@winspan/claude-forge 3.6.53 → 3.6.57

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 (67) hide show
  1. package/dist/convention/types.d.ts +4 -0
  2. package/dist/convention/types.d.ts.map +1 -1
  3. package/dist/daemon/handlers/pre-tool-use-handler.d.ts.map +1 -1
  4. package/dist/daemon/handlers/pre-tool-use-handler.js +1 -7
  5. package/dist/daemon/handlers/pre-tool-use-handler.js.map +1 -1
  6. package/dist/daemon/handlers/stages/07-pipeline-reply.js +1 -1
  7. package/dist/daemon/handlers/stages/12-strategy-advice.d.ts.map +1 -1
  8. package/dist/daemon/handlers/stages/12-strategy-advice.js +6 -1
  9. package/dist/daemon/handlers/stages/12-strategy-advice.js.map +1 -1
  10. package/dist/daemon/handlers/stages/13-template-route.d.ts.map +1 -1
  11. package/dist/daemon/handlers/stages/13-template-route.js +3 -1
  12. package/dist/daemon/handlers/stages/13-template-route.js.map +1 -1
  13. package/dist/daemon/handlers/stages/18-complex-task.d.ts.map +1 -1
  14. package/dist/daemon/handlers/stages/18-complex-task.js +0 -5
  15. package/dist/daemon/handlers/stages/18-complex-task.js.map +1 -1
  16. package/dist/daemon/handlers/stages/19-moderate-task.d.ts.map +1 -1
  17. package/dist/daemon/handlers/stages/19-moderate-task.js +6 -9
  18. package/dist/daemon/handlers/stages/19-moderate-task.js.map +1 -1
  19. package/dist/goal/goal-classifier.js +6 -0
  20. package/dist/goal/goal-classifier.js.map +1 -1
  21. package/dist/goal/goal-decomposer.d.ts +1 -0
  22. package/dist/goal/goal-decomposer.d.ts.map +1 -1
  23. package/dist/goal/goal-decomposer.js +16 -5
  24. package/dist/goal/goal-decomposer.js.map +1 -1
  25. package/dist/goal/goal-planner.d.ts +1 -0
  26. package/dist/goal/goal-planner.d.ts.map +1 -1
  27. package/dist/goal/goal-planner.js +60 -3
  28. package/dist/goal/goal-planner.js.map +1 -1
  29. package/dist/pipeline/completion-gate.d.ts +3 -0
  30. package/dist/pipeline/completion-gate.d.ts.map +1 -1
  31. package/dist/pipeline/completion-gate.js +22 -1
  32. package/dist/pipeline/completion-gate.js.map +1 -1
  33. package/dist/pipeline/execution-engine.d.ts.map +1 -1
  34. package/dist/pipeline/execution-engine.js +125 -6
  35. package/dist/pipeline/execution-engine.js.map +1 -1
  36. package/dist/pipeline/execution-plan.d.ts +2 -0
  37. package/dist/pipeline/execution-plan.d.ts.map +1 -1
  38. package/dist/pipeline/execution-plan.js +1 -0
  39. package/dist/pipeline/execution-plan.js.map +1 -1
  40. package/dist/pipeline/i-node-executor.d.ts +1 -1
  41. package/dist/pipeline/i-node-executor.d.ts.map +1 -1
  42. package/dist/pipeline/node-type-registry.d.ts.map +1 -1
  43. package/dist/pipeline/node-type-registry.js +18 -0
  44. package/dist/pipeline/node-type-registry.js.map +1 -1
  45. package/dist/pipeline/plan-service.d.ts +1 -0
  46. package/dist/pipeline/plan-service.d.ts.map +1 -1
  47. package/dist/pipeline/plan-service.js +75 -7
  48. package/dist/pipeline/plan-service.js.map +1 -1
  49. package/dist/prompts/pipeline-decompose.md +9 -1
  50. package/dist/retrospective/index.d.ts +2 -1
  51. package/dist/retrospective/index.d.ts.map +1 -1
  52. package/dist/retrospective/index.js +3 -2
  53. package/dist/retrospective/index.js.map +1 -1
  54. package/dist/retrospective/metrics-extractor.d.ts.map +1 -1
  55. package/dist/retrospective/metrics-extractor.js +5 -0
  56. package/dist/retrospective/metrics-extractor.js.map +1 -1
  57. package/dist/retrospective/strategy-advisor.d.ts +3 -1
  58. package/dist/retrospective/strategy-advisor.d.ts.map +1 -1
  59. package/dist/retrospective/strategy-advisor.js +6 -5
  60. package/dist/retrospective/strategy-advisor.js.map +1 -1
  61. package/dist/utils/formatter.d.ts +1 -1
  62. package/dist/utils/formatter.js +2 -2
  63. package/dist/utils/formatter.js.map +1 -1
  64. package/dist/web-static/assets/{PipelineDetail-DGoURh1I.js → PipelineDetail-Dgya5Xr_.js} +1 -1
  65. package/dist/web-static/assets/{index-DCciPmWV.js → index-jF7qJ2X8.js} +2 -2
  66. package/dist/web-static/index.html +1 -1
  67. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$t as t,Bn as n,Bt as r,Ft as i,Gn as a,It as o,Kn as s,Mn as c,Pn as l,Qt as u,Rt as d,Wn as f,Wt as p,Xn as m,Yn as h,Zn as g,dr as _,er as v,gr as y,jn as b,nn as x,pr as S,qn as C,rn as w,s as T,wn as E}from"./vendor-DRGPi8ui.js";import{c as D,l as ee,s as te}from"./vendor-react-DJI9oneq.js";import{a as ne,n as O,r as k}from"./vendor-query-DqPOMnuX.js";import{c as A}from"./vendor-flow-srkes8If.js";import{Kt as j,Ut as M,_ as N,dt as P,j as F,n as re,zt as ie}from"./client-BvVpIixG.js";import{a as I,l as L,n as R,r as z,t as B}from"./ui-CDL3BZ13.js";import{t as V}from"./vendor-motion-CQmdgnI8.js";import{n as H}from"./Toast-BbB3oD2a.js";import{t as U}from"./ConfirmDialog-BKfwMp04.js";import{t as W}from"./Breadcrumb-DtfwnOx6.js";var G=e(y(),1),K=A(),q={pending:s,running:a,validating:x,passed:h,failed:C,need_human:m},J={pending:`text-gray-400`,running:`text-blue-500`,validating:`text-yellow-500`,passed:`text-green-500`,failed:`text-red-500`,need_human:`text-orange-500`},Y={pending:`待执行`,running:`执行中`,validating:`验证中`,passed:`已完成`,failed:`失败`,need_human:`需人工介入`};function ae({steps:e,currentStepId:t}){return!e||e.length===0?null:(0,K.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`text-sm font-medium text-gray-700 dark:text-gray-300 mb-2`,children:[`步骤进度 (`,e.filter(e=>e.status===`passed`).length,`/`,e.length,`)`]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:e.map((e,n)=>{let r=q[e.status],i=e.id===t;return(0,K.jsxs)(`div`,{className:I(`flex items-start gap-3 p-3 rounded-lg border transition-colors`,i?`bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800`:`bg-gray-50 dark:bg-gray-800/50 border-gray-200 dark:border-gray-700`),children:[(0,K.jsx)(`div`,{className:`flex-shrink-0 w-6 h-6 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-xs font-medium`,children:n+1}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,K.jsx)(r,{className:I(`w-4 h-4`,J[e.status])}),(0,K.jsx)(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:e.stepName}),(0,K.jsx)(B,{variant:e.status===`passed`?`success`:e.status===`failed`?`error`:`default`,children:Y[e.status]}),i&&(0,K.jsx)(B,{variant:`info`,children:`当前`})]}),e.attempts>0&&(0,K.jsxs)(`div`,{className:`text-xs text-gray-500 dark:text-gray-400 mb-1`,children:[`重试次数:`,e.attempts]}),e.failureReason&&(0,K.jsxs)(`div`,{className:`text-xs text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 p-2 rounded mt-1`,children:[`失败原因:`,e.failureReason]}),e.outputs&&Object.keys(e.outputs).length>0&&(0,K.jsxs)(`div`,{className:`mt-2 text-xs`,children:[(0,K.jsx)(`div`,{className:`text-gray-600 dark:text-gray-400 mb-1`,children:`输出产物:`}),(0,K.jsx)(`div`,{className:`space-y-1`,children:Object.entries(e.outputs).map(([e,t])=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-700 dark:text-gray-300`,children:[(0,K.jsxs)(`span`,{className:`font-medium`,children:[e,`:`]}),(0,K.jsx)(`a`,{href:`file://${t}`,className:`text-blue-600 dark:text-blue-400 hover:underline truncate`,title:t,children:t})]},e))})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-4 mt-2 text-xs text-gray-500 dark:text-gray-400`,children:[e.startedAt&&(0,K.jsxs)(`span`,{children:[`开始:`,T(new Date(e.startedAt),`HH:mm:ss`)]}),e.completedAt&&(0,K.jsxs)(`span`,{children:[`完成:`,T(new Date(e.completedAt),`HH:mm:ss`)]})]})]})]},e.id)})})]})}var oe={document:c,code:f,test:p,config:t,diagram:E,data:n,other:b},X={analyze:{name:`需求分析`,description:`分析需求,明确目标和范围`},design:{name:`架构设计`,description:`设计系统架构和技术方案`},profile:{name:`性能分析`,description:`分析性能瓶颈,制定优化方案`},code:{name:`编码实现`,description:`编写代码,实现功能`},test:{name:`测试验证`,description:`编写测试,验证功能正确性`},review:{name:`代码审查`,description:`审查代码质量和规范`}},se={analy:`#3b82f6`,design:`#8b5cf6`,architect:`#8b5cf6`,profile:`#06b6d4`,code:`#10b981`,implement:`#10b981`,test:`#f59e0b`,verif:`#f59e0b`,review:`#ef4444`,deploy:`#06b6d4`};function Z(e){let t=e.toLowerCase();for(let[e,n]of Object.entries(se))if(t.includes(e))return n;return`#6b7280`}function Q(e){let t=X[e];return t?t.name:e.split(/[_\-.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function ce(e){return X[e]?.description||null}function le(e){let t=new Set,n=[],r=new Map(e.map(e=>[e.id,e]));function i(e){if(t.has(e))return;t.add(e);let a=r.get(e);a&&((a.dependencies||[]).forEach(e=>i(e)),n.push(a))}return e.forEach(e=>i(e.id)),n}function $(e,t){if(!e)return null;let n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.floor((r-n)/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function ue({pipeline:e,onRetryNode:t}){let[n,r]=(0,G.useState)(new Set),o=(0,G.useMemo)(()=>le(e.nodes),[e.nodes]),s=o.filter(e=>e.status===`completed`||e.status===`skipped`).length,c=o.length>0&&o.every(e=>e.status===`completed`||e.status===`skipped`||e.status===`failed`),l=c?-1:o.findIndex(t=>t.id===e.currentNodeId),u=e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return o.length===0?(0,K.jsx)(z,{children:(0,K.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:`暂无节点`})}):(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(z,{className:`!p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,K.jsxs)(`span`,{className:`text-sm font-medium text-gray-700`,children:[`编排阶段 · `,s,`/`,o.length,` 已完成`]}),(0,K.jsx)(`span`,{className:`text-xs text-gray-400`,children:c||e.status===`completed`?`✅ 全部完成`:e.status===`failed`?`❌ 已失败`:l>=0?`当前:第 ${l+1} 阶段`:`准备中`})]}),(0,K.jsx)(`div`,{className:`flex items-start gap-0 overflow-x-auto pb-1`,children:o.map((t,n)=>{let r=t.id===e.currentNodeId,i=t.status===`completed`,a=t.status===`failed`,s=t.status===`skipped`,c=Z(t.nodeTypeId),l=a?`#ef4444`:s?`#9ca3af`:i||r?c:void 0;return(0,K.jsxs)(`div`,{className:`flex items-center flex-shrink-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,K.jsx)(`div`,{className:I(`w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold transition-all`,l?`text-white`:`bg-gray-100 text-gray-400`,r&&`ring-4 ring-offset-2`),style:l?{backgroundColor:l,...r?{ringColor:`${c}40`}:{}}:{},children:i?`✓`:a?`✗`:s?`—`:n+1}),(0,K.jsx)(`span`,{className:I(`text-xs mt-1 max-w-[72px] text-center leading-tight break-words`,r?`font-bold text-gray-900`:`text-gray-500`),children:Q(t.nodeTypeId)})]}),n<o.length-1&&(0,K.jsx)(`div`,{className:I(`h-0.5 w-6 mx-0.5 mb-5 flex-shrink-0 transition-colors`,i?`bg-green-400`:`bg-gray-200`)})]},t.id)})})]}),(0,K.jsx)(`div`,{className:`space-y-3`,children:o.map((r,s)=>{let c=r.id===e.currentNodeId,l=Z(r.nodeTypeId),d=Q(r.nodeTypeId),f=ce(r.nodeTypeId),p=$(r.startedAt,r.completedAt),m=n.has(r.id),h=null,_=null;if(r.output)try{let e=JSON.parse(r.output);e.artifacts&&e.validation?h=e:_=r.output}catch{_=r.output}let y=_?_.trim().split(`
2
2
  `):[],S=y.length>10,C=(r.dependencies||[]).map(e=>{let t=o.find(t=>t.id===e);return t?Q(t.nodeTypeId):e.slice(0,8)});return(0,K.jsxs)(z,{className:I(`!p-0 overflow-hidden transition-all`,c?`ring-2 ring-blue-400 ring-offset-1`:``),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 p-4`,children:[(0,K.jsx)(`div`,{className:`w-10 h-10 rounded-full flex items-center justify-center text-white font-bold text-sm flex-shrink-0`,style:{backgroundColor:r.status===`pending`?`#d1d5db`:r.status===`failed`?`#ef4444`:r.status===`skipped`?`#9ca3af`:l},children:r.status===`completed`?`✓`:r.status===`failed`?`✗`:r.status===`skipped`?`—`:s+1}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,K.jsx)(`span`,{className:`font-semibold text-gray-900`,children:d}),c&&(0,K.jsx)(B,{variant:`info`,size:`sm`,children:`当前阶段`}),(0,K.jsx)(B,{size:`sm`,variant:r.status===`completed`?`success`:r.status===`in_progress`?`info`:r.status===`failed`?`danger`:r.status===`skipped`?`warning`:`default`,children:r.status===`completed`?`已完成`:r.status===`in_progress`?`执行中`:r.status===`failed`?`失败`:r.status===`skipped`?`已跳过`:`等待中`}),p&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-gray-400`,children:[(0,K.jsx)(a,{className:`w-3 h-3`}),p]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-1`,children:[f&&(0,K.jsx)(`span`,{className:`text-xs text-gray-500`,children:f}),r.boundSkillName&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-amber-600`,children:[(0,K.jsx)(i,{className:`w-3 h-3`}),r.boundSkillName]}),C.length>0&&(0,K.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`依赖:`,C.join(`, `)]}),r.completedAt&&(0,K.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`完成于 `,T(new Date(r.completedAt),`HH:mm:ss`)]})]})]}),r.status===`failed`&&t&&(0,K.jsx)(R,{variant:`outline`,size:`sm`,icon:x,onClick:()=>t(r.id),className:`flex-shrink-0`,children:`重试`})]}),h&&(0,K.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 px-4 pt-3 pb-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold text-gray-500 uppercase tracking-wider`,children:`阶段产出`}),!h.validation.passed&&(0,K.jsx)(B,{variant:`danger`,size:`sm`,children:`验证失败`})]}),h.summary&&(0,K.jsx)(`div`,{className:`text-sm text-gray-700 mb-3`,children:h.summary}),h.artifacts.length>0&&(0,K.jsx)(`div`,{className:`space-y-2`,children:h.artifacts.map((e,t)=>(0,K.jsx)(`div`,{className:`bg-white rounded-lg border border-gray-200 p-3`,children:(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(oe[e.type]||b,{className:`w-4 h-4 text-gray-400 mt-0.5 flex-shrink-0`}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`div`,{className:`font-mono text-sm text-gray-900 break-all`,children:e.path}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 text-xs text-gray-500`,children:[(0,K.jsx)(`span`,{className:`capitalize`,children:e.type}),e.size_bytes&&(0,K.jsxs)(`span`,{children:[`· `,(e.size_bytes/1024).toFixed(1),` KB`]}),(0,K.jsxs)(`span`,{children:[`· `,T(new Date(e.created_at),`HH:mm:ss`)]})]})]})]})},t))}),h.validation.errors&&h.validation.errors.length>0&&(0,K.jsx)(`div`,{className:`mt-3 p-2 bg-red-50 border border-red-200 rounded text-xs text-red-700`,children:h.validation.errors.map((e,t)=>(0,K.jsxs)(`div`,{children:[`• `,e]},t))})]}),!h&&y.length>0&&(0,K.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 px-4 pt-3 pb-4`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold text-gray-500 uppercase tracking-wider`,children:`阶段产出`}),(0,K.jsx)(`div`,{className:I(`mt-2 text-sm text-gray-800 whitespace-pre-wrap font-mono bg-white rounded-lg border border-gray-100 p-3 leading-relaxed`,!m&&S?`max-h-52 overflow-hidden`:``),children:!m&&S?y.slice(0,10).join(`
3
3
  `)+`
4
- …`:_}),S&&(0,K.jsx)(`button`,{onClick:()=>u(r.id),className:`mt-2 text-xs text-blue-600 hover:underline flex items-center gap-1`,children:m?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(g,{className:`w-3 h-3`}),`收起`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(v,{className:`w-3 h-3`}),`展开全部(`,y.length,` 行)`]})})]}),r.stepExecutions&&r.stepExecutions.length>0&&(0,K.jsx)(`div`,{className:`border-t border-gray-100 bg-white px-4 py-3`,children:(0,K.jsx)(ae,{steps:r.stepExecutions,currentStepId:r.currentStepId})}),r.status===`in_progress`&&y.length===0&&(0,K.jsxs)(`div`,{className:`border-t border-blue-100 bg-blue-50 px-4 py-3 flex items-center gap-2 text-sm text-blue-600`,children:[(0,K.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-blue-500 animate-pulse`}),`正在执行,等待产出…`]})]},r.id)})})]})}var de={PreToolUse:`#3b82f6`,PostToolUse:`#10b981`,UserPromptSubmit:`#f59e0b`,Stop:`#ef4444`};function fe(){let{id:e}=ee(),t=D(),n=te(),i=ne(),[a,s]=(0,G.useState)(`tasks`),[c,f]=(0,G.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),p=n.state?.from||`/pipelines`,{data:m,isLoading:g,isError:v,error:y}=k({queryKey:[`pipeline`,e],queryFn:()=>P(e).then(e=>e.data),enabled:!!e}),b=O({mutationFn:()=>N(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),t(p)},onError:e=>H(e.message||`关闭失败`,`error`)}),x=O({mutationFn:()=>ie(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(`Pipeline 已重新激活`,`success`)},onError:e=>H(e.message||`重新激活失败`,`error`)}),C=O({mutationFn:()=>j(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(`已添加到执行队列,下次工具调用时自动注入提示`,`success`)},onError:e=>H(e.message||`恢复失败`,`error`)}),E=O({mutationFn:t=>re(e),onSuccess:t=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(t.data.message||`节点已重置,等待重新执行`,`success`)},onError:e=>H(e.message||`重试失败`,`error`)}),A=O({mutationFn:e=>M(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(`问题已标记为已解决`,`success`)},onError:e=>H(e.message||`操作失败`,`error`)}),q=O({mutationFn:e=>F(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(`问题已忽略`,`success`)},onError:e=>H(e.message||`操作失败`,`error`)});if(v)return(0,K.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,y?.message||`未知错误`]});if(g||!m)return(0,K.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,K.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let J=m,Y=J.status!==`completed`&&J.status!==`failed`;return(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsx)(W,{items:[{label:`Pipeline 列表`,path:`/pipelines`},{label:m.id.slice(0,12)+`...`}]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(R,{variant:`ghost`,size:`sm`,icon:_,onClick:()=>t(p),children:`返回`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-lg font-bold text-gray-900`,children:`Pipeline 执行轨迹`}),(0,K.jsxs)(B,{variant:`primary`,size:`sm`,children:[(0,K.jsx)(d,{className:`w-3 h-3 mr-1`}),` 动态编排`]})]}),(0,K.jsxs)(`p`,{className:`text-sm text-gray-500`,children:[(0,K.jsx)(`span`,{className:`font-mono`,children:m.id.slice(0,12)}),m.sessionId&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`mx-2`,children:`·`}),(0,K.jsxs)(`span`,{className:`text-blue-600 cursor-pointer hover:underline`,onClick:()=>t(`/sessions/${m.sessionId}`),children:[`会话 `,m.sessionId.slice(0,8)]})]})]})]}),(0,K.jsx)(B,{variant:Y?`info`:`success`,children:J.status===`completed`?`已完成`:J.status===`failed`?`已失败`:`执行中`}),(0,K.jsx)(B,{variant:m.complexity===`complex`?`danger`:m.complexity===`moderate`?`warning`:`default`,children:m.complexity})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[m.sessionId&&(0,K.jsx)(R,{variant:`secondary`,size:`sm`,icon:S,onClick:()=>t(`/sessions/${m.sessionId}`),children:`查看会话`}),Y&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(R,{variant:`primary`,size:`sm`,onClick:()=>C.mutate(),loading:C.isPending,children:`继续执行`}),(0,K.jsx)(R,{variant:`danger`,size:`sm`,icon:o,onClick:()=>{f({open:!0,title:`关闭 Pipeline`,description:`确认关闭此 Pipeline?`,onConfirm:()=>{b.mutate(),f(e=>({...e,open:!1}))}})},children:`关闭`})]}),!Y&&(0,K.jsx)(R,{variant:`secondary`,size:`sm`,icon:w,onClick:()=>{f({open:!0,title:`重新激活 Pipeline`,description:`确认重新激活此 Pipeline?状态将重置为活跃。`,onConfirm:()=>{x.mutate(),f(e=>({...e,open:!1}))}})},loading:x.isPending,children:`重新激活`})]})]}),(0,K.jsx)(z,{className:`!p-4`,children:(0,K.jsx)(`p`,{className:`text-sm text-gray-700 line-clamp-3`,children:m.requirement})}),J.executionPlan&&(0,K.jsx)(z,{title:`编排计划`,className:`!p-4`,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[J.reasoning&&(0,K.jsxs)(`div`,{className:`text-sm text-gray-600 bg-blue-50 p-3 rounded-lg border border-blue-100`,children:[(0,K.jsx)(`div`,{className:`font-medium text-blue-900 mb-1`,children:`规划依据`}),(0,K.jsx)(`p`,{className:`text-blue-800`,children:J.reasoning})]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:J.executionPlan.stages.map((e,t)=>{let n=J.nodes.find(t=>t.nodeTypeId===e.nodeTypeId),r=n?.status===`completed`,i=n?.status===`in_progress`,a=!n||n.status===`pending`;return(0,K.jsxs)(`div`,{className:I(`flex items-start gap-3 p-3 rounded-lg border`,r&&`bg-green-50 border-green-200`,i&&`bg-blue-50 border-blue-200`,a&&`bg-gray-50 border-gray-200`),children:[(0,K.jsx)(`div`,{className:`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold`,style:{backgroundColor:r?`#10b981`:i?`#3b82f6`:`#9ca3af`,color:`white`},children:t+1}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-gray-900`,children:e.name}),(0,K.jsx)(B,{size:`sm`,variant:r?`success`:i?`info`:`default`,children:r?`已完成`:i?`进行中`:`待执行`}),e.phase&&(0,K.jsx)(B,{size:`sm`,children:e.phase})]}),e.description&&(0,K.jsx)(`p`,{className:`text-sm text-gray-600 mt-1`,children:e.description}),e.expectedArtifacts&&e.expectedArtifacts.length>0&&(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:`预期产物:`}),e.expectedArtifacts.map((e,t)=>(0,K.jsxs)(`span`,{className:`ml-1 font-mono bg-gray-100 px-1.5 py-0.5 rounded`,children:[e.pattern,e.required&&(0,K.jsx)(`span`,{className:`text-red-500`,children:`*`})]},t))]})]})]},t)})})]})}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-3`,children:[(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-blue-600`,children:m.stats.totalEvents}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`事件`})]}),(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-green-600`,children:`${J.stats.completedNodes}/${J.stats.totalNodes}`}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`节点`})]}),(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-purple-600`,children:m.stats.totalArtifacts}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`产物`})]}),(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-orange-600`,children:m.stats.totalQualityIssues}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`质量问题`})]}),(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-red-600`,children:m.stats.unresolvedQuality}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`未解决`})]})]}),(0,K.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit`,children:[`tasks`,`events`,`artifacts`,`quality`].map(e=>(0,K.jsx)(`button`,{onClick:()=>s(e),className:I(`px-4 py-2 rounded-md text-sm font-medium transition-colors`,a===e?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`),children:{tasks:`编排图 (${J.stats.totalNodes})`,events:`事件 (${m.stats.totalEvents})`,artifacts:`产物 (${m.stats.totalArtifacts})`,quality:`质量 (${m.stats.totalQualityIssues})`}[e]},e))}),a===`tasks`&&(0,K.jsx)(`div`,{className:`space-y-4`,children:(0,K.jsx)(ue,{pipeline:J,onRetryNode:e=>{f({open:!0,title:`重试失败节点`,description:`确定要重试此节点吗?节点状态将重置为等待中,下次工具调用时自动重新执行。`,onConfirm:()=>{E.mutate(e),f(e=>({...e,open:!1}))}})}})}),a===`events`&&(0,K.jsx)(z,{title:`工具调用时间线`,children:(0,K.jsxs)(`div`,{className:`space-y-1 max-h-[600px] overflow-y-auto`,children:[m.events.map((e,t)=>(0,K.jsxs)(V.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:t*.01},className:`flex items-center gap-3 py-1.5 px-2 rounded hover:bg-gray-50 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-gray-400 font-mono w-16 flex-shrink-0`,children:T(L(e.time),`HH:mm:ss`)}),(0,K.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:de[e.hookType]||`#6b7280`}}),(0,K.jsx)(`span`,{className:`font-mono text-gray-700 w-20 flex-shrink-0`,children:e.toolName||e.hookType}),(0,K.jsx)(`span`,{className:`text-gray-500 truncate`,children:e.detail||``})]},t)),m.events.length===0&&(0,K.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无事件`})]})}),a===`artifacts`&&(0,K.jsx)(z,{title:`产物文件`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[m.artifacts.map((e,t)=>(0,K.jsx)(V.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.03},className:`flex items-center justify-between p-3 rounded-lg border border-gray-100 hover:border-green-200 hover:bg-green-50/50`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(l,{className:`h-5 w-5 text-green-500`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-mono text-sm text-gray-900`,children:e.filePath.split(`/`).slice(-2).join(`/`)}),(0,K.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[e.tool,` · `,T(L(e.time),`HH:mm:ss`)]})]})]})},t)),m.artifacts.length===0&&(0,K.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无产物`})]})}),a===`quality`&&(0,K.jsx)(z,{title:`质量问题`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[m.qualityIssues.map((e,t)=>(0,K.jsxs)(V.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:t*.03},className:`flex items-start justify-between p-3 rounded-lg border border-gray-100`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3 flex-1`,children:[e.resolved?(0,K.jsx)(h,{className:`h-5 w-5 text-green-500 mt-0.5`}):(0,K.jsx)(r,{className:`h-5 w-5 text-amber-500 mt-0.5`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(B,{size:`sm`,variant:e.level===`error`?`danger`:e.level===`warn`?`warning`:`info`,children:e.level}),(0,K.jsx)(B,{size:`sm`,children:e.category})]}),(0,K.jsx)(`p`,{className:`text-sm text-gray-700 mt-1`,children:e.message}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:T(L(e.createdAt),`MM-dd HH:mm`)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(B,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),!e.resolved&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(R,{variant:`secondary`,size:`sm`,onClick:()=>A.mutate(e.id),loading:A.isPending,children:`解决`}),(0,K.jsx)(R,{variant:`ghost`,size:`sm`,onClick:()=>q.mutate(e.id),loading:q.isPending,children:`忽略`})]})]})]},t)),m.qualityIssues.length===0&&(0,K.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,K.jsx)(u,{className:`h-12 w-12 mx-auto mb-3 text-green-300`}),`暂无质量问题`]})]})}),(0,K.jsx)(U,{open:c.open,title:c.title,description:c.description,variant:`danger`,onConfirm:c.onConfirm,onCancel:()=>f({...c,open:!1})})]})}export{fe as default};
4
+ …`:_}),S&&(0,K.jsx)(`button`,{onClick:()=>u(r.id),className:`mt-2 text-xs text-blue-600 hover:underline flex items-center gap-1`,children:m?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(g,{className:`w-3 h-3`}),`收起`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(v,{className:`w-3 h-3`}),`展开全部(`,y.length,` 行)`]})})]}),r.stepExecutions&&r.stepExecutions.length>0&&(0,K.jsx)(`div`,{className:`border-t border-gray-100 bg-white px-4 py-3`,children:(0,K.jsx)(ae,{steps:r.stepExecutions,currentStepId:r.currentStepId})}),r.status===`in_progress`&&y.length===0&&(0,K.jsxs)(`div`,{className:`border-t border-blue-100 bg-blue-50 px-4 py-3 flex items-center gap-2 text-sm text-blue-600`,children:[(0,K.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-blue-500 animate-pulse`}),`正在执行,等待产出…`]})]},r.id)})})]})}var de={PreToolUse:`#3b82f6`,PostToolUse:`#10b981`,UserPromptSubmit:`#f59e0b`,Stop:`#ef4444`};function fe(){let{id:e}=ee(),t=D(),n=te(),i=ne(),[a,s]=(0,G.useState)(`tasks`),[c,f]=(0,G.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),p=n.state?.from||`/pipelines`,{data:m,isLoading:g,isError:v,error:y}=k({queryKey:[`pipeline`,e],queryFn:()=>P(e).then(e=>e.data),enabled:!!e}),b=O({mutationFn:()=>N(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),t(p)},onError:e=>H(e.message||`关闭失败`,`error`)}),x=O({mutationFn:()=>ie(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(`Pipeline 已重新激活`,`success`)},onError:e=>H(e.message||`重新激活失败`,`error`)}),C=O({mutationFn:()=>j(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(`已添加到执行队列,下次工具调用时自动注入提示`,`success`)},onError:e=>H(e.message||`恢复失败`,`error`)}),E=O({mutationFn:t=>re(e),onSuccess:t=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(t.data.message||`节点已重置,等待重新执行`,`success`)},onError:e=>H(e.message||`重试失败`,`error`)}),A=O({mutationFn:e=>M(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(`问题已标记为已解决`,`success`)},onError:e=>H(e.message||`操作失败`,`error`)}),q=O({mutationFn:e=>F(e),onSuccess:()=>{i.invalidateQueries({queryKey:[`pipeline`,e]}),H(`问题已忽略`,`success`)},onError:e=>H(e.message||`操作失败`,`error`)});if(v)return(0,K.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,y?.message||`未知错误`]});if(g||!m)return(0,K.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,K.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let J=m,Y=J.status!==`completed`&&J.status!==`failed`;return(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsx)(W,{items:[{label:`Pipeline 列表`,path:`/pipelines`},{label:m.id.slice(0,12)+`...`}]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(R,{variant:`ghost`,size:`sm`,icon:_,onClick:()=>t(p),children:`返回`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-lg font-bold text-gray-900`,children:`Pipeline 执行轨迹`}),(0,K.jsxs)(B,{variant:`primary`,size:`sm`,children:[(0,K.jsx)(d,{className:`w-3 h-3 mr-1`}),` 动态编排`]})]}),(0,K.jsxs)(`p`,{className:`text-sm text-gray-500`,children:[(0,K.jsx)(`span`,{className:`font-mono`,children:m.id.slice(0,12)}),m.sessionId&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`mx-2`,children:`·`}),(0,K.jsxs)(`span`,{className:`text-blue-600 cursor-pointer hover:underline`,onClick:()=>t(`/sessions/${m.sessionId}`),children:[`会话 `,m.sessionId.slice(0,8)]})]})]})]}),(0,K.jsx)(B,{variant:Y?`info`:`success`,children:J.status===`completed`?`已完成`:J.status===`failed`?`已失败`:`执行中`}),(0,K.jsx)(B,{variant:m.complexity===`complex`?`danger`:m.complexity===`moderate`?`warning`:`default`,children:m.complexity})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[m.sessionId&&(0,K.jsx)(R,{variant:`secondary`,size:`sm`,icon:S,onClick:()=>t(`/sessions/${m.sessionId}`),children:`查看会话`}),Y&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(R,{variant:`primary`,size:`sm`,onClick:()=>C.mutate(),loading:C.isPending,children:`继续执行`}),(0,K.jsx)(R,{variant:`danger`,size:`sm`,icon:o,onClick:()=>{f({open:!0,title:`关闭 Pipeline`,description:`确认关闭此 Pipeline?`,onConfirm:()=>{b.mutate(),f(e=>({...e,open:!1}))}})},children:`关闭`})]}),!Y&&(0,K.jsx)(R,{variant:`secondary`,size:`sm`,icon:w,onClick:()=>{f({open:!0,title:`重新激活 Pipeline`,description:`确认重新激活此 Pipeline?状态将重置为活跃。`,onConfirm:()=>{x.mutate(),f(e=>({...e,open:!1}))}})},loading:x.isPending,children:`重新激活`})]})]}),(0,K.jsx)(z,{className:`!p-4`,children:(0,K.jsx)(`p`,{className:`text-sm text-gray-700 line-clamp-3`,children:m.requirement})}),J.executionPlan&&(0,K.jsx)(z,{title:`编排计划`,className:`!p-4`,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[J.reasoning&&(0,K.jsxs)(`div`,{className:`text-sm bg-blue-50 p-3 rounded-lg border border-blue-100`,children:[(0,K.jsx)(`div`,{className:`font-medium text-blue-900 mb-1`,children:`规划依据`}),(0,K.jsx)(`p`,{className:`text-blue-800`,children:J.reasoning}),J.executionPlan.complexity&&(0,K.jsxs)(`div`,{className:`mt-1.5 flex gap-2 flex-wrap`,children:[(0,K.jsxs)(`span`,{className:`text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded-full`,children:[`复杂度:`,J.executionPlan.complexity]}),J.executionPlan.source&&(0,K.jsxs)(`span`,{className:`text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded-full`,children:[`来源:`,J.executionPlan.source===`template`?`模板匹配`:`AI 智能分解`]}),J.executionPlan.templateName&&(0,K.jsxs)(`span`,{className:`text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded-full`,children:[`模板:`,J.executionPlan.templateName]})]})]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:J.executionPlan.stages.map((e,t)=>{let n=J.nodes.find(t=>t.nodeTypeId===e.nodeTypeId),r=n?.status===`completed`,i=n?.status===`in_progress`,a=!n||n.status===`pending`;return(0,K.jsxs)(`div`,{className:I(`flex items-start gap-3 p-3 rounded-lg border`,r&&`bg-green-50 border-green-200`,i&&`bg-blue-50 border-blue-200`,a&&`bg-gray-50 border-gray-200`),children:[(0,K.jsx)(`div`,{className:`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold`,style:{backgroundColor:r?`#10b981`:i?`#3b82f6`:`#9ca3af`,color:`white`},children:t+1}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-gray-900`,children:e.name}),(0,K.jsx)(B,{size:`sm`,variant:r?`success`:i?`info`:`default`,children:r?`已完成`:i?`进行中`:`待执行`}),e.phase&&(0,K.jsx)(B,{size:`sm`,children:e.phase})]}),e.description&&(0,K.jsx)(`p`,{className:`text-sm text-gray-600 mt-1`,children:e.description}),e.stageReasoning&&(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500 bg-white bg-opacity-60 rounded px-2 py-1.5 border border-gray-200`,children:[(0,K.jsx)(`span`,{className:`font-medium text-gray-600`,children:`编排依据:`}),(0,K.jsx)(`span`,{children:e.stageReasoning})]}),e.expectedArtifacts&&e.expectedArtifacts.length>0&&(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:`预期产物:`}),e.expectedArtifacts.map((e,t)=>(0,K.jsxs)(`span`,{className:`ml-1 font-mono bg-gray-100 px-1.5 py-0.5 rounded`,children:[e.pattern,e.required&&(0,K.jsx)(`span`,{className:`text-red-500`,children:`*`})]},t))]})]})]},t)})})]})}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-3`,children:[(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-blue-600`,children:m.stats.totalEvents}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`事件`})]}),(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-green-600`,children:`${J.stats.completedNodes}/${J.stats.totalNodes}`}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`节点`})]}),(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-purple-600`,children:m.stats.totalArtifacts}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`产物`})]}),(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-orange-600`,children:m.stats.totalQualityIssues}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`质量问题`})]}),(0,K.jsxs)(z,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-red-600`,children:m.stats.unresolvedQuality}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`未解决`})]})]}),(0,K.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit`,children:[`tasks`,`events`,`artifacts`,`quality`].map(e=>(0,K.jsx)(`button`,{onClick:()=>s(e),className:I(`px-4 py-2 rounded-md text-sm font-medium transition-colors`,a===e?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`),children:{tasks:`编排图 (${J.stats.totalNodes})`,events:`事件 (${m.stats.totalEvents})`,artifacts:`产物 (${m.stats.totalArtifacts})`,quality:`质量 (${m.stats.totalQualityIssues})`}[e]},e))}),a===`tasks`&&(0,K.jsx)(`div`,{className:`space-y-4`,children:(0,K.jsx)(ue,{pipeline:J,onRetryNode:e=>{f({open:!0,title:`重试失败节点`,description:`确定要重试此节点吗?节点状态将重置为等待中,下次工具调用时自动重新执行。`,onConfirm:()=>{E.mutate(e),f(e=>({...e,open:!1}))}})}})}),a===`events`&&(0,K.jsx)(z,{title:`工具调用时间线`,children:(0,K.jsxs)(`div`,{className:`space-y-1 max-h-[600px] overflow-y-auto`,children:[m.events.map((e,t)=>(0,K.jsxs)(V.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:t*.01},className:`flex items-center gap-3 py-1.5 px-2 rounded hover:bg-gray-50 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-gray-400 font-mono w-16 flex-shrink-0`,children:T(L(e.time),`HH:mm:ss`)}),(0,K.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:de[e.hookType]||`#6b7280`}}),(0,K.jsx)(`span`,{className:`font-mono text-gray-700 w-20 flex-shrink-0`,children:e.toolName||e.hookType}),(0,K.jsx)(`span`,{className:`text-gray-500 truncate`,children:e.detail||``})]},t)),m.events.length===0&&(0,K.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无事件`})]})}),a===`artifacts`&&(0,K.jsx)(z,{title:`产物文件`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[m.artifacts.map((e,t)=>(0,K.jsx)(V.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.03},className:`flex items-center justify-between p-3 rounded-lg border border-gray-100 hover:border-green-200 hover:bg-green-50/50`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(l,{className:`h-5 w-5 text-green-500`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-mono text-sm text-gray-900`,children:e.filePath.split(`/`).slice(-2).join(`/`)}),(0,K.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[e.tool,` · `,T(L(e.time),`HH:mm:ss`)]})]})]})},t)),m.artifacts.length===0&&(0,K.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无产物`})]})}),a===`quality`&&(0,K.jsx)(z,{title:`质量问题`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[m.qualityIssues.map((e,t)=>(0,K.jsxs)(V.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:t*.03},className:`flex items-start justify-between p-3 rounded-lg border border-gray-100`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3 flex-1`,children:[e.resolved?(0,K.jsx)(h,{className:`h-5 w-5 text-green-500 mt-0.5`}):(0,K.jsx)(r,{className:`h-5 w-5 text-amber-500 mt-0.5`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(B,{size:`sm`,variant:e.level===`error`?`danger`:e.level===`warn`?`warning`:`info`,children:e.level}),(0,K.jsx)(B,{size:`sm`,children:e.category})]}),(0,K.jsx)(`p`,{className:`text-sm text-gray-700 mt-1`,children:e.message}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:T(L(e.createdAt),`MM-dd HH:mm`)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(B,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),!e.resolved&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(R,{variant:`secondary`,size:`sm`,onClick:()=>A.mutate(e.id),loading:A.isPending,children:`解决`}),(0,K.jsx)(R,{variant:`ghost`,size:`sm`,onClick:()=>q.mutate(e.id),loading:q.isPending,children:`忽略`})]})]})]},t)),m.qualityIssues.length===0&&(0,K.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,K.jsx)(u,{className:`h-12 w-12 mx-auto mb-3 text-green-300`}),`暂无质量问题`]})]})}),(0,K.jsx)(U,{open:c.open,title:c.title,description:c.description,variant:`danger`,onConfirm:c.onConfirm,onCancel:()=>f({...c,open:!1})})]})}export{fe as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-Dskgf0jG.js","assets/rolldown-runtime-COnpUsM8.js","assets/vendor-react-DJI9oneq.js","assets/vendor-DRGPi8ui.js","assets/vendor-charts-9eVsQvUV.js","assets/vendor-query-DqPOMnuX.js","assets/vendor-flow-srkes8If.js","assets/vendor-flow-CHpVij2M.css","assets/vendor-motion-CQmdgnI8.js","assets/client-BvVpIixG.js","assets/ConfirmDialog-BKfwMp04.js","assets/ui-CDL3BZ13.js","assets/Sessions-C0BmdDPK.js","assets/BatchProgress-BQ533tSf.js","assets/ErrorState-BOInXmfg.js","assets/Skeleton-B7PVDJJ_.js","assets/exportCsv-Dm5Y5M_E.js","assets/SessionDetail-BMrqH8_W.js","assets/Breadcrumb-DtfwnOx6.js","assets/Events-CAY9kU9T.js","assets/useDebounce-DNfPs3Tv.js","assets/Pipelines-Drat9IqZ.js","assets/Pagination-lp8b_3NR.js","assets/PipelineDetail-DGoURh1I.js","assets/Toast-BbB3oD2a.js","assets/Quality-Bm7oRSun.js","assets/Config-1QvdGyY8.js","assets/Analytics-txva5ugO.js","assets/Knowledge-BHLyFp2U.js","assets/Projects-qDolX6Y6.js","assets/ProjectDetail-Cx8VZp8O.js","assets/Skills-B3c1_uFt.js","assets/Conventions-E_2yAYoB.js","assets/vendor-editor-CYLOGES5.js","assets/NodeTypes-B6wc7VnR.js","assets/PipelineTemplates-sSL-9oRh.js","assets/Templates-Dho__f4l.js","assets/TemplateDetail-ep5h3Cu5.js","assets/Evolution-Ck_BqRpt.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$n as t,$t as n,Bt as r,Dn as i,En as a,Ft as o,Mn as s,Qt as c,Un as l,Vt as u,_n as d,ar as f,cr as p,en as ee,gr as m,ir as h,kn as g,mn as _,or as v,pr as y,rn as b,rr as x,un as S,xn as C}from"./vendor-DRGPi8ui.js";import{a as w,c as T,d as E,i as D,o as O,r as k,s as A,t as j,u as M}from"./vendor-react-DJI9oneq.js";import{a as N,i as P,o as F,r as I}from"./vendor-query-DqPOMnuX.js";import{c as te}from"./vendor-flow-srkes8If.js";import{Dt as L,Yt as R,et as z,ht as B,wt as V}from"./client-BvVpIixG.js";import{a as H,n as U}from"./ui-CDL3BZ13.js";import{n as W,t as G}from"./vendor-motion-CQmdgnI8.js";import{t as K}from"./useDebounce-DNfPs3Tv.js";import{t as q}from"./Toast-BbB3oD2a.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var J=e(E(),1),Y=e(m(),1),X=te(),Z=[{path:`/dashboard`,label:`仪表盘`,icon:C},{path:`/projects`,label:`项目管理`,icon:g},{path:`/sessions`,label:`会话管理`,icon:y},{path:`/events`,label:`事件流`,icon:h},{path:`/pipelines`,label:`流水线`,icon:i},{path:`/quality`,label:`质量门禁`,icon:c},{path:`/knowledge`,label:`知识图谱`,icon:f},{path:`/skills`,label:`技能管理`,icon:S},{path:`/conventions`,label:`规范管理`,icon:p},{path:`/node-types`,label:`节点类型`,icon:v},{path:`/pipeline-templates`,label:`模板管理`,icon:s},{path:`/templates`,label:`执行模板`,icon:i},{path:`/evolution`,label:`模板进化`,icon:u},{path:`/analytics`,label:`数据分析`,icon:x},{path:`/config`,label:`系统配置`,icon:n}];function Q({children:e}){let[n,r]=(0,Y.useState)(()=>localStorage.getItem(`sidebar-collapsed`)===`true`),i=A();(0,Y.useEffect)(()=>{localStorage.setItem(`sidebar-collapsed`,String(n))},[n]);let{data:a}=I({queryKey:[`health`],queryFn:()=>z().then(e=>e.data)}),s=Z.find(e=>i.pathname.startsWith(e.path));return(0,X.jsxs)(`div`,{className:`flex min-h-screen bg-gray-50`,children:[(0,X.jsxs)(`aside`,{className:H(`fixed top-0 left-0 bottom-0 z-50 flex flex-col transition-all duration-300`,`bg-gradient-to-b from-slate-900 to-slate-800`,n?`w-16`:`w-60`),children:[(0,X.jsxs)(`div`,{className:H(`flex items-center border-b border-white/10 h-16`,n?`justify-center px-2`:`justify-between px-5`),children:[!n&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-gradient-to-br from-blue-500 to-purple-600`,children:(0,X.jsx)(o,{className:`h-5 w-5 text-white`})}),(0,X.jsx)(`span`,{className:`text-white font-bold text-lg tracking-tight`,children:`Forge`})]}),(0,X.jsx)(`button`,{onClick:()=>r(!n),className:`p-1.5 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-colors`,children:n?(0,X.jsx)(_,{className:`h-5 w-5`}):(0,X.jsx)(t,{className:`h-5 w-5`})})]}),(0,X.jsx)(`nav`,{className:`flex-1 py-4 space-y-1 px-2`,children:Z.map(e=>(0,X.jsxs)(k,{to:e.path,className:({isActive:e})=>H(`flex items-center gap-3 rounded-lg transition-all duration-200`,n?`justify-center p-3`:`px-3 py-2.5`,e?`bg-blue-600/20 text-blue-400`:`text-white/60 hover:text-white hover:bg-white/5`),children:[(0,X.jsx)(e.icon,{className:`h-5 w-5 flex-shrink-0`}),!n&&(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]},e.path))}),(0,X.jsx)(`div`,{className:H(`border-t border-white/10 py-4`,n?`px-2`:`px-5`),children:(0,X.jsxs)(`div`,{className:H(`flex items-center gap-2`,n?`justify-center`:``),children:[(0,X.jsx)(`div`,{className:H(`w-2 h-2 rounded-full`,a?.status===`ok`?`bg-green-400 animate-pulse`:`bg-red-400`)}),!n&&(0,X.jsx)(`span`,{className:`text-xs text-white/40`,children:a?.status===`ok`?`Daemon 运行中`:`连接断开`})]})})]}),(0,X.jsxs)(`main`,{className:H(`flex-1 transition-all duration-300`,n?`ml-16`:`ml-60`),children:[(0,X.jsxs)(`header`,{className:`sticky top-0 z-40 bg-white/80 backdrop-blur-md border-b border-gray-200/50 h-16 flex items-center justify-between px-8`,children:[(0,X.jsx)(`h1`,{className:`text-xl font-semibold text-gray-900`,children:s?.label||`Claude Forge`}),(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,X.jsxs)(`button`,{className:`hidden sm:flex items-center gap-2 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors`,onClick:()=>{let e=new KeyboardEvent(`keydown`,{key:`k`,metaKey:!0});window.dispatchEvent(e)},children:[(0,X.jsx)(l,{className:`h-4 w-4`}),(0,X.jsx)(`span`,{children:`命令面板`}),(0,X.jsx)(`kbd`,{className:`px-2 py-0.5 text-xs bg-gray-100 rounded border border-gray-200`,children:`⌘K`})]}),(0,X.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[`v`,`3.6.53`]}),(0,X.jsxs)(`div`,{className:H(`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold`,a?.status===`ok`?`bg-green-50 text-green-700 border border-green-200`:`bg-red-50 text-red-700 border border-red-200`),children:[(0,X.jsx)(`div`,{className:H(`w-1.5 h-1.5 rounded-full`,a?.status===`ok`?`bg-green-500`:`bg-red-500`)}),a?.status===`ok`?`在线`:`离线`]})]})]}),(0,X.jsx)(`div`,{className:`p-8 overflow-x-hidden`,children:e})]})]})}var ne=e=>[{id:`nav-dashboard`,label:`仪表盘`,description:`查看效率指标和趋势`,icon:C,action:()=>e(`/dashboard`),category:`导航`},{id:`nav-sessions`,label:`会话管理`,description:`查看和管理会话`,icon:y,action:()=>e(`/sessions`),category:`导航`},{id:`nav-events`,label:`事件流`,description:`查看实时事件`,icon:h,action:()=>e(`/events`),category:`导航`},{id:`nav-pipelines`,label:`流水线`,description:`查看编排流水线`,icon:i,action:()=>e(`/pipelines`),category:`导航`},{id:`nav-quality`,label:`质量门禁`,description:`查看质量问题`,icon:c,action:()=>e(`/quality`),category:`导航`},{id:`nav-knowledge`,label:`知识图谱`,description:`浏览知识节点`,icon:f,action:()=>e(`/knowledge`),category:`导航`},{id:`nav-analytics`,label:`数据分析`,description:`查看统计报表`,icon:x,action:()=>e(`/analytics`),category:`导航`},{id:`nav-config`,label:`系统配置`,description:`管理配置项`,icon:n,action:()=>e(`/config`),category:`导航`}];function re(){let[e,t]=(0,Y.useState)(!1),[n,r]=(0,Y.useState)(``),[i,s]=(0,Y.useState)(0),c=(0,Y.useRef)(null),u=T(),p=K(n,300),m=p.trim().length>=2,{data:h,isFetching:g}=I({queryKey:[`cmd-pipelines`,p],queryFn:()=>B({search:p,page_size:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:_,isFetching:v}=I({queryKey:[`cmd-sessions`,p],queryFn:()=>V({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:b,isFetching:x}=I({queryKey:[`cmd-knowledge`,p],queryFn:()=>R(p,void 0,void 0,5).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:S,isFetching:C}=I({queryKey:[`cmd-skills`,p],queryFn:()=>L({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),w=g||v||x||C,E=[];if(m){let e=p.toLowerCase();(h?.items||[]).forEach(t=>{let n=String(t.requirement||``);(n.toLowerCase().includes(e)||!e)&&E.push({id:`pipeline-${t.id}`,label:n.slice(0,60)||String(t.id),description:`流水线 · ${t.project||``}`,icon:a,action:()=>u(`/pipelines/${t.id}`),category:`流水线`})}),(_?.items||[]).filter(t=>String(t.title||t.id||``).toLowerCase().includes(e)).forEach(e=>{E.push({id:`session-${e.id}`,label:String(e.title||e.id||``).slice(0,60),description:`会话 · ${String(e.project_path||``).split(`/`).pop()||``}`,icon:y,action:()=>u(`/sessions/${e.id}`),category:`会话`})}),(b?.items||[]).forEach(e=>{E.push({id:`knowledge-${e.id}`,label:String(e.title||``).slice(0,60),description:`知识节点 · ${e.node_type||``}`,icon:f,action:()=>u(`/knowledge`),category:`知识图谱`})}),(S?.items||[]).filter(t=>String(t.name||``).toLowerCase().includes(e)).forEach(e=>{E.push({id:`skill-${e.name}`,label:String(e.name||``).slice(0,60),description:`技能 · ${e.description?String(e.description).slice(0,40):``}`,icon:o,action:()=>u(`/skills`),category:`技能`})})}let D=ne(u),O=n?D.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||(e.description||``).toLowerCase().includes(n.toLowerCase())):D,k=m?[...E,...O]:O;(0,Y.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),t(e=>!e),r(``),s(0)),e.key===`Escape`&&t(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,Y.useEffect)(()=>{e&&setTimeout(()=>c.current?.focus(),100)},[e]),(0,Y.useEffect)(()=>{s(0)},[p]);let A=e=>{e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.min(e+1,k.length-1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`&&k[i]&&(k[i].action(),t(!1))},j=Array.from(new Set(k.map(e=>e.category)));return(0,X.jsx)(W,{children:e&&(0,X.jsx)(G.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-[200] bg-black/50 backdrop-blur-sm flex items-start justify-center pt-[20vh]`,onClick:()=>t(!1),children:(0,X.jsxs)(G.div,{initial:{scale:.95,opacity:0,y:-20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:-20},transition:{duration:.15},className:`bg-white rounded-xl shadow-2xl w-full max-w-lg overflow-hidden border border-gray-200`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-gray-100`,children:[w?(0,X.jsx)(d,{className:`h-5 w-5 text-blue-400 flex-shrink-0 animate-spin`}):(0,X.jsx)(ee,{className:`h-5 w-5 text-gray-400 flex-shrink-0`}),(0,X.jsx)(`input`,{ref:c,type:`text`,placeholder:`输入命令或搜索(≥2字符跨模块搜索)...`,value:n,onChange:e=>{r(e.target.value),s(0)},onKeyDown:A,className:`flex-1 text-sm outline-none placeholder:text-gray-400`}),(0,X.jsx)(`kbd`,{className:`hidden sm:inline-flex items-center gap-1 px-2 py-0.5 text-xs text-gray-400 bg-gray-100 rounded`,children:`ESC`})]}),(0,X.jsx)(`div`,{className:`max-h-80 overflow-y-auto py-2`,children:k.length===0&&!w?(0,X.jsx)(`div`,{className:`px-4 py-8 text-center text-sm text-gray-400`,children:m?`没有找到相关内容`:`没有匹配的命令`}):j.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`px-4 py-1.5 text-xs font-semibold text-gray-400 uppercase tracking-wider`,children:e}),k.filter(t=>t.category===e).map(e=>{let n=k.indexOf(e);return(0,X.jsxs)(`button`,{className:H(`w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors`,n===i?`bg-blue-50 text-blue-700`:`text-gray-700 hover:bg-gray-50`),onClick:()=>{e.action(),t(!1)},onMouseEnter:()=>s(n),children:[(0,X.jsx)(e.icon,{className:`h-4 w-4 flex-shrink-0`}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e.label}),e.description&&(0,X.jsx)(`div`,{className:`text-xs text-gray-400 truncate`,children:e.description})]})]},e.id)})]},e))}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-t border-gray-100 text-xs text-gray-400`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↑↓`}),`导航`]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↵`}),`执行`]})]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(l,{className:`h-3 w-3`}),`K 打开`]})]})]})})})}var $=class extends Y.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught:`,e,t)}render(){return this.state.hasError?(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50 px-4`,children:(0,X.jsxs)(`div`,{className:`max-w-md w-full bg-white rounded-xl shadow-lg p-8 text-center`,children:[(0,X.jsx)(r,{className:`h-16 w-16 text-red-500 mx-auto mb-4`}),(0,X.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900 mb-2`,children:`出错了`}),(0,X.jsx)(`p`,{className:`text-gray-600 mb-6`,children:`页面加载时遇到错误,请刷新页面重试`}),this.state.error&&(0,X.jsxs)(`details`,{className:`text-left mb-6 p-4 bg-gray-50 rounded-lg`,children:[(0,X.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-gray-700 mb-2`,children:`错误详情`}),(0,X.jsx)(`pre`,{className:`text-xs text-red-600 overflow-auto`,children:this.state.error.toString()})]}),(0,X.jsx)(U,{variant:`primary`,icon:b,onClick:()=>window.location.reload(),children:`刷新页面`})]})}):this.props.children}},ie=3e3;function ae(){let e=window.__AUTH_TOKEN__;return e?`/api/events/stream?token=${encodeURIComponent(e)}`:`/api/events/stream`}function oe(){let e=N(),t=(0,Y.useRef)(null),n=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let r=!1;function i(){if(r)return;let a=new EventSource(ae());t.current=a;let o=t=>{for(let n of t)e.invalidateQueries({queryKey:n})};a.addEventListener(`pipeline:status`,()=>{o([[`pipelines-active`],[`pipelines`,`active`],[`pipelines`],[`overview`],[`plan`,`by-project`]])}),a.addEventListener(`pipeline:node`,()=>{o([[`pipelines-active`],[`pipelines`,`active`],[`pipelines`],[`pipeline`]])}),a.addEventListener(`quality:issue`,()=>{o([[`quality-history`],[`quality-unresolved`],[`overview`]])}),a.addEventListener(`session:event`,()=>{o([[`events-live`],[`sessions`],[`overview`]])}),a.addEventListener(`session:status`,()=>{o([[`sessions`],[`overview`]])}),a.addEventListener(`daemon:status`,()=>{o([[`daemon-status`],[`health`]])}),a.onerror=()=>{a.close(),t.current=null,r||(n.current=setTimeout(i,ie))}}return i(),()=>{r=!0,n.current&&clearTimeout(n.current),t.current?.close(),t.current=null}},[e])}var se=(0,Y.lazy)(()=>M(()=>import(`./Dashboard-Dskgf0jG.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ce=(0,Y.lazy)(()=>M(()=>import(`./Sessions-C0BmdDPK.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,9,13,10,11,8,14,15,16]))),le=(0,Y.lazy)(()=>M(()=>import(`./SessionDetail-BMrqH8_W.js`),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,18,11]))),ue=(0,Y.lazy)(()=>M(()=>import(`./Events-CAY9kU9T.js`),__vite__mapDeps([19,1,3,5,6,4,7,8,9,10,11,14,20,16]))),de=(0,Y.lazy)(()=>M(()=>import(`./Pipelines-Drat9IqZ.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,13,10,11,14,22,15,20,16]))),fe=(0,Y.lazy)(()=>M(()=>import(`./PipelineDetail-DGoURh1I.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,18,10,11,24]))),pe=(0,Y.lazy)(()=>M(()=>import(`./Quality-Bm7oRSun.js`),__vite__mapDeps([25,1,3,5,6,4,7,8,9,10,11,14,22,24,20,16]))),me=(0,Y.lazy)(()=>M(()=>import(`./Config-1QvdGyY8.js`),__vite__mapDeps([26,1,3,5,6,4,7,8,9,10,11,24]))),he=(0,Y.lazy)(()=>M(()=>import(`./Analytics-txva5ugO.js`),__vite__mapDeps([27,1,3,5,6,4,7,9,14,11,8,16]))),ge=(0,Y.lazy)(()=>M(()=>import(`./Knowledge-BHLyFp2U.js`),__vite__mapDeps([28,1,3,5,6,4,7,8,9,10,11,22,24,16]))),_e=(0,Y.lazy)(()=>M(()=>import(`./Projects-qDolX6Y6.js`),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,22,11,24,16]))),ve=(0,Y.lazy)(()=>M(()=>import(`./ProjectDetail-Cx8VZp8O.js`),__vite__mapDeps([30,1,2,3,4,5,6,7,9,18,22,11,8,24]))),ye=(0,Y.lazy)(()=>M(()=>import(`./Skills-B3c1_uFt.js`),__vite__mapDeps([31,1,3,5,6,4,7,9,10,11,8,24]))),be=(0,Y.lazy)(()=>M(()=>import(`./Conventions-E_2yAYoB.js`),__vite__mapDeps([32,1,33,3,5,6,4,7,9,10,11,8,24]))),xe=(0,Y.lazy)(()=>M(()=>import(`./NodeTypes-B6wc7VnR.js`),__vite__mapDeps([34,1,3,5,6,4,7,9]))),Se=(0,Y.lazy)(()=>M(()=>import(`./PipelineTemplates-sSL-9oRh.js`),__vite__mapDeps([35,1,3,5,6,4,7,9,24]))),Ce=(0,Y.lazy)(()=>M(()=>import(`./Templates-Dho__f4l.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,14,11,15]))),we=(0,Y.lazy)(()=>M(()=>import(`./TemplateDetail-ep5h3Cu5.js`),__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,10,11,14,15]))),Te=(0,Y.lazy)(()=>M(()=>import(`./Evolution-Ck_BqRpt.js`),__vite__mapDeps([38,2,1,3,4,5,6,7,8,9,15,11])));function Ee(){return oe(),(0,X.jsx)($,{children:(0,X.jsxs)(q,{children:[(0,X.jsx)(re,{}),(0,X.jsx)(Q,{children:(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400`,children:`加载中...`}),children:(0,X.jsxs)(O,{children:[(0,X.jsx)(w,{path:`/`,element:(0,X.jsx)(D,{to:`/dashboard`,replace:!0})}),(0,X.jsx)(w,{path:`/dashboard`,element:(0,X.jsx)(se,{})}),(0,X.jsx)(w,{path:`/sessions`,element:(0,X.jsx)(ce,{})}),(0,X.jsx)(w,{path:`/sessions/:id`,element:(0,X.jsx)(le,{})}),(0,X.jsx)(w,{path:`/events`,element:(0,X.jsx)(ue,{})}),(0,X.jsx)(w,{path:`/pipelines`,element:(0,X.jsx)(de,{})}),(0,X.jsx)(w,{path:`/pipelines/:id`,element:(0,X.jsx)(fe,{})}),(0,X.jsx)(w,{path:`/projects`,element:(0,X.jsx)(_e,{})}),(0,X.jsx)(w,{path:`/projects/:encodedPath`,element:(0,X.jsx)(ve,{})}),(0,X.jsx)(w,{path:`/quality`,element:(0,X.jsx)(pe,{})}),(0,X.jsx)(w,{path:`/analytics`,element:(0,X.jsx)(he,{})}),(0,X.jsx)(w,{path:`/knowledge`,element:(0,X.jsx)(ge,{})}),(0,X.jsx)(w,{path:`/skills`,element:(0,X.jsx)(ye,{})}),(0,X.jsx)(w,{path:`/conventions`,element:(0,X.jsx)(be,{})}),(0,X.jsx)(w,{path:`/node-types`,element:(0,X.jsx)(xe,{})}),(0,X.jsx)(w,{path:`/pipeline-templates`,element:(0,X.jsx)(Se,{})}),(0,X.jsx)(w,{path:`/templates`,element:(0,X.jsx)(Ce,{})}),(0,X.jsx)(w,{path:`/templates/:id`,element:(0,X.jsx)(we,{})}),(0,X.jsx)(w,{path:`/evolution`,element:(0,X.jsx)(Te,{})}),(0,X.jsx)(w,{path:`/config`,element:(0,X.jsx)(me,{})})]})})})]})})}var De=new F({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});J.createRoot(document.getElementById(`root`)).render((0,X.jsx)(Y.StrictMode,{children:(0,X.jsx)(P,{client:De,children:(0,X.jsx)(j,{children:(0,X.jsx)(Ee,{})})})}));
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-Dskgf0jG.js","assets/rolldown-runtime-COnpUsM8.js","assets/vendor-react-DJI9oneq.js","assets/vendor-DRGPi8ui.js","assets/vendor-charts-9eVsQvUV.js","assets/vendor-query-DqPOMnuX.js","assets/vendor-flow-srkes8If.js","assets/vendor-flow-CHpVij2M.css","assets/vendor-motion-CQmdgnI8.js","assets/client-BvVpIixG.js","assets/ConfirmDialog-BKfwMp04.js","assets/ui-CDL3BZ13.js","assets/Sessions-C0BmdDPK.js","assets/BatchProgress-BQ533tSf.js","assets/ErrorState-BOInXmfg.js","assets/Skeleton-B7PVDJJ_.js","assets/exportCsv-Dm5Y5M_E.js","assets/SessionDetail-BMrqH8_W.js","assets/Breadcrumb-DtfwnOx6.js","assets/Events-CAY9kU9T.js","assets/useDebounce-DNfPs3Tv.js","assets/Pipelines-Drat9IqZ.js","assets/Pagination-lp8b_3NR.js","assets/PipelineDetail-Dgya5Xr_.js","assets/Toast-BbB3oD2a.js","assets/Quality-Bm7oRSun.js","assets/Config-1QvdGyY8.js","assets/Analytics-txva5ugO.js","assets/Knowledge-BHLyFp2U.js","assets/Projects-qDolX6Y6.js","assets/ProjectDetail-Cx8VZp8O.js","assets/Skills-B3c1_uFt.js","assets/Conventions-E_2yAYoB.js","assets/vendor-editor-CYLOGES5.js","assets/NodeTypes-B6wc7VnR.js","assets/PipelineTemplates-sSL-9oRh.js","assets/Templates-Dho__f4l.js","assets/TemplateDetail-ep5h3Cu5.js","assets/Evolution-Ck_BqRpt.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$n as t,$t as n,Bt as r,Dn as i,En as a,Ft as o,Mn as s,Qt as c,Un as l,Vt as u,_n as d,ar as f,cr as p,en as ee,gr as m,ir as h,kn as g,mn as _,or as v,pr as y,rn as b,rr as x,un as S,xn as C}from"./vendor-DRGPi8ui.js";import{a as w,c as T,d as E,i as D,o as O,r as k,s as A,t as j,u as M}from"./vendor-react-DJI9oneq.js";import{a as N,i as P,o as F,r as I}from"./vendor-query-DqPOMnuX.js";import{c as te}from"./vendor-flow-srkes8If.js";import{Dt as L,Yt as R,et as z,ht as B,wt as V}from"./client-BvVpIixG.js";import{a as H,n as U}from"./ui-CDL3BZ13.js";import{n as W,t as G}from"./vendor-motion-CQmdgnI8.js";import{t as K}from"./useDebounce-DNfPs3Tv.js";import{t as q}from"./Toast-BbB3oD2a.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var J=e(E(),1),Y=e(m(),1),X=te(),Z=[{path:`/dashboard`,label:`仪表盘`,icon:C},{path:`/projects`,label:`项目管理`,icon:g},{path:`/sessions`,label:`会话管理`,icon:y},{path:`/events`,label:`事件流`,icon:h},{path:`/pipelines`,label:`流水线`,icon:i},{path:`/quality`,label:`质量门禁`,icon:c},{path:`/knowledge`,label:`知识图谱`,icon:f},{path:`/skills`,label:`技能管理`,icon:S},{path:`/conventions`,label:`规范管理`,icon:p},{path:`/node-types`,label:`节点类型`,icon:v},{path:`/pipeline-templates`,label:`模板管理`,icon:s},{path:`/templates`,label:`执行模板`,icon:i},{path:`/evolution`,label:`模板进化`,icon:u},{path:`/analytics`,label:`数据分析`,icon:x},{path:`/config`,label:`系统配置`,icon:n}];function Q({children:e}){let[n,r]=(0,Y.useState)(()=>localStorage.getItem(`sidebar-collapsed`)===`true`),i=A();(0,Y.useEffect)(()=>{localStorage.setItem(`sidebar-collapsed`,String(n))},[n]);let{data:a}=I({queryKey:[`health`],queryFn:()=>z().then(e=>e.data)}),s=Z.find(e=>i.pathname.startsWith(e.path));return(0,X.jsxs)(`div`,{className:`flex min-h-screen bg-gray-50`,children:[(0,X.jsxs)(`aside`,{className:H(`fixed top-0 left-0 bottom-0 z-50 flex flex-col transition-all duration-300`,`bg-gradient-to-b from-slate-900 to-slate-800`,n?`w-16`:`w-60`),children:[(0,X.jsxs)(`div`,{className:H(`flex items-center border-b border-white/10 h-16`,n?`justify-center px-2`:`justify-between px-5`),children:[!n&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-gradient-to-br from-blue-500 to-purple-600`,children:(0,X.jsx)(o,{className:`h-5 w-5 text-white`})}),(0,X.jsx)(`span`,{className:`text-white font-bold text-lg tracking-tight`,children:`Forge`})]}),(0,X.jsx)(`button`,{onClick:()=>r(!n),className:`p-1.5 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-colors`,children:n?(0,X.jsx)(_,{className:`h-5 w-5`}):(0,X.jsx)(t,{className:`h-5 w-5`})})]}),(0,X.jsx)(`nav`,{className:`flex-1 py-4 space-y-1 px-2`,children:Z.map(e=>(0,X.jsxs)(k,{to:e.path,className:({isActive:e})=>H(`flex items-center gap-3 rounded-lg transition-all duration-200`,n?`justify-center p-3`:`px-3 py-2.5`,e?`bg-blue-600/20 text-blue-400`:`text-white/60 hover:text-white hover:bg-white/5`),children:[(0,X.jsx)(e.icon,{className:`h-5 w-5 flex-shrink-0`}),!n&&(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]},e.path))}),(0,X.jsx)(`div`,{className:H(`border-t border-white/10 py-4`,n?`px-2`:`px-5`),children:(0,X.jsxs)(`div`,{className:H(`flex items-center gap-2`,n?`justify-center`:``),children:[(0,X.jsx)(`div`,{className:H(`w-2 h-2 rounded-full`,a?.status===`ok`?`bg-green-400 animate-pulse`:`bg-red-400`)}),!n&&(0,X.jsx)(`span`,{className:`text-xs text-white/40`,children:a?.status===`ok`?`Daemon 运行中`:`连接断开`})]})})]}),(0,X.jsxs)(`main`,{className:H(`flex-1 transition-all duration-300`,n?`ml-16`:`ml-60`),children:[(0,X.jsxs)(`header`,{className:`sticky top-0 z-40 bg-white/80 backdrop-blur-md border-b border-gray-200/50 h-16 flex items-center justify-between px-8`,children:[(0,X.jsx)(`h1`,{className:`text-xl font-semibold text-gray-900`,children:s?.label||`Claude Forge`}),(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,X.jsxs)(`button`,{className:`hidden sm:flex items-center gap-2 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors`,onClick:()=>{let e=new KeyboardEvent(`keydown`,{key:`k`,metaKey:!0});window.dispatchEvent(e)},children:[(0,X.jsx)(l,{className:`h-4 w-4`}),(0,X.jsx)(`span`,{children:`命令面板`}),(0,X.jsx)(`kbd`,{className:`px-2 py-0.5 text-xs bg-gray-100 rounded border border-gray-200`,children:`⌘K`})]}),(0,X.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[`v`,`3.6.57`]}),(0,X.jsxs)(`div`,{className:H(`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold`,a?.status===`ok`?`bg-green-50 text-green-700 border border-green-200`:`bg-red-50 text-red-700 border border-red-200`),children:[(0,X.jsx)(`div`,{className:H(`w-1.5 h-1.5 rounded-full`,a?.status===`ok`?`bg-green-500`:`bg-red-500`)}),a?.status===`ok`?`在线`:`离线`]})]})]}),(0,X.jsx)(`div`,{className:`p-8 overflow-x-hidden`,children:e})]})]})}var ne=e=>[{id:`nav-dashboard`,label:`仪表盘`,description:`查看效率指标和趋势`,icon:C,action:()=>e(`/dashboard`),category:`导航`},{id:`nav-sessions`,label:`会话管理`,description:`查看和管理会话`,icon:y,action:()=>e(`/sessions`),category:`导航`},{id:`nav-events`,label:`事件流`,description:`查看实时事件`,icon:h,action:()=>e(`/events`),category:`导航`},{id:`nav-pipelines`,label:`流水线`,description:`查看编排流水线`,icon:i,action:()=>e(`/pipelines`),category:`导航`},{id:`nav-quality`,label:`质量门禁`,description:`查看质量问题`,icon:c,action:()=>e(`/quality`),category:`导航`},{id:`nav-knowledge`,label:`知识图谱`,description:`浏览知识节点`,icon:f,action:()=>e(`/knowledge`),category:`导航`},{id:`nav-analytics`,label:`数据分析`,description:`查看统计报表`,icon:x,action:()=>e(`/analytics`),category:`导航`},{id:`nav-config`,label:`系统配置`,description:`管理配置项`,icon:n,action:()=>e(`/config`),category:`导航`}];function re(){let[e,t]=(0,Y.useState)(!1),[n,r]=(0,Y.useState)(``),[i,s]=(0,Y.useState)(0),c=(0,Y.useRef)(null),u=T(),p=K(n,300),m=p.trim().length>=2,{data:h,isFetching:g}=I({queryKey:[`cmd-pipelines`,p],queryFn:()=>B({search:p,page_size:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:_,isFetching:v}=I({queryKey:[`cmd-sessions`,p],queryFn:()=>V({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:b,isFetching:x}=I({queryKey:[`cmd-knowledge`,p],queryFn:()=>R(p,void 0,void 0,5).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:S,isFetching:C}=I({queryKey:[`cmd-skills`,p],queryFn:()=>L({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),w=g||v||x||C,E=[];if(m){let e=p.toLowerCase();(h?.items||[]).forEach(t=>{let n=String(t.requirement||``);(n.toLowerCase().includes(e)||!e)&&E.push({id:`pipeline-${t.id}`,label:n.slice(0,60)||String(t.id),description:`流水线 · ${t.project||``}`,icon:a,action:()=>u(`/pipelines/${t.id}`),category:`流水线`})}),(_?.items||[]).filter(t=>String(t.title||t.id||``).toLowerCase().includes(e)).forEach(e=>{E.push({id:`session-${e.id}`,label:String(e.title||e.id||``).slice(0,60),description:`会话 · ${String(e.project_path||``).split(`/`).pop()||``}`,icon:y,action:()=>u(`/sessions/${e.id}`),category:`会话`})}),(b?.items||[]).forEach(e=>{E.push({id:`knowledge-${e.id}`,label:String(e.title||``).slice(0,60),description:`知识节点 · ${e.node_type||``}`,icon:f,action:()=>u(`/knowledge`),category:`知识图谱`})}),(S?.items||[]).filter(t=>String(t.name||``).toLowerCase().includes(e)).forEach(e=>{E.push({id:`skill-${e.name}`,label:String(e.name||``).slice(0,60),description:`技能 · ${e.description?String(e.description).slice(0,40):``}`,icon:o,action:()=>u(`/skills`),category:`技能`})})}let D=ne(u),O=n?D.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||(e.description||``).toLowerCase().includes(n.toLowerCase())):D,k=m?[...E,...O]:O;(0,Y.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),t(e=>!e),r(``),s(0)),e.key===`Escape`&&t(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,Y.useEffect)(()=>{e&&setTimeout(()=>c.current?.focus(),100)},[e]),(0,Y.useEffect)(()=>{s(0)},[p]);let A=e=>{e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.min(e+1,k.length-1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`&&k[i]&&(k[i].action(),t(!1))},j=Array.from(new Set(k.map(e=>e.category)));return(0,X.jsx)(W,{children:e&&(0,X.jsx)(G.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-[200] bg-black/50 backdrop-blur-sm flex items-start justify-center pt-[20vh]`,onClick:()=>t(!1),children:(0,X.jsxs)(G.div,{initial:{scale:.95,opacity:0,y:-20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:-20},transition:{duration:.15},className:`bg-white rounded-xl shadow-2xl w-full max-w-lg overflow-hidden border border-gray-200`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-gray-100`,children:[w?(0,X.jsx)(d,{className:`h-5 w-5 text-blue-400 flex-shrink-0 animate-spin`}):(0,X.jsx)(ee,{className:`h-5 w-5 text-gray-400 flex-shrink-0`}),(0,X.jsx)(`input`,{ref:c,type:`text`,placeholder:`输入命令或搜索(≥2字符跨模块搜索)...`,value:n,onChange:e=>{r(e.target.value),s(0)},onKeyDown:A,className:`flex-1 text-sm outline-none placeholder:text-gray-400`}),(0,X.jsx)(`kbd`,{className:`hidden sm:inline-flex items-center gap-1 px-2 py-0.5 text-xs text-gray-400 bg-gray-100 rounded`,children:`ESC`})]}),(0,X.jsx)(`div`,{className:`max-h-80 overflow-y-auto py-2`,children:k.length===0&&!w?(0,X.jsx)(`div`,{className:`px-4 py-8 text-center text-sm text-gray-400`,children:m?`没有找到相关内容`:`没有匹配的命令`}):j.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`px-4 py-1.5 text-xs font-semibold text-gray-400 uppercase tracking-wider`,children:e}),k.filter(t=>t.category===e).map(e=>{let n=k.indexOf(e);return(0,X.jsxs)(`button`,{className:H(`w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors`,n===i?`bg-blue-50 text-blue-700`:`text-gray-700 hover:bg-gray-50`),onClick:()=>{e.action(),t(!1)},onMouseEnter:()=>s(n),children:[(0,X.jsx)(e.icon,{className:`h-4 w-4 flex-shrink-0`}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e.label}),e.description&&(0,X.jsx)(`div`,{className:`text-xs text-gray-400 truncate`,children:e.description})]})]},e.id)})]},e))}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-t border-gray-100 text-xs text-gray-400`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↑↓`}),`导航`]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↵`}),`执行`]})]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(l,{className:`h-3 w-3`}),`K 打开`]})]})]})})})}var $=class extends Y.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught:`,e,t)}render(){return this.state.hasError?(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50 px-4`,children:(0,X.jsxs)(`div`,{className:`max-w-md w-full bg-white rounded-xl shadow-lg p-8 text-center`,children:[(0,X.jsx)(r,{className:`h-16 w-16 text-red-500 mx-auto mb-4`}),(0,X.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900 mb-2`,children:`出错了`}),(0,X.jsx)(`p`,{className:`text-gray-600 mb-6`,children:`页面加载时遇到错误,请刷新页面重试`}),this.state.error&&(0,X.jsxs)(`details`,{className:`text-left mb-6 p-4 bg-gray-50 rounded-lg`,children:[(0,X.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-gray-700 mb-2`,children:`错误详情`}),(0,X.jsx)(`pre`,{className:`text-xs text-red-600 overflow-auto`,children:this.state.error.toString()})]}),(0,X.jsx)(U,{variant:`primary`,icon:b,onClick:()=>window.location.reload(),children:`刷新页面`})]})}):this.props.children}},ie=3e3;function ae(){let e=window.__AUTH_TOKEN__;return e?`/api/events/stream?token=${encodeURIComponent(e)}`:`/api/events/stream`}function oe(){let e=N(),t=(0,Y.useRef)(null),n=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let r=!1;function i(){if(r)return;let a=new EventSource(ae());t.current=a;let o=t=>{for(let n of t)e.invalidateQueries({queryKey:n})};a.addEventListener(`pipeline:status`,()=>{o([[`pipelines-active`],[`pipelines`,`active`],[`pipelines`],[`overview`],[`plan`,`by-project`]])}),a.addEventListener(`pipeline:node`,()=>{o([[`pipelines-active`],[`pipelines`,`active`],[`pipelines`],[`pipeline`]])}),a.addEventListener(`quality:issue`,()=>{o([[`quality-history`],[`quality-unresolved`],[`overview`]])}),a.addEventListener(`session:event`,()=>{o([[`events-live`],[`sessions`],[`overview`]])}),a.addEventListener(`session:status`,()=>{o([[`sessions`],[`overview`]])}),a.addEventListener(`daemon:status`,()=>{o([[`daemon-status`],[`health`]])}),a.onerror=()=>{a.close(),t.current=null,r||(n.current=setTimeout(i,ie))}}return i(),()=>{r=!0,n.current&&clearTimeout(n.current),t.current?.close(),t.current=null}},[e])}var se=(0,Y.lazy)(()=>M(()=>import(`./Dashboard-Dskgf0jG.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ce=(0,Y.lazy)(()=>M(()=>import(`./Sessions-C0BmdDPK.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,9,13,10,11,8,14,15,16]))),le=(0,Y.lazy)(()=>M(()=>import(`./SessionDetail-BMrqH8_W.js`),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,18,11]))),ue=(0,Y.lazy)(()=>M(()=>import(`./Events-CAY9kU9T.js`),__vite__mapDeps([19,1,3,5,6,4,7,8,9,10,11,14,20,16]))),de=(0,Y.lazy)(()=>M(()=>import(`./Pipelines-Drat9IqZ.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,13,10,11,14,22,15,20,16]))),fe=(0,Y.lazy)(()=>M(()=>import(`./PipelineDetail-Dgya5Xr_.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,18,10,11,24]))),pe=(0,Y.lazy)(()=>M(()=>import(`./Quality-Bm7oRSun.js`),__vite__mapDeps([25,1,3,5,6,4,7,8,9,10,11,14,22,24,20,16]))),me=(0,Y.lazy)(()=>M(()=>import(`./Config-1QvdGyY8.js`),__vite__mapDeps([26,1,3,5,6,4,7,8,9,10,11,24]))),he=(0,Y.lazy)(()=>M(()=>import(`./Analytics-txva5ugO.js`),__vite__mapDeps([27,1,3,5,6,4,7,9,14,11,8,16]))),ge=(0,Y.lazy)(()=>M(()=>import(`./Knowledge-BHLyFp2U.js`),__vite__mapDeps([28,1,3,5,6,4,7,8,9,10,11,22,24,16]))),_e=(0,Y.lazy)(()=>M(()=>import(`./Projects-qDolX6Y6.js`),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,22,11,24,16]))),ve=(0,Y.lazy)(()=>M(()=>import(`./ProjectDetail-Cx8VZp8O.js`),__vite__mapDeps([30,1,2,3,4,5,6,7,9,18,22,11,8,24]))),ye=(0,Y.lazy)(()=>M(()=>import(`./Skills-B3c1_uFt.js`),__vite__mapDeps([31,1,3,5,6,4,7,9,10,11,8,24]))),be=(0,Y.lazy)(()=>M(()=>import(`./Conventions-E_2yAYoB.js`),__vite__mapDeps([32,1,33,3,5,6,4,7,9,10,11,8,24]))),xe=(0,Y.lazy)(()=>M(()=>import(`./NodeTypes-B6wc7VnR.js`),__vite__mapDeps([34,1,3,5,6,4,7,9]))),Se=(0,Y.lazy)(()=>M(()=>import(`./PipelineTemplates-sSL-9oRh.js`),__vite__mapDeps([35,1,3,5,6,4,7,9,24]))),Ce=(0,Y.lazy)(()=>M(()=>import(`./Templates-Dho__f4l.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,14,11,15]))),we=(0,Y.lazy)(()=>M(()=>import(`./TemplateDetail-ep5h3Cu5.js`),__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,10,11,14,15]))),Te=(0,Y.lazy)(()=>M(()=>import(`./Evolution-Ck_BqRpt.js`),__vite__mapDeps([38,2,1,3,4,5,6,7,8,9,15,11])));function Ee(){return oe(),(0,X.jsx)($,{children:(0,X.jsxs)(q,{children:[(0,X.jsx)(re,{}),(0,X.jsx)(Q,{children:(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400`,children:`加载中...`}),children:(0,X.jsxs)(O,{children:[(0,X.jsx)(w,{path:`/`,element:(0,X.jsx)(D,{to:`/dashboard`,replace:!0})}),(0,X.jsx)(w,{path:`/dashboard`,element:(0,X.jsx)(se,{})}),(0,X.jsx)(w,{path:`/sessions`,element:(0,X.jsx)(ce,{})}),(0,X.jsx)(w,{path:`/sessions/:id`,element:(0,X.jsx)(le,{})}),(0,X.jsx)(w,{path:`/events`,element:(0,X.jsx)(ue,{})}),(0,X.jsx)(w,{path:`/pipelines`,element:(0,X.jsx)(de,{})}),(0,X.jsx)(w,{path:`/pipelines/:id`,element:(0,X.jsx)(fe,{})}),(0,X.jsx)(w,{path:`/projects`,element:(0,X.jsx)(_e,{})}),(0,X.jsx)(w,{path:`/projects/:encodedPath`,element:(0,X.jsx)(ve,{})}),(0,X.jsx)(w,{path:`/quality`,element:(0,X.jsx)(pe,{})}),(0,X.jsx)(w,{path:`/analytics`,element:(0,X.jsx)(he,{})}),(0,X.jsx)(w,{path:`/knowledge`,element:(0,X.jsx)(ge,{})}),(0,X.jsx)(w,{path:`/skills`,element:(0,X.jsx)(ye,{})}),(0,X.jsx)(w,{path:`/conventions`,element:(0,X.jsx)(be,{})}),(0,X.jsx)(w,{path:`/node-types`,element:(0,X.jsx)(xe,{})}),(0,X.jsx)(w,{path:`/pipeline-templates`,element:(0,X.jsx)(Se,{})}),(0,X.jsx)(w,{path:`/templates`,element:(0,X.jsx)(Ce,{})}),(0,X.jsx)(w,{path:`/templates/:id`,element:(0,X.jsx)(we,{})}),(0,X.jsx)(w,{path:`/evolution`,element:(0,X.jsx)(Te,{})}),(0,X.jsx)(w,{path:`/config`,element:(0,X.jsx)(me,{})})]})})})]})})}var De=new F({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});J.createRoot(document.getElementById(`root`)).render((0,X.jsx)(Y.StrictMode,{children:(0,X.jsx)(P,{client:De,children:(0,X.jsx)(j,{children:(0,X.jsx)(Ee,{})})})}));
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Claude Forge - 管理后台</title>
7
- <script type="module" crossorigin src="/assets/index-DCciPmWV.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-jF7qJ2X8.js"></script>
8
8
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-COnpUsM8.js">
9
9
  <link rel="modulepreload" crossorigin href="/assets/vendor-DRGPi8ui.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/vendor-charts-9eVsQvUV.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winspan/claude-forge",
3
- "version": "3.6.53",
3
+ "version": "3.6.57",
4
4
  "description": "SDLC intelligent orchestration engine for Claude Code",
5
5
  "main": "dist/cli/index.js",
6
6
  "type": "module",