@winspan/claude-forge 3.6.47 → 3.6.51

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 (44) hide show
  1. package/dist/prompts/pipeline-decompose.md +2 -2
  2. package/dist/web-static/assets/{Analytics-Bo74j97W.js → Analytics-txva5ugO.js} +1 -1
  3. package/dist/web-static/assets/Config-1QvdGyY8.js +1 -0
  4. package/dist/web-static/assets/Conventions-E_2yAYoB.js +1 -0
  5. package/dist/web-static/assets/Dashboard-Dskgf0jG.js +1 -0
  6. package/dist/web-static/assets/{Events-C0y7WcDP.js → Events-CAY9kU9T.js} +1 -1
  7. package/dist/web-static/assets/{Evolution-DimZAXFS.js → Evolution-Ck_BqRpt.js} +1 -1
  8. package/dist/web-static/assets/Knowledge-BHLyFp2U.js +2 -0
  9. package/dist/web-static/assets/{NodeTypes-DyrDqhBp.js → NodeTypes-B6wc7VnR.js} +1 -1
  10. package/dist/web-static/assets/PipelineDetail-DGoURh1I.js +4 -0
  11. package/dist/web-static/assets/PipelineTemplates-sSL-9oRh.js +1 -0
  12. package/dist/web-static/assets/Pipelines-Drat9IqZ.js +2 -0
  13. package/dist/web-static/assets/ProjectDetail-Cx8VZp8O.js +1 -0
  14. package/dist/web-static/assets/Projects-qDolX6Y6.js +1 -0
  15. package/dist/web-static/assets/Quality-Bm7oRSun.js +3 -0
  16. package/dist/web-static/assets/{SessionDetail-BNDIfmmq.js → SessionDetail-BMrqH8_W.js} +1 -1
  17. package/dist/web-static/assets/Sessions-C0BmdDPK.js +2 -0
  18. package/dist/web-static/assets/Skills-B3c1_uFt.js +1 -0
  19. package/dist/web-static/assets/{TemplateDetail-DOfBYdQ3.js → TemplateDetail-ep5h3Cu5.js} +1 -1
  20. package/dist/web-static/assets/{Templates-Cp3yC5tv.js → Templates-Dho__f4l.js} +1 -1
  21. package/dist/web-static/assets/Toast-BbB3oD2a.js +1 -0
  22. package/dist/web-static/assets/client-BvVpIixG.js +1 -0
  23. package/dist/web-static/assets/index-BoxlVgIs.js +2 -0
  24. package/dist/web-static/index.html +3 -2
  25. package/package.json +1 -1
  26. package/dist/web-static/assets/Config-DhfQsbT1.js +0 -1
  27. package/dist/web-static/assets/Conventions-BobuQiOk.js +0 -1
  28. package/dist/web-static/assets/Dashboard-Bj28rnDe.js +0 -1
  29. package/dist/web-static/assets/Knowledge-Y1lX6vor.js +0 -2
  30. package/dist/web-static/assets/PipelineDetail-DGKz18zu.js +0 -4
  31. package/dist/web-static/assets/PipelineTemplates-D4zvL6I1.js +0 -1
  32. package/dist/web-static/assets/Pipelines-CR9oD3Xy.js +0 -2
  33. package/dist/web-static/assets/ProjectDetail-RfdtEvTT.js +0 -1
  34. package/dist/web-static/assets/Projects-RGIPdiJn.js +0 -1
  35. package/dist/web-static/assets/Quality-BdvL1VQn.js +0 -3
  36. package/dist/web-static/assets/Sessions-CorfQV78.js +0 -2
  37. package/dist/web-static/assets/Skills-BJt0OrKj.js +0 -1
  38. package/dist/web-static/assets/client-BhcjNvkG.js +0 -1
  39. package/dist/web-static/assets/index-D8kSmB5h.js +0 -2
  40. package/dist/web-static/assets/useSmartPolling-DYAVOihL.js +0 -1
  41. /package/dist/web-static/assets/{ConfirmDialog-CVzB7X5y.js → ConfirmDialog-BKfwMp04.js} +0 -0
  42. /package/dist/web-static/assets/{ErrorState-DXHA8lr8.js → ErrorState-BOInXmfg.js} +0 -0
  43. /package/dist/web-static/assets/{exportCsv-CSExJI8h.js → exportCsv-Dm5Y5M_E.js} +0 -0
  44. /package/dist/web-static/assets/{vendor-editor-B1NX2ipj.js → vendor-editor-CYLOGES5.js} +0 -0
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{It as t,Jn as n,Kt as r,Ln as i,Lt as a,Mn as o,On as s,Rn as c,Ut as l,Vt as u,Xt as d,_n as f,an as p,cn as m,en as h,er as g,gr as _,rn as v,tn as y,un as b}from"./vendor-DRGPi8ui.js";import{a as x,n as S,r as C}from"./vendor-query-DqPOMnuX.js";import{c as w}from"./vendor-flow-srkes8If.js";import{Dt as T,Et as ee,F as E,It as te,P as ne,T as D,Tt as O,Vt as k,Xt as A,cn as j,k as M,l as N,lt as P,r as F,sn as I,un as L}from"./client-BhcjNvkG.js";import{a as R}from"./ui-CDL3BZ13.js";import{t as z}from"./ConfirmDialog-CVzB7X5y.js";var B=e(_(),1),V=w(),H={local:`bg-blue-50 text-blue-700`,remote:`bg-purple-50 text-purple-700`,generated:`bg-green-50 text-green-700`,official:`bg-amber-50 text-amber-700`,user:`bg-pink-50 text-pink-700`},U={local:`本地`,remote:`远程`,generated:`AI生成`,official:`官方`,user:`用户`};function W(){let[e,t]=(0,B.useState)(`list`),[i,a]=(0,B.useState)(``),[o,c]=(0,B.useState)(``),[d,p]=(0,B.useState)(new Set),[m,h]=(0,B.useState)(``),[_,v]=(0,B.useState)(null),[y,w]=(0,B.useState)(!1),[D,O]=(0,B.useState)(null),[j,P]=(0,B.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),F=x(),{data:I,isLoading:W}=C({queryKey:[`skills`,i,o],queryFn:()=>T({source:i||void 0,tag:o||void 0}).then(e=>e.data),refetchInterval:3e4}),{data:G}=C({queryKey:[`skills-status`],queryFn:()=>ee().then(e=>e.data),refetchInterval:3e4}),K=S({mutationFn:e=>A(e).then(e=>e.data),onSuccess:e=>{v(e),L(`找到 ${e.github.length+e.npm.length} 个结果`,`success`)}}),q=S({mutationFn:e=>te(e).then(e=>e.data),onSuccess:e=>{L(`已安装: ${e.skill.name}`,`success`),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),J=S({mutationFn:e=>M(e).then(e=>e.data),onSuccess:(e,t)=>{L(`已删除: ${t}`,`success`),p(e=>{let n=new Set(e);return n.delete(t),n}),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),Y=S({mutationFn:e=>N(e).then(e=>e.data),onSuccess:e=>{L(`已删除 ${e.success.length} 个技能`,`success`),p(new Set),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),X=S({mutationFn:()=>E().then(e=>e.data),onSuccess:e=>{L(`进化完成:${e.repaired.length+e.retired.length+e.optimized.length+e.generated.length} 项变更`,`success`),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),Z=S({mutationFn:()=>ne().then(e=>e.data),onSuccess:e=>{L(`蒸馏完成:新增 ${e.distilled.length} 个技能`,`success`),F.invalidateQueries({queryKey:[`skills`]}),F.invalidateQueries({queryKey:[`skills-status`]})}}),Q=S({mutationFn:()=>k().then(e=>e.data),onSuccess:e=>{L(`修复完成:${e.repaired.length} 个技能已修复`,`success`),F.invalidateQueries({queryKey:[`skills`]})}}),$=I?.items||[],se=$.length>0&&d.size===$.length,ce=e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`技能管理`}),(0,V.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`管理 Claude Code 技能库,搜索安装、进化优化`})]}),G&&(0,V.jsx)(`div`,{className:`flex items-center gap-3`,children:[{label:`全部`,value:G.total,color:`text-gray-700`},{label:`官方`,value:G.official,color:`text-amber-600`},{label:`本地`,value:G.local,color:`text-blue-600`},{label:`AI生成`,value:G.generated,color:`text-green-600`}].map(({label:e,value:t,color:n})=>(0,V.jsxs)(`div`,{className:`text-center`,children:[(0,V.jsx)(`div`,{className:R(`text-xl font-bold`,n),children:t}),(0,V.jsx)(`div`,{className:`text-xs text-gray-500`,children:e})]},e))})]}),(0,V.jsx)(`div`,{className:`border-b border-gray-200`,children:(0,V.jsx)(`nav`,{className:`flex gap-1`,children:[{key:`list`,label:`技能列表`},{key:`search`,label:`搜索安装`},{key:`evolve`,label:`进化管理`},{key:`sources`,label:`技能源`}].map(n=>(0,V.jsx)(`button`,{onClick:()=>t(n.key),className:R(`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors`,e===n.key?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`),children:n.label},n.key))})}),e===`list`&&(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsxs)(`button`,{onClick:()=>w(!y),className:R(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,y?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,V.jsx)(s,{className:`h-4 w-4`}),`筛选`,(0,V.jsx)(g,{className:R(`h-3.5 w-3.5 transition-transform`,y&&`rotate-180`)})]}),(0,V.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[$.length,` 个技能`]}),d.size>0&&(0,V.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`已选 `,d.size,` 个`]}),(0,V.jsxs)(`button`,{onClick:()=>{P({open:!0,title:`批量删除技能`,description:`确定要删除选中的 ${d.size} 个技能吗?此操作不可恢复。`,count:d.size,onConfirm:()=>{Y.mutate(Array.from(d)),P(e=>({...e,open:!1}))}})},disabled:Y.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-50 text-red-600 hover:bg-red-100 rounded-lg transition-colors`,children:[(0,V.jsx)(l,{className:`h-3.5 w-3.5`}),`批量删除`]})]})]}),y&&(0,V.jsxs)(`div`,{className:`flex gap-3 mt-3 pt-3 border-t border-gray-100`,children:[(0,V.jsxs)(`select`,{value:i,onChange:e=>a(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,V.jsx)(`option`,{value:``,children:`全部来源`}),(0,V.jsx)(`option`,{value:`local`,children:`本地`}),(0,V.jsx)(`option`,{value:`official`,children:`官方`}),(0,V.jsx)(`option`,{value:`remote`,children:`远程`}),(0,V.jsx)(`option`,{value:`generated`,children:`AI生成`}),(0,V.jsx)(`option`,{value:`user`,children:`用户`})]}),(0,V.jsx)(`input`,{type:`text`,placeholder:`按标签筛选...`,value:o,onChange:e=>c(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]})]}),W?(0,V.jsx)(`div`,{className:`flex items-center justify-center h-48`,children:(0,V.jsx)(f,{className:`h-8 w-8 animate-spin text-blue-500`})}):(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,V.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,V.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{className:`w-10 px-4 py-3`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:se,onChange:()=>{p(se?new Set:new Set($.map(e=>e.name)))},className:`rounded`})}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`技能名称`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`版本`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`调用次数`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`成功率`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`最近使用`}),(0,V.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,V.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:$.map(e=>(0,V.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,V.jsx)(`td`,{className:`px-4 py-3`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:d.has(e.name),onChange:()=>ce(e.name),className:`rounded`})}),(0,V.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,V.jsx)(`button`,{onClick:()=>O(e.name),className:`font-medium text-blue-600 hover:text-blue-700 cursor-pointer`,children:e.name}),(0,V.jsx)(`div`,{className:`text-xs text-gray-500 truncate max-w-xs`,children:e.description}),e.tags&&e.tags.length>0&&(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:e.tags.map(e=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-gray-100 text-gray-600 text-xs rounded`,children:[(0,V.jsx)(r,{className:`h-2.5 w-2.5`}),e]},e))})]}),(0,V.jsx)(`td`,{className:`px-4 py-3`,children:(0,V.jsx)(`span`,{className:R(`px-2 py-0.5 text-xs rounded-full font-medium`,H[e.source]||`bg-gray-100 text-gray-600`),children:U[e.source]||e.source})}),(0,V.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.version}),(0,V.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.stats.callCount}),(0,V.jsx)(`td`,{className:`px-4 py-3`,children:e.stats.callCount>0?(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`div`,{className:`w-16 h-1.5 bg-gray-200 rounded-full overflow-hidden`,children:(0,V.jsx)(`div`,{className:R(`h-full rounded-full`,e.stats.successRate>=.8?`bg-green-500`:e.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`),style:{width:`${e.stats.successRate*100}%`}})}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-600`,children:[(e.stats.successRate*100).toFixed(0),`%`]})]}):(0,V.jsx)(`span`,{className:`text-xs text-gray-400`,children:`未使用`})}),(0,V.jsx)(`td`,{className:`px-4 py-3 text-xs text-gray-500`,children:e.stats.lastUsed?new Date(e.stats.lastUsed).toLocaleDateString(`zh-CN`):`—`}),(0,V.jsx)(`td`,{className:`px-4 py-3`,children:(0,V.jsx)(`button`,{onClick:()=>{P({open:!0,title:`删除技能`,description:`确定要删除技能 "${e.name}" 吗?此操作不可恢复。`,onConfirm:()=>{J.mutate(e.name),P(e=>({...e,open:!1}))}})},disabled:J.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`删除`,children:(0,V.jsx)(l,{className:`h-4 w-4`})})})]},e.name))})]}),$.length===0&&(0,V.jsxs)(`div`,{className:`text-center py-12`,children:[(0,V.jsx)(b,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,V.jsx)(`p`,{className:`text-gray-500`,children:`暂无技能`})]})]}),G&&(G.topUsed.length>0||G.topRated.length>0)&&(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[G.topUsed.length>0&&(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,V.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,V.jsx)(u,{className:`h-4 w-4 text-blue-500`}),`最常用技能`]}),(0,V.jsx)(`div`,{className:`space-y-2`,children:G.topUsed.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,V.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,V.jsxs)(`span`,{className:`text-gray-500`,children:[e.calls,` 次`]})]},e.name))})]}),G.topRated.length>0&&(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,V.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,V.jsx)(n,{className:`h-4 w-4 text-green-500`}),`评分最高技能`]}),(0,V.jsx)(`div`,{className:`space-y-2`,children:G.topRated.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,V.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,V.jsxs)(`span`,{className:`text-gray-500`,children:[(e.rating*100).toFixed(0),`%`]})]},e.name))})]})]})]}),e===`search`&&(0,V.jsx)(ie,{searchQuery:m,setSearchQuery:h,searchResults:_,onSearch:()=>K.mutate(m),onInstall:e=>q.mutate(e),isSearching:K.isPending,isInstalling:q.isPending}),e===`evolve`&&(0,V.jsx)(ae,{onEvolve:()=>X.mutate(),onDistill:()=>Z.mutate(),onRepair:()=>Q.mutate(),isEvolving:X.isPending,isDistilling:Z.isPending,isRepairing:Q.isPending,evolveResult:X.data,distillResult:Z.data,repairResult:Q.data}),e===`sources`&&(0,V.jsx)(oe,{}),D&&(0,V.jsx)(re,{name:D,onClose:()=>O(null)}),(0,V.jsx)(z,{open:j.open,title:j.title,description:j.description,count:j.count,onConfirm:j.onConfirm,onCancel:()=>P(e=>({...e,open:!1}))})]})}function re({name:e,onClose:n}){let[a,s]=(0,B.useState)(`content`),[c,u]=(0,B.useState)(!1),[d,h]=(0,B.useState)(``),[g,_]=(0,B.useState)(``),v=x(),{data:w,isLoading:T}=C({queryKey:[`skill-detail`,e],queryFn:()=>O(e).then(e=>e.data)}),{data:ee}=C({queryKey:[`orchestration-mappings`],queryFn:()=>P().then(e=>e.data),enabled:a===`orchestration`}),E=ee?.items.find(t=>t.skill===e),[te,ne]=(0,B.useState)([]),k=E?.keywords??[],A=S({mutationFn:t=>I(e,t),onSuccess:()=>{L(`技能内容已保存`,`success`),u(!1),v.invalidateQueries({queryKey:[`skill-detail`,e]})},onError:()=>L(`保存失败`,`error`)}),M=S({mutationFn:t=>j(e,t),onSuccess:()=>{L(`编排映射已保存`,`success`),v.invalidateQueries({queryKey:[`orchestration-mappings`]})},onError:()=>L(`保存失败`,`error`)}),N=S({mutationFn:()=>D(e),onSuccess:()=>{L(`编排映射已删除`,`success`),v.invalidateQueries({queryKey:[`orchestration-mappings`]})}}),[F,R]=(0,B.useState)(null),z=F??k;return(0,V.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/40`,onClick:n,children:(0,V.jsxs)(`div`,{className:`bg-white rounded-2xl shadow-2xl w-full max-w-3xl max-h-[85vh] flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-gray-100`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(b,{className:`h-5 w-5 text-blue-500`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900`,children:e}),w&&(0,V.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:w.description})]})]}),(0,V.jsx)(`button`,{onClick:n,className:`p-1.5 text-gray-400 hover:text-gray-600 rounded-lg transition-colors`,children:(0,V.jsx)(t,{className:`h-5 w-5`})})]}),(0,V.jsx)(`div`,{className:`flex gap-1 px-6 pt-3 border-b border-gray-100`,children:[`content`,`stats`,`orchestration`].map(e=>(0,V.jsx)(`button`,{onClick:()=>s(e),className:`px-3 py-1.5 text-sm font-medium border-b-2 transition-colors ${a===e?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:e===`content`?`技能内容`:e===`stats`?`使用情况`:`编排映射`},e))}),(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 py-5`,children:T?(0,V.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,V.jsx)(f,{className:`h-6 w-6 animate-spin text-blue-500`})}):w?a===`content`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,V.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full font-medium ${H[w.source]||`bg-gray-100 text-gray-600`}`,children:U[w.source]||w.source}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,w.version]}),w.requires?.bins&&w.requires.bins.length>0&&(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`需要:`,w.requires.bins.join(`, `)]}),w.filePath&&(0,V.jsx)(`span`,{className:`text-xs text-gray-400 font-mono truncate max-w-xs`,children:w.filePath})]}),w.tags&&w.tags.length>0&&(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:w.tags.map(e=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 text-xs rounded-full`,children:[(0,V.jsx)(r,{className:`h-2.5 w-2.5`}),e]},e))}),w.content||w.filePath?(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`text-xs text-gray-500 mb-2 flex items-center justify-between`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(o,{className:`h-3.5 w-3.5`}),`技能文件内容`]}),w.filePath&&!c&&(0,V.jsxs)(`button`,{onClick:()=>{h(w.content||``),u(!0)},className:`flex items-center gap-1 text-blue-600 hover:underline`,children:[(0,V.jsx)(m,{className:`h-3 w-3`}),`编辑`]}),c&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>u(!1),className:`text-gray-500 hover:text-gray-700 text-xs`,children:`取消`}),(0,V.jsxs)(`button`,{onClick:()=>A.mutate(d),disabled:A.isPending,className:`flex items-center gap-1 text-green-600 hover:underline text-xs`,children:[(0,V.jsx)(y,{className:`h-3 w-3`}),A.isPending?`保存中...`:`保存`]})]})]}),c?(0,V.jsx)(`textarea`,{value:d,onChange:e=>h(e.target.value),className:`w-full text-xs text-gray-800 bg-gray-50 rounded-lg p-4 border border-blue-300 focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono leading-relaxed resize-y`,style:{minHeight:`40vh`,maxHeight:`60vh`}}):(0,V.jsx)(`pre`,{className:`text-xs text-gray-800 bg-gray-50 rounded-lg p-4 overflow-auto whitespace-pre-wrap border border-gray-200 max-h-[50vh] leading-relaxed`,children:w.content||`(空文件)`})]}):(0,V.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无文件内容`}),w.sourceUrl&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,V.jsx)(i,{className:`h-3.5 w-3.5 text-gray-400`}),(0,V.jsx)(`a`,{href:w.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:underline truncate`,children:w.sourceUrl})]})]}):a===`stats`?(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,V.jsxs)(`div`,{className:`bg-blue-50 rounded-xl p-4 text-center`,children:[(0,V.jsx)(`div`,{className:`text-2xl font-bold text-blue-700`,children:w.stats.callCount}),(0,V.jsx)(`div`,{className:`text-xs text-blue-600 mt-1`,children:`总调用次数`})]}),(0,V.jsxs)(`div`,{className:`bg-green-50 rounded-xl p-4 text-center`,children:[(0,V.jsx)(`div`,{className:`text-2xl font-bold text-green-700`,children:w.stats.callCount>0?`${(w.stats.successRate*100).toFixed(0)}%`:`—`}),(0,V.jsx)(`div`,{className:`text-xs text-green-600 mt-1`,children:`成功率`})]}),(0,V.jsxs)(`div`,{className:`bg-purple-50 rounded-xl p-4 text-center`,children:[(0,V.jsx)(`div`,{className:`text-2xl font-bold text-purple-700`,children:w.stats.userFeedback.positive+w.stats.userFeedback.negative>0?`${w.stats.userFeedback.positive} / ${w.stats.userFeedback.negative}`:`—`}),(0,V.jsx)(`div`,{className:`text-xs text-purple-600 mt-1`,children:`用户反馈(正向/负向)`})]})]}),w.stats.callCount>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex justify-between text-xs text-gray-500 mb-1.5`,children:[(0,V.jsx)(`span`,{children:`成功率`}),(0,V.jsxs)(`span`,{children:[(w.stats.successRate*100).toFixed(1),`%`]})]}),(0,V.jsx)(`div`,{className:`w-full h-2 bg-gray-200 rounded-full overflow-hidden`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full transition-all ${w.stats.successRate>=.8?`bg-green-500`:w.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`}`,style:{width:`${w.stats.successRate*100}%`}})})]}),(0,V.jsxs)(`div`,{className:`bg-gray-50 rounded-xl p-4`,children:[(0,V.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`最近使用时间`}),(0,V.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:w.stats.lastUsed?new Date(w.stats.lastUsed).toLocaleString(`zh-CN`):`从未使用`})]}),w.stats.callCount===0&&(0,V.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`该技能尚未被调用过`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:`配置触发该技能的关键词,当用户输入包含这些关键词时,编排引擎会自动调用此技能。`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:`触发关键词`}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2 min-h-[40px] p-3 bg-gray-50 rounded-lg border border-gray-200`,children:z.length===0?(0,V.jsx)(`span`,{className:`text-xs text-gray-400`,children:`暂无关键词,添加后可触发自动编排`}):z.map((e,n)=>(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 text-blue-700 text-xs rounded-full`,children:[e,(0,V.jsx)(`button`,{onClick:()=>R(z.filter((e,t)=>t!==n)),className:`hover:text-red-500 transition-colors`,children:(0,V.jsx)(t,{className:`h-3 w-3`})})]},n))})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`input`,{type:`text`,value:g,onChange:e=>_(e.target.value),onKeyDown:e=>{if(e.key===`Enter`&&g.trim()){let e=g.trim();z.includes(e)||R([...z,e]),_(``)}},placeholder:`输入关键词,回车添加`,className:`flex-1 px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsx)(`button`,{onClick:()=>{let e=g.trim();e&&!z.includes(e)&&R([...z,e]),_(``)},disabled:!g.trim(),className:`px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:(0,V.jsx)(p,{className:`h-4 w-4`})})]}),(0,V.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,V.jsxs)(`button`,{onClick:()=>M.mutate(z),disabled:M.isPending||F===null,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,V.jsx)(y,{className:`h-3.5 w-3.5`}),M.isPending?`保存中...`:`保存映射`]}),E&&(0,V.jsxs)(`button`,{onClick:()=>N.mutate(),disabled:N.isPending,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-red-50 text-red-600 rounded-lg hover:bg-red-100 disabled:opacity-50 transition-colors`,children:[(0,V.jsx)(l,{className:`h-3.5 w-3.5`}),`删除映射`]})]})]}):(0,V.jsx)(`div`,{className:`text-center py-16 text-gray-500`,children:`技能不存在`})})]})})}function ie({searchQuery:e,setSearchQuery:t,searchResults:n,onSearch:r,onInstall:a,isSearching:o,isInstalling:s}){return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:(0,V.jsxs)(`div`,{className:`flex gap-3`,children:[(0,V.jsx)(`input`,{type:`text`,placeholder:`搜索技能(GitHub / npm)...`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>e.key===`Enter`&&r(),className:`flex-1 px-4 py-2.5 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsxs)(`button`,{onClick:r,disabled:o||!e.trim(),className:`flex items-center gap-2 px-6 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[o?(0,V.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(h,{className:`h-4 w-4`}),`搜索`]})]})}),n&&(0,V.jsxs)(`div`,{className:`space-y-6`,children:[n.github.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`GitHub 结果 (`,n.github.length,`)`]}),(0,V.jsx)(`div`,{className:`grid gap-3`,children:n.github.map((e,t)=>(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-blue-300 transition-colors`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,V.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,V.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),(0,V.jsxs)(`a`,{href:e.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-blue-600 hover:underline`,children:[(0,V.jsx)(i,{className:`h-3 w-3`}),e.sourceUrl]})]}),(0,V.jsxs)(`button`,{onClick:()=>a(e.sourceUrl),disabled:s,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-50 text-blue-600 hover:bg-blue-100 rounded-lg transition-colors`,children:[(0,V.jsx)(c,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.npm.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`npm 结果 (`,n.npm.length,`)`]}),(0,V.jsx)(`div`,{className:`grid gap-3`,children:n.npm.map((e,t)=>(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-purple-300 transition-colors`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,V.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,V.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),e.installCommand&&(0,V.jsx)(`code`,{className:`text-xs bg-gray-100 px-2 py-1 rounded`,children:e.installCommand})]}),(0,V.jsxs)(`button`,{onClick:()=>a(e.sourceUrl),disabled:s,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-50 text-purple-600 hover:bg-purple-100 rounded-lg transition-colors`,children:[(0,V.jsx)(c,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.github.length===0&&n.npm.length===0&&(0,V.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,V.jsx)(h,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,V.jsx)(`p`,{className:`text-gray-500`,children:`未找到匹配的技能`})]})]})]})}function ae({onEvolve:e,onDistill:t,onRepair:n,isEvolving:r,isDistilling:i,isRepairing:o,evolveResult:s,distillResult:l,repairResult:u}){return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,V.jsx)(`div`,{className:`p-2 bg-blue-50 rounded-lg`,children:(0,V.jsx)(d,{className:`h-5 w-5 text-blue-600`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`技能进化`}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:`淘汰、优化、生成`})]})]}),(0,V.jsxs)(`button`,{onClick:e,disabled:r,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[r?(0,V.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(v,{className:`h-4 w-4`}),r?`进化中...`:`开始进化`]}),s&&(0,V.jsxs)(`div`,{className:`mt-4 space-y-2 text-sm`,children:[s.repaired?.length>0&&(0,V.jsxs)(`div`,{className:`text-green-600`,children:[`✔ 修复 `,s.repaired.length,` 个`]}),s.retired?.length>0&&(0,V.jsxs)(`div`,{className:`text-red-600`,children:[`- 淘汰 `,s.retired.length,` 个`]}),s.optimized?.length>0&&(0,V.jsxs)(`div`,{className:`text-blue-600`,children:[`↑ 优化 `,s.optimized.length,` 个`]}),s.generated?.length>0&&(0,V.jsxs)(`div`,{className:`text-green-600`,children:[`+ 生成 `,s.generated.length,` 个`]})]})]}),(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,V.jsx)(`div`,{className:`p-2 bg-purple-50 rounded-lg`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-purple-600`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`社区蒸馏`}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:`从精选源采集`})]})]}),(0,V.jsxs)(`button`,{onClick:t,disabled:i,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,children:[i?(0,V.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(c,{className:`h-4 w-4`}),i?`蒸馏中...`:`开始蒸馏`]}),l&&l.distilled?.length>0&&(0,V.jsxs)(`div`,{className:`mt-4 text-sm text-purple-600`,children:[`✦ 新增 `,l.distilled.length,` 个技能`]})]}),(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,V.jsx)(`div`,{className:`p-2 bg-amber-50 rounded-lg`,children:(0,V.jsx)(a,{className:`h-5 w-5 text-amber-600`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`修复残缺`}),(0,V.jsx)(`p`,{className:`text-xs text-gray-500`,children:`AI 修复低质量技能`})]})]}),(0,V.jsxs)(`button`,{onClick:n,disabled:o,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-amber-600 text-white rounded-lg hover:bg-amber-700 disabled:opacity-50 transition-colors`,children:[o?(0,V.jsx)(f,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(a,{className:`h-4 w-4`}),o?`修复中...`:`开始修复`]}),u&&u.repaired?.length>0&&(0,V.jsxs)(`div`,{className:`mt-4 text-sm text-amber-600`,children:[`✔ 修复 `,u.repaired.length,` 个技能`]})]})]}),(0,V.jsxs)(`div`,{className:`bg-blue-50 rounded-xl border border-blue-200 p-4`,children:[(0,V.jsx)(`h4`,{className:`text-sm font-semibold text-blue-900 mb-2`,children:`进化机制说明`}),(0,V.jsxs)(`ul`,{className:`text-sm text-blue-700 space-y-1`,children:[(0,V.jsxs)(`li`,{children:[`• `,(0,V.jsx)(`strong`,{children:`技能进化`}),`:根据使用统计自动淘汰低效技能、优化高频技能、生成新技能`]}),(0,V.jsxs)(`li`,{children:[`• `,(0,V.jsx)(`strong`,{children:`社区蒸馏`}),`:从 GitHub 精选仓库采集优质技能并蒸馏为官方技能`]}),(0,V.jsxs)(`li`,{children:[`• `,(0,V.jsx)(`strong`,{children:`修复残缺`}),`:检测并修复缺少描述、版本号或格式错误的技能文件`]})]})]})]})}function oe(){let e=x(),[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),{data:a}=C({queryKey:[`skill-sources`],queryFn:()=>F.get(`/skills/sources`).then(e=>e.data)}),o=S({mutationFn:e=>F.post(`/skills/sources`,e).then(e=>e.data),onSuccess:()=>{L(`技能源已添加`,`success`),n(!1),i({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),e.invalidateQueries({queryKey:[`skill-sources`]})}}),s=S({mutationFn:e=>F.delete(`/skills/sources/${encodeURIComponent(e)}`).then(e=>e.data),onSuccess:()=>{L(`技能源已删除`,`success`),e.invalidateQueries({queryKey:[`skill-sources`]})}}),u=a?.builtIn||[],d=a?.user||[];return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`div`,{className:`flex justify-end`,children:(0,V.jsxs)(`button`,{onClick:()=>n(!t),className:`flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,V.jsx)(c,{className:`h-4 w-4`}),`添加技能源`]})}),t&&(0,V.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,V.jsx)(`h3`,{className:`font-semibold text-gray-900 mb-4`,children:`添加自定义技能源`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsx)(`input`,{type:`text`,placeholder:`仓库 (owner/repo)`,value:r.repo,onChange:e=>i({...r,repo:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`目录路径`,value:r.dir,onChange:e=>i({...r,dir:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsx)(`input`,{type:`text`,placeholder:`分支 (默认 main)`,value:r.branch,onChange:e=>i({...r,branch:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,V.jsxs)(`select`,{value:r.format,onChange:e=>i({...r,format:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,V.jsx)(`option`,{value:`command-md`,children:`command-md`}),(0,V.jsx)(`option`,{value:`skill-md`,children:`skill-md`})]}),(0,V.jsx)(`input`,{type:`text`,placeholder:`描述`,value:r.description,onChange:e=>i({...r,description:e.target.value}),className:`col-span-2 px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,V.jsxs)(`div`,{className:`flex gap-2 mt-4`,children:[(0,V.jsx)(`button`,{onClick:()=>o.mutate(r),disabled:!r.repo||!r.dir||o.isPending,className:`px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:o.isPending?`添加中...`:`确认添加`}),(0,V.jsx)(`button`,{onClick:()=>n(!1),className:`px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`内置技能源`}),(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:u.map((e,t)=>(0,V.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,V.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,V.jsx)(`span`,{className:`px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded`,children:`内置`})]},t))})]}),d.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`用户自定义源`}),(0,V.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:d.map((e,t)=>(0,V.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,V.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,V.jsx)(`button`,{onClick:()=>s.mutate(e.repo),disabled:s.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,children:(0,V.jsx)(l,{className:`h-4 w-4`})})]},t))})]})]})}export{W as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Bt as t,It as n,Yn as r,gr as i,mr as a,qn as ee}from"./vendor-DRGPi8ui.js";import{C as o}from"./vendor-charts-9eVsQvUV.js";import{c as s}from"./vendor-flow-srkes8If.js";var c=e(i(),1),l=e(o(),1),u=s(),te=(0,c.createContext)({toast:()=>{}}),d=()=>{};function f(e,t=`error`){d(e,t)}function p({children:e}){let[i,a]=(0,c.useState)([]),o={current:0},s=(0,c.useCallback)((e,t=`error`)=>{let n=++o.current;a(r=>[...r,{id:n,type:t,message:e}]),setTimeout(()=>a(e=>e.filter(e=>e.id!==n)),4e3)},[]);(0,c.useEffect)(()=>{d=s},[s]);let f={success:r,error:ee,warning:t},p={success:`bg-green-50 border-green-200 text-green-800`,error:`bg-red-50 border-red-200 text-red-800`,warning:`bg-yellow-50 border-yellow-200 text-yellow-800`},m={success:`text-green-500`,error:`text-red-500`,warning:`text-yellow-500`};return(0,u.jsxs)(te.Provider,{value:{toast:s},children:[e,(0,l.createPortal)((0,u.jsx)(`div`,{className:`fixed bottom-4 right-4 z-[9999] flex flex-col gap-2 max-w-sm`,children:i.map(e=>{let t=f[e.type];return(0,u.jsxs)(`div`,{className:`flex items-start gap-3 px-4 py-3 rounded-lg border shadow-lg text-sm ${p[e.type]}`,children:[(0,u.jsx)(t,{className:`h-4 w-4 mt-0.5 flex-shrink-0 ${m[e.type]}`}),(0,u.jsx)(`span`,{className:`flex-1`,children:e.message}),(0,u.jsx)(`button`,{onClick:()=>a(t=>t.filter(t=>t.id!==e.id)),children:(0,u.jsx)(n,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`})})]},e.id)})}),document.body)]})}var m=a.create({baseURL:`/api`,timeout:3e4});m.interceptors.request.use(e=>{let t=window.__AUTH_TOKEN__;return t&&(e.headers.Authorization=`Bearer ${t}`),e}),m.interceptors.response.use(e=>e,e=>(f(e.response?.data?.error||e.response?.data?.message||e.message||`请求失败`,`error`),Promise.reject(e)));var h=()=>m.get(`/health`),g=()=>m.get(`/config`),_=e=>m.put(`/config`,e),v=()=>m.get(`/config/history`),y=e=>m.get(`/sessions`,{params:e}),b=e=>m.get(`/sessions/${e}`),x=e=>m.delete(`/sessions/${e}`),S=(e,t)=>m.patch(`/sessions/${e}/meta`,t),C=e=>m.delete(`/sessions`,{data:{ids:e}}),w=e=>m.get(`/events`,{params:e}),T=e=>m.get(`/events/stats`,{params:{project_path:e}}),E=e=>m.get(`/pipelines`,{params:e}),D=e=>m.get(`/pipelines/${e}`),O=e=>m.get(`/quality/history`,{params:e}),k=e=>m.get(`/quality/unresolved`,{params:{project_path:e}}),A=()=>m.get(`/stats/roi`),j=()=>m.get(`/stats/overview`),M=(e,t,n,r)=>m.get(`/knowledge/search`,{params:{q:e,project_path:t,node_type:n,limit:r}}),N=e=>m.get(`/knowledge/overview`,{params:{project_path:e}}),P=(e,t)=>m.get(`/knowledge/neighbors`,{params:{node_id:e,project_path:t}}),F=(e,t)=>m.get(`/knowledge/graph`,{params:{project_path:e,node_type:t}}),I=e=>m.post(`/knowledge/nodes`,e),L=(e,t)=>m.put(`/knowledge/nodes/${e}`,t),R=e=>m.delete(`/knowledge/nodes/${e}`),z=e=>m.delete(`/knowledge/batch`,{data:{ids:e}}),B=e=>m.post(`/knowledge/import`,{nodes:e}),V=e=>m.post(`/knowledge/edges`,e),H=e=>m.post(`/pipelines/${e}/close`),U=e=>m.post(`/pipelines/${e}/reactivate`),W=e=>m.post(`/pipelines/batch-close`,{ids:e}),G=()=>m.post(`/pipelines/close-expired`),K=()=>m.get(`/pipelines/active`),q=e=>m.post(`/pipelines/${e}/resume`),J=e=>m.post(`/pipelines/${e}/advance`),Y=e=>m.get(`/pipeline-templates`,{params:e}),X=e=>m.get(`/pipeline-templates/${e}`),Z=e=>m.post(`/pipeline-templates`,e),Q=(e,t)=>m.put(`/pipeline-templates/${e}`,t),ne=e=>m.delete(`/pipeline-templates/${e}`),re=e=>m.get(`/projects`,{params:e}),ie=e=>m.get(`/projects/${e}`),ae=e=>m.delete(`/projects/${e}`),oe=e=>m.post(`/convention/init`,{path:e},{timeout:18e4}),se=e=>m.get(`/projects/${e}/conventions`),ce=(e,t)=>m.post(`/projects/${e}/conventions/bind`,{conventionId:t}),le=(e,t)=>m.delete(`/projects/${e}/conventions/${encodeURIComponent(t)}`),ue=e=>m.get(`/projects/${e}/conventions/custom/yaml`),de=(e,t)=>m.put(`/projects/${e}/conventions/custom`,{yaml:t}),fe=e=>m.post(`/projects/${e}/conventions/distill`,{},{timeout:12e4}),pe=e=>m.get(`/claudemd/${e}`),me=(e,t)=>m.put(`/claudemd/${e}`,{content:t}),he=e=>m.get(`/claudemd/${e}/profile`),ge=e=>m.get(`/claudemd/${e}/modules`),_e=e=>m.post(`/claudemd/${e}/distill`,void 0,{timeout:18e4}),ve=e=>m.post(`/claudemd/${e}/init`,void 0,{timeout:18e4}),ye=e=>m.post(`/quality/${e}/resolve`),be=e=>m.post(`/quality/${e}/dismiss`),xe=e=>m.post(`/quality/batch-dismiss`,{ids:e}),Se=e=>m.post(`/quality/batch-resolve`,{ids:e}),Ce=()=>m.post(`/quality/resolve-all`),we=e=>m.get(`/quality/${e}/context`),Te=()=>m.get(`/daemon/status`),Ee=()=>m.post(`/daemon/restart`),De=()=>m.get(`/daemon/diagnose`),Oe=()=>m.post(`/daemon/repair`),ke=e=>m.post(`/config/backup`,e||{}),Ae=()=>m.get(`/config/backups`),je=e=>`/api/config/backups/${encodeURIComponent(e)}`,Me=(e,t)=>m.post(`/config/restore`,{filename:e,password:t}),Ne=e=>m.post(`/events/purge`,{retentionDays:e}),Pe=()=>m.get(`/memory/caches`),Fe=()=>m.get(`/memory/process`),Ie=e=>m.post(`/memory/caches/${encodeURIComponent(e)}/clear`),Le=()=>m.post(`/memory/caches/clear-all`),Re=()=>m.post(`/memory/gc`),ze=e=>m.get(`/stats/api-usage`,{params:{days:e}}),Be=e=>m.get(`/skills`,{params:e}),Ve=()=>m.get(`/skills/status`),He=e=>m.get(`/skills/${encodeURIComponent(e)}`),Ue=(e,t)=>m.put(`/skills/${encodeURIComponent(e)}/content`,{content:t}),We=(e,t)=>m.post(`/skills/search`,{query:e,...t},{timeout:3e4}),Ge=e=>m.post(`/skills/install`,{url:e},{timeout:6e4}),Ke=e=>m.delete(`/skills/${encodeURIComponent(e)}`),qe=e=>m.post(`/skills/batch-delete`,{names:e}),Je=()=>m.post(`/skills/evolve`,{},{timeout:12e4}),Ye=()=>m.post(`/skills/distill`,{},{timeout:12e4}),Xe=()=>m.post(`/skills/repair`,{},{timeout:6e4}),Ze=()=>m.get(`/skills/orchestration`),Qe=(e,t)=>m.put(`/skills/orchestration`,{skill:e,keywords:t}),$e=e=>m.delete(`/skills/orchestration/${encodeURIComponent(e)}`),et=()=>m.get(`/conventions`),tt=e=>m.get(`/conventions/${encodeURIComponent(e)}`),nt=()=>m.post(`/conventions/sync-official`),rt=e=>m.post(`/conventions/install`,{url:e},{timeout:3e4}),it=e=>m.delete(`/conventions/${encodeURIComponent(e)}`),at=()=>m.get(`/conventions/usage-stats`),ot=e=>m.get(`/conventions/${encodeURIComponent(e)}/evolution-history`),st=e=>m.post(`/conventions/batch-evolve`,{conventionIds:e},{timeout:12e4}),ct=e=>m.get(`/conventions/${encodeURIComponent(e)}/yaml`),lt=(e,t)=>m.put(`/conventions/${encodeURIComponent(e)}/yaml`,{yaml:t}),ut=e=>m.get(`/node-types`,{params:e?{projectPath:e}:void 0}),dt=e=>m.get(`/node-types/${encodeURIComponent(e)}`),ft=e=>m.post(`/node-types`,e),$=(e,t)=>m.put(`/node-types/${encodeURIComponent(e)}`,t),pt=e=>m.delete(`/node-types/${encodeURIComponent(e)}`),mt=e=>m.get(`/plans/by-project/${encodeURIComponent(e)}`),ht=e=>m.get(`/plans/nodes/${e}/attempts`),gt=e=>m.post(`/plans/${e}/approve`),_t=e=>m.post(`/plans/${e}/abort`),vt=()=>m.get(`/templates`),yt=e=>m.get(`/templates/${e}/versions`),bt=(e,t)=>m.post(`/templates/${e}/rollback`,{version_id:t}),xt=e=>m.get(`/templates/${e}/stats`),St=e=>m.get(`/evolution/events`,{params:e}),Ct=()=>m.get(`/evolution/stats`);export{et as $,le as $t,De as A,vt as At,ge as B,Oe as Bt,R as C,b as Ct,ae as D,Be as Dt,ne as E,Ve as Et,Je as F,rt as Ft,at as G,Me as Gt,g as H,Ce as Ht,K as I,Ge as It,T as J,lt as Jt,ct as K,q as Kt,ze as L,Ae as Lt,_e as M,B as Mt,fe as N,oe as Nt,x as O,xt as Ot,Ye as P,ve as Pt,tt as Q,Re as Qt,je as R,Ne as Rt,it as S,A as St,$e as T,He as Tt,v as U,ye as Ut,he as V,Xe as Vt,ot as W,Ee as Wt,St as X,We as Xt,w as Y,M as Yt,Ct as Z,nt as Zt,H as _,se as _t,ke as a,de as an,Fe as at,ft as b,we as bt,C as c,Qe as cn,ut as ct,st as d,D as dt,me as en,h as et,Se as f,mt as ft,G as g,ie as gt,Ie as h,E as ht,gt as i,Q as in,Pe as it,be as j,k as jt,Ke as k,yt as kt,qe as l,p as ln,Ze as lt,Le as m,Y as mt,J as n,L as nn,P as nt,W as o,S as on,ht as ot,ce as p,X as pt,Te as q,bt as qt,m as r,$ as rn,N as rt,z as s,Ue as sn,dt as st,_t as t,_ as tn,F as tt,xe as u,f as un,j as ut,V as v,ue as vt,pt as w,y as wt,Z as x,O as xt,I as y,re as yt,pe as z,U as zt};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-Bj28rnDe.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-BhcjNvkG.js","assets/ConfirmDialog-CVzB7X5y.js","assets/ui-CDL3BZ13.js","assets/useSmartPolling-DYAVOihL.js","assets/Sessions-CorfQV78.js","assets/BatchProgress-BQ533tSf.js","assets/ErrorState-DXHA8lr8.js","assets/Skeleton-B7PVDJJ_.js","assets/exportCsv-CSExJI8h.js","assets/SessionDetail-BNDIfmmq.js","assets/Breadcrumb-DtfwnOx6.js","assets/Events-C0y7WcDP.js","assets/useDebounce-DNfPs3Tv.js","assets/Pipelines-CR9oD3Xy.js","assets/Pagination-lp8b_3NR.js","assets/PipelineDetail-DGKz18zu.js","assets/Quality-BdvL1VQn.js","assets/Config-DhfQsbT1.js","assets/Analytics-Bo74j97W.js","assets/Knowledge-Y1lX6vor.js","assets/Projects-RGIPdiJn.js","assets/ProjectDetail-RfdtEvTT.js","assets/Skills-BJt0OrKj.js","assets/Conventions-BobuQiOk.js","assets/vendor-editor-B1NX2ipj.js","assets/NodeTypes-DyrDqhBp.js","assets/PipelineTemplates-D4zvL6I1.js","assets/Templates-Cp3yC5tv.js","assets/TemplateDetail-DOfBYdQ3.js","assets/Evolution-DimZAXFS.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 ee,ar as d,cr as f,en as p,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,ln as V,wt as H}from"./client-BhcjNvkG.js";import{a as U,n as W}from"./ui-CDL3BZ13.js";import{n as G,t as K}from"./vendor-motion-CQmdgnI8.js";import{t as q}from"./useDebounce-DNfPs3Tv.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:d},{path:`/skills`,label:`技能管理`,icon:S},{path:`/conventions`,label:`规范管理`,icon:f},{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),refetchInterval:15e3}),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:U(`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:U(`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})=>U(`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:U(`border-t border-white/10 py-4`,n?`px-2`:`px-5`),children:(0,X.jsxs)(`div`,{className:U(`flex items-center gap-2`,n?`justify-center`:``),children:[(0,X.jsx)(`div`,{className:U(`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:U(`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.47`]}),(0,X.jsxs)(`div`,{className:U(`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:U(`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:d,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(),f=q(n,300),m=f.trim().length>=2,{data:h,isFetching:g}=I({queryKey:[`cmd-pipelines`,f],queryFn:()=>B({search:f,page_size:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:_,isFetching:v}=I({queryKey:[`cmd-sessions`,f],queryFn:()=>H({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:b,isFetching:x}=I({queryKey:[`cmd-knowledge`,f],queryFn:()=>R(f,void 0,void 0,5).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:S,isFetching:C}=I({queryKey:[`cmd-skills`,f],queryFn:()=>L({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),w=g||v||x||C,E=[];if(m){let e=f.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:d,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)},[f]);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)(G,{children:e&&(0,X.jsx)(K.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)(K.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)(ee,{className:`h-5 w-5 text-blue-400 flex-shrink-0 animate-spin`}):(0,X.jsx)(p,{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:U(`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 ie=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)(W,{variant:`primary`,icon:b,onClick:()=>window.location.reload(),children:`刷新页面`})]})}):this.props.children}},ae=3e3;function oe(){let e=window.__AUTH_TOKEN__;return e?`/api/events/stream?token=${encodeURIComponent(e)}`:`/api/events/stream`}function se(){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(oe());t.current=a;let o=t=>{for(let n of t)e.invalidateQueries({queryKey:n})};a.addEventListener(`pipeline:status`,()=>{o([[`pipelines-active`],[`pipelines`],[`overview`]])}),a.addEventListener(`pipeline:node`,()=>{o([[`pipelines-active`],[`pipelines`]])}),a.addEventListener(`quality:issue`,()=>{o([[`quality-history`],[`overview`]])}),a.addEventListener(`session:event`,()=>{o([[`events-live`],[`sessions`],[`overview`]])}),a.addEventListener(`session:status`,()=>{o([[`sessions`],[`overview`]])}),a.addEventListener(`daemon:status`,()=>{o([[`daemon-status`]])}),a.onerror=()=>{a.close(),t.current=null,r||(n.current=setTimeout(i,ae))}}return i(),()=>{r=!0,n.current&&clearTimeout(n.current),t.current?.close(),t.current=null}},[e])}var ce=(0,Y.lazy)(()=>M(()=>import(`./Dashboard-Bj28rnDe.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),le=(0,Y.lazy)(()=>M(()=>import(`./Sessions-CorfQV78.js`),__vite__mapDeps([13,1,2,3,4,5,6,7,9,14,10,11,8,15,16,12,17]))),ue=(0,Y.lazy)(()=>M(()=>import(`./SessionDetail-BNDIfmmq.js`),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,19,11]))),de=(0,Y.lazy)(()=>M(()=>import(`./Events-C0y7WcDP.js`),__vite__mapDeps([20,1,3,5,6,4,7,8,9,10,11,15,21,17]))),fe=(0,Y.lazy)(()=>M(()=>import(`./Pipelines-CR9oD3Xy.js`),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,14,10,11,15,23,16,21,12,17]))),pe=(0,Y.lazy)(()=>M(()=>import(`./PipelineDetail-DGKz18zu.js`),__vite__mapDeps([24,1,2,3,4,5,6,7,8,9,19,10,11]))),me=(0,Y.lazy)(()=>M(()=>import(`./Quality-BdvL1VQn.js`),__vite__mapDeps([25,1,3,5,6,4,7,8,9,10,11,15,23,21,17]))),he=(0,Y.lazy)(()=>M(()=>import(`./Config-DhfQsbT1.js`),__vite__mapDeps([26,1,3,5,6,4,7,8,9,10,11]))),ge=(0,Y.lazy)(()=>M(()=>import(`./Analytics-Bo74j97W.js`),__vite__mapDeps([27,1,3,5,6,4,7,9,15,11,8,17]))),_e=(0,Y.lazy)(()=>M(()=>import(`./Knowledge-Y1lX6vor.js`),__vite__mapDeps([28,1,3,5,6,4,7,8,9,10,11,23,17]))),ve=(0,Y.lazy)(()=>M(()=>import(`./Projects-RGIPdiJn.js`),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,23,11,17]))),ye=(0,Y.lazy)(()=>M(()=>import(`./ProjectDetail-RfdtEvTT.js`),__vite__mapDeps([30,1,2,3,4,5,6,7,9,19,23,11,8]))),be=(0,Y.lazy)(()=>M(()=>import(`./Skills-BJt0OrKj.js`),__vite__mapDeps([31,1,3,5,6,4,7,9,10,11,8]))),$=(0,Y.lazy)(()=>M(()=>import(`./Conventions-BobuQiOk.js`),__vite__mapDeps([32,1,33,3,5,6,4,7,9,10,11,8]))),xe=(0,Y.lazy)(()=>M(()=>import(`./NodeTypes-DyrDqhBp.js`),__vite__mapDeps([34,1,3,5,6,4,7,9]))),Se=(0,Y.lazy)(()=>M(()=>import(`./PipelineTemplates-D4zvL6I1.js`),__vite__mapDeps([35,1,3,5,6,4,7,9]))),Ce=(0,Y.lazy)(()=>M(()=>import(`./Templates-Cp3yC5tv.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,15,11,16]))),we=(0,Y.lazy)(()=>M(()=>import(`./TemplateDetail-DOfBYdQ3.js`),__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,10,11,15,16]))),Te=(0,Y.lazy)(()=>M(()=>import(`./Evolution-DimZAXFS.js`),__vite__mapDeps([38,2,1,3,4,5,6,7,8,9,16,11])));function Ee(){return se(),(0,X.jsx)(ie,{children:(0,X.jsxs)(V,{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)(ce,{})}),(0,X.jsx)(w,{path:`/sessions`,element:(0,X.jsx)(le,{})}),(0,X.jsx)(w,{path:`/sessions/:id`,element:(0,X.jsx)(ue,{})}),(0,X.jsx)(w,{path:`/events`,element:(0,X.jsx)(de,{})}),(0,X.jsx)(w,{path:`/pipelines`,element:(0,X.jsx)(fe,{})}),(0,X.jsx)(w,{path:`/pipelines/:id`,element:(0,X.jsx)(pe,{})}),(0,X.jsx)(w,{path:`/projects`,element:(0,X.jsx)(ve,{})}),(0,X.jsx)(w,{path:`/projects/:encodedPath`,element:(0,X.jsx)(ye,{})}),(0,X.jsx)(w,{path:`/quality`,element:(0,X.jsx)(me,{})}),(0,X.jsx)(w,{path:`/analytics`,element:(0,X.jsx)(ge,{})}),(0,X.jsx)(w,{path:`/knowledge`,element:(0,X.jsx)(_e,{})}),(0,X.jsx)(w,{path:`/skills`,element:(0,X.jsx)(be,{})}),(0,X.jsx)(w,{path:`/conventions`,element:(0,X.jsx)($,{})}),(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)(he,{})})]})})})]})})}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 +0,0 @@
1
- function e(e){return e?5e3:6e4}export{e as t};