agentic-qe 3.15.5 → 3.15.7

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 (584) hide show
  1. package/.claude/skills/qe-court/evals/fixtures/seeded-mutant-delivery/README.md +9 -2
  2. package/.claude/skills/qe-court/evals/qe-court.yaml +3 -2
  3. package/.claude/skills/qe-quality-assessment/schemas/output.json +12 -2
  4. package/.claude/skills/skills-manifest.json +1 -1
  5. package/CHANGELOG.md +262 -0
  6. package/README.md +2 -0
  7. package/assets/skills/qe-court/evals/fixtures/seeded-mutant-delivery/README.md +9 -2
  8. package/assets/skills/qe-court/evals/qe-court.yaml +3 -2
  9. package/assets/skills/qe-quality-assessment/schemas/output.json +12 -2
  10. package/assets/skills/skills-manifest.json +1 -1
  11. package/dist/cli/bundle.js +8 -6
  12. package/dist/cli/chunks/adapter-PEOUNYXJ.js +2 -0
  13. package/dist/cli/chunks/{agent-booster-wasm-CCTTGCQS.js → agent-booster-wasm-OS5G7KMQ.js} +2 -2
  14. package/dist/cli/chunks/{agent-handler-DHYUF3NX.js → agent-handler-PI4I7PME.js} +2 -2
  15. package/dist/cli/chunks/{agent-memory-branch-642W7CYX.js → agent-memory-branch-J7TXHX4U.js} +2 -2
  16. package/dist/cli/chunks/aqe-learning-engine-DHKZI5RX.js +2 -0
  17. package/dist/cli/chunks/{arena-MUCC7UUN.js → arena-FXESDCFR.js} +4 -4
  18. package/dist/cli/chunks/{arena-NW2JVAFY.js → arena-OWUGXKNT.js} +2 -2
  19. package/dist/cli/chunks/{audit-VKQTZJAA.js → audit-EPAWLYIZ.js} +3 -3
  20. package/dist/cli/chunks/base-QZWK3D5P.js +2 -0
  21. package/dist/cli/chunks/{better-sqlite3-7ZUFVWLQ.js → better-sqlite3-IYVR5EQY.js} +2 -2
  22. package/dist/cli/chunks/{brain-handler-7LKAWSBI.js → brain-handler-3W2E6TC6.js} +3 -3
  23. package/dist/cli/chunks/{branch-enumerator-HUNXJKM4.js → branch-enumerator-HU7VACJ4.js} +2 -2
  24. package/dist/cli/chunks/{browser-ZSZEYUDP.js → browser-72XOR6E2.js} +2 -2
  25. package/dist/cli/chunks/browser-workflow-ITPX72RX.js +2 -0
  26. package/dist/cli/chunks/{chunk-PVAE65B4.js → chunk-2423JAA5.js} +1 -1
  27. package/dist/cli/chunks/{chunk-VLOIEVER.js → chunk-24CENUT4.js} +3 -3
  28. package/dist/cli/chunks/chunk-2AYBYXOA.js +4 -0
  29. package/dist/cli/chunks/{chunk-FWYJ6UDX.js → chunk-2E3XWKEU.js} +2 -2
  30. package/dist/cli/chunks/{chunk-L375O3CZ.js → chunk-2RJYA6WK.js} +2 -2
  31. package/dist/cli/chunks/{chunk-SDWMLT7B.js → chunk-2YVJ5OUL.js} +5 -5
  32. package/dist/cli/chunks/{chunk-WN55MNZ2.js → chunk-34JLY3U6.js} +2 -2
  33. package/dist/cli/chunks/{chunk-6ZIDZ4TJ.js → chunk-3JD2USUH.js} +2 -2
  34. package/dist/cli/chunks/{chunk-5BOZCMXZ.js → chunk-3RM46XFP.js} +1 -1
  35. package/dist/cli/chunks/{chunk-UE22ODHN.js → chunk-44DPYNPE.js} +1 -1
  36. package/dist/cli/chunks/{chunk-AUZXRFOX.js → chunk-4DIZ5BT6.js} +2 -2
  37. package/dist/cli/chunks/{chunk-RUSLEOMC.js → chunk-4G2VNW4C.js} +2 -2
  38. package/dist/cli/chunks/{chunk-VML4SG3X.js → chunk-56ZKQYZY.js} +3 -3
  39. package/dist/cli/chunks/{chunk-FHUJCVT3.js → chunk-5KCBX225.js} +2 -2
  40. package/dist/cli/chunks/chunk-5KS7HA37.js +2 -0
  41. package/dist/cli/chunks/{chunk-IJ2EXSMO.js → chunk-5PBRBS7D.js} +2 -2
  42. package/dist/cli/chunks/chunk-5Q22XPTH.js +2 -0
  43. package/dist/cli/chunks/{chunk-PDPEMBFV.js → chunk-634D2ENF.js} +2 -2
  44. package/dist/cli/chunks/{chunk-BYXNHGQC.js → chunk-6AYRAOCA.js} +2 -2
  45. package/dist/cli/chunks/{chunk-ORTBRO7F.js → chunk-6BO3WCK7.js} +2 -2
  46. package/dist/cli/chunks/{chunk-6LG5UEQE.js → chunk-6FEQ73BF.js} +2 -2
  47. package/dist/cli/chunks/{chunk-JYY7AYGA.js → chunk-6JT73S5B.js} +1 -1
  48. package/dist/cli/chunks/{chunk-LNO5IWGH.js → chunk-6OS7HREG.js} +1 -1
  49. package/dist/cli/chunks/{chunk-XNEEYXR2.js → chunk-6PKCQXEW.js} +2 -2
  50. package/dist/cli/chunks/{chunk-KHCALIFP.js → chunk-7EX4DEQR.js} +2 -2
  51. package/dist/cli/chunks/chunk-7UCVYYWL.js +3 -0
  52. package/dist/cli/chunks/chunk-AAA4SHEG.js +2 -0
  53. package/dist/cli/chunks/{chunk-DTJODGCE.js → chunk-AXO7OOOA.js} +2 -2
  54. package/dist/cli/chunks/{chunk-ZT3GUYM5.js → chunk-B7M323VL.js} +2 -2
  55. package/dist/cli/chunks/{chunk-L6SVCNXK.js → chunk-BB7OLQKO.js} +1 -1
  56. package/dist/cli/chunks/{chunk-6UYN5PHA.js → chunk-BTIBXGVQ.js} +4 -4
  57. package/dist/cli/chunks/chunk-BTYKGVJ5.js +2 -0
  58. package/dist/cli/chunks/{chunk-6JFGB2JB.js → chunk-C2CUPJGR.js} +1 -1
  59. package/dist/cli/chunks/{chunk-EAYQCBXL.js → chunk-C2MDBBFF.js} +3 -3
  60. package/dist/cli/chunks/{chunk-3AYYGR6W.js → chunk-CG5DZCOZ.js} +1 -1
  61. package/dist/cli/chunks/chunk-CIFWOMNX.js +2 -0
  62. package/dist/cli/chunks/{chunk-Y2WMPEUP.js → chunk-CWPRU7ZI.js} +2 -2
  63. package/dist/cli/chunks/{chunk-XNHB6TLC.js → chunk-CXTJ47QS.js} +2 -2
  64. package/dist/cli/chunks/{chunk-4PT5KNXL.js → chunk-DCJW2DPL.js} +4 -4
  65. package/dist/cli/chunks/{chunk-VCKDVOPD.js → chunk-DGK6GQMO.js} +2 -2
  66. package/dist/cli/chunks/{chunk-47GEI2LT.js → chunk-DVPGBDBP.js} +3 -3
  67. package/dist/cli/chunks/chunk-EB2PP6X2.js +2 -0
  68. package/dist/cli/chunks/{chunk-CXOXUBYU.js → chunk-ECSLJJOQ.js} +1 -1
  69. package/dist/cli/chunks/{chunk-A2WOQO2N.js → chunk-ED32XJ5R.js} +2 -2
  70. package/dist/cli/chunks/{chunk-35MDATQE.js → chunk-EDU72RTW.js} +1 -1
  71. package/dist/cli/chunks/{chunk-PCCIZFD7.js → chunk-EL75G2A3.js} +1 -1
  72. package/dist/cli/chunks/{chunk-4UXPDV7E.js → chunk-EV2BYY6T.js} +1 -1
  73. package/dist/cli/chunks/{chunk-3YASZPLO.js → chunk-F62EKVVC.js} +2 -2
  74. package/dist/cli/chunks/{chunk-AQN5EDBM.js → chunk-FTTFJ7SJ.js} +1 -1
  75. package/dist/cli/chunks/chunk-FVBFASOD.js +2 -0
  76. package/dist/cli/chunks/{chunk-QXY3IRBW.js → chunk-G762PEFO.js} +26 -26
  77. package/dist/cli/chunks/{chunk-A5J4XJS6.js → chunk-G7YTZTGU.js} +1 -1
  78. package/dist/cli/chunks/{chunk-YINFES3E.js → chunk-GY2SAIXP.js} +2 -2
  79. package/dist/cli/chunks/chunk-H4WHDFB5.js +4 -0
  80. package/dist/cli/chunks/chunk-HLZATDD2.js +2 -0
  81. package/dist/cli/chunks/{chunk-7EZLOC4K.js → chunk-HPG7354V.js} +2 -2
  82. package/dist/cli/chunks/{chunk-HLFDC4SF.js → chunk-HSDOOFV7.js} +1 -1
  83. package/dist/cli/chunks/{chunk-MQGEZA2A.js → chunk-HTWIGQL4.js} +2 -2
  84. package/dist/cli/chunks/{chunk-HBYQYGXP.js → chunk-HXBAQKMH.js} +2 -2
  85. package/dist/cli/chunks/chunk-HZFT3P5B.js +2 -0
  86. package/dist/cli/chunks/{chunk-MS3Z2CP5.js → chunk-I7H4IP7T.js} +2 -2
  87. package/dist/cli/chunks/{chunk-IHFUEPZH.js → chunk-IARSGAG7.js} +2 -2
  88. package/dist/cli/chunks/{chunk-ZTC5FBL6.js → chunk-IC2WSSD5.js} +8 -8
  89. package/dist/cli/chunks/{chunk-GKPRECLL.js → chunk-ICPALF4Q.js} +2 -2
  90. package/dist/cli/chunks/{chunk-FQKEZVN6.js → chunk-IWQQIXHO.js} +2 -2
  91. package/dist/cli/chunks/{chunk-DWZI3IVB.js → chunk-IYQ7XNE5.js} +2 -2
  92. package/dist/cli/chunks/{chunk-ZLBBX24Q.js → chunk-J26GADQE.js} +418 -412
  93. package/dist/cli/chunks/{chunk-NMJVG22Z.js → chunk-J43DV3ME.js} +1 -1
  94. package/dist/cli/chunks/{chunk-EUEHBERE.js → chunk-JFPXCQNP.js} +1 -1
  95. package/dist/cli/chunks/{chunk-3YNP33GB.js → chunk-JK6B3ULP.js} +2 -2
  96. package/dist/cli/chunks/{chunk-FBEXG4HD.js → chunk-JPHDMHFG.js} +2 -2
  97. package/dist/cli/chunks/{chunk-U6OVPMQX.js → chunk-JVYPXW6Y.js} +2 -2
  98. package/dist/cli/chunks/{chunk-X52TMBHU.js → chunk-JY4AIEZ7.js} +1 -1
  99. package/dist/cli/chunks/{chunk-MNQ36MAF.js → chunk-JY4WLN3K.js} +2 -2
  100. package/dist/cli/chunks/{chunk-E4VIVMDL.js → chunk-JYXOFN3E.js} +2 -2
  101. package/dist/cli/chunks/{chunk-CR2JUANW.js → chunk-K7W55B7Q.js} +3 -3
  102. package/dist/cli/chunks/{chunk-WLIYWBQR.js → chunk-KPOPBUUJ.js} +2 -2
  103. package/dist/cli/chunks/{chunk-DXVZBJE4.js → chunk-LDXQRNTT.js} +1 -1
  104. package/dist/cli/chunks/{chunk-W3ZGNNDV.js → chunk-LDZWIV2O.js} +1 -1
  105. package/dist/cli/chunks/{chunk-VRJPH3LG.js → chunk-LGBN7TKC.js} +2 -2
  106. package/dist/cli/chunks/{chunk-RUJLVJDE.js → chunk-LMEU64TR.js} +2 -2
  107. package/dist/cli/chunks/{chunk-JI77KJP7.js → chunk-LP4AS2E4.js} +1 -1
  108. package/dist/cli/chunks/{chunk-QPV3OKX2.js → chunk-LQOVA4YX.js} +2 -2
  109. package/dist/cli/chunks/{chunk-NLDFNAOS.js → chunk-LVEX4GID.js} +2 -2
  110. package/dist/cli/chunks/{chunk-U4TV75AC.js → chunk-M63QB466.js} +2 -2
  111. package/dist/cli/chunks/{chunk-SAPIRK2G.js → chunk-MDC4G323.js} +1 -1
  112. package/dist/cli/chunks/chunk-MHZPC4HJ.js +2 -0
  113. package/dist/cli/chunks/{chunk-WR64BKUE.js → chunk-MJJC6HUK.js} +1 -1
  114. package/dist/cli/chunks/{chunk-Y7GPLOXB.js → chunk-MKFQNCXI.js} +2 -2
  115. package/dist/cli/chunks/{chunk-BZFT4QDQ.js → chunk-MMXG3LL6.js} +2 -2
  116. package/dist/cli/chunks/{chunk-HGBJ2QQ4.js → chunk-MNCF643K.js} +2 -2
  117. package/dist/cli/chunks/{chunk-XIE7OHML.js → chunk-MNZFEIE5.js} +1 -1
  118. package/dist/cli/chunks/{chunk-FE3AIZI6.js → chunk-MQ6OF6DU.js} +1 -1
  119. package/dist/cli/chunks/{chunk-3QD7U3FY.js → chunk-MRHM4COP.js} +2 -2
  120. package/dist/cli/chunks/{chunk-663ZFPUL.js → chunk-N4PMPSJJ.js} +2 -2
  121. package/dist/cli/chunks/{chunk-DL5JENWD.js → chunk-NZQPP533.js} +3 -3
  122. package/dist/cli/chunks/{chunk-4XSCZVON.js → chunk-OA4GR3EZ.js} +2 -2
  123. package/dist/cli/chunks/{chunk-IJOFZBXD.js → chunk-OJEZNLB6.js} +2 -2
  124. package/dist/cli/chunks/{chunk-OU4ZAWCC.js → chunk-ONVALAZN.js} +2 -2
  125. package/dist/cli/chunks/{chunk-A337MD3C.js → chunk-PEKDSJBC.js} +2 -2
  126. package/dist/cli/chunks/{chunk-D3G2NN7F.js → chunk-PG64YV6C.js} +66 -65
  127. package/dist/cli/chunks/{chunk-VYDNLQJN.js → chunk-PQV7E7XH.js} +2 -2
  128. package/dist/cli/chunks/chunk-PTK66HEY.js +2 -0
  129. package/dist/cli/chunks/{chunk-LRASYSGV.js → chunk-PUECC4WI.js} +2 -2
  130. package/dist/cli/chunks/{chunk-3OAQPN2N.js → chunk-PXZKPUW6.js} +2 -2
  131. package/dist/cli/chunks/chunk-PYHYOKYT.js +2 -0
  132. package/dist/cli/chunks/{chunk-WT3JC4A6.js → chunk-PZG3542B.js} +2 -2
  133. package/dist/cli/chunks/{chunk-RMJ7PJOS.js → chunk-Q2T5FXEA.js} +2 -2
  134. package/dist/cli/chunks/chunk-QJE6ZW2X.js +6 -0
  135. package/dist/cli/chunks/{chunk-2XYTS2WY.js → chunk-QNQSM2OG.js} +2 -2
  136. package/dist/cli/chunks/{chunk-EVCFUYYK.js → chunk-QQT6QENQ.js} +9 -9
  137. package/dist/cli/chunks/{chunk-VH3EB6ZG.js → chunk-QVG4ZDXX.js} +3 -3
  138. package/dist/cli/chunks/chunk-QWLTHFZW.js +16 -0
  139. package/dist/cli/chunks/{chunk-GGDKOJVF.js → chunk-RCYLCA7E.js} +10 -6
  140. package/dist/cli/chunks/{chunk-BMWAWZAN.js → chunk-REEIFA6A.js} +2 -2
  141. package/dist/cli/chunks/{chunk-Y2E3IJ53.js → chunk-RNYX4CPI.js} +2 -2
  142. package/dist/cli/chunks/{chunk-BY646JOM.js → chunk-RORZ5O5Z.js} +2 -2
  143. package/dist/cli/chunks/{chunk-JNMUVBAJ.js → chunk-RRPYWBFX.js} +2 -2
  144. package/dist/cli/chunks/{chunk-XQRE2HWM.js → chunk-RXAFLK34.js} +2 -2
  145. package/dist/cli/chunks/{chunk-UXZEVIFX.js → chunk-SQHLC6I5.js} +1 -1
  146. package/dist/cli/chunks/{chunk-DPV33C77.js → chunk-SSP2B2WR.js} +2 -2
  147. package/dist/cli/chunks/chunk-SX2YSHE7.js +115 -0
  148. package/dist/cli/chunks/chunk-T3ZDVU6F.js +5 -0
  149. package/dist/cli/chunks/{chunk-JCC7QEKZ.js → chunk-T6W5APYP.js} +1 -1
  150. package/dist/cli/chunks/{chunk-DEGWCUMY.js → chunk-TU4LIIOP.js} +2 -2
  151. package/dist/cli/chunks/{chunk-CQMHDAJS.js → chunk-UBYCR3O4.js} +2 -2
  152. package/dist/cli/chunks/{chunk-PHP4UJYP.js → chunk-UCLN6AME.js} +1 -1
  153. package/dist/cli/chunks/{chunk-HIUNCO2W.js → chunk-UIYKR2SA.js} +2 -2
  154. package/dist/cli/chunks/{chunk-ONCH5AXU.js → chunk-UUHIEM2M.js} +18 -18
  155. package/dist/cli/chunks/{chunk-CFPR24YK.js → chunk-UY3REQOK.js} +2 -2
  156. package/dist/cli/chunks/{chunk-FNAYDITO.js → chunk-V2SAEMZY.js} +1 -1
  157. package/dist/cli/chunks/{chunk-JANLATHN.js → chunk-V5NGBQAQ.js} +2 -2
  158. package/dist/cli/chunks/{chunk-644DFAGS.js → chunk-VCA6YYII.js} +1 -1
  159. package/dist/cli/chunks/chunk-VJRZFWR5.js +2 -0
  160. package/dist/cli/chunks/{chunk-7BIYJRQJ.js → chunk-VKPKYMCT.js} +2 -2
  161. package/dist/cli/chunks/{chunk-2KWI3MT3.js → chunk-VNW5Q2CX.js} +2 -2
  162. package/dist/cli/chunks/chunk-VUFRTGML.js +3 -0
  163. package/dist/cli/chunks/{chunk-PHAQWAEV.js → chunk-W4X2VTIY.js} +2 -2
  164. package/dist/cli/chunks/{chunk-PURHGLEC.js → chunk-WTLIEBDH.js} +1 -1
  165. package/dist/cli/chunks/{chunk-3SH23PS3.js → chunk-WUV5RZUI.js} +2 -2
  166. package/dist/cli/chunks/{chunk-OGYWWZU7.js → chunk-WXI2STKQ.js} +2 -2
  167. package/dist/cli/chunks/{chunk-OW42F2TX.js → chunk-XEWXYGJI.js} +2 -2
  168. package/dist/cli/chunks/{chunk-DPYDUKVZ.js → chunk-XNSQZ3O7.js} +2 -2
  169. package/dist/cli/chunks/{chunk-B2UHTA4Q.js → chunk-XTJMY3KS.js} +1 -1
  170. package/dist/cli/chunks/{chunk-NF6AFIAX.js → chunk-XXAVQACL.js} +1 -1
  171. package/dist/cli/chunks/{chunk-V7GNUVYI.js → chunk-Y4SAWE45.js} +1 -1
  172. package/dist/cli/chunks/{chunk-WC47GICZ.js → chunk-Y6A46M3B.js} +2 -2
  173. package/dist/cli/chunks/{chunk-3DTEQHFB.js → chunk-YDZJWDR6.js} +3 -3
  174. package/dist/cli/chunks/{chunk-KJ3KBP24.js → chunk-YFOBQSOW.js} +2 -2
  175. package/dist/cli/chunks/{chunk-MB4VFAJC.js → chunk-YK3NOC2R.js} +2 -2
  176. package/dist/cli/chunks/{chunk-GRIPCYW5.js → chunk-YUC7RJGR.js} +1 -1
  177. package/dist/cli/chunks/{chunk-HPLMX62I.js → chunk-Z3VJLWRR.js} +2 -2
  178. package/dist/cli/chunks/{chunk-EOR3RECZ.js → chunk-ZLVQSEZK.js} +2 -2
  179. package/dist/cli/chunks/{chunk-4AZP7ZCW.js → chunk-ZRLNACPY.js} +2 -2
  180. package/dist/cli/chunks/{chunk-OQDC7GCM.js → chunk-ZTMZFF25.js} +2 -2
  181. package/dist/cli/chunks/chunk-ZUMDDMDE.js +3 -0
  182. package/dist/cli/chunks/ci-5HEXJZ2C.js +81 -0
  183. package/dist/cli/chunks/{ci-config-XDDZOOEI.js → ci-config-WU4NPDAM.js} +2 -2
  184. package/dist/cli/chunks/{ci-output-7ZUQI4U6.js → ci-output-BJQVXX5E.js} +2 -2
  185. package/dist/cli/chunks/{circuit-breaker-ALXKCFAL.js → circuit-breaker-3BMGTQCB.js} +2 -2
  186. package/dist/cli/chunks/{claude-flow-setup-RL7K2NI2.js → claude-flow-setup-GVDGJWMU.js} +2 -2
  187. package/dist/cli/chunks/client-S7GNYTZ5.js +2 -0
  188. package/dist/cli/chunks/{cline-installer-2Z2QQKC3.js → cline-installer-V4MRGWVA.js} +2 -2
  189. package/dist/cli/chunks/{code-QSZTDINQ.js → code-A3TGQPEO.js} +3 -3
  190. package/dist/cli/chunks/{code-index-extractor-5CGR5D3Y.js → code-index-extractor-YJQSYWD3.js} +2 -2
  191. package/dist/cli/chunks/{codex-installer-7JLSEDE5.js → codex-installer-7N7UQPAH.js} +2 -2
  192. package/dist/cli/chunks/{completions-U4NBSXEB.js → completions-PPGVYLZS.js} +2 -2
  193. package/dist/cli/chunks/{complexity-analyzer-WYZD2YSY.js → complexity-analyzer-XZTFLYV5.js} +2 -2
  194. package/dist/cli/chunks/{continuedev-installer-UPXINJFT.js → continuedev-installer-Z5I57RAH.js} +2 -2
  195. package/dist/cli/chunks/{copilot-installer-WIVYQRIF.js → copilot-installer-F5YZ6BHB.js} +2 -2
  196. package/dist/cli/chunks/core-handlers-CUEPOQIO.js +2 -0
  197. package/dist/cli/chunks/{cost-tracker-RIN4JDDM.js → cost-tracker-GO33ZQAP.js} +2 -2
  198. package/dist/cli/chunks/coverage-GSHKLY74.js +49 -0
  199. package/dist/cli/chunks/cross-domain-router-CXN5QFEV.js +2 -0
  200. package/dist/cli/chunks/{cursor-installer-POM7NGCC.js → cursor-installer-JJ7IVJZB.js} +2 -2
  201. package/dist/cli/chunks/daemon-3DQCKRYO.js +10 -0
  202. package/dist/cli/chunks/{daemon-HFGKQ6LB.js → daemon-IRL7QRNE.js} +5 -5
  203. package/dist/cli/chunks/{dag-attention-scheduler-HJXM7Q5P.js → dag-attention-scheduler-ORXSUHPA.js} +2 -2
  204. package/dist/cli/chunks/{detect-XKQGLZYN.js → detect-RHU62KRI.js} +2 -2
  205. package/dist/cli/chunks/{dist-node-SSKB53QL.js → dist-node-3VKV4Z6C.js} +2 -2
  206. package/dist/cli/chunks/{domain-handler-6BNDHATU.js → domain-handler-SFIML4FK.js} +2 -2
  207. package/dist/cli/chunks/{domain-plugins-DOX54YE3.js → domain-plugins-CJ4FA3OC.js} +2 -2
  208. package/dist/cli/chunks/{domain-transfer-FW4ZX3Z7.js → domain-transfer-BCRKPCAA.js} +2 -2
  209. package/dist/cli/chunks/dream-5AUNJW24.js +2 -0
  210. package/dist/cli/chunks/embed-and-insert-pattern-VL3HFLPV.js +3 -0
  211. package/dist/cli/chunks/{eval-K7E4XXBS.js → eval-GGKRI4P5.js} +2 -2
  212. package/dist/cli/chunks/experience-capture-middleware-F72TIRQY.js +40 -0
  213. package/dist/cli/chunks/{fast-paths-5JXXTYAG.js → fast-paths-7KOOF3MA.js} +2 -2
  214. package/dist/cli/chunks/{feature-flags-2CR3CO23.js → feature-flags-FNHBTHBH.js} +2 -2
  215. package/dist/cli/chunks/{feature-flags-RB72LHOJ.js → feature-flags-IOZEWWFU.js} +2 -2
  216. package/dist/cli/chunks/file-discovery-AYWF357I.js +2 -0
  217. package/dist/cli/chunks/{fleet-SDU7QEOA.js → fleet-QX5KXTRC.js} +3 -3
  218. package/dist/cli/chunks/{gnn-wrapper-AWCFODUV.js → gnn-wrapper-OH2DOQP7.js} +2 -2
  219. package/dist/cli/chunks/{heartbeat-handler-A4PJ3NFP.js → heartbeat-handler-W67NXTNE.js} +4 -4
  220. package/dist/cli/chunks/heartbeat-scheduler-7ZIDVXIP.js +2 -0
  221. package/dist/cli/chunks/hnsw-adapter-P77OC7FM.js +2 -0
  222. package/dist/cli/chunks/hnsw-index-3LBOTQAW.js +2 -0
  223. package/dist/cli/chunks/{hnsw-legacy-bridge-KRS7SSFM.js → hnsw-legacy-bridge-6MLLOGOE.js} +2 -2
  224. package/dist/cli/chunks/{hnswlib-node-OGGCPKPO.js → hnswlib-node-4UDISJ3G.js} +2 -2
  225. package/dist/cli/chunks/{hooks-XNRNMUBW.js → hooks-NOQJWQ4P.js} +43 -43
  226. package/dist/cli/chunks/hybrid-backend-LOM54PDD.js +2 -0
  227. package/dist/cli/chunks/{hypergraph-engine-X35LTXYT.js → hypergraph-engine-2OD3APVP.js} +2 -2
  228. package/dist/cli/chunks/{hypergraph-handler-M6THKAG6.js → hypergraph-handler-5AZGMBUM.js} +3 -3
  229. package/dist/cli/chunks/impact-analyzer-QSDJVBPS.js +2 -0
  230. package/dist/cli/chunks/init-guard-SMGJ45PW.js +2 -0
  231. package/dist/cli/chunks/init-handler-5T4MP2NM.js +88 -0
  232. package/dist/cli/chunks/init-wizard-MK2325JJ.js +2 -0
  233. package/dist/cli/chunks/kernel-2NJQQ2KT.js +2 -0
  234. package/dist/cli/chunks/{kilocode-installer-TEPR2ZJD.js → kilocode-installer-RLZYLVQJ.js} +2 -2
  235. package/dist/cli/chunks/{kiro-installer-RUKHGDEE.js → kiro-installer-LFZOC7VD.js} +2 -2
  236. package/dist/cli/chunks/knowledge-graph-SDISHO62.js +2 -0
  237. package/dist/cli/chunks/learning-XRPGLUWR.js +122 -0
  238. package/dist/cli/chunks/{llm-router-7GECMDCP.js → llm-router-OMK5HYPH.js} +4 -4
  239. package/dist/cli/chunks/llm-router-service-YTCMRBAN.js +2 -0
  240. package/dist/cli/chunks/{load-NTJ4Y4ZR.js → load-XADC7KCU.js} +2 -2
  241. package/dist/cli/chunks/load-test-RPKHLBCC.js +2 -0
  242. package/dist/cli/chunks/{mcp-4335GTTG.js → mcp-PIBKSSVU.js} +2 -2
  243. package/dist/cli/chunks/{memory-HYC4M4XS.js → memory-AP7EZERS.js} +5 -5
  244. package/dist/cli/chunks/memory-backend-BZXFO4JZ.js +2 -0
  245. package/dist/cli/chunks/memory-handlers-MOFDNB6E.js +2 -0
  246. package/dist/cli/chunks/{multi-model-executor-T7FYKM6T.js → multi-model-executor-7JJ2FZ33.js} +2 -2
  247. package/dist/cli/chunks/{opencode-installer-3USXVT5M.js → opencode-installer-ZZZ6EBYJ.js} +2 -2
  248. package/dist/cli/chunks/orchestrator-2H2YKSGJ.js +452 -0
  249. package/dist/cli/chunks/pattern-null-store-4PRPIOR6.js +2 -0
  250. package/dist/cli/chunks/{pattern-usage-recorder-CMZLPX2K.js → pattern-usage-recorder-7MJJWC2Z.js} +2 -2
  251. package/dist/cli/chunks/{pipeline-BTRZOVSL.js → pipeline-LIE5BWQY.js} +2 -2
  252. package/dist/cli/chunks/{platform-2MCRKC25.js → platform-SMYUNLGX.js} +2 -2
  253. package/dist/cli/chunks/plugin-LJDIXQNT.js +27 -0
  254. package/dist/cli/chunks/{prime-radiant-advanced-wasm-TXFEMBP6.js → prime-radiant-advanced-wasm-RIDNE5D2.js} +2 -2
  255. package/dist/cli/chunks/project-root-NBIQF63D.js +2 -0
  256. package/dist/cli/chunks/protocol-executor-BRPGIYWQ.js +2 -0
  257. package/dist/cli/chunks/{protocol-handler-DZ26OYVZ.js → protocol-handler-YVM66DLI.js} +2 -2
  258. package/dist/cli/chunks/{prove-QWONEJWX.js → prove-ZBDT52GD.js} +2 -2
  259. package/dist/cli/chunks/qe-reasoning-bank-GDZACWKW.js +2 -0
  260. package/dist/cli/chunks/{quality-WFH54FY7.js → quality-DUKXGDDO.js} +2 -2
  261. package/dist/cli/chunks/{quality-gate-ONJB7XU7.js → quality-gate-SM3RXF4V.js} +3 -3
  262. package/dist/cli/chunks/queen-coordinator-LDKLBPD5.js +2 -0
  263. package/dist/cli/chunks/real-embeddings-4QLQZDB5.js +2 -0
  264. package/dist/cli/chunks/{ref-validation-HW5Y55ZC.js → ref-validation-M3EO32YQ.js} +2 -2
  265. package/dist/cli/chunks/{roocode-installer-5OABDNZT.js → roocode-installer-S6Q5OLV5.js} +2 -2
  266. package/dist/cli/chunks/router-H5YSIRH2.js +2 -0
  267. package/dist/cli/chunks/routing-feedback-5R36TJDH.js +2 -0
  268. package/dist/cli/chunks/{routing-handler-CVHVOQTC.js → routing-handler-55FMUACP.js} +2 -2
  269. package/dist/cli/chunks/{ruvector-commands-KKDKFGIQ.js → ruvector-commands-QATKAAPK.js} +2 -2
  270. package/dist/cli/chunks/rvf-dual-writer-TT2DBQQQ.js +2 -0
  271. package/dist/cli/chunks/rvf-migration-adapter-BCLFJKSK.js +2 -0
  272. package/dist/cli/chunks/rvf-migration-coordinator-RFXFU6JD.js +2 -0
  273. package/dist/cli/chunks/rvf-native-adapter-UXI66OQJ.js +2 -0
  274. package/dist/cli/chunks/{rvf-store-integrity-UGUXKIFX.js → rvf-store-integrity-PKDVXQAW.js} +2 -2
  275. package/dist/cli/chunks/safe-db-MSTD2GDH.js +2 -0
  276. package/dist/cli/chunks/schedule-KST6KIFD.js +2 -0
  277. package/dist/cli/chunks/scheduler-FTQS6YK3.js +2 -0
  278. package/dist/cli/chunks/security-CMRB6WA3.js +18 -0
  279. package/dist/cli/chunks/shared-rvf-adapter-YHLLNFHF.js +2 -0
  280. package/dist/cli/chunks/{shared-rvf-dual-writer-ZSHYG5IA.js → shared-rvf-dual-writer-4BGDVPQ7.js} +2 -2
  281. package/dist/cli/chunks/sqlite-persistence-ZX5QFDMR.js +2 -0
  282. package/dist/cli/chunks/{standalone-memory-MHZEEYMK.js → standalone-memory-LUHKQAGM.js} +2 -2
  283. package/dist/cli/chunks/{status-handler-JKXPJ22K.js → status-handler-S6S5PNR7.js} +2 -2
  284. package/dist/cli/chunks/{structural-health-J4RKCYWF.js → structural-health-PQ7NZAJ4.js} +2 -2
  285. package/dist/cli/chunks/{sync-PDPORHVN.js → sync-Q6KRQXU6.js} +2 -2
  286. package/dist/cli/chunks/sync-S744AEJC.js +2 -0
  287. package/dist/cli/chunks/{task-handler-VERADM44.js → task-handler-GAMGEHUW.js} +2 -2
  288. package/dist/cli/chunks/{task-handlers-4RUCWUR2.js → task-handlers-6CRDEELN.js} +3 -3
  289. package/dist/cli/chunks/{test-DMBJFQNL.js → test-FNH67DBK.js} +12 -12
  290. package/dist/cli/chunks/{test-scheduling-LUPTVGCD.js → test-scheduling-NZA5SHK6.js} +3 -3
  291. package/dist/cli/chunks/token-bootstrap-CXKG55JD.js +2 -0
  292. package/dist/cli/chunks/{token-usage-VOA34IKM.js → token-usage-M7WWEDJX.js} +2 -2
  293. package/dist/cli/chunks/{transformers-GU4TYAN5.js → transformers-2IFMCK6A.js} +2 -2
  294. package/dist/cli/chunks/{tree-sitter-wasm-parser-MZPXAH7C.js → tree-sitter-wasm-parser-NMNA6RJC.js} +2 -2
  295. package/dist/cli/chunks/{types-K4FLXR2K.js → types-N7FWTOLD.js} +2 -2
  296. package/dist/cli/chunks/unified-memory-2Z2F446J.js +2 -0
  297. package/dist/cli/chunks/unified-memory-hnsw-A4EWYPJQ.js +2 -0
  298. package/dist/cli/chunks/unified-persistence-Z6N6JZFA.js +2 -0
  299. package/dist/cli/chunks/{upgrade-M3ATDRMK.js → upgrade-KDB5RGL7.js} +2 -2
  300. package/dist/cli/chunks/{validate-AAP773B3.js → validate-KMUV5FUA.js} +2 -2
  301. package/dist/cli/chunks/{validate-swarm-7RGAZX5F.js → validate-swarm-ANZWRCJU.js} +2 -2
  302. package/dist/cli/chunks/visual-security-GXYZV7KR.js +2 -0
  303. package/dist/cli/chunks/{web-tree-sitter-GQMRHGGI.js → web-tree-sitter-SXXC4NMS.js} +2 -2
  304. package/dist/cli/chunks/{windsurf-installer-HG6HF2GF.js → windsurf-installer-2LWSKMBU.js} +2 -2
  305. package/dist/cli/chunks/witness-chain-52PEIEGK.js +2 -0
  306. package/dist/cli/chunks/{witness-chain-WKU3ZIBQ.js → witness-chain-JJMSJFZP.js} +2 -2
  307. package/dist/cli/chunks/witness-chain-repair-OX7VFW6T.js +2 -0
  308. package/dist/cli/chunks/{witness-chain-verifier-Q2KW3QEQ.js → witness-chain-verifier-QLSMXHAZ.js} +2 -2
  309. package/dist/cli/chunks/witness-key-manager-3DS4L7LE.js +2 -0
  310. package/dist/cli/chunks/{workflow-CX6SHFBW.js → workflow-ARWAMHD3.js} +28 -28
  311. package/dist/cli/chunks/workflow-orchestrator-DORMQMG7.js +2 -0
  312. package/dist/cli/chunks/wrappers-J6KGTUSJ.js +2 -0
  313. package/dist/cli/commands/ci.js +47 -25
  314. package/dist/cli/commands/coverage.d.ts +1 -28
  315. package/dist/cli/commands/coverage.js +63 -134
  316. package/dist/cli/commands/daemon.js +7 -1
  317. package/dist/cli/commands/hooks-handlers/stats-hooks.d.ts +15 -0
  318. package/dist/cli/commands/hooks-handlers/stats-hooks.js +54 -2
  319. package/dist/cli/commands/learning.js +50 -9
  320. package/dist/cli/commands/security.d.ts +16 -0
  321. package/dist/cli/commands/security.js +76 -9
  322. package/dist/cli/commands/test.js +6 -7
  323. package/dist/cli/commands/workflow.js +9 -5
  324. package/dist/cli/handlers/init-guard.d.ts +33 -0
  325. package/dist/cli/handlers/init-guard.js +66 -0
  326. package/dist/cli/handlers/init-handler.d.ts +3 -0
  327. package/dist/cli/handlers/init-handler.js +64 -54
  328. package/dist/cli/handlers/interfaces.js +5 -1
  329. package/dist/cli/index.js +11 -0
  330. package/dist/cli/scheduler/persistent-scheduler.d.ts +6 -2
  331. package/dist/cli/scheduler/persistent-scheduler.js +107 -41
  332. package/dist/cli/utils/ci-output.d.ts +13 -1
  333. package/dist/cli/utils/ci-output.js +21 -2
  334. package/dist/cli/utils/coverage-data.d.ts +3 -0
  335. package/dist/cli/utils/coverage-data.js +14 -39
  336. package/dist/cli/utils/coverage-verdict.d.ts +130 -0
  337. package/dist/cli/utils/coverage-verdict.js +193 -0
  338. package/dist/cli/utils/file-discovery.js +5 -0
  339. package/dist/coordination/deterministic-actions.js +24 -13
  340. package/dist/coordination/handlers/code-intelligence-handlers.d.ts +8 -0
  341. package/dist/coordination/handlers/code-intelligence-handlers.js +39 -0
  342. package/dist/coordination/handlers/coverage-handlers.js +34 -6
  343. package/dist/coordination/handlers/coverage-runner.d.ts +22 -0
  344. package/dist/coordination/handlers/coverage-runner.js +105 -10
  345. package/dist/coordination/handlers/coverage-target.d.ts +1 -0
  346. package/dist/coordination/handlers/coverage-target.js +4 -1
  347. package/dist/coordination/handlers/handler-types.d.ts +9 -0
  348. package/dist/coordination/handlers/handler-utils.d.ts +14 -1
  349. package/dist/coordination/handlers/handler-utils.js +46 -22
  350. package/dist/coordination/handlers/quality-handlers.js +108 -18
  351. package/dist/coordination/handlers/security-handlers.js +22 -6
  352. package/dist/coordination/handlers/test-execution-handlers.js +4 -1
  353. package/dist/coordination/protocols/defect-investigation.d.ts +2 -1
  354. package/dist/coordination/protocols/defect-investigation.js +12 -3
  355. package/dist/coordination/protocols/quality-gate.js +10 -6
  356. package/dist/coordination/protocols/security-audit.js +11 -0
  357. package/dist/coordination/result-saver.d.ts +31 -0
  358. package/dist/coordination/result-saver.js +146 -46
  359. package/dist/coordination/task-executor.d.ts +7 -0
  360. package/dist/coordination/task-executor.js +32 -3
  361. package/dist/domains/code-intelligence/plugin.js +4 -0
  362. package/dist/domains/code-intelligence/services/metric-collector/index.js +9 -2
  363. package/dist/domains/code-intelligence/services/metric-collector/interfaces.d.ts +21 -0
  364. package/dist/domains/code-intelligence/services/metric-collector/interfaces.js +25 -0
  365. package/dist/domains/code-intelligence/services/metric-collector/loc-counter.d.ts +12 -0
  366. package/dist/domains/code-intelligence/services/metric-collector/loc-counter.js +69 -3
  367. package/dist/domains/code-intelligence/services/metric-collector/test-counter.js +4 -1
  368. package/dist/domains/coverage-analysis/collected-metrics.d.ts +35 -0
  369. package/dist/domains/coverage-analysis/collected-metrics.js +42 -0
  370. package/dist/domains/coverage-analysis/coordinator.js +18 -6
  371. package/dist/domains/coverage-analysis/interfaces.d.ts +44 -0
  372. package/dist/domains/coverage-analysis/interfaces.js +6 -1
  373. package/dist/domains/coverage-analysis/services/coverage-analyzer.js +61 -34
  374. package/dist/domains/coverage-analysis/services/gap-detector.js +7 -2
  375. package/dist/domains/defect-intelligence/plugin.js +4 -0
  376. package/dist/domains/defect-intelligence/services/defect-predictor.js +13 -8
  377. package/dist/domains/learning-optimization/coordinator.js +4 -0
  378. package/dist/domains/learning-optimization/plugin.js +4 -0
  379. package/dist/domains/quality-assessment/coordinator-rl-integration.d.ts +14 -0
  380. package/dist/domains/quality-assessment/coordinator-rl-integration.js +54 -16
  381. package/dist/domains/quality-assessment/coordinator.js +10 -6
  382. package/dist/domains/quality-assessment/coverage-report-event.d.ts +32 -8
  383. package/dist/domains/quality-assessment/coverage-report-event.js +28 -6
  384. package/dist/domains/quality-assessment/index.d.ts +1 -1
  385. package/dist/domains/quality-assessment/interfaces.d.ts +50 -0
  386. package/dist/domains/quality-assessment/quality-evidence.d.ts +49 -3
  387. package/dist/domains/quality-assessment/quality-evidence.js +62 -0
  388. package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +23 -2
  389. package/dist/domains/quality-assessment/services/quality-analyzer.js +197 -112
  390. package/dist/domains/quality-assessment/services/quality-gate.js +12 -3
  391. package/dist/domains/security-compliance/dependency-advisory-engine.d.ts +52 -0
  392. package/dist/domains/security-compliance/dependency-advisory-engine.js +113 -0
  393. package/dist/domains/security-compliance/interfaces.d.ts +30 -0
  394. package/dist/domains/security-compliance/plugin.d.ts +7 -1
  395. package/dist/domains/security-compliance/plugin.js +19 -0
  396. package/dist/domains/security-compliance/services/scanners/dast-scanner.js +22 -16
  397. package/dist/domains/security-compliance/services/scanners/dependency-resolver.d.ts +71 -0
  398. package/dist/domains/security-compliance/services/scanners/dependency-resolver.js +232 -0
  399. package/dist/domains/security-compliance/services/scanners/dependency-scanner.d.ts +21 -6
  400. package/dist/domains/security-compliance/services/scanners/dependency-scanner.js +142 -64
  401. package/dist/domains/security-compliance/services/scanners/lockfile-versions.d.ts +43 -0
  402. package/dist/domains/security-compliance/services/scanners/lockfile-versions.js +248 -0
  403. package/dist/domains/security-compliance/services/scanners/scanner-types.d.ts +30 -2
  404. package/dist/domains/security-compliance/services/security-auditor.d.ts +19 -6
  405. package/dist/domains/security-compliance/services/security-auditor.js +133 -92
  406. package/dist/domains/test-execution/interfaces.d.ts +10 -6
  407. package/dist/domains/test-execution/plugin.js +4 -0
  408. package/dist/domains/test-execution/services/retry-handler.js +17 -6
  409. package/dist/domains/test-execution/services/test-executor.d.ts +1 -0
  410. package/dist/domains/test-execution/services/test-executor.js +239 -109
  411. package/dist/domains/test-generation/coordinator.js +4 -0
  412. package/dist/domains/test-generation/plugin.js +4 -0
  413. package/dist/feedback/coverage-learner.js +4 -1
  414. package/dist/feedback/coverage-session-provenance.d.ts +29 -0
  415. package/dist/feedback/coverage-session-provenance.js +39 -0
  416. package/dist/init/orchestrator.js +2 -0
  417. package/dist/init/phases/09-assets.d.ts +4 -0
  418. package/dist/init/phases/09-assets.js +35 -0
  419. package/dist/init/retired-assets.d.ts +86 -0
  420. package/dist/init/retired-assets.js +230 -0
  421. package/dist/init/skills-installer.d.ts +2 -0
  422. package/dist/init/skills-installer.js +4 -0
  423. package/dist/init/types.d.ts +3 -0
  424. package/dist/integrations/ruvector/rvf-native-adapter.d.ts +2 -0
  425. package/dist/integrations/ruvector/rvf-native-adapter.js +5 -0
  426. package/dist/integrations/ruvector/server-client.js +4 -12
  427. package/dist/kernel/project-root.d.ts +17 -0
  428. package/dist/kernel/project-root.js +54 -2
  429. package/dist/kernel/shared-dirs.d.ts +66 -0
  430. package/dist/kernel/shared-dirs.js +180 -0
  431. package/dist/learning/daily-log.js +2 -1
  432. package/dist/learning/experience-capture-middleware.d.ts +22 -0
  433. package/dist/learning/experience-capture-middleware.js +35 -0
  434. package/dist/learning/learnable-result.d.ts +16 -0
  435. package/dist/learning/learnable-result.js +24 -0
  436. package/dist/learning/pattern-mutation-error.d.ts +8 -0
  437. package/dist/learning/pattern-mutation-error.js +12 -0
  438. package/dist/learning/qe-reasoning-bank.d.ts +10 -0
  439. package/dist/learning/qe-reasoning-bank.js +50 -1
  440. package/dist/learning/rvf-reconcile.d.ts +39 -0
  441. package/dist/learning/rvf-reconcile.js +40 -0
  442. package/dist/learning/sqlite-persistence.d.ts +14 -0
  443. package/dist/learning/sqlite-persistence.js +36 -0
  444. package/dist/mcp/bundle.js +908 -896
  445. package/dist/mcp/handlers/domain-handler-configs.d.ts +35 -1
  446. package/dist/mcp/handlers/domain-handler-configs.js +42 -4
  447. package/dist/mcp/handlers/handler-factory.js +40 -14
  448. package/dist/mcp/protocol-server.js +29 -3
  449. package/dist/mcp/tool-cache-scope.d.ts +31 -0
  450. package/dist/mcp/tool-cache-scope.js +71 -0
  451. package/dist/mcp/tools/code-intelligence/analyze.js +5 -3
  452. package/dist/mcp/types.d.ts +10 -0
  453. package/dist/optimization/session-cache.d.ts +19 -1
  454. package/dist/optimization/session-cache.js +36 -2
  455. package/dist/plugins/cache.js +2 -1
  456. package/dist/plugins/sources/github.js +2 -1
  457. package/dist/plugins/sources/npm.js +2 -1
  458. package/dist/shared/aqe-managed-dirs.d.ts +24 -0
  459. package/dist/shared/aqe-managed-dirs.js +56 -0
  460. package/dist/shared/events/domain-events.d.ts +18 -3
  461. package/dist/shared/events/domain-events.js +4 -0
  462. package/dist/shared/http/http-client.d.ts +6 -0
  463. package/dist/shared/http/http-client.js +13 -15
  464. package/dist/shared/io/file-reader.d.ts +26 -0
  465. package/dist/shared/io/file-reader.js +111 -17
  466. package/dist/shared/llm/providers/response-deadline.d.ts +7 -2
  467. package/dist/shared/llm/providers/response-deadline.js +17 -5
  468. package/dist/shared/metrics/code-metrics.d.ts +24 -0
  469. package/dist/shared/metrics/code-metrics.js +93 -6
  470. package/dist/shared/metrics/index.d.ts +1 -1
  471. package/dist/shared/security/index.d.ts +2 -2
  472. package/dist/shared/security/index.js +1 -1
  473. package/dist/shared/security/osv-client.d.ts +79 -132
  474. package/dist/shared/security/osv-client.js +344 -167
  475. package/dist/shared/security/osv-lookup.d.ts +124 -0
  476. package/dist/shared/security/osv-lookup.js +246 -0
  477. package/dist/shared/security/osv-types.d.ts +119 -0
  478. package/dist/shared/security/osv-types.js +6 -0
  479. package/dist/workers/interfaces.d.ts +15 -2
  480. package/dist/workers/namespaced-keys.d.ts +16 -0
  481. package/dist/workers/namespaced-keys.js +24 -0
  482. package/dist/workers/quality-daemon/coverage-delta.d.ts +4 -3
  483. package/dist/workers/quality-daemon/coverage-delta.js +13 -6
  484. package/dist/workers/quality-daemon/index.js +6 -5
  485. package/dist/workers/quality-daemon/notification-service.js +3 -3
  486. package/dist/workers/quality-daemon/persistent-memory.d.ts +3 -3
  487. package/dist/workers/quality-daemon/persistent-memory.js +4 -4
  488. package/dist/workers/worker-manager.js +10 -3
  489. package/dist/workers/workers/coverage-tracker.js +69 -33
  490. package/dist/workers/workers/defect-predictor.d.ts +25 -8
  491. package/dist/workers/workers/defect-predictor.js +223 -216
  492. package/dist/workers/workers/performance-baseline.d.ts +24 -9
  493. package/dist/workers/workers/performance-baseline.js +187 -230
  494. package/dist/workers/workers/quality-gate.d.ts +11 -9
  495. package/dist/workers/workers/quality-gate.js +125 -267
  496. package/dist/workers/workers/regression-monitor.d.ts +18 -1
  497. package/dist/workers/workers/regression-monitor.js +276 -117
  498. package/dist/workers/workers/security-scan-records.d.ts +111 -0
  499. package/dist/workers/workers/security-scan-records.js +128 -0
  500. package/dist/workers/workers/security-scan.d.ts +25 -7
  501. package/dist/workers/workers/security-scan.js +187 -164
  502. package/package.json +2 -2
  503. package/dist/cli/chunks/adapter-EGIPTX5H.js +0 -2
  504. package/dist/cli/chunks/aqe-learning-engine-WP4GCBDT.js +0 -2
  505. package/dist/cli/chunks/base-6ORFD62I.js +0 -2
  506. package/dist/cli/chunks/browser-workflow-PIXGERWP.js +0 -2
  507. package/dist/cli/chunks/chunk-2WFTZSRT.js +0 -2
  508. package/dist/cli/chunks/chunk-7YB2KELI.js +0 -5
  509. package/dist/cli/chunks/chunk-BBL6YXD3.js +0 -2
  510. package/dist/cli/chunks/chunk-BJ5P4IV2.js +0 -2
  511. package/dist/cli/chunks/chunk-BO4PKNYP.js +0 -102
  512. package/dist/cli/chunks/chunk-DFPL5N3Q.js +0 -16
  513. package/dist/cli/chunks/chunk-DLY4YEN3.js +0 -2
  514. package/dist/cli/chunks/chunk-ERGWWI4Y.js +0 -3
  515. package/dist/cli/chunks/chunk-GTSOFCMQ.js +0 -2
  516. package/dist/cli/chunks/chunk-KZVJW2SD.js +0 -2
  517. package/dist/cli/chunks/chunk-L336HFFE.js +0 -2
  518. package/dist/cli/chunks/chunk-N2TJNIHA.js +0 -2
  519. package/dist/cli/chunks/chunk-RCXMUEZN.js +0 -3
  520. package/dist/cli/chunks/chunk-SEZLYRCS.js +0 -2
  521. package/dist/cli/chunks/chunk-TDLKXLJC.js +0 -4
  522. package/dist/cli/chunks/chunk-WOZIXXY5.js +0 -7
  523. package/dist/cli/chunks/ci-KP4GZKJ7.js +0 -81
  524. package/dist/cli/chunks/client-C3KHVRM6.js +0 -2
  525. package/dist/cli/chunks/core-handlers-KSQM6Q6S.js +0 -2
  526. package/dist/cli/chunks/coverage-SPFVHRRU.js +0 -43
  527. package/dist/cli/chunks/coverage-target-GSRBNHXE.js +0 -2
  528. package/dist/cli/chunks/cross-domain-router-CTGNOVCF.js +0 -2
  529. package/dist/cli/chunks/daemon-M5TD5Y6T.js +0 -10
  530. package/dist/cli/chunks/dream-MIK2E4UL.js +0 -2
  531. package/dist/cli/chunks/embed-and-insert-pattern-QST77T2B.js +0 -3
  532. package/dist/cli/chunks/experience-capture-middleware-X66IYSRV.js +0 -40
  533. package/dist/cli/chunks/file-discovery-3NHRUQQB.js +0 -2
  534. package/dist/cli/chunks/heartbeat-scheduler-OCKRACUW.js +0 -2
  535. package/dist/cli/chunks/hnsw-adapter-X67XG73C.js +0 -2
  536. package/dist/cli/chunks/hnsw-index-I7KCQBQR.js +0 -2
  537. package/dist/cli/chunks/hybrid-backend-FOUHTKAK.js +0 -2
  538. package/dist/cli/chunks/impact-analyzer-GXYVX46O.js +0 -2
  539. package/dist/cli/chunks/init-handler-2AXMXHYF.js +0 -86
  540. package/dist/cli/chunks/init-wizard-C2MRX2QG.js +0 -2
  541. package/dist/cli/chunks/kernel-Q2IUDIDC.js +0 -2
  542. package/dist/cli/chunks/knowledge-graph-E2Z6K5EE.js +0 -2
  543. package/dist/cli/chunks/learning-BEA26RNA.js +0 -122
  544. package/dist/cli/chunks/llm-router-service-YATYFEDD.js +0 -2
  545. package/dist/cli/chunks/load-test-LV77JXWA.js +0 -2
  546. package/dist/cli/chunks/memory-backend-XME3X3QX.js +0 -2
  547. package/dist/cli/chunks/memory-handlers-VG47X5DX.js +0 -2
  548. package/dist/cli/chunks/orchestrator-VHUXUYIM.js +0 -452
  549. package/dist/cli/chunks/pattern-null-store-TAXMLENP.js +0 -2
  550. package/dist/cli/chunks/plugin-2VAYWAO3.js +0 -27
  551. package/dist/cli/chunks/project-root-CFFPBGPX.js +0 -2
  552. package/dist/cli/chunks/protocol-executor-ML76QAVQ.js +0 -2
  553. package/dist/cli/chunks/qe-reasoning-bank-LUZH6RYV.js +0 -2
  554. package/dist/cli/chunks/queen-coordinator-EWXNIXB6.js +0 -2
  555. package/dist/cli/chunks/real-embeddings-GZV4VKK4.js +0 -2
  556. package/dist/cli/chunks/router-MXOBVEBF.js +0 -2
  557. package/dist/cli/chunks/routing-feedback-T6CCRUEK.js +0 -2
  558. package/dist/cli/chunks/rvf-dual-writer-WHXVT3V3.js +0 -2
  559. package/dist/cli/chunks/rvf-migration-adapter-JFPWIRCG.js +0 -2
  560. package/dist/cli/chunks/rvf-migration-coordinator-D4KUBNRZ.js +0 -2
  561. package/dist/cli/chunks/rvf-native-adapter-KOXR7TJL.js +0 -2
  562. package/dist/cli/chunks/safe-db-CI6IPSIN.js +0 -2
  563. package/dist/cli/chunks/schedule-X4HW6TVJ.js +0 -2
  564. package/dist/cli/chunks/scheduler-KCNJ2ON3.js +0 -2
  565. package/dist/cli/chunks/security-7723AZZ4.js +0 -13
  566. package/dist/cli/chunks/shared-rvf-adapter-KEQ5CLNI.js +0 -2
  567. package/dist/cli/chunks/sqlite-persistence-PGHU6VUR.js +0 -2
  568. package/dist/cli/chunks/sync-EFWXMA2H.js +0 -2
  569. package/dist/cli/chunks/token-bootstrap-S346YBVO.js +0 -2
  570. package/dist/cli/chunks/unified-memory-6CK3TUNQ.js +0 -2
  571. package/dist/cli/chunks/unified-memory-hnsw-A7BWBGYN.js +0 -2
  572. package/dist/cli/chunks/unified-persistence-GEPMDBQZ.js +0 -2
  573. package/dist/cli/chunks/visual-security-L4J7LQWT.js +0 -2
  574. package/dist/cli/chunks/witness-chain-CDUMX623.js +0 -2
  575. package/dist/cli/chunks/witness-chain-repair-WNYH6O4L.js +0 -2
  576. package/dist/cli/chunks/witness-key-manager-NQ5DAAC4.js +0 -2
  577. package/dist/cli/chunks/workflow-orchestrator-USJDWVDR.js +0 -2
  578. package/dist/cli/chunks/wrappers-CZDI6Z3X.js +0 -2
  579. /package/.claude/skills/qe-court/evals/fixtures/seeded-mutant-delivery/{budget.test.ts → budget-tests.ts.fixture} +0 -0
  580. /package/.claude/skills/qe-court/evals/fixtures/seeded-mutant-delivery/{budget.ts → budget.ts.fixture} +0 -0
  581. /package/.claude/skills/testability-scoring/resources/templates/{testability-scoring.spec.template.js → testability-scoring-spec.template.js} +0 -0
  582. /package/assets/skills/qe-court/evals/fixtures/seeded-mutant-delivery/{budget.test.ts → budget-tests.ts.fixture} +0 -0
  583. /package/assets/skills/qe-court/evals/fixtures/seeded-mutant-delivery/{budget.ts → budget.ts.fixture} +0 -0
  584. /package/assets/skills/testability-scoring/resources/templates/{testability-scoring.spec.template.js → testability-scoring-spec.template.js} +0 -0
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-6LG5UEQE.js";import"./chunk-3OAQPN2N.js";import"./chunk-L375O3CZ.js";import"./chunk-EOR3RECZ.js";import"./chunk-RUJLVJDE.js";import"./chunk-RUSLEOMC.js";import"./chunk-KHCALIFP.js";import"./chunk-2XYTS2WY.js";import"./chunk-3YASZPLO.js";import"./chunk-MQGEZA2A.js";import"./chunk-OU4ZAWCC.js";import"./chunk-OQDC7GCM.js";import"./chunk-RMJ7PJOS.js";import"./chunk-Y2E3IJ53.js";import"./chunk-AQN5EDBM.js";import"./chunk-OGYWWZU7.js";import"./chunk-L336HFFE.js";import"./chunk-E4VIVMDL.js";import"./chunk-WLIYWBQR.js";import"./chunk-NLDFNAOS.js";import"./chunk-VRJPH3LG.js";import"./chunk-KZVJW2SD.js";import"./chunk-IHFUEPZH.js";import"./chunk-U6OVPMQX.js";import"./chunk-HLFDC4SF.js";export{l as MCPToolBase,k as defaultToolLogger,j as getKernel,i as getLLMRouter,e as getMemoryBackend,g as getSharedLLMRouter,c as getSharedMemoryBackend,a as isMemoryOnlyMode,b as registerRvfResetFn,h as resetSharedLLMRouter,d as resetSharedMemoryBackend,f as setSharedLLMRouter};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{a}from"./chunk-HPLMX62I.js";import"./chunk-6LG5UEQE.js";import"./chunk-3OAQPN2N.js";import"./chunk-L375O3CZ.js";import"./chunk-EOR3RECZ.js";import"./chunk-RUJLVJDE.js";import"./chunk-RUSLEOMC.js";import"./chunk-KHCALIFP.js";import"./chunk-2XYTS2WY.js";import"./chunk-3YASZPLO.js";import"./chunk-MQGEZA2A.js";import"./chunk-OU4ZAWCC.js";import"./chunk-OQDC7GCM.js";import"./chunk-RMJ7PJOS.js";import"./chunk-Y2E3IJ53.js";import"./chunk-AQN5EDBM.js";import"./chunk-OGYWWZU7.js";import"./chunk-L336HFFE.js";import"./chunk-E4VIVMDL.js";import"./chunk-WLIYWBQR.js";import"./chunk-NLDFNAOS.js";import"./chunk-VRJPH3LG.js";import"./chunk-KZVJW2SD.js";import"./chunk-IHFUEPZH.js";import"./chunk-U6OVPMQX.js";import"./chunk-HLFDC4SF.js";export{a as BrowserWorkflowTool};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{existsSync as d,readFileSync as g,readdirSync as _,statSync as w}from"fs";import{join as o,extname as T}from"path";var E=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".pyw",".go",".rs",".java",".kt",".kts",".rb",".cs",".php",".swift",".c",".h",".cpp",".hpp",".cc",".scala"]),v=[".test.",".spec.","_test.","_spec."],F=new Set(["node_modules","dist","build","coverage",".git","__pycache__",".venv","venv",".tox",".mypy_cache","target",".gradle","vendor",".bundle",".next",".nuxt",".output"]);function O(s,n={}){let{maxDepth:r=6,includeTests:m=!1,testsOnly:x=!1,extraExtensions:y=[]}=n;if(!d(s))return[];let c=w(s);if(c.isFile())return[s];if(!c.isDirectory())return[];let S=new Set(y.map(e=>e.startsWith(".")?e:`.${e}`)),i=[];function a(e,u){if(u>r)return;let l;try{l=_(e,{withFileTypes:!0})}catch{return}for(let t of l)if(t.isDirectory()){if(F.has(t.name))continue;a(o(e,t.name),u+1)}else if(t.isFile()){let p=T(t.name).toLowerCase();if(!(E.has(p)||S.has(p))||t.name.endsWith(".d.ts"))continue;let f=v.some(h=>t.name.includes(h))||t.name.startsWith("test_");x?f&&i.push(o(e,t.name)):(m||!f)&&i.push(o(e,t.name))}}return a(s,0),i}function D(s,n){return n!=="node"&&n!=="node-test"?s:s.filter(r=>{try{return!/@playwright\/test|require\(\s*['"]playwright['"]\s*\)/.test(g(r,"utf8"))}catch{return!0}})}export{E as a,O as b,D as c};
@@ -1,5 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{a as R}from"./chunk-CXOXUBYU.js";var P="quality-daemon",x=class{constructor(e){this.backend=e}backend;async get(e){return this.backend.kvGet(e,P)}async set(e,t){await this.backend.kvSet(e,t,P)}async search(e){return this.backend.kvSearch(e,P)}};import{cpus as ee,freemem as te,totalmem as ie,loadavg as oe}from"os";var p=class{queues={now:[],next:[],later:[]};_maxSize;constructor(e=1e3){this._maxSize=e}enqueue(e){return this.size>=this._maxSize&&(this.pruneExpired(),this.size>=this._maxSize)?!1:(this.queues[e.priority].push(e),!0)}dequeue(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(;i.length>0;){let o=i.shift();if(!(o.ttlMs&&e-o.createdAt>o.ttlMs))return o}}}peek(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(let o of i)if(!o.ttlMs||e-o.createdAt<=o.ttlMs)return o}}drainPriority(e){let t=this.queues[e].splice(0),i=Date.now();return t.filter(o=>!o.ttlMs||i-o.createdAt<=o.ttlMs)}pruneExpired(){let e=0,t=Date.now();for(let i of["now","next","later"]){let o=this.queues[i].length;this.queues[i]=this.queues[i].filter(r=>!r.ttlMs||t-r.createdAt<=r.ttlMs),e+=o-this.queues[i].length}return e}get size(){return this.queues.now.length+this.queues.next.length+this.queues.later.length}get depths(){return{now:this.queues.now.length,next:this.queues.next.length,later:this.queues.later.length}}get isEmpty(){return this.size===0}clear(){this.queues.now=[],this.queues.next=[],this.queues.later=[]}};import{watch as Q}from"fs";import{execFile as $}from"child_process";import{promisify as H}from"util";import{resolve as q,join as z}from"path";import{existsSync as E,readFileSync as L}from"fs";var _=H($),U={repoRoot:process.cwd(),debounceMs:500,maxChangedFiles:200,pollIntervalMs:5e3},g=class{constructor(e,t){this.queue=e;this.options={...U,...t}}queue;watcher;pollTimer;options;lastKnownHeads=new Map;debounceTimer;_running=!1;_polling=!1;get running(){return this._running}async start(){if(this._running)return;let e=q(this.options.repoRoot,".git","refs","heads");if(!E(e))throw new Error(`Git refs directory not found: ${e}`);await this.snapshotHeads(),process.platform==="darwin"||process.platform==="win32"?this.watcher=Q(e,{recursive:!0},(i,o)=>{o&&this.handleRefChange(o)}):(this.pollTimer=setInterval(()=>{this.poll().catch(i=>{console.debug("[GitWatcher] Poll error:",i)})},this.options.pollIntervalMs),this.pollTimer.unref?.()),this._running=!0}stop(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=void 0),this.watcher&&(this.watcher.close(),this.watcher=void 0),this._running=!1}async poll(){if(this._polling)return[];this._polling=!0;let e=[];try{let{stdout:t}=await _("git",["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot});for(let i of t.trim().split(`
3
- `)){if(!i)continue;let[o,r]=i.split(" "),n=this.lastKnownHeads.get(o);n&&n!==r&&(e.push(o),await this.enqueueCommitAnalysis(o,r)),this.lastKnownHeads.set(o,r)}}catch{}finally{this._polling=!1}return e}handleRefChange(e){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.processRefChange(e).catch(t=>{console.debug("[GitWatcher] Error processing ref change:",t)})},this.options.debounceMs)}async processRefChange(e){let t=e.replace(/\\/g,"/"),i=q(this.options.repoRoot,".git","refs","heads"),o=z(i,e),r;try{r=L(o,"utf-8").trim()}catch{return}this.lastKnownHeads.get(t)!==r&&(this.lastKnownHeads.set(t,r),await this.enqueueCommitAnalysis(t,r))}async enqueueCommitAnalysis(e,t){if(R(t,"commit hash"))return;let i=[];try{let{stdout:n}=await _("git",["diff-tree","--no-commit-id","--name-only","-r",t],{cwd:this.options.repoRoot});i=n.trim().split(`
4
- `).filter(Boolean).slice(0,this.options.maxChangedFiles)}catch{}let o={type:"git_commit",branch:e,commitHash:t,changedFiles:i},r={id:`git-${t}-${Date.now()}`,priority:"next",payload:o,createdAt:Date.now(),source:"git-watcher",ttlMs:300*1e3};this.queue.enqueue(r)}async snapshotHeads(){try{let{stdout:e}=await _("git",["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot});for(let t of e.trim().split(`
5
- `)){if(!t)continue;let[i,o]=t.split(" ");this.lastKnownHeads.set(i,o)}}catch{}}};var j={regressionThreshold:2,gapThreshold:60,memoryPrefix:"quality-daemon:coverage"},f=class{constructor(e,t){this.queue=e;this.options={...j,...t}}queue;options;async analyze(e,t,i){let o=await t.get(`${this.options.memoryPrefix}:snapshot`);if(await t.set(`${this.options.memoryPrefix}:snapshot`,e),!o)return{regressionDetected:!1,overallDelta:{line:0,branch:0,function:0,statement:0},affectedFiles:[],newGaps:[]};let r=o,n={line:e.overall.line-r.overall.line,branch:e.overall.branch-r.overall.branch,function:e.overall.function-r.overall.function,statement:e.overall.statement-r.overall.statement},s=n.line<-this.options.regressionThreshold||n.branch<-this.options.regressionThreshold,a=i??Object.keys(e.files),u=[],c=[];for(let d of a){let l=e.files[d],m=r.files[d];if(!l)continue;let M=m?l.line-m.line:0,I=m?l.branch-m.branch:0,D=m?l.uncoveredLines.filter(T=>!m.uncoveredLines.includes(T)):l.uncoveredLines;if((M!==0||I!==0||D.length>0)&&u.push({file:d,lineDelta:M,branchDelta:I,newUncoveredLines:D}),l.line<this.options.gapThreshold){let T=this.computeRiskScore(l,D.length);c.push({file:d,uncoveredLines:l.uncoveredLines,currentCoverage:l.line,riskScore:T})}}return(s||c.length>0)&&this.enqueueTestSuggestion(e,r,c),await t.set(`${this.options.memoryPrefix}:delta`,{timestamp:Date.now(),overallDelta:n,regressionDetected:s,affectedFileCount:u.length,gapCount:c.length}),{regressionDetected:s,overallDelta:n,affectedFiles:u,newGaps:c}}async buildSnapshot(e){let t=await e.get("coverage:latest");if(t)return{timestamp:Date.now(),overall:{line:t.line,branch:t.branch,function:t.function,statement:t.statement},files:t.files??{}}}computeRiskScore(e,t){let o=1-Math.min(100,Math.max(0,e.line))/100,r=Math.min(t/50,1);return Math.min(1,o*.6+r*.4)}enqueueTestSuggestion(e,t,i){let o={type:"coverage_delta",previousSnapshot:`snapshot-${t.timestamp}`,currentSnapshot:`snapshot-${e.timestamp}`},r={id:`coverage-delta-${Date.now()}`,priority:i.some(n=>n.riskScore>.8)?"now":"next",payload:o,createdAt:Date.now(),source:"coverage-delta",ttlMs:600*1e3};this.queue.enqueue(r)}};import{execFile as B}from"child_process";import{promisify as J}from"util";var K=J(B),V={runsPerWorkflow:10,flakyThreshold:3,repo:""},y=class{constructor(e,t){this.queue=e;this.options={...V,...t}}queue;options;async check(){let e=await this.fetchRecentRuns(),t=this.groupByWorkflow(e),i=[],o=[],r=0;for(let[s,a]of Object.entries(t)){let u=a.filter(m=>m.conclusion==="failure").length,c=a.length>0?(a.length-u)/a.length*100:100,d=this.countConsecutiveFailures(a),l=a[0]?.conclusion??"unknown";l==="failure"&&r++,d>=this.options.flakyThreshold&&(o.push(s),this.enqueueFailureAlert(s,a[0])),i.push({name:s,recentRuns:a.length,failedRuns:u,successRate:Math.round(c*10)/10,lastConclusion:l,consecutiveFailures:d})}let n=this.calculateHealthScore(i);return{timestamp:Date.now(),workflows:i,failingWorkflows:r,flakyWorkflows:o,healthScore:n}}async fetchRecentRuns(){try{let e=["run","list","--limit",String(this.options.runsPerWorkflow*5),"--json","name,status,conclusion,headBranch,number,databaseId,createdAt"];this.options.repo&&e.push("--repo",this.options.repo);let{stdout:t}=await K("gh",e,{timeout:15e3});return JSON.parse(t).map(o=>({name:o.name,status:o.status,conclusion:o.conclusion??"pending",headBranch:o.headBranch,runNumber:o.number,databaseId:o.databaseId,createdAt:o.createdAt}))}catch{return[]}}groupByWorkflow(e){let t={};for(let i of e)t[i.name]||(t[i.name]=[]),t[i.name].push(i);for(let i of Object.keys(t))t[i]=t[i].slice(0,this.options.runsPerWorkflow);return t}countConsecutiveFailures(e){let t=0;for(let i of e)if(i.conclusion==="failure")t++;else break;return t}calculateHealthScore(e){if(e.length===0)return 100;let t=e.reduce((i,o)=>i+o.successRate,0)/e.length;return Math.round(t)}enqueueFailureAlert(e,t){let i={type:"ci_failure",workflowName:e,runId:t.databaseId,conclusion:t.conclusion},o={id:`ci-failure-${e}-${Date.now()}`,priority:"now",payload:i,createdAt:Date.now(),source:"ci-monitor",ttlMs:1800*1e3};this.queue.enqueue(o)}};var Y={memoryPrefix:"quality-daemon:suggestions",maxSuggestions:100,minRiskScore:.3},v=class{options;constructor(e){this.options={...Y,...e}}async suggest(e,t,i){let o=[],r=e.filter(s=>s.riskScore>=this.options.minRiskScore);for(let s of r){let a=t.includes(s.file),u=this.determinePriority(s,a),c=this.determineTestType(s.file),d=this.estimateEffort(s);o.push({id:`suggestion-${Date.now()}-${o.length}`,file:s.file,uncoveredLines:s.uncoveredLines.slice(0,50),suggestedTestType:c,description:this.generateDescription(s,c),priority:u,estimatedEffort:d,createdAt:Date.now(),status:"pending"})}o.sort((s,a)=>{let u={high:0,medium:1,low:2};return u[s.priority]-u[a.priority]});let n=o.slice(0,this.options.maxSuggestions);return await this.storeSuggestions(n,i),n}async getPending(e){return(await e.get(`${this.options.memoryPrefix}:list`)??[]).filter(i=>i.status==="pending")}async updateStatus(e,t,i){let o=await i.get(`${this.options.memoryPrefix}:list`);if(!o)return!1;let r=o.findIndex(s=>s.id===e);if(r===-1)return!1;let n=o.map((s,a)=>a===r?{...s,status:t}:s);return await i.set(`${this.options.memoryPrefix}:list`,n),!0}determinePriority(e,t){return e.riskScore>.8?"high":t||e.riskScore>.5?"medium":"low"}determineTestType(e){return e.includes("/api/")||e.includes("/routes/")||e.includes("/handlers/")?"integration":e.includes("/e2e/")||e.includes("/pages/")||e.includes("/views/")?"e2e":"unit"}estimateEffort(e){return e.uncoveredLines.length<=10?"small":e.uncoveredLines.length<=50?"medium":"large"}generateDescription(e,t){let i=e.uncoveredLines.length,o=Math.round(e.currentCoverage);return`Add ${t} tests for ${e.file} (${i} uncovered lines, ${o}% coverage, risk ${(e.riskScore*100).toFixed(0)}%)`}async storeSuggestions(e,t){let r=[...(await t.get(`${this.options.memoryPrefix}:list`)??[]).filter(n=>n.status!=="pending"),...e].slice(-this.options.maxSuggestions);await t.set(`${this.options.memoryPrefix}:list`,r),await t.set(`${this.options.memoryPrefix}:count`,{pending:e.length,total:r.length,lastUpdated:Date.now()})}};var X={memoryPrefix:"quality-daemon:nightly",maxEntryAge:6048e5,nightlyHour:2},w=class{constructor(e,t){this.queue=e;this.options={...X,...t}}queue;options;lastRunDate;shouldRun(){let e=new Date,t=e.toISOString().split("T")[0];return this.lastRunDate===t?!1:e.getHours()>=this.options.nightlyHour}scheduleIfDue(){if(!this.shouldRun())return!1;let e={type:"nightly",tasks:["consolidate_patterns","prune_expired","generate_report"]},t={id:`nightly-${Date.now()}`,priority:"later",payload:e,createdAt:Date.now(),source:"nightly-consolidation",ttlMs:720*60*1e3};return this.queue.enqueue(t)}async execute(e,t){let i=Date.now(),o=new Date().toISOString().split("T")[0],r=await this.consolidatePatterns(e),n=await this.pruneExpired(e),s=this.generateReport(o,t);await e.set(`${this.options.memoryPrefix}:report:${o}`,s),this.lastRunDate=o;let a={timestamp:Date.now(),patternsConsolidated:r,entriesPruned:n,reportGenerated:!0,durationMs:Date.now()-i};return await e.set(`${this.options.memoryPrefix}:last-result`,a),a}async getLastResult(e){return e.get(`${this.options.memoryPrefix}:last-result`)}async consolidatePatterns(e){let t=await e.search("quality-daemon:*"),i=0;return await e.get("quality-daemon:suggestions:count")&&i++,await e.get("quality-daemon:coverage:delta")&&i++,i}async pruneExpired(e){let t=await e.search("quality-daemon:*"),i=0,o=Date.now();for(let r of t){if(r.endsWith(":snapshot")||r.endsWith(":list"))continue;let n=await e.get(r);n&&typeof n.timestamp=="number"&&o-n.timestamp>this.options.maxEntryAge&&(await e.set(r,{pruned:!0,prunedAt:o}),i++)}return i}generateReport(e,t){return{date:e,coverageHealth:t.coverageHealth??0,ciHealth:t.ciHealth??0,commitsAnalyzed:t.commitsAnalyzed??0,suggestionsGenerated:t.suggestionsGenerated??0,notificationsSent:t.notificationsSent??0,queueDepthAvg:t.queueDepthAvg??0,daemonUptime:t.uptimeSeconds??0}}};import{writeFileSync as W,mkdirSync as A,readdirSync as S,readFileSync as N,unlinkSync as F}from"fs";import{join as b,resolve as Z}from"path";var O={notificationsDir:Z(process.cwd(),".agentic-qe","notifications"),maxNotifications:200},k=class{notificationsDir;maxNotifications;webhookUrl;urlValidator;_sentCount=0;constructor(e){this.notificationsDir=e?.notificationsDir??O.notificationsDir,this.maxNotifications=e?.maxNotifications??O.maxNotifications,this.webhookUrl=e?.webhookUrl,this.urlValidator=e?.urlValidator}get sentCount(){return this._sentCount}initialize(){A(this.notificationsDir,{recursive:!0})}async send(e){let t={...e,id:`notif-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,timestamp:Date.now(),read:!1};return this.writeToFile(t),this.webhookUrl&&await this.sendWebhook(t),this._sentCount++,this.pruneOldNotifications(),t}list(e){let t=e?.limit??50;try{let i=S(this.notificationsDir).filter(r=>r.endsWith(".json")).sort().reverse(),o=[];for(let r of i){if(o.length>=t)break;try{let n=N(b(this.notificationsDir,r),"utf-8"),s=JSON.parse(n);if(e?.unreadOnly&&s.read||e?.type&&s.type!==e.type)continue;o.push(s)}catch{}}return o}catch{return[]}}markRead(e){try{let t=S(this.notificationsDir).filter(n=>n.endsWith(`-${e}.json`));if(t.length===0)return!1;let i=b(this.notificationsDir,t[0]),r={...JSON.parse(N(i,"utf-8")),read:!0};return W(i,JSON.stringify(r,null,2)),!0}catch{return!1}}clear(){try{let e=S(this.notificationsDir).filter(t=>t.endsWith(".json"));for(let t of e)F(b(this.notificationsDir,t));return e.length}catch{return 0}}writeToFile(e){try{A(this.notificationsDir,{recursive:!0});let t=`${e.timestamp}-${e.id}.json`,i=b(this.notificationsDir,t);W(i,JSON.stringify(e,null,2))}catch(t){console.debug("[NotificationService] Failed to write notification:",t)}}async sendWebhook(e){if(this.webhookUrl){if(this.urlValidator&&!this.urlValidator(this.webhookUrl)){console.warn("[NotificationService] Webhook URL blocked by SSRF guard:",this.webhookUrl);return}try{let t=await fetch(this.webhookUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(5e3)});t.ok||console.debug(`[NotificationService] Webhook returned ${t.status}`)}catch(t){console.debug("[NotificationService] Webhook delivery failed:",t)}}}pruneOldNotifications(){try{let e=S(this.notificationsDir).filter(i=>i.endsWith(".json")).sort();if(e.length<=this.maxNotifications)return;let t=e.slice(0,e.length-this.maxNotifications);for(let i of t)F(b(this.notificationsDir,i))}catch{}}};var C={tickIntervalMs:3e4,ciPollIntervalMs:5*6e4,coverageCheckIntervalMs:2*6e4,cpuThreshold:.7,memoryThreshold:.8},G=class{queue;gitWatcher;coverageDelta;ciMonitor;testSuggester;nightlyConsolidation;notificationService;tickTimer;_running=!1;_startedAt=0;_tickCount=0;_lastTickAt;_throttled=!1;_commitsAnalyzed=0;_suggestionsGenerated=0;_ciHealth=100;_coverageHealth=100;_lastCICheck;_lastCoverageCheck;_memory;config;constructor(e){this.config={tickIntervalMs:e?.tickIntervalMs??C.tickIntervalMs,ciPollIntervalMs:e?.ciPollIntervalMs??C.ciPollIntervalMs,coverageCheckIntervalMs:e?.coverageCheckIntervalMs??C.coverageCheckIntervalMs,cpuThreshold:e?.cpuThreshold??C.cpuThreshold,memoryThreshold:e?.memoryThreshold??C.memoryThreshold},this.queue=new p,this.gitWatcher=new g(this.queue,e?.git),this.coverageDelta=new f(this.queue,e?.coverage),this.ciMonitor=new y(this.queue,e?.ci),this.testSuggester=new v(e?.suggestions),this.nightlyConsolidation=new w(this.queue,e?.nightly),this.notificationService=new k(e?.notifications)}get running(){return this._running}async start(e){this._running||(this._memory=e,this._running=!0,this._startedAt=Date.now(),this.notificationService.initialize(),await this.gitWatcher.start().catch(t=>{console.debug("[QualityDaemon] Git watcher failed to start:",t)}),this.scheduleTick())}async stop(){this._running&&(this._running=!1,this.tickTimer&&(clearTimeout(this.tickTimer),this.tickTimer=void 0),this.gitWatcher.stop(),this._memory&&await this._memory.set("quality-daemon:state",{stoppedAt:Date.now(),tickCount:this._tickCount,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated}))}getStatus(){return{running:this._running,uptimeSeconds:this._running?Math.floor((Date.now()-this._startedAt)/1e3):0,tickCount:this._tickCount,queueDepth:this.queue.depths,lastTickAt:this._lastTickAt,throttled:this._throttled,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,ciHealth:this._ciHealth,coverageHealth:this._coverageHealth,lastCICheck:this._lastCICheck,lastCoverageCheck:this._lastCoverageCheck}}scheduleTick(){this._running&&(this.tickTimer=setTimeout(()=>this.tick(),this.config.tickIntervalMs),this.tickTimer.unref?.())}async tick(){if(!(!this._running||!this._memory)){if(this._tickCount++,this._lastTickAt=Date.now(),this._throttled=this.isResourceConstrained(),this._throttled){await this.processNowItems(this._memory),this.scheduleTick();return}await this.processQueue(this._memory),await this.runPeriodicChecks(this._memory),this.nightlyConsolidation.scheduleIfDue(),this.queue.pruneExpired(),this.scheduleTick()}}async processQueue(e){let t=0,i=10;for(;t<i&&!this.queue.isEmpty;){let o=this.queue.dequeue();if(!o)break;await this.handleQueueItem(o,e),t++}}async processNowItems(e){let t=this.queue.drainPriority("now");for(let i of t)await this.handleQueueItem(i,e)}async handleQueueItem(e,t){let i=e.payload;switch(i.type){case"git_commit":{this._commitsAnalyzed++;let o=await this.coverageDelta.buildSnapshot(t);if(o){let r=await this.coverageDelta.analyze(o,t,i.changedFiles);if(r.regressionDetected&&await this.notificationService.send({type:"coverage_drop",title:"Coverage Regression Detected",message:`Line coverage delta: ${r.overallDelta.line.toFixed(1)}% (${r.affectedFiles.length} files affected)`,severity:"high",metadata:{delta:r.overallDelta,commit:i.commitHash}}),r.newGaps.length>0){let n=await this.testSuggester.suggest(r.newGaps,i.changedFiles,t);this._suggestionsGenerated+=n.length,n.length>0&&await this.notificationService.send({type:"suggestion_available",title:"New Test Suggestions Available",message:`${n.length} test suggestions generated for uncovered code`,severity:"info",metadata:{count:n.length}})}}break}case"coverage_delta":{let o=await this.testSuggester.getPending(t);o.length>0&&await this.notificationService.send({type:"suggestion_available",title:"Test Suggestions Pending",message:`${o.length} test suggestions awaiting review`,severity:"info",metadata:{count:o.length}});break}case"gate_failure":await this.notificationService.send({type:"gate_failure",title:`Quality Gate Failed: ${i.gateName}`,message:`Score ${i.score} below threshold ${i.threshold}`,severity:"critical",metadata:{gate:i.gateName,score:i.score,threshold:i.threshold}});break;case"ci_failure":await this.notificationService.send({type:"ci_failure",title:`CI Failure: ${i.workflowName}`,message:`Workflow ${i.workflowName} run #${i.runId} concluded: ${i.conclusion}`,severity:"high",metadata:{workflow:i.workflowName,runId:i.runId}});break;case"nightly":{let o={coverageHealth:this._coverageHealth,ciHealth:this._ciHealth,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,queueDepthAvg:this.queue.size,uptimeSeconds:Math.floor((Date.now()-this._startedAt)/1e3)};await this.nightlyConsolidation.execute(t,o);break}default:console.warn("[QualityDaemon] Unhandled payload type:",i.type)}}async runPeriodicChecks(e){let t=Date.now();if(!this._lastCICheck||t-this._lastCICheck>=this.config.ciPollIntervalMs)try{let i=await this.ciMonitor.check();this._ciHealth=i.healthScore,this._lastCICheck=t,i.flakyWorkflows.length>0&&await this.notificationService.send({type:"flaky_detected",title:"Flaky Workflows Detected",message:`${i.flakyWorkflows.length} workflows showing repeated failures: ${i.flakyWorkflows.join(", ")}`,severity:"medium",metadata:{workflows:i.flakyWorkflows}})}catch{}if(!this._lastCoverageCheck||t-this._lastCoverageCheck>=this.config.coverageCheckIntervalMs)try{let i=await this.coverageDelta.buildSnapshot(e);i&&(this._coverageHealth=Math.round((i.overall.line+i.overall.branch+i.overall.function+i.overall.statement)/4),this._lastCoverageCheck=t)}catch{}}isResourceConstrained(){if(1-te()/ie()>this.config.memoryThreshold)return!0;let t=ee().length;return(t>0?oe()[0]/t:0)>this.config.cpuThreshold}};export{x as a,G as b};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{g}from"./chunk-QXY3IRBW.js";import{i as h}from"./chunk-AQN5EDBM.js";import{c as p,d}from"./chunk-3AYYGR6W.js";import{b as m,e as f}from"./chunk-NLDFNAOS.js";f();var I={maxDepth:5,riskWeights:{directImpact:.4,transitiveImpact:.2,testCoverage:.2,criticalPath:.15,dependencyCount:.05},testPatterns:["**/*.test.ts","**/*.test.tsx","**/*.spec.ts","**/*.spec.tsx","**/test_*.py","**/*_test.py","**/*_test.go"],criticalPaths:["**/auth/**","**/security/**","**/payment/**","**/api/**","**/core/**"],namespace:"code-intelligence:impact"},u=class{constructor(e,t,i={}){this.memory=e;this.config={...I,...i},this.knowledgeGraph=t||new g(e)}memory;config;knowledgeGraph;async analyzeImpact(e){try{let{changedFiles:t,depth:i=this.config.maxDepth,includeTests:r=!0}=e;if(t.length===0)return p({directImpact:[],transitiveImpact:[],impactedTests:[],riskLevel:"info",recommendations:[]});let n=await this.analyzeDirectImpact(t),l=await this.analyzeTransitiveImpact(t,n,i),s=[];if(r){let a=await this.getImpactedTests(t);a.success&&(s=a.value)}let c={directImpact:n,transitiveImpact:l,impactedTests:s,riskLevel:"info",recommendations:[]};return c.riskLevel=this.calculateRiskLevel(c),c.recommendations=this.getRecommendations(c),await this.storeAnalysis(t,c),p(c)}catch(t){return d(m(t))}}async getImpactedTests(e){try{let t=new Set;for(let i of e){if(this.isTestFile(i)){t.add(i);continue}let r=await this.knowledgeGraph.mapDependencies({files:[i],direction:"incoming",depth:3});if(r.success)for(let s of r.value.nodes)this.isTestFile(s.path)&&t.add(s.path);let n=this.getBaseName(i),l=[`${n}.test`,`${n}.spec`,`test_${n}`,`${n}_test`];for(let s of l){let c=await this.memory.search(`code-intelligence:kg:node:*${s}*`,10,{namespace:"code-intelligence:kg"});for(let a of c){let o=await this.memory.get(a,{namespace:"code-intelligence:kg"});o?.properties?.path&&this.isTestFile(o.properties.path)&&t.add(o.properties.path)}}}return p(Array.from(t))}catch(t){return d(m(t))}}calculateRiskLevel(e){let t=this.config.riskWeights,i=0,r=Math.min(1,e.directImpact.length/10);i+=r*t.directImpact;let n=Math.min(1,e.transitiveImpact.length/20);i+=n*t.transitiveImpact;let l=e.impactedTests.length>0?Math.max(0,1-e.impactedTests.length/(e.directImpact.length||1)):1;i+=l*t.testCoverage;let s=this.countCriticalFiles([...e.directImpact.map(o=>o.file),...e.transitiveImpact.map(o=>o.file)]),c=Math.min(1,s/5);i+=c*t.criticalPath;let a=this.calculateAverageRiskScore([...e.directImpact,...e.transitiveImpact]);return i+=a*t.dependencyCount,i>=.8?"critical":i>=.6?"high":i>=.4?"medium":i>=.2?"low":"info"}getRecommendations(e){let t=[];(e.riskLevel==="critical"||e.riskLevel==="high")&&t.push("This change has significant impact - consider peer review before merging"),e.impactedTests.length===0&&e.directImpact.length>0?t.push("No tests found for impacted files - add test coverage"):e.impactedTests.length<e.directImpact.length/2&&t.push("Test coverage appears low for impacted files"),e.impactedTests.length>0&&(e.impactedTests.length<=10?t.push(`Run these ${e.impactedTests.length} tests: ${e.impactedTests.slice(0,3).join(", ")}${e.impactedTests.length>3?"...":""}`):t.push(`Run all ${e.impactedTests.length} impacted tests before deployment`));let i=[...e.directImpact,...e.transitiveImpact].filter(n=>this.isCriticalPath(n.file));i.length>0&&t.push(`${i.length} critical path files affected - extra scrutiny recommended`),e.transitiveImpact.length>10&&t.push("Large transitive impact - consider breaking down into smaller changes");let r=[...e.directImpact,...e.transitiveImpact].filter(n=>n.riskScore>=.7);return r.length>0&&t.push(`${r.length} high-risk files impacted: ${r.slice(0,2).map(n=>this.getFileName(n.file)).join(", ")}`),t}async analyzeDirectImpact(e){let t=[];for(let i of e){let r=await this.knowledgeGraph.mapDependencies({files:[i],direction:"incoming",depth:1});if(r.success){let{nodes:n,edges:l}=r.value;for(let s of n){if(s.path===i)continue;let c=l.find(o=>o.target===s.id||o.source===s.id),a=this.calculateFileRiskScore(s.path,s.inDegree,s.outDegree);t.push({file:s.path,reason:`Directly ${c?.type||"depends on"} ${this.getFileName(i)}`,distance:1,riskScore:a})}}}return this.deduplicateImpact(t)}async analyzeTransitiveImpact(e,t,i){let r=[],n=new Set([...e,...t.map(s=>s.file)]),l=t.map(s=>({file:s.file,distance:1}));for(;l.length>0;){let s=l.shift();if(s.distance>=i)continue;let c=await this.knowledgeGraph.mapDependencies({files:[s.file],direction:"incoming",depth:1});if(c.success)for(let a of c.value.nodes){if(n.has(a.path)||a.path===s.file)continue;n.add(a.path);let o=this.calculateFileRiskScore(a.path,a.inDegree,a.outDegree,s.distance+1);r.push({file:a.path,reason:`Transitively depends via ${this.getFileName(s.file)}`,distance:s.distance+1,riskScore:o}),l.push({file:a.path,distance:s.distance+1})}}return this.deduplicateImpact(r)}calculateFileRiskScore(e,t,i,r=1){let n=0;return n+=Math.min(.3,t/20),n+=Math.min(.2,i/30),this.isCriticalPath(e)&&(n+=.3),this.isEntryPoint(e)&&(n+=.2),n=n*Math.pow(.8,r-1),Math.min(1,Math.max(0,n))}calculateAverageRiskScore(e){return e.length===0?0:e.reduce((i,r)=>i+r.riskScore,0)/e.length}countCriticalFiles(e){return e.filter(t=>this.isCriticalPath(t)).length}isTestFile(e){return[/\.test\.[tj]sx?$/,/\.spec\.[tj]sx?$/,/_test\.[tj]sx?$/,/test_.*\.py$/,/.*_test\.py$/,/.*_test\.go$/].some(i=>i.test(e))}isCriticalPath(e){return this.config.criticalPaths.map(i=>i.replace(/\*\*/g,".*").replace(/\*/g,"[^/]*")).some(i=>new RegExp(i).test(e))}isEntryPoint(e){return[/\/index\.[tj]sx?$/,/\/main\.[tj]sx?$/,/\/app\.[tj]sx?$/,/^src\/[^/]+\.[tj]sx?$/,/\/server\.[tj]sx?$/,/\/__init__\.py$/,/\/main\.go$/].some(i=>i.test(e))}getBaseName(e){return this.getFileName(e).replace(/\.[^.]+$/,"")}getFileName(e){return e.split(/[/\\]/).pop()||e}deduplicateImpact(e){let t=new Map;for(let i of e){let r=t.get(i.file);(!r||i.distance<r.distance)&&t.set(i.file,i)}return Array.from(t.values()).sort((i,r)=>r.riskScore!==i.riskScore?r.riskScore-i.riskScore:i.distance-r.distance)}async storeAnalysis(e,t){let i=h();await this.memory.set(`${this.config.namespace}:analysis:${i}`,{id:i,changedFiles:e,analysis:t,timestamp:new Date().toISOString()},{namespace:this.config.namespace,persist:!0})}};export{u as a};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- var v="quality-assessment";var d=["coverage","testsPassing","criticalBugs","codeSmells","securityVulnerabilities","technicalDebt","duplications"],y={coverage:{direction:"min",value:80,severity:"high"},testsPassing:{direction:"min",value:95,severity:"critical"},criticalBugs:{direction:"max",value:0,severity:"critical"},codeSmells:{direction:"max",value:20,severity:"medium"},securityVulnerabilities:{direction:"max",value:0,severity:"critical"},technicalDebt:{direction:"max",value:5,severity:"medium"},duplications:{direction:"max",value:5,severity:"low"}};function p(e){return`quality-evidence:${e}:latest`}function h(e,r,a){if(typeof e!="string")throw new Error("Measured quality evidence is malformed: measuredAt is required.");let i=Date.parse(e);if(!Number.isFinite(i))throw new Error("Measured quality evidence is malformed: measuredAt is invalid.");if(i>r+6e4)throw new Error("Measured quality evidence is malformed: measuredAt is in the future.");if(r-i>a)throw new Error("Measured quality evidence is stale. Run the relevant quality analyzers again.");return i}function E(e,r,a,i){if(!e||typeof e!="object")throw new Error(`No measured quality evidence found for ${r}.`);let t=e;if(t.schemaVersion!==1||t.metric!==r||!Number.isFinite(t.value)||t.value<0||typeof t.source!="string"||t.source.trim().length===0)throw new Error(`Measured quality evidence for ${r} is malformed or incomplete.`);h(t.measuredAt,a,i)}async function M(e,r,a){let i=Date.now();if(h(a.measuredAt,i,Number.POSITIVE_INFINITY),a.source.trim().length===0)throw new Error("Quality evidence source is required.");for(let t of d){let s=r[t];if(s===void 0)continue;if(!Number.isFinite(s)||s<0)throw new Error(`Quality evidence value for ${t} must be a non-negative finite number.`);let n={schemaVersion:1,metric:t,value:s,measuredAt:a.measuredAt,source:a.source};await e.set(p(t),n,{namespace:v,persist:!0})}}var o="insufficient-evidence",u="no MCP tool or CLI command records it yet, so supply it from your own measurement",f={coverage:"run the tests with coverage instrumentation enabled so measured line coverage is recorded (a static estimate is not measured coverage)",testsPassing:"run the test suite (test_execute_parallel, or `aqe test execute`)",security:"static analysis never measures security; drop it from metrics and use security_scan_comprehensive (or `aqe security`) for findings",securityVulnerabilities:`a measured vulnerability count is required; ${u}`,criticalBugs:`a measured critical-bug count is required; ${u}`,codeSmells:`a measured code-smell count is required; ${u}`,technicalDebt:`a measured technical-debt ratio is required; ${u}`,duplications:`a measured duplication percentage is required; ${u}`,complexity:"make sure the target contains readable TypeScript/JavaScript source the analyzer can parse",maintainability:"make sure the target contains readable TypeScript/JavaScript source the analyzer can parse",testability:"make sure the target contains readable TypeScript/JavaScript source the analyzer can parse",duplication:"make sure the target contains readable TypeScript/JavaScript source the analyzer can parse"};function g(e){return e.map(r=>`Insufficient evidence: ${r} not measured \u2014 ${f[r]??"measure it"}.`)}var l=class extends Error{status=o;unmeasured;problems;constructor(r){super(r[0]?.reason??"Measured quality evidence is unavailable."),this.name="InsufficientQualityEvidenceError",this.problems=r,this.unmeasured=r.map(a=>a.metric)}toDetails(){return{passed:!1,status:o,evidenceStatus:o,unmeasured:this.unmeasured,gateEvaluated:!1,recommendations:g(this.unmeasured)}}};async function b(e,r={}){let a=r.now??Date.now(),i=r.maxAgeMs??864e5,t={},s=[];for(let n of d){let m=await e.get(p(n),{namespace:v});try{E(m,n,a,i),t[n]=m.value}catch(c){s.push({metric:n,reason:c instanceof Error?c.message:String(c)})}}return{values:t,problems:s}}async function w(e,r={}){let{values:a,problems:i}=await b(e,r);if(i.length>0)throw new l(i);return a}function Q(e={}){if(e.coverage!==void 0&&(!Number.isFinite(e.coverage)||e.coverage<0||e.coverage>100))throw new Error("Coverage quality threshold must be a finite number between 0 and 100.");return{...y,...e.coverage!==void 0?{coverage:{...y.coverage,value:e.coverage}}:{}}}function x(e,r={}){let a=Q(r),i=d.map(t=>{let s=a[t],n=e[t];return{name:t,value:n,threshold:s.value,direction:s.direction,severity:s.severity,passed:s.direction==="min"?n>=s.value:n<=s.value}});return{passed:i.every(t=>t.passed),checks:i,recommendations:i.filter(t=>!t.passed).map(t=>`${t.name} failed its measured ${t.direction} threshold.`)}}export{y as a,M as b,o as c,g as d,l as e,b as f,w as g,Q as h,x as i};
@@ -1,102 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{writeFileSync as p,readFileSync as m}from"node:fs";import{resolve as f,dirname as u,join as g}from"node:path";import{mkdirSync as v}from"node:fs";import{fileURLToPath as h}from"node:url";function y(){try{let e=typeof __dirname<"u"?__dirname:u(h(import.meta.url));for(let n=0;n<5;n++){let t=g(e,"package.json");try{let s=JSON.parse(m(t,"utf-8"));if(s.version)return s.version}catch{}e=u(e)}}catch{}return"unknown"}function l(e){return e.status??e.evidence?.completeness??"unverified"}var T=["-F, --format <format>","Output format (text|json|sarif|junit|markdown)","text"],C=["-o, --output <path>","Write output to file instead of stdout"];function w(e,n,t){if(n){let s=f(n);v(u(s),{recursive:!0}),p(s,e,"utf-8"),t&&console.log(t),console.log(`Output written to: ${s}`)}else console.log(e)}function $(e){return JSON.stringify(e,null,2)}var S="https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json";function F(e){let n=l(e),t=o=>{switch(o.toLowerCase()){case"critical":case"high":return"error";case"medium":return"warning";case"low":case"info":return"note";default:return"warning"}},s=new Map,i=[];for(let o of e.vulnerabilities){let a=o.ruleId||`AQE/${o.type.replace(/\s+/g,"-").toLowerCase()}`;s.has(a)||s.set(a,{id:a,name:o.type,shortDescription:o.type,...o.cweId?{helpUri:`https://cwe.mitre.org/data/definitions/${o.cweId.replace("CWE-","")}.html`}:{}}),i.push({ruleId:a,level:t(o.severity),message:{text:o.message},locations:[{physicalLocation:{artifactLocation:{uri:o.file,uriBaseId:"%SRCROOT%"},region:{startLine:o.line,startColumn:1}}}],...o.cweId?{taxa:[{id:o.cweId,toolComponent:{name:"CWE"}}]}:{}})}let r={$schema:S,version:"2.1.0",runs:[{tool:{driver:{name:"agentic-qe",version:y(),informationUri:"https://github.com/proffesor-for-testing/agentic-qe",rules:Array.from(s.values()).map(o=>({id:o.id,name:o.name,shortDescription:{text:o.shortDescription},...o.helpUri?{helpUri:o.helpUri}:{},defaultConfiguration:{level:"warning"}}))}},results:i,properties:{securityScan:{status:n,target:e.target,scanType:e.scanType,coverage:e.evidence?e.coverage:void 0,evidence:e.evidence,discovery:e.discovery,checks:e.checks}},invocations:[{executionSuccessful:n==="complete",...n==="complete"?{}:{toolExecutionNotifications:[{level:"warning",message:{text:`Security analysis ${n}; findings do not establish complete coverage.`}}]}}]}]};return JSON.stringify(r,null,2)}function c(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function I(e){let n=e.tests||[],t=e.passed+e.failed+e.skipped,s=(e.duration/1e3).toFixed(3),i=`<?xml version="1.0" encoding="UTF-8"?>
3
- `;if(i+=`<testsuites tests="${t}" failures="${e.failed}" errors="0" time="${s}">
4
- `,i+=` <testsuite name="aqe-test-run" tests="${t}" failures="${e.failed}" errors="0" skipped="${e.skipped}" time="${s}" id="${c(e.runId)}">
5
- `,n.length>0)for(let r of n){let o=(r.duration/1e3).toFixed(3),a=c(r.suite||r.file||"aqe"),d=c(r.name);i+=` <testcase classname="${a}" name="${d}" time="${o}"`,!r.passed&&r.error?(i+=`>
6
- `,i+=` <failure message="${c(r.error)}">${c(r.error)}</failure>
7
- `,i+=` </testcase>
8
- `):i+=` />
9
- `}else{for(let r=0;r<e.passed;r++)i+=` <testcase classname="aqe" name="test-${r+1}" time="0" />
10
- `;for(let r=0;r<e.failed;r++)i+=` <testcase classname="aqe" name="failed-test-${r+1}" time="0">
11
- `,i+=` <failure message="Test failed">Test failed</failure>
12
- `,i+=` </testcase>
13
- `;for(let r=0;r<e.skipped;r++)i+=` <testcase classname="aqe" name="skipped-test-${r+1}" time="0">
14
- `,i+=` <skipped />
15
- `,i+=` </testcase>
16
- `}return i+=` </testsuite>
17
- `,i+=`</testsuites>
18
- `,i}function E(e){let n=`# Coverage Report
19
-
20
- `;n+=`| Metric | Value | Status |
21
- `,n+=`|--------|-------|--------|
22
- `;let t=(s,i)=>i===null?`| ${s} | n/a (not collected) | \u2014 |
23
- `:`| ${s} | ${i}% | ${i>=e.threshold?"\u2705":"\u274C"} |
24
- `;if(n+=t("Lines",e.summary.line),n+=t("Branches",e.summary.branch),n+=t("Functions",e.summary.function),n+=t("Statements",e.summary.statement),n+=`
25
- **Threshold:** ${e.threshold}% \u2014 ${e.meetsThreshold?"\u2705 Met":"\u274C Not met"}
26
- `,e.gaps&&e.gaps.length>0){n+=`
27
- ## Coverage Gaps
28
-
29
- `,n+=`| File | Uncovered Lines | Risk | Severity |
30
- `,n+=`|------|----------------|------|----------|
31
- `;for(let s of e.gaps.slice(0,20))n+=`| ${s.file} | ${s.lines.length} | ${(s.riskScore*100).toFixed(0)}% | ${s.severity} |
32
- `}if(e.recommendations&&e.recommendations.length>0){n+=`
33
- ## Recommendations
34
-
35
- `;for(let s of e.recommendations)n+=`- ${s}
36
- `}return n}function A(e){let n=`# Quality Gate Report
37
-
38
- `;if(e.evidenceStatus==="insufficient-evidence")return n+=`**Result:** \u26A0\uFE0F INSUFFICIENT EVIDENCE \u2014 quality gate not evaluated
39
- `,e.unmeasured&&e.unmeasured.length>0&&(n+=`**Unmeasured:** ${e.unmeasured.join(", ")}
40
- `),e.error&&(n+=`**Reason:** ${e.error}
41
- `),e.recommendations&&e.recommendations.length>0&&(n+=`
42
- ## Recommendations
43
-
44
- ${e.recommendations.map(t=>`- ${t}`).join(`
45
- `)}
46
- `),n;n+=`**Result:** ${e.passed?"\u2705 PASSED":"\u274C FAILED"}
47
- `,n+=`**Score:** ${e.score}
48
-
49
- `,n+=`## Checks
50
-
51
- `,n+=`| Check | Value | Threshold | Status |
52
- `,n+=`|-------|-------|-----------|--------|
53
- `;for(let t of e.checks)n+=`| ${t.name} | ${t.value} | ${t.threshold} | ${t.passed?"\u2705":"\u274C"} |
54
- `;if(e.recommendations&&e.recommendations.length>0){n+=`
55
- ## Recommendations
56
-
57
- `;for(let t of e.recommendations)n+=`- ${t}
58
- `}return n}function O(e){let n=`# Security Scan Report
59
-
60
- `;if(n+=`**Target:** ${e.target}
61
- `,n+=`**Scan Type:** ${e.scanType}
62
- `,n+=`**Execution:** ${l(e)}
63
- `,n+=`**Vulnerabilities Found:** ${e.vulnerabilities.length}
64
-
65
- `,e.checks?.length){n+=`## Check execution
66
-
67
- `;for(let t of e.checks)n+=`- **${t.name}:** ${t.status}${t.reason?` \u2014 ${t.reason}`:""}
68
- `;n+=`
69
- `}if(e.coverage&&e.evidence&&(n+=`**Analyzed files:** ${e.coverage.filesScanned}
70
- `,n+=`**Analyzed lines:** ${e.coverage.linesScanned}
71
- `,n+=`**Rules applied:** ${e.coverage.rulesApplied}${e.coverage.rulesAppliedScope?` (${e.coverage.rulesAppliedScope})`:""}
72
-
73
- `),(e.evidence||e.discovery)&&(n+=`## Execution receipts
74
-
75
- \`\`\`json
76
- ${$({evidence:e.evidence,discovery:e.discovery})}
77
- \`\`\`
78
-
79
- `),e.vulnerabilities.length>0){n+=`## Vulnerabilities
80
-
81
- `,n+=`| Severity | Type | File | Line | Message |
82
- `,n+=`|----------|------|------|------|---------|
83
- `;for(let t of e.vulnerabilities)n+=`| ${t.severity} | ${t.type} | ${t.file} | ${t.line} | ${t.message} |
84
- `}if(e.compliance&&(n+=`
85
- ## Compliance
86
-
87
- `,n+=`**Status:** ${e.compliance.compliant?"\u2705 Compliant":"\u274C Non-compliant"}
88
- `,e.compliance.issues))for(let t of e.compliance.issues)n+=`- **${t.framework}:** ${t.issue}
89
- `;return n}function U(e){let n=e.passed+e.failed+e.skipped,t=`# Test Run Report
90
-
91
- `;return t+=`**Run ID:** ${e.runId}
92
- `,t+=`**Duration:** ${e.duration}ms
93
-
94
- `,t+=`| Metric | Count |
95
- `,t+=`|--------|-------|
96
- `,t+=`| Total | ${n} |
97
- `,t+=`| Passed | ${e.passed} |
98
- `,t+=`| Failed | ${e.failed} |
99
- `,t+=`| Skipped | ${e.skipped} |
100
- `,t+=`
101
- **Result:** ${e.failed===0?"\u2705 All tests passed":"\u274C Some tests failed"}
102
- `,t}export{l as a,T as b,C as c,w as d,$ as e,F as f,I as g,E as h,A as i,O as j,U as k};
@@ -1,16 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{a as q}from"./chunk-DLY4YEN3.js";import{r as Q,s as V}from"./chunk-EOR3RECZ.js";import{i as N}from"./chunk-AQN5EDBM.js";import{a as F,c as y,d}from"./chunk-3AYYGR6W.js";import{a as h,b as M,e as H}from"./chunk-NLDFNAOS.js";import{f as U}from"./chunk-HLFDC4SF.js";H();var v={WorkflowStarted:"workflow.WorkflowStarted",WorkflowCompleted:"workflow.WorkflowCompleted",WorkflowFailed:"workflow.WorkflowFailed",WorkflowCancelled:"workflow.WorkflowCancelled",StepStarted:"workflow.StepStarted",StepCompleted:"workflow.StepCompleted",StepFailed:"workflow.StepFailed",StepSkipped:"workflow.StepSkipped",StepAwaitingApproval:"workflow.StepAwaitingApproval",StepApproved:"workflow.StepApproved",StepRejected:"workflow.StepRejected"},T={maxConcurrentWorkflows:10,defaultStepTimeout:6e4,defaultWorkflowTimeout:6e5,enableEventTriggers:!0,persistExecutions:!0};import{createHash as K}from"node:crypto";function R(s){if(["__proto__","constructor","prototype"].includes(s.id))throw new Error(`parallel_output_invalid_path: unsafe step ID ${s.id}`);let e=[{stepId:s.id,path:s.id,segments:[s.id]}];for(let t of Object.values(s.outputMapping??{}).sort()){let i=t.split(".");if(i.some(r=>!r||["__proto__","constructor","prototype"].includes(r)))throw new Error(`parallel_output_invalid_path: ${s.id} maps to ${t}`);e.push({stepId:s.id,path:t,segments:i})}return e}function $(s){let e=s.flatMap(R),t=[];for(let i=0;i<e.length;i++)for(let r=i+1;r<e.length;r++){let o=e[i],a=e[r];if(o.stepId===a.stepId)continue;let n=Math.min(o.segments.length,a.segments.length);o.segments.slice(0,n).every((c,l)=>c===a.segments[l])&&t.push({pathA:o.path,stepA:o.stepId,pathB:a.path,stepB:a.stepId,kind:o.segments.length===a.segments.length?"exact":"ancestor-descendant"})}return t}function L(s){let e=[];for(let t of s){let i=[...Object.values(t.inputMapping??{}),t.condition?.path,t.skipCondition?.path].filter(r=>typeof r=="string");for(let r of i)for(let o of s){if(o.id===t.id)continue;if(r==="results"){e.push({stepId:t.id,sourcePath:r,otherStepId:o.id});continue}if(!r.startsWith("results."))continue;let a=r.slice(8).split(".");R(o).some(c=>{let l=Math.min(a.length,c.segments.length);return c.segments.slice(0,l).every((g,S)=>g===a[S])})&&e.push({stepId:t.id,sourcePath:r,otherStepId:o.id})}}return e}function E(s,e){if(s===null||typeof s=="string"||typeof s=="boolean")return s;if(typeof s=="number")return["number",String(s)];if(typeof s=="bigint")return["bigint",String(s)];if(s===void 0)return["undefined"];if(typeof s!="object")throw new Error("parallel_output_unhashable");if(e.has(s))throw new Error("parallel_output_cyclic");e.add(s);try{if(s instanceof Date)return["date",s.toISOString()];if(s instanceof ArrayBuffer)return["bytes",Buffer.from(s).toString("base64")];if(ArrayBuffer.isView(s))return["bytes",s.constructor.name,Buffer.from(s.buffer,s.byteOffset,s.byteLength).toString("base64")];if(Array.isArray(s))return["array",s.map(i=>E(i,e))];if(s instanceof Set)return["set",[...s].map(r=>E(r,e)).sort((r,o)=>JSON.stringify(r).localeCompare(JSON.stringify(o)))];if(s instanceof Map)return["map",[...s].map(([r,o])=>[E(r,e),E(o,e)]).sort((r,o)=>JSON.stringify(r).localeCompare(JSON.stringify(o)))];let t=s;return["object",Object.keys(t).sort().map(i=>[i,E(t[i],e)])]}finally{e.delete(s)}}function x(s){let e=JSON.stringify(E(s,new Set));return K("sha256").update(e).digest("hex")}function P(){try{let{getUnifiedMemory:s}=(V(),U(Q)),e=s();return e.isInitialized()?e.getDatabase():null}catch{return null}}var J={id:"quality-gate-check",domain:"quality-assessment",action:"gate-check",async execute(s){let e=typeof s.coverageMin=="number"?s.coverageMin:80,t=typeof s.testsPassingMin=="number"?s.testsPassingMin:90,i=typeof s.maxBugs=="number"?s.maxBugs:5,r=typeof s.currentCoverage=="number"?s.currentCoverage:null,o=typeof s.currentTestsPassingRate=="number"?s.currentTestsPassingRate:null,a=typeof s.currentBugs=="number"?s.currentBugs:null;if(r===null||o===null||a===null){let f=P();if(f)try{if(r===null&&(r=f.prepare("SELECT after_lines FROM coverage_sessions ORDER BY created_at DESC LIMIT 1").get()?.after_lines??0),o===null){let k=f.prepare(`SELECT COUNT(*) as total,
3
- SUM(CASE WHEN passed = 1 THEN 1 ELSE 0 END) as passed
4
- FROM test_outcomes
5
- WHERE created_at > datetime('now', '-7 days')`).get();o=k&&k.total>0?k.passed/k.total*100:0}a===null&&(a=f.prepare(`SELECT COUNT(*) as bugs FROM test_outcomes
6
- WHERE passed = 0 AND flaky = 0
7
- AND created_at > datetime('now', '-7 days')`).get()?.bugs??0)}catch{}}r=r??0,o=o??0,a=a??0;let n=r>=e,c=o>=t,l=a<=i,g=n&&c&&l,S=Math.min(r/e,1),I=Math.min(o/t,1),p=i>0?Math.max(0,1-a/i):a===0?1:0,w=(S+I+p)/3;return y({passed:g,score:Math.round(w*100)/100,source:typeof s.currentCoverage=="number"?"input":"database",details:{coverage:{current:r,threshold:e,passed:n},testsPassing:{current:o,threshold:t,passed:c},bugs:{current:a,threshold:i,passed:l}}})}},X={id:"coverage-threshold",domain:"coverage-analysis",action:"threshold-check",async execute(s){let e=typeof s.minCoverage=="number"?s.minCoverage:80,t=typeof s.currentCoverage=="number"?s.currentCoverage:null,i="input";if(t===null){i="database";let a=P();if(a)try{t=a.prepare("SELECT after_lines FROM coverage_sessions ORDER BY created_at DESC LIMIT 1").get()?.after_lines??0}catch{t=0}else t=0}let r=t>=e,o=r?0:Math.round((e-t)*100)/100;return y({currentCoverage:t,passed:r,gap:o,minCoverage:e,source:i})}},Y={id:"pattern-health",domain:"learning-optimization",action:"health-check",async execute(s){let e=typeof s.totalPatterns=="number"?s.totalPatterns:null,t=typeof s.activePatterns=="number"?s.activePatterns:null,i=typeof s.avgConfidence=="number"?s.avgConfidence:null,r="input";if(e===null||t===null||i===null){r="database";let c=P();if(c)try{let l=c.prepare(`
8
- SELECT COUNT(*) as total,
9
- SUM(CASE WHEN deprecated_at IS NULL AND confidence >= 0.3 THEN 1 ELSE 0 END) as active,
10
- AVG(confidence) as avg_conf
11
- FROM qe_patterns
12
- `).get();e=e??l?.total??0,t=t??l?.active??0,i=i??l?.avg_conf??0}catch{}}e=e??0,t=t??0,i=i??0;let o=Math.min(e/100,1),a=e>0?t/e:0,n=Math.round((o*.3+a*.3+i*.4)*100)/100;return y({totalPatterns:e,activePatterns:t,avgConfidence:i,healthScore:n,source:r})}},Z={id:"routing-accuracy",domain:"learning-optimization",action:"routing-check",async execute(s){let e=typeof s.totalOutcomes=="number"?s.totalOutcomes:null,t=typeof s.successfulOutcomes=="number"?s.successfulOutcomes:null,i=typeof s.confidenceCorrelation=="number"?s.confidenceCorrelation:null,r="input";if(e===null||t===null){r="database";let a=P();if(a)try{let n=a.prepare(`
13
- SELECT COUNT(*) as total,
14
- SUM(CASE WHEN success = 1 THEN 1 ELSE 0 END) as successful
15
- FROM routing_outcomes
16
- `).get();e=e??n?.total??0,t=t??n?.successful??0}catch{}}e=e??0,t=t??0,i=i??0;let o=e>0?Math.round(t/e*1e4)/100:0;return y({successRate:o,totalOutcomes:e,successfulOutcomes:t,confidenceCorrelation:i,source:r})}},ee=[J,X,Y,Z];function B(s,e){return ee.find(t=>t.domain===s&&t.action===e)}function z(){return[te(),re(),ie(),ne(),oe(),se()]}var j=["comprehensive-testing","defect-prevention","pre-release","continuous-learning","morning-sync","qcsd-ideation-swarm"];function te(){return{id:"comprehensive-testing",name:"Comprehensive Testing Workflow",description:"test-generation -> test-execution -> coverage-analysis -> quality-assessment",version:"1.0.0",tags:["testing","quality"],steps:[{id:"generate-tests",name:"Generate Tests",domain:"test-generation",action:"generateTests",inputMapping:{sourceFiles:"input.sourceFiles",framework:"input.framework"},outputMapping:{testFiles:"generatedTests.files",testCount:"generatedTests.count"},timeout:12e4,retry:{maxAttempts:2,backoffMs:1e3}},{id:"execute-tests",name:"Execute Tests",domain:"test-execution",action:"execute",dependsOn:["generate-tests"],inputMapping:{testFiles:"results.generatedTests.files"},outputMapping:{runId:"execution.runId",passed:"execution.passed",failed:"execution.failed"},timeout:3e5},{id:"analyze-coverage",name:"Analyze Coverage",domain:"coverage-analysis",action:"analyze",dependsOn:["execute-tests"],inputMapping:{runId:"results.execution.runId"},outputMapping:{line:"coverage.line",branch:"coverage.branch",overall:"coverage.overall"}},{id:"assess-quality",name:"Assess Quality",domain:"quality-assessment",action:"evaluateGate",dependsOn:["analyze-coverage"],inputMapping:{coverage:"results.coverage",testResults:"results.execution"},outputMapping:{passed:"quality.gatePassed",score:"quality.score"}},{id:"generate-more-tests",name:"Generate Additional Tests",domain:"test-generation",action:"generateTests",dependsOn:["analyze-coverage"],condition:{path:"results.coverage.overall",operator:"lt",value:80},inputMapping:{sourceFiles:"input.sourceFiles",targetCoverage:"input.targetCoverage"},continueOnFailure:!0}]}}function re(){return{id:"defect-prevention",name:"Defect Prevention Workflow",description:"code-intelligence (impact) -> defect-intelligence (predict) -> test-generation (for risky areas)",version:"1.0.0",tags:["defect","prevention","ai"],steps:[{id:"analyze-impact",name:"Analyze Code Impact",domain:"code-intelligence",action:"analyzeImpact",inputMapping:{changedFiles:"input.changedFiles"},outputMapping:{impactedFiles:"impact.files",impactedTests:"impact.tests",riskLevel:"impact.riskLevel"},timeout:6e4},{id:"predict-defects",name:"Predict Defects",domain:"defect-intelligence",action:"predictDefects",dependsOn:["analyze-impact"],inputMapping:{files:"results.impact.files"},outputMapping:{predictions:"defects.predictions",highRiskFiles:"defects.highRiskFiles"}},{id:"generate-targeted-tests",name:"Generate Targeted Tests",domain:"test-generation",action:"generateTests",dependsOn:["predict-defects"],condition:{path:"results.defects.highRiskFiles",operator:"exists",value:!0},inputMapping:{sourceFiles:"results.defects.highRiskFiles",priority:"input.priority"}}],triggers:[{eventType:"code-intelligence.ImpactAnalysisCompleted",inputMapping:{changedFiles:"event.changedFiles"}}]}}function ie(){return{id:"pre-release",name:"Pre-Release Workflow",description:"security-audit -> quality-gate -> deployment-advisor",version:"1.0.0",tags:["release","security","deployment"],steps:[{id:"security-audit",name:"Security Audit",domain:"security-compliance",action:"runAudit",inputMapping:{targetFiles:"input.targetFiles",includeDependencies:"input.includeDependencies"},outputMapping:{vulnerabilities:"security.vulnerabilities",riskScore:"security.riskScore",passed:"security.passed"},timeout:18e4},{id:"quality-gate",name:"Quality Gate Evaluation",domain:"quality-assessment",action:"evaluateGate",dependsOn:["security-audit"],inputMapping:{securityResults:"results.security",releaseCandidate:"input.releaseCandidate"},outputMapping:{passed:"quality.gatePassed",checks:"quality.checks"}},{id:"deployment-advice",name:"Get Deployment Advice",domain:"quality-assessment",action:"getDeploymentAdvice",dependsOn:["quality-gate"],inputMapping:{releaseCandidate:"input.releaseCandidate",qualityResults:"results.quality",securityResults:"results.security"},outputMapping:{decision:"deployment.decision",recommendations:"deployment.recommendations",riskScore:"deployment.riskScore"}}],triggers:[{eventType:"quality-assessment.QualityGateEvaluated",condition:{path:"event.passed",operator:"eq",value:!0}}]}}function ne(){return{id:"continuous-learning",name:"Continuous Learning Workflow",description:"Collect patterns -> consolidate -> transfer -> optimize",version:"1.0.0",tags:["learning","optimization","ai"],steps:[{id:"collect-patterns",name:"Collect Patterns",domain:"learning-optimization",action:"runLearningCycle",inputMapping:{domain:"input.targetDomain"},outputMapping:{patternsLearned:"learning.patterns",experiencesProcessed:"learning.experiences"}},{id:"consolidate-patterns",name:"Consolidate Patterns",domain:"learning-optimization",action:"shareCrossDomainLearnings",dependsOn:["collect-patterns"],condition:{path:"results.learning.patterns",operator:"gt",value:0},outputMapping:{knowledgeShared:"consolidation.shared",domainsUpdated:"consolidation.domains"}},{id:"transfer-knowledge",name:"Transfer Knowledge",domain:"learning-optimization",action:"shareCrossDomainLearnings",dependsOn:["consolidate-patterns"],outputMapping:{transferSuccessRate:"transfer.successRate",newPatternsCreated:"transfer.newPatterns"}},{id:"optimize-strategies",name:"Optimize Strategies",domain:"learning-optimization",action:"optimizeAllStrategies",dependsOn:["transfer-knowledge"],outputMapping:{domainsOptimized:"optimization.domains",avgImprovement:"optimization.improvement"}}]}}function oe(){return{id:"morning-sync",name:"Morning Sync Protocol",description:"Daily quality synchronization across all domains",version:"1.0.0",tags:["protocol","daily","sync"],steps:[{id:"collect-metrics",name:"Collect Quality Metrics",domain:"quality-assessment",action:"analyzeQuality",inputMapping:{sourceFiles:"input.sourceFiles"},outputMapping:{score:"metrics.qualityScore"}},{id:"analyze-trends",name:"Analyze Coverage Trends",domain:"coverage-analysis",action:"getTrend",inputMapping:{timeRange:"input.timeRange",granularity:"input.granularity"},outputMapping:{trend:"trends.coverage",forecast:"trends.forecast"}},{id:"check-security",name:"Check Security Posture",domain:"security-compliance",action:"getSecurityPosture",outputMapping:{overallScore:"security.score",criticalIssues:"security.critical",recommendations:"security.recommendations"}},{id:"get-defect-predictions",name:"Get Defect Predictions",domain:"defect-intelligence",action:"predictDefects",inputMapping:{files:"input.changedFiles"},outputMapping:{predictions:"defects.predictions"}},{id:"generate-learning-report",name:"Generate Learning Dashboard",domain:"learning-optimization",action:"getLearningDashboard",dependsOn:["collect-metrics","analyze-trends","check-security","get-defect-predictions"],outputMapping:{learningRate:"learning.rate",topDomains:"learning.topDomains"}}]}}function se(){return{id:"qcsd-ideation-swarm",name:"QCSD Ideation Swarm",description:"Quality Conscious Software Delivery ideation phase: [url-extraction] -> [flag-detection] -> quality-criteria (HTSM) -> [testability, risk, requirements, security*, accessibility*, qx*] in parallel -> aggregated report. Supports live website URLs with conditional agent spawning based on HAS_UI, HAS_SECURITY, HAS_UX flags.",version:"3.0.0",tags:["qcsd","ideation","quality-criteria","htsm","shift-left","url-analysis"],steps:[{id:"website-content-extraction",name:"Website Content Extraction",domain:"requirements-validation",action:"extractWebsiteContent",inputMapping:{url:"input.url"},outputMapping:{extractedDescription:"extraction.description",extractedFeatures:"extraction.features",extractedAcceptanceCriteria:"extraction.acceptanceCriteria",detectedFlags:"extraction.flags",isWebsite:"extraction.isWebsite"},timeout:6e4,continueOnFailure:!0},{id:"quality-criteria-analysis",name:"HTSM Quality Criteria Analysis",domain:"requirements-validation",action:"analyzeQualityCriteria",dependsOn:["website-content-extraction"],inputMapping:{targetId:"input.targetId",targetType:"input.targetType",description:"results.website-content-extraction.extractedDescription || input.description",acceptanceCriteria:"results.website-content-extraction.extractedAcceptanceCriteria || input.acceptanceCriteria"},outputMapping:{qualityCriteria:"qualityCriteria.criteria",qualityScore:"qualityCriteria.score"},timeout:18e4,retry:{maxAttempts:2,backoffMs:2e3}},{id:"testability-assessment",name:"Testability Scoring (10 Principles)",domain:"requirements-validation",action:"assessTestability",dependsOn:["quality-criteria-analysis"],inputMapping:{targetId:"input.targetId",description:"results.website-content-extraction.extractedDescription || input.description",acceptanceCriteria:"results.website-content-extraction.extractedAcceptanceCriteria || input.acceptanceCriteria"},outputMapping:{overallScore:"testability.overallScore",principles:"testability.principles",blockers:"testability.blockers",recommendations:"testability.recommendations"},timeout:12e4,continueOnFailure:!0},{id:"risk-assessment",name:"Quality Risk Assessment",domain:"requirements-validation",action:"assessRisks",dependsOn:["quality-criteria-analysis"],inputMapping:{targetId:"input.targetId",targetType:"input.targetType",description:"results.website-content-extraction.extractedDescription || input.description"},outputMapping:{overallRisk:"risks.overallRisk",riskScore:"risks.riskScore",factors:"risks.factors",mitigations:"risks.mitigations"},timeout:9e4,continueOnFailure:!0},{id:"requirements-validation",name:"Requirements & Acceptance Criteria Validation",domain:"requirements-validation",action:"validateRequirements",dependsOn:["quality-criteria-analysis"],inputMapping:{targetId:"input.targetId",description:"results.website-content-extraction.extractedDescription || input.description",acceptanceCriteria:"results.website-content-extraction.extractedAcceptanceCriteria || input.acceptanceCriteria"},outputMapping:{valid:"requirements.valid",issues:"requirements.issues",suggestions:"requirements.suggestions"},timeout:9e4,continueOnFailure:!0},{id:"security-threat-modeling",name:"Early Security Threat Modeling (STRIDE)",domain:"security-compliance",action:"modelSecurityThreats",dependsOn:["quality-criteria-analysis"],condition:{path:"results.website-content-extraction.detectedFlags.hasSecurity || input.securityCritical",operator:"eq",value:!0},inputMapping:{targetId:"input.targetId",description:"results.website-content-extraction.extractedDescription || input.description",securityCritical:"results.website-content-extraction.detectedFlags.hasSecurity || input.securityCritical"},outputMapping:{threats:"security.threats",overallRisk:"security.overallRisk",recommendations:"security.recommendations"},timeout:12e4,continueOnFailure:!0},{id:"accessibility-audit",name:"Accessibility Audit (WCAG 2.2)",domain:"visual-accessibility",action:"auditAccessibility",dependsOn:["quality-criteria-analysis"],condition:{path:"results.website-content-extraction.detectedFlags.hasUI || input.hasUI",operator:"eq",value:!0},inputMapping:{targetId:"input.targetId",url:"input.url",description:"results.website-content-extraction.extractedDescription || input.description",features:"results.website-content-extraction.extractedFeatures"},outputMapping:{wcagLevel:"accessibility.wcagLevel",violations:"accessibility.violations",recommendations:"accessibility.recommendations"},timeout:18e4,continueOnFailure:!0},{id:"quality-experience-analysis",name:"Quality Experience Analysis (QX Partner)",domain:"coordination",action:"analyzeQualityExperience",dependsOn:["quality-criteria-analysis"],condition:{path:"results.website-content-extraction.detectedFlags.hasUX || input.hasUX",operator:"eq",value:!0},inputMapping:{targetId:"input.targetId",url:"input.url",description:"results.website-content-extraction.extractedDescription || input.description",features:"results.website-content-extraction.extractedFeatures"},outputMapping:{journeys:"qx.journeys",frictionPoints:"qx.frictionPoints",recommendations:"qx.recommendations"},timeout:15e4,continueOnFailure:!0},{id:"aggregate-ideation-report",name:"Generate Ideation Report",domain:"requirements-validation",action:"generateIdeationReport",dependsOn:["quality-criteria-analysis","testability-assessment","risk-assessment","requirements-validation","security-threat-modeling","accessibility-audit","quality-experience-analysis"],inputMapping:{targetId:"input.targetId",targetType:"input.targetType"},outputMapping:{report:"ideation.report",readyForDevelopment:"ideation.readyForDevelopment",blockers:"ideation.blockers",recommendations:"ideation.recommendations",testStrategy:"ideation.testStrategy"},timeout:6e4},{id:"store-ideation-learnings",name:"Store Ideation Learnings",domain:"learning-optimization",action:"storeIdeationLearnings",dependsOn:["aggregate-ideation-report"],inputMapping:{targetId:"input.targetId",report:"results.ideation.report"},outputMapping:{stored:"learning.stored",patternId:"learning.patternId"},continueOnFailure:!0}],triggers:[{eventType:"requirements-validation.EpicCreated",inputMapping:{targetId:"event.epicId",targetType:"event.type",description:"event.description",acceptanceCriteria:"event.acceptanceCriteria"}},{eventType:"requirements-validation.SprintPlanningStarted",inputMapping:{targetId:"event.sprintId",targetType:"event.type",description:"event.description",acceptanceCriteria:"event.acceptanceCriteria"}}]}}var O=class{constructor(e,t,i,r={}){this.eventBus=e;this.memory=t;this.agentCoordinator=i;this.config={...T,...r}}eventBus;memory;agentCoordinator;config;workflows=new Map;executions=new Map;actionRegistry={};eventSubscriptions=[];approvalGates=new Map;initialized=!1;async initialize(){this.initialized||(this.registerBuiltInWorkflows(),this.config.enableEventTriggers&&this.setupEventTriggers(),await this.loadPersistedWorkflows(),this.initialized=!0)}async dispose(){for(let e of this.executions.values())e.status==="running"&&await this.cancelWorkflow(e.executionId);for(let e of this.eventSubscriptions)e.unsubscribe();await this.persistWorkflows(),this.initialized=!1}registerWorkflow(e){try{let t=this.validateWorkflowDefinition(e);return t.success?(this.workflows.set(e.id,e),this.config.enableEventTriggers&&e.triggers&&this.registerWorkflowTriggers(e),y(void 0)):t}catch(t){return d(M(t))}}unregisterWorkflow(e){if(!this.workflows.has(e))return d(new Error(`Workflow not found: ${e}`));let t=Array.from(this.executions.values()).filter(i=>i.workflowId===e&&i.status==="running");return t.length>0?d(new Error(`Cannot unregister workflow with ${t.length} active execution(s)`)):(this.workflows.delete(e),y(void 0))}async executeWorkflow(e,t={},i){let r=this.workflows.get(e);if(!r)return d(new Error(`Workflow not found: ${e}`));if(Array.from(this.executions.values()).filter(g=>g.status==="running").length>=this.config.maxConcurrentWorkflows)return d(new Error(`Maximum concurrent workflows (${this.config.maxConcurrentWorkflows}) reached`));let a=N(),n=new Date,c={input:t,results:{},metadata:{executionId:a,workflowId:e,correlationId:i||a,startedAt:n}},l={executionId:a,workflowId:e,workflowName:r.name,status:"running",startedAt:n,progress:0,currentSteps:[],completedSteps:[],failedSteps:[],skippedSteps:[],context:c,stepResults:new Map,parallelCompositionReceipts:[]};return this.executions.set(a,l),await this.publishWorkflowStarted(l,r),this.runWorkflow(r,l).catch(async g=>{l.status="failed",l.error=h(g),l.completedAt=new Date,l.duration=l.completedAt.getTime()-n.getTime(),await this.publishWorkflowFailed(l,"unknown",String(g))}),y(a)}getWorkflowStatus(e){return this.executions.get(e)}async cancelWorkflow(e){let t=this.executions.get(e);return t?t.status!=="running"&&t.status!=="paused"?d(new Error(`Cannot cancel workflow in status: ${t.status}`)):(t.status="cancelled",t.completedAt=new Date,t.duration=t.completedAt.getTime()-t.startedAt.getTime(),this.closeApprovalGates(e,"Workflow cancelled"),await this.publishEvent(v.WorkflowCancelled,{executionId:e,workflowId:t.workflowId,workflowName:t.workflowName},t.context.metadata.correlationId),y(void 0)):d(new Error(`Execution not found: ${e}`))}async pauseWorkflow(e){let t=this.executions.get(e);return t?t.status!=="running"?d(new Error(`Cannot pause workflow in status: ${t.status}`)):(t.status="paused",y(void 0)):d(new Error(`Execution not found: ${e}`))}async resumeWorkflow(e){let t=this.executions.get(e);if(!t)return d(new Error(`Execution not found: ${e}`));if(t.status!=="paused")return d(new Error(`Cannot resume workflow in status: ${t.status}`));let i=this.workflows.get(t.workflowId);return i?(t.status="running",this.runWorkflow(i,t).catch(async r=>{t.status="failed",t.error=h(r)}),y(void 0)):d(new Error(`Workflow definition not found: ${t.workflowId}`))}listWorkflows(){return Array.from(this.workflows.values()).map(e=>({id:e.id,name:e.name,description:e.description,version:e.version,stepCount:e.steps.length,tags:e.tags,triggers:e.triggers?.map(t=>t.eventType)}))}getActiveExecutions(){return Array.from(this.executions.values()).filter(e=>e.status==="running"||e.status==="paused")}getWorkflow(e){return this.workflows.get(e)}approveStep(e,t){let i=`${e}:${t}`,r=this.approvalGates.get(i);return r?(r.resolve({approved:!0}),this.approvalGates.delete(i),!0):!1}rejectStep(e,t,i){let r=`${e}:${t}`,o=this.approvalGates.get(r);return o?(o.resolve({approved:!1,reason:i}),this.approvalGates.delete(r),!0):!1}isActionRegistered(e,t){return!!this.actionRegistry[e]?.[t]}getRegisteredActions(e){return Object.keys(this.actionRegistry[e]||{})}getDomainsWithActions(){return Object.keys(this.actionRegistry)}async spawnWorkflowAgent(e,t,i){return this.agentCoordinator.canSpawn()?this.agentCoordinator.spawn({name:`workflow-agent-${e.slice(0,8)}-${t}`,domain:i,type:"coordinator",capabilities:["workflow-execution",t],config:{workflowId:e,stepId:t}}):d(new Error("Agent limit reached"))}async stopWorkflowAgent(e){return this.agentCoordinator.stop(e)}getAvailableAgentCapacity(){return this.agentCoordinator.canSpawn()?this.config.maxConcurrentWorkflows-this.getActiveExecutions().length:0}registerAction(e,t,i){let r=["__proto__","constructor","prototype"];if(r.includes(e)||r.includes(t))throw new Error("Invalid domain or action name: contains dangerous prototype key");this.actionRegistry[e]||(this.actionRegistry[e]={}),this.actionRegistry[e][t]=i}async executeFromBehaviorTree(e){let t=new Date;try{let i=await e.tick(),r=new Date,o=r.getTime()-t.getTime();return{status:i==="SUCCESS"?"completed":i==="RUNNING"?"running":"failed",startedAt:t,completedAt:r,duration:o,treeStatus:i,treeName:e.name}}catch(i){let r=new Date,o=r.getTime()-t.getTime();return{status:"failed",startedAt:t,completedAt:r,duration:o,treeStatus:"FAILURE",treeName:e.name,error:h(i)}}}async runWorkflow(e,t){let i=e.timeout||this.config.defaultWorkflowTimeout,r,o=new Promise((a,n)=>{r=setTimeout(()=>n(new Error(`Workflow timeout after ${i}ms`)),i)});try{await Promise.race([this.executeSteps(e,t),o]),t.status==="running"&&(t.status="completed",t.completedAt=new Date,t.duration=t.completedAt.getTime()-t.startedAt.getTime(),t.progress=100,await this.publishWorkflowCompleted(t))}catch(a){if(t.status==="running"){t.status="failed",t.error=h(a),this.closeApprovalGates(t.executionId,"Workflow failed"),t.completedAt=new Date,t.duration=t.completedAt.getTime()-t.startedAt.getTime();let n=t.currentSteps[0]||"unknown";t.currentSteps=[],await this.publishWorkflowFailed(t,n,h(a))}}finally{r&&clearTimeout(r)}this.config.persistExecutions&&await this.persistExecution(t)}async executeSteps(e,t){let i=e.steps,r=new Set(t.completedSteps),o=new Set(t.skippedSteps),a=new Set(t.failedSteps),n=i.filter(c=>!r.has(c.id)&&!o.has(c.id)&&!a.has(c.id));for(;n.length>0&&t.status==="running";){let c=n.filter(p=>(p.dependsOn||[]).every(f=>r.has(f)||o.has(f)));if(c.length===0)break;let l=c.filter(p=>!p.dependsOn?.length),g=c.filter(p=>p.dependsOn?.length);if(l.length===1&&g.unshift(l[0]),l.length>1){t.currentSteps=l.map(u=>u.id);let p={version:1,workflowId:e.id,workflowRevision:`${e.version}:${x(e)}`,executionId:t.executionId,groupId:l.map(u=>u.id).join("|"),steps:[],conflicts:[],strategy:"rejected",disposition:"invalid"};t.parallelCompositionReceipts??=[],t.parallelCompositionReceipts.push(p);try{p.steps=l.map(u=>({stepId:u.id,disposition:"not_started",writes:R(u).map(m=>m.path)})),p.conflicts=$(l)}catch(u){throw new Error(`parallel_output_invalid_path: ${h(u)}`)}if(p.conflicts.length>0)throw p.disposition="conflict",new Error(`parallel_output_conflict: ${p.conflicts.map(u=>`${u.stepA}.${u.pathA} \u2194 ${u.stepB}.${u.pathB}`).join(", ")}`);let w=L(l);if(w.length>0)throw new Error(`parallel_dependency_error: ${w.map(u=>`${u.stepId} reads ${u.sourcePath} from concurrent step ${u.otherStepId}`).join(", ")}`);let f,k,D;try{f=structuredClone(t.context),D=x(f.results),k=l.map(()=>structuredClone(f))}catch(u){throw new Error(`parallel_context_uncloneable: ${h(u)}`)}let _=await Promise.allSettled(l.map((u,m)=>this.executeStep(u,t,e,k[m],!0))),A;for(let u=0;u<l.length;u++){let m=l[u],b=_[u];if(b.status==="fulfilled"){let C=b.value;if(t.stepResults.set(m.id,C),C.status==="completed"){r.add(m.id),t.completedSteps.push(m.id),p.steps[u].disposition="succeeded";try{p.steps[u].outputHash=x(C.output)}catch(G){throw new Error(`parallel_output_unhashable: ${h(G)}`)}}else C.status==="skipped"?(o.add(m.id),t.skippedSteps.push(m.id),p.steps[u].disposition="skipped"):C.status==="failed"&&(a.add(m.id),t.failedSteps.push(m.id),p.steps[u].disposition="failed",m.continueOnFailure||(A??=C.error??"Unknown error"))}else a.add(m.id),t.failedSteps.push(m.id),p.steps[u].disposition="failed",m.continueOnFailure||(A??=h(b.reason));let W=n.indexOf(m);W!==-1&&n.splice(W,1)}if(t.status!=="running"||A!==void 0){if(p.disposition="partial",A!==void 0)throw new Error(A);if(t.status!=="running")return}else try{let u={...f,results:structuredClone(f.results)};for(let b=0;b<l.length;b++){let W=_[b];W.status==="fulfilled"&&W.value.status==="completed"&&this.mapStepOutput(l[b],W.value.output,u)}let m=x(u.results);if(t.status!=="running"){p.disposition="partial";return}if(x(t.context.results)!==D)throw new Error("parallel_context_changed: shared results changed before composition");t.context.results=u.results,p.combinedStateHash=m,p.strategy="disjoint",p.disposition="composed"}catch(u){throw p.disposition="invalid",new Error(`parallel_output_invalid: ${h(u)}`)}}for(let p of g){if(t.status!=="running")break;t.currentSteps=[p.id];let w=await this.executeStep(p,t,e);if(w.status==="completed")r.add(p.id),t.completedSteps.push(p.id);else if(w.status==="skipped")o.add(p.id),t.skippedSteps.push(p.id);else if(w.status==="failed"&&(a.add(p.id),t.failedSteps.push(p.id),!p.continueOnFailure)){t.status="failed",t.error=w.error;return}let f=n.indexOf(p);f!==-1&&n.splice(f,1)}let S=i.length,I=r.size+o.size+a.size;t.progress=Math.round(I/S*100)}t.currentSteps=[]}async executeStep(e,t,i,r=t.context,o=!1){let a=new Date,n={stepId:e.id,status:"pending",startedAt:a};try{if(e.skipCondition&&this.evaluateCondition(e.skipCondition,r))return n.status="skipped",n.completedAt=new Date,n.duration=n.completedAt.getTime()-a.getTime(),o||t.stepResults.set(e.id,n),await this.publishStepSkipped(t,e),n;if(e.condition&&!this.evaluateCondition(e.condition,r))return n.status="skipped",n.completedAt=new Date,n.duration=n.completedAt.getTime()-a.getTime(),o||t.stepResults.set(e.id,n),await this.publishStepSkipped(t,e),n;n.status="running",await this.publishStepStarted(t,e);let c=this.buildStepInput(e,r);if(e.approval){n.status="awaiting_approval",t.stepResults.set(e.id,n);let p=await this.waitForApproval(e,t);if(!p.approved||t.status!=="running")return n.status="failed",n.error=p.reason||"Step rejected at approval gate",n.completedAt=new Date,n.duration=n.completedAt.getTime()-a.getTime(),await this.publishStepFailed(t,e,n.error),n;n.status="running"}let l,g=e.retry?.maxAttempts||1,S=e.retry?.backoffMs||1e3,I=e.retry?.backoffMultiplier||2;for(let p=1;p<=g;p++){n.retryCount=p-1;try{let w=e.timeout||this.config.defaultStepTimeout,f=await this.executeStepAction(e,c,r,w);o||this.mapStepOutput(e,f,r);let k;try{k=o?structuredClone(f):f}catch(D){throw new Error(`parallel_output_uncloneable: ${h(D)}`)}return n.status="completed",n.output=k,n.completedAt=new Date,n.duration=n.completedAt.getTime()-a.getTime(),o||t.stepResults.set(e.id,n),await this.publishStepCompleted(t,e,n),n}catch(w){if(l=M(w),l.message.startsWith("parallel_output_uncloneable:"))break;p<g&&(await this.delay(S),S*=I)}}return n.status="failed",n.error=l?.message||"Unknown error",n.completedAt=new Date,n.duration=n.completedAt.getTime()-a.getTime(),o||t.stepResults.set(e.id,n),e.rollback&&await this.executeRollback(e.rollback,r),await this.publishStepFailed(t,e,n.error),n}catch(c){return n.status="failed",n.error=h(c),n.completedAt=new Date,n.duration=n.completedAt.getTime()-a.getTime(),o||t.stepResults.set(e.id,n),await this.publishStepFailed(t,e,n.error),n}}async executeStepAction(e,t,i,r){let o=new Promise((c,l)=>{setTimeout(()=>l(new Error(`Step timeout after ${r}ms`)),r)}),a=B(e.domain,e.action);if(a){let c=await Promise.race([a.execute(t,i),o]);if(!c.success)throw c.error;return c.value}let n=this.actionRegistry[e.domain];if(n?.[e.action]){let c=await Promise.race([n[e.action](t,i),o]);if(!c.success)throw c.error;return c.value}throw new Error(`Action '${e.action}' not registered for domain '${e.domain}'. Register it using orchestrator.registerAction('${e.domain}', '${e.action}', handler)`)}async executeRollback(e,t){try{let i=this.actionRegistry[e.domain];if(!i?.[e.action]){console.warn(`Rollback action '${e.action}' not registered for domain '${e.domain}'. Skipping rollback.`);return}let r=await i[e.action](e.input||{},t);r.success||console.error(`Rollback failed for ${e.domain}.${e.action}:`,r.error)}catch(i){console.error(`Rollback failed for ${e.domain}.${e.action}:`,i)}}buildStepInput(e,t){let i={};if(e.inputMapping)for(let[r,o]of Object.entries(e.inputMapping)){let a=this.getValueByPath(t,o);a!==void 0&&(i[r]=a)}return i}mapStepOutput(e,t,i){if(Object.defineProperty(i.results,e.id,{value:t,writable:!0,enumerable:!0,configurable:!0}),e.outputMapping&&typeof t=="object"&&t!==null)for(let[r,o]of Object.entries(e.outputMapping)){let a=this.getValueByPath(t,r);a!==void 0&&this.setValueByPath(i.results,o,a)}}getValueByPath(e,t){let i=t.split("."),r=e;for(let o of i){if(r==null)return;if(typeof r=="object")r=r[o];else return}return r}setValueByPath(e,t,i){let r=t.split("."),o=new Set(["__proto__","constructor","prototype"]);for(let c of r)if(o.has(c))throw new Error("Invalid path: contains dangerous prototype key");let a=e;for(let c=0;c<r.length-1;c++){let l=r[c];Object.hasOwn(a,l)||Object.defineProperty(a,l,{value:Object.create(null),writable:!0,enumerable:!0,configurable:!0}),a=a[l]}let n=r[r.length-1];Object.defineProperty(a,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}evaluateCondition(e,t){let i=this.getValueByPath(t,e.path);switch(e.operator){case"eq":return i===e.value;case"neq":return i!==e.value;case"gt":return typeof i=="number"&&i>e.value;case"gte":return typeof i=="number"&&i>=e.value;case"lt":return typeof i=="number"&&i<e.value;case"lte":return typeof i=="number"&&i<=e.value;case"contains":return Array.isArray(i)?i.includes(e.value):typeof i=="string"?i.includes(String(e.value)):!1;case"exists":return i!=null;default:return!1}}async publishEvent(e,t,i){let r=q(e,"learning-optimization",t,i);await this.eventBus.publish(r)}async publishWorkflowStarted(e,t){await this.publishEvent(v.WorkflowStarted,{executionId:e.executionId,workflowId:e.workflowId,workflowName:e.workflowName,stepCount:t.steps.length},e.context.metadata.correlationId)}async publishWorkflowCompleted(e){await this.publishEvent(v.WorkflowCompleted,{executionId:e.executionId,workflowId:e.workflowId,workflowName:e.workflowName,duration:e.duration||0,completedSteps:e.completedSteps.length,skippedSteps:e.skippedSteps.length},e.context.metadata.correlationId)}async publishWorkflowFailed(e,t,i){await this.publishEvent(v.WorkflowFailed,{executionId:e.executionId,workflowId:e.workflowId,workflowName:e.workflowName,failedStep:t,error:i},e.context.metadata.correlationId)}async publishStepStarted(e,t){await this.publishEvent(v.StepStarted,{executionId:e.executionId,workflowId:e.workflowId,stepId:t.id,stepName:t.name,domain:t.domain},e.context.metadata.correlationId)}async publishStepCompleted(e,t,i){await this.publishEvent(v.StepCompleted,{executionId:e.executionId,workflowId:e.workflowId,stepId:t.id,stepName:t.name,domain:t.domain,duration:i.duration},e.context.metadata.correlationId)}async publishStepFailed(e,t,i){await this.publishEvent(v.StepFailed,{executionId:e.executionId,workflowId:e.workflowId,stepId:t.id,stepName:t.name,domain:t.domain,error:i},e.context.metadata.correlationId)}async publishStepSkipped(e,t){await this.publishEvent(v.StepSkipped,{executionId:e.executionId,workflowId:e.workflowId,stepId:t.id,stepName:t.name,domain:t.domain},e.context.metadata.correlationId)}validateWorkflowDefinition(e){if(!e.id)return d(new Error("Workflow ID is required"));if(!e.name)return d(new Error("Workflow name is required"));if(!e.steps||e.steps.length===0)return d(new Error("Workflow must have at least one step"));let t=new Set;for(let r of e.steps){if(!r.id)return d(new Error("Step ID is required"));if(t.has(r.id))return d(new Error(`Duplicate step ID: ${r.id}`));if(t.add(r.id),!r.domain)return d(new Error(`Step ${r.id} must have a domain`));if(!F.includes(r.domain))return d(new Error(`Invalid domain for step ${r.id}: ${r.domain}`));if(!r.action)return d(new Error(`Step ${r.id} must have an action`));if(r.approval&&typeof r.approval=="object"){let{expiresAfter:o,autoApproveAfter:a}=r.approval;if(o!==void 0&&a!==void 0)return d(new Error(`Step ${r.id} sets both approval expiry fields`));let n=o??a;if(n!==void 0&&(!Number.isSafeInteger(n)||n<0||n>2147483647))return d(new Error(`Step ${r.id} has an invalid approval expiry`))}if(r.dependsOn){for(let o of r.dependsOn)if(!e.steps.some(a=>a.id===o))return d(new Error(`Step ${r.id} depends on unknown step: ${o}`))}}let i=this.detectCircularDependencies(e.steps);return i?d(new Error(`Circular dependency detected: ${i}`)):y(void 0)}detectCircularDependencies(e){let t=new Set,i=new Set,r=(o,a)=>{if(i.has(o))return[...a,o].join(" -> ");if(t.has(o))return null;t.add(o),i.add(o);let n=e.find(c=>c.id===o);if(n?.dependsOn)for(let c of n.dependsOn){let l=r(c,[...a,o]);if(l)return l}return i.delete(o),null};for(let o of e){let a=r(o.id,[]);if(a)return a}return null}setupEventTriggers(){let e=this.eventBus.subscribe("*",async t=>{await this.handleEventForTriggers(t)});this.eventSubscriptions.push(e)}registerWorkflowTriggers(e){}async handleEventForTriggers(e){for(let t of this.workflows.values())if(t.triggers)for(let i of t.triggers){if(i.eventType!==e.type||i.sourceDomain&&i.sourceDomain!==e.source)continue;if(i.condition){let o={input:{event:e.payload},results:{},metadata:{executionId:"",workflowId:t.id,startedAt:new Date}};if(!this.evaluateCondition(i.condition,o))continue}let r={};if(i.inputMapping)for(let[o,a]of Object.entries(i.inputMapping)){let n=this.getValueByPath({event:e.payload},a);n!==void 0&&(r[o]=n)}else r.triggerEvent=e.payload;await this.executeWorkflow(t.id,r,e.correlationId)}}registerBuiltInWorkflows(){let e=z();for(let t of e)this.registerWorkflow(t)}async loadPersistedWorkflows(){try{let e=await this.memory.search("workflow:definition:*",100);for(let t of e){let i=await this.memory.get(t);i&&!this.workflows.has(i.id)&&this.workflows.set(i.id,i)}}catch(e){console.error("Failed to load persisted workflows:",e)}}async persistWorkflows(){try{for(let e of this.workflows.values())j.includes(e.id)||await this.memory.set(`workflow:definition:${e.id}`,e,{namespace:"coordination",persist:!0})}catch(e){console.error("Failed to persist workflows:",e)}}async persistExecution(e){try{let t={...e,stepResults:Object.fromEntries(e.stepResults)};await this.memory.set(`workflow:execution:${e.executionId}`,t,{namespace:"coordination",ttl:86400*7})}catch(t){console.error("Failed to persist execution:",t)}}closeApprovalGates(e,t){for(let[i,r]of this.approvalGates.entries())i.startsWith(`${e}:`)&&r.resolve({approved:!1,reason:t})}async waitForApproval(e,t){if(t.status!=="running")return{approved:!1,reason:`Workflow is ${t.status}`};let i=typeof e.approval=="object"?e.approval:{},r=i.expiresAfter??i.autoApproveAfter??3e5,o=i.message??`Awaiting approval for step: ${e.name}`;if(!Number.isSafeInteger(r)||r<0||r>2147483647)return{approved:!1,reason:"Invalid approval expiry"};let a=`${t.executionId}:${e.id}`,n,c=new Promise(l=>{let g={resolve:S=>{this.approvalGates.get(a)===g&&(this.approvalGates.delete(a),n&&clearTimeout(n),l(S))}};this.approvalGates.set(a,g),r>0&&(n=setTimeout(()=>{g.resolve({approved:!1,reason:"Approval expired"})},r))});try{await this.publishEvent(v.StepAwaitingApproval,{executionId:t.executionId,workflowId:t.workflowId,stepId:e.id,stepName:e.name,domain:e.domain,message:o,expiresAfter:r>0?r:void 0},t.context.metadata.correlationId)}catch(l){throw this.approvalGates.get(a)?.resolve({approved:!1,reason:"Approval event failed"}),l}return c}delay(e){return new Promise(t=>setTimeout(t,e))}};function xe(s,e,t,i){return new O(s,e,t,i)}export{v as a,T as b,O as c,xe as d};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{i as e}from"./chunk-AQN5EDBM.js";function g(t,n,r,a){return{id:e(),type:t,timestamp:new Date,source:n,correlationId:a,payload:r}}var i={TestGenerated:"test-generation.TestGenerated",TestSuiteCreated:"test-generation.TestSuiteCreated",PatternLearned:"test-generation.PatternLearned",GenerationFailed:"test-generation.GenerationFailed"},s={TestRunStarted:"test-execution.TestRunStarted",TestRunCompleted:"test-execution.TestRunCompleted",FlakyTestDetected:"test-execution.FlakyTestDetected",RetryTriggered:"test-execution.RetryTriggered"},o={CoverageReportCreated:"coverage-analysis.CoverageReportCreated",CoverageGapDetected:"coverage-analysis.CoverageGapDetected",RiskZoneIdentified:"coverage-analysis.RiskZoneIdentified"},d={QualityGateEvaluated:"quality-assessment.QualityGateEvaluated",DeploymentApproved:"quality-assessment.DeploymentApproved",DeploymentBlocked:"quality-assessment.DeploymentBlocked"},l={DefectPredicted:"defect-intelligence.DefectPredicted",RootCauseIdentified:"defect-intelligence.RootCauseIdentified",RegressionRiskAnalyzed:"defect-intelligence.RegressionRiskAnalyzed"},c={KnowledgeGraphUpdated:"code-intelligence.KnowledgeGraphUpdated",ImpactAnalysisCompleted:"code-intelligence.ImpactAnalysisCompleted",SemanticSearchCompleted:"code-intelligence.SemanticSearchCompleted",C4DiagramsGenerated:"code-intelligence.C4DiagramsGenerated"},m={VulnerabilityDetected:"security-compliance.VulnerabilityDetected",ComplianceValidated:"security-compliance.ComplianceValidated",SecurityAuditCompleted:"security-compliance.SecurityAuditCompleted"},p={PatternConsolidated:"learning-optimization.PatternConsolidated",TransferCompleted:"learning-optimization.TransferCompleted",OptimizationApplied:"learning-optimization.OptimizationApplied",DreamCycleCompleted:"learning-optimization.dream.completed"},y={...i,...s,...o,...d,...l,...c,...m,...p};export{g as a,i as b,s as c,o as d,d as e,l as f,c as g,m as h,p as i};
@@ -1,3 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import*as h from"fs";import*as p from"path";var x=["coverage/coverage-final.json","coverage/coverage-summary.json",".coverage/coverage-final.json"];function S(r){for(let o of x){let s=p.join(r,o);if(h.existsSync(s))try{let t=JSON.parse(h.readFileSync(s,"utf-8"));if(t.total&&t.total.lines)return L(t,r);let a=new Map;for(let[e,i]of Object.entries(t)){let n=i,l=Object.keys(n.s),u=l.filter(c=>n.s[c]>0).length,f=Object.keys(n.b),d=0,C=0;for(let c of f)for(let g of n.b[c])d++,g>0&&C++;let y=Object.keys(n.f),F=y.filter(c=>n.f[c]>0).length,b=new Set,m=new Set;for(let c of l){let g=n.statementMap[c];for(let M=g.start.line;M<=g.end.line;M++)m.add(M),n.s[c]>0&&b.add(M)}let v=[...m].filter(c=>!b.has(c)).sort((c,g)=>c-g);a.set(e,{path:e,lines:{covered:b.size,total:m.size},branches:{covered:C,total:d},functions:{covered:F,total:y.length},statements:{covered:u,total:l.length},uncoveredLines:v,uncoveredBranches:v.slice(0,Math.floor(v.length/2))})}return a.size>0?a:null}catch{continue}}return null}function L(r,o){let s=new Map;for(let[t,a]of Object.entries(r)){if(t==="total")continue;let e=a;s.set(t,{path:t,lines:{covered:e.lines.covered,total:e.lines.total},branches:{covered:e.branches.covered,total:e.branches.total},functions:{covered:e.functions.covered,total:e.functions.total},statements:{covered:e.statements.covered,total:e.statements.total},uncoveredLines:[],uncoveredBranches:[]})}return s.size>0?s:null}function j(r,o){let t=o.split(`
3
- `).length,e=[r.replace(".ts",".test.ts").replace("/src/","/tests/"),r.replace(".ts",".spec.ts").replace("/src/","/tests/"),r.replace(".ts",".test.ts"),r.replace("/src/","/test/").replace(".ts",".test.ts")].some(m=>h.existsSync(m)),i=(o.match(/\bexport\b/g)||[]).length,n=(o.match(/\b(function|=>)\b/g)||[]).length,l=(o.match(/\b(if|switch|case|\?\?|\|\|)\b/g)||[]).length,u;if(e){let m=Math.min(l*.005,.15),v=Math.min(t*1e-4,.1);u=.85-m-v}else u=.2+(i>5?.1:0);u=Math.max(.05,Math.min(.95,u));let f=Math.floor(t*u),d=Math.max(n,1),C=Math.max(l,1),y=Math.floor(f*.7),F=Math.floor(d*u*.9),b=Array.from({length:t-f},(m,v)=>v+f+1);return{path:r,lines:{covered:f,total:t},branches:{covered:Math.min(y,C),total:C},functions:{covered:Math.min(F,d),total:d},statements:{covered:f,total:t},uncoveredLines:b,uncoveredBranches:b.slice(0,Math.floor(b.length/2))}}function R(r){let o=e=>r.reduce((i,n)=>i+e(n),0),s=(e,i)=>i>0?Math.round(e/i*100):0,t=o(e=>e.lines.total),a=o(e=>e.lines.covered);return{line:s(a,t),branch:s(o(e=>e.branches.covered),o(e=>e.branches.total)),function:s(o(e=>e.functions.covered),o(e=>e.functions.total)),statement:s(a,t),files:r.length}}function w(r,o){let s=o||process.cwd(),t=S(s),a=[],e=[],i=!1;if(t&&t.size>0){i=!0;for(let n of r){let l=p.resolve(n),u=t.get(l)||t.get(n)||t.get(p.relative(s,l));u?a.push({...u,path:n}):e.push(n)}}else for(let n of r){let l=h.existsSync(n)?h.readFileSync(n,"utf-8"):"";a.push(j(n,l))}return{files:a,summary:R(a),instrumented:i,...e.length>0?{unmeasuredFiles:e}:{}}}export{R as a,w as b};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import*as p from"node:fs/promises";import*as o from"node:path";var S=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".pyw",".go",".rs",".java",".kt",".kts",".rb",".cs",".php",".swift",".c",".h",".cpp",".hpp",".cc",".scala"]),E=new Set(["node_modules",".git","dist","build","coverage",".nyc_output","__pycache__",".venv","venv",".tox",".mypy_cache","target",".gradle","vendor",".bundle",".agentic-qe",".claude",".cache",".npm",".yarn",".next",".nuxt",".svelte-kit","out",".turbo","tmp","temp",".tmp"]);function x(l){return S.has(o.extname(l).toLowerCase())}async function _(l,y={}){let m=y.maxFiles??5e3,f=y.maxDepth??64;if(!Number.isSafeInteger(m)||m<1||!Number.isSafeInteger(f)||f<0)throw new Error("Security discovery requires a positive file limit and non-negative depth limit.");let a=[],i=[],h=[],n=o.resolve(l),c=!1,d=!1;function v(e,u){let r=u?.code;i.push({path:e,reason:typeof r=="string"&&/^[A-Z0-9_]{1,32}$/.test(r)?r:"DISCOVERY_FAILED"})}async function g(e,u){if(u>f){i.push({path:e,reason:"DEPTH_LIMIT"});return}let r;try{r=await p.readdir(e,{withFileTypes:!0})}catch(t){v(e,t),e===n&&(c=!0);return}r.sort((t,s)=>t.name<s.name?-1:t.name>s.name?1:0);for(let t of r){if(d)return;let s=o.join(e,t.name);if(t.isSymbolicLink())h.push(s);else if(t.isDirectory())E.has(t.name)?h.push(s):await g(s,u+1);else if(t.isFile()&&x(t.name)){if(a.length===m){i.push({path:s,reason:"FILE_LIMIT"}),d=!0;return}a.push(s)}}}try{let e=await p.lstat(n);e.isFile()?a.push(n):e.isDirectory()?await g(n,0):(c=!0,i.push({path:n,reason:e.isSymbolicLink()?"SYMLINK_TARGET":"NOT_REGULAR_INPUT"}))}catch(e){c=!0,v(n,e)}return{files:a,discovery:{status:c?"failed":i.length>0?"partial":"complete",policy:"aqe-security-source-files@1",issues:i,excludedPaths:h}}}export{x as a,_ as b};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{b as g}from"./chunk-HLFDC4SF.js";import*as s from"fs";import*as f from"os";import*as t from"path";function j(){l=null,p=null}function m(a,n){let i=t.relative(n,a);return i===""||!i.startsWith("..")&&!t.isAbsolute(i)}function v(a=process.cwd()){if(process.env.AQE_PROJECT_ROOT)return process.env.AQE_PROJECT_ROOT;let n=t.resolve(a);if(l&&p===n)return l;p=n;let i=t.parse(n).root,c=null;try{c=t.resolve(f.homedir())}catch{c=null}let e=n,r=null,o=null,u=null;for(;e!==i;){let h=e===c&&e!==n&&!m(n,t.join(e,".agentic-qe"));o===null&&!h&&s.existsSync(t.join(e,".agentic-qe"))&&r===null&&(r=e),s.existsSync(t.join(e,".git"))&&o===null&&(o=e),s.existsSync(t.join(e,"package.json"))&&(u=e),e=t.dirname(e)}return r?l=r:o?l=o:u?l=u:l=n,l}var l,p,d=g(()=>{l=null,p=null});export{j as a,v as b,d as c};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{a as e,c as r,d as g,g as t}from"./chunk-E4VIVMDL.js";import{b as o}from"./chunk-HLFDC4SF.js";var L=o(()=>{"use strict";e();g();t();r()});export{L as a};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{b as h,d as v,f as T}from"./chunk-HLFDC4SF.js";var y={};v(y,{DotProductAttention:()=>z,FlashAttention:()=>k,HyperbolicAttention:()=>C,LinearAttention:()=>j,MoEAttention:()=>W,MultiHeadAttention:()=>F,RuvectorLayer:()=>O,SonaEngine:()=>K,TensorCompress:()=>E,default:()=>I,differentiableSearch:()=>L,getCompressionLevel:()=>B,hierarchicalForward:()=>V,init:()=>D,pipeline:()=>q});import{createRequire as A}from"module";var _,g,I,O,E,L,V,B,D,k,z,F,C,j,W,K,q,R=h(()=>{_=A(import.meta.url),g=_("@ruvector/rvf-node"),I=g,{RuvectorLayer:O,TensorCompress:E,differentiableSearch:L,hierarchicalForward:V,getCompressionLevel:B,init:D,FlashAttention:k,DotProductAttention:z,MultiHeadAttention:F,HyperbolicAttention:C,LinearAttention:j,MoEAttention:W,SonaEngine:K,pipeline:q}=g||{}});var Z={};v(Z,{createRvfStore:()=>$,isRvfNativeAvailable:()=>X,openRvfStore:()=>G,openRvfStoreReadonly:()=>U});import{readFileSync as J,writeFileSync as H,copyFileSync as Q,existsSync as Y}from"fs";function c(){if(S)return m;S=!0;try{let s=(R(),T(y));!s.RvfDatabase&&s.default&&s.default.RvfDatabase&&(s=s.default),m=s}catch{m=null}return m}function w(s){return`${s}.idmap.json`}function N(s){let e=w(s),t=new Map,n=new Map,i=1;if(Y(e))try{let r=JSON.parse(J(e,"utf-8"));i=r.nextLabel;for(let[a,p]of r.entries)t.set(a,p),n.set(p,a)}catch{}return{strToNum:t,numToStr:n,nextLabel:i}}function b(s,e,t){let n={nextLabel:t,entries:Array.from(e.entries())};H(w(s),JSON.stringify(n),"utf-8")}function $(s,e){let t=c();if(!t)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let n=t.RvfDatabase.create(s,{dimension:e}),i=n.dimension();return new d(n,s,i,new Map,new Map,1)}function G(s){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.open(s),n=t.dimension(),{strToNum:i,numToStr:r,nextLabel:a}=N(s);return new d(t,s,n,i,r,a)}function U(s){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.openReadonly(s),n=t.dimension(),{strToNum:i,numToStr:r,nextLabel:a}=N(s);return new d(t,s,n,i,r,a)}function X(){return process.env.AQE_MEMORY_BACKEND==="memory"?!1:c()!==null}var m,S,d,P=h(()=>{m=null,S=!1;d=class s{db;_path;_dimension;strToNum;numToStr;nextLabel;_open;constructor(e,t,n,i,r,a){this.db=e,this._path=t,this._dimension=n,this.strToNum=i,this.numToStr=r,this.nextLabel=a,this._open=!0}ingest(e){if(this.ensureOpen(),e.length===0)return{accepted:0,rejected:0};let t=this._dimension,n=new Float32Array(e.length*t),i=[],r=[];for(let o=0;o<e.length;o++){let{id:u,vector:f,metadata:x}=e[o],l=this.strToNum.get(u);l===void 0&&(l=this.nextLabel++,this.strToNum.set(u,l),this.numToStr.set(l,u)),i.push(l),r.push(x);let M=f instanceof Float32Array?f:new Float32Array(f);n.set(M.subarray(0,t),o*t)}let a;if(r.some(o=>o!==void 0)&&typeof this.db.ingestBatchWithMetadata=="function"){let o=r.map(u=>u?JSON.stringify(u):"");a=this.db.ingestBatchWithMetadata(n,i,o)}else a=this.db.ingestBatch(n,i);return this.persistIdMap(),{accepted:a.accepted,rejected:a.rejected}}search(e,t){this.ensureOpen();let n=e instanceof Float32Array?e:new Float32Array(e);return this.db.query(n,t).map(r=>{let a=this.numToStr.get(r.id);return a===void 0?null:{id:a,distance:r.distance,score:1/(1+r.distance)}}).filter(r=>r!==null)}delete(e){this.ensureOpen();let t=[];for(let i of e){let r=this.strToNum.get(i);r!==void 0&&t.push(r)}if(t.length===0)return 0;let n=this.db.delete(t);for(let i of e){let r=this.strToNum.get(i);r!==void 0&&(this.strToNum.delete(i),this.numToStr.delete(r))}return this.persistIdMap(),n.deleted}fork(e){this.ensureOpen(),Q(this._path,e);let t=new Map(this.strToNum),n=new Map(this.numToStr);b(e,t,this.nextLabel);let r=c().RvfDatabase.open(e);return new s(r,e,this._dimension,t,n,this.nextLabel)}status(){this.ensureOpen();let e=this.db.status(),n=this.db.segments().filter(i=>i.segType==="witness");return{totalVectors:e.totalVectors,totalSegments:e.totalSegments,fileSizeBytes:e.fileSize,epoch:e.currentEpoch,witnessValid:n.length>0,witnessEntries:n.length,deadSpaceRatio:typeof e.deadSpaceRatio=="number"?e.deadSpaceRatio:0}}dimension(){return this._dimension}size(){return this.ensureOpen(),this.db.status().totalVectors}compact(){this.ensureOpen();try{let e=this.db.compact();return e&&typeof e=="object"?{segmentsCompacted:typeof e.segmentsCompacted=="number"?e.segmentsCompacted:0,bytesReclaimed:typeof e.bytesReclaimed=="number"?e.bytesReclaimed:0,epoch:typeof e.epoch=="number"?e.epoch:0}:{segmentsCompacted:0,bytesReclaimed:0,epoch:0}}catch{return null}}close(){this._open&&(this.db.close(),this._open=!1)}isOpen(){return this._open}path(){return this._path}embedKernel(e){return this.ensureOpen(),this.db.embedKernel(0,99,0,e,0,"")}extractKernel(){return this.ensureOpen(),this.db.extractKernel()}verifyWitness(){this.ensureOpen();let e=this.tryNative("verifyWitness");return e?{valid:e.valid??!0,totalEntries:e.totalEntries??0,errors:Array.isArray(e.errors)?e.errors:[]}:{valid:!0,totalEntries:0,errors:[]}}sign(e){this.ensureOpen();let t=this.tryNative("sign",e);return typeof t=="string"?t:null}fileId(){this.ensureOpen();let e=this.tryNative("fileId");return typeof e=="string"?e:null}parentId(){this.ensureOpen();let e=this.tryNative("parentId");return typeof e=="string"?e:null}lineageDepth(){this.ensureOpen();let e=this.tryNative("lineageDepth");return typeof e=="number"?e:0}indexStats(){let e=this.status();return{totalVectors:e.totalVectors,dimension:this._dimension,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries,idMapSize:this.strToNum.size}}freeze(){this.ensureOpen();let e=this.tryNative("freeze");return typeof e=="number"?e:0}derive(e){this.ensureOpen();let t=c();if(typeof this.db.derive=="function")try{let n=this.db.derive(e),i=new Map(this.strToNum),r=new Map(this.numToStr);return b(e,i,this.nextLabel),new s(n,e,this._dimension,i,r,this.nextLabel)}catch{}return this.fork(e)}ensureOpen(){if(!this._open)throw new Error("RVF database is closed")}tryNative(e,...t){if(typeof this.db[e]!="function")return null;try{return this.db[e](...t)}catch{return null}}persistIdMap(){b(this._path,this.strToNum,this.nextLabel)}}});export{$ as a,G as b,U as c,X as d,Z as e,P as f};
@@ -1,3 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{b as F,d as K}from"./chunk-RUSLEOMC.js";import{a as T}from"./chunk-3AYYGR6W.js";import{a as R,e as j}from"./chunk-NLDFNAOS.js";import{randomUUID as te}from"crypto";import*as u from"fs";import*as g from"path";import*as v from"os";import*as P from"fs";var G={"aqe test generate":{domain:"test-generation",action:"generateTests"},"aqe test execute":{domain:"test-execution",action:"execute"},"aqe coverage analyze":{domain:"coverage-analysis",action:"analyze"},"aqe coverage gaps":{domain:"coverage-analysis",action:"detectGaps"},"aqe quality gate":{domain:"quality-assessment",action:"evaluateGate"},"aqe quality assess":{domain:"quality-assessment",action:"analyzeQuality"},"aqe security scan":{domain:"security-compliance",action:"runSASTScan"},"aqe security audit":{domain:"security-compliance",action:"runAudit"},"aqe defect predict":{domain:"defect-intelligence",action:"predictDefects"},"aqe code index":{domain:"code-intelligence",action:"index"},"aqe code impact":{domain:"code-intelligence",action:"analyzeImpact"},"aqe contract validate":{domain:"contract-testing",action:"validateContract"},"aqe chaos test":{domain:"chaos-resilience",action:"runChaosTest"},"aqe requirements validate":{domain:"requirements-validation",action:"validateRequirements"},"aqe visual test":{domain:"visual-accessibility",action:"runVisualTest"},"aqe accessibility test":{domain:"visual-accessibility",action:"runAccessibilityTest"},"aqe learn optimize":{domain:"learning-optimization",action:"optimizeAllStrategies"}},x={daily:"0 0 * * *",weekly:"0 0 * * 0",hourly:"0 * * * *",minutely:"* * * * *"},C=1e4,I=20,O=1e4,H=["__proto__","constructor","prototype"];function _(i){return!H.includes(i)}function B(i){let e=i.split(`
3
- `);if(e.length>C)throw new Error(`YAML content exceeds maximum allowed lines (${C}). File has ${e.length} lines.`);for(let n=0;n<e.length;n++)if(e[n].length>O)throw new Error(`YAML line ${n+1} exceeds maximum allowed length (${O} characters).`);let s={};for(let n=0;n<e.length;n++){let r=e[n];if(r.trim()===""||r.trim().startsWith("#")||r.search(/\S/)!==0)continue;let c=r.match(/^([\w_-]+):\s*(.+)$/);if(c){let[,a,d]=c;_(a)&&(s[a]=y(d))}}let t=["tags","stages","triggers"];for(let n of t){let r=new RegExp(`^${n}:\\s*$`),o=-1;for(let h=0;h<e.length;h++){let l=e[h];if(!(l.trim()===""||l.trim().startsWith("#"))&&r.test(l.trim())){o=h;break}}if(o===-1)continue;let c=[];s[n]=c;let a=e[o].search(/\S/),d=o+1;for(;d<e.length;){let h=e[d];if(h.trim()===""||h.trim().startsWith("#")){d++;continue}let l=h.search(/\S/),f=h.trim();if(l<=a&&!f.startsWith("-"))break;if(f.startsWith("- ")){let m=f.slice(2).trim();if(!m.includes(":")){c.push(y(m)),d++;continue}let p={},w=m.match(/^([\w_-]+):\s*(.*)$/);if(w){let[,S,k]=w;p[S]=y(k)}let V=l;for(d++;d<e.length;){let S=e[d];if(S.trim()===""||S.trim().startsWith("#")){d++;continue}let k=S.search(/\S/),U=S.trim();if(k<=V)break;let A=U.match(/^([\w_-]+):\s*(.*)$/);if(A){let[,L,E]=A;if(E===""){let M=X(e,d+1,k,1);p[L]=M.value,d=M.nextLine;continue}else p[L]=y(E)}d++}c.push(p)}else d++}}return s}function X(i,e,s,t=0){if(t>I)throw new Error(`YAML nesting exceeds maximum allowed depth (${I}).`);let n={},r=null,o=null,c=e;for(;c<i.length;){let d=i[c];if(d.trim()===""||d.trim().startsWith("#")){c++;continue}let h=d.search(/\S/),l=d.trim();if(h<=s)break;if(l.startsWith("- ")){let m=l.slice(2).trim();o&&!Array.isArray(n[o])&&(n[o]=[]),o?n[o].push(y(m)):(r||(r=[]),r.push(y(m))),c++;continue}let f=l.match(/^([\w_-]+):\s*(.*)$/);if(f){let[,m,p]=f;if(!_(m)){c++;continue}p===""?(o=m,n[m]=[]):(n[m]=y(p),o=null)}c++}if(r&&Object.keys(n).length===0)return{value:r,nextLine:c};let a=Object.keys(n);return a.length===1&&Array.isArray(n[a[0]])?{value:n[a[0]],nextLine:c}:{value:n,nextLine:c}}function y(i){if(i==="")return"";if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(i==="true")return!0;if(i==="false")return!1;if(i==="null"||i==="~")return null;let e=Number(i);return!isNaN(e)&&i!==""?e:i.startsWith("[")&&i.endsWith("]")?i.slice(1,-1).split(",").map(t=>y(t.trim())):i}function le(i){let e=[];if(!P.existsSync(i))return{success:!1,errors:[`File not found: ${i}`]};let s;try{s=P.readFileSync(i,"utf-8")}catch(t){return{success:!1,errors:[`Failed to read file: ${t}`]}}return J(s,i)}function J(i,e){let s=[],t;try{t=B(i)}catch(o){return{success:!1,errors:[`Invalid YAML syntax: ${o}`]}}if((!t.name||typeof t.name!="string")&&s.push('Pipeline must have a "name" field'),(!t.stages||!Array.isArray(t.stages))&&s.push('Pipeline must have a "stages" array'),s.length>0)return{success:!1,errors:s};let n={name:t.name,description:t.description,version:t.version||"1.0.0",schedule:t.schedule,stages:t.stages.map((o,c)=>{let a=o;return{name:a.name||`stage-${c}`,command:a.command,params:a.params,depends_on:a.depends_on,condition:a.condition,timeout:a.timeout,retry:a.retry,continue_on_failure:a.continue_on_failure}}),triggers:t.triggers,tags:t.tags,timeout:t.timeout};for(let o=0;o<n.stages.length;o++){let c=n.stages[o];c.command||s.push(`Stage ${o+1} (${c.name}) must have a "command" field`)}if(s.length>0)return{success:!1,pipeline:n,errors:s};let r=Q(n,e);return{success:!0,pipeline:n,workflow:r,errors:[]}}function Q(i,e){let s=`pipeline-${i.name.replace(/\s+/g,"-").toLowerCase()}`,t=i.stages.map((r,o)=>{let c=q(r.command),a={};if(r.params)for(let[h,l]of Object.entries(r.params))_(h)&&(a[h]=`input.${h}`);let d={id:`stage-${r.name.replace(/\s+/g,"-").toLowerCase()}`,name:r.name,domain:c.domain,action:c.action,inputMapping:Object.keys(a).length>0?a:void 0,dependsOn:r.depends_on?.map(h=>`stage-${h.replace(/\s+/g,"-").toLowerCase()}`),timeout:r.timeout?r.timeout*1e3:void 0,continueOnFailure:r.continue_on_failure};return r.condition&&(d.condition={path:r.condition.path,operator:r.condition.operator,value:r.condition.value}),r.retry&&(d.retry={maxAttempts:r.retry.max_attempts||3,backoffMs:(r.retry.backoff_seconds||1)*1e3}),d}),n=i.triggers?.map(r=>{let o={eventType:Z(r),sourceDomain:r.source_domain};return r.condition&&(o.condition={path:r.condition.path,operator:r.condition.operator,value:r.condition.value}),o});return{id:s,name:i.name,description:i.description||`Pipeline from ${e||"inline YAML"}`,version:i.version||"1.0.0",steps:t,triggers:n,tags:i.tags,timeout:i.timeout?i.timeout*1e3:void 0}}function q(i){let e=i.trim().replace(/\s+/g," ").toLowerCase();for(let[s,t]of Object.entries(G))if(e.startsWith(s.toLowerCase()))return t;return e.includes("test")&&e.includes("generate")?{domain:"test-generation",action:"generateTests"}:e.includes("test")&&(e.includes("execute")||e.includes("run"))?{domain:"test-execution",action:"execute"}:e.includes("coverage")?{domain:"coverage-analysis",action:"analyze"}:e.includes("quality")||e.includes("gate")?{domain:"quality-assessment",action:"evaluateGate"}:e.includes("security")||e.includes("scan")?{domain:"security-compliance",action:"runSASTScan"}:e.includes("defect")||e.includes("predict")?{domain:"defect-intelligence",action:"predictDefects"}:{domain:"learning-optimization",action:"runLearningCycle"}}function Z(i){let e=i.event.toLowerCase();return e==="push"?"code-intelligence.CodePushed":e==="pull_request"||e==="pr"?"code-intelligence.PullRequestOpened":e==="schedule"?"workflow.ScheduleTrigger":e==="quality_gate"?"quality-assessment.QualityGateEvaluated":e==="test_complete"?"test-execution.TestRunCompleted":e}function ue(i){let e=[],s=[];if(i.name||e.push({path:"name",message:"Pipeline name is required",severity:"error"}),!i.stages||i.stages.length===0)e.push({path:"stages",message:"Pipeline must have at least one stage",severity:"error"});else{let t=new Set;for(let r=0;r<i.stages.length;r++){let o=i.stages[r],c=`stages[${r}]`;if(t.has(o.name)&&e.push({path:`${c}.name`,message:`Duplicate stage name: ${o.name}`,severity:"error"}),t.add(o.name),o.command?q(o.command).domain==="learning-optimization"&&!o.command.toLowerCase().includes("learn")&&s.push({path:`${c}.command`,message:`Command "${o.command}" not recognized, will default to learning-optimization domain`,severity:"warning"}):e.push({path:`${c}.command`,message:"Stage must have a command",severity:"error"}),o.depends_on)for(let a of o.depends_on)i.stages.some(d=>d.name===a)||e.push({path:`${c}.depends_on`,message:`Unknown dependency: ${a}`,severity:"error"});o.timeout!==void 0&&o.timeout<=0&&e.push({path:`${c}.timeout`,message:"Timeout must be a positive number",severity:"error"}),o.retry&&o.retry.max_attempts!==void 0&&o.retry.max_attempts<1&&e.push({path:`${c}.retry.max_attempts`,message:"max_attempts must be at least 1",severity:"error"})}let n=ee(i.stages);n&&e.push({path:"stages",message:`Circular dependency detected: ${n}`,severity:"error"})}if(i.schedule&&(D(i.schedule)||e.push({path:"schedule",message:`Invalid cron expression: ${i.schedule}`,severity:"error"})),i.triggers)for(let t=0;t<i.triggers.length;t++){let n=i.triggers[t],r=`triggers[${t}]`;n.event||e.push({path:`${r}.event`,message:"Trigger must have an event type",severity:"error"}),n.source_domain&&!T.includes(n.source_domain)&&s.push({path:`${r}.source_domain`,message:`Unknown domain: ${n.source_domain}`,severity:"warning"})}return{valid:e.length===0,errors:e,warnings:s}}function ee(i){let e=new Set,s=new Set,t=(n,r)=>{if(s.has(n))return[...r,n].join(" -> ");if(e.has(n))return null;e.add(n),s.add(n);let o=i.find(c=>c.name===n);if(o?.depends_on)for(let c of o.depends_on){let a=t(c,[...r,n]);if(a)return a}return s.delete(n),null};for(let n of i){let r=t(n.name,[]);if(r)return r}return null}function D(i){return W(i)!==void 0}function W(i){let s=(Object.hasOwn(x,i)?x[i]:i).trim().split(/\s+/);if(s.length!==5)return;let t=[[0,59],[0,23],[1,31],[1,12],[0,7]],n=[/^(\*|[0-5]?\d)(-[0-5]?\d)?(\/\d+)?$/,/^(\*|1?\d|2[0-3])(-\d+)?(\/\d+)?$/,/^(\*|[1-9]|[12]\d|3[01])(-\d+)?(\/\d+)?$/,/^(\*|[1-9]|1[0-2])(-\d+)?(\/\d+)?$/,/^(\*|[0-7])(-[0-7])?(\/\d+)?$/],r=[];for(let o=0;o<s.length;o++){let[c,a]=t[o],d=new Set;for(let h of s[o].split(",")){if(!n[o].test(h))return;let l=/^(\*|\d+)(?:-(\d+))?(?:\/(\d+))?$/.exec(h);if(!l||l[1]==="*"&&l[2]!==void 0)return;let f=l[1]==="*"?c:Number(l[1]),m=l[2]!==void 0?Number(l[2]):l[1]==="*"||l[3]!==void 0?a:f,p=l[3]===void 0?1:Number(l[3]);if(!Number.isSafeInteger(f)||!Number.isSafeInteger(m)||!Number.isSafeInteger(p)||p<=0||f<c||m>a||f>m)return;for(let w=f;w<=m;w+=p)d.add(o===4&&w===7?0:w)}r.push(d)}return{fields:r,wildcardDay:s[2].startsWith("*")||s[4].startsWith("*")}}function he(i){let e={"@daily":"Daily at midnight","@weekly":"Weekly on Sunday at midnight","@hourly":"Every hour","@minutely":"Every minute"};if(e[i])return e[i];if(Object.keys(x).includes(i))return{daily:"Daily at midnight",weekly:"Weekly on Sunday at midnight",hourly:"Every hour",minutely:"Every minute"}[i]||i;let s=i.trim().split(/\s+/);if(s.length!==5)return i;let[t,n,r,o,c]=s;return t==="0"&&n==="0"&&r==="*"&&o==="*"&&c==="*"?"Daily at midnight":t==="0"&&r==="*"&&o==="*"&&c==="*"?`Daily at ${n}:00`:t!=="*"&&n!=="*"&&r==="*"&&o==="*"?`Daily at ${n}:${t.padStart(2,"0")}`:n==="*"&&t==="0"?"Every hour":t!=="*"&&n==="*"?`Every hour at minute ${t}`:i}function b(i,e=new Date){let s=W(i);if(!s)throw new Error(`Invalid cron expression: ${i}`);if(!Number.isFinite(e.getTime()))throw new Error("Invalid schedule start date");let[t,n,r,o,c]=s.fields,a=new Date(Math.floor(e.getTime()/6e4)*6e4+6e4),d=new Date(e);d.setFullYear(e.getFullYear()+400);let h=Number.isFinite(d.getTime())?d.getTime():864e13;for(;Number.isFinite(a.getTime())&&a.getTime()<=h;){let l=r.has(a.getDate()),f=c.has(a.getDay());if(!(o.has(a.getMonth()+1)&&(s.wildcardDay?l&&f:l||f))){a.setHours(24,0,0,0);continue}if(n.has(a.getHours())&&t.has(a.getMinutes()))return a;a=new Date(a.getTime()+6e4)}throw new Error(`No matching cron date within a 400-year Gregorian cycle and the supported Date range: ${i}`)}K();j();var ne=".aqe",ie="schedules.json",se="1.0.0",N=5e3,re=50,Y=10*1024*1024,$=class{schedulesPath;debug;lockFile;initialized=!1;constructor(e={}){e.schedulesPath&&this.validateSchedulesPath(e.schedulesPath),this.schedulesPath=e.schedulesPath??this.getDefaultSchedulesPath(),this.lockFile=`${this.schedulesPath}.lock`,this.debug=e.debug??!1}validateSchedulesPath(e){let s=v.homedir(),t=g.resolve(e),n=g.resolve(s);if(t.startsWith(n+g.sep)||t===n)return;let r=process.cwd(),o=g.resolve(r);if(t.startsWith(o+g.sep)||t===o)return;let c=v.tmpdir(),a=g.resolve(c);if(!(t.startsWith(a+g.sep)||t===a))throw new Error(`Security: Custom schedulesPath must be within home directory (${s}), current working directory (${r}), or temp directory (${c}). Provided path: ${e}`)}getDefaultSchedulesPath(){let e=v.homedir();return g.join(e,ne,ie)}async initialize(){if(this.initialized)return;let e=g.dirname(this.schedulesPath);u.existsSync(e)||(u.mkdirSync(e,{recursive:!0}),this.log(`Created directory: ${e}`)),this.initialized=!0}async loadSchedules(){if(await this.initialize(),!u.existsSync(this.schedulesPath))return this.log("Schedules file does not exist, returning empty array"),[];try{let e=u.readFileSync(this.schedulesPath,"utf-8"),s=this.parseSchedulesFile(e);return this.log(`Loaded ${s.schedules.length} schedules`),s.schedules}catch(e){return await this.handleCorruptFile(e),[]}}async saveSchedule(e){await this.initialize(),await this.withFileLock(async()=>{let s=await this.loadSchedulesUnsafe(),t=s.findIndex(n=>n.id===e.id);t>=0?(s[t]=e,this.log(`Updated schedule: ${e.id}`)):(s.push(e),this.log(`Added schedule: ${e.id}`)),await this.writeSchedules(s)})}async removeSchedule(e){await this.initialize(),await this.withFileLock(async()=>{let s=await this.loadSchedulesUnsafe(),t=s.filter(n=>n.id!==e);if(t.length===s.length){this.log(`Schedule not found: ${e}`);return}await this.writeSchedules(t),this.log(`Removed schedule: ${e}`)})}async getSchedules(){return this.loadSchedules()}async getSchedule(e){return(await this.loadSchedules()).find(t=>t.id===e)}async getDueSchedules(){let e=await this.loadSchedules(),s=new Date;return e.filter(t=>t.enabled?new Date(t.nextRun)<=s:!1)}async markExecuted(e){await this.initialize(),await this.withFileLock(async()=>{let s=await this.loadSchedulesUnsafe(),t=s.find(r=>r.id===e);if(!t)throw new Error(`Schedule not found: ${e}`);let n=new Date;t.lastRun=n.toISOString(),t.nextRun=b(t.schedule,n).toISOString(),await this.writeSchedules(s),this.log(`Marked executed: ${e}, next run: ${t.nextRun}`)})}async setEnabled(e,s){await this.initialize(),await this.withFileLock(async()=>{let t=await this.loadSchedulesUnsafe(),n=t.find(r=>r.id===e);if(!n)throw new Error(`Schedule not found: ${e}`);n.enabled=s,s&&(n.nextRun=b(n.schedule,new Date).toISOString()),await this.writeSchedules(t),this.log(`Set enabled=${s}: ${e}`)})}async getEnabledSchedules(){return(await this.loadSchedules()).filter(s=>s.enabled)}async getSchedulesByWorkflow(e){return(await this.loadSchedules()).filter(t=>t.workflowId===e)}async clearAll(){await this.initialize(),await this.withFileLock(async()=>{await this.writeSchedules([]),this.log("Cleared all schedules")})}async getStats(){let e=await this.loadSchedules(),s=new Date;return{total:e.length,enabled:e.filter(t=>t.enabled).length,disabled:e.filter(t=>!t.enabled).length,due:e.filter(t=>t.enabled&&new Date(t.nextRun)<=s).length}}async loadSchedulesUnsafe(){if(!u.existsSync(this.schedulesPath))return[];try{let e=u.readFileSync(this.schedulesPath,"utf-8");return this.parseSchedulesFile(e).schedules}catch{return[]}}parseSchedulesFile(e){let s=Buffer.byteLength(e,"utf-8");if(s>Y)throw new Error(`Schedules file exceeds maximum allowed size (${Y/(1024*1024)}MB). File is ${(s/(1024*1024)).toFixed(2)}MB.`);let t=F(e);if(!t.schedules||!Array.isArray(t.schedules))throw new Error("Invalid schedules file: missing schedules array");for(let n of t.schedules){if(!n.id||!n.workflowId||!Object.prototype.hasOwnProperty.call(n,"schedule"))throw new Error("Invalid schedule entry: missing required fields");typeof n.schedule!="string"||!D(n.schedule)?(n.disabledReason=`Invalid cron expression: ${n.schedule}`,n.enabled&&console.warn(`[PersistentScheduler] Disabled schedule ${n.id}: ${n.disabledReason}`),n.enabled=!1):delete n.disabledReason}return t}async writeSchedules(e){let s={version:se,updatedAt:new Date().toISOString(),schedules:e},t=JSON.stringify(s,null,2);u.writeFileSync(this.schedulesPath,t,"utf-8"),this.log(`Wrote ${e.length} schedules to disk`)}async handleCorruptFile(e){let s=R(e);this.log(`Corrupt schedules file detected: ${s}`);let t=`${this.schedulesPath}.corrupt.${Date.now()}`;try{u.existsSync(this.schedulesPath)&&(u.copyFileSync(this.schedulesPath,t),this.log(`Backed up corrupt file to: ${t}`))}catch(n){this.log(`Failed to backup corrupt file: ${n}`)}try{u.existsSync(this.schedulesPath)&&(u.unlinkSync(this.schedulesPath),this.log("Removed corrupt schedules file"))}catch(n){this.log(`Failed to remove corrupt file: ${n}`)}}async withFileLock(e){await this.acquireLock();try{return await e()}finally{this.releaseLock()}}async acquireLock(){let e=Date.now();for(;u.existsSync(this.lockFile);){try{let s=u.statSync(this.lockFile);if(Date.now()-s.mtimeMs>N){u.unlinkSync(this.lockFile),this.log("Removed stale lock file");break}}catch{break}if(Date.now()-e>N)throw new Error("Timeout waiting for scheduler lock");await this.sleep(re)}try{u.writeFileSync(this.lockFile,`${process.pid}:${Date.now()}`,{flag:"wx"})}catch(s){if(s.code==="EEXIST")return this.acquireLock();throw s}}releaseLock(){try{u.existsSync(this.lockFile)&&u.unlinkSync(this.lockFile)}catch(e){console.debug("[PersistentScheduler] Lock release error:",e instanceof Error?e.message:e)}}sleep(e){return new Promise(s=>setTimeout(s,e))}log(e){this.debug&&console.log(`[PersistentScheduler] ${e}`)}};function oe(i={}){return new $(i)}function z(){let i=Date.now().toString(36),e=te().slice(0,8);return`sched-${i}-${e}`}function ae(i){let e=new Date;return{id:z(),workflowId:i.workflowId,pipelinePath:i.pipelinePath,schedule:i.schedule,scheduleDescription:i.scheduleDescription,nextRun:b(i.schedule,e).toISOString(),enabled:i.enabled??!0,createdAt:e.toISOString()}}export{le as a,ue as b,he as c,$ as d,oe as e,z as f,ae as g};
@@ -1,2 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import r from"chalk";function s(e){switch(e){case"healthy":case"completed":return r.green(e);case"idle":return r.cyan(e);case"degraded":case"running":return r.yellow(e);case"unhealthy":case"failed":return r.red(e);default:return r.gray(e)}}function a(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`}function l(e){let t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),o=Math.floor(e%6e4/1e3);return`${t}h ${n}m ${o}s`}export{s as a,a as b,l as c};
@@ -1,4 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import*as a from"fs";import*as m from"path";import{createRequire as z}from"node:module";var B=z(import.meta.url),b=B("semver"),L="3.15.5",y=t=>typeof t=="string"&&b.valid(t)===t.split("+")[0],E=t=>b.validRange(t)!==null,x=(t,e)=>b.satisfies(t,e),C=(t,e)=>b.compare(t,e),N=(t,e)=>C(e,t)||t.localeCompare(e);var R=class{cacheDir;keepVersions;constructor(e={}){this.cacheDir=e.cacheDir??m.join(process.cwd(),".agentic-qe","plugins"),this.keepVersions=e.keepVersions??2}has(e,n){let s=this.versionDir(e,n);return a.existsSync(s)&&a.existsSync(m.join(s,"qe-plugin.json"))}get(e,n){if(!this.has(e,n))return;let s=this.versionDir(e,n),i=a.readFileSync(m.join(s,"qe-plugin.json"),"utf-8"),r=JSON.parse(i),l=a.statSync(s);return{manifest:r,path:s,cachedAt:l.birthtime.toISOString()}}store(e,n){let s=this.versionDir(e.name,e.version);if(a.existsSync(s))return s;a.mkdirSync(s,{recursive:!0});try{this.copyDir(n,s),a.writeFileSync(m.join(s,"qe-plugin.json"),JSON.stringify(e,null,2))}catch(i){throw a.rmSync(s,{recursive:!0,force:!0}),i}return this.pruneOldVersions(e.name),s}remove(e,n){let s=this.versionDir(e,n);return a.existsSync(s)?(a.rmSync(s,{recursive:!0,force:!0}),!0):!1}listVersions(e){let n=m.join(this.cacheDir,e);if(!a.existsSync(n))return[];let s=[],i=a.readdirSync(n);for(let r of i){let l=m.join(n,r),d=m.join(l,"qe-plugin.json");if(a.existsSync(d))try{let p=a.readFileSync(d,"utf-8"),v=JSON.parse(p);if(!y(v.version)){console.warn(`[PluginCache] Skipping cached plugin ${e}@${r}: invalid version ${JSON.stringify(v.version)}`);continue}let c=a.statSync(l);s.push({manifest:v,path:l,cachedAt:c.birthtime.toISOString()})}catch{}}return s}listAll(){if(!a.existsSync(this.cacheDir))return[];let e=[],n=a.readdirSync(this.cacheDir);for(let s of n){let i=this.listVersions(s);i.length>0&&(i.sort((r,l)=>N(r.manifest.version,l.manifest.version)),e.push(i[0]))}return e}listCandidates(){return a.existsSync(this.cacheDir)?a.readdirSync(this.cacheDir).flatMap(e=>this.listVersions(e)):[]}versionDir(e,n){return m.join(this.cacheDir,e,n)}pruneOldVersions(e){let n=this.listVersions(e);if(n.length<=this.keepVersions)return;n.sort((i,r)=>i.cachedAt.localeCompare(r.cachedAt));let s=n.slice(0,n.length-this.keepVersions);for(let i of s)a.rmSync(i.path,{recursive:!0,force:!0})}copyDir(e,n){if(!a.existsSync(e))return;let s=a.readdirSync(e,{withFileTypes:!0});for(let i of s){let r=m.join(e,i.name),l=m.join(n,i.name);if(i.isDirectory()){if(i.name===".git"||i.name==="node_modules")continue;a.mkdirSync(l,{recursive:!0}),this.copyDir(r,l)}else a.copyFileSync(r,l)}}};var K=/^[a-z][a-z0-9-]*$/,Z=["aqe-core-","agentic-qe-core-"],F=64,G=500;function k(t){let e=[],n=[];if(!t||typeof t!="object")return{valid:!1,errors:["Manifest must be a non-null object"],warnings:[]};let s=t;if(!s.name||typeof s.name!="string"?e.push("name is required and must be a string"):ee(s.name,e,n),!s.version||typeof s.version!="string"?e.push("version is required and must be a string"):y(s.version)||e.push(`version "${s.version}" is not valid semver (expected: major.minor.patch)`),!s.description||typeof s.description!="string"?e.push("description is required and must be a string"):s.description.length>G&&n.push(`description exceeds ${G} characters`),(!s.author||typeof s.author!="string")&&e.push("author is required and must be a string"),!Array.isArray(s.domains)||s.domains.length===0)e.push("domains is required and must be a non-empty array");else for(let i of s.domains)if(typeof i!="string"){e.push("Each domain must be a string");break}if(!s.entryPoint||typeof s.entryPoint!="string"?e.push("entryPoint is required and must be a string"):se(s.entryPoint,e),s.dependencies!==void 0)if(typeof s.dependencies!="object"||s.dependencies===null||Array.isArray(s.dependencies))e.push("dependencies must be an object mapping plugin names to semver ranges");else for(let[i,r]of Object.entries(s.dependencies))typeof r!="string"?e.push(`Dependency "${i}" must have a string version range`):E(r)||e.push(`Dependency "${i}" has an invalid semver range`);if(s.hooks!==void 0)if(typeof s.hooks!="object"||s.hooks===null||Array.isArray(s.hooks))e.push("hooks must be an object mapping event names to handler paths");else for(let[,i]of Object.entries(s.hooks)){if(typeof i!="string"){e.push("Hook handler paths must be strings");break}i.includes("..")&&e.push(`Hook handler path "${i}" must not contain ".." (path traversal)`)}if(s.minAqeVersion!==void 0&&(typeof s.minAqeVersion!="string"||!y(s.minAqeVersion))&&e.push("minAqeVersion must be valid semver"),s.permissions!==void 0){if(!Array.isArray(s.permissions))e.push("permissions must be an array of strings");else for(let i of s.permissions)if(typeof i!="string"){e.push("Each permission must be a string");break}}return{valid:e.length===0,errors:e,warnings:n}}function T(t){let e=typeof t=="string"?JSON.parse(t):t,n=k(e);if(!n.valid)throw new Error(`Invalid plugin manifest:
3
- - ${n.errors.join(`
4
- - `)}`);return e}function ee(t,e,n){t.length>F&&e.push(`name must be ${F} characters or fewer`),K.test(t)||e.push("name must be lowercase alphanumeric with hyphens, starting with a letter"),/[^\x00-\x7F]/.test(t)&&e.push("name must contain only ASCII characters");for(let s of Z)t.startsWith(s)&&e.push(`name cannot start with reserved prefix "${s}"`);["plugin","test","tool"].includes(t)&&n.push(`name "${t}" is very generic \u2014 consider a more descriptive name`)}function se(t,e){t.includes("..")&&e.push('entryPoint must not contain ".." (path traversal)'),(t.startsWith("/")||t.startsWith("\\"))&&e.push("entryPoint must be a relative path"),!t.endsWith(".js")&&!t.endsWith(".ts")&&!t.endsWith(".mjs")&&e.push("entryPoint must end in .js, .ts, or .mjs")}var I=class{constructor(e=L){this.aqeVersion=e}aqeVersion;resolve(e,n){let s=new Map,i=new Map;for(let o of e){let u=s.get(o.name)??[];s.set(o.name,u);let f=this.validateVersions(o);f?i.set(o.name,[...i.get(o.name)??[],f]):u.push(o)}for(let o of s.values())o.sort((u,f)=>N(u.version,f.version));let r=new Map,l=[],d=o=>({ordered:o.map((u,f)=>({manifest:u,order:f})),missing:r,errors:l,selectedVersions:Object.fromEntries(o.map(u=>[u.name,u.version])),aqeVersion:this.aqeVersion}),p=[...n??s.keys()].sort(),v=new Set(p),c=new Map,_=0,h=!1,J=()=>{for(let o of c.values())for(let[u,f]of Object.entries(o.dependencies??{})){let g=c.get(u);if(!(g?[g]:s.get(u)??[]).some(M=>x(M.version,f)))return!1}return!0},w,X=()=>{let o=new Set,u=new Set,f=(g,P)=>{if(u.has(g))return[...P.slice(P.indexOf(g)),g];if(!o.has(g)){u.add(g);for(let M of Object.keys(c.get(g)?.dependencies??{})){let Q=f(M,[...P,g]);if(Q)return Q}u.delete(g),o.add(g)}};for(let g of c.keys()){let P=f(g,[]);if(P)return P}},j=()=>{let o=new Set(p);for(let f of c.values())for(let g of Object.keys(f.dependencies??{}))o.add(g);let u=[...o].sort().find(f=>!c.has(f));if(!u){let f=X();return f?(w=f,!1):!0}v.add(u);for(let f of s.get(u)??[]){if(++_>1e4)return h=!0,!1;if(c.set(u,f),J()&&j())return!0;if(c.delete(u),h)return!1}return!1};if(!j()){if(w&&!h)throw new Error(`Dependency cycle detected: ${w.join(" -> ")}`);for(let o of v)s.get(o)?.length||l.push(...i.get(o)??[]);for(let[o,u]of s){let f=[...new Set(u.flatMap(g=>Object.keys(g.dependencies??{})))].filter(g=>!s.has(g));f.length&&r.set(o,f)}return l.push({code:h?"RESOLUTION_LIMIT":r.size?"MISSING_DEPENDENCY":"UNSATISFIED_DEPENDENCY_RANGE",plugin:p.join(", "),message:h?"Plugin dependency search exceeded 10000 candidates":"No cached plugin selection satisfies all dependency ranges"}),d([])}let O=[],q=new Set,A=new Set,$=(o,u)=>{if(q.has(o))return;if(A.has(o))throw new Error(`Dependency cycle detected: ${[...u.slice(u.indexOf(o)),o].join(" -> ")}`);A.add(o);let f=c.get(o);for(let g of Object.keys(f.dependencies??{}))$(g,[...u,o]);A.delete(o),q.add(o),O.push(f)};for(let o of[...c.keys()].sort())$(o,[]);return d(O)}resolveAvailable(e){let n=[],s=this.resolve(e,[]),i=[],r=new Map;for(let l of[...new Set(e.map(d=>d.name))].sort())try{let d=this.resolve(e,[...n,l]);if(d.errors.length){i.push(...d.errors.map(p=>({...p,plugin:l})));for(let[p,v]of d.missing)r.set(p,v);continue}n.push(l),s=d}catch(d){i.push({code:"DEPENDENCY_CYCLE",plugin:l,message:d instanceof Error?d.message:String(d)})}return{...s,errors:i,missing:r}}canLoad(e,n){let s=Object.entries(e.dependencies??{}).filter(([i,r])=>{let l=n instanceof Set?void 0:n.get(i);return!l||!E(r)||!x(l,r)}).map(([i])=>i);return{canLoad:!this.validateVersions(e)&&s.length===0,missingDeps:s}}validateVersions(e){if(!y(e.version))return{code:"INVALID_PLUGIN_VERSION",plugin:e.name,message:"Invalid plugin version"};for(let n of Object.values(e.dependencies??{}))if(!E(n))return{code:"INVALID_DEPENDENCY_RANGE",plugin:e.name,message:"Invalid dependency range"};if(e.minAqeVersion&&(!y(e.minAqeVersion)||!y(this.aqeVersion)||C(this.aqeVersion,e.minAqeVersion)<0))return{code:"AQE_VERSION_INCOMPATIBLE",plugin:e.name,message:`Requires AQE ${e.minAqeVersion}; running ${this.aqeVersion}`}}};var ne=["aqe-core-","agentic-qe-core-","agentic-qe-internal-"],U=new Set(["aqe","agentic-qe","ruflo","claude-flow"]),te=["..","~","/etc/","/proc/","/dev/","node_modules/"];function Y(t){let e=[];return ie(t.name,e),re(t.entryPoint,e),oe(t.hooks,e),ae(t.permissions,e),{safe:e.length===0,violations:e}}function ie(t,e){/[^\x20-\x7E]/.test(t)&&e.push(`Plugin name "${t}" contains non-ASCII characters`),U.has(t.toLowerCase())&&e.push(`Plugin name "${t}" is a reserved name`);for(let s of ne)t.toLowerCase().startsWith(s)&&e.push(`Plugin name "${t}" uses reserved prefix "${s}"`);let n=t.toLowerCase().replace(/[0o]/g,"o").replace(/[1il]/g,"l").replace(/[-_]/g,"");U.has(n)&&e.push(`Plugin name "${t}" is visually similar to a reserved name`)}function re(t,e){W(t,"entryPoint",e),(t.startsWith("/")||t.startsWith("\\"))&&e.push("entryPoint must be a relative path, not absolute")}function oe(t,e){if(t)for(let[n,s]of Object.entries(t))W(s,`hook[${n}]`,e)}function W(t,e,n){for(let s of te)t.includes(s)&&n.push(`${e} contains dangerous path pattern "${s}"`);t.includes("\0")&&n.push(`${e} contains null byte (path injection attempt)`)}function ae(t,e){if(!t)return;let n=["fs:write-root","net:arbitrary","exec:shell"];for(let s of t)n.includes(s)&&e.push(`Plugin requests dangerous permission: ${s}`)}import*as S from"fs";import*as V from"path";var D=class{type="local";async resolve(e){let n=V.resolve(e),s=V.join(n,"qe-plugin.json");if(!S.existsSync(s))throw new Error(`No qe-plugin.json found at ${s}`);let i=S.readFileSync(s,"utf-8");return T(i)}async getPluginPath(e){let n=V.resolve(e);if(!S.existsSync(n))throw new Error(`Plugin directory does not exist: ${n}`);return n}};var H=class{cache;resolver;sources=new Map;constructor(e={}){this.cache=e.cache??new R,this.resolver=new I;let n=new D;if(this.sources.set("local",n),e.sources)for(let s of e.sources)this.sources.set(s.type,s)}async install(e,n="local"){if(process.env.AQE_PLUGINS_DISABLED==="true")return{success:!1,errors:["Plugin loading is disabled (AQE_PLUGINS_DISABLED=true)"],securityViolations:[]};let s=[],i=this.sources.get(n);if(!i)return{success:!1,errors:[`Unknown source type: ${n}. Available: ${[...this.sources.keys()].join(", ")}`],securityViolations:[]};let r;try{r=await i.resolve(e)}catch(c){return{success:!1,errors:[`Failed to resolve plugin: ${c instanceof Error?c.message:String(c)}`],securityViolations:[]}}let l=k(r);if(!l.valid)return{success:!1,manifest:r,errors:l.errors,securityViolations:[]};let d=Y(r);if(!d.safe)return{success:!1,manifest:r,errors:["Plugin failed security checks"],securityViolations:d.violations};try{let c=this.cache.listCandidates().map(h=>h.manifest).filter(h=>h.name!==r.name),_=this.resolver.resolve([...c,r],[r.name]);if(_.errors.length)return{success:!1,manifest:r,errors:_.errors.map(h=>`${h.code}: ${h.message}`),securityViolations:[]}}catch(c){return{success:!1,manifest:r,errors:[c instanceof Error?c.message:String(c)],securityViolations:[]}}if(this.cache.has(r.name,r.version)){let c=this.cache.get(r.name,r.version);return{success:!0,manifest:r,cachePath:c.path,errors:[],securityViolations:[]}}let p;try{p=await i.getPluginPath(e)}catch(c){return{success:!1,manifest:r,errors:[`Failed to get plugin path: ${c instanceof Error?c.message:String(c)}`],securityViolations:[]}}let v=this.cache.store(r,p);return{success:!0,manifest:r,cachePath:v,errors:s,securityViolations:[]}}remove(e,n){if(n)return this.cache.remove(e,n);let s=this.cache.listVersions(e),i=!1;for(let r of s)this.cache.remove(e,r.manifest.version)&&(i=!0);return i}list(){return this.cache.listAll().map(n=>({name:n.manifest.name,version:n.manifest.version,description:n.manifest.description,domains:n.manifest.domains,source:"cached",cachePath:n.path}))}resolveLoadOrder(){let e=this.cache.listCandidates();return this.resolver.resolveAvailable(e.map(n=>n.manifest))}registerSource(e){this.sources.set(e.type,e)}};export{T as a,R as b,H as c};
@@ -1,7 +0,0 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.5");process.exit(0)}
2
- import{b as X,d as ue}from"./chunk-RUSLEOMC.js";import*as T from"fs";import*as le from"os";import*as d from"path";ue();import*as A from"fs/promises";import*as F from"path";async function Z(s){let t=[F.join(s,"coverage","coverage-final.json"),F.join(s,"coverage","lcov.info"),F.join(s,".nyc_output","coverage-final.json"),F.join(s,"coverage-final.json"),F.join(s,"coverage","coverage-summary.json"),F.join(s,"coverage.xml"),F.join(s,"htmlcov","status.json"),F.join(s,"cobertura-coverage.xml")];for(let e of t)try{let n=await A.readFile(e,"utf-8");if(e.endsWith("coverage-summary.json"))return K(n);if(e.endsWith(".json"))return G(n);if(e.endsWith(".info"))return z(n);if(e.endsWith(".xml"))return V(n)}catch{}return null}function G(s){let t=X(s),e=[],n=0,a=0,r=0,o=0,i=0,c=0,f=0,l=0;for(let[p,b]of Object.entries(t)){let C=b,m=C.statementMap||{},R=C.s||{},w=C.branchMap||{},N=C.b||{},u=C.f||{},S=Object.keys(R).length,x=Object.values(R).filter(v=>v>0).length,y=Object.values(N).flat().length,L=Object.values(N).flat().filter(v=>v>0).length,j=Object.keys(u).length,_=Object.values(u).filter(v=>v>0).length,k=Object.keys(m).length,I=Object.values(R).filter(v=>v>0).length,O=[];for(let[v,D]of Object.entries(R))if(D===0){let M=m[v];M?.start?.line&&O.push(M.start.line)}let B=[];for(let[v,D]of Object.entries(N)){let M=w[v];D.forEach((P,E)=>{P===0&&M?.locations?.[E]?.start?.line&&B.push(M.locations[E].start.line)})}e.push({path:p,lines:{covered:x,total:S},branches:{covered:L,total:y},functions:{covered:_,total:j},statements:{covered:I,total:k},uncoveredLines:Array.from(new Set(O)).sort((v,D)=>v-D),uncoveredBranches:Array.from(new Set(B)).sort((v,D)=>v-D)}),n+=S,a+=x,r+=y,o+=L,i+=j,c+=_,f+=k,l+=I}return{files:e,summary:{line:n>0?a/n*100:0,branch:r>0?o/r*100:0,function:i>0?c/i*100:0,statement:f>0?l/f*100:0,files:e.length}}}function K(s){let t=X(s),e=o=>({covered:Number(o?.covered)||0,total:Number(o?.total)||0}),n=[];for(let[o,i]of Object.entries(t))o==="total"||typeof i!="object"||i===null||!i.lines||n.push({path:o,lines:e(i.lines),branches:e(i.branches),functions:e(i.functions),statements:e(i.statements??i.lines),uncoveredLines:[],uncoveredBranches:[]});let a=o=>n.reduce((i,c)=>({covered:i.covered+o(c).covered,total:i.total+o(c).total}),{covered:0,total:0}),r=o=>o.total>0?o.covered/o.total*100:0;return{files:n,summary:{line:r(a(o=>o.lines)),branch:r(a(o=>o.branches)),function:r(a(o=>o.functions)),statement:r(a(o=>o.statements)),files:n.length}}}function z(s){let t=[],e=s.split(`
3
- `),n=null,a=0,r=0,o=0,i=0,c=0,f=0,l=[],p=[];for(let u of e)if(u.startsWith("SF:"))n=u.slice(3);else if(u.startsWith("LF:"))a=parseInt(u.slice(3),10);else if(u.startsWith("LH:"))r=parseInt(u.slice(3),10);else if(u.startsWith("BRF:"))o=parseInt(u.slice(4),10);else if(u.startsWith("BRH:"))i=parseInt(u.slice(4),10);else if(u.startsWith("FNF:"))c=parseInt(u.slice(4),10);else if(u.startsWith("FNH:"))f=parseInt(u.slice(4),10);else if(u.startsWith("DA:")){let[S,x]=u.slice(3).split(",").map(y=>parseInt(y,10));x===0&&l.push(S)}else if(u.startsWith("BRDA:")){let S=u.slice(5).split(","),x=parseInt(S[0],10),y=S[3];(y==="0"||y==="-")&&p.push(x)}else u==="end_of_record"&&n&&(t.push({path:n,lines:{covered:r,total:a},branches:{covered:i,total:o},functions:{covered:f,total:c},statements:{covered:r,total:a},uncoveredLines:Array.from(new Set(l)),uncoveredBranches:Array.from(new Set(p))}),n=null,a=r=0,o=i=0,c=f=0,l.length=0,p.length=0);let b=0,C=0,m=0,R=0,w=0,N=0;for(let u of t)b+=u.lines.total,C+=u.lines.covered,m+=u.branches.total,R+=u.branches.covered,w+=u.functions.total,N+=u.functions.covered;return{files:t,summary:{line:b>0?C/b*100:0,branch:m>0?R/m*100:0,function:w>0?N/w*100:0,statement:b>0?C/b*100:0,files:t.length}}}function V(s){let t=[];function e(m,R){let w=m.match(new RegExp(`${R}=["']([^"']*)["']`));return w?w[1]:null}let n=/<class\s[^>]*?>/g,a;for(;(a=n.exec(s))!==null;){let m=a[0],R=e(m,"filename");if(!R)continue;let w=parseFloat(e(m,"line-rate")||"NaN"),N=parseFloat(e(m,"branch-rate")||"NaN"),u=a.index,S=s.indexOf("</class>",u),x=S>u?s.slice(u,S):"",y=0,L=0,j=0,_=0,k=0,I=0,O=[],B=[],v=/<line\s([^>]*?)\/>/g,D;for(;(D=v.exec(x))!==null;){let E=D[1],W=parseInt(e(E,"number")||"0",10),U=parseInt(e(E,"hits")||"0",10),H=e(E,"branch")==="true",$=e(E,"condition-coverage");y++,U>0?L++:O.push(W),H&&(j++,($?parseInt($,10):U>0?100:0)===100?_++:B.push(W))}let M=/<method\s([^>]*?)>/g,P;for(;(P=M.exec(x))!==null;){k++;let E=P.index,W=x.indexOf("</method>",E);if(W>E){let U=x.slice(E,W),H=/<line\s([^>]*?)\/>/g,$=!1,q;for(;(q=H.exec(U))!==null;)if(parseInt(e(q[1],"hits")||"0",10)>0){$=!0;break}$&&I++}}y===0&&!isNaN(w)&&(y=100,L=Math.round(Math.max(0,Math.min(1,w))*100)),t.push({path:R,lines:{covered:L,total:y},branches:{covered:_,total:j},functions:{covered:I,total:k},statements:{covered:L,total:y},uncoveredLines:O,uncoveredBranches:B})}let r=0,o=0,i=0,c=0,f=0,l=0;for(let m of t)r+=m.lines.total,o+=m.lines.covered,i+=m.branches.total,c+=m.branches.covered,f+=m.functions.total,l+=m.functions.covered;let p=s.match(/<coverage\s[^>]*?>/),b=p?parseFloat(e(p[0],"line-rate")||"NaN")*100:NaN,C=p?parseFloat(e(p[0],"branch-rate")||"NaN")*100:NaN;return{files:t,summary:{line:isNaN(b)?r>0?o/r*100:0:b,branch:isNaN(C)?i>0?c/i*100:0:C,function:f>0?l/f*100:0,statement:r>0?o/r*100:0,files:t.length}}}async function Ne(s,t={}){let e=[],{includeTests:n=!0,languages:a,maxFiles:r=5e3}=t,o=[".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".pyw",".go",".rs",".java",".kt",".kts",".rb",".cs",".php",".swift",".c",".h",".cpp",".hpp",".cc",".scala"];if(a&&a.length>0){o=[];for(let c of a)c==="typescript"&&o.push(".ts",".tsx"),c==="javascript"&&o.push(".js",".jsx",".mjs",".cjs"),c==="python"&&o.push(".py",".pyw"),c==="go"&&o.push(".go"),c==="rust"&&o.push(".rs"),c==="java"&&o.push(".java"),c==="kotlin"&&o.push(".kt",".kts"),c==="ruby"&&o.push(".rb"),(c==="csharp"||c==="c#")&&o.push(".cs"),c==="php"&&o.push(".php"),c==="swift"&&o.push(".swift"),(c==="c"||c==="cpp"||c==="c++")&&o.push(".c",".h",".cpp",".hpp",".cc"),c==="scala"&&o.push(".scala")}async function i(c){try{let f=await A.readdir(c,{withFileTypes:!0});for(let l of f){let p=F.join(c,l.name);if(l.isDirectory()){if(["node_modules",".git","dist","build","coverage",".nyc_output","__pycache__",".venv","venv",".tox",".mypy_cache","target",".gradle","vendor",".bundle",".agentic-qe",".claude",".cache",".npm",".yarn",".next",".nuxt",".svelte-kit","out",".turbo","tmp","temp",".tmp"].includes(l.name))continue;if(e.length>=r)return;await i(p)}else if(l.isFile()){let b=F.extname(l.name);if(!o.includes(b)||!n&&(l.name.includes(".test.")||l.name.includes(".spec.")||l.name.endsWith("_test.ts")||l.name.endsWith("_test.js")||p.includes("/__tests__/")||p.includes("/test/")||p.includes("/tests/")))continue;if(e.length>=r)return;e.push(p)}}}catch{}}try{if((await A.stat(s)).isFile())return[s];await i(s)}catch{}return e}function Le(s){let t=new Set,e={injection:"Use parameterized queries and input validation to prevent injection attacks",xss:"Sanitize user input and use Content-Security-Policy headers","sensitive-data":"Never hardcode secrets; use environment variables or secret managers","access-control":"Implement proper authentication and authorization checks","security-misconfiguration":"Review and harden security configurations","insecure-deserialization":"Avoid deserializing untrusted data; use safe alternatives","broken-auth":"Use strong authentication mechanisms and secure session management",dependencies:"Keep dependencies updated and regularly audit for vulnerabilities"};for(let r of s){let o=e[r.category];o&&t.add(o)}let n=s.some(r=>r.severity==="critical"),a=s.some(r=>r.severity==="high");return n&&t.add("CRITICAL: Address critical vulnerabilities immediately before deployment"),a&&t.add("Prioritize fixing high-severity issues in the next sprint"),t.size===0&&s.length===0&&t.add("No vulnerabilities found - maintain current security practices"),Array.from(t)}import*as g from"fs";import*as te from"os";import*as h from"path";function fe(s=process.env){let t=(s.AQE_COVERAGE_NO_EXEC??"").trim().toLowerCase();return t?t!=="false"&&t!=="0"&&t!=="no"&&t!=="off":!1}var he=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java",".rb"]),ne=new Set(["node_modules","dist","build","coverage",".git",".claude",".agentic-qe","__pycache__",".venv","target","vendor"]),se=new Set(["tests","test","__tests__","benches","examples","spec"]),pe=[/\.test\./i,/\.spec\./i,/_test\./i,/_spec\./i,/^test_/i,/^test\./i,/^conftest\./i];function J(s,t){let e=s.split(h.sep).join("/"),n=h.basename(e);if(pe.some(r=>r.test(n)))return!0;let a=e;if(t){let r=h.resolve(t).split(h.sep).join("/"),o=h.resolve(s).split(h.sep).join("/");(o===r||o.startsWith(`${r}/`))&&(a=o.slice(r.length).replace(/^\//,""))}return a.split("/").some(r=>se.has(r))}function de(s){let t=s.split(""),e=s.length,n=0,a=(r,o)=>{for(let i=r;i<o&&i<e;i++)s[i]!==`
4
- `&&(t[i]=" ")};for(;n<e;){let r=s[n];if(r==="/"&&s[n+1]==="/"){let i=s.indexOf(`
5
- `,n),c=i===-1?e:i;a(n,c),n=c;continue}if(r==="/"&&s[n+1]==="*"){let i=0,c=n;for(;n<e;){if(s[n]==="/"&&s[n+1]==="*"){i++,n+=2;continue}if(s[n]==="*"&&s[n+1]==="/"){if(i--,n+=2,i===0)break;continue}n++}a(c,n);continue}let o=/^b?r(#*)"/.exec(s.slice(n,n+300));if(o){let i=`"${o[1]}`,c=n+o[0].length,f=s.indexOf(i,c),l=f===-1?e:f+i.length;a(n,l),n=l;continue}if(r==='"'){let i=n;for(n++;n<e;){if(s[n]==="\\"){n+=2;continue}if(s[n]==='"'){n++;break}n++}a(i,n);continue}if(r==="'"){let i=-1;if(s[n+1]==="\\"){let c=s.indexOf("'",n+2);c!==-1&&c<=n+5&&(i=c+1)}else s[n+2]==="'"&&(i=n+3);if(i!==-1){a(n,i),n=i;continue}}n++}return t.join("")}function me(s,t){if(t!==".rs")return[];let e=de(s).split(`
6
- `),n=[];for(let a=0;a<e.length;a++){if(!/#\s*\[\s*cfg\s*\(\s*test\s*\)\s*\]/.test(e[a]))continue;let r=-1;for(let c=a;c<Math.min(e.length,a+10);c++){let f=e[c],l=f.indexOf("{"),p=f.indexOf(";");if(p!==-1&&(l===-1||p<l))break;if(l!==-1){let b=e.slice(a,c+1).join(" ");/\bmod\s+\w+/.test(b)&&(r=c);break}}if(r===-1)continue;let o=0,i=-1;for(let c=r;c<e.length;c++){for(let f of e[c])f==="{"?o++:f==="}"&&o--;if(o<=0){i=c;break}}n.push([a+1,(i===-1?e.length-1:i)+1]),a=i===-1?e.length:i}return n}function ge(s){if(s.length===0)return 0;let t=s.split(`
7
- `);return t[t.length-1]===""&&t.pop(),t.length}function re(s,t=6){let e=h.resolve(s);try{if(!g.existsSync(e))return null;g.statSync(e).isDirectory()||(e=h.dirname(e))}catch{return null}for(let n=0;n<=t;n++){if(g.existsSync(h.join(e,"Cargo.toml")))return g.realpathSync(e);let a=h.dirname(e);if(a===e)break;e=a}return null}function oe(s,t=0){if(t>4)return!1;let e;try{e=g.readdirSync(s,{withFileTypes:!0})}catch{return!1}for(let n of e)if(n.isFile()&&h.extname(n.name)===".rs")return!0;for(let n of e)if(n.isDirectory()&&!ne.has(n.name)&&oe(h.join(s,n.name),t+1))return!0;return!1}function Me(s){let t=re(s);if(t===null)return!1;let e=h.resolve(s);return e===t||oe(e)}async function Ae(s,t={}){if(fe())return null;let{execSync:e}=await import("child_process"),n=t.timeoutMs??3e5,a=re(s);if(!a)return null;try{e("cargo llvm-cov --version",{cwd:a,timeout:3e4,stdio:["pipe","pipe","pipe"]})}catch{return null}let r=h.join(g.mkdtempSync(h.join(te.tmpdir(),"aqe-rust-cov-")),"lcov.info");try{if(e(`cargo llvm-cov --lcov --output-path ${JSON.stringify(r)}`,{cwd:a,timeout:n,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),!g.existsSync(r))return null;let i=z(g.readFileSync(r,"utf-8")).files.filter(l=>!J(l.path,a));if(i.length===0)return null;let c=ae(i),f=i.some(l=>l.branches.total>0);return{data:c,provenance:{method:"cargo-llvm-cov",estimated:!1,branchDataCollected:f,functionDataCollected:i.some(l=>l.functions.total>0),notes:f?[]:["cargo-llvm-cov reported no branch data (Rust branch coverage requires a nightly toolchain with -Z coverage-options=branch). Branch coverage is reported as null rather than assumed."]}}}catch{return null}finally{try{g.rmSync(h.dirname(r),{recursive:!0,force:!0})}catch{}}}var Y={".rs":{fn:/\bfn\s+\w+/g,branch:/\b(if|match|while|for)\b|\?\?|\|\||&&/g},".go":{fn:/\bfunc\s+\w*/g,branch:/\b(if|switch|case|for|select)\b|\|\||&&/g},".py":{fn:/\b(def|lambda)\b/g,branch:/\b(if|elif|for|while|except)\b|\band\b|\bor\b/g},".java":{fn:/\b(public|private|protected|static)[\w<>,\s[\]]+\w+\s*\(/g,branch:/\b(if|switch|case|for|while|catch)\b|\|\||&&/g},".rb":{fn:/\bdef\s+\w+/g,branch:/\b(if|elsif|unless|case|when|while)\b|\|\||&&/g},default:{fn:/\bfunction\b|=>|\b\w+\s*\([^)]*\)\s*\{/g,branch:/\b(if|switch|case|for|while|catch)\b|\?\?|\|\||&&/g}};function ve(s){return Y[s]??Y.default}function ee(s,t){return(s.match(new RegExp(t.source,t.flags))||[]).length}function ae(s){let t=r=>s.reduce((o,i)=>o+r(i),0),e=(r,o)=>o>0?Math.round(r/o*100):0,n=t(r=>r.lines.total),a=t(r=>r.lines.covered);return{files:s,summary:{line:e(a,n),branch:e(t(r=>r.branches.covered),t(r=>r.branches.total)),function:e(t(r=>r.functions.covered),t(r=>r.functions.total)),statement:e(a,n),files:s.length}}}function be(s){let t=[],e=s;function n(a,r){if(r>6)return;let o;try{o=g.readdirSync(a,{withFileTypes:!0})}catch{return}for(let i of o){let c=h.join(a,i.name);if(i.isDirectory()){if(ne.has(i.name)||se.has(i.name))continue;n(c,r+1)}else if(i.isFile()){if(!he.has(h.extname(i.name))||J(c,e))continue;t.push(c)}}}return n(s,0),t}function Ie(s){if(!g.existsSync(s)||!g.statSync(s).isDirectory())return null;let t=be(s);if(t.length===0)return null;let e=t.map(n=>{let a="";try{a=g.readFileSync(n,"utf-8")}catch{}let r=h.extname(n),o=ge(a),i=me(a,r),c=j=>i.some(([_,k])=>j>=_&&j<=k),f=i.reduce((j,[_,k])=>j+(k-_+1),0),l=Math.max(o-f,0),p=ve(r),b=ee(a,p.fn),C=i.length>0,m=ye(n),R=C||m,w=ee(a,p.branch),N=Math.min(w*.005,.15),u=Math.min(l*1e-4,.1),S=Math.max(.05,Math.min(.95,R?.85-N-u:.2)),x=Math.floor(l*S),y=[];for(let j=1;j<=o;j++)c(j)||y.push(j);let L=y.slice(x);return{path:n,lines:{covered:x,total:l},branches:{covered:0,total:0},functions:{covered:0,total:b},statements:{covered:x,total:l},uncoveredLines:L,uncoveredBranches:[]}});return{data:ae(e),provenance:{method:"static-estimation",estimated:!0,branchDataCollected:!1,functionDataCollected:!1,notes:["No instrumentation ran. These numbers are a STATIC ESTIMATE derived from source shape (file size, declaration counts, presence of a test file) \u2014 they are not measured coverage and must not be reported as such.","Branch and function coverage were not collected and are reported as null."]}}}function ye(s){let t=h.extname(s),e=s.slice(0,-t.length);return[`${e}.test${t}`,`${e}.spec${t}`,`${e}_test${t}`,`${e}.test${t}`.replace("/src/","/tests/"),`${e}.spec${t}`.replace("/src/","/tests/"),`${e}${t}`.replace("/src/","/tests/")].some(a=>{try{return g.existsSync(a)}catch{return!1}})}var Ce=["package.json","pyproject.toml","setup.py","setup.cfg","go.mod","Cargo.toml","pom.xml","build.gradle","build.gradle.kts",".git"];function ie(s,t=12){let e;try{let r=d.resolve(s);if(!T.existsSync(r))return null;let o=T.realpathSync(r);e=T.statSync(o).isDirectory()?o:d.dirname(o)}catch{return null}let n=null;try{n=T.realpathSync(le.homedir())}catch{n=null}let a=e;for(let r=0;r<=t;r++){if(n!==null&&e===n&&e!==a)return null;if(Ce.some(i=>T.existsSync(d.join(e,i))))return e;let o=d.dirname(e);if(o===e)return null;e=o}return null}var xe=new Set(["lcov.info","coverage-final.json","coverage-summary.json","coverage.xml","cobertura-coverage.xml","cobertura.xml"]);function je(s){let t=d.basename(s).toLowerCase();return xe.has(t)||t.endsWith(".lcov")||t.endsWith(".lcov.info")}async function Re(s){let t;try{t=await T.promises.readFile(s,"utf-8")}catch{return null}if(t.trim().length===0)return null;try{let e=d.basename(s).toLowerCase(),n;if(e.endsWith(".json")){let a=JSON.parse(t);if(Se(a))n=K(t);else if(we(a))n=G(t);else return null}else e.endsWith(".xml")?n=V(t):n=z(t);return n.files.length>0?n:null}catch{return null}}function we(s){let t=Object.values(s);return t.length>0&&t.every(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.s=="object"&&typeof e.statementMap=="object")}function Se(s){let t=s.total;return typeof t=="object"&&t!==null&&typeof t.lines=="object"}function Fe(s,t){let e=d.relative(t,s);return e===""||!e.startsWith("..")&&!d.isAbsolute(e)}function Q(s){try{return T.realpathSync(s)}catch{return d.resolve(s)}}function Te(s,t,e){let n=Q(t),a=Q(e);return a===n?[...s.files]:s.files.filter(r=>{let o=d.isAbsolute(r.path)?Q(r.path):d.resolve(n,r.path);return Fe(o,a)})}function ce(s,t,e,n={}){if(n.numTotalTests===0)return{status:"no-data",reason:"no-tests-ran"};let a=Te(s,t,e);if(a.length===0)return{status:"no-data",reason:"target-not-covered"};let r=a.filter(o=>!J(o.path,t));return r.length===0?{status:"no-data",reason:"test-only-report"}:{status:"measured",files:r}}async function $e(s){let t=d.resolve(s),e;try{e=T.statSync(t)}catch{return{status:"target-missing",target:t}}if(e.isFile()&&je(t)){let r=d.dirname(t),o=ie(r)??(d.basename(r)==="coverage"?d.dirname(r):r),i=await Re(t),c=i?ce(i,o,o):{status:"no-data",reason:"unreadable-report"};return{status:"evaluated",target:t,projectRoot:o,source:"report-file",evaluation:c}}let n=ie(t)??(e.isDirectory()?t:d.dirname(t)),a=await Z(n);return a?{status:"evaluated",target:t,projectRoot:n,source:"project-report",evaluation:ce(a,n,t)}:{status:"no-report",target:t,projectRoot:n}}function ze(s,t,e){let n=[s.line,s.statement];e.branch&&n.push(s.branch),e.function&&n.push(s.function);let a=n.reduce((r,o)=>r+o,0)/n.length;return{overall:a,meetsThreshold:a>=t}}var Ee=/^Coverage is [\d.]+% below threshold/i;function Pe(s,t,e,n){let a=s.filter(r=>!Ee.test(r)&&(n.branch||!/branch coverage/i.test(r))&&(n.function||!/function coverage/i.test(r)));return t.meetsThreshold?a:[`Coverage is ${(e-t.overall).toFixed(1)}% below threshold. Focus on high-risk files first.`,...a]}function Ue(s){return s==="target-not-covered"||s==="no-tests-ran"}function Je(s,t,e){switch(s){case"target-missing":return`Target does not exist: ${t}`;case"unreadable-report":return`Unreadable coverage report: ${t}. It could not be parsed or lists no files. Supported: lcov.info, istanbul coverage-final.json / coverage-summary.json, Cobertura XML. Raw V8 output is not supported \u2014 convert it with c8 or your runner's istanbul reporter.`;case"test-only-report":return"The coverage report contains only test files, so there is no production coverage to report. Coverage OF a test file is not a meaningful metric. Check that your coverage tool is instrumenting your source directory.";case"target-not-covered":return`Target is UNMEASURED: the coverage data for project ${e??"?"} has no entry for any production file under ${t}. This is not 0% coverage \u2014 no measurement exists for it. Check your coverage tool's include/exclude settings, or regenerate the report.`;case"no-tests-ran":return`Target is UNMEASURED: the test runner reported running 0 tests from ${e??"?"}. This is not 0% coverage.`}}export{Ne as a,Le as b,fe as c,re as d,Me as e,Ae as f,Ie as g,ie as h,je as i,Re as j,Te as k,ce as l,$e as m,ze as n,Pe as o,Ue as p,Je as q};