zen-gitsync 2.17.19 → 2.17.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.
Files changed (54) hide show
  1. package/package.json +1 -1
  2. package/src/config.js +3 -0
  3. package/src/ui/public/assets/{AgentEngineSelector-j7LYtcCD.js → AgentEngineSelector-DIn2efUS.js} +1 -1
  4. package/src/ui/public/assets/AgentView-CS-sFe-x.js +10 -0
  5. package/src/ui/public/assets/{AgentView-phgvR10P.css → AgentView-CWCc_b0o.css} +1 -1
  6. package/src/ui/public/assets/{AppVersionBadge-eo7ROtED.js → AppVersionBadge-CeHsanRP.js} +2 -2
  7. package/src/ui/public/assets/{BranchSelector-BwrAEUNg.js → BranchSelector-CxEoHp2q.js} +1 -1
  8. package/src/ui/public/assets/{CommitForm-BIx30QyK.js → CommitForm-DOfYuDqr.js} +1 -1
  9. package/src/ui/public/assets/{CommonDialog-CXmqa6q4.js → CommonDialog-CZ5McwHT.js} +1 -1
  10. package/src/ui/public/assets/EditorView-BZjWMYYl.css +1 -0
  11. package/src/ui/public/assets/EditorView-BxRrHGUj.js +31 -0
  12. package/src/ui/public/assets/{FileDiffViewer-DXnoEMNi.js → FileDiffViewer-CKcSkMAd.js} +1 -1
  13. package/src/ui/public/assets/{FlowExecutionViewer-D_pSWT0R.js → FlowExecutionViewer-DShoSVO7.js} +1 -1
  14. package/src/ui/public/assets/{FlowOrchestrationWorkspace-CcG6dBBg.js → FlowOrchestrationWorkspace-BkPZZ0-D.js} +1 -1
  15. package/src/ui/public/assets/{IconButton-jqB5gLxI.js → IconButton-D-maDWg7.js} +1 -1
  16. package/src/ui/public/assets/{LogList-CtrKeYUA.js → LogList-Bv5ZqdMf.js} +1 -1
  17. package/src/ui/public/assets/{MindmapView-DUWUbAgc.js → MindmapView-C27U_5_C.js} +1 -1
  18. package/src/ui/public/assets/{MonitorView-CLW2-HBy.js → MonitorView-BudY0fTU.js} +1 -1
  19. package/src/ui/public/assets/{ProjectStartupButton-CErZT4zR.js → ProjectStartupButton-YJPcfS3t.js} +1 -1
  20. package/src/ui/public/assets/RecentDirectoriesChat-Bqd_4eU5.js +1 -0
  21. package/src/ui/public/assets/RecentDirectoriesChat-CZD_IC5M.css +1 -0
  22. package/src/ui/public/assets/{RemoteManagerDialog-sksn2MmQ.js → RemoteManagerDialog-BUNLKNem.js} +1 -1
  23. package/src/ui/public/assets/{RemoteRepoCard-Cz_aoLZb.js → RemoteRepoCard-Bq1oLUnZ.js} +1 -1
  24. package/src/ui/public/assets/{SourceMapView-D5qkdXhn.js → SourceMapView-BCrE4CvT.js} +1 -1
  25. package/src/ui/public/assets/{SvgIcon-D54dZy2f.js → SvgIcon-z4ExzvGR.js} +1 -1
  26. package/src/ui/public/assets/{TemplateManager-DRHRpB64.js → TemplateManager-BSq-dNvW.js} +1 -1
  27. package/src/ui/public/assets/{UserInputNode-C4NV2vaL.js → UserInputNode-BzbaR9lE.js} +1 -1
  28. package/src/ui/public/assets/WorkbenchView-BJ7lMt3C.js +70 -0
  29. package/src/ui/public/assets/WorkbenchView-DGIn0UR4.css +1 -0
  30. package/src/ui/public/assets/{_plugin-vue_export-helper-Ut942ckG.js → _plugin-vue_export-helper-o8uPiAjs.js} +5 -5
  31. package/src/ui/public/assets/{agentConversations-C2864Cya.js → agentConversations-BmOPFH_t.js} +2 -2
  32. package/src/ui/public/assets/configStore-DrMJDegh.js +1 -0
  33. package/src/ui/public/assets/{flow-mindmap-DnzM9SlK.css → flow-mindmap-BMpmHdqh.css} +1 -1
  34. package/src/ui/public/assets/flow-mindmap-C22NSZc1.js +257 -0
  35. package/src/ui/public/assets/{gitStore-DyaXgTSR.js → gitStore-BI_ujQ9r.js} +1 -1
  36. package/src/ui/public/assets/index-Cp5WtCfY.css +1 -0
  37. package/src/ui/public/assets/{index-Dq6OyCrE.js → index-D_Pwvey4.js} +61 -58
  38. package/src/ui/public/assets/{previewSandbox-D2ioUBVm.js → previewSandbox-B16xvZLS.js} +0 -0
  39. package/src/ui/public/assets/previewSandbox-PYnM6Paz.css +1 -0
  40. package/src/ui/public/assets/{toolsStore-DrPVMxvn.js → toolsStore-DgqU92bI.js} +1 -1
  41. package/src/ui/public/assets/{vendor-B5GNSK12.js → vendor-CPpc-p6F.js} +256 -106
  42. package/src/ui/public/index.html +16 -16
  43. package/src/ui/server/routes/fs.js +98 -0
  44. package/src/ui/public/assets/AgentView-B8zgTjEM.js +0 -10
  45. package/src/ui/public/assets/EditorView-Bo176FOY.js +0 -31
  46. package/src/ui/public/assets/EditorView-D10uW5AV.css +0 -1
  47. package/src/ui/public/assets/RecentDirectoriesChat-CO7G6tRt.css +0 -1
  48. package/src/ui/public/assets/RecentDirectoriesChat-cVsO1elA.js +0 -1
  49. package/src/ui/public/assets/WorkbenchView-B3VcBlk7.js +0 -70
  50. package/src/ui/public/assets/WorkbenchView-ZDvzGafG.css +0 -1
  51. package/src/ui/public/assets/configStore-DG0VBR3h.js +0 -1
  52. package/src/ui/public/assets/flow-mindmap-j-zhcNPe.js +0 -139
  53. package/src/ui/public/assets/index-B5MKbT-v.css +0 -1
  54. package/src/ui/public/assets/previewSandbox-CxLaNg4X.css +0 -1
@@ -10,38 +10,38 @@
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-Dq6OyCrE.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-D_Pwvey4.js"></script>
14
14
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C0FnF6B9.js">
15
15
  <link rel="modulepreload" crossorigin href="/assets/element-plus-AaVXaSqv.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/monaco-DkJuNcCr.js">
17
- <link rel="modulepreload" crossorigin href="/assets/vendor-B5GNSK12.js">
18
- <link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-Ut942ckG.js">
19
- <link rel="modulepreload" crossorigin href="/assets/SvgIcon-D54dZy2f.js">
20
- <link rel="modulepreload" crossorigin href="/assets/IconButton-jqB5gLxI.js">
21
- <link rel="modulepreload" crossorigin href="/assets/configStore-DG0VBR3h.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/vendor-CPpc-p6F.js">
18
+ <link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-o8uPiAjs.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/SvgIcon-z4ExzvGR.js">
20
+ <link rel="modulepreload" crossorigin href="/assets/IconButton-D-maDWg7.js">
21
+ <link rel="modulepreload" crossorigin href="/assets/configStore-DrMJDegh.js">
22
22
  <link rel="modulepreload" crossorigin href="/assets/socket-io-BFqQXqAp.js">
23
- <link rel="modulepreload" crossorigin href="/assets/gitStore-DyaXgTSR.js">
23
+ <link rel="modulepreload" crossorigin href="/assets/gitStore-BI_ujQ9r.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/fileIcon-B5p5pGN9.js">
25
- <link rel="modulepreload" crossorigin href="/assets/flow-mindmap-j-zhcNPe.js">
26
- <link rel="modulepreload" crossorigin href="/assets/previewSandbox-D2ioUBVm.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/flow-mindmap-C22NSZc1.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/previewSandbox-B16xvZLS.js">
27
27
  <link rel="modulepreload" crossorigin href="/assets/useThemeObserver-CiUpR4zj.js">
28
- <link rel="modulepreload" crossorigin href="/assets/CommonDialog-CXmqa6q4.js">
29
- <link rel="modulepreload" crossorigin href="/assets/FileDiffViewer-DXnoEMNi.js">
30
- <link rel="modulepreload" crossorigin href="/assets/toolsStore-DrPVMxvn.js">
31
- <link rel="modulepreload" crossorigin href="/assets/TemplateManager-DRHRpB64.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/CommonDialog-CZ5McwHT.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/FileDiffViewer-CKcSkMAd.js">
30
+ <link rel="modulepreload" crossorigin href="/assets/toolsStore-DgqU92bI.js">
31
+ <link rel="modulepreload" crossorigin href="/assets/TemplateManager-BSq-dNvW.js">
32
32
  <link rel="modulepreload" crossorigin href="/assets/vue-flow-DwYB6Myr.js">
33
33
  <link rel="stylesheet" crossorigin href="/assets/element-plus-Qexo5hiM.css">
34
34
  <link rel="stylesheet" crossorigin href="/assets/monaco-B2lPvkrc.css">
35
35
  <link rel="stylesheet" crossorigin href="/assets/vendor-BzMymUBi.css">
36
36
  <link rel="stylesheet" crossorigin href="/assets/SvgIcon-CDNsk4-Q.css">
37
37
  <link rel="stylesheet" crossorigin href="/assets/IconButton-RlXqKOeu.css">
38
- <link rel="stylesheet" crossorigin href="/assets/flow-mindmap-DnzM9SlK.css">
39
- <link rel="stylesheet" crossorigin href="/assets/previewSandbox-CxLaNg4X.css">
38
+ <link rel="stylesheet" crossorigin href="/assets/flow-mindmap-BMpmHdqh.css">
39
+ <link rel="stylesheet" crossorigin href="/assets/previewSandbox-PYnM6Paz.css">
40
40
  <link rel="stylesheet" crossorigin href="/assets/CommonDialog-w6EmBEXv.css">
41
41
  <link rel="stylesheet" crossorigin href="/assets/FileDiffViewer-n5ea9qMe.css">
42
42
  <link rel="stylesheet" crossorigin href="/assets/TemplateManager-DO7EPfj8.css">
43
43
  <link rel="stylesheet" crossorigin href="/assets/vue-flow-CavUTEzp.css">
44
- <link rel="stylesheet" crossorigin href="/assets/index-B5MKbT-v.css">
44
+ <link rel="stylesheet" crossorigin href="/assets/index-Cp5WtCfY.css">
45
45
  </head>
46
46
  <body>
47
47
  <div id="app"></div>
@@ -354,6 +354,104 @@ export function registerFsRoutes({
354
354
  }
355
355
  }));
356
356
 
357
+ // 一次性取回"根目录 + 已展开子目录"的整棵可见子树,供前端静默刷新文件树。
358
+ //
359
+ // 为什么不复用 GET /api/browse_directory 逐目录并发请求:树展开得越深,请求数越多
360
+ // (多级展开会有十几个到几十个),一轮刷新要等最慢的那个;中途还会出现"部分目录
361
+ // 已刷新、部分没刷"的中间态。这里一次往返把已展开的部分整棵读回来,前端按 path
362
+ // 对账(内容没变就完全不碰 DOM),所以刷新是静默的。
363
+ //
364
+ // 请求体:{ path: 根目录绝对路径, expand?: string[] 已展开目录的绝对路径 }
365
+ // 响应:{ success, items: [...] },只有 expand 里列出的目录才带 children
366
+ // —— 展开态由前端提供,后端不猜,避免把整盘目录读爆。
367
+ const MAX_TREE_EXPAND_DIRS = 200;
368
+
369
+ app.post('/api/browse_directory_tree', express.json(), asyncRoute(async (req, res) => {
370
+ const rawRoot = req.body?.path;
371
+ if (typeof rawRoot !== 'string' || !rawRoot.trim()) {
372
+ res.status(400).json({ success: false, error: '缺少 path 参数' });
373
+ return;
374
+ }
375
+ const rootPath = path.resolve(rawRoot);
376
+
377
+ // 只接受根目录之下的路径:既挡越权(前端传个 C:\Windows 进来),
378
+ // 也顺手挡掉路径拼错。Windows 下比较要忽略大小写。
379
+ const normalize = (p) => (process.platform === 'win32' ? p.toLowerCase() : p);
380
+ const normRoot = normalize(rootPath);
381
+ const rootPrefix = normRoot.endsWith(path.sep) ? normRoot : normRoot + path.sep;
382
+ const expandSet = new Set();
383
+ const rawExpand = Array.isArray(req.body?.expand) ? req.body.expand : [];
384
+ for (const p of rawExpand.slice(0, MAX_TREE_EXPAND_DIRS)) {
385
+ if (typeof p !== 'string' || !p.trim()) continue;
386
+ const resolved = path.resolve(p);
387
+ const normResolved = normalize(resolved);
388
+ if (normResolved === normRoot || normResolved.startsWith(rootPrefix)) {
389
+ expandSet.add(resolved);
390
+ }
391
+ }
392
+
393
+ // 读一层目录,排序口径与 GET /api/browse_directory 保持一致(目录在前,各自按名排)。
394
+ async function readDirEntries(dirPath) {
395
+ const entries = await fs.readdir(dirPath, { withFileTypes: true });
396
+ const directories = [];
397
+ const files = [];
398
+ for (const item of entries) {
399
+ const fullPath = path.join(dirPath, item.name);
400
+ if (item.isDirectory()) {
401
+ directories.push({ name: item.name, path: fullPath, type: 'directory' });
402
+ } else if (item.isFile()) {
403
+ files.push({ name: item.name, path: fullPath, type: 'file' });
404
+ }
405
+ }
406
+ directories.sort((a, b) => a.name.localeCompare(b.name));
407
+ files.sort((a, b) => a.name.localeCompare(b.name));
408
+ return [...directories, ...files];
409
+ }
410
+
411
+ try {
412
+ // 根目录读不到就老实报错,让前端保留旧树 —— 不能返回空树,
413
+ // 否则一次瞬时 IO 失败会把用户已展开的整棵树清空。
414
+ const rootEntries = await readDirEntries(rootPath);
415
+ const contents = new Map([[rootPath, rootEntries]]);
416
+
417
+ // 逐层(BFS)并行读取:frontier 是"已经拿到内容、还要继续往下读"的目录。
418
+ let frontier = [rootPath];
419
+ while (frontier.length > 0) {
420
+ await Promise.all(frontier.map(async (dir) => {
421
+ try {
422
+ contents.set(dir, await readDirEntries(dir));
423
+ } catch {
424
+ // 单个子目录读失败(权限 / 刚被删掉)—— 退化成空目录,不让整次刷新失败。
425
+ // 轮询刷新是后台行为,不该因为一个坏目录把用户已展开的树整个清掉。
426
+ contents.set(dir, []);
427
+ }
428
+ }));
429
+ const next = [];
430
+ for (const dir of frontier) {
431
+ for (const item of contents.get(dir)) {
432
+ if (item.type === 'directory' && expandSet.has(item.path) && !contents.has(item.path)) {
433
+ next.push(item.path);
434
+ }
435
+ }
436
+ }
437
+ frontier = next;
438
+ }
439
+
440
+ const build = (dir) => contents.get(dir).map((item) => (
441
+ item.type === 'directory' && contents.has(item.path)
442
+ ? { ...item, children: build(item.path) }
443
+ : item
444
+ ));
445
+
446
+ res.json({ success: true, currentPath: rootPath, items: build(rootPath) });
447
+ } catch (error) {
448
+ res.status(400).json({
449
+ success: false,
450
+ error: `无法读取目录 "${rootPath}": ${error.message}`
451
+ });
452
+ }
453
+ }));
454
+
357
455
  // 获取最近访问的目录列表
358
456
  app.get('/api/recent_directories', asyncRoute(async (req, res) => {
359
457
  try {
@@ -1,10 +0,0 @@
1
- import"./rolldown-runtime-C0FnF6B9.js";import{$ as e,A as t,Bt as n,Cn as r,Ct as i,Dn as a,Dt as o,En as s,Fr as c,H as l,Jr as u,K as d,Mn as f,Ot as p,Pn as m,Q as h,Qn as g,Rn as _,Tn as v,Un as y,Ut as ee,Xn as b,Xr as x,a as S,at as C,br as w,cr as T,ei as E,ft as D,hn as O,i as k,j as A,jn as j,ln as M,lr as N,o as P,or as F,pr as I,qt as te,rn as L,st as R,tr as z,vr as B,wn as V,yn as H}from"./element-plus-AaVXaSqv.js";import{r as ne,t as re}from"./vendor-B5GNSK12.js";import{n as U,t as W}from"./_plugin-vue_export-helper-Ut942ckG.js";import{t as ie}from"./configStore-DG0VBR3h.js";import{t as G}from"./CommonDialog-CXmqa6q4.js";import{a as ae,i as oe,n as se,o as ce,r as le,t as ue}from"./agentConversations-C2864Cya.js";import{n as de,t as fe}from"./AgentEngineSelector-j7LYtcCD.js";_(),I();var K=m({__name:`MarketplacePanel`,props:{type:{type:String,required:!0}},setup(t,{expose:i}){i();let a=t,s=ie(),c=w([]),l=w([]),u=w(!1),d=w(``),f=w(``),p=w([]),m=w(`project`),h=w(new Set),g=w(new Set),_=r(()=>s.currentDirectory||``),v=null;async function y(){if(!u.value){u.value=!0;try{let e=new URLSearchParams({type:a.type,cwd:_.value});f.value&&e.set(`q`,f.value),p.value.length&&e.set(`sources`,p.value.join(`,`));let t=await(await fetch(`/api/agent/marketplace/catalog?${e}`)).json();t?.success?(c.value=t.groups||[],l.value=t.installed||[]):S.error(t?.error||U(`@MKT:加载失败`))}catch{S.error(U(`@MKT:加载失败`))}finally{u.value=!1}}}F(d,e=>{v&&clearTimeout(v),v=setTimeout(()=>{f.value=e.trim(),y()},400)}),F(p,()=>y()),F(()=>a.type,()=>{p.value=[],f.value=``,d.value=``,y()}),F(_,()=>y()),y();let b=r(()=>{let e=_.value?_.value.split(/[\\/]/).filter(Boolean).pop():``;return m.value===`project`?e||U(`@MKT:当前项目`):U(`@MKT:g ai 智能体`)});function x(e){return e.stars?`${C(e.stars)} ★`:e.downloads?`${C(e.downloads)} ${U(`@MKT:周下载`)}`:e.uses?`${C(e.uses)} ${U(`@MKT:次使用`)}`:``}function C(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function T(e){return`${e.id}`}function E(e){return h.value.has(T(e))}let O=r(()=>{let e={project:[],global:[]};for(let t of l.value)(e[t.target]||=[]).push(t);return e}),A=B({visible:!1,item:null,env:{},args:``});function j(e){return a.type===`mcp`&&(!!e.envKeys?.length||!!e.args?.length)}function M(e){A.item=e,A.env=Object.fromEntries((e.envKeys||[]).map(e=>[e,``])),A.args=(e.args||[]).join(` `),A.visible=!0}function N(){let e=A.item;if(A.visible=!1,!e)return;let t=Object.fromEntries(Object.entries(A.env).filter(([,e])=>e.trim()!==``)),n=A.args.trim()?A.args.trim().match(/(?:[^\s"]+|"[^"]*")+/g)?.map(e=>e.replace(/^"|"$/g,``))??void 0:void 0;I(e,{env:t,...n?{args:n}:{}})}async function P(e){if(!e.installed||await z(e)){if(j(e)){M(e);return}await I(e,{})}}async function I(e,t){let n=T(e);h.value.add(n);try{let n=await fetch(`/api/agent/marketplace/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:a.type,target:m.value,cwd:_.value,item:{...e,...t}})}),r=await n.json().catch(()=>null);if(!n.ok||!r?.success){S.error(r?.error||U(`@MKT:安装失败`));return}r.item?.warning&&S.warning(r.item.warning),r.item?.envKeys?.length?S.warning(`${U(`@MKT:还缺环境变量`)}: ${r.item.envKeys.join(`, `)}`):S.success(U(`@MKT:安装成功`)),await y()}catch{S.error(U(`@MKT:安装失败`))}finally{h.value.delete(n)}}async function z(e){try{return await k.confirm(`${e.name} ${U(`@MKT:已安装,要重新安装吗?`)}`,U(`@MKT:重新安装`),{confirmButtonText:U(`@MKT:重装`),cancelButtonText:U(`@MKT:取消`),type:`warning`}),!0}catch{return!1}}async function V(e){try{await k.confirm(`${U(`@MKT:确定卸载`)} ${e.name}?`,U(`@MKT:卸载`),{confirmButtonText:U(`@MKT:卸载`),cancelButtonText:U(`@MKT:取消`),type:`warning`})}catch{return}let t=`${e.target}:${e.id}`;g.value.add(t);try{let t=new URLSearchParams({target:e.target,cwd:_.value}),n=await fetch(`/api/agent/marketplace/item/${a.type}/${encodeURIComponent(e.id)}?${t}`,{method:`DELETE`}),r=await n.json().catch(()=>null);if(!n.ok||!r?.success){S.error(r?.error||U(`@MKT:卸载失败`));return}S.success(U(`@MKT:已卸载`)),await y()}catch{S.error(U(`@MKT:卸载失败`))}finally{g.value.delete(t)}}let H={props:a,configStore:s,groups:c,installed:l,loading:u,searchInput:d,query:f,selectedSources:p,installTarget:m,installing:h,removing:g,cwd:_,get searchTimer(){return v},set searchTimer(e){v=e},loadCatalog:y,targetLabel:b,metricText:x,formatCount:C,cardKey:T,isBusy:E,installedByTarget:O,configDialog:A,needsConfig:j,openConfigDialog:M,confirmConfig:N,onInstall:P,doInstall:I,confirmReinstall:z,onRemove:V,get $t(){return U},get Search(){return ee},get Refresh(){return n},get Delete(){return R},get Link(){return o},get Check(){return e},get Star(){return te},get Download(){return D},get Warning(){return L},CommonDialog:G};return Object.defineProperty(H,"__isScriptSetup",{enumerable:!1,value:!0}),H}});_(),M(),c();var q={class:`marketplace-panel`},J={class:`mp-toolbar`},Y={class:`mp-search`},pe=[`placeholder`],X={class:`mp-toolbar-sub`},Z={class:`mp-target-hint`},Q={class:`mp-source-filter`},me=[`onClick`],$={class:`mp-body`},he={class:`mp-group-header`},ge={class:`mp-group-title`},_e={key:0,class:`mp-group-count`},ve={key:1,class:`mp-group-error`},ye=[`href`,`title`],be={key:0,class:`mp-grid`},xe={class:`mp-card-head`},Se=[`title`],Ce={key:0,class:`mp-card-metric`},we=[`title`],Te={class:`mp-card-meta`},Ee=[`title`],De=[`title`],Oe={key:2,class:`mp-tag remote`},ke={class:`mp-card-foot`},Ae=[`href`],je={key:1,class:`mp-installed-chip`},Me=[`disabled`,`onClick`],Ne={key:3,class:`mp-not-installable`},Pe={key:1,class:`mp-empty`},Fe={key:0,class:`mp-group installed`},Ie={class:`mp-group-header`},Le={class:`mp-group-title`},Re={class:`mp-group-count`},ze={key:0,class:`mp-installed-block`},Be={class:`mp-installed-target`},Ve={class:`mp-installed-list`},He={class:`mp-installed-name`},Ue={key:0,class:`mp-meta-pkg`},We={key:1,class:`mp-tag warn`},Ge=[`disabled`,`onClick`],Ke={key:1,class:`mp-empty all`},qe={key:0,class:`mkt-form`},Je={class:`mkt-form-name`},Ye=[`onUpdate:modelValue`,`placeholder`],Xe={key:0,class:`mkt-field`},Ze={class:`mkt-hint`};function Qe(e,n,r,i,o,c){let p=d,m=t,h=A,_=l,y=P;return b(),a(`div`,q,[s(` ── 工具栏 ───────────────────────────────── `),V(`div`,J,[V(`div`,Y,[f(p,{class:`mp-search-icon`},{default:T(()=>[f(i.Search)]),_:1}),N(V(`input`,{"onUpdate:modelValue":n[0]||=e=>i.searchInput=e,class:`mp-search-input`,type:`text`,placeholder:r.type===`skill`?i.$t(`@MKT:搜索 Skill...`):i.$t(`@MKT:搜索 MCP 服务...`)},null,8,pe),[[O,i.searchInput]])]),f(h,{modelValue:i.installTarget,"onUpdate:modelValue":n[1]||=e=>i.installTarget=e,size:`small`,class:`mp-target`},{default:T(()=>[f(m,{value:`project`},{default:T(()=>[j(E(i.$t(`@MKT:当前项目`)),1)]),_:1}),f(m,{value:`global`},{default:T(()=>[j(E(i.$t(`@MKT:g ai 智能体`)),1)]),_:1})]),_:1},8,[`modelValue`]),f(_,{content:i.$t(`@MKT:刷新`),placement:`top`,"show-after":300},{default:T(()=>[V(`button`,{class:u([`mp-refresh`,{spinning:i.loading}]),onClick:i.loadCatalog},[f(p,null,{default:T(()=>[f(i.Refresh)]),_:1})],2)]),_:1},8,[`content`])]),V(`div`,X,[V(`span`,Z,[j(E(i.$t(`@MKT:安装到`))+` `,1),V(`b`,null,E(i.targetLabel),1)]),V(`div`,Q,[(b(!0),a(H,null,g(i.groups,e=>(b(),a(`button`,{key:e.id,class:u([`mp-chip`,{active:i.selectedSources.includes(e.id)}]),onClick:()=>{let t=i.selectedSources.indexOf(e.id);t>=0?i.selectedSources.splice(t,1):i.selectedSources.push(e.id)}},E(e.label),11,me))),128)),i.selectedSources.length?(b(),a(`button`,{key:0,class:`mp-chip clear`,onClick:n[2]||=e=>i.selectedSources=[]},E(i.$t(`@MKT:全部来源`)),1)):s(`v-if`,!0)])]),s(` ── 内容 ─────────────────────────────────── `),N((b(),a(`div`,$,[(b(!0),a(H,null,g(i.groups,e=>(b(),a(`section`,{key:e.id,class:`mp-group`},[V(`header`,he,[V(`h3`,ge,E(e.label),1),e.status===`ok`?(b(),a(`span`,_e,E(e.items.length),1)):(b(),a(`span`,ve,[f(p,null,{default:T(()=>[f(i.Warning)]),_:1}),j(` `+E(e.error||i.$t(`@MKT:来源不可用`)),1)])),e.homepage?(b(),a(`a`,{key:2,class:`mp-group-link`,href:e.homepage,target:`_blank`,rel:`noopener noreferrer`,title:e.homepage},[f(p,null,{default:T(()=>[f(i.Link)]),_:1})],8,ye)):s(`v-if`,!0)]),e.status===`ok`&&e.items.length?(b(),a(`div`,be,[(b(!0),a(H,null,g(e.items,e=>(b(),a(`article`,{key:i.cardKey(e),class:`mp-card`},[V(`div`,xe,[V(`span`,{class:`mp-card-name`,title:e.name},E(e.name),9,Se),i.metricText(e)?(b(),a(`span`,Ce,[f(p,null,{default:T(()=>[e.stars?(b(),v(i.Star,{key:0})):(b(),v(i.Download,{key:1}))]),_:2},1024),j(` `+E(i.metricText(e)),1)])):s(`v-if`,!0)]),V(`p`,{class:`mp-card-desc`,title:e.description},E(e.description||i.$t(`@MKT:暂无描述`)),9,we),V(`div`,Te,[e.package?(b(),a(`code`,{key:0,class:`mp-meta-pkg`,title:e.package},E(e.package),9,Ee)):e.repository?(b(),a(`span`,{key:1,class:`mp-meta-repo`,title:e.repository+(e.subpath?` · `+e.subpath:``)},[j(E(e.repository),1),e.subpath?(b(),a(H,{key:0},[j(` · `+E(e.subpath),1)],64)):s(`v-if`,!0)],8,De)):s(`v-if`,!0),e.transport===`remote`?(b(),a(`span`,Oe,E(i.$t(`@MKT:远程服务`)),1)):s(`v-if`,!0),(b(!0),a(H,null,g((e.tags||[]).slice(0,2),e=>(b(),a(`span`,{key:e,class:`mp-tag`},E(e),1))),128))]),V(`div`,ke,[e.upstream?(b(),a(`a`,{key:0,class:`mp-card-link`,href:e.upstream,target:`_blank`,rel:`noopener noreferrer`},E(i.$t(`@MKT:查看来源`)),9,Ae)):s(`v-if`,!0),n[6]||=V(`span`,{class:`mp-foot-spacer`},null,-1),e.installed?(b(),a(`span`,je,[f(p,null,{default:T(()=>[f(i.Check)]),_:1}),j(E(i.$t(`@MKT:已安装`)),1)])):e.installable===!1?(b(),a(`span`,Ne,E(i.$t(`@MKT:暂不支持一键安装`)),1)):(b(),a(`button`,{key:2,class:`mp-install-btn`,disabled:i.isBusy(e),onClick:t=>i.onInstall(e)},E(i.isBusy(e)?i.$t(`@MKT:安装中...`):i.$t(`@MKT:安装`)),9,Me))])]))),128))])):e.status===`ok`?(b(),a(`div`,Pe,E(i.$t(`@MKT:该来源暂无结果`)),1)):s(`v-if`,!0)]))),128)),s(` ── 已安装 ─────────────────────────────── `),i.installed.length?(b(),a(`section`,Fe,[V(`header`,Ie,[V(`h3`,Le,E(i.$t(`@MKT:已安装`)),1),V(`span`,Re,E(i.installed.length),1)]),(b(),a(H,null,g([`project`,`global`],e=>V(`div`,{key:e},[i.installedByTarget[e]?.length?(b(),a(`div`,ze,[V(`div`,Be,E(e===`project`?i.$t(`@MKT:当前项目`):i.$t(`@MKT:g ai 智能体`)),1),V(`div`,Ve,[(b(!0),a(H,null,g(i.installedByTarget[e],t=>(b(),a(`div`,{key:e+t.id,class:`mp-installed-row`},[V(`span`,He,E(t.name),1),t.package?(b(),a(`code`,Ue,E(t.package),1)):s(`v-if`,!0),t.requiredEnv?.length?(b(),a(`span`,We,E(i.$t(`@MKT:待配置`))+`: `+E(t.requiredEnv.join(`, `)),1)):s(`v-if`,!0),n[7]||=V(`span`,{class:`mp-foot-spacer`},null,-1),V(`button`,{class:`mp-remove-btn`,disabled:i.removing.has(e+t.id),onClick:e=>i.onRemove(t)},[f(p,null,{default:T(()=>[f(i.Delete)]),_:1}),j(` `+E(i.removing.has(e+t.id)?i.$t(`@MKT:卸载中...`):i.$t(`@MKT:卸载`)),1)],8,Ge)]))),128))])])):s(`v-if`,!0)])),64))])):s(`v-if`,!0),!i.loading&&!i.groups.length?(b(),a(`div`,Ke,E(i.$t(`@MKT:加载失败`)),1)):s(`v-if`,!0)])),[[y,i.loading]]),s(` ── MCP 安装前配置 ───────────────────────── `),f(i.CommonDialog,{modelValue:i.configDialog.visible,"onUpdate:modelValue":n[5]||=e=>i.configDialog.visible=e,title:i.$t(`@MKT:配置 MCP`),width:`460px`,type:`flex`,"close-on-click-modal":!1,"append-to-body":``},{footer:T(()=>[V(`button`,{class:`mkt-cancel`,onClick:n[4]||=e=>i.configDialog.visible=!1},E(i.$t(`@MKT:取消`)),1),V(`button`,{class:`mkt-confirm`,onClick:i.confirmConfig},E(i.$t(`@MKT:安装`)),1)]),default:T(()=>[i.configDialog.item?(b(),a(`div`,qe,[V(`p`,Je,E(i.configDialog.item.name),1),(b(!0),a(H,null,g(Object.keys(i.configDialog.env),e=>(b(),a(`div`,{key:e,class:`mkt-field`},[V(`label`,null,E(e),1),N(V(`input`,{"onUpdate:modelValue":t=>i.configDialog.env[e]=t,type:`text`,autocomplete:`off`,placeholder:i.$t(`@MKT:环境变量值`),spellcheck:`false`},null,8,Ye),[[O,i.configDialog.env[e]]])]))),128)),i.configDialog.item.args?.length?(b(),a(`div`,Xe,[V(`label`,null,E(i.$t(`@MKT:启动参数`)),1),N(V(`input`,{"onUpdate:modelValue":n[3]||=e=>i.configDialog.args=e,type:`text`,autocomplete:`off`,spellcheck:`false`},null,512),[[O,i.configDialog.args]]),V(`p`,Ze,E(i.$t(`@MKT:参数提示`)),1)])):s(`v-if`,!0)])):s(`v-if`,!0)]),_:1},8,[`modelValue`,`title`])])}var $e=W(K,[[`render`,Qe],[`__scopeId`,`data-v-e9f9e851`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/MarketplacePanel.vue`]]);_(),I();var et=m({__name:`AgentView`,setup(e,{expose:t}){t();let n=ie(),a=w(null),{narrow:o}=de(a),s=w(`chat`),c=w(`chat`),l=r(()=>c.value===`mcp`?`mcp`:`skill`),u=r(()=>[{id:`chat`,label:U(`@AGENT:对话`),icon:h},{id:`skill`,label:U(`@AGENT:Skill 广场`),icon:i},{id:`mcp`,label:U(`@AGENT:MCP 广场`),icon:C}]),{sessions:f,sessionsLoading:m,currentSessionId:g,messages:_,isStreaming:v,sessionLoading:ee,loadSessions:b,loadSession:x,deleteSession:S,renameSession:T,newSession:E,sendMessage:D,pendingQuestion:O,answeringQuestion:k,answerQuestion:A,isSessionGenerating:j,currentEngine:M,pendingEngine:N,isEngineLocked:P,pickEngine:I,stop:te}=ce(),L=r(()=>P.value?M.value:N.value);function R(e){P.value||I(e)}let z=r(()=>{let e=n.theme;return e===`dark`||e===`auto`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}),B=r(()=>oe(f.value,j)),V=se(),H=r(()=>B.value.find(e=>e.id===g.value)?.title||U(`@AGENT:对话`)),W=r(()=>[{id:`p1`,label:U(`@AGENT:查看项目结构`),prompt:U(`@AGENT:prompt_p1`)},{id:`p2`,label:U(`@AGENT:分析代码质量`),prompt:U(`@AGENT:prompt_p2`)},{id:`p3`,label:U(`@AGENT:帮我写测试`),prompt:U(`@AGENT:prompt_p3`)},{id:`p4`,label:U(`@AGENT:Git 状态检查`),prompt:U(`@AGENT:prompt_p4`)},{id:`p5`,label:U(`@AGENT:帮我启动项目`),prompt:U(`@AGENT:prompt_p5`)}]);async function G(e){await D(e.text,e.files),await y(),Y()}async function K(e){await D(e.prompt),await y(),Y()}let q=le(),J=w(null);function Y(e=!0){J.value?.scrollToBottom(e)}F(()=>_.value.length,()=>{y(()=>Y(!1))});function pe(e){x(e),s.value=`chat`}function X(){E(),s.value=`chat`}let Z=w(280),Q=w(!1);function me(e){Q.value=!0;let t=e.clientX,n=Z.value,r=e=>{let r=e.clientX-t,i=Math.max(200,Math.min(500,n+r));Z.value=i},i=()=>{Q.value=!1,document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}F(o,e=>{e||(s.value=`chat`)}),F(()=>[n.currentDirectory,v.value],async([e,t],n)=>{let r=!n||e!==n[0],i=!!n&&n[1]===!0&&!t;(r||i)&&await b(),g.value&&!v.value&&!f.value.some(e=>e.sessionId===g.value)&&E()},{immediate:!0});let $={configStore:n,rootRef:a,narrow:o,chatPage:s,activeTab:c,marketplaceType:l,tabs:u,sessions:f,sessionsLoading:m,currentSessionId:g,messages:_,isStreaming:v,sessionLoading:ee,loadSessions:b,loadSession:x,deleteSession:S,renameSession:T,newSession:E,sendMessage:D,pendingQuestion:O,answeringQuestion:k,answerQuestion:A,isSessionGenerating:j,currentEngine:M,pendingEngine:N,isEngineLocked:P,pickEngine:I,stop:te,displayEngine:L,handleEngineSelect:R,chatTheme:z,conversationItems:B,conversationLabels:V,currentSessionTitle:H,presetQuestions:W,onSend:G,onSelectPreset:K,questionLabels:q,chatContainerRef:J,scrollToBottom:Y,selectSession:pe,handleNewSession:X,sidebarWidth:Z,isResizing:Q,startResize:me,get $t(){return U},get ElIcon(){return d},get Loading(){return p},get ChatContainer(){return re},get ConversationList(){return ne},get AGENT_UPLOAD_ACCEPT(){return ae},get AGENT_ASSISTANT_NAME(){return ue},MarketplacePanel:$e,AgentEngineSelector:fe};return Object.defineProperty($,"__isScriptSetup",{enumerable:!1,value:!0}),$}});_(),c();var tt={ref:`rootRef`,class:`agent-view`},nt={class:`agent-chat-area`},rt={class:`agent-tabs`,role:`tablist`},it=[`aria-selected`,`onClick`],at={class:`agent-tab-body`},ot={key:0,class:`agent-chat-pane`},st={key:0,class:`agent-list-page`},ct={key:0,class:`agent-page-bar`},lt=[`title`,`aria-label`],ut={class:`agent-page-title`},dt={class:`agent-chat-host`},ft={key:0,class:`chat-loading`};function pt(e,t,n,r,i,o){return b(),a(`div`,tt,[s(` ═══ 宽屏:左侧会话列表(只在「对话」Tab 显示)═══
2
- 窄屏时这一整块不渲染,会话列表改成 body 里的一个整页(见 .agent-list-page) `),r.activeTab===`chat`&&!r.narrow?(b(),a(H,{key:0},[V(`aside`,{class:`agent-sidebar`,style:x({width:r.sidebarWidth+`px`})},[s(` 会话列表:UI 与交互都在组件库的 ConversationList 里 `),f(r.ConversationList,{class:`agent-conversations`,items:r.conversationItems,"active-id":r.currentSessionId,loading:r.sessionsLoading,labels:r.conversationLabels,onSelect:r.selectSession,onNew:r.handleNewSession,onRename:r.renameSession,onDelete:r.deleteSession},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])],4),s(` 拖拽分隔条 `),V(`div`,{class:u([`sidebar-resizer`,{active:r.isResizing}]),onMousedown:r.startResize},null,34)],64)):s(`v-if`,!0),s(` ═══ 右侧:Tab 栏 + 内容区 ═══ `),V(`main`,nt,[V(`nav`,rt,[(b(!0),a(H,null,g(r.tabs,e=>(b(),a(`button`,{key:e.id,type:`button`,class:u([`agent-tab`,{active:r.activeTab===e.id}]),role:`tab`,"aria-selected":r.activeTab===e.id,onClick:t=>r.activeTab=e.id},[f(r.ElIcon,null,{default:T(()=>[(b(),v(z(e.icon)))]),_:2},1024),V(`span`,null,E(e.label),1)],10,it))),128)),s(` ═══ 引擎选择器 ═══
3
- 与工作台执行器下拉同一套交互(点击展开、未安装标出来、点了直接开安装弹窗)。
4
- 下拉本体收口在 AgentEngineSelector,文件空间 g ai 面板复用同一份实现。
5
- 会话一旦落盘就置灰:引擎在会话建立时锁定(三家续聊标识互不通用),要换请新建。 `),r.activeTab===`chat`?(b(),v(r.AgentEngineSelector,{key:0,class:`agent-engine`,engine:r.displayEngine,locked:r.isEngineLocked,onSelect:r.handleEngineSelect},null,8,[`engine`,`locked`])):s(`v-if`,!0)]),V(`div`,at,[s(` ── 对话 ── `),r.activeTab===`chat`?(b(),a(`div`,ot,[s(` 窄屏 · 会话列表页:列表独占整页 `),r.narrow&&r.chatPage===`list`?(b(),a(`div`,st,[f(r.ConversationList,{class:`agent-conversations`,items:r.conversationItems,"active-id":r.currentSessionId,loading:r.sessionsLoading,labels:r.conversationLabels,onSelect:r.selectSession,onNew:r.handleNewSession,onRename:r.renameSession,onDelete:r.deleteSession},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])])):(b(),a(H,{key:1},[s(` 对话页(窄屏时顶上多一条返回条;宽屏左侧就摆着列表,不需要) `),r.narrow?(b(),a(`div`,ct,[V(`button`,{type:`button`,class:`agent-page-back`,title:r.$t(`@AGENT:返回会话列表`),"aria-label":r.$t(`@AGENT:返回会话列表`),onClick:t[0]||=e=>r.chatPage=`list`},[...t[1]||=[V(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[V(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),V(`polyline`,{points:`12 19 5 12 12 5`})],-1)]],8,lt),V(`span`,ut,E(r.currentSessionTitle),1)])):s(`v-if`,!0),s(`
6
- 对话宿主:单独开一层裁剪边界。
7
- 欢迎页在矮/窄窗口里会比可用高度还高,而它是垂直居中的 —— 溢出的部分
8
- 会**向上**跑出 .acu-chat,盖到刚加的返回条上(把返回条的点击也一起吃掉,
9
- e2e 实测就是这个症状)。宿主的 overflow:hidden 把它裁在自己这一格里。
10
- `),V(`div`,dt,[s(` 加载中 `),r.sessionLoading?(b(),a(`div`,ft,[f(r.ElIcon,{class:`is-loading`,size:32},{default:T(()=>[f(r.Loading)]),_:1}),V(`span`,null,E(r.$t(`@AGENT:加载会话中...`)),1)])):(b(),a(H,{key:1},[s(` ChatContainer `),f(r.ChatContainer,{ref:`chatContainerRef`,messages:r.messages,"preset-questions":r.presetQuestions,"welcome-title":r.$t(`@AGENT:智能体助手`),"welcome-description":r.$t(`@AGENT:我可以帮你阅读代码、执行命令、修改文件。选择下方话题或直接输入你的问题。`),"assistant-name":r.AGENT_ASSISTANT_NAME,theme:r.chatTheme,disabled:r.isStreaming,generating:r.isStreaming,"upload-config":{accept:r.AGENT_UPLOAD_ACCEPT},placeholder:r.isStreaming?r.$t(`@AGENT:正在生成中...`):r.$t(`@AGENT:输入消息,Enter 发送`),question:r.pendingQuestion,"question-submitting":r.answeringQuestion,"question-labels":r.questionLabels,onSend:r.onSend,onSelect:r.onSelectPreset,onStop:r.stop,onAnswer:r.answerQuestion},null,8,[`messages`,`preset-questions`,`welcome-title`,`welcome-description`,`assistant-name`,`theme`,`disabled`,`generating`,`upload-config`,`placeholder`,`question`,`question-submitting`,`question-labels`,`onStop`,`onAnswer`])],2112))])],64))])):(b(),a(H,{key:1},[s(` ── Skill 广场 / MCP 广场 ── `),f(r.MarketplacePanel,{type:r.marketplaceType},null,8,[`type`])],2112))])])],512)}var mt=W(et,[[`render`,pt],[`__scopeId`,`data-v-bd681ddd`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/views/AgentView.vue`]]);export{mt as default};
@@ -1,31 +0,0 @@
1
- import"./rolldown-runtime-C0FnF6B9.js";import{An as e,Cn as t,Dn as n,En as r,Fr as i,H as a,Jn as o,Jr as s,Kn as c,Mn as l,Pn as u,Qn as d,Rn as f,Tn as p,Un as m,Xn as h,Xr as g,_n as ee,a as _,br as v,cr as y,ei as b,gn as x,hn as S,jn as C,ln as w,lr as T,or as E,pr as te,vn as D,wn as O,xn as ne,xr as re,yn as k}from"./element-plus-AaVXaSqv.js";import{o as ie,r as ae,t as oe}from"./vendor-B5GNSK12.js";import{n as A,t as se}from"./_plugin-vue_export-helper-Ut942ckG.js";import{t as ce}from"./SvgIcon-D54dZy2f.js";import{t as le}from"./configStore-DG0VBR3h.js";import{n as ue,t as de}from"./fileIcon-B5p5pGN9.js";import{a as fe,i as pe,n as me,r as he,s as ge,t as _e}from"./previewSandbox-D2ioUBVm.js";import{a as ve,c as j,l as ye,n as M,o as be,r as xe,s as N}from"./monaco-DkJuNcCr.js";import{t as Se}from"./useThemeObserver-CiUpR4zj.js";import{r as P,t as F}from"./flow-mindmap-j-zhcNPe.js";import{r as Ce}from"./index-Dq6OyCrE.js";import{a as I,i as we,n as Te,o as Ee,r as De,t as L}from"./agentConversations-C2864Cya.js";import{n as R,t as Oe}from"./AgentEngineSelector-j7LYtcCD.js";function ke(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`}f();var Ae=u({__name:`MindmapPreview`,props:{content:{type:String,required:!0}},setup(e,{expose:n}){n();let r=e,i={props:r,data:t(()=>F(r.content||``,`未命名文档`)),get MindMap(){return P}};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}});f();var z={class:`mindmap-preview`},B={class:`mindmap-preview-canvas`};function je(e,t,r,i,a,o){return h(),n(`div`,z,[t[0]||=O(`div`,{class:`mindmap-preview-header`},[O(`span`,{class:`mindmap-preview-title`},`整篇导图`),O(`span`,{class:`mindmap-preview-hint`},`基于整篇 Markdown 自动生成 · 阅读模式`)],-1),O(`div`,B,[l(i.MindMap,{data:i.data,"preview-mode":``},null,8,[`data`])])])}var Me=se(Ae,[[`render`,je],[`__scopeId`,`data-v-3969a8bf`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/MindmapPreview.vue`]]);f(),te();var Ne=u({__name:`EditorAgentPanel`,props:{activeFilePath:{type:[String,null],required:!1},activeFileName:{type:String,required:!1},active:{type:Boolean,required:!1}},emits:[`close`],setup(e,{expose:n,emit:r}){n();let i=e,a=r,{theme:s}=Se(),l=t(()=>s.value===`dark`?`dark`:`light`),{sessions:u,sessionsLoading:d,currentSessionId:f,messages:p,isStreaming:h,pendingQuestion:g,answeringQuestion:ee,isSessionGenerating:_,currentEngine:y,pendingEngine:b,isEngineLocked:x,pickEngine:S,loadSessions:C,loadSession:w,deleteSession:T,renameSession:te,newSession:D,sendMessage:O,answerQuestion:ne,stop:re}=Ee(),k=t(()=>x.value?y.value:b.value);function se(e){x.value||S(e)}let ce=t(()=>we(u.value,_)),le=Te(),ue=De(),de=v(null),fe=v(null),pe=v(null),me=v(null),he=v(null),{width:ge,narrow:_e}=R(he),ve=v(`chat`),j=v(null),ye=v(!1),M=null,be=t(()=>!!i.activeFileName&&!ye.value);function xe(e){return Array.from(e.children).find(e=>e.classList?.contains(`acu-input-attachments`))??null}function N(){let e=fe.value?.$el;if(!e)return;let t=e.querySelector(`.agent-context-slot`);if(!be.value){if(!t)return;j.value=null,m(()=>t.remove());return}let n=j.value&&e.contains(j.value)?j.value:t;n||(n=document.createElement(`div`),n.className=`agent-context-slot`);let r=xe(e),i=r??e;n.parentElement!==i&&i.insertBefore(n,r?r.firstChild:e.firstChild),j.value=n}function P(e=!0){de.value?.scrollToBottom(e)}async function F(e){let t=ye.value?void 0:i.activeFilePath||void 0;await O(e.text,e.files,{openFilePath:t}),await m(),P()}function Ce(e){w(e),ve.value=`chat`}function ke(){D(),ve.value=`chat`}E(()=>p.value.length,()=>{m(()=>P(!1))});function Ae(){let e=me.value;e&&typeof MutationObserver<`u`&&(M?.disconnect(),M=new MutationObserver(()=>N()),M.observe(e,{childList:!0,subtree:!0}))}E(()=>i.active,e=>{e&&(ve.value=`chat`,C().catch(()=>{}),m(()=>{N(),P(!1)}))}),E(_e,e=>{e||(ve.value=`chat`)}),E(()=>i.activeFilePath,()=>{ye.value=!1}),E(be,e=>{e&&m(N)}),o(()=>{C().catch(()=>{}),m(()=>{N(),Ae()})}),c(()=>{M?.disconnect(),M=null,j.value=null});let z={props:i,emit:a,theme:s,chatTheme:l,sessions:u,sessionsLoading:d,currentSessionId:f,messages:p,isStreaming:h,pendingQuestion:g,answeringQuestion:ee,isSessionGenerating:_,currentEngine:y,pendingEngine:b,isEngineLocked:x,pickEngine:S,loadSessions:C,loadSession:w,deleteSession:T,renameSession:te,newSession:D,sendMessage:O,answerQuestion:ne,stop:re,displayEngine:k,onEngineSelect:se,conversationItems:ce,conversationLabels:le,questionLabels:ue,chatRef:de,inputRef:fe,chatHostRef:pe,composerRef:me,rootRef:he,width:ge,narrow:_e,page:ve,contextSlot:j,contextDismissed:ye,get slotObserver(){return M},set slotObserver(e){M=e},showContextCard:be,findAttachmentsHost:xe,syncContextSlot:N,scrollToBottom:P,onSend:F,onSelectSession:Ce,onNewSession:ke,watchChatDom:Ae,get $t(){return A},get ChatContainer(){return oe},get ChatInput(){return ie},get ConversationList(){return ae},get AGENT_UPLOAD_ACCEPT(){return I},get AGENT_ASSISTANT_NAME(){return L},AgentEngineSelector:Oe};return Object.defineProperty(z,"__isScriptSetup",{enumerable:!1,value:!0}),z}});f(),i(),w();var Pe={ref:`rootRef`,class:`editor-agent-panel`},V={class:`agent-panel-header`},Fe=[`title`,`aria-label`],H={class:`agent-panel-title`},Ie={key:1,class:`agent-panel-title`},Le=[`title`,`aria-label`],Re=[`title`],ze={class:`agent-panel-convs`},Be={ref:`chatHostRef`,class:`agent-panel-chat`},Ve=[`data-theme`],U=[`title`],W={class:`agent-context-att-name`},G=[`title`,`aria-label`];function He(t,i,a,o,c,u){return h(),n(k,null,[r(`
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(`div`,Pe,[O(`div`,V,[r(` 窄屏的列表页:整条 header 让给「返回对话 + 标题」 `),o.narrow&&o.page===`list`?(h(),n(k,{key:0},[O(`button`,{class:`agent-panel-icon-btn agent-panel-back-btn`,title:o.$t(`@EDITOR:返回对话`),"aria-label":o.$t(`@EDITOR:返回对话`),onClick:i[0]||=e=>o.page=`chat`},[...i[4]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),O(`polyline`,{points:`12 19 5 12 12 5`})],-1)]],8,Fe),O(`span`,H,b(o.$t(`@EDITOR:会话列表`)),1)],64)):(h(),n(`span`,Ie,b(o.$t(`@EDITOR:g ai 对话`)),1)),i[7]||=O(`div`,{class:`agent-panel-spacer`},null,-1),r(` 引擎切换:与「智能体」视图同一套(同一个 AgentEngineSelector)。
12
- 宽屏左边摆着历史,对话区一直在,所以常驻;窄屏只在对话页出现 ——
13
- 列表页没有正在跑的对话,摆这儿只会挤占标题。 `),!o.narrow||o.page===`chat`?(h(),p(o.AgentEngineSelector,{key:2,class:`agent-panel-engine`,engine:o.displayEngine,locked:o.isEngineLocked,onSelect:o.onEngineSelect},null,8,[`engine`,`locked`])):r(`v-if`,!0),r(` 会话列表按钮:只有"列表是独立一页"时才需要它(宽屏列表就在旁边) `),o.narrow&&o.page===`chat`?(h(),n(`button`,{key:3,class:`agent-panel-icon-btn agent-panel-list-btn`,title:o.$t(`@EDITOR:会话列表`),"aria-label":o.$t(`@EDITOR:会话列表`),onClick:i[1]||=e=>o.page=`list`},[...i[5]||=[e(`<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,Le)):r(`v-if`,!0),O(`button`,{class:`agent-panel-icon-btn`,title:o.$t(`@EDITOR:关闭对话`),onClick:i[2]||=e=>o.emit(`close`)},[...i[6]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[O(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),O(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Re)]),O(`div`,{class:s([`agent-panel-body`,{"is-wide":!o.narrow}])},[r(` 会话历史:宽屏是常驻左列(行高正常 + 带搜索框),窄屏是独享整页 `),T(O(`div`,ze,[l(o.ConversationList,{"show-search":!0,items:o.conversationItems,"active-id":o.currentSessionId,loading:o.sessionsLoading,labels:o.conversationLabels,onSelect:o.onSelectSession,onNew:o.onNewSession,onRename:o.renameSession,onDelete:o.deleteSession},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])],512),[[x,!o.narrow||o.page===`list`]]),r(` 气泡区:输入框已经不在这里了(show-input=false),见下面常驻的那一条 `),T(O(`div`,Be,[l(o.ChatContainer,{ref:`chatRef`,"show-input":!1,messages:o.messages,"assistant-name":o.AGENT_ASSISTANT_NAME,theme:o.chatTheme,question:o.pendingQuestion,"question-submitting":o.answeringQuestion,"question-labels":o.questionLabels,onAnswer:o.answerQuestion},null,8,[`messages`,`assistant-name`,`theme`,`question`,`question-submitting`,`question-labels`,`onAnswer`])],512),[[x,!o.narrow||o.page===`chat`]]),r(`
14
- 输入框常驻:两种形态、两个页面都在最下方(与演示页同一套做法)。
15
- 它被拆到 ChatContainer 外面,所以 acu-root 与 data-theme 得自己套上:
16
- 库把盒模型重置限定在 .acu-root 子树里,而 ChatInput 根节点是 div(不是 button),
17
- 少了它就会退回 content-box、横着溢出面板。
18
-
19
- v-if="width > 0":**等量到本面板的宽度再挂载输入框**。库的 ChatInput 只在
20
- onMounted 里量一次 scrollHeight,量到的宽度不对就再也纠不回来 —— 实测首帧挂载时
21
- 容器还没宽度,占位文案被折成十几行,textarea 直接顶到 200px 上限并一直卡在那里。
22
- 宽度是 useNarrowPane 在 onMounted 里同步量到的,所以这里晚的只是一次重渲染。
23
- `),o.width>0?(h(),n(`div`,{key:0,ref:`composerRef`,class:`agent-panel-composer acu-root`,"data-theme":o.chatTheme},[l(o.ChatInput,{ref:`inputRef`,disabled:o.isStreaming,generating:o.isStreaming,placeholder:o.isStreaming?o.$t(`@AGENT:正在生成中...`):o.$t(`@AGENT:输入消息,Enter 发送`),"upload-config":{accept:o.AGENT_UPLOAD_ACCEPT},onSend:o.onSend,onStop:o.stop},null,8,[`disabled`,`generating`,`placeholder`,`upload-config`,`onStop`]),r(`
24
- 当前文档:**和添加的附件同处一行、同一副样子**。
25
- 组件库的 ChatContainer / ChatInput 没有任何插槽(dist 里 \`slots\` 出现 0 次),
26
- 没法声明式地往输入框里放东西,所以:
27
- · 往 \`.acu-input-wrap\` 插一个锚点,再把卡片 Teleport 进去(节点仍是 Vue 渲染的);
28
- · **有附件行(.acu-input-attachments)时锚点住进它内部** —— 卡片因此成为那一行的
29
- flex item,与附件并排、共用同一套 gap/wrap。只插在输入框最前面是不行的:
30
- Vue 更新输入框时会用自己的锚点 \`insertBefore\`,把外来节点挤到后面去。
31
- `),o.contextSlot?(h(),p(ne,{key:0,to:o.contextSlot},[o.showContextCard?(h(),n(`div`,{key:0,class:`agent-context-att`,title:a.activeFilePath||``},[i[9]||=O(`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`},[O(`path`,{d:`M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z`}),O(`polyline`,{points:`14 3 14 8 19 8`})],-1),O(`span`,W,b(a.activeFileName),1),O(`button`,{type:`button`,class:`agent-context-att-remove`,title:o.$t(`@EDITOR:不引用当前文档`),"aria-label":o.$t(`@EDITOR:不引用当前文档`),onClick:i[3]||=e=>o.contextDismissed=!0},[...i[8]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"aria-hidden":`true`},[O(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),O(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,G)],8,U)):r(`v-if`,!0)],8,[`to`])):r(`v-if`,!0)],8,Ve)):r(`v-if`,!0)],2)],512)],2112)}var Ue=se(Ne,[[`render`,He],[`__scopeId`,`data-v-7cc12c51`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/EditorAgentPanel.vue`]]);f(),te();var We=15e3,Ge=u({__name:`EditorView`,props:{pendingFilePath:{type:[String,null],required:!1}},setup(e,{expose:n}){n(),self.MonacoEnvironment={getWorker(e,t){return t===`json`?new j:t===`css`||t===`scss`||t===`less`?new N:t===`html`||t===`handlebars`||t===`razor`?new be:t===`typescript`||t===`javascript`?new ve:new ye}};let r=e,i=le(),s=Ce(),l=v([]),u=v(!1),d=v(``),f=v(``),p=null;function h(){d.value=``,f.value=``,p&&=(clearTimeout(p),null)}E(d,e=>{p&&clearTimeout(p),p=setTimeout(()=>{f.value=e,p=null},180)}),c(()=>{p&&clearTimeout(p),y()});let g=null;function ee(){y(),g=setInterval(()=>{document.hidden||i.currentDirectory&&(d.value.trim()||w())},We)}function y(){g&&=(clearInterval(g),null)}E(()=>i.currentDirectory,()=>{ee()});async function b(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 x(){let e=i.currentDirectory;if(e){u.value=!0;try{l.value=await b(e,0)}finally{u.value=!1}}}function S(e,t=new Set){for(let n of e)n.type===`directory`&&n.expanded&&(t.add(n.path),n.children&&S(n.children,t));return t}async function C(e,t){for(let n of e)n.type===`directory`&&t.has(n.path)&&(n.children||=await b(n.path,n.depth+1),n.expanded=!0,await C(n.children,t))}async function w(){let e=i.currentDirectory;if(!e)return;let t=S(l.value);u.value=!0;try{l.value=await b(e,0),t.size>0&&await C(l.value,t)}finally{u.value=!1}}async function T(e){if(e.type===`directory`){if(e.expanded)e.expanded=!1;else{if(!e.children){e.loading=!0;try{e.children=await b(e.path,e.depth+1)}finally{e.loading=!1}}e.expanded=!0}}}function te(e){let t=[];for(let n of e)t.push(n),n.type===`directory`&&n.expanded&&n.children&&t.push(...te(n.children));return t}let D=t(()=>f.value.trim().toLowerCase());function O(e,t){if(!t)return e;let n=[];for(let r of e){let e=r.children?O(r.children,t):[],i=r.name.toLowerCase().includes(t);r.type===`directory`?(i||e.length>0)&&(r.expanded=!0,r.children!==void 0&&(r.children=e),n.push(r)):i&&n.push(r)}return n}let ne=t(()=>O(l.value,D.value)),k=t(()=>D.value.length>0&&ne.value.length===0);function ie(e){let t=f.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}let ae=v(null);function oe(){let e=ae.value;e&&(e.focus(),e.select())}function se(){d.value?(h(),ae.value?.focus()):(ae.value?.blur(),L.value?.focus())}let P=v([]),F=v(null),I=v(null);async function we(e){if(I.value=e,e.type!==`file`){T(e);return}let t=P.value.find(t=>t.path===e.path);if(console.log(`[debug-open-in-editor] EditorView openFile existing tab check:`,{path:e.path,found:!!t,tabsCount:P.value.length}),t){F.value=e.path,m(()=>z());return}let n=e.name.split(`.`).pop()||``;if(ht.has(n.toLowerCase())){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`plaintext`};P.value.push(t),F.value=e.path,J.value=!0;return}if(ge(e.name)){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`office`};P.value.push(t),F.value=e.path,Y.value=!1,J.value=!0;return}try{let t=await fetch(`/api/editor/file?path=${encodeURIComponent(e.path)}`),r=await t.json();if(console.log(`[debug-open-in-editor] EditorView fetch /api/editor/file response:`,{path:e.path,status:t.status,data:r}),!r.success){_.error(`${A(`@EDITOR:打开文件失败: `)}${r.error}`);return}let i=ke(n),a={path:e.path,name:e.name,content:r.content,originalContent:r.content,isDirty:!1,language:i};console.log(`[debug-open-in-editor] EditorView pushing tab:`,{path:a.path,name:a.name,contentLen:a.content.length,lang:a.language}),P.value.push(a),F.value=e.path,console.log(`[debug-open-in-editor] EditorView tabs after push:`,P.value.length,`activeTabPath=`,F.value)}catch(e){console.log(`[debug-open-in-editor] EditorView fetch threw:`,e),_.error(`${A(`@EDITOR:打开文件失败: `)}${e.message}`)}}E(()=>r.pendingFilePath,async e=>{if(console.log(`[debug-open-in-editor] EditorView watcher fired, filePath=`,e),!e)return;await m();let t=e.split(/[\\/]/).pop()||e;console.log(`[debug-open-in-editor] EditorView calling openFile, name=`,t,`path=`,e),await we({name:t,path:e,type:`file`,depth:0}),console.log(`[debug-open-in-editor] EditorView openFile returned`)},{immediate:!0});function Te(e,t){t.stopPropagation();let n=P.value.findIndex(t=>t.path===e);n!==-1&&(!P.value[n].isDirty||confirm(A(`@EDITOR:文件未保存,确认关闭?`)))&&(P.value.splice(n,1),F.value===e&&(F.value=P.value[Math.min(n,P.value.length-1)]?.path??null))}let Ee=()=>P.value.find(e=>e.path===F.value)??null,De=v(null),L=re(null),R=new Map;function Oe(e){let t=R.get(e.path);return(!t||t.isDisposed())&&(t=xe.createModel(e.content,e.language,M.file(e.path)),R.set(e.path,t)),t}function Ae(){if(!De.value)return;let e=document.documentElement.getAttribute(`data-theme`)===`dark`;L.value=xe.create(De.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}),L.value.onDidChangeModelContent(()=>{let e=Ee();if(!e)return;let t=L.value.getValue();e.content=t,e.isDirty=t!==e.originalContent}),L.value.onDidBlurEditorText(()=>{i.ui.editorAutoSave&&Ee()?.isDirty&&Ne(!1),requestAnimationFrame(()=>{if(!V.value||V.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`))||z()})})}E(F,e=>{if(!L.value||!e)return;let t=P.value.find(t=>t.path===e);if(!t)return;let n=Oe(t);L.value.setModel(n),m(()=>z())});function z(){if(!L.value)return;L.value.focus();let e=document.querySelector(`.monaco-editor .native-edit-context`);e&&document.activeElement!==e&&requestAnimationFrame(()=>e.focus?.())}E(()=>P.value.filter(e=>e.isDirty).length,e=>{s.setDirtyCount(e)},{immediate:!0}),c(()=>s.setDirtyCount(0)),Se(()=>{let e=document.documentElement.getAttribute(`data-theme`)===`dark`;xe.setTheme(e?`vs-dark`:`vs`)});let B=null;function je(){if(B||!V.value)return;let e=[V.value],t=V.value.parentElement;for(;t;){if(t.classList.contains(`view-pane`)||t.classList.contains(`editor-pane`)){e.push(t);break}t=t.parentElement}B=new MutationObserver(()=>{V.value&&V.value.offsetParent!==null&&F.value&&L.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`))||z()})});let n=B;e.forEach(e=>n.observe(e,{attributes:!0,attributeFilter:[`style`,`class`,`hidden`]}))}o(async()=>{Ae(),await x(),je(),ee(),F.value&&m(()=>z())}),c(()=>{B?.disconnect(),B=null,L.value?.dispose(),R.forEach(e=>e.dispose()),R.clear()});async function Ne(e=!1){let t=Ee();if(t)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){_.error(`${A(`@EDITOR:保存失败: `)}${n.error}`);return}t.originalContent=t.content,t.isDirty=!1,e||_.success(A(`@EDITOR:已保存`))}catch(e){_.error(`${A(`@EDITOR:保存失败: `)}${e.message}`)}}function Pe(e){let t=e.ctrlKey||e.metaKey;if(t&&e.key.toLowerCase()===`f`){e.preventDefault(),oe();return}t&&e.key===`s`&&(e.preventDefault(),Ne())}o(()=>window.addEventListener(`keydown`,Pe)),c(()=>window.removeEventListener(`keydown`,Pe));let V=v(null),Fe=v(220),H=!1,Ie=0,Le=0;function Re(e){H=!0,Ie=e.clientX,Le=Fe.value,document.addEventListener(`mousemove`,ze),document.addEventListener(`mouseup`,Be),e.preventDefault()}function ze(e){if(!H)return;let t=e.clientX-Ie;Fe.value=Math.max(140,Math.min(400,Le+t))}function Be(){H=!1,document.removeEventListener(`mousemove`,ze),document.removeEventListener(`mouseup`,Be)}function Ve(e){return e.type===`directory`?ue(e.name):de(e.name)}let U=v(null),W=v(null),G=v(null),He=v(null);function Ge(){let e=I.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(/[\\/][^\\/]+$/,``):i.currentDirectory??``,afterNode:e,depth:e.depth}:{parentPath:i.currentDirectory??``,afterNode:null,depth:0}}async function Ke(){let e=Ge();I.value?.type===`directory`&&!I.value.expanded&&await T(I.value),U.value={...e,kind:`file`,value:``},await m(),G.value?.focus()}async function qe(){let e=Ge();I.value?.type===`directory`&&!I.value.expanded&&await T(I.value),U.value={...e,kind:`directory`,value:``},await m(),G.value?.focus()}function Je(){U.value=null}async function Ye(){let e=U.value;if(!e||!e.value.trim()){U.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){_.error(e.error);return}_.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){_.error(e.error);return}_.success(A(`@EDITOR:创建成功`))}U.value=null,await w()}function Xe(e){e.key===`Enter`&&(e.preventDefault(),Ye()),e.key===`Escape`&&(e.preventDefault(),Je())}let K=v(null),Ze=v(null);function Qe(e,t){e.preventDefault(),K.value={x:e.clientX,y:e.clientY,node:t}}function q(){K.value=null}async function $e(){let e=K.value?.node;q(),e&&(I.value=e),e?.type===`directory`&&!e.expanded&&await T(e);let t=Ge();U.value={...t,kind:`file`,value:``},await m(),G.value?.focus()}async function et(){let e=K.value?.node;q(),e&&(I.value=e),e?.type===`directory`&&!e.expanded&&await T(e);let t=Ge();U.value={...t,kind:`directory`,value:``},await m(),G.value?.focus()}async function tt(){let e=K.value?.node;q(),e&&(W.value={node:e,value:e.name},await m(),He.value?.focus(),He.value?.select())}async function nt(){let e=W.value;if(!e||!e.value.trim()||e.value.trim()===e.node.name){W.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){_.error(r.error);return}let i=P.value.find(t=>t.path===e.node.path);i&&(i.path=n,i.name=t,F.value===e.node.path&&(F.value=n)),W.value=null,await w()}function rt(e){e.key===`Enter`&&(e.preventDefault(),nt()),e.key===`Escape`&&(e.preventDefault(),W.value=null)}async function it(){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){_.error(n.error);return}let r=P.value.findIndex(t=>t.path===e.path);r!==-1&&(P.value.splice(r,1),F.value===e.path&&(F.value=P.value[Math.max(0,r-1)]?.path??null)),_.success(A(`@EDITOR:已删除`)),await w()}async function at(){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||_.error(t.error)}catch(e){_.error(e?.message||String(e))}}function ot(e){let t=i.currentDirectory;if(!t)return e;let n=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``),r=n(t),a=n(e);return a===r?`.`:a.startsWith(r+`/`)?a.slice(r.length+1):a}async function st(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 ct(){let e=K.value?.node;q(),e&&(await st(e.path)?_.success(A(`@EDITOR:已复制到剪贴板`)):_.error(A(`@EDITOR:复制失败`)))}async function lt(){let e=K.value?.node;q(),e&&(await st(ot(e.path))?_.success(A(`@EDITOR:已复制到剪贴板`)):_.error(A(`@EDITOR:复制失败`)))}async function ut(){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||_.error(t.error||A(`@EDITOR:VSCode 未安装`))}catch(e){_.error(e?.message||String(e))}}let dt=new Set([`html`,`htm`]),ft=t(()=>{let e=K.value?.node;if(!e||e.type!==`file`)return!1;let t=e.name.slice(e.name.lastIndexOf(`.`)+1).toLowerCase();return dt.has(t)});async function pt(){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||_.error(t.error||A(`@EDITOR:浏览器打开失败`))}catch(e){_.error(e?.message||String(e))}}o(()=>document.addEventListener(`click`,q)),c(()=>document.removeEventListener(`click`,q));let mt=new Set([`md`,`html`,`htm`,`svg`]),ht=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`ico`,`bmp`]),J=v(!1),Y=v(!1),X=v(!1),gt=v(!1),_t=v(0),Z=t(()=>P.value.find(e=>e.path===F.value)??null),vt=t(()=>Z.value?.language===`plaintext`&&Z.value?.content===``),yt=t(()=>Z.value?.language===`office`),Q=t(()=>(Z.value?.name??``).split(`.`).pop()?.toLowerCase()??``),bt=t(()=>mt.has(Q.value)||ht.has(Q.value)||ge(Q.value)),xt=t(()=>((Z.value?.content??``).match(/^#{1,6}\s+/gm)||[]).length),St=t(()=>Q.value===`md`&&xt.value>0);E(F,()=>{J.value&&!bt.value&&(J.value=!1),Y.value&&!St.value&&(Y.value=!1)});function Ct(){bt.value&&(J.value||(Y.value=!1,X.value=!1),J.value=!J.value)}function wt(){St.value&&(Y.value||(J.value=!1,X.value=!1),Y.value=!Y.value)}function Tt(){X.value||(J.value=!1,Y.value=!1),X.value=!X.value,gt.value=!0}let Et=t(()=>{let e=Z.value;if(!e)return``;let t=Q.value,n=document.documentElement.getAttribute(`data-theme`)===`light`?`#ffffff`:`#0d1117`;return t===`html`||t===`htm`?me(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>`:``}),$=!1,Dt=0,Ot=0;function kt(e){$=!0,Dt=e.clientX,Ot=_t.value,document.addEventListener(`mousemove`,At),document.addEventListener(`mouseup`,jt),e.preventDefault()}function At(e){if(!$)return;let t=e.clientX-Dt;_t.value=Math.max(200,Math.min(900,Ot+t))}function jt(){$=!1,document.removeEventListener(`mousemove`,At),document.removeEventListener(`mouseup`,jt)}let Mt={props:r,configStore:i,editorTabsStore:s,treeNodes:l,treeLoading:u,searchQuery:d,debouncedSearchQuery:f,get searchDebounceTimer(){return p},set searchDebounceTimer(e){p=e},clearSearch:h,TREE_POLL_MS:We,get treePollTimer(){return g},set treePollTimer(e){g=e},startTreePolling:ee,stopTreePolling:y,loadDir:b,initTree:x,collectExpandedPaths:S,restoreExpanded:C,refreshTree:w,toggleDir:T,flattenTree:te,searchQueryLower:D,filterTree:O,visibleTree:ne,noSearchResults:k,highlightName:ie,searchInputRef:ae,focusSearchInput:oe,onSearchEscape:se,tabs:P,activeTabPath:F,selectedNode:I,openFile:we,closeTab:Te,activeTab:Ee,editorContainerRef:De,editorInstance:L,modelCache:R,getOrCreateModel:Oe,mountEditor:Ae,focusEditor:z,get viewVisibilityObserver(){return B},set viewVisibilityObserver(e){B=e},setupViewVisibilityObserver:je,saveCurrentFile:Ne,handleKeydown:Pe,containerRef:V,sidebarWidth:Fe,get isResizing(){return H},set isResizing(e){H=e},get resizeStartX(){return Ie},set resizeStartX(e){Ie=e},get resizeStartW(){return Le},set resizeStartW(e){Le=e},startSidebarResize:Re,onSidebarResize:ze,stopSidebarResize:Be,getNodeSpriteId:Ve,inlineInput:U,renameInput:W,inlineInputRef:G,renameInputRef:He,getTargetDir:Ge,startNewFile:Ke,startNewFolder:qe,cancelInlineInput:Je,confirmInlineInput:Ye,handleInlineKeydown:Xe,ctxMenu:K,ctxMenuRef:Ze,openContextMenu:Qe,closeContextMenu:q,ctxNewFile:$e,ctxNewFolder:et,ctxRename:tt,confirmRename:nt,handleRenameKeydown:rt,ctxDelete:it,ctxRevealInExplorer:at,toWorkspaceRelative:ot,copyToClipboard:st,ctxCopyAbsolutePath:ct,ctxCopyRelativePath:lt,ctxOpenInVscode:ut,BROWSER_OPEN_EXTS:dt,ctxMenuCanOpenInBrowser:ft,ctxOpenInBrowser:pt,PREVIEW_TEXT_EXTS:mt,IMAGE_EXTS:ht,showPreview:J,showMindmap:Y,showAgentChat:X,agentOpened:gt,previewWidth:_t,activeTabRef:Z,activeTabIsImage:vt,activeTabIsOffice:yt,activeExt:Q,isPreviewable:bt,mindmapTitleCount:xt,isMindmapable:St,togglePreview:Ct,toggleMindmap:wt,toggleAgentChat:Tt,previewSrcdoc:Et,get isPreviewResizing(){return $},set isPreviewResizing(e){$=e},get previewResizeStartX(){return Dt},set previewResizeStartX(e){Dt=e},get previewResizeStartW(){return Ot},set previewResizeStartW(e){Ot=e},startPreviewResize:kt,onPreviewResize:At,stopPreviewResize:jt,get $t(){return A},get ElTooltip(){return a},ImagePreview:fe,OfficePreview:he,MarkdownPreview:pe,MindmapPreview:Me,EditorAgentPanel:Ue,SvgIcon:ce,get PREVIEW_IFRAME_SANDBOX(){return _e}};return Object.defineProperty(Mt,"__isScriptSetup",{enumerable:!1,value:!0}),Mt}});f(),i(),w();var Ke={class:`editor-view`,ref:`containerRef`},qe={class:`sidebar-header`},Je={class:`sidebar-title`},Ye={class:`sidebar-actions`},Xe={class:`sidebar-search`},K=[`placeholder`,`title`],Ze=[`title`,`aria-label`],Qe={key:0,class:`sidebar-tree`},q={key:1,class:`tree-arrow-spacer`},$e={class:`tree-icon mit-icon`,"aria-hidden":`true`},et=[`xlink:href`],tt=[`onClick`,`onContextmenu`],nt={key:1,class:`tree-arrow-spacer`},rt={key:2,class:`tree-icon mit-icon`,"aria-hidden":`true`},it=[`xlink:href`],at={key:3,class:`tree-icon mit-icon`,"aria-hidden":`true`},ot=[`xlink:href`],st=[`title`],ct={key:0,class:`tree-name-hit`},lt={key:4,class:`tree-loading`},ut={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)`}},dt={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-tertiary)`}},ft=[`placeholder`],pt={key:0,class:`tree-node tree-inline-input-row`,style:{paddingLeft:`12px`}},mt={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)`}},ht={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-tertiary)`}},J=[`placeholder`],Y={key:1,class:`tree-empty`},X={key:1,class:`sidebar-loading`},gt={class:`editor-main`},_t={key:0,class:`editor-tabs`},Z=[`onClick`,`title`],vt={class:`tab-name`},yt={key:0,class:`tab-dirty-dot`},Q=[`onClick`],bt=[`title`],xt=[`disabled`,`title`],St=[`title`],Ct={key:1,class:`editor-empty`},wt={viewBox:`0 0 24 24`,width:`48`,height:`48`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{opacity:`.3`}},Tt={class:`editor-empty-hint`},Et={class:`editor-body`},$={key:0,class:`image-tab-placeholder`},Dt={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`}},Ot={class:`image-tab-placeholder-title`},kt={class:`image-tab-placeholder-hint`},At={class:`preview-header`},jt={class:`preview-title`},Mt={class:`preview-ext-badge`},Nt=[`title`],Pt={class:`preview-body`},Ft=[`sandbox`,`srcdoc`];function It(t,i,a,o,c,u){return h(),n(k,null,[O(`div`,Ke,[r(` 左侧文件树 `),O(`div`,{class:`editor-sidebar`,style:g({width:o.sidebarWidth+`px`})},[O(`div`,qe,[O(`span`,Je,b(o.$t(`@EDITOR:资源管理器`)),1),O(`div`,Ye,[l(o.ElTooltip,{content:o.$t(`@EDITOR:新建文件`),placement:`bottom`,"show-after":300},{default:y(()=>[O(`button`,{class:`sidebar-action-btn`,onClick:o.startNewFile},[r(` new-file icon `),i[10]||=O(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`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`}),O(`polyline`,{points:`14 2 14 8 20 8`}),O(`line`,{x1:`12`,y1:`13`,x2:`12`,y2:`19`}),O(`line`,{x1:`9`,y1:`16`,x2:`15`,y2:`16`})],-1)])]),_:1},8,[`content`]),l(o.ElTooltip,{content:o.$t(`@EDITOR:新建文件夹`),placement:`bottom`,"show-after":300},{default:y(()=>[O(`button`,{class:`sidebar-action-btn`,onClick:o.startNewFolder},[r(` new-folder icon `),i[11]||=O(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`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`}),O(`line`,{x1:`12`,y1:`11`,x2:`12`,y2:`17`}),O(`line`,{x1:`9`,y1:`14`,x2:`15`,y2:`14`})],-1)])]),_:1},8,[`content`]),l(o.ElTooltip,{content:o.$t(`@EDITOR:刷新`),placement:`bottom`,"show-after":300},{default:y(()=>[O(`button`,{class:`sidebar-action-btn`,onClick:o.initTree},[...i[12]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`polyline`,{points:`1 4 1 10 7 10`}),O(`polyline`,{points:`23 20 23 14 17 14`}),O(`path`,{d:`M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15`})],-1)]])]),_:1},8,[`content`])])]),O(`div`,Xe,[i[14]||=O(`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`},[O(`circle`,{cx:`11`,cy:`11`,r:`7`}),O(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})],-1),T(O(`input`,{ref:`searchInputRef`,"onUpdate:modelValue":i[0]||=e=>o.searchQuery=e,type:`text`,class:`sidebar-search-input`,placeholder:o.$t(`@EDITOR:搜索文件...`),title:o.$t(`@EDITOR:搜索文件...`),spellcheck:`false`,autocomplete:`off`,onKeydown:ee(o.onSearchEscape,[`escape`])},null,40,K),[[S,o.searchQuery]]),o.searchQuery?(h(),n(`button`,{key:0,class:`sidebar-search-clear`,title:o.$t(`@EDITOR:清除搜索`),"aria-label":o.$t(`@EDITOR:清除搜索`),onClick:o.clearSearch},[...i[13]||=[O(`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`},[O(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),O(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Ze)):r(`v-if`,!0)]),o.treeLoading?(h(),n(`div`,X,[...i[23]||=[O(`span`,{class:`spin-icon`},null,-1)]])):(h(),n(`div`,Qe,[(h(!0),n(k,null,d(o.flattenTree(o.visibleTree),e=>(h(),n(k,{key:e.path},[r(` 重命名时用输入框替换节点 `),o.renameInput&&o.renameInput.node.path===e.path?(h(),n(`div`,{key:0,class:`tree-node tree-inline-input-row`,style:g({paddingLeft:12+e.depth*14+`px`})},[e.type===`directory`?(h(),n(`span`,{key:0,class:s([`tree-arrow`,{expanded:e.expanded}])},[...i[15]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(h(),n(`span`,q)),(h(),n(`svg`,$e,[O(`use`,{"xlink:href":`#${o.getNodeSpriteId(e)}`},null,8,et)])),T(O(`input`,{ref_for:!0,ref:`renameInputRef`,"onUpdate:modelValue":i[1]||=e=>o.renameInput.value=e,onKeydown:o.handleRenameKeydown,onBlur:o.confirmRename,onClick:i[2]||=D(()=>{},[`stop`])},null,544),[[S,o.renameInput.value]])],4)):(h(),n(k,{key:1},[r(` 普通节点 `),O(`div`,{class:s([`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:g({paddingLeft:12+e.depth*14+`px`}),onClick:t=>o.openFile(e),onContextmenu:t=>o.openContextMenu(t,e)},[r(` 展开箭头 `),e.type===`directory`?(h(),n(`span`,{key:0,class:s([`tree-arrow`,{expanded:e.expanded}])},[...i[16]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(h(),n(`span`,nt)),r(` 图标 `),e.type===`directory`?(h(),n(`svg`,rt,[O(`use`,{"xlink:href":`#${o.getNodeSpriteId(e)}`},null,8,it)])):(h(),n(`svg`,at,[O(`use`,{"xlink:href":`#${o.getNodeSpriteId(e)}`},null,8,ot)])),r(` 名称(命中关键字高亮) `),O(`span`,{class:`tree-name`,title:e.path},[(h(!0),n(k,null,d(o.highlightName(e.name),(e,t)=>(h(),n(k,{key:t},[e.hit?(h(),n(`span`,ct,b(e.text),1)):(h(),n(k,{key:1},[C(b(e.text),1)],64))],64))),128))],8,st),e.loading?(h(),n(`span`,lt)):r(`v-if`,!0)],46,tt)],2112)),r(` 内联新建输入框:紧跟在 afterNode 之后 `),o.inlineInput&&o.inlineInput.afterNode?.path===e.path?(h(),n(`div`,{key:2,class:`tree-node tree-inline-input-row`,style:g({paddingLeft:12+o.inlineInput.depth*14+`px`})},[i[19]||=O(`span`,{class:`tree-arrow-spacer`},null,-1),o.inlineInput.kind===`directory`?(h(),n(`svg`,ut,[...i[17]||=[O(`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)]])):(h(),n(`svg`,dt,[...i[18]||=[O(`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),O(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),T(O(`input`,{ref_for:!0,ref:`inlineInputRef`,class:`tree-inline-input`,"onUpdate:modelValue":i[3]||=e=>o.inlineInput.value=e,placeholder:o.inlineInput.kind===`file`?o.$t(`@EDITOR:输入文件名`):o.$t(`@EDITOR:输入文件夹名`),onKeydown:o.handleInlineKeydown,onBlur:o.cancelInlineInput,onClick:i[4]||=D(()=>{},[`stop`])},null,40,ft),[[S,o.inlineInput.value]])],4)):r(`v-if`,!0)],64))),128)),r(` 根级输入框(无选中节点时出现在列表末尾) `),o.inlineInput&&o.inlineInput.afterNode===null?(h(),n(`div`,pt,[i[22]||=O(`span`,{class:`tree-arrow-spacer`},null,-1),o.inlineInput.kind===`directory`?(h(),n(`svg`,mt,[...i[20]||=[O(`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)]])):(h(),n(`svg`,ht,[...i[21]||=[O(`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),O(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),T(O(`input`,{ref:`inlineInputRef`,class:`tree-inline-input`,"onUpdate:modelValue":i[5]||=e=>o.inlineInput.value=e,placeholder:o.inlineInput.kind===`file`?o.$t(`@EDITOR:输入文件名`):o.$t(`@EDITOR:输入文件夹名`),onKeydown:o.handleInlineKeydown,onBlur:o.cancelInlineInput,onClick:i[6]||=D(()=>{},[`stop`])},null,40,J),[[S,o.inlineInput.value]])])):r(`v-if`,!0),!o.inlineInput&&(o.noSearchResults||o.treeNodes.length===0)?(h(),n(`div`,Y,b(o.noSearchResults?o.$t(`@EDITOR:未找到匹配文件`):o.$t(`@EDITOR:暂无文件`)),1)):r(`v-if`,!0)]))],4),r(` 拖拽分隔条 `),O(`div`,{class:`editor-resizer`,onMousedown:o.startSidebarResize},null,32),r(` 右侧编辑区 `),O(`div`,gt,[r(` 标签栏 `),o.tabs.length>0?(h(),n(`div`,_t,[(h(!0),n(k,null,d(o.tabs,e=>(h(),n(`div`,{key:e.path,class:s([`editor-tab`,{active:o.activeTabPath===e.path,dirty:e.isDirty}]),onClick:t=>o.activeTabPath=e.path,title:e.path},[O(`span`,vt,b(e.name),1),e.isDirty?(h(),n(`span`,yt)):r(`v-if`,!0),O(`button`,{class:`tab-close`,onClick:t=>o.closeTab(e.path,t)},[...i[24]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[O(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),O(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Q)],10,Z))),128)),i[28]||=O(`div`,{class:`editor-tabs-spacer`},null,-1),r(` 预览切换按钮 `),o.isPreviewable?(h(),n(`button`,{key:0,class:s([`preview-toggle-btn`,{active:o.showPreview}]),title:o.showPreview?o.$t(`@EDITOR:关闭预览`):o.$t(`@EDITOR:打开预览`),onClick:o.togglePreview},[i[25]||=O(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`path`,{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z`}),O(`circle`,{cx:`12`,cy:`12`,r:`3`})],-1),O(`span`,null,b(o.$t(`@EDITOR:预览`)),1)],10,bt)):r(`v-if`,!0),r(` 思维导图:整篇 markdown 渲染为一张大导图 `),o.isMindmapable?(h(),n(`button`,{key:1,class:s([`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},[i[26]||=e(`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-fc2ebf13><circle cx="12" cy="12" r="2" data-v-fc2ebf13></circle><circle cx="5" cy="6" r="1.6" data-v-fc2ebf13></circle><circle cx="19" cy="6" r="1.6" data-v-fc2ebf13></circle><circle cx="5" cy="18" r="1.6" data-v-fc2ebf13></circle><circle cx="19" cy="18" r="1.6" data-v-fc2ebf13></circle><line x1="11" y1="11" x2="6.4" y2="7" data-v-fc2ebf13></line><line x1="13" y1="11" x2="17.6" y2="7" data-v-fc2ebf13></line><line x1="11" y1="13" x2="6.4" y2="17" data-v-fc2ebf13></line><line x1="13" y1="13" x2="17.6" y2="17" data-v-fc2ebf13></line></svg>`,1),O(`span`,null,b(o.$t(`@EDITOR:思维导图`)),1)],10,xt)):r(`v-if`,!0),r(` g ai 对话:文件空间右侧的智能体面板(与预览/思维导图互斥) `),O(`button`,{class:s([`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},[i[27]||=O(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`path`,{d:`M12 3l1.9 4.6L18.5 9.5l-4.6 1.9L12 16l-1.9-4.6L5.5 9.5l4.6-1.9z`}),O(`path`,{d:`M18 16.5l.9 2.1 2.1.9-2.1.9-.9 2.1-.9-2.1-2.1-.9 2.1-.9z`})],-1),O(`span`,null,b(o.$t(`@EDITOR:g ai 对话`)),1)],10,St)])):r(`v-if`,!0),r(` 无文件打开时的提示 `),o.tabs.length===0?(h(),n(`div`,Ct,[(h(),n(`svg`,wt,[...i[29]||=[O(`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),O(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),O(`p`,null,b(o.$t(`@EDITOR:从左侧选择文件打开`)),1),O(`p`,Tt,b(o.$t(`@EDITOR:Ctrl+S 保存`)),1)])):r(`v-if`,!0),r(` Monaco 容器(始终挂载,tab 为空或 image tab 时隐藏) `),O(`div`,Et,[O(`div`,{class:s([`monaco-container`,{hidden:o.tabs.length===0||o.activeTabIsImage||o.activeTabIsOffice}]),ref:`editorContainerRef`},null,2),r(` 图片 tab 时的占位提示(主预览区在右侧 preview-panel) `),o.activeTabIsImage&&o.tabs.length>0&&!o.showPreview&&!o.showMindmap?(h(),n(`div`,$,[(h(),n(`svg`,Dt,[...i[30]||=[O(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`},null,-1),O(`circle`,{cx:`9`,cy:`9`,r:`2`},null,-1),O(`path`,{d:`m21 15-5-5L5 21`},null,-1)]])),O(`p`,Ot,b(o.activeTabRef?.name),1),O(`p`,kt,b(o.$t(`@EDITOR:这是图片文件,已在右侧预览面板中打开`)),1)])):r(`v-if`,!0),r(` 预览分隔条(在面板右侧,拉动调整面板宽度) `),(o.showPreview||o.showMindmap||o.showAgentChat)&&o.tabs.length>0?(h(),n(`div`,{key:1,class:`preview-resizer`,onMousedown:o.startPreviewResize},null,32)):r(`v-if`,!0),r(` g ai 对话面板:v-if 懒挂载 + v-show 保状态(切到预览再切回来,进行中的流还在) `),o.agentOpened?T((h(),p(o.EditorAgentPanel,{key:2,active:o.showAgentChat&&o.tabs.length>0,"active-file-path":o.activeTabPath,"active-file-name":o.activeTabRef?.name??``,style:g({flexBasis:o.previewWidth+`px`}),onClose:i[7]||=e=>o.showAgentChat=!1},null,8,[`active`,`active-file-path`,`active-file-name`,`style`])),[[x,o.showAgentChat&&o.tabs.length>0]]):r(`v-if`,!0),r(` 预览面板 `),(o.showPreview||o.showMindmap)&&o.tabs.length>0?(h(),n(`div`,{key:3,class:`preview-panel`,style:g({flexBasis:o.previewWidth+`px`})},[O(`div`,At,[O(`span`,jt,b(o.showMindmap?o.$t(`@EDITOR:思维导图`):o.$t(`@EDITOR:预览`)),1),O(`span`,Mt,b(o.activeExt.toUpperCase()),1),i[32]||=O(`div`,{class:`preview-header-spacer`},null,-1),O(`button`,{class:`preview-close-btn`,title:o.showMindmap?o.$t(`@EDITOR:关闭思维导图`):o.$t(`@EDITOR:关闭预览`),onClick:i[8]||=e=>o.showMindmap?o.showMindmap=!1:o.showPreview=!1},[...i[31]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[O(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),O(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Nt)]),O(`div`,Pt,[r(` 思维导图:整篇 markdown → 一张大导图 `),o.showMindmap&&o.activeExt===`md`&&o.activeTabRef?(h(),p(o.MindmapPreview,{key:0,content:o.activeTabRef.content,class:`preview-mindmap`},null,8,[`content`])):o.showPreview&&o.activeExt===`md`&&o.activeTabRef?(h(),n(k,{key:1},[r(` Markdown → in-app 渲染 `),l(o.MarkdownPreview,{content:o.activeTabRef.content,class:`preview-markdown`},null,8,[`content`])],2112)):o.showPreview&&[`html`,`htm`,`svg`].includes(o.activeExt)?(h(),n(k,{key:2},[r(` HTML / SVG → sandboxed iframe (JS 可执行,不透明 origin 隔离宿主) `),O(`iframe`,{class:`preview-iframe`,sandbox:o.PREVIEW_IFRAME_SANDBOX,srcdoc:o.previewSrcdoc},null,8,Ft)],2112)):o.showPreview&&o.IMAGE_EXTS.has(o.activeExt)&&o.activeTabRef?(h(),n(k,{key:3},[r(` 图片预览(使用增强版 ImagePreview,支持缩放/拖拽) `),l(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?(h(),p(o.OfficePreview,{key:4,"file-path":o.activeTabRef.path},null,8,[`file-path`])):r(`v-if`,!0)])],4)):r(`v-if`,!0)])])],512),r(` 右键菜单 `),(h(),p(ne,{to:`body`},[o.ctxMenu?(h(),n(`div`,{key:0,ref:`ctxMenuRef`,class:`ctx-menu`,style:g({left:o.ctxMenu.x+`px`,top:o.ctxMenu.y+`px`}),onClick:i[9]||=D(()=>{},[`stop`])},[O(`button`,{class:`ctx-menu-item`,onClick:o.ctxNewFile},[i[33]||=O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`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`}),O(`polyline`,{points:`14 2 14 8 20 8`}),O(`line`,{x1:`12`,y1:`13`,x2:`12`,y2:`19`}),O(`line`,{x1:`9`,y1:`16`,x2:`15`,y2:`16`})],-1),C(` `+b(o.$t(`@EDITOR:新建文件`)),1)]),O(`button`,{class:`ctx-menu-item`,onClick:o.ctxNewFolder},[i[34]||=O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`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`}),O(`line`,{x1:`12`,y1:`11`,x2:`12`,y2:`17`}),O(`line`,{x1:`9`,y1:`14`,x2:`15`,y2:`14`})],-1),C(` `+b(o.$t(`@EDITOR:新建文件夹`)),1)]),i[41]||=O(`div`,{class:`ctx-menu-sep`},null,-1),O(`button`,{class:`ctx-menu-item`,onClick:o.ctxCopyAbsolutePath},[i[35]||=O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),O(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})],-1),C(` `+b(o.$t(`@EDITOR:复制绝对路径`)),1)]),O(`button`,{class:`ctx-menu-item`,onClick:o.ctxCopyRelativePath},[i[36]||=O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}),O(`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`})],-1),C(` `+b(o.$t(`@EDITOR:复制相对路径`)),1)]),i[42]||=O(`div`,{class:`ctx-menu-sep`},null,-1),r(` 只有 HTML 才有"用浏览器打开":浏览器能直接渲染出结果 `),o.ctxMenuCanOpenInBrowser?(h(),n(`button`,{key:0,class:`ctx-menu-item`,onClick:o.ctxOpenInBrowser},[i[37]||=O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`circle`,{cx:`12`,cy:`12`,r:`9`}),O(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),O(`path`,{d:`M12 3a13 13 0 0 1 3.5 9 13 13 0 0 1-3.5 9 13 13 0 0 1-3.5-9A13 13 0 0 1 12 3z`})],-1),C(` `+b(o.$t(`@EDITOR:在浏览器中打开`)),1)])):r(`v-if`,!0),O(`button`,{class:`ctx-menu-item`,onClick:o.ctxRevealInExplorer},[i[38]||=O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`path`,{d:`M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}),O(`path`,{d:`M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2`})],-1),C(` `+b(o.$t(`@EDITOR:在资源管理器中打开`)),1)]),O(`button`,{class:`ctx-menu-item`,onClick:o.ctxOpenInVscode},[l(o.SvgIcon,{"icon-class":`vscode`,"class-name":`ctx-menu-icon`}),C(` `+b(o.$t(`@EDITOR:在 VSCode 中打开`)),1)]),O(`button`,{class:`ctx-menu-item`,onClick:o.ctxRename},[i[39]||=O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),O(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`})],-1),C(` `+b(o.$t(`@EDITOR:重命名`)),1)]),O(`button`,{class:`ctx-menu-item ctx-menu-item--danger`,onClick:o.ctxDelete},[i[40]||=O(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[O(`polyline`,{points:`3 6 5 6 21 6`}),O(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),O(`path`,{d:`M10 11v6`}),O(`path`,{d:`M14 11v6`}),O(`path`,{d:`M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2`})],-1),C(` `+b(o.$t(`@EDITOR:删除`)),1)])],4)):r(`v-if`,!0)]))],64)}var Lt=se(Ge,[[`render`,It],[`__scopeId`,`data-v-fc2ebf13`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/views/EditorView.vue`]]);export{Lt as default};
@@ -1 +0,0 @@
1
- .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}.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-tertiary);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-icon-btn[data-v-7cc12c51]{border-radius:var(--radius-xs);width:24px;height:24px;color:var(--text-tertiary);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]{grid-template-columns:240px minmax(0,1fr);grid-template-areas:"list chat""list composer"}.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-chat[data-v-7cc12c51]>.acu-chat{flex:1;min-width: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-tertiary);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-tertiary);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-tertiary)}.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-tertiary);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}.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-tertiary);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-tertiary);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-tertiary);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)}.editor-empty[data-v-fc2ebf13]{color:var(--text-tertiary);font-size:var(--font-size-mid);-webkit-user-select:none;user-select:none;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:10px;display:flex}.editor-empty p[data-v-fc2ebf13]{margin:0}.editor-empty-hint[data-v-fc2ebf13]{font-size:var(--font-size-xs);opacity:.6}.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-tertiary);margin:0}.editor-body[data-v-fc2ebf13]{flex:1;min-height:0;display:flex;overflow:hidden}.preview-resizer[data-v-fc2ebf13]{cursor:col-resize;width:6px;transition:background var(--transition-fast);z-index:2;background:0 0;flex-shrink:0;order:99;margin-left:auto;position:relative}.preview-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%)}.preview-resizer[data-v-fc2ebf13]:hover{background:var(--tint-primary-06)}.preview-resizer[data-v-fc2ebf13]:hover:after{background:var(--color-primary);height:48px;box-shadow:0 0 8px #3b82f666}.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-tertiary);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);background:var(--bg-hover)}.preview-body[data-v-fc2ebf13]{flex-direction:column;flex:1;display:flex;overflow:hidden}.preview-iframe[data-v-fc2ebf13]{background:0 0;border:none;flex:1;width:100%;height:100%}.preview-markdown[data-v-fc2ebf13]{background:var(--bg-container,#fff);width:100%;height:100%;color:var(--text-primary,var(--md-text-strong));flex:1;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:9999;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)}.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}
@@ -1 +0,0 @@
1
- .dir-chat[data-v-a2b1a866]{height:min(340px,34vh);min-height:200px;margin-top:var(--spacing-sm);border-top:1px solid var(--border-color-light);padding-top:var(--spacing-sm);display:flex}.dir-chat[data-v-a2b1a866]>.acu-chat{flex:1;min-width:0}.dir-chat--fill[data-v-a2b1a866]{flex:auto;height:auto;min-height:0}.dir-chat[data-v-a2b1a866] .acu-welcome{padding:var(--spacing-base)}.dir-chat[data-v-a2b1a866] .acu-welcome-logo{display:none}.dir-chat[data-v-a2b1a866] .acu-welcome-title{font-size:var(--font-size-lg);margin-bottom:var(--spacing-xs)}.dir-chat[data-v-a2b1a866] .acu-welcome-desc{font-size:var(--font-size-sm);margin-bottom:var(--spacing-base)}.dir-chat[data-v-a2b1a866] .acu-welcome-grid{gap:var(--spacing-sm)}
@@ -1 +0,0 @@
1
- import{Cn as e,Dn as t,Fr as n,Jr as r,Kn as i,Mn as a,Pn as o,Rn as s,Xn as c}from"./element-plus-AaVXaSqv.js";import{t as l}from"./vendor-B5GNSK12.js";import{n as u,t as d}from"./_plugin-vue_export-helper-Ut942ckG.js";import{t as f}from"./useThemeObserver-CiUpR4zj.js";import{o as p,r as m,t as h}from"./agentConversations-C2864Cya.js";s();var g=o({__name:`RecentDirectoriesChat`,props:{dirStatus:{type:Array,required:!0},summary:{type:String,required:!1},fill:{type:Boolean,required:!1}},setup(t,{expose:n}){n();let r=t,{theme:a}=f(),o=e(()=>a.value===`dark`?`dark`:`light`),{messages:s,isStreaming:c,pendingQuestion:d,answeringQuestion:g,sendMessage:_,answerQuestion:v,stop:y}=p(),b=m(),x=e(()=>[{id:`priority`,label:u(`@13D1C:这些项目该先处理哪个?`),prompt:u(`@13D1C:这些项目里该先处理哪个?按优先级给我一个处理顺序,并说明每一项该做什么。`)},{id:`behind`,label:u(`@13D1C:哪些项目落后远端?`),prompt:u(`@13D1C:哪些项目落后远端?分别落后多少个提交?`)}]);async function S(e){await _(e.text,e.files,{engine:`gai`,dirStatus:r.dirStatus,dirSummary:r.summary})}i(()=>{y()});let C={props:r,theme:a,chatTheme:o,messages:s,isStreaming:c,pendingQuestion:d,answeringQuestion:g,sendMessage:_,answerQuestion:v,stop:y,questionLabels:b,presetQuestions:x,onSend:S,get ChatContainer(){return l},get $t(){return u},get AGENT_ASSISTANT_NAME(){return h}};return Object.defineProperty(C,"__isScriptSetup",{enumerable:!1,value:!0}),C}});s(),n();function _(e,n,i,o,s,l){return c(),t(`div`,{class:r([`dir-chat`,{"dir-chat--fill":i.fill}])},[a(o.ChatContainer,{messages:o.messages,"assistant-name":o.AGENT_ASSISTANT_NAME,theme:o.chatTheme,disabled:o.isStreaming,generating:o.isStreaming,"show-avatar":!1,"upload-config":{enabled:!1},placeholder:o.isStreaming?o.$t(`@13D1C:g ai 正在回答...`):o.$t(`@13D1C:追问 g ai:这批项目该怎么处理?`),"welcome-title":o.$t(`@13D1C:可以接着问 g ai`),"welcome-description":o.$t(`@13D1C:它已经拿到了这批目录的 Git 状态,可以直接问该先处理哪个、某个项目落后了什么。`),"preset-questions":o.presetQuestions,question:o.pendingQuestion,"question-submitting":o.answeringQuestion,"question-labels":o.questionLabels,onSend:o.onSend,onStop:o.stop,onAnswer:o.answerQuestion},null,8,[`messages`,`assistant-name`,`theme`,`disabled`,`generating`,`placeholder`,`welcome-title`,`welcome-description`,`preset-questions`,`question`,`question-submitting`,`question-labels`,`onStop`,`onAnswer`])],2)}var v=d(g,[[`render`,_],[`__scopeId`,`data-v-a2b1a866`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/RecentDirectoriesChat.vue`]]);export{v as default};