@winspan/claude-forge 3.6.26 → 3.6.39

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 (169) hide show
  1. package/dist/autopilot/issue-tracker.js +1 -1
  2. package/dist/autopilot/issue-tracker.js.map +1 -1
  3. package/dist/autopilot/quality-gate.d.ts +20 -2
  4. package/dist/autopilot/quality-gate.d.ts.map +1 -1
  5. package/dist/autopilot/quality-gate.js +20 -2
  6. package/dist/autopilot/quality-gate.js.map +1 -1
  7. package/dist/cli/commands/logs.js +1 -1
  8. package/dist/cli/commands/logs.js.map +1 -1
  9. package/dist/config/defaults.d.ts.map +1 -1
  10. package/dist/config/defaults.js +5 -0
  11. package/dist/config/defaults.js.map +1 -1
  12. package/dist/config/schema.d.ts +9 -1
  13. package/dist/config/schema.d.ts.map +1 -1
  14. package/dist/config/schema.js +5 -0
  15. package/dist/config/schema.js.map +1 -1
  16. package/dist/convention/convention-loader.d.ts.map +1 -1
  17. package/dist/convention/convention-loader.js +3 -0
  18. package/dist/convention/convention-loader.js.map +1 -1
  19. package/dist/daemon/handlers/stages/07-pipeline-reply.d.ts.map +1 -1
  20. package/dist/daemon/handlers/stages/07-pipeline-reply.js +3 -0
  21. package/dist/daemon/handlers/stages/07-pipeline-reply.js.map +1 -1
  22. package/dist/daemon/handlers/stages/18-complex-task.d.ts.map +1 -1
  23. package/dist/daemon/handlers/stages/18-complex-task.js +3 -0
  24. package/dist/daemon/handlers/stages/18-complex-task.js.map +1 -1
  25. package/dist/daemon/handlers/stages/19-moderate-task.d.ts.map +1 -1
  26. package/dist/daemon/handlers/stages/19-moderate-task.js +3 -0
  27. package/dist/daemon/handlers/stages/19-moderate-task.js.map +1 -1
  28. package/dist/daemon/index.d.ts.map +1 -1
  29. package/dist/daemon/index.js +81 -0
  30. package/dist/daemon/index.js.map +1 -1
  31. package/dist/pipeline/dynamic-node-types.d.ts +2 -0
  32. package/dist/pipeline/dynamic-node-types.d.ts.map +1 -1
  33. package/dist/pipeline/index.d.ts +27 -1
  34. package/dist/pipeline/index.d.ts.map +1 -1
  35. package/dist/pipeline/index.js +87 -72
  36. package/dist/pipeline/index.js.map +1 -1
  37. package/dist/pipeline/pipeline-state-machine.d.ts +19 -0
  38. package/dist/pipeline/pipeline-state-machine.d.ts.map +1 -0
  39. package/dist/pipeline/pipeline-state-machine.js +53 -0
  40. package/dist/pipeline/pipeline-state-machine.js.map +1 -0
  41. package/dist/pipeline/template-registry.d.ts.map +1 -1
  42. package/dist/pipeline/template-registry.js +4 -1
  43. package/dist/pipeline/template-registry.js.map +1 -1
  44. package/dist/storage/repositories/base-repository.d.ts +2 -0
  45. package/dist/storage/repositories/base-repository.d.ts.map +1 -1
  46. package/dist/storage/repositories/base-repository.js +12 -0
  47. package/dist/storage/repositories/base-repository.js.map +1 -1
  48. package/dist/storage/repositories/dynamic-pipeline-repository.d.ts +11 -4
  49. package/dist/storage/repositories/dynamic-pipeline-repository.d.ts.map +1 -1
  50. package/dist/storage/repositories/dynamic-pipeline-repository.js +41 -14
  51. package/dist/storage/repositories/dynamic-pipeline-repository.js.map +1 -1
  52. package/dist/storage/repositories/dynamic-pipeline-template-repository.d.ts +13 -0
  53. package/dist/storage/repositories/dynamic-pipeline-template-repository.d.ts.map +1 -0
  54. package/dist/storage/repositories/dynamic-pipeline-template-repository.js +117 -0
  55. package/dist/storage/repositories/dynamic-pipeline-template-repository.js.map +1 -0
  56. package/dist/storage/repositories/event-repository.d.ts.map +1 -1
  57. package/dist/storage/repositories/event-repository.js +3 -3
  58. package/dist/storage/repositories/event-repository.js.map +1 -1
  59. package/dist/storage/repositories/latency-repository.js +1 -1
  60. package/dist/storage/repositories/latency-repository.js.map +1 -1
  61. package/dist/storage/repositories/maintenance-repository.d.ts.map +1 -1
  62. package/dist/storage/repositories/maintenance-repository.js +1 -0
  63. package/dist/storage/repositories/maintenance-repository.js.map +1 -1
  64. package/dist/storage/repositories/quality-repository.d.ts +16 -0
  65. package/dist/storage/repositories/quality-repository.d.ts.map +1 -0
  66. package/dist/storage/repositories/quality-repository.js +36 -0
  67. package/dist/storage/repositories/quality-repository.js.map +1 -0
  68. package/dist/storage/repositories/session-repository.d.ts +7 -0
  69. package/dist/storage/repositories/session-repository.d.ts.map +1 -1
  70. package/dist/storage/repositories/session-repository.js +33 -0
  71. package/dist/storage/repositories/session-repository.js.map +1 -1
  72. package/dist/storage/schema/migration-manager.d.ts +1 -1
  73. package/dist/storage/schema/migration-manager.d.ts.map +1 -1
  74. package/dist/storage/schema/migration-manager.js +27 -1
  75. package/dist/storage/schema/migration-manager.js.map +1 -1
  76. package/dist/storage/sqlite.d.ts +13 -0
  77. package/dist/storage/sqlite.d.ts.map +1 -1
  78. package/dist/storage/sqlite.js +92 -31
  79. package/dist/storage/sqlite.js.map +1 -1
  80. package/dist/types/session.d.ts +3 -0
  81. package/dist/types/session.d.ts.map +1 -1
  82. package/dist/utils/logger.d.ts +4 -4
  83. package/dist/utils/logger.d.ts.map +1 -1
  84. package/dist/utils/logger.js +24 -10
  85. package/dist/utils/logger.js.map +1 -1
  86. package/dist/web/routes/config.d.ts +2 -0
  87. package/dist/web/routes/config.d.ts.map +1 -1
  88. package/dist/web/routes/config.js +58 -3
  89. package/dist/web/routes/config.js.map +1 -1
  90. package/dist/web/routes/events.d.ts.map +1 -1
  91. package/dist/web/routes/events.js +4 -5
  92. package/dist/web/routes/events.js.map +1 -1
  93. package/dist/web/routes/knowledge.d.ts.map +1 -1
  94. package/dist/web/routes/knowledge.js +51 -8
  95. package/dist/web/routes/knowledge.js.map +1 -1
  96. package/dist/web/routes/pipelines.d.ts.map +1 -1
  97. package/dist/web/routes/pipelines.js +79 -5
  98. package/dist/web/routes/pipelines.js.map +1 -1
  99. package/dist/web/routes/projects.d.ts.map +1 -1
  100. package/dist/web/routes/projects.js +1 -2
  101. package/dist/web/routes/projects.js.map +1 -1
  102. package/dist/web/routes/quality.d.ts.map +1 -1
  103. package/dist/web/routes/quality.js +16 -19
  104. package/dist/web/routes/quality.js.map +1 -1
  105. package/dist/web/routes/sessions.d.ts.map +1 -1
  106. package/dist/web/routes/sessions.js +44 -21
  107. package/dist/web/routes/sessions.js.map +1 -1
  108. package/dist/web/routes/skills.d.ts.map +1 -1
  109. package/dist/web/routes/skills.js +16 -10
  110. package/dist/web/routes/skills.js.map +1 -1
  111. package/dist/web/routes/stats.d.ts.map +1 -1
  112. package/dist/web/routes/stats.js +53 -2
  113. package/dist/web/routes/stats.js.map +1 -1
  114. package/dist/web/server.d.ts.map +1 -1
  115. package/dist/web/server.js +113 -26
  116. package/dist/web/server.js.map +1 -1
  117. package/dist/web/sse-broadcaster.d.ts +23 -0
  118. package/dist/web/sse-broadcaster.d.ts.map +1 -0
  119. package/dist/web/sse-broadcaster.js +73 -0
  120. package/dist/web/sse-broadcaster.js.map +1 -0
  121. package/dist/web/utils/error-response.d.ts +23 -0
  122. package/dist/web/utils/error-response.d.ts.map +1 -0
  123. package/dist/web/utils/error-response.js +26 -0
  124. package/dist/web/utils/error-response.js.map +1 -0
  125. package/dist/web/utils/validation.d.ts +56 -3
  126. package/dist/web/utils/validation.d.ts.map +1 -1
  127. package/dist/web/utils/validation.js +88 -4
  128. package/dist/web/utils/validation.js.map +1 -1
  129. package/dist/web-static/assets/Analytics-BTMAlQBr.js +1 -0
  130. package/dist/web-static/assets/BatchProgress-CIrC9RcC.js +1 -0
  131. package/dist/web-static/assets/Breadcrumb-DbDeWYcH.js +1 -0
  132. package/dist/web-static/assets/Config-yTRFpmlP.js +1 -0
  133. package/dist/web-static/assets/ConfirmDialog-CH1HyRaY.js +1 -0
  134. package/dist/web-static/assets/Conventions-DaqIk41m.js +1 -0
  135. package/dist/web-static/assets/Dashboard-BS61GjKa.js +1 -0
  136. package/dist/web-static/assets/ErrorState-HW0OjEYK.js +1 -0
  137. package/dist/web-static/assets/Events-DAms_1fs.js +1 -0
  138. package/dist/web-static/assets/Knowledge-CZhuou1K.js +2 -0
  139. package/dist/web-static/assets/NodeTypes-B5E6NYKn.js +1 -0
  140. package/dist/web-static/assets/Pagination-ooTI9JPa.js +1 -0
  141. package/dist/web-static/assets/PipelineDetail-DCnqD5lr.js +4 -0
  142. package/dist/web-static/assets/PipelineTemplates-CxGoLw6Q.js +1 -0
  143. package/dist/web-static/assets/Pipelines-DEuVx4hF.js +2 -0
  144. package/dist/web-static/assets/ProjectDetail-Dn01H3zi.js +1 -0
  145. package/dist/web-static/assets/Projects-D5-BfuFU.js +1 -0
  146. package/dist/web-static/assets/Quality-wvfdPtGB.js +3 -0
  147. package/dist/web-static/assets/SessionDetail-DleCNmQH.js +1 -0
  148. package/dist/web-static/assets/Sessions-Dz6xFq_4.js +2 -0
  149. package/dist/web-static/assets/Skills-CpHL-tyW.js +1 -0
  150. package/dist/web-static/assets/client-B_-7qCOP.js +1 -0
  151. package/dist/web-static/assets/exportCsv-CSExJI8h.js +3 -0
  152. package/dist/web-static/assets/index-CN_edVMt.js +2 -0
  153. package/dist/web-static/assets/index-DLMLziRH.css +2 -0
  154. package/dist/web-static/assets/rolldown-runtime-COnpUsM8.js +1 -0
  155. package/dist/web-static/assets/ui-B2gvOcFY.js +1 -0
  156. package/dist/web-static/assets/useDebounce-Bo1fLB5L.js +1 -0
  157. package/dist/web-static/assets/useSmartPolling-DYAVOihL.js +1 -0
  158. package/dist/web-static/assets/vendor-BpBCrKSP.js +9 -0
  159. package/dist/web-static/assets/vendor-charts-BXsEmmv5.js +36 -0
  160. package/dist/web-static/assets/vendor-editor-DYIoTHFO.js +11 -0
  161. package/dist/web-static/assets/vendor-flow-CHpVij2M.css +1 -0
  162. package/dist/web-static/assets/vendor-flow-D-_WxBha.js +7 -0
  163. package/dist/web-static/assets/vendor-motion-BsfSkSjj.js +9 -0
  164. package/dist/web-static/assets/vendor-query-BF-uT_c5.js +4 -0
  165. package/dist/web-static/assets/vendor-react-CXfI0Tes.js +11 -0
  166. package/dist/web-static/index.html +13 -2
  167. package/package.json +1 -1
  168. package/dist/web-static/assets/index-DL3sxp0u.js +0 -87
  169. package/dist/web-static/assets/index-DwWCJY_u.css +0 -1
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{In as t,It as n,Nn as r,Tn as i,Un as ee,Ut as te,en as a,mr as o,rn as s,s as c}from"./vendor-BpBCrKSP.js";import{c as l}from"./vendor-react-CXfI0Tes.js";import{a as u,n as d,r as f}from"./vendor-query-BF-uT_c5.js";import{c as p}from"./vendor-flow-D-_WxBha.js";import{h as ne,i as re,lt as m,m as h}from"./client-B_-7qCOP.js";import{l as g,n as _,r as v,t as y}from"./ui-B2gvOcFY.js";import{t as ie}from"./vendor-motion-BsfSkSjj.js";import{t as ae}from"./useDebounce-Bo1fLB5L.js";import{t as oe}from"./ErrorState-HW0OjEYK.js";import{t as b}from"./exportCsv-CSExJI8h.js";import{t as x}from"./ConfirmDialog-CH1HyRaY.js";import{t as S}from"./useSmartPolling-DYAVOihL.js";import{t as C}from"./Pagination-ooTI9JPa.js";import{n as w,r as T,t as se}from"./BatchProgress-CIrC9RcC.js";var E=e(o(),1),D=p();function O(){let e=u(),o=l(),[p,O]=(0,E.useState)(``),k=ae(p),[A,ce]=(0,E.useState)(``),[j,M]=(0,E.useState)(`all`),[N,P]=(0,E.useState)(1),[F,I]=(0,E.useState)(20),[L,R]=(0,E.useState)(new Set),[z,B]=(0,E.useState)(``),[V,H]=(0,E.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:U,isLoading:W,isError:le,refetch:G}=f({queryKey:[`pipelines`,`active`],queryFn:()=>m({status:`active`,page_size:100}).then(e=>e.data),refetchInterval:S((U?.total??0)>0)}),{data:K,refetch:ue}=f({queryKey:[`pipelines`,`completed`,k,A,N,F],queryFn:()=>m({status:`completed`,search:k||void 0,complexity:A||void 0,page:N,page_size:F}).then(e=>e.data)}),q=d({mutationFn:e=>ne(e),onSuccess:()=>e.invalidateQueries({queryKey:[`pipelines`]})}),J=d({mutationFn:()=>h(),onSuccess:()=>e.invalidateQueries({queryKey:[`pipelines`]})}),Y=d({mutationFn:e=>re(e),onSuccess:t=>{e.invalidateQueries({queryKey:[`pipelines`]}),R(new Set),t.failed.length>0&&alert(`关闭完成:成功 ${t.success.length} 个,失败 ${t.failed.length} 个\n失败原因:\n${t.errors.map(e=>`${e.id}: ${e.reason}`).join(`
2
+ `)}`)}});if(W)return(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsx)(w,{rows:2}),(0,D.jsx)(T,{count:5})]});if(le)return(0,D.jsx)(oe,{message:`Pipeline 数据加载失败`,onRetry:()=>G()});let X=U?.items||[],Z=K?.items||[],Q=K?.total||0,$=X.filter(e=>!z||e.requirement.toLowerCase().includes(z.toLowerCase())||e.project.toLowerCase().includes(z.toLowerCase())),de=j===`all`||j===`active`,fe=j===`all`||j===`completed`,pe=Math.ceil(Q/F);return(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,D.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[X.length,` 个活跃 · `,Q,` 个已完成`,L.size>0&&` · 已选 ${L.size} 个`]}),(0,D.jsxs)(`select`,{value:j,onChange:e=>{M(e.target.value),P(1)},className:`px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,D.jsx)(`option`,{value:`all`,children:`全部状态`}),(0,D.jsx)(`option`,{value:`active`,children:`仅活跃`}),(0,D.jsx)(`option`,{value:`completed`,children:`仅已完成`})]})]}),(0,D.jsxs)(`div`,{className:`flex gap-2`,children:[$.length>0&&L.size>0&&(0,D.jsxs)(_,{variant:`danger`,size:`sm`,icon:n,onClick:()=>{L.size!==0&&H({open:!0,title:`批量关闭 Pipeline`,description:`确认关闭选中的 ${L.size} 个 Pipeline?`,count:L.size,onConfirm:()=>{Y.mutate(Array.from(L)),H(e=>({...e,open:!1}))}})},loading:Y.isPending,children:[`批量关闭 (`,L.size,`)`]}),$.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{variant:`secondary`,size:`sm`,onClick:()=>{L.size===$.length?R(new Set):R(new Set($.map(e=>e.id)))},children:L.size===$.length?`取消全选`:`全选`}),(0,D.jsx)(_,{variant:`danger`,size:`sm`,icon:te,onClick:()=>{H({open:!0,title:`清理过期 Pipeline`,description:`确认关闭所有过期 Pipeline?`,onConfirm:()=>{J.mutate(),H(e=>({...e,open:!1}))}})},loading:J.isPending,children:`清理过期`})]}),(0,D.jsx)(_,{variant:`secondary`,size:`sm`,icon:s,onClick:()=>G(),children:`刷新`}),(0,D.jsx)(_,{variant:`secondary`,size:`sm`,icon:t,onClick:()=>{let e=[...X,...Z];b(`pipelines-${c(new Date,`yyyyMMdd-HHmmss`)}.csv`,[`ID`,`需求`,`复杂度`,`状态`,`项目`,`创建时间`],e.map(e=>[e.id,e.requirement,e.complexity,e.status,e.project,e.createdAt]))},children:`导出 CSV`})]})]}),Y.isPending&&(0,D.jsx)(se,{total:L.size,done:0,label:`批量关闭中`}),de&&X.length>0&&(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,D.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-500 uppercase tracking-wider`,children:[`活跃中 (`,$.length,`/`,X.length,`)`]}),(0,D.jsxs)(`div`,{className:`relative w-64`,children:[(0,D.jsx)(a,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,D.jsx)(`input`,{type:`text`,placeholder:`搜索活跃 Pipeline...`,value:z,onChange:e=>B(e.target.value),className:`w-full pl-10 pr-4 py-1.5 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`})]})]}),(0,D.jsx)(`div`,{className:`space-y-3`,children:$.map((e,t)=>(0,D.jsx)(ie.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t*.05},children:(0,D.jsx)(v,{className:`!p-0 overflow-hidden cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>o(`/pipelines/${e.id}`),children:(0,D.jsxs)(`div`,{className:`flex items-center justify-between p-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-4 flex-1 min-w-0`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:L.has(e.id),onChange:t=>{t.stopPropagation(),R(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 flex-shrink-0`}),(0,D.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg`,style:{backgroundColor:`#10b98120`},children:(0,D.jsx)(i,{className:`h-5 w-5`,style:{color:`#10b981`}})}),(0,D.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,D.jsx)(`div`,{className:`font-medium text-gray-900 truncate`,children:e.requirement}),(0,D.jsxs)(`div`,{className:`text-sm text-gray-500 flex items-center gap-3 mt-1`,children:[(0,D.jsx)(y,{variant:`primary`,size:`sm`,children:`动态`}),(0,D.jsx)(`span`,{children:e.project}),(0,D.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,D.jsx)(ee,{className:`h-3 w-3`}),c(g(e.createdAt),`MM-dd HH:mm`)]})]}),e.type===`dynamic`&&e.nodeConfig&&(0,D.jsxs)(`div`,{className:`mt-2 flex items-center gap-3 text-xs text-gray-600`,children:[(0,D.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,D.jsx)(i,{className:`h-3 w-3`}),e.nodeConfig.totalNodes,` 个节点`]}),e.nodeConfig.boundSkills.length>0&&(0,D.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`⚡ `,e.nodeConfig.boundSkills.length,` 个技能`]}),(0,D.jsxs)(`span`,{className:`text-gray-400`,children:[`节点类型:`,e.nodeConfig.nodeTypes.map(e=>e.split(/[_\-.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)).join(` → `)]})]})]})]}),(0,D.jsx)(_,{variant:`danger`,size:`sm`,icon:n,onClick:()=>{H({open:!0,title:`关闭 Pipeline`,description:`确认关闭此 Pipeline?`,onConfirm:()=>{q.mutate(e.id),H(e=>({...e,open:!1}))}})},loading:q.isPending,children:`关闭`})]})})},e.id))})]}),fe&&(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h3`,{className:`text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3`,children:`历史记录`}),(0,D.jsxs)(v,{children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center mb-4 pb-4 border-b border-gray-100`,children:[(0,D.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-sm`,children:[(0,D.jsx)(a,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,D.jsx)(`input`,{type:`text`,placeholder:`搜索需求描述...`,value:p,onChange:e=>{O(e.target.value),P(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`})]}),(0,D.jsxs)(`select`,{value:A,onChange:e=>{ce(e.target.value),P(1)},className:`px-3 py-2 border border-gray-200 rounded-lg text-sm`,children:[(0,D.jsx)(`option`,{value:``,children:`全部复杂度`}),(0,D.jsx)(`option`,{value:`simple`,children:`简单`}),(0,D.jsx)(`option`,{value:`moderate`,children:`中等`}),(0,D.jsx)(`option`,{value:`complex`,children:`复杂`})]})]}),(0,D.jsx)(`div`,{className:`overflow-x-auto`,children:(0,D.jsxs)(`table`,{className:`w-full`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,D.jsx)(`th`,{className:`pb-3 font-medium`,children:`需求`}),(0,D.jsx)(`th`,{className:`pb-3 font-medium`,children:`项目`}),(0,D.jsx)(`th`,{className:`pb-3 font-medium`,children:`类型`}),(0,D.jsx)(`th`,{className:`pb-3 font-medium`,children:`复杂度`}),(0,D.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,D.jsx)(`th`,{className:`pb-3 font-medium`,children:`操作`})]})}),(0,D.jsx)(`tbody`,{className:`text-sm`,children:Z.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-gray-50 cursor-pointer`,onClick:()=>o(`/pipelines/${e.id}`),children:[(0,D.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.requirement}),(0,D.jsx)(`td`,{className:`py-3`,children:e.project}),(0,D.jsx)(`td`,{className:`py-3`,children:(0,D.jsxs)(`div`,{className:`space-y-1`,children:[(0,D.jsx)(y,{size:`sm`,variant:`primary`,children:`动态编排`}),e.nodeConfig&&(0,D.jsxs)(`div`,{className:`text-xs text-gray-500 space-y-0.5`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,D.jsx)(i,{className:`h-3 w-3`}),e.nodeConfig.totalNodes,` 节点`,e.nodeConfig.boundSkills.length>0&&(0,D.jsxs)(`span`,{className:`ml-1`,children:[`· ⚡ `,e.nodeConfig.boundSkills.length,` 技能`]})]}),(0,D.jsx)(`div`,{className:`text-gray-400 max-w-[200px] truncate`,children:e.nodeConfig.nodeTypes.map(e=>e.split(/[_\-.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)).join(` → `)})]})]})}),(0,D.jsx)(`td`,{className:`py-3`,children:(0,D.jsx)(y,{size:`sm`,variant:e.complexity===`complex`?`danger`:e.complexity===`moderate`?`warning`:`default`,children:e.complexity||`-`})}),(0,D.jsx)(`td`,{className:`py-3 text-gray-500`,children:c(g(e.createdAt),`MM-dd HH:mm`)}),(0,D.jsx)(`td`,{className:`py-3`,children:(0,D.jsx)(_,{variant:`ghost`,size:`sm`,icon:r,onClick:t=>{t.stopPropagation(),o(`/pipelines/${e.id}`)},children:`查看`})})]},e.id))})]})}),Q===0&&(0,D.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无历史记录`}),Q>0&&(0,D.jsx)(C,{currentPage:N,totalPages:pe,onPageChange:P,pageSize:F,onPageSizeChange:e=>{I(e),P(1)},totalItems:Q})]})]}),(0,D.jsx)(x,{open:V.open,title:V.title,description:V.description,count:V.count,variant:`danger`,onConfirm:V.onConfirm,onCancel:()=>H({...V,open:!1})})]})}export{O as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$n as t,$t as n,An as r,Bn as i,Bt as a,Dn as o,Ft as s,Gn as c,Gt as l,It as u,Mn as d,Qt as ee,Tn as te,Ut as ne,Vt as re,Wt as f,Zt as p,cn as ie,dr as m,er as h,lr as g,mr as _,or as v,qn as y,rn as ae,rr as b,s as x,tn as S,vn as C}from"./vendor-BpBCrKSP.js";import{c as oe,l as se}from"./vendor-react-CXfI0Tes.js";import{a as ce,n as w,r as T}from"./vendor-query-BF-uT_c5.js";import{c as E}from"./vendor-flow-D-_WxBha.js";import{A as le,L as ue,R as de,T as fe,Tt as pe,Ut as D,Wt as me,Y as O,Yt as k,d as A,dt as j,en as M,ft as N,j as P,mt as he,ut as ge,wt as _e,z as ve}from"./client-B_-7qCOP.js";import{a as ye,c as be,l as F,n as I,r as L,t as R}from"./ui-B2gvOcFY.js";import{t as xe}from"./Pagination-ooTI9JPa.js";import{t as Se}from"./Breadcrumb-DbDeWYcH.js";var z=e(_(),1),B=E(),Ce={spec:{label:`规格`,icon:r,color:`text-blue-600`,bg:`bg-blue-50`,border:`border-blue-200`},security:{label:`安全`,icon:p,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-200`},quality:{label:`质量`,icon:d,color:`text-purple-600`,bg:`bg-purple-50`,border:`border-purple-200`},test:{label:`测试`,icon:f,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-200`},performance:{label:`性能`,icon:s,color:`text-orange-600`,bg:`bg-orange-50`,border:`border-orange-200`}},V={fail:{label:`失败`,icon:c,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-300`},warn:{label:`警告`,icon:a,color:`text-yellow-600`,bg:`bg-yellow-50`,border:`border-yellow-300`},pass:{label:`通过`,icon:y,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-300`}};function we({level:e}){let t=V[e];if(!t)return(0,B.jsx)(R,{size:`sm`,children:e});let n=t.icon;return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,B.jsx)(n,{className:`h-3 w-3`}),t.label]})}function Te({category:e}){let t=Ce[e];if(!t)return(0,B.jsx)(R,{size:`sm`,children:e});let n=t.icon;return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,B.jsx)(n,{className:`h-3 w-3`}),t.label]})}function H(){let{encodedPath:e}=se(),c=oe(),d=ce(),[f,p]=(0,z.useState)(`sessions`),[_,v]=(0,z.useState)(!1),[y,S]=(0,z.useState)(``),[C,E]=(0,z.useState)(!1),[D,O]=(0,z.useState)(``),[k,A]=(0,z.useState)(null),[j,N]=(0,z.useState)(1),[P,Ce]=(0,z.useState)(20),[V,H]=(0,z.useState)(null),De=async e=>{try{let t=await he(e);await navigator.clipboard.writeText(t.data.context),H(e),M(`上下文已复制,请粘贴到 Claude Code 进行修复`,`success`),setTimeout(()=>H(null),3e3)}catch{M(`复制失败`,`error`)}},U=e?encodeURIComponent(e):``,{data:W,isLoading:Oe,isError:ke,error:Ae}=T({queryKey:[`project`,e],queryFn:()=>ge(U).then(e=>e.data),enabled:!!e}),{data:G}=T({queryKey:[`claudemd`,e],queryFn:()=>ue(U).then(e=>e.data),enabled:!!e&&f===`claudemd`}),{data:K}=T({queryKey:[`claudemd-modules`,e],queryFn:()=>de(U).then(e=>e.data),enabled:!!e&&f===`claudemd`}),je=w({mutationFn:()=>fe(U),onSuccess:()=>{d.invalidateQueries({queryKey:[`projects`]}),c(`/projects`)},onError:e=>M(e.message||`删除失败`,`error`)}),Me=w({mutationFn:e=>me(U,e),onSuccess:()=>{d.invalidateQueries({queryKey:[`claudemd`,e]}),E(!1)},onError:e=>M(e.message||`保存失败`,`error`)}),q=w({mutationFn:()=>le(U),onSuccess:t=>{d.invalidateQueries({queryKey:[`claudemd`,e]}),A({success:!0,message:t.data.distilled?`蒸馏完成,压缩 ${t.data.reduction}%(${t.data.before} → ${t.data.after} 字符):${t.data.summary}`:t.data.message??`无需蒸馏`})},onError:e=>{A({success:!1,message:e.message})}}),[J,Y]=(0,z.useState)(null),[Ne,Pe]=(0,z.useState)(!1),[Fe,Ie]=(0,z.useState)(!1),[X,Z]=(0,z.useState)(null),[Le,Re]=(0,z.useState)(!1),[Q,$]=(0,z.useState)(null);return ke?(0,B.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,Ae?.message||`未知错误`]}):Oe||!W?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,B.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})}):(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(Se,{items:[{label:`项目列表`,path:`/projects`},{label:W.projectName}]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,B.jsx)(I,{variant:`ghost`,size:`sm`,icon:g,onClick:()=>c(`/projects`),children:`返回`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50`,children:(0,B.jsx)(o,{className:`h-5 w-5 text-blue-600`})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:W.projectName}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:W.projectPath})]})]})]}),(0,B.jsx)(I,{variant:`danger`,size:`sm`,icon:ne,onClick:()=>v(!0),children:`删除项目`})]}),_&&(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,B.jsxs)(L,{className:`max-w-md`,children:[(0,B.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,B.jsx)(a,{className:`h-5 w-5`}),`危险操作:删除项目`]}),(0,B.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除项目 `,(0,B.jsx)(`strong`,{children:W.projectName}),` 的所有监控数据:`]}),(0,B.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,B.jsx)(`li`,{children:`所有会话记录`}),(0,B.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,B.jsx)(`li`,{children:`所有质量问题记录`}),(0,B.jsx)(`li`,{children:`所有事件日志`}),(0,B.jsx)(`li`,{children:`所有知识节点`})]}),(0,B.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,B.jsxs)(`div`,{className:`mb-4`,children:[(0,B.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入项目名称 `,(0,B.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:W.projectName}),` 以确认删除:`]}),(0,B.jsx)(`input`,{type:`text`,value:y,onChange:e=>S(e.target.value),placeholder:`输入项目名称`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,B.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>{v(!1),S(``)},children:`取消`}),(0,B.jsx)(I,{variant:`danger`,size:`sm`,disabled:y!==W.projectName,onClick:()=>{y===W.projectName&&(je.mutate(),v(!1),S(``))},children:`确认删除`})]})]})}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,B.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>p(`sessions`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(m,{className:`h-8 w-8 text-blue-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:W.sessions.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`会话`})]})]})}),(0,B.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>p(`pipelines`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(te,{className:`h-8 w-8 text-green-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:W.pipelines.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`Pipeline`})]})]})}),(0,B.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>p(`api`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(l,{className:`h-8 w-8 text-purple-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:W.events.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`事件`})]})]})}),(0,B.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>p(`quality`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(ee,{className:`h-8 w-8 text-orange-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:W.quality.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`质量`})]})]})}),(0,B.jsx)(L,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>p(`knowledge`),children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(b,{className:`h-8 w-8 text-pink-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:W.knowledge.total}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`知识`})]})]})})]}),(0,B.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit flex-wrap`,children:[{key:`sessions`,label:`会话`},{key:`pipelines`,label:`Pipeline`},{key:`quality`,label:`质量问题`},{key:`knowledge`,label:`知识文档`},{key:`rules`,label:`规则管理`},{key:`convention`,label:`自定义规范`},{key:`claudemd`,label:`CLAUDE.md`},{key:`environment`,label:`环境初始化`}].map(e=>(0,B.jsx)(`button`,{onClick:()=>p(e.key),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${f===e.key?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`}`,children:e.label},e.key))}),f===`sessions`&&(0,B.jsxs)(L,{children:[(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`会话 ID`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`首条对话`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`开始时间`})]})}),(0,B.jsx)(`tbody`,{className:`text-sm`,children:(()=>{let e=W.sessions.items;return Math.ceil(e.length/P),(0,B.jsxs)(B.Fragment,{children:[e.slice((j-1)*P,j*P).map(e=>(0,B.jsxs)(`tr`,{onClick:()=>c(`/sessions/${e.session_id}`,{state:{from:`/projects/${U}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,B.jsx)(`td`,{className:`py-3 font-mono text-xs`,children:e.session_id.slice(0,12)}),(0,B.jsx)(`td`,{className:`py-3 text-gray-700 max-w-md truncate`,title:e.first_requirement,children:e.first_requirement?e.first_requirement:`(无对话记录)`}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(R,{size:`sm`,className:be(e.status),children:e.status})}),(0,B.jsx)(`td`,{className:`py-3 text-gray-500`,children:x(F(e.start_time),`MM-dd HH:mm`)})]},e.session_id)),e.length===0&&(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:4,className:`py-8 text-center text-gray-400`,children:`暂无会话记录`})})]})})()})]})}),(()=>{let e=W.sessions.items,t=Math.ceil(e.length/P);return e.length>P?(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsx)(xe,{currentPage:j,totalPages:t,onPageChange:N,pageSize:P,onPageSizeChange:e=>{Ce(e),N(1)},totalItems:e.length})}):null})()]}),f===`pipelines`&&(0,B.jsx)(L,{children:(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`需求`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`阶段`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`})]})}),(0,B.jsx)(`tbody`,{className:`text-sm`,children:W.pipelines.items.map(e=>(0,B.jsxs)(`tr`,{onClick:()=>c(`/pipelines/${e.id}`,{state:{from:`/projects/${U}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,B.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.requirement}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(R,{size:`sm`,children:e.phase})}),(0,B.jsx)(`td`,{className:`py-3 text-gray-500`,children:x(F(e.updated_at),`MM-dd HH:mm`)})]},e.id))})]})})}),f===`quality`&&(0,B.jsxs)(L,{children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,B.jsxs)(`p`,{className:`text-sm text-gray-600`,children:[`共 `,W.quality.total,` 个质量问题`]})}),(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`问题`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`级别`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`分类`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,B.jsx)(`th`,{className:`pb-3 font-medium`})]})}),(0,B.jsx)(`tbody`,{className:`text-sm`,children:W.quality.items.map(e=>(0,B.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-blue-50 transition-colors`,children:[(0,B.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.message}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(we,{level:e.level})}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(Te,{category:e.category})}),(0,B.jsx)(`td`,{className:`py-3`,children:(0,B.jsx)(R,{size:`sm`,variant:e.resolved?`success`:`default`,children:e.resolved?`已解决`:`未解决`})}),(0,B.jsx)(`td`,{className:`py-3 text-gray-500`,children:x(F(e.created_at),`MM-dd HH:mm`)}),(0,B.jsx)(`td`,{className:`py-3`,children:!e.resolved&&(0,B.jsxs)(`button`,{onClick:()=>De(e.id),className:`flex items-center gap-1 px-2 py-1 text-xs text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors`,title:`复制上下文到剪贴板`,children:[V===e.id?(0,B.jsx)(h,{className:`h-3.5 w-3.5 text-green-500`}):(0,B.jsx)(i,{className:`h-3.5 w-3.5`}),V===e.id?`已复制`:`复制`]})})]},e.id))})]})})]}),f===`knowledge`&&(0,B.jsx)(L,{children:(0,B.jsx)(`div`,{className:`space-y-3`,children:W.knowledge.items.map(e=>(0,B.jsx)(`div`,{className:`p-4 border border-gray-100 rounded-lg hover:bg-blue-50 cursor-pointer transition-colors`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(r,{className:`h-5 w-5 text-blue-500 flex-shrink-0 mt-0.5`}),(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsx)(`h4`,{className:`font-medium text-gray-900 mb-1`,children:e.title}),(0,B.jsxs)(`p`,{className:`text-sm text-gray-600 line-clamp-2`,children:[e.content?.substring(0,150),`...`]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-gray-400`,children:[(0,B.jsx)(R,{size:`sm`,children:e.node_type}),(0,B.jsxs)(`span`,{children:[`更新于 `,x(F(e.updated_at),`MM-dd HH:mm`)]})]})]})]})},e.id))})}),f===`rules`&&(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(L,{title:`意图识别规则`,children:(0,B.jsx)(`div`,{className:`space-y-2`,children:W.rules.intentRules.slice(0,10).map(e=>(0,B.jsx)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(R,{size:`sm`,children:e.rule_type}),(0,B.jsx)(`code`,{className:`text-xs text-gray-600`,children:e.pattern})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3 mt-1 text-xs text-gray-400`,children:[(0,B.jsxs)(`span`,{children:[`命中 `,e.hit_count,` 次`]}),(0,B.jsxs)(`span`,{children:[`置信度 `,(e.confidence*100).toFixed(0),`%`]})]})]})},e.id))})}),(0,B.jsx)(L,{title:`任务模式`,children:(0,B.jsx)(`div`,{className:`space-y-2`,children:W.rules.taskPatterns.slice(0,10).map(e=>(0,B.jsxs)(`div`,{className:`p-3 border border-gray-100 rounded-lg`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,B.jsx)(R,{size:`sm`,children:e.task_type}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-500`,children:[(0,B.jsx)(re,{className:`h-3 w-3`}),(0,B.jsxs)(`span`,{children:[`效果 `,(e.effectiveness_score*100).toFixed(0),`%`]})]})]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-600 mb-1`,children:e.failure_pattern}),(0,B.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[`策略:`,e.prevention_strategy]})]},e.id))})})]}),f===`convention`&&e&&(0,B.jsx)(Ee,{encodedPath:U}),f===`claudemd`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(L,{children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(r,{className:`h-5 w-5 text-blue-500`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:`CLAUDE.md`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:G?.exists?`${(G.size/1024).toFixed(1)} KB · ${G.hasAutoSection?`含自动区块`:`纯用户内容`}`:`文件不存在`})]})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(I,{variant:`ghost`,size:`sm`,icon:ae,onClick:()=>d.invalidateQueries({queryKey:[`claudemd`,e]}),children:`刷新`}),G?.exists&&(0,B.jsx)(I,{variant:`secondary`,size:`sm`,icon:s,onClick:()=>{A(null),q.mutate()},disabled:q.isPending,title:`AI 蒸馏:压缩冗余内容,保留核心规范`,children:q.isPending?`蒸馏中...`:`蒸馏`}),G?.exists&&!C&&(0,B.jsx)(I,{size:`sm`,icon:ie,onClick:()=>{O(G.content||``),E(!0)},children:`编辑`})]})]})}),k&&(0,B.jsx)(L,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsx)(`p`,{className:`text-sm ${k.success?`text-gray-900`:`text-red-600`}`,children:k.message}),(0,B.jsx)(I,{variant:`ghost`,size:`sm`,icon:u,onClick:()=>A(null)})]})}),C&&(0,B.jsxs)(L,{children:[(0,B.jsx)(`textarea`,{className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-md font-mono h-96 resize-y`,value:D,onChange:e=>O(e.target.value)}),(0,B.jsxs)(`div`,{className:`flex gap-2 justify-end mt-3`,children:[(0,B.jsx)(I,{variant:`ghost`,size:`sm`,icon:u,onClick:()=>E(!1),children:`取消`}),(0,B.jsx)(I,{size:`sm`,icon:t,onClick:()=>Me.mutate(D),children:`保存`})]})]}),!C&&G?.exists&&(0,B.jsx)(L,{title:`内容预览`,children:(0,B.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 p-4 rounded-md overflow-auto max-h-96 whitespace-pre-wrap font-mono`,children:G.content})}),(0,B.jsx)(L,{title:`子模块 (${K?.total??0})`,children:K?.items.length===0?(0,B.jsx)(`p`,{className:`text-sm text-gray-400`,children:`未检测到子模块`}):(0,B.jsx)(`div`,{className:`space-y-2`,children:K?.items.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(o,{className:`h-4 w-4 text-gray-400`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.relativePath})]})]}),(0,B.jsx)(R,{size:`sm`,variant:e.hasClaudeMd?`success`:`default`,children:e.hasClaudeMd?`已有 CLAUDE.md`:`未生成`})]},e.path))})})]}),f===`environment`&&(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(L,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`font-medium text-gray-900 mb-1`,children:`环境检测 & 项目初始化`}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:`检测项目技术栈、创建 .claude-forge 目录、自动生成 CLAUDE.md(如不存在)`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2 flex-shrink-0`,children:[(0,B.jsx)(I,{variant:`secondary`,size:`sm`,icon:n,onClick:async()=>{Pe(!0),Y(null);try{Y((await ve(U)).data.profile)}catch(e){Y({error:String(e)})}finally{Pe(!1)}},disabled:Ne,children:Ne?`检测中...`:`环境检测`}),(0,B.jsx)(I,{size:`sm`,icon:s,onClick:async()=>{Ie(!0),Z(null);try{let t=await pe(U);Z({success:t.data.success,message:t.data.message,claudeMdGenerated:t.data.claudeMdGenerated}),Y(t.data.profile),d.invalidateQueries({queryKey:[`claudemd`,e]}),d.invalidateQueries({queryKey:[`project`,e]})}catch(e){Z({success:!1,message:String(e)})}finally{Ie(!1)}},disabled:Fe,children:Fe?`初始化中...`:`一键初始化`}),(0,B.jsx)(I,{size:`sm`,icon:r,onClick:async()=>{Re(!0),$(null);try{let t=await _e(U);$({success:t.data.success,message:t.data.message}),t.data.skipped||(d.invalidateQueries({queryKey:[`conventions`,e]}),d.invalidateQueries({queryKey:[`claudemd`,e]}))}catch(e){$({success:!1,message:String(e)})}finally{Re(!1)}},disabled:Le,children:Le?`生成中...`:`初始化规范`})]})]})}),X&&(0,B.jsx)(L,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[X.success?(0,B.jsx)(t,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,B.jsx)(u,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-sm font-medium ${X.success?`text-gray-900`:`text-red-600`}`,children:X.message}),X.claudeMdGenerated&&(0,B.jsx)(`p`,{className:`text-xs text-green-600 mt-0.5`,children:`CLAUDE.md 已自动生成`})]})]}),(0,B.jsx)(I,{variant:`ghost`,size:`sm`,icon:u,onClick:()=>Z(null)})]})}),Q&&(0,B.jsx)(L,{children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2`,children:[Q.success?(0,B.jsx)(t,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,B.jsx)(u,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,B.jsx)(`p`,{className:ye(`text-sm font-medium`,Q.success?`text-gray-900`:`text-red-600`),children:Q.message})]}),(0,B.jsx)(I,{variant:`ghost`,size:`sm`,icon:u,onClick:()=>$(null)})]})}),J&&!(`error`in J)&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(L,{title:`技术栈`,children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`项目名称`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.projectName})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`包管理器`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.packageManager||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`测试框架`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.testFramework||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`构建工具`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.buildTool||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Linter`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.linter||`未检测到`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Formatter`}),(0,B.jsx)(`p`,{className:`font-medium text-gray-900`,children:J.formatter||`未检测到`})]})]})}),J.languages.length>0&&(0,B.jsx)(L,{title:`检测到的语言`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:J.languages.map((e,t)=>(0,B.jsxs)(R,{size:`sm`,children:[e.name,e.version?` ${e.version}`:``]},t))})}),J.frameworks.length>0&&(0,B.jsx)(L,{title:`检测到的框架`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:J.frameworks.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-blue-50 rounded-md`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-blue-700`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-blue-400`,children:e.category})]},t))})}),Object.keys(J.scripts).length>0&&(0,B.jsx)(L,{title:`常用脚本`,children:(0,B.jsx)(`div`,{className:`space-y-1`,children:Object.entries(J.scripts).map(([e,t])=>(0,B.jsxs)(`div`,{className:`flex items-start gap-3 text-sm py-1 border-b border-gray-50 last:border-0`,children:[(0,B.jsx)(`span`,{className:`font-mono text-blue-600 flex-shrink-0 w-24`,children:e}),(0,B.jsx)(`span`,{className:`text-gray-600 font-mono text-xs break-all`,children:t})]},e))})}),J.keyDirectories.length>0&&(0,B.jsx)(L,{title:`关键目录`,children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:J.keyDirectories.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-gray-50 rounded-md`,children:[(0,B.jsx)(o,{className:`h-3.5 w-3.5 text-gray-400`}),(0,B.jsx)(`span`,{className:`text-sm text-gray-700 font-mono`,children:e})]},t))})})]}),J&&`error`in J&&(0,B.jsx)(L,{children:(0,B.jsxs)(`p`,{className:`text-sm text-red-600`,children:[`检测失败:`,J.error]})})]})]})}function Ee({encodedPath:e}){let[t,n]=(0,z.useState)(`bindings`),[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(``),[c,l]=(0,z.useState)(!1),d=ce(),{data:ee,isLoading:te}=T({queryKey:[`project-conventions`,e],queryFn:()=>j(e).then(e=>e.data)}),{data:ne}=T({queryKey:[`global-conventions`],queryFn:()=>O().then(e=>e.data),enabled:r}),{data:re}=T({queryKey:[`project-custom-yaml`,e],queryFn:()=>N(e).then(e=>e.data),enabled:c}),f=w({mutationFn:t=>A(e,t).then(e=>e.data),onSuccess:t=>{M(`已绑定:${t.convention.name}`,`success`),i(!1),d.invalidateQueries({queryKey:[`project-conventions`,e]})}}),p=w({mutationFn:t=>D(e,t).then(e=>e.data),onSuccess:()=>{M(`已解绑`,`success`),d.invalidateQueries({queryKey:[`project-conventions`,e]})}}),m=w({mutationFn:()=>P(e).then(e=>e.data),onSuccess:t=>{M(t.isIncremental?`增量蒸馏完成,版本 ${t.convention.version}`:`蒸馏完成,生成 ${t.convention.name}`,`success`),d.invalidateQueries({queryKey:[`project-conventions`,e]}),n(`custom`)}}),h=w({mutationFn:t=>k(e,t).then(e=>e.data),onSuccess:()=>{M(`保存成功`,`success`),l(!1),d.invalidateQueries({queryKey:[`project-conventions`,e]})}}),g=ee?.bindings||[],_=ee?.custom,y=(ne?.items||[]).filter(e=>!g.some(t=>t.id===e.id)),b={official:`bg-amber-50 text-amber-700`,user:`bg-blue-50 text-blue-700`,community:`bg-purple-50 text-purple-700`},x={official:`官方`,user:`用户`,community:`社区`};return te?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,B.jsx)(ae,{className:`h-6 w-6 animate-spin text-blue-500`})}):(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`div`,{className:`flex gap-1 bg-gray-100 rounded-lg p-1`,children:[`bindings`,`custom`].map(e=>(0,B.jsx)(`button`,{onClick:()=>n(e),className:`px-4 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-1.5 ${t===e?`bg-white text-gray-900 shadow-sm`:`text-gray-500 hover:text-gray-700`}`,children:e===`bindings`?`绑定的规范 (${g.length})`:(0,B.jsxs)(B.Fragment,{children:[`蒸馏规范`,_&&(0,B.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700`,children:`实际生效`})]})},e))}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[t===`bindings`&&(0,B.jsxs)(`button`,{onClick:()=>i(!r),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,B.jsx)(C,{className:`h-3.5 w-3.5`}),`绑定规范`]}),t===`custom`&&(0,B.jsxs)(`button`,{onClick:()=>m.mutate(),disabled:m.isPending||g.length===0,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,title:g.length===0?`请先绑定至少一个规范`:``,children:[(0,B.jsx)(s,{className:`h-3.5 w-3.5 ${m.isPending?`animate-pulse`:``}`}),m.isPending?`蒸馏中...`:_?`重新蒸馏`:`生成蒸馏规范`]})]})]}),r&&(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-blue-200 p-4 space-y-3`,children:[(0,B.jsx)(`div`,{className:`text-sm font-medium text-gray-700`,children:`从全局规范库选择绑定`}),y.length===0?(0,B.jsx)(`p`,{className:`text-sm text-gray-400`,children:`所有全局规范已全部绑定`}):(0,B.jsx)(`div`,{className:`grid gap-2`,children:y.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between p-3 bg-gray-50 rounded-lg`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full ${b[e.source]||`bg-gray-100 text-gray-600`}`,children:x[e.source]||e.source}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:e.description})]}),(0,B.jsx)(`button`,{onClick:()=>f.mutate(e.id),disabled:f.isPending,className:`px-3 py-1.5 text-xs bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:`绑定`})]},e.id))}),(0,B.jsx)(`button`,{onClick:()=>i(!1),className:`text-xs text-gray-400 hover:text-gray-600`,children:`关闭`})]}),t===`bindings`&&(0,B.jsx)(`div`,{className:`space-y-3`,children:g.length===0?(0,B.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,B.jsx)(v,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未绑定任何规范`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`点击「绑定规范」从全局规范库选择`})]}):g.map(e=>(0,B.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,B.jsx)(`span`,{className:`font-medium text-gray-900`,children:e.name}),(0,B.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full font-medium ${b[e.source]||`bg-gray-100 text-gray-600`}`,children:x[e.source]||e.source}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500`,children:e.description}),(0,B.jsxs)(`div`,{className:`flex gap-3 mt-2 text-xs text-gray-400`,children:[(0,B.jsxs)(`span`,{children:[e.roles?Object.keys(e.roles).length:0,` 个角色`]}),(0,B.jsxs)(`span`,{children:[e.quality_standards?.length||0,` 条质量标准`]})]})]}),(0,B.jsx)(`button`,{onClick:()=>p.mutate(e.id),disabled:p.isPending,className:`ml-4 p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`解绑`,children:(0,B.jsx)(u,{className:`h-4 w-4`})})]})},e.id))}),t===`custom`&&(0,B.jsx)(`div`,{className:`space-y-4`,children:_?(0,B.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-4 border-b border-gray-100`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`font-semibold text-gray-900`,children:_.name}),(0,B.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,_.version]}),(0,B.jsx)(`span`,{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-200`,children:`项目真实规范`})]}),(0,B.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:_.description})]}),!c&&(0,B.jsxs)(`button`,{onClick:()=>{o(re?.yaml||``),l(!0)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-gray-100 text-gray-700 hover:bg-gray-200 rounded-lg transition-colors`,children:[(0,B.jsx)(ie,{className:`h-3.5 w-3.5`}),`编辑 YAML`]})]}),(0,B.jsx)(`div`,{className:`p-5`,children:c?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(`textarea`,{value:a||re?.yaml||``,onChange:e=>o(e.target.value),rows:24,className:`w-full px-3 py-2 text-xs border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono`}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsxs)(`button`,{onClick:()=>h.mutate(a),disabled:h.isPending,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,B.jsx)(S,{className:`h-3.5 w-3.5`}),h.isPending?`保存中...`:`保存`]}),(0,B.jsx)(`button`,{onClick:()=>l(!1),className:`px-4 py-2 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}):(0,B.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[_.principles&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:`核心原则`}),(0,B.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 rounded-lg p-3 whitespace-pre-wrap border border-gray-100 max-h-48 overflow-y-auto`,children:typeof _.principles==`string`?_.principles:JSON.stringify(_.principles,null,2)})]}),_.quality_standards&&_.quality_standards.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:[`质量标准 (`,_.quality_standards.length,`)`]}),(0,B.jsxs)(`div`,{className:`space-y-1`,children:[_.quality_standards.slice(0,5).map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-gray-600`,children:[(0,B.jsx)(`span`,{className:`mt-0.5 px-1.5 py-0.5 rounded text-xs font-medium ${e.severity===`must`?`bg-red-50 text-red-600`:e.severity===`should`?`bg-yellow-50 text-yellow-600`:`bg-gray-100 text-gray-500`}`,children:e.severity||`rule`}),(0,B.jsx)(`span`,{children:e.rule||String(e)})]},t)),_.quality_standards.length>5&&(0,B.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[`...还有 `,_.quality_standards.length-5,` 条`]})]})]})]})})]}):(0,B.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,B.jsx)(s,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,B.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未生成蒸馏规范`}),(0,B.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:g.length>0?`点击「生成蒸馏规范」将绑定的规范融合为项目专属规范`:`请先绑定至少一个规范,再生成蒸馏规范`})]})})]})}export{H as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$t as t,Dn as n,In as r,It as i,Kt as ee,Qt as te,Tn as a,Un as ne,Ut as o,Yt as s,dr as c,en as l,mr as u,qt as re,rr as d,s as f,sr as p,ur as m}from"./vendor-BpBCrKSP.js";import{c as ie}from"./vendor-react-CXfI0Tes.js";import{a as ae,n as oe,r as h}from"./vendor-query-BF-uT_c5.js";import{c as g}from"./vendor-flow-D-_WxBha.js";import{T as _,en as v,n as y,pt as se}from"./client-B_-7qCOP.js";import{a as b,l as x,r as S,t as C}from"./ui-B2gvOcFY.js";import{t as w}from"./vendor-motion-BsfSkSjj.js";import{t as T}from"./exportCsv-CSExJI8h.js";import{t as E}from"./Pagination-ooTI9JPa.js";var D=e(u(),1),O=g();function k(){let e=ie(),u=ae(),[g,k]=(0,D.useState)(``),[A,j]=(0,D.useState)(1),[M,ce]=(0,D.useState)(12),[N,le]=(0,D.useState)(`lastActivity`),[P,F]=(0,D.useState)(!1),[I,L]=(0,D.useState)(!1),[R,z]=(0,D.useState)(null),[B,V]=(0,D.useState)(``),[H,U]=(0,D.useState)(``),[W,G]=(0,D.useState)(new Set),[ue,K]=(0,D.useState)(!1),[q,J]=(0,D.useState)(``),[Y,X]=(0,D.useState)(!1),{data:de}=h({queryKey:[`project-meta-all`],queryFn:()=>y.get(`/projects/meta/all`).then(e=>e.data),staleTime:3e4}),Z=de||{},Q=oe({mutationFn:({projectPath:e,meta:t})=>y.put(`/projects/${encodeURIComponent(e)}/meta`,t),onSuccess:()=>{u.invalidateQueries({queryKey:[`project-meta-all`]})},onError:e=>v(e.message||`操作失败`,`error`)}),fe=(e,t)=>{t.stopPropagation();let n=Z[e]||{notes:``,tags:[],archived:!1};V(n.notes),U(n.tags.join(`, `)),z(e)},pe=()=>{if(!R)return;let e=Z[R]||{notes:``,tags:[],archived:!1};Q.mutate({projectPath:R,meta:{notes:B.trim(),tags:H.split(`,`).map(e=>e.trim()).filter(Boolean),archived:e.archived}}),z(null)},me=(e,t)=>{t.stopPropagation();let n=Z[e]||{notes:``,tags:[],archived:!1};Q.mutate({projectPath:e,meta:{...n,archived:!n.archived}})},he=(e,t)=>{t.stopPropagation(),G(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ge=()=>{for(let e of W){let t=Z[e]||{notes:``,tags:[],archived:!1};Q.mutate({projectPath:e,meta:{...t,archived:!0}})}v(`已归档 ${W.size} 个项目`,`success`),G(new Set)},_e=async()=>{X(!0);let e=0;for(let t of W)try{await _(encodeURIComponent(t)),e++}catch{}X(!1),K(!1),J(``),G(new Set),u.invalidateQueries({queryKey:[`projects`]}),v(`已删除 ${e} 个项目`,`success`)},{data:ve,isLoading:ye}=h({queryKey:[`projects`],queryFn:()=>se({limit:1e3}).then(e=>e.data),refetchInterval:3e4});if(ye)return(0,O.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,O.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let be=ve?.items||[],xe=e=>{N===e?F(e=>!e):(le(e),F(!1)),j(1)},$=be.filter(e=>{if(Z[e.projectPath]?.archived&&!I)return!1;if(!g)return!0;let t=g.toLowerCase();return e.projectName.toLowerCase().includes(t)||e.projectPath.toLowerCase().includes(t)}).sort((e,t)=>{let n=0;return N===`name`?n=e.projectName.localeCompare(t.projectName):N===`lastActivity`?n=(e.lastActivity||``).localeCompare(t.lastActivity||``):N===`sessionCount`?n=e.sessionCount-t.sessionCount:N===`totalEvents`&&(n=e.totalEvents-t.totalEvents),P?n:-n}),Se=Math.ceil($.length/M),Ce=$.slice((A-1)*M,A*M);return(0,O.jsxs)(`div`,{className:`space-y-6`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`项目管理`}),(0,O.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`查看所有被 Forge 管理的项目`})]}),(0,O.jsx)(`div`,{className:`flex items-center gap-3`,children:W.size>0?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(C,{variant:`info`,children:[W.size,` 个已选`]}),(0,O.jsxs)(`button`,{onClick:ge,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,O.jsx)(m,{className:`h-4 w-4`}),`批量归档`]}),(0,O.jsxs)(`button`,{onClick:()=>K(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors`,children:[(0,O.jsx)(o,{className:`h-4 w-4`}),`批量删除`]}),(0,O.jsxs)(`button`,{onClick:()=>G(new Set),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,O.jsx)(i,{className:`h-4 w-4`}),`取消选择`]})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(C,{variant:`info`,children:[$.length,` 个项目`]}),(0,O.jsxs)(`button`,{onClick:()=>L(!I),className:b(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,I?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,O.jsx)(m,{className:`h-4 w-4`}),I?`隐藏归档`:`显示归档`]}),(0,O.jsxs)(`button`,{onClick:()=>{let e=[`项目名称`,`项目路径`,`会话数`,`Pipeline 数`,`质量问题数`,`总事件数`,`最近活动`],t=$.map(e=>[e.projectName,e.projectPath,e.sessionCount,e.pipelineCount,e.qualityIssueCount,e.totalEvents,e.lastActivity||``]);T(`projects-${new Date().toISOString().slice(0,10)}.csv`,e,t)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,O.jsx)(r,{className:`h-4 w-4`}),`导出 CSV`]})]})})]}),(0,O.jsx)(S,{children:(0,O.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,O.jsxs)(`div`,{className:`relative flex-1`,children:[(0,O.jsx)(l,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,O.jsx)(`input`,{type:`text`,placeholder:`搜索项目名称或路径...`,value:g,onChange:e=>{k(e.target.value),j(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,O.jsx)(`span`,{className:`text-gray-500`,children:`排序:`}),[{key:`name`,label:`名称`},{key:`lastActivity`,label:`活动时间`},{key:`sessionCount`,label:`会话数`},{key:`totalEvents`,label:`事件数`}].map(({key:e,label:t})=>(0,O.jsxs)(`button`,{onClick:()=>xe(e),className:b(`px-3 py-1.5 rounded-lg transition-colors flex items-center gap-1`,N===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:[t,N===e&&(0,O.jsx)(p,{className:b(`h-3 w-3`,P&&`rotate-180`)})]},e))]})]})}),(0,O.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Ce.map((r,i)=>{let o=r.projectPath,l=Z[o]||{notes:``,tags:[],archived:!1};return(0,O.jsx)(w.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:i*.03},children:(0,O.jsx)(S,{className:b(`!p-0 overflow-hidden cursor-pointer hover:shadow-md transition-shadow h-full flex flex-col`,l.archived&&`opacity-60`),onClick:()=>e(`/projects/${encodeURIComponent(o)}`),children:(0,O.jsxs)(`div`,{className:`p-4 flex-1 flex flex-col`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-3 mb-3`,children:[(0,O.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50 flex-shrink-0`,children:(0,O.jsx)(n,{className:`h-5 w-5 text-blue-600`})}),(0,O.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,O.jsx)(`h3`,{className:`font-semibold text-gray-900 truncate`,children:r.projectName}),l.archived&&(0,O.jsx)(m,{className:`h-3.5 w-3.5 text-gray-400 flex-shrink-0`})]}),(0,O.jsx)(`p`,{className:`text-xs text-gray-500 truncate`,children:o}),l.tags.length>0&&(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:l.tags.map(e=>(0,O.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-blue-50 text-blue-600 text-xs rounded`,children:[(0,O.jsx)(ee,{className:`h-2.5 w-2.5`}),e]},e))}),l.notes&&(0,O.jsx)(`p`,{className:`text-xs text-gray-400 mt-1 truncate`,children:l.notes})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[(0,O.jsx)(`button`,{onClick:e=>he(o,e),className:b(`p-1 rounded transition-colors`,W.has(o)?`text-blue-600`:`text-gray-300 hover:text-gray-500`),title:`选择`,children:W.has(o)?(0,O.jsx)(s,{className:`h-3.5 w-3.5`}):(0,O.jsx)(re,{className:`h-3.5 w-3.5`})}),(0,O.jsx)(`button`,{onClick:e=>me(o,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:l.archived?`取消归档`:`归档`,children:(0,O.jsx)(m,{className:`h-3.5 w-3.5`})}),(0,O.jsx)(`button`,{onClick:e=>fe(o,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:`项目设置`,children:(0,O.jsx)(t,{className:`h-3.5 w-3.5`})})]})]}),(0,O.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-sm flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,O.jsx)(c,{className:`h-4 w-4 flex-shrink-0`}),(0,O.jsxs)(`span`,{children:[r.sessionCount,` 会话`]})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,O.jsx)(a,{className:`h-4 w-4 flex-shrink-0`}),(0,O.jsxs)(`span`,{children:[r.pipelineCount,` Pipeline`]})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,O.jsx)(te,{className:`h-4 w-4 flex-shrink-0`}),(0,O.jsxs)(`span`,{children:[r.qualityIssueCount,` 质量`]})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,O.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}),(0,O.jsxs)(`span`,{children:[r.totalEvents,` 事件`]})]})]}),r.lastActivity&&(0,O.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-gray-400 mt-3 pt-3 border-t border-gray-100`,children:[(0,O.jsx)(ne,{className:`h-3 w-3 flex-shrink-0`}),(0,O.jsxs)(`span`,{children:[`最近活动:`,f(x(r.lastActivity),`MM-dd HH:mm`)]})]})]})})},o)})}),$.length===0&&(0,O.jsxs)(`div`,{className:`text-center py-12`,children:[(0,O.jsx)(n,{className:`h-12 w-12 text-gray-300 mx-auto mb-3`}),(0,O.jsx)(`p`,{className:`text-gray-500`,children:`暂无项目`}),(0,O.jsx)(`p`,{className:`text-sm text-gray-400 mt-1`,children:`在任意目录使用 Claude Code 后,项目将自动出现在这里`})]}),$.length>0&&(0,O.jsx)(E,{currentPage:A,totalPages:Se,onPageChange:j,pageSize:M,onPageSizeChange:e=>{ce(e),j(1)},totalItems:$.length}),ue&&(0,O.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:()=>{K(!1),J(``)},children:(0,O.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,O.jsx)(o,{className:`h-5 w-5`}),`危险操作:批量删除项目`]}),(0,O.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,O.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除 `,(0,O.jsxs)(`strong`,{children:[W.size,` 个项目`]}),` 的所有监控数据:`]}),(0,O.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,O.jsx)(`li`,{children:`所有会话记录`}),(0,O.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,O.jsx)(`li`,{children:`所有质量问题记录`}),(0,O.jsx)(`li`,{children:`所有事件日志`}),(0,O.jsx)(`li`,{children:`所有知识节点`})]}),(0,O.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,O.jsxs)(`div`,{className:`mb-4`,children:[(0,O.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入 `,(0,O.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:`删除`}),` 以确认批量删除:`]}),(0,O.jsx)(`input`,{type:`text`,value:q,onChange:e=>J(e.target.value),placeholder:`输入「删除」二字`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,O.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,O.jsx)(`button`,{onClick:()=>{K(!1),J(``)},className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,O.jsx)(`button`,{disabled:q!==`删除`||Y,onClick:_e,className:`px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed`,children:Y?`删除中...`:`确认删除`})]})]})}),R&&(0,O.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,onClick:()=>z(null),children:(0,O.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,O.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`项目设置`}),(0,O.jsx)(`button`,{onClick:()=>z(null),className:`text-gray-400 hover:text-gray-600`,children:(0,O.jsx)(i,{className:`h-5 w-5`})})]}),(0,O.jsx)(`p`,{className:`text-xs text-gray-500 mb-4 truncate`,children:R}),(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,O.jsx)(`input`,{type:`text`,value:H,onChange:e=>U(e.target.value),placeholder:`前端, 工具, 实验...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`备注`}),(0,O.jsx)(`textarea`,{value:B,onChange:e=>V(e.target.value),rows:3,placeholder:`项目说明、注意事项...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none`})]})]}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 mt-5`,children:[(0,O.jsx)(`button`,{onClick:()=>z(null),className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,O.jsx)(`button`,{onClick:pe,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700`,children:`保存`})]})]})})]})}export{k as default};
@@ -0,0 +1,3 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$n as t,An as n,Bn as r,Bt as i,En as a,Ft as o,Gn as s,In as ee,It as c,Mn as l,On as te,Qn as u,Wt as d,Xn as f,Zt as p,_n as ne,en as re,er as m,mr as h,qn as g,s as _}from"./vendor-BpBCrKSP.js";import{a as ie,n as v,r as y}from"./vendor-query-BF-uT_c5.js";import{c as b}from"./vendor-flow-D-_WxBha.js";import{Nt as ae,Pt as oe,St as se,c as ce,en as le,ht as ue,k as de,mt as fe,u as pe}from"./client-B_-7qCOP.js";import{a as x,l as S,n as C,r as w,t as T}from"./ui-B2gvOcFY.js";import{n as E,t as D}from"./vendor-motion-BsfSkSjj.js";import{t as me}from"./useDebounce-Bo1fLB5L.js";import{t as he}from"./ErrorState-HW0OjEYK.js";import{t as ge}from"./exportCsv-CSExJI8h.js";import{t as _e}from"./ConfirmDialog-CH1HyRaY.js";import{t as ve}from"./Pagination-ooTI9JPa.js";var O=e(h(),1),k=b(),A={spec:{label:`规格`,icon:n,color:`text-blue-600`,bg:`bg-blue-50`,border:`border-blue-200`},security:{label:`安全`,icon:p,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-200`},quality:{label:`质量`,icon:l,color:`text-purple-600`,bg:`bg-purple-50`,border:`border-purple-200`},test:{label:`测试`,icon:d,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-200`},performance:{label:`性能`,icon:o,color:`text-orange-600`,bg:`bg-orange-50`,border:`border-orange-200`}},j={fail:{label:`失败`,icon:s,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-300`},warn:{label:`警告`,icon:i,color:`text-yellow-600`,bg:`bg-yellow-50`,border:`border-yellow-300`},pass:{label:`通过`,icon:g,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-300`}};function M({level:e}){let t=j[e];if(!t)return(0,k.jsx)(T,{size:`sm`,children:e});let n=t.icon;return(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,k.jsx)(n,{className:`h-3 w-3`}),t.label]})}function N({category:e}){let t=A[e];if(!t)return(0,k.jsx)(T,{size:`sm`,children:e});let n=t.icon;return(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,k.jsx)(n,{className:`h-3 w-3`}),t.label]})}function P(){let e=ie(),[n,i]=(0,O.useState)(``),o=me(n),[s,l]=(0,O.useState)(``),[d,p]=(0,O.useState)(``),[h,b]=(0,O.useState)(``),[P,ye]=(0,O.useState)(``),[F,be]=(0,O.useState)(!1),[I,L]=(0,O.useState)(1),[R,xe]=(0,O.useState)(20),[z,B]=(0,O.useState)(null),[V,H]=(0,O.useState)(null),[U,W]=(0,O.useState)(new Set),[G,Se]=(0,O.useState)(`list`),[Ce,we]=(0,O.useState)(new Set),[K,q]=(0,O.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:Te,isError:Ee,refetch:De}=y({queryKey:[`quality-unresolved`],queryFn:()=>se().then(e=>e.data),refetchInterval:1e4}),{data:Oe}=y({queryKey:[`quality-history`,s,d,h,P,o],queryFn:()=>ue({limit:500,level:s||void 0,category:d||void 0,resolved:h===`resolved`?!0:h===`unresolved`?!1:void 0,project_path:P||void 0,search:o||void 0}).then(e=>e.data)}),{data:J}=y({queryKey:[`quality-history`,`all`],queryFn:()=>ue({limit:500}).then(e=>e.data)}),Y=v({mutationFn:e=>oe(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),X=v({mutationFn:e=>de(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),ke=v({mutationFn:()=>ae(),onSuccess:()=>{e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),Ae=v({mutationFn:e=>ce(e),onSuccess:t=>{W(new Set),e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]}),t.failed.length>0&&alert(`忽略完成:成功 ${t.success.length} 个,失败 ${t.failed.length} 个\n失败原因:\n${t.errors.map(e=>`${e.id}: ${e.reason}`).join(`
2
+ `)}`)}}),je=v({mutationFn:e=>pe(e),onSuccess:t=>{W(new Set),e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]}),t.failed.length>0&&alert(`解决完成:成功 ${t.success.length} 个,失败 ${t.failed.length} 个\n失败原因:\n${t.errors.map(e=>`${e.id}: ${e.reason}`).join(`
3
+ `)}`)}}),Me=async e=>{try{let t=await fe(e);await navigator.clipboard.writeText(t.data.context),H(e),le(`上下文已复制,请粘贴到 Claude Code 进行修复`,`success`),setTimeout(()=>H(null),3e3)}catch{le(`复制失败`,`error`)}},Z=Oe?.items||[],Ne=Z.reduce((e,t)=>{let n=t.project_path?.split(`/`).pop()||`未知项目`;return e[n]||(e[n]=[]),e[n].push(t),e},{}),Pe=Math.ceil(Z.length/R),Fe=Z.slice((I-1)*R,I*R),Ie=J?.total||0,Q=Te?.total||0,Le=Z.filter(e=>e.level===`fail`).length,Re=Z.filter(e=>e.level===`warn`).length,ze=Array.from(new Set(J?.items.map(e=>e.level)||[])),Be=Array.from(new Set(J?.items.map(e=>e.category)||[])),Ve=Array.from(new Set(J?.items.map(e=>e.project_path?.split(`/`).pop()||``).filter(Boolean)||[])),$=[s,d,h,P].filter(Boolean).length,He=()=>{let e=[`级别`,`类别`,`消息`,`项目`,`状态`,`创建时间`],t=Z.map(e=>[e.level,e.category,e.message,e.project_path?.split(`/`).pop()||``,e.resolved?`已解决`:`未解决`,e.created_at?_(S(e.created_at),`yyyy-MM-dd HH:mm:ss`):``]);ge(`quality-issues-${_(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)};return Ee?(0,k.jsx)(he,{message:`质量数据加载失败`,onRetry:()=>De()}):(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsx)(w,{children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,k.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,k.jsxs)(`div`,{className:`relative flex-1`,children:[(0,k.jsx)(re,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,k.jsx)(`input`,{type:`text`,placeholder:`搜索问题描述...`,value:n,onChange:e=>{i(e.target.value),L(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,k.jsxs)(`button`,{onClick:()=>be(e=>!e),className:x(`flex items-center gap-1.5 px-3 py-2 text-sm rounded-lg border transition-colors`,F||$>0?`border-blue-300 bg-blue-50 text-blue-700`:`border-gray-200 text-gray-600 hover:bg-gray-50`),children:[(0,k.jsx)(a,{className:`h-4 w-4`}),`筛选`,$>0&&(0,k.jsx)(`span`,{className:`ml-1 px-1.5 py-0.5 bg-blue-600 text-white text-xs rounded-full`,children:$}),(0,k.jsx)(u,{className:x(`h-3.5 w-3.5 transition-transform`,F&&`rotate-180`)})]}),(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[U.size>0&&(0,k.jsxs)(C,{variant:`secondary`,size:`sm`,icon:t,onClick:()=>q({open:!0,title:`批量解决问题`,description:`确认将选中的 ${U.size} 个问题标记为已解决?`,count:U.size,onConfirm:()=>{je.mutate(Array.from(U)),q(e=>({...e,open:!1}))}}),loading:je.isPending,children:[`解决 (`,U.size,`)`]}),U.size>0&&(0,k.jsxs)(C,{variant:`secondary`,size:`sm`,icon:c,onClick:()=>q({open:!0,title:`批量忽略问题`,description:`确认忽略选中的 ${U.size} 个问题?`,count:U.size,onConfirm:()=>{Ae.mutate(Array.from(U)),q(e=>({...e,open:!1}))}}),loading:Ae.isPending,children:[`忽略 (`,U.size,`)`]}),Q>0&&(0,k.jsx)(C,{variant:`primary`,size:`sm`,icon:t,onClick:()=>q({open:!0,title:`全部标记已修复`,description:`确认将 ${Q} 个问题全部标记为已修复?`,onConfirm:()=>{ke.mutate(),q(e=>({...e,open:!1}))}}),loading:ke.isPending,children:`全部已修复`}),(0,k.jsx)(C,{variant:`secondary`,size:`sm`,icon:ee,onClick:()=>Z.length>0&&He(),children:`导出`}),(0,k.jsxs)(`div`,{className:`flex border border-gray-200 rounded-lg overflow-hidden`,children:[(0,k.jsx)(`button`,{onClick:()=>Se(`list`),className:x(`px-2.5 py-1.5 text-sm transition-colors flex items-center gap-1`,G===`list`?`bg-blue-50 text-blue-700`:`text-gray-600 hover:bg-gray-50`),title:`列表视图`,children:(0,k.jsx)(ne,{className:`h-4 w-4`})}),(0,k.jsx)(`button`,{onClick:()=>Se(`group`),className:x(`px-2.5 py-1.5 text-sm transition-colors flex items-center gap-1`,G===`group`?`bg-blue-50 text-blue-700`:`text-gray-600 hover:bg-gray-50`),title:`按项目分组`,children:(0,k.jsx)(te,{className:`h-4 w-4`})})]})]})]}),F&&(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-3 pt-2 border-t border-gray-100`,children:[(0,k.jsxs)(`select`,{value:s,onChange:e=>{l(e.target.value),L(1)},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,k.jsx)(`option`,{value:``,children:`全部级别`}),ze.map(e=>(0,k.jsx)(`option`,{value:e,children:j[e]?.label||e},e))]}),(0,k.jsxs)(`select`,{value:d,onChange:e=>{p(e.target.value),L(1)},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,k.jsx)(`option`,{value:``,children:`全部类别`}),Be.map(e=>(0,k.jsx)(`option`,{value:e,children:A[e]?.label||e},e))]}),(0,k.jsxs)(`select`,{value:h,onChange:e=>{b(e.target.value),L(1)},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,k.jsx)(`option`,{value:``,children:`全部状态`}),(0,k.jsx)(`option`,{value:`resolved`,children:`已解决`}),(0,k.jsx)(`option`,{value:`unresolved`,children:`未解决`})]}),(0,k.jsxs)(`select`,{value:P,onChange:e=>{ye(e.target.value),L(1)},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,k.jsx)(`option`,{value:``,children:`全部项目`}),Ve.map(e=>(0,k.jsx)(`option`,{value:e,children:e},e))]})]})]})}),(0,k.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,k.jsxs)(w,{className:`text-center`,children:[(0,k.jsx)(`div`,{className:`text-3xl font-bold text-red-600`,children:Le}),(0,k.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`失败`})]}),(0,k.jsxs)(w,{className:`text-center`,children:[(0,k.jsx)(`div`,{className:`text-3xl font-bold text-amber-600`,children:Re}),(0,k.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`警告`})]}),(0,k.jsxs)(w,{className:`text-center`,children:[(0,k.jsx)(`div`,{className:`text-3xl font-bold text-orange-600`,children:Q}),(0,k.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`未解决`})]}),(0,k.jsxs)(w,{className:`text-center`,children:[(0,k.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:Ie}),(0,k.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`总检查`})]})]}),(0,k.jsxs)(w,{title:`问题列表 (${Z.length})`,action:Z.length>0?(0,k.jsx)(`button`,{onClick:()=>{let e=G===`list`?Fe.filter(e=>!e.resolved).map(e=>String(e.id)):Z.filter(e=>!e.resolved).map(e=>String(e.id));U.size===e.length&&e.length>0?W(new Set):W(new Set(e))},className:`text-xs text-blue-600 hover:underline`,children:U.size>0?`取消全选`:G===`list`?`全选当前页未解决`:`全选所有未解决`}):void 0,children:[G===`list`?(0,k.jsx)(`div`,{className:`space-y-2`,children:Fe.map((e,n)=>{let i=z===String(e.id||n);return(0,k.jsxs)(`div`,{className:`rounded-lg border border-gray-100 overflow-hidden`,children:[(0,k.jsxs)(D.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.02},className:x(`flex items-center gap-3 p-4 cursor-pointer transition-all`,U.has(String(e.id))?`bg-blue-50`:`hover:bg-gray-50`),onClick:()=>B(i?null:String(e.id||n)),children:[e.resolved?(0,k.jsx)(`div`,{className:`h-4 w-4 flex-shrink-0`}):(0,k.jsx)(`input`,{type:`checkbox`,checked:U.has(String(e.id)),onChange:t=>{t.stopPropagation(),W(t=>{let n=new Set(t);return n.has(String(e.id))?n.delete(String(e.id)):n.add(String(e.id)),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0`}),(0,k.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 md:grid-cols-5 gap-3 items-center min-w-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,k.jsx)(M,{level:e.level}),(0,k.jsx)(N,{category:e.category})]}),(0,k.jsx)(`div`,{className:`md:col-span-2 min-w-0`,children:(0,k.jsx)(`p`,{className:`text-sm text-gray-700 truncate`,children:e.message})}),(0,k.jsx)(`div`,{className:`text-sm text-gray-500 truncate`,children:e.project_path?.split(`/`).pop()||`-`}),(0,k.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,k.jsx)(T,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),(0,k.jsx)(`span`,{className:`text-xs text-gray-400 flex-shrink-0`,children:e.created_at?_(S(e.created_at),`MM-dd HH:mm`):``}),i?(0,k.jsx)(u,{className:`h-4 w-4 text-gray-400 flex-shrink-0`}):(0,k.jsx)(f,{className:`h-4 w-4 text-gray-400 flex-shrink-0`})]})]})]}),(0,k.jsx)(E,{children:i&&(0,k.jsx)(D.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,k.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 p-4 space-y-2 text-sm`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`完整消息:`}),(0,k.jsx)(`p`,{className:`text-gray-700 mt-1 break-words`,children:e.message})]}),e.project_path&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`项目路径:`}),(0,k.jsx)(`span`,{className:`text-gray-700 ml-1 font-mono text-xs break-all`,children:e.project_path})]}),(0,k.jsxs)(`div`,{className:`flex gap-6`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`创建时间:`}),(0,k.jsx)(`span`,{className:`text-gray-700 ml-1`,children:e.created_at?_(S(e.created_at),`yyyy-MM-dd HH:mm:ss`):`-`})]}),e.resolved_at&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`解决时间:`}),(0,k.jsx)(`span`,{className:`text-gray-700 ml-1`,children:_(S(e.resolved_at),`yyyy-MM-dd HH:mm:ss`)})]})]}),!e.resolved&&(0,k.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,k.jsx)(C,{variant:`ghost`,size:`sm`,icon:V===String(e.id)?m:r,onClick:t=>{t.stopPropagation(),Me(String(e.id))},children:V===String(e.id)?`已复制`:`复制上下文`}),(0,k.jsx)(C,{variant:`ghost`,size:`sm`,icon:t,onClick:t=>{t.stopPropagation(),Y.mutate(String(e.id))},loading:Y.isPending,children:`标记已修复`}),(0,k.jsx)(C,{variant:`ghost`,size:`sm`,icon:c,onClick:t=>{t.stopPropagation(),X.mutate(String(e.id))},loading:X.isPending,children:`忽略`})]})]})})})]},e.id||n)})}):(0,k.jsx)(`div`,{className:`space-y-3`,children:Object.entries(Ne).map(([e,n])=>{let i=Ce.has(e),a=n.filter(e=>!e.resolved).length;return(0,k.jsxs)(`div`,{className:`border border-gray-200 rounded-lg overflow-hidden`,children:[(0,k.jsx)(`div`,{className:`flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors`,onClick:()=>we(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i?(0,k.jsx)(u,{className:`h-4 w-4 text-gray-500`}):(0,k.jsx)(f,{className:`h-4 w-4 text-gray-500`}),(0,k.jsx)(`span`,{className:`font-medium text-gray-900`,children:e}),(0,k.jsxs)(T,{size:`sm`,children:[n.length,` 个问题`]}),a>0&&(0,k.jsxs)(T,{size:`sm`,variant:`warning`,children:[a,` 未解决`]})]})}),(0,k.jsx)(E,{children:i&&(0,k.jsx)(D.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,k.jsx)(`div`,{className:`divide-y divide-gray-100`,children:n.map((e,n)=>{let i=z===String(e.id||n);return(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(D.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:n*.01},className:x(`flex items-center gap-3 p-3 cursor-pointer transition-all`,U.has(String(e.id))?`bg-blue-50`:`hover:bg-gray-50`),onClick:()=>B(i?null:String(e.id||n)),children:[e.resolved?(0,k.jsx)(`div`,{className:`h-4 w-4 flex-shrink-0`}):(0,k.jsx)(`input`,{type:`checkbox`,checked:U.has(String(e.id)),onChange:t=>{t.stopPropagation(),W(t=>{let n=new Set(t);return n.has(String(e.id))?n.delete(String(e.id)):n.add(String(e.id)),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0`}),(0,k.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 md:grid-cols-4 gap-3 items-center min-w-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,k.jsx)(M,{level:e.level}),(0,k.jsx)(N,{category:e.category})]}),(0,k.jsx)(`div`,{className:`md:col-span-2 min-w-0`,children:(0,k.jsx)(`p`,{className:`text-sm text-gray-700 truncate`,children:e.message})}),(0,k.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,k.jsx)(T,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),(0,k.jsx)(`span`,{className:`text-xs text-gray-400 flex-shrink-0`,children:e.created_at?_(S(e.created_at),`MM-dd HH:mm`):``}),i?(0,k.jsx)(u,{className:`h-4 w-4 text-gray-400 flex-shrink-0`}):(0,k.jsx)(f,{className:`h-4 w-4 text-gray-400 flex-shrink-0`})]})]})]}),(0,k.jsx)(E,{children:i&&(0,k.jsx)(D.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,k.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 p-4 space-y-2 text-sm`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`完整消息:`}),(0,k.jsx)(`p`,{className:`text-gray-700 mt-1 break-words`,children:e.message})]}),e.project_path&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`项目路径:`}),(0,k.jsx)(`span`,{className:`text-gray-700 ml-1 font-mono text-xs break-all`,children:e.project_path})]}),(0,k.jsxs)(`div`,{className:`flex gap-6`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`创建时间:`}),(0,k.jsx)(`span`,{className:`text-gray-700 ml-1`,children:e.created_at?_(S(e.created_at),`yyyy-MM-dd HH:mm:ss`):`-`})]}),e.resolved_at&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`解决时间:`}),(0,k.jsx)(`span`,{className:`text-gray-700 ml-1`,children:_(S(e.resolved_at),`yyyy-MM-dd HH:mm:ss`)})]})]}),!e.resolved&&(0,k.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,k.jsx)(C,{variant:`ghost`,size:`sm`,icon:V===String(e.id)?m:r,onClick:t=>{t.stopPropagation(),Me(String(e.id))},children:V===String(e.id)?`已复制`:`复制上下文`}),(0,k.jsx)(C,{variant:`ghost`,size:`sm`,icon:t,onClick:t=>{t.stopPropagation(),Y.mutate(String(e.id))},loading:Y.isPending,children:`标记已修复`}),(0,k.jsx)(C,{variant:`ghost`,size:`sm`,icon:c,onClick:t=>{t.stopPropagation(),X.mutate(String(e.id))},loading:X.isPending,children:`忽略`})]})]})})})]},e.id||n)})})})})]},e)})}),Z.length===0&&(0,k.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,k.jsx)(g,{className:`h-12 w-12 mx-auto mb-3 text-green-300`}),`没有符合条件的记录`]}),Z.length>0&&G===`list`&&(0,k.jsx)(ve,{currentPage:I,totalPages:Pe,onPageChange:L,pageSize:R,onPageSizeChange:e=>{xe(e),L(1)},totalItems:Z.length})]}),(0,k.jsx)(_e,{open:K.open,title:K.title,description:K.description,count:K.count,variant:`warning`,onConfirm:K.onConfirm,onCancel:()=>q({...K,open:!1})})]})}export{P as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Gt as t,Lt as n,Qn as r,Un as i,Xn as a,en as o,jn as s,lr as c,mr as l,s as u}from"./vendor-BpBCrKSP.js";import{S as d,d as f,f as p,g as m,l as h,m as g,p as _,s as v,y}from"./vendor-charts-BXsEmmv5.js";import{c as b,l as x,s as S}from"./vendor-react-CXfI0Tes.js";import{r as C}from"./vendor-query-BF-uT_c5.js";import{c as w}from"./vendor-flow-D-_WxBha.js";import{_t as T}from"./client-B_-7qCOP.js";import{a as E,l as D,n as O,o as k,r as A,t as j}from"./ui-B2gvOcFY.js";import{t as M}from"./vendor-motion-BsfSkSjj.js";import{t as N}from"./Breadcrumb-DbDeWYcH.js";var P=e(l(),1),F=w();function I(){let{id:e}=x(),l=b(),w=S(),[I,L]=(0,P.useState)(null),[R,z]=(0,P.useState)(`phases`),B=w.state?.from||`/sessions`,{data:V,isLoading:H,isError:U,error:W}=C({queryKey:[`session`,e],queryFn:()=>T(e).then(e=>e.data),enabled:!!e});if(U)return(0,F.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,W?.message||`未知错误`]});if(H||!V)return(0,F.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,F.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let{session:G,phases:K,dataFlow:q,timeline:J,stats:Y}=V,X=Object.entries(Y.toolUsage).sort((e,t)=>t[1]-e[1]).slice(0,12).map(([e,t])=>({name:e,value:t}));return(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(N,{items:[{label:`会话列表`,path:`/sessions`},{label:G.session_id.slice(0,8)+`...`}]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsx)(O,{variant:`ghost`,size:`sm`,icon:c,onClick:()=>l(B),children:`返回`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:`会话详情`}),(0,F.jsx)(`p`,{className:`text-sm text-gray-500 font-mono`,children:G.session_id})]}),(0,F.jsx)(j,{variant:G.status===`active`?`success`:`info`,children:G.status})]}),V.pipeline&&(0,F.jsx)(O,{variant:`secondary`,size:`sm`,onClick:()=>l(`/pipelines/${V.pipeline.id}`,{state:{from:B}}),children:`查看关联 Pipeline`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(i,{className:`h-5 w-5 text-blue-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:k(Y.duration)}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`持续时间`})]}),(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(n,{className:`h-5 w-5 text-green-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:Y.totalEvents}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`总事件数`})]}),(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(s,{className:`h-5 w-5 text-purple-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:Y.writeOps}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`写入操作`})]}),(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(o,{className:`h-5 w-5 text-orange-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:Y.readOps}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`读取操作`})]}),(0,F.jsxs)(A,{className:`text-center !p-4`,children:[(0,F.jsx)(t,{className:`h-5 w-5 text-red-500 mx-auto mb-2`}),(0,F.jsx)(`div`,{className:`text-xl font-bold`,children:K.length}),(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:`交互轮次`})]})]}),(0,F.jsx)(A,{title:`事件密度时间线`,children:(0,F.jsx)(d,{width:`100%`,height:120,children:(0,F.jsxs)(v,{data:J,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`timelineGrad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`5%`,stopColor:`#3b82f6`,stopOpacity:.4}),(0,F.jsx)(`stop`,{offset:`95%`,stopColor:`#3b82f6`,stopOpacity:0})]})}),(0,F.jsx)(m,{strokeDasharray:`3 3`,stroke:`#e5e7eb`}),(0,F.jsx)(p,{dataKey:`time`,tick:!1}),(0,F.jsx)(f,{hide:!0}),(0,F.jsx)(y,{formatter:e=>[`${e} 事件`,`数量`]}),(0,F.jsx)(g,{type:`monotone`,dataKey:`count`,stroke:`#3b82f6`,fill:`url(#timelineGrad)`})]})})}),(0,F.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit`,children:[`phases`,`flow`,`events`].map(e=>(0,F.jsx)(`button`,{onClick:()=>z(e),className:E(`px-4 py-2 rounded-md text-sm font-medium transition-colors`,R===e?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`),children:{phases:`阶段视图`,flow:`数据流图`,events:`事件列表`}[e]},e))}),R===`phases`&&(0,F.jsx)(`div`,{className:`space-y-3`,children:K.map((e,t)=>(0,F.jsx)(M.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.05},children:(0,F.jsxs)(A,{className:`!p-0 overflow-hidden`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between p-4 cursor-pointer hover:bg-gray-50 transition-colors`,onClick:()=>L(I===t?null:t),children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 text-white font-bold text-sm`,children:t+1}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-semibold text-gray-900`,children:e.name}),(0,F.jsxs)(`div`,{className:`text-sm text-gray-500`,children:[e.toolCalls,` 工具调用 · `,e.writeOps,` 写入 · `,e.artifacts.length,` 产物`]})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[e.duration&&(0,F.jsx)(`span`,{className:`text-sm text-gray-500`,children:k(e.duration)}),(0,F.jsxs)(`div`,{className:`flex gap-1`,children:[e.artifacts.slice(0,3).map((e,t)=>(0,F.jsx)(j,{variant:`success`,size:`sm`,children:e},t)),e.artifacts.length>3&&(0,F.jsxs)(j,{variant:`default`,size:`sm`,children:[`+`,e.artifacts.length-3]})]}),I===t?(0,F.jsx)(r,{className:`h-5 w-5 text-gray-400`}):(0,F.jsx)(a,{className:`h-5 w-5 text-gray-400`})]})]}),I===t&&(0,F.jsx)(M.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},className:`border-t border-gray-100`,children:(0,F.jsx)(`div`,{className:`p-4 max-h-96 overflow-y-auto space-y-2`,children:e.events.map((e,t)=>(0,F.jsxs)(`div`,{className:`flex items-start gap-3 text-sm`,children:[(0,F.jsx)(`div`,{className:`text-gray-400 font-mono w-20 flex-shrink-0`,children:u(D(e.time),`HH:mm:ss`)}),(0,F.jsx)(j,{size:`sm`,variant:e.hookType===`PostToolUse`?`success`:e.hookType===`PreToolUse`?`info`:e.hookType===`UserPromptSubmit`?`warning`:`default`,children:e.hookType}),e.toolName&&(0,F.jsx)(`span`,{className:`font-mono text-gray-700 font-medium`,children:e.toolName}),e.input&&(0,F.jsx)(`span`,{className:`text-gray-500 truncate max-w-md`,children:e.input})]},t))})})]})},t))}),R===`flow`&&(0,F.jsx)(A,{title:`数据流图 (${q.nodes.length} 节点)`,children:(0,F.jsx)(`div`,{className:`space-y-1 max-h-[600px] overflow-y-auto`,children:q.nodes.map((e,t)=>(0,F.jsxs)(M.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:t*.02},className:`flex items-center gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col items-center w-8`,children:[t>0&&(0,F.jsx)(`div`,{className:`w-0.5 h-3 bg-gray-300`}),(0,F.jsx)(`div`,{className:E(`w-3 h-3 rounded-full border-2`,e.type===`intent`?`bg-blue-500 border-blue-500`:e.type===`artifact`?`bg-green-500 border-green-500`:e.type===`quality`?`bg-yellow-500 border-yellow-500`:`bg-gray-400 border-gray-400`)}),t<q.nodes.length-1&&(0,F.jsx)(`div`,{className:`w-0.5 h-3 bg-gray-300`})]}),(0,F.jsxs)(`div`,{className:E(`flex-1 flex items-center gap-3 p-2 rounded-lg text-sm`,e.type===`intent`?`bg-blue-50`:e.type===`artifact`?`bg-green-50`:e.type===`quality`?`bg-yellow-50`:`bg-gray-50`),children:[(0,F.jsx)(`span`,{className:`font-mono text-xs text-gray-400`,children:u(D(e.time),`HH:mm:ss`)}),(0,F.jsx)(j,{size:`sm`,variant:e.type===`intent`?`info`:e.type===`artifact`?`success`:e.type===`quality`?`warning`:`default`,children:e.label}),e.detail&&(0,F.jsx)(`span`,{className:`text-gray-600 truncate`,children:e.detail})]})]},e.id))})}),R===`events`&&(0,F.jsx)(A,{title:`全部事件 (${V.events.length})`,children:(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(`table`,{className:`w-full`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,F.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,F.jsx)(`th`,{className:`pb-3 font-medium`,children:`类型`}),(0,F.jsx)(`th`,{className:`pb-3 font-medium`,children:`工具`}),(0,F.jsx)(`th`,{className:`pb-3 font-medium`,children:`详情`})]})}),(0,F.jsx)(`tbody`,{className:`text-sm`,children:V.events.map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-gray-50`,children:[(0,F.jsx)(`td`,{className:`py-2 font-mono text-gray-500`,children:u(D(e.timestamp),`HH:mm:ss`)}),(0,F.jsx)(`td`,{className:`py-2`,children:(0,F.jsx)(j,{size:`sm`,variant:e.hook_type===`PostToolUse`?`success`:e.hook_type===`UserPromptSubmit`?`warning`:`default`,children:e.hook_type})}),(0,F.jsx)(`td`,{className:`py-2 font-mono`,children:e.tool_name||`-`}),(0,F.jsx)(`td`,{className:`py-2 text-gray-500 truncate max-w-md`,children:typeof e.tool_input==`string`?e.tool_input.slice(0,80):``})]},e.id))})]})})}),(0,F.jsx)(A,{title:`工具使用分布`,children:(0,F.jsx)(d,{width:`100%`,height:250,children:(0,F.jsxs)(h,{data:X,layout:`vertical`,children:[(0,F.jsx)(m,{strokeDasharray:`3 3`,stroke:`#e5e7eb`}),(0,F.jsx)(p,{type:`number`}),(0,F.jsx)(f,{dataKey:`name`,type:`category`,width:80,tick:{fontSize:12}}),(0,F.jsx)(y,{}),(0,F.jsx)(_,{dataKey:`value`,fill:`#3b82f6`,radius:[0,4,4,0]})]})})})]})}export{I as default};
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{En as t,In as n,Nn as r,Qn as i,Un as a,Ut as o,dr as s,en as c,mr as l,nr as u,o as d,s as f,sr as p,ur as ee}from"./vendor-BpBCrKSP.js";import{c as te}from"./vendor-react-CXfI0Tes.js";import{a as ne,n as m,r as h,t as g}from"./vendor-query-BF-uT_c5.js";import{c as _}from"./vendor-flow-D-_WxBha.js";import{E as v,Xt as y,o as b,vt as x}from"./client-B_-7qCOP.js";import{a as S,l as C,n as w,r as T,t as E}from"./ui-B2gvOcFY.js";import{t as re}from"./ErrorState-HW0OjEYK.js";import{t as ie}from"./exportCsv-CSExJI8h.js";import{t as ae}from"./ConfirmDialog-CH1HyRaY.js";import{t as oe}from"./useSmartPolling-DYAVOihL.js";import{i as se,r as ce,t as le}from"./BatchProgress-CIrC9RcC.js";var D=e(l(),1),O=_();function k(e,t){let n=t.getTime()-e.getTime();if(n<0)return`-`;let r=Math.floor(n/6e4),i=Math.floor(r/60);return i>0?`${i}h ${r%60}m`:r>0?`${r}m`:`${Math.floor(n/1e3)}s`}function A(){let e=ne(),[l,_]=(0,D.useState)(``),[A,j]=(0,D.useState)(``),[M,N]=(0,D.useState)(``),[P,F]=(0,D.useState)(`all`),[I,L]=(0,D.useState)(new Set),[R,z]=(0,D.useState)(`start_time`),[B,V]=(0,D.useState)(!1),[H,U]=(0,D.useState)(!1),[W,G]=(0,D.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),ue=te(),K=(0,D.useRef)(null),{data:q,isLoading:de,isError:J,refetch:Y}=h({queryKey:[`sessions`,{limit:100,status:A||void 0}],queryFn:()=>x({limit:100,status:A||void 0}).then(e=>e.data),refetchInterval:oe((q?.items.filter(e=>e.status===`active`).length??0)>0)}),X=m({mutationFn:e=>v(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`sessions`]})}}),Z=m({mutationFn:e=>b(e),onSuccess:t=>{L(new Set),e.invalidateQueries({queryKey:[`sessions`]}),t.failed.length>0&&alert(`删除完成:成功 ${t.success.length} 个,失败 ${t.failed.length} 个\n失败原因:\n${t.errors.map(e=>`${e.id}: ${e.reason}`).join(`
2
+ `)}`)}}),fe=m({mutationFn:({id:e,meta:t})=>y(e,t),onSuccess:()=>e.invalidateQueries({queryKey:[`sessions`]})}),Q=(q?.items.filter(e=>{let t=e.session_id.toLowerCase().includes(l.toLowerCase())||e.project_path.toLowerCase().includes(l.toLowerCase()),n=!M||e.project_path.split(`/`).pop()===M,r=P===`all`||new Date(e.start_time)>=d(new Date,P===`1d`?1:P===`7d`?7:30);return t&&n&&r})||[]).sort((e,t)=>{let n=0;return R===`start_time`?n=e.start_time.localeCompare(t.start_time):R===`event_count`?n=e.event_count-t.event_count:R===`duration`&&(n=(e.end_time?new Date(e.end_time).getTime()-new Date(e.start_time).getTime():1/0)-(t.end_time?new Date(t.end_time).getTime()-new Date(t.start_time).getTime():1/0)),B?n:-n}),pe=Array.from(new Set(q?.items.map(e=>e.project_path.split(`/`).pop()||``).filter(Boolean)||[])),me=e=>{R===e?V(e=>!e):(z(e),V(!1))},$=g({count:Q.length,getScrollElement:()=>K.current,estimateSize:()=>72,overscan:10}),he=()=>{let e=[`Session ID`,`项目`,`状态`,`开始时间`,`结束时间`,`事件数`],t=Q.map(e=>[e.session_id,e.project_path,e.status,e.start_time,e.end_time||``,e.event_count]);ie(`sessions-${f(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)};return de?(0,O.jsxs)(`div`,{className:`space-y-6`,children:[(0,O.jsx)(se,{count:4}),(0,O.jsx)(ce,{count:6})]}):J?(0,O.jsx)(re,{message:`会话数据加载失败`,onRetry:()=>Y()}):(0,O.jsxs)(`div`,{className:`space-y-6`,children:[(0,O.jsx)(T,{children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,O.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,O.jsxs)(`div`,{className:`relative flex-1`,children:[(0,O.jsx)(c,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,O.jsx)(`input`,{type:`text`,placeholder:`搜索会话 ID 或项目...`,value:l,onChange:e=>_(e.target.value),className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,O.jsxs)(`button`,{onClick:()=>U(e=>!e),className:S(`flex items-center gap-1.5 px-3 py-2 text-sm rounded-lg border transition-colors`,H||A||M||P!==`all`?`border-blue-300 bg-blue-50 text-blue-700`:`border-gray-200 text-gray-600 hover:bg-gray-50`),children:[(0,O.jsx)(t,{className:`h-4 w-4`}),`筛选`,(A||M||P!==`all`)&&(0,O.jsx)(`span`,{className:`ml-1 px-1.5 py-0.5 bg-blue-600 text-white text-xs rounded-full`,children:[A,M,P===`all`?``:P].filter(Boolean).length}),(0,O.jsx)(i,{className:S(`h-3.5 w-3.5 transition-transform`,H&&`rotate-180`)})]}),(0,O.jsxs)(`div`,{className:`flex gap-2`,children:[I.size>0&&(0,O.jsxs)(w,{variant:`danger`,size:`sm`,icon:o,onClick:()=>{G({open:!0,title:`批量删除会话`,description:`确定删除选中的 ${I.size} 个会话吗?此操作不可撤销。`,count:I.size,onConfirm:()=>{Z.mutate(Array.from(I)),G(e=>({...e,open:!1}))}})},loading:Z.isPending,children:[`删除 (`,I.size,`)`]}),(0,O.jsx)(w,{variant:`secondary`,size:`sm`,icon:n,onClick:()=>Q.length>0&&he(),children:`导出`}),(0,O.jsx)(w,{variant:`primary`,size:`sm`,onClick:()=>Y(),children:`刷新`})]})]}),Z.isPending&&(0,O.jsx)(`div`,{className:`mt-2`,children:(0,O.jsx)(le,{total:I.size,done:0,label:`批量删除中`})}),H&&(0,O.jsxs)(`div`,{className:`flex flex-wrap gap-3 pt-2 border-t border-gray-100`,children:[(0,O.jsxs)(`select`,{value:A,onChange:e=>j(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,O.jsx)(`option`,{value:``,children:`全部状态`}),(0,O.jsx)(`option`,{value:`active`,children:`活跃`}),(0,O.jsx)(`option`,{value:`completed`,children:`已完成`}),(0,O.jsx)(`option`,{value:`interrupted`,children:`中断`})]}),(0,O.jsxs)(`select`,{value:M,onChange:e=>N(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,O.jsx)(`option`,{value:``,children:`全部项目`}),pe.map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-1 border border-gray-200 rounded-lg overflow-hidden text-sm`,children:[(0,O.jsx)(u,{className:`h-3.5 w-3.5 text-gray-400 ml-2`}),[`all`,`1d`,`7d`,`30d`].map(e=>(0,O.jsx)(`button`,{onClick:()=>F(e),className:S(`px-2.5 py-1.5 transition-colors`,P===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:e===`all`?`全部`:e},e))]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-1 text-sm`,children:[(0,O.jsx)(`span`,{className:`text-gray-500 text-xs`,children:`排序:`}),[{key:`start_time`,label:`时间`},{key:`event_count`,label:`事件数`},{key:`duration`,label:`时长`}].map(({key:e,label:t})=>(0,O.jsxs)(`button`,{onClick:()=>me(e),className:S(`px-2.5 py-1.5 rounded-lg transition-colors flex items-center gap-1`,R===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:[t,R===e&&(0,O.jsx)(p,{className:S(`h-3 w-3`,B&&`rotate-180`)})]},e))]})]})]})}),(0,O.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,O.jsxs)(T,{className:`text-center`,children:[(0,O.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:q?.total||0}),(0,O.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`总会话数`})]}),(0,O.jsxs)(T,{className:`text-center`,children:[(0,O.jsx)(`div`,{className:`text-3xl font-bold text-green-600`,children:q?.items.filter(e=>e.status===`active`).length||0}),(0,O.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`活跃会话`})]}),(0,O.jsxs)(T,{className:`text-center`,children:[(0,O.jsx)(`div`,{className:`text-3xl font-bold text-purple-600`,children:q?.items.filter(e=>e.status===`completed`).length||0}),(0,O.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`已完成`})]}),(0,O.jsxs)(T,{className:`text-center`,children:[(0,O.jsx)(`div`,{className:`text-3xl font-bold text-orange-600`,children:Math.round((q?.items.reduce((e,t)=>e+t.event_count,0)||0)/(q?.items.length||1))}),(0,O.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`平均事件数`})]})]}),(0,O.jsx)(T,{title:`会话列表 (${Q.length})`,action:Q.length>0?(0,O.jsx)(`button`,{onClick:()=>{I.size===Q.length?L(new Set):L(new Set(Q.map(e=>e.session_id)))},className:`text-xs text-blue-600 hover:underline`,children:I.size===Q.length?`取消全选`:`全选`}):void 0,children:Q.length===0?(0,O.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,O.jsx)(s,{className:`h-12 w-12 mx-auto mb-3 opacity-30`}),(0,O.jsx)(`p`,{children:`暂无会话记录`}),(0,O.jsx)(`p`,{className:`text-sm mt-1`,children:`使用 Claude Code 开始一个会话后,记录将自动出现在这里`})]}):(0,O.jsx)(`div`,{ref:K,className:`h-[600px] overflow-auto`,children:(0,O.jsx)(`div`,{style:{height:`${$.getTotalSize()}px`,position:`relative`},children:$.getVirtualItems().map(e=>{let t=Q[e.index];return(0,O.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:(0,O.jsxs)(`div`,{className:S(`flex items-center gap-3 p-4 rounded-lg border transition-all cursor-pointer mb-2`,I.has(t.session_id)?`border-blue-300 bg-blue-50`:`border-gray-100 hover:border-blue-200 hover:bg-blue-50/50`),onClick:()=>ue(`/sessions/${t.session_id}`),children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:I.has(t.session_id),onChange:e=>{e.stopPropagation(),L(e=>{let n=new Set(e);return n.has(t.session_id)?n.delete(t.session_id):n.add(t.session_id),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0`}),(0,O.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 md:grid-cols-6 gap-4 items-center`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`div`,{className:`font-mono text-sm font-medium text-gray-900`,children:[t.session_id.slice(0,12),`...`]}),(0,O.jsx)(`div`,{className:`text-xs text-gray-500 mt-1`,children:t.project_path.split(`/`).slice(-2).join(`/`)})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(E,{variant:t.status===`active`?`success`:t.status===`completed`?`info`:`warning`,children:t.status}),t.archived&&(0,O.jsx)(E,{variant:`default`,children:`已归档`})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,O.jsx)(s,{className:`h-4 w-4`}),t.event_count,` 事件`]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,O.jsx)(a,{className:`h-4 w-4`}),f(C(t.start_time),`MM-dd HH:mm`)]}),(0,O.jsx)(`div`,{className:`text-sm text-gray-600`,children:t.end_time?k(C(t.start_time),C(t.end_time)):k(C(t.start_time),new Date)}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,O.jsx)(w,{variant:`ghost`,size:`sm`,icon:r,children:`查看详情`}),(0,O.jsx)(w,{variant:`ghost`,size:`sm`,icon:ee,onClick:e=>{e.stopPropagation(),fe.mutate({id:t.session_id,meta:{archived:!t.archived}})},title:t.archived?`取消归档`:`归档`}),(0,O.jsx)(w,{variant:`ghost`,size:`sm`,icon:o,onClick:e=>{e.stopPropagation(),G({open:!0,title:`删除会话`,description:`确认删除此会话及其所有数据?此操作不可撤销。`,onConfirm:()=>{X.mutate(t.session_id),G(e=>({...e,open:!1}))}})},loading:X.isPending&&X.variables===t.session_id})]})]})]})},t.session_id)})})})}),(0,O.jsx)(ae,{open:W.open,title:W.title,description:W.description,count:W.count,variant:`danger`,onConfirm:W.onConfirm,onCancel:()=>G({...W,open:!1})})]})}export{A as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{An as t,En as n,Fn as r,In as i,It as a,Kn as o,Kt as s,Lt as c,Qn as l,Ut as u,Vt as d,Xt as f,an as p,cn as m,en as h,gn as g,mr as _,rn as v,tn as y,un as ee}from"./vendor-BpBCrKSP.js";import{a as b,n as x,r as S}from"./vendor-query-BF-uT_c5.js";import{c as C}from"./vendor-flow-D-_WxBha.js";import{Bt as w,C as T,D as E,Dt as D,M as te,Mt as ne,N as O,Qt as k,Zt as A,bt as j,en as M,it as N,n as P,s as F,xt as I,yt as L}from"./client-B_-7qCOP.js";import{a as R}from"./ui-B2gvOcFY.js";import{t as z}from"./ConfirmDialog-CH1HyRaY.js";var B=e(_(),1),V=C(),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`),[r,i]=(0,B.useState)(``),[a,c]=(0,B.useState)(``),[f,p]=(0,B.useState)(new Set),[m,h]=(0,B.useState)(``),[_,v]=(0,B.useState)(null),[y,C]=(0,B.useState)(!1),[T,k]=(0,B.useState)(null),[A,N]=(0,B.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),P=b(),{data:L,isLoading:W}=S({queryKey:[`skills`,r,a],queryFn:()=>I({source:r||void 0,tag:a||void 0}).then(e=>e.data),refetchInterval:3e4}),{data:G}=S({queryKey:[`skills-status`],queryFn:()=>j().then(e=>e.data),refetchInterval:3e4}),K=x({mutationFn:e=>w(e).then(e=>e.data),onSuccess:e=>{v(e),M(`找到 ${e.github.length+e.npm.length} 个结果`,`success`)}}),q=x({mutationFn:e=>D(e).then(e=>e.data),onSuccess:e=>{M(`已安装: ${e.skill.name}`,`success`),P.invalidateQueries({queryKey:[`skills`]}),P.invalidateQueries({queryKey:[`skills-status`]})}}),J=x({mutationFn:e=>E(e).then(e=>e.data),onSuccess:(e,t)=>{M(`已删除: ${t}`,`success`),p(e=>{let n=new Set(e);return n.delete(t),n}),P.invalidateQueries({queryKey:[`skills`]}),P.invalidateQueries({queryKey:[`skills-status`]})}}),Y=x({mutationFn:e=>F(e).then(e=>e.data),onSuccess:e=>{M(`已删除 ${e.success.length} 个技能`,`success`),p(new Set),P.invalidateQueries({queryKey:[`skills`]}),P.invalidateQueries({queryKey:[`skills-status`]})}}),X=x({mutationFn:()=>O().then(e=>e.data),onSuccess:e=>{M(`进化完成:${e.repaired.length+e.retired.length+e.optimized.length+e.generated.length} 项变更`,`success`),P.invalidateQueries({queryKey:[`skills`]}),P.invalidateQueries({queryKey:[`skills-status`]})}}),Z=x({mutationFn:()=>te().then(e=>e.data),onSuccess:e=>{M(`蒸馏完成:新增 ${e.distilled.length} 个技能`,`success`),P.invalidateQueries({queryKey:[`skills`]}),P.invalidateQueries({queryKey:[`skills-status`]})}}),Q=x({mutationFn:()=>ne().then(e=>e.data),onSuccess:e=>{M(`修复完成:${e.repaired.length} 个技能已修复`,`success`),P.invalidateQueries({queryKey:[`skills`]})}}),$=L?.items||[],se=$.length>0&&f.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:()=>C(!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)(n,{className:`h-4 w-4`}),`筛选`,(0,V.jsx)(l,{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,` 个技能`]}),f.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:[`已选 `,f.size,` 个`]}),(0,V.jsxs)(`button`,{onClick:()=>{N({open:!0,title:`批量删除技能`,description:`确定要删除选中的 ${f.size} 个技能吗?此操作不可恢复。`,count:f.size,onConfirm:()=>{Y.mutate(Array.from(f)),N(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)(u,{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:r,onChange:e=>i(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:a,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)(g,{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:f.has(e.name),onChange:()=>ce(e.name),className:`rounded`})}),(0,V.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,V.jsx)(`button`,{onClick:()=>k(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)(s,{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:()=>{N({open:!0,title:`删除技能`,description:`确定要删除技能 "${e.name}" 吗?此操作不可恢复。`,onConfirm:()=>{J.mutate(e.name),N(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)(u,{className:`h-4 w-4`})})})]},e.name))})]}),$.length===0&&(0,V.jsxs)(`div`,{className:`text-center py-12`,children:[(0,V.jsx)(ee,{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)(d,{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)(o,{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,{}),T&&(0,V.jsx)(re,{name:T,onClose:()=>k(null)}),(0,V.jsx)(z,{open:A.open,title:A.title,description:A.description,count:A.count,onConfirm:A.onConfirm,onCancel:()=>N(e=>({...e,open:!1}))})]})}function re({name:e,onClose:n}){let[i,o]=(0,B.useState)(`content`),[c,l]=(0,B.useState)(!1),[d,f]=(0,B.useState)(``),[h,_]=(0,B.useState)(``),v=b(),{data:C,isLoading:w}=S({queryKey:[`skill-detail`,e],queryFn:()=>L(e).then(e=>e.data)}),{data:E}=S({queryKey:[`orchestration-mappings`],queryFn:()=>N().then(e=>e.data),enabled:i===`orchestration`}),D=E?.items.find(t=>t.skill===e),[te,ne]=(0,B.useState)([]),O=D?.keywords??[],j=x({mutationFn:t=>A(e,t),onSuccess:()=>{M(`技能内容已保存`,`success`),l(!1),v.invalidateQueries({queryKey:[`skill-detail`,e]})},onError:()=>M(`保存失败`,`error`)}),P=x({mutationFn:t=>k(e,t),onSuccess:()=>{M(`编排映射已保存`,`success`),v.invalidateQueries({queryKey:[`orchestration-mappings`]})},onError:()=>M(`保存失败`,`error`)}),F=x({mutationFn:()=>T(e),onSuccess:()=>{M(`编排映射已删除`,`success`),v.invalidateQueries({queryKey:[`orchestration-mappings`]})}}),[I,R]=(0,B.useState)(null),z=I??O;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)(ee,{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}),C&&(0,V.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:C.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)(a,{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:()=>o(e),className:`px-3 py-1.5 text-sm font-medium border-b-2 transition-colors ${i===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:w?(0,V.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,V.jsx)(g,{className:`h-6 w-6 animate-spin text-blue-500`})}):C?i===`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[C.source]||`bg-gray-100 text-gray-600`}`,children:U[C.source]||C.source}),(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,C.version]}),C.requires?.bins&&C.requires.bins.length>0&&(0,V.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`需要:`,C.requires.bins.join(`, `)]}),C.filePath&&(0,V.jsx)(`span`,{className:`text-xs text-gray-400 font-mono truncate max-w-xs`,children:C.filePath})]}),C.tags&&C.tags.length>0&&(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:C.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)(s,{className:`h-2.5 w-2.5`}),e]},e))}),C.content||C.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)(t,{className:`h-3.5 w-3.5`}),`技能文件内容`]}),C.filePath&&!c&&(0,V.jsxs)(`button`,{onClick:()=>{f(C.content||``),l(!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:()=>l(!1),className:`text-gray-500 hover:text-gray-700 text-xs`,children:`取消`}),(0,V.jsxs)(`button`,{onClick:()=>j.mutate(d),disabled:j.isPending,className:`flex items-center gap-1 text-green-600 hover:underline text-xs`,children:[(0,V.jsx)(y,{className:`h-3 w-3`}),j.isPending?`保存中...`:`保存`]})]})]}),c?(0,V.jsx)(`textarea`,{value:d,onChange:e=>f(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:C.content||`(空文件)`})]}):(0,V.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无文件内容`}),C.sourceUrl&&(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,V.jsx)(r,{className:`h-3.5 w-3.5 text-gray-400`}),(0,V.jsx)(`a`,{href:C.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:underline truncate`,children:C.sourceUrl})]})]}):i===`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:C.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:C.stats.callCount>0?`${(C.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:C.stats.userFeedback.positive+C.stats.userFeedback.negative>0?`${C.stats.userFeedback.positive} / ${C.stats.userFeedback.negative}`:`—`}),(0,V.jsx)(`div`,{className:`text-xs text-purple-600 mt-1`,children:`用户反馈(正向/负向)`})]})]}),C.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:[(C.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 ${C.stats.successRate>=.8?`bg-green-500`:C.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`}`,style:{width:`${C.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:C.stats.lastUsed?new Date(C.stats.lastUsed).toLocaleString(`zh-CN`):`从未使用`})]}),C.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,t)=>(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,n)=>n!==t)),className:`hover:text-red-500 transition-colors`,children:(0,V.jsx)(a,{className:`h-3 w-3`})})]},t))})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`input`,{type:`text`,value:h,onChange:e=>_(e.target.value),onKeyDown:e=>{if(e.key===`Enter`&&h.trim()){let e=h.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=h.trim();e&&!z.includes(e)&&R([...z,e]),_(``)},disabled:!h.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:()=>P.mutate(z),disabled:P.isPending||I===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`}),P.isPending?`保存中...`:`保存映射`]}),D&&(0,V.jsxs)(`button`,{onClick:()=>F.mutate(),disabled:F.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)(u,{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:a,onInstall:o,isSearching:s,isInstalling:c}){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`&&a(),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:a,disabled:s||!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:[s?(0,V.jsx)(g,{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)(r,{className:`h-3 w-3`}),e.sourceUrl]})]}),(0,V.jsxs)(`button`,{onClick:()=>o(e.sourceUrl),disabled:c,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)(i,{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:()=>o(e.sourceUrl),disabled:c,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)(i,{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:a,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)(f,{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)(g,{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)(i,{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:a,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:[a?(0,V.jsx)(g,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(i,{className:`h-4 w-4`}),a?`蒸馏中...`:`开始蒸馏`]}),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)(c,{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)(g,{className:`h-4 w-4 animate-spin`}):(0,V.jsx)(c,{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=b(),[t,n]=(0,B.useState)(!1),[r,a]=(0,B.useState)({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),{data:o}=S({queryKey:[`skill-sources`],queryFn:()=>P.get(`/skills/sources`).then(e=>e.data)}),s=x({mutationFn:e=>P.post(`/skills/sources`,e).then(e=>e.data),onSuccess:()=>{M(`技能源已添加`,`success`),n(!1),a({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),e.invalidateQueries({queryKey:[`skill-sources`]})}}),c=x({mutationFn:e=>P.delete(`/skills/sources/${encodeURIComponent(e)}`).then(e=>e.data),onSuccess:()=>{M(`技能源已删除`,`success`),e.invalidateQueries({queryKey:[`skill-sources`]})}}),l=o?.builtIn||[],d=o?.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)(i,{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=>a({...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=>a({...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=>a({...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=>a({...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=>a({...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:()=>s.mutate(r),disabled:!r.repo||!r.dir||s.isPending,className:`px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:s.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:l.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:()=>c.mutate(e.repo),disabled:c.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,children:(0,V.jsx)(u,{className:`h-4 w-4`})})]},t))})]})]})}export{W as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Bt as t,Gn as n,It as r,fr as i,mr as a,qn as ee}from"./vendor-BpBCrKSP.js";import{C as o}from"./vendor-charts-BXsEmmv5.js";import{c as s}from"./vendor-flow-D-_WxBha.js";var c=e(a(),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:ee,error:n,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)(r,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`})})]},e.id)})}),document.body)]})}var m=i.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)}`),$=()=>m.post(`/conventions/sync-official`),nt=e=>m.post(`/conventions/install`,{url:e},{timeout:3e4}),rt=e=>m.delete(`/conventions/${encodeURIComponent(e)}`),it=()=>m.get(`/conventions/usage-stats`),at=e=>m.get(`/conventions/${encodeURIComponent(e)}/evolution-history`),ot=e=>m.post(`/conventions/batch-evolve`,{conventionIds:e},{timeout:12e4}),st=e=>m.get(`/conventions/${encodeURIComponent(e)}/yaml`),ct=(e,t)=>m.put(`/conventions/${encodeURIComponent(e)}/yaml`,{yaml:t}),lt=e=>m.get(`/node-types`,{params:e?{projectPath:e}:void 0}),ut=e=>m.get(`/node-types/${encodeURIComponent(e)}`),dt=e=>m.post(`/node-types`,e),ft=(e,t)=>m.put(`/node-types/${encodeURIComponent(e)}`,t),pt=e=>m.delete(`/node-types/${encodeURIComponent(e)}`);export{N as $,p as $t,_e as A,U as At,g as B,We as Bt,$e as C,B as Ct,Ke as D,Ge as Dt,x as E,nt as Et,ze as F,Ee as Ft,Te as G,_ as Gt,at as H,Re as Ht,je as I,Me as It,tt as J,Q as Jt,T as K,L as Kt,pe as L,q as Lt,Ye as M,Xe as Mt,Je as N,Ce as Nt,De as O,Ae as Ot,K as P,ye as Pt,P as Q,Qe as Qt,ge as R,ct as Rt,pt as S,k as St,ae as T,ve as Tt,it as U,le as Ut,v as V,$ as Vt,st as W,me as Wt,h as X,S as Xt,et as Y,de as Yt,F as Z,Ue as Zt,I as _,b as _t,z as a,j as at,rt as b,Ve as bt,xe as c,Y as ct,ce as d,se as dt,f as en,Pe as et,Le as f,ue as ft,V as g,A as gt,H as h,O as ht,W as i,Ze as it,fe as j,Oe as jt,be as k,Ne as kt,ot as l,E as lt,G as m,we as mt,m as n,ut as nt,C as o,D as ot,Ie as p,re as pt,w as q,ft as qt,ke as r,lt as rt,qe as s,X as st,J as t,Fe as tt,Se as u,ie as ut,dt as v,y as vt,ne as w,oe as wt,R as x,Be as xt,Z as y,He as yt,he as z,M as zt};
@@ -0,0 +1,3 @@
1
+ function e(e,t,n){let r=e=>{let t=e==null?``:String(e);return t.includes(`,`)||t.includes(`"`)||t.includes(`
2
+ `)?`"${t.replace(/"/g,`""`)}"`:t},i=[t.map(r).join(`,`),...n.map(e=>e.map(r).join(`,`))].join(`
3
+ `),a=new Blob([``+i],{type:`text/csv;charset=utf-8;`}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=e,s.click(),URL.revokeObjectURL(o)}export{e as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-BS61GjKa.js","assets/rolldown-runtime-COnpUsM8.js","assets/vendor-react-CXfI0Tes.js","assets/vendor-BpBCrKSP.js","assets/vendor-charts-BXsEmmv5.js","assets/vendor-query-BF-uT_c5.js","assets/vendor-flow-D-_WxBha.js","assets/vendor-flow-CHpVij2M.css","assets/vendor-motion-BsfSkSjj.js","assets/client-B_-7qCOP.js","assets/ConfirmDialog-CH1HyRaY.js","assets/ui-B2gvOcFY.js","assets/useSmartPolling-DYAVOihL.js","assets/Sessions-Dz6xFq_4.js","assets/BatchProgress-CIrC9RcC.js","assets/ErrorState-HW0OjEYK.js","assets/exportCsv-CSExJI8h.js","assets/SessionDetail-DleCNmQH.js","assets/Breadcrumb-DbDeWYcH.js","assets/Events-DAms_1fs.js","assets/useDebounce-Bo1fLB5L.js","assets/Pipelines-DEuVx4hF.js","assets/Pagination-ooTI9JPa.js","assets/PipelineDetail-DCnqD5lr.js","assets/Quality-wvfdPtGB.js","assets/Config-yTRFpmlP.js","assets/Analytics-BTMAlQBr.js","assets/Knowledge-CZhuou1K.js","assets/Projects-D5-BfuFU.js","assets/ProjectDetail-Dn01H3zi.js","assets/Skills-CpHL-tyW.js","assets/Conventions-DaqIk41m.js","assets/vendor-editor-DYIoTHFO.js","assets/NodeTypes-B5E6NYKn.js","assets/PipelineTemplates-CxGoLw6Q.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$t as t,An as n,Bt as r,Dn as i,Ft as a,Qt as o,Tn as s,Vn as c,Zn as l,bn as u,dr as d,en as f,gn as p,ir as m,mn as h,mr as g,nr as _,or as v,rn as y,rr as b,tr as x,un as S,wn as C}from"./vendor-BpBCrKSP.js";import{a as w,c as ee,d as T,i as E,o as D,r as O,s as k,t as A,u as j}from"./vendor-react-CXfI0Tes.js";import{a as M,i as N,o as te,r as P}from"./vendor-query-BF-uT_c5.js";import{c as F}from"./vendor-flow-D-_WxBha.js";import{$t as I,X as L,lt as R,vt as z,xt as B,zt as V}from"./client-B_-7qCOP.js";import{a as H,n as U}from"./ui-B2gvOcFY.js";import{n as W,t as G}from"./vendor-motion-BsfSkSjj.js";import{t as K}from"./useDebounce-Bo1fLB5L.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 q=e(T(),1),J=e(g(),1),Y=F(),X=[{path:`/dashboard`,label:`仪表盘`,icon:u},{path:`/projects`,label:`项目管理`,icon:i},{path:`/sessions`,label:`会话管理`,icon:d},{path:`/events`,label:`事件流`,icon:_},{path:`/pipelines`,label:`流水线`,icon:s},{path:`/quality`,label:`质量门禁`,icon:o},{path:`/knowledge`,label:`知识图谱`,icon:b},{path:`/skills`,label:`技能管理`,icon:S},{path:`/conventions`,label:`规范管理`,icon:v},{path:`/node-types`,label:`节点类型`,icon:m},{path:`/pipeline-templates`,label:`模板管理`,icon:n},{path:`/analytics`,label:`数据分析`,icon:x},{path:`/config`,label:`系统配置`,icon:t}];function Z({children:e}){let[t,n]=(0,J.useState)(()=>localStorage.getItem(`sidebar-collapsed`)===`true`),r=k();(0,J.useEffect)(()=>{localStorage.setItem(`sidebar-collapsed`,String(t))},[t]);let{data:i}=P({queryKey:[`health`],queryFn:()=>L().then(e=>e.data),refetchInterval:15e3}),o=X.find(e=>r.pathname.startsWith(e.path));return(0,Y.jsxs)(`div`,{className:`flex min-h-screen bg-gray-50`,children:[(0,Y.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`,t?`w-16`:`w-60`),children:[(0,Y.jsxs)(`div`,{className:H(`flex items-center border-b border-white/10 h-16`,t?`justify-center px-2`:`justify-between px-5`),children:[!t&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,Y.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,Y.jsx)(a,{className:`h-5 w-5 text-white`})}),(0,Y.jsx)(`span`,{className:`text-white font-bold text-lg tracking-tight`,children:`Forge`})]}),(0,Y.jsx)(`button`,{onClick:()=>n(!t),className:`p-1.5 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-colors`,children:t?(0,Y.jsx)(h,{className:`h-5 w-5`}):(0,Y.jsx)(l,{className:`h-5 w-5`})})]}),(0,Y.jsx)(`nav`,{className:`flex-1 py-4 space-y-1 px-2`,children:X.map(e=>(0,Y.jsxs)(O,{to:e.path,className:({isActive:e})=>H(`flex items-center gap-3 rounded-lg transition-all duration-200`,t?`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,Y.jsx)(e.icon,{className:`h-5 w-5 flex-shrink-0`}),!t&&(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]},e.path))}),(0,Y.jsx)(`div`,{className:H(`border-t border-white/10 py-4`,t?`px-2`:`px-5`),children:(0,Y.jsxs)(`div`,{className:H(`flex items-center gap-2`,t?`justify-center`:``),children:[(0,Y.jsx)(`div`,{className:H(`w-2 h-2 rounded-full`,i?.status===`ok`?`bg-green-400 animate-pulse`:`bg-red-400`)}),!t&&(0,Y.jsx)(`span`,{className:`text-xs text-white/40`,children:i?.status===`ok`?`Daemon 运行中`:`连接断开`})]})})]}),(0,Y.jsxs)(`main`,{className:H(`flex-1 transition-all duration-300`,t?`ml-16`:`ml-60`),children:[(0,Y.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,Y.jsx)(`h1`,{className:`text-xl font-semibold text-gray-900`,children:o?.label||`Claude Forge`}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,Y.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,Y.jsx)(c,{className:`h-4 w-4`}),(0,Y.jsx)(`span`,{children:`命令面板`}),(0,Y.jsx)(`kbd`,{className:`px-2 py-0.5 text-xs bg-gray-100 rounded border border-gray-200`,children:`⌘K`})]}),(0,Y.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[`v`,`3.6.39`]}),(0,Y.jsxs)(`div`,{className:H(`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold`,i?.status===`ok`?`bg-green-50 text-green-700 border border-green-200`:`bg-red-50 text-red-700 border border-red-200`),children:[(0,Y.jsx)(`div`,{className:H(`w-1.5 h-1.5 rounded-full`,i?.status===`ok`?`bg-green-500`:`bg-red-500`)}),i?.status===`ok`?`在线`:`离线`]})]})]}),(0,Y.jsx)(`div`,{className:`p-8 overflow-x-hidden`,children:e})]})]})}var Q=e=>[{id:`nav-dashboard`,label:`仪表盘`,description:`查看效率指标和趋势`,icon:u,action:()=>e(`/dashboard`),category:`导航`},{id:`nav-sessions`,label:`会话管理`,description:`查看和管理会话`,icon:d,action:()=>e(`/sessions`),category:`导航`},{id:`nav-events`,label:`事件流`,description:`查看实时事件`,icon:_,action:()=>e(`/events`),category:`导航`},{id:`nav-pipelines`,label:`流水线`,description:`查看编排流水线`,icon:s,action:()=>e(`/pipelines`),category:`导航`},{id:`nav-quality`,label:`质量门禁`,description:`查看质量问题`,icon:o,action:()=>e(`/quality`),category:`导航`},{id:`nav-knowledge`,label:`知识图谱`,description:`浏览知识节点`,icon:b,action:()=>e(`/knowledge`),category:`导航`},{id:`nav-analytics`,label:`数据分析`,description:`查看统计报表`,icon:x,action:()=>e(`/analytics`),category:`导航`},{id:`nav-config`,label:`系统配置`,description:`管理配置项`,icon:t,action:()=>e(`/config`),category:`导航`}];function ne(){let[e,t]=(0,J.useState)(!1),[n,r]=(0,J.useState)(``),[i,o]=(0,J.useState)(0),s=(0,J.useRef)(null),l=ee(),u=K(n,300),m=u.trim().length>=2,{data:h,isFetching:g}=P({queryKey:[`cmd-pipelines`,u],queryFn:()=>R({search:u,page_size:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:_,isFetching:v}=P({queryKey:[`cmd-sessions`,u],queryFn:()=>z({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:y,isFetching:x}=P({queryKey:[`cmd-knowledge`,u],queryFn:()=>V(u,void 0,void 0,5).then(e=>e.data),enabled:m&&e,staleTime:1e4}),{data:S,isFetching:w}=P({queryKey:[`cmd-skills`,u],queryFn:()=>B({limit:5}).then(e=>e.data),enabled:m&&e,staleTime:1e4}),T=g||v||x||w,E=[];if(m){let e=u.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:C,action:()=>l(`/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:d,action:()=>l(`/sessions/${e.id}`),category:`会话`})}),(y?.items||[]).forEach(e=>{E.push({id:`knowledge-${e.id}`,label:String(e.title||``).slice(0,60),description:`知识节点 · ${e.node_type||``}`,icon:b,action:()=>l(`/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:a,action:()=>l(`/skills`),category:`技能`})})}let D=Q(l),O=n?D.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||(e.description||``).toLowerCase().includes(n.toLowerCase())):D,k=m?[...E,...O]:O;(0,J.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),t(e=>!e),r(``),o(0)),e.key===`Escape`&&t(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,J.useEffect)(()=>{e&&setTimeout(()=>s.current?.focus(),100)},[e]),(0,J.useEffect)(()=>{o(0)},[u]);let A=e=>{e.key===`ArrowDown`?(e.preventDefault(),o(e=>Math.min(e+1,k.length-1))):e.key===`ArrowUp`?(e.preventDefault(),o(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,Y.jsx)(W,{children:e&&(0,Y.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,Y.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,Y.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-gray-100`,children:[T?(0,Y.jsx)(p,{className:`h-5 w-5 text-blue-400 flex-shrink-0 animate-spin`}):(0,Y.jsx)(f,{className:`h-5 w-5 text-gray-400 flex-shrink-0`}),(0,Y.jsx)(`input`,{ref:s,type:`text`,placeholder:`输入命令或搜索(≥2字符跨模块搜索)...`,value:n,onChange:e=>{r(e.target.value),o(0)},onKeyDown:A,className:`flex-1 text-sm outline-none placeholder:text-gray-400`}),(0,Y.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,Y.jsx)(`div`,{className:`max-h-80 overflow-y-auto py-2`,children:k.length===0&&!T?(0,Y.jsx)(`div`,{className:`px-4 py-8 text-center text-sm text-gray-400`,children:m?`没有找到相关内容`:`没有匹配的命令`}):j.map(e=>(0,Y.jsxs)(`div`,{children:[(0,Y.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,Y.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:()=>o(n),children:[(0,Y.jsx)(e.icon,{className:`h-4 w-4 flex-shrink-0`}),(0,Y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Y.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e.label}),e.description&&(0,Y.jsx)(`div`,{className:`text-xs text-gray-400 truncate`,children:e.description})]})]},e.id)})]},e))}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-t border-gray-100 text-xs text-gray-400`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↑↓`}),`导航`]}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↵`}),`执行`]})]}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(c,{className:`h-3 w-3`}),`K 打开`]})]})]})})})}var re=class extends J.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,Y.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50 px-4`,children:(0,Y.jsxs)(`div`,{className:`max-w-md w-full bg-white rounded-xl shadow-lg p-8 text-center`,children:[(0,Y.jsx)(r,{className:`h-16 w-16 text-red-500 mx-auto mb-4`}),(0,Y.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900 mb-2`,children:`出错了`}),(0,Y.jsx)(`p`,{className:`text-gray-600 mb-6`,children:`页面加载时遇到错误,请刷新页面重试`}),this.state.error&&(0,Y.jsxs)(`details`,{className:`text-left mb-6 p-4 bg-gray-50 rounded-lg`,children:[(0,Y.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-gray-700 mb-2`,children:`错误详情`}),(0,Y.jsx)(`pre`,{className:`text-xs text-red-600 overflow-auto`,children:this.state.error.toString()})]}),(0,Y.jsx)(U,{variant:`primary`,icon:y,onClick:()=>window.location.reload(),children:`刷新页面`})]})}):this.props.children}},ie=`/api/events/stream`,ae=3e3;function oe(){let e=M(),t=(0,J.useRef)(null),n=(0,J.useRef)(null);(0,J.useEffect)(()=>{let r=!1;function i(){if(r)return;let a=new EventSource(ie);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 se=(0,J.lazy)(()=>j(()=>import(`./Dashboard-BS61GjKa.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),ce=(0,J.lazy)(()=>j(()=>import(`./Sessions-Dz6xFq_4.js`),__vite__mapDeps([13,1,2,3,4,5,6,7,9,14,11,8,10,15,12,16]))),le=(0,J.lazy)(()=>j(()=>import(`./SessionDetail-DleCNmQH.js`),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,18,11]))),ue=(0,J.lazy)(()=>j(()=>import(`./Events-DAms_1fs.js`),__vite__mapDeps([19,1,3,5,6,4,7,8,9,10,11,15,20,16]))),de=(0,J.lazy)(()=>j(()=>import(`./Pipelines-DEuVx4hF.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,14,11,10,15,22,20,12,16]))),fe=(0,J.lazy)(()=>j(()=>import(`./PipelineDetail-DCnqD5lr.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,18,10,11]))),pe=(0,J.lazy)(()=>j(()=>import(`./Quality-wvfdPtGB.js`),__vite__mapDeps([24,1,3,5,6,4,7,8,9,10,11,15,22,20,16]))),$=(0,J.lazy)(()=>j(()=>import(`./Config-yTRFpmlP.js`),__vite__mapDeps([25,1,3,5,6,4,7,8,9,10,11]))),me=(0,J.lazy)(()=>j(()=>import(`./Analytics-BTMAlQBr.js`),__vite__mapDeps([26,1,3,5,6,4,7,9,15,11,8,16]))),he=(0,J.lazy)(()=>j(()=>import(`./Knowledge-CZhuou1K.js`),__vite__mapDeps([27,1,3,5,6,4,7,8,9,10,11,22,16]))),ge=(0,J.lazy)(()=>j(()=>import(`./Projects-D5-BfuFU.js`),__vite__mapDeps([28,1,2,3,4,5,6,7,8,9,22,11,16]))),_e=(0,J.lazy)(()=>j(()=>import(`./ProjectDetail-Dn01H3zi.js`),__vite__mapDeps([29,1,2,3,4,5,6,7,9,18,22,11,8]))),ve=(0,J.lazy)(()=>j(()=>import(`./Skills-CpHL-tyW.js`),__vite__mapDeps([30,1,3,5,6,4,7,9,10,11,8]))),ye=(0,J.lazy)(()=>j(()=>import(`./Conventions-DaqIk41m.js`),__vite__mapDeps([31,1,32,3,5,6,4,7,9,10,11,8]))),be=(0,J.lazy)(()=>j(()=>import(`./NodeTypes-B5E6NYKn.js`),__vite__mapDeps([33,1,3,5,6,4,7,9]))),xe=(0,J.lazy)(()=>j(()=>import(`./PipelineTemplates-CxGoLw6Q.js`),__vite__mapDeps([34,1,3,5,6,4,7,9])));function Se(){return oe(),(0,Y.jsx)(re,{children:(0,Y.jsxs)(I,{children:[(0,Y.jsx)(ne,{}),(0,Y.jsx)(Z,{children:(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400`,children:`加载中...`}),children:(0,Y.jsxs)(D,{children:[(0,Y.jsx)(w,{path:`/`,element:(0,Y.jsx)(E,{to:`/dashboard`,replace:!0})}),(0,Y.jsx)(w,{path:`/dashboard`,element:(0,Y.jsx)(se,{})}),(0,Y.jsx)(w,{path:`/sessions`,element:(0,Y.jsx)(ce,{})}),(0,Y.jsx)(w,{path:`/sessions/:id`,element:(0,Y.jsx)(le,{})}),(0,Y.jsx)(w,{path:`/events`,element:(0,Y.jsx)(ue,{})}),(0,Y.jsx)(w,{path:`/pipelines`,element:(0,Y.jsx)(de,{})}),(0,Y.jsx)(w,{path:`/pipelines/:id`,element:(0,Y.jsx)(fe,{})}),(0,Y.jsx)(w,{path:`/projects`,element:(0,Y.jsx)(ge,{})}),(0,Y.jsx)(w,{path:`/projects/:encodedPath`,element:(0,Y.jsx)(_e,{})}),(0,Y.jsx)(w,{path:`/quality`,element:(0,Y.jsx)(pe,{})}),(0,Y.jsx)(w,{path:`/analytics`,element:(0,Y.jsx)(me,{})}),(0,Y.jsx)(w,{path:`/knowledge`,element:(0,Y.jsx)(he,{})}),(0,Y.jsx)(w,{path:`/skills`,element:(0,Y.jsx)(ve,{})}),(0,Y.jsx)(w,{path:`/conventions`,element:(0,Y.jsx)(ye,{})}),(0,Y.jsx)(w,{path:`/node-types`,element:(0,Y.jsx)(be,{})}),(0,Y.jsx)(w,{path:`/pipeline-templates`,element:(0,Y.jsx)(xe,{})}),(0,Y.jsx)(w,{path:`/config`,element:(0,Y.jsx)($,{})})]})})})]})})}var Ce=new te({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});q.createRoot(document.getElementById(`root`)).render((0,Y.jsx)(J.StrictMode,{children:(0,Y.jsx)(N,{client:Ce,children:(0,Y.jsx)(A,{children:(0,Y.jsx)(Se,{})})})}));
@@ -0,0 +1,2 @@
1
+ /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-800:oklch(47.6% .114 61.907);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-700:oklch(45.7% .24 277.023);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-pink-50:oklch(97.1% .014 343.198);--color-pink-500:oklch(65.6% .241 354.308);--color-pink-700:oklch(52.5% .223 3.958);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.top-6{top:calc(var(--spacing) * 6)}.top-full{top:100%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.z-40{z-index:40}.z-50{z-index:50}.z-\[200\]{z-index:200}.z-\[9999\]{z-index:9999}.col-span-2{grid-column:span 2/span 2}.mx-0\.5{margin-inline:calc(var(--spacing) * .5)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing) * 1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-16{margin-left:calc(var(--spacing) * 16)}.ml-60{margin-left:calc(var(--spacing) * 60)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-48{height:calc(var(--spacing) * 48)}.h-96{height:calc(var(--spacing) * 96)}.h-\[180px\]{height:180px}.h-\[600px\]{height:600px}.h-full{height:100%}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-52{max-height:calc(var(--spacing) * 52)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[50vh\]{max-height:50vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[600px\]{max-height:600px}.min-h-\[40px\]{min-height:40px}.min-h-screen{min-height:100vh}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-1\/2{width:50%}.w-1\/3{width:33.3333%}.w-1\/4{width:25%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\/5{width:80%}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-\[600px\]{width:600px}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[72px\]{max-width:72px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[80px\]{min-width:80px}.min-w-\[200px\]{min-width:200px}.min-w-\[240px\]{min-width:240px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1{--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize-y{resize:vertical}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.\!border-green-200{border-color:var(--color-green-200)!important}.\!border-red-200{border-color:var(--color-red-200)!important}.\!border-yellow-200{border-color:var(--color-yellow-200)!important}.border-amber-200{border-color:var(--color-amber-200)}.border-blue-100{border-color:var(--color-blue-100)}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-300{border-color:var(--color-blue-300)}.border-blue-400{border-color:var(--color-blue-400)}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-50{border-color:var(--color-gray-50)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-200\/50{border-color:#e5e7eb80}@supports (color:color-mix(in lab, red, red)){.border-gray-200\/50{border-color:color-mix(in oklab, var(--color-gray-200) 50%, transparent)}}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-400{border-color:var(--color-gray-400)}.border-green-200{border-color:var(--color-green-200)}.border-green-300{border-color:var(--color-green-300)}.border-green-500{border-color:var(--color-green-500)}.border-orange-200{border-color:var(--color-orange-200)}.border-purple-200{border-color:var(--color-purple-200)}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-transparent{border-color:#0000}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.border-white\/10{border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.border-yellow-200{border-color:var(--color-yellow-200)}.border-yellow-300{border-color:var(--color-yellow-300)}.border-yellow-500{border-color:var(--color-yellow-500)}.border-l-blue-500{border-left-color:var(--color-blue-500)}.\!bg-green-50{background-color:var(--color-green-50)!important}.\!bg-yellow-50{background-color:var(--color-yellow-50)!important}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-600{background-color:var(--color-amber-600)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\/20{background-color:#155dfc33}@supports (color:color-mix(in lab, red, red)){.bg-blue-600\/20{background-color:color-mix(in oklab, var(--color-blue-600) 20%, transparent)}}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-400{background-color:var(--color-green-400)}.bg-green-500{background-color:var(--color-green-500)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-orange-100{background-color:var(--color-orange-100)}.bg-pink-50{background-color:var(--color-pink-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-purple-100{background-color:var(--color-purple-100)}.bg-purple-600{background-color:var(--color-purple-600)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-400{background-color:var(--color-red-400)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab, red, red)){.bg-white\/80{background-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-green-500{--tw-gradient-from:var(--color-green-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-orange-500{--tw-gradient-from:var(--color-orange-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-red-500{--tw-gradient-from:var(--color-red-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-slate-900{--tw-gradient-from:var(--color-slate-900);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-blue-600{--tw-gradient-to:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-green-600{--tw-gradient-to:var(--color-green-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-600{--tw-gradient-to:var(--color-orange-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to:var(--color-purple-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-red-600{--tw-gradient-to:var(--color-red-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-slate-800{--tw-gradient-to:var(--color-slate-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.\!p-0{padding:calc(var(--spacing) * 0)!important}.\!p-2{padding:calc(var(--spacing) * 2)!important}.\!p-3{padding:calc(var(--spacing) * 3)!important}.\!p-4{padding:calc(var(--spacing) * 4)!important}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-\[20vh\]{padding-top:20vh}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-10{padding-left:calc(var(--spacing) * 10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-300{color:var(--color-green-300)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-indigo-500{color:var(--color-indigo-500)}.text-indigo-700{color:var(--color-indigo-700)}.text-orange-500{color:var(--color-orange-500)}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-pink-500{color:var(--color-pink-500)}.text-pink-700{color:var(--color-pink-700)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab, red, red)){.text-white\/40{color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab, red, red)){.text-white\/60{color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-700{color:var(--color-yellow-700)}.text-yellow-800{color:var(--color-yellow-800)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-blue-400{--tw-ring-color:var(--color-blue-400)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-gray-400::placeholder{color:var(--color-gray-400)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}@media (hover:hover){.hover\:border-blue-200:hover{border-color:var(--color-blue-200)}.hover\:border-blue-300:hover{border-color:var(--color-blue-300)}.hover\:border-gray-200:hover{border-color:var(--color-gray-200)}.hover\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\:border-green-200:hover{border-color:var(--color-green-200)}.hover\:border-purple-300:hover{border-color:var(--color-purple-300)}.hover\:bg-amber-100:hover{background-color:var(--color-amber-100)}.hover\:bg-amber-700:hover{background-color:var(--color-amber-700)}.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}.hover\:bg-blue-50\/50:hover{background-color:#eff6ff80}@supports (color:color-mix(in lab, red, red)){.hover\:bg-blue-50\/50:hover{background-color:color-mix(in oklab, var(--color-blue-50) 50%, transparent)}}.hover\:bg-blue-100:hover{background-color:var(--color-blue-100)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-green-50\/50:hover{background-color:#f0fdf480}@supports (color:color-mix(in lab, red, red)){.hover\:bg-green-50\/50:hover{background-color:color-mix(in oklab, var(--color-green-50) 50%, transparent)}}.hover\:bg-green-100:hover{background-color:var(--color-green-100)}.hover\:bg-purple-100:hover{background-color:var(--color-purple-100)}.hover\:bg-purple-700:hover{background-color:var(--color-purple-700)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-100:hover{background-color:var(--color-red-100)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.hover\:text-blue-500:hover{color:var(--color-blue-500)}.hover\:text-blue-600:hover{color:var(--color-blue-600)}.hover\:text-blue-700:hover{color:var(--color-blue-700)}.hover\:text-blue-800:hover{color:var(--color-blue-800)}.hover\:text-gray-500:hover{color:var(--color-gray-500)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-gray-900:hover{color:var(--color-gray-900)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:border-red-500:focus{border-color:var(--color-red-500)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-amber-400:focus{--tw-ring-color:var(--color-amber-400)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-red-400:focus{--tw-ring-color:var(--color-red-400)}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:bg-blue-800:active{background-color:var(--color-blue-800)}.active\:bg-gray-200:active{background-color:var(--color-gray-200)}.active\:bg-gray-300:active{background-color:var(--color-gray-300)}.active\:bg-red-800:active{background-color:var(--color-red-800)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-50:disabled{background-color:var(--color-gray-50)}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:flex{display:flex}.sm\:inline-flex{display:inline-flex}}@media (width>=48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (width>=64rem){.lg\:sticky{position:sticky}.lg\:top-6{top:calc(var(--spacing) * 6)}.lg\:col-span-2{grid-column:span 2/span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:self-start{align-self:flex-start}}@media (width>=80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (prefers-color-scheme:dark){.dark\:border-blue-800{border-color:var(--color-blue-800)}.dark\:border-gray-700{border-color:var(--color-gray-700)}.dark\:bg-blue-900\/20{background-color:#1c398e33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-900\/20{background-color:color-mix(in oklab, var(--color-blue-900) 20%, transparent)}}.dark\:bg-gray-700{background-color:var(--color-gray-700)}.dark\:bg-gray-800\/50{background-color:#1e293980}@supports (color:color-mix(in lab, red, red)){.dark\:bg-gray-800\/50{background-color:color-mix(in oklab, var(--color-gray-800) 50%, transparent)}}.dark\:bg-red-900\/20{background-color:#82181a33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-900\/20{background-color:color-mix(in oklab, var(--color-red-900) 20%, transparent)}}.dark\:text-blue-400{color:var(--color-blue-400)}.dark\:text-gray-100{color:var(--color-gray-100)}.dark\:text-gray-300{color:var(--color-gray-300)}.dark\:text-gray-400{color:var(--color-gray-400)}.dark\:text-red-400{color:var(--color-red-400)}}}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif}#root{min-height:100vh}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#f1f5f9}::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#94a3b8}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.animate-shimmer{background:linear-gradient(90deg,#f1f5f9 4%,#e2e8f0 25%,#f1f5f9 36%) 0 0/1000px 100%;animation:2s infinite shimmer}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);export{u as a,d as i,o as n,c as r,s as t};
@@ -0,0 +1 @@
1
+ import{Nt as e,Pt as t}from"./vendor-BpBCrKSP.js";import{c as n}from"./vendor-flow-D-_WxBha.js";import{t as r}from"./vendor-motion-BsfSkSjj.js";function i(...n){return e(t(n))}function a(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}天${r%24}小时`:r>0?`${r}小时${n%60}分钟`:n>0?`${n}分钟${t%60}秒`:`${t}秒`}function o(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function s(e){let t={active:`text-green-600 bg-green-50`,completed:`text-blue-600 bg-blue-50`,failed:`text-red-600 bg-red-50`,interrupted:`text-yellow-600 bg-yellow-50`,pending:`text-gray-600 bg-gray-50`};return t[e]||t.pending}function c(e){return e?e.endsWith(`Z`)||/[+-]\d{2}:\d{2}$/.test(e)?new Date(e):new Date(e+`Z`):new Date}var l=n();function u({title:e,value:t,change:n,icon:a,color:o=`blue`,trend:s}){return(0,l.jsx)(r.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`relative overflow-hidden rounded-xl bg-white p-6 shadow-lg border border-gray-100`,children:(0,l.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`p`,{className:`text-sm font-medium text-gray-600`,children:e}),(0,l.jsx)(`p`,{className:`mt-2 text-3xl font-bold text-gray-900`,children:t}),n!==void 0&&(0,l.jsxs)(`div`,{className:i(`mt-2 flex items-center text-sm`,s===`up`?`text-green-600`:`text-red-600`),children:[(0,l.jsx)(`span`,{children:s===`up`?`↑`:`↓`}),(0,l.jsxs)(`span`,{className:`ml-1`,children:[Math.abs(n),`%`]}),(0,l.jsx)(`span`,{className:`ml-1 text-gray-500`,children:`vs 昨天`})]})]}),(0,l.jsx)(`div`,{className:i(`rounded-lg bg-gradient-to-br p-3`,{blue:`from-blue-500 to-blue-600`,green:`from-green-500 to-green-600`,purple:`from-purple-500 to-purple-600`,orange:`from-orange-500 to-orange-600`,red:`from-red-500 to-red-600`}[o]),children:(0,l.jsx)(a,{className:`h-6 w-6 text-white`})})]})})}function d({children:e,variant:t=`default`,size:n=`md`}){return(0,l.jsx)(`span`,{className:i(`inline-flex items-center rounded-full font-medium`,{default:`bg-gray-100 text-gray-700`,success:`bg-green-100 text-green-700`,warning:`bg-yellow-100 text-yellow-700`,danger:`bg-red-100 text-red-700`,info:`bg-blue-100 text-blue-700`}[t],{sm:`px-2 py-0.5 text-xs`,md:`px-3 py-1 text-sm`}[n]),children:e})}function f({children:e,variant:t=`primary`,size:n=`md`,loading:r,icon:a,className:o,disabled:s,...c}){return(0,l.jsxs)(`button`,{className:i(`inline-flex items-center justify-center gap-2 rounded-lg font-medium transition-colors`,`focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2`,`disabled:opacity-50 disabled:cursor-not-allowed`,{primary:`bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`,secondary:`bg-gray-100 text-gray-700 hover:bg-gray-200 active:bg-gray-300`,ghost:`bg-transparent text-gray-700 hover:bg-gray-100 active:bg-gray-200`,danger:`bg-red-600 text-white hover:bg-red-700 active:bg-red-800`}[t],{sm:`px-3 py-1.5 text-sm`,md:`px-4 py-2 text-sm`,lg:`px-6 py-3 text-base`}[n],o),disabled:s||r,...c,children:[r&&(0,l.jsxs)(`svg`,{className:`animate-spin h-4 w-4`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`,fill:`none`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}),a&&!r&&(0,l.jsx)(a,{className:`h-4 w-4`}),e]})}function p({children:e,className:t,title:n,action:r,...a}){return(0,l.jsxs)(`div`,{className:i(`rounded-xl bg-white p-6 shadow-sm border border-gray-100`,t),...a,children:[(n||r)&&(0,l.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[n&&(0,l.jsx)(`h3`,{className:`text-lg font-semibold text-gray-900`,children:n}),r]}),e]})}export{i as a,s as c,u as i,c as l,f as n,a as o,p as r,o as s,d as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{mr as t}from"./vendor-BpBCrKSP.js";var n=e(t(),1);function r(e,t=300){let[r,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let n=setTimeout(()=>i(e),t);return()=>clearTimeout(n)},[e,t]),r}export{r as t};
@@ -0,0 +1 @@
1
+ function e(e){return e?5e3:6e4}export{e as t};