zen-gitsync 2.13.21 → 2.13.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ui/public/assets/{AppVersionBadge-D9w7Usgz.js → AppVersionBadge-CS59-kD5.js} +1 -1
- package/src/ui/public/assets/{BranchSelector-BJpA20eU.js → BranchSelector-DulCErgN.js} +1 -1
- package/src/ui/public/assets/{CommandConsole-DUyDJSaq.js → CommandConsole-H1j4BsHx.js} +2 -2
- package/src/ui/public/assets/{CommitForm-BCWCchcJ.js → CommitForm-DIdLEAZ_.js} +1 -1
- package/src/ui/public/assets/{CustomCommandManager-DRzAgnp3.js → CustomCommandManager-Cm5yU0TM.js} +1 -1
- package/src/ui/public/assets/{EditorView-DuB3Btcp.js → EditorView-CTvDExIi.js} +0 -0
- package/src/ui/public/assets/{FileDiffViewer-DldATw5k.js → FileDiffViewer-C7Cosx8a.js} +1 -1
- package/src/ui/public/assets/{FlowExecutionViewer-BNuIB5Bi.js → FlowExecutionViewer-BeGTXBVV.js} +1 -1
- package/src/ui/public/assets/{FlowOrchestrationWorkspace-BcA7LT02.js → FlowOrchestrationWorkspace-CuqAZCaM.js} +1 -1
- package/src/ui/public/assets/{GitStatus-BFpSu8gV.js → GitStatus-DBDjyLJD.js} +1 -1
- package/src/ui/public/assets/{LogList-C4mS0mZ4.js → LogList-YCJ_gVWr.js} +1 -1
- package/src/ui/public/assets/{ProjectStartupButton-BBRjQvH3.js → ProjectStartupButton-gWSO3HCJ.js} +1 -1
- package/src/ui/public/assets/{RemoteRepoCard-OUVJTKSC.js → RemoteRepoCard-9iWOAx2g.js} +1 -1
- package/src/ui/public/assets/ResetToRemoteButton-BTIEz5PB.css +1 -0
- package/src/ui/public/assets/{ResetToRemoteButton-Bpqx8Rhc.js → ResetToRemoteButton-BckRJ_lM.js} +1 -1
- package/src/ui/public/assets/{SourceMapView-CDETiU3C.js → SourceMapView-DWBowIx1.js} +1 -1
- package/src/ui/public/assets/{TemplateManager-idRwh__b.js → TemplateManager-DiKpGMhi.js} +1 -1
- package/src/ui/public/assets/{UserInputNode-pnY8iicS.js → UserInputNode-CU11vBBn.js} +1 -1
- package/src/ui/public/assets/{WorkbenchView-B83HdnYr.js → WorkbenchView-BsVMwobR.js} +1 -1
- package/src/ui/public/assets/{index-Bi1D0fFa.js → index-BxxqloTb.js} +2 -2
- package/src/ui/public/assets/index-CDa9xf0V.css +1 -0
- package/src/ui/public/index.html +2 -2
- package/src/ui/server/routes/workbench.js +12 -9
- package/src/ui/public/assets/ResetToRemoteButton-DQuq2KfL.css +0 -1
- package/src/ui/public/assets/index-DYjISu_4.css +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{Cn as t,En as n,Fn as r,G as i,In as a,Nn as o,Qn as s,Sn as c,Vn as l,Yn as u,Zn as d,_r as f,a as ee,cn as p,cr as m,dn as h,gn as g,hn as _,hr as v,ln as te,lr as ne,mr as y,sn as re,vn as b,vr as x,wn as S,yn as C,zn as w}from"./element-plus-CJjFCgLP.js";import{n as T,t as ie}from"./_plugin-vue_export-helper-vLPduyLG.js";import{c as ae}from"./monaco-DC7mqInI.js";import{s as oe}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{Cn as t,En as n,Fn as r,G as i,In as a,Nn as o,Qn as s,Sn as c,Vn as l,Yn as u,Zn as d,_r as f,a as ee,cn as p,cr as m,dn as h,gn as g,hn as _,hr as v,ln as te,lr as ne,mr as y,sn as re,vn as b,vr as x,wn as S,yn as C,zn as w}from"./element-plus-CJjFCgLP.js";import{n as T,t as ie}from"./_plugin-vue_export-helper-vLPduyLG.js";import{c as ae}from"./monaco-DC7mqInI.js";import{s as oe}from"./index-BxxqloTb.js";import{a as se,c as ce,i as le,l as ue,n as de,o as fe,r as pe,s as me,t as he}from"./vue-flow-HHfhvx4N.js";import{t as E}from"./dagre-CWIGcX9d.js";import{t as ge}from"./fileIcon-B5p5pGN9.js";var _e=e(E(),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=ie(n({__name:`SourceMapView`,setup(e){let n=m(document.documentElement.getAttribute(`data-theme`)===`dark`?`dark`:`light`);function ie(){n.value=document.documentElement.getAttribute(`data-theme`)===`dark`?`dark`:`light`}let E=null,D=oe(),O=m(D.currentDirectory||``),k=m(`idle`),A=m([]),_t=0,j=m(null),M=m(null),N=m(`files`),P=m(``),F=m(``),I=m(!1),L=m([]),R=m(new Set),z=m({files:!0,graph:!0,source:!0}),B=m(!1),V=m(220),H=m(360),U=m(140),W=null,G=0,vt=0,K=0;function q(e,t){W=e,G=t.clientX,vt=t.clientY,K=e===`files`?V.value:e===`source`?H.value:U.value,document.addEventListener(`mousemove`,yt),document.addEventListener(`mouseup`,J),t.preventDefault()}function yt(e){W&&(W===`files`?V.value=Math.max(120,Math.min(480,K+e.clientX-G)):W===`source`?H.value=Math.max(200,Math.min(700,K+G-e.clientX)):U.value=Math.max(60,Math.min(500,K+vt-e.clientY)))}function J(){W=null,document.removeEventListener(`mousemove`,yt),document.removeEventListener(`mouseup`,J)}let Y=m(null),X=ne(null),{fitView:bt,setNodes:xt,setEdges:St,getNodes:Ct,getEdges:wt,updateNodeInternals:Tt}=ue(),Z=_(()=>k.value===`scanning`||k.value===`analyzing`),Et=_(()=>n.value===`dark`?`#334155`:`#cbd5e1`),Q=_(()=>j.value?.nodes.find(e=>e.id===M.value)??null),Dt=_(()=>{if(!j.value)return[];let e=new Map;for(let t of j.value.nodes){let n=t.subsystem??`__default__`;if(!e.has(n)){let r=j.value.subsystems?.find(e=>e.name===n);e.set(n,{displayName:r?.displayName||t.subsystem||T(`@SRCMAP:默认`),color:t.subsystemColor||kt[0],nodes:[]})}e.get(n).nodes.push(t)}return[...e.entries()].map(([,e])=>e)});function $(e,t=`info`){A.value.push({id:++_t,message:e,type:t,timestamp:Date.now()}),A.value.length>200&&A.value.splice(0,A.value.length-200)}function Ot(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 kt=[`#f59e0b`,`#3b82f6`,`#10b981`,`#8b5cf6`];function At(e){return e.subsystemColor?e.subsystemColor:e.subsystemIndex===void 0?e.importance===`high`?`#f59e0b`:e.importance===`low`?`#94a3b8`:`#3b82f6`:kt[e.subsystemIndex%kt.length]}function jt(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 Mt(){!Y.value||X.value||(X.value=ae.create(Y.value,{value:``,language:`plaintext`,theme:n.value===`dark`?`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}}))}u(n,e=>{X.value&&ae.setTheme(e===`dark`?`vs-dark`:`vs`)});function Nt(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,d=At(e);i.push({id:e.id,type:`default`,position:{x:l,y:u},label:e.label,class:`sm-fn-node`,data:{...e,_accentColor:d},style:{"--node-accent":d}})}),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,class:`sm-fn-edge`,markerEnd:{type:se.ArrowClosed}}))}}async function Pt(){let e=Ct.value,t=wt.value;if(e.length!==0){B.value=!0;try{await o(),await new Promise(e=>requestAnimationFrame(()=>e())),Tt(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}xt(e.map(e=>({...e,position:r.get(e.id)??e.position}))),await o(),bt({padding:.18})}finally{B.value=!1}}}async function Ft(){if(!O.value.trim()){ee.warning(T(`@SRCMAP:请先输入项目路径`));return}if(!Z.value){A.value=[],j.value=null,M.value=null,P.value=``,F.value=``,xt([]),St([]),k.value=`scanning`,$(T(`@SRCMAP:开始分析项目...`),`info`);try{let e=await fetch(`/api/code-analysis/analyze`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:O.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=``;k.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
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);It(i,t)}catch{}}i=``,a=[]}}}catch(e){$(`${T(`@SRCMAP:分析失败`)}: ${e.message}`,`error`),k.value=`error`}}}function It(e,t){if(e===`log`)$(t.message,t.type||`info`);else if(e===`files`)L.value=Ot(t.files||[]),L.value.forEach(e=>{e.kind===`dir`&&R.value.add(e.path)});else if(e===`result`){j.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}=Nt(j.value.nodes,j.value.edges);xt(e),St(n),o(()=>Pt())}else e===`done`&&(t.error?($(`${T(`@SRCMAP:分析失败`)}: ${t.error}`,`error`),k.value=`error`):k.value=`done`)}async function Lt(e){if(!(!e||I.value)&&F.value!==e){I.value=!0,F.value=e,P.value=``;try{let t=await(await fetch(`/api/code-analysis/file-content?path=${encodeURIComponent(O.value)}&file=${encodeURIComponent(e)}`)).json();if(t.error)throw Error(t.error);P.value=t.content||``}catch(e){P.value=`// ${T(`@SRCMAP:加载失败`)}: ${e.message}`}finally{I.value=!1}}}function Rt(e){let t=e.node.data;M.value=t.id,t.file&&Lt(t.file)}function zt(e){R.value.has(e)?R.value.delete(e):R.value.add(e)}let Bt=_(()=>{let e=[];function t(n,r){for(let i of n){let n=R.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(L.value,0),e});return u(()=>D.currentDirectory,e=>{e&&!O.value&&(O.value=e)}),u([P,F],([e,t])=>{let n=X.value;if(!n)return;let r=jt(t||``),i=n.getModel(),a=ae.createModel(e||``,r);n.setModel(a),i?.dispose(),n.setScrollPosition({scrollTop:0,scrollLeft:0})}),a(()=>{Mt(),!O.value&&D.currentDirectory&&(O.value=D.currentDirectory),E=new MutationObserver(()=>ie()),E.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}),r(()=>{X.value?.getModel()?.dispose(),X.value?.dispose(),J(),E?.disconnect(),E=null}),(e,r)=>{let a=i;return w(),C(`div`,ve,[g(`div`,ye,[g(`div`,be,[r[9]||=g(`svg`,{viewBox:`0 0 24 24`,width:`18`,height:`18`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,class:`sm-icon-map`},[g(`polygon`,{points:`3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21`}),g(`line`,{x1:`9`,y1:`3`,x2:`9`,y2:`18`}),g(`line`,{x1:`15`,y1:`6`,x2:`15`,y2:`21`})],-1),g(`span`,xe,x(y(T)(`@SRCMAP:源码地图`)),1)]),g(`div`,Se,[s(g(`input`,{"onUpdate:modelValue":r[0]||=e=>O.value=e,class:`sm-path-input`,placeholder:y(T)(`@SRCMAP:输入项目目录路径`),disabled:Z.value,onKeydown:te(Ft,[`enter`])},null,40,Ce),[[re,O.value]]),g(`button`,{class:`sm-btn sm-btn-primary`,disabled:Z.value,onClick:Ft},[Z.value?(w(),C(h,{key:0},[r[10]||=g(`span`,{class:`sm-spinner`},null,-1),t(` `+x(y(T)(`@SRCMAP:分析中...`)),1)],64)):(w(),C(h,{key:1},[t(x(k.value===`done`?y(T)(`@SRCMAP:重新分析`):y(T)(`@SRCMAP:开始分析`)),1)],64))],8,we)]),g(`div`,Te,[S(a,{content:y(T)(`@SRCMAP:文件列表`),placement:`bottom`},{default:d(()=>[g(`button`,{class:v([`sm-panel-btn`,{active:z.value.files}]),onClick:r[1]||=e=>z.value.files=!z.value.files},[...r[11]||=[g(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[g(`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`]),S(a,{content:y(T)(`@SRCMAP:调用图`),placement:`bottom`},{default:d(()=>[g(`button`,{class:v([`sm-panel-btn`,{active:z.value.graph}]),onClick:r[2]||=e=>z.value.graph=!z.value.graph},[...r[12]||=[g(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[g(`circle`,{cx:`12`,cy:`12`,r:`3`}),g(`circle`,{cx:`3`,cy:`6`,r:`2`}),g(`circle`,{cx:`21`,cy:`6`,r:`2`}),g(`circle`,{cx:`3`,cy:`18`,r:`2`}),g(`circle`,{cx:`21`,cy:`18`,r:`2`}),g(`line`,{x1:`5`,y1:`6`,x2:`9`,y2:`11`}),g(`line`,{x1:`19`,y1:`6`,x2:`15`,y2:`11`}),g(`line`,{x1:`5`,y1:`18`,x2:`9`,y2:`13`}),g(`line`,{x1:`19`,y1:`18`,x2:`15`,y2:`13`})],-1)]],2)]),_:1},8,[`content`]),S(a,{content:y(T)(`@SRCMAP:源码面板`),placement:`bottom`},{default:d(()=>[g(`button`,{class:v([`sm-panel-btn`,{active:z.value.source}]),onClick:r[3]||=e=>z.value.source=!z.value.source},[...r[13]||=[g(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[g(`polyline`,{points:`16 18 22 12 16 6`}),g(`polyline`,{points:`8 6 2 12 8 18`})],-1)]],2)]),_:1},8,[`content`])])]),g(`div`,Ee,[s(g(`div`,{class:`sm-panel sm-panel-files`,style:f({width:V.value+`px`})},[g(`div`,De,[g(`button`,{class:v([`sm-tab-btn`,{active:N.value===`files`}]),onClick:r[4]||=e=>N.value=`files`},[r[14]||=g(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[g(`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),t(` `+x(y(T)(`@SRCMAP:文件列表`))+` `,1),j.value?(w(),C(`span`,Oe,x(j.value.allFiles.length),1)):b(``,!0)],2),g(`button`,{class:v([`sm-tab-btn`,{active:N.value===`outline`}]),onClick:r[5]||=e=>N.value=`outline`},[r[15]||=c(`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" data-v-40cb4ff8><line x1="8" y1="6" x2="21" y2="6" data-v-40cb4ff8></line><line x1="8" y1="12" x2="21" y2="12" data-v-40cb4ff8></line><line x1="8" y1="18" x2="21" y2="18" data-v-40cb4ff8></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-40cb4ff8></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-40cb4ff8></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-40cb4ff8></line></svg>`,1),t(` `+x(y(T)(`@SRCMAP:大纲`)),1)],2)]),s(g(`div`,ke,[Bt.value.length>0?(w(!0),C(h,{key:0},l(Bt.value,e=>(w(),C(`div`,{key:e.path,class:v([`sm-tree-node`,{"sm-tree-node--dir":e.kind===`dir`,"sm-tree-node--active":e.kind===`file`&&F.value===e.path}]),style:f({paddingLeft:10+e.depth*14+`px`}),onClick:t=>e.kind===`dir`?zt(e.path):Lt(e.path)},[e.kind===`dir`?(w(),C(`span`,{key:0,class:v([`sm-tree-arrow`,{expanded:e.expanded}])},[...r[16]||=[g(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[g(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(w(),C(`span`,je)),e.kind===`dir`?(w(),C(`svg`,Me,[g(`use`,{"xlink:href":`#${y(ge)(e.name)||`icon-folder`}`},null,8,Ne)])):(w(),C(`svg`,Pe,[g(`use`,{"xlink:href":`#${y(ge)(e.name)}`},null,8,Fe)])),g(`span`,{class:`sm-tree-name`,title:e.path},x(e.name),9,Ie)],14,Ae))),128)):(w(),C(`div`,Le,x(y(T)(`@SRCMAP:暂无文件,请先开始分析`)),1))],512),[[p,N.value===`files`]]),s(g(`div`,Re,[Dt.value.length>0?(w(!0),C(h,{key:0},l(Dt.value,e=>(w(),C(`div`,{key:e.displayName,class:`sm-outline-group`},[g(`div`,{class:`sm-outline-group-header`,style:f({color:e.color})},[r[17]||=g(`svg`,{viewBox:`0 0 24 24`,width:`8`,height:`8`,fill:`currentColor`},[g(`circle`,{cx:`12`,cy:`12`,r:`6`})],-1),t(` `+x(e.displayName)+` `,1),g(`span`,ze,x(e.nodes.length),1)],4),(w(!0),C(h,null,l(e.nodes,t=>(w(),C(`div`,{key:t.id,class:v([`sm-outline-node`,{"sm-outline-node--active":M.value===t.id}]),onClick:e=>{M.value=t.id,t.file&&Lt(t.file)}},[g(`span`,{class:`sm-outline-dot`,style:f({background:e.color})},null,4),g(`span`,{class:`sm-outline-label`,title:t.file||t.label},x(t.label),9,Ve),t.description?(w(),C(`span`,He,x(t.description.length>18?t.description.slice(0,18)+`…`:t.description),1)):b(``,!0)],10,Be))),128))]))),128)):(w(),C(`div`,Ue,x(y(T)(`@SRCMAP:暂无分析结果`)),1))],512),[[p,N.value===`outline`]])],4),[[p,z.value.files]]),s(g(`div`,{class:`sm-resizer sm-resizer-v`,onMousedown:r[6]||=e=>q(`files`,e)},null,544),[[p,z.value.files&&z.value.graph]]),s(g(`div`,We,[j.value?(w(),C(`div`,Ge,[g(`span`,Ke,x(j.value.language),1),j.value.subsystems&&j.value.subsystems.length>1?(w(!0),C(h,{key:0},l(j.value.subsystems,e=>(w(),C(`span`,{key:e.name,class:`sm-subsystem-tag`,style:f({borderColor:e.color,color:e.color})},`● `+x(e.displayName||e.name),5))),128)):(w(!0),C(h,{key:1},l(j.value.techStack.slice(0,4),e=>(w(),C(`span`,{key:e,class:`sm-tech-tag`},x(e),1))),128)),g(`span`,qe,x(j.value.summary),1)])):b(``,!0),g(`div`,Je,[g(`div`,Ye,[g(`button`,{class:`sm-layout-btn`,disabled:B.value||!j.value,onClick:Pt},[r[18]||=c(`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" data-v-40cb4ff8><rect x="3" y="3" width="7" height="7" rx="1" data-v-40cb4ff8></rect><rect x="14" y="3" width="7" height="7" rx="1" data-v-40cb4ff8></rect><rect x="3" y="14" width="7" height="7" rx="1" data-v-40cb4ff8></rect><rect x="14" y="14" width="7" height="7" rx="1" data-v-40cb4ff8></rect></svg>`,1),t(` `+x(B.value?y(T)(`@SRCMAP:布局中...`):y(T)(`@SRCMAP:优化布局`)),1)],8,Xe)]),S(y(me),{class:`sm-vue-flow`,"default-viewport":{zoom:1},"min-zoom":.2,"max-zoom":4,"fit-view-on-init":``,onNodeClick:Rt},{"node-default":d(({data:e,label:t})=>[S(y(ce),{type:`target`,position:y(fe).Top},null,8,[`position`]),g(`div`,{class:`sm-fn-inner`,title:`${t}${e?.description?`
|
|
3
3
|
`+e.description:``}`},[g(`div`,Qe,x(t),1),e?.description?(w(),C(`div`,$e,x(e.description.length>22?e.description.slice(0,22)+`…`:e.description),1)):b(``,!0)],8,Ze),S(y(ce),{type:`source`,position:y(fe).Bottom},null,8,[`position`])]),default:d(()=>[S(y(le),{variant:y(pe).Dots,gap:20,size:1,"pattern-color":Et.value},null,8,[`variant`,`pattern-color`]),S(y(de)),S(y(he),{"node-color":`#3b82f6`,"mask-color":n.value===`dark`?`rgba(0,0,0,0.55)`:`rgba(15,23,42,0.06)`},null,8,[`mask-color`])]),_:1}),!j.value&&!Z.value?(w(),C(`div`,et,[(w(),C(`svg`,tt,[...r[19]||=[g(`polygon`,{points:`3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21`},null,-1),g(`line`,{x1:`9`,y1:`3`,x2:`9`,y2:`18`},null,-1),g(`line`,{x1:`15`,y1:`6`,x2:`15`,y2:`21`},null,-1)]])),g(`p`,null,x(y(T)(`@SRCMAP:输入项目路径后点击开始分析`)),1)])):b(``,!0),Z.value&&!j.value?(w(),C(`div`,nt,[r[20]||=g(`span`,{class:`sm-spinner sm-spinner-lg`},null,-1),g(`p`,null,x(y(T)(`@SRCMAP:AI 正在分析项目结构...`)),1)])):b(``,!0)]),g(`div`,{class:`sm-resizer sm-resizer-h`,onMousedown:r[7]||=e=>q(`log`,e)},null,32),g(`div`,{class:`sm-log-panel`,style:f({height:U.value+`px`})},[g(`div`,rt,[r[21]||=g(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[g(`polyline`,{points:`4 17 10 11 4 5`}),g(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})],-1),t(` `+x(y(T)(`@SRCMAP:Agent 日志`))+` `,1),Z.value?(w(),C(`span`,it)):b(``,!0)]),g(`div`,at,[(w(!0),C(h,null,l(A.value.slice(-50),e=>(w(),C(`div`,{key:e.id,class:v([`sm-log-entry`,`sm-log-entry--${e.type}`])},x(e.message),3))),128)),A.value.length===0?(w(),C(`div`,ot,x(y(T)(`@SRCMAP:等待开始分析`)),1)):b(``,!0)],512)],4)],512),[[p,z.value.graph]]),s(g(`div`,{class:`sm-resizer sm-resizer-v`,onMousedown:r[8]||=e=>q(`source`,e)},null,544),[[p,z.value.graph&&z.value.source]]),s(g(`div`,{class:`sm-panel sm-panel-source`,style:f({width:H.value+`px`})},[g(`div`,st,[r[22]||=g(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[g(`polyline`,{points:`16 18 22 12 16 6`}),g(`polyline`,{points:`8 6 2 12 8 18`})],-1),t(` `+x(F.value||y(T)(`@SRCMAP:源码面板`))+` `,1),Q.value?(w(),C(`span`,ct,x(Q.value.label),1)):b(``,!0)]),Q.value?(w(),C(`div`,lt,[g(`div`,ut,x(Q.value.label),1),g(`div`,dt,[t(x(Q.value.file),1),Q.value.line?(w(),C(`span`,ft,` :`+x(Q.value.line),1)):b(``,!0)]),Q.value.description?(w(),C(`div`,pt,x(Q.value.description),1)):b(``,!0)])):b(``,!0),g(`div`,mt,[I.value?(w(),C(`div`,ht,[...r[23]||=[g(`span`,{class:`sm-spinner`},null,-1)]])):b(``,!0),!I.value&&!P.value?(w(),C(`div`,gt,x(y(T)(`@SRCMAP:点击调用图中的节点查看源码`)),1)):b(``,!0),g(`div`,{ref_key:`monacoContainerRef`,ref:Y,class:`sm-monaco-container`},null,512)])],4),[[p,z.value.source]])])])}}}),[[`__scopeId`,`data-v-40cb4ff8`]]);export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-CMxvf4Kt.js";import{B as e,Cn as t,En as n,I as r,S as i,Vn as a,W as ee,Yn as o,Zn as s,_n as c,a as l,cr as u,dn as d,gn as f,hn as p,hr as m,ht as h,j as g,ln as _,mr as v,vn as y,vr as b,wn as x,yn as S,z as C,zn as w}from"./element-plus-CJjFCgLP.js";import{n as T,t as E}from"./_plugin-vue_export-helper-vLPduyLG.js";import{i as D,l as O,s as k}from"./index-
|
|
1
|
+
import"./rolldown-runtime-CMxvf4Kt.js";import{B as e,Cn as t,En as n,I as r,S as i,Vn as a,W as ee,Yn as o,Zn as s,_n as c,a as l,cr as u,dn as d,gn as f,hn as p,hr as m,ht as h,j as g,ln as _,mr as v,vn as y,vr as b,wn as x,yn as S,z as C,zn as w}from"./element-plus-CJjFCgLP.js";import{n as T,t as E}from"./_plugin-vue_export-helper-vLPduyLG.js";import{i as D,l as O,s as k}from"./index-BxxqloTb.js";var te={class:`template-form`},ne={class:`template-form-buttons`},re={key:0,class:`template-list`},ie={key:1,class:`template-list-scroll`},ae={class:`template-content`},A={class:`template-actions`},oe={key:1,class:`templates-container`},se={class:`message-templates-list`},ce={class:`templates-scroll-area`},le={class:`template-content`},ue={class:`template-actions`},j={key:0,class:`current-default-message`},M={class:`default-message-content`},N={key:2,class:`message-help-text`},P=E(n({__name:`TemplateManager`,props:{visible:{type:Boolean},type:{},title:{},placeholder:{default:T(`@60CAC:输入新模板内容`)},editPlaceholder:{default:T(`@60CAC:编辑模板内容`)},emptyDescription:{default:T(`@60CAC:暂无保存的模板`)},showDefaultSection:{type:Boolean,default:!1},showHelpText:{type:Boolean,default:!1}},emits:[`update:visible`,`use-template`,`set-default`],setup(n,{expose:E,emit:P}){let F=n,I=P,L=k(),R=u(``),z=u(!1),B=u(``),V=u(-1),H=u(!1),U=u(!1),W=u(!1),G=p(()=>{switch(F.type){case`description`:return L.descriptionTemplates||[];case`scope`:return L.scopeTemplates||[];case`message`:return L.messageTemplates||[];case`command`:return L.commandTemplates||[];default:return[]}}),K=p(()=>F.type===`message`?L.defaultCommitMessage:``),de=p(()=>z.value?F.editPlaceholder:F.placeholder),fe=p(()=>z.value?T(`@60CAC:更新模板`):T(`@60CAC:添加模板`)),q=p({get:()=>F.visible,set:e=>I(`update:visible`,e)});o(q,e=>{e||J()});function J(){R.value=``,z.value=!1,B.value=``,V.value=-1}async function Y(){if(!R.value.trim()){l.warning(T(`@60CAC:模板内容不能为空`));return}try{H.value=!0,z.value?await L.updateTemplate(B.value,R.value,F.type)&&J():await L.saveTemplate(R.value,F.type)&&(R.value=``)}catch(e){l.error(`${T(`@60CAC:模板保存失败: `)}${e.message}`)}finally{H.value=!1}}function X(e){I(`use-template`,e),F.type!==`message`&&(q.value=!1)}function Z(e,t){z.value=!0,B.value=e,R.value=e,V.value=t}function pe(){J()}async function Q(e){try{W.value=!0,await L.pinTemplate(e,F.type)}catch(e){l.error(`${T(`@60CAC:置顶模板失败: `)}${e.message}`)}finally{W.value=!1}}async function $(e){try{await L.deleteTemplate(e,F.type)}catch(e){l.error(`${T(`@60CAC:模板删除失败: `)}${e.message}`)}}async function me(){if(!(F.type!==`message`||!R.value.trim()))try{U.value=!0,await L.saveDefaultMessage(R.value)&&I(`set-default`,R.value)}catch(e){l.error(`${T(`@60CAC:设置默认提交信息失败: `)}${e.message}`)}finally{U.value=!1}}return E({resetForm:J}),(o,l)=>{let u=ee,p=e,E=i,k=D,P=g,F=r,I=C;return w(),c(O,{modelValue:q.value,"onUpdate:modelValue":l[1]||=e=>q.value=e,title:n.title,"close-on-click-modal":!1,"append-to-body":!0,"custom-class":n.type===`message`?`message-template-dialog`:`template-dialog`},{default:s(()=>[f(`div`,{class:m([`template-container`,{"message-template-container":n.type===`message`}])},[f(`div`,te,[x(u,{modelValue:R.value,"onUpdate:modelValue":l[0]||=e=>R.value=e,placeholder:de.value,class:`template-input`,clearable:``,onKeyup:_(Y,[`enter`])},null,8,[`modelValue`,`placeholder`]),f(`div`,ne,[z.value?(w(),c(p,{key:0,onClick:pe},{default:s(()=>[t(b(v(T)(`@60CAC:取消`)),1)]),_:1})):y(``,!0),x(p,{type:`primary`,onClick:Y,disabled:!R.value.trim()||H.value,loading:H.value},{default:s(()=>[t(b(fe.value),1)]),_:1},8,[`disabled`,`loading`]),n.type===`message`?(w(),c(p,{key:1,type:`success`,onClick:me,disabled:!R.value.trim()||U.value,loading:U.value,plain:``},{default:s(()=>[t(b(v(T)(`@60CAC:设为默认提交信息`)),1)]),_:1},8,[`disabled`,`loading`])):y(``,!0)])]),n.type===`message`?(w(),S(`div`,oe,[f(`div`,se,[f(`h3`,null,b(v(T)(`@60CAC:已保存模板`)),1),f(`div`,ce,[G.value.length===0?(w(),c(E,{key:0,description:n.emptyDescription},null,8,[`description`])):y(``,!0),(w(!0),S(d,null,a(G.value,(e,n)=>(w(),c(F,{key:n,class:`template-item`},{default:s(()=>[x(P,{justify:`space-between`,align:`middle`,style:{width:`100%`}},{default:s(()=>[f(`div`,le,b(e),1),f(`div`,ue,[x(p,{size:`small`,class:`pin-button`,onClick:t=>Q(e),loading:W.value,disabled:n===0,title:`置顶`},{default:s(()=>[x(k,{"icon-class":`pin`,"class-name":`pin-icon`})]),_:1},8,[`onClick`,`loading`,`disabled`]),x(p,{type:`primary`,size:`small`,onClick:t=>X(e)},{default:s(()=>[t(b(v(T)(`@60CAC:使用`)),1)]),_:1},8,[`onClick`]),x(p,{type:`warning`,size:`small`,icon:v(h),onClick:t=>Z(e,Number(n))},{default:s(()=>[t(b(v(T)(`@60CAC:编辑`)),1)]),_:1},8,[`icon`,`onClick`]),x(p,{type:`danger`,size:`small`,onClick:t=>$(e)},{default:s(()=>[t(b(v(T)(`@60CAC:删除`)),1)]),_:1},8,[`onClick`])])]),_:2},1024)]),_:2},1024))),128))])]),n.showDefaultSection?(w(),S(`div`,j,[f(`h3`,null,b(v(T)(`@60CAC:当前默认提交信息`)),1),K.value?(w(),c(F,{key:0,class:`default-message-card`},{default:s(()=>[f(`div`,M,b(K.value),1)]),_:1})):(w(),c(E,{key:1,description:v(T)(`@60CAC:尚未设置默认提交信息`),"image-size":100},null,8,[`description`])),n.showHelpText?(w(),S(`div`,N,[f(`h4`,null,b(v(T)(`@60CAC:关于默认提交信息`)),1),f(`p`,null,b(v(T)(`@60CAC:默认提交信息将在未输入提交信息时自动使用。`)),1),f(`p`,null,[t(b(v(T)(`@60CAC:你可以通过点击左侧模板的`)),1),x(I,{size:`small`,type:`primary`},{default:s(()=>[t(b(v(T)(`@60CAC:使用`)),1)]),_:1}),t(b(v(T)(`@60CAC:按钮先选择喜欢的模板,然后点击上方`)),1),x(I,{size:`small`,type:`success`},{default:s(()=>[t(b(v(T)(`@60CAC:设为默认提交信息`)),1)]),_:1}),t(b(v(T)(`@60CAC:按钮保存。`)),1)])])):y(``,!0)])):y(``,!0)])):(w(),S(`div`,re,[f(`h3`,null,b(v(T)(`@60CAC:已保存`))+` `+b(n.type===`description`?v(T)(`@60CAC:模板`):n.type===`scope`?v(T)(`@60CAC:作用域`):n.type===`command`?v(T)(`@CMD01:命令模板`):``),1),G.value.length===0?(w(),c(E,{key:0,description:n.emptyDescription},null,8,[`description`])):(w(),S(`div`,ie,[(w(!0),S(d,null,a(G.value,(e,n)=>(w(),c(F,{key:n,class:`template-item`},{default:s(()=>[x(P,{justify:`space-between`,align:`middle`,style:{width:`100%`}},{default:s(()=>[f(`div`,ae,b(e),1),f(`div`,A,[x(p,{size:`small`,class:`pin-button`,onClick:t=>Q(e),loading:W.value,disabled:n===0,title:`置顶`},{default:s(()=>[x(k,{"icon-class":`pin`,"class-name":`pin-icon`})]),_:1},8,[`onClick`,`loading`,`disabled`]),x(p,{type:`primary`,size:`small`,onClick:t=>X(e)},{default:s(()=>[t(b(v(T)(`@60CAC:使用`)),1)]),_:1},8,[`onClick`]),x(p,{type:`warning`,size:`small`,icon:v(h),onClick:t=>Z(e,Number(n))},{default:s(()=>[t(b(v(T)(`@60CAC:编辑`)),1)]),_:1},8,[`icon`,`onClick`]),x(p,{type:`danger`,size:`small`,onClick:t=>$(e)},{default:s(()=>[t(b(v(T)(`@60CAC:删除`)),1)]),_:1},8,[`onClick`])])]),_:2},1024)]),_:2},1024))),128))]))]))],2)]),_:1},8,[`modelValue`,`title`,`custom-class`])}}}),[[`__scopeId`,`data-v-105ad2b4`]]);export{P as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-CMxvf4Kt.js";import{Cn as e,En as t,Hn as n,Vn as r,Y as i,Zn as a,_n as o,_r as s,dn as c,gn as l,hn as u,hr as d,it as f,jt as p,mr as m,un as ee,vn as h,vr as g,wn as _,yn as v,yt as y,zn as b}from"./element-plus-CJjFCgLP.js";import{n as x,t as S}from"./_plugin-vue_export-helper-vLPduyLG.js";import{s as C}from"./index-
|
|
1
|
+
import"./rolldown-runtime-CMxvf4Kt.js";import{Cn as e,En as t,Hn as n,Vn as r,Y as i,Zn as a,_n as o,_r as s,dn as c,gn as l,hn as u,hr as d,it as f,jt as p,mr as m,un as ee,vn as h,vr as g,wn as _,yn as v,yt as y,zn as b}from"./element-plus-CJjFCgLP.js";import{n as x,t as S}from"./_plugin-vue_export-helper-vLPduyLG.js";import{s as C}from"./index-BxxqloTb.js";import{c as w,o as T}from"./vue-flow-HHfhvx4N.js";var E={key:0},D={key:1},O={key:2},k={key:3,class:`node-header`},A={class:`flow-node-icon`},j={class:`node-title`},M={class:`node-body`},N={key:4,class:`disabled-overlay`},P=S(t({__name:`BaseNode`,props:{id:{},nodeId:{},nodeType:{default:`command`},title:{},icon:{},enabled:{type:Boolean,default:!0},selected:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},showDeleteOnSelected:{type:Boolean,default:!1},sourceHandleIds:{},execStatus:{}},emits:[`delete`],setup(e,{emit:t}){let p=e,y=u(()=>!!(p.title&&String(p.title).trim()||p.icon&&String(p.icon).trim())),x=u(()=>y.value?16:0),S=u(()=>p.sourceHandleIds&&p.sourceHandleIds.length?p.sourceHandleIds:[`source`]),C=t;return(t,u)=>{let p=i;return b(),v(`div`,{class:d([`flow-node-wrapper`,[{disabled:!e.enabled,"is-selected":e.selected,"show-delete-on-selected":e.showDeleteOnSelected},e.nodeType?`node-type-${e.nodeType}`:``]])},[e.nodeType===`start`?h(``,!0):(b(),o(m(w),{key:0,id:`target`,type:`target`,position:m(T).Left,class:`flow-node-handle handle-left`},null,8,[`position`])),e.deletable===!1?h(``,!0):(b(),o(p,{key:1,class:`flow-node-delete-btn`,onClick:u[0]||=ee(t=>C(`delete`,e.nodeId),[`stop`]),title:`删除节点`,role:`button`,tabindex:`0`},{default:a(()=>[_(m(f))]),_:1})),e.execStatus?(b(),v(`div`,{key:2,class:d([`flow-node-status`,[`status-${e.execStatus}`]])},[e.execStatus===`running`?(b(),v(`span`,E,`执行中`)):e.execStatus===`success`?(b(),v(`span`,D,`成功`)):(b(),v(`span`,O,`失败`))],2)):h(``,!0),e.title||e.icon?(b(),v(`div`,k,[l(`div`,A,g(e.icon),1),l(`div`,j,g(e.title),1)])):h(``,!0),l(`div`,M,[n(t.$slots,`default`,{},void 0,!0)]),e.enabled?h(``,!0):(b(),v(`div`,N,`已禁用`)),e.nodeType===`condition`?(b(!0),v(c,{key:5},r(S.value,e=>(b(),o(m(w),{key:e,id:e,type:`source`,position:m(T).Right,class:`flow-node-handle handle-right`,style:s({top:`calc(50% + ${x.value}px + ${(S.value.indexOf(e)-(S.value.length-1)/2)*18}px)`})},null,8,[`id`,`position`,`style`]))),128)):(b(),o(m(w),{key:6,id:`source`,type:`source`,position:m(T).Right,class:`flow-node-handle handle-right`},null,8,[`position`]))],2)}}}),[[`__scopeId`,`data-v-054d8274`]]),F={class:`command-node-content`},I={class:`node-badges`},L={key:0,class:`node-badge terminal`},R={key:0,class:`node-warning`},z={key:1,class:`command-details`},B={class:`command-code`},V={key:0,class:`command-dir`},H=S(t({__name:`CommandNode`,props:{data:{},id:{}},setup(e){let t=e,n=C(),r=u(()=>!t.data.config||!t.data.config.commandId?null:n.customCommands.find(e=>e.id===t.data.config.commandId)||null),o=u(()=>t.data.config?{name:t.data.config.commandName||x(`@FLOWNODE:未配置`),terminal:t.data.config.useTerminal||!1,command:r.value?.command||``,directory:r.value?.directory||``}:null);return(t,n)=>{let r=i;return b(),v(`div`,F,[l(`div`,I,[o.value?.terminal?(b(),v(`div`,L,[_(r,null,{default:a(()=>[_(m(p))]),_:1}),l(`span`,null,g(m(x)(`@FLOWNODE:终端`)),1)])):h(``,!0)]),e.data.config?h(``,!0):(b(),v(`div`,R,g(m(x)(`@FLOWNODE:未配置`)),1)),o.value?.command?(b(),v(`div`,z,[l(`div`,B,[l(`code`,null,g(o.value.command),1)]),o.value.directory?(b(),v(`div`,V,[_(r,null,{default:a(()=>[_(m(y))]),_:1}),l(`span`,null,g(o.value.directory),1)])):h(``,!0)])):h(``,!0)])}}}),[[`__scopeId`,`data-v-7eaef8da`]]),U={class:`wait-node-content`},W={key:0,class:`node-warning`},G={key:1,class:`wait-seconds`},K=S(t({__name:`WaitNode`,props:{data:{},id:{}},setup(e){return(t,n)=>(b(),v(`div`,U,[e.data.config?(b(),v(`div`,G,g(m(x)(`@FLOWNODE:等待 {seconds} 秒`,{seconds:e.data.config?.waitSeconds??0})),1)):(b(),v(`div`,W,g(m(x)(`@FLOWNODE:未配置`)),1))]))}}),[[`__scopeId`,`data-v-26cc2aa1`]]),q={class:`version-node-content`},J={key:0,class:`node-badge`},te={key:1,class:`info-grid`},Y={class:`info-label`},X=[`title`],Z={key:2,class:`node-warning`},Q=S(t({__name:`VersionNode`,props:{data:{},id:{}},setup(e){let t=e,n=u(()=>{if(!t.data.config)return null;let e=t.data.config,n=String(e?.versionTarget||`version`),r=String(e?.versionSource||`bump`),i=[];i.push({label:x(`@FLOWNODE:目标`),value:x(n===`dependency`?`@FLOWNODE:依赖版本`:`@FLOWNODE:version字段`)}),i.push({label:x(`@FLOWNODE:来源`),value:x(r===`reference`?`@FLOWNODE:引用输出`:r===`input`?`@FLOWNODE:引用输入`:r===`manual`?`@FLOWNODE:手动输入`:`@FLOWNODE:自动递增`)});let a=String(e?.packageJsonPath||``).trim();if(i.push({label:x(`@FLOWNODE:package.json`),value:a||x(`@FLOWNODE:当前目录`)}),n===`dependency`){let t=String(e?.dependencyType||`dependencies`),n=String(e?.dependencyName||``).trim();if(n&&i.push({label:x(`@FLOWNODE:依赖`),value:`${t}::${n}`}),r===`manual`){let t=String(e?.dependencyVersion||``).trim();t&&i.push({label:x(`@FLOWNODE:版本号`),value:t})}else if(r===`bump`){let t=String(e?.dependencyVersionBump||e?.versionBump||`patch`);i.push({label:x(`@FLOWNODE:递增`),value:t})}else if(r===`reference`){let t=String(e?.inputRef?.nodeId||``).trim(),n=String(e?.inputRef?.outputKey||``).trim(),r=t&&n?`${t}::${n}`:``;r&&i.push({label:x(`@FLOWNODE:引用`),value:r})}else if(r===`input`){let t=String(e?.dependencyVersionInputKey||e?.versionInputKey||``).trim();t&&i.push({label:x(`@FLOWNODE:引用`),value:t})}}else{let t=String(e?.versionBump||`patch`);i.push({label:x(`@FLOWNODE:递增`),value:t})}return{target:n,rows:i}});return(t,i)=>(b(),v(`div`,q,[n.value?.target===`dependency`?(b(),v(`div`,J,g(m(x)(`@FLOWNODE:依赖`)),1)):h(``,!0),n.value?.rows?.length?(b(),v(`div`,te,[(b(!0),v(c,null,r(n.value.rows,(e,t)=>(b(),v(`div`,{key:t,class:`info-row`},[l(`div`,Y,g(e.label),1),l(`div`,{class:`info-value`,title:e.value},g(e.value),9,X)]))),128))])):h(``,!0),e.data.config?h(``,!0):(b(),v(`div`,Z,g(m(x)(`@FLOWNODE:未配置`)),1))]))}}),[[`__scopeId`,`data-v-cc373b8c`]]),ne={key:0,class:`confirm-node-content`},re={class:`node-warning`},ie=S(t({__name:`ConfirmNode`,props:{data:{},id:{}},setup(e){return(t,n)=>e.data.config?h(``,!0):(b(),v(`div`,ne,[l(`div`,re,g(m(x)(`@FLOWNODE:未配置`)),1)]))}}),[[`__scopeId`,`data-v-d84be2ca`]]),ae={class:`code-node-content`},oe={key:0,class:`node-warning`},se={key:1,class:`code-details`},ce={class:`code-meta`},le={class:`meta-item`},ue={class:`meta-item`},de=S(t({__name:`CodeNode`,props:{data:{},id:{}},setup(e){let t=e,n=u(()=>{let e=t.data.config||{};return{hasScript:!!(e.codeScript&&String(e.codeScript).trim()),outputKeys:Array.isArray(e.codeOutputKeys)?e.codeOutputKeys:[]}});return(t,r)=>(b(),v(`div`,ae,[e.data.config?(b(),v(`div`,se,[l(`div`,ce,[l(`span`,le,g(m(x)(`@NODECFG:脚本`))+`: `+g(n.value.hasScript?m(x)(`@FLOWNODE:已添加`):m(x)(`@FLOWNODE:未配置`)),1),l(`span`,ue,g(m(x)(`@NODECFG:输出键列表`))+`: `+g(n.value.outputKeys.length?n.value.outputKeys.join(`, `):m(x)(`@FLOWNODE:未配置`)),1)])])):(b(),v(`div`,oe,g(m(x)(`@FLOWNODE:未配置`)),1))]))}}),[[`__scopeId`,`data-v-44d1cf38`]]),fe={class:`condition-node`},pe={key:0,class:`condition-empty`},me={key:1,class:`condition-branches`},he={class:`branch-name`},ge={class:`branch-meta`},_e=S(t({__name:`ConditionNode`,props:{id:{type:String,required:!0},data:{type:Object,required:!0}},setup(e){let t=e,n=u(()=>{let e=t.data?.config;return[...Array.isArray(e?.conditionBranches)?e.conditionBranches:[]].sort((e,t)=>(e.priority??0)-(t.priority??0))});return(e,t)=>(b(),v(`div`,fe,[n.value.length===0?(b(),v(`div`,pe,`未配置条件分支`)):(b(),v(`div`,me,[(b(!0),v(c,null,r(n.value,e=>(b(),v(`div`,{key:e.id,class:`condition-branch`},[l(`span`,he,g(e.isDefault?`DEFAULT`:e.name),1),l(`span`,ge,`(`+g(e.combine.toUpperCase())+` / `+g(e.rules.length)+`)`,1)]))),128))]))]))}}),[[`__scopeId`,`data-v-cffa23e5`]]),ve={class:`user-input-node-content`},ye={key:0,class:`node-warning`},be={key:0,class:`node-warning`},$={key:1,class:`param-summary`},xe={class:`param-count`},Se={class:`param-list`},Ce={key:0,class:`star`},we={key:0,class:`more`},Te=S(t({__name:`UserInputNode`,props:{data:{},id:{}},setup(t){let n=t,i=u(()=>{let e=n.data?.config;return(Array.isArray(e?.userInputParams)?e.userInputParams:[]).map(e=>String(e?.name||``).trim()).filter(e=>!!e)}),a=u(()=>{let e=n.data?.config,t=Array.isArray(e?.userInputParams)?e.userInputParams:[],r=new Set;for(let e of t){let t=String(e?.name||``).trim();t&&e?.required&&r.add(t)}return r}),o=u(()=>i.value.slice(0,3)),s=u(()=>i.value.length>3);return(n,u)=>(b(),v(`div`,ve,[t.data.config?(b(),v(c,{key:1},[i.value.length===0?(b(),v(`div`,be,g(m(x)(`@UINPUT:暂无输入参数`)),1)):(b(),v(`div`,$,[l(`div`,xe,g(m(x)(`@UINPUT:参数名`))+` (`+g(i.value.length)+`)`,1),l(`div`,Se,[(b(!0),v(c,null,r(o.value,t=>(b(),v(`span`,{key:t,class:d([`param-chip`,{required:a.value.has(t)}])},[a.value.has(t)?(b(),v(`span`,Ce,`*`)):h(``,!0),e(` `+g(t),1)],2))),128)),s.value?(b(),v(`span`,we,`+`+g(i.value.length-3),1)):h(``,!0)])]))],64)):(b(),v(`div`,ye,g(m(x)(`@FLOWNODE:未配置`)),1))]))}}),[[`__scopeId`,`data-v-d0578713`]]);export{Q as a,P as c,ie as i,_e as n,K as o,de as r,H as s,Te as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./rolldown-runtime-CMxvf4Kt.js";import{A as e,B as t,Cn as n,D as r,E as i,En as a,Et as o,F as s,Fn as c,In as l,It as u,J as d,K as f,L as p,Ln as m,Lt as h,Nn as g,Nt as _,Ot as v,Pt as y,Qn as b,R as x,Sn as S,Tt as ee,Vn as C,W as te,Wn as w,X as T,Y as ne,Yn as E,Z as re,Zn as D,_n as O,_r as ie,a as k,at as A,b as j,cn as ae,cr as M,ct as N,dn as P,dt as oe,et as F,f as se,gn as I,gt as ce,hn as L,hr as R,i as z,ir as le,it as ue,k as de,l as B,ln as fe,lt as pe,mr as V,o as me,on as he,or as ge,ot as _e,p as ve,pn as ye,pt as be,q as xe,r as Se,rt as Ce,sn as we,un as H,vn as U,vr as W,wn as G,x as K,y as q,yn as J,yt as Te,zn as Y}from"./element-plus-CJjFCgLP.js";import{r as Ee}from"./vendor-0YbzMuxw.js";import{n as X,t as Z}from"./_plugin-vue_export-helper-vLPduyLG.js";import{n as De}from"./index-
|
|
1
|
+
import"./rolldown-runtime-CMxvf4Kt.js";import{A as e,B as t,Cn as n,D as r,E as i,En as a,Et as o,F as s,Fn as c,In as l,It as u,J as d,K as f,L as p,Ln as m,Lt as h,Nn as g,Nt as _,Ot as v,Pt as y,Qn as b,R as x,Sn as S,Tt as ee,Vn as C,W as te,Wn as w,X as T,Y as ne,Yn as E,Z as re,Zn as D,_n as O,_r as ie,a as k,at as A,b as j,cn as ae,cr as M,ct as N,dn as P,dt as oe,et as F,f as se,gn as I,gt as ce,hn as L,hr as R,i as z,ir as le,it as ue,k as de,l as B,ln as fe,lt as pe,mr as V,o as me,on as he,or as ge,ot as _e,p as ve,pn as ye,pt as be,q as xe,r as Se,rt as Ce,sn as we,un as H,vn as U,vr as W,wn as G,x as K,y as q,yn as J,yt as Te,zn as Y}from"./element-plus-CJjFCgLP.js";import{r as Ee}from"./vendor-0YbzMuxw.js";import{n as X,t as Z}from"./_plugin-vue_export-helper-vLPduyLG.js";import{n as De}from"./index-BxxqloTb.js";var Oe={class:`ai-split-direct-pane`},ke={key:0,class:`ai-split-status`},Ae={key:1,class:`ai-split-status`},je={key:1},Me={key:2},Ne={key:2,class:`ai-split-status is-error`},Pe={key:3,class:`ai-split-idle`},Fe={class:`ai-split-idle__title`},Ie={class:`ai-split-idle__desc`},Le={class:`ai-split-prompt-actions`},Re={key:0,class:`ai-split-prompt-editor`},ze={class:`ai-split-prompt-editor__actions`},Be={key:1,class:`ai-split-pre`},Ve={class:`ai-split-subhead`},He={class:`ai-split-user-actions`},Ue={key:3,class:`ai-split-pre`},We={key:0,class:`ai-split-tab-count`},Ge={class:`ai-split-pre ai-split-pre--think`},Ke={key:0,class:`ai-split-tab-count`},qe={class:`ai-split-parse-error__detail`},Je={class:`ai-split-parse-error__hint`},Q={class:`ai-split-parse-error__actions`},Ye={key:1,class:`ai-split-raw-toolbar`},Xe={class:`ai-split-raw-tip`},Ze={key:0,class:`ai-split-tab-count`},Qe={key:0,class:`ai-split-empty`},$e={key:1,class:`ai-split-list`},et={class:`ai-split-list__no`},tt={class:`ai-split-list__body`},nt={class:`ai-split-list__title`},rt={class:`ai-split-list__desc`},it={key:5,class:`ai-split-footer-hint`},at={class:`ai-split-direct-footer`},ot=Z(a({__name:`AISplitDirectPane`,props:{title:{},desc:{},taskId:{},promptId:{}},emits:[`confirm`],setup(e,{emit:r}){let i=e,a=r,s=M(`idle`),c=M(`prompt`),l=M(``),f=M(``),p=M(``),m=M(``),h=M(``),g=M([]),_=M(``),v=M(``),y=M(``),b=null,x=0,ee=L(()=>p.value.length),w=L(()=>m.value.length),T=L(()=>s.value===`result`&&g.value.length>0),re=L(()=>s.value===`running`),ie=L(()=>s.value===`preview`),A=M(``),j=M(!1);function ae(){b&&=(b.abort(),null)}function N(){ae(),s.value=`idle`,c.value=`prompt`,l.value=``,f.value=``,A.value=``,p.value=``,m.value=``,h.value=``,g.value=[],_.value=``,v.value=``,y.value=``}async function oe(){if(!i.title.trim()){k.warning(X(`@WORKBENCH:请先填写任务标题`));return}N(),s.value=`preview`,c.value=`prompt`,j.value=!0;try{let e=await fetch(`/api/workbench/tasks/ai-split-preview`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:i.title,desc:i.desc,taskId:i.taskId||``,promptId:i.promptId||``})}).then(e=>e.json());if(!e.success){s.value=`error`,_.value=e.error||X(`@WORKBENCH:生成预览失败`);return}l.value=e.system||``,f.value=e.user||``,A.value=e.user||``}catch(e){s.value=`error`,_.value=e?.message||String(e)}finally{j.value=!1}}async function F(){if(!A.value.trim()){k.warning(X(`@WORKBENCH:提示词不能为空`));return}let e=++x;ae(),p.value=``,m.value=``,h.value=``,g.value=[],v.value=``,y.value=``,_.value=``,s.value=`running`,c.value=`thinking`,f.value=A.value,b=new AbortController;let t=b;try{let n=await fetch(`/api/workbench/tasks/ai-split-subtasks`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify({title:i.title,desc:i.desc,taskId:i.taskId||``,promptId:i.promptId||``,customUserBlock:A.value}),signal:t.signal});if(e!==x)return;if(!n.ok||!n.body){let e=await n.text().catch(()=>``);throw Error(e||`HTTP ${n.status}`)}let r=n.body.getReader(),a=new TextDecoder(`utf-8`),o=``,u=null;for(;;){let{value:t,done:n}=await r.read();if(e!==x)return;if(n)break;o+=a.decode(t,{stream:!0});let i=o.split(`
|
|
2
2
|
`);o=i.pop()??``;for(let e of i){let t=e.trim();if(!t.startsWith(`data:`))continue;let n=t.slice(5).trim();if(!n)continue;let r;try{r=JSON.parse(n)}catch{continue}switch(r.type){case`meta`:l.value=r.prompt?.system||l.value;break;case`thinking`:p.value+=String(r.delta||``);break;case`content`:m.value+=String(r.delta||``);break;case`done`:u=r;break;case`error`:throw Error(r.error||`AI 拆分失败`)}}}if(e!==x)return;if(!u)throw Error(X(`@WORKBENCH:AI 未返回结果`));g.value=Array.isArray(u.subtasks)?u.subtasks:[],h.value=u.raw||m.value,v.value=String(u.parseError||``),y.value=String(u.parseStage||``),p.value||=X(`@WORKBENCH:(当前模型未返回独立的思考内容,可切换到「原始结果」查看完整输出)`),s.value=`result`,c.value=g.value.length>0?`confirm`:`raw`}catch(n){if(e!==x)return;if(n?.name===`AbortError`||t.signal.aborted){s.value=`preview`,c.value=`prompt`;return}s.value=`error`,_.value=n?.message||String(n)}finally{e===x&&(b=null)}}function ce(){T.value&&a(`confirm`,g.value.slice())}function R(){A.value.trim()?F():oe()}function z(){b&&(b.abort(),b=null,k.info(X(`@WORKBENCH:已停止拆分`)))}let le=M(!1);async function ue(){if(!m.value.trim()){k.warning(X(`@WORKBENCH:原始结果为空,无法解析`));return}le.value=!0;try{let e=await fetch(`/api/workbench/tasks/parse-subtasks`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({raw:m.value})}).then(e=>e.json());if(!e.success){k.error(e.error||X(`@WORKBENCH:解析失败`));return}g.value=Array.isArray(e.subtasks)?e.subtasks:[],v.value=String(e.parseError||``),y.value=String(e.parseStage||``),h.value=m.value,g.value.length>0?(k.success(X(`@WORKBENCH:解析成功,已识别 {n} 个子任务`,{n:g.value.length})),c.value=`confirm`):k.warning(X(`@WORKBENCH:仍未解析到子任务,请继续修改原始结果`))}catch(e){k.error(X(`@WORKBENCH:解析失败: `)+(e?.message||e))}finally{le.value=!1}}E(()=>i.taskId,()=>{N()});let de=M(!1),B=M(``),fe=M(!1);function pe(){B.value=l.value,de.value=!0}async function me(){if(!B.value.trim()){k.warning(X(`@WORKBENCH:指令内容不能为空`));return}fe.value=!0;try{let e=await fetch(`/api/workbench/tasks/ai-subtask-instruction`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({instruction:B.value})}).then(e=>e.json());e.success?(k.success(X(`@WORKBENCH:已保存指令`)),de.value=!1,oe()):k.error(e.error||X(`@WORKBENCH:保存失败`))}catch(e){k.error(X(`@WORKBENCH:保存失败: `)+(e?.message||e))}finally{fe.value=!1}}function he(){de.value=!1}return(e,r)=>{let i=ne,a=t,h=te,y=se,b=d,x=ve;return Y(),J(`div`,Oe,[re.value?(Y(),J(`div`,ke,[G(i,{class:`is-loading`},{default:D(()=>[G(V(o))]),_:1}),I(`span`,null,W(V(X)(`@WORKBENCH:AI 正在拆分…`)),1),G(a,{size:`small`,link:``,type:`danger`,class:`ai-split-status__stop`,onClick:z},{default:D(()=>[n(W(V(X)(`@WORKBENCH:停止拆分`)),1)]),_:1})])):ie.value?(Y(),J(`div`,Ae,[j.value?(Y(),O(i,{key:0,class:`is-loading`},{default:D(()=>[G(V(o))]),_:1})):U(``,!0),j.value?(Y(),J(`span`,je,W(V(X)(`@WORKBENCH:正在生成提示词预览…`)),1)):(Y(),J(`span`,Me,W(V(X)(`@WORKBENCH:提示词已就绪,可在下方编辑后点「发送给 AI」开始拆分`)),1))])):s.value===`error`?(Y(),J(`div`,Ne,[G(i,{color:`#f56c6c`},{default:D(()=>[G(V(Ce))]),_:1}),I(`span`,null,W(_.value),1)])):s.value===`idle`?(Y(),J(`div`,Pe,[r[5]||=S(`<div class="ai-split-idle__icon" aria-hidden="true" data-v-85bcc687><svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-v-85bcc687><path d="M12 3v3" data-v-85bcc687></path><path d="M12 18v3" data-v-85bcc687></path><path d="M3 12h3" data-v-85bcc687></path><path d="M18 12h3" data-v-85bcc687></path><path d="M5.6 5.6l2.1 2.1" data-v-85bcc687></path><path d="M16.3 16.3l2.1 2.1" data-v-85bcc687></path><path d="M5.6 18.4l2.1-2.1" data-v-85bcc687></path><path d="M16.3 7.7l2.1-2.1" data-v-85bcc687></path><circle cx="12" cy="12" r="4" data-v-85bcc687></circle></svg></div>`,1),I(`div`,Fe,W(V(X)(`@WORKBENCH:准备用 AI 拆分任务`)),1),I(`div`,Ie,W(V(X)(`@WORKBENCH:点击下方按钮开始生成。生成期间可切换到「思考 / 原始结果」实时查看模型输出。`)),1),G(a,{type:`primary`,icon:V(u),onClick:oe},{default:D(()=>[n(W(V(X)(`@WORKBENCH:开始拆分`)),1)]),_:1},8,[`icon`])])):U(``,!0),s.value===`idle`?U(``,!0):(Y(),O(x,{key:4,modelValue:c.value,"onUpdate:modelValue":r[4]||=e=>c.value=e,class:`ai-split-tabs`},{default:D(()=>[G(y,{label:V(X)(`@WORKBENCH:提示词`),name:`prompt`},{default:D(()=>[I(`div`,Le,[G(a,{size:`small`,disabled:re.value,onClick:pe},{default:D(()=>[n(W(V(X)(`@WORKBENCH:编辑指令`)),1)]),_:1},8,[`disabled`])]),de.value?(Y(),J(`div`,Re,[G(h,{modelValue:B.value,"onUpdate:modelValue":r[0]||=e=>B.value=e,type:`textarea`,rows:12,placeholder:V(X)(`@WORKBENCH:指令内容`)},null,8,[`modelValue`,`placeholder`]),I(`div`,ze,[G(a,{size:`small`,onClick:he},{default:D(()=>[n(W(V(X)(`@WORKBENCH:取消`)),1)]),_:1}),G(a,{size:`small`,type:`primary`,loading:fe.value,onClick:me},{default:D(()=>[n(W(V(X)(`@WORKBENCH:保存并重跑`)),1)]),_:1},8,[`loading`])])])):(Y(),J(`pre`,Be,W(l.value||`(等待 LLM 启动…)`),1)),I(`h4`,Ve,W(V(X)(`@WORKBENCH:用户提示词(拼装后)`)),1),ie.value?(Y(),J(P,{key:2},[G(h,{modelValue:A.value,"onUpdate:modelValue":r[1]||=e=>A.value=e,type:`textarea`,rows:16,placeholder:V(X)(`@WORKBENCH:正在生成预览…`),readonly:j.value,class:`ai-split-user-editor`,resize:`none`},null,8,[`modelValue`,`placeholder`,`readonly`]),I(`div`,He,[G(a,{size:`small`,disabled:j.value,onClick:N},{default:D(()=>[n(W(V(X)(`@WORKBENCH:取消`)),1)]),_:1},8,[`disabled`]),G(a,{type:`primary`,icon:V(u),disabled:j.value||!A.value.trim(),onClick:F},{default:D(()=>[n(W(V(X)(`@WORKBENCH:发送给 AI`)),1)]),_:1},8,[`icon`,`disabled`])])],64)):(Y(),J(`pre`,Ue,W(f.value||`(等待 LLM 启动…)`),1))]),_:1},8,[`label`]),G(y,{name:`thinking`},{label:D(()=>[I(`span`,null,[n(W(V(X)(`@WORKBENCH:思考`))+` `,1),ee.value>0?(Y(),J(`span`,We,`(`+W(ee.value)+`)`,1)):U(``,!0)])]),default:D(()=>[I(`pre`,Ge,W(p.value||V(X)(`@WORKBENCH:(暂无输出)`)),1)]),_:1}),G(y,{name:`raw`},{label:D(()=>[I(`span`,null,[n(W(V(X)(`@WORKBENCH:原始结果`))+` `,1),w.value>0?(Y(),J(`span`,Ke,`(`+W(w.value)+`)`,1)):U(``,!0)])]),default:D(()=>[v.value&&s.value===`result`?(Y(),O(b,{key:0,type:`warning`,"show-icon":``,closable:!1,class:`ai-split-parse-error`},{title:D(()=>[n(W(V(X)(`@WORKBENCH:模型返回内容解析失败,无法识别为有效的子任务 JSON`)),1)]),default:D(()=>[I(`div`,qe,W(v.value),1),I(`div`,Je,W(V(X)(`@WORKBENCH:常见原因:desc 内夹杂了 ASCII 双引号、出现尾随逗号,或输出被截断。可在下方文本框中手动修改后点「重新解析」,或重新生成。`)),1),I(`div`,Q,[G(a,{size:`small`,type:`primary`,loading:le.value,onClick:ue},{default:D(()=>[n(W(V(X)(`@WORKBENCH:重新解析`)),1)]),_:1},8,[`loading`]),G(a,{size:`small`,onClick:R},{default:D(()=>[n(W(V(X)(`@WORKBENCH:重新生成`)),1)]),_:1}),G(a,{size:`small`,onClick:r[2]||=e=>c.value=`prompt`},{default:D(()=>[n(W(V(X)(`@WORKBENCH:去编辑指令`)),1)]),_:1})])]),_:1})):U(``,!0),s.value===`result`||m.value?(Y(),J(`div`,Ye,[I(`span`,Xe,W(V(X)(`@WORKBENCH:可直接编辑下方文本,修正后点「重新解析」即可入库`)),1),G(a,{size:`small`,type:`primary`,loading:le.value,disabled:!m.value.trim(),onClick:ue},{default:D(()=>[n(W(V(X)(`@WORKBENCH:重新解析`)),1)]),_:1},8,[`loading`,`disabled`])])):U(``,!0),G(h,{modelValue:m.value,"onUpdate:modelValue":r[3]||=e=>m.value=e,type:`textarea`,rows:14,placeholder:V(X)(`@WORKBENCH:(暂无输出)`),readonly:re.value,class:`ai-split-raw-editor`,resize:`none`},null,8,[`modelValue`,`placeholder`,`readonly`])]),_:1}),G(y,{name:`confirm`,disabled:g.value.length===0},{label:D(()=>[I(`span`,null,[n(W(V(X)(`@WORKBENCH:确认入库`))+` `,1),g.value.length>0?(Y(),J(`span`,Ze,`(`+W(g.value.length)+`)`,1)):U(``,!0)])]),default:D(()=>[g.value.length===0?(Y(),J(`div`,Qe,W(V(X)(`@WORKBENCH:(暂无子任务)`)),1)):(Y(),J(`ul`,$e,[(Y(!0),J(P,null,C(g.value,(e,t)=>(Y(),J(`li`,{key:t,class:`ai-split-list__item`},[I(`div`,et,W(t+1),1),I(`div`,tt,[I(`div`,nt,W(e.title),1),I(`div`,rt,W(e.desc),1)])]))),128))]))]),_:1},8,[`disabled`])]),_:1},8,[`modelValue`])),v.value&&s.value===`result`&&g.value.length===0?(Y(),J(`div`,it,[G(i,{color:`#e6a23c`},{default:D(()=>[G(V(Ce))]),_:1}),I(`span`,null,W(V(X)(`@WORKBENCH:解析失败,未能从模型输出中提取出子任务 — 请查看「原始结果」`)),1)])):U(``,!0),I(`div`,at,[s.value===`error`||s.value===`result`&&v.value&&g.value.length===0?(Y(),O(a,{key:0,onClick:R},{default:D(()=>[n(W(V(X)(`@WORKBENCH:重新生成`)),1)]),_:1})):U(``,!0),s.value===`result`&&g.value.length>0?(Y(),O(a,{key:1,onClick:R},{default:D(()=>[n(W(V(X)(`@WORKBENCH:重新拆分`)),1)]),_:1})):U(``,!0),G(a,{type:`primary`,disabled:!T.value,onClick:ce},{default:D(()=>[n(W(V(X)(`@WORKBENCH:确认入库`))+` (`+W(g.value.length)+`) `,1)]),_:1},8,[`disabled`])])])}}}),[[`__scopeId`,`data-v-85bcc687`]]),st={class:`ai-chat-pane`},ct={key:0,class:`ai-chat-streaming-banner`},lt={key:1,class:`ai-chat-empty`},ut={class:`ai-chat-empty__title`},dt={class:`ai-chat-empty__desc`},ft={key:0,class:`ai-chat-bubble user`},pt={class:`ai-chat-content`},mt={key:1,class:`ai-chat-bubble assistant`},ht={class:`ai-chat-pre ai-chat-pre--think`},gt={key:1,class:`ai-chat-content-text`},_t={key:2,class:`ai-chat-subtasks`},vt={class:`ai-chat-subtasks__head`},yt={class:`ai-chat-subtasks__count`},bt={class:`ai-chat-list`},xt={class:`ai-chat-list__no`},St={class:`ai-chat-list__body`},Ct={class:`ai-chat-list__title`},wt={class:`ai-chat-list__desc`},Tt={class:`ai-chat-parse-error__detail`},Et={class:`ai-chat-pre`},Dt={key:5,class:`ai-chat-turn__actions`},Ot={class:`ai-chat-input`},kt={class:`ai-chat-input__actions`},At={key:0,class:`ai-chat-history__loading`},jt={key:1,class:`ai-chat-history__empty`},Mt={key:2,class:`ai-chat-history__list`},Nt={class:`ai-chat-history__title`},Pt={class:`ai-chat-history__meta`},Ft={class:`ai-chat-history__actions`},It=Z(a({__name:`AISplitChatPane`,props:{title:{},desc:{},taskId:{},promptId:{},initialSessionId:{}},emits:[`confirm`],setup(r,{emit:a}){let s=r,c=a,l=M(`idle`),d=M(``),f=M([]),p=M(``),m=M(``),_=null,v=0,y=M(null),b=L(()=>l.value===`streaming`),x=L(()=>{if(!b.value)return``;let e=[...f.value].reverse().find(e=>e.role===`assistant`);return e?e.content?X(`@WORKBENCH:AI 正在输出…`):e.thinking?X(`@WORKBENCH:AI 正在思考… (已思考 {n} 字)`,{n:e.thinking.length}):X(`@WORKBENCH:AI 正在思考…`):X(`@WORKBENCH:AI 正在思考…`)}),S=M(!1),ee=M(!1),w=M([]);function T(){y.value&&(y.value.scrollTop=y.value.scrollHeight)}async function E(){let e=p.value.trim();if(!e||b.value)return;if(!d.value&&!s.title.trim()){k.warning(X(`@WORKBENCH:请先填写任务标题`));return}let t=++v;_=new AbortController;let n=_,r={role:`user`,content:e};f.value.push(r),p.value=``;let i={role:`assistant`,content:``,thinking:``};f.value.push(i),l.value=`streaming`,await g(),T();try{let r=await fetch(`/api/workbench/tasks/ai-chat-split`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify({sessionId:d.value,title:s.title,desc:s.desc,taskId:s.taskId||``,promptId:s.promptId||``,userMessage:e}),signal:n.signal});if(t!==v)return;if(!r.ok||!r.body){let e=await r.text().catch(()=>``);throw Error(e||`HTTP ${r.status}`)}let a=r.body.getReader(),o=new TextDecoder(`utf-8`),c=``,u=null,p=!1;for(;;){let{value:e,done:n}=await a.read();if(t!==v)return;if(n)break;c+=o.decode(e,{stream:!0});let r=c.split(`
|
|
3
3
|
`);c=r.pop()??``;for(let e of r){let t=e.trim();if(!t.startsWith(`data:`))continue;let n=t.slice(5).trim();if(!n)continue;let r;try{r=JSON.parse(n)}catch{continue}switch(r.type){case`meta`:r.sessionId&&(d.value=r.sessionId);break;case`user_echo`:p=!0;break;case`thinking`:i.thinking=(i.thinking||``)+String(r.delta||``);break;case`content`:i.content+=String(r.delta||``);break;case`done`:u=r;break;case`error`:throw Error(r.error||`对话拆分失败`)}}f.value=[...f.value],await g(),T()}if(t!==v)return;if(!p&&!u)throw Error(X(`@WORKBENCH:AI 未返回结果`));u&&(i.subtasks=Array.isArray(u.subtasks)?u.subtasks:[],i.raw=String(u.raw||i.content),i.parseError=String(u.parseError||``),i.parseStage=String(u.parseStage||``)),f.value=[...f.value],await g(),T(),l.value=`idle`}catch(e){if(t!==v)return;if(e?.name===`AbortError`||n.signal.aborted){i.content=(i.content||``)+`
|
|
4
4
|
|