zen-gitsync 2.12.7 → 2.12.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -2
- package/package.json +1 -1
- package/src/ui/public/assets/{EditorView-DK-Xgt7r.css → EditorView-DEd8QuPp.css} +1 -1
- package/src/ui/public/assets/EditorView-DkH7PwMR.js +0 -0
- package/src/ui/public/assets/SourceMapView-BG6MIju7.js +3 -0
- package/src/ui/public/assets/SourceMapView-P9hbpXgz.css +1 -0
- package/src/ui/public/assets/WorkbenchView-CDKIBwuO.css +1 -0
- package/src/ui/public/assets/WorkbenchView-DgwZOvhW.js +1 -0
- package/src/ui/public/assets/_plugin-vue_export-helper-opDPZuCO.js +9 -0
- package/src/ui/public/assets/index-DPihtJfT.js +65 -0
- package/src/ui/public/assets/{index-a-r8YYZJ.css → index-tejX3YgJ.css} +1 -1
- package/src/ui/public/assets/{vendor-BMFU1ekz.js → vendor-A4IPqbyo.js} +204 -204
- package/src/ui/public/assets/{vendor-BPPhhD0O.css → vendor-DpYOE9sy.css} +1 -1
- package/src/ui/public/index.html +5 -4
- package/src/ui/server/index.js +9 -0
- package/src/ui/server/routes/workbench.js +873 -0
- package/src/ui/public/assets/EditorView-DDyMmxPI.js +0 -0
- package/src/ui/public/assets/SourceMapView-DakscAmd.js +0 -3
- package/src/ui/public/assets/SourceMapView-DyMK80hS.css +0 -1
- package/src/ui/public/assets/index-CPUqt5Ue.js +0 -73
|
Binary file
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{An as t,Bn as n,Dn as r,En as i,Gn as a,In as o,Mn as s,Nn as c,P as l,Pn as u,Sn as ee,Un as d,Vn as te,Xn as f,Yn as ne,Zn as p,_ as re,ar as m,bn as ie,c as ae,d as h,er as g,f as oe,g as _,h as se,ht as ce,ir as v,kn as y,m as le,nr as b,p as ue,rr as x,t as de,tr as fe,v as pe,wn as S,xn as C,y as me,zn as w}from"./vendor-BMFU1ekz.js";import{a as T,i as he,n as ge,o as E}from"./index-CPUqt5Ue.js";var _e=e(h(),1),ve={class:`source-map-view`},ye={class:`sm-toolbar`},be={class:`sm-toolbar-left`},xe={class:`sm-title`},Se={class:`sm-toolbar-center`},Ce=[`placeholder`,`disabled`],we=[`disabled`],Te={class:`sm-toolbar-right`},Ee={class:`sm-body`},De={class:`sm-panel-header sm-panel-header--tabs`},Oe={key:0,class:`sm-badge`},ke={class:`sm-panel-body sm-file-tree`},Ae=[`onClick`],je={key:1,class:`sm-tree-arrow-spacer`},Me={key:2,class:`sm-tree-icon mit-icon`,"aria-hidden":`true`},Ne=[`xlink:href`],Pe={key:3,class:`sm-tree-icon mit-icon`,"aria-hidden":`true`},Fe=[`xlink:href`],Ie=[`title`],Le={key:1,class:`sm-tree-empty`},Re={class:`sm-panel-body sm-outline-body`},ze={class:`sm-badge`,style:{"margin-left":`auto`}},Be=[`onClick`],Ve=[`title`],He={key:0,class:`sm-outline-desc`},Ue={key:1,class:`sm-tree-empty`},We={class:`sm-panel sm-panel-graph`},Ge={key:0,class:`sm-project-info`},Ke={class:`sm-lang-badge`},qe={class:`sm-summary-text`},Je={class:`sm-graph-container`},Ye={class:`sm-layout-btn-wrap`},Xe=[`disabled`],Ze=[`title`],Qe={class:`sm-fn-label`},$e={key:0,class:`sm-fn-desc`},et={key:0,class:`sm-graph-empty`},tt={viewBox:`0 0 24 24`,width:`48`,height:`48`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,style:{opacity:`0.3`}},nt={key:1,class:`sm-graph-loading`},rt={class:`sm-log-header`},it={key:0,class:`sm-log-indicator`},at={class:`sm-log-body`,ref:`logBodyRef`},ot={key:0,class:`sm-empty`},st={class:`sm-panel-header`},ct={key:0,class:`sm-badge sm-badge-amber`},lt={key:0,class:`sm-node-detail`},ut={class:`sm-node-name`},dt={class:`sm-node-file`},ft={key:0},pt={key:0,class:`sm-node-desc`},mt={class:`sm-panel-body sm-source-body`},ht={key:0,class:`sm-source-overlay`},gt={key:1,class:`sm-source-overlay sm-source-placeholder`},D=T(o({__name:`SourceMapView`,setup(e){let o=he(),h=g(o.currentDirectory||``),T=g(`idle`),D=g([]),_t=0,O=g(null),k=g(null),A=g(`files`),j=g(``),M=g(``),N=g(!1),P=g([]),F=g(new Set),I=g({files:!0,graph:!0,source:!0}),L=g(!1),R=g(220),z=g(360),B=g(140),V=null,H=0,vt=0,U=0;function W(e,t){V=e,H=t.clientX,vt=t.clientY,U=e===`files`?R.value:e===`source`?z.value:B.value,document.addEventListener(`mousemove`,yt),document.addEventListener(`mouseup`,G),t.preventDefault()}function yt(e){V&&(V===`files`?R.value=Math.max(120,Math.min(480,U+e.clientX-H)):V===`source`?z.value=Math.max(200,Math.min(700,U+H-e.clientX)):B.value=Math.max(60,Math.min(500,U+vt-e.clientY)))}function G(){V=null,document.removeEventListener(`mousemove`,yt),document.removeEventListener(`mouseup`,G)}let K=g(null),q=fe(null),{fitView:bt,setNodes:J,setEdges:xt,getNodes:St,getEdges:Ct,updateNodeInternals:wt}=me(),Y=i(()=>T.value===`scanning`||T.value===`analyzing`),X=i(()=>O.value?.nodes.find(e=>e.id===k.value)??null),Tt=i(()=>{if(!O.value)return[];let e=new Map;for(let t of O.value.nodes){let n=t.subsystem??`__default__`;if(!e.has(n)){let r=O.value.subsystems?.find(e=>e.name===n);e.set(n,{displayName:r?.displayName||t.subsystem||E(`@SRCMAP:默认`),color:t.subsystemColor||Q[0],nodes:[]})}e.get(n).nodes.push(t)}return[...e.entries()].map(([,e])=>e)});function Z(e,t=`info`){D.value.push({id:++_t,message:e,type:t,timestamp:Date.now()}),D.value.length>200&&D.value.splice(0,D.value.length-200)}function Et(e){let t={name:``,path:``,kind:`dir`,children:[],childMap:new Map};for(let n of e){let e=n.trim().split(`/`).filter(Boolean),r=t,i=``;for(let t=0;t<e.length;t++){let n=e[t];i=i?`${i}/${n}`:n;let a=t===e.length-1,o=r.childMap.get(n);o||(o={name:n,path:i,kind:a?`file`:`dir`,children:[],childMap:new Map},r.childMap.set(n,o),r.children.push(o)),r=o}}let n=e=>{e.sort((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1),e.forEach(e=>{e.kind===`dir`&&n(e.children)})};return n(t.children),t.children}let Q=[`#f59e0b`,`#3b82f6`,`#10b981`,`#8b5cf6`];function Dt(e){return e.subsystemColor?e.subsystemColor:e.subsystemIndex===void 0?e.importance===`high`?`#f59e0b`:e.importance===`low`?`#94a3b8`:`#3b82f6`:Q[e.subsystemIndex%Q.length]}function Ot(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`javascript`,vue:`html`,svelte:`html`,html:`html`,py:`python`,java:`java`,go:`go`,rs:`rust`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,c:`c`,h:`c`,hpp:`cpp`,cs:`csharp`,rb:`ruby`,php:`php`,swift:`swift`,kt:`kotlin`,sh:`shell`,bash:`shell`,json:`json`,yaml:`yaml`,yml:`yaml`,md:`markdown`,css:`css`,scss:`scss`,less:`less`,sql:`sql`}[e.split(`.`).pop()?.toLowerCase()||``]||`plaintext`}function kt(){if(!K.value||q.value)return;let e=document.documentElement.getAttribute(`data-theme`)===`dark`;q.value=ae.create(K.value,{value:``,language:`plaintext`,theme:e?`vs-dark`:`vs`,readOnly:!0,fontSize:12,lineHeight:19,fontFamily:`'JetBrains Mono', 'Fira Code', Consolas, monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,automaticLayout:!0,wordWrap:`off`,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6}})}function At(e,t){let n={};t.forEach(e=>{n[e.source]||(n[e.source]=[]),n[e.source].push(e.target)});let r=new Map;e.forEach(e=>{let t=e.subsystem??`__default`;r.has(t)||r.set(t,[]),r.get(t).push(e)});let i=[],a=0;for(let[,e]of r){let t=new Set(e.map(e=>e.id)),r={},o=e.length?[e[0].id]:[];for(o[0]&&(r[o[0]]=0);o.length;){let e=o.shift();(n[e]||[]).filter(e=>t.has(e)).forEach(t=>{r[t]===void 0&&(r[t]=(r[e]??0)+1,o.push(t))})}let s={};e.forEach(e=>{let t=r[e.id]??0;s[t]=(s[t]||0)+1});let c={};e.forEach(e=>{let t=r[e.id]??0;c[t]=(c[t]??-1)+1;let n=c[t],o=s[t]??1,l=a*600+n*220-(o-1)*220/2,u=t*110,ee=Dt(e);i.push({id:e.id,type:`default`,position:{x:l,y:u},label:e.label,data:{...e},style:{background:`#1e293b`,border:`2px solid ${ee}`,borderRadius:`8px`,color:`#e2e8f0`,fontSize:`12px`,padding:`8px 12px`,minWidth:`140px`,maxWidth:`200px`,cursor:`pointer`}})}),a++}return{flowNodes:i,flowEdges:t.map((e,t)=>({id:`e_${t}_${e.source}_${e.target}`,source:e.source,target:e.target,type:`smoothstep`,animated:!1,style:{stroke:`#475569`,strokeWidth:1.5},markerEnd:{type:se.ArrowClosed,color:`#475569`}}))}}async function jt(){let e=St.value,t=Ct.value;if(e.length!==0){L.value=!0;try{await w(),await new Promise(e=>requestAnimationFrame(()=>e())),wt(e.map(e=>e.id)),await new Promise(e=>requestAnimationFrame(()=>e()));let n=new Map;e.forEach(e=>{let t=e.data?.subsystem??`__default__`;n.has(t)||n.set(t,[]),n.get(t).push(e)});let r=new Map,i=0;for(let[,e]of n){let n=new _e.default.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:`TB`,nodesep:55,ranksep:75,marginx:40,marginy:40});let a=new Set(e.map(e=>e.id));e.forEach(e=>{let t=190,r=e.data?.description?68:48,i=document.querySelector(`.vue-flow__node[data-id="${e.id}"]`);i&&i.offsetWidth>0&&(t=i.offsetWidth,r=i.offsetHeight),n.setNode(e.id,{width:t,height:r})}),t.forEach(e=>{a.has(e.source)&&a.has(e.target)&&n.setEdge(e.source,e.target)}),_e.default.layout(n);let o=0;e.forEach(e=>{let t=n.node(e.id);t&&(r.set(e.id,{x:i+t.x-t.width/2,y:t.y-t.height/2}),o=Math.max(o,t.x+t.width/2))}),i+=o+120}J(e.map(e=>({...e,position:r.get(e.id)??e.position}))),await w(),bt({padding:.18})}finally{L.value=!1}}}async function Mt(){if(!h.value.trim()){l.warning(E(`@SRCMAP:请先输入项目路径`));return}if(!Y.value){D.value=[],O.value=null,k.value=null,j.value=``,M.value=``,J([]),xt([]),T.value=`scanning`,Z(E(`@SRCMAP:开始分析项目...`),`info`);try{let e=await fetch(`/api/code-analysis/analyze`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:h.value})});if(!e.ok){let t=await e.json().catch(()=>({error:`请求失败`}));throw Error(t.error||`HTTP ${e.status}`)}let t=e.body.getReader(),n=new TextDecoder,r=``;T.value=`analyzing`;let i=``,a=[];for(;;){let{done:e,value:o}=await t.read();if(e)break;r+=n.decode(o,{stream:!0});let s=r.split(`
|
|
2
|
-
`);r=s.pop()??``;for(let e of s)if(e.startsWith(`event:`))i=e.slice(6).trim(),a=[];else if(e.startsWith(`data:`))a.push(e.slice(5).trim());else if(e===``){if(i&&a.length){let e=a.join(``);try{let t=JSON.parse(e);Nt(i,t)}catch{}}i=``,a=[]}}}catch(e){Z(`${E(`@SRCMAP:分析失败`)}: ${e.message}`,`error`),T.value=`error`}}}function Nt(e,t){if(e===`log`)Z(t.message,t.type||`info`);else if(e===`files`)P.value=Et(t.files||[]),P.value.forEach(e=>{e.kind===`dir`&&F.value.add(e.path)});else if(e===`result`){O.value={language:t.language||``,entryFile:t.entryFile||``,entryFunction:t.entryFunction||``,nodes:Array.isArray(t.nodes)?t.nodes:[],edges:Array.isArray(t.edges)?t.edges:[],techStack:Array.isArray(t.techStack)?t.techStack:[],summary:t.summary||``,allFiles:Array.isArray(t.allFiles)?t.allFiles:[],codeFiles:Array.isArray(t.codeFiles)?t.codeFiles:[],subsystems:Array.isArray(t.subsystems)?t.subsystems:void 0};let{flowNodes:e,flowEdges:n}=At(O.value.nodes,O.value.edges);J(e),xt(n),w(()=>jt())}else e===`done`&&(t.error?(Z(`${E(`@SRCMAP:分析失败`)}: ${t.error}`,`error`),T.value=`error`):T.value=`done`)}async function $(e){if(!(!e||N.value)&&M.value!==e){N.value=!0,M.value=e,j.value=``;try{let t=await(await fetch(`/api/code-analysis/file-content?path=${encodeURIComponent(h.value)}&file=${encodeURIComponent(e)}`)).json();if(t.error)throw Error(t.error);j.value=t.content||``}catch(e){j.value=`// ${E(`@SRCMAP:加载失败`)}: ${e.message}`}finally{N.value=!1}}}function Pt(e){let t=e.node.data;k.value=t.id,t.file&&$(t.file)}function Ft(e){F.value.has(e)?F.value.delete(e):F.value.add(e)}let It=i(()=>{let e=[];function t(n,r){for(let i of n){let n=F.value.has(i.path);e.push({name:i.name,path:i.path,kind:i.kind,depth:r,expanded:n}),i.kind===`dir`&&n&&t(i.children,r+1)}}return t(P.value,0),e});return ne(()=>o.currentDirectory,e=>{e&&!h.value&&(h.value=e)}),ne([j,M],([e,t])=>{let n=q.value;if(!n)return;let r=Ot(t||``),i=n.getModel(),a=ae.createModel(e||``,r);n.setModel(a),i?.dispose(),n.setScrollPosition({scrollTop:0,scrollLeft:0})}),te(()=>{kt(),!h.value&&o.currentDirectory&&(h.value=o.currentDirectory)}),n(()=>{q.value?.getModel()?.dispose(),q.value?.dispose(),G()}),(e,n)=>{let i=ce;return d(),t(`div`,ve,[r(`div`,ye,[r(`div`,be,[n[9]||=r(`svg`,{viewBox:`0 0 24 24`,width:`18`,height:`18`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,class:`sm-icon-map`},[r(`polygon`,{points:`3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21`}),r(`line`,{x1:`9`,y1:`3`,x2:`9`,y2:`18`}),r(`line`,{x1:`15`,y1:`6`,x2:`15`,y2:`21`})],-1),r(`span`,xe,m(b(E)(`@SRCMAP:源码地图`)),1)]),r(`div`,Se,[p(r(`input`,{"onUpdate:modelValue":n[0]||=e=>h.value=e,class:`sm-path-input`,placeholder:b(E)(`@SRCMAP:输入项目目录路径`),disabled:Y.value,onKeydown:ee(Mt,[`enter`])},null,40,Ce),[[ie,h.value]]),r(`button`,{class:`sm-btn sm-btn-primary`,disabled:Y.value,onClick:Mt},[Y.value?(d(),t(S,{key:0},[n[10]||=r(`span`,{class:`sm-spinner`},null,-1),c(` `+m(b(E)(`@SRCMAP:分析中...`)),1)],64)):(d(),t(S,{key:1},[c(m(T.value===`done`?b(E)(`@SRCMAP:重新分析`):b(E)(`@SRCMAP:开始分析`)),1)],64))],8,we)]),r(`div`,Te,[u(i,{content:b(E)(`@SRCMAP:文件列表`),placement:`bottom`},{default:f(()=>[r(`button`,{class:x([`sm-panel-btn`,{active:I.value.files}]),onClick:n[1]||=e=>I.value.files=!I.value.files},[...n[11]||=[r(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[r(`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`})],-1)]],2)]),_:1},8,[`content`]),u(i,{content:b(E)(`@SRCMAP:调用图`),placement:`bottom`},{default:f(()=>[r(`button`,{class:x([`sm-panel-btn`,{active:I.value.graph}]),onClick:n[2]||=e=>I.value.graph=!I.value.graph},[...n[12]||=[r(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[r(`circle`,{cx:`12`,cy:`12`,r:`3`}),r(`circle`,{cx:`3`,cy:`6`,r:`2`}),r(`circle`,{cx:`21`,cy:`6`,r:`2`}),r(`circle`,{cx:`3`,cy:`18`,r:`2`}),r(`circle`,{cx:`21`,cy:`18`,r:`2`}),r(`line`,{x1:`5`,y1:`6`,x2:`9`,y2:`11`}),r(`line`,{x1:`19`,y1:`6`,x2:`15`,y2:`11`}),r(`line`,{x1:`5`,y1:`18`,x2:`9`,y2:`13`}),r(`line`,{x1:`19`,y1:`18`,x2:`15`,y2:`13`})],-1)]],2)]),_:1},8,[`content`]),u(i,{content:b(E)(`@SRCMAP:源码面板`),placement:`bottom`},{default:f(()=>[r(`button`,{class:x([`sm-panel-btn`,{active:I.value.source}]),onClick:n[3]||=e=>I.value.source=!I.value.source},[...n[13]||=[r(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[r(`polyline`,{points:`16 18 22 12 16 6`}),r(`polyline`,{points:`8 6 2 12 8 18`})],-1)]],2)]),_:1},8,[`content`])])]),r(`div`,Ee,[p(r(`div`,{class:`sm-panel sm-panel-files`,style:v({width:R.value+`px`})},[r(`div`,De,[r(`button`,{class:x([`sm-tab-btn`,{active:A.value===`files`}]),onClick:n[4]||=e=>A.value=`files`},[n[14]||=r(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[r(`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`})],-1),c(` `+m(b(E)(`@SRCMAP:文件列表`))+` `,1),O.value?(d(),t(`span`,Oe,m(O.value.allFiles.length),1)):y(``,!0)],2),r(`button`,{class:x([`sm-tab-btn`,{active:A.value===`outline`}]),onClick:n[5]||=e=>A.value=`outline`},[n[15]||=s(`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" data-v-39b8daed><line x1="8" y1="6" x2="21" y2="6" data-v-39b8daed></line><line x1="8" y1="12" x2="21" y2="12" data-v-39b8daed></line><line x1="8" y1="18" x2="21" y2="18" data-v-39b8daed></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-39b8daed></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-39b8daed></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-39b8daed></line></svg>`,1),c(` `+m(b(E)(`@SRCMAP:大纲`)),1)],2)]),p(r(`div`,ke,[It.value.length>0?(d(!0),t(S,{key:0},a(It.value,e=>(d(),t(`div`,{key:e.path,class:x([`sm-tree-node`,{"sm-tree-node--dir":e.kind===`dir`,"sm-tree-node--active":e.kind===`file`&&M.value===e.path}]),style:v({paddingLeft:10+e.depth*14+`px`}),onClick:t=>e.kind===`dir`?Ft(e.path):$(e.path)},[e.kind===`dir`?(d(),t(`span`,{key:0,class:x([`sm-tree-arrow`,{expanded:e.expanded}])},[...n[16]||=[r(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[r(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(d(),t(`span`,je)),e.kind===`dir`?(d(),t(`svg`,Me,[r(`use`,{"xlink:href":`#${b(ge)(e.name)||`icon-folder`}`},null,8,Ne)])):(d(),t(`svg`,Pe,[r(`use`,{"xlink:href":`#${b(ge)(e.name)}`},null,8,Fe)])),r(`span`,{class:`sm-tree-name`,title:e.path},m(e.name),9,Ie)],14,Ae))),128)):(d(),t(`div`,Le,m(b(E)(`@SRCMAP:暂无文件,请先开始分析`)),1))],512),[[C,A.value===`files`]]),p(r(`div`,Re,[Tt.value.length>0?(d(!0),t(S,{key:0},a(Tt.value,e=>(d(),t(`div`,{key:e.displayName,class:`sm-outline-group`},[r(`div`,{class:`sm-outline-group-header`,style:v({color:e.color})},[n[17]||=r(`svg`,{viewBox:`0 0 24 24`,width:`8`,height:`8`,fill:`currentColor`},[r(`circle`,{cx:`12`,cy:`12`,r:`6`})],-1),c(` `+m(e.displayName)+` `,1),r(`span`,ze,m(e.nodes.length),1)],4),(d(!0),t(S,null,a(e.nodes,n=>(d(),t(`div`,{key:n.id,class:x([`sm-outline-node`,{"sm-outline-node--active":k.value===n.id}]),onClick:e=>{k.value=n.id,n.file&&$(n.file)}},[r(`span`,{class:`sm-outline-dot`,style:v({background:e.color})},null,4),r(`span`,{class:`sm-outline-label`,title:n.file||n.label},m(n.label),9,Ve),n.description?(d(),t(`span`,He,m(n.description.length>18?n.description.slice(0,18)+`…`:n.description),1)):y(``,!0)],10,Be))),128))]))),128)):(d(),t(`div`,Ue,m(b(E)(`@SRCMAP:暂无分析结果`)),1))],512),[[C,A.value===`outline`]])],4),[[C,I.value.files]]),p(r(`div`,{class:`sm-resizer sm-resizer-v`,onMousedown:n[6]||=e=>W(`files`,e)},null,544),[[C,I.value.files&&I.value.graph]]),p(r(`div`,We,[O.value?(d(),t(`div`,Ge,[r(`span`,Ke,m(O.value.language),1),O.value.subsystems&&O.value.subsystems.length>1?(d(!0),t(S,{key:0},a(O.value.subsystems,e=>(d(),t(`span`,{key:e.name,class:`sm-subsystem-tag`,style:v({borderColor:e.color,color:e.color})},`● `+m(e.displayName||e.name),5))),128)):(d(!0),t(S,{key:1},a(O.value.techStack.slice(0,4),e=>(d(),t(`span`,{key:e,class:`sm-tech-tag`},m(e),1))),128)),r(`span`,qe,m(O.value.summary),1)])):y(``,!0),r(`div`,Je,[r(`div`,Ye,[r(`button`,{class:`sm-layout-btn`,disabled:L.value||!O.value,onClick:jt},[n[18]||=s(`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" data-v-39b8daed><rect x="3" y="3" width="7" height="7" rx="1" data-v-39b8daed></rect><rect x="14" y="3" width="7" height="7" rx="1" data-v-39b8daed></rect><rect x="3" y="14" width="7" height="7" rx="1" data-v-39b8daed></rect><rect x="14" y="14" width="7" height="7" rx="1" data-v-39b8daed></rect></svg>`,1),c(` `+m(L.value?b(E)(`@SRCMAP:布局中...`):b(E)(`@SRCMAP:优化布局`)),1)],8,Xe)]),u(b(re),{class:`sm-vue-flow`,"default-viewport":{zoom:1},"min-zoom":.2,"max-zoom":4,"fit-view-on-init":``,onNodeClick:Pt},{"node-default":f(({data:e,label:n})=>[u(b(pe),{type:`target`,position:b(_).Top},null,8,[`position`]),r(`div`,{class:`sm-fn-inner`,title:`${n}${e?.description?`
|
|
3
|
-
`+e.description:``}`},[r(`div`,Qe,m(n),1),e?.description?(d(),t(`div`,$e,m(e.description.length>22?e.description.slice(0,22)+`…`:e.description),1)):y(``,!0)],8,Ze),u(b(pe),{type:`source`,position:b(_).Bottom},null,8,[`position`])]),default:f(()=>[u(b(le),{variant:b(ue).Dots,gap:20,size:1,"pattern-color":`#334155`},null,8,[`variant`]),u(b(oe)),u(b(de),{"node-color":`#3b82f6`})]),_:1}),!O.value&&!Y.value?(d(),t(`div`,et,[(d(),t(`svg`,tt,[...n[19]||=[r(`polygon`,{points:`3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21`},null,-1),r(`line`,{x1:`9`,y1:`3`,x2:`9`,y2:`18`},null,-1),r(`line`,{x1:`15`,y1:`6`,x2:`15`,y2:`21`},null,-1)]])),r(`p`,null,m(b(E)(`@SRCMAP:输入项目路径后点击开始分析`)),1)])):y(``,!0),Y.value&&!O.value?(d(),t(`div`,nt,[n[20]||=r(`span`,{class:`sm-spinner sm-spinner-lg`},null,-1),r(`p`,null,m(b(E)(`@SRCMAP:AI 正在分析项目结构...`)),1)])):y(``,!0)]),r(`div`,{class:`sm-resizer sm-resizer-h`,onMousedown:n[7]||=e=>W(`log`,e)},null,32),r(`div`,{class:`sm-log-panel`,style:v({height:B.value+`px`})},[r(`div`,rt,[n[21]||=r(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[r(`polyline`,{points:`4 17 10 11 4 5`}),r(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})],-1),c(` `+m(b(E)(`@SRCMAP:Agent 日志`))+` `,1),Y.value?(d(),t(`span`,it)):y(``,!0)]),r(`div`,at,[(d(!0),t(S,null,a(D.value.slice(-50),e=>(d(),t(`div`,{key:e.id,class:x([`sm-log-entry`,`sm-log-entry--${e.type}`])},m(e.message),3))),128)),D.value.length===0?(d(),t(`div`,ot,m(b(E)(`@SRCMAP:等待开始分析`)),1)):y(``,!0)],512)],4)],512),[[C,I.value.graph]]),p(r(`div`,{class:`sm-resizer sm-resizer-v`,onMousedown:n[8]||=e=>W(`source`,e)},null,544),[[C,I.value.graph&&I.value.source]]),p(r(`div`,{class:`sm-panel sm-panel-source`,style:v({width:z.value+`px`})},[r(`div`,st,[n[22]||=r(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[r(`polyline`,{points:`16 18 22 12 16 6`}),r(`polyline`,{points:`8 6 2 12 8 18`})],-1),c(` `+m(M.value||b(E)(`@SRCMAP:源码面板`))+` `,1),X.value?(d(),t(`span`,ct,m(X.value.label),1)):y(``,!0)]),X.value?(d(),t(`div`,lt,[r(`div`,ut,m(X.value.label),1),r(`div`,dt,[c(m(X.value.file),1),X.value.line?(d(),t(`span`,ft,` :`+m(X.value.line),1)):y(``,!0)]),X.value.description?(d(),t(`div`,pt,m(X.value.description),1)):y(``,!0)])):y(``,!0),r(`div`,mt,[N.value?(d(),t(`div`,ht,[...n[23]||=[r(`span`,{class:`sm-spinner`},null,-1)]])):y(``,!0),!N.value&&!j.value?(d(),t(`div`,gt,m(b(E)(`@SRCMAP:点击调用图中的节点查看源码`)),1)):y(``,!0),r(`div`,{ref_key:`monacoContainerRef`,ref:K,class:`sm-monaco-container`},null,512)])],4),[[C,I.value.source]])])])}}}),[[`__scopeId`,`data-v-39b8daed`]]);export{D as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.source-map-view[data-v-39b8daed]{background:var(--bg-page,#0f172a);width:100%;height:100%;color:var(--text-primary,#e2e8f0);flex-direction:column;font-size:13px;display:flex;overflow:hidden}.sm-toolbar[data-v-39b8daed]{background:var(--bg-container,#1e293b);border-bottom:1px solid var(--border-color,#334155);flex-shrink:0;align-items:center;gap:12px;padding:8px 16px;display:flex}.sm-toolbar-left[data-v-39b8daed]{flex-shrink:0;align-items:center;gap:8px;display:flex}.sm-toolbar-center[data-v-39b8daed]{flex:1;align-items:center;gap:8px;display:flex}.sm-toolbar-right[data-v-39b8daed]{flex-shrink:0;align-items:center;gap:4px;display:flex}.sm-icon-map[data-v-39b8daed]{color:#f59e0b}.sm-title[data-v-39b8daed]{color:var(--text-primary,#e2e8f0);font-size:13px;font-weight:600}.sm-path-input[data-v-39b8daed]{background:var(--bg-page,#0f172a);border:1px solid var(--border-color,#334155);height:30px;color:var(--text-primary,#e2e8f0);border-radius:6px;outline:none;flex:1;padding:0 10px;font-family:Consolas,Monaco,monospace;font-size:12px;transition:border-color .15s}.sm-path-input[data-v-39b8daed]:focus{border-color:#f59e0b}.sm-path-input[data-v-39b8daed]:disabled{opacity:.6;cursor:not-allowed}.sm-btn[data-v-39b8daed]{cursor:pointer;white-space:nowrap;border:none;border-radius:6px;align-items:center;gap:6px;height:30px;padding:0 14px;font-size:12px;font-weight:500;transition:all .15s;display:inline-flex}.sm-btn-primary[data-v-39b8daed]{color:#fff;background:linear-gradient(135deg,#f59e0b,#d97706)}.sm-btn-primary[data-v-39b8daed]:hover:not(:disabled){background:linear-gradient(135deg,#fbbf24,#f59e0b)}.sm-btn-primary[data-v-39b8daed]:disabled{opacity:.6;cursor:not-allowed}.sm-panel-btn[data-v-39b8daed]{cursor:pointer;width:28px;height:28px;color:var(--text-tertiary,#64748b);background:0 0;border:1px solid #0000;border-radius:5px;justify-content:center;align-items:center;transition:all .15s;display:flex}.sm-panel-btn[data-v-39b8daed]:hover,.sm-panel-btn.active[data-v-39b8daed]{background:var(--bg-hover,#1e293b);border-color:var(--border-color,#334155);color:var(--text-primary,#e2e8f0)}.sm-panel-btn.active[data-v-39b8daed]{color:#f59e0b;border-color:#f59e0b40}.sm-body[data-v-39b8daed]{flex:1;min-height:0;display:flex;overflow:hidden}.sm-resizer[data-v-39b8daed]{z-index:2;background:0 0;flex-shrink:0;transition:background .15s;position:relative}.sm-resizer-v[data-v-39b8daed]{cursor:col-resize;width:6px}.sm-resizer-h[data-v-39b8daed]{cursor:row-resize;height:6px}.sm-resizer[data-v-39b8daed]:after{content:"";background:var(--border-color,#334155);border-radius:2px;transition:background .15s;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.sm-resizer-v[data-v-39b8daed]:after{width:2px;height:32px}.sm-resizer-h[data-v-39b8daed]:after{width:32px;height:2px}.sm-resizer[data-v-39b8daed]:hover{background:#3b82f60f}.sm-resizer[data-v-39b8daed]:hover:after{background:var(--color-primary,#3b82f6);box-shadow:0 0 8px #3b82f666}.sm-resizer-v[data-v-39b8daed]:hover:after{height:48px}.sm-resizer-h[data-v-39b8daed]:hover:after{width:48px}.sm-panel[data-v-39b8daed]{flex-direction:column;min-width:0;display:flex;overflow:hidden}.sm-panel-files[data-v-39b8daed]{background:var(--bg-container,#1e293b);border-right:1px solid var(--border-color,#334155);flex-shrink:0;min-width:0;overflow:hidden}.sm-panel-graph[data-v-39b8daed]{background:var(--bg-page,#0f172a);flex:1;min-width:300px}.sm-panel-source[data-v-39b8daed]{background:var(--bg-container,#1e293b);border-left:1px solid var(--border-color,#334155);flex-shrink:0}.sm-panel-header[data-v-39b8daed]{color:var(--text-secondary,#94a3b8);text-transform:uppercase;letter-spacing:.05em;border-bottom:1px solid var(--border-color,#334155);background:var(--bg-container,#1e293b);flex-shrink:0;align-items:center;gap:6px;padding:6px 10px;font-size:11px;font-weight:600;display:flex}.sm-panel-body[data-v-39b8daed]{flex:1;min-height:0;overflow:auto}.sm-project-info[data-v-39b8daed]{background:var(--bg-container,#1e293b);border-bottom:1px solid var(--border-color,#334155);flex-shrink:0;align-items:center;gap:6px;padding:6px 12px;display:flex;overflow:hidden}.sm-lang-badge[data-v-39b8daed]{color:#f59e0b;background:#f59e0b22;border:1px solid #f59e0b44;border-radius:4px;flex-shrink:0;align-items:center;padding:1px 7px;font-size:10px;font-weight:600;display:inline-flex}.sm-tech-tag[data-v-39b8daed]{color:#93c5fd;background:#3b82f611;border:1px solid #3b82f630;border-radius:4px;flex-shrink:0;align-items:center;padding:1px 6px;font-size:10px;display:inline-flex}.sm-subsystem-tag[data-v-39b8daed]{opacity:.85;background:0 0;border:1px solid;border-radius:4px;flex-shrink:0;align-items:center;gap:3px;padding:1px 7px;font-size:10px;font-weight:600;display:inline-flex}.sm-summary-text[data-v-39b8daed]{color:var(--text-tertiary,#64748b);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:11px;overflow:hidden}.sm-graph-container[data-v-39b8daed]{flex:1;min-height:0;position:relative;overflow:hidden}.sm-vue-flow[data-v-39b8daed]{width:100%;height:100%}.sm-graph-empty[data-v-39b8daed],.sm-graph-loading[data-v-39b8daed]{color:var(--text-tertiary,#64748b);pointer-events:none;flex-direction:column;justify-content:center;align-items:center;gap:12px;font-size:13px;display:flex;position:absolute;inset:0}.sm-log-panel[data-v-39b8daed]{border-top:1px solid var(--border-color,#334155);background:var(--bg-container,#1e293b);flex-direction:column;flex-shrink:0;min-height:60px;display:flex}.sm-log-header[data-v-39b8daed]{color:var(--text-tertiary,#64748b);text-transform:uppercase;letter-spacing:.05em;border-bottom:1px solid var(--border-color,#334155);flex-shrink:0;align-items:center;gap:6px;padding:4px 10px;font-size:10px;font-weight:600;display:flex}.sm-log-indicator[data-v-39b8daed]{background:#f59e0b;border-radius:50%;width:6px;height:6px;margin-left:auto;animation:1s infinite pulse-39b8daed}@keyframes pulse-39b8daed{0%,to{opacity:1}50%{opacity:.3}}.sm-log-body[data-v-39b8daed]{flex:1;padding:4px 0;font-family:Consolas,Monaco,monospace;font-size:11px;overflow-y:auto}.sm-log-entry[data-v-39b8daed]{padding:2px 10px;line-height:1.5}.sm-log-entry--info[data-v-39b8daed]{color:#94a3b8}.sm-log-entry--success[data-v-39b8daed]{color:#4ade80}.sm-log-entry--error[data-v-39b8daed]{color:#f87171}.sm-log-entry--thinking[data-v-39b8daed]{color:#f59e0b}.sm-file-tree[data-v-39b8daed]{flex:1;padding:4px 0;overflow:hidden auto}.sm-tree-node[data-v-39b8daed]{cursor:pointer;-webkit-user-select:none;user-select:none;height:24px;color:var(--text-primary,#e2e8f0);white-space:nowrap;box-sizing:border-box;border-radius:4px;align-items:center;gap:4px;padding-right:8px;font-size:13px;transition:background .1s;display:flex;overflow:hidden}.sm-tree-node[data-v-39b8daed]:hover{background:var(--bg-hover)}.sm-tree-node--active[data-v-39b8daed]{color:var(--color-primary,#3b82f6);background:#3b82f61f}.sm-tree-arrow[data-v-39b8daed]{color:var(--text-tertiary,#64748b);flex-shrink:0;align-items:center;width:12px;transition:transform .15s;display:flex}.sm-tree-arrow.expanded[data-v-39b8daed]{transform:rotate(90deg)}.sm-tree-arrow-spacer[data-v-39b8daed]{flex-shrink:0;width:12px;display:inline-block}.sm-tree-icon[data-v-39b8daed]{flex-shrink:0;align-items:center;font-size:14px;line-height:1;display:flex}.sm-tree-icon.mit-icon[data-v-39b8daed]{fill:currentColor;vertical-align:middle;width:14px;height:14px;display:inline-block}.sm-tree-name[data-v-39b8daed]{text-overflow:ellipsis;flex:1;min-width:0;font-size:13px;overflow:hidden}.sm-tree-empty[data-v-39b8daed]{color:var(--text-tertiary,#64748b);text-align:center;padding:24px 12px;font-size:12px}.sm-node-detail[data-v-39b8daed]{background:#f59e0b0c;border-bottom:1px solid #f59e0b22;flex-shrink:0;padding:8px 12px}.sm-node-name[data-v-39b8daed]{color:#f59e0b;font-family:Consolas,monospace;font-size:13px;font-weight:600}.sm-node-file[data-v-39b8daed]{color:var(--text-tertiary,#64748b);margin-top:2px;font-family:Consolas,monospace;font-size:10px}.sm-node-desc[data-v-39b8daed]{color:var(--text-secondary,#94a3b8);margin-top:4px;font-size:11px;line-height:1.4}.sm-source-body[data-v-39b8daed]{background:#0d1117;position:relative;overflow:hidden}.sm-monaco-container[data-v-39b8daed]{width:100%;height:100%}.sm-source-overlay[data-v-39b8daed]{z-index:10;color:var(--text-tertiary,#64748b);pointer-events:none;background:#0d111799;justify-content:center;align-items:center;font-size:12px;display:flex;position:absolute;inset:0}.sm-source-placeholder[data-v-39b8daed]{pointer-events:none;background:#0d1117}.sm-empty[data-v-39b8daed]{height:100%;min-height:60px;color:var(--text-tertiary,#64748b);text-align:center;justify-content:center;align-items:center;padding:12px;font-size:12px;display:flex}.sm-badge[data-v-39b8daed]{background:var(--bg-page,#0f172a);border:1px solid var(--border-color,#334155);color:var(--text-secondary,#94a3b8);border-radius:4px;align-items:center;margin-left:4px;padding:1px 6px;font-size:10px;font-weight:600;display:inline-flex}.sm-badge-amber[data-v-39b8daed]{color:#f59e0b;background:#f59e0b15;border-color:#f59e0b40}.sm-spinner[data-v-39b8daed]{border:2px solid #ffffff40;border-top-color:#fff;border-radius:50%;width:12px;height:12px;animation:.8s linear infinite spin-39b8daed;display:inline-block}.sm-spinner-lg[data-v-39b8daed]{border-width:3px;border-color:#f59e0b #f59e0b20 #f59e0b20;width:32px;height:32px}@keyframes spin-39b8daed{to{transform:rotate(360deg)}}[data-v-39b8daed] .vue-flow__background{background:#0f172a}[data-v-39b8daed] .vue-flow__controls{box-shadow:none;background:#1e293b;border:1px solid #334155;border-radius:8px}[data-v-39b8daed] .vue-flow__controls-button{color:#94a3b8;background:0 0;border:none}[data-v-39b8daed] .vue-flow__controls-button:hover{color:#e2e8f0;background:#0f172a}[data-v-39b8daed] .vue-flow__minimap{background:#1e293b;border:1px solid #334155;border-radius:6px}[data-v-39b8daed] .vue-flow__node{transition:box-shadow .15s}[data-v-39b8daed] .vue-flow__node:hover{box-shadow:0 0 0 2px #f59e0b80}[data-v-39b8daed] .vue-flow__node.selected{box-shadow:0 0 0 2px #f59e0b}.sm-layout-btn-wrap[data-v-39b8daed]{z-index:10;position:absolute;top:10px;right:10px}.sm-layout-btn[data-v-39b8daed]{background:var(--bg-container,#1e293b);border:1px solid var(--border-color,#334155);height:28px;color:var(--text-secondary,#94a3b8);cursor:pointer;white-space:nowrap;border-radius:6px;align-items:center;gap:5px;padding:0 10px;font-size:11px;font-weight:500;transition:all .15s;display:flex}.sm-layout-btn[data-v-39b8daed]:hover:not(:disabled){color:#f59e0b;background:#f59e0b08;border-color:#f59e0b50}.sm-layout-btn[data-v-39b8daed]:disabled{opacity:.45;cursor:not-allowed}.sm-fn-inner[data-v-39b8daed]{text-align:center;flex-direction:column;gap:3px;width:100%;min-width:0;display:flex;overflow:hidden}.sm-fn-label[data-v-39b8daed]{color:#e2e8f0;white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:12px;font-weight:600;overflow:hidden}.sm-fn-desc[data-v-39b8daed]{color:#94a3b8;white-space:nowrap;text-overflow:ellipsis;max-width:180px;font-size:10px;overflow:hidden}.sm-panel-header--tabs[data-v-39b8daed]{gap:0;height:32px;min-height:32px;padding:0}.sm-tab-btn[data-v-39b8daed]{cursor:pointer;height:100%;color:var(--text-tertiary,#64748b);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;background:0 0;border:none;border-bottom:2px solid #0000;flex:1;align-items:center;gap:4px;padding:0 8px;font-size:10px;font-weight:600;transition:all .15s;display:flex}.sm-tab-btn[data-v-39b8daed]:hover{color:var(--text-secondary,#94a3b8);background:var(--bg-hover)}.sm-tab-btn.active[data-v-39b8daed]{color:#f59e0b;border-bottom-color:#f59e0b}.sm-outline-body[data-v-39b8daed]{flex:1;padding:4px 0;overflow:hidden auto}.sm-outline-group[data-v-39b8daed]{margin-bottom:2px}.sm-outline-group-header[data-v-39b8daed]{text-transform:uppercase;letter-spacing:.06em;background:var(--bg-container,#1e293b);z-index:1;align-items:center;gap:5px;padding:5px 10px 3px;font-size:10px;font-weight:700;display:flex;position:sticky;top:0}.sm-outline-node[data-v-39b8daed]{cursor:pointer;align-items:center;gap:6px;height:26px;padding:0 8px 0 16px;transition:background .1s;display:flex;overflow:hidden}.sm-outline-node[data-v-39b8daed]:hover{background:var(--bg-hover)}.sm-outline-node--active[data-v-39b8daed]{background:#3b82f61f}.sm-outline-dot[data-v-39b8daed]{border-radius:50%;flex-shrink:0;width:6px;height:6px}.sm-outline-label[data-v-39b8daed]{color:var(--text-primary,#e2e8f0);white-space:nowrap;text-overflow:ellipsis;flex-shrink:0;max-width:80px;font-family:Consolas,monospace;font-size:12px;font-weight:500;overflow:hidden}.sm-outline-desc[data-v-39b8daed]{color:var(--text-tertiary,#64748b);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:10px;overflow:hidden}
|