@winspan/claude-forge 9.2.0 → 9.12.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 (591) hide show
  1. package/DEVELOPMENT.md +80 -19
  2. package/README.md +13 -6
  3. package/dist/catalogs/agents.json +19 -24
  4. package/dist/catalogs/skills.json +139 -27
  5. package/dist/claudemd/templates/swarm-protocol.md +1 -1
  6. package/dist/cli/commands/agent.d.ts +169 -0
  7. package/dist/cli/commands/agent.d.ts.map +1 -0
  8. package/dist/cli/commands/agent.js +690 -0
  9. package/dist/cli/commands/agent.js.map +1 -0
  10. package/dist/cli/commands/codegraph.d.ts +17 -0
  11. package/dist/cli/commands/codegraph.d.ts.map +1 -0
  12. package/dist/cli/commands/codegraph.js +263 -0
  13. package/dist/cli/commands/codegraph.js.map +1 -0
  14. package/dist/cli/commands/decisions.d.ts.map +1 -1
  15. package/dist/cli/commands/decisions.js +46 -9
  16. package/dist/cli/commands/decisions.js.map +1 -1
  17. package/dist/cli/commands/executions.d.ts.map +1 -1
  18. package/dist/cli/commands/executions.js +2 -1
  19. package/dist/cli/commands/executions.js.map +1 -1
  20. package/dist/cli/commands/insights-goal-check.d.ts +5 -1
  21. package/dist/cli/commands/insights-goal-check.d.ts.map +1 -1
  22. package/dist/cli/commands/insights-goal-check.js +15 -15
  23. package/dist/cli/commands/insights-goal-check.js.map +1 -1
  24. package/dist/cli/commands/knowledge.d.ts +51 -0
  25. package/dist/cli/commands/knowledge.d.ts.map +1 -1
  26. package/dist/cli/commands/knowledge.js +202 -29
  27. package/dist/cli/commands/knowledge.js.map +1 -1
  28. package/dist/cli/commands/loop.d.ts +95 -0
  29. package/dist/cli/commands/loop.d.ts.map +1 -0
  30. package/dist/cli/commands/loop.js +408 -0
  31. package/dist/cli/commands/loop.js.map +1 -0
  32. package/dist/cli/commands/maintenance.d.ts +33 -0
  33. package/dist/cli/commands/maintenance.d.ts.map +1 -0
  34. package/dist/cli/commands/maintenance.js +75 -0
  35. package/dist/cli/commands/maintenance.js.map +1 -0
  36. package/dist/cli/commands/mcp.d.ts +23 -0
  37. package/dist/cli/commands/mcp.d.ts.map +1 -1
  38. package/dist/cli/commands/mcp.js +82 -0
  39. package/dist/cli/commands/mcp.js.map +1 -1
  40. package/dist/cli/commands/skills.d.ts +131 -0
  41. package/dist/cli/commands/skills.d.ts.map +1 -1
  42. package/dist/cli/commands/skills.js +409 -9
  43. package/dist/cli/commands/skills.js.map +1 -1
  44. package/dist/cli/commands/stats.d.ts.map +1 -1
  45. package/dist/cli/commands/stats.js +9 -2
  46. package/dist/cli/commands/stats.js.map +1 -1
  47. package/dist/cli/index.js +8 -0
  48. package/dist/cli/index.js.map +1 -1
  49. package/dist/core/constants.d.ts +37 -0
  50. package/dist/core/constants.d.ts.map +1 -1
  51. package/dist/core/constants.js +43 -0
  52. package/dist/core/constants.js.map +1 -1
  53. package/dist/core/diagnostics/checks.d.ts.map +1 -1
  54. package/dist/core/diagnostics/checks.js +2 -1
  55. package/dist/core/diagnostics/checks.js.map +1 -1
  56. package/dist/core/diagnostics/daemon-status.d.ts +1 -1
  57. package/dist/core/diagnostics/daemon-status.d.ts.map +1 -1
  58. package/dist/core/diagnostics/daemon-status.js +1 -1
  59. package/dist/core/diagnostics/daemon-status.js.map +1 -1
  60. package/dist/core/diagnostics/entropy-checks.d.ts +3 -2
  61. package/dist/core/diagnostics/entropy-checks.d.ts.map +1 -1
  62. package/dist/core/diagnostics/entropy-checks.js +10 -5
  63. package/dist/core/diagnostics/entropy-checks.js.map +1 -1
  64. package/dist/core/diagnostics/heartbeat-reader.d.ts +28 -0
  65. package/dist/core/diagnostics/heartbeat-reader.d.ts.map +1 -0
  66. package/dist/core/diagnostics/heartbeat-reader.js +50 -0
  67. package/dist/core/diagnostics/heartbeat-reader.js.map +1 -0
  68. package/dist/core/event-fields.d.ts +27 -0
  69. package/dist/core/event-fields.d.ts.map +1 -1
  70. package/dist/core/event-fields.js +43 -0
  71. package/dist/core/event-fields.js.map +1 -1
  72. package/dist/core/governance/global-inject.d.ts +34 -4
  73. package/dist/core/governance/global-inject.d.ts.map +1 -1
  74. package/dist/core/governance/global-inject.js +80 -25
  75. package/dist/core/governance/global-inject.js.map +1 -1
  76. package/dist/core/insights/agent-anchor-guard.d.ts +77 -0
  77. package/dist/core/insights/agent-anchor-guard.d.ts.map +1 -0
  78. package/dist/core/insights/agent-anchor-guard.js +119 -0
  79. package/dist/core/insights/agent-anchor-guard.js.map +1 -0
  80. package/dist/core/insights/agent-distill-context.d.ts +55 -0
  81. package/dist/core/insights/agent-distill-context.d.ts.map +1 -0
  82. package/dist/core/insights/agent-distill-context.js +146 -0
  83. package/dist/core/insights/agent-distill-context.js.map +1 -0
  84. package/dist/core/insights/agent-distill-spawn.d.ts +56 -0
  85. package/dist/core/insights/agent-distill-spawn.d.ts.map +1 -0
  86. package/dist/core/insights/agent-distill-spawn.js +179 -0
  87. package/dist/core/insights/agent-distill-spawn.js.map +1 -0
  88. package/dist/core/insights/agent-drift.d.ts +66 -0
  89. package/dist/core/insights/agent-drift.d.ts.map +1 -0
  90. package/dist/core/insights/agent-drift.js +109 -0
  91. package/dist/core/insights/agent-drift.js.map +1 -0
  92. package/dist/core/insights/agent-evolution-sources.d.ts +21 -0
  93. package/dist/core/insights/agent-evolution-sources.d.ts.map +1 -0
  94. package/dist/core/insights/agent-evolution-sources.js +36 -0
  95. package/dist/core/insights/agent-evolution-sources.js.map +1 -0
  96. package/dist/core/insights/agent-health.d.ts +142 -0
  97. package/dist/core/insights/agent-health.d.ts.map +1 -0
  98. package/dist/core/insights/agent-health.js +296 -0
  99. package/dist/core/insights/agent-health.js.map +1 -0
  100. package/dist/core/insights/agent-patch-apply.d.ts +45 -0
  101. package/dist/core/insights/agent-patch-apply.d.ts.map +1 -0
  102. package/dist/core/insights/agent-patch-apply.js +165 -0
  103. package/dist/core/insights/agent-patch-apply.js.map +1 -0
  104. package/dist/core/insights/agent-suggest.d.ts +128 -0
  105. package/dist/core/insights/agent-suggest.d.ts.map +1 -0
  106. package/dist/core/insights/agent-suggest.js +284 -0
  107. package/dist/core/insights/agent-suggest.js.map +1 -0
  108. package/dist/core/insights/coverage-tiers.d.ts +46 -0
  109. package/dist/core/insights/coverage-tiers.d.ts.map +1 -0
  110. package/dist/core/insights/coverage-tiers.js +95 -0
  111. package/dist/core/insights/coverage-tiers.js.map +1 -0
  112. package/dist/{daemon/services → core/insights}/experience-extractor.d.ts +0 -7
  113. package/dist/core/insights/experience-extractor.d.ts.map +1 -0
  114. package/dist/{daemon/services → core/insights}/experience-extractor.js +5 -9
  115. package/dist/core/insights/experience-extractor.js.map +1 -0
  116. package/dist/{daemon/services → core/insights}/violation-reporter.d.ts +20 -1
  117. package/dist/core/insights/violation-reporter.d.ts.map +1 -0
  118. package/dist/{daemon/services → core/insights}/violation-reporter.js +56 -4
  119. package/dist/core/insights/violation-reporter.js.map +1 -0
  120. package/dist/core/loop/loop-engine.d.ts +140 -0
  121. package/dist/core/loop/loop-engine.d.ts.map +1 -0
  122. package/dist/core/loop/loop-engine.js +266 -0
  123. package/dist/core/loop/loop-engine.js.map +1 -0
  124. package/dist/core/queue/index.d.ts.map +1 -1
  125. package/dist/core/queue/index.js +2 -1
  126. package/dist/core/queue/index.js.map +1 -1
  127. package/dist/core/storage/base.d.ts +159 -0
  128. package/dist/core/storage/base.d.ts.map +1 -1
  129. package/dist/core/storage/base.js +523 -0
  130. package/dist/core/storage/base.js.map +1 -1
  131. package/dist/core/storage/codegraph-types.d.ts +79 -0
  132. package/dist/core/storage/codegraph-types.d.ts.map +1 -0
  133. package/dist/core/storage/codegraph-types.js +14 -0
  134. package/dist/core/storage/codegraph-types.js.map +1 -0
  135. package/dist/core/storage/codegraph.d.ts +186 -0
  136. package/dist/core/storage/codegraph.d.ts.map +1 -0
  137. package/dist/core/storage/codegraph.js +452 -0
  138. package/dist/core/storage/codegraph.js.map +1 -0
  139. package/dist/core/storage/decisions.d.ts +30 -5
  140. package/dist/core/storage/decisions.d.ts.map +1 -1
  141. package/dist/core/storage/decisions.js +45 -13
  142. package/dist/core/storage/decisions.js.map +1 -1
  143. package/dist/core/storage/events.d.ts +127 -0
  144. package/dist/core/storage/events.d.ts.map +1 -1
  145. package/dist/core/storage/events.js +318 -3
  146. package/dist/core/storage/events.js.map +1 -1
  147. package/dist/core/storage/feedback.d.ts +3 -23
  148. package/dist/core/storage/feedback.d.ts.map +1 -1
  149. package/dist/core/storage/feedback.js +37 -38
  150. package/dist/core/storage/feedback.js.map +1 -1
  151. package/dist/core/storage/injections.d.ts +40 -0
  152. package/dist/core/storage/injections.d.ts.map +1 -1
  153. package/dist/core/storage/injections.js +69 -0
  154. package/dist/core/storage/injections.js.map +1 -1
  155. package/dist/core/storage/knowledge.d.ts +226 -0
  156. package/dist/core/storage/knowledge.d.ts.map +1 -1
  157. package/dist/core/storage/knowledge.js +391 -4
  158. package/dist/core/storage/knowledge.js.map +1 -1
  159. package/dist/core/storage/pipeline-rollup.d.ts +1 -7
  160. package/dist/core/storage/pipeline-rollup.d.ts.map +1 -1
  161. package/dist/core/storage/pipeline-rollup.js +18 -57
  162. package/dist/core/storage/pipeline-rollup.js.map +1 -1
  163. package/dist/core/storage/routing.d.ts +34 -0
  164. package/dist/core/storage/routing.d.ts.map +1 -1
  165. package/dist/core/storage/routing.js +92 -2
  166. package/dist/core/storage/routing.js.map +1 -1
  167. package/dist/core/storage/rows.d.ts +5 -25
  168. package/dist/core/storage/rows.d.ts.map +1 -1
  169. package/dist/core/storage/schema.sql +92 -27
  170. package/dist/core/storage/sessions.d.ts.map +1 -1
  171. package/dist/core/storage/sessions.js +2 -1
  172. package/dist/core/storage/sessions.js.map +1 -1
  173. package/dist/core/storage/skills.d.ts +159 -0
  174. package/dist/core/storage/skills.d.ts.map +1 -1
  175. package/dist/core/storage/skills.js +350 -4
  176. package/dist/core/storage/skills.js.map +1 -1
  177. package/dist/core/storage/sqlite.d.ts +81 -25
  178. package/dist/core/storage/sqlite.d.ts.map +1 -1
  179. package/dist/core/storage/sqlite.js +143 -45
  180. package/dist/core/storage/sqlite.js.map +1 -1
  181. package/dist/core/storage/tasks.d.ts +270 -0
  182. package/dist/core/storage/tasks.d.ts.map +1 -1
  183. package/dist/core/storage/tasks.js +495 -16
  184. package/dist/core/storage/tasks.js.map +1 -1
  185. package/dist/core/storage/tool-intercepts.d.ts +1 -1
  186. package/dist/core/storage/tool-intercepts.js +1 -1
  187. package/dist/core/types.d.ts +26 -3
  188. package/dist/core/types.d.ts.map +1 -1
  189. package/dist/core/types.js +1 -3
  190. package/dist/core/types.js.map +1 -1
  191. package/dist/core/utils/binary-paths.d.ts +32 -0
  192. package/dist/core/utils/binary-paths.d.ts.map +1 -1
  193. package/dist/core/utils/binary-paths.js +52 -0
  194. package/dist/core/utils/binary-paths.js.map +1 -1
  195. package/dist/core/utils/claude-cli-resolver.d.ts.map +1 -0
  196. package/dist/{skills/distill → core/utils}/claude-cli-resolver.js +1 -1
  197. package/dist/core/utils/claude-cli-resolver.js.map +1 -0
  198. package/dist/core/utils/claude-cli-spawn.d.ts +1 -1
  199. package/dist/core/utils/claude-cli-spawn.js +2 -2
  200. package/dist/core/utils/claude-cli-spawn.js.map +1 -1
  201. package/dist/core/utils/noise-prompt.d.ts +1 -1
  202. package/dist/core/utils/noise-prompt.js +1 -1
  203. package/dist/core/utils/time.d.ts +26 -0
  204. package/dist/core/utils/time.d.ts.map +1 -1
  205. package/dist/core/utils/time.js +33 -0
  206. package/dist/core/utils/time.js.map +1 -1
  207. package/dist/daemon/config-store.d.ts.map +1 -1
  208. package/dist/daemon/config-store.js +14 -5
  209. package/dist/daemon/config-store.js.map +1 -1
  210. package/dist/daemon/event-parser.d.ts.map +1 -1
  211. package/dist/daemon/event-parser.js +5 -0
  212. package/dist/daemon/event-parser.js.map +1 -1
  213. package/dist/daemon/handlers/post-tool-use.d.ts +24 -16
  214. package/dist/daemon/handlers/post-tool-use.d.ts.map +1 -1
  215. package/dist/daemon/handlers/post-tool-use.js +76 -116
  216. package/dist/daemon/handlers/post-tool-use.js.map +1 -1
  217. package/dist/daemon/handlers/pre-tool-use.d.ts +35 -10
  218. package/dist/daemon/handlers/pre-tool-use.d.ts.map +1 -1
  219. package/dist/daemon/handlers/pre-tool-use.js +71 -38
  220. package/dist/daemon/handlers/pre-tool-use.js.map +1 -1
  221. package/dist/daemon/handlers/stop.d.ts +20 -0
  222. package/dist/daemon/handlers/stop.d.ts.map +1 -1
  223. package/dist/daemon/handlers/stop.js +96 -8
  224. package/dist/daemon/handlers/stop.js.map +1 -1
  225. package/dist/daemon/handlers/user-prompt.d.ts +16 -1
  226. package/dist/daemon/handlers/user-prompt.d.ts.map +1 -1
  227. package/dist/daemon/handlers/user-prompt.js +97 -56
  228. package/dist/daemon/handlers/user-prompt.js.map +1 -1
  229. package/dist/daemon/handlers/violation-content-backfill.d.ts +76 -0
  230. package/dist/daemon/handlers/violation-content-backfill.d.ts.map +1 -0
  231. package/dist/daemon/handlers/violation-content-backfill.js +167 -0
  232. package/dist/daemon/handlers/violation-content-backfill.js.map +1 -0
  233. package/dist/daemon/index.d.ts +19 -0
  234. package/dist/daemon/index.d.ts.map +1 -1
  235. package/dist/daemon/index.js +125 -200
  236. package/dist/daemon/index.js.map +1 -1
  237. package/dist/daemon/rules/defaults.d.ts.map +1 -1
  238. package/dist/daemon/rules/defaults.js +151 -64
  239. package/dist/daemon/rules/defaults.js.map +1 -1
  240. package/dist/daemon/rules/types.d.ts +28 -22
  241. package/dist/daemon/rules/types.d.ts.map +1 -1
  242. package/dist/daemon/rules/workflow-defaults.js +9 -9
  243. package/dist/daemon/rules/workflow-defaults.js.map +1 -1
  244. package/dist/daemon/services/codegraph-sync.d.ts +94 -0
  245. package/dist/daemon/services/codegraph-sync.d.ts.map +1 -0
  246. package/dist/daemon/services/codegraph-sync.js +159 -0
  247. package/dist/daemon/services/codegraph-sync.js.map +1 -0
  248. package/dist/daemon/services/decision-hint.d.ts +47 -10
  249. package/dist/daemon/services/decision-hint.d.ts.map +1 -1
  250. package/dist/daemon/services/decision-hint.js +99 -24
  251. package/dist/daemon/services/decision-hint.js.map +1 -1
  252. package/dist/daemon/services/event-ttl-sweep.d.ts.map +1 -1
  253. package/dist/daemon/services/event-ttl-sweep.js +3 -2
  254. package/dist/daemon/services/event-ttl-sweep.js.map +1 -1
  255. package/dist/daemon/services/feedback-aggregator.d.ts +14 -26
  256. package/dist/daemon/services/feedback-aggregator.d.ts.map +1 -1
  257. package/dist/daemon/services/feedback-aggregator.js +23 -63
  258. package/dist/daemon/services/feedback-aggregator.js.map +1 -1
  259. package/dist/daemon/services/heartbeat-writer.d.ts +6 -15
  260. package/dist/daemon/services/heartbeat-writer.d.ts.map +1 -1
  261. package/dist/daemon/services/heartbeat-writer.js +7 -36
  262. package/dist/daemon/services/heartbeat-writer.js.map +1 -1
  263. package/dist/daemon/services/kb-injector.d.ts +1 -1
  264. package/dist/daemon/services/kb-injector.d.ts.map +1 -1
  265. package/dist/daemon/services/kb-injector.js +10 -2
  266. package/dist/daemon/services/kb-injector.js.map +1 -1
  267. package/dist/daemon/services/kb-rebuild-scheduler.d.ts +95 -0
  268. package/dist/daemon/services/kb-rebuild-scheduler.d.ts.map +1 -0
  269. package/dist/daemon/services/kb-rebuild-scheduler.js +149 -0
  270. package/dist/daemon/services/kb-rebuild-scheduler.js.map +1 -0
  271. package/dist/daemon/services/loop-hint.d.ts +139 -0
  272. package/dist/daemon/services/loop-hint.d.ts.map +1 -0
  273. package/dist/daemon/services/loop-hint.js +272 -0
  274. package/dist/daemon/services/loop-hint.js.map +1 -0
  275. package/dist/daemon/services/outcome-classification-service.js +1 -1
  276. package/dist/daemon/services/outcome-classification-service.js.map +1 -1
  277. package/dist/daemon/services/task-segmenter.d.ts +11 -0
  278. package/dist/daemon/services/task-segmenter.d.ts.map +1 -1
  279. package/dist/daemon/services/task-segmenter.js +48 -2
  280. package/dist/daemon/services/task-segmenter.js.map +1 -1
  281. package/dist/daemon/startup/maintenance-schedulers.d.ts +68 -0
  282. package/dist/daemon/startup/maintenance-schedulers.d.ts.map +1 -0
  283. package/dist/daemon/startup/maintenance-schedulers.js +294 -0
  284. package/dist/daemon/startup/maintenance-schedulers.js.map +1 -0
  285. package/dist/daemon/templates/agents/agent-retro-distiller.md +106 -0
  286. package/dist/daemon/templates/agents/claudemd-writer.md +1 -0
  287. package/dist/daemon/templates/agents/coder.md +165 -8
  288. package/dist/daemon/templates/agents/decision-maker.md +107 -21
  289. package/dist/daemon/templates/agents/doc-reviewer.md +4 -1
  290. package/dist/daemon/templates/agents/harness-debug-full.md +85 -3
  291. package/dist/daemon/templates/agents/knowledge-builder.md +1 -0
  292. package/dist/daemon/templates/agents/patch-applier.md +1 -0
  293. package/dist/daemon/templates/agents/planner.md +55 -3
  294. package/dist/daemon/templates/agents/safety-net-implementer.md +278 -0
  295. package/dist/daemon/templates/agents/skill-distiller.md +1 -0
  296. package/dist/daemon/templates/agents/task-boundary-classifier.md +1 -0
  297. package/dist/daemon/templates/agents/verify-agent.md +128 -5
  298. package/dist/hooks/stop.sh +7 -1
  299. package/dist/knowledge/builder.js +36 -7
  300. package/dist/knowledge/builder.js.map +1 -1
  301. package/dist/knowledge/constants.d.ts +10 -5
  302. package/dist/knowledge/constants.d.ts.map +1 -1
  303. package/dist/knowledge/constants.js +10 -5
  304. package/dist/knowledge/constants.js.map +1 -1
  305. package/dist/knowledge/graph/edge-extractor.d.ts +45 -0
  306. package/dist/knowledge/graph/edge-extractor.d.ts.map +1 -0
  307. package/dist/knowledge/graph/edge-extractor.js +242 -0
  308. package/dist/knowledge/graph/edge-extractor.js.map +1 -0
  309. package/dist/knowledge/graph/impact.d.ts +73 -0
  310. package/dist/knowledge/graph/impact.d.ts.map +1 -0
  311. package/dist/knowledge/graph/impact.js +94 -0
  312. package/dist/knowledge/graph/impact.js.map +1 -0
  313. package/dist/knowledge/graph/types.d.ts +22 -0
  314. package/dist/knowledge/graph/types.d.ts.map +1 -0
  315. package/dist/knowledge/graph/types.js +13 -0
  316. package/dist/knowledge/graph/types.js.map +1 -0
  317. package/dist/knowledge/prompt.d.ts +9 -0
  318. package/dist/knowledge/prompt.d.ts.map +1 -1
  319. package/dist/knowledge/prompt.js +17 -5
  320. package/dist/knowledge/prompt.js.map +1 -1
  321. package/dist/knowledge/query.d.ts +13 -0
  322. package/dist/knowledge/query.d.ts.map +1 -1
  323. package/dist/knowledge/query.js +107 -10
  324. package/dist/knowledge/query.js.map +1 -1
  325. package/dist/knowledge/repo-map.d.ts +11 -5
  326. package/dist/knowledge/repo-map.d.ts.map +1 -1
  327. package/dist/knowledge/repo-map.js +42 -3
  328. package/dist/knowledge/repo-map.js.map +1 -1
  329. package/dist/knowledge/validator.d.ts.map +1 -1
  330. package/dist/knowledge/validator.js +69 -2
  331. package/dist/knowledge/validator.js.map +1 -1
  332. package/dist/mcp/server.d.ts +64 -8
  333. package/dist/mcp/server.d.ts.map +1 -1
  334. package/dist/mcp/server.js +233 -18
  335. package/dist/mcp/server.js.map +1 -1
  336. package/dist/skills/distill/distiller.js +1 -1
  337. package/dist/skills/distill/distiller.js.map +1 -1
  338. package/dist/skills/distilled/distilled-api-design.md +4 -0
  339. package/dist/skills/distilled/distilled-brainstorming.md +79 -0
  340. package/dist/skills/distilled/distilled-brand-guidelines.md +86 -0
  341. package/dist/skills/distilled/distilled-canvas-design.md +128 -0
  342. package/dist/skills/distilled/distilled-claude-api.md +185 -0
  343. package/dist/skills/distilled/distilled-creator.md +5 -2
  344. package/dist/skills/distilled/distilled-dispatching-parallel-agents.md +136 -0
  345. package/dist/skills/distilled/distilled-doc-coauthoring.md +144 -0
  346. package/dist/skills/distilled/distilled-docx.md +231 -0
  347. package/dist/skills/distilled/distilled-executing-plans.md +85 -50
  348. package/dist/skills/distilled/distilled-finishing-a-development-branch.md +213 -0
  349. package/dist/skills/distilled/distilled-frontend-design.md +118 -0
  350. package/dist/skills/distilled/distilled-harness-engineering.md +1 -1
  351. package/dist/skills/distilled/distilled-receiving-code-review.md +185 -0
  352. package/dist/skills/distilled/distilled-subagent-driven-development.md +124 -0
  353. package/dist/skills/distilled/distilled-systematic-debugging.md +108 -260
  354. package/dist/skills/distilled/distilled-test-driven-development.md +432 -0
  355. package/dist/skills/distilled/distilled-using-superpowers.md +134 -0
  356. package/dist/skills/distilled/distilled-verification-before-completion.md +88 -78
  357. package/dist/skills/distilled/distilled-writing-skills.md +175 -0
  358. package/dist/skills/registry.d.ts +10 -50
  359. package/dist/skills/registry.d.ts.map +1 -1
  360. package/dist/skills/registry.js +7 -118
  361. package/dist/skills/registry.js.map +1 -1
  362. package/dist/skills/tools/pipeline-suggest.js +2 -2
  363. package/dist/skills/tools/pipeline-suggest.js.map +1 -1
  364. package/dist/skills/tools/skill-invoke.d.ts +2 -1
  365. package/dist/skills/tools/skill-invoke.d.ts.map +1 -1
  366. package/dist/skills/tools/skill-invoke.js +3 -1
  367. package/dist/skills/tools/skill-invoke.js.map +1 -1
  368. package/dist/web/analytics/anti-pattern-detector.d.ts.map +1 -1
  369. package/dist/web/analytics/anti-pattern-detector.js +6 -1
  370. package/dist/web/analytics/anti-pattern-detector.js.map +1 -1
  371. package/dist/web/analytics/drift-detector.d.ts +6 -0
  372. package/dist/web/analytics/drift-detector.d.ts.map +1 -1
  373. package/dist/web/analytics/drift-detector.js +15 -8
  374. package/dist/web/analytics/drift-detector.js.map +1 -1
  375. package/dist/web/analytics/weekly-report.d.ts +13 -0
  376. package/dist/web/analytics/weekly-report.d.ts.map +1 -1
  377. package/dist/web/analytics/weekly-report.js +17 -3
  378. package/dist/web/analytics/weekly-report.js.map +1 -1
  379. package/dist/web/routes/_helpers.d.ts +31 -0
  380. package/dist/web/routes/_helpers.d.ts.map +1 -1
  381. package/dist/web/routes/_helpers.js +33 -0
  382. package/dist/web/routes/_helpers.js.map +1 -1
  383. package/dist/web/routes/agent-distill.d.ts +49 -0
  384. package/dist/web/routes/agent-distill.d.ts.map +1 -0
  385. package/dist/web/routes/agent-distill.js +526 -0
  386. package/dist/web/routes/agent-distill.js.map +1 -0
  387. package/dist/web/routes/config.d.ts +56 -0
  388. package/dist/web/routes/config.d.ts.map +1 -0
  389. package/dist/web/routes/config.js +243 -0
  390. package/dist/web/routes/config.js.map +1 -0
  391. package/dist/web/routes/decisions.js +1 -1
  392. package/dist/web/routes/decisions.js.map +1 -1
  393. package/dist/web/routes/error-handler.d.ts +0 -4
  394. package/dist/web/routes/error-handler.d.ts.map +1 -1
  395. package/dist/web/routes/error-handler.js +0 -8
  396. package/dist/web/routes/error-handler.js.map +1 -1
  397. package/dist/web/routes/events.d.ts.map +1 -1
  398. package/dist/web/routes/events.js +2 -1
  399. package/dist/web/routes/events.js.map +1 -1
  400. package/dist/web/routes/insights.d.ts.map +1 -1
  401. package/dist/web/routes/insights.js +0 -0
  402. package/dist/web/routes/insights.js.map +1 -1
  403. package/dist/web/routes/knowledge.d.ts +43 -2
  404. package/dist/web/routes/knowledge.d.ts.map +1 -1
  405. package/dist/web/routes/knowledge.js +117 -6
  406. package/dist/web/routes/knowledge.js.map +1 -1
  407. package/dist/web/routes/pipeline.d.ts +0 -9
  408. package/dist/web/routes/pipeline.d.ts.map +1 -1
  409. package/dist/web/routes/pipeline.js +0 -4
  410. package/dist/web/routes/pipeline.js.map +1 -1
  411. package/dist/web/routes/rules.d.ts.map +1 -1
  412. package/dist/web/routes/rules.js +20 -6
  413. package/dist/web/routes/rules.js.map +1 -1
  414. package/dist/web/routes/sessions.d.ts.map +1 -1
  415. package/dist/web/routes/sessions.js +8 -7
  416. package/dist/web/routes/sessions.js.map +1 -1
  417. package/dist/web/routes/skill-stats.d.ts.map +1 -1
  418. package/dist/web/routes/skill-stats.js +153 -16
  419. package/dist/web/routes/skill-stats.js.map +1 -1
  420. package/dist/web/routes/skills-distill.js +1 -1
  421. package/dist/web/routes/skills-distill.js.map +1 -1
  422. package/dist/web/routes/stats.d.ts.map +1 -1
  423. package/dist/web/routes/stats.js +2 -1
  424. package/dist/web/routes/stats.js.map +1 -1
  425. package/dist/web/routes/task-timeline.d.ts +95 -19
  426. package/dist/web/routes/task-timeline.d.ts.map +1 -1
  427. package/dist/web/routes/task-timeline.js +344 -88
  428. package/dist/web/routes/task-timeline.js.map +1 -1
  429. package/dist/web/routes/tasks.d.ts.map +1 -1
  430. package/dist/web/routes/tasks.js +52 -30
  431. package/dist/web/routes/tasks.js.map +1 -1
  432. package/dist/web/routes/violations.d.ts +1 -1
  433. package/dist/web/routes/violations.d.ts.map +1 -1
  434. package/dist/web/routes/violations.js +3 -2
  435. package/dist/web/routes/violations.js.map +1 -1
  436. package/dist/web/server.d.ts.map +1 -1
  437. package/dist/web/server.js +20 -0
  438. package/dist/web/server.js.map +1 -1
  439. package/dist/web/services/agent-distill-manager.d.ts +122 -0
  440. package/dist/web/services/agent-distill-manager.d.ts.map +1 -0
  441. package/dist/web/services/agent-distill-manager.js +397 -0
  442. package/dist/web/services/agent-distill-manager.js.map +1 -0
  443. package/dist/web/services/distill-manager.d.ts +47 -0
  444. package/dist/web/services/distill-manager.d.ts.map +1 -1
  445. package/dist/web/services/distill-manager.js +103 -0
  446. package/dist/web/services/distill-manager.js.map +1 -1
  447. package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js +2 -0
  448. package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js.map +1 -0
  449. package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js +3 -0
  450. package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js.map +1 -0
  451. package/dist/web/static/assets/AgentsPage-Qd9FExLG.js +2 -0
  452. package/dist/web/static/assets/AgentsPage-Qd9FExLG.js.map +1 -0
  453. package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js +2 -0
  454. package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js.map +1 -0
  455. package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js +2 -0
  456. package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js.map +1 -0
  457. package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js +2 -0
  458. package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js.map +1 -0
  459. package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js +2 -0
  460. package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js.map +1 -0
  461. package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js +4 -0
  462. package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js.map +1 -0
  463. package/dist/web/static/assets/DistillPage-O7BHtRN8.js +2 -0
  464. package/dist/web/static/assets/DistillPage-O7BHtRN8.js.map +1 -0
  465. package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js +2 -0
  466. package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js.map +1 -0
  467. package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js +2 -0
  468. package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js.map +1 -0
  469. package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js +2 -0
  470. package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js.map +1 -0
  471. package/dist/web/static/assets/IssuesPage-SKmhlCrw.js +2 -0
  472. package/dist/web/static/assets/IssuesPage-SKmhlCrw.js.map +1 -0
  473. package/dist/web/static/assets/KbDetailPage-Yna86Na8.js +2 -0
  474. package/dist/web/static/assets/KbDetailPage-Yna86Na8.js.map +1 -0
  475. package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js +2 -0
  476. package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js.map +1 -0
  477. package/dist/web/static/assets/{MarkdownRenderer-DZmTl-8J.js → MarkdownRenderer-DlDQNihj.js} +2 -2
  478. package/dist/web/static/assets/{MarkdownRenderer-DZmTl-8J.js.map → MarkdownRenderer-DlDQNihj.js.map} +1 -1
  479. package/dist/web/static/assets/NotFound-LMzbP51V.js +2 -0
  480. package/dist/web/static/assets/{NotFound-BQPh0vaF.js.map → NotFound-LMzbP51V.js.map} +1 -1
  481. package/dist/web/static/assets/SettingsPage-DzoK4PKg.js +2 -0
  482. package/dist/web/static/assets/SettingsPage-DzoK4PKg.js.map +1 -0
  483. package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js +2 -0
  484. package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js.map +1 -0
  485. package/dist/web/static/assets/SkillsPage-aojkJpBc.js +2 -0
  486. package/dist/web/static/assets/SkillsPage-aojkJpBc.js.map +1 -0
  487. package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js +4 -0
  488. package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js.map +1 -0
  489. package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js +6 -0
  490. package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js.map +1 -0
  491. package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js +2 -0
  492. package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js.map +1 -0
  493. package/dist/web/static/assets/arco-DV6xCLhr.js +14 -0
  494. package/dist/web/static/assets/arco-DV6xCLhr.js.map +1 -0
  495. package/dist/web/static/assets/charts-BSV4cyC4.js +37 -0
  496. package/dist/web/static/assets/charts-BSV4cyC4.js.map +1 -0
  497. package/dist/web/static/assets/{index-7bl3kbcx.css → index-B_v_MKlb.css} +1 -1
  498. package/dist/web/static/assets/index-DileOOE4.js +4 -0
  499. package/dist/web/static/assets/index-DileOOE4.js.map +1 -0
  500. package/dist/web/static/assets/markdown-CA7ePUts.js +30 -0
  501. package/dist/web/static/assets/markdown-CA7ePUts.js.map +1 -0
  502. package/dist/web/static/assets/{outcome-DUn1NjlC.js → outcome-BKGy9azt.js} +2 -2
  503. package/dist/web/static/assets/{outcome-DUn1NjlC.js.map → outcome-BKGy9azt.js.map} +1 -1
  504. package/dist/web/static/assets/{query-S6X1S7K9.js → query-CgCOpYWf.js} +2 -2
  505. package/dist/web/static/assets/{query-S6X1S7K9.js.map → query-CgCOpYWf.js.map} +1 -1
  506. package/dist/web/static/assets/{react-router-JVUrkhdd.js → react-router-Cxmg8RuL.js} +3 -3
  507. package/dist/web/static/assets/{react-router-JVUrkhdd.js.map → react-router-Cxmg8RuL.js.map} +1 -1
  508. package/dist/web/static/assets/{syntax-highlighter-BkZfCDsz.js → syntax-highlighter-BDYycNja.js} +3 -3
  509. package/dist/web/static/assets/{syntax-highlighter-BkZfCDsz.js.map → syntax-highlighter-BDYycNja.js.map} +1 -1
  510. package/dist/web/static/assets/task-title-BhOcemuR.js +2 -0
  511. package/dist/web/static/assets/task-title-BhOcemuR.js.map +1 -0
  512. package/dist/web/static/assets/useAgentStats-B-uTgqBd.js +2 -0
  513. package/dist/web/static/assets/useAgentStats-B-uTgqBd.js.map +1 -0
  514. package/dist/web/static/assets/useDecisions-D-G2Ft5T.js +2 -0
  515. package/dist/web/static/assets/useDecisions-D-G2Ft5T.js.map +1 -0
  516. package/dist/web/static/assets/useDistill-21dZkXlT.js +3 -0
  517. package/dist/web/static/assets/useDistill-21dZkXlT.js.map +1 -0
  518. package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js +2 -0
  519. package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js.map +1 -0
  520. package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js +2 -0
  521. package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js.map +1 -0
  522. package/dist/web/static/assets/useKbHits-xKXWgqh9.js +2 -0
  523. package/dist/web/static/assets/useKbHits-xKXWgqh9.js.map +1 -0
  524. package/dist/web/static/assets/useSkillStats-B5hbIwdf.js +2 -0
  525. package/dist/web/static/assets/useSkillStats-B5hbIwdf.js.map +1 -0
  526. package/dist/web/static/assets/vendor-DS-q4Eyc.js +36 -0
  527. package/dist/web/static/assets/vendor-DS-q4Eyc.js.map +1 -0
  528. package/dist/web/static/index.html +6 -6
  529. package/package.json +5 -3
  530. package/dist/core/storage/workflow-recommendations.d.ts +0 -124
  531. package/dist/core/storage/workflow-recommendations.d.ts.map +0 -1
  532. package/dist/core/storage/workflow-recommendations.js +0 -274
  533. package/dist/core/storage/workflow-recommendations.js.map +0 -1
  534. package/dist/daemon/services/experience-extractor.d.ts.map +0 -1
  535. package/dist/daemon/services/experience-extractor.js.map +0 -1
  536. package/dist/daemon/services/violation-reporter.d.ts.map +0 -1
  537. package/dist/daemon/services/violation-reporter.js.map +0 -1
  538. package/dist/daemon/templates/agents/harness-hotfix.md +0 -99
  539. package/dist/daemon/templates/agents/hybrid-feature-with-safety.md +0 -104
  540. package/dist/daemon/templates/agents/refactor-specialist.md +0 -98
  541. package/dist/skills/distill/claude-cli-resolver.d.ts.map +0 -1
  542. package/dist/skills/distill/claude-cli-resolver.js.map +0 -1
  543. package/dist/skills/distilled/distilled-defi-amm-security.md +0 -293
  544. package/dist/skills/keyword-score.d.ts +0 -29
  545. package/dist/skills/keyword-score.d.ts.map +0 -1
  546. package/dist/skills/keyword-score.js +0 -54
  547. package/dist/skills/keyword-score.js.map +0 -1
  548. package/dist/web/static/assets/AgentContentPage-DkeRNxok.js +0 -2
  549. package/dist/web/static/assets/AgentContentPage-DkeRNxok.js.map +0 -1
  550. package/dist/web/static/assets/AgentDelegationTable-ByBa0x1l.js +0 -2
  551. package/dist/web/static/assets/AgentDelegationTable-ByBa0x1l.js.map +0 -1
  552. package/dist/web/static/assets/ContextInsightsPage-oUk7_I8u.js +0 -3
  553. package/dist/web/static/assets/ContextInsightsPage-oUk7_I8u.js.map +0 -1
  554. package/dist/web/static/assets/DaemonHealthPage-DG2fyOP7.js +0 -2
  555. package/dist/web/static/assets/DaemonHealthPage-DG2fyOP7.js.map +0 -1
  556. package/dist/web/static/assets/DecisionsPage-CMAPEnKb.js +0 -2
  557. package/dist/web/static/assets/DecisionsPage-CMAPEnKb.js.map +0 -1
  558. package/dist/web/static/assets/DiagnosticsPage-DQd-Zm4r.js +0 -2
  559. package/dist/web/static/assets/DiagnosticsPage-DQd-Zm4r.js.map +0 -1
  560. package/dist/web/static/assets/DriftTab-DqpepOhI.js +0 -2
  561. package/dist/web/static/assets/DriftTab-DqpepOhI.js.map +0 -1
  562. package/dist/web/static/assets/HealthHomePage-CN6zNIie.js +0 -3
  563. package/dist/web/static/assets/HealthHomePage-CN6zNIie.js.map +0 -1
  564. package/dist/web/static/assets/KbHitRateTable-ByEIWujF.js +0 -2
  565. package/dist/web/static/assets/KbHitRateTable-ByEIWujF.js.map +0 -1
  566. package/dist/web/static/assets/NotFound-BQPh0vaF.js +0 -2
  567. package/dist/web/static/assets/ProjectSwitcher-D3lZMFd3.js +0 -2
  568. package/dist/web/static/assets/ProjectSwitcher-D3lZMFd3.js.map +0 -1
  569. package/dist/web/static/assets/SettingsPage-oLJBNzQj.js +0 -2
  570. package/dist/web/static/assets/SettingsPage-oLJBNzQj.js.map +0 -1
  571. package/dist/web/static/assets/SkillContentPage-DK5rgfgw.js +0 -2
  572. package/dist/web/static/assets/SkillContentPage-DK5rgfgw.js.map +0 -1
  573. package/dist/web/static/assets/SkillStatsTable-DYMzjEUV.js +0 -2
  574. package/dist/web/static/assets/SkillStatsTable-DYMzjEUV.js.map +0 -1
  575. package/dist/web/static/assets/SkillsDistillTab-C7qaG8q3.js +0 -2
  576. package/dist/web/static/assets/SkillsDistillTab-C7qaG8q3.js.map +0 -1
  577. package/dist/web/static/assets/TasksHubPage-03wsRRsJ.js +0 -6
  578. package/dist/web/static/assets/TasksHubPage-03wsRRsJ.js.map +0 -1
  579. package/dist/web/static/assets/ViolationsPage-DSiLr-9O.js +0 -3
  580. package/dist/web/static/assets/ViolationsPage-DSiLr-9O.js.map +0 -1
  581. package/dist/web/static/assets/arco-Bhi3a6Qp.js +0 -14
  582. package/dist/web/static/assets/arco-Bhi3a6Qp.js.map +0 -1
  583. package/dist/web/static/assets/charts-BuHQWDbQ.js +0 -37
  584. package/dist/web/static/assets/charts-BuHQWDbQ.js.map +0 -1
  585. package/dist/web/static/assets/index-BIYnq1Dx.js +0 -4
  586. package/dist/web/static/assets/index-BIYnq1Dx.js.map +0 -1
  587. package/dist/web/static/assets/useTabsParam-k8qte_0C.js +0 -2
  588. package/dist/web/static/assets/useTabsParam-k8qte_0C.js.map +0 -1
  589. package/dist/web/static/assets/vendor-DWgdB1eY.js +0 -65
  590. package/dist/web/static/assets/vendor-DWgdB1eY.js.map +0 -1
  591. /package/dist/{skills/distill → core/utils}/claude-cli-resolver.d.ts +0 -0
@@ -0,0 +1,6 @@
1
+ var xt=Object.defineProperty;var ut=(t,n,o)=>n in t?xt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var Me=(t,n,o)=>ut(t,typeof n!="symbol"?n+"":n,o);import{j as e,r as T}from"./react-vendor-tkvCrao7.js";import{L as Re,a as we,u as ft}from"./react-router-Cxmg8RuL.js";import{a as De,c as fe,u as G,k as Be}from"./query-CgCOpYWf.js";import{J as z,b as m,T as i,ak as ke,al as gt,aa as Ae,t as ht,O as le,am as He,N as yt,_ as ie,h as Q,F as A,ad as _e,C as jt,ah as Oe,a2 as qe,a3 as K,an as bt,ao as Ke,ap as xe,y as Te,q as vt,d as re,a1 as St,$ as wt,E as se,Y as Fe,aq as ve,a8 as kt,x as _t,ar as Tt,as as Ee,v as zt,at as Ct,a as It,ai as $t,au as Mt,av as Bt,R as Se,z as Ft,aw as Et,I as Lt,ax as ee,ay as Wt}from"./arco-DV6xCLhr.js";import{p as E,f as Nt,c as Pt,a as Rt,u as Dt,r as At,l as Ht,k as Ot}from"./index-DileOOE4.js";import{n as qt}from"./task-title-BhOcemuR.js";import{a as Kt}from"./auth-Bnf8ZcqN.js";import{f as Z}from"./date-fns-sbWH3_uq.js";import{T as Ut}from"./vendor-DS-q4Eyc.js";import{c as Jt,F as Gt,G as Vt,M as Yt}from"./lucide-CnlPQoG8.js";import{b as Qt,o as Zt}from"./outcome-BKGy9azt.js";function Xt(t){switch(t){case"success":return e.jsx(le,{style:{color:"var(--cf-tag-green)"}});case"partial":return e.jsx(ht,{style:{color:"var(--cf-tag-orange)"}});case"failed":return e.jsx(Ae,{style:{color:"var(--cf-tag-red)"}});case"abandoned":return e.jsx(gt,{style:{color:"var(--color-text-3)"}});default:return e.jsx(ke,{style:{color:"var(--cf-tag-blue)"},spin:!0})}}function en(t){switch(t){case"success":return"green";case"partial":return"orange";case"failed":return"red";case"abandoned":return"gray";default:return"arcoblue"}}function tn({banner:t,taskId:n,startedAt:o}){const s=en(t.outcome);return e.jsx(z,{bordered:!0,"data-testid":"tier-banner",style:{marginBottom:10,background:"var(--cf-kpi-wash-purple, #FAF5FF)",borderColor:"var(--cf-tag-purple, #B37FEB)"},bodyStyle:{padding:"10px 14px"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",fontSize:13},children:[e.jsx("span",{style:{fontSize:18,lineHeight:1,display:"inline-flex",alignItems:"center"},children:Xt(t.outcome)}),e.jsx(m,{color:s,size:"default","data-testid":"tier-banner-outcome",children:t.outcomeLabel}),e.jsx(i.Text,{style:{fontSize:12,color:"var(--color-text-2)"},children:t.pathLabel}),e.jsx(i.Text,{style:{fontSize:12,color:"var(--color-text-3)"},children:"·"}),e.jsxs(i.Text,{style:{fontSize:12},children:[t.fileCount," 文件"]}),e.jsx(i.Text,{style:{fontSize:12,color:"var(--color-text-3)"},children:"·"}),e.jsxs(i.Text,{style:{fontSize:12},children:[t.commitCount," commit"]}),e.jsx(i.Text,{style:{fontSize:12,color:"var(--color-text-3)"},children:"·"}),e.jsx(i.Text,{style:{fontSize:12},children:t.durationLabel}),t.agentSpawnCount>0&&e.jsxs(e.Fragment,{children:[e.jsx(i.Text,{style:{fontSize:12,color:"var(--color-text-3)"},children:"·"}),e.jsxs(i.Text,{style:{fontSize:12},children:[t.agentSpawnCount," agent spawn"]})]}),e.jsx("span",{style:{flex:1}}),e.jsxs(i.Text,{type:"secondary",style:{fontSize:11},title:n,children:[n.slice(0,8)," · ",o.slice(0,19).replace("T"," ")]})]})})}function ue({cardId:t,idx:n,title:o,oneLine:s,rightChip:r,expanded:a,onToggle:x,detail:c}){return e.jsxs(z,{bordered:!0,"data-testid":`decision-card-${t}`,"data-expanded":a?"1":"0",style:{marginBottom:8},bodyStyle:{padding:0},children:[e.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":a,onClick:x,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),x())},style:{cursor:"pointer",padding:"10px 14px",display:"flex",alignItems:"center",gap:10,userSelect:"none"},children:[e.jsx("span",{style:{color:"var(--color-text-3)",fontSize:14,lineHeight:1,display:"inline-flex"},children:a?e.jsx(He,{}):e.jsx(yt,{})}),e.jsx(i.Text,{style:{fontSize:12,color:"var(--color-text-3)",minWidth:14},children:n}),e.jsx(i.Text,{style:{fontSize:13,fontWeight:600,minWidth:92},children:o}),e.jsx(i.Text,{type:"secondary",style:{fontSize:12,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--color-text-1)"},title:s,children:s}),r&&e.jsx("span",{style:{flexShrink:0},children:r})]}),a&&e.jsx("div",{"data-testid":`decision-card-detail-${t}`,style:{padding:"8px 14px 14px",borderTop:"1px solid var(--color-border-2)",background:"var(--color-fill-1)"},children:c})]})}function Le(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Ue(t){var N,P,L,B,H,q;const n=((P=(N=t.userPrompts[0])==null?void 0:N.content)==null?void 0:P.trim())||null,o=((L=t.userPrompts[0])==null?void 0:L.timestamp)??null,s=t.injections.find(y=>y.source_handler.includes(":intent"))??null,r=Le(s==null?void 0:s.metadata_json),a=r?{workflow_type:r.workflow_type,confidence:r.confidence,suggested_agent:r.suggested_agent,layer:r.layer,reasoning:r.reasoning}:null,x=t.injections.filter(y=>y.source_handler==="UserPromptSubmitHandler:kb"),c=new Map;for(const y of x){const S=Le(y.metadata_json);if(Array.isArray(S)){for(const w of S)if(w&&typeof w.name=="string"){const W=((B=c.get(w.name))==null?void 0:B.score)??0,_=typeof w.score=="number"?w.score:0;c.set(w.name,{score:Math.max(W,_),matched:Array.isArray(w.matched_keywords)?w.matched_keywords:void 0})}}}const u=Array.from(c.entries()).sort((y,S)=>S[1].score-y[1].score).slice(0,8).map(([y,S])=>({name:y,score:S.score||void 0,matched:S.matched})),h=t.skillInvocations.slice(0,16).map(y=>({skill_id:y.skill_id,reason:y.reason??""})),l=t.timeline.filter(y=>{var S;return y.is_agent_call&&((S=y.agent_detail)==null?void 0:S.subagent_type)}).map(y=>{var S,w,W,_;return{subagent_type:(S=y.agent_detail)==null?void 0:S.subagent_type,name:(w=y.agent_detail)==null?void 0:w.name,promptPreview:(_=(W=y.agent_detail)==null?void 0:W.prompt)==null?void 0:_.slice(0,200)}}),b=new Map;for(const y of t.timeline)if((y.tool_name==="Edit"||y.tool_name==="Write")&&((H=y.input)!=null&&H.file_path)){const S=y.input.file_path;b.set(S,(b.get(S)??0)+1)}const g=Array.from(b.entries()).sort((y,S)=>S[1]-y[1]).map(([y,S])=>({path:y,count:S})),k=g.length,f=[];for(const y of t.timeline){if(y.tool_name!=="Bash")continue;const S=(q=y.input)==null?void 0:q.command;if(S&&/\bgit\s+commit\b/.test(S)){const w=y.output,W=typeof w=="string"?w:(w==null?void 0:w.stdout)??(w==null?void 0:w.output)??JSON.stringify(w??{}),_=String(W).match(/\b[a-f0-9]{7,40}\b/);_?f.push(_[0]):f.push(`(commit @ ${y.timestamp.slice(11,19)})`)}}const M=t.outcome?{label:t.outcome,reason:t.outcome_reason,commit_count:t.commit_count}:null;return{prompt:n,promptTimestamp:o,intent:a,intentInj:s,kbHits:u,kbInjs:x,skills:h,spawned:l,filesChanged:k,fileList:g,commits:f,outcome:M,specs:t.pendingSpecs??[]}}function Je(t){const n=!t.intent&&t.kbHits.length===0,o=t.specs.length===0&&t.skills.length===0,s=t.spawned.length===0&&t.filesChanged===0;return n&&o&&s}function nn(t,n){var h,l,b;const o=t.specs.length>0;let s;if(o)s=`BMAD Spec (token=${t.specs[0].token})`;else{const g=((h=n.agentSpawns[0])==null?void 0:h.subagent_type)??null;s=cn(null,g)}const r=((l=t.outcome)==null?void 0:l.label)??"active",a=r==="success"?"成功":r==="partial"?"部分":r==="failed"?"失败":r==="abandoned"?"放弃":"进行中",x=t.filesChanged,c=(((b=t.outcome)==null?void 0:b.commit_count)??0)||t.commits.length;let u="-";if(n.start_time){const g=n.end_time?E(n.end_time).getTime():Date.now(),k=E(n.start_time).getTime(),f=Math.max(0,Math.round((g-k)/1e3));f<60?u=`${f}s`:f<3600?u=`${Math.floor(f/60)}m${f%60}s`:u=`${Math.floor(f/3600)}h${Math.floor(f%3600/60)}m`}return{outcome:r,outcomeLabel:a,pathLabel:s,fileCount:x,commitCount:c,durationLabel:u,agentSpawnCount:n.agentSpawns.length}}function sn(t,n){var q,y,S,w,W,_,C,U;const o=((q=t.intent)==null?void 0:q.workflow_type)??"?",s=((y=t.intent)==null?void 0:y.layer)??"-",r=typeof((S=t.intent)==null?void 0:S.confidence)=="number"?` conf=${t.intent.confidence.toFixed(2)}`:"",a=t.prompt?(t.prompt.length>30?t.prompt.slice(0,30)+"…":t.prompt).replace(/\n/g," "):"",x=`${o} · ${s}${r}${a?` · "${a}"`:""}`,c=t.specs.length,u=t.skills.length,h=[];c&&h.push(`spec×${c}`),u&&h.push(`skill×${u}`);const l=h.length===0?"自主决策(未走 daemon 推荐)":h.join(" · "),b=n.agentSpawns.length,g=t.filesChanged,k=Array.from(new Set(n.agentSpawns.map(V=>V.subagent_type??"?")));let f;b===0?f=g>0?`主线程直改 ${g} 文件 (0 spawn)`:"未触发":f=`spawn×${b} (${k.slice(0,2).join(", ")}${k.length>2?"…":""}) · file×${g}`;const M=((w=t.outcome)==null?void 0:w.label)==="success"?"成功":((W=t.outcome)==null?void 0:W.label)==="partial"?"部分":((_=t.outcome)==null?void 0:_.label)==="failed"?"失败":((C=t.outcome)==null?void 0:C.label)==="abandoned"?"放弃":"进行中",N=((U=t.outcome)==null?void 0:U.commit_count)??t.commits.length,P=n.reverted_commits??0,L=n.user_violation_count??0,B=[M];N>0&&B.push(`commit×${N}`),P>0&&B.push(`reverted×${P}`),L>0&&B.push(`violation×${L}`);const H=B.join(" · ");return{intent:x,decision:l,execution:f,outcome:H}}function on(t){return t.status==="approved"?{label:"已 approve",color:"green"}:t.status==="skipped"?{label:"已 skip",color:"gray"}:t.status==="modified"?{label:"已修改",color:"orange"}:t.status==="expired"?{label:"已过期",color:"gray"}:{label:"待 approve",color:"arcoblue"}}const oe={fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,lineHeight:1.55,color:"var(--color-text-2)",background:"var(--color-fill-1)",border:"1px solid var(--color-border-2)",borderRadius:4,padding:10,margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:280,overflowY:"auto"},rn={"bmad-question-default":"BMAD 默认路径(疑问句)","bmad-default":"BMAD 默认路径","task-question-needs-bmad":"任务问题需走 BMAD","decision-hint-pending":"待 decision-maker 介入","no-spawn":"主线程直接处理","harness-debug-full":"Harness 调试流程(未知 bug)","harness-hotfix":"Harness hotfix(已知 bug)","refactor-low-coverage":"重构低覆盖代码","hybrid-feature-with-safety":"新功能 + 改老代码(低覆盖)","workflow-recommendation-mismatch":"主线程未按推荐 spawn","workflow-rec":"Workflow 推荐命中","kb-injection":"知识库(KB)注入","spec-gate-block-mutation":"Spec gate 拦截 mutation","edit-multi-file-hard":"多文件 Edit 硬阈值","write-multi-file-hard":"多文件 Write 硬阈值","edit-multi-file-no-agent":"多文件 Edit 但未 spawn agent","write-multi-file-no-agent":"多文件 Write 但未 spawn agent","edit-hook-script-from-main":"主线程改 hook 脚本","write-hook-script-from-main":"主线程写 hook 脚本","bash-grep-multi-file":"主线程 bash grep 多文件","bash-find-source":"主线程 bash find 源码","bash-git-log-diff-no-file":"主线程 git log/diff 无文件","task-spawn-general-purpose-misuse":"spawn general-purpose(应用专门 agent)","inline-edit-no-spawn":"单文件 inline Edit 未 spawn","inline-write-no-spawn":"单文件 inline Write 未 spawn"};function ln(t){if(!t)return"未知";const n=rn[t];return n||(typeof console<"u"&&console.warn&&console.warn(`[reasonLabel] unknown enum: "${t}"`),t)}const We=/<!--\s*decision-id:\s*([a-f0-9]{4,40})\s*-->/gi;function an(t){if(!t)return{ids:[],cleanedPrompt:""};const n=[];let o=t;const s=new RegExp(We.source,"gi");let r;for(;(r=s.exec(t))!==null;)r[1]&&!n.includes(r[1])&&n.push(r[1]);return o=o.replace(new RegExp(We.source,"gi"),""),o=o.replace(/^[ \t]*\n+/,"").replace(/\n{3,}/g,`
2
+
3
+ `).trimStart(),{ids:n,cleanedPrompt:o}}function cn(t,n){const o=n||null;return o?`自主决策: spawn ${o}(无 daemon 推荐)`:"自主决策(未走 daemon 推荐)"}function dn({s:t}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("section",{children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:4},children:["用户提问",t.prompt&&e.jsxs(m,{size:"small",color:"gray",style:{marginLeft:6},children:[t.prompt.length," chars"]})]}),t.prompt?e.jsxs(e.Fragment,{children:[t.promptTimestamp&&e.jsxs(i.Text,{type:"secondary",style:{fontSize:11,display:"block",marginBottom:4},children:["timestamp: ",e.jsx(i.Text,{code:!0,style:{fontSize:11},children:Nt(t.promptTimestamp,{includeSeconds:!0})})]}),e.jsx("pre",{style:oe,children:t.prompt})]}):e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"未触发"})]}),e.jsxs("section",{children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:4},children:["意图识别",t.intentInj&&e.jsx(m,{size:"small",color:"arcoblue",style:{marginLeft:6},children:"已注入"})]}),t.intent?e.jsxs("div",{style:{marginBottom:6,fontSize:12},children:[e.jsxs(i.Text,{code:!0,style:{fontSize:11},children:["workflow_type=",t.intent.workflow_type??"-"]}),typeof t.intent.confidence=="number"&&e.jsxs(i.Text,{type:"secondary",style:{fontSize:11,marginLeft:6},children:["· confidence=",(t.intent.confidence*100).toFixed(0),"%"]}),t.intent.layer&&e.jsxs(m,{size:"small",color:"gray",style:{marginLeft:6,fontSize:10},children:["layer=",t.intent.layer]}),t.intent.suggested_agent&&e.jsxs(m,{size:"small",color:"purple",style:{marginLeft:6,fontSize:10},children:["→ ",t.intent.suggested_agent]}),t.intent.reasoning&&e.jsx("div",{style:{marginTop:4,fontSize:11,color:"var(--color-text-2)"},children:t.intent.reasoning})]}):e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"未触发"}),t.intentInj&&e.jsxs(e.Fragment,{children:[e.jsxs(i.Text,{type:"secondary",style:{fontSize:11,display:"block",marginTop:4,marginBottom:4},children:["注入原文 (source: ",e.jsx(i.Text,{code:!0,style:{fontSize:11},children:t.intentInj.source_handler}),"):"]}),e.jsx("pre",{style:oe,children:t.intentInj.content})]})]}),e.jsxs("section",{children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:4},children:["命中知识库",t.kbHits.length>0&&e.jsxs(m,{size:"small",color:"purple",style:{marginLeft:6},children:[t.kbHits.length," 命中"]})]}),t.kbHits.length===0?e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"未触发"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:4,marginBottom:6},children:t.kbHits.map(n=>e.jsxs(m,{size:"small",color:"purple",style:{fontSize:10},children:[n.name,typeof n.score=="number"&&` · score ${Math.round(n.score)}`,n.matched&&n.matched.length>0&&` · [${n.matched.slice(0,3).join(", ")}]`]},n.name))}),t.kbInjs.map((n,o)=>e.jsxs("div",{style:{marginTop:6},children:[e.jsxs(i.Text,{type:"secondary",style:{fontSize:11,display:"block",marginBottom:4},children:["注入 #",o+1," (",n.content.length," chars):"]}),e.jsxs("pre",{style:oe,children:[n.content.slice(0,800),n.content.length>800&&`
4
+ …(truncated)`]})]},n.id))]})]})]})}function pn({s:t}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("section",{children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:4},children:["Spec 生成 (Phase 2b)",t.specs.length>0&&e.jsxs(m,{size:"small",color:"purple",style:{marginLeft:6},children:[t.specs.length," 条"]})]}),t.specs.length===0?e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"未触发"}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:t.specs.map(n=>{var s;const o=on(n);return e.jsxs("div",{style:{padding:"6px 10px",background:"var(--color-bg-1)",border:"1px solid var(--color-border-2)",borderRadius:4,fontSize:11},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[e.jsxs(i.Text,{code:!0,style:{fontSize:11,color:"var(--cf-tag-purple)"},children:["token=",n.token]}),e.jsx(m,{size:"small",color:o.color,children:o.label}),((s=n.intent)==null?void 0:s.workflow_type)&&e.jsxs(m,{size:"small",color:"gray",style:{fontSize:10},children:[n.intent.workflow_type,n.intent.suggested_agent?` → ${n.intent.suggested_agent}`:""]}),e.jsx(i.Text,{type:"secondary",style:{fontSize:10},children:n.created_at.slice(11,19)})]}),e.jsxs("div",{style:{marginTop:4},children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"spec_path: "}),e.jsx(i.Text,{code:!0,style:{fontSize:10,wordBreak:"break-all"},children:n.spec_path})]}),n.approved_at&&e.jsxs("div",{style:{marginTop:2,color:"var(--color-text-2)"},children:["approved_at: ",e.jsx(i.Text,{code:!0,style:{fontSize:10},children:n.approved_at})]})]},n.id)})})]}),e.jsxs("section",{children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:4},children:["匹配技能",t.skills.length>0&&e.jsxs(m,{size:"small",color:"arcoblue",style:{marginLeft:6},children:[t.skills.length," 个"]})]}),t.skills.length===0?e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"未触发"}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:t.skills.map((n,o)=>e.jsxs("div",{style:{padding:"6px 10px",background:"var(--color-bg-1)",border:"1px solid var(--color-border-2)",borderRadius:4,fontSize:11},children:[e.jsx(i.Text,{code:!0,style:{fontSize:11,color:"var(--cf-tag-purple)"},children:n.skill_id}),n.reason&&e.jsx("div",{style:{marginTop:4,color:"var(--color-text-2)"},children:n.reason})]},`${n.skill_id}-${o}`))})]})]})}function mn({s:t,data:n}){const o=t.fileList.reduce((s,r)=>s+r.count,0);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("section",{children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:4},children:["spawn Agent",n.agentSpawns.length>0&&e.jsxs(m,{size:"small",color:"arcoblue",style:{marginLeft:6},children:[n.agentSpawns.length," 次"]})]}),n.agentSpawns.length===0?e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"未 spawn"}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:n.agentSpawns.map((s,r)=>{var g;const a=s.end_timestamp?Math.max(0,Math.round((E(s.end_timestamp).getTime()-E(s.timestamp).getTime())/1e3)):null,x=a===null?"running":a<60?`${a}s`:`${Math.floor(a/60)}m${a%60}s`,c=s.timestamp,u=n.agentSpawns[r+1],h=(u==null?void 0:u.timestamp)??s.end_timestamp??new Date().toISOString(),l=new Map;for(const k of n.timeline){if(k.tool_name!=="Edit"&&k.tool_name!=="Write"||k.timestamp<c||k.timestamp>h)continue;const f=(g=k.input)==null?void 0:g.file_path;typeof f=="string"&&l.set(f,(l.get(f)??0)+1)}const b=Array.from(l.entries());return e.jsxs("div",{style:{padding:"8px 10px",background:"var(--color-bg-1)",border:"1px solid var(--color-border-2)",borderRadius:4,fontSize:11},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4,flexWrap:"wrap"},children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:600,color:"var(--cf-tag-blue)"},children:["Spawn #",r+1]}),e.jsx(i.Text,{code:!0,style:{fontSize:11,color:"var(--cf-tag-blue)"},children:s.subagent_type??"(no type)"}),s.status==="completed"?e.jsx(m,{size:"small",color:"green",children:"completed"}):e.jsx(m,{size:"small",color:"arcoblue",children:"running"}),e.jsxs(i.Text,{type:"secondary",style:{fontSize:10},children:[s.timestamp.slice(11,19)," · ",x]})]}),s.description&&e.jsxs("div",{style:{marginTop:2},children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"描述: "}),e.jsx(i.Text,{style:{fontSize:11},children:s.description})]}),s.prompt&&e.jsxs("details",{style:{marginTop:4},children:[e.jsxs("summary",{style:{fontSize:11,color:"var(--color-text-3)",cursor:"pointer"},children:["完整 prompt (",s.prompt_length," chars)"]}),e.jsx("pre",{style:oe,children:s.prompt})]}),s.output&&e.jsxs("details",{style:{marginTop:4},children:[e.jsxs("summary",{style:{fontSize:11,color:"var(--color-text-3)",cursor:"pointer"},children:["输出预览 (",s.output_length," chars)"]}),e.jsxs("pre",{style:{...oe,maxHeight:160},children:[s.output.slice(0,1200),s.output.length>1200&&`
5
+ …(fold)`]})]}),e.jsxs("div",{style:{marginTop:6},children:[e.jsxs(i.Text,{type:"secondary",style:{fontSize:11},children:["期间产物 (",b.length," 文件):"]}),b.length>0?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2,marginTop:4},children:b.map(([k,f])=>e.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",fontSize:11},children:[e.jsx(ie,{style:{color:"var(--cf-tag-green)",flexShrink:0}}),e.jsx(i.Text,{code:!0,style:{fontSize:10,wordBreak:"break-all"},children:k}),e.jsxs(m,{size:"small",color:"gray",style:{fontSize:10},children:["×",f]})]},k))}):e.jsx(i.Text,{type:"secondary",style:{fontSize:11,marginLeft:4},children:"(无)"})]})]},r)})})]}),e.jsxs("section",{children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:4},children:["改文件总览",t.filesChanged>0&&e.jsxs(m,{size:"small",color:"green",style:{marginLeft:6},children:[t.filesChanged," 文件 / ",o," 操作"]})]}),t.fileList.length===0?e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"未触发"}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.fileList.map(s=>{var x,c;let r=-1;for(const u of n.timeline)if(!(u.tool_name!=="Edit"&&u.tool_name!=="Write")&&((x=u.input)==null?void 0:x.file_path)===s.path){for(let h=0;h<n.agentSpawns.length;h++){const l=n.agentSpawns[h],b=((c=n.agentSpawns[h+1])==null?void 0:c.timestamp)??l.end_timestamp??"9999";if(u.timestamp>=l.timestamp&&u.timestamp<=b){r=h;break}}if(r>=0)break}const a=r>=0?e.jsxs(m,{size:"small",color:"cyan",style:{fontSize:10},children:["by Spawn #",r+1]}):e.jsx(m,{size:"small",color:"gray",style:{fontSize:10},children:"by 主线程"});return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 8px",background:"var(--color-bg-1)",border:"1px solid var(--color-border-2)",borderRadius:4},children:[e.jsx(ie,{style:{color:"var(--cf-tag-green)",flexShrink:0}}),e.jsx(i.Text,{code:!0,style:{fontSize:11,flex:1,wordBreak:"break-all"},title:s.path,children:s.path}),a,e.jsxs(m,{size:"small",color:"gray",style:{flexShrink:0,fontSize:10},children:["×",s.count]})]},s.path)})})]})]})}function xn(t){return t==="success"?e.jsx(m,{color:"green",size:"small",children:"成功"}):t==="partial"?e.jsx(m,{color:"orange",size:"small",children:"部分"}):t==="failed"?e.jsx(m,{color:"red",size:"small",children:"失败"}):t==="abandoned"?e.jsx(m,{color:"gray",size:"small",children:"放弃"}):e.jsx(m,{size:"small",children:t})}function un({s:t,data:n}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,fontSize:12},children:[!t.outcome&&e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"未分类 / 进行中"}),t.outcome&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"outcome: "}),xn(t.outcome.label)]}),t.outcome.reason&&e.jsxs("div",{children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"outcome_reason: "}),e.jsx(i.Text,{code:!0,style:{fontSize:11},children:t.outcome.reason})]}),typeof t.outcome.commit_count=="number"&&e.jsxs("div",{children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"commit_count: "}),e.jsx(i.Text,{style:{fontSize:11},children:t.outcome.commit_count})]})]}),typeof n.reverted_commits=="number"&&n.reverted_commits>0&&e.jsxs("div",{children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"reverted_commits: "}),e.jsx(m,{color:"red",size:"small",children:n.reverted_commits})]}),typeof n.user_violation_count=="number"&&n.user_violation_count>0&&e.jsxs("div",{children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"user_violation_count: "}),e.jsx(m,{color:"orange",size:"small",children:n.user_violation_count})]}),t.commits.length>0&&e.jsxs("div",{children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11,display:"block",marginBottom:4},children:"commits (best-effort grep from Bash):"}),e.jsx("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:4},children:t.commits.map((o,s)=>e.jsx(m,{size:"small",color:"green",style:{fontSize:10,fontFamily:"monospace"},children:o},`${o}-${s}`))})]}),e.jsxs("div",{children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"event_count: "}),e.jsx(i.Text,{style:{fontSize:11},children:n.event_count})]})]})}async function ze(t,n){const o=await Kt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n?JSON.stringify(n):void 0});if(!o.ok){let s;try{const r=await o.json();s=(r==null?void 0:r.error)||(r==null?void 0:r.message)}catch{}throw new Error(`${o.status} ${s??o.statusText}`)}return o.json()}async function fn(t){return ze(`/api/tasks/${encodeURIComponent(t.taskId)}/approve-spec`)}async function gn(t){return ze(`/api/tasks/${encodeURIComponent(t.taskId)}/mark-abandoned`,{reason:t.reason??null})}async function Ge(t){return ze(`/api/tasks/${encodeURIComponent(t.taskId)}/rerun`)}function hn({taskId:t,outcome:n,pendingSpecs:o}){const s=Pt(),r=De(),[a,x]=T.useState(null),c=o.some(f=>f.status==="generated"),u=n==="abandoned",h=fe({mutationFn:()=>fn({taskId:t}),onSuccess:f=>{K.success(`已 approve ${f.approved} spec`),r.invalidateQueries({queryKey:["task-detail",t]})},onError:f=>{K.error(`Approve 失败:${f.message}`)}}),l=fe({mutationFn:f=>gn({taskId:t,reason:f}),onSuccess:()=>{K.success("已标记 abandoned"),r.invalidateQueries({queryKey:["task-detail",t]})},onError:f=>{K.error(`标记失败:${f.message}`)}}),b=fe({mutationFn:()=>Ge({taskId:t}),onSuccess:f=>{x(f)},onError:f=>{K.error(`Re-run 取 prompt 失败:${f.message}`)}}),g=async()=>{await s({title:"标记任务为 abandoned",message:"此操作会把该任务的 outcome 置为 abandoned。可以稍后再点击 Re-run 用同意图重跑。是否继续?",confirmText:"标记 abandoned",variant:"warning"})&&l.mutate(void 0)},k=async()=>{if(a!=null&&a.prompt)try{await navigator.clipboard.writeText(a.prompt),K.success("已复制到剪贴板")}catch{K.warning("复制失败(请手动选取文本)")}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-testid":"action-rail",style:{display:"flex",flexWrap:"wrap",gap:8,padding:"10px 14px",border:"1px dashed var(--color-border-2)",borderRadius:4,marginTop:4,marginBottom:16,background:"var(--color-bg-1)"},children:[e.jsx(Q,{content:c?"把待审 spec 标记为 approved(不重启 daemon)":"该任务没有 pending spec",children:e.jsxs(A,{type:"primary",size:"small",icon:e.jsx(le,{}),disabled:!c||h.isPending,loading:h.isPending,onClick:()=>h.mutate(),"data-testid":"action-approve-spec",children:["Approve spec",o.length>0&&` (${o.filter(f=>f.status==="generated").length})`]})}),e.jsx(Q,{content:u?"该任务已是 abandoned":"把任务标记为 abandoned(不影响已写文件)",children:e.jsx(A,{status:"warning",size:"small",icon:e.jsx(Ae,{}),disabled:u||l.isPending,loading:l.isPending,onClick:g,"data-testid":"action-mark-abandoned",children:"标记 abandoned"})}),e.jsx(Q,{content:"打开原 prompt 文本,复制后粘贴到 Claude Code 继续",children:e.jsx(A,{size:"small",icon:e.jsx(_e,{}),loading:b.isPending,onClick:()=>b.mutate(),"data-testid":"action-rerun",children:"Re-run (复制原 prompt)"})}),e.jsx(Q,{content:"MVP 后续(需要 cross-task 相似性查询)",children:e.jsx(A,{size:"small",icon:e.jsx(jt,{}),disabled:!0,"data-testid":"action-compare",children:"对比上周同类任务"})})]}),e.jsx(Oe,{title:"Re-run — 复制原 prompt",visible:!!a,onCancel:()=>x(null),footer:e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsx(A,{onClick:()=>x(null),size:"small",children:"完成"}),e.jsx(A,{type:"primary",size:"small",icon:e.jsx(qe,{}),onClick:k,disabled:!(a!=null&&a.prompt),children:"复制到剪贴板"})]}),style:{width:720},children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(a==null?void 0:a.workflow_type)&&e.jsxs("div",{style:{fontSize:12},children:[e.jsx(i.Text,{type:"secondary",children:"workflow_type:"})," ",e.jsx(i.Text,{code:!0,children:a.workflow_type}),a.suggested_agent&&e.jsxs(e.Fragment,{children:[" ",e.jsx(i.Text,{type:"secondary",children:"→"})," ",e.jsx(i.Text,{code:!0,children:a.suggested_agent})]})]}),a!=null&&a.prompt?e.jsx("pre",{"data-testid":"rerun-prompt-text",style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:12,lineHeight:1.55,background:"var(--color-fill-1)",border:"1px solid var(--color-border-2)",borderRadius:4,padding:12,maxHeight:360,overflowY:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:a.prompt}):e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"该任务没有可恢复的原 prompt(events 表未记录 UserPromptSubmit)。"}),e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"MVP 工作流:复制后回到 Claude Code 中粘贴提交。后续会有 daemon-driven spawn-same-agent 模式。"})]})})]})}function yn(t,n){const o=E(t).getTime(),s=n?E(n).getTime():Date.now(),r=Math.max(0,Math.round((s-o)/1e3));return r<60?`${r}s`:r<3600?`${Math.floor(r/60)}m${r%60}s`:`${Math.floor(r/3600)}h${Math.floor(r%3600/60)}m`}function jn(t,n=32){if(!t)return"(无 prompt)";const o=t.replace(/\n/g," ").trim();return o.length>n?o.slice(0,n)+"…":o}function bn({data:t,summary:n}){var b;const[o,s]=T.useState(!1),[r,a]=T.useState(null),x=((b=n.outcome)==null?void 0:b.commit_count)??n.commits.length,c=yn(t.start_time,t.end_time),u=jn(n.prompt),h=fe({mutationFn:()=>Ge({taskId:t.id}),onSuccess:g=>a(g),onError:g=>K.error(`Re-run 取 prompt 失败:${g.message}`)}),l=async()=>{if(r!=null&&r.prompt)try{await navigator.clipboard.writeText(r.prompt),K.success("已复制到剪贴板")}catch{K.warning("复制失败(请手动选取文本)")}};return e.jsxs(z,{bordered:!0,style:{marginBottom:16,background:"var(--cf-kpi-wash-blue, #F2F9FF)"},"data-testid":"trivial-card",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",cursor:"pointer"},onClick:()=>s(g=>!g),"data-testid":"trivial-card-header",children:[e.jsx(le,{style:{color:"var(--cf-tag-green, #00B42A)",fontSize:16}}),e.jsxs(i.Text,{style:{fontSize:13,fontWeight:500},children:["“",u,"”"]}),e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"·"}),e.jsxs(i.Text,{style:{fontSize:12},children:[x," commit",x===1?"":"s"]}),e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"·"}),e.jsx(i.Text,{style:{fontSize:12},children:c}),e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"·"}),e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"daemon 未介入"}),e.jsx("span",{style:{flex:1}}),e.jsx(A,{size:"mini",type:"text",icon:o?e.jsx(bt,{}):e.jsx(He,{}),onClick:g=>{g.stopPropagation(),s(k=>!k)},"data-testid":"trivial-card-toggle",children:o?"收起":"展开"})]}),o&&e.jsxs("div",{style:{marginTop:12,paddingTop:12,borderTop:"1px solid var(--color-border-2)",display:"flex",flexDirection:"column",gap:6},"data-testid":"trivial-card-detail",children:[e.jsxs("div",{style:{display:"flex",gap:12,fontSize:12,flexWrap:"wrap"},children:[e.jsx(i.Text,{type:"secondary",children:"时间"}),e.jsx(i.Text,{code:!0,children:Z(E(t.start_time),"yyyy-MM-dd HH:mm:ss")})]}),e.jsxs("div",{style:{display:"flex",gap:12,fontSize:12,flexWrap:"wrap"},children:[e.jsx(i.Text,{type:"secondary",children:"Task ID"}),e.jsx(i.Text,{code:!0,children:t.id.slice(0,12)})]}),n.commits.length>0&&e.jsxs("div",{style:{display:"flex",gap:12,fontSize:12,flexWrap:"wrap"},children:[e.jsx(i.Text,{type:"secondary",children:"Commit"}),e.jsx(i.Text,{code:!0,children:n.commits.join(", ")})]}),e.jsx("div",{style:{display:"flex",gap:8,marginTop:4},children:e.jsx(A,{size:"small",icon:e.jsx(_e,{}),loading:h.isPending,onClick:()=>h.mutate(),"data-testid":"trivial-card-rerun",children:"Re-run"})})]}),e.jsx(Oe,{title:"Re-run — 复制原 prompt",visible:!!r,onCancel:()=>a(null),footer:e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsx(A,{onClick:()=>a(null),size:"small",children:"完成"}),e.jsx(A,{type:"primary",size:"small",icon:e.jsx(qe,{}),onClick:l,disabled:!(r!=null&&r.prompt),children:"复制到剪贴板"})]}),style:{width:720},children:r!=null&&r.prompt?e.jsx("pre",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:12,lineHeight:1.55,background:"var(--color-fill-1)",border:"1px solid var(--color-border-2)",borderRadius:4,padding:12,maxHeight:360,overflowY:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:r.prompt}):e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"该任务没有可恢复的原 prompt(events 表未记录 UserPromptSubmit)。"})})]})}const te={fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,lineHeight:1.55,color:"var(--color-text-2)",background:"var(--color-fill-1)",border:"1px solid var(--color-border-2)",borderRadius:4,padding:10,margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:240,overflowY:"auto"};function ne({title:t,children:n,testId:o}){return e.jsxs("div",{"data-testid":o,style:{marginBottom:16},children:[e.jsx(i.Text,{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:6},children:t}),n]})}function vn({data:t,timeline:n,visible:o,onClose:s}){const r=Ue(t),a=Je(r),x=t.injections.find(u=>u.source_handler.includes(":intent"));let c=null;try{c=x!=null&&x.metadata_json?JSON.parse(x.metadata_json):null}catch{c=null}return e.jsxs(Ke,{visible:o,onCancel:s,onOk:s,title:"高级调试信息(仅故障排查时使用)",width:560,placement:"right","data-testid":"debug-drawer",footer:null,children:[e.jsx(ne,{title:"① intent_engine 输出",testId:"debug-section-intent",children:c?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",gap:6,marginBottom:6,flexWrap:"wrap"},children:[typeof c.workflow_type=="string"&&e.jsxs(m,{size:"small",color:"arcoblue",children:["workflow_type=",c.workflow_type]}),typeof c.confidence=="number"&&e.jsxs(m,{size:"small",color:"gray",children:["conf=",c.confidence.toFixed(2)]}),typeof c.layer=="string"&&e.jsxs(m,{size:"small",color:"gray",children:["layer=",c.layer]}),typeof c.suggested_agent=="string"&&e.jsxs(m,{size:"small",color:"purple",children:["agent=",c.suggested_agent]})]}),e.jsx("pre",{style:te,children:JSON.stringify(c,null,2)})]}):e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"未触发 intent injection"})}),e.jsx(xe,{style:{margin:"12px 0"}}),e.jsxs(ne,{title:"② daemon config flags(最新值)",testId:"debug-section-config",children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:"下列标志通过 daemon `config-store` 控制(实时值需后端补 endpoint; 目前显示最近一次注入的快照):"}),e.jsx("pre",{style:te,children:JSON.stringify({"auto_spec_generation.enabled":"(see /api/health for live value)","dedup_guard.enabled":"(see /api/health for live value)","active_pending.window_min":"(see /api/health for live value)","feedback_loop.enabled":"(see /api/health for live value)"},null,2)})]}),e.jsx(xe,{style:{margin:"12px 0"}}),e.jsxs(ne,{title:"③ trivial_filter 决策",testId:"debug-section-trivial",children:[e.jsx("div",{style:{display:"flex",gap:6,marginBottom:6,flexWrap:"wrap"},children:e.jsxs(m,{size:"small",color:a?"green":"orange",children:["isTrivialPath=",String(a)]})}),e.jsx("pre",{style:te,children:JSON.stringify({intentEmpty:!r.intent&&r.kbHits.length===0,decisionEmpty:r.specs.length===0&&r.skills.length===0,executionEmpty:r.spawned.length===0&&r.filesChanged===0,counters:{specs:r.specs.length,skills:r.skills.length,spawned:r.spawned.length,filesChanged:r.filesChanged,kbHits:r.kbHits.length,commits:r.commits.length}},null,2)})]}),e.jsx(xe,{style:{margin:"12px 0"}}),e.jsxs(ne,{title:"④ 原始事件(timeline 端点返回)",testId:"debug-section-raw",children:[n?e.jsxs(e.Fragment,{children:[e.jsxs(i.Text,{type:"secondary",style:{fontSize:11},children:["events: ",n.events.length," · artifacts: spec=",n.artifacts.spec.length," archive=",n.artifacts.archive.length," ","changelog=",n.artifacts.changelog.length," template=",n.artifacts.template.length," code=",n.artifacts.code.length]}),e.jsx("pre",{style:te,children:JSON.stringify(n,null,2)})]}):e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"timeline 端点未返回(loading 或 error)"}),e.jsx(i.Text,{type:"secondary",style:{fontSize:11,display:"block",marginTop:8},children:t.agentSpawns.length>0?`agent_spawn 共 ${t.agentSpawns.length} 个,prompt/output 全文见 task detail JSON: GET /api/tasks/${t.id}`:"无 agent spawn"})]}),e.jsx(xe,{style:{margin:"12px 0"}}),e.jsx(ne,{title:"⑤ daemon 注入(additionalContext / systemMessage)",testId:"debug-section-injections",children:t.injections.length===0?e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"本任务无注入事件"}):e.jsxs(e.Fragment,{children:[e.jsxs(i.Text,{type:"secondary",style:{fontSize:11,display:"block",marginBottom:6},children:["共 ",t.injections.length," 条注入"]}),t.injections.map(u=>e.jsxs("div",{style:{marginBottom:8},children:[e.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",marginBottom:4,flexWrap:"wrap"},children:[e.jsx(m,{size:"small",color:u.injection_type==="systemMessage"?"arcoblue":"orange",children:u.injection_type}),e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:u.source_handler})]}),e.jsx("pre",{style:te,children:u.content})]},u.id))]})})]})}async function Sn(t){const n=await fetch(`/api/tasks/${encodeURIComponent(t)}/timeline`);if(!n.ok)throw new Error(`timeline HTTP ${n.status}`);return n.json()}function wn(t){try{return Z(E(t),"HH:mm:ss")}catch{return t.slice(11,19)}}function kn(t,n){if(t===null||t<0)return n==="task_end"?"进行中":"未知";if(t===0&&n!=="paired")return"未知";const o=(()=>{if(t<1e3)return`${t}ms`;const s=Math.round(t/1e3);return s<60?`${s}s`:`${Math.floor(s/60)}m${s%60}s`})();return n==="task_end"?`进行中 (≈${o})`:o}const Ve='"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif',_n={user_prompt:{icon:"👤",color:"gray",label:"用户"},daemon_enforce:{icon:"🚫",color:"red",label:"daemon 拦截"},agent_spawn:{icon:"🤝",color:"arcoblue",label:"agent spawn"},commit:{icon:"💾",color:"green",label:"commit"},decision_resolved:{icon:"✅",color:"green",label:"决策闭环"}};function Tn({ev:t}){const n=_n[t.kind];return e.jsxs("div",{"data-testid":`timeline-event-${t.kind}`,style:{display:"flex",alignItems:"flex-start",gap:12,padding:"8px 4px",borderBottom:"1px solid var(--color-border-2)"},children:[e.jsx(i.Text,{code:!0,type:"secondary",style:{fontSize:11,minWidth:70,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace"},children:wn(t.at)}),e.jsx("span",{style:{fontSize:14,minWidth:24,fontFamily:Ve,fontVariantEmoji:"emoji"},children:n.icon}),e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(zn,{ev:t})})]})}function zn({ev:t}){switch(t.kind){case"user_prompt":return e.jsxs("div",{children:[e.jsx(i.Text,{style:{fontSize:12,fontWeight:500},children:"用户"}),e.jsxs(i.Paragraph,{style:{fontSize:12,color:"var(--color-text-2)",margin:"4px 0 0",whiteSpace:"pre-wrap"},ellipsis:{rows:3,expandable:!0},children:['"',t.text,'"']})]});case"daemon_enforce":return e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:500},children:[t.decision==="deny"?"daemon 拒绝":"daemon 警告"," ",t.tool]}),e.jsx(m,{size:"small",color:t.decision==="deny"?"red":"orange",children:ln(t.rule_id)})]}),t.hint&&e.jsx(i.Text,{type:"secondary",style:{fontSize:11,display:"block",marginTop:2},children:t.hint.slice(0,200)})]});case"agent_spawn":{const{ids:n,cleanedPrompt:o}=an(t.prompt_preview);return e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:500},children:["主线程 spawn ",t.subagent_type??"?"]}),e.jsxs(i.Text,{type:"secondary",style:{fontSize:11},children:["(",kn(t.duration_ms,t.duration_source),")"]}),n.map(s=>e.jsx(Re,{to:`/decisions/${s}`,style:{textDecoration:"none"},title:`查看决策 ${s}`,children:e.jsxs(m,{size:"small",color:"purple",style:{cursor:"pointer"},children:[e.jsx("span",{style:{fontFamily:Ve},children:"📋"})," ","决策 ",s.slice(0,8)]})},s))]}),e.jsxs("div",{style:{marginTop:4,marginLeft:12,fontSize:11,color:"var(--color-text-3)"},children:[e.jsx("span",{children:"└─ "}),e.jsxs(i.Text,{type:"secondary",style:{fontSize:11},children:["prompt ",t.prompt_length," chars · output ",t.output_length," chars"]})]}),o&&e.jsx(i.Paragraph,{style:{fontSize:11,color:"var(--color-text-3)",margin:"4px 0 0 24px",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",whiteSpace:"pre-wrap"},ellipsis:{rows:2,expandable:!0},children:o})]})}case"commit":return e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[e.jsx(i.Text,{style:{fontSize:12,fontWeight:500},children:"提交"}),e.jsx(i.Text,{code:!0,style:{fontSize:11,color:"var(--cf-tag-green)"},children:t.hash})]}),t.message_preview&&e.jsx(i.Text,{style:{fontSize:11,display:"block",marginTop:2},children:t.message_preview})]});case"decision_resolved":return e.jsx("div",{children:e.jsxs(i.Text,{style:{fontSize:12,fontWeight:500},children:["决策闭环"," ",e.jsx(i.Text,{code:!0,style:{fontSize:11},children:t.decision_id})]})});default:return null}}function Cn({artifacts:t}){const n=Object.keys(t).map(o=>({key:o,label:o==="spec"?"📄 spec":o==="archive"?"📦 归档":o==="changelog"?"📝 changelog":o==="template"?"🧱 模板":"⚙ 代码",count:t[o].length,example:t[o][0]??"-"})).filter(o=>o.count>0);return e.jsxs("div",{"data-testid":"artifacts-table",style:{marginTop:16},children:[e.jsx(i.Text,{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:6},children:"产物总览"}),n.length===0?e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"(本任务无产物)"}):e.jsx(St,{size:"small",pagination:!1,data:n,columns:[{title:"类型",dataIndex:"label",width:120},{title:"数量",dataIndex:"count",width:80},{title:"示例路径",dataIndex:"example",render:o=>e.jsx(i.Text,{code:!0,style:{fontSize:11,wordBreak:"break-all"},children:o})}]})]})}function In({data:t}){const[n,o]=T.useState(!1),{data:s,isLoading:r,isError:a}=G({queryKey:["task-timeline",t.id],queryFn:()=>Sn(t.id),staleTime:3e4,retry:1});if(a)throw new Error("timeline fetch failed");return e.jsxs(z,{bordered:!0,style:{marginBottom:16,background:"var(--cf-kpi-wash-blue, #F2F9FF)"},"data-testid":"task-timeline-view",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:[e.jsxs(i.Text,{style:{fontSize:13,fontWeight:600,display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(Te,{style:{color:"var(--cf-tag-blue)"}}),"任务详情 · 时间线"]}),e.jsx(A,{size:"mini",type:"text",icon:e.jsx(vt,{}),onClick:()=>o(!0),"data-testid":"debug-drawer-toggle",title:"高级调试信息(仅故障排查时使用)",children:"调试"})]}),r&&e.jsx("div",{"data-testid":"task-timeline-loading",children:e.jsx(re,{animation:!0,text:{rows:6}})}),s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-testid":"task-timeline-events",children:s.events.length===0?e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"(时间线无事件)"}):s.events.map((x,c)=>e.jsx(Tn,{ev:x},`${x.at}-${x.kind}-${c}`))}),e.jsx(Cn,{artifacts:s.artifacts})]}),e.jsx(vn,{data:t,timeline:s??null,visible:n,onClose:()=>o(!1)})]})}function $n(t){return!t||t==="success"?new Set:t==="failed"||t==="partial"?new Set(["execution"]):t==="abandoned"?new Set(["outcome"]):new Set}function Mn(t){const n=t.get("expand");if(!n)return new Set;const o=new Set;for(const s of n.split(",")){const r=s.trim();(r==="intent"||r==="decision"||r==="execution"||r==="outcome")&&o.add(r)}return o}function Bn(t){return["intent","decision","execution","outcome"].filter(o=>t.has(o)).join(",")}class Fn extends T.Component{constructor(){super(...arguments);Me(this,"state",{errored:!1})}static getDerivedStateFromError(){return{errored:!0}}componentDidCatch(o,s){console.warn("[TaskTimelineView] fallback to 4-card; error:",o.message,s)}render(){return this.state.errored?this.props.fallback:this.props.children}}function En({data:t}){const[n,o]=we(),s=T.useMemo(()=>{const l=Mn(n);return l.size>0?l:$n(t.outcome)},[n,t.outcome]),r=T.useCallback(l=>{const b=new Set(s);b.has(l)?b.delete(l):b.add(l);const g=Bn(b),k=new URLSearchParams(n);g?k.set("expand",g):k.delete("expand"),o(k,{replace:!0})},[s,n,o]),a=T.useMemo(()=>Ue(t),[t]),x=T.useMemo(()=>nn(a,t),[a,t]),c=T.useMemo(()=>sn(a,t),[a,t]);if(T.useMemo(()=>Je(a),[a]))return e.jsx(bn,{data:t,summary:a});const h=e.jsxs(z,{bordered:!0,style:{marginBottom:16,background:"var(--cf-kpi-wash-blue, #F2F9FF)"},"data-testid":"tier-container",children:[e.jsxs(i.Text,{style:{fontSize:13,fontWeight:600,display:"inline-flex",alignItems:"center",gap:6,marginBottom:8},children:[e.jsx(Te,{style:{color:"var(--cf-tag-blue)"}}),"任务详情"]}),e.jsx(tn,{banner:x,taskId:t.id,startedAt:t.start_time}),e.jsx(ue,{cardId:"intent",idx:1,title:"用户意图",oneLine:c.intent,expanded:s.has("intent"),onToggle:()=>r("intent"),detail:e.jsx(dn,{s:a})}),e.jsx(ue,{cardId:"decision",idx:2,title:"系统决策",oneLine:c.decision,expanded:s.has("decision"),onToggle:()=>r("decision"),detail:e.jsx(pn,{s:a})}),e.jsx(ue,{cardId:"execution",idx:3,title:"执行",oneLine:c.execution,expanded:s.has("execution"),onToggle:()=>r("execution"),detail:e.jsx(mn,{s:a,data:t})}),e.jsx(ue,{cardId:"outcome",idx:4,title:"结果",oneLine:c.outcome,expanded:s.has("outcome"),onToggle:()=>r("outcome"),detail:e.jsx(un,{s:a,data:t})}),e.jsx(hn,{taskId:t.id,outcome:t.outcome??null,pendingSpecs:t.pendingSpecs})]});return e.jsx(Fn,{fallback:h,children:e.jsx(In,{data:t})})}async function Ln(){const t=await fetch("/api/insights/badge?days=7");if(!t.ok)throw new Error(`badge HTTP ${t.status}`);return t.json()}function Wn({slot:t}={}){const{data:n,isLoading:o,isError:s}=G({queryKey:["daemon-observer-badge"],queryFn:Ln,refetchInterval:6e4,retry:1});if(o)return e.jsx("div",{"data-testid":"daemon-observer-badge-loading",style:{marginBottom:12},children:e.jsx(re,{animation:!0,text:{rows:1,width:360}})});if(s||!n)return null;const r=n.denied_7d??0,a=n.hinted_7d??0,x=n.trivial_passed_7d??0;return e.jsxs("div",{"data-testid":"daemon-observer-badge",style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",padding:"6px 10px",marginBottom:12,border:"1px solid var(--color-border-2)",borderRadius:4,background:"var(--color-bg-1)",fontSize:12},children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"本周 daemon:"}),e.jsxs(m,{size:"small",color:"red","data-testid":"daemon-observer-denied",children:["🚫 拒 ",r," 次"]}),e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"·"}),e.jsxs(m,{size:"small",color:"orange","data-testid":"daemon-observer-hinted",children:["⚡ hint ",a," 次"]}),e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"·"}),e.jsxs(m,{size:"small",color:"green","data-testid":"daemon-observer-trivial",children:["✓ 通过 ",x," 个 trivial"]})]})}async function Nn(t){const n=await fetch(`/api/tasks/${t}`);if(!n.ok)throw new Error("Failed to fetch task detail");const o=await n.json();return{...o.task,userPrompts:o.userPrompts??[],injections:(o.injections??[]).map(s=>({id:s.id,timestamp:s.timestamp,source_handler:s.source_handler,injection_type:s.injection_type,content:s.content,metadata_json:s.metadata_json??null})),timeline:(o.timeline??[]).map((s,r)=>({id:`${s.timestamp}-${s.tool_name??s.kind}-${r}`,timestamp:s.timestamp,kind:s.kind??"tool",tool_name:s.tool_name??null,hook_type:s.hook_type,input:s.input,output:s.output,is_agent_call:s.is_agent_call,agent_detail:s.agent_detail,notification:s.notification})),skillInvocations:o.skillInvocations??[],artifacts:o.artifacts??[],pendingSpecs:o.pendingSpecs??[],agentSpawns:o.agentSpawns??[]}}function Pn(t){switch(t){case"Read":return e.jsx(Bt,{style:{color:"var(--color-text-3)"}});case"Edit":return e.jsx(Mt,{style:{color:"var(--cf-tag-orange)"}});case"Write":return e.jsx(ie,{style:{color:"var(--cf-tag-green)"}});case"Bash":return e.jsx($t,{style:{color:"var(--cf-tag-orange)"}});case"Agent":case"Task":return e.jsx(Te,{style:{color:"var(--cf-tag-blue)"}});case"Grep":case"Glob":return e.jsx(It,{style:{color:"var(--cf-tag-purple)"}});case"WebSearch":case"WebFetch":return e.jsx(Ct,{style:{color:"#14C9C9"}});default:return e.jsx(zt,{style:{color:"var(--color-text-3)"}})}}function Ne(t,n){const o=E(t).getTime()-E(n).getTime();return o<1e3?"+0s":o<6e4?`+${Math.floor(o/1e3)}s`:o<36e5?`+${Math.floor(o/6e4)}m${Math.floor(o%6e4/1e3)}s`:`+${Math.floor(o/36e5)}h${Math.floor(o%36e5/6e4)}m`}function Rn(t){return t==="completed"?e.jsx(m,{color:"green",icon:e.jsx(le,{}),children:"已完成"}):t==="active"?e.jsx(m,{color:"arcoblue",icon:e.jsx(ke,{spin:!0}),children:"进行中"}):t==="abandoned"?e.jsx(m,{color:"gray",children:"已放弃"}):e.jsx(m,{color:"gray",children:t})}function Pe(t){return t==="success"?e.jsx(m,{color:"green",size:"small",children:"成功"}):t==="partial"?e.jsx(m,{color:"orange",size:"small",children:"部分"}):t==="failed"?e.jsx(m,{color:"red",size:"small",children:"失败"}):t==="abandoned"?e.jsx(m,{color:"gray",size:"small",children:"放弃"}):e.jsx(m,{size:"small",children:t})}function Dn({taskId:t}){var h;const[n,o]=T.useState(new Set),{data:s,isLoading:r,error:a}=G({queryKey:["task-detail",t],queryFn:()=>Nn(t),enabled:!!t,refetchInterval:1e4});if(r)return e.jsx(z,{bordered:!0,children:e.jsx(re,{animation:!0,text:{rows:6}})});if(a||!s)return e.jsx(z,{bordered:!0,children:e.jsxs(i.Text,{type:"error",children:["加载失败: ",(a==null?void 0:a.message)||"未知错误"]})});const x=l=>{o(b=>{const g=new Set(b);return g.has(l)?g.delete(l):g.add(l),g})},c=s.end_time?`${Math.round((E(s.end_time).getTime()-E(s.start_time).getTime())/1e3)}s`:"进行中",u=s.userPrompts.length===0&&s.injections.length===0&&s.timeline.length===0&&s.skillInvocations.length===0&&s.artifacts.length===0;return e.jsxs("div",{children:[e.jsxs(z,{bordered:!0,style:{marginBottom:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:12,marginBottom:16},children:[e.jsx(i.Title,{heading:6,style:{margin:0},children:qt(s.title,(h=s.userPrompts[0])==null?void 0:h.content)}),e.jsxs("span",{style:{display:"inline-flex",gap:6},children:[Rn(s.status),s.outcome&&Pe(s.outcome)]})]}),e.jsx(wt,{colon:" :",size:"small",column:2,data:[{label:"开始时间",value:Z(E(s.start_time),"MM-dd HH:mm:ss")},{label:"结束时间",value:s.end_time?Z(E(s.end_time),"MM-dd HH:mm:ss"):"-"},{label:"持续时间",value:c},{label:"事件数",value:s.event_count},...s.outcome?[{label:"结果",value:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[Pe(s.outcome),s.outcome_reason&&e.jsx(i.Text,{type:"secondary",style:{fontSize:11},children:s.outcome_reason})]})}]:[],...typeof s.commit_count=="number"?[{label:"提交数",value:e.jsxs("span",{children:[s.commit_count,typeof s.reverted_commits=="number"&&s.reverted_commits>0&&e.jsxs(i.Text,{type:"secondary",style:{fontSize:11,marginLeft:4},children:["(",s.reverted_commits," reverted)"]})]})}]:[]]})]}),e.jsx(Wn,{slot:"task-detail"}),e.jsx(En,{data:s}),u&&e.jsx(z,{bordered:!0,children:e.jsx(se,{icon:e.jsx(Fe,{style:{fontSize:32,color:"var(--color-text-4)"}}),description:e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500},children:"该任务暂无可展示的执行内容"}),e.jsx("div",{style:{fontSize:12,color:"var(--color-text-3)",marginTop:4},children:"事件可能仍在记录中,稍后刷新查看"})]})})}),s.timeline.length>0&&e.jsxs(z,{bordered:!0,style:{marginBottom:16},children:[e.jsxs(i.Text,{style:{fontSize:13,fontWeight:600,display:"inline-flex",alignItems:"center",gap:6,marginBottom:16},children:[e.jsx(Fe,{style:{color:"var(--color-text-3)"}}),"执行时间线",e.jsx(m,{size:"small",color:"gray",children:s.timeline.length})]}),e.jsx(ve,{children:s.timeline.map((l,b)=>{var y,S,w,W,_,C,U,V,ae;if(l.kind==="notification"){const R=((y=l.notification)==null?void 0:y.message)??"通知",j=((S=l.notification)==null?void 0:S.notification_type)??null;return e.jsx(ve.Item,{dot:e.jsx(kt,{style:{color:"var(--cf-tag-orange)"}}),label:Ne(l.timestamp,s.start_time),labelPosition:"relative",dotType:"hollow",children:e.jsxs("div",{style:{padding:4},"data-testid":"timeline-notification",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[e.jsx(i.Text,{style:{fontSize:13,fontWeight:500,color:"var(--cf-tag-orange)"},children:"通知"}),j&&e.jsx(m,{size:"small",color:"orange",children:j})]}),e.jsx(i.Text,{type:"secondary",style:{fontSize:12,display:"block",marginTop:2},children:R})]})},l.id||b)}const g=l.is_agent_call,k=l.tool_name==="Edit"||l.tool_name==="Write",f=n.has(b),M=l.input,N=M==null?void 0:M.file_path,P=(M==null?void 0:M.description)||(M==null?void 0:M.command),L=(w=l.agent_detail)==null?void 0:w.status,B=((W=l.agent_detail)==null?void 0:W.changed_files)??[],H=g?s.agentSpawns.find(R=>{var j;return R.timestamp===l.timestamp&&(R.subagent_type??void 0)===((j=l.agent_detail)==null?void 0:j.subagent_type)})??s.agentSpawns.find(R=>R.timestamp===l.timestamp):void 0,q=g?L==="running"?e.jsx(ke,{spin:!0,style:{color:"var(--cf-tag-orange)"}}):e.jsx(le,{style:{color:"var(--cf-tag-green)"}}):Pn(l.tool_name);return e.jsx(ve.Item,{dot:q,label:Ne(l.timestamp,s.start_time),labelPosition:"relative",dotType:"hollow",children:e.jsxs("div",{onClick:()=>x(b),style:{cursor:"pointer",padding:4,borderRadius:4},"data-testid":g?"timeline-agent-call":void 0,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[g?e.jsx(i.Text,{style:{fontSize:13,fontWeight:600,color:L==="running"?"var(--cf-tag-orange)":"var(--cf-tag-green)"},children:L==="running"?`⏳ ${((_=l.agent_detail)==null?void 0:_.subagent_type)??"子 agent"} 进行中`:`✅ ${((C=l.agent_detail)==null?void 0:C.subagent_type)??"子 agent"} 完成`}):e.jsx(i.Text,{style:{fontSize:13,fontWeight:500,color:"var(--color-text-1)"},children:l.tool_name}),g&&B.length>0&&e.jsxs(m,{size:"small",color:"green",children:[B.length," 文件"]}),!g&&((U=l.agent_detail)==null?void 0:U.subagent_type)&&e.jsx(m,{size:"small",color:"arcoblue",children:l.agent_detail.subagent_type}),((V=l.agent_detail)==null?void 0:V.name)&&e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:l.agent_detail.name})]}),g&&!f&&((ae=l.agent_detail)==null?void 0:ae.description)&&e.jsx(i.Text,{type:"secondary",style:{fontSize:11,display:"block",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.agent_detail.description}),!f&&k&&N&&e.jsx(i.Text,{style:{fontSize:11,fontFamily:"monospace",color:"var(--cf-tag-green)",display:"block",marginTop:2},title:N,children:N}),!f&&!k&&P&&e.jsx(i.Text,{type:"secondary",style:{fontSize:11,display:"block",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:P}),f&&e.jsxs("div",{onClick:R=>R.stopPropagation(),style:{marginTop:8,display:"flex",flexDirection:"column",gap:8},children:[g&&l.agent_detail&&e.jsxs(z,{size:"small",bordered:!0,style:{background:"var(--cf-kpi-wash-blue, #E8F3FF)"},children:[l.agent_detail.subagent_type&&e.jsxs("div",{style:{fontSize:12,marginBottom:4},children:[e.jsx(i.Text,{type:"secondary",children:"subagent_type:"})," ",e.jsx(i.Text,{code:!0,children:l.agent_detail.subagent_type})]}),l.agent_detail.name&&e.jsxs("div",{style:{fontSize:12,marginBottom:4},children:[e.jsx(i.Text,{type:"secondary",children:"name:"})," ",e.jsx(i.Text,{code:!0,children:l.agent_detail.name})]}),l.agent_detail.prompt&&e.jsxs("div",{children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"prompt:"}),e.jsx("pre",{style:{fontSize:11,background:"#fff",border:"1px solid var(--color-border-2)",borderRadius:4,padding:8,marginTop:4,maxHeight:200,overflow:"auto",whiteSpace:"pre-wrap"},children:l.agent_detail.prompt})]}),B.length>0&&e.jsxs("div",{style:{marginTop:8},"data-testid":"agent-changed-files",children:[e.jsxs(i.Text,{type:"secondary",style:{fontSize:12},children:["改动文件 (",B.length,"):"]}),e.jsx("div",{style:{marginTop:4,display:"flex",flexDirection:"column",gap:2},children:B.map(R=>e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(ie,{style:{color:"var(--cf-tag-green)"}}),e.jsx(i.Text,{code:!0,style:{fontSize:11},title:R,children:R})]},R))})]}),(H==null?void 0:H.output)&&e.jsxs("div",{style:{marginTop:8},children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"报告全文:"}),e.jsx("pre",{style:{fontSize:11,background:"#fff",border:"1px solid var(--color-border-2)",borderRadius:4,padding:8,marginTop:4,maxHeight:320,overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:H.output})]}),L==="running"&&e.jsx(i.Text,{type:"secondary",style:{fontSize:12,display:"block",marginTop:8},children:"⏳ 子 agent 仍在执行,报告尚未返回"})]}),k&&N&&e.jsxs(z,{size:"small",bordered:!0,children:[e.jsx(i.Text,{type:"secondary",style:{fontSize:12},children:"file:"})," ",e.jsx(i.Text,{code:!0,style:{color:"var(--cf-tag-green)"},children:N})]}),!g&&P&&e.jsx(z,{size:"small",bordered:!0,children:e.jsx("pre",{style:{fontSize:11,color:"var(--color-text-2)",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:160,overflow:"auto"},children:P})})]})]})},l.id||b)})})]}),s.skillInvocations.length>0&&e.jsxs(z,{bordered:!0,style:{marginBottom:16},children:[e.jsxs(i.Text,{style:{fontSize:13,fontWeight:600,display:"inline-flex",alignItems:"center",gap:6,marginBottom:12},children:[e.jsx(_t,{style:{color:"var(--cf-tag-purple)"}}),"Skill 调用",e.jsx(m,{size:"small",color:"gray",children:s.skillInvocations.length})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:s.skillInvocations.map(l=>e.jsxs(z,{size:"small",bordered:!0,style:{borderColor:"var(--cf-tag-purple)",background:"var(--cf-kpi-wash-purple, #F5E8FF)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:4},children:[e.jsx(i.Text,{style:{fontFamily:"monospace",fontSize:13,fontWeight:500,color:"var(--cf-tag-purple)"},children:l.skill_id}),l.workflow&&e.jsx(m,{size:"small",color:"purple",children:l.workflow}),l.phase&&e.jsxs(m,{size:"small",color:"purple",children:["phase: ",l.phase]})]}),e.jsx(i.Text,{style:{fontSize:12,color:"var(--color-text-2)"},children:l.reason})]},l.id))})]}),s.artifacts.length>0&&e.jsxs(z,{bordered:!0,children:[e.jsxs(i.Text,{style:{fontSize:13,fontWeight:600,display:"inline-flex",alignItems:"center",gap:6,marginBottom:12},children:[e.jsx(Tt,{style:{color:"var(--cf-tag-green)"}}),"产物",e.jsxs(m,{size:"small",color:"gray",children:[s.artifacts.length," 个文件"]})]}),e.jsx(Ee,{size:"small",dataSource:s.artifacts,render:l=>e.jsx(Ee.Item,{style:{padding:"6px 12px"},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[e.jsx(ie,{style:{color:"var(--cf-tag-green)"}}),e.jsx(i.Text,{code:!0,style:{fontSize:12},title:l,children:l})]})},l)})]})]})}async function An(t){const n=await fetch(`/api/sessions/${t}/detail`);if(!n.ok)throw new Error("Failed to fetch session detail");return n.json()}function Hn({sessionId:t}){const{data:n,isLoading:o,error:s}=G({queryKey:["session-detail",t],queryFn:()=>An(t),enabled:!!t});return o?e.jsx("div",{className:"p-6 text-gray-500",children:"加载中..."}):s||!n?e.jsx("div",{className:"p-6 text-red-600",children:"加载失败"}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Session ID"}),e.jsx("div",{className:"text-sm font-mono text-gray-900 break-all",children:n.session.session_id})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 pb-4 border-b border-gray-200",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-gray-500",children:"事件数"}),e.jsx("div",{className:"text-lg font-semibold",children:n.session.event_count})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-gray-500",children:"任务数"}),e.jsx("div",{className:"text-lg font-semibold",children:n.tasks.length})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-gray-500",children:"开始时间"}),e.jsx("div",{className:"text-sm",children:n.session.start_time?Z(E(n.session.start_time),"MM-dd HH:mm:ss"):"-"})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"任务列表"}),e.jsx("div",{className:"space-y-3",children:n.tasks.map(r=>e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900 flex-1 mr-2",children:r.title}),e.jsx("span",{className:Ut("px-2 py-0.5 text-xs font-medium rounded-full whitespace-nowrap",r.status==="completed"&&"bg-green-100 text-green-700",r.status==="active"&&"bg-blue-100 text-blue-700",r.status==="abandoned"&&"bg-gray-100 text-gray-600"),children:r.status})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-3 text-xs",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-gray-500 mb-1 flex items-center gap-1",children:[e.jsx(Jt,{className:"h-3 w-3"}),"工具使用"]}),e.jsx("div",{className:"space-y-0.5",children:Object.entries(r.summary.toolUsage).slice(0,4).map(([a,x])=>e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:a}),e.jsx("span",{className:"font-mono text-gray-900",children:x})]},a))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-gray-500 mb-1 flex items-center gap-1",children:[e.jsx(Gt,{className:"h-3 w-3"}),"文件变更"]}),e.jsxs("div",{className:"text-gray-700",children:[r.summary.filesChanged.length," 个"]}),r.summary.filesChanged.slice(0,3).map(a=>e.jsx("div",{className:"text-gray-500 truncate text-[10px]",title:a,children:a.split("/").pop()},a))]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-gray-500 mb-1 flex items-center gap-1",children:[e.jsx(Vt,{className:"h-3 w-3"}),"提交"]}),e.jsxs("div",{className:"text-gray-700",children:[r.summary.commits.length," 次"]})]})]}),r.prompts.length>0&&e.jsxs("div",{className:"border-t border-gray-100 pt-3",children:[e.jsxs("div",{className:"text-xs text-gray-500 mb-2 flex items-center gap-1",children:[e.jsx(Yt,{className:"h-3 w-3"}),"用户提示 (",r.prompts.length,")"]}),e.jsxs("div",{className:"space-y-1.5",children:[r.prompts.slice(0,3).map((a,x)=>e.jsx("div",{className:"text-xs bg-gray-50 rounded p-2",children:e.jsx("p",{className:"text-gray-700 line-clamp-2",children:a.content})},x)),r.prompts.length>3&&e.jsxs("div",{className:"text-xs text-gray-400",children:["还有 ",r.prompts.length-3," 条..."]})]})]})]},r.id))})]})]})}const On=720;function qn(t){const n=t.get("task");if(n)return{kind:"task",id:n,paramKey:"task"};const o=t.get("session");return o?{kind:"session",id:o,paramKey:"session"}:null}function Kn(t){switch(t.kind){case"session":return`会话: ${t.id.slice(0,8)}...`;case"task":return`任务: ${t.id.slice(0,8)}...`}}function Un(){const[t,n]=we(),o=T.useMemo(()=>qn(t),[t]),s=()=>{if(!o)return;const a=new URLSearchParams(t);a.delete(o.paramKey),n(a,{replace:!1})},r=!!o;return e.jsx(Ke,{title:o?Kn(o):"",width:On,placement:"right",visible:r,onCancel:s,footer:null,maskClosable:!0,unmountOnExit:!0,children:o?e.jsx(Jn,{target:o}):null})}function Jn({target:t}){return t.kind==="session"?e.jsx(Hn,{sessionId:t.id}):e.jsx(Dn,{taskId:t.id})}const Gn=[{key:"all",label:"全部",color:"gray"},{key:"success",label:"✅ 成功",color:"green"},{key:"partial",label:"⚠️ 部分",color:"orange"},{key:"failed",label:"❌ 失败",color:"red"},{key:"abandoned",label:"🛑 放弃",color:"gray"},{key:"none",label:"🔄 进行中",color:"arcoblue",hideWhenZero:!0},{key:"answered",label:"💬 已答复",color:"cyan",hideWhenZero:!0}];function Vn({active:t,counts:n,onChange:o}){return e.jsx("div",{style:{display:"inline-flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:Gn.map(s=>{const r=s.key===t,a=n[s.key]??0;return s.hideWhenZero&&a===0&&!r?null:e.jsxs(m,{checkable:!0,checked:r,onCheck:()=>o(s.key),color:r?s.color:void 0,style:{cursor:"pointer",fontSize:12,fontWeight:r?600:400,borderColor:r?void 0:"var(--color-border-2)"},children:[s.label," ",e.jsxs("span",{style:{opacity:.7,marginLeft:2},children:["(",a,")"]})]},s.key)})})}async function Yn(t,n={}){const o=new URLSearchParams;o.set("window",String(n.windowDays??30)),t&&o.set("project",t),n.limit!=null&&o.set("limit",String(n.limit)),n.offset!=null&&o.set("offset",String(n.offset)),n.includeSystem&&o.set("include_kinds","user,agent-callback,image,system");const s=await fetch(`/api/insights/agent-board?${o.toString()}`);if(!s.ok)throw new Error(`API ${s.status}`);return s.json()}async function Qn(t,n={}){const o=new URLSearchParams;o.set("window",String(n.windowDays??30)),o.set("rows","prompt"),t&&o.set("project",t),n.limit!=null&&o.set("limit",String(n.limit)),n.offset!=null&&o.set("offset",String(n.offset)),n.includeSystem&&o.set("include_kinds","user,agent-callback,image,system"),n.outcome&&n.outcome!=="all"&&o.set("outcome",n.outcome);const s=(n.search??"").trim();s&&o.set("search",s);const r=await fetch(`/api/insights/agent-board?${o.toString()}`);if(!r.ok)throw new Error(`API ${r.status}`);return r.json()}function Zn(t){try{return Z(E(t),"MM-dd HH:mm")}catch{return t}}function Ye(t){if(t==null)return"—";if(t<60)return`${t}s`;if(t<3600)return`${Math.round(t/60)}m`;const n=Math.floor(t/3600),o=Math.round(t%3600/60);return o>0?`${n}h ${o}m`:`${n}h`}function Qe(t){const n=Date.now()-E(t).getTime();return n<6e4?"刚刚":n<36e5?`${Math.round(n/6e4)}m 前`:n<864e5?`${Math.round(n/36e5)}h 前`:`${Math.round(n/864e5)}d 前`}function Xn(t){switch(t){case"agent-callback":return"回调";case"image":return"图片";case"system":return"系统";case"user":default:return""}}function es(t){return t!=="user"}const Ze={pending:{text:"待处理",color:"gray"},active:{text:"进行中",color:"arcoblue"},abandoned:{text:"中断",color:"orange"},completed:{text:"完成",color:"green"}};function ts({row:t,group:n,onOpen:o}){const s=t.prompt_text||"(空 prompt)",r=s.length>160?`${s.slice(0,160)}…`:s,a=(n==null?void 0:n.lane)??"active",x=Ze[a];return e.jsx(z,{bordered:!0,hoverable:!0,onClick:()=>o(t.group_id),"data-prompt-row":t.event_id,"data-group-id":t.group_id,style:{marginBottom:8,background:"var(--color-bg-1)",borderLeft:"3px solid var(--color-border-2)",cursor:"pointer"},bodyStyle:{padding:"10px 14px"},children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx(Q,{content:s,children:e.jsxs(i.Text,{style:{fontSize:13,color:"var(--color-text-1)"},children:["💬 ",r]})}),e.jsxs("div",{style:{display:"flex",gap:8,fontSize:11,color:"var(--color-text-3)",flexWrap:"wrap",alignItems:"center",marginTop:4},children:[e.jsx("span",{style:{fontFamily:"monospace"},children:t.event_id.slice(0,8)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:Qe(t.prompt_ts)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:Zn(t.prompt_ts)})]})]}),e.jsx("div",{style:{flexShrink:0},children:n!=null&&n.outcome?e.jsx(Qt,{value:n.outcome}):e.jsx(m,{color:x.color,size:"small",children:x.text})})]})})}const ns=[{key:"pending",emoji:"🆕",title:"待处理",bg:"#f5f6f7",border:"#dadce0"},{key:"active",emoji:"🔄",title:"进行中",bg:"#eaf2ff",border:"#bcd2ff"},{key:"abandoned",emoji:"⏸",title:"中断",bg:"#fff5e8",border:"#ffd591"},{key:"failed",emoji:"❌",title:"失败",bg:"#fff1f0",border:"#ffccc7"},{key:"done",emoji:"✅",title:"完成",bg:"#e8faef",border:"#b8e8ca"}];function ss({def:t,cards:n,onOpen:o,limit:s,onLoadMore:r}){const a=n.slice(0,s),x=Math.max(0,n.length-a.length);return e.jsxs("div",{"data-lane":t.key,style:{flex:1,minWidth:240,background:t.bg,border:`1px solid ${t.border}`,borderRadius:8,padding:12,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[e.jsx("span",{style:{fontSize:16},children:t.emoji}),e.jsx(i.Text,{style:{fontSize:13,fontWeight:600},children:t.title}),e.jsx(m,{size:"small",style:{marginLeft:"auto"},children:n.length})]}),e.jsxs("div",{style:{flex:1,maxHeight:"calc(100vh - 300px)",overflowY:"auto",paddingRight:4},children:[n.length===0?e.jsx("div",{style:{padding:"16px 0",display:"flex",justifyContent:"center",opacity:.6},children:e.jsx(se,{description:"无任务"})}):a.map(c=>{const u=es(c.task_kind),h=u?"var(--color-fill-4)":c.status==="completed"?Zt(c.outcome):"var(--color-border-2)";return e.jsxs(z,{bordered:!0,size:"small",hoverable:!0,onClick:()=>o(c.task_id),"data-task-kind":c.task_kind,style:{marginBottom:8,background:u?"var(--color-fill-1)":"var(--color-bg-1)",borderLeft:`4px solid ${h}`,cursor:"pointer",opacity:u?.78:1},bodyStyle:{padding:"8px 10px"},children:[u&&e.jsx("div",{style:{marginBottom:4},children:e.jsx(m,{color:"gray",size:"small",style:{fontSize:10},children:Xn(c.task_kind)})}),e.jsx(i.Paragraph,{style:{margin:0,marginBottom:4,fontSize:12,fontWeight:600,lineHeight:1.35,wordBreak:"break-word",color:u?"var(--color-text-3)":void 0},children:c.title?c.title.length>80?c.title.slice(0,80)+"…":c.title:"(空 title)"}),e.jsxs("div",{style:{display:"flex",gap:4,fontSize:10.5,color:"var(--color-text-3)",flexWrap:"wrap"},children:[e.jsx("span",{children:Qe(c.start_time)}),c.duration_sec!==null&&e.jsxs("span",{children:["· ",Ye(c.duration_sec)]}),c.files_changed>0&&e.jsxs("span",{children:["· ",c.files_changed," files"]}),c.kb_pages.length>0&&e.jsxs("span",{children:["· ",c.kb_pages.length," KB"]})]})]},c.task_id)}),x>0&&e.jsx("div",{style:{paddingTop:4},children:e.jsxs(A,{size:"mini",long:!0,type:"text",onClick:r,style:{fontSize:11,color:"var(--color-text-3)"},children:["再看 30 条(剩 ",x,")"]})})]})]})}function gs(){const[t,n]=we(),o=ft(),{data:s}=G({queryKey:Ot(),queryFn:Ht,staleTime:3e4}),{project:r}=Rt(),a=(s==null?void 0:s.current)??"",x=At(r,a),c=t.get("outcome")??"all",u=t.get("view")==="kanban"?"kanban":"list",h=t.get("q")??"",{window:l}=Dt(),b=t.get("sys")==="1",g=[20,40,80],k=40,f=300,M=parseInt(t.get("page")??"1",10),N=parseInt(t.get("pageSize")??String(k),10),P=Number.isFinite(M)&&M>0?M:1,L=g.includes(N)?N:k,B=30,[H,q]=T.useState(B);T.useEffect(()=>{q(B)},[c,h,l]);const y=T.useRef(l);T.useEffect(()=>{if(y.current!==l&&(y.current=l,t.get("page")||t.get("pageSize"))){const p=new URLSearchParams(t);p.delete("page"),p.delete("pageSize"),n(p,{replace:!0})}},[l,t,n]);const S=u==="list"?L:f,w=u==="list"?(P-1)*L:0,W=De(),_=u==="list",{data:C,isLoading:U,isError:V,refetch:ae,isFetching:R}=G({queryKey:["tasks-hub",x,"kanban",S,w,b,l],queryFn:()=>Yn(x,{limit:S,offset:w,includeSystem:b,windowDays:l}),enabled:!_,refetchInterval:3e4,refetchIntervalInBackground:!1,placeholderData:Be}),{data:j,isLoading:Xe,isError:et,refetch:tt,isFetching:nt}=G({queryKey:["tasks-hub",x,"prompt",S,w,b,l,c,h],queryFn:()=>Qn(x,{limit:S,offset:w,includeSystem:b,windowDays:l,outcome:c,search:h}),enabled:_,refetchInterval:3e4,refetchIntervalInBackground:!1,placeholderData:Be}),[ge,he]=T.useState(!1);T.useEffect(()=>{if(typeof EventSource>"u")return;const p=x?`/api/events/stream?project=${encodeURIComponent(x)}`:"/api/events/stream",d=new EventSource(p);let v=null;const O=()=>{v&&clearTimeout(v),v=setTimeout(()=>{W.invalidateQueries({queryKey:["tasks-hub"]})},700)};return d.onopen=()=>he(!0),d.onmessage=F=>{try{const $=JSON.parse(F.data||"{}");if(($==null?void 0:$.type)==="connected"){he(!0);return}}catch{}O()},d.onerror=()=>{he(!1)},()=>{v&&clearTimeout(v),d.close()}},[x,W]);const ce=T.useMemo(()=>C?[...C.lanes.pending,...C.lanes.active,...C.lanes.abandoned,...C.lanes.completed]:[],[C]),st=T.useMemo(()=>{if(_){const v=j==null?void 0:j.window_aggregates;if(v)return{all:v.task_total,success:v.by_outcome.success,partial:v.by_outcome.partial,failed:v.by_outcome.failed,abandoned:v.by_outcome.abandoned,answered:v.by_outcome.answered,none:v.by_outcome.none};const O=j?Object.values(j.groups).filter($=>$.task_kind==="user"):[],F={all:O.length,success:0,partial:0,failed:0,abandoned:0,answered:0,none:0};for(const $ of O)$.outcome==="success"||$.outcome==="partial"||$.outcome==="failed"||$.outcome==="abandoned"?F[$.outcome]++:$.status==="abandoned"?F.abandoned++:F.none++;return F}const p=ce.filter(v=>v.task_kind==="user"),d={all:p.length,success:0,partial:0,failed:0,abandoned:0,answered:0,none:0};for(const v of p)v.outcome==="success"||v.outcome==="partial"||v.outcome==="failed"||v.outcome==="abandoned"?d[v.outcome]++:v.status==="abandoned"?d.abandoned++:d.none++;return d},[_,j,ce]),ot=T.useMemo(()=>{if(!C)return{pending:[],active:[],abandoned:[],failed:[],done:[]};const p=h.trim().toLowerCase(),d=$=>p?$.filter(I=>[I.title,...I.top_tools.map(me=>me.tool),...I.kb_pages.map(me=>me.name)].join(" ").toLowerCase().includes(p)):$,v=d(C.lanes.completed),O=v.filter($=>$.outcome==="failed"),F=v.filter($=>$.outcome!=="failed");return{pending:d(C.lanes.pending),active:d(C.lanes.active),abandoned:d(C.lanes.abandoned),failed:O,done:F}},[C,h]),J=T.useMemo(()=>{if(_){const I=j==null?void 0:j.window_aggregates,X=(j==null?void 0:j.total_in_window)??0;if(I){const D=I.task_total;return{total:D,failed:I.by_outcome.failed,intercepted:0,avgSec:I.avg_duration_sec??0,promptTotal:X,groupCount:D}}const je=(j?Object.values(j.groups):[]).filter(D=>D.task_kind==="user"),$e=je.length,dt=je.filter(D=>D.outcome==="failed").length,be=je.map(D=>D.duration_sec).filter(D=>typeof D=="number"&&D>0),pt=be.length>0?Math.round(be.reduce((D,mt)=>D+mt,0)/be.length):0;return{total:$e,failed:dt,intercepted:0,avgSec:pt,promptTotal:X,groupCount:$e}}const p=ce.filter(I=>I.task_kind==="user"),d=(C==null?void 0:C.total_in_window)??p.length,v=p.filter(I=>I.outcome==="failed").length,O=p.filter(I=>I.intercepts.deny+I.intercepts.warn>0).length,F=p.map(I=>I.duration_sec).filter(I=>typeof I=="number"&&I>0),$=F.length>0?Math.round(F.reduce((I,X)=>I+X,0)/F.length):0;return{total:d,failed:v,intercepted:O,avgSec:$,promptTotal:0,groupCount:d}},[_,j,ce,C]),de=T.useMemo(()=>j?j.rows:[],[j]),it=T.useMemo(()=>{const p=[],d=new Set;for(const v of de)d.has(v.group_id)||(d.add(v.group_id),p.push(v.group_id));return p},[de]),Y=p=>n(p,{replace:!1}),pe=p=>{p.delete("page"),p.delete("pageSize")},Ce=p=>{const d=new URLSearchParams(t);p==="all"?d.delete("outcome"):d.set("outcome",p),pe(d),Y(d)},rt=p=>{const d=new URLSearchParams(t);p==="list"?d.delete("view"):d.set("view",p),pe(d),Y(d)},lt=p=>{const d=new URLSearchParams(t);p?d.set("q",p):d.delete("q"),pe(d),Y(d)},at=p=>{const d=new URLSearchParams(t);p?d.set("sys","1"):d.delete("sys"),pe(d),Y(d)},ye=p=>{o(`/tasks/${p}`)},ct=p=>{const d=new URLSearchParams(t);p<=1?d.delete("page"):d.set("page",String(p)),Y(d)},Ie=p=>{const d=new URLSearchParams(t);p===k?d.delete("pageSize"):d.set("pageSize",String(p)),d.delete("page"),Y(d)};return e.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,height:"100%"},children:[e.jsxs(z,{bordered:!1,bodyStyle:{padding:"12px 16px"},style:{background:"var(--color-bg-1)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",marginBottom:12},children:[e.jsx(i.Title,{heading:5,style:{margin:0},children:"我的任务"}),e.jsxs(i.Text,{type:"secondary",style:{fontSize:12},children:["近 ",l,"d · ",_?"每行 = 1 条 user prompt(按任务分组)· 点行看执行链路":"看板按任务卡 · 点卡片看详情"]}),e.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:8,alignItems:"center"},children:[e.jsx(Q,{content:ge?"实时已连接(SSE)":"离线 · 30s 轮询兜底",children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:12,color:"var(--color-text-3)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:ge?"var(--cf-tag-green, #00B42A)":"var(--color-text-4, #C9CDD4)",display:"inline-block"}}),ge?"实时":"离线"]})}),e.jsxs(Se.Group,{type:"button",size:"small",value:u,onChange:p=>rt(p),children:[e.jsxs(Se,{value:"list",children:[e.jsx(Ft,{})," 列表"]}),e.jsxs(Se,{value:"kanban",children:[e.jsx(Et,{})," 看板"]})]}),e.jsx(A,{size:"small",icon:e.jsx(_e,{}),loading:_?nt:R,onClick:()=>_?tt():ae(),children:"刷新"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[e.jsx(Vn,{active:c,counts:st,onChange:Ce}),e.jsx(m,{checkable:!0,checked:b,onCheck:p=>at(p),size:"small",color:b?"arcoblue":void 0,"data-testid":"sys-toggle",children:"含系统任务"}),e.jsx(Lt.Search,{size:"small",placeholder:"搜索 title / tool / KB / file...",style:{width:280,marginLeft:"auto"},value:h,onChange:p=>lt(p),allowClear:!0})]})]}),e.jsx(z,{bordered:!0,bodyStyle:{padding:"12px 16px"},children:e.jsxs("div",{style:{display:"flex",gap:24,flexWrap:"wrap"},children:[e.jsx(ee,{title:e.jsxs("span",{style:{fontSize:12,color:"var(--color-text-3)"},children:["总任务数 (",l,"d)"]}),value:J.total,groupSeparator:!0}),_&&e.jsx(ee,{title:e.jsxs("span",{style:{fontSize:12,color:"var(--color-text-3)"},children:["prompt 数 (",l,"d)"]}),value:J.promptTotal,groupSeparator:!0}),e.jsx("div",{style:{cursor:"pointer"},onClick:()=>Ce("failed"),title:"点击筛选失败任务",children:e.jsx(ee,{title:e.jsx("span",{style:{fontSize:12,color:"#f44336"},children:"失败 (可点击 →)"}),value:J.failed,styleValue:{color:J.failed>0?"#f44336":void 0}})}),!_&&e.jsx(ee,{title:e.jsx("span",{style:{fontSize:12,color:"var(--color-text-3)"},children:"被拦截"}),value:J.intercepted,styleValue:{color:J.intercepted>0?"#ff9800":void 0}}),e.jsx(ee,{title:e.jsx("span",{style:{fontSize:12,color:"var(--color-text-3)"},children:"平均时长"}),value:Ye(J.avgSec)})]})}),_?et?e.jsx(z,{bordered:!0,children:e.jsx(se,{description:"加载失败"})}):Xe||!j?e.jsx(z,{bordered:!0,children:e.jsx(re,{animation:!0,text:{rows:6}})}):e.jsxs("div",{style:{flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column"},children:[de.length===0?e.jsxs(z,{bordered:!0,children:[e.jsx(se,{description:h.length>0?`近 ${l}d 无匹配「${h}」的 prompt(整窗)`:c!=="all"?`近 ${l}d 无 ${c} 任务`:`近 ${l}d 无 prompt(或被过滤掉)`}),(c!=="all"||h.length>0)&&e.jsxs(i.Text,{type:"secondary",style:{fontSize:11,display:"block",textAlign:"center",padding:12},children:["整窗无匹配;清空筛选/搜索 (",e.jsx(Re,{to:"?",children:"重置"}),")"]})]}):e.jsx("div",{style:{flex:1},children:it.map(p=>{const d=j.groups[p],v=de.filter(F=>F.group_id===p),O=Ze[(d==null?void 0:d.lane)??"active"];return e.jsxs("div",{style:{marginBottom:14},"data-group-section":p,children:[e.jsxs("div",{style:{position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:8,padding:"6px 10px",marginBottom:6,background:"var(--color-fill-1)",borderRadius:6,flexWrap:"wrap"},children:[e.jsxs(i.Text,{style:{fontSize:12,fontWeight:600,cursor:"pointer"},onClick:()=>ye(p),children:["🎯 ",(d==null?void 0:d.title)||"(空 title)"]}),e.jsx(m,{size:"small",color:O.color,children:O.text}),e.jsx(m,{size:"small",style:{fontFamily:"monospace"},children:p.slice(0,8)}),e.jsxs(i.Text,{type:"secondary",style:{fontSize:11},children:[(d==null?void 0:d.prompt_count)??v.length," 条 prompt"]})]}),v.map(F=>e.jsx(ts,{row:F,group:d,onOpen:ye},F.event_id))]},p)})}),((j==null?void 0:j.total_in_window)??0)>0&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 4px",gap:12,flexWrap:"wrap",borderTop:"1px solid var(--color-border-2)",marginTop:8},children:[e.jsxs(i.Text,{type:"secondary",style:{fontSize:11},children:["近 ",l,"d 共 ",(j==null?void 0:j.total_in_window)??0," 条 prompt(",(j==null?void 0:j.summary.total_groups)??0," 个分组)· 第 ",P," / ",Math.max(1,Math.ceil(((j==null?void 0:j.total_in_window)??0)/L))," 页",c!=="all"&&e.jsxs("span",{style:{marginLeft:8},children:["· 已筛选「",c,"」(整窗)"]}),h.length>0&&e.jsxs("span",{style:{marginLeft:8},children:["· 已搜索「",h,"」(整窗)"]})]}),e.jsx(Wt,{current:P,total:(j==null?void 0:j.total_in_window)??0,pageSize:L,sizeOptions:[...g],sizeCanChange:!0,showJumper:!0,size:"small",onChange:(p,d)=>{d!==L?Ie(d):ct(p)},onPageSizeChange:p=>Ie(p)})]})]}):V?e.jsx(z,{bordered:!0,children:e.jsx(se,{description:"加载失败"})}):U||!C?e.jsx(z,{bordered:!0,children:e.jsx(re,{animation:!0,text:{rows:6}})}):e.jsx("div",{style:{display:"flex",gap:12,flex:1,minHeight:0,overflowX:"auto"},children:ns.map(p=>e.jsx(ss,{def:p,cards:ot[p.key]??[],onOpen:ye,limit:H,onLoadMore:()=>q(d=>d+B)},p.key))}),e.jsx(Un,{})]})}export{gs as default};
6
+ //# sourceMappingURL=TasksHubPage-C2PLh3eg.js.map