@winspan/claude-forge 4.0.0 → 6.0.0

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 (1268) hide show
  1. package/README.md +116 -718
  2. package/dist/claudemd/claudemd-generator.d.ts +28 -0
  3. package/dist/claudemd/claudemd-generator.d.ts.map +1 -0
  4. package/dist/claudemd/claudemd-generator.js +97 -0
  5. package/dist/claudemd/claudemd-generator.js.map +1 -0
  6. package/dist/claudemd/index.d.ts +25 -42
  7. package/dist/claudemd/index.d.ts.map +1 -1
  8. package/dist/claudemd/index.js +26 -270
  9. package/dist/claudemd/index.js.map +1 -1
  10. package/dist/claudemd/persona-manager.d.ts +19 -0
  11. package/dist/claudemd/persona-manager.d.ts.map +1 -0
  12. package/dist/claudemd/persona-manager.js +88 -0
  13. package/dist/claudemd/persona-manager.js.map +1 -0
  14. package/dist/claudemd/resume-manager.d.ts +29 -0
  15. package/dist/claudemd/resume-manager.d.ts.map +1 -0
  16. package/dist/claudemd/resume-manager.js +155 -0
  17. package/dist/claudemd/resume-manager.js.map +1 -0
  18. package/dist/claudemd/tech-detector.d.ts +20 -0
  19. package/dist/claudemd/tech-detector.d.ts.map +1 -0
  20. package/dist/claudemd/tech-detector.js +142 -0
  21. package/dist/claudemd/tech-detector.js.map +1 -0
  22. package/dist/cli/commands/claudemd.d.ts +2 -2
  23. package/dist/cli/commands/claudemd.d.ts.map +1 -1
  24. package/dist/cli/commands/claudemd.js +62 -304
  25. package/dist/cli/commands/claudemd.js.map +1 -1
  26. package/dist/cli/commands/config.d.ts +1 -1
  27. package/dist/cli/commands/config.d.ts.map +1 -1
  28. package/dist/cli/commands/config.js +32 -168
  29. package/dist/cli/commands/config.js.map +1 -1
  30. package/dist/cli/commands/daemon.d.ts +2 -2
  31. package/dist/cli/commands/daemon.d.ts.map +1 -1
  32. package/dist/cli/commands/daemon.js +34 -300
  33. package/dist/cli/commands/daemon.js.map +1 -1
  34. package/dist/cli/commands/init.d.ts +3 -0
  35. package/dist/cli/commands/init.d.ts.map +1 -0
  36. package/dist/cli/commands/init.js +53 -0
  37. package/dist/cli/commands/init.js.map +1 -0
  38. package/dist/cli/commands/skills.d.ts +3 -0
  39. package/dist/cli/commands/skills.d.ts.map +1 -0
  40. package/dist/cli/commands/skills.js +83 -0
  41. package/dist/cli/commands/skills.js.map +1 -0
  42. package/dist/cli/commands/status.d.ts +1 -1
  43. package/dist/cli/commands/status.d.ts.map +1 -1
  44. package/dist/cli/commands/status.js +45 -52
  45. package/dist/cli/commands/status.js.map +1 -1
  46. package/dist/cli/index.js +15 -48
  47. package/dist/cli/index.js.map +1 -1
  48. package/dist/cli/init/hook-manager.d.ts +19 -0
  49. package/dist/cli/init/hook-manager.d.ts.map +1 -0
  50. package/dist/cli/init/hook-manager.js +99 -0
  51. package/dist/cli/init/hook-manager.js.map +1 -0
  52. package/dist/core/ai/provider.d.ts +25 -0
  53. package/dist/core/ai/provider.d.ts.map +1 -0
  54. package/dist/core/ai/provider.js +68 -0
  55. package/dist/core/ai/provider.js.map +1 -0
  56. package/dist/core/ai/types.d.ts +12 -0
  57. package/dist/core/ai/types.d.ts.map +1 -0
  58. package/dist/core/ai/types.js +5 -0
  59. package/dist/core/ai/types.js.map +1 -0
  60. package/dist/core/config.d.ts +18 -0
  61. package/dist/core/config.d.ts.map +1 -0
  62. package/dist/core/config.js +72 -0
  63. package/dist/core/config.js.map +1 -0
  64. package/dist/core/constants.d.ts +39 -0
  65. package/dist/core/constants.d.ts.map +1 -0
  66. package/dist/core/constants.js +41 -0
  67. package/dist/core/constants.js.map +1 -0
  68. package/dist/core/storage/schema.sql +109 -0
  69. package/dist/core/storage/sqlite.d.ts +32 -0
  70. package/dist/core/storage/sqlite.d.ts.map +1 -0
  71. package/dist/core/storage/sqlite.js +163 -0
  72. package/dist/core/storage/sqlite.js.map +1 -0
  73. package/dist/core/types.d.ts +45 -0
  74. package/dist/core/types.d.ts.map +1 -0
  75. package/dist/core/types.js +2 -0
  76. package/dist/core/types.js.map +1 -0
  77. package/dist/core/utils/forge-resume-block.d.ts.map +1 -0
  78. package/dist/core/utils/forge-resume-block.js.map +1 -0
  79. package/dist/core/utils/logger.d.ts +17 -0
  80. package/dist/core/utils/logger.d.ts.map +1 -0
  81. package/dist/core/utils/logger.js +40 -0
  82. package/dist/core/utils/logger.js.map +1 -0
  83. package/dist/core/utils/lru-cache.d.ts +14 -0
  84. package/dist/core/utils/lru-cache.d.ts.map +1 -0
  85. package/dist/core/utils/lru-cache.js +42 -0
  86. package/dist/core/utils/lru-cache.js.map +1 -0
  87. package/dist/core/utils/path.d.ts +9 -0
  88. package/dist/core/utils/path.d.ts.map +1 -0
  89. package/dist/core/utils/path.js +18 -0
  90. package/dist/core/utils/path.js.map +1 -0
  91. package/dist/daemon/event-parser.d.ts +1 -1
  92. package/dist/daemon/event-parser.d.ts.map +1 -1
  93. package/dist/daemon/event-parser.js +5 -3
  94. package/dist/daemon/event-parser.js.map +1 -1
  95. package/dist/daemon/handlers/history-exporter.d.ts +15 -0
  96. package/dist/daemon/handlers/history-exporter.d.ts.map +1 -0
  97. package/dist/daemon/handlers/history-exporter.js +94 -0
  98. package/dist/daemon/handlers/history-exporter.js.map +1 -0
  99. package/dist/daemon/handlers/post-tool-use.d.ts +16 -0
  100. package/dist/daemon/handlers/post-tool-use.d.ts.map +1 -0
  101. package/dist/daemon/handlers/post-tool-use.js +48 -0
  102. package/dist/daemon/handlers/post-tool-use.js.map +1 -0
  103. package/dist/daemon/handlers/pre-tool-use.d.ts +19 -0
  104. package/dist/daemon/handlers/pre-tool-use.d.ts.map +1 -0
  105. package/dist/daemon/handlers/pre-tool-use.js +50 -0
  106. package/dist/daemon/handlers/pre-tool-use.js.map +1 -0
  107. package/dist/daemon/handlers/stop.d.ts +19 -0
  108. package/dist/daemon/handlers/stop.d.ts.map +1 -0
  109. package/dist/daemon/handlers/stop.js +42 -0
  110. package/dist/daemon/handlers/stop.js.map +1 -0
  111. package/dist/daemon/handlers/user-prompt.d.ts +21 -0
  112. package/dist/daemon/handlers/user-prompt.d.ts.map +1 -0
  113. package/dist/daemon/handlers/user-prompt.js +69 -0
  114. package/dist/daemon/handlers/user-prompt.js.map +1 -0
  115. package/dist/daemon/index.d.ts +10 -0
  116. package/dist/daemon/index.d.ts.map +1 -1
  117. package/dist/daemon/index.js +81 -535
  118. package/dist/daemon/index.js.map +1 -1
  119. package/dist/daemon/lifecycle.d.ts +0 -9
  120. package/dist/daemon/lifecycle.d.ts.map +1 -1
  121. package/dist/daemon/lifecycle.js +1 -23
  122. package/dist/daemon/lifecycle.js.map +1 -1
  123. package/dist/daemon/router.d.ts +13 -0
  124. package/dist/daemon/router.d.ts.map +1 -0
  125. package/dist/daemon/router.js +7 -0
  126. package/dist/daemon/router.js.map +1 -0
  127. package/dist/daemon/server.d.ts +2 -6
  128. package/dist/daemon/server.d.ts.map +1 -1
  129. package/dist/daemon/server.js +2 -21
  130. package/dist/daemon/server.js.map +1 -1
  131. package/dist/engine/context-builder.d.ts +23 -0
  132. package/dist/engine/context-builder.d.ts.map +1 -0
  133. package/dist/engine/context-builder.js +63 -0
  134. package/dist/engine/context-builder.js.map +1 -0
  135. package/dist/engine/conventions/basic-security.yaml +100 -0
  136. package/dist/engine/conventions/code-quality.yaml +123 -0
  137. package/dist/engine/conventions/dependency-safety.yaml +131 -0
  138. package/dist/engine/conventions/git-safety.yaml +105 -0
  139. package/dist/engine/conventions/strict-security.yaml +30 -0
  140. package/dist/engine/conventions/ts-quality.yaml +49 -0
  141. package/dist/engine/dsl/compiler.d.ts +34 -0
  142. package/dist/engine/dsl/compiler.d.ts.map +1 -0
  143. package/dist/engine/dsl/compiler.js +620 -0
  144. package/dist/engine/dsl/compiler.js.map +1 -0
  145. package/dist/engine/dsl/parser.d.ts +19 -0
  146. package/dist/engine/dsl/parser.d.ts.map +1 -0
  147. package/dist/engine/dsl/parser.js +174 -0
  148. package/dist/engine/dsl/parser.js.map +1 -0
  149. package/dist/engine/dsl/runtime.d.ts +46 -0
  150. package/dist/engine/dsl/runtime.d.ts.map +1 -0
  151. package/dist/engine/dsl/runtime.js +173 -0
  152. package/dist/engine/dsl/runtime.js.map +1 -0
  153. package/dist/engine/dsl/types.d.ts +113 -0
  154. package/dist/engine/dsl/types.d.ts.map +1 -0
  155. package/dist/engine/dsl/types.js +11 -0
  156. package/dist/engine/dsl/types.js.map +1 -0
  157. package/dist/engine/evidence-store.d.ts +44 -0
  158. package/dist/engine/evidence-store.d.ts.map +1 -0
  159. package/dist/engine/evidence-store.js +106 -0
  160. package/dist/engine/evidence-store.js.map +1 -0
  161. package/dist/engine/rule-engine.d.ts +28 -0
  162. package/dist/engine/rule-engine.d.ts.map +1 -0
  163. package/dist/engine/rule-engine.js +196 -0
  164. package/dist/engine/rule-engine.js.map +1 -0
  165. package/dist/intelligence/classifier.d.ts +27 -0
  166. package/dist/intelligence/classifier.d.ts.map +1 -0
  167. package/dist/intelligence/classifier.js +142 -0
  168. package/dist/intelligence/classifier.js.map +1 -0
  169. package/dist/intelligence/distiller.d.ts +22 -0
  170. package/dist/intelligence/distiller.d.ts.map +1 -0
  171. package/dist/intelligence/distiller.js +108 -0
  172. package/dist/intelligence/distiller.js.map +1 -0
  173. package/dist/intelligence/quality-gate.d.ts +43 -0
  174. package/dist/intelligence/quality-gate.d.ts.map +1 -0
  175. package/dist/intelligence/quality-gate.js +168 -0
  176. package/dist/intelligence/quality-gate.js.map +1 -0
  177. package/dist/skills/index.d.ts +3 -0
  178. package/dist/skills/index.d.ts.map +1 -0
  179. package/dist/skills/index.js +3 -0
  180. package/dist/skills/index.js.map +1 -0
  181. package/dist/skills/matcher.d.ts +10 -0
  182. package/dist/skills/matcher.d.ts.map +1 -0
  183. package/dist/skills/matcher.js +14 -0
  184. package/dist/skills/matcher.js.map +1 -0
  185. package/dist/skills/official-skills.d.ts +22 -0
  186. package/dist/skills/official-skills.d.ts.map +1 -0
  187. package/dist/skills/official-skills.js +531 -0
  188. package/dist/skills/official-skills.js.map +1 -0
  189. package/dist/skills/registry.d.ts +31 -0
  190. package/dist/skills/registry.d.ts.map +1 -0
  191. package/dist/skills/registry.js +100 -0
  192. package/dist/skills/registry.js.map +1 -0
  193. package/dist/web/server.d.ts +9 -8
  194. package/dist/web/server.d.ts.map +1 -1
  195. package/dist/web/server.js +40 -231
  196. package/dist/web/server.js.map +1 -1
  197. package/dist/web/static/index.html +140 -0
  198. package/package.json +3 -26
  199. package/dist/ai/base-provider.d.ts +0 -48
  200. package/dist/ai/base-provider.d.ts.map +0 -1
  201. package/dist/ai/base-provider.js +0 -173
  202. package/dist/ai/base-provider.js.map +0 -1
  203. package/dist/ai/factory.d.ts +0 -16
  204. package/dist/ai/factory.d.ts.map +0 -1
  205. package/dist/ai/factory.js +0 -22
  206. package/dist/ai/factory.js.map +0 -1
  207. package/dist/ai/index.d.ts +0 -40
  208. package/dist/ai/index.d.ts.map +0 -1
  209. package/dist/ai/index.js +0 -153
  210. package/dist/ai/index.js.map +0 -1
  211. package/dist/ai/model-selector.d.ts +0 -24
  212. package/dist/ai/model-selector.d.ts.map +0 -1
  213. package/dist/ai/model-selector.js +0 -91
  214. package/dist/ai/model-selector.js.map +0 -1
  215. package/dist/ai/ollama-provider.d.ts +0 -20
  216. package/dist/ai/ollama-provider.d.ts.map +0 -1
  217. package/dist/ai/ollama-provider.js +0 -47
  218. package/dist/ai/ollama-provider.js.map +0 -1
  219. package/dist/ai/openai-provider.d.ts +0 -21
  220. package/dist/ai/openai-provider.d.ts.map +0 -1
  221. package/dist/ai/openai-provider.js +0 -53
  222. package/dist/ai/openai-provider.js.map +0 -1
  223. package/dist/ai/rate-limiter.d.ts +0 -33
  224. package/dist/ai/rate-limiter.d.ts.map +0 -1
  225. package/dist/ai/rate-limiter.js +0 -83
  226. package/dist/ai/rate-limiter.js.map +0 -1
  227. package/dist/ai/response-cache.d.ts +0 -24
  228. package/dist/ai/response-cache.d.ts.map +0 -1
  229. package/dist/ai/response-cache.js +0 -86
  230. package/dist/ai/response-cache.js.map +0 -1
  231. package/dist/ai/token-budget.d.ts +0 -83
  232. package/dist/ai/token-budget.d.ts.map +0 -1
  233. package/dist/ai/token-budget.js +0 -171
  234. package/dist/ai/token-budget.js.map +0 -1
  235. package/dist/ai/types.d.ts +0 -58
  236. package/dist/ai/types.d.ts.map +0 -1
  237. package/dist/ai/types.js +0 -23
  238. package/dist/ai/types.js.map +0 -1
  239. package/dist/autopilot/ground-truth-rules.d.ts +0 -64
  240. package/dist/autopilot/ground-truth-rules.d.ts.map +0 -1
  241. package/dist/autopilot/ground-truth-rules.js +0 -129
  242. package/dist/autopilot/ground-truth-rules.js.map +0 -1
  243. package/dist/autopilot/index.d.ts +0 -2
  244. package/dist/autopilot/index.d.ts.map +0 -1
  245. package/dist/autopilot/index.js +0 -2
  246. package/dist/autopilot/index.js.map +0 -1
  247. package/dist/autopilot/issue-tracker.d.ts +0 -52
  248. package/dist/autopilot/issue-tracker.d.ts.map +0 -1
  249. package/dist/autopilot/issue-tracker.js +0 -138
  250. package/dist/autopilot/issue-tracker.js.map +0 -1
  251. package/dist/autopilot/phase-gap-detector.d.ts +0 -26
  252. package/dist/autopilot/phase-gap-detector.d.ts.map +0 -1
  253. package/dist/autopilot/phase-gap-detector.js +0 -80
  254. package/dist/autopilot/phase-gap-detector.js.map +0 -1
  255. package/dist/autopilot/quality-gate-utils.d.ts +0 -6
  256. package/dist/autopilot/quality-gate-utils.d.ts.map +0 -1
  257. package/dist/autopilot/quality-gate-utils.js +0 -48
  258. package/dist/autopilot/quality-gate-utils.js.map +0 -1
  259. package/dist/autopilot/quality-gate.d.ts +0 -187
  260. package/dist/autopilot/quality-gate.d.ts.map +0 -1
  261. package/dist/autopilot/quality-gate.js +0 -815
  262. package/dist/autopilot/quality-gate.js.map +0 -1
  263. package/dist/autopilot/rule-distiller.d.ts +0 -44
  264. package/dist/autopilot/rule-distiller.d.ts.map +0 -1
  265. package/dist/autopilot/rule-distiller.js +0 -176
  266. package/dist/autopilot/rule-distiller.js.map +0 -1
  267. package/dist/autopilot/task-completion-detector.d.ts +0 -32
  268. package/dist/autopilot/task-completion-detector.d.ts.map +0 -1
  269. package/dist/autopilot/task-completion-detector.js +0 -116
  270. package/dist/autopilot/task-completion-detector.js.map +0 -1
  271. package/dist/backup/index.d.ts +0 -16
  272. package/dist/backup/index.d.ts.map +0 -1
  273. package/dist/backup/index.js +0 -170
  274. package/dist/backup/index.js.map +0 -1
  275. package/dist/claudemd/detector.d.ts +0 -55
  276. package/dist/claudemd/detector.d.ts.map +0 -1
  277. package/dist/claudemd/detector.js +0 -588
  278. package/dist/claudemd/detector.js.map +0 -1
  279. package/dist/claudemd/modules-config.d.ts +0 -37
  280. package/dist/claudemd/modules-config.d.ts.map +0 -1
  281. package/dist/claudemd/modules-config.js +0 -80
  282. package/dist/claudemd/modules-config.js.map +0 -1
  283. package/dist/claudemd/prompt-injector.d.ts +0 -29
  284. package/dist/claudemd/prompt-injector.d.ts.map +0 -1
  285. package/dist/claudemd/prompt-injector.js +0 -143
  286. package/dist/claudemd/prompt-injector.js.map +0 -1
  287. package/dist/claudemd/prompts.d.ts +0 -19
  288. package/dist/claudemd/prompts.d.ts.map +0 -1
  289. package/dist/claudemd/prompts.js +0 -476
  290. package/dist/claudemd/prompts.js.map +0 -1
  291. package/dist/claudemd/writer.d.ts +0 -48
  292. package/dist/claudemd/writer.d.ts.map +0 -1
  293. package/dist/claudemd/writer.js +0 -205
  294. package/dist/claudemd/writer.js.map +0 -1
  295. package/dist/cli/commands/backup.d.ts +0 -3
  296. package/dist/cli/commands/backup.d.ts.map +0 -1
  297. package/dist/cli/commands/backup.js +0 -102
  298. package/dist/cli/commands/backup.js.map +0 -1
  299. package/dist/cli/commands/convention.d.ts +0 -3
  300. package/dist/cli/commands/convention.d.ts.map +0 -1
  301. package/dist/cli/commands/convention.js +0 -169
  302. package/dist/cli/commands/convention.js.map +0 -1
  303. package/dist/cli/commands/distill.d.ts +0 -3
  304. package/dist/cli/commands/distill.d.ts.map +0 -1
  305. package/dist/cli/commands/distill.js +0 -57
  306. package/dist/cli/commands/distill.js.map +0 -1
  307. package/dist/cli/commands/init/doctor.d.ts +0 -23
  308. package/dist/cli/commands/init/doctor.d.ts.map +0 -1
  309. package/dist/cli/commands/init/doctor.js +0 -217
  310. package/dist/cli/commands/init/doctor.js.map +0 -1
  311. package/dist/cli/commands/init/hook-manager.d.ts +0 -30
  312. package/dist/cli/commands/init/hook-manager.d.ts.map +0 -1
  313. package/dist/cli/commands/init/hook-manager.js +0 -189
  314. package/dist/cli/commands/init/hook-manager.js.map +0 -1
  315. package/dist/cli/commands/init/index.d.ts +0 -5
  316. package/dist/cli/commands/init/index.d.ts.map +0 -1
  317. package/dist/cli/commands/init/index.js +0 -147
  318. package/dist/cli/commands/init/index.js.map +0 -1
  319. package/dist/cli/commands/init/project-doctor.d.ts +0 -15
  320. package/dist/cli/commands/init/project-doctor.d.ts.map +0 -1
  321. package/dist/cli/commands/init/project-doctor.js +0 -375
  322. package/dist/cli/commands/init/project-doctor.js.map +0 -1
  323. package/dist/cli/commands/logs.d.ts +0 -3
  324. package/dist/cli/commands/logs.d.ts.map +0 -1
  325. package/dist/cli/commands/logs.js +0 -520
  326. package/dist/cli/commands/logs.js.map +0 -1
  327. package/dist/cli/commands/pattern.d.ts +0 -3
  328. package/dist/cli/commands/pattern.d.ts.map +0 -1
  329. package/dist/cli/commands/pattern.js +0 -129
  330. package/dist/cli/commands/pattern.js.map +0 -1
  331. package/dist/cli/commands/pipeline.d.ts +0 -3
  332. package/dist/cli/commands/pipeline.d.ts.map +0 -1
  333. package/dist/cli/commands/pipeline.js +0 -123
  334. package/dist/cli/commands/pipeline.js.map +0 -1
  335. package/dist/cli/commands/project.d.ts +0 -3
  336. package/dist/cli/commands/project.d.ts.map +0 -1
  337. package/dist/cli/commands/project.js +0 -72
  338. package/dist/cli/commands/project.js.map +0 -1
  339. package/dist/cli/commands/query.d.ts +0 -3
  340. package/dist/cli/commands/query.d.ts.map +0 -1
  341. package/dist/cli/commands/query.js +0 -231
  342. package/dist/cli/commands/query.js.map +0 -1
  343. package/dist/cli/commands/skill.d.ts +0 -3
  344. package/dist/cli/commands/skill.d.ts.map +0 -1
  345. package/dist/cli/commands/skill.js +0 -531
  346. package/dist/cli/commands/skill.js.map +0 -1
  347. package/dist/cli/commands/web.d.ts +0 -3
  348. package/dist/cli/commands/web.d.ts.map +0 -1
  349. package/dist/cli/commands/web.js +0 -37
  350. package/dist/cli/commands/web.js.map +0 -1
  351. package/dist/cli/tui.d.ts +0 -2
  352. package/dist/cli/tui.d.ts.map +0 -1
  353. package/dist/cli/tui.js +0 -333
  354. package/dist/cli/tui.js.map +0 -1
  355. package/dist/cli/utils/errors.d.ts +0 -17
  356. package/dist/cli/utils/errors.d.ts.map +0 -1
  357. package/dist/cli/utils/errors.js +0 -42
  358. package/dist/cli/utils/errors.js.map +0 -1
  359. package/dist/cli/utils/output.d.ts +0 -23
  360. package/dist/cli/utils/output.d.ts.map +0 -1
  361. package/dist/cli/utils/output.js +0 -98
  362. package/dist/cli/utils/output.js.map +0 -1
  363. package/dist/config/defaults.d.ts +0 -3
  364. package/dist/config/defaults.d.ts.map +0 -1
  365. package/dist/config/defaults.js +0 -72
  366. package/dist/config/defaults.js.map +0 -1
  367. package/dist/config/index.d.ts +0 -25
  368. package/dist/config/index.d.ts.map +0 -1
  369. package/dist/config/index.js +0 -161
  370. package/dist/config/index.js.map +0 -1
  371. package/dist/config/schema.d.ts +0 -87
  372. package/dist/config/schema.d.ts.map +0 -1
  373. package/dist/config/schema.js +0 -129
  374. package/dist/config/schema.js.map +0 -1
  375. package/dist/constants.d.ts +0 -406
  376. package/dist/constants.d.ts.map +0 -1
  377. package/dist/constants.js +0 -448
  378. package/dist/constants.js.map +0 -1
  379. package/dist/convention/convention-evolver.d.ts +0 -31
  380. package/dist/convention/convention-evolver.d.ts.map +0 -1
  381. package/dist/convention/convention-evolver.js +0 -175
  382. package/dist/convention/convention-evolver.js.map +0 -1
  383. package/dist/convention/convention-loader.d.ts +0 -22
  384. package/dist/convention/convention-loader.d.ts.map +0 -1
  385. package/dist/convention/convention-loader.js +0 -184
  386. package/dist/convention/convention-loader.js.map +0 -1
  387. package/dist/convention/convention-manager.d.ts +0 -84
  388. package/dist/convention/convention-manager.d.ts.map +0 -1
  389. package/dist/convention/convention-manager.js +0 -305
  390. package/dist/convention/convention-manager.js.map +0 -1
  391. package/dist/convention/index.d.ts +0 -5
  392. package/dist/convention/index.d.ts.map +0 -1
  393. package/dist/convention/index.js +0 -4
  394. package/dist/convention/index.js.map +0 -1
  395. package/dist/convention/types.d.ts +0 -226
  396. package/dist/convention/types.d.ts.map +0 -1
  397. package/dist/convention/types.js +0 -13
  398. package/dist/convention/types.js.map +0 -1
  399. package/dist/daemon/context-injector.d.ts +0 -41
  400. package/dist/daemon/context-injector.d.ts.map +0 -1
  401. package/dist/daemon/context-injector.js +0 -100
  402. package/dist/daemon/context-injector.js.map +0 -1
  403. package/dist/daemon/engine-registry/init-autopilot.d.ts +0 -11
  404. package/dist/daemon/engine-registry/init-autopilot.d.ts.map +0 -1
  405. package/dist/daemon/engine-registry/init-autopilot.js +0 -17
  406. package/dist/daemon/engine-registry/init-autopilot.js.map +0 -1
  407. package/dist/daemon/engine-registry/init-distill.d.ts +0 -6
  408. package/dist/daemon/engine-registry/init-distill.d.ts.map +0 -1
  409. package/dist/daemon/engine-registry/init-distill.js +0 -34
  410. package/dist/daemon/engine-registry/init-distill.js.map +0 -1
  411. package/dist/daemon/engine-registry/init-governance.d.ts +0 -10
  412. package/dist/daemon/engine-registry/init-governance.d.ts.map +0 -1
  413. package/dist/daemon/engine-registry/init-governance.js +0 -22
  414. package/dist/daemon/engine-registry/init-governance.js.map +0 -1
  415. package/dist/daemon/engine-registry/init-orchestration.d.ts +0 -5
  416. package/dist/daemon/engine-registry/init-orchestration.d.ts.map +0 -1
  417. package/dist/daemon/engine-registry/init-orchestration.js +0 -13
  418. package/dist/daemon/engine-registry/init-orchestration.js.map +0 -1
  419. package/dist/daemon/engine-registry/init-pipeline.d.ts +0 -7
  420. package/dist/daemon/engine-registry/init-pipeline.d.ts.map +0 -1
  421. package/dist/daemon/engine-registry/init-pipeline.js +0 -16
  422. package/dist/daemon/engine-registry/init-pipeline.js.map +0 -1
  423. package/dist/daemon/engine-registry/init-resume.d.ts +0 -6
  424. package/dist/daemon/engine-registry/init-resume.d.ts.map +0 -1
  425. package/dist/daemon/engine-registry/init-resume.js +0 -20
  426. package/dist/daemon/engine-registry/init-resume.js.map +0 -1
  427. package/dist/daemon/engine-registry/init-skill-registry.d.ts +0 -10
  428. package/dist/daemon/engine-registry/init-skill-registry.d.ts.map +0 -1
  429. package/dist/daemon/engine-registry/init-skill-registry.js +0 -47
  430. package/dist/daemon/engine-registry/init-skill-registry.js.map +0 -1
  431. package/dist/daemon/engine-registry.d.ts +0 -13
  432. package/dist/daemon/engine-registry.d.ts.map +0 -1
  433. package/dist/daemon/engine-registry.js +0 -105
  434. package/dist/daemon/engine-registry.js.map +0 -1
  435. package/dist/daemon/handler-context.d.ts +0 -59
  436. package/dist/daemon/handler-context.d.ts.map +0 -1
  437. package/dist/daemon/handler-context.js +0 -2
  438. package/dist/daemon/handler-context.js.map +0 -1
  439. package/dist/daemon/handlers/base-handler.d.ts +0 -14
  440. package/dist/daemon/handlers/base-handler.d.ts.map +0 -1
  441. package/dist/daemon/handlers/base-handler.js +0 -18
  442. package/dist/daemon/handlers/base-handler.js.map +0 -1
  443. package/dist/daemon/handlers/context-builder.d.ts +0 -45
  444. package/dist/daemon/handlers/context-builder.d.ts.map +0 -1
  445. package/dist/daemon/handlers/context-builder.js +0 -363
  446. package/dist/daemon/handlers/context-builder.js.map +0 -1
  447. package/dist/daemon/handlers/conversational-config-handler.d.ts +0 -24
  448. package/dist/daemon/handlers/conversational-config-handler.d.ts.map +0 -1
  449. package/dist/daemon/handlers/conversational-config-handler.js +0 -177
  450. package/dist/daemon/handlers/conversational-config-handler.js.map +0 -1
  451. package/dist/daemon/handlers/orchestration-context.d.ts +0 -39
  452. package/dist/daemon/handlers/orchestration-context.d.ts.map +0 -1
  453. package/dist/daemon/handlers/orchestration-context.js +0 -2
  454. package/dist/daemon/handlers/orchestration-context.js.map +0 -1
  455. package/dist/daemon/handlers/post-tool-use-handler.d.ts +0 -11
  456. package/dist/daemon/handlers/post-tool-use-handler.d.ts.map +0 -1
  457. package/dist/daemon/handlers/post-tool-use-handler.js +0 -308
  458. package/dist/daemon/handlers/post-tool-use-handler.js.map +0 -1
  459. package/dist/daemon/handlers/pre-tool-use-handler.d.ts +0 -11
  460. package/dist/daemon/handlers/pre-tool-use-handler.d.ts.map +0 -1
  461. package/dist/daemon/handlers/pre-tool-use-handler.js +0 -175
  462. package/dist/daemon/handlers/pre-tool-use-handler.js.map +0 -1
  463. package/dist/daemon/handlers/safe-handler.d.ts +0 -15
  464. package/dist/daemon/handlers/safe-handler.d.ts.map +0 -1
  465. package/dist/daemon/handlers/safe-handler.js +0 -24
  466. package/dist/daemon/handlers/safe-handler.js.map +0 -1
  467. package/dist/daemon/handlers/session-cleanup.d.ts +0 -41
  468. package/dist/daemon/handlers/session-cleanup.d.ts.map +0 -1
  469. package/dist/daemon/handlers/session-cleanup.js +0 -392
  470. package/dist/daemon/handlers/session-cleanup.js.map +0 -1
  471. package/dist/daemon/handlers/stages/01-failure-signal.d.ts +0 -9
  472. package/dist/daemon/handlers/stages/01-failure-signal.d.ts.map +0 -1
  473. package/dist/daemon/handlers/stages/01-failure-signal.js +0 -40
  474. package/dist/daemon/handlers/stages/01-failure-signal.js.map +0 -1
  475. package/dist/daemon/handlers/stages/02-active-intervention.d.ts +0 -9
  476. package/dist/daemon/handlers/stages/02-active-intervention.d.ts.map +0 -1
  477. package/dist/daemon/handlers/stages/02-active-intervention.js +0 -28
  478. package/dist/daemon/handlers/stages/02-active-intervention.js.map +0 -1
  479. package/dist/daemon/handlers/stages/03-init-prompt.d.ts +0 -9
  480. package/dist/daemon/handlers/stages/03-init-prompt.d.ts.map +0 -1
  481. package/dist/daemon/handlers/stages/03-init-prompt.js +0 -24
  482. package/dist/daemon/handlers/stages/03-init-prompt.js.map +0 -1
  483. package/dist/daemon/handlers/stages/04-skill-suggestions.d.ts +0 -9
  484. package/dist/daemon/handlers/stages/04-skill-suggestions.d.ts.map +0 -1
  485. package/dist/daemon/handlers/stages/04-skill-suggestions.js +0 -24
  486. package/dist/daemon/handlers/stages/04-skill-suggestions.js.map +0 -1
  487. package/dist/daemon/handlers/stages/05-conv-config.d.ts +0 -11
  488. package/dist/daemon/handlers/stages/05-conv-config.d.ts.map +0 -1
  489. package/dist/daemon/handlers/stages/05-conv-config.js +0 -24
  490. package/dist/daemon/handlers/stages/05-conv-config.js.map +0 -1
  491. package/dist/daemon/handlers/stages/06-engine-check.d.ts +0 -9
  492. package/dist/daemon/handlers/stages/06-engine-check.d.ts.map +0 -1
  493. package/dist/daemon/handlers/stages/06-engine-check.js +0 -14
  494. package/dist/daemon/handlers/stages/06-engine-check.js.map +0 -1
  495. package/dist/daemon/handlers/stages/07-pipeline-reply.d.ts +0 -10
  496. package/dist/daemon/handlers/stages/07-pipeline-reply.d.ts.map +0 -1
  497. package/dist/daemon/handlers/stages/07-pipeline-reply.js +0 -60
  498. package/dist/daemon/handlers/stages/07-pipeline-reply.js.map +0 -1
  499. package/dist/daemon/handlers/stages/08-esc-interrupt.d.ts +0 -9
  500. package/dist/daemon/handlers/stages/08-esc-interrupt.d.ts.map +0 -1
  501. package/dist/daemon/handlers/stages/08-esc-interrupt.js +0 -29
  502. package/dist/daemon/handlers/stages/08-esc-interrupt.js.map +0 -1
  503. package/dist/daemon/handlers/stages/09-pipeline-active.d.ts +0 -11
  504. package/dist/daemon/handlers/stages/09-pipeline-active.d.ts.map +0 -1
  505. package/dist/daemon/handlers/stages/09-pipeline-active.js +0 -75
  506. package/dist/daemon/handlers/stages/09-pipeline-active.js.map +0 -1
  507. package/dist/daemon/handlers/stages/10-cooldown.d.ts +0 -9
  508. package/dist/daemon/handlers/stages/10-cooldown.d.ts.map +0 -1
  509. package/dist/daemon/handlers/stages/10-cooldown.js +0 -27
  510. package/dist/daemon/handlers/stages/10-cooldown.js.map +0 -1
  511. package/dist/daemon/handlers/stages/11-intent-analysis.d.ts +0 -12
  512. package/dist/daemon/handlers/stages/11-intent-analysis.d.ts.map +0 -1
  513. package/dist/daemon/handlers/stages/11-intent-analysis.js +0 -88
  514. package/dist/daemon/handlers/stages/11-intent-analysis.js.map +0 -1
  515. package/dist/daemon/handlers/stages/12-strategy-advice.d.ts +0 -9
  516. package/dist/daemon/handlers/stages/12-strategy-advice.d.ts.map +0 -1
  517. package/dist/daemon/handlers/stages/12-strategy-advice.js +0 -23
  518. package/dist/daemon/handlers/stages/12-strategy-advice.js.map +0 -1
  519. package/dist/daemon/handlers/stages/13-template-route.d.ts +0 -9
  520. package/dist/daemon/handlers/stages/13-template-route.d.ts.map +0 -1
  521. package/dist/daemon/handlers/stages/13-template-route.js +0 -49
  522. package/dist/daemon/handlers/stages/13-template-route.js.map +0 -1
  523. package/dist/daemon/handlers/stages/14-plan-resume.d.ts +0 -9
  524. package/dist/daemon/handlers/stages/14-plan-resume.d.ts.map +0 -1
  525. package/dist/daemon/handlers/stages/14-plan-resume.js +0 -47
  526. package/dist/daemon/handlers/stages/14-plan-resume.js.map +0 -1
  527. package/dist/daemon/handlers/stages/15-plan-enforcement.d.ts +0 -9
  528. package/dist/daemon/handlers/stages/15-plan-enforcement.d.ts.map +0 -1
  529. package/dist/daemon/handlers/stages/15-plan-enforcement.js +0 -42
  530. package/dist/daemon/handlers/stages/15-plan-enforcement.js.map +0 -1
  531. package/dist/daemon/handlers/stages/17-simple-task.d.ts +0 -9
  532. package/dist/daemon/handlers/stages/17-simple-task.d.ts.map +0 -1
  533. package/dist/daemon/handlers/stages/17-simple-task.js +0 -33
  534. package/dist/daemon/handlers/stages/17-simple-task.js.map +0 -1
  535. package/dist/daemon/handlers/stages/18-complex-task.d.ts +0 -15
  536. package/dist/daemon/handlers/stages/18-complex-task.d.ts.map +0 -1
  537. package/dist/daemon/handlers/stages/18-complex-task.js +0 -161
  538. package/dist/daemon/handlers/stages/18-complex-task.js.map +0 -1
  539. package/dist/daemon/handlers/stages/stage-interface.d.ts +0 -32
  540. package/dist/daemon/handlers/stages/stage-interface.d.ts.map +0 -1
  541. package/dist/daemon/handlers/stages/stage-interface.js +0 -2
  542. package/dist/daemon/handlers/stages/stage-interface.js.map +0 -1
  543. package/dist/daemon/handlers/stages/stage-scheduler.d.ts +0 -27
  544. package/dist/daemon/handlers/stages/stage-scheduler.d.ts.map +0 -1
  545. package/dist/daemon/handlers/stages/stage-scheduler.js +0 -105
  546. package/dist/daemon/handlers/stages/stage-scheduler.js.map +0 -1
  547. package/dist/daemon/handlers/stop-handler.d.ts +0 -18
  548. package/dist/daemon/handlers/stop-handler.d.ts.map +0 -1
  549. package/dist/daemon/handlers/stop-handler.js +0 -274
  550. package/dist/daemon/handlers/stop-handler.js.map +0 -1
  551. package/dist/daemon/handlers/user-prompt-handler.d.ts +0 -34
  552. package/dist/daemon/handlers/user-prompt-handler.d.ts.map +0 -1
  553. package/dist/daemon/handlers/user-prompt-handler.js +0 -230
  554. package/dist/daemon/handlers/user-prompt-handler.js.map +0 -1
  555. package/dist/daemon/pending-prompts.d.ts +0 -31
  556. package/dist/daemon/pending-prompts.d.ts.map +0 -1
  557. package/dist/daemon/pending-prompts.js +0 -57
  558. package/dist/daemon/pending-prompts.js.map +0 -1
  559. package/dist/daemon/tool-summary.d.ts +0 -10
  560. package/dist/daemon/tool-summary.d.ts.map +0 -1
  561. package/dist/daemon/tool-summary.js +0 -68
  562. package/dist/daemon/tool-summary.js.map +0 -1
  563. package/dist/distill/index.d.ts +0 -26
  564. package/dist/distill/index.d.ts.map +0 -1
  565. package/dist/distill/index.js +0 -155
  566. package/dist/distill/index.js.map +0 -1
  567. package/dist/distill/prompts.d.ts +0 -7
  568. package/dist/distill/prompts.d.ts.map +0 -1
  569. package/dist/distill/prompts.js +0 -100
  570. package/dist/distill/prompts.js.map +0 -1
  571. package/dist/distill/tree-index.d.ts +0 -40
  572. package/dist/distill/tree-index.d.ts.map +0 -1
  573. package/dist/distill/tree-index.js +0 -254
  574. package/dist/distill/tree-index.js.map +0 -1
  575. package/dist/distill/trigger.d.ts +0 -49
  576. package/dist/distill/trigger.d.ts.map +0 -1
  577. package/dist/distill/trigger.js +0 -182
  578. package/dist/distill/trigger.js.map +0 -1
  579. package/dist/distill/writer.d.ts +0 -43
  580. package/dist/distill/writer.d.ts.map +0 -1
  581. package/dist/distill/writer.js +0 -210
  582. package/dist/distill/writer.js.map +0 -1
  583. package/dist/goal/goal-classifier.d.ts +0 -38
  584. package/dist/goal/goal-classifier.d.ts.map +0 -1
  585. package/dist/goal/goal-classifier.js +0 -475
  586. package/dist/goal/goal-classifier.js.map +0 -1
  587. package/dist/goal/goal-decomposer.d.ts +0 -45
  588. package/dist/goal/goal-decomposer.d.ts.map +0 -1
  589. package/dist/goal/goal-decomposer.js +0 -326
  590. package/dist/goal/goal-decomposer.js.map +0 -1
  591. package/dist/goal/goal-planner.d.ts +0 -17
  592. package/dist/goal/goal-planner.d.ts.map +0 -1
  593. package/dist/goal/goal-planner.js +0 -149
  594. package/dist/goal/goal-planner.js.map +0 -1
  595. package/dist/goal/goal-types.d.ts +0 -93
  596. package/dist/goal/goal-types.d.ts.map +0 -1
  597. package/dist/goal/goal-types.js +0 -8
  598. package/dist/goal/goal-types.js.map +0 -1
  599. package/dist/goal/index.d.ts +0 -5
  600. package/dist/goal/index.d.ts.map +0 -1
  601. package/dist/goal/index.js +0 -4
  602. package/dist/goal/index.js.map +0 -1
  603. package/dist/governance/contract-builder.d.ts +0 -39
  604. package/dist/governance/contract-builder.d.ts.map +0 -1
  605. package/dist/governance/contract-builder.js +0 -216
  606. package/dist/governance/contract-builder.js.map +0 -1
  607. package/dist/governance/engine.d.ts +0 -33
  608. package/dist/governance/engine.d.ts.map +0 -1
  609. package/dist/governance/engine.js +0 -183
  610. package/dist/governance/engine.js.map +0 -1
  611. package/dist/governance/evidence-collector.d.ts +0 -42
  612. package/dist/governance/evidence-collector.d.ts.map +0 -1
  613. package/dist/governance/evidence-collector.js +0 -136
  614. package/dist/governance/evidence-collector.js.map +0 -1
  615. package/dist/governance/plugins/correction-plugin.d.ts +0 -20
  616. package/dist/governance/plugins/correction-plugin.d.ts.map +0 -1
  617. package/dist/governance/plugins/correction-plugin.js +0 -113
  618. package/dist/governance/plugins/correction-plugin.js.map +0 -1
  619. package/dist/governance/plugins/guidance-plugin.d.ts +0 -21
  620. package/dist/governance/plugins/guidance-plugin.d.ts.map +0 -1
  621. package/dist/governance/plugins/guidance-plugin.js +0 -69
  622. package/dist/governance/plugins/guidance-plugin.js.map +0 -1
  623. package/dist/governance/plugins/memory-plugin.d.ts +0 -22
  624. package/dist/governance/plugins/memory-plugin.d.ts.map +0 -1
  625. package/dist/governance/plugins/memory-plugin.js +0 -106
  626. package/dist/governance/plugins/memory-plugin.js.map +0 -1
  627. package/dist/governance/plugins/policy-plugin.d.ts +0 -16
  628. package/dist/governance/plugins/policy-plugin.d.ts.map +0 -1
  629. package/dist/governance/plugins/policy-plugin.js +0 -69
  630. package/dist/governance/plugins/policy-plugin.js.map +0 -1
  631. package/dist/governance/plugins/verification-plugin.d.ts +0 -15
  632. package/dist/governance/plugins/verification-plugin.d.ts.map +0 -1
  633. package/dist/governance/plugins/verification-plugin.js +0 -65
  634. package/dist/governance/plugins/verification-plugin.js.map +0 -1
  635. package/dist/governance/types.d.ts +0 -202
  636. package/dist/governance/types.d.ts.map +0 -1
  637. package/dist/governance/types.js +0 -10
  638. package/dist/governance/types.js.map +0 -1
  639. package/dist/knowledge/graph.d.ts +0 -101
  640. package/dist/knowledge/graph.d.ts.map +0 -1
  641. package/dist/knowledge/graph.js +0 -338
  642. package/dist/knowledge/graph.js.map +0 -1
  643. package/dist/orchestration/index.d.ts +0 -32
  644. package/dist/orchestration/index.d.ts.map +0 -1
  645. package/dist/orchestration/index.js +0 -74
  646. package/dist/orchestration/index.js.map +0 -1
  647. package/dist/orchestration/notifier.d.ts +0 -11
  648. package/dist/orchestration/notifier.d.ts.map +0 -1
  649. package/dist/orchestration/notifier.js +0 -22
  650. package/dist/orchestration/notifier.js.map +0 -1
  651. package/dist/orchestration/policy-engine.d.ts +0 -21
  652. package/dist/orchestration/policy-engine.d.ts.map +0 -1
  653. package/dist/orchestration/policy-engine.js +0 -78
  654. package/dist/orchestration/policy-engine.js.map +0 -1
  655. package/dist/orchestration/tracker.d.ts +0 -45
  656. package/dist/orchestration/tracker.d.ts.map +0 -1
  657. package/dist/orchestration/tracker.js +0 -95
  658. package/dist/orchestration/tracker.js.map +0 -1
  659. package/dist/pipeline/artifact-collector.d.ts +0 -31
  660. package/dist/pipeline/artifact-collector.d.ts.map +0 -1
  661. package/dist/pipeline/artifact-collector.js +0 -134
  662. package/dist/pipeline/artifact-collector.js.map +0 -1
  663. package/dist/pipeline/artifact-generator.d.ts +0 -36
  664. package/dist/pipeline/artifact-generator.d.ts.map +0 -1
  665. package/dist/pipeline/artifact-generator.js +0 -564
  666. package/dist/pipeline/artifact-generator.js.map +0 -1
  667. package/dist/pipeline/artifact-orchestrator.d.ts +0 -22
  668. package/dist/pipeline/artifact-orchestrator.d.ts.map +0 -1
  669. package/dist/pipeline/artifact-orchestrator.js +0 -110
  670. package/dist/pipeline/artifact-orchestrator.js.map +0 -1
  671. package/dist/pipeline/artifact-validator.d.ts +0 -37
  672. package/dist/pipeline/artifact-validator.d.ts.map +0 -1
  673. package/dist/pipeline/artifact-validator.js +0 -160
  674. package/dist/pipeline/artifact-validator.js.map +0 -1
  675. package/dist/pipeline/completion-detector.d.ts +0 -57
  676. package/dist/pipeline/completion-detector.d.ts.map +0 -1
  677. package/dist/pipeline/completion-detector.js +0 -190
  678. package/dist/pipeline/completion-detector.js.map +0 -1
  679. package/dist/pipeline/completion-engine.d.ts +0 -37
  680. package/dist/pipeline/completion-engine.d.ts.map +0 -1
  681. package/dist/pipeline/completion-engine.js +0 -146
  682. package/dist/pipeline/completion-engine.js.map +0 -1
  683. package/dist/pipeline/completion-gate.d.ts +0 -65
  684. package/dist/pipeline/completion-gate.d.ts.map +0 -1
  685. package/dist/pipeline/completion-gate.js +0 -303
  686. package/dist/pipeline/completion-gate.js.map +0 -1
  687. package/dist/pipeline/completion-verifier.d.ts +0 -83
  688. package/dist/pipeline/completion-verifier.d.ts.map +0 -1
  689. package/dist/pipeline/completion-verifier.js +0 -247
  690. package/dist/pipeline/completion-verifier.js.map +0 -1
  691. package/dist/pipeline/custom-node-type-store.d.ts +0 -12
  692. package/dist/pipeline/custom-node-type-store.d.ts.map +0 -1
  693. package/dist/pipeline/custom-node-type-store.js +0 -54
  694. package/dist/pipeline/custom-node-type-store.js.map +0 -1
  695. package/dist/pipeline/diagnosis-service.d.ts +0 -44
  696. package/dist/pipeline/diagnosis-service.d.ts.map +0 -1
  697. package/dist/pipeline/diagnosis-service.js +0 -136
  698. package/dist/pipeline/diagnosis-service.js.map +0 -1
  699. package/dist/pipeline/dynamic-node-executor.d.ts +0 -129
  700. package/dist/pipeline/dynamic-node-executor.d.ts.map +0 -1
  701. package/dist/pipeline/dynamic-node-executor.js +0 -536
  702. package/dist/pipeline/dynamic-node-executor.js.map +0 -1
  703. package/dist/pipeline/dynamic-node-types.d.ts +0 -133
  704. package/dist/pipeline/dynamic-node-types.d.ts.map +0 -1
  705. package/dist/pipeline/dynamic-node-types.js +0 -8
  706. package/dist/pipeline/dynamic-node-types.js.map +0 -1
  707. package/dist/pipeline/execution-engine.d.ts +0 -74
  708. package/dist/pipeline/execution-engine.d.ts.map +0 -1
  709. package/dist/pipeline/execution-engine.js +0 -346
  710. package/dist/pipeline/execution-engine.js.map +0 -1
  711. package/dist/pipeline/execution-plan.d.ts +0 -67
  712. package/dist/pipeline/execution-plan.d.ts.map +0 -1
  713. package/dist/pipeline/execution-plan.js +0 -61
  714. package/dist/pipeline/execution-plan.js.map +0 -1
  715. package/dist/pipeline/i-node-executor.d.ts +0 -84
  716. package/dist/pipeline/i-node-executor.d.ts.map +0 -1
  717. package/dist/pipeline/i-node-executor.js +0 -8
  718. package/dist/pipeline/i-node-executor.js.map +0 -1
  719. package/dist/pipeline/index.d.ts +0 -214
  720. package/dist/pipeline/index.d.ts.map +0 -1
  721. package/dist/pipeline/index.js +0 -728
  722. package/dist/pipeline/index.js.map +0 -1
  723. package/dist/pipeline/node-runtime.d.ts +0 -43
  724. package/dist/pipeline/node-runtime.d.ts.map +0 -1
  725. package/dist/pipeline/node-runtime.js +0 -77
  726. package/dist/pipeline/node-runtime.js.map +0 -1
  727. package/dist/pipeline/node-type-evolver.d.ts +0 -18
  728. package/dist/pipeline/node-type-evolver.d.ts.map +0 -1
  729. package/dist/pipeline/node-type-evolver.js +0 -171
  730. package/dist/pipeline/node-type-evolver.js.map +0 -1
  731. package/dist/pipeline/node-type-registry.d.ts +0 -47
  732. package/dist/pipeline/node-type-registry.d.ts.map +0 -1
  733. package/dist/pipeline/node-type-registry.js +0 -494
  734. package/dist/pipeline/node-type-registry.js.map +0 -1
  735. package/dist/pipeline/node-type-sync.d.ts +0 -17
  736. package/dist/pipeline/node-type-sync.d.ts.map +0 -1
  737. package/dist/pipeline/node-type-sync.js +0 -127
  738. package/dist/pipeline/node-type-sync.js.map +0 -1
  739. package/dist/pipeline/orchestration-enforcer.d.ts +0 -44
  740. package/dist/pipeline/orchestration-enforcer.d.ts.map +0 -1
  741. package/dist/pipeline/orchestration-enforcer.js +0 -141
  742. package/dist/pipeline/orchestration-enforcer.js.map +0 -1
  743. package/dist/pipeline/pattern-types.d.ts +0 -148
  744. package/dist/pipeline/pattern-types.d.ts.map +0 -1
  745. package/dist/pipeline/pattern-types.js +0 -8
  746. package/dist/pipeline/pattern-types.js.map +0 -1
  747. package/dist/pipeline/phase-tool-policy.d.ts +0 -20
  748. package/dist/pipeline/phase-tool-policy.d.ts.map +0 -1
  749. package/dist/pipeline/phase-tool-policy.js +0 -75
  750. package/dist/pipeline/phase-tool-policy.js.map +0 -1
  751. package/dist/pipeline/pipeline-options.d.ts +0 -19
  752. package/dist/pipeline/pipeline-options.d.ts.map +0 -1
  753. package/dist/pipeline/pipeline-options.js +0 -136
  754. package/dist/pipeline/pipeline-options.js.map +0 -1
  755. package/dist/pipeline/pipeline-state-machine.d.ts +0 -19
  756. package/dist/pipeline/pipeline-state-machine.d.ts.map +0 -1
  757. package/dist/pipeline/pipeline-state-machine.js +0 -53
  758. package/dist/pipeline/pipeline-state-machine.js.map +0 -1
  759. package/dist/pipeline/plan-service.d.ts +0 -59
  760. package/dist/pipeline/plan-service.d.ts.map +0 -1
  761. package/dist/pipeline/plan-service.js +0 -451
  762. package/dist/pipeline/plan-service.js.map +0 -1
  763. package/dist/pipeline/report-generator.d.ts +0 -20
  764. package/dist/pipeline/report-generator.d.ts.map +0 -1
  765. package/dist/pipeline/report-generator.js +0 -123
  766. package/dist/pipeline/report-generator.js.map +0 -1
  767. package/dist/pipeline/semantic-validator.d.ts +0 -53
  768. package/dist/pipeline/semantic-validator.d.ts.map +0 -1
  769. package/dist/pipeline/semantic-validator.js +0 -188
  770. package/dist/pipeline/semantic-validator.js.map +0 -1
  771. package/dist/pipeline/step-gate-keeper.d.ts +0 -28
  772. package/dist/pipeline/step-gate-keeper.d.ts.map +0 -1
  773. package/dist/pipeline/step-gate-keeper.js +0 -46
  774. package/dist/pipeline/step-gate-keeper.js.map +0 -1
  775. package/dist/pipeline/step-orchestrator.d.ts +0 -71
  776. package/dist/pipeline/step-orchestrator.d.ts.map +0 -1
  777. package/dist/pipeline/step-orchestrator.js +0 -191
  778. package/dist/pipeline/step-orchestrator.js.map +0 -1
  779. package/dist/pipeline/step-prompt-builder.d.ts +0 -32
  780. package/dist/pipeline/step-prompt-builder.d.ts.map +0 -1
  781. package/dist/pipeline/step-prompt-builder.js +0 -111
  782. package/dist/pipeline/step-prompt-builder.js.map +0 -1
  783. package/dist/pipeline/step-types.d.ts +0 -141
  784. package/dist/pipeline/step-types.d.ts.map +0 -1
  785. package/dist/pipeline/step-types.js +0 -7
  786. package/dist/pipeline/step-types.js.map +0 -1
  787. package/dist/pipeline/step-validator.d.ts +0 -29
  788. package/dist/pipeline/step-validator.d.ts.map +0 -1
  789. package/dist/pipeline/step-validator.js +0 -172
  790. package/dist/pipeline/step-validator.js.map +0 -1
  791. package/dist/pipeline/strategy-selector.d.ts +0 -41
  792. package/dist/pipeline/strategy-selector.d.ts.map +0 -1
  793. package/dist/pipeline/strategy-selector.js +0 -112
  794. package/dist/pipeline/strategy-selector.js.map +0 -1
  795. package/dist/pipeline/template-evolver.d.ts +0 -45
  796. package/dist/pipeline/template-evolver.d.ts.map +0 -1
  797. package/dist/pipeline/template-evolver.js +0 -223
  798. package/dist/pipeline/template-evolver.js.map +0 -1
  799. package/dist/pipeline/template-registry.d.ts +0 -52
  800. package/dist/pipeline/template-registry.d.ts.map +0 -1
  801. package/dist/pipeline/template-registry.js +0 -588
  802. package/dist/pipeline/template-registry.js.map +0 -1
  803. package/dist/pipeline/template-router.d.ts +0 -32
  804. package/dist/pipeline/template-router.d.ts.map +0 -1
  805. package/dist/pipeline/template-router.js +0 -132
  806. package/dist/pipeline/template-router.js.map +0 -1
  807. package/dist/pipeline/template-sync.d.ts +0 -13
  808. package/dist/pipeline/template-sync.d.ts.map +0 -1
  809. package/dist/pipeline/template-sync.js +0 -246
  810. package/dist/pipeline/template-sync.js.map +0 -1
  811. package/dist/pipeline/types.d.ts +0 -93
  812. package/dist/pipeline/types.d.ts.map +0 -1
  813. package/dist/pipeline/types.js +0 -2
  814. package/dist/pipeline/types.js.map +0 -1
  815. package/dist/prompts/claudemd-distill.md +0 -31
  816. package/dist/prompts/distill-analysis.md +0 -25
  817. package/dist/prompts/intent-analysis.md +0 -135
  818. package/dist/prompts/pipeline-decompose.md +0 -108
  819. package/dist/prompts/quality-phase-completion.md +0 -36
  820. package/dist/prompts/quality-phase-review.md +0 -43
  821. package/dist/prompts/quality-review.md +0 -41
  822. package/dist/prompts/registry.d.ts +0 -17
  823. package/dist/prompts/registry.d.ts.map +0 -1
  824. package/dist/prompts/registry.js +0 -40
  825. package/dist/prompts/registry.js.map +0 -1
  826. package/dist/prompts/retrospective-pattern.md +0 -24
  827. package/dist/resume/context-gen.d.ts +0 -20
  828. package/dist/resume/context-gen.d.ts.map +0 -1
  829. package/dist/resume/context-gen.js +0 -130
  830. package/dist/resume/context-gen.js.map +0 -1
  831. package/dist/resume/index.d.ts +0 -33
  832. package/dist/resume/index.d.ts.map +0 -1
  833. package/dist/resume/index.js +0 -114
  834. package/dist/resume/index.js.map +0 -1
  835. package/dist/resume/state-machine.d.ts +0 -21
  836. package/dist/resume/state-machine.d.ts.map +0 -1
  837. package/dist/resume/state-machine.js +0 -58
  838. package/dist/resume/state-machine.js.map +0 -1
  839. package/dist/retrospective/failure-detector.d.ts +0 -17
  840. package/dist/retrospective/failure-detector.d.ts.map +0 -1
  841. package/dist/retrospective/failure-detector.js +0 -67
  842. package/dist/retrospective/failure-detector.js.map +0 -1
  843. package/dist/retrospective/index.d.ts +0 -77
  844. package/dist/retrospective/index.d.ts.map +0 -1
  845. package/dist/retrospective/index.js +0 -255
  846. package/dist/retrospective/index.js.map +0 -1
  847. package/dist/retrospective/metrics-extractor.d.ts +0 -27
  848. package/dist/retrospective/metrics-extractor.d.ts.map +0 -1
  849. package/dist/retrospective/metrics-extractor.js +0 -76
  850. package/dist/retrospective/metrics-extractor.js.map +0 -1
  851. package/dist/retrospective/pattern-learner.d.ts +0 -29
  852. package/dist/retrospective/pattern-learner.d.ts.map +0 -1
  853. package/dist/retrospective/pattern-learner.js +0 -149
  854. package/dist/retrospective/pattern-learner.js.map +0 -1
  855. package/dist/retrospective/report-writer.d.ts +0 -28
  856. package/dist/retrospective/report-writer.d.ts.map +0 -1
  857. package/dist/retrospective/report-writer.js +0 -95
  858. package/dist/retrospective/report-writer.js.map +0 -1
  859. package/dist/retrospective/satisfaction-inferrer.d.ts +0 -38
  860. package/dist/retrospective/satisfaction-inferrer.d.ts.map +0 -1
  861. package/dist/retrospective/satisfaction-inferrer.js +0 -137
  862. package/dist/retrospective/satisfaction-inferrer.js.map +0 -1
  863. package/dist/retrospective/strategy-advisor.d.ts +0 -23
  864. package/dist/retrospective/strategy-advisor.d.ts.map +0 -1
  865. package/dist/retrospective/strategy-advisor.js +0 -64
  866. package/dist/retrospective/strategy-advisor.js.map +0 -1
  867. package/dist/retrospective/types.d.ts +0 -105
  868. package/dist/retrospective/types.d.ts.map +0 -1
  869. package/dist/retrospective/types.js +0 -7
  870. package/dist/retrospective/types.js.map +0 -1
  871. package/dist/skill-registry/collector.d.ts +0 -75
  872. package/dist/skill-registry/collector.d.ts.map +0 -1
  873. package/dist/skill-registry/collector.js +0 -350
  874. package/dist/skill-registry/collector.js.map +0 -1
  875. package/dist/skill-registry/evolver/community-distiller.d.ts +0 -10
  876. package/dist/skill-registry/evolver/community-distiller.d.ts.map +0 -1
  877. package/dist/skill-registry/evolver/community-distiller.js +0 -117
  878. package/dist/skill-registry/evolver/community-distiller.js.map +0 -1
  879. package/dist/skill-registry/evolver/generation-engine.d.ts +0 -7
  880. package/dist/skill-registry/evolver/generation-engine.d.ts.map +0 -1
  881. package/dist/skill-registry/evolver/generation-engine.js +0 -71
  882. package/dist/skill-registry/evolver/generation-engine.js.map +0 -1
  883. package/dist/skill-registry/evolver/index.d.ts +0 -52
  884. package/dist/skill-registry/evolver/index.d.ts.map +0 -1
  885. package/dist/skill-registry/evolver/index.js +0 -196
  886. package/dist/skill-registry/evolver/index.js.map +0 -1
  887. package/dist/skill-registry/evolver/keyword-evolver.d.ts +0 -7
  888. package/dist/skill-registry/evolver/keyword-evolver.d.ts.map +0 -1
  889. package/dist/skill-registry/evolver/keyword-evolver.js +0 -117
  890. package/dist/skill-registry/evolver/keyword-evolver.js.map +0 -1
  891. package/dist/skill-registry/evolver/official-evolver.d.ts +0 -8
  892. package/dist/skill-registry/evolver/official-evolver.d.ts.map +0 -1
  893. package/dist/skill-registry/evolver/official-evolver.js +0 -79
  894. package/dist/skill-registry/evolver/official-evolver.js.map +0 -1
  895. package/dist/skill-registry/evolver/optimization-engine.d.ts +0 -7
  896. package/dist/skill-registry/evolver/optimization-engine.d.ts.map +0 -1
  897. package/dist/skill-registry/evolver/optimization-engine.js +0 -130
  898. package/dist/skill-registry/evolver/optimization-engine.js.map +0 -1
  899. package/dist/skill-registry/evolver/repair-engine.d.ts +0 -26
  900. package/dist/skill-registry/evolver/repair-engine.d.ts.map +0 -1
  901. package/dist/skill-registry/evolver/repair-engine.js +0 -247
  902. package/dist/skill-registry/evolver/repair-engine.js.map +0 -1
  903. package/dist/skill-registry/evolver/retirement-engine.d.ts +0 -7
  904. package/dist/skill-registry/evolver/retirement-engine.d.ts.map +0 -1
  905. package/dist/skill-registry/evolver/retirement-engine.js +0 -46
  906. package/dist/skill-registry/evolver/retirement-engine.js.map +0 -1
  907. package/dist/skill-registry/evolver/shared.d.ts +0 -18
  908. package/dist/skill-registry/evolver/shared.d.ts.map +0 -1
  909. package/dist/skill-registry/evolver/shared.js +0 -74
  910. package/dist/skill-registry/evolver/shared.js.map +0 -1
  911. package/dist/skill-registry/fuzzy-matcher.d.ts +0 -15
  912. package/dist/skill-registry/fuzzy-matcher.d.ts.map +0 -1
  913. package/dist/skill-registry/fuzzy-matcher.js +0 -41
  914. package/dist/skill-registry/fuzzy-matcher.js.map +0 -1
  915. package/dist/skill-registry/index.d.ts +0 -82
  916. package/dist/skill-registry/index.d.ts.map +0 -1
  917. package/dist/skill-registry/index.js +0 -219
  918. package/dist/skill-registry/index.js.map +0 -1
  919. package/dist/skill-registry/official-sync/index.d.ts +0 -17
  920. package/dist/skill-registry/official-sync/index.d.ts.map +0 -1
  921. package/dist/skill-registry/official-sync/index.js +0 -120
  922. package/dist/skill-registry/official-sync/index.js.map +0 -1
  923. package/dist/skill-registry/official-sync/skill-definitions.d.ts +0 -24
  924. package/dist/skill-registry/official-sync/skill-definitions.d.ts.map +0 -1
  925. package/dist/skill-registry/official-sync/skill-definitions.js +0 -1133
  926. package/dist/skill-registry/official-sync/skill-definitions.js.map +0 -1
  927. package/dist/skill-registry/orchestration-config.d.ts +0 -45
  928. package/dist/skill-registry/orchestration-config.d.ts.map +0 -1
  929. package/dist/skill-registry/orchestration-config.js +0 -145
  930. package/dist/skill-registry/orchestration-config.js.map +0 -1
  931. package/dist/skill-registry/orchestrator.d.ts +0 -61
  932. package/dist/skill-registry/orchestrator.d.ts.map +0 -1
  933. package/dist/skill-registry/orchestrator.js +0 -296
  934. package/dist/skill-registry/orchestrator.js.map +0 -1
  935. package/dist/skill-registry/pattern-evolver.d.ts +0 -43
  936. package/dist/skill-registry/pattern-evolver.d.ts.map +0 -1
  937. package/dist/skill-registry/pattern-evolver.js +0 -214
  938. package/dist/skill-registry/pattern-evolver.js.map +0 -1
  939. package/dist/skill-registry/project-learner.d.ts +0 -25
  940. package/dist/skill-registry/project-learner.d.ts.map +0 -1
  941. package/dist/skill-registry/project-learner.js +0 -176
  942. package/dist/skill-registry/project-learner.js.map +0 -1
  943. package/dist/skill-registry/registry.d.ts +0 -58
  944. package/dist/skill-registry/registry.d.ts.map +0 -1
  945. package/dist/skill-registry/registry.js +0 -190
  946. package/dist/skill-registry/registry.js.map +0 -1
  947. package/dist/skill-registry/scanner.d.ts +0 -36
  948. package/dist/skill-registry/scanner.d.ts.map +0 -1
  949. package/dist/skill-registry/scanner.js +0 -125
  950. package/dist/skill-registry/scanner.js.map +0 -1
  951. package/dist/skill-registry/skills-config.d.ts +0 -29
  952. package/dist/skill-registry/skills-config.d.ts.map +0 -1
  953. package/dist/skill-registry/skills-config.js +0 -86
  954. package/dist/skill-registry/skills-config.js.map +0 -1
  955. package/dist/storage/index.d.ts +0 -241
  956. package/dist/storage/index.d.ts.map +0 -1
  957. package/dist/storage/index.js +0 -2
  958. package/dist/storage/index.js.map +0 -1
  959. package/dist/storage/repositories/api-usage-repository.d.ts +0 -28
  960. package/dist/storage/repositories/api-usage-repository.d.ts.map +0 -1
  961. package/dist/storage/repositories/api-usage-repository.js +0 -59
  962. package/dist/storage/repositories/api-usage-repository.js.map +0 -1
  963. package/dist/storage/repositories/base-repository.d.ts +0 -14
  964. package/dist/storage/repositories/base-repository.d.ts.map +0 -1
  965. package/dist/storage/repositories/base-repository.js +0 -43
  966. package/dist/storage/repositories/base-repository.js.map +0 -1
  967. package/dist/storage/repositories/distill-repository.d.ts +0 -37
  968. package/dist/storage/repositories/distill-repository.d.ts.map +0 -1
  969. package/dist/storage/repositories/distill-repository.js +0 -91
  970. package/dist/storage/repositories/distill-repository.js.map +0 -1
  971. package/dist/storage/repositories/dynamic-pipeline-repository.d.ts +0 -91
  972. package/dist/storage/repositories/dynamic-pipeline-repository.d.ts.map +0 -1
  973. package/dist/storage/repositories/dynamic-pipeline-repository.js +0 -425
  974. package/dist/storage/repositories/dynamic-pipeline-repository.js.map +0 -1
  975. package/dist/storage/repositories/dynamic-pipeline-template-repository.d.ts +0 -13
  976. package/dist/storage/repositories/dynamic-pipeline-template-repository.d.ts.map +0 -1
  977. package/dist/storage/repositories/dynamic-pipeline-template-repository.js +0 -117
  978. package/dist/storage/repositories/dynamic-pipeline-template-repository.js.map +0 -1
  979. package/dist/storage/repositories/event-repository.d.ts +0 -14
  980. package/dist/storage/repositories/event-repository.d.ts.map +0 -1
  981. package/dist/storage/repositories/event-repository.js +0 -226
  982. package/dist/storage/repositories/event-repository.js.map +0 -1
  983. package/dist/storage/repositories/failure-repository.d.ts +0 -22
  984. package/dist/storage/repositories/failure-repository.d.ts.map +0 -1
  985. package/dist/storage/repositories/failure-repository.js +0 -26
  986. package/dist/storage/repositories/failure-repository.js.map +0 -1
  987. package/dist/storage/repositories/graph-traversal.d.ts +0 -37
  988. package/dist/storage/repositories/graph-traversal.d.ts.map +0 -1
  989. package/dist/storage/repositories/graph-traversal.js +0 -158
  990. package/dist/storage/repositories/graph-traversal.js.map +0 -1
  991. package/dist/storage/repositories/intent-rule-repository.d.ts +0 -20
  992. package/dist/storage/repositories/intent-rule-repository.d.ts.map +0 -1
  993. package/dist/storage/repositories/intent-rule-repository.js +0 -38
  994. package/dist/storage/repositories/intent-rule-repository.js.map +0 -1
  995. package/dist/storage/repositories/knowledge-repository.d.ts +0 -60
  996. package/dist/storage/repositories/knowledge-repository.d.ts.map +0 -1
  997. package/dist/storage/repositories/knowledge-repository.js +0 -131
  998. package/dist/storage/repositories/knowledge-repository.js.map +0 -1
  999. package/dist/storage/repositories/latency-repository.d.ts +0 -21
  1000. package/dist/storage/repositories/latency-repository.d.ts.map +0 -1
  1001. package/dist/storage/repositories/latency-repository.js +0 -39
  1002. package/dist/storage/repositories/latency-repository.js.map +0 -1
  1003. package/dist/storage/repositories/maintenance-repository.d.ts +0 -101
  1004. package/dist/storage/repositories/maintenance-repository.d.ts.map +0 -1
  1005. package/dist/storage/repositories/maintenance-repository.js +0 -372
  1006. package/dist/storage/repositories/maintenance-repository.js.map +0 -1
  1007. package/dist/storage/repositories/node-attempt-repository.d.ts +0 -29
  1008. package/dist/storage/repositories/node-attempt-repository.d.ts.map +0 -1
  1009. package/dist/storage/repositories/node-attempt-repository.js +0 -57
  1010. package/dist/storage/repositories/node-attempt-repository.js.map +0 -1
  1011. package/dist/storage/repositories/node-type-repository.d.ts +0 -52
  1012. package/dist/storage/repositories/node-type-repository.d.ts.map +0 -1
  1013. package/dist/storage/repositories/node-type-repository.js +0 -130
  1014. package/dist/storage/repositories/node-type-repository.js.map +0 -1
  1015. package/dist/storage/repositories/pipeline-plan-repository.d.ts +0 -75
  1016. package/dist/storage/repositories/pipeline-plan-repository.d.ts.map +0 -1
  1017. package/dist/storage/repositories/pipeline-plan-repository.js +0 -123
  1018. package/dist/storage/repositories/pipeline-plan-repository.js.map +0 -1
  1019. package/dist/storage/repositories/project-meta-repository.d.ts +0 -19
  1020. package/dist/storage/repositories/project-meta-repository.d.ts.map +0 -1
  1021. package/dist/storage/repositories/project-meta-repository.js +0 -46
  1022. package/dist/storage/repositories/project-meta-repository.js.map +0 -1
  1023. package/dist/storage/repositories/quality-repository.d.ts +0 -16
  1024. package/dist/storage/repositories/quality-repository.d.ts.map +0 -1
  1025. package/dist/storage/repositories/quality-repository.js +0 -36
  1026. package/dist/storage/repositories/quality-repository.js.map +0 -1
  1027. package/dist/storage/repositories/satisfaction-repository.d.ts +0 -21
  1028. package/dist/storage/repositories/satisfaction-repository.d.ts.map +0 -1
  1029. package/dist/storage/repositories/satisfaction-repository.js +0 -26
  1030. package/dist/storage/repositories/satisfaction-repository.js.map +0 -1
  1031. package/dist/storage/repositories/session-repository.d.ts +0 -24
  1032. package/dist/storage/repositories/session-repository.d.ts.map +0 -1
  1033. package/dist/storage/repositories/session-repository.js +0 -116
  1034. package/dist/storage/repositories/session-repository.js.map +0 -1
  1035. package/dist/storage/repositories/task-repository.d.ts +0 -99
  1036. package/dist/storage/repositories/task-repository.d.ts.map +0 -1
  1037. package/dist/storage/repositories/task-repository.js +0 -223
  1038. package/dist/storage/repositories/task-repository.js.map +0 -1
  1039. package/dist/storage/repositories/template-evolution-repository.d.ts +0 -39
  1040. package/dist/storage/repositories/template-evolution-repository.d.ts.map +0 -1
  1041. package/dist/storage/repositories/template-evolution-repository.js +0 -83
  1042. package/dist/storage/repositories/template-evolution-repository.js.map +0 -1
  1043. package/dist/storage/schema/migration-manager.d.ts +0 -15
  1044. package/dist/storage/schema/migration-manager.d.ts.map +0 -1
  1045. package/dist/storage/schema/migration-manager.js +0 -1000
  1046. package/dist/storage/schema/migration-manager.js.map +0 -1
  1047. package/dist/storage/sqlite.d.ts +0 -426
  1048. package/dist/storage/sqlite.d.ts.map +0 -1
  1049. package/dist/storage/sqlite.js +0 -525
  1050. package/dist/storage/sqlite.js.map +0 -1
  1051. package/dist/types/core-types.d.ts +0 -24
  1052. package/dist/types/core-types.d.ts.map +0 -1
  1053. package/dist/types/core-types.js +0 -37
  1054. package/dist/types/core-types.js.map +0 -1
  1055. package/dist/types/event.d.ts +0 -25
  1056. package/dist/types/event.d.ts.map +0 -1
  1057. package/dist/types/event.js +0 -2
  1058. package/dist/types/event.js.map +0 -1
  1059. package/dist/types/index.d.ts +0 -3
  1060. package/dist/types/index.d.ts.map +0 -1
  1061. package/dist/types/index.js +0 -2
  1062. package/dist/types/index.js.map +0 -1
  1063. package/dist/types/session.d.ts +0 -14
  1064. package/dist/types/session.d.ts.map +0 -1
  1065. package/dist/types/session.js +0 -2
  1066. package/dist/types/session.js.map +0 -1
  1067. package/dist/utils/artifact-manager.d.ts +0 -60
  1068. package/dist/utils/artifact-manager.d.ts.map +0 -1
  1069. package/dist/utils/artifact-manager.js +0 -205
  1070. package/dist/utils/artifact-manager.js.map +0 -1
  1071. package/dist/utils/cache-registry.d.ts +0 -53
  1072. package/dist/utils/cache-registry.d.ts.map +0 -1
  1073. package/dist/utils/cache-registry.js +0 -93
  1074. package/dist/utils/cache-registry.js.map +0 -1
  1075. package/dist/utils/circuit-breaker.d.ts +0 -39
  1076. package/dist/utils/circuit-breaker.d.ts.map +0 -1
  1077. package/dist/utils/circuit-breaker.js +0 -101
  1078. package/dist/utils/circuit-breaker.js.map +0 -1
  1079. package/dist/utils/claude-api.d.ts +0 -31
  1080. package/dist/utils/claude-api.d.ts.map +0 -1
  1081. package/dist/utils/claude-api.js +0 -125
  1082. package/dist/utils/claude-api.js.map +0 -1
  1083. package/dist/utils/error-handler.d.ts +0 -48
  1084. package/dist/utils/error-handler.d.ts.map +0 -1
  1085. package/dist/utils/error-handler.js +0 -251
  1086. package/dist/utils/error-handler.js.map +0 -1
  1087. package/dist/utils/forge-resume-block.d.ts.map +0 -1
  1088. package/dist/utils/forge-resume-block.js.map +0 -1
  1089. package/dist/utils/formatter.d.ts +0 -71
  1090. package/dist/utils/formatter.d.ts.map +0 -1
  1091. package/dist/utils/formatter.js +0 -133
  1092. package/dist/utils/formatter.js.map +0 -1
  1093. package/dist/utils/latency-tracer.d.ts +0 -27
  1094. package/dist/utils/latency-tracer.d.ts.map +0 -1
  1095. package/dist/utils/latency-tracer.js +0 -64
  1096. package/dist/utils/latency-tracer.js.map +0 -1
  1097. package/dist/utils/logger.d.ts +0 -33
  1098. package/dist/utils/logger.d.ts.map +0 -1
  1099. package/dist/utils/logger.js +0 -173
  1100. package/dist/utils/logger.js.map +0 -1
  1101. package/dist/utils/memory-manager.d.ts +0 -58
  1102. package/dist/utils/memory-manager.d.ts.map +0 -1
  1103. package/dist/utils/memory-manager.js +0 -165
  1104. package/dist/utils/memory-manager.js.map +0 -1
  1105. package/dist/utils/mutex-lock.d.ts +0 -24
  1106. package/dist/utils/mutex-lock.d.ts.map +0 -1
  1107. package/dist/utils/mutex-lock.js +0 -55
  1108. package/dist/utils/mutex-lock.js.map +0 -1
  1109. package/dist/utils/path.d.ts +0 -6
  1110. package/dist/utils/path.d.ts.map +0 -1
  1111. package/dist/utils/path.js +0 -13
  1112. package/dist/utils/path.js.map +0 -1
  1113. package/dist/utils/pending-prompt-sink.d.ts +0 -14
  1114. package/dist/utils/pending-prompt-sink.d.ts.map +0 -1
  1115. package/dist/utils/pending-prompt-sink.js +0 -7
  1116. package/dist/utils/pending-prompt-sink.js.map +0 -1
  1117. package/dist/utils/plan-reader.d.ts +0 -54
  1118. package/dist/utils/plan-reader.d.ts.map +0 -1
  1119. package/dist/utils/plan-reader.js +0 -238
  1120. package/dist/utils/plan-reader.js.map +0 -1
  1121. package/dist/utils/project-root.d.ts +0 -13
  1122. package/dist/utils/project-root.d.ts.map +0 -1
  1123. package/dist/utils/project-root.js +0 -43
  1124. package/dist/utils/project-root.js.map +0 -1
  1125. package/dist/utils/stage-trace.d.ts +0 -74
  1126. package/dist/utils/stage-trace.d.ts.map +0 -1
  1127. package/dist/utils/stage-trace.js +0 -125
  1128. package/dist/utils/stage-trace.js.map +0 -1
  1129. package/dist/utils/truncate.d.ts +0 -30
  1130. package/dist/utils/truncate.d.ts.map +0 -1
  1131. package/dist/utils/truncate.js +0 -64
  1132. package/dist/utils/truncate.js.map +0 -1
  1133. package/dist/web/middleware/auth.d.ts +0 -3
  1134. package/dist/web/middleware/auth.d.ts.map +0 -1
  1135. package/dist/web/middleware/auth.js +0 -19
  1136. package/dist/web/middleware/auth.js.map +0 -1
  1137. package/dist/web/routes/claudemd.d.ts +0 -4
  1138. package/dist/web/routes/claudemd.d.ts.map +0 -1
  1139. package/dist/web/routes/claudemd.js +0 -205
  1140. package/dist/web/routes/claudemd.js.map +0 -1
  1141. package/dist/web/routes/config.d.ts +0 -6
  1142. package/dist/web/routes/config.d.ts.map +0 -1
  1143. package/dist/web/routes/config.js +0 -331
  1144. package/dist/web/routes/config.js.map +0 -1
  1145. package/dist/web/routes/convention.d.ts +0 -4
  1146. package/dist/web/routes/convention.d.ts.map +0 -1
  1147. package/dist/web/routes/convention.js +0 -235
  1148. package/dist/web/routes/convention.js.map +0 -1
  1149. package/dist/web/routes/daemon.d.ts +0 -4
  1150. package/dist/web/routes/daemon.d.ts.map +0 -1
  1151. package/dist/web/routes/daemon.js +0 -94
  1152. package/dist/web/routes/daemon.js.map +0 -1
  1153. package/dist/web/routes/events.d.ts +0 -4
  1154. package/dist/web/routes/events.d.ts.map +0 -1
  1155. package/dist/web/routes/events.js +0 -99
  1156. package/dist/web/routes/events.js.map +0 -1
  1157. package/dist/web/routes/evolution.d.ts +0 -4
  1158. package/dist/web/routes/evolution.d.ts.map +0 -1
  1159. package/dist/web/routes/evolution.js +0 -61
  1160. package/dist/web/routes/evolution.js.map +0 -1
  1161. package/dist/web/routes/knowledge.d.ts +0 -4
  1162. package/dist/web/routes/knowledge.d.ts.map +0 -1
  1163. package/dist/web/routes/knowledge.js +0 -313
  1164. package/dist/web/routes/knowledge.js.map +0 -1
  1165. package/dist/web/routes/memory.d.ts +0 -7
  1166. package/dist/web/routes/memory.d.ts.map +0 -1
  1167. package/dist/web/routes/memory.js +0 -94
  1168. package/dist/web/routes/memory.js.map +0 -1
  1169. package/dist/web/routes/node-types.d.ts +0 -7
  1170. package/dist/web/routes/node-types.d.ts.map +0 -1
  1171. package/dist/web/routes/node-types.js +0 -192
  1172. package/dist/web/routes/node-types.js.map +0 -1
  1173. package/dist/web/routes/pipelines.d.ts +0 -5
  1174. package/dist/web/routes/pipelines.d.ts.map +0 -1
  1175. package/dist/web/routes/pipelines.js +0 -556
  1176. package/dist/web/routes/pipelines.js.map +0 -1
  1177. package/dist/web/routes/plans.d.ts +0 -5
  1178. package/dist/web/routes/plans.d.ts.map +0 -1
  1179. package/dist/web/routes/plans.js +0 -163
  1180. package/dist/web/routes/plans.js.map +0 -1
  1181. package/dist/web/routes/project-meta.d.ts +0 -8
  1182. package/dist/web/routes/project-meta.d.ts.map +0 -1
  1183. package/dist/web/routes/project-meta.js +0 -63
  1184. package/dist/web/routes/project-meta.js.map +0 -1
  1185. package/dist/web/routes/projects.d.ts +0 -4
  1186. package/dist/web/routes/projects.d.ts.map +0 -1
  1187. package/dist/web/routes/projects.js +0 -156
  1188. package/dist/web/routes/projects.js.map +0 -1
  1189. package/dist/web/routes/quality.d.ts +0 -5
  1190. package/dist/web/routes/quality.d.ts.map +0 -1
  1191. package/dist/web/routes/quality.js +0 -214
  1192. package/dist/web/routes/quality.js.map +0 -1
  1193. package/dist/web/routes/sessions.d.ts +0 -4
  1194. package/dist/web/routes/sessions.d.ts.map +0 -1
  1195. package/dist/web/routes/sessions.js +0 -283
  1196. package/dist/web/routes/sessions.js.map +0 -1
  1197. package/dist/web/routes/skills.d.ts +0 -3
  1198. package/dist/web/routes/skills.d.ts.map +0 -1
  1199. package/dist/web/routes/skills.js +0 -387
  1200. package/dist/web/routes/skills.js.map +0 -1
  1201. package/dist/web/routes/stats.d.ts +0 -4
  1202. package/dist/web/routes/stats.d.ts.map +0 -1
  1203. package/dist/web/routes/stats.js +0 -243
  1204. package/dist/web/routes/stats.js.map +0 -1
  1205. package/dist/web/routes/templates.d.ts +0 -4
  1206. package/dist/web/routes/templates.d.ts.map +0 -1
  1207. package/dist/web/routes/templates.js +0 -117
  1208. package/dist/web/routes/templates.js.map +0 -1
  1209. package/dist/web/sse-broadcaster.d.ts +0 -23
  1210. package/dist/web/sse-broadcaster.d.ts.map +0 -1
  1211. package/dist/web/sse-broadcaster.js +0 -73
  1212. package/dist/web/sse-broadcaster.js.map +0 -1
  1213. package/dist/web/utils/error-response.d.ts +0 -23
  1214. package/dist/web/utils/error-response.d.ts.map +0 -1
  1215. package/dist/web/utils/error-response.js +0 -26
  1216. package/dist/web/utils/error-response.js.map +0 -1
  1217. package/dist/web/utils/errors.d.ts +0 -31
  1218. package/dist/web/utils/errors.d.ts.map +0 -1
  1219. package/dist/web/utils/errors.js +0 -56
  1220. package/dist/web/utils/errors.js.map +0 -1
  1221. package/dist/web/utils/path-validation.d.ts +0 -20
  1222. package/dist/web/utils/path-validation.d.ts.map +0 -1
  1223. package/dist/web/utils/path-validation.js +0 -55
  1224. package/dist/web/utils/path-validation.js.map +0 -1
  1225. package/dist/web/utils/validation.d.ts +0 -112
  1226. package/dist/web/utils/validation.d.ts.map +0 -1
  1227. package/dist/web/utils/validation.js +0 -185
  1228. package/dist/web/utils/validation.js.map +0 -1
  1229. package/dist/web-static/assets/Analytics-Bo_OyY9A.js +0 -36
  1230. package/dist/web-static/assets/BatchProgress-qW-6664M.js +0 -1
  1231. package/dist/web-static/assets/Breadcrumb-C1Mua6se.js +0 -1
  1232. package/dist/web-static/assets/Config-Dn-dtdo9.js +0 -1
  1233. package/dist/web-static/assets/ConfirmDialog-bdDaAlT1.js +0 -1
  1234. package/dist/web-static/assets/Conventions-ByV7r45c.js +0 -1
  1235. package/dist/web-static/assets/Dashboard-C-7N8kYZ.js +0 -1
  1236. package/dist/web-static/assets/ErrorState-CMLoMrQY.js +0 -1
  1237. package/dist/web-static/assets/Events-DHuyQHQe.js +0 -1
  1238. package/dist/web-static/assets/Evolution-Dzr5xOLD.js +0 -1
  1239. package/dist/web-static/assets/Knowledge-ClwX4cnr.js +0 -2
  1240. package/dist/web-static/assets/MiniCharts-DsV2Sqfk.js +0 -1
  1241. package/dist/web-static/assets/NodeTypes-DFt8b5gi.js +0 -1
  1242. package/dist/web-static/assets/Pagination-CR-eJz36.js +0 -1
  1243. package/dist/web-static/assets/PipelineDetail-By1HJlaB.js +0 -4
  1244. package/dist/web-static/assets/Pipelines--MGzCPtR.js +0 -2
  1245. package/dist/web-static/assets/ProjectDetail-CrpekCeY.js +0 -1
  1246. package/dist/web-static/assets/Projects-Dw1qYmjz.js +0 -1
  1247. package/dist/web-static/assets/Quality-CYwODfQP.js +0 -3
  1248. package/dist/web-static/assets/SessionDetail-c8MYnwnk.js +0 -1
  1249. package/dist/web-static/assets/Sessions-BkDd4Mxb.js +0 -2
  1250. package/dist/web-static/assets/Skeleton-DbL04wuz.js +0 -1
  1251. package/dist/web-static/assets/Skills-2OPSAnaU.js +0 -1
  1252. package/dist/web-static/assets/TemplateDetail-DbifRj4h.js +0 -1
  1253. package/dist/web-static/assets/Templates-CDw-GGp8.js +0 -1
  1254. package/dist/web-static/assets/Toast-CrwuIbKC.js +0 -1
  1255. package/dist/web-static/assets/client-C_VWY70M.js +0 -1
  1256. package/dist/web-static/assets/exportCsv-CO51kx6P.js +0 -3
  1257. package/dist/web-static/assets/index-DD2Z15TY.css +0 -2
  1258. package/dist/web-static/assets/index-DR3AaQnu.js +0 -2
  1259. package/dist/web-static/assets/rolldown-runtime-COnpUsM8.js +0 -1
  1260. package/dist/web-static/assets/ui-DpI1N3yJ.js +0 -1
  1261. package/dist/web-static/assets/useDebounce-BLryFdeo.js +0 -1
  1262. package/dist/web-static/assets/vendor-2ObLXPrQ.js +0 -9
  1263. package/dist/web-static/assets/vendor-motion-BryL_tAt.js +0 -9
  1264. package/dist/web-static/assets/vendor-query-CjmRaY7o.js +0 -4
  1265. package/dist/web-static/assets/vendor-react-DZi7brq3.js +0 -11
  1266. package/dist/web-static/index.html +0 -22
  1267. /package/dist/{utils → core/utils}/forge-resume-block.d.ts +0 -0
  1268. /package/dist/{utils → core/utils}/forge-resume-block.js +0 -0
@@ -1 +0,0 @@
1
- import{r as e}from"./vendor-motion-BryL_tAt.js";var t=e();function n({total:e,done:n,label:r=`处理中`}){let i=e>0?Math.round(n/e*100):0;return(0,t.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,t.jsxs)(`span`,{className:`text-gray-500 whitespace-nowrap`,children:[r,` `,n,`/`,e]}),(0,t.jsx)(`div`,{className:`flex-1 h-1.5 bg-gray-100 rounded-full overflow-hidden min-w-[80px]`,children:(0,t.jsx)(`div`,{className:`h-full bg-blue-500 rounded-full transition-all duration-300`,style:{width:`${i}%`}})}),(0,t.jsxs)(`span`,{className:`text-gray-400 w-8 text-right`,children:[i,`%`]})]})}export{n as t};
@@ -1 +0,0 @@
1
- import{Vn as e}from"./vendor-2ObLXPrQ.js";import{a as t}from"./vendor-react-DZi7brq3.js";import{r as n}from"./vendor-motion-BryL_tAt.js";var r=n();function i({items:n}){return(0,r.jsx)(`nav`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:n.map((n,i)=>(0,r.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i>0&&(0,r.jsx)(e,{className:`h-3.5 w-3.5 text-gray-400`}),n.path?(0,r.jsx)(t,{to:n.path,className:`hover:text-gray-900 transition-colors`,children:n.label}):(0,r.jsx)(`span`,{className:`text-gray-900 font-medium`,children:n.label})]},i))})}export{i as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{An as t,At as n,Dn as r,Dt as i,Gt as a,Ht as o,In as s,Kt as c,Rn as l,Tn as u,an as d,ar as f,kn as p,kt as m,mn as h,n as g,qt as _,wn as v}from"./vendor-2ObLXPrQ.js";import{a as y,n as b,r as x}from"./vendor-query-CjmRaY7o.js";import{n as S,r as C,t as w}from"./vendor-motion-BryL_tAt.js";import{At as T,D as E,Gt as D,Nt as ee,P as O,R as te,Rt as k,U as A,a as j,et as M,m as N,p as P,qt as ne,r as F,tt as I,z as L}from"./client-C_VWY70M.js";import{a as R,n as z,r as B,t as re}from"./ui-DpI1N3yJ.js";import{n as V}from"./Toast-CrwuIbKC.js";import{t as ie}from"./ConfirmDialog-bdDaAlT1.js";var H=e(f(),1),U=C();function ae({onConfirm:e}){let t=y(),[n,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(``),[s,c]=(0,H.useState)(!1),[l,f]=(0,H.useState)({}),{data:m,refetch:S}=x({queryKey:[`backups`],queryFn:()=>T().then(e=>e.data)}),{data:C}=x({queryKey:[`daemon-status`],queryFn:()=>A().then(e=>e.data)}),w=b({mutationFn:()=>j(n?{encrypt:!0,password:a}:{}),onSuccess:()=>{V(`备份创建成功`,`success`),o(``),i(!1),S()},onError:()=>V(`备份创建失败`,`error`)}),E=b({mutationFn:({filename:e,password:t})=>k(e,t),onSuccess:()=>{V(`数据库恢复成功,daemon 将自动重启`,`success`),t.clear()},onError:()=>V(`恢复失败,请检查密码或文件完整性`,`error`)});return(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(B,{children:(0,U.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`div`,{className:`flex-shrink-0 w-10 h-10 rounded-full bg-blue-50 flex items-center justify-center`,children:(0,U.jsx)(h,{className:`h-5 w-5 text-blue-600`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`当前数据库`}),(0,U.jsxs)(`p`,{className:`text-sm text-gray-500 mt-1`,children:[`内存占用:`,C?.memory?`${(C.memory.heapUsed/1024/1024).toFixed(2)} MB`:`加载中...`]})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm text-gray-600 cursor-pointer`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>i(e.target.checked),className:`rounded`}),(0,U.jsx)(d,{className:`h-3.5 w-3.5`}),`加密备份`]})}),n&&(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`input`,{type:s?`text`:`password`,placeholder:`备份密码(≥8位)`,value:a,onChange:e=>o(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 pr-8 w-48`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`absolute right-2 top-1/2 -translate-y-1/2 text-gray-400`,children:s?(0,U.jsx)(u,{className:`h-3.5 w-3.5`}):(0,U.jsx)(v,{className:`h-3.5 w-3.5`})})]}),(0,U.jsx)(z,{variant:`primary`,size:`sm`,icon:p,onClick:()=>w.mutate(),loading:w.isPending,disabled:n&&a.length<8,children:`立即备份`})]})]})}),(0,U.jsxs)(B,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,U.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`备份历史`}),(0,U.jsx)(z,{variant:`ghost`,size:`sm`,icon:_,onClick:()=>void S(),children:`刷新`})]}),m&&m.items.length>0?(0,U.jsx)(`div`,{className:`space-y-2`,children:m.items.map(t=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-gray-900 truncate`,children:t.filename}),t.encrypted&&(0,U.jsxs)(`span`,{className:`flex items-center gap-0.5 text-xs text-amber-600 bg-amber-50 px-1.5 py-0.5 rounded`,children:[(0,U.jsx)(d,{className:`h-3 w-3`}),` 已加密`]}),!t.hasChecksum&&(0,U.jsx)(`span`,{className:`text-xs text-gray-400 bg-gray-100 px-1.5 py-0.5 rounded`,children:`无校验`})]}),(0,U.jsxs)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:[g(new Date(t.createdAt),`yyyy-MM-dd HH:mm:ss`),` · `,t.sizeMb,` MB`]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 ml-3 flex-shrink-0`,children:[(0,U.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>e({title:`恢复数据库`,description:`确定要从 ${t.filename} 恢复数据库吗?当前数据库将被覆盖(会自动备份)。恢复后 daemon 将自动重启。`,onConfirm:()=>E.mutate({filename:t.filename,password:l[t.filename]})}),loading:E.isPending&&E.variables?.filename===t.filename,children:`恢复`}),(0,U.jsx)(`a`,{href:O(t.filename),download:t.filename,children:(0,U.jsx)(z,{variant:`ghost`,size:`sm`,icon:r,children:`下载`})})]})]}),t.encrypted&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(d,{className:`h-3.5 w-3.5 text-amber-500 flex-shrink-0`}),(0,U.jsx)(`input`,{type:`password`,placeholder:`输入解密密码后点击恢复`,value:l[t.filename]||``,onChange:e=>f(n=>({...n,[t.filename]:e.target.value})),className:`flex-1 px-2 py-1 text-xs border border-amber-200 rounded focus:outline-none focus:ring-1 focus:ring-amber-400`})]})]},t.filename))}):(0,U.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无备份记录`})]}),(0,U.jsxs)(B,{children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,U.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`数据管理`})}),(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:`清理历史事件`}),(0,U.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:`删除超过指定天数的事件记录`})]}),(0,U.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>e({title:`清理历史事件`,description:`确定要清理 30 天前的事件记录吗?此操作不可撤销。`,onConfirm:()=>{F.post(`/events/purge`,{retentionDays:30}).then(()=>V(`事件清理完成`,`success`)).catch(()=>V(`事件清理失败`,`error`))}}),children:`清理 30 天前`})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:`数据库优化`}),(0,U.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:`执行 VACUUM 回收空间,提升性能`})]}),(0,U.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>e({title:`数据库优化`,description:`确定要执行 VACUUM 优化吗?此操作可能需要几分钟。`,onConfirm:()=>{F.post(`/config/vacuum`).then(()=>V(`数据库优化完成`,`success`)).catch(()=>V(`数据库优化失败`,`error`))}}),children:`立即优化`})]})]})]})]})}function oe({onConfirm:e}){let{data:n,refetch:r}=x({queryKey:[`memory-caches`],queryFn:()=>M().then(e=>e.data)}),{data:i}=x({queryKey:[`memory-process`],queryFn:()=>I().then(e=>e.data)}),a=b({mutationFn:e=>N(e),onSuccess:()=>{V(`缓存已清空`,`success`),r()},onError:()=>V(`清空失败`,`error`)}),o=b({mutationFn:()=>P(),onSuccess:()=>{V(`所有缓存已清空`,`success`),r()},onError:()=>V(`清空失败`,`error`)}),s=b({mutationFn:()=>D(),onSuccess:()=>V(`GC 已触发`,`success`),onError:()=>V(`GC 触发失败`,`error`)});return(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(B,{children:(0,U.jsxs)(`div`,{className:`flex items-start justify-between mb-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`div`,{className:`flex-shrink-0 w-10 h-10 rounded-full bg-purple-50 flex items-center justify-center`,children:(0,U.jsx)(t,{className:`h-5 w-5 text-purple-600`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`进程内存`}),i&&(0,U.jsxs)(`div`,{className:`text-sm text-gray-600 mt-2 space-y-1`,children:[(0,U.jsxs)(`div`,{children:[`RSS: `,i.rssMB,` MB`]}),(0,U.jsxs)(`div`,{children:[`堆已用: `,i.heapUsedMB,` MB / `,i.heapTotalMB,` MB`]}),(0,U.jsxs)(`div`,{children:[`外部: `,i.externalMB,` MB`]})]})]})]}),(0,U.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>s.mutate(),loading:s.isPending,children:`触发 GC`})]})}),(0,U.jsxs)(B,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,U.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`LRU 缓存`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(z,{variant:`ghost`,size:`sm`,icon:_,onClick:()=>void r(),children:`刷新`}),(0,U.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>e({title:`清空所有缓存`,description:`确定要清空所有 LRU 缓存吗?`,onConfirm:()=>o.mutate()}),loading:o.isPending,children:`清空全部`})]})]}),n&&n.caches.length>0?(0,U.jsx)(`div`,{className:`space-y-2`,children:n.caches.map(e=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,U.jsxs)(`div`,{className:`flex-1`,children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,U.jsxs)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:[e.size,` / `,e.maxSize,` 条`,e.hitRate!==void 0&&` · 命中率 ${(e.hitRate*100).toFixed(1)}%`]})]}),(0,U.jsx)(z,{variant:`ghost`,size:`sm`,onClick:()=>a.mutate(e.name),loading:a.isPending&&a.variables===e.name,children:`清空`})]},e.name))}):(0,U.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无缓存数据`})]})]})}function se({currentConfig:e,onRestore:t,onConfirm:n}){let[r,i]=(0,H.useState)(null),{data:a}=x({queryKey:[`config-history`],queryFn:()=>L().then(e=>e.data)});return(0,U.jsxs)(B,{children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,U.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`最近 10 次配置变更`})}),a&&a.items.length>0?(0,U.jsx)(`div`,{className:`space-y-2`,children:a.items.map(a=>{let o=r===String(a.id),s=e,c=[];if(o&&s){let e=(t,n=``)=>typeof t!=`object`||!t?{[n]:JSON.stringify(t)}:Object.entries(t).reduce((t,[r,i])=>{let a=n?`${n}.${r}`:r;return typeof i==`object`&&i&&!Array.isArray(i)?Object.assign(t,e(i,a)):t[a]=JSON.stringify(i),t},{}),t=e(a.config),n=e(s);new Set([...Object.keys(t),...Object.keys(n)]).forEach(e=>{let r=t[e]??`(无)`,i=n[e]??`(无)`;r!==i&&c.push({key:e,old:r,cur:i})})}return(0,U.jsxs)(`div`,{className:`py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`span`,{className:`text-sm font-medium text-gray-900`,children:[`#`,a.id]}),(0,U.jsx)(`span`,{className:`text-xs text-gray-500`,children:g(new Date(a.savedAt),`yyyy-MM-dd HH:mm:ss`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(z,{variant:`ghost`,size:`sm`,onClick:()=>i(o?null:String(a.id)),children:o?`收起对比`:`与当前对比`}),(0,U.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>n({title:`确认恢复配置`,description:`确定要恢复到 ${g(new Date(a.savedAt),`yyyy-MM-dd HH:mm:ss`)} 的配置吗?当前配置将被覆盖。`,onConfirm:()=>t(a.config)}),children:`恢复到此版本`})]})]}),(0,U.jsx)(S,{children:o&&(0,U.jsx)(w.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,U.jsxs)(`div`,{className:`mt-3 rounded border border-gray-200 overflow-hidden text-xs font-mono`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-3 bg-gray-100 px-3 py-1.5 text-gray-500 font-medium text-xs`,children:[(0,U.jsx)(`span`,{children:`配置项`}),(0,U.jsx)(`span`,{className:`text-red-600`,children:`历史值`}),(0,U.jsx)(`span`,{className:`text-green-600`,children:`当前值`})]}),c.length===0?(0,U.jsx)(`div`,{className:`px-3 py-3 text-gray-400 text-center`,children:`与当前配置完全一致`}):c.map(({key:e,old:t,cur:n})=>(0,U.jsxs)(`div`,{className:`grid grid-cols-3 px-3 py-2 border-t border-gray-100 hover:bg-gray-50`,children:[(0,U.jsx)(`span`,{className:`text-gray-700 truncate`,children:e}),(0,U.jsx)(`span`,{className:`text-red-600 truncate`,children:t}),(0,U.jsx)(`span`,{className:`text-green-600 truncate`,children:n})]},e))]})})})]},a.id)})}):(0,U.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无历史记录`})]})}function ce({content:e,children:t,className:n}){let[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(`top`),s=(0,H.useRef)(null);return(0,H.useEffect)(()=>{r&&s.current&&o(s.current.getBoundingClientRect().top<80?`bottom`:`top`)},[r]),(0,U.jsxs)(`span`,{ref:s,className:R(`relative inline-flex items-center cursor-help`,n),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[t,r&&(0,U.jsx)(`span`,{className:R(`absolute z-50 w-max max-w-xs px-2.5 py-1.5 text-xs text-white bg-gray-800 rounded-lg shadow-lg pointer-events-none whitespace-normal`,a===`top`?`bottom-full mb-1.5 left-1/2 -translate-x-1/2`:`top-full mt-1.5 left-1/2 -translate-x-1/2`),children:e})]})}var W={Pipeline:`自动化工作流,将需求分解为多个节点依次执行`,Daemon:`后台守护进程,监听 Claude Code 事件并驱动编排引擎`,Hook:`Claude Code 生命周期钩子,在工具调用前后触发`,Distill:`将会话事件提炼为结构化知识,沉淀到知识图谱`,"Quality Gate":`质量门禁,在关键节点检测代码/文档质量问题`,Convention:`项目规范配置,定义节点类型、技能绑定和质量标准`,Skill:`可复用的 Claude Code 技能脚本,绑定到 Pipeline 节点`,ROI:`投资回报率,统计 AI 辅助节省的时间和 Token 用量`,Token:`LLM 处理的最小文本单元,影响 API 调用成本`,SSE:`Server-Sent Events,服务端向客户端推送实时事件的协议`},G=[{key:`distill`,title:`蒸馏配置`,description:`AI 知识蒸馏的触发条件和参数`,fields:[{key:`provider`,label:`提供商`,type:`select`,options:[{value:`claude`,label:`Claude`},{value:`openai`,label:`OpenAI`},{value:`ollama`,label:`Ollama`}]},{key:`auto_trigger`,label:`自动触发`,type:`boolean`,description:`达到事件阈值时自动蒸馏`},{key:`event_threshold`,label:`事件阈值`,type:`number`,description:`触发蒸馏的最小事件数`,min:1,max:1e4},{key:`timer_interval_minutes`,label:`定时器间隔(分钟)`,type:`number`,min:1,max:1440},{key:`model`,label:`模型`,type:`text`},{key:`api_key`,label:`API Key`,type:`text`,sensitive:!0,description:`留空自动从环境变量获取`},{key:`base_url`,label:`API 地址`,type:`text`,description:`留空使用默认地址`}]},{key:`autopilot`,title:`自动驾驶`,description:`意图分析、质量门禁、Pipeline 编排`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`intent_analysis`,label:`意图分析`,type:`boolean`,description:`AI 分析用户意图和任务复杂度`},{key:`quality_gate`,label:`质量门禁`,type:`boolean`,description:`代码变更时自动审查质量`},{key:`quality_review_interval`,label:`审查间隔`,type:`number`,description:`每 N 次 Write/Edit 触发一次审查`,min:1,max:100},{key:`auto_start_pipeline`,label:`自动启动流水线`,type:`boolean`},{key:`pipeline_confirm_mode`,label:`确认模式`,type:`select`,options:[{value:`prompt`,label:`提示确认`},{value:`auto`,label:`自动启动`},{value:`preview`,label:`仅预览`}]}]},{key:`resume`,title:`会话续接`,description:`中断会话的自动恢复`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`timeout_minutes`,label:`超时时间(分钟)`,type:`number`,min:1,max:1440},{key:`max_age_days`,label:`最大保留天数`,type:`number`,min:1,max:365}]},{key:`claudemd`,title:`CLAUDE.md 管理`,description:`项目级 CLAUDE.md 的自动生成与精炼`,fields:[{key:`auto_generate`,label:`自动生成`,type:`boolean`},{key:`auto_refine`,label:`自动精炼`,type:`boolean`},{key:`refine_interval`,label:`精炼间隔`,type:`number`,description:`每 N 次蒸馏后精炼一次`,min:1,max:100}]},{key:`orchestration`,title:`编排通知`,description:`蒸馏和 CLAUDE.md 更新的通知`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`notify_on_distill`,label:`蒸馏完成通知`,type:`boolean`},{key:`notify_on_claudemd`,label:`CLAUDE.md 更新通知`,type:`boolean`}]},{key:`web`,title:`Web 管理后台`,description:`Web 服务配置`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`port`,label:`端口`,type:`number`,min:1024,max:65535}]},{key:`ai`,title:`AI 模型`,description:`分层模型配置(Haiku/Sonnet/Opus)`,fields:[{key:`models.haiku`,label:`Haiku 模型`,type:`text`},{key:`models.sonnet`,label:`Sonnet 模型`,type:`text`},{key:`models.opus`,label:`Opus 模型`,type:`text`}]},{key:`storage`,title:`存储`,description:`数据库路径和容量限制`,fields:[{key:`path`,label:`数据库路径`,type:`text`},{key:`max_size_mb`,label:`最大容量(MB)`,type:`number`,min:100,max:102400}]},{key:`backup`,title:`备份配置`,description:`数据备份策略`,fields:[{key:`include_profile`,label:`包含用户画像`,type:`boolean`,description:`备份时包含用户画像数据`},{key:`encrypt_by_default`,label:`默认加密`,type:`boolean`,description:`备份文件默认加密`}]},{key:`pattern_engine`,title:`模式引擎`,description:`模式识别与演化配置`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`route_timeout_ms`,label:`路由超时(毫秒)`,type:`number`,min:100,max:6e4},{key:`evolve_interval_days`,label:`演化间隔(天)`,type:`number`,min:1,max:365},{key:`evolve_min_executions`,label:`最小执行次数`,type:`number`,description:`触发演化的最小执行次数`,min:1,max:1e3}]},{key:`ui`,title:`UI 配置`,description:`前端界面参数`,fields:[{key:`skill_repair_limit`,label:`Skill 修复上限`,type:`number`,min:1,max:100},{key:`logs_tail_default`,label:`日志默认条数`,type:`number`,min:10,max:1e3},{key:`pipeline_expire_hours`,label:`Pipeline 过期时间(小时)`,type:`number`,min:1,max:720}]},{key:`history`,title:`配置历史`,description:`查看最近 10 次配置变更记录`,fields:[]}];function K(){let e=y(),[d,f]=(0,H.useState)(null),[h,g]=(0,H.useState)(`idle`),[C,T]=(0,H.useState)(`distill`),[D,O]=(0,H.useState)(new Set),k=D.size>0,[A,j]=(0,H.useState)(null),[M,N]=(0,H.useState)(new Set),[P,I]=(0,H.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:L,isLoading:K}=x({queryKey:[`config`],queryFn:()=>te().then(e=>e.data)}),{data:q,refetch:J}=x({queryKey:[`daemon-diagnosis`],queryFn:()=>E().then(e=>e.data),enabled:C===`environment`}),Y=b({mutationFn:()=>ee(),onSuccess:e=>{j(e.data),J()}});(0,H.useEffect)(()=>{L&&!d&&f(L)},[L,d]);let X=b({mutationFn:e=>ne(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),g(`success`),O(new Set),setTimeout(()=>g(`idle`),3e3)},onError:()=>{g(`error`),setTimeout(()=>g(`idle`),3e3)}}),le=b({mutationFn:()=>F.post(`/config/reset`),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),f(null),g(`success`),setTimeout(()=>g(`idle`),3e3)}});if(K||!d)return(0,U.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,U.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let Z=(e,t)=>{let n=d[e];if(!n)return``;let r=t.split(`.`),i=n;for(let e of r)i=i?.[e];return i??``},Q=(e,t,n)=>{O(t=>new Set(t).add(e)),f(r=>{if(!r)return r;let i={...r[e]||{}},a=t.split(`.`);if(a.length===1)i[t]=n;else{let e={...i[a[0]]||{}};e[a[1]]=n,i[a[0]]=e}return{...r,[e]:i}})},ue=()=>{if(!d)return;let e={};D.forEach(t=>{e[t]=d[t]}),X.mutate(e)},de=()=>{f(L),O(new Set)},fe=()=>{let e=JSON.stringify(d,null,2),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`claude-forge-config-${new Date().toISOString().slice(0,10)}.json`,r.click(),URL.revokeObjectURL(n)},pe=()=>{let e=document.createElement(`input`);e.type=`file`,e.accept=`.json`,e.onchange=e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=e=>{try{f(JSON.parse(e.target?.result)),O(new Set(G.map(e=>e.key)))}catch{V(`配置文件格式错误,请选择有效的 JSON 文件`,`error`)}},n.readAsText(t)},e.click()},$=G.find(e=>e.key===C);return(0,U.jsxs)(`div`,{className:`flex gap-6`,children:[(0,U.jsx)(`div`,{className:`w-56 flex-shrink-0`,children:(0,U.jsx)(B,{className:`!p-2 sticky top-6`,children:(0,U.jsxs)(`nav`,{className:`space-y-1`,children:[G.map(e=>(0,U.jsx)(`button`,{onClick:()=>T(e.key),className:R(`w-full text-left px-3 py-2.5 rounded-lg text-sm transition-colors`,C===e.key?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50 hover:text-gray-900`),children:W[e.title]?(0,U.jsx)(ce,{content:W[e.title],children:e.title}):e.title},e.key)),(0,U.jsx)(`div`,{className:`border-t border-gray-100 my-1`}),(0,U.jsxs)(`button`,{onClick:()=>T(`backup_mgmt`),className:R(`w-full text-left px-3 py-2.5 rounded-lg text-sm transition-colors flex items-center gap-2`,C===`backup_mgmt`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50 hover:text-gray-900`),children:[(0,U.jsx)(p,{className:`h-3.5 w-3.5`}),`数据备份`]}),(0,U.jsxs)(`button`,{onClick:()=>T(`memory_mgmt`),className:R(`w-full text-left px-3 py-2.5 rounded-lg text-sm transition-colors flex items-center gap-2`,C===`memory_mgmt`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50 hover:text-gray-900`),children:[(0,U.jsx)(t,{className:`h-3.5 w-3.5`}),`内存管理`]}),(0,U.jsxs)(`button`,{onClick:()=>T(`environment`),className:R(`w-full text-left px-3 py-2.5 rounded-lg text-sm transition-colors flex items-center gap-2`,C===`environment`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50 hover:text-gray-900`),children:[(0,U.jsx)(o,{className:`h-3.5 w-3.5`}),`环境检测`]})]})})}),(0,U.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900`,children:C===`environment`?`环境检测`:C===`backup_mgmt`?`数据备份`:C===`memory_mgmt`?`内存管理`:C===`history`?`配置历史`:$?.title}),(0,U.jsx)(`p`,{className:`text-sm text-gray-500`,children:C===`environment`?`Hook 脚本与 Claude settings.json 注入状态检测与修复`:C===`backup_mgmt`?`数据库备份与历史备份管理`:C===`memory_mgmt`?`LRU 缓存状态与进程内存管理`:C===`history`?`查看最近 10 次配置变更记录`:$?.description??``})]}),C!==`environment`&&C!==`backup_mgmt`&&C!==`memory_mgmt`&&C!==`history`&&(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(S,{children:[h===`success`&&(0,U.jsxs)(w.div,{initial:{opacity:0,x:10},animate:{opacity:1,x:0},exit:{opacity:0},className:`flex items-center gap-1.5 text-green-600 text-sm`,children:[(0,U.jsx)(l,{className:`h-4 w-4`}),`已保存`]}),h===`error`&&(0,U.jsxs)(w.div,{initial:{opacity:0,x:10},animate:{opacity:1,x:0},exit:{opacity:0},className:`flex items-center gap-1.5 text-red-600 text-sm`,children:[(0,U.jsx)(s,{className:`h-4 w-4`}),`保存失败`]})]}),k&&(0,U.jsx)(re,{variant:`warning`,children:`未保存`}),(0,U.jsx)(z,{variant:`ghost`,size:`sm`,icon:r,onClick:fe,children:`导出`}),(0,U.jsx)(z,{variant:`ghost`,size:`sm`,icon:m,onClick:pe,children:`导入`}),(0,U.jsx)(z,{variant:`ghost`,size:`sm`,icon:c,onClick:de,disabled:!k,children:`撤销`}),(0,U.jsx)(z,{variant:`primary`,size:`sm`,icon:a,onClick:ue,loading:X.isPending,disabled:!k,children:`保存`})]})]}),C!==`environment`&&C!==`backup_mgmt`&&C!==`memory_mgmt`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(B,{children:(0,U.jsx)(`div`,{className:`space-y-6`,children:$?.fields.map(e=>(0,U.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,U.jsxs)(`div`,{className:`w-48 flex-shrink-0 pt-2`,children:[(0,U.jsx)(`label`,{className:`text-sm font-medium text-gray-700`,children:e.label}),e.description&&(0,U.jsx)(`p`,{className:`text-xs text-gray-400 mt-0.5`,children:e.description})]}),(0,U.jsx)(`div`,{className:`flex-1`,children:e.type===`boolean`?(0,U.jsx)(`button`,{onClick:()=>Q(C,e.key,!Z(C,e.key)),className:R(`relative inline-flex h-6 w-11 items-center rounded-full transition-colors`,Z(C,e.key)?`bg-blue-600`:`bg-gray-300`),children:(0,U.jsx)(`span`,{className:R(`inline-block h-4 w-4 transform rounded-full bg-white transition-transform`,Z(C,e.key)?`translate-x-6`:`translate-x-1`)})}):e.type===`select`?(0,U.jsx)(`select`,{value:String(Z(C,e.key)||``),onChange:t=>Q(C,e.key,t.target.value),className:`w-full max-w-xs px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`,children:e.options?.map(e=>(0,U.jsx)(`option`,{value:e.value,children:e.label},e.value))}):e.type===`number`?(0,U.jsx)(`input`,{type:`number`,value:Number(Z(C,e.key))||0,onChange:t=>Q(C,e.key,Number(t.target.value)),min:e.min,max:e.max,className:`w-full max-w-xs px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`}):(0,U.jsxs)(`div`,{className:`relative flex items-center max-w-xs`,children:[(0,U.jsx)(`input`,{type:e.sensitive&&!M.has(`${C}.${e.key}`)?`password`:`text`,value:String(Z(C,e.key)||``),onChange:t=>Q(C,e.key,t.target.value),className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm pr-9`}),e.sensitive&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>N(t=>{let n=new Set(t),r=`${C}.${e.key}`;return n.has(r)?n.delete(r):n.add(r),n}),className:`absolute right-2 text-gray-400 hover:text-gray-600`,children:M.has(`${C}.${e.key}`)?(0,U.jsx)(u,{className:`h-4 w-4`}):(0,U.jsx)(v,{className:`h-4 w-4`})})]})})]},e.key))})}),(0,U.jsx)(B,{className:`!border-red-200`,children:(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-red-600`,children:`重置配置`}),(0,U.jsx)(`p`,{className:`text-xs text-gray-500 mt-1`,children:`将所有配置恢复为默认值,此操作不可撤销`})]}),(0,U.jsx)(z,{variant:`danger`,size:`sm`,icon:n,onClick:()=>{I({open:!0,title:`重置配置`,description:`确定要重置所有配置为默认值吗?此操作不可撤销。`,onConfirm:()=>{le.mutate(),I({...P,open:!1})}})},loading:le.isPending,children:`重置`})]})})]}),C===`backup_mgmt`&&(0,U.jsx)(ae,{onConfirm:e=>I({...e,open:!0})}),C===`memory_mgmt`&&(0,U.jsx)(oe,{onConfirm:e=>I({...e,open:!0})}),C===`history`&&(0,U.jsx)(se,{currentConfig:L,onRestore:e=>X.mutate(e),onConfirm:e=>I({...e,open:!0})}),C===`environment`&&(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(B,{children:(0,U.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`font-medium text-gray-900 mb-1`,children:`Hook 环境诊断`}),(0,U.jsx)(`p`,{className:`text-sm text-gray-500`,children:`检测 Forge hooks 脚本与 Claude settings.json 中 Forge 注入是否完整`})]}),(0,U.jsxs)(`div`,{className:`flex gap-2 flex-shrink-0`,children:[(0,U.jsx)(z,{variant:`secondary`,size:`sm`,icon:_,onClick:()=>J(),children:`重新检测`}),(0,U.jsx)(z,{size:`sm`,icon:i,onClick:()=>Y.mutate(),disabled:Y.isPending||q?.hooksHealthy,children:Y.isPending?`修复中...`:`一键修复`})]})]})}),A&&(0,U.jsx)(B,{children:(0,U.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2`,children:[A.hooksHealthy?(0,U.jsx)(l,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,U.jsx)(n,{className:`h-4 w-4 text-yellow-500 mt-0.5 flex-shrink-0`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:R(`text-sm font-medium`,A.hooksHealthy?`text-gray-900`:`text-yellow-600`),children:A.hooksHealthy?`Hooks 环境已恢复正常`:`修复后仍有未通过项,请根据下方列表排查`}),A.backupPath&&(0,U.jsxs)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:[`已备份 settings: `,A.backupPath.split(`/`).pop()]})]})]}),(0,U.jsx)(z,{variant:`ghost`,size:`sm`,icon:s,onClick:()=>j(null)})]})}),q&&(0,U.jsx)(B,{children:(0,U.jsx)(`div`,{className:`space-y-2`,children:q.items.map(e=>(0,U.jsxs)(`div`,{className:`flex items-start gap-3 py-2 border-b border-gray-50 last:border-0`,children:[(0,U.jsx)(`div`,{className:`flex-shrink-0 mt-0.5`,children:e.ok?(0,U.jsx)(l,{className:`h-4 w-4 text-green-500`}):e.id===`daemon_process`?(0,U.jsx)(n,{className:`h-4 w-4 text-yellow-500`}):(0,U.jsx)(s,{className:`h-4 w-4 text-red-500`})}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.label}),(0,U.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5 break-all`,children:e.detail})]})]},e.id))})}),q&&(0,U.jsx)(B,{className:q.hooksHealthy?`!border-green-200 !bg-green-50`:`!border-yellow-200 !bg-yellow-50`,children:(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:q.hooksHealthy?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(l,{className:`h-5 w-5 text-green-600`}),(0,U.jsx)(`p`,{className:`text-sm font-medium text-green-700`,children:`Hooks 相关环境正常`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(n,{className:`h-5 w-5 text-yellow-600`}),(0,U.jsx)(`p`,{className:`text-sm font-medium text-yellow-700`,children:`检测到 Hooks 环境不完整,请点击「一键修复」`})]})})})]})]}),(0,U.jsx)(ie,{open:P.open,title:P.title,description:P.description,variant:`danger`,onConfirm:P.onConfirm,onCancel:()=>I({...P,open:!1})})]})}export{K as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{At as t,Nt as n,ar as r,fn as i}from"./vendor-2ObLXPrQ.js";import{r as a}from"./vendor-motion-BryL_tAt.js";import{a as o,n as s}from"./ui-DpI1N3yJ.js";var c=e(r(),1),l=a();function u({open:e,title:r,description:a,confirmText:u=`确认`,cancelText:d=`取消`,variant:f=`default`,loading:p=!1,count:m,onConfirm:h,onCancel:g}){let[_,v]=(0,c.useState)(``),y=m!==void 0&&m>=5&&m<=20,b=m!==void 0&&m>20,x=y||b,S=b?`DELETE`:String(m),C=!x||_===S;if((0,c.useEffect)(()=>{if(!e){v(``);return}let t=e=>{e.key===`Escape`&&g(),e.key===`Enter`&&C&&h()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,h,g,C]),!e)return null;let w=f===`danger`?n:f===`warning`?t:i,T=f===`danger`?`text-red-500`:f===`warning`?`text-amber-500`:`text-blue-500`;return(0,l.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm`,onClick:g,children:(0,l.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md mx-4 p-6`,onClick:e=>e.stopPropagation(),children:[(0,l.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,l.jsx)(`div`,{className:o(`flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center`,f===`danger`?`bg-red-50`:f===`warning`?`bg-amber-50`:`bg-blue-50`),children:(0,l.jsx)(w,{className:o(`h-5 w-5`,T)})}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsx)(`h3`,{className:`text-base font-semibold text-gray-900`,children:r}),(0,l.jsx)(`p`,{className:`mt-1 text-sm text-gray-500 leading-relaxed`,children:a})]})]}),x&&(0,l.jsxs)(`div`,{className:`mt-4`,children:[(0,l.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:b?(0,l.jsxs)(l.Fragment,{children:[`请输入 `,(0,l.jsx)(`code`,{className:`px-1 py-0.5 bg-gray-100 rounded text-red-600 font-mono text-xs`,children:`DELETE`}),` 以确认操作`]}):(0,l.jsxs)(l.Fragment,{children:[`请输入数量 `,(0,l.jsx)(`code`,{className:`px-1 py-0.5 bg-gray-100 rounded text-gray-800 font-mono text-xs`,children:m}),` 以确认操作`]})}),(0,l.jsx)(`input`,{autoFocus:!0,type:`text`,value:_,onChange:e=>v(e.target.value),placeholder:S,className:o(`w-full px-3 py-2 border rounded-lg text-sm focus:outline-none focus:ring-2`,_&&!C?`border-red-300 focus:ring-red-400`:`border-gray-200 focus:ring-blue-500`)})]}),(0,l.jsxs)(`div`,{className:`flex justify-end gap-3 mt-6`,children:[(0,l.jsx)(s,{variant:`secondary`,size:`sm`,onClick:g,disabled:p,children:d}),(0,l.jsx)(s,{variant:f===`danger`?`danger`:`primary`,size:`sm`,onClick:h,loading:p,disabled:!C,children:u})]})]})})}export{u as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Dn as t,Et as n,Gt as r,Nt as i,Pn as a,Rn as o,Wt as s,Zn as c,ar as l,jt as u,qt as d,xn as f}from"./vendor-2ObLXPrQ.js";import{a as p,n as m,r as h}from"./vendor-query-CjmRaY7o.js";import{r as g}from"./vendor-motion-BryL_tAt.js";import{B as _,H as v,J as y,Ot as b,V as x,Vt as S,Wt as C,Y as w,b as T,d as E}from"./client-C_VWY70M.js";import{n as D}from"./Toast-CrwuIbKC.js";import{t as O}from"./ConfirmDialog-bdDaAlT1.js";var k=e(l(),1),A=g();function j(){let[e,r]=(0,k.useState)(`library`),[a,o]=(0,k.useState)(`all`),[l,u]=(0,k.useState)(``),[g,_]=(0,k.useState)(new Set),[v,y]=(0,k.useState)(null),[S,j]=(0,k.useState)(``),[F,I]=(0,k.useState)(!1),[L,R]=(0,k.useState)(null),z=p(),{data:B,isLoading:V}=h({queryKey:[`global-conventions`],queryFn:()=>w().then(e=>e.data)}),{data:H}=h({queryKey:[`convention-usage-stats`],queryFn:()=>x().then(e=>e.data),enabled:e===`usage`}),U=m({mutationFn:()=>C().then(e=>e.data),onSuccess:e=>{D(e.added.length+e.updated.length>0?`同步完成:新增 ${e.added.length},更新 ${e.updated.length}`:`已是最新`,`success`),z.invalidateQueries({queryKey:[`global-conventions`]})}}),W=m({mutationFn:e=>b(e).then(e=>e.data),onSuccess:e=>{D(`已安装:${e.convention.name}`,`success`),j(``),I(!1),z.invalidateQueries({queryKey:[`global-conventions`]})}}),G=m({mutationFn:e=>T(e).then(e=>e.data),onSuccess:(e,t)=>{D(`规范已删除`,`success`),R(null),z.invalidateQueries({queryKey:[`global-conventions`]})}}),K=m({mutationFn:e=>E(e.length>0?e:void 0).then(e=>e.data),onSuccess:e=>{D(`进化完成:${e.results.success.length} 个规范已更新`,`success`),z.invalidateQueries({queryKey:[`global-conventions`]})}}),q=(B?.items||[]).filter(e=>!(a!==`all`&&e.source!==a||l&&!e.name.toLowerCase().includes(l.toLowerCase()))),J=e=>{_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Y=q.length>0&&g.size===q.length,X=()=>_(Y?new Set:new Set(q.map(e=>e.id))),Z={official:`bg-amber-50 text-amber-700`,user:`bg-blue-50 text-blue-700`,community:`bg-purple-50 text-purple-700`},Q={official:`官方`,user:`用户`,community:`社区`};return(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`规范管理`}),(0,A.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`管理全局规范模板,绑定到项目,追踪使用情况`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsxs)(`button`,{onClick:()=>U.mutate(),disabled:U.isPending,className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-amber-50 text-amber-700 hover:bg-amber-100 rounded-lg transition-colors`,children:[(0,A.jsx)(d,{className:`h-4 w-4 ${U.isPending?`animate-spin`:``}`}),`同步官方规范`]}),(0,A.jsxs)(`button`,{onClick:()=>I(!F),className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-blue-600 text-white hover:bg-blue-700 rounded-lg transition-colors`,children:[(0,A.jsx)(t,{className:`h-4 w-4`}),`从 URL 安装`]})]})]}),F&&(0,A.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:(0,A.jsxs)(`div`,{className:`flex gap-3`,children:[(0,A.jsx)(`input`,{type:`text`,placeholder:`规范 YAML 文件 URL...`,value:S,onChange:e=>j(e.target.value),onKeyDown:e=>e.key===`Enter`&&S.trim()&&W.mutate(S.trim()),className:`flex-1 px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,A.jsx)(`button`,{onClick:()=>W.mutate(S.trim()),disabled:!S.trim()||W.isPending,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:W.isPending?`安装中...`:`安装`}),(0,A.jsx)(`button`,{onClick:()=>I(!1),className:`p-2 text-gray-400 hover:text-gray-600 rounded-lg`,children:(0,A.jsx)(n,{className:`h-4 w-4`})})]})}),(0,A.jsx)(`div`,{className:`border-b border-gray-200`,children:(0,A.jsx)(`nav`,{className:`flex gap-1`,children:[{key:`library`,label:`规范库`},{key:`usage`,label:`使用统计`},{key:`evolution`,label:`进化历史`}].map(t=>(0,A.jsx)(`button`,{onClick:()=>r(t.key),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${e===t.key?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:t.label},t.key))})}),e===`library`&&(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3 flex-wrap`,children:[(0,A.jsx)(`div`,{className:`flex gap-1`,children:[`all`,`official`,`user`,`community`].map(e=>(0,A.jsx)(`button`,{onClick:()=>o(e),className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${a===e?`bg-blue-600 text-white`:`bg-gray-100 text-gray-600 hover:bg-gray-200`}`,children:{all:`全部`,official:`官方`,user:`用户`,community:`社区`}[e]},e))}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(s,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400`}),(0,A.jsx)(`input`,{type:`text`,placeholder:`搜索规范名称...`,value:l,onChange:e=>u(e.target.value),className:`pl-8 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 w-48`})]}),(0,A.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[q.length,` 个规范`]}),g.size>0&&(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,A.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`已选 `,g.size,` 个`]}),(0,A.jsxs)(`button`,{onClick:()=>K.mutate(Array.from(g)),disabled:K.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-green-50 text-green-600 hover:bg-green-100 rounded-lg transition-colors`,children:[(0,A.jsx)(d,{className:`h-3.5 w-3.5 ${K.isPending?`animate-spin`:``}`}),`批量进化`]})]})]}),V?(0,A.jsx)(`div`,{className:`flex items-center justify-center h-48 bg-white rounded-xl border border-gray-200`,children:(0,A.jsx)(d,{className:`h-8 w-8 animate-spin text-blue-500`})}):(0,A.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,A.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,A.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,A.jsxs)(`tr`,{children:[(0,A.jsx)(`th`,{className:`w-10 px-4 py-3`,children:(0,A.jsx)(`input`,{type:`checkbox`,checked:Y,onChange:X,className:`rounded`})}),(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`规范名称`}),(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`版本`}),(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`角色数`}),(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`质量标准`}),(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,A.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:q.map(e=>(0,A.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,A.jsx)(`td`,{className:`px-4 py-3`,children:(0,A.jsx)(`input`,{type:`checkbox`,checked:g.has(e.id),onChange:()=>J(e.id),className:`rounded`})}),(0,A.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,A.jsx)(`button`,{onClick:()=>y(e.id),className:`font-medium text-blue-600 hover:text-blue-700 text-left`,children:e.name}),(0,A.jsx)(`div`,{className:`text-xs text-gray-500 truncate max-w-xs mt-0.5`,children:e.description})]}),(0,A.jsx)(`td`,{className:`px-4 py-3`,children:(0,A.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full font-medium ${Z[e.source]||`bg-gray-100 text-gray-600`}`,children:Q[e.source]||e.source})}),(0,A.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.version||`—`}),(0,A.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.roles?Object.keys(e.roles).length:0}),(0,A.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.quality_standards?.length||0}),(0,A.jsx)(`td`,{className:`px-4 py-3`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,A.jsx)(`button`,{onClick:()=>y(e.id),className:`p-1.5 text-gray-400 hover:text-blue-500 rounded transition-colors`,title:`查看/编辑`,children:(0,A.jsx)(f,{className:`h-4 w-4`})}),e.source!==`official`&&(0,A.jsx)(`button`,{onClick:()=>R(e),className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`删除`,children:(0,A.jsx)(i,{className:`h-4 w-4`})})]})})]},e.id))})]}),q.length===0&&(0,A.jsxs)(`div`,{className:`text-center py-12`,children:[(0,A.jsx)(c,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,A.jsx)(`p`,{className:`text-gray-500`,children:`暂无规范`}),(0,A.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`点击「同步官方规范」获取内置规范`})]})]})]}),e===`usage`&&(0,A.jsx)(M,{data:H?.items||[]}),e===`evolution`&&(0,A.jsx)(N,{conventions:B?.items||[]}),v&&(0,A.jsx)(P,{id:v,onClose:()=>y(null)}),L&&(0,A.jsx)(O,{open:!!L,title:`删除规范`,description:`确定要删除规范「${L.name}」吗?此操作不可撤销。`,variant:`danger`,onConfirm:()=>G.mutate(L.id),onCancel:()=>R(null)})]})}function M({data:e}){let[t,n]=(0,k.useState)(null);return(0,A.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:e.length===0?(0,A.jsxs)(`div`,{className:`text-center py-12`,children:[(0,A.jsx)(u,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,A.jsx)(`p`,{className:`text-gray-500`,children:`暂无使用数据`})]}):(0,A.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,A.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,A.jsxs)(`tr`,{children:[(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`规范名称`}),(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`使用项目数`}),(0,A.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,A.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:e.map(e=>(0,A.jsxs)(k.Fragment,{children:[(0,A.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,A.jsx)(`td`,{className:`px-4 py-3 font-medium text-gray-900`,children:e.name}),(0,A.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.source}),(0,A.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.projectCount}),(0,A.jsx)(`td`,{className:`px-4 py-3`,children:(0,A.jsx)(`button`,{onClick:()=>n(t===e.id?null:e.id),className:`text-xs text-blue-600 hover:text-blue-700`,children:t===e.id?`收起`:`查看项目`})})]}),t===e.id&&(0,A.jsx)(`tr`,{children:(0,A.jsx)(`td`,{colSpan:4,className:`px-4 py-3 bg-gray-50`,children:(0,A.jsx)(`div`,{className:`text-xs text-gray-600 space-y-1`,children:e.projects.map((e,t)=>(0,A.jsx)(`div`,{className:`font-mono`,children:e},t))})})})]},e.id))})]})})}function N({conventions:e}){let[t,n]=(0,k.useState)(null),{data:r,isLoading:i}=h({queryKey:[`convention-evolution`,t],queryFn:()=>t?_(t).then(e=>e.data):null,enabled:!!t});return(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,A.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:`选择规范`}),(0,A.jsxs)(`select`,{value:t||``,onChange:e=>n(e.target.value||null),className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,A.jsx)(`option`,{value:``,children:`— 请选择 —`}),e.map(e=>(0,A.jsxs)(`option`,{value:e.id,children:[e.name,` (v`,e.version,`)`]},e.id))]})]}),t&&(0,A.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:i?(0,A.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,A.jsx)(d,{className:`h-8 w-8 animate-spin text-blue-500`})}):!r||r.history.length===0?(0,A.jsxs)(`div`,{className:`text-center py-12`,children:[(0,A.jsx)(a,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,A.jsx)(`p`,{className:`text-gray-500`,children:`暂无进化记录`})]}):(0,A.jsx)(`div`,{className:`space-y-4`,children:r.history.map((e,t)=>(0,A.jsxs)(`div`,{className:`border-l-2 border-blue-200 pl-4 pb-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(o,{className:`h-4 w-4 text-green-500`}),(0,A.jsxs)(`span`,{className:`text-sm font-medium text-gray-900`,children:[e.previousVersion,` → `,e.newVersion]}),(0,A.jsx)(`span`,{className:`text-xs text-gray-500`,children:new Date(e.timestamp).toLocaleString(`zh-CN`)})]}),e.changes.length>0&&(0,A.jsx)(`ul`,{className:`text-sm text-gray-600 space-y-1 ml-6`,children:e.changes.map((e,t)=>(0,A.jsx)(`li`,{className:`list-disc`,children:e},t))})]},t))})})]})}function P({id:e,onClose:t}){let[i,a]=(0,k.useState)(``),[o,s]=(0,k.useState)(!1),c=p(),{data:l,isLoading:u}=h({queryKey:[`global-convention`,e],queryFn:()=>y(e).then(e=>e.data)}),{data:g}=h({queryKey:[`convention-yaml`,e],queryFn:()=>v(e).then(e=>e.data),enabled:o});(0,k.useEffect)(()=>{g?.yaml!==void 0&&a(g.yaml)},[g]);let _=m({mutationFn:t=>S(e,t).then(e=>e.data),onSuccess:()=>{D(`保存成功`,`success`),s(!1),c.invalidateQueries({queryKey:[`global-convention`,e]}),c.invalidateQueries({queryKey:[`global-conventions`]})},onError:()=>{D(`保存失败`,`error`)}}),b=m({mutationFn:()=>E([e]).then(e=>e.data),onSuccess:t=>{t.results.success.length>0?(D(`规范已进化更新`,`success`),c.invalidateQueries({queryKey:[`global-convention`,e]}),c.invalidateQueries({queryKey:[`global-conventions`]})):D(`进化失败:`+(t.results.failed[0]?.error||`未知错误`),`error`)},onError:()=>{D(`进化失败`,`error`)}});if(u)return(0,A.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,A.jsx)(`div`,{className:`bg-white rounded-xl p-8`,children:(0,A.jsx)(d,{className:`h-8 w-8 animate-spin text-blue-500 mx-auto`})})});if(!l)return null;let x=l.source===`official`;return(0,A.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`,onClick:t,children:(0,A.jsxs)(`div`,{className:`bg-white rounded-xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between p-6 border-b border-gray-200`,children:[(0,A.jsxs)(`div`,{className:`flex-1`,children:[(0,A.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:l.name}),(0,A.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:l.description})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 ml-4`,children:[(0,A.jsxs)(`button`,{onClick:()=>b.mutate(),disabled:b.isPending,className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-green-50 text-green-600 hover:bg-green-100 rounded-lg transition-colors disabled:opacity-50`,title:`AI 进化优化`,children:[(0,A.jsx)(d,{className:`h-4 w-4 ${b.isPending?`animate-spin`:``}`}),b.isPending?`进化中...`:`手动进化`]}),(0,A.jsx)(`button`,{onClick:t,className:`p-2 text-gray-400 hover:text-gray-600 rounded-lg transition-colors`,children:(0,A.jsx)(n,{className:`h-5 w-5`})})]})]}),(0,A.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 space-y-4`,children:[(0,A.jsxs)(`div`,{className:`grid grid-cols-3 gap-4 text-sm`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-gray-500`,children:`版本`}),(0,A.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:l.version})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-gray-500`,children:`来源`}),(0,A.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:l.source===`official`?`官方`:l.source===`user`?`用户`:`社区`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-gray-500`,children:`角色数`}),(0,A.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:l.roles?Object.keys(l.roles).length:0})]})]}),o?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(`label`,{className:`text-sm font-medium text-gray-700`,children:`YAML 内容`}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(`button`,{onClick:()=>_.mutate(i),disabled:_.isPending,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 disabled:opacity-50 transition-colors`,children:[(0,A.jsx)(r,{className:`h-3.5 w-3.5`}),_.isPending?`保存中...`:`保存`]}),(0,A.jsx)(`button`,{onClick:()=>s(!1),className:`px-3 py-1.5 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}),(0,A.jsx)(`div`,{className:`border border-gray-200 rounded-lg overflow-hidden`,children:(0,A.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),className:`w-full h-[500px] p-4 text-sm font-mono bg-gray-50 border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none`,spellCheck:!1})})]}):(0,A.jsxs)(`div`,{className:`space-y-4`,children:[l.principles&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`核心原则`}),(0,A.jsx)(`pre`,{className:`text-sm text-gray-600 bg-gray-50 p-3 rounded-lg overflow-x-auto whitespace-pre-wrap`,children:l.principles})]}),l.roles&&Object.keys(l.roles).length>0&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`角色定义`}),(0,A.jsx)(`div`,{className:`space-y-2`,children:Object.entries(l.roles).map(([e,t])=>(0,A.jsxs)(`div`,{className:`bg-gray-50 p-3 rounded-lg`,children:[(0,A.jsx)(`div`,{className:`font-medium text-gray-900 text-sm`,children:t.name||e}),t.responsibilities&&(0,A.jsxs)(`div`,{className:`text-xs text-gray-600 mt-1`,children:[`职责:`,t.responsibilities]}),t.constraints&&(0,A.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[`约束:`,t.constraints]})]},e))})]}),l.quality_standards&&l.quality_standards.length>0&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`质量标准`}),(0,A.jsx)(`div`,{className:`space-y-1.5`,children:l.quality_standards.map((e,t)=>(0,A.jsxs)(`div`,{className:`flex items-start gap-2 text-sm`,children:[(0,A.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded font-medium ${e.severity===`must`?`bg-red-50 text-red-600`:e.severity===`should`?`bg-amber-50 text-amber-600`:`bg-blue-50 text-blue-600`}`,children:e.severity===`must`?`必须`:e.severity===`should`?`应该`:`可以`}),(0,A.jsxs)(`span`,{className:`text-gray-500`,children:[`[`,e.category,`]`]}),(0,A.jsx)(`span`,{className:`text-gray-700 flex-1`,children:e.rule})]},t))})]}),l.active_prompt&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`Active Prompt`}),(0,A.jsx)(`pre`,{className:`text-xs text-gray-600 bg-gray-50 p-3 rounded-lg overflow-x-auto whitespace-pre-wrap`,children:l.active_prompt})]}),!x&&(0,A.jsxs)(`button`,{onClick:()=>s(!0),className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-blue-50 text-blue-600 hover:bg-blue-100 rounded-lg transition-colors`,children:[(0,A.jsx)(f,{className:`h-4 w-4`}),`编辑 YAML`]})]})]})]})})}export{j as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{$n as t,$t as n,An as r,At as i,Et as a,Ht as o,Jn as s,Jt as ee,Nt as c,Pn as l,Tt as u,Wn as d,Xt as f,ar as p,gn as m,n as h,nr as g,qt as _,wn as v}from"./vendor-2ObLXPrQ.js";import{a as y,n as b,r as x}from"./vendor-query-CjmRaY7o.js";import{d as te}from"./vendor-react-DZi7brq3.js";import{r as S,t as C}from"./vendor-motion-BryL_tAt.js";import{Ft as ne,G as w,Lt as T,M as E,U as D,et as O,g as re,h as ie,ht as ae,ot as oe,tt as se}from"./client-C_VWY70M.js";import{a as k,i as A,l as j,n as M,r as N,s as P,t as F}from"./ui-DpI1N3yJ.js";import{t as I}from"./ConfirmDialog-bdDaAlT1.js";import{t as L}from"./MiniCharts-DsV2Sqfk.js";var R=e(p(),1),z=S(),B={PreToolUse:`#3b82f6`,PostToolUse:`#10b981`,UserPromptSubmit:`#f59e0b`,Stop:`#ef4444`,Notification:`#8b5cf6`};function V(){let e=te(),p=y(),[S,V]=(0,R.useState)(!1),H=(0,R.useRef)(null),[U,W]=(0,R.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:G}=x({queryKey:[`pipelines-active`],queryFn:()=>E().then(e=>e.data)}),K=(G?.total||0)>0,{data:q}=x({queryKey:[`daemon-status`],queryFn:()=>D().then(e=>e.data)}),{data:J}=x({queryKey:[`overview`],queryFn:()=>oe().then(e=>e.data)}),{data:Y}=x({queryKey:[`roi-stats`],queryFn:()=>ae().then(e=>e.data)}),{data:X,refetch:ce}=x({queryKey:[`events-live`],queryFn:()=>w({limit:100}).then(e=>e.data)}),{data:Z}=x({queryKey:[`memory-process-dash`],queryFn:()=>se().then(e=>e.data)}),{data:Q}=x({queryKey:[`memory-caches-dash`],queryFn:()=>O().then(e=>e.data)}),le=b({mutationFn:e=>re(e),onSuccess:()=>p.invalidateQueries({queryKey:[`pipelines-active`]})}),ue=b({mutationFn:()=>ie(),onSuccess:()=>p.invalidateQueries({queryKey:[`pipelines-active`]})}),de=b({mutationFn:()=>ne(),onSuccess:()=>p.invalidateQueries({queryKey:[`overview`]})}),fe=b({mutationFn:()=>T()});(0,R.useEffect)(()=>{!S&&H.current&&H.current.scrollIntoView({behavior:`smooth`})},[X,S]);let $=J?.recommendations?.find(e=>e.action===`/quality`);return(0,z.jsxs)(`div`,{className:`space-y-6`,children:[(0,z.jsx)(N,{className:`!p-3`,children:(0,z.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-4 text-sm flex-wrap`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`div`,{className:k(`w-2 h-2 rounded-full`,q?.running?`bg-green-500 animate-pulse`:`bg-red-500`)}),(0,z.jsx)(`span`,{className:`font-medium`,children:q?.running?`Daemon PID:${q.pid}`:`Daemon 离线`})]}),q?.uptime&&(0,z.jsxs)(`span`,{className:`text-gray-400`,children:[`运行 `,q.uptime.formatted]}),q?.memory&&(0,z.jsxs)(`span`,{className:`text-gray-400`,children:[`内存 `,q.memory.rss,`MB`]}),K&&(0,z.jsx)(F,{variant:`info`,children:`Pipeline 运行中`}),$&&(0,z.jsx)(F,{variant:`warning`,children:$.title})]}),(0,z.jsx)(M,{variant:`ghost`,size:`sm`,icon:ee,onClick:()=>{W({open:!0,title:`重启 Daemon`,description:`确认重启 daemon?这将中断当前所有会话。`,onConfirm:()=>{fe.mutate(),W(e=>({...e,open:!1}))}})},children:`重启`})]})}),Z&&(0,z.jsx)(N,{className:`!p-3`,children:(0,z.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-3`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(r,{className:`h-4 w-4 text-purple-500`}),(0,z.jsx)(`span`,{className:`text-sm font-medium text-gray-700`,children:`内存`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-4 text-sm flex-wrap`,children:[(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[`RSS `,(0,z.jsxs)(`span`,{className:`font-mono text-gray-800`,children:[Z.rssMB,` MB`]})]}),(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[`堆 `,(0,z.jsxs)(`span`,{className:`font-mono text-gray-800`,children:[Z.heapUsedMB,`/`,Z.heapTotalMB,` MB`]})]}),Q&&(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[`缓存 `,(0,z.jsxs)(`span`,{className:`font-mono text-gray-800`,children:[Q.caches.reduce((e,t)=>e+t.size,0),`/`,Q.caches.reduce((e,t)=>e+t.maxSize,0)]}),` 条`]}),(0,z.jsx)(`button`,{onClick:()=>e(`/config?section=memory_mgmt`),className:`text-xs text-blue-600 hover:underline`,children:`管理`})]})]})}),K&&(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3`,children:`当前运行中`}),(0,z.jsx)(`div`,{className:`space-y-3`,children:G?.items.map((t,n)=>(0,z.jsx)(C.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,z.jsx)(N,{className:`border-l-4 border-l-blue-500 !p-4`,children:(0,z.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,z.jsx)(m,{className:`h-5 w-5 text-blue-500`}),t.type===`dynamic`&&(0,z.jsx)(F,{variant:`primary`,size:`sm`,children:`动态编排`}),(0,z.jsx)(F,{variant:`info`,children:t.phaseLabel}),(0,z.jsx)(`span`,{className:`text-sm text-gray-500`,children:t.projectPath?t.projectPath.split(`/`).pop():``})]}),(0,z.jsx)(`p`,{className:`text-sm text-gray-700 line-clamp-2`,children:t.requirement?.slice(0,150)}),(0,z.jsxs)(`p`,{className:`text-xs text-gray-400 mt-2`,children:[`创建于 `,t.updatedAt?h(j(t.updatedAt),`HH:mm:ss`):``]})]}),(0,z.jsxs)(`div`,{className:`flex gap-2 ml-4`,children:[(0,z.jsx)(M,{variant:`secondary`,size:`sm`,icon:v,onClick:()=>e(`/pipelines/${t.id}`),children:`查看`}),(0,z.jsx)(M,{variant:`danger`,size:`sm`,icon:a,onClick:()=>{W({open:!0,title:`关闭 Pipeline`,description:`确认关闭此 Pipeline?`,onConfirm:()=>{le.mutate(t.id),W(e=>({...e,open:!1}))}})},children:`关闭`})]})]})})},t.id))})]}),J?.recommendations&&J.recommendations.length>0&&(0,z.jsx)(`div`,{className:`space-y-2`,children:J.recommendations.map((n,r)=>(0,z.jsxs)(C.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:k(`flex items-center justify-between p-3 rounded-lg border cursor-pointer transition-all hover:shadow-sm`,n.type===`warning`?`bg-amber-50 border-amber-200`:`bg-blue-50 border-blue-200`),children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3 flex-1`,onClick:()=>e(n.action),children:[(0,z.jsx)(i,{className:k(`h-4 w-4`,n.type===`warning`?`text-amber-500`:`text-blue-500`)}),(0,z.jsx)(`span`,{className:`text-sm font-medium`,children:n.title})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[n.action===`/quality`&&(0,z.jsx)(M,{variant:`ghost`,size:`sm`,icon:d,onClick:e=>{e.stopPropagation(),de.mutate()},children:`修复`}),n.action===`/pipelines`&&(0,z.jsx)(M,{variant:`ghost`,size:`sm`,icon:c,onClick:e=>{e.stopPropagation(),ue.mutate()},children:`清理`}),(0,z.jsx)(t,{className:`h-4 w-4 text-gray-300`})]})]},r))}),(0,z.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,z.jsx)(`div`,{className:`cursor-pointer`,onClick:()=>e(`/sessions`),children:(0,z.jsx)(A,{title:`本周节省`,value:`${Y?.week.timeSavedHours||0}h`,icon:l,color:`blue`})}),(0,z.jsx)(`div`,{className:`cursor-pointer`,onClick:()=>e(`/analytics`),children:(0,z.jsx)(A,{title:`Token 用量`,value:P(Y?.week.tokensTotal||0),icon:u,color:`green`})}),(0,z.jsx)(`div`,{className:`cursor-pointer`,onClick:()=>e(`/quality`),children:(0,z.jsx)(A,{title:`质量拦截`,value:Y?.week.qualityBlocked||0,icon:o,color:`purple`})}),(0,z.jsx)(`div`,{className:`cursor-pointer`,onClick:()=>e(`/knowledge`),children:(0,z.jsx)(A,{title:`知识沉淀`,value:Y?.totals.knowledgeNodes||0,icon:s,color:`orange`})})]}),(0,z.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,z.jsx)(N,{title:`7 天活动趋势`,children:(0,z.jsx)(L,{data:(Y?.dailyTrend||[]).map(e=>({label:e.date,value:e.events})),height:180,color:`#3b82f6`})}),(0,z.jsx)(N,{title:`实时事件流`,action:(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[S&&(0,z.jsx)(M,{variant:`ghost`,size:`sm`,icon:_,onClick:()=>void ce(),children:`刷新`}),(0,z.jsx)(M,{variant:`ghost`,size:`sm`,icon:S?f:n,onClick:()=>V(!S),children:S?`继续`:`暂停`})]}),children:(0,z.jsxs)(`div`,{className:`h-[180px] overflow-y-auto text-xs font-mono space-y-1`,children:[X?.items.map((t,n)=>{let r=t.tool_input,i=r?.file_path?String(r.file_path).split(`/`).slice(-2).join(`/`):r?.command?String(r.command).slice(0,60):r?.pattern?String(r.pattern):t.hook_type===`UserPromptSubmit`?`用户输入`:``;return(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-1 hover:bg-gray-50 rounded px-1 cursor-pointer`,onClick:()=>e(`/events`),children:[(0,z.jsx)(`span`,{className:`text-gray-400 w-14 flex-shrink-0`,children:h(j(t.timestamp),`HH:mm:ss`)}),(0,z.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:B[t.hook_type]||`#6b7280`}}),(0,z.jsx)(`span`,{className:`text-gray-700 font-medium w-16 flex-shrink-0 truncate`,children:t.tool_name||t.hook_type}),(0,z.jsx)(`span`,{className:`text-gray-400 truncate flex-1`,children:i})]},`${t.id}-${n}`)}),(0,z.jsx)(`div`,{ref:H})]})})]}),(0,z.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[{label:`会话管理`,icon:g,path:`/sessions`,count:Y?.week.sessions},{label:`流水线`,icon:m,path:`/pipelines`,count:G?.total},{label:`质量门禁`,icon:o,path:`/quality`,count:J?.recommendations?.find(e=>e.action===`/quality`)?`!`:`0`},{label:`知识图谱`,icon:s,path:`/knowledge`,count:Y?.totals.knowledgeNodes}].map(t=>(0,z.jsx)(C.div,{whileHover:{scale:1.02},whileTap:{scale:.98},className:`bg-white rounded-xl p-4 border border-gray-100 cursor-pointer hover:border-blue-200 hover:shadow-sm transition-all`,onClick:()=>e(t.path),children:(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(t.icon,{className:`h-5 w-5 text-gray-500`}),(0,z.jsx)(`span`,{className:`text-sm font-medium text-gray-700`,children:t.label})]}),(0,z.jsx)(`span`,{className:`text-sm font-bold text-gray-900`,children:t.count??`-`})]})},t.path))}),(0,z.jsx)(I,{open:U.open,title:U.title,description:U.description,variant:`warning`,onConfirm:U.onConfirm,onCancel:()=>W(e=>({...e,open:!1}))})]})}export{V as default};
@@ -1 +0,0 @@
1
- import{qt as e,zn as t}from"./vendor-2ObLXPrQ.js";import{r as n}from"./vendor-motion-BryL_tAt.js";import{n as r}from"./ui-DpI1N3yJ.js";var i=n();function a({message:n=`加载失败,请重试`,onRetry:a}){return(0,i.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-96 text-center px-4`,children:[(0,i.jsx)(`div`,{className:`flex items-center justify-center w-16 h-16 rounded-full bg-red-50 mb-4`,children:(0,i.jsx)(t,{className:`h-8 w-8 text-red-500`})}),(0,i.jsx)(`h3`,{className:`text-lg font-semibold text-gray-900 mb-2`,children:`出错了`}),(0,i.jsx)(`p`,{className:`text-sm text-gray-500 mb-6 max-w-md`,children:n}),a&&(0,i.jsx)(r,{variant:`primary`,size:`sm`,icon:e,onClick:a,children:`重试`})]})}export{a as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Cn as t,Dn as n,Ft as ee,Nt as r,Un as te,Vn as ne,Wt as i,Xn as a,ar as o,n as s,qn as c,qt as re,rn as ie,t as ae}from"./vendor-2ObLXPrQ.js";import{a as l,n as u,r as d,t as f}from"./vendor-query-CjmRaY7o.js";import{n as p,r as m,t as h}from"./vendor-motion-BryL_tAt.js";import{G as g,jt as _}from"./client-C_VWY70M.js";import{a as v,l as y,n as b,r as x,t as oe}from"./ui-DpI1N3yJ.js";import{t as se}from"./useDebounce-BLryFdeo.js";import{t as ce}from"./ErrorState-CMLoMrQY.js";import{t as le}from"./exportCsv-CO51kx6P.js";import{t as ue}from"./ConfirmDialog-bdDaAlT1.js";var S=e(o(),1),C=m(),de={PreToolUse:`bg-blue-100 text-blue-700`,PostToolUse:`bg-green-100 text-green-700`,UserPromptSubmit:`bg-amber-100 text-amber-700`,Stop:`bg-red-100 text-red-700`,Notification:`bg-purple-100 text-purple-700`};function w(e){if(!e)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function T(e){if(e.hook_type===`UserPromptSubmit`){let t=e.user_prompt;return{title:`用户输入`,subtitle:t?t.slice(0,80):`用户提交了新请求`}}if(e.tool_name){let t=e.tool_input;return t?.file_path?{title:`${e.tool_name} 文件`,subtitle:String(t.file_path).split(`/`).slice(-2).join(`/`)}:t?.command?{title:`${e.tool_name} 命令`,subtitle:String(t.command).slice(0,100)}:t?.pattern?{title:`${e.tool_name} 搜索`,subtitle:String(t.pattern)}:{title:e.tool_name,subtitle:e.hook_type}}return{title:e.hook_type,subtitle:e.project_path.split(`/`).pop()||``}}function E(){let e=l(),[o,m]=(0,S.useState)(50),[E,D]=(0,S.useState)(``),[O,k]=(0,S.useState)(``),[A,j]=(0,S.useState)(``),[M,N]=(0,S.useState)(null),[P,F]=(0,S.useState)(``),I=se(P),[L,R]=(0,S.useState)(``),[z,B]=(0,S.useState)(``),[V,H]=(0,S.useState)(`all`),[U,fe]=(0,S.useState)(30),[W,G]=(0,S.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),K=(0,S.useRef)(null),q=V===`all`?void 0:s(ae(new Date,V===`1d`?1:V===`7d`?7:30),`yyyy-MM-dd'T'HH:mm:ss`),{data:J,isLoading:pe,isError:Y,refetch:X}=d({queryKey:[`events`,{limit:o,tool_name:E||void 0,start_time:q,search:L||void 0}],queryFn:()=>g({limit:o,tool_name:E||void 0,start_time:q,search:L||void 0}).then(e=>e.data)}),Z=u({mutationFn:e=>_(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`events`]})}}),Q=J?.items.filter(e=>!(O&&e.hook_type!==O||A&&e.project_path.split(`/`).pop()!==A||I&&![e.tool_name,w(e.tool_input),w(e.tool_output)].join(` `).toLowerCase().includes(I.toLowerCase())))||[],$=f({count:Q.length,getScrollElement:()=>K.current,estimateSize:()=>120,overscan:5});if(pe)return(0,C.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,C.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});if(Y)return(0,C.jsx)(ce,{message:`事件数据加载失败`,onRetry:()=>X()});let me=Array.from(new Set(J?.items.map(e=>e.project_path.split(`/`).pop()||``).filter(Boolean)||[])),he=Q.reduce((e,t)=>{let n=t.tool_name||`N/A`;return e[n]=(e[n]||0)+1,e},{}),ge=Object.entries(he).sort((e,t)=>t[1]-e[1]).slice(0,10),_e=Array.from(new Set(J?.items.map(e=>e.hook_type)||[]));return(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsx)(x,{children:(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center justify-between`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center flex-1`,children:[(0,C.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-sm`,children:[(0,C.jsx)(i,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,C.jsx)(`input`,{type:`text`,placeholder:`实时过滤:工具名、文件名...`,value:P,onChange:e=>{F(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 text-sm`})]}),(0,C.jsx)(`div`,{className:`relative min-w-[200px] max-w-xs`,children:(0,C.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),R(z)},children:[(0,C.jsx)(`input`,{type:`text`,placeholder:`全文搜索内容(回车提交)...`,value:z,onChange:e=>B(e.target.value),className:v(`w-full pl-3 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`,L?`border-blue-400 bg-blue-50`:`border-gray-200`)}),L&&(0,C.jsx)(`button`,{type:`button`,onClick:()=>{R(``),B(``)},className:`absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 text-xs`,children:`✕`})]})}),(0,C.jsxs)(`select`,{value:O,onChange:e=>{k(e.target.value)},className:`px-3 py-2 border border-gray-200 rounded-lg text-sm`,children:[(0,C.jsx)(`option`,{value:``,children:`全部类型`}),_e.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]}),(0,C.jsxs)(`select`,{value:A,onChange:e=>{j(e.target.value)},className:`px-3 py-2 border border-gray-200 rounded-lg text-sm`,children:[(0,C.jsx)(`option`,{value:``,children:`全部项目`}),me.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-1 border border-gray-200 rounded-lg overflow-hidden text-sm`,children:[(0,C.jsx)(c,{className:`h-3.5 w-3.5 text-gray-400 ml-2`}),[`all`,`1d`,`7d`,`30d`].map(e=>(0,C.jsx)(`button`,{onClick:()=>{H(e)},className:v(`px-2.5 py-2 transition-colors`,V===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:e===`all`?`全部`:e},e))]}),(0,C.jsxs)(`select`,{value:o,onChange:e=>m(Number(e.target.value)),className:`px-3 py-2 border border-gray-200 rounded-lg text-sm`,children:[(0,C.jsx)(`option`,{value:20,children:`20 条`}),(0,C.jsx)(`option`,{value:50,children:`50 条`}),(0,C.jsx)(`option`,{value:100,children:`100 条`})]})]}),(0,C.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,C.jsxs)(`select`,{value:U,onChange:e=>fe(Number(e.target.value)),className:`px-2 py-1.5 border border-gray-200 rounded-lg text-sm`,children:[(0,C.jsx)(`option`,{value:7,children:`7天`}),(0,C.jsx)(`option`,{value:30,children:`30天`}),(0,C.jsx)(`option`,{value:90,children:`90天`})]}),(0,C.jsx)(b,{variant:`secondary`,size:`sm`,icon:n,onClick:()=>{let e=[`时间`,`类型`,`工具`,`项目`,`会话ID`,`摘要`],t=Q.map(e=>{let t=T(e);return[e.timestamp,e.hook_type,e.tool_name||``,e.project_path.split(`/`).pop()||``,e.session_id.slice(0,12),t.subtitle]});le(`events-${s(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)},children:`导出`}),(0,C.jsx)(b,{variant:`secondary`,size:`sm`,icon:r,onClick:()=>{G({open:!0,title:`清理历史事件`,description:`确认清理 ${U} 天前的已蒸馏事件?此操作不可撤销。`,onConfirm:()=>{Z.mutate(U),G({...W,open:!1})}})},loading:Z.isPending,children:`清理历史`}),(0,C.jsx)(b,{variant:`secondary`,size:`sm`,icon:re,onClick:()=>X(),children:`刷新`})]})]})}),(0,C.jsx)(x,{title:`工具使用频率`,children:(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ge.map(([e,t])=>(0,C.jsxs)(`button`,{onClick:()=>{D(E===e?``:e)},className:v(`px-3 py-1.5 rounded-full text-sm transition-all`,E===e?`bg-blue-100 text-blue-700 border-2 border-blue-300`:`bg-gray-100 text-gray-700 hover:bg-gray-200 border-2 border-transparent`),children:[(0,C.jsx)(`span`,{className:`font-medium`,children:e}),(0,C.jsx)(`span`,{className:`ml-1 text-xs opacity-70`,children:t})]},e))})}),(0,C.jsx)(x,{title:`执行轨迹 (${Q.length})`,children:(0,C.jsx)(`div`,{ref:K,className:`h-[600px] overflow-auto`,style:{contain:`strict`},children:(0,C.jsx)(`div`,{style:{height:`${$.getTotalSize()}px`,width:`100%`,position:`relative`},children:$.getVirtualItems().map(e=>{let n=Q[e.index],r=T(n),i=M===n.event_id;return(0,C.jsx)(`div`,{"data-index":e.index,ref:$.measureElement,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},className:`pb-2`,children:(0,C.jsxs)(`div`,{className:`border border-gray-100 rounded-lg overflow-hidden`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between p-3 hover:bg-gray-50 cursor-pointer`,onClick:()=>N(i?null:n.event_id),children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,C.jsx)(`button`,{className:`text-gray-400`,children:i?(0,C.jsx)(te,{className:`h-4 w-4`}):(0,C.jsx)(ne,{className:`h-4 w-4`})}),(0,C.jsx)(oe,{size:`sm`,className:de[n.hook_type]||`bg-gray-100 text-gray-700`,children:n.hook_type}),n.tool_name&&(0,C.jsxs)(`div`,{className:`flex items-center gap-1 text-sm text-gray-700 flex-shrink-0`,children:[n.tool_name===`Bash`?(0,C.jsx)(ee,{className:`h-4 w-4`}):(0,C.jsx)(t,{className:`h-4 w-4`}),(0,C.jsx)(`span`,{className:`font-mono`,children:n.tool_name})]}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(`div`,{className:`text-sm font-medium text-gray-900 truncate`,children:r.title}),(0,C.jsx)(`div`,{className:`text-xs text-gray-500 truncate`,children:r.subtitle})]})]}),(0,C.jsx)(`div`,{className:`text-xs text-gray-400 font-mono ml-3`,children:s(y(n.timestamp),`HH:mm:ss`)})]}),(0,C.jsx)(p,{children:i&&(0,C.jsx)(h.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},className:`border-t border-gray-100 bg-gray-50`,children:(0,C.jsxs)(`div`,{className:`p-4 space-y-4`,children:[(0,C.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3 text-xs`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-gray-400 mb-1`,children:`会话`}),(0,C.jsxs)(`div`,{className:`font-mono text-gray-700`,children:[n.session_id.slice(0,12),`...`]})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-gray-400 mb-1`,children:`项目`}),(0,C.jsx)(`div`,{className:`text-gray-700`,children:n.project_path.split(`/`).pop()})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-gray-400 mb-1`,children:`时间`}),(0,C.jsx)(`div`,{className:`font-mono text-gray-700`,children:n.timestamp})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`text-gray-400 mb-1`,children:`类型`}),(0,C.jsx)(`div`,{className:`text-gray-700`,children:n.hook_type})]})]}),n.tool_input&&(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-gray-500 mb-2 uppercase tracking-wider`,children:[(0,C.jsx)(ie,{className:`h-3 w-3`}),` 输入`]}),(0,C.jsx)(`pre`,{className:`bg-white p-3 rounded-lg text-xs font-mono overflow-x-auto border border-gray-200 text-gray-700 whitespace-pre-wrap break-all`,children:w(n.tool_input)})]}),n.tool_output&&(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-gray-500 mb-2 uppercase tracking-wider`,children:[(0,C.jsx)(a,{className:`h-3 w-3`}),` 输出`]}),(0,C.jsx)(`pre`,{className:`bg-white p-3 rounded-lg text-xs font-mono overflow-x-auto border border-gray-200 text-gray-700 whitespace-pre-wrap break-all max-h-64 overflow-y-auto`,children:w(n.tool_output)})]})]})})})]})},n.event_id)})})})}),(0,C.jsx)(ue,{open:W.open,title:W.title,description:W.description,variant:`danger`,onConfirm:W.onConfirm,onCancel:()=>G({...W,open:!1})})]})}export{E as default};
@@ -1 +0,0 @@
1
- import{Tt as e,gn as t,jt as n,n as r,nr as i}from"./vendor-2ObLXPrQ.js";import{r as a}from"./vendor-query-CjmRaY7o.js";import{d as o}from"./vendor-react-DZi7brq3.js";import{r as s,t as c}from"./vendor-motion-BryL_tAt.js";import{K as l,q as u}from"./client-C_VWY70M.js";import{l as d,r as f}from"./ui-DpI1N3yJ.js";import{t as p}from"./Skeleton-DbL04wuz.js";var m=s(),h={multi_retry_pass:`多次重试通过`,strategy_reliable:`策略可靠`,strategy_ineffective:`策略无效`,backtrack_failure:`回溯失败`,diagnosis_pattern:`诊断模式`},g={multi_retry_pass:`bg-yellow-100 text-yellow-700`,strategy_reliable:`bg-green-100 text-green-700`,strategy_ineffective:`bg-red-100 text-red-700`,backtrack_failure:`bg-orange-100 text-orange-700`,diagnosis_pattern:`bg-purple-100 text-purple-700`};function _(){let s=o(),{data:_,isLoading:v}=a({queryKey:[`evolution-stats`],queryFn:()=>u().then(e=>e.data)}),{data:y,isLoading:b}=a({queryKey:[`evolution-events-all`],queryFn:()=>l({limit:100}).then(e=>e.data)});if(v||b)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(p,{rows:2}),(0,m.jsx)(p,{rows:5})]});let x=y?.items||[];return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`模板进化`}),(0,m.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`系统根据执行结果自动优化流水线模板`})]}),_&&(0,m.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:[(0,m.jsx)(f,{children:(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsx)(`div`,{className:`p-2 bg-blue-100 rounded-lg`,children:(0,m.jsx)(i,{className:`h-5 w-5 text-blue-600`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:_.total_events}),(0,m.jsx)(`div`,{className:`text-sm text-gray-500`,children:`总进化事件`})]})]})}),(0,m.jsx)(f,{children:(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsx)(`div`,{className:`p-2 bg-green-100 rounded-lg`,children:(0,m.jsx)(t,{className:`h-5 w-5 text-green-600`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:_.total_evolved_templates}),(0,m.jsx)(`div`,{className:`text-sm text-gray-500`,children:`已进化模板数`})]})]})}),(0,m.jsx)(f,{children:(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsx)(`div`,{className:`p-2 bg-purple-100 rounded-lg`,children:(0,m.jsx)(n,{className:`h-5 w-5 text-purple-600`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:_.signal_breakdown.length}),(0,m.jsx)(`div`,{className:`text-sm text-gray-500`,children:`信号类型`})]})]})})]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[_&&_.signal_breakdown.length>0&&(0,m.jsxs)(f,{children:[(0,m.jsxs)(`h3`,{className:`text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2`,children:[(0,m.jsx)(e,{className:`h-5 w-5`}),`信号分布`]}),(0,m.jsx)(`div`,{className:`space-y-3`,children:_.signal_breakdown.map((e,t)=>{let n=_.signal_breakdown.reduce((e,t)=>e+t.count,0),r=n>0?e.count/n*100:0;return(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsx)(`span`,{className:`px-2 py-0.5 rounded text-xs font-medium w-28 text-center ${g[e.signal_type]||`bg-gray-100 text-gray-700`}`,children:h[e.signal_type]||e.signal_type}),(0,m.jsx)(`div`,{className:`flex-1 h-2 bg-gray-200 rounded-full overflow-hidden`,children:(0,m.jsx)(`div`,{className:`h-full bg-blue-500 transition-all`,style:{width:`${r}%`}})}),(0,m.jsx)(`span`,{className:`text-sm text-gray-700 w-8 text-right`,children:e.count})]},t)})})]}),_&&_.recent_evolutions.length>0&&(0,m.jsxs)(f,{children:[(0,m.jsxs)(`h3`,{className:`text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2`,children:[(0,m.jsx)(t,{className:`h-5 w-5`}),`最近进化的模板`]}),(0,m.jsx)(`div`,{className:`space-y-3`,children:_.recent_evolutions.map((e,t)=>(0,m.jsxs)(c.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:t*.05},className:`flex items-center justify-between p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors`,onClick:()=>s(`/templates/${e.template_id}`),children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`font-medium text-gray-900`,children:e.template_name||e.template_id}),(0,m.jsx)(`div`,{className:`text-xs text-gray-500 mt-0.5`,children:r(d(e.last_evolved_at),`yyyy-MM-dd HH:mm`)})]}),(0,m.jsxs)(`span`,{className:`text-sm text-gray-600 bg-gray-100 px-2 py-1 rounded`,children:[e.evolution_count,` 次进化`]})]},e.template_id))})]})]}),(0,m.jsxs)(f,{children:[(0,m.jsxs)(`h3`,{className:`text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2`,children:[(0,m.jsx)(i,{className:`h-5 w-5`}),`最近进化事件`]}),x.length===0?(0,m.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无进化事件。系统将在 Pipeline 执行完成后自动分析并触发进化。`}):(0,m.jsx)(`div`,{className:`space-y-2`,children:x.map((e,t)=>(0,m.jsxs)(c.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.03},className:`flex items-start gap-3 p-3 border border-gray-100 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors`,onClick:()=>s(`/templates/${e.template_id}`),children:[(0,m.jsx)(`span`,{className:`px-2 py-0.5 rounded text-xs font-medium flex-shrink-0 ${g[e.signal_type]||`bg-gray-100 text-gray-700`}`,children:h[e.signal_type]||e.signal_type}),(0,m.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,m.jsx)(`p`,{className:`text-sm text-gray-700 truncate`,children:e.action}),(0,m.jsx)(`p`,{className:`text-xs text-gray-400 mt-0.5`,children:r(d(e.created_at),`MM-dd HH:mm`)})]})]},e.event_id))})]})]})}export{_ as default};
@@ -1,2 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Dn as t,Jn as n,Nn as r,Nt as i,Rn as a,Rt as o,Wt as s,Yt as c,ar as l,gn as u,kt as d,ln as f,n as p,tn as ee,xn as m}from"./vendor-2ObLXPrQ.js";import{a as te,n as h,r as g}from"./vendor-query-CjmRaY7o.js";import{r as _,t as ne}from"./vendor-motion-BryL_tAt.js";import{$ as re,Ht as v,Jt as ie,Q as ae,Tt as oe,Z as se,_ as ce,s as le,v as ue,x as de}from"./client-C_VWY70M.js";import{n as y,r as b,t as x}from"./ui-DpI1N3yJ.js";import{n as S}from"./Toast-CrwuIbKC.js";import{t as fe}from"./exportCsv-CO51kx6P.js";import{t as pe}from"./ConfirmDialog-bdDaAlT1.js";import{n as me}from"./MiniCharts-DsV2Sqfk.js";import{t as he}from"./Pagination-CR-eJz36.js";var C=e(l(),1);function ge(e,t){let[n,r]=(0,C.useState)(e);return(0,C.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}var w=_();function _e({open:e,count:t,itemLabel:n=`项`,loading:r=!1,onConfirm:a,onCancel:o}){let[s,c]=(0,C.useState)(``);if((0,C.useEffect)(()=>{e||c(``)},[e]),(0,C.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&o()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,o]),!e)return null;let l=t<5?`simple`:t<=20?`count`:`keyword`,u=`DELETE`,d=l===`simple`||l===`count`&&s===String(t)||l===`keyword`&&s===u;return(0,w.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm`,onClick:o,children:(0,w.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md mx-4 p-6`,onClick:e=>e.stopPropagation(),children:[(0,w.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,w.jsx)(`div`,{className:`flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center bg-red-50`,children:(0,w.jsx)(i,{className:`h-5 w-5 text-red-500`})}),(0,w.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,w.jsxs)(`h3`,{className:`text-base font-semibold text-gray-900`,children:[`删除 `,t,` 个`,n]}),(0,w.jsx)(`p`,{className:`mt-1 text-sm text-gray-500 leading-relaxed`,children:`此操作不可撤销,关联数据也会被删除。`}),l===`count`&&(0,w.jsxs)(`div`,{className:`mt-3`,children:[(0,w.jsxs)(`label`,{className:`block text-xs text-gray-500 mb-1`,children:[`请输入数量 `,(0,w.jsx)(`span`,{className:`font-mono font-bold text-gray-800`,children:t}),` 以确认:`]}),(0,w.jsx)(`input`,{autoFocus:!0,type:`text`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&d&&a()},placeholder:String(t),className:`w-full px-3 py-1.5 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-400 font-mono`})]}),l===`keyword`&&(0,w.jsxs)(`div`,{className:`mt-3`,children:[(0,w.jsxs)(`label`,{className:`block text-xs text-gray-500 mb-1`,children:[`请输入 `,(0,w.jsx)(`span`,{className:`font-mono font-bold text-red-600`,children:u}),` 以确认:`]}),(0,w.jsx)(`input`,{autoFocus:!0,type:`text`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&d&&a()},placeholder:u,className:`w-full px-3 py-1.5 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-400 font-mono`})]})]})]}),(0,w.jsxs)(`div`,{className:`flex justify-end gap-3 mt-6`,children:[(0,w.jsx)(y,{variant:`secondary`,size:`sm`,onClick:o,disabled:r,children:`取消`}),(0,w.jsx)(y,{variant:`danger`,size:`sm`,onClick:a,loading:r,disabled:!d,children:`确认删除`})]})]})})}var T={requirement:`#3b82f6`,decision:`#8b5cf6`,code_change:`#10b981`,outcome:`#f59e0b`},E={requirement:`bg-blue-50 border-blue-200`,decision:`bg-purple-50 border-purple-200`,code_change:`bg-green-50 border-green-200`,outcome:`bg-amber-50 border-amber-200`};function ve({nodes:e,edges:t,onNodeClick:n}){let r=(0,C.useMemo)(()=>{let e=new Map;for(let n of t){let t=e.get(n.from_node_id)||[];t.push(n.to_node_id),e.set(n.from_node_id,t)}return e},[t]);return e.length===0?(0,w.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400 text-sm`,children:`暂无知识节点`}):(0,w.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3 p-4`,children:e.map(e=>{let t=r.get(e.id)||[];return(0,w.jsxs)(`button`,{onClick:()=>n?.(e.id),className:`text-left p-3 rounded-lg border transition-shadow hover:shadow-md ${E[e.node_type]||`bg-gray-50 border-gray-200`}`,children:[(0,w.jsx)(`div`,{className:`w-2 h-2 rounded-full mb-2`,style:{backgroundColor:T[e.node_type]||`#6b7280`}}),(0,w.jsx)(`div`,{className:`text-xs font-semibold text-gray-900 truncate`,children:e.title}),(0,w.jsx)(`div`,{className:`text-[10px] text-gray-500 mt-0.5`,children:e.node_type}),t.length>0&&(0,w.jsxs)(`div`,{className:`text-[10px] text-gray-400 mt-1`,children:[t.length,` 条连接`]})]},e.id)})})}var ye={requirement:m,decision:f,code_change:r,outcome:a},be={requirement:`#3b82f6`,decision:`#8b5cf6`,code_change:`#10b981`,outcome:`#f59e0b`},D={requirement:`需求`,decision:`决策`,code_change:`代码变更`,outcome:`结果`},O=[`#3b82f6`,`#8b5cf6`,`#10b981`,`#f59e0b`,`#ef4444`,`#06b6d4`];function k(){let e=te(),[r,a]=(0,C.useState)(``),l=ge(r,300),[f,m]=(0,C.useState)(``),[_,T]=(0,C.useState)(null),[E,k]=(0,C.useState)(new Set),[A,j]=(0,C.useState)(1),[M,xe]=(0,C.useState)(20),[Se,N]=(0,C.useState)(!1),[Ce,P]=(0,C.useState)(!1),[we,F]=(0,C.useState)(!1),[I,L]=(0,C.useState)(null),[R,z]=(0,C.useState)(``),[B,Te]=(0,C.useState)(`list`),[V,H]=(0,C.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),[Ee,U]=(0,C.useState)(!1),{data:W}=g({queryKey:[`knowledge-overview`],queryFn:()=>re().then(e=>e.data)}),{data:De}=g({queryKey:[`knowledge-search`,l,f,R],queryFn:()=>v(l,R||void 0,f||void 0).then(e=>e.data),enabled:l.length>0}),{data:G}=g({queryKey:[`knowledge-all`],queryFn:()=>v(``,void 0,void 0,500).then(e=>e.data)}),{data:Oe}=g({queryKey:[`knowledge-filtered`,f,R],queryFn:()=>v(``,R||void 0,f||void 0,500).then(e=>e.data),enabled:r.length===0&&(!!f||!!R)}),{data:K}=g({queryKey:[`knowledge-neighbors`,_],queryFn:()=>ae(_).then(e=>e.data),enabled:!!_}),{data:q}=g({queryKey:[`knowledge-graph`,R,f],queryFn:()=>se(R||void 0,f||void 0).then(e=>e.data),enabled:B===`graph`}),ke=h({mutationFn:ue,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),N(!1)}}),Ae=h({mutationFn:({id:e,data:t})=>ie(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),P(!1),L(null)}}),je=h({mutationFn:de,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),T(null)}}),J=h({mutationFn:e=>le(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),k(new Set),T(null)}}),Y=h({mutationFn:ce,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-neighbors`]}),e.invalidateQueries({queryKey:[`knowledge-graph`]}),F(!1)}}),X=l?De?.items:f||R?Oe?.items:G?.items,Me=Array.from(new Set(G?.items.map(e=>e.node_type)||[])),Ne=Array.from(new Set(G?.items.map(e=>e.project_path||``).filter(Boolean)||[])),Z=W?.byType?Object.entries(W.byType).map(([e,t])=>({name:e,value:t})):[],Pe=Math.ceil((X?.length||0)/M),Q=X?.slice((A-1)*M,A*M),Fe=e=>{e.preventDefault();let t=new FormData(e.currentTarget);ke.mutate({title:t.get(`title`),content:t.get(`content`),node_type:t.get(`node_type`),project_path:t.get(`project_path`),tags:t.get(`tags`)})},Ie=e=>{if(e.preventDefault(),!I)return;let t=new FormData(e.currentTarget);Ae.mutate({id:I.id,data:{title:t.get(`title`),content:t.get(`content`),tags:t.get(`tags`)}})},Le=e=>{H({open:!0,title:`删除知识节点`,description:`确认删除此知识节点?关联的边也会被删除。`,onConfirm:()=>{je.mutate(e),H(e=>({...e,open:!1}))}})},Re=()=>{U(!0)},ze=()=>{if(!X||X.length===0)return;let e=[`ID`,`标题`,`类型`,`内容`,`标签`,`项目路径`],t=X.map(e=>[e.id,e.title,e.node_type,e.content,e.tags||``,e.project_path||``]);fe(`knowledge-nodes-${p(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)},Be=()=>{if(!X||X.length===0)return;let e=new Blob([JSON.stringify(X,null,2)],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`knowledge-nodes-${p(new Date,`yyyyMMdd-HHmmss`)}.json`,n.click(),URL.revokeObjectURL(t)},$=h({mutationFn:e=>oe(e).then(e=>e.data),onSuccess:t=>{S(t.message,`success`),e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]})},onError:()=>S(`导入失败`,`error`)});return(0,w.jsxs)(`div`,{className:`space-y-6`,children:[(0,w.jsx)(b,{children:(0,w.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1`,children:[(0,w.jsx)(s,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,w.jsx)(`input`,{type:`text`,placeholder:`搜索知识节点(需求、决策、代码变更、结果)...`,value:r,onChange:e=>{a(e.target.value),j(1)},className:`w-full pl-10 pr-4 py-3 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 text-lg`})]}),(0,w.jsxs)(`select`,{value:f,onChange:e=>{m(e.target.value),j(1)},className:`px-3 py-3 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,w.jsx)(`option`,{value:``,children:`全部类型`}),Me.map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))]}),(0,w.jsxs)(`select`,{value:R,onChange:e=>{z(e.target.value),j(1)},className:`px-3 py-3 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,w.jsx)(`option`,{value:``,children:`全部项目`}),Ne.map(e=>(0,w.jsx)(`option`,{value:e,children:e.split(`/`).pop()},e))]}),(0,w.jsx)(y,{variant:`primary`,size:`sm`,icon:c,onClick:()=>N(!0),children:`创建节点`}),E.size>0&&(0,w.jsxs)(y,{variant:`danger`,size:`sm`,icon:i,onClick:Re,loading:J.isPending,children:[`删除 (`,E.size,`)`]}),(0,w.jsxs)(`div`,{className:`flex border border-gray-200 rounded-lg overflow-hidden`,children:[(0,w.jsx)(`button`,{onClick:()=>Te(`list`),className:`px-3 py-2 text-sm transition-colors ${B===`list`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`}`,children:`列表`}),(0,w.jsxs)(`button`,{onClick:()=>Te(`graph`),className:`px-3 py-2 text-sm transition-colors flex items-center gap-1 ${B===`graph`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`}`,children:[(0,w.jsx)(ee,{className:`h-4 w-4`}),`图谱`]})]})]})}),(0,w.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,w.jsxs)(b,{title:`知识图谱概览`,children:[(0,w.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 mb-4`,children:[(0,w.jsxs)(`button`,{className:`text-center p-4 bg-blue-50 rounded-xl hover:bg-blue-100 transition-colors cursor-pointer`,onClick:()=>{m(``),z(``),j(1)},title:`点击查看全部节点`,children:[(0,w.jsx)(n,{className:`h-8 w-8 text-blue-500 mx-auto mb-2`}),(0,w.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:W?.totalNodes||0}),(0,w.jsx)(`div`,{className:`text-sm text-gray-600`,children:`知识节点`})]}),(0,w.jsxs)(`div`,{className:`text-center p-4 bg-purple-50 rounded-xl`,children:[(0,w.jsx)(u,{className:`h-8 w-8 text-purple-500 mx-auto mb-2`}),(0,w.jsx)(`div`,{className:`text-3xl font-bold text-purple-600`,children:Z.length}),(0,w.jsx)(`div`,{className:`text-sm text-gray-600`,children:`节点类型`})]})]}),Z.length>0&&(0,w.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Z.map((e,t)=>(0,w.jsxs)(`button`,{onClick:()=>{m(f===e.name?``:e.name),j(1)},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${f===e.name?`text-white`:`bg-gray-100 text-gray-700 hover:bg-gray-200`}`,style:f===e.name?{backgroundColor:O[t%O.length]}:{},children:[(0,w.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:O[t%O.length]}}),D[e.name]||e.name,(0,w.jsxs)(`span`,{className:`opacity-70`,children:[`(`,e.value,`)`]})]},e.name))})]}),(0,w.jsx)(b,{title:`节点类型分布`,children:Z.length>0?(0,w.jsx)(me,{data:Z.map((e,t)=>({label:D[e.name]||e.name,value:e.value,color:O[t%O.length]})),height:220}):(0,w.jsx)(`div`,{className:`flex items-center justify-center h-48 text-gray-400`,children:`暂无数据`})})]}),B===`graph`&&(0,w.jsx)(b,{title:`知识图谱`,children:(0,w.jsx)(`div`,{className:`h-[600px] border border-gray-200 rounded-lg overflow-hidden`,children:q?(0,w.jsx)(ve,{nodes:q.nodes,edges:q.edges,onNodeClick:T}):(0,w.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,w.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})})})}),B===`list`&&(0,w.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,w.jsx)(`div`,{className:`lg:col-span-2`,children:(0,w.jsxs)(b,{title:`知识节点 (${X?.length||0})`,action:(0,w.jsxs)(`div`,{className:`flex gap-2`,children:[X&&X.length>0&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(y,{variant:`secondary`,size:`sm`,icon:t,onClick:ze,children:`导出 CSV`}),(0,w.jsx)(y,{variant:`secondary`,size:`sm`,icon:t,onClick:Be,children:`导出 JSON`})]}),(0,w.jsxs)(`label`,{className:`cursor-pointer`,children:[(0,w.jsx)(`input`,{type:`file`,accept:`.json,.csv`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=e=>{try{let n=e.target?.result,r=[];if(t.name.endsWith(`.json`)){let e=JSON.parse(n);r=Array.isArray(e)?e:e.nodes||e.items||[]}else if(t.name.endsWith(`.csv`)){let e=n.split(`
2
- `).filter(e=>e.trim()),t=e[0].split(`,`).map(e=>e.trim().replace(/^"|"$/g,``));r=e.slice(1).map(e=>{let n=e.split(`,`).map(e=>e.trim().replace(/^"|"$/g,``)),r={};return t.forEach((e,t)=>{r[e]=n[t]||``}),{title:r.title||r.标题||``,content:r.content||r.内容||``,node_type:r.node_type||r.类型||`requirement`,project_path:r.project_path||r.项目路径||``,tags:r.tags||r.标签?(r.tags||r.标签).split(`;`).filter(Boolean):[]}})}if(r.length===0){S(`未解析到有效节点,请检查文件格式`,`error`);return}$.mutate(r)}catch{S(`文件解析失败,请检查格式`,`error`)}},n.readAsText(t),e.target.value=``}}),(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg border border-gray-200 bg-white hover:bg-gray-50 transition-colors ${$.isPending?`opacity-50 pointer-events-none`:``}`,children:[(0,w.jsx)(d,{className:`h-4 w-4`}),$.isPending?`导入中...`:`导入`]})]}),Q&&Q.length>0&&(0,w.jsx)(`button`,{onClick:()=>{E.size===Q.length?k(new Set):k(new Set(Q.map(e=>e.id)))},className:`text-xs text-blue-600 hover:underline`,children:E.size===Q.length?`取消全选`:`全选当前页`})]}),children:[(0,w.jsxs)(`div`,{className:`space-y-2`,children:[Q?.map((e,t)=>{let r=ye[e.node_type]||n,a=be[e.node_type]||`#6b7280`;return(0,w.jsx)(ne.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t*.03},className:`p-4 rounded-lg border cursor-pointer transition-all group ${E.has(e.id)?`border-blue-300 bg-blue-50`:_===e.id?`border-blue-300 bg-blue-50 shadow-sm`:`border-gray-100 hover:border-gray-200 hover:bg-gray-50`}`,onClick:()=>T(e.id),children:(0,w.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:E.has(e.id),onChange:t=>{t.stopPropagation(),k(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 cursor-pointer flex-shrink-0 mt-1`}),(0,w.jsx)(`div`,{className:`p-2 rounded-lg`,style:{backgroundColor:`${a}15`},children:(0,w.jsx)(r,{className:`h-5 w-5`,style:{color:a}})}),(0,w.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`font-semibold text-gray-900 truncate`,children:e.title}),(0,w.jsx)(x,{size:`sm`,variant:e.node_type===`outcome`?`success`:e.node_type===`decision`?`info`:`default`,children:D[e.node_type]||e.node_type})]}),(0,w.jsx)(`p`,{className:`text-sm text-gray-600 mt-1 line-clamp-2`,children:e.content}),e.tags&&e.tags.trim()&&(0,w.jsx)(`div`,{className:`flex gap-1 mt-2`,children:e.tags.split(`,`).filter(e=>e.trim()).slice(0,3).map(e=>(0,w.jsx)(`span`,{className:`text-xs px-2 py-0.5 bg-gray-100 rounded-full text-gray-600`,children:e.trim()},e))})]}),(0,w.jsxs)(`div`,{className:`flex gap-1 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity`,children:[(0,w.jsx)(`button`,{onClick:t=>{t.stopPropagation(),L({id:e.id,title:e.title,content:e.content,tags:e.tags||``}),P(!0)},className:`p-1.5 rounded hover:bg-gray-200 text-gray-400 hover:text-gray-600`,children:(0,w.jsx)(o,{className:`h-3.5 w-3.5`})}),(0,w.jsx)(`button`,{onClick:t=>{t.stopPropagation(),Le(e.id)},className:`p-1.5 rounded hover:bg-red-100 text-gray-400 hover:text-red-600`,children:(0,w.jsx)(i,{className:`h-3.5 w-3.5`})})]})]})},e.id)}),(!Q||Q.length===0)&&(0,w.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-gray-400`,children:[(0,w.jsx)(n,{className:`h-12 w-12 mb-4`}),(0,w.jsx)(`p`,{children:`暂无知识节点`}),(0,w.jsx)(`p`,{className:`text-sm mt-1`,children:`使用 Claude Code 进行开发后,知识会自动沉淀`})]})]}),X&&X.length>0&&(0,w.jsx)(`div`,{className:`mt-4`,children:(0,w.jsx)(he,{currentPage:A,totalPages:Pe,onPageChange:j,pageSize:M,onPageSizeChange:e=>{xe(e),j(1)},totalItems:X.length})})]})}),(0,w.jsx)(`div`,{children:(0,w.jsx)(b,{title:`节点详情`,children:_&&X?(()=>{let e=X.find(e=>e.id===_);if(!e)return(0,w.jsx)(`div`,{className:`text-gray-400 text-center py-8`,children:`节点未找到`});let t=ye[e.node_type]||n,r=be[e.node_type]||`#6b7280`;return(0,w.jsxs)(`div`,{className:`space-y-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsx)(`div`,{className:`p-3 rounded-xl`,style:{backgroundColor:`${r}15`},children:(0,w.jsx)(t,{className:`h-6 w-6`,style:{color:r}})}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`font-bold text-gray-900`,children:e.title}),(0,w.jsx)(x,{size:`sm`,children:D[e.node_type]||e.node_type})]})]}),(0,w.jsx)(`div`,{className:`p-3 bg-gray-50 rounded-lg text-sm text-gray-700 whitespace-pre-wrap`,children:e.content}),e.tags&&e.tags.trim()&&(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`text-xs font-semibold text-gray-500 mb-2`,children:`标签`}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tags.split(`,`).filter(e=>e.trim()).map(e=>(0,w.jsx)(`span`,{className:`text-xs px-2 py-1 bg-blue-50 text-blue-600 rounded-full`,children:e.trim()},e))})]}),K&&K.items.length>0&&(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`text-xs font-semibold text-gray-500 mb-2`,children:[`关联节点 (`,K.total,`)`]}),(0,w.jsx)(`div`,{className:`space-y-2`,children:K.items.map((e,t)=>(0,w.jsxs)(`div`,{className:`p-2 bg-gray-50 rounded-lg text-sm cursor-pointer hover:bg-gray-100`,onClick:()=>T(e.id),children:[(0,w.jsx)(`div`,{className:`font-medium`,children:e.title}),(0,w.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[e.edge_type,` · `,e.node_type]})]},t))})]}),(0,w.jsx)(y,{variant:`ghost`,size:`sm`,icon:u,onClick:()=>F(!0),children:`添加关系`})]})})():(0,w.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-gray-400`,children:[(0,w.jsx)(s,{className:`h-8 w-8 mb-3`}),(0,w.jsx)(`p`,{className:`text-sm`,children:`点击左侧节点查看详情`})]})})})]}),Se&&(0,w.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>N(!1),children:(0,w.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto`,onClick:e=>e.stopPropagation(),children:[(0,w.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`创建知识节点`}),(0,w.jsxs)(`form`,{onSubmit:Fe,className:`space-y-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标题 *`}),(0,w.jsx)(`input`,{type:`text`,name:`title`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`内容 *`}),(0,w.jsx)(`textarea`,{name:`content`,required:!0,rows:6,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`类型 *`}),(0,w.jsxs)(`select`,{name:`node_type`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,w.jsx)(`option`,{value:`requirement`,children:`需求 (requirement)`}),(0,w.jsx)(`option`,{value:`decision`,children:`决策 (decision)`}),(0,w.jsx)(`option`,{value:`code_change`,children:`代码变更 (code_change)`}),(0,w.jsx)(`option`,{value:`outcome`,children:`结果 (outcome)`})]})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`项目路径 *`}),(0,w.jsx)(`input`,{type:`text`,name:`project_path`,required:!0,placeholder:`/path/to/project`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,w.jsx)(`input`,{type:`text`,name:`tags`,placeholder:`tag1, tag2, tag3`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,w.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,w.jsx)(y,{type:`button`,variant:`secondary`,onClick:()=>N(!1),children:`取消`}),(0,w.jsx)(y,{type:`submit`,variant:`primary`,loading:ke.isPending,children:`创建`})]})]})]})}),Ce&&I&&(0,w.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>P(!1),children:(0,w.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto`,onClick:e=>e.stopPropagation(),children:[(0,w.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`编辑知识节点`}),(0,w.jsxs)(`form`,{onSubmit:Ie,className:`space-y-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标题`}),(0,w.jsx)(`input`,{type:`text`,name:`title`,defaultValue:I.title,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`内容`}),(0,w.jsx)(`textarea`,{name:`content`,defaultValue:I.content,required:!0,rows:6,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,w.jsx)(`input`,{type:`text`,name:`tags`,defaultValue:I.tags,placeholder:`tag1, tag2, tag3`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,w.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,w.jsx)(y,{type:`button`,variant:`secondary`,onClick:()=>P(!1),children:`取消`}),(0,w.jsx)(y,{type:`submit`,variant:`primary`,loading:Ae.isPending,children:`保存`})]})]})]})}),we&&_&&(0,w.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>F(!1),children:(0,w.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-md`,onClick:e=>e.stopPropagation(),children:[(0,w.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`添加关系`}),(0,w.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget),n=t.get(`to_node_id`),r=t.get(`edge_type`);n&&r&&Y.mutate({from_node_id:_,to_node_id:n,edge_type:r})},className:`space-y-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`目标节点 *`}),(0,w.jsxs)(`select`,{name:`to_node_id`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,w.jsx)(`option`,{value:``,children:`选择节点`}),G?.items.filter(e=>e.id!==_).map(e=>(0,w.jsxs)(`option`,{value:e.id,children:[e.title,` (`,D[e.node_type]||e.node_type,`)`]},e.id))]})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`关系类型 *`}),(0,w.jsxs)(`select`,{name:`edge_type`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,w.jsx)(`option`,{value:``,children:`选择关系`}),(0,w.jsx)(`option`,{value:`depends_on`,children:`依赖于`}),(0,w.jsx)(`option`,{value:`implements`,children:`实现`}),(0,w.jsx)(`option`,{value:`relates_to`,children:`关联到`}),(0,w.jsx)(`option`,{value:`causes`,children:`导致`}),(0,w.jsx)(`option`,{value:`resolves`,children:`解决`})]})]}),(0,w.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,w.jsx)(`button`,{type:`button`,onClick:()=>F(!1),className:`px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg transition-colors`,children:`取消`}),(0,w.jsx)(`button`,{type:`submit`,disabled:Y.isPending,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50`,children:Y.isPending?`创建中...`:`创建`})]})]})]})}),(0,w.jsx)(pe,{open:V.open,title:V.title,description:V.description,variant:`danger`,onConfirm:V.onConfirm,onCancel:()=>H({...V,open:!1})}),(0,w.jsx)(_e,{open:Ee,count:E.size,itemLabel:`知识节点`,loading:J.isPending,onConfirm:()=>{J.mutate(Array.from(E)),U(!1),k(new Set)},onCancel:()=>U(!1)})]})}export{k as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{ar as t}from"./vendor-2ObLXPrQ.js";import{r as n}from"./vendor-motion-BryL_tAt.js";var r=e(t(),1),i=n(),a=[`#3b82f6`,`#10b981`,`#f59e0b`,`#ef4444`,`#8b5cf6`,`#ec4899`];function o({data:e,height:t=200,className:n=``}){let r=Math.max(...e.map(e=>e.value),1);return(0,i.jsx)(`div`,{className:`flex items-end gap-1 ${n}`,style:{height:t},children:e.map((e,t)=>(0,i.jsxs)(`div`,{className:`flex-1 flex flex-col items-center gap-1`,title:`${e.label}: ${e.value}`,children:[(0,i.jsx)(`div`,{className:`w-full rounded-t transition-all`,style:{height:`${e.value/r*100}%`,minHeight:e.value>0?4:0,backgroundColor:e.color||a[t%a.length]}}),(0,i.jsx)(`span`,{className:`text-[10px] text-gray-500 truncate w-full text-center`,children:e.label})]},t))})}function s({data:e,height:t=160,color:n=`#3b82f6`,className:a=``}){let o=(0,r.useMemo)(()=>Math.max(...e.map(e=>e.value),1),[e]),s=t-24,c=e.map((t,n)=>({x:e.length>1?n/(e.length-1)*400:400/2,y:s-t.value/o*s})),l=c.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`).join(` `),u=`${l} L400,${s} L0,${s} Z`;return(0,i.jsx)(`div`,{className:a,children:(0,i.jsxs)(`svg`,{viewBox:`0 0 400 ${t}`,className:`w-full`,style:{height:t},children:[(0,i.jsx)(`defs`,{children:(0,i.jsxs)(`linearGradient`,{id:`area-${n.replace(`#`,``)}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:n,stopOpacity:.3}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:n,stopOpacity:.02})]})}),(0,i.jsx)(`path`,{d:u,fill:`url(#area-${n.replace(`#`,``)})`}),(0,i.jsx)(`path`,{d:l,fill:`none`,stroke:n,strokeWidth:2}),c.map((t,r)=>(0,i.jsxs)(`g`,{children:[(0,i.jsx)(`circle`,{cx:t.x,cy:t.y,r:3,fill:n}),(0,i.jsx)(`title`,{children:`${e[r].label}: ${e[r].value}`})]},r))]})})}export{o as n,s as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Bn as t,Et as n,Gt as r,Nt as i,Rn as a,Tt as o,Un as s,Yn as c,Yt as l,Zt as u,ar as d,sn as f,xn as p}from"./vendor-2ObLXPrQ.js";import{a as m,n as h,r as g}from"./vendor-query-CjmRaY7o.js";import{r as _}from"./vendor-motion-BryL_tAt.js";import{S as v,Yt as y,dt as b,it as x,rt as S,y as C}from"./client-C_VWY70M.js";var w=e(d(),1),T=_(),E=[`analyze`,`design`,`code`,`test`,`review`,`deploy`],D=[`read_heavy`,`write_heavy`,`balanced`],O=[`document`,`code`,`test`,`config`];function k({artifacts:e,onChange:t}){let r=e||[],i=()=>t([...r,{type:`document`,description:``,required:!0,minCount:1}]),a=e=>t(r.filter((t,n)=>n!==e)),o=(e,n,i)=>{t(r.map((t,r)=>r===e?{...t,[n]:i}:t))};return(0,T.jsxs)(`div`,{className:`space-y-2`,children:[r.map((e,t)=>(0,T.jsxs)(`div`,{className:`border border-gray-200 rounded p-3 space-y-2 text-sm`,children:[(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[(0,T.jsx)(`select`,{value:e.type,onChange:e=>o(t,`type`,e.target.value),className:`border rounded px-2 py-1 text-xs`,children:O.map(e=>(0,T.jsx)(`option`,{children:e},e))}),(0,T.jsx)(`input`,{value:e.description,onChange:e=>o(t,`description`,e.target.value),placeholder:`描述`,className:`flex-1 border rounded px-2 py-1 text-xs`}),(0,T.jsx)(`button`,{onClick:()=>a(t),className:`text-red-400 hover:text-red-600`,children:(0,T.jsx)(n,{className:`h-4 w-4`})})]}),(0,T.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,T.jsx)(`input`,{value:e.pathPattern||``,onChange:e=>o(t,`pathPattern`,e.target.value),placeholder:`路径模式 (如 docs/**/*.md)`,className:`flex-1 border rounded px-2 py-1 text-xs`}),(0,T.jsxs)(`label`,{className:`flex items-center gap-1 text-xs text-gray-600`,children:[(0,T.jsx)(`input`,{type:`checkbox`,checked:e.required!==!1,onChange:e=>o(t,`required`,e.target.checked)}),`必须`]}),(0,T.jsx)(`input`,{type:`number`,value:e.minCount||1,min:1,onChange:e=>o(t,`minCount`,parseInt(e.target.value)),className:`w-16 border rounded px-2 py-1 text-xs`})]})]},t)),(0,T.jsxs)(`button`,{onClick:i,className:`flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800`,children:[(0,T.jsx)(l,{className:`h-3 w-3`}),` 添加产物约束`]})]})}function A({initial:e,onSave:t,onCancel:i}){let[a,o]=(0,w.useState)({id:e?.id||``,name:e?.name||``,description:e?.description||``,semanticCategory:e?.semanticCategory||`code`,defaultSkills:e?.defaultSkills||[],minToolCalls:e?.minToolCalls||20,stagnationStrategy:e?.stagnationStrategy||`balanced`,expectedArtifacts:e?.expectedArtifacts||[],instructionSuffix:e?.instructionSuffix||``}),s=(e,t)=>o(n=>({...n,[e]:t}));return(0,T.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`ID(唯一标识)`}),(0,T.jsx)(`input`,{value:a.id,onChange:e=>s(`id`,e.target.value),disabled:!!e?.id,className:`w-full border rounded px-2 py-1 text-xs disabled:bg-gray-50`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`名称`}),(0,T.jsx)(`input`,{value:a.name,onChange:e=>s(`name`,e.target.value),className:`w-full border rounded px-2 py-1 text-xs`})]})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`描述`}),(0,T.jsx)(`input`,{value:a.description,onChange:e=>s(`description`,e.target.value),className:`w-full border rounded px-2 py-1 text-xs`})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`语义类别`}),(0,T.jsx)(`select`,{value:a.semanticCategory,onChange:e=>s(`semanticCategory`,e.target.value),className:`w-full border rounded px-2 py-1 text-xs`,children:E.map(e=>(0,T.jsx)(`option`,{children:e},e))})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`最小工具调用`}),(0,T.jsx)(`input`,{type:`number`,value:a.minToolCalls,min:1,onChange:e=>s(`minToolCalls`,parseInt(e.target.value)),className:`w-full border rounded px-2 py-1 text-xs`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`停滞策略`}),(0,T.jsx)(`select`,{value:a.stagnationStrategy,onChange:e=>s(`stagnationStrategy`,e.target.value),className:`w-full border rounded px-2 py-1 text-xs`,children:D.map(e=>(0,T.jsx)(`option`,{children:e},e))})]})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`预期产物`}),(0,T.jsx)(k,{artifacts:a.expectedArtifacts,onChange:e=>s(`expectedArtifacts`,e)})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`执行提示(可选)`}),(0,T.jsx)(`textarea`,{value:a.instructionSuffix||``,onChange:e=>s(`instructionSuffix`,e.target.value),rows:2,className:`w-full border rounded px-2 py-1 text-xs`})]}),(0,T.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,T.jsxs)(`button`,{onClick:()=>t(a),className:`flex items-center gap-1 px-3 py-1.5 bg-blue-600 text-white text-xs rounded hover:bg-blue-700`,children:[(0,T.jsx)(r,{className:`h-3 w-3`}),` 保存`]}),(0,T.jsxs)(`button`,{onClick:i,className:`flex items-center gap-1 px-3 py-1.5 border text-xs rounded hover:bg-gray-50`,children:[(0,T.jsx)(n,{className:`h-3 w-3`}),` 取消`]})]})]})}function j(){let[e,n]=(0,w.useState)(null),[r,d]=(0,w.useState)(!1),[_,E]=(0,w.useState)(void 0),[D,O]=(0,w.useState)(`view`),k=m(),{data:j}=g({queryKey:[`projects`],queryFn:()=>b().then(e=>e.data)});(0,w.useEffect)(()=>{j?.items?.[0]?.projectPath&&E(j.items[0].projectPath)},[j]);let{data:M,isLoading:N}=g({queryKey:[`node-types`,_],queryFn:()=>x(_),enabled:!!_}),{data:P,isLoading:F}=g({queryKey:[`node-type`,e],queryFn:()=>S(e),enabled:!!e&&D===`view`}),I=()=>{k.invalidateQueries({queryKey:[`node-types`]}),k.invalidateQueries({queryKey:[`node-type`,e]})},L=h({mutationFn:e=>C(e),onSuccess:()=>{I(),O(`view`)}}),R=h({mutationFn:e=>y(e.id,e),onSuccess:()=>{I(),O(`view`)}}),z=h({mutationFn:e=>v(e),onSuccess:()=>{n(null),O(`view`),I()}}),B=M?.data.items||[],V=P?.data,H=e=>({analyze:`bg-blue-100 text-blue-700`,design:`bg-purple-100 text-purple-700`,code:`bg-green-100 text-green-700`,test:`bg-orange-100 text-orange-700`,review:`bg-red-100 text-red-700`,deploy:`bg-indigo-100 text-indigo-700`})[e]||`bg-gray-100 text-gray-700`;return(0,T.jsxs)(`div`,{className:`p-6 max-w-7xl mx-auto`,children:[(0,T.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`流水线节点类型管理`}),(0,T.jsx)(`p`,{className:`text-sm text-gray-600 mt-1`,children:`浏览所有可用的节点类型,点击查看详细配置`})]}),(0,T.jsxs)(`button`,{onClick:()=>{n(null),O(`create`)},className:`flex items-center gap-1 px-3 py-2 bg-blue-600 text-white text-sm rounded hover:bg-blue-700`,children:[(0,T.jsx)(l,{className:`h-4 w-4`}),` 新建节点类型`]})]}),N?(0,T.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,T.jsx)(f,{className:`h-6 w-6 animate-spin text-gray-400`})}):(0,T.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,T.jsx)(`div`,{className:`space-y-3`,children:B.map(t=>(0,T.jsxs)(`div`,{onClick:()=>{n(t.id),O(`view`),d(!1)},className:`p-4 border rounded-lg cursor-pointer transition-all ${e===t.id?`border-blue-500 bg-blue-50 shadow-sm`:`border-gray-200 hover:border-gray-300 hover:shadow-sm`}`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(c,{className:`h-5 w-5 text-gray-600`}),(0,T.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:t.name})]}),(0,T.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full ${H(t.semanticCategory)}`,children:t.semanticCategory})]}),(0,T.jsx)(`p`,{className:`text-sm text-gray-600 mt-2`,children:t.description}),(0,T.jsxs)(`div`,{className:`flex items-center gap-4 mt-3 text-xs text-gray-500`,children:[t.isBuiltin&&(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(a,{className:`h-3 w-3`}),`内置`]}),!t.isBuiltin&&(0,T.jsx)(`span`,{className:`flex items-center gap-1 text-blue-600`,children:`自定义`}),t.defaultSkills.length>0&&(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(o,{className:`h-3 w-3`}),t.defaultSkills.length,` 个默认技能`]}),(t.expectedArtifacts?.length||0)>0&&(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(p,{className:`h-3 w-3`}),t.expectedArtifacts.length,` 个产物约束`]}),t.usageCount!==void 0&&(0,T.jsxs)(`span`,{className:`flex items-center gap-1 text-purple-600 font-medium`,children:[`使用 `,t.usageCount,` 次`]})]})]},t.id))}),(0,T.jsx)(`div`,{className:`lg:sticky lg:top-6 lg:self-start`,children:D===`create`?(0,T.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-6`,children:[(0,T.jsx)(`h2`,{className:`text-lg font-bold text-gray-900 mb-4`,children:`新建节点类型`}),(0,T.jsx)(A,{onSave:e=>L.mutate(e),onCancel:()=>O(`view`)})]}):D===`edit`&&V?(0,T.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-6`,children:[(0,T.jsx)(`h2`,{className:`text-lg font-bold text-gray-900 mb-4`,children:`编辑节点类型`}),(0,T.jsx)(A,{initial:{...V,minToolCalls:V.activityThreshold.minToolCalls,stagnationStrategy:V.activityThreshold.stagnationStrategy},onSave:e=>R.mutate(e),onCancel:()=>O(`view`)})]}):e?F?(0,T.jsx)(`div`,{className:`border border-gray-200 rounded-lg p-8 flex items-center justify-center`,children:(0,T.jsx)(f,{className:`h-6 w-6 animate-spin text-gray-400`})}):V?(0,T.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-6 space-y-4`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,T.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:V.name}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`px-2 py-1 text-xs rounded-full ${H(V.semanticCategory)}`,children:V.semanticCategory}),!V.isBuiltin&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`button`,{onClick:()=>O(`edit`),className:`p-1 text-gray-400 hover:text-blue-600`,children:(0,T.jsx)(u,{className:`h-4 w-4`})}),(0,T.jsx)(`button`,{onClick:()=>{confirm(`确认删除?`)&&z.mutate(V.id)},className:`p-1 text-gray-400 hover:text-red-600`,children:(0,T.jsx)(i,{className:`h-4 w-4`})})]})]})]}),(0,T.jsx)(`p`,{className:`text-sm text-gray-600`,children:V.description}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 text-xs text-gray-500`,children:[(0,T.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded`,children:V.id}),V.isBuiltin&&(0,T.jsxs)(`span`,{className:`flex items-center gap-1 text-green-600`,children:[(0,T.jsx)(a,{className:`h-3 w-3`}),`内置节点`]})]})]}),V.expectedArtifacts&&V.expectedArtifacts.length>0&&(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,T.jsx)(p,{className:`h-4 w-4`}),`预期产物`]}),(0,T.jsx)(`div`,{className:`space-y-2`,children:V.expectedArtifacts.map((e,t)=>(0,T.jsxs)(`div`,{className:`flex items-start gap-2 text-xs bg-gray-50 rounded p-2`,children:[(0,T.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-xs font-medium ${e.type===`code`?`bg-green-100 text-green-700`:e.type===`test`?`bg-orange-100 text-orange-700`:`bg-blue-100 text-blue-700`}`,children:e.type}),(0,T.jsxs)(`div`,{className:`flex-1`,children:[(0,T.jsx)(`div`,{className:`text-gray-700`,children:e.description}),e.pathPattern&&(0,T.jsx)(`code`,{className:`text-gray-500`,children:e.pathPattern})]}),e.required&&(0,T.jsx)(`span`,{className:`text-red-500 text-xs`,children:`必须`})]},t))})]}),V.defaultSkills.length>0&&(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,T.jsx)(o,{className:`h-4 w-4`}),`默认技能`]}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:V.defaultSkills.map(e=>(0,T.jsx)(`span`,{className:`px-2 py-1 bg-blue-50 text-blue-700 text-xs rounded`,children:e},e))})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,T.jsx)(a,{className:`h-4 w-4`}),`完成条件`]}),(0,T.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[V.completion.explicitSignal&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`span`,{className:`text-gray-600`,children:`显式信号:`}),(0,T.jsx)(`code`,{className:`ml-2 bg-gray-100 px-2 py-0.5 rounded text-xs`,children:V.completion.explicitSignal})]}),V.completion.keywords.length>0&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`span`,{className:`text-gray-600`,children:`关键词:`}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:V.completion.keywords.map((e,t)=>(0,T.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded text-xs`,children:e},t))})]})]})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2`,children:`活跃度阈值`}),(0,T.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[V.activityThreshold.minToolCalls!==void 0&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`span`,{className:`text-gray-600`,children:`最小工具调用:`}),(0,T.jsx)(`span`,{className:`ml-2`,children:V.activityThreshold.minToolCalls})]}),V.activityThreshold.stagnationStrategy&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`span`,{className:`text-gray-600`,children:`停滞策略:`}),(0,T.jsx)(`code`,{className:`ml-2 bg-gray-100 px-2 py-0.5 rounded text-xs`,children:V.activityThreshold.stagnationStrategy})]})]})]}),V.instructionSuffix&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2`,children:`执行提示`}),(0,T.jsx)(`p`,{className:`text-xs text-gray-600 bg-gray-50 rounded p-2`,children:V.instructionSuffix})]}),V.heuristic&&(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`button`,{onClick:()=>d(!r),className:`flex items-center gap-2 text-sm font-semibold text-gray-700 hover:text-gray-900`,children:[r?(0,T.jsx)(t,{className:`h-4 w-4`}):(0,T.jsx)(s,{className:`h-4 w-4`}),`原始配置(JSON)`]}),r&&(0,T.jsx)(`pre`,{className:`mt-2 p-3 bg-gray-50 rounded text-xs overflow-auto max-h-64`,children:JSON.stringify(V.heuristic,null,2)})]})]}):null:(0,T.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-8 text-center text-gray-500`,children:[(0,T.jsx)(c,{className:`h-12 w-12 mx-auto mb-3 text-gray-300`}),(0,T.jsx)(`p`,{children:`选择左侧节点类型查看详细信息`})]})})]})]})}export{j as default};
@@ -1 +0,0 @@
1
- import{Hn as e,Vn as t}from"./vendor-2ObLXPrQ.js";import{r as n}from"./vendor-motion-BryL_tAt.js";import{n as r}from"./ui-DpI1N3yJ.js";var i=n();function a({currentPage:n,totalPages:a,onPageChange:o,pageSize:s,onPageSizeChange:c,totalItems:l}){return(0,i.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-t border-gray-200`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,i.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`显示 `,(n-1)*s+1,`-`,Math.min(n*s,l),` / 共 `,l,` 条`]}),(0,i.jsxs)(`select`,{value:s,onChange:e=>c(Number(e.target.value)),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,i.jsx)(`option`,{value:10,children:`10 条/页`}),(0,i.jsx)(`option`,{value:20,children:`20 条/页`}),(0,i.jsx)(`option`,{value:50,children:`50 条/页`}),(0,i.jsx)(`option`,{value:100,children:`100 条/页`})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r,{variant:`ghost`,size:`sm`,icon:e,onClick:()=>o(n-1),disabled:n===1,children:`上一页`}),(0,i.jsx)(`div`,{className:`flex items-center gap-1`,children:Array.from({length:Math.min(a,7)},(e,t)=>{let r;return r=a<=7||n<=4?t+1:n>=a-3?a-6+t:n-3+t,(0,i.jsx)(`button`,{onClick:()=>o(r),className:`px-3 py-1.5 text-sm rounded-lg transition-colors ${n===r?`bg-blue-600 text-white`:`text-gray-600 hover:bg-gray-100`}`,children:r},r)})}),(0,i.jsx)(r,{variant:`ghost`,size:`sm`,icon:t,onClick:()=>o(n+1),disabled:n===a,children:`下一页`})]})]})}export{a as t};
@@ -1,4 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{At as t,Bn as n,Cn as r,Et as i,Fn as a,Ht as o,In as s,Kt as c,Nn as l,Ot as u,Pn as d,Pt as f,Rn as p,Tt as m,Un as h,Ut as g,ar as _,bn as v,er as y,kn as b,n as x,nr as S,pn as C,qt as w,xn as T,zn as E}from"./vendor-2ObLXPrQ.js";import{a as D,n as O,r as k}from"./vendor-query-CjmRaY7o.js";import{d as ee,f as te,u as ne}from"./vendor-react-DZi7brq3.js";import{r as A,t as j}from"./vendor-motion-BryL_tAt.js";import{It as M,Mt as N,O as P,g as F,n as I,st as re,zt as ie}from"./client-C_VWY70M.js";import{a as L,l as R,n as z,r as B,t as V}from"./ui-DpI1N3yJ.js";import{n as H}from"./Toast-CrwuIbKC.js";import{t as U}from"./ConfirmDialog-bdDaAlT1.js";import{t as W}from"./Breadcrumb-C1Mua6se.js";var G=e(_(),1),K=A(),q={pending:a,running:d,validating:c,passed:p,failed:s,need_human:E},J={pending:`text-gray-400`,running:`text-blue-500`,validating:`text-yellow-500`,passed:`text-green-500`,failed:`text-red-500`,need_human:`text-orange-500`},Y={pending:`待执行`,running:`执行中`,validating:`验证中`,passed:`已完成`,failed:`失败`,need_human:`需人工介入`};function ae({steps:e,currentStepId:t}){return!e||e.length===0?null:(0,K.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`text-sm font-medium text-gray-700 dark:text-gray-300 mb-2`,children:[`步骤进度 (`,e.filter(e=>e.status===`passed`).length,`/`,e.length,`)`]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:e.map((e,n)=>{let r=q[e.status],i=e.id===t;return(0,K.jsxs)(`div`,{className:L(`flex items-start gap-3 p-3 rounded-lg border transition-colors`,i?`bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800`:`bg-gray-50 dark:bg-gray-800/50 border-gray-200 dark:border-gray-700`),children:[(0,K.jsx)(`div`,{className:`flex-shrink-0 w-6 h-6 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-xs font-medium`,children:n+1}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,K.jsx)(r,{className:L(`w-4 h-4`,J[e.status])}),(0,K.jsx)(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:e.stepName}),(0,K.jsx)(V,{variant:e.status===`passed`?`success`:e.status===`failed`?`error`:`default`,children:Y[e.status]}),i&&(0,K.jsx)(V,{variant:`info`,children:`当前`})]}),e.attempts>0&&(0,K.jsxs)(`div`,{className:`text-xs text-gray-500 dark:text-gray-400 mb-1`,children:[`重试次数:`,e.attempts]}),e.failureReason&&(0,K.jsxs)(`div`,{className:`text-xs text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 p-2 rounded mt-1`,children:[`失败原因:`,e.failureReason]}),e.outputs&&Object.keys(e.outputs).length>0&&(0,K.jsxs)(`div`,{className:`mt-2 text-xs`,children:[(0,K.jsx)(`div`,{className:`text-gray-600 dark:text-gray-400 mb-1`,children:`输出产物:`}),(0,K.jsx)(`div`,{className:`space-y-1`,children:Object.entries(e.outputs).map(([e,t])=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-700 dark:text-gray-300`,children:[(0,K.jsxs)(`span`,{className:`font-medium`,children:[e,`:`]}),(0,K.jsx)(`a`,{href:`file://${t}`,className:`text-blue-600 dark:text-blue-400 hover:underline truncate`,title:t,children:t})]},e))})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-4 mt-2 text-xs text-gray-500 dark:text-gray-400`,children:[e.startedAt&&(0,K.jsxs)(`span`,{children:[`开始:`,x(new Date(e.startedAt),`HH:mm:ss`)]}),e.completedAt&&(0,K.jsxs)(`span`,{children:[`完成:`,x(new Date(e.completedAt),`HH:mm:ss`)]})]})]})]},e.id)})})]})}var oe={document:T,code:l,test:f,config:g,diagram:C,data:b,other:v},X={analyze:{name:`需求分析`,description:`分析需求,明确目标和范围`},design:{name:`架构设计`,description:`设计系统架构和技术方案`},profile:{name:`性能分析`,description:`分析性能瓶颈,制定优化方案`},code:{name:`编码实现`,description:`编写代码,实现功能`},test:{name:`测试验证`,description:`编写测试,验证功能正确性`},review:{name:`代码审查`,description:`审查代码质量和规范`}},se={analy:`#3b82f6`,design:`#8b5cf6`,architect:`#8b5cf6`,profile:`#06b6d4`,code:`#10b981`,implement:`#10b981`,test:`#f59e0b`,verif:`#f59e0b`,review:`#ef4444`,deploy:`#06b6d4`};function Z(e){let t=e.toLowerCase();for(let[e,n]of Object.entries(se))if(t.includes(e))return n;return`#6b7280`}function Q(e){let t=X[e];return t?t.name:e.split(/[_\-.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function ce(e){return X[e]?.description||null}function le(e){let t=new Set,n=[],r=new Map(e.map(e=>[e.id,e]));function i(e){if(t.has(e))return;t.add(e);let a=r.get(e);a&&((a.dependencies||[]).forEach(e=>i(e)),n.push(a))}return e.forEach(e=>i(e.id)),n}function $(e,t){if(!e)return null;let n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.floor((r-n)/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function ue({pipeline:e,onRetryNode:t}){let[r,i]=(0,G.useState)(new Set),a=(0,G.useMemo)(()=>le(e.nodes),[e.nodes]),o=a.filter(e=>e.status===`completed`||e.status===`skipped`).length,s=a.length>0&&a.every(e=>e.status===`completed`||e.status===`skipped`||e.status===`failed`),l=s?-1:a.findIndex(t=>t.id===e.currentNodeId),u=e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return a.length===0?(0,K.jsx)(B,{children:(0,K.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:`暂无节点`})}):(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(B,{className:`!p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,K.jsxs)(`span`,{className:`text-sm font-medium text-gray-700`,children:[`编排阶段 · `,o,`/`,a.length,` 已完成`]}),(0,K.jsx)(`span`,{className:`text-xs text-gray-400`,children:s||e.status===`completed`?`✅ 全部完成`:e.status===`failed`?`❌ 已失败`:l>=0?`当前:第 ${l+1} 阶段`:`准备中`})]}),(0,K.jsx)(`div`,{className:`flex items-start gap-0 overflow-x-auto pb-1`,children:a.map((t,n)=>{let r=t.id===e.currentNodeId,i=t.status===`completed`,o=t.status===`failed`,s=t.status===`skipped`,c=Z(t.nodeTypeId),l=o?`#ef4444`:s?`#9ca3af`:i||r?c:void 0;return(0,K.jsxs)(`div`,{className:`flex items-center flex-shrink-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,K.jsx)(`div`,{className:L(`w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold transition-all`,l?`text-white`:`bg-gray-100 text-gray-400`,r&&`ring-4 ring-offset-2`),style:l?{backgroundColor:l,...r?{ringColor:`${c}40`}:{}}:{},children:i?`✓`:o?`✗`:s?`—`:n+1}),(0,K.jsx)(`span`,{className:L(`text-xs mt-1 max-w-[72px] text-center leading-tight break-words`,r?`font-bold text-gray-900`:`text-gray-500`),children:Q(t.nodeTypeId)})]}),n<a.length-1&&(0,K.jsx)(`div`,{className:L(`h-0.5 w-6 mx-0.5 mb-5 flex-shrink-0 transition-colors`,i?`bg-green-400`:`bg-gray-200`)})]},t.id)})})]}),(0,K.jsx)(`div`,{className:`space-y-3`,children:a.map((i,o)=>{let s=i.id===e.currentNodeId,l=Z(i.nodeTypeId),f=Q(i.nodeTypeId),p=ce(i.nodeTypeId),g=$(i.startedAt,i.completedAt),_=r.has(i.id),y=null,b=null;if(i.output)try{let e=JSON.parse(i.output);e.artifacts&&e.validation?y=e:b=i.output}catch{b=i.output}let S=b?b.trim().split(`
2
- `):[],C=S.length>10,w=(i.dependencies||[]).map(e=>{let t=a.find(t=>t.id===e);return t?Q(t.nodeTypeId):e.slice(0,8)});return(0,K.jsxs)(B,{className:L(`!p-0 overflow-hidden transition-all`,s?`ring-2 ring-blue-400 ring-offset-1`:``),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 p-4`,children:[(0,K.jsx)(`div`,{className:`w-10 h-10 rounded-full flex items-center justify-center text-white font-bold text-sm flex-shrink-0`,style:{backgroundColor:i.status===`pending`?`#d1d5db`:i.status===`failed`?`#ef4444`:i.status===`skipped`?`#9ca3af`:l},children:i.status===`completed`?`✓`:i.status===`failed`?`✗`:i.status===`skipped`?`—`:o+1}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,K.jsx)(`span`,{className:`font-semibold text-gray-900`,children:f}),s&&(0,K.jsx)(V,{variant:`info`,size:`sm`,children:`当前阶段`}),(0,K.jsx)(V,{size:`sm`,variant:i.status===`completed`?`success`:i.status===`in_progress`?`info`:i.status===`failed`?`danger`:i.status===`skipped`?`warning`:`default`,children:i.status===`completed`?`已完成`:i.status===`in_progress`?`执行中`:i.status===`failed`?`失败`:i.status===`skipped`?`已跳过`:`等待中`}),g&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-gray-400`,children:[(0,K.jsx)(d,{className:`w-3 h-3`}),g]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-1`,children:[p&&(0,K.jsx)(`span`,{className:`text-xs text-gray-500`,children:p}),i.boundSkillName&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-amber-600`,children:[(0,K.jsx)(m,{className:`w-3 h-3`}),i.boundSkillName]}),w.length>0&&(0,K.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`依赖:`,w.join(`, `)]}),i.completedAt&&(0,K.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`完成于 `,x(new Date(i.completedAt),`HH:mm:ss`)]})]})]}),i.status===`failed`&&t&&(0,K.jsx)(z,{variant:`outline`,size:`sm`,icon:c,onClick:()=>t(i.id),className:`flex-shrink-0`,children:`重试`})]}),y&&(0,K.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 px-4 pt-3 pb-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold text-gray-500 uppercase tracking-wider`,children:`阶段产出`}),!y.validation.passed&&(0,K.jsx)(V,{variant:`danger`,size:`sm`,children:`验证失败`})]}),y.summary&&(0,K.jsx)(`div`,{className:`text-sm text-gray-700 mb-3`,children:y.summary}),y.artifacts.length>0&&(0,K.jsx)(`div`,{className:`space-y-2`,children:y.artifacts.map((e,t)=>(0,K.jsx)(`div`,{className:`bg-white rounded-lg border border-gray-200 p-3`,children:(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(oe[e.type]||v,{className:`w-4 h-4 text-gray-400 mt-0.5 flex-shrink-0`}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`div`,{className:`font-mono text-sm text-gray-900 break-all`,children:e.path}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 text-xs text-gray-500`,children:[(0,K.jsx)(`span`,{className:`capitalize`,children:e.type}),e.size_bytes&&(0,K.jsxs)(`span`,{children:[`· `,(e.size_bytes/1024).toFixed(1),` KB`]}),(0,K.jsxs)(`span`,{children:[`· `,x(new Date(e.created_at),`HH:mm:ss`)]})]})]})]})},t))}),y.validation.errors&&y.validation.errors.length>0&&(0,K.jsx)(`div`,{className:`mt-3 p-2 bg-red-50 border border-red-200 rounded text-xs text-red-700`,children:y.validation.errors.map((e,t)=>(0,K.jsxs)(`div`,{children:[`• `,e]},t))})]}),!y&&S.length>0&&(0,K.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 px-4 pt-3 pb-4`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold text-gray-500 uppercase tracking-wider`,children:`阶段产出`}),(0,K.jsx)(`div`,{className:L(`mt-2 text-sm text-gray-800 whitespace-pre-wrap font-mono bg-white rounded-lg border border-gray-100 p-3 leading-relaxed`,!_&&C?`max-h-52 overflow-hidden`:``),children:!_&&C?S.slice(0,10).join(`
3
- `)+`
4
- …`:b}),C&&(0,K.jsx)(`button`,{onClick:()=>u(i.id),className:`mt-2 text-xs text-blue-600 hover:underline flex items-center gap-1`,children:_?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(n,{className:`w-3 h-3`}),`收起`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(h,{className:`w-3 h-3`}),`展开全部(`,S.length,` 行)`]})})]}),i.stepExecutions&&i.stepExecutions.length>0&&(0,K.jsx)(`div`,{className:`border-t border-gray-100 bg-white px-4 py-3`,children:(0,K.jsx)(ae,{steps:i.stepExecutions,currentStepId:i.currentStepId})}),i.status===`in_progress`&&S.length===0&&(0,K.jsxs)(`div`,{className:`border-t border-blue-100 bg-blue-50 px-4 py-3 flex items-center gap-2 text-sm text-blue-600`,children:[(0,K.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-blue-500 animate-pulse`}),`正在执行,等待产出…`]})]},i.id)})})]})}var de={PreToolUse:`#3b82f6`,PostToolUse:`#10b981`,UserPromptSubmit:`#f59e0b`,Stop:`#ef4444`};function fe(){let{id:e}=te(),n=ee(),a=ne(),s=D(),[c,l]=(0,G.useState)(`tasks`),[d,f]=(0,G.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),m=a.state?.from||`/pipelines`,{data:h,isLoading:g,isError:_,error:v}=k({queryKey:[`pipeline`,e],queryFn:()=>re(e).then(e=>e.data),enabled:!!e}),b=O({mutationFn:()=>F(e),onSuccess:()=>{s.invalidateQueries({queryKey:[`pipeline`,e]}),n(m)},onError:e=>H(e.message||`关闭失败`,`error`)}),C=O({mutationFn:()=>N(e),onSuccess:()=>{s.invalidateQueries({queryKey:[`pipeline`,e]}),H(`Pipeline 已重新激活`,`success`)},onError:e=>H(e.message||`重新激活失败`,`error`)}),T=O({mutationFn:()=>ie(e),onSuccess:()=>{s.invalidateQueries({queryKey:[`pipeline`,e]}),H(`已添加到执行队列,下次工具调用时自动注入提示`,`success`)},onError:e=>H(e.message||`恢复失败`,`error`)}),E=O({mutationFn:t=>I(e),onSuccess:t=>{s.invalidateQueries({queryKey:[`pipeline`,e]}),H(t.data.message||`节点已重置,等待重新执行`,`success`)},onError:e=>H(e.message||`重试失败`,`error`)}),A=O({mutationFn:e=>M(e),onSuccess:()=>{s.invalidateQueries({queryKey:[`pipeline`,e]}),H(`问题已标记为已解决`,`success`)},onError:e=>H(e.message||`操作失败`,`error`)}),q=O({mutationFn:e=>P(e),onSuccess:()=>{s.invalidateQueries({queryKey:[`pipeline`,e]}),H(`问题已忽略`,`success`)},onError:e=>H(e.message||`操作失败`,`error`)});if(_)return(0,K.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,v?.message||`未知错误`]});if(g||!h)return(0,K.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,K.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let J=h,Y=J.status!==`completed`&&J.status!==`failed`;return(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsx)(W,{items:[{label:`Pipeline 列表`,path:`/pipelines`},{label:h.id.slice(0,12)+`...`}]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(z,{variant:`ghost`,size:`sm`,icon:y,onClick:()=>n(m),children:`返回`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-lg font-bold text-gray-900`,children:`Pipeline 执行轨迹`}),(0,K.jsxs)(V,{variant:`primary`,size:`sm`,children:[(0,K.jsx)(u,{className:`w-3 h-3 mr-1`}),` 动态编排`]})]}),(0,K.jsxs)(`p`,{className:`text-sm text-gray-500`,children:[(0,K.jsx)(`span`,{className:`font-mono`,children:h.id.slice(0,12)}),h.sessionId&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`mx-2`,children:`·`}),(0,K.jsxs)(`span`,{className:`text-blue-600 cursor-pointer hover:underline`,onClick:()=>n(`/sessions/${h.sessionId}`),children:[`会话 `,h.sessionId.slice(0,8)]})]})]})]}),(0,K.jsx)(V,{variant:Y?`info`:`success`,children:J.status===`completed`?`已完成`:J.status===`failed`?`已失败`:`执行中`}),(0,K.jsx)(V,{variant:h.complexity===`complex`?`danger`:h.complexity===`moderate`?`warning`:`default`,children:h.complexity})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[h.sessionId&&(0,K.jsx)(z,{variant:`secondary`,size:`sm`,icon:S,onClick:()=>n(`/sessions/${h.sessionId}`),children:`查看会话`}),Y&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(z,{variant:`primary`,size:`sm`,onClick:()=>T.mutate(),loading:T.isPending,children:`继续执行`}),(0,K.jsx)(z,{variant:`danger`,size:`sm`,icon:i,onClick:()=>{f({open:!0,title:`关闭 Pipeline`,description:`确认关闭此 Pipeline?`,onConfirm:()=>{b.mutate(),f(e=>({...e,open:!1}))}})},children:`关闭`})]}),!Y&&(0,K.jsx)(z,{variant:`secondary`,size:`sm`,icon:w,onClick:()=>{f({open:!0,title:`重新激活 Pipeline`,description:`确认重新激活此 Pipeline?状态将重置为活跃。`,onConfirm:()=>{C.mutate(),f(e=>({...e,open:!1}))}})},loading:C.isPending,children:`重新激活`})]})]}),(0,K.jsx)(B,{className:`!p-4`,children:(0,K.jsx)(`p`,{className:`text-sm text-gray-700 line-clamp-3`,children:h.requirement})}),J.executionPlan&&(0,K.jsx)(B,{title:`编排计划`,className:`!p-4`,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[J.reasoning&&!J.reasoning.startsWith(`图片`)&&!J.reasoning.startsWith(`[Image`)&&(0,K.jsxs)(`div`,{className:`text-sm bg-blue-50 p-3 rounded-lg border border-blue-100`,children:[(0,K.jsx)(`div`,{className:`font-medium text-blue-900 mb-1`,children:`规划依据`}),(0,K.jsx)(`p`,{className:`text-blue-800`,children:J.reasoning}),J.executionPlan.complexity&&(0,K.jsxs)(`div`,{className:`mt-1.5 flex gap-2 flex-wrap`,children:[(0,K.jsxs)(`span`,{className:`text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded-full`,children:[`复杂度:`,J.executionPlan.complexity]}),J.executionPlan.source&&(0,K.jsxs)(`span`,{className:`text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded-full`,children:[`来源:`,J.executionPlan.source===`template`?`模板匹配`:`AI 智能分解`]}),J.executionPlan.templateName&&(0,K.jsxs)(`span`,{className:`text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded-full`,children:[`模板:`,J.executionPlan.templateName]})]})]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:J.executionPlan.stages.map((e,t)=>{let n=J.nodes.find(t=>t.nodeTypeId===e.nodeTypeId),r=n?.status===`completed`,i=n?.status===`in_progress`,a=!n||n.status===`pending`;return(0,K.jsxs)(`div`,{className:L(`flex items-start gap-3 p-3 rounded-lg border`,r&&`bg-green-50 border-green-200`,i&&`bg-blue-50 border-blue-200`,a&&`bg-gray-50 border-gray-200`),children:[(0,K.jsx)(`div`,{className:`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold`,style:{backgroundColor:r?`#10b981`:i?`#3b82f6`:`#9ca3af`,color:`white`},children:t+1}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-gray-900`,children:e.name}),(0,K.jsx)(V,{size:`sm`,variant:r?`success`:i?`info`:`default`,children:r?`已完成`:i?`进行中`:`待执行`}),e.phase&&(0,K.jsx)(V,{size:`sm`,children:e.phase})]}),e.description&&(0,K.jsx)(`p`,{className:`text-sm text-gray-600 mt-1`,children:e.description}),e.stageReasoning&&(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500 bg-white bg-opacity-60 rounded px-2 py-1.5 border border-gray-200`,children:[(0,K.jsx)(`span`,{className:`font-medium text-gray-600`,children:`编排依据:`}),(0,K.jsx)(`span`,{children:e.stageReasoning})]}),e.expectedArtifacts&&e.expectedArtifacts.length>0&&(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:`预期产物:`}),e.expectedArtifacts.map((e,t)=>(0,K.jsxs)(`span`,{className:`ml-1 font-mono bg-gray-100 px-1.5 py-0.5 rounded`,children:[e.pattern,e.required&&(0,K.jsx)(`span`,{className:`text-red-500`,children:`*`})]},t))]})]})]},t)})})]})}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-3`,children:[(0,K.jsxs)(B,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-blue-600`,children:h.stats.totalEvents}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`事件`})]}),(0,K.jsxs)(B,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-green-600`,children:`${J.stats.completedNodes}/${J.stats.totalNodes}`}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`节点`})]}),(0,K.jsxs)(B,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-purple-600`,children:h.stats.totalArtifacts}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`产物`})]}),(0,K.jsxs)(B,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-orange-600`,children:h.stats.totalQualityIssues}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`质量问题`})]}),(0,K.jsxs)(B,{className:`text-center !p-3`,children:[(0,K.jsx)(`div`,{className:`text-xl font-bold text-red-600`,children:h.stats.unresolvedQuality}),(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:`未解决`})]})]}),(0,K.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit`,children:[`tasks`,`events`,`artifacts`,`quality`].map(e=>(0,K.jsx)(`button`,{onClick:()=>l(e),className:L(`px-4 py-2 rounded-md text-sm font-medium transition-colors`,c===e?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`),children:{tasks:`编排图 (${J.stats.totalNodes})`,events:`事件 (${h.stats.totalEvents})`,artifacts:`产物 (${h.stats.totalArtifacts})`,quality:`质量 (${h.stats.totalQualityIssues})`}[e]},e))}),c===`tasks`&&(0,K.jsx)(`div`,{className:`space-y-4`,children:(0,K.jsx)(ue,{pipeline:J,onRetryNode:e=>{f({open:!0,title:`重试失败节点`,description:`确定要重试此节点吗?节点状态将重置为等待中,下次工具调用时自动重新执行。`,onConfirm:()=>{E.mutate(e),f(e=>({...e,open:!1}))}})}})}),c===`events`&&(0,K.jsx)(B,{title:`工具调用时间线`,children:(0,K.jsxs)(`div`,{className:`space-y-1 max-h-[600px] overflow-y-auto`,children:[h.events.map((e,t)=>(0,K.jsxs)(j.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:t*.01},className:`flex items-center gap-3 py-1.5 px-2 rounded hover:bg-gray-50 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-gray-400 font-mono w-16 flex-shrink-0`,children:x(R(e.time),`HH:mm:ss`)}),(0,K.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:de[e.hookType]||`#6b7280`}}),(0,K.jsx)(`span`,{className:`font-mono text-gray-700 w-20 flex-shrink-0`,children:e.toolName||e.hookType}),(0,K.jsx)(`span`,{className:`text-gray-500 truncate`,children:e.detail||``})]},t)),h.events.length===0&&(0,K.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无事件`})]})}),c===`artifacts`&&(0,K.jsx)(B,{title:`产物文件`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[h.artifacts.map((e,t)=>(0,K.jsx)(j.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.03},className:`flex items-center justify-between p-3 rounded-lg border border-gray-100 hover:border-green-200 hover:bg-green-50/50`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(r,{className:`h-5 w-5 text-green-500`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-mono text-sm text-gray-900`,children:e.filePath.split(`/`).slice(-2).join(`/`)}),(0,K.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[e.tool,` · `,x(R(e.time),`HH:mm:ss`)]})]})]})},t)),h.artifacts.length===0&&(0,K.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无产物`})]})}),c===`quality`&&(0,K.jsx)(B,{title:`质量问题`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[h.qualityIssues.map((e,n)=>(0,K.jsxs)(j.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:n*.03},className:`flex items-start justify-between p-3 rounded-lg border border-gray-100`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3 flex-1`,children:[e.resolved?(0,K.jsx)(p,{className:`h-5 w-5 text-green-500 mt-0.5`}):(0,K.jsx)(t,{className:`h-5 w-5 text-amber-500 mt-0.5`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(V,{size:`sm`,variant:e.level===`error`?`danger`:e.level===`warn`?`warning`:`info`,children:e.level}),(0,K.jsx)(V,{size:`sm`,children:e.category})]}),(0,K.jsx)(`p`,{className:`text-sm text-gray-700 mt-1`,children:e.message}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:x(R(e.createdAt),`MM-dd HH:mm`)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(V,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),!e.resolved&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(z,{variant:`secondary`,size:`sm`,onClick:()=>A.mutate(e.id),loading:A.isPending,children:`解决`}),(0,K.jsx)(z,{variant:`ghost`,size:`sm`,onClick:()=>q.mutate(e.id),loading:q.isPending,children:`忽略`})]})]})]},n)),h.qualityIssues.length===0&&(0,K.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,K.jsx)(o,{className:`h-12 w-12 mx-auto mb-3 text-green-300`}),`暂无质量问题`]})]})}),(0,K.jsx)(U,{open:d.open,title:d.title,description:d.description,variant:`danger`,onConfirm:d.onConfirm,onCancel:()=>f({...d,open:!1})})]})}export{fe as default};
@@ -1,2 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{At as t,Dn as n,Et as r,In as i,Nt as a,Pn as o,Rn as s,Un as c,Vn as l,Wt as u,ar as d,gn as f,n as p,on as m,qt as h,wn as g}from"./vendor-2ObLXPrQ.js";import{a as ee,n as _,r as v}from"./vendor-query-CjmRaY7o.js";import{d as te}from"./vendor-react-DZi7brq3.js";import{n as y,r as b,t as x}from"./vendor-motion-BryL_tAt.js";import{ct as S,g as ne,h as re,i as ie,lt as C,nt as w,o as ae,t as T}from"./client-C_VWY70M.js";import{a as E,l as D,n as O,r as k,t as A}from"./ui-DpI1N3yJ.js";import{t as j}from"./useDebounce-BLryFdeo.js";import{t as oe}from"./ErrorState-CMLoMrQY.js";import{t as se}from"./exportCsv-CO51kx6P.js";import{t as ce}from"./ConfirmDialog-bdDaAlT1.js";import{n as M,t as le}from"./Skeleton-DbL04wuz.js";import{t as ue}from"./Pagination-CR-eJz36.js";import{t as de}from"./BatchProgress-qW-6664M.js";var N=e(d(),1),P=b(),F={pending:{label:`待执行`,color:`text-gray-400`,icon:(0,P.jsx)(o,{className:`w-4 h-4`})},in_progress:{label:`执行中`,color:`text-blue-500`,icon:(0,P.jsx)(m,{className:`w-4 h-4 animate-spin`})},retrying:{label:`重试中`,color:`text-yellow-500`,icon:(0,P.jsx)(h,{className:`w-4 h-4 animate-spin`})},blocked:{label:`已阻塞`,color:`text-red-500`,icon:(0,P.jsx)(i,{className:`w-4 h-4`})},done:{label:`已完成`,color:`text-green-500`,icon:(0,P.jsx)(s,{className:`w-4 h-4`})},failed:{label:`失败`,color:`text-red-500`,icon:(0,P.jsx)(i,{className:`w-4 h-4`})},skipped:{label:`已跳过`,color:`text-gray-400`,icon:(0,P.jsx)(t,{className:`w-4 h-4`})}};function I({node:e}){let[t,n]=(0,N.useState)(!1),r=F[e.status],{data:i,isLoading:a}=v({queryKey:[`node-attempts`,e.node_id],queryFn:()=>w(e.node_id).then(e=>e.data),enabled:t});return(0,P.jsxs)(`div`,{className:`border border-gray-700 rounded-lg overflow-hidden`,children:[(0,P.jsxs)(`button`,{className:`w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-800/50 transition-colors text-left`,onClick:()=>n(e=>!e),children:[(0,P.jsx)(`span`,{className:E(`flex-shrink-0`,r.color),children:r.icon}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium text-gray-100 truncate`,children:e.title}),(0,P.jsx)(A,{variant:e.status===`done`?`success`:e.status===`blocked`||e.status===`failed`?`error`:e.status===`in_progress`||e.status===`retrying`?`warning`:`default`,children:r.label}),e.attempt_count>0&&(0,P.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[e.attempt_count,` 次尝试`]})]}),(0,P.jsxs)(`div`,{className:`text-xs text-gray-500 mt-0.5`,children:[`阶段: `,e.phase,` · 超时: `,e.timeout_sec,`s`]})]}),(0,P.jsx)(`span`,{className:`text-gray-500 flex-shrink-0`,children:t?(0,P.jsx)(c,{className:`w-4 h-4`}):(0,P.jsx)(l,{className:`w-4 h-4`})})]}),(0,P.jsx)(y,{children:t&&(0,P.jsx)(x.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,P.jsx)(`div`,{className:`px-4 pb-4 pt-2 border-t border-gray-700 bg-gray-900/50`,children:a?(0,P.jsx)(`div`,{className:`text-sm text-gray-500 py-2`,children:`加载执行记录...`}):i?.items.length===0?(0,P.jsx)(`div`,{className:`text-sm text-gray-500 py-2`,children:`暂无执行记录`}):(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(`div`,{className:`text-xs font-medium text-gray-400 mb-2`,children:`执行记录`}),i?.items.map(e=>(0,P.jsxs)(`div`,{className:E(`rounded p-3 text-xs space-y-1`,e.status===`passed`?`bg-green-900/20 border border-green-800/30`:e.status===`failed`?`bg-red-900/20 border border-red-800/30`:`bg-gray-800/50 border border-gray-700`),children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsxs)(`span`,{className:`font-medium text-gray-300`,children:[`第 `,e.attempt_number,` 次 · 策略: `,e.strategy_id]}),(0,P.jsx)(`span`,{className:E(`font-medium`,e.status===`passed`?`text-green-400`:e.status===`failed`?`text-red-400`:`text-blue-400`),children:e.status===`passed`?`通过`:e.status===`failed`?`失败`:`执行中`})]}),e.started_at&&(0,P.jsxs)(`div`,{className:`text-gray-500`,children:[p(new Date(e.started_at),`HH:mm:ss`),e.ended_at&&` → ${p(new Date(e.ended_at),`HH:mm:ss`)}`]}),e.verification_result&&!e.verification_result.passed&&(0,P.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,P.jsx)(`div`,{className:`text-gray-400`,children:e.verification_result.diagnostics}),e.verification_result.missing_items.length>0&&(0,P.jsx)(`ul`,{className:`text-red-400 space-y-0.5 pl-3`,children:e.verification_result.missing_items.map((e,t)=>(0,P.jsxs)(`li`,{children:[`· `,e]},t))})]})]},e.attempt_id))]})})})})]})}function L({nodes:e}){let t=e.length,n=e.filter(e=>e.status===`done`).length,r=e.filter(e=>e.status===`blocked`||e.status===`failed`).length,i=e.filter(e=>e.status===`retrying`).length,a=t>0?Math.round(n/t*100):0;return(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,P.jsxs)(`span`,{className:`text-gray-400`,children:[`进度: `,n,`/`,t,` 节点完成`]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[i>0&&(0,P.jsxs)(`span`,{className:`text-yellow-400`,children:[i,` 重试中`]}),r>0&&(0,P.jsxs)(`span`,{className:`text-red-400`,children:[r,` 已阻塞`]}),(0,P.jsxs)(`span`,{className:`text-gray-400`,children:[a,`%`]})]})]}),(0,P.jsx)(`div`,{className:`h-2 bg-gray-700 rounded-full overflow-hidden`,children:(0,P.jsx)(`div`,{className:E(`h-full rounded-full transition-all duration-500`,r>0?`bg-red-500`:a===100?`bg-green-500`:`bg-blue-500`),style:{width:`${a}%`}})})]})}function fe({projectPath:e}){let{data:t,isLoading:n,isError:r}=v({queryKey:[`plan`,`by-project`,e],queryFn:()=>S(e).then(e=>e.data)});if(n)return(0,P.jsx)(`div`,{className:`text-sm text-gray-500 py-4 text-center`,children:`加载执行计划...`});if(r||!t)return null;let i={draft:{label:`草稿`,color:`default`},approved:{label:`已确认`,color:`default`},running:{label:`执行中`,color:`warning`},completed:{label:`已完成`,color:`success`},failed:{label:`失败`,color:`error`},aborted:{label:`已中止`,color:`error`}}[t.status];return(0,P.jsxs)(`div`,{className:`space-y-4`,children:[(0,P.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium text-gray-200 truncate`,children:t.goal}),(0,P.jsx)(A,{variant:i.color,children:i.label})]}),(0,P.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[`模板: `,t.template_id,` · 创建: `,p(new Date(t.created_at),`MM-dd HH:mm`)]})]})}),(0,P.jsx)(L,{nodes:t.nodes}),(0,P.jsx)(`div`,{className:`space-y-2`,children:t.nodes.map(e=>(0,P.jsx)(I,{node:e},e.node_id))})]})}function pe({open:e,planId:n,templateName:i,goal:a,nodes:c,onApprove:l,onReject:u,onClose:d,loading:p=!1}){let[m,h]=(0,N.useState)(new Set),g=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return e?(0,P.jsx)(y,{children:(0,P.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,children:(0,P.jsxs)(x.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`bg-white rounded-lg shadow-xl max-w-3xl w-full max-h-[90vh] overflow-hidden flex flex-col`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between p-6 border-b border-gray-200`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-xl font-semibold text-gray-900`,children:`确认执行计划`}),(0,P.jsxs)(`p`,{className:`text-sm text-gray-500 mt-1`,children:[`模板:`,i]})]}),(0,P.jsx)(`button`,{onClick:d,className:`text-gray-400 hover:text-gray-600 transition-colors`,children:(0,P.jsx)(r,{className:`h-5 w-5`})})]}),(0,P.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 space-y-6`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`目标`}),(0,P.jsx)(`p`,{className:`text-gray-900`,children:a})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`h3`,{className:`text-sm font-medium text-gray-700 mb-3`,children:[`执行节点(共 `,c.length,` 个)`]}),(0,P.jsx)(`div`,{className:`space-y-2`,children:c.map((e,n)=>(0,P.jsxs)(`div`,{className:`border border-gray-200 rounded-lg overflow-hidden`,children:[(0,P.jsxs)(`button`,{onClick:()=>g(e.node_id),className:`w-full flex items-center justify-between p-4 hover:bg-gray-50 transition-colors text-left`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 flex-1`,children:[(0,P.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 rounded-full bg-blue-100 text-blue-600 text-sm font-medium`,children:n+1}),(0,P.jsxs)(`div`,{className:`flex-1`,children:[(0,P.jsx)(`div`,{className:`font-medium text-gray-900`,children:e.title}),(0,P.jsxs)(`div`,{className:`text-sm text-gray-500 flex items-center gap-2 mt-1`,children:[(0,P.jsx)(`span`,{className:`px-2 py-0.5 bg-gray-100 rounded text-xs`,children:e.phase}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(s,{className:`h-3 w-3`}),e.completion_rules.length,` 条完成规则`]}),e.dependencies&&e.dependencies.length>0&&(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(f,{className:`h-3 w-3`}),`依赖 `,e.dependencies.length,` 个节点`]})]})]})]}),(0,P.jsx)(x.div,{animate:{rotate:m.has(e.node_id)?180:0},transition:{duration:.2},children:(0,P.jsx)(`svg`,{className:`h-5 w-5 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})})})]}),(0,P.jsx)(y,{children:m.has(e.node_id)&&(0,P.jsx)(x.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`border-t border-gray-200 bg-gray-50`,children:(0,P.jsx)(`div`,{className:`p-4 space-y-3`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h4`,{className:`text-xs font-medium text-gray-700 mb-2`,children:`完成条件`}),(0,P.jsx)(`div`,{className:`space-y-1.5`,children:e.completion_rules.map((e,n)=>(0,P.jsxs)(`div`,{className:`flex items-start gap-2 text-sm`,children:[e.required?(0,P.jsx)(t,{className:`h-4 w-4 text-orange-500 flex-shrink-0 mt-0.5`}):(0,P.jsx)(o,{className:`h-4 w-4 text-gray-400 flex-shrink-0 mt-0.5`}),(0,P.jsxs)(`div`,{className:`flex-1`,children:[(0,P.jsx)(`span`,{className:`text-gray-700`,children:e.description}),(0,P.jsxs)(`span`,{className:`ml-2 text-xs text-gray-500`,children:[`(`,e.type===`artifact`?`文件检查`:e.type===`command`?`命令执行`:`人工确认`,`)`]})]})]},n))})]})})})})]},e.node_id))})]}),(0,P.jsxs)(`div`,{className:`flex items-start gap-3 p-4 bg-yellow-50 border border-yellow-200 rounded-lg`,children:[(0,P.jsx)(t,{className:`h-5 w-5 text-yellow-600 flex-shrink-0 mt-0.5`}),(0,P.jsxs)(`div`,{className:`text-sm text-yellow-800`,children:[(0,P.jsx)(`p`,{className:`font-medium mb-1`,children:`确认后将开始执行`}),(0,P.jsx)(`p`,{children:`系统将按照节点顺序自动执行,每个节点完成后会自动推进到下一个节点。`})]})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50`,children:[(0,P.jsx)(O,{variant:`secondary`,onClick:u,disabled:p,children:`拒绝`}),(0,P.jsx)(O,{variant:`primary`,onClick:l,loading:p,icon:s,children:`确认执行`})]})]})})}):null}function R(){let e=ee(),t=te(),[i,s]=(0,N.useState)(``),c=j(i),[l,d]=(0,N.useState)(``),[m,y]=(0,N.useState)(`all`),[b,S]=(0,N.useState)(1),[w,E]=(0,N.useState)(20),[F,I]=(0,N.useState)(new Set),[L,R]=(0,N.useState)(``),[z,B]=(0,N.useState)(null),[V,H]=(0,N.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:me,isLoading:he,isError:ge,refetch:U}=v({queryKey:[`pipelines`,`active`],queryFn:()=>C({status:`active`,page_size:100}).then(e=>e.data)}),{data:W,refetch:_e}=v({queryKey:[`pipelines`,`completed`,c,l,b,w],queryFn:()=>C({status:`completed`,search:c||void 0,complexity:l||void 0,page:b,page_size:w}).then(e=>e.data)}),G=_({mutationFn:e=>ne(e),onSuccess:()=>e.invalidateQueries({queryKey:[`pipelines`]})}),K=_({mutationFn:()=>re(),onSuccess:()=>e.invalidateQueries({queryKey:[`pipelines`]})}),q=_({mutationFn:e=>ae(e),onSuccess:t=>{e.invalidateQueries({queryKey:[`pipelines`]}),I(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
- `)}`)}}),J=_({mutationFn:e=>ie(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`pipelines`]}),B(null)}}),Y=_({mutationFn:e=>T(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`pipelines`]}),B(null)}});if(he)return(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsx)(le,{rows:2}),(0,P.jsx)(M,{count:5})]});if(ge)return(0,P.jsx)(oe,{message:`Pipeline 数据加载失败`,onRetry:()=>U()});let X=me?.items||[],Z=W?.items||[],Q=W?.total||0,$=X.filter(e=>!L||e.requirement.toLowerCase().includes(L.toLowerCase())||e.project.toLowerCase().includes(L.toLowerCase())),ve=m===`all`||m===`active`,ye=m===`all`||m===`completed`,be=Math.ceil(Q/w);return(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,P.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[X.length,` 个活跃 · `,Q,` 个已完成`,F.size>0&&` · 已选 ${F.size} 个`]}),(0,P.jsxs)(`select`,{value:m,onChange:e=>{y(e.target.value),S(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,P.jsx)(`option`,{value:`all`,children:`全部状态`}),(0,P.jsx)(`option`,{value:`active`,children:`仅活跃`}),(0,P.jsx)(`option`,{value:`completed`,children:`仅已完成`})]})]}),(0,P.jsxs)(`div`,{className:`flex gap-2`,children:[$.length>0&&F.size>0&&(0,P.jsxs)(O,{variant:`danger`,size:`sm`,icon:r,onClick:()=>{F.size!==0&&H({open:!0,title:`批量关闭 Pipeline`,description:`确认关闭选中的 ${F.size} 个 Pipeline?`,count:F.size,onConfirm:()=>{q.mutate(Array.from(F)),H(e=>({...e,open:!1}))}})},loading:q.isPending,children:[`批量关闭 (`,F.size,`)`]}),$.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(O,{variant:`secondary`,size:`sm`,onClick:()=>{F.size===$.length?I(new Set):I(new Set($.map(e=>e.id)))},children:F.size===$.length?`取消全选`:`全选`}),(0,P.jsx)(O,{variant:`danger`,size:`sm`,icon:a,onClick:()=>{H({open:!0,title:`清理过期 Pipeline`,description:`确认关闭所有过期 Pipeline?`,onConfirm:()=>{K.mutate(),H(e=>({...e,open:!1}))}})},loading:K.isPending,children:`清理过期`})]}),(0,P.jsx)(O,{variant:`secondary`,size:`sm`,icon:h,onClick:()=>U(),children:`刷新`}),(0,P.jsx)(O,{variant:`secondary`,size:`sm`,icon:n,onClick:()=>{let e=[...X,...Z];se(`pipelines-${p(new Date,`yyyyMMdd-HHmmss`)}.csv`,[`ID`,`需求`,`复杂度`,`状态`,`项目`,`创建时间`],e.map(e=>[e.id,e.requirement,e.complexity,e.status,e.project,e.createdAt]))},children:`导出 CSV`})]})]}),q.isPending&&(0,P.jsx)(de,{total:F.size,done:0,label:`批量关闭中`}),ve&&X.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,P.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-500 uppercase tracking-wider`,children:[`活跃中 (`,$.length,`/`,X.length,`)`]}),(0,P.jsxs)(`div`,{className:`relative w-64`,children:[(0,P.jsx)(u,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,P.jsx)(`input`,{type:`text`,placeholder:`搜索活跃 Pipeline...`,value:L,onChange:e=>R(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,P.jsx)(`div`,{className:`space-y-3`,children:$.map((e,n)=>(0,P.jsx)(x.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.05},children:(0,P.jsxs)(k,{className:`!p-0 overflow-hidden cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>t(`/pipelines/${e.id}`),children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between p-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-4 flex-1 min-w-0`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:F.has(e.id),onChange:t=>{t.stopPropagation(),I(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,P.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg`,style:{backgroundColor:`#10b98120`},children:(0,P.jsx)(f,{className:`h-5 w-5`,style:{color:`#10b981`}})}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsx)(`div`,{className:`font-medium text-gray-900 truncate`,children:e.requirement}),(0,P.jsxs)(`div`,{className:`text-sm text-gray-500 flex items-center gap-3 mt-1`,children:[(0,P.jsx)(A,{variant:`primary`,size:`sm`,children:`动态`}),(0,P.jsx)(`span`,{children:e.project}),(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(o,{className:`h-3 w-3`}),p(D(e.createdAt),`MM-dd HH:mm`)]})]}),e.type===`dynamic`&&e.nodeConfig&&(0,P.jsxs)(`div`,{className:`mt-2 flex items-center gap-3 text-xs text-gray-600`,children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(f,{className:`h-3 w-3`}),e.nodeConfig.totalNodes,` 个节点`]}),e.nodeConfig.boundSkills.length>0&&(0,P.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`⚡ `,e.nodeConfig.boundSkills.length,` 个技能`]}),(0,P.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,P.jsx)(O,{variant:`danger`,size:`sm`,icon:r,onClick:t=>{t.stopPropagation(),H({open:!0,title:`关闭 Pipeline`,description:`确认关闭此 Pipeline?`,onConfirm:()=>{G.mutate(e.id),H(e=>({...e,open:!1}))}})},loading:G.isPending,children:`关闭`})]}),(0,P.jsx)(`div`,{className:`border-t border-gray-100`,children:(0,P.jsx)(fe,{projectPath:e.project})})]})},e.id))})]}),ye&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3`,children:`历史记录`}),(0,P.jsxs)(k,{children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center mb-4 pb-4 border-b border-gray-100`,children:[(0,P.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-sm`,children:[(0,P.jsx)(u,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,P.jsx)(`input`,{type:`text`,placeholder:`搜索需求描述...`,value:i,onChange:e=>{s(e.target.value),S(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,P.jsxs)(`select`,{value:l,onChange:e=>{d(e.target.value),S(1)},className:`px-3 py-2 border border-gray-200 rounded-lg text-sm`,children:[(0,P.jsx)(`option`,{value:``,children:`全部复杂度`}),(0,P.jsx)(`option`,{value:`simple`,children:`简单`}),(0,P.jsx)(`option`,{value:`moderate`,children:`中等`}),(0,P.jsx)(`option`,{value:`complex`,children:`复杂`})]})]}),(0,P.jsx)(`div`,{className:`overflow-x-auto`,children:(0,P.jsxs)(`table`,{className:`w-full`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,P.jsx)(`th`,{className:`pb-3 font-medium`,children:`需求`}),(0,P.jsx)(`th`,{className:`pb-3 font-medium`,children:`项目`}),(0,P.jsx)(`th`,{className:`pb-3 font-medium`,children:`类型`}),(0,P.jsx)(`th`,{className:`pb-3 font-medium`,children:`复杂度`}),(0,P.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,P.jsx)(`th`,{className:`pb-3 font-medium`,children:`操作`})]})}),(0,P.jsx)(`tbody`,{className:`text-sm`,children:Z.map(e=>(0,P.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-gray-50 cursor-pointer`,onClick:()=>t(`/pipelines/${e.id}`),children:[(0,P.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.requirement}),(0,P.jsx)(`td`,{className:`py-3`,children:e.project}),(0,P.jsx)(`td`,{className:`py-3`,children:(0,P.jsxs)(`div`,{className:`space-y-1`,children:[(0,P.jsx)(A,{size:`sm`,variant:`primary`,children:`动态编排`}),e.nodeConfig&&(0,P.jsxs)(`div`,{className:`text-xs text-gray-500 space-y-0.5`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(f,{className:`h-3 w-3`}),e.nodeConfig.totalNodes,` 节点`,e.nodeConfig.boundSkills.length>0&&(0,P.jsxs)(`span`,{className:`ml-1`,children:[`· ⚡ `,e.nodeConfig.boundSkills.length,` 技能`]})]}),(0,P.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,P.jsx)(`td`,{className:`py-3`,children:(0,P.jsx)(A,{size:`sm`,variant:e.complexity===`complex`?`danger`:e.complexity===`moderate`?`warning`:`default`,children:e.complexity||`-`})}),(0,P.jsx)(`td`,{className:`py-3 text-gray-500`,children:p(D(e.createdAt),`MM-dd HH:mm`)}),(0,P.jsx)(`td`,{className:`py-3`,children:(0,P.jsx)(O,{variant:`ghost`,size:`sm`,icon:g,onClick:n=>{n.stopPropagation(),t(`/pipelines/${e.id}`)},children:`查看`})})]},e.id))})]})}),Q===0&&(0,P.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无历史记录`}),Q>0&&(0,P.jsx)(ue,{currentPage:b,totalPages:be,onPageChange:S,pageSize:w,onPageSizeChange:e=>{E(e),S(1)},totalItems:Q})]})]}),z&&(0,P.jsx)(pe,{open:!0,planId:z,templateName:`待确认计划`,goal:`执行计划`,nodes:[],onApprove:()=>J.mutate(z),onReject:()=>Y.mutate(z),onClose:()=>B(null),loading:J.isPending||Y.isPending}),(0,P.jsx)(ce,{open:V.open,title:V.title,description:V.description,count:V.count,variant:`danger`,onConfirm:V.onConfirm,onCancel:()=>H({...V,open:!1})})]})}export{R as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{At as t,Cn as n,Et as r,Ft as ee,Gn as te,Ht as ne,In as i,Jn as re,Nt as ie,Pt as a,Qt as ae,Rn as o,Tt as s,Ut as oe,Vt as c,Wn as l,ar as u,er as se,gn as ce,jn as le,jt as ue,n as d,nr as de,qt as fe,vn as f,xn as p}from"./vendor-2ObLXPrQ.js";import{a as pe,n as m,r as h}from"./vendor-query-CjmRaY7o.js";import{d as me,f as he}from"./vendor-react-DZi7brq3.js";import{r as g}from"./vendor-motion-BryL_tAt.js";import{Dt as ge,Et as _e,F as ve,I as ye,Kt as be,L as xe,ft as Se,k as Ce,ut as we,w as Te}from"./client-C_VWY70M.js";import{a as Ee,c as De,l as _,n as v,r as y,t as b}from"./ui-DpI1N3yJ.js";import{n as x}from"./Toast-CrwuIbKC.js";import{t as Oe}from"./Pagination-CR-eJz36.js";import{t as ke}from"./Breadcrumb-C1Mua6se.js";var S=e(u(),1),C=g(),w={spec:{label:`规格`,icon:p,color:`text-blue-600`,bg:`bg-blue-50`,border:`border-blue-200`},security:{label:`安全`,icon:c,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-200`},quality:{label:`质量`,icon:n,color:`text-purple-600`,bg:`bg-purple-50`,border:`border-purple-200`},test:{label:`测试`,icon:a,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`}},T={fail:{label:`失败`,icon:i,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-300`},warn:{label:`警告`,icon:t,color:`text-yellow-600`,bg:`bg-yellow-50`,border:`border-yellow-300`},pass:{label:`通过`,icon:o,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-300`}};function Ae({level:e}){let t=T[e];if(!t)return(0,C.jsx)(b,{size:`sm`,children:e});let n=t.icon;return(0,C.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,C.jsx)(n,{className:`h-3 w-3`}),t.label]})}function je({category:e}){let t=w[e];if(!t)return(0,C.jsx)(b,{size:`sm`,children:e});let n=t.icon;return(0,C.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,C.jsx)(n,{className:`h-3 w-3`}),t.label]})}function E(){let{encodedPath:e}=he(),n=me(),i=pe(),[a,o]=(0,S.useState)(`sessions`),[c,u]=(0,S.useState)(!1),[g,w]=(0,S.useState)(``),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(``),[k,A]=(0,S.useState)(null),[j,M]=(0,S.useState)(1),[N,P]=(0,S.useState)(20),[F,I]=(0,S.useState)(null),Me=async e=>{try{let t=await Se(e);await navigator.clipboard.writeText(t.data.context),I(e),x(`上下文已复制,请粘贴到 Claude Code 进行修复`,`success`),setTimeout(()=>I(null),3e3)}catch{x(`复制失败`,`error`)}},L=e?encodeURIComponent(e):``,{data:R,isLoading:Ne,isError:Pe,error:Fe}=h({queryKey:[`project`,e],queryFn:()=>we(L).then(e=>e.data),enabled:!!e}),{data:z}=h({queryKey:[`claudemd`,e],queryFn:()=>ve(L).then(e=>e.data),enabled:!!e&&a===`claudemd`}),{data:B}=h({queryKey:[`claudemd-modules`,e],queryFn:()=>ye(L).then(e=>e.data),enabled:!!e&&a===`claudemd`}),Ie=m({mutationFn:()=>Te(L),onSuccess:()=>{i.invalidateQueries({queryKey:[`projects`]}),n(`/projects`)},onError:e=>x(e.message||`删除失败`,`error`)}),Le=m({mutationFn:e=>be(L,e),onSuccess:()=>{i.invalidateQueries({queryKey:[`claudemd`,e]}),E(!1)},onError:e=>x(e.message||`保存失败`,`error`)}),V=m({mutationFn:()=>Ce(L),onSuccess:t=>{i.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})}}),[H,U]=(0,S.useState)(null),[W,G]=(0,S.useState)(!1),[K,q]=(0,S.useState)(!1),[J,Y]=(0,S.useState)(null),[X,Z]=(0,S.useState)(!1),[Q,$]=(0,S.useState)(null);return Pe?(0,C.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,Fe?.message||`未知错误`]}):Ne||!R?(0,C.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,C.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})}):(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsx)(ke,{items:[{label:`项目列表`,path:`/projects`},{label:R.projectName}]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,C.jsx)(v,{variant:`ghost`,size:`sm`,icon:se,onClick:()=>n(`/projects`),children:`返回`}),(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50`,children:(0,C.jsx)(f,{className:`h-5 w-5 text-blue-600`})}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:R.projectName}),(0,C.jsx)(`p`,{className:`text-sm text-gray-500`,children:R.projectPath})]})]})]}),(0,C.jsx)(v,{variant:`danger`,size:`sm`,icon:ie,onClick:()=>u(!0),children:`删除项目`})]}),c&&(0,C.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,C.jsxs)(y,{className:`max-w-md`,children:[(0,C.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,C.jsx)(t,{className:`h-5 w-5`}),`危险操作:删除项目`]}),(0,C.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,C.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除项目 `,(0,C.jsx)(`strong`,{children:R.projectName}),` 的所有监控数据:`]}),(0,C.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,C.jsx)(`li`,{children:`所有会话记录`}),(0,C.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,C.jsx)(`li`,{children:`所有质量问题记录`}),(0,C.jsx)(`li`,{children:`所有事件日志`}),(0,C.jsx)(`li`,{children:`所有知识节点`})]}),(0,C.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,C.jsxs)(`div`,{className:`mb-4`,children:[(0,C.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入项目名称 `,(0,C.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:R.projectName}),` 以确认删除:`]}),(0,C.jsx)(`input`,{type:`text`,value:g,onChange:e=>w(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,C.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,C.jsx)(v,{variant:`ghost`,size:`sm`,onClick:()=>{u(!1),w(``)},children:`取消`}),(0,C.jsx)(v,{variant:`danger`,size:`sm`,disabled:g!==R.projectName,onClick:()=>{g===R.projectName&&(Ie.mutate(),u(!1),w(``))},children:`确认删除`})]})]})}),(0,C.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,C.jsx)(y,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>o(`sessions`),children:(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(de,{className:`h-8 w-8 text-blue-500`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:R.sessions.total}),(0,C.jsx)(`p`,{className:`text-sm text-gray-500`,children:`会话`})]})]})}),(0,C.jsx)(y,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>o(`pipelines`),children:(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(ce,{className:`h-8 w-8 text-green-500`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:R.pipelines.total}),(0,C.jsx)(`p`,{className:`text-sm text-gray-500`,children:`Pipeline`})]})]})}),(0,C.jsx)(y,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>o(`api`),children:(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(ee,{className:`h-8 w-8 text-purple-500`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:R.events.total}),(0,C.jsx)(`p`,{className:`text-sm text-gray-500`,children:`事件`})]})]})}),(0,C.jsx)(y,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>o(`quality`),children:(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(ne,{className:`h-8 w-8 text-orange-500`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:R.quality.total}),(0,C.jsx)(`p`,{className:`text-sm text-gray-500`,children:`质量`})]})]})}),(0,C.jsx)(y,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>o(`knowledge`),children:(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(re,{className:`h-8 w-8 text-pink-500`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:R.knowledge.total}),(0,C.jsx)(`p`,{className:`text-sm text-gray-500`,children:`知识`})]})]})})]}),(0,C.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,C.jsx)(`button`,{onClick:()=>o(e.key),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${a===e.key?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`}`,children:e.label},e.key))}),a===`sessions`&&(0,C.jsxs)(y,{children:[(0,C.jsx)(`div`,{className:`overflow-x-auto`,children:(0,C.jsxs)(`table`,{className:`w-full`,children:[(0,C.jsx)(`thead`,{children:(0,C.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`会话 ID`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`首条对话`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`开始时间`})]})}),(0,C.jsx)(`tbody`,{className:`text-sm`,children:(()=>{let e=R.sessions.items;return Math.ceil(e.length/N),(0,C.jsxs)(C.Fragment,{children:[e.slice((j-1)*N,j*N).map(e=>(0,C.jsxs)(`tr`,{onClick:()=>n(`/sessions/${e.session_id}`,{state:{from:`/projects/${L}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,C.jsx)(`td`,{className:`py-3 font-mono text-xs`,children:e.session_id.slice(0,12)}),(0,C.jsx)(`td`,{className:`py-3 text-gray-700 max-w-md truncate`,title:e.first_requirement,children:e.first_requirement?e.first_requirement:`(无对话记录)`}),(0,C.jsx)(`td`,{className:`py-3`,children:(0,C.jsx)(b,{size:`sm`,className:De(e.status),children:e.status})}),(0,C.jsx)(`td`,{className:`py-3 text-gray-500`,children:d(_(e.start_time),`MM-dd HH:mm`)})]},e.session_id)),e.length===0&&(0,C.jsx)(`tr`,{children:(0,C.jsx)(`td`,{colSpan:4,className:`py-8 text-center text-gray-400`,children:`暂无会话记录`})})]})})()})]})}),(()=>{let e=R.sessions.items,t=Math.ceil(e.length/N);return e.length>N?(0,C.jsx)(`div`,{className:`mt-4`,children:(0,C.jsx)(Oe,{currentPage:j,totalPages:t,onPageChange:M,pageSize:N,onPageSizeChange:e=>{P(e),M(1)},totalItems:e.length})}):null})()]}),a===`pipelines`&&(0,C.jsx)(y,{children:(0,C.jsx)(`div`,{className:`overflow-x-auto`,children:(0,C.jsxs)(`table`,{className:`w-full`,children:[(0,C.jsx)(`thead`,{children:(0,C.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`需求`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`阶段`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`})]})}),(0,C.jsx)(`tbody`,{className:`text-sm`,children:R.pipelines.items.map(e=>(0,C.jsxs)(`tr`,{onClick:()=>n(`/pipelines/${e.id}`,{state:{from:`/projects/${L}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,C.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.requirement}),(0,C.jsx)(`td`,{className:`py-3`,children:(0,C.jsx)(b,{size:`sm`,children:e.phase})}),(0,C.jsx)(`td`,{className:`py-3 text-gray-500`,children:d(_(e.updated_at),`MM-dd HH:mm`)})]},e.id))})]})})}),a===`quality`&&(0,C.jsxs)(y,{children:[(0,C.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,C.jsxs)(`p`,{className:`text-sm text-gray-600`,children:[`共 `,R.quality.total,` 个质量问题`]})}),(0,C.jsx)(`div`,{className:`overflow-x-auto`,children:(0,C.jsxs)(`table`,{className:`w-full`,children:[(0,C.jsx)(`thead`,{children:(0,C.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`问题`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`级别`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`分类`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,C.jsx)(`th`,{className:`pb-3 font-medium`})]})}),(0,C.jsx)(`tbody`,{className:`text-sm`,children:R.quality.items.map(e=>(0,C.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-blue-50 transition-colors`,children:[(0,C.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.message}),(0,C.jsx)(`td`,{className:`py-3`,children:(0,C.jsx)(Ae,{level:e.level})}),(0,C.jsx)(`td`,{className:`py-3`,children:(0,C.jsx)(je,{category:e.category})}),(0,C.jsx)(`td`,{className:`py-3`,children:(0,C.jsx)(b,{size:`sm`,variant:e.resolved?`success`:`default`,children:e.resolved?`已解决`:`未解决`})}),(0,C.jsx)(`td`,{className:`py-3 text-gray-500`,children:d(_(e.created_at),`MM-dd HH:mm`)}),(0,C.jsx)(`td`,{className:`py-3`,children:!e.resolved&&(0,C.jsxs)(`button`,{onClick:()=>Me(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:[F===e.id?(0,C.jsx)(te,{className:`h-3.5 w-3.5 text-green-500`}):(0,C.jsx)(le,{className:`h-3.5 w-3.5`}),F===e.id?`已复制`:`复制`]})})]},e.id))})]})})]}),a===`knowledge`&&(0,C.jsx)(y,{children:(0,C.jsx)(`div`,{className:`space-y-3`,children:R.knowledge.items.map(e=>(0,C.jsx)(`div`,{className:`p-4 border border-gray-100 rounded-lg hover:bg-blue-50 cursor-pointer transition-colors`,children:(0,C.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,C.jsx)(p,{className:`h-5 w-5 text-blue-500 flex-shrink-0 mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,C.jsx)(`h4`,{className:`font-medium text-gray-900 mb-1`,children:e.title}),(0,C.jsxs)(`p`,{className:`text-sm text-gray-600 line-clamp-2`,children:[e.content?.substring(0,150),`...`]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-gray-400`,children:[(0,C.jsx)(b,{size:`sm`,children:e.node_type}),(0,C.jsxs)(`span`,{children:[`更新于 `,d(_(e.updated_at),`MM-dd HH:mm`)]})]})]})]})},e.id))})}),a===`rules`&&(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsx)(y,{title:`意图识别规则`,children:(0,C.jsx)(`div`,{className:`space-y-2`,children:R.rules.intentRules.slice(0,10).map(e=>(0,C.jsx)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:(0,C.jsxs)(`div`,{className:`flex-1`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(b,{size:`sm`,children:e.rule_type}),(0,C.jsx)(`code`,{className:`text-xs text-gray-600`,children:e.pattern})]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-3 mt-1 text-xs text-gray-400`,children:[(0,C.jsxs)(`span`,{children:[`命中 `,e.hit_count,` 次`]}),(0,C.jsxs)(`span`,{children:[`置信度 `,(e.confidence*100).toFixed(0),`%`]})]})]})},e.id))})}),(0,C.jsx)(y,{title:`任务模式`,children:(0,C.jsx)(`div`,{className:`space-y-2`,children:R.rules.taskPatterns.slice(0,10).map(e=>(0,C.jsxs)(`div`,{className:`p-3 border border-gray-100 rounded-lg`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,C.jsx)(b,{size:`sm`,children:e.task_type}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-500`,children:[(0,C.jsx)(ue,{className:`h-3 w-3`}),(0,C.jsxs)(`span`,{children:[`效果 `,(e.effectiveness_score*100).toFixed(0),`%`]})]})]}),(0,C.jsx)(`p`,{className:`text-sm text-gray-600 mb-1`,children:e.failure_pattern}),(0,C.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[`策略:`,e.prevention_strategy]})]},e.id))})})]}),a===`claudemd`&&(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsx)(y,{children:(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(p,{className:`h-5 w-5 text-blue-500`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium text-gray-900`,children:`CLAUDE.md`}),(0,C.jsx)(`p`,{className:`text-xs text-gray-500`,children:z?.exists?`${(z.size/1024).toFixed(1)} KB · ${z.hasAutoSection?`含自动区块`:`纯用户内容`}`:`文件不存在`})]})]}),(0,C.jsxs)(`div`,{className:`flex gap-2`,children:[(0,C.jsx)(v,{variant:`ghost`,size:`sm`,icon:fe,onClick:()=>i.invalidateQueries({queryKey:[`claudemd`,e]}),children:`刷新`}),z?.exists&&(0,C.jsx)(v,{variant:`secondary`,size:`sm`,icon:s,onClick:()=>{A(null),V.mutate()},disabled:V.isPending,title:`AI 蒸馏:压缩冗余内容,保留核心规范`,children:V.isPending?`蒸馏中...`:`蒸馏`}),z?.exists&&!T&&(0,C.jsx)(v,{size:`sm`,icon:ae,onClick:()=>{O(z.content||``),E(!0)},children:`编辑`})]})]})}),k&&(0,C.jsx)(y,{children:(0,C.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,C.jsx)(`p`,{className:`text-sm ${k.success?`text-gray-900`:`text-red-600`}`,children:k.message}),(0,C.jsx)(v,{variant:`ghost`,size:`sm`,icon:r,onClick:()=>A(null)})]})}),T&&(0,C.jsxs)(y,{children:[(0,C.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,C.jsxs)(`div`,{className:`flex gap-2 justify-end mt-3`,children:[(0,C.jsx)(v,{variant:`ghost`,size:`sm`,icon:r,onClick:()=>E(!1),children:`取消`}),(0,C.jsx)(v,{size:`sm`,icon:l,onClick:()=>Le.mutate(D),children:`保存`})]})]}),!T&&z?.exists&&(0,C.jsx)(y,{title:`内容预览`,children:(0,C.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:z.content})}),(0,C.jsx)(y,{title:`子模块 (${B?.total??0})`,children:B?.items.length===0?(0,C.jsx)(`p`,{className:`text-sm text-gray-400`,children:`未检测到子模块`}):(0,C.jsx)(`div`,{className:`space-y-2`,children:B?.items.map(e=>(0,C.jsxs)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(f,{className:`h-4 w-4 text-gray-400`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,C.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.relativePath})]})]}),(0,C.jsx)(b,{size:`sm`,variant:e.hasClaudeMd?`success`:`default`,children:e.hasClaudeMd?`已有 CLAUDE.md`:`未生成`})]},e.path))})})]}),a===`environment`&&(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsx)(y,{children:(0,C.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium text-gray-900 mb-1`,children:`环境检测 & 项目初始化`}),(0,C.jsx)(`p`,{className:`text-sm text-gray-500`,children:`检测项目技术栈、创建 .claude-forge 目录、自动生成 CLAUDE.md(如不存在)`})]}),(0,C.jsxs)(`div`,{className:`flex gap-2 flex-shrink-0`,children:[(0,C.jsx)(v,{variant:`secondary`,size:`sm`,icon:oe,onClick:async()=>{G(!0),U(null);try{U((await xe(L)).data.profile)}catch(e){U({error:String(e)})}finally{G(!1)}},disabled:W,children:W?`检测中...`:`环境检测`}),(0,C.jsx)(v,{size:`sm`,icon:s,onClick:async()=>{q(!0),Y(null);try{let t=await ge(L);Y({success:t.data.success,message:t.data.message,claudeMdGenerated:t.data.claudeMdGenerated}),U(t.data.profile),i.invalidateQueries({queryKey:[`claudemd`,e]}),i.invalidateQueries({queryKey:[`project`,e]})}catch(e){Y({success:!1,message:String(e)})}finally{q(!1)}},disabled:K,children:K?`初始化中...`:`一键初始化`}),(0,C.jsx)(v,{size:`sm`,icon:p,onClick:async()=>{Z(!0),$(null);try{let t=await _e(L);$({success:t.data.success,message:t.data.message}),t.data.skipped||(i.invalidateQueries({queryKey:[`conventions`,e]}),i.invalidateQueries({queryKey:[`claudemd`,e]}))}catch(e){$({success:!1,message:String(e)})}finally{Z(!1)}},disabled:X,children:X?`生成中...`:`初始化规范`})]})]})}),J&&(0,C.jsx)(y,{children:(0,C.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,C.jsxs)(`div`,{className:`flex items-start gap-2`,children:[J.success?(0,C.jsx)(l,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,C.jsx)(r,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-sm font-medium ${J.success?`text-gray-900`:`text-red-600`}`,children:J.message}),J.claudeMdGenerated&&(0,C.jsx)(`p`,{className:`text-xs text-green-600 mt-0.5`,children:`CLAUDE.md 已自动生成`})]})]}),(0,C.jsx)(v,{variant:`ghost`,size:`sm`,icon:r,onClick:()=>Y(null)})]})}),Q&&(0,C.jsx)(y,{children:(0,C.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,C.jsxs)(`div`,{className:`flex items-start gap-2`,children:[Q.success?(0,C.jsx)(l,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,C.jsx)(r,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,C.jsx)(`p`,{className:Ee(`text-sm font-medium`,Q.success?`text-gray-900`:`text-red-600`),children:Q.message})]}),(0,C.jsx)(v,{variant:`ghost`,size:`sm`,icon:r,onClick:()=>$(null)})]})}),H&&!(`error`in H)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(y,{title:`技术栈`,children:(0,C.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`项目名称`}),(0,C.jsx)(`p`,{className:`font-medium text-gray-900`,children:H.projectName})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`包管理器`}),(0,C.jsx)(`p`,{className:`font-medium text-gray-900`,children:H.packageManager||`未检测到`})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`测试框架`}),(0,C.jsx)(`p`,{className:`font-medium text-gray-900`,children:H.testFramework||`未检测到`})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`构建工具`}),(0,C.jsx)(`p`,{className:`font-medium text-gray-900`,children:H.buildTool||`未检测到`})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Linter`}),(0,C.jsx)(`p`,{className:`font-medium text-gray-900`,children:H.linter||`未检测到`})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Formatter`}),(0,C.jsx)(`p`,{className:`font-medium text-gray-900`,children:H.formatter||`未检测到`})]})]})}),H.languages.length>0&&(0,C.jsx)(y,{title:`检测到的语言`,children:(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:H.languages.map((e,t)=>(0,C.jsxs)(b,{size:`sm`,children:[e.name,e.version?` ${e.version}`:``]},t))})}),H.frameworks.length>0&&(0,C.jsx)(y,{title:`检测到的框架`,children:(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:H.frameworks.map((e,t)=>(0,C.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-blue-50 rounded-md`,children:[(0,C.jsx)(`span`,{className:`text-sm font-medium text-blue-700`,children:e.name}),(0,C.jsx)(`span`,{className:`text-xs text-blue-400`,children:e.category})]},t))})}),Object.keys(H.scripts).length>0&&(0,C.jsx)(y,{title:`常用脚本`,children:(0,C.jsx)(`div`,{className:`space-y-1`,children:Object.entries(H.scripts).map(([e,t])=>(0,C.jsxs)(`div`,{className:`flex items-start gap-3 text-sm py-1 border-b border-gray-50 last:border-0`,children:[(0,C.jsx)(`span`,{className:`font-mono text-blue-600 flex-shrink-0 w-24`,children:e}),(0,C.jsx)(`span`,{className:`text-gray-600 font-mono text-xs break-all`,children:t})]},e))})}),H.keyDirectories.length>0&&(0,C.jsx)(y,{title:`关键目录`,children:(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:H.keyDirectories.map((e,t)=>(0,C.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-gray-50 rounded-md`,children:[(0,C.jsx)(f,{className:`h-3.5 w-3.5 text-gray-400`}),(0,C.jsx)(`span`,{className:`text-sm text-gray-700 font-mono`,children:e})]},t))})})]}),H&&`error`in H&&(0,C.jsx)(y,{children:(0,C.jsxs)(`p`,{className:`text-sm text-red-600`,children:[`检测失败:`,H.error]})})]})]})}export{E as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Dn as t,Et as n,Ht as ee,It as te,Jn as r,Lt as ne,Nt as i,Pn as re,Qn as a,Ut as o,Wt as s,ar as c,gn as ie,n as ae,nr as l,tr as u,vn as d,zt as f}from"./vendor-2ObLXPrQ.js";import{a as p,n as oe,r as m}from"./vendor-query-CjmRaY7o.js";import{d as h}from"./vendor-react-DZi7brq3.js";import{r as g,t as se}from"./vendor-motion-BryL_tAt.js";import{dt as ce,r as _,w as v}from"./client-C_VWY70M.js";import{a as y,l as b,r as x,t as S}from"./ui-DpI1N3yJ.js";import{n as C}from"./Toast-CrwuIbKC.js";import{t as w}from"./exportCsv-CO51kx6P.js";import{t as T}from"./Pagination-CR-eJz36.js";var E=e(c(),1),D=g();function O(){let e=h(),c=p(),[g,O]=(0,E.useState)(``),[k,A]=(0,E.useState)(1),[j,le]=(0,E.useState)(12),[M,N]=(0,E.useState)(`lastActivity`),[P,F]=(0,E.useState)(!1),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(null),[B,V]=(0,E.useState)(``),[H,U]=(0,E.useState)(``),[W,G]=(0,E.useState)(new Set),[ue,K]=(0,E.useState)(!1),[q,J]=(0,E.useState)(``),[Y,X]=(0,E.useState)(!1),{data:de}=m({queryKey:[`project-meta-all`],queryFn:()=>_.get(`/projects/meta/all`).then(e=>e.data),staleTime:3e4}),Z=de||{},Q=oe({mutationFn:({projectPath:e,meta:t})=>_.put(`/projects/${encodeURIComponent(e)}/meta`,t),onSuccess:()=>{c.invalidateQueries({queryKey:[`project-meta-all`]})},onError:e=>C(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}})}C(`已归档 ${W.size} 个项目`,`success`),G(new Set)},_e=async()=>{X(!0);let e=0;for(let t of W)try{await v(encodeURIComponent(t)),e++}catch{}X(!1),K(!1),J(``),G(new Set),c.invalidateQueries({queryKey:[`projects`]}),C(`已删除 ${e} 个项目`,`success`)},{data:ve,isLoading:ye}=m({queryKey:[`projects`],queryFn:()=>ce({limit:1e3}).then(e=>e.data)});if(ye)return(0,D.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,D.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let be=ve?.items||[],xe=e=>{M===e?F(e=>!e):(N(e),F(!1)),A(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 M===`name`?n=e.projectName.localeCompare(t.projectName):M===`lastActivity`?n=(e.lastActivity||``).localeCompare(t.lastActivity||``):M===`sessionCount`?n=e.sessionCount-t.sessionCount:M===`totalEvents`&&(n=e.totalEvents-t.totalEvents),P?n:-n}),Se=Math.ceil($.length/j),Ce=$.slice((k-1)*j,k*j);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`,{children:[(0,D.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`项目管理`}),(0,D.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`查看所有被 Forge 管理的项目`})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-3`,children:W.size>0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(S,{variant:`info`,children:[W.size,` 个已选`]}),(0,D.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,D.jsx)(u,{className:`h-4 w-4`}),`批量归档`]}),(0,D.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,D.jsx)(i,{className:`h-4 w-4`}),`批量删除`]}),(0,D.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,D.jsx)(n,{className:`h-4 w-4`}),`取消选择`]})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(S,{variant:`info`,children:[$.length,` 个项目`]}),(0,D.jsxs)(`button`,{onClick:()=>L(!I),className:y(`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,D.jsx)(u,{className:`h-4 w-4`}),I?`隐藏归档`:`显示归档`]}),(0,D.jsxs)(`button`,{onClick:()=>{let e=[`项目名称`,`项目路径`,`会话数`,`Pipeline 数`,`质量问题数`,`总事件数`,`最近活动`],t=$.map(e=>[e.projectName,e.projectPath,e.sessionCount,e.pipelineCount,e.qualityIssueCount,e.totalEvents,e.lastActivity||``]);w(`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,D.jsx)(t,{className:`h-4 w-4`}),`导出 CSV`]})]})})]}),(0,D.jsx)(x,{children:(0,D.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,D.jsxs)(`div`,{className:`relative flex-1`,children:[(0,D.jsx)(s,{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:g,onChange:e=>{O(e.target.value),A(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,D.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,D.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,D.jsxs)(`button`,{onClick:()=>xe(e),className:y(`px-3 py-1.5 rounded-lg transition-colors flex items-center gap-1`,M===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:[t,M===e&&(0,D.jsx)(a,{className:y(`h-3 w-3`,P&&`rotate-180`)})]},e))]})]})}),(0,D.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Ce.map((t,n)=>{let i=t.projectPath,a=Z[i]||{notes:``,tags:[],archived:!1};return(0,D.jsx)(se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.03},children:(0,D.jsx)(x,{className:y(`!p-0 overflow-hidden cursor-pointer hover:shadow-md transition-shadow h-full flex flex-col`,a.archived&&`opacity-60`),onClick:()=>e(`/projects/${encodeURIComponent(i)}`),children:(0,D.jsxs)(`div`,{className:`p-4 flex-1 flex flex-col`,children:[(0,D.jsxs)(`div`,{className:`flex items-start gap-3 mb-3`,children:[(0,D.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50 flex-shrink-0`,children:(0,D.jsx)(d,{className:`h-5 w-5 text-blue-600`})}),(0,D.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,D.jsx)(`h3`,{className:`font-semibold text-gray-900 truncate`,children:t.projectName}),a.archived&&(0,D.jsx)(u,{className:`h-3.5 w-3.5 text-gray-400 flex-shrink-0`})]}),(0,D.jsx)(`p`,{className:`text-xs text-gray-500 truncate`,children:i}),a.tags.length>0&&(0,D.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:a.tags.map(e=>(0,D.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,D.jsx)(te,{className:`h-2.5 w-2.5`}),e]},e))}),a.notes&&(0,D.jsx)(`p`,{className:`text-xs text-gray-400 mt-1 truncate`,children:a.notes})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[(0,D.jsx)(`button`,{onClick:e=>he(i,e),className:y(`p-1 rounded transition-colors`,W.has(i)?`text-blue-600`:`text-gray-300 hover:text-gray-500`),title:`选择`,children:W.has(i)?(0,D.jsx)(f,{className:`h-3.5 w-3.5`}):(0,D.jsx)(ne,{className:`h-3.5 w-3.5`})}),(0,D.jsx)(`button`,{onClick:e=>me(i,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:a.archived?`取消归档`:`归档`,children:(0,D.jsx)(u,{className:`h-3.5 w-3.5`})}),(0,D.jsx)(`button`,{onClick:e=>fe(i,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:`项目设置`,children:(0,D.jsx)(o,{className:`h-3.5 w-3.5`})})]})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-sm flex-1`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,D.jsx)(l,{className:`h-4 w-4 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[t.sessionCount,` 会话`]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,D.jsx)(ie,{className:`h-4 w-4 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[t.pipelineCount,` Pipeline`]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,D.jsx)(ee,{className:`h-4 w-4 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[t.qualityIssueCount,` 质量`]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,D.jsx)(r,{className:`h-4 w-4 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[t.totalEvents,` 事件`]})]})]}),t.lastActivity&&(0,D.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-gray-400 mt-3 pt-3 border-t border-gray-100`,children:[(0,D.jsx)(re,{className:`h-3 w-3 flex-shrink-0`}),(0,D.jsxs)(`span`,{children:[`最近活动:`,ae(b(t.lastActivity),`MM-dd HH:mm`)]})]})]})})},i)})}),$.length===0&&(0,D.jsxs)(`div`,{className:`text-center py-12`,children:[(0,D.jsx)(d,{className:`h-12 w-12 text-gray-300 mx-auto mb-3`}),(0,D.jsx)(`p`,{className:`text-gray-500`,children:`暂无项目`}),(0,D.jsx)(`p`,{className:`text-sm text-gray-400 mt-1`,children:`在任意目录使用 Claude Code 后,项目将自动出现在这里`})]}),$.length>0&&(0,D.jsx)(T,{currentPage:k,totalPages:Se,onPageChange:A,pageSize:j,onPageSizeChange:e=>{le(e),A(1)},totalItems:$.length}),ue&&(0,D.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:()=>{K(!1),J(``)},children:(0,D.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,D.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,D.jsx)(i,{className:`h-5 w-5`}),`危险操作:批量删除项目`]}),(0,D.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,D.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除 `,(0,D.jsxs)(`strong`,{children:[W.size,` 个项目`]}),` 的所有监控数据:`]}),(0,D.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,D.jsx)(`li`,{children:`所有会话记录`}),(0,D.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,D.jsx)(`li`,{children:`所有质量问题记录`}),(0,D.jsx)(`li`,{children:`所有事件日志`}),(0,D.jsx)(`li`,{children:`所有知识节点`})]}),(0,D.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,D.jsxs)(`div`,{className:`mb-4`,children:[(0,D.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入 `,(0,D.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:`删除`}),` 以确认批量删除:`]}),(0,D.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,D.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,D.jsx)(`button`,{onClick:()=>{K(!1),J(``)},className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,D.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,D.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,onClick:()=>z(null),children:(0,D.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,D.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`项目设置`}),(0,D.jsx)(`button`,{onClick:()=>z(null),className:`text-gray-400 hover:text-gray-600`,children:(0,D.jsx)(n,{className:`h-5 w-5`})})]}),(0,D.jsx)(`p`,{className:`text-xs text-gray-500 mb-4 truncate`,children:R}),(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,D.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,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`备注`}),(0,D.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,D.jsxs)(`div`,{className:`flex justify-end gap-2 mt-5`,children:[(0,D.jsx)(`button`,{onClick:()=>z(null),className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,D.jsx)(`button`,{onClick:pe,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700`,children:`保存`})]})]})})]})}export{O as default};