agentic-qe 3.6.19 → 3.7.1

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 (369) hide show
  1. package/.claude/skills/pr-review/SKILL.md +1 -1
  2. package/.claude/skills/skills-manifest.json +6 -6
  3. package/README.md +43 -7
  4. package/package.json +3 -2
  5. package/scripts/generate-opencode-agents.ts +523 -0
  6. package/scripts/generate-opencode-skills.ts +318 -0
  7. package/scripts/rvf-baseline-benchmark.ts +843 -0
  8. package/v3/CHANGELOG.md +56 -0
  9. package/v3/README.md +7 -7
  10. package/v3/assets/skills/pr-review/SKILL.md +1 -1
  11. package/v3/dist/adapters/a2a/notifications/retry-queue.d.ts.map +1 -1
  12. package/v3/dist/adapters/a2a/notifications/retry-queue.js +2 -1
  13. package/v3/dist/adapters/a2a/notifications/retry-queue.js.map +1 -1
  14. package/v3/dist/adapters/a2a/notifications/subscription-store.d.ts.map +1 -1
  15. package/v3/dist/adapters/a2a/notifications/subscription-store.js +2 -1
  16. package/v3/dist/adapters/a2a/notifications/subscription-store.js.map +1 -1
  17. package/v3/dist/adapters/a2a/tasks/task-manager.d.ts.map +1 -1
  18. package/v3/dist/adapters/a2a/tasks/task-manager.js +4 -3
  19. package/v3/dist/adapters/a2a/tasks/task-manager.js.map +1 -1
  20. package/v3/dist/agents/claim-verifier/index.d.ts.map +1 -1
  21. package/v3/dist/agents/claim-verifier/index.js +2 -1
  22. package/v3/dist/agents/claim-verifier/index.js.map +1 -1
  23. package/v3/dist/audit/witness-chain.d.ts +148 -0
  24. package/v3/dist/audit/witness-chain.d.ts.map +1 -0
  25. package/v3/dist/audit/witness-chain.js +269 -0
  26. package/v3/dist/audit/witness-chain.js.map +1 -0
  27. package/v3/dist/cli/brain-commands.d.ts +39 -0
  28. package/v3/dist/cli/brain-commands.d.ts.map +1 -0
  29. package/v3/dist/cli/brain-commands.js +60 -0
  30. package/v3/dist/cli/brain-commands.js.map +1 -0
  31. package/v3/dist/cli/bundle.js +6790 -3274
  32. package/v3/dist/cli/command-registry.d.ts.map +1 -1
  33. package/v3/dist/cli/command-registry.js +3 -1
  34. package/v3/dist/cli/command-registry.js.map +1 -1
  35. package/v3/dist/cli/commands/hooks.d.ts.map +1 -1
  36. package/v3/dist/cli/commands/hooks.js +17 -2
  37. package/v3/dist/cli/commands/hooks.js.map +1 -1
  38. package/v3/dist/cli/commands/init.d.ts.map +1 -1
  39. package/v3/dist/cli/commands/init.js +2 -0
  40. package/v3/dist/cli/commands/init.js.map +1 -1
  41. package/v3/dist/cli/commands/learning-helpers.d.ts.map +1 -1
  42. package/v3/dist/cli/commands/learning-helpers.js +11 -0
  43. package/v3/dist/cli/commands/learning-helpers.js.map +1 -1
  44. package/v3/dist/cli/handlers/brain-handler.d.ts +22 -0
  45. package/v3/dist/cli/handlers/brain-handler.d.ts.map +1 -0
  46. package/v3/dist/cli/handlers/brain-handler.js +148 -0
  47. package/v3/dist/cli/handlers/brain-handler.js.map +1 -0
  48. package/v3/dist/cli/handlers/index.d.ts +1 -0
  49. package/v3/dist/cli/handlers/index.d.ts.map +1 -1
  50. package/v3/dist/cli/handlers/index.js +1 -0
  51. package/v3/dist/cli/handlers/index.js.map +1 -1
  52. package/v3/dist/cli/handlers/init-handler.d.ts +1 -0
  53. package/v3/dist/cli/handlers/init-handler.d.ts.map +1 -1
  54. package/v3/dist/cli/handlers/init-handler.js +3 -0
  55. package/v3/dist/cli/handlers/init-handler.js.map +1 -1
  56. package/v3/dist/cli/scheduler/persistent-scheduler.d.ts.map +1 -1
  57. package/v3/dist/cli/scheduler/persistent-scheduler.js +2 -1
  58. package/v3/dist/cli/scheduler/persistent-scheduler.js.map +1 -1
  59. package/v3/dist/coordination/consensus/consensus-engine.d.ts.map +1 -1
  60. package/v3/dist/coordination/consensus/consensus-engine.js +2 -1
  61. package/v3/dist/coordination/consensus/consensus-engine.js.map +1 -1
  62. package/v3/dist/coordination/cross-domain-router.d.ts.map +1 -1
  63. package/v3/dist/coordination/cross-domain-router.js +7 -8
  64. package/v3/dist/coordination/cross-domain-router.js.map +1 -1
  65. package/v3/dist/coordination/handlers/code-intelligence-handlers.d.ts +9 -0
  66. package/v3/dist/coordination/handlers/code-intelligence-handlers.d.ts.map +1 -0
  67. package/v3/dist/coordination/handlers/code-intelligence-handlers.js +203 -0
  68. package/v3/dist/coordination/handlers/code-intelligence-handlers.js.map +1 -0
  69. package/v3/dist/coordination/handlers/coverage-handlers.d.ts +9 -0
  70. package/v3/dist/coordination/handlers/coverage-handlers.d.ts.map +1 -0
  71. package/v3/dist/coordination/handlers/coverage-handlers.js +120 -0
  72. package/v3/dist/coordination/handlers/coverage-handlers.js.map +1 -0
  73. package/v3/dist/coordination/handlers/handler-types.d.ts +35 -0
  74. package/v3/dist/coordination/handlers/handler-types.d.ts.map +1 -0
  75. package/v3/dist/coordination/handlers/handler-types.js +8 -0
  76. package/v3/dist/coordination/handlers/handler-types.js.map +1 -0
  77. package/v3/dist/coordination/handlers/handler-utils.d.ts +106 -0
  78. package/v3/dist/coordination/handlers/handler-utils.d.ts.map +1 -0
  79. package/v3/dist/coordination/handlers/handler-utils.js +480 -0
  80. package/v3/dist/coordination/handlers/handler-utils.js.map +1 -0
  81. package/v3/dist/coordination/handlers/index.d.ts +15 -0
  82. package/v3/dist/coordination/handlers/index.d.ts.map +1 -0
  83. package/v3/dist/coordination/handlers/index.js +14 -0
  84. package/v3/dist/coordination/handlers/index.js.map +1 -0
  85. package/v3/dist/coordination/handlers/misc-handlers.d.ts +9 -0
  86. package/v3/dist/coordination/handlers/misc-handlers.d.ts.map +1 -0
  87. package/v3/dist/coordination/handlers/misc-handlers.js +64 -0
  88. package/v3/dist/coordination/handlers/misc-handlers.js.map +1 -0
  89. package/v3/dist/coordination/handlers/quality-handlers.d.ts +9 -0
  90. package/v3/dist/coordination/handlers/quality-handlers.d.ts.map +1 -0
  91. package/v3/dist/coordination/handlers/quality-handlers.js +83 -0
  92. package/v3/dist/coordination/handlers/quality-handlers.js.map +1 -0
  93. package/v3/dist/coordination/handlers/requirements-handlers.d.ts +9 -0
  94. package/v3/dist/coordination/handlers/requirements-handlers.d.ts.map +1 -0
  95. package/v3/dist/coordination/handlers/requirements-handlers.js +95 -0
  96. package/v3/dist/coordination/handlers/requirements-handlers.js.map +1 -0
  97. package/v3/dist/coordination/handlers/security-handlers.d.ts +9 -0
  98. package/v3/dist/coordination/handlers/security-handlers.d.ts.map +1 -0
  99. package/v3/dist/coordination/handlers/security-handlers.js +255 -0
  100. package/v3/dist/coordination/handlers/security-handlers.js.map +1 -0
  101. package/v3/dist/coordination/handlers/test-execution-handlers.d.ts +9 -0
  102. package/v3/dist/coordination/handlers/test-execution-handlers.d.ts.map +1 -0
  103. package/v3/dist/coordination/handlers/test-execution-handlers.js +153 -0
  104. package/v3/dist/coordination/handlers/test-execution-handlers.js.map +1 -0
  105. package/v3/dist/coordination/queen-coordinator.d.ts.map +1 -1
  106. package/v3/dist/coordination/queen-coordinator.js +28 -25
  107. package/v3/dist/coordination/queen-coordinator.js.map +1 -1
  108. package/v3/dist/coordination/task-executor.d.ts +25 -9
  109. package/v3/dist/coordination/task-executor.d.ts.map +1 -1
  110. package/v3/dist/coordination/task-executor.js +38 -1352
  111. package/v3/dist/coordination/task-executor.js.map +1 -1
  112. package/v3/dist/domains/code-intelligence/services/metric-collector/loc-counter.js +15 -9
  113. package/v3/dist/domains/code-intelligence/services/metric-collector/loc-counter.js.map +1 -1
  114. package/v3/dist/domains/coverage-analysis/services/hnsw-index.d.ts +31 -44
  115. package/v3/dist/domains/coverage-analysis/services/hnsw-index.d.ts.map +1 -1
  116. package/v3/dist/domains/coverage-analysis/services/hnsw-index.js +73 -178
  117. package/v3/dist/domains/coverage-analysis/services/hnsw-index.js.map +1 -1
  118. package/v3/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts.map +1 -1
  119. package/v3/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +2 -1
  120. package/v3/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js.map +1 -1
  121. package/v3/dist/domains/quality-assessment/coordinator.d.ts.map +1 -1
  122. package/v3/dist/domains/quality-assessment/coordinator.js +8 -0
  123. package/v3/dist/domains/quality-assessment/coordinator.js.map +1 -1
  124. package/v3/dist/domains/requirements-validation/services/product-factors-assessment/types/index.d.ts.map +1 -1
  125. package/v3/dist/domains/requirements-validation/services/product-factors-assessment/types/index.js +2 -1
  126. package/v3/dist/domains/requirements-validation/services/product-factors-assessment/types/index.js.map +1 -1
  127. package/v3/dist/domains/test-execution/coordinator.d.ts +14 -0
  128. package/v3/dist/domains/test-execution/coordinator.d.ts.map +1 -1
  129. package/v3/dist/domains/test-execution/coordinator.js +18 -0
  130. package/v3/dist/domains/test-execution/coordinator.js.map +1 -1
  131. package/v3/dist/domains/test-execution/services/index.d.ts +1 -0
  132. package/v3/dist/domains/test-execution/services/index.d.ts.map +1 -1
  133. package/v3/dist/domains/test-execution/services/index.js +1 -0
  134. package/v3/dist/domains/test-execution/services/index.js.map +1 -1
  135. package/v3/dist/domains/test-execution/services/mincut-test-optimizer.d.ts +118 -0
  136. package/v3/dist/domains/test-execution/services/mincut-test-optimizer.d.ts.map +1 -0
  137. package/v3/dist/domains/test-execution/services/mincut-test-optimizer.js +358 -0
  138. package/v3/dist/domains/test-execution/services/mincut-test-optimizer.js.map +1 -0
  139. package/v3/dist/domains/test-execution/types/e2e-step.types.d.ts.map +1 -1
  140. package/v3/dist/domains/test-execution/types/e2e-step.types.js +2 -1
  141. package/v3/dist/domains/test-execution/types/e2e-step.types.js.map +1 -1
  142. package/v3/dist/feedback/coverage-learner.d.ts.map +1 -1
  143. package/v3/dist/feedback/coverage-learner.js +2 -1
  144. package/v3/dist/feedback/coverage-learner.js.map +1 -1
  145. package/v3/dist/init/opencode-installer.d.ts +67 -0
  146. package/v3/dist/init/opencode-installer.d.ts.map +1 -0
  147. package/v3/dist/init/opencode-installer.js +267 -0
  148. package/v3/dist/init/opencode-installer.js.map +1 -0
  149. package/v3/dist/init/orchestrator.d.ts.map +1 -1
  150. package/v3/dist/init/orchestrator.js +1 -0
  151. package/v3/dist/init/orchestrator.js.map +1 -1
  152. package/v3/dist/init/phases/09-assets.d.ts +2 -0
  153. package/v3/dist/init/phases/09-assets.d.ts.map +1 -1
  154. package/v3/dist/init/phases/09-assets.js +26 -0
  155. package/v3/dist/init/phases/09-assets.js.map +1 -1
  156. package/v3/dist/init/phases/phase-interface.d.ts +2 -0
  157. package/v3/dist/init/phases/phase-interface.d.ts.map +1 -1
  158. package/v3/dist/init/phases/phase-interface.js.map +1 -1
  159. package/v3/dist/integrations/agentic-flow/onnx-embeddings/adapter.d.ts.map +1 -1
  160. package/v3/dist/integrations/agentic-flow/onnx-embeddings/adapter.js +2 -1
  161. package/v3/dist/integrations/agentic-flow/onnx-embeddings/adapter.js.map +1 -1
  162. package/v3/dist/integrations/n8n/agent-factory.d.ts.map +1 -1
  163. package/v3/dist/integrations/n8n/agent-factory.js +2 -1
  164. package/v3/dist/integrations/n8n/agent-factory.js.map +1 -1
  165. package/v3/dist/integrations/rl-suite/sona.d.ts.map +1 -1
  166. package/v3/dist/integrations/rl-suite/sona.js +2 -1
  167. package/v3/dist/integrations/rl-suite/sona.js.map +1 -1
  168. package/v3/dist/integrations/ruvector/brain-exporter.d.ts +66 -0
  169. package/v3/dist/integrations/ruvector/brain-exporter.d.ts.map +1 -0
  170. package/v3/dist/integrations/ruvector/brain-exporter.js +538 -0
  171. package/v3/dist/integrations/ruvector/brain-exporter.js.map +1 -0
  172. package/v3/dist/integrations/ruvector/hypergraph-schema.d.ts.map +1 -1
  173. package/v3/dist/integrations/ruvector/hypergraph-schema.js +7 -0
  174. package/v3/dist/integrations/ruvector/hypergraph-schema.js.map +1 -1
  175. package/v3/dist/integrations/ruvector/index.d.ts +5 -0
  176. package/v3/dist/integrations/ruvector/index.d.ts.map +1 -1
  177. package/v3/dist/integrations/ruvector/index.js +6 -0
  178. package/v3/dist/integrations/ruvector/index.js.map +1 -1
  179. package/v3/dist/integrations/ruvector/mincut-wrapper.d.ts +204 -0
  180. package/v3/dist/integrations/ruvector/mincut-wrapper.d.ts.map +1 -0
  181. package/v3/dist/integrations/ruvector/mincut-wrapper.js +310 -0
  182. package/v3/dist/integrations/ruvector/mincut-wrapper.js.map +1 -0
  183. package/v3/dist/integrations/ruvector/rvf-dual-writer.d.ts +141 -0
  184. package/v3/dist/integrations/ruvector/rvf-dual-writer.d.ts.map +1 -0
  185. package/v3/dist/integrations/ruvector/rvf-dual-writer.js +367 -0
  186. package/v3/dist/integrations/ruvector/rvf-dual-writer.js.map +1 -0
  187. package/v3/dist/integrations/ruvector/rvf-native-adapter.d.ts +60 -0
  188. package/v3/dist/integrations/ruvector/rvf-native-adapter.d.ts.map +1 -0
  189. package/v3/dist/integrations/ruvector/rvf-native-adapter.js +240 -0
  190. package/v3/dist/integrations/ruvector/rvf-native-adapter.js.map +1 -0
  191. package/v3/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts +41 -0
  192. package/v3/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts.map +1 -0
  193. package/v3/dist/integrations/ruvector/shared-rvf-dual-writer.js +122 -0
  194. package/v3/dist/integrations/ruvector/shared-rvf-dual-writer.js.map +1 -0
  195. package/v3/dist/integrations/ruvector/sona-wrapper.d.ts.map +1 -1
  196. package/v3/dist/integrations/ruvector/sona-wrapper.js +2 -1
  197. package/v3/dist/integrations/ruvector/sona-wrapper.js.map +1 -1
  198. package/v3/dist/integrations/vibium/client.d.ts.map +1 -1
  199. package/v3/dist/integrations/vibium/client.js +2 -1
  200. package/v3/dist/integrations/vibium/client.js.map +1 -1
  201. package/v3/dist/integrations/vibium/fallback.d.ts.map +1 -1
  202. package/v3/dist/integrations/vibium/fallback.js +2 -1
  203. package/v3/dist/integrations/vibium/fallback.js.map +1 -1
  204. package/v3/dist/kernel/hnsw-adapter.d.ts +99 -0
  205. package/v3/dist/kernel/hnsw-adapter.d.ts.map +1 -0
  206. package/v3/dist/kernel/hnsw-adapter.js +218 -0
  207. package/v3/dist/kernel/hnsw-adapter.js.map +1 -0
  208. package/v3/dist/kernel/hnsw-index-provider.d.ts +90 -0
  209. package/v3/dist/kernel/hnsw-index-provider.d.ts.map +1 -0
  210. package/v3/dist/kernel/hnsw-index-provider.js +23 -0
  211. package/v3/dist/kernel/hnsw-index-provider.js.map +1 -0
  212. package/v3/dist/kernel/kernel.d.ts.map +1 -1
  213. package/v3/dist/kernel/kernel.js +2 -1
  214. package/v3/dist/kernel/kernel.js.map +1 -1
  215. package/v3/dist/kernel/progressive-hnsw-backend.d.ts +67 -0
  216. package/v3/dist/kernel/progressive-hnsw-backend.d.ts.map +1 -0
  217. package/v3/dist/kernel/progressive-hnsw-backend.js +266 -0
  218. package/v3/dist/kernel/progressive-hnsw-backend.js.map +1 -0
  219. package/v3/dist/kernel/unified-memory-hnsw.d.ts +71 -0
  220. package/v3/dist/kernel/unified-memory-hnsw.d.ts.map +1 -1
  221. package/v3/dist/kernel/unified-memory-hnsw.js +87 -0
  222. package/v3/dist/kernel/unified-memory-hnsw.js.map +1 -1
  223. package/v3/dist/kernel/unified-memory-schemas.d.ts +1 -0
  224. package/v3/dist/kernel/unified-memory-schemas.d.ts.map +1 -1
  225. package/v3/dist/kernel/unified-memory-schemas.js +16 -0
  226. package/v3/dist/kernel/unified-memory-schemas.js.map +1 -1
  227. package/v3/dist/kernel/unified-memory.d.ts.map +1 -1
  228. package/v3/dist/kernel/unified-memory.js +19 -9
  229. package/v3/dist/kernel/unified-memory.js.map +1 -1
  230. package/v3/dist/learning/aqe-learning-engine.d.ts.map +1 -1
  231. package/v3/dist/learning/aqe-learning-engine.js +14 -2
  232. package/v3/dist/learning/aqe-learning-engine.js.map +1 -1
  233. package/v3/dist/learning/dream/concept-graph.d.ts +10 -5
  234. package/v3/dist/learning/dream/concept-graph.d.ts.map +1 -1
  235. package/v3/dist/learning/dream/concept-graph.js +77 -25
  236. package/v3/dist/learning/dream/concept-graph.js.map +1 -1
  237. package/v3/dist/learning/dream/dream-engine.d.ts +16 -0
  238. package/v3/dist/learning/dream/dream-engine.d.ts.map +1 -1
  239. package/v3/dist/learning/dream/dream-engine.js +107 -29
  240. package/v3/dist/learning/dream/dream-engine.js.map +1 -1
  241. package/v3/dist/learning/dream/index.d.ts +2 -0
  242. package/v3/dist/learning/dream/index.d.ts.map +1 -1
  243. package/v3/dist/learning/dream/index.js +8 -0
  244. package/v3/dist/learning/dream/index.js.map +1 -1
  245. package/v3/dist/learning/dream/insight-generator.d.ts.map +1 -1
  246. package/v3/dist/learning/dream/insight-generator.js +2 -1
  247. package/v3/dist/learning/dream/insight-generator.js.map +1 -1
  248. package/v3/dist/learning/dream/rvcow-branch-manager.d.ts +170 -0
  249. package/v3/dist/learning/dream/rvcow-branch-manager.d.ts.map +1 -0
  250. package/v3/dist/learning/dream/rvcow-branch-manager.js +263 -0
  251. package/v3/dist/learning/dream/rvcow-branch-manager.js.map +1 -0
  252. package/v3/dist/learning/dream/speculative-dreamer.d.ts +129 -0
  253. package/v3/dist/learning/dream/speculative-dreamer.d.ts.map +1 -0
  254. package/v3/dist/learning/dream/speculative-dreamer.js +214 -0
  255. package/v3/dist/learning/dream/speculative-dreamer.js.map +1 -0
  256. package/v3/dist/learning/dream/spreading-activation.d.ts +1 -1
  257. package/v3/dist/learning/dream/spreading-activation.d.ts.map +1 -1
  258. package/v3/dist/learning/dream/spreading-activation.js +13 -5
  259. package/v3/dist/learning/dream/spreading-activation.js.map +1 -1
  260. package/v3/dist/learning/memory-auditor.d.ts.map +1 -1
  261. package/v3/dist/learning/memory-auditor.js +7 -4
  262. package/v3/dist/learning/memory-auditor.js.map +1 -1
  263. package/v3/dist/learning/qe-reasoning-bank.d.ts +9 -0
  264. package/v3/dist/learning/qe-reasoning-bank.d.ts.map +1 -1
  265. package/v3/dist/learning/qe-reasoning-bank.js +50 -1
  266. package/v3/dist/learning/qe-reasoning-bank.js.map +1 -1
  267. package/v3/dist/learning/real-embeddings.d.ts.map +1 -1
  268. package/v3/dist/learning/real-embeddings.js +26 -1
  269. package/v3/dist/learning/real-embeddings.js.map +1 -1
  270. package/v3/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -1
  271. package/v3/dist/learning/real-qe-reasoning-bank.js +13 -2
  272. package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
  273. package/v3/dist/learning/sqlite-persistence.d.ts +5 -0
  274. package/v3/dist/learning/sqlite-persistence.d.ts.map +1 -1
  275. package/v3/dist/learning/sqlite-persistence.js +47 -7
  276. package/v3/dist/learning/sqlite-persistence.js.map +1 -1
  277. package/v3/dist/mcp/bundle.js +5837 -2932
  278. package/v3/dist/mcp/connection-pool.d.ts.map +1 -1
  279. package/v3/dist/mcp/connection-pool.js +3 -2
  280. package/v3/dist/mcp/connection-pool.js.map +1 -1
  281. package/v3/dist/mcp/entry.js +12 -0
  282. package/v3/dist/mcp/entry.js.map +1 -1
  283. package/v3/dist/mcp/handlers/core-handlers.d.ts +28 -0
  284. package/v3/dist/mcp/handlers/core-handlers.d.ts.map +1 -1
  285. package/v3/dist/mcp/handlers/core-handlers.js +117 -0
  286. package/v3/dist/mcp/handlers/core-handlers.js.map +1 -1
  287. package/v3/dist/mcp/handlers/index.d.ts +1 -1
  288. package/v3/dist/mcp/handlers/index.d.ts.map +1 -1
  289. package/v3/dist/mcp/handlers/index.js +1 -1
  290. package/v3/dist/mcp/handlers/index.js.map +1 -1
  291. package/v3/dist/mcp/http-server.d.ts.map +1 -1
  292. package/v3/dist/mcp/http-server.js +12 -9
  293. package/v3/dist/mcp/http-server.js.map +1 -1
  294. package/v3/dist/mcp/middleware/output-compaction.d.ts +45 -0
  295. package/v3/dist/mcp/middleware/output-compaction.d.ts.map +1 -0
  296. package/v3/dist/mcp/middleware/output-compaction.js +279 -0
  297. package/v3/dist/mcp/middleware/output-compaction.js.map +1 -0
  298. package/v3/dist/mcp/protocol-server.d.ts.map +1 -1
  299. package/v3/dist/mcp/protocol-server.js +53 -41
  300. package/v3/dist/mcp/protocol-server.js.map +1 -1
  301. package/v3/dist/mcp/security/sampling-server.js +2 -2
  302. package/v3/dist/mcp/security/sampling-server.js.map +1 -1
  303. package/v3/dist/mcp/services/mincut-routing-service.d.ts +148 -0
  304. package/v3/dist/mcp/services/mincut-routing-service.d.ts.map +1 -0
  305. package/v3/dist/mcp/services/mincut-routing-service.js +198 -0
  306. package/v3/dist/mcp/services/mincut-routing-service.js.map +1 -0
  307. package/v3/dist/mcp/services/reasoning-bank-service.d.ts.map +1 -1
  308. package/v3/dist/mcp/services/reasoning-bank-service.js +4 -5
  309. package/v3/dist/mcp/services/reasoning-bank-service.js.map +1 -1
  310. package/v3/dist/mcp/services/task-router.d.ts +4 -0
  311. package/v3/dist/mcp/services/task-router.d.ts.map +1 -1
  312. package/v3/dist/mcp/services/task-router.js +57 -15
  313. package/v3/dist/mcp/services/task-router.js.map +1 -1
  314. package/v3/dist/mcp/tools/base.d.ts +5 -0
  315. package/v3/dist/mcp/tools/base.d.ts.map +1 -1
  316. package/v3/dist/mcp/tools/base.js +25 -1
  317. package/v3/dist/mcp/tools/base.js.map +1 -1
  318. package/v3/dist/mcp/tools/learning-optimization/dream.d.ts.map +1 -1
  319. package/v3/dist/mcp/tools/learning-optimization/dream.js +22 -0
  320. package/v3/dist/mcp/tools/learning-optimization/dream.js.map +1 -1
  321. package/v3/dist/mcp/tools/security-compliance/scan.d.ts.map +1 -1
  322. package/v3/dist/mcp/tools/security-compliance/scan.js +2 -1
  323. package/v3/dist/mcp/tools/security-compliance/scan.js.map +1 -1
  324. package/v3/dist/mcp/transport/index.d.ts +8 -6
  325. package/v3/dist/mcp/transport/index.d.ts.map +1 -1
  326. package/v3/dist/mcp/transport/index.js +10 -9
  327. package/v3/dist/mcp/transport/index.js.map +1 -1
  328. package/v3/dist/migrations/20260120_add_hypergraph_tables.d.ts.map +1 -1
  329. package/v3/dist/migrations/20260120_add_hypergraph_tables.js +7 -0
  330. package/v3/dist/migrations/20260120_add_hypergraph_tables.js.map +1 -1
  331. package/v3/dist/monitoring/structural-health.d.ts +142 -0
  332. package/v3/dist/monitoring/structural-health.d.ts.map +1 -0
  333. package/v3/dist/monitoring/structural-health.js +201 -0
  334. package/v3/dist/monitoring/structural-health.js.map +1 -0
  335. package/v3/dist/optimization/token-optimizer-service.d.ts.map +1 -1
  336. package/v3/dist/optimization/token-optimizer-service.js +2 -1
  337. package/v3/dist/optimization/token-optimizer-service.js.map +1 -1
  338. package/v3/dist/planning/goap-planner.d.ts.map +1 -1
  339. package/v3/dist/planning/goap-planner.js +2 -1
  340. package/v3/dist/planning/goap-planner.js.map +1 -1
  341. package/v3/dist/planning/plan-executor.d.ts +5 -1
  342. package/v3/dist/planning/plan-executor.d.ts.map +1 -1
  343. package/v3/dist/planning/plan-executor.js +16 -2
  344. package/v3/dist/planning/plan-executor.js.map +1 -1
  345. package/v3/dist/routing/routing-feedback.d.ts.map +1 -1
  346. package/v3/dist/routing/routing-feedback.js +2 -1
  347. package/v3/dist/routing/routing-feedback.js.map +1 -1
  348. package/v3/dist/shared/llm/cost-tracker.d.ts.map +1 -1
  349. package/v3/dist/shared/llm/cost-tracker.js +2 -1
  350. package/v3/dist/shared/llm/cost-tracker.js.map +1 -1
  351. package/v3/dist/shared/llm/metrics/router-metrics.d.ts.map +1 -1
  352. package/v3/dist/shared/llm/metrics/router-metrics.js +2 -1
  353. package/v3/dist/shared/llm/metrics/router-metrics.js.map +1 -1
  354. package/v3/dist/strange-loop/belief-reconciler.d.ts.map +1 -1
  355. package/v3/dist/strange-loop/belief-reconciler.js +2 -1
  356. package/v3/dist/strange-loop/belief-reconciler.js.map +1 -1
  357. package/v3/dist/sync/readers/json-reader.d.ts.map +1 -1
  358. package/v3/dist/sync/readers/json-reader.js +2 -1
  359. package/v3/dist/sync/readers/json-reader.js.map +1 -1
  360. package/v3/dist/types/cross-phase-signals.d.ts.map +1 -1
  361. package/v3/dist/types/cross-phase-signals.js +2 -1
  362. package/v3/dist/types/cross-phase-signals.js.map +1 -1
  363. package/v3/dist/validation/swarm-skill-validator.d.ts.map +1 -1
  364. package/v3/dist/validation/swarm-skill-validator.js +2 -1
  365. package/v3/dist/validation/swarm-skill-validator.js.map +1 -1
  366. package/v3/dist/workers/base-worker.d.ts.map +1 -1
  367. package/v3/dist/workers/base-worker.js +2 -1
  368. package/v3/dist/workers/base-worker.js.map +1 -1
  369. package/v3/package.json +5 -2
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Code intelligence and defect prediction task handlers.
3
+ *
4
+ * Extracted from task-executor.ts registerHandlers().
5
+ * Covers: index-code, predict-defects
6
+ */
7
+ import type { TaskHandlerContext } from './handler-types';
8
+ export declare function registerCodeIntelligenceHandlers(ctx: TaskHandlerContext): void;
9
+ //# sourceMappingURL=code-intelligence-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-intelligence-handlers.d.ts","sourceRoot":"","sources":["../../../src/coordination/handlers/code-intelligence-handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,kBAAkB,GAAG,IAAI,CA0N9E"}
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Code intelligence and defect prediction task handlers.
3
+ *
4
+ * Extracted from task-executor.ts registerHandlers().
5
+ * Covers: index-code, predict-defects
6
+ */
7
+ import * as fs from 'fs/promises';
8
+ import * as path from 'path';
9
+ import { ok, err } from '../../shared/types';
10
+ import { toError } from '../../shared/error-utils.js';
11
+ import { discoverSourceFiles } from './handler-utils';
12
+ export function registerCodeIntelligenceHandlers(ctx) {
13
+ // Register code indexing handler - REAL IMPLEMENTATION
14
+ ctx.registerHandler('index-code', async (task) => {
15
+ const payload = task.payload;
16
+ try {
17
+ const kg = ctx.getKnowledgeGraph();
18
+ const targetPath = payload.target || process.cwd();
19
+ const startTime = Date.now();
20
+ // Discover files to index
21
+ const filesToIndex = await discoverSourceFiles(targetPath, {
22
+ includeTests: payload.includeTests !== false,
23
+ languages: payload.languages,
24
+ });
25
+ if (filesToIndex.length === 0) {
26
+ return ok({
27
+ filesIndexed: 0,
28
+ nodesCreated: 0,
29
+ edgesCreated: 0,
30
+ target: targetPath,
31
+ incremental: payload.incremental || false,
32
+ languages: payload.languages || [],
33
+ duration: Date.now() - startTime,
34
+ warning: `No source files found in ${targetPath}. Searched for: TypeScript, JavaScript, Python, Go, Rust, Java, Ruby, C/C++, and more.`,
35
+ });
36
+ }
37
+ // Use the real KnowledgeGraphService to index files
38
+ const result = await kg.index({
39
+ paths: filesToIndex,
40
+ incremental: payload.incremental || false,
41
+ includeTests: payload.includeTests !== false,
42
+ languages: payload.languages,
43
+ });
44
+ if (!result.success) {
45
+ return result;
46
+ }
47
+ const indexResult = result.value;
48
+ // Detect languages from files
49
+ const detectedLanguages = new Set();
50
+ const extToLang = {
51
+ ts: 'typescript', tsx: 'typescript',
52
+ js: 'javascript', jsx: 'javascript', mjs: 'javascript', cjs: 'javascript',
53
+ py: 'python', pyw: 'python',
54
+ go: 'go', rs: 'rust',
55
+ java: 'java', kt: 'kotlin', kts: 'kotlin',
56
+ rb: 'ruby', cs: 'csharp', php: 'php', swift: 'swift',
57
+ c: 'c', h: 'c', cpp: 'cpp', hpp: 'cpp', cc: 'cpp',
58
+ scala: 'scala',
59
+ };
60
+ for (const file of filesToIndex) {
61
+ const ext = path.extname(file).slice(1);
62
+ const lang = extToLang[ext];
63
+ if (lang)
64
+ detectedLanguages.add(lang);
65
+ }
66
+ return ok({
67
+ filesIndexed: indexResult.filesIndexed,
68
+ nodesCreated: indexResult.nodesCreated,
69
+ edgesCreated: indexResult.edgesCreated,
70
+ target: targetPath,
71
+ incremental: payload.incremental || false,
72
+ languages: Array.from(detectedLanguages),
73
+ duration: indexResult.duration,
74
+ errors: indexResult.errors,
75
+ });
76
+ }
77
+ catch (error) {
78
+ return err(toError(error));
79
+ }
80
+ });
81
+ // Register defect prediction handler - REAL IMPLEMENTATION
82
+ ctx.registerHandler('predict-defects', async (task) => {
83
+ const payload = task.payload;
84
+ try {
85
+ const targetPath = payload.target || process.cwd();
86
+ const minConfidence = payload.minConfidence || 0.5;
87
+ // Discover actual source files in the target directory
88
+ const sourceFiles = await discoverSourceFiles(targetPath, { includeTests: false });
89
+ if (sourceFiles.length === 0) {
90
+ return ok({
91
+ predictedDefects: [],
92
+ riskScore: 0,
93
+ recommendations: [
94
+ `No source files found in ${targetPath}. Ensure the path contains source code files.`,
95
+ ],
96
+ warning: `No source files found in ${targetPath}`,
97
+ filesAnalyzed: 0,
98
+ });
99
+ }
100
+ // Analyze each file for defect indicators based on real metrics
101
+ const predictedDefects = [];
102
+ for (const filePath of sourceFiles) {
103
+ try {
104
+ const content = await fs.readFile(filePath, 'utf-8');
105
+ const lines = content.split('\n');
106
+ const lineCount = lines.length;
107
+ // Calculate complexity indicators from real code
108
+ let probability = 0;
109
+ const reasons = [];
110
+ // Factor 1: File size (large files are more defect-prone)
111
+ if (lineCount > 500) {
112
+ probability += 0.25;
113
+ reasons.push(`Large file (${lineCount} lines)`);
114
+ }
115
+ else if (lineCount > 300) {
116
+ probability += 0.15;
117
+ reasons.push(`Medium-large file (${lineCount} lines)`);
118
+ }
119
+ // Factor 2: Cyclomatic complexity indicators
120
+ const branchKeywords = content.match(/\b(if|else|switch|case|for|while|catch|&&|\|\|)\b/g) || [];
121
+ const branchDensity = branchKeywords.length / Math.max(lineCount, 1);
122
+ if (branchDensity > 0.15) {
123
+ probability += 0.25;
124
+ reasons.push(`High branch density (${branchKeywords.length} branches in ${lineCount} lines)`);
125
+ }
126
+ else if (branchDensity > 0.08) {
127
+ probability += 0.10;
128
+ reasons.push('Moderate branch complexity');
129
+ }
130
+ // Factor 3: Deeply nested code
131
+ const maxIndent = Math.max(...lines.map(l => {
132
+ const match = l.match(/^(\s*)/);
133
+ return match ? match[1].length : 0;
134
+ }));
135
+ if (maxIndent > 20) {
136
+ probability += 0.15;
137
+ reasons.push('Deep nesting detected');
138
+ }
139
+ // Factor 4: TODO/FIXME/HACK comments
140
+ const debtComments = (content.match(/\b(TODO|FIXME|HACK|XXX|WORKAROUND)\b/gi) || []).length;
141
+ if (debtComments > 3) {
142
+ probability += 0.15;
143
+ reasons.push(`${debtComments} technical debt markers`);
144
+ }
145
+ // Factor 5: Long functions (heuristic)
146
+ const functionStarts = (content.match(/\b(function|def|func|async)\b/g) || []).length;
147
+ if (functionStarts > 0 && lineCount / functionStarts > 80) {
148
+ probability += 0.10;
149
+ reasons.push('Potentially long functions');
150
+ }
151
+ probability = Math.min(probability, 0.95);
152
+ if (probability >= minConfidence) {
153
+ // Use relative path for readability
154
+ const relativePath = filePath.startsWith(targetPath)
155
+ ? filePath.slice(targetPath.length).replace(/^\//, '')
156
+ : filePath;
157
+ predictedDefects.push({
158
+ file: relativePath,
159
+ probability: Math.round(probability * 100) / 100,
160
+ reason: reasons.join('; '),
161
+ });
162
+ }
163
+ }
164
+ catch {
165
+ // Skip files that can't be read
166
+ }
167
+ }
168
+ // Sort by probability descending
169
+ predictedDefects.sort((a, b) => b.probability - a.probability);
170
+ // Calculate overall risk score
171
+ const avgProb = predictedDefects.length > 0
172
+ ? predictedDefects.reduce((sum, d) => sum + d.probability, 0) / predictedDefects.length
173
+ : 0;
174
+ const riskScore = Math.round(avgProb * 100);
175
+ // Generate recommendations from actual findings
176
+ const recommendations = [];
177
+ if (predictedDefects.length > 0) {
178
+ recommendations.push(`${predictedDefects.length} files flagged for potential defects out of ${sourceFiles.length} analyzed`);
179
+ const topFile = predictedDefects[0];
180
+ recommendations.push(`Highest risk: ${topFile.file} (${Math.round(topFile.probability * 100)}%) — ${topFile.reason}`);
181
+ }
182
+ if (predictedDefects.some(d => d.reason.includes('Large file'))) {
183
+ recommendations.push('Consider splitting large files to reduce complexity');
184
+ }
185
+ if (predictedDefects.some(d => d.reason.includes('technical debt'))) {
186
+ recommendations.push('Address TODO/FIXME comments to reduce technical debt');
187
+ }
188
+ if (predictedDefects.length === 0) {
189
+ recommendations.push('No files exceeded the defect probability threshold — code looks healthy');
190
+ }
191
+ return ok({
192
+ predictedDefects: predictedDefects.slice(0, 20), // Top 20
193
+ riskScore,
194
+ recommendations,
195
+ filesAnalyzed: sourceFiles.length,
196
+ });
197
+ }
198
+ catch (error) {
199
+ return err(toError(error));
200
+ }
201
+ });
202
+ }
203
+ //# sourceMappingURL=code-intelligence-handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-intelligence-handlers.js","sourceRoot":"","sources":["../../../src/coordination/handlers/code-intelligence-handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,UAAU,gCAAgC,CAAC,GAAuB;IACtE,uDAAuD;IACvD,GAAG,CAAC,eAAe,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,OAKpB,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,GAAG,CAAC,iBAAiB,EAAE,CAAC;YACnC,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YACnD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAE7B,0BAA0B;YAC1B,MAAM,YAAY,GAAG,MAAM,mBAAmB,CAAC,UAAU,EAAE;gBACzD,YAAY,EAAE,OAAO,CAAC,YAAY,KAAK,KAAK;gBAC5C,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAC,CAAC;YAEH,IAAI,YAAY,CAAC,MAA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gBACT,eAAe;gBACf,aAAa,EAAE,WAAW,CAAC,MAAM;aAClC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Coverage analysis task handlers.
3
+ *
4
+ * Extracted from task-executor.ts registerHandlers().
5
+ * Covers: analyze-coverage
6
+ */
7
+ import type { TaskHandlerContext } from './handler-types';
8
+ export declare function registerCoverageHandlers(ctx: TaskHandlerContext): void;
9
+ //# sourceMappingURL=coverage-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage-handlers.d.ts","sourceRoot":"","sources":["../../../src/coordination/handlers/coverage-handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,kBAAkB,GAAG,IAAI,CAqHtE"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Coverage analysis task handlers.
3
+ *
4
+ * Extracted from task-executor.ts registerHandlers().
5
+ * Covers: analyze-coverage
6
+ */
7
+ import * as fs from 'fs/promises';
8
+ import * as path from 'path';
9
+ import { ok, err } from '../../shared/types';
10
+ import { toError } from '../../shared/error-utils.js';
11
+ import { safeJsonParse } from '../../shared/safe-json.js';
12
+ import { loadCoverageData } from './handler-utils';
13
+ export function registerCoverageHandlers(ctx) {
14
+ // Register coverage analysis handler - REAL IMPLEMENTATION
15
+ ctx.registerHandler('analyze-coverage', async (task) => {
16
+ const payload = task.payload;
17
+ try {
18
+ const analyzer = ctx.getCoverageAnalyzer();
19
+ const targetPath = payload.target || process.cwd();
20
+ const threshold = payload.threshold || 80;
21
+ // Try to find and read actual coverage files
22
+ let coverageData = await loadCoverageData(targetPath);
23
+ if (!coverageData) {
24
+ // No coverage data found — attempt to collect it by running tests with coverage
25
+ let collected = false;
26
+ try {
27
+ const { execSync } = await import('child_process');
28
+ // Detect test runner from package.json
29
+ let coverageCmd = 'npx vitest run --coverage --reporter=json 2>/dev/null';
30
+ try {
31
+ const pkgContent = await fs.readFile(path.join(targetPath, 'package.json'), 'utf-8');
32
+ const pkg = safeJsonParse(pkgContent);
33
+ const deps = { ...(pkg.devDependencies || {}), ...(pkg.dependencies || {}) };
34
+ if (deps['jest'] || deps['@jest/core']) {
35
+ coverageCmd = 'npx jest --coverage --json 2>/dev/null';
36
+ }
37
+ else if (deps['mocha'] || deps['nyc']) {
38
+ coverageCmd = 'npx nyc mocha 2>/dev/null';
39
+ }
40
+ // vitest is the default — covers vitest, @vitest/coverage-v8, etc.
41
+ }
42
+ catch {
43
+ // No package.json — use default vitest
44
+ }
45
+ execSync(coverageCmd, {
46
+ cwd: targetPath,
47
+ timeout: 120000,
48
+ encoding: 'utf-8',
49
+ stdio: ['pipe', 'pipe', 'pipe'],
50
+ });
51
+ collected = true;
52
+ }
53
+ catch {
54
+ // Test runner failed or not available — that's OK, we'll check for output anyway
55
+ }
56
+ // Re-check for coverage data after collection attempt
57
+ coverageData = await loadCoverageData(targetPath);
58
+ if (!coverageData) {
59
+ return ok({
60
+ lineCoverage: 0,
61
+ branchCoverage: 0,
62
+ functionCoverage: 0,
63
+ statementCoverage: 0,
64
+ totalFiles: 0,
65
+ coverageByFile: [],
66
+ gaps: [],
67
+ algorithm: 'sublinear-O(log n)',
68
+ warning: collected
69
+ ? 'Tests ran but no coverage output was generated. Ensure a coverage provider is configured (e.g., @vitest/coverage-v8, istanbul).'
70
+ : 'No coverage data found and could not run tests automatically. Run: npm test -- --coverage',
71
+ });
72
+ }
73
+ }
74
+ // Analyze coverage using the real CoverageAnalyzerService
75
+ const analysisResult = await analyzer.analyze({
76
+ coverageData,
77
+ threshold,
78
+ includeFileDetails: payload.detectGaps,
79
+ });
80
+ if (!analysisResult.success) {
81
+ return analysisResult;
82
+ }
83
+ const report = analysisResult.value;
84
+ // Find gaps if requested
85
+ let gaps = [];
86
+ if (payload.detectGaps) {
87
+ const gapsResult = await analyzer.findGaps(coverageData, threshold);
88
+ if (gapsResult.success) {
89
+ gaps = gapsResult.value.gaps.map(gap => ({
90
+ file: gap.file,
91
+ lines: gap.lines,
92
+ risk: gap.severity,
93
+ }));
94
+ }
95
+ }
96
+ return ok({
97
+ lineCoverage: Math.round(report.summary.line * 10) / 10,
98
+ branchCoverage: Math.round(report.summary.branch * 10) / 10,
99
+ functionCoverage: Math.round(report.summary.function * 10) / 10,
100
+ statementCoverage: Math.round(report.summary.statement * 10) / 10,
101
+ totalFiles: report.summary.files,
102
+ coverageByFile: coverageData.files.map(f => ({
103
+ file: f.path,
104
+ lineCoverage: f.lines.total > 0 ? Math.round((f.lines.covered / f.lines.total) * 1000) / 10 : 0,
105
+ branchCoverage: f.branches.total > 0 ? Math.round((f.branches.covered / f.branches.total) * 1000) / 10 : 0,
106
+ functionCoverage: f.functions.total > 0 ? Math.round((f.functions.covered / f.functions.total) * 1000) / 10 : 0,
107
+ })),
108
+ gaps,
109
+ meetsThreshold: report.meetsThreshold,
110
+ delta: report.delta,
111
+ recommendations: report.recommendations,
112
+ algorithm: 'sublinear-O(log n)',
113
+ });
114
+ }
115
+ catch (error) {
116
+ return err(toError(error));
117
+ }
118
+ });
119
+ }
120
+ //# sourceMappingURL=coverage-handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage-handlers.js","sourceRoot":"","sources":["../../../src/coordination/handlers/coverage-handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,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IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;oBAC/F,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;oBAC1G,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,GAAG,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;iBAChH,CAAC,CAAC;gBACH,IAAI;gBACJ,cAAc,EAAE,MAAM,CAAC,cAAc;gBACrC,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,eAAe,EAAE,MAAM,CAAC,eAAe;gBACvC,SAAS,EAAE,oBAAoB;aAChC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shared types for extracted task handlers.
3
+ *
4
+ * Handlers receive a TaskHandlerContext that exposes the minimal surface
5
+ * of DomainTaskExecutor needed to register and implement handlers.
6
+ */
7
+ import type { Result } from '../../shared/types';
8
+ import type { QueenTask, TaskType } from '../queen-coordinator';
9
+ import type { CoverageAnalyzerService } from '../../domains/coverage-analysis';
10
+ import type { SecurityScannerService } from '../../domains/security-compliance';
11
+ import type { TestGeneratorService } from '../../domains/test-generation';
12
+ import type { KnowledgeGraphService } from '../../domains/code-intelligence';
13
+ import type { QualityAnalyzerService } from '../../domains/quality-assessment';
14
+ /** Signature of a single task handler */
15
+ export type InstanceTaskHandler = (task: QueenTask) => Promise<Result<unknown, Error>>;
16
+ /**
17
+ * Minimal interface that handler registration functions use to interact
18
+ * with DomainTaskExecutor. This avoids a circular import on the class itself.
19
+ */
20
+ export interface TaskHandlerContext {
21
+ /** Register a handler for a given task type */
22
+ registerHandler(type: TaskType, handler: InstanceTaskHandler): void;
23
+ /** Lazy service getters */
24
+ getCoverageAnalyzer(): CoverageAnalyzerService;
25
+ getSecurityScanner(): SecurityScannerService;
26
+ getTestGenerator(): TestGeneratorService;
27
+ getKnowledgeGraph(): KnowledgeGraphService;
28
+ getQualityAnalyzer(): QualityAnalyzerService;
29
+ /** Executor configuration */
30
+ readonly config: {
31
+ defaultLanguage: string;
32
+ defaultFramework: string;
33
+ };
34
+ }
35
+ //# sourceMappingURL=handler-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler-types.d.ts","sourceRoot":"","sources":["../../../src/coordination/handlers/handler-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE/E,yCAAyC;AACzC,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAEpE,2BAA2B;IAC3B,mBAAmB,IAAI,uBAAuB,CAAC;IAC/C,kBAAkB,IAAI,sBAAsB,CAAC;IAC7C,gBAAgB,IAAI,oBAAoB,CAAC;IACzC,iBAAiB,IAAI,qBAAqB,CAAC;IAC3C,kBAAkB,IAAI,sBAAsB,CAAC;IAE7C,6BAA6B;IAC7B,QAAQ,CAAC,MAAM,EAAE;QACf,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shared types for extracted task handlers.
3
+ *
4
+ * Handlers receive a TaskHandlerContext that exposes the minimal surface
5
+ * of DomainTaskExecutor needed to register and implement handlers.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=handler-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler-types.js","sourceRoot":"","sources":["../../../src/coordination/handlers/handler-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Shared utility functions used by extracted task handlers.
3
+ *
4
+ * These were originally module-level helpers in task-executor.ts and are
5
+ * now co-located with the handlers that use them.
6
+ */
7
+ import type { CoverageData } from '../../domains/coverage-analysis';
8
+ /**
9
+ * Istanbul/nyc coverage-final.json file data structure
10
+ * Each file in the coverage report has this structure
11
+ */
12
+ export interface IstanbulFileCoverage {
13
+ /** Statement map - keyed by statement ID */
14
+ statementMap: Record<string, {
15
+ start: {
16
+ line: number;
17
+ column: number;
18
+ };
19
+ end: {
20
+ line: number;
21
+ column: number;
22
+ };
23
+ }>;
24
+ /** Statement execution counts - keyed by statement ID */
25
+ s: Record<string, number>;
26
+ /** Branch map - keyed by branch ID */
27
+ branchMap: Record<string, {
28
+ type: string;
29
+ line: number;
30
+ locations: Array<{
31
+ start: {
32
+ line: number;
33
+ column: number;
34
+ };
35
+ end: {
36
+ line: number;
37
+ column: number;
38
+ };
39
+ }>;
40
+ }>;
41
+ /** Branch execution counts - array of counts per branch */
42
+ b: Record<string, number[]>;
43
+ /** Function map - keyed by function ID */
44
+ fnMap: Record<string, {
45
+ name: string;
46
+ decl: {
47
+ start: {
48
+ line: number;
49
+ column: number;
50
+ };
51
+ end: {
52
+ line: number;
53
+ column: number;
54
+ };
55
+ };
56
+ loc: {
57
+ start: {
58
+ line: number;
59
+ column: number;
60
+ };
61
+ end: {
62
+ line: number;
63
+ column: number;
64
+ };
65
+ };
66
+ line: number;
67
+ }>;
68
+ /** Function execution counts - keyed by function ID */
69
+ f: Record<string, number>;
70
+ /** Path to the file */
71
+ path: string;
72
+ }
73
+ /**
74
+ * Load coverage data from common coverage file formats
75
+ */
76
+ export declare function loadCoverageData(targetPath: string): Promise<CoverageData | null>;
77
+ /**
78
+ * Parse Istanbul/nyc coverage-final.json format
79
+ */
80
+ export declare function parseCoverageJson(content: string): CoverageData;
81
+ /**
82
+ * Parse LCOV info format
83
+ */
84
+ export declare function parseLcovInfo(content: string): CoverageData;
85
+ /**
86
+ * Parse Cobertura XML format (Python coverage.py, Java JaCoCo, etc.)
87
+ * Handles both coverage.xml and cobertura-coverage.xml formats.
88
+ * Uses attribute-order-independent extraction to handle output from
89
+ * different tools (coverage.py, JaCoCo, Cobertura) that order attributes differently.
90
+ */
91
+ export declare function parseCoberturaXml(content: string): CoverageData;
92
+ /**
93
+ * Discover source files in a directory
94
+ */
95
+ export declare function discoverSourceFiles(targetPath: string, options?: {
96
+ includeTests?: boolean;
97
+ languages?: string[];
98
+ }): Promise<string[]>;
99
+ /**
100
+ * Generate security recommendations based on findings
101
+ */
102
+ export declare function generateSecurityRecommendations(vulnerabilities: Array<{
103
+ category: string;
104
+ severity: string;
105
+ }>): string[];
106
+ //# sourceMappingURL=handler-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler-utils.d.ts","sourceRoot":"","sources":["../../../src/coordination/handlers/handler-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,iCAAiC,CAAC;AAMlF;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE;QAC3B,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QACxC,GAAG,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KACvC,CAAC,CAAC;IACH,yDAAyD;IACzD,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,KAAK,CAAC;YACf,KAAK,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,MAAM,EAAE,MAAM,CAAA;aAAE,CAAC;YACxC,GAAG,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,MAAM,EAAE,MAAM,CAAA;aAAE,CAAC;SACvC,CAAC,CAAC;KACJ,CAAC,CAAC;IACH,2DAA2D;IAC3D,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5B,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE;YAAE,KAAK,EAAE;g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