agentic-qe 3.14.3 → 3.14.5

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 (786) hide show
  1. package/.claude/agents/v3/qe-coverage-specialist.md +1 -1
  2. package/.claude/agents/v3/qe-fleet-commander.md +1 -1
  3. package/.claude/agents/v3/qe-pentest-validator.md +1 -1
  4. package/.claude/agents/v3/qe-queen-coordinator.md +1 -1
  5. package/.claude/agents/v3/qe-risk-assessor.md +1 -1
  6. package/.claude/agents/v3/qe-root-cause-analyzer.md +1 -1
  7. package/.claude/agents/v3/qe-security-auditor.md +1 -1
  8. package/.claude/agents/v3/qe-test-architect.md +1 -1
  9. package/.claude/commands/aqe-costs.md +10 -10
  10. package/.claude/helpers/advisor-call.cjs +3 -3
  11. package/.claude/helpers/v3/advisor-call.cjs +3 -3
  12. package/.claude/skills/.validation/examples/chaos-engineering-output.example.json +1 -1
  13. package/.claude/skills/.validation/examples/performance-testing-output.example.json +1 -1
  14. package/.claude/skills/.validation/examples/security-testing-output.example.json +1 -1
  15. package/.claude/skills/.validation/examples/testability-scoring-output.example.json +1 -1
  16. package/.claude/skills/.validation/schemas/skill-eval.schema.json +4 -1
  17. package/.claude/skills/.validation/schemas/skill-frontmatter.schema.json +1 -1
  18. package/.claude/skills/.validation/schemas/skill-output.template.json +1 -1
  19. package/.claude/skills/.validation/templates/eval.template.yaml +1 -1
  20. package/.claude/skills/.validation/templates/security-testing-eval.template.yaml +1 -1
  21. package/.claude/skills/.validation/templates/skill-frontmatter.example.yaml +1 -1
  22. package/.claude/skills/.validation/test-data/sample-output.json +1 -1
  23. package/.claude/skills/a11y-ally/SKILL.md +1 -1
  24. package/.claude/skills/a11y-ally/evals/a11y-ally.yaml +1 -1
  25. package/.claude/skills/accessibility-testing/evals/accessibility-testing.yaml +1 -1
  26. package/.claude/skills/api-testing-patterns/evals/api-testing-patterns.yaml +1 -1
  27. package/.claude/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +1 -1
  28. package/.claude/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +1 -1
  29. package/.claude/skills/compatibility-testing/evals/compatibility-testing.yaml +1 -1
  30. package/.claude/skills/compliance-testing/evals/compliance-testing.yaml +1 -1
  31. package/.claude/skills/contract-testing/evals/contract-testing.yaml +1 -1
  32. package/.claude/skills/database-testing/evals/database-testing.yaml +1 -1
  33. package/.claude/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +1 -1
  34. package/.claude/skills/localization-testing/evals/localization-testing.yaml +1 -1
  35. package/.claude/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +1 -1
  36. package/.claude/skills/mobile-testing/evals/mobile-testing.yaml +1 -1
  37. package/.claude/skills/mutation-testing/evals/mutation-testing.yaml +1 -1
  38. package/.claude/skills/mutation-testing/test-data/sample-output.json +1 -1
  39. package/.claude/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +1 -1
  40. package/.claude/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +1 -1
  41. package/.claude/skills/n8n-security-testing/evals/n8n-security-testing.yaml +1 -1
  42. package/.claude/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +1 -1
  43. package/.claude/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +1 -1
  44. package/.claude/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +1 -1
  45. package/.claude/skills/pentest-validation/evals/pentest-validation.yaml +1 -1
  46. package/.claude/skills/performance-testing/evals/performance-testing.yaml +1 -1
  47. package/.claude/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +1 -1
  48. package/.claude/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +1 -1
  49. package/.claude/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +1 -1
  50. package/.claude/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +1 -1
  51. package/.claude/skills/qcsd-refinement-swarm/evals/qcsd-refinement-swarm.yaml +1 -1
  52. package/.claude/skills/qe-browser/evals/qe-browser.yaml +1 -1
  53. package/.claude/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +1 -1
  54. package/.claude/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +1 -1
  55. package/.claude/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +1 -1
  56. package/.claude/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +1 -1
  57. package/.claude/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +2 -2
  58. package/.claude/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +1 -1
  59. package/.claude/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +1 -1
  60. package/.claude/skills/qe-test-execution/evals/qe-test-execution.yaml +1 -1
  61. package/.claude/skills/qe-test-generation/evals/qe-test-generation.yaml +1 -1
  62. package/.claude/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +1 -1
  63. package/.claude/skills/quality-metrics/evals/quality-metrics.yaml +1 -1
  64. package/.claude/skills/regression-testing/evals/regression-testing.yaml +1 -1
  65. package/.claude/skills/risk-based-testing/evals/risk-based-testing.yaml +1 -1
  66. package/.claude/skills/security-testing/evals/security-testing.yaml +1 -1
  67. package/.claude/skills/security-visual-testing/evals/security-visual-testing.yaml +1 -1
  68. package/.claude/skills/shift-left-testing/evals/shift-left-testing.yaml +1 -1
  69. package/.claude/skills/shift-right-testing/evals/shift-right-testing.yaml +1 -1
  70. package/.claude/skills/skills-manifest.json +1 -1
  71. package/.claude/skills/test-automation-strategy/evals/test-automation-strategy.yaml +1 -1
  72. package/.claude/skills/test-data-management/evals/test-data-management.yaml +1 -1
  73. package/.claude/skills/test-design-techniques/evals/test-design-techniques.yaml +1 -1
  74. package/.claude/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +1 -1
  75. package/.claude/skills/testability-scoring/evals/testability-scoring.yaml +1 -1
  76. package/.claude/skills/validation-pipeline/evals/validation-pipeline.yaml +1 -1
  77. package/.claude/skills/verification-quality/evals/verification-quality.yaml +1 -1
  78. package/.claude/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +1 -1
  79. package/.claude/skills/wms-testing-patterns/evals/wms-testing-patterns.yaml +1 -1
  80. package/.opencode/agents/collective-intelligence-coordinator.yaml +1 -1
  81. package/.opencode/agents/ddd-domain-expert.yaml +1 -1
  82. package/.opencode/agents/memory-specialist.yaml +1 -1
  83. package/.opencode/agents/performance-engineer.yaml +1 -1
  84. package/.opencode/agents/qe-accessibility-auditor.yaml +1 -1
  85. package/.opencode/agents/qe-api-contract-validator.yaml +1 -1
  86. package/.opencode/agents/qe-bdd-generator.yaml +1 -1
  87. package/.opencode/agents/qe-chaos-engineer.yaml +1 -1
  88. package/.opencode/agents/qe-code-complexity.yaml +1 -1
  89. package/.opencode/agents/qe-code-intelligence.yaml +1 -1
  90. package/.opencode/agents/qe-coverage-analyzer.yaml +1 -1
  91. package/.opencode/agents/qe-defect-predictor.yaml +1 -1
  92. package/.opencode/agents/qe-dependency-mapper.yaml +1 -1
  93. package/.opencode/agents/qe-deployment-advisor.yaml +1 -1
  94. package/.opencode/agents/qe-devils-advocate.yaml +1 -1
  95. package/.opencode/agents/qe-flaky-hunter.yaml +1 -1
  96. package/.opencode/agents/qe-fleet-commander.yaml +1 -1
  97. package/.opencode/agents/qe-gap-detector.yaml +1 -1
  98. package/.opencode/agents/qe-graphql-tester.yaml +1 -1
  99. package/.opencode/agents/qe-impact-analyzer.yaml +1 -1
  100. package/.opencode/agents/qe-integration-architect.yaml +1 -1
  101. package/.opencode/agents/qe-integration-tester.yaml +1 -1
  102. package/.opencode/agents/qe-kg-builder.yaml +1 -1
  103. package/.opencode/agents/qe-learning-coordinator.yaml +1 -1
  104. package/.opencode/agents/qe-load-tester.yaml +1 -1
  105. package/.opencode/agents/qe-message-broker-tester.yaml +1 -1
  106. package/.opencode/agents/qe-metrics-optimizer.yaml +1 -1
  107. package/.opencode/agents/qe-middleware-validator.yaml +1 -1
  108. package/.opencode/agents/qe-mutation-tester.yaml +1 -1
  109. package/.opencode/agents/qe-odata-contract-tester.yaml +1 -1
  110. package/.opencode/agents/qe-parallel-executor.yaml +1 -1
  111. package/.opencode/agents/qe-pattern-learner.yaml +1 -1
  112. package/.opencode/agents/qe-pentest-validator.yaml +1 -1
  113. package/.opencode/agents/qe-performance-tester.yaml +1 -1
  114. package/.opencode/agents/qe-product-factors-assessor.yaml +1 -1
  115. package/.opencode/agents/qe-property-tester.yaml +1 -1
  116. package/.opencode/agents/qe-quality-criteria-recommender.yaml +1 -1
  117. package/.opencode/agents/qe-quality-gate.yaml +1 -1
  118. package/.opencode/agents/qe-queen-coordinator.yaml +1 -1
  119. package/.opencode/agents/qe-qx-partner.yaml +1 -1
  120. package/.opencode/agents/qe-regression-analyzer.yaml +1 -1
  121. package/.opencode/agents/qe-requirements-validator.yaml +1 -1
  122. package/.opencode/agents/qe-responsive-tester.yaml +1 -1
  123. package/.opencode/agents/qe-retry-handler.yaml +1 -1
  124. package/.opencode/agents/qe-risk-assessor.yaml +1 -1
  125. package/.opencode/agents/qe-root-cause-analyzer.yaml +1 -1
  126. package/.opencode/agents/qe-sap-idoc-tester.yaml +1 -1
  127. package/.opencode/agents/qe-sap-rfc-tester.yaml +1 -1
  128. package/.opencode/agents/qe-security-auditor.yaml +1 -1
  129. package/.opencode/agents/qe-security-scanner.yaml +1 -1
  130. package/.opencode/agents/qe-soap-tester.yaml +1 -1
  131. package/.opencode/agents/qe-sod-analyzer.yaml +1 -1
  132. package/.opencode/agents/qe-tdd-specialist.yaml +1 -1
  133. package/.opencode/agents/qe-test-generator.yaml +1 -1
  134. package/.opencode/agents/qe-test-idea-rewriter.yaml +1 -1
  135. package/.opencode/agents/qe-transfer-specialist.yaml +1 -1
  136. package/.opencode/agents/qe-visual-tester.yaml +1 -1
  137. package/.opencode/agents/security-architect.yaml +1 -1
  138. package/.opencode/agents/security-auditor.yaml +1 -1
  139. package/CHANGELOG.md +204 -0
  140. package/README.md +7 -2
  141. package/assets/agents/v3/helpers/advisor-call.cjs +3 -3
  142. package/assets/agents/v3/qe-coverage-specialist.md +1 -1
  143. package/assets/agents/v3/qe-fleet-commander.md +1 -1
  144. package/assets/agents/v3/qe-pentest-validator.md +1 -1
  145. package/assets/agents/v3/qe-queen-coordinator.md +1 -1
  146. package/assets/agents/v3/qe-risk-assessor.md +1 -1
  147. package/assets/agents/v3/qe-root-cause-analyzer.md +1 -1
  148. package/assets/agents/v3/qe-security-auditor.md +1 -1
  149. package/assets/agents/v3/qe-test-architect.md +1 -1
  150. package/assets/skills/.validation/examples/chaos-engineering-output.example.json +1 -1
  151. package/assets/skills/.validation/examples/performance-testing-output.example.json +1 -1
  152. package/assets/skills/.validation/examples/security-testing-output.example.json +1 -1
  153. package/assets/skills/.validation/examples/testability-scoring-output.example.json +1 -1
  154. package/assets/skills/.validation/schemas/skill-eval.schema.json +4 -1
  155. package/assets/skills/.validation/schemas/skill-frontmatter.schema.json +1 -1
  156. package/assets/skills/.validation/schemas/skill-output.template.json +1 -1
  157. package/assets/skills/.validation/templates/eval.template.yaml +1 -1
  158. package/assets/skills/.validation/templates/security-testing-eval.template.yaml +1 -1
  159. package/assets/skills/.validation/templates/skill-frontmatter.example.yaml +1 -1
  160. package/assets/skills/.validation/test-data/sample-output.json +1 -1
  161. package/assets/skills/a11y-ally/SKILL.md +1 -1
  162. package/assets/skills/a11y-ally/evals/a11y-ally.yaml +1 -1
  163. package/assets/skills/accessibility-testing/evals/accessibility-testing.yaml +1 -1
  164. package/assets/skills/api-testing-patterns/evals/api-testing-patterns.yaml +1 -1
  165. package/assets/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +1 -1
  166. package/assets/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +1 -1
  167. package/assets/skills/compatibility-testing/evals/compatibility-testing.yaml +1 -1
  168. package/assets/skills/compliance-testing/evals/compliance-testing.yaml +1 -1
  169. package/assets/skills/contract-testing/evals/contract-testing.yaml +1 -1
  170. package/assets/skills/database-testing/evals/database-testing.yaml +1 -1
  171. package/assets/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +1 -1
  172. package/assets/skills/localization-testing/evals/localization-testing.yaml +1 -1
  173. package/assets/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +1 -1
  174. package/assets/skills/mobile-testing/evals/mobile-testing.yaml +1 -1
  175. package/assets/skills/mutation-testing/evals/mutation-testing.yaml +1 -1
  176. package/assets/skills/mutation-testing/test-data/sample-output.json +1 -1
  177. package/assets/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +1 -1
  178. package/assets/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +1 -1
  179. package/assets/skills/n8n-security-testing/evals/n8n-security-testing.yaml +1 -1
  180. package/assets/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +1 -1
  181. package/assets/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +1 -1
  182. package/assets/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +1 -1
  183. package/assets/skills/pentest-validation/evals/pentest-validation.yaml +1 -1
  184. package/assets/skills/performance-testing/evals/performance-testing.yaml +1 -1
  185. package/assets/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +1 -1
  186. package/assets/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +1 -1
  187. package/assets/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +1 -1
  188. package/assets/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +1 -1
  189. package/assets/skills/qcsd-refinement-swarm/evals/qcsd-refinement-swarm.yaml +1 -1
  190. package/assets/skills/qe-browser/evals/qe-browser.yaml +1 -1
  191. package/assets/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +1 -1
  192. package/assets/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +1 -1
  193. package/assets/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +1 -1
  194. package/assets/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +1 -1
  195. package/assets/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +2 -2
  196. package/assets/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +1 -1
  197. package/assets/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +1 -1
  198. package/assets/skills/qe-test-execution/evals/qe-test-execution.yaml +1 -1
  199. package/assets/skills/qe-test-generation/evals/qe-test-generation.yaml +1 -1
  200. package/assets/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +1 -1
  201. package/assets/skills/quality-metrics/evals/quality-metrics.yaml +1 -1
  202. package/assets/skills/regression-testing/evals/regression-testing.yaml +1 -1
  203. package/assets/skills/risk-based-testing/evals/risk-based-testing.yaml +1 -1
  204. package/assets/skills/security-testing/evals/security-testing.yaml +1 -1
  205. package/assets/skills/security-visual-testing/evals/security-visual-testing.yaml +1 -1
  206. package/assets/skills/shift-left-testing/evals/shift-left-testing.yaml +1 -1
  207. package/assets/skills/shift-right-testing/evals/shift-right-testing.yaml +1 -1
  208. package/assets/skills/skills-manifest.json +1 -1
  209. package/assets/skills/test-automation-strategy/evals/test-automation-strategy.yaml +1 -1
  210. package/assets/skills/test-data-management/evals/test-data-management.yaml +1 -1
  211. package/assets/skills/test-design-techniques/evals/test-design-techniques.yaml +1 -1
  212. package/assets/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +1 -1
  213. package/assets/skills/testability-scoring/evals/testability-scoring.yaml +1 -1
  214. package/assets/skills/validation-pipeline/evals/validation-pipeline.yaml +1 -1
  215. package/assets/skills/verification-quality/evals/verification-quality.yaml +1 -1
  216. package/assets/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +1 -1
  217. package/assets/skills/wms-testing-patterns/evals/wms-testing-patterns.yaml +1 -1
  218. package/dist/audit/witness-chain.d.ts +1 -1
  219. package/dist/audit/witness-chain.js +29 -22
  220. package/dist/cli/bundle.js +13 -10
  221. package/dist/cli/chunks/adapter-IYC62SXA.js +2 -0
  222. package/dist/cli/chunks/{agent-booster-wasm-TQOMLWWX.js → agent-booster-wasm-EDNKP3SP.js} +2 -2
  223. package/dist/cli/chunks/{agent-handler-Q3SEMMI2.js → agent-handler-V6CZ7Q6S.js} +2 -2
  224. package/dist/cli/chunks/{agent-memory-branch-SJXAQSZI.js → agent-memory-branch-ZMD6ULC3.js} +2 -2
  225. package/dist/cli/chunks/aqe-learning-engine-LLOU2IXD.js +2 -0
  226. package/dist/cli/chunks/{arena-7RC7TBGW.js → arena-4UPAEHFT.js} +4 -4
  227. package/dist/cli/chunks/{arena-UPB7TKUY.js → arena-QLSBESC7.js} +2 -2
  228. package/dist/cli/chunks/{audit-IXN5R4WB.js → audit-CVZQMF55.js} +3 -3
  229. package/dist/cli/chunks/base-P3Z4IKCT.js +2 -0
  230. package/dist/cli/chunks/{better-sqlite3-RP4DEGK3.js → better-sqlite3-4DSBPDRH.js} +2 -2
  231. package/dist/cli/chunks/brain-handler-GBY4EZ4P.js +94 -0
  232. package/dist/cli/chunks/{branch-enumerator-VPRWDGFJ.js → branch-enumerator-XYBVXCNO.js} +2 -2
  233. package/dist/cli/chunks/{browser-B6E7JPPJ.js → browser-32F6MREU.js} +2 -2
  234. package/dist/cli/chunks/browser-workflow-YYHQQ25X.js +2 -0
  235. package/dist/cli/chunks/{chunk-HOQQCY2K.js → chunk-2JGEZHWY.js} +2 -2
  236. package/dist/cli/chunks/{chunk-NN76NTOX.js → chunk-2KJQ2UQE.js} +1 -1
  237. package/dist/cli/chunks/{chunk-D4Z2N74A.js → chunk-2OMLTYQK.js} +1 -1
  238. package/dist/cli/chunks/chunk-37TUN44F.js +4 -0
  239. package/dist/cli/chunks/{chunk-LVLBIKJD.js → chunk-3DDXWYMO.js} +1 -1
  240. package/dist/cli/chunks/{chunk-UHQY3GK7.js → chunk-3EZ5DR2R.js} +3 -3
  241. package/dist/cli/chunks/{chunk-3P6NCFI2.js → chunk-3KDL6QDK.js} +2 -2
  242. package/dist/cli/chunks/{chunk-SG47AXJG.js → chunk-3VIXOHMS.js} +1 -1
  243. package/dist/cli/chunks/{chunk-7FYMDKQH.js → chunk-3YUB5HER.js} +165 -167
  244. package/dist/cli/chunks/chunk-4FWTLJEP.js +16 -0
  245. package/dist/cli/chunks/{chunk-PI74GOE4.js → chunk-52L77RMG.js} +2 -2
  246. package/dist/cli/chunks/{chunk-LS3EUMBP.js → chunk-5D36YHS3.js} +5 -5
  247. package/dist/cli/chunks/{chunk-EY4OQHU3.js → chunk-5WOSWNDN.js} +1 -1
  248. package/dist/cli/chunks/{chunk-F67AV5P2.js → chunk-67YV75XP.js} +2 -2
  249. package/dist/cli/chunks/{chunk-IP7NSFQQ.js → chunk-6A44AOGN.js} +2 -2
  250. package/dist/cli/chunks/{chunk-3ABRGG3C.js → chunk-6CR4VQBQ.js} +2 -2
  251. package/dist/cli/chunks/chunk-6ITZZIQX.js +2 -0
  252. package/dist/cli/chunks/{chunk-7BUERZYL.js → chunk-6LKDHEBY.js} +2 -2
  253. package/dist/cli/chunks/{chunk-FKG5OQFT.js → chunk-6TU7FEMD.js} +1 -1
  254. package/dist/cli/chunks/{chunk-KF63AYXD.js → chunk-6VAZAHQG.js} +2 -2
  255. package/dist/cli/chunks/{chunk-XXCYQXK3.js → chunk-73EI4C2E.js} +2 -2
  256. package/dist/cli/chunks/chunk-75QJ5HWE.js +14 -0
  257. package/dist/cli/chunks/{chunk-72UJXEKQ.js → chunk-7CD7PBHY.js} +2 -2
  258. package/dist/cli/chunks/chunk-7DETTOPZ.js +14 -0
  259. package/dist/cli/chunks/{chunk-7JQHPANT.js → chunk-7JZJJA7U.js} +3 -3
  260. package/dist/cli/chunks/{chunk-5Y5TC6BY.js → chunk-7VFY7TUR.js} +2 -2
  261. package/dist/cli/chunks/chunk-7X7JYWT4.js +27 -0
  262. package/dist/cli/chunks/chunk-AF4XKLXO.js +2 -0
  263. package/dist/cli/chunks/{chunk-7SLAZAVU.js → chunk-AFEDJ3RU.js} +2 -2
  264. package/dist/cli/chunks/{chunk-ZUG5MOUB.js → chunk-AMMQOV35.js} +2 -2
  265. package/dist/cli/chunks/{chunk-ZN3J6TZD.js → chunk-BHFR2EXL.js} +1 -1
  266. package/dist/cli/chunks/{chunk-HXE5NBJG.js → chunk-BJPL6THQ.js} +1 -1
  267. package/dist/cli/chunks/{chunk-37BASGWC.js → chunk-BXVAVFGU.js} +2 -2
  268. package/dist/cli/chunks/{chunk-VWNHKYK7.js → chunk-BYG36QC5.js} +2 -2
  269. package/dist/cli/chunks/chunk-C3HQL6S4.js +2 -0
  270. package/dist/cli/chunks/{chunk-OY7MLMEX.js → chunk-C3Z4VVHP.js} +5 -5
  271. package/dist/cli/chunks/{chunk-CB5JPRIZ.js → chunk-CPC7FN52.js} +2 -2
  272. package/dist/cli/chunks/{chunk-OVDKWCD7.js → chunk-CVMNJSCB.js} +2 -2
  273. package/dist/cli/chunks/{chunk-N4H2QOT5.js → chunk-CYE2TJFV.js} +2 -2
  274. package/dist/cli/chunks/{chunk-YCBDE2N7.js → chunk-CZO4BJG5.js} +2 -2
  275. package/dist/cli/chunks/{chunk-YEXPFHV6.js → chunk-D6OUCB2H.js} +2 -2
  276. package/dist/cli/chunks/{chunk-JRYZKBY2.js → chunk-DDCIYOGT.js} +2 -2
  277. package/dist/cli/chunks/{chunk-XX7HUSX2.js → chunk-DKUBQQFG.js} +2 -2
  278. package/dist/cli/chunks/{chunk-SGXSB7YO.js → chunk-DLF5BOJD.js} +1 -1
  279. package/dist/cli/chunks/{chunk-5BLFXQEB.js → chunk-DO6EI5KB.js} +1 -1
  280. package/dist/cli/chunks/{chunk-33VPWGCM.js → chunk-DPBRWP4J.js} +3 -3
  281. package/dist/cli/chunks/{chunk-H6XBM2LY.js → chunk-E3W6XQ57.js} +2 -2
  282. package/dist/cli/chunks/{chunk-KPMGTVB4.js → chunk-E4AZXCT5.js} +1 -1
  283. package/dist/cli/chunks/chunk-E4EYPYR3.js +2 -0
  284. package/dist/cli/chunks/{chunk-TFHQE6NK.js → chunk-EFV4ADMO.js} +4 -4
  285. package/dist/cli/chunks/{chunk-VIDBBB6F.js → chunk-ELBZON4V.js} +2 -2
  286. package/dist/cli/chunks/chunk-EOR2UT72.js +2 -0
  287. package/dist/cli/chunks/{chunk-H5ZRV5K5.js → chunk-F34OAHOM.js} +2 -2
  288. package/dist/cli/chunks/{chunk-UMENRGHK.js → chunk-FUNGTIF2.js} +2 -2
  289. package/dist/cli/chunks/{chunk-DBA3N742.js → chunk-G3L5L6YQ.js} +1 -1
  290. package/dist/cli/chunks/{chunk-ELU4IC3I.js → chunk-G3W6BMVJ.js} +1 -1
  291. package/dist/cli/chunks/{chunk-RTJ2M6V6.js → chunk-GTKCGPJZ.js} +3 -3
  292. package/dist/cli/chunks/chunk-HBCGYMQU.js +2 -0
  293. package/dist/cli/chunks/{chunk-YL7T3VV7.js → chunk-HSVKZ5KI.js} +4 -4
  294. package/dist/cli/chunks/{chunk-MXMFGSWR.js → chunk-HVU64GP5.js} +2 -2
  295. package/dist/cli/chunks/chunk-HVXJC3OC.js +2 -0
  296. package/dist/cli/chunks/chunk-HYEJJJY3.js +4 -0
  297. package/dist/cli/chunks/{chunk-CR3QGHVN.js → chunk-I2NENQ44.js} +2 -2
  298. package/dist/cli/chunks/{chunk-GNTVFN7D.js → chunk-I6X3EGJI.js} +1 -1
  299. package/dist/cli/chunks/{chunk-2GNRW3OD.js → chunk-IGBEJ4UJ.js} +2 -2
  300. package/dist/cli/chunks/{chunk-UYJHYMEQ.js → chunk-IIAR5S7Q.js} +2 -2
  301. package/dist/cli/chunks/{chunk-YAKS3CAB.js → chunk-IJHCIXJC.js} +2 -2
  302. package/dist/cli/chunks/{chunk-YDNSLLBS.js → chunk-IUDWEOLX.js} +2 -2
  303. package/dist/cli/chunks/chunk-IUHB5GVS.js +3 -0
  304. package/dist/cli/chunks/{chunk-4UDZLD42.js → chunk-IYTLXUBO.js} +2 -2
  305. package/dist/cli/chunks/chunk-J27F4NSB.js +2 -0
  306. package/dist/cli/chunks/{chunk-HRUU7E3D.js → chunk-J5UNP6W3.js} +2 -2
  307. package/dist/cli/chunks/{chunk-E3FBW6G2.js → chunk-JES6R5KP.js} +1 -1
  308. package/dist/cli/chunks/chunk-JROVR6YS.js +11 -0
  309. package/dist/cli/chunks/chunk-JSZ663MU.js +2 -0
  310. package/dist/cli/chunks/{chunk-FUE6LL72.js → chunk-JVQBWYHW.js} +2 -2
  311. package/dist/cli/chunks/{chunk-G6ZHTF42.js → chunk-K27SU3RE.js} +2 -2
  312. package/dist/cli/chunks/chunk-K7NJHFLZ.js +54 -0
  313. package/dist/cli/chunks/{chunk-MDZ6RRLX.js → chunk-KEY43ANX.js} +2 -2
  314. package/dist/cli/chunks/chunk-KIP6WZGV.js +13 -0
  315. package/dist/cli/chunks/{chunk-SQ3PPISY.js → chunk-KKHYJF5U.js} +1 -1
  316. package/dist/cli/chunks/{chunk-TJEIOE7F.js → chunk-KLTP5IDB.js} +1 -1
  317. package/dist/cli/chunks/{chunk-IKIITGU5.js → chunk-KO4FNAUR.js} +4 -4
  318. package/dist/cli/chunks/{chunk-DX3C5HPN.js → chunk-KYA5LARK.js} +1 -1
  319. package/dist/cli/chunks/{chunk-ZHXWGNYM.js → chunk-LSUILON7.js} +1 -1
  320. package/dist/cli/chunks/chunk-LULD4JV2.js +15 -0
  321. package/dist/cli/chunks/{chunk-MWWAMDHI.js → chunk-M23ZOZVY.js} +1 -1
  322. package/dist/cli/chunks/{chunk-RKJZWWB7.js → chunk-M5AEL7IS.js} +2 -2
  323. package/dist/cli/chunks/chunk-MI5Q55DG.js +65 -0
  324. package/dist/cli/chunks/chunk-N7H767TP.js +4 -0
  325. package/dist/cli/chunks/{chunk-5F6DWHQG.js → chunk-NQI7FWCS.js} +2 -2
  326. package/dist/cli/chunks/{chunk-LLVGTEHU.js → chunk-NRE4NAVA.js} +1 -1
  327. package/dist/cli/chunks/{chunk-XA7CG3LH.js → chunk-NU7UTXMP.js} +2 -2
  328. package/dist/cli/chunks/chunk-NVYBM3R4.js +2 -0
  329. package/dist/cli/chunks/chunk-O3JTQ7N4.js +2 -0
  330. package/dist/cli/chunks/{chunk-TISSZFHO.js → chunk-OEIQTWQP.js} +1 -1
  331. package/dist/cli/chunks/{chunk-2IGT5WNQ.js → chunk-PSPKSUF6.js} +1 -1
  332. package/dist/cli/chunks/{chunk-B7SWW5A6.js → chunk-QIRL6B3C.js} +2 -2
  333. package/dist/cli/chunks/{chunk-JBB7E26R.js → chunk-QRCIZFNK.js} +2 -2
  334. package/dist/cli/chunks/{chunk-4JBFJTHJ.js → chunk-QWUXCG2L.js} +1 -1
  335. package/dist/cli/chunks/{chunk-B5XFDFBT.js → chunk-QYOGD2VW.js} +1 -1
  336. package/dist/cli/chunks/chunk-QZMUXJHZ.js +2 -0
  337. package/dist/cli/chunks/chunk-R6IU3EWP.js +2 -0
  338. package/dist/cli/chunks/{chunk-G5C2XVZC.js → chunk-R74ZKREV.js} +1 -1
  339. package/dist/cli/chunks/chunk-RD2VGOUH.js +2 -0
  340. package/dist/cli/chunks/{chunk-OV5EZO3U.js → chunk-RD6TEZ64.js} +2 -2
  341. package/dist/cli/chunks/{chunk-4C6UJIHB.js → chunk-RGGK6VZ7.js} +1 -1
  342. package/dist/cli/chunks/{chunk-4XPPMADQ.js → chunk-RIZVC4XY.js} +6 -6
  343. package/dist/cli/chunks/{chunk-4RP5VUBI.js → chunk-RKOUXVZZ.js} +2 -2
  344. package/dist/cli/chunks/{chunk-IFFZR6GY.js → chunk-RP2ZKPYV.js} +1 -1
  345. package/dist/cli/chunks/{chunk-BN7DKW5D.js → chunk-SQF6HRXR.js} +1 -1
  346. package/dist/cli/chunks/chunk-SQKW3B6B.js +2 -0
  347. package/dist/cli/chunks/{chunk-LKN7JQTW.js → chunk-SX4JLSLV.js} +2 -2
  348. package/dist/cli/chunks/{chunk-YGB6R5DW.js → chunk-TUSSPKRM.js} +1 -1
  349. package/dist/cli/chunks/{chunk-LHGNNZ76.js → chunk-TY5WC3FT.js} +3 -3
  350. package/dist/cli/chunks/{chunk-B2ZONZPZ.js → chunk-UDHVCKGA.js} +2 -2
  351. package/dist/cli/chunks/{chunk-IU4EBTA2.js → chunk-UJWAWIRV.js} +4 -4
  352. package/dist/cli/chunks/{chunk-LTBCAFTZ.js → chunk-UKGXWW64.js} +3 -3
  353. package/dist/cli/chunks/{chunk-JV4FZUE7.js → chunk-UMGFMKDW.js} +2 -2
  354. package/dist/cli/chunks/{chunk-STRDSVH3.js → chunk-URVHZPWY.js} +2 -2
  355. package/dist/cli/chunks/{chunk-PZTVH2AS.js → chunk-UTBYJ4RF.js} +2 -2
  356. package/dist/cli/chunks/{chunk-ZK5JKHP4.js → chunk-VD5IO5EO.js} +1 -1
  357. package/dist/cli/chunks/chunk-VTOVWHEM.js +2 -0
  358. package/dist/cli/chunks/{chunk-OYMLHX2B.js → chunk-W2XCZU62.js} +1 -1
  359. package/dist/cli/chunks/{chunk-T35GZXTU.js → chunk-WJHWH5D2.js} +2 -2
  360. package/dist/cli/chunks/{chunk-NBWQBQO5.js → chunk-WJTSY5MC.js} +1 -1
  361. package/dist/cli/chunks/{chunk-NTSXHZTC.js → chunk-WK7B4B6Y.js} +4 -4
  362. package/dist/cli/chunks/{chunk-2WT7AKKK.js → chunk-WLXK2KNU.js} +2 -2
  363. package/dist/cli/chunks/chunk-WOIGKU2N.js +180 -0
  364. package/dist/cli/chunks/{chunk-WYMGK5DX.js → chunk-WX6RRIGW.js} +2 -2
  365. package/dist/cli/chunks/{chunk-C46DMCWF.js → chunk-XEZIIQYJ.js} +2 -2
  366. package/dist/cli/chunks/{chunk-TTMHIOQ3.js → chunk-XFPPERA2.js} +2 -2
  367. package/dist/cli/chunks/{chunk-OVPJQWHW.js → chunk-XLAUGSW7.js} +2 -2
  368. package/dist/cli/chunks/{chunk-V4AOVDCJ.js → chunk-XQSIRBKT.js} +8 -8
  369. package/dist/cli/chunks/{chunk-4Q35TI6Z.js → chunk-XUR2M2WB.js} +2 -2
  370. package/dist/cli/chunks/{chunk-5IAB5NRZ.js → chunk-XZSMZHM2.js} +2 -2
  371. package/dist/cli/chunks/{chunk-AB4U6ZNI.js → chunk-Y5L3ES4L.js} +2 -2
  372. package/dist/cli/chunks/chunk-YDFL445W.js +2 -0
  373. package/dist/cli/chunks/{chunk-7G6UX2QN.js → chunk-YQGPQBCX.js} +2 -2
  374. package/dist/cli/chunks/{chunk-5FOZO7KM.js → chunk-YXP6BKGS.js} +46 -46
  375. package/dist/cli/chunks/chunk-ZBABIZ2D.js +2 -0
  376. package/dist/cli/chunks/{chunk-IQEJGZV6.js → chunk-ZCWERUYB.js} +4 -4
  377. package/dist/cli/chunks/ci-RACDAJMR.js +81 -0
  378. package/dist/cli/chunks/{ci-output-LK3MBXLZ.js → ci-output-EHRSZBKG.js} +2 -2
  379. package/dist/cli/chunks/{circuit-breaker-7AIXACR7.js → circuit-breaker-GBV7M5XG.js} +2 -2
  380. package/dist/cli/chunks/{claude-flow-setup-UA7EO6VN.js → claude-flow-setup-5LVJOFKP.js} +2 -2
  381. package/dist/cli/chunks/client-HUVFA5PF.js +2 -0
  382. package/dist/cli/chunks/{cline-installer-YDDCKKEV.js → cline-installer-W4NMXJSG.js} +2 -2
  383. package/dist/cli/chunks/{code-URB7UAKW.js → code-JWXJMYXB.js} +29 -29
  384. package/dist/cli/chunks/{code-index-extractor-BL6HWH4Q.js → code-index-extractor-RVI2IFTM.js} +2 -2
  385. package/dist/cli/chunks/codex-installer-3BORJINH.js +14 -0
  386. package/dist/cli/chunks/{completions-RCKBSSSS.js → completions-A55NCTAO.js} +2 -2
  387. package/dist/cli/chunks/complexity-analyzer-JCXHGGLY.js +2 -0
  388. package/dist/cli/chunks/{continuedev-installer-VOTCEBFH.js → continuedev-installer-PUVFMGYW.js} +2 -2
  389. package/dist/cli/chunks/{copilot-installer-NVTGLZX3.js → copilot-installer-4DCMYWHB.js} +2 -2
  390. package/dist/cli/chunks/core-handlers-UEXO3VAA.js +2 -0
  391. package/dist/cli/chunks/cost-tracker-5TV2GGKY.js +2 -0
  392. package/dist/cli/chunks/{coverage-ZTPJWXWE.js → coverage-NNWM7TX3.js} +3 -3
  393. package/dist/cli/chunks/cross-domain-router-ODU5IZD6.js +2 -0
  394. package/dist/cli/chunks/{cursor-installer-CMGJQMHX.js → cursor-installer-4NCHGJGK.js} +2 -2
  395. package/dist/cli/chunks/{daemon-Y2I3YVIU.js → daemon-QIKCXKWO.js} +4 -4
  396. package/dist/cli/chunks/{daemon-V456IWR3.js → daemon-T4JO4IXP.js} +3 -3
  397. package/dist/cli/chunks/{dag-attention-scheduler-ZCBBOD3D.js → dag-attention-scheduler-RPAAIDAD.js} +2 -2
  398. package/dist/cli/chunks/{detect-2GHEA4A3.js → detect-SBEEVDSN.js} +2 -2
  399. package/dist/cli/chunks/{dist-node-44AGYJCH.js → dist-node-ZHI6NCSU.js} +2 -2
  400. package/dist/cli/chunks/{domain-handler-IDLIEP6X.js → domain-handler-LBC3GJ7Z.js} +2 -2
  401. package/dist/cli/chunks/domain-plugins-H6IZ5USZ.js +2 -0
  402. package/dist/cli/chunks/{domain-transfer-KLEXGIRF.js → domain-transfer-JZA5TMW3.js} +2 -2
  403. package/dist/cli/chunks/dream-HE3OX42F.js +2 -0
  404. package/dist/cli/chunks/embed-and-insert-pattern-AHTR7CRU.js +3 -0
  405. package/dist/cli/chunks/eval-DZU2KISM.js +17 -0
  406. package/dist/cli/chunks/{experience-capture-middleware-CJJJN7CF.js → experience-capture-middleware-5IQCWKSL.js} +4 -4
  407. package/dist/cli/chunks/{fast-paths-LGLLKX6P.js → fast-paths-2KLDUWCY.js} +2 -2
  408. package/dist/cli/chunks/{feature-flags-33D3I4DD.js → feature-flags-7AC3XDZA.js} +2 -2
  409. package/dist/cli/chunks/{feature-flags-QL4NCEGW.js → feature-flags-N6UAEZY4.js} +2 -2
  410. package/dist/cli/chunks/{file-discovery-GKCYJPFZ.js → file-discovery-5SDIW4V2.js} +2 -2
  411. package/dist/cli/chunks/fleet-ZIQCAZ2Y.js +43 -0
  412. package/dist/cli/chunks/{gnn-wrapper-ELSGT67Z.js → gnn-wrapper-DUMBZJEV.js} +2 -2
  413. package/dist/cli/chunks/{heartbeat-handler-ZUI3DOOP.js → heartbeat-handler-6HVM6ZMR.js} +4 -4
  414. package/dist/cli/chunks/heartbeat-scheduler-QUIFGGLX.js +2 -0
  415. package/dist/cli/chunks/hnsw-adapter-42KB37KP.js +2 -0
  416. package/dist/cli/chunks/hnsw-index-T2PGO77J.js +2 -0
  417. package/dist/cli/chunks/{hnsw-legacy-bridge-EZMM5JWL.js → hnsw-legacy-bridge-5DRL5FLX.js} +2 -2
  418. package/dist/cli/chunks/{hnswlib-node-G4CE3EOS.js → hnswlib-node-GW67GTCL.js} +2 -2
  419. package/dist/cli/chunks/{hooks-LCVXXA55.js → hooks-QHH6FVO4.js} +10 -10
  420. package/dist/cli/chunks/hybrid-backend-FRNWYRKH.js +2 -0
  421. package/dist/cli/chunks/{hypergraph-engine-6Z7RQ3HI.js → hypergraph-engine-7XDCCVG2.js} +2 -2
  422. package/dist/cli/chunks/{hypergraph-handler-PLI2GYPK.js → hypergraph-handler-QHF7NOU5.js} +3 -3
  423. package/dist/cli/chunks/impact-analyzer-A5QYOYBR.js +2 -0
  424. package/dist/cli/chunks/{init-handler-7VH3QJ5Y.js → init-handler-5UIVOM7K.js} +6 -6
  425. package/dist/cli/chunks/init-wizard-XBU674YH.js +2 -0
  426. package/dist/cli/chunks/kernel-DV5MTNZD.js +2 -0
  427. package/dist/cli/chunks/{kilocode-installer-U3MW62DE.js → kilocode-installer-TGGV6K5Q.js} +2 -2
  428. package/dist/cli/chunks/{kiro-installer-PPEAC44T.js → kiro-installer-4XYBHZWW.js} +12 -12
  429. package/dist/cli/chunks/knowledge-graph-4ACGVJQK.js +2 -0
  430. package/dist/cli/chunks/learning-STE5W6BS.js +122 -0
  431. package/dist/cli/chunks/llm-router-NKF7J3RI.js +37 -0
  432. package/dist/cli/chunks/llm-router-service-PSMASERT.js +2 -0
  433. package/dist/cli/chunks/{load-VO7ABNHV.js → load-B2T77UJQ.js} +2 -2
  434. package/dist/cli/chunks/load-test-MRUO2VPF.js +2 -0
  435. package/dist/cli/chunks/mcp-JGSFCEMH.js +2 -0
  436. package/dist/cli/chunks/{memory-FZTT7ADM.js → memory-WRFZKG56.js} +6 -6
  437. package/dist/cli/chunks/memory-backend-2MPGI6JW.js +2 -0
  438. package/dist/cli/chunks/memory-handlers-XT4HMITB.js +2 -0
  439. package/dist/cli/chunks/multi-model-executor-26Q5BSVG.js +14 -0
  440. package/dist/cli/chunks/{opencode-installer-GQ7J5SBG.js → opencode-installer-J36EMQU7.js} +2 -2
  441. package/dist/cli/chunks/{orchestrator-66JK2OS5.js → orchestrator-D5IFV65I.js} +20 -20
  442. package/dist/cli/chunks/pattern-null-store-TGWUL237.js +2 -0
  443. package/dist/cli/chunks/{pattern-usage-recorder-O6XHM2G5.js → pattern-usage-recorder-BVMTWI3E.js} +2 -2
  444. package/dist/cli/chunks/pipeline-OWAHDUAQ.js +19 -0
  445. package/dist/cli/chunks/platform-ANGBFWBV.js +2 -0
  446. package/dist/cli/chunks/{plugin-7OFLNGOS.js → plugin-OO7ON2YW.js} +2 -2
  447. package/dist/cli/chunks/{prime-radiant-advanced-wasm-OSRDK2FW.js → prime-radiant-advanced-wasm-HFG3BXWU.js} +2 -2
  448. package/dist/cli/chunks/project-root-LNOYVTYY.js +2 -0
  449. package/dist/cli/chunks/protocol-executor-GEVH5KD6.js +2 -0
  450. package/dist/cli/chunks/{protocol-handler-WLYTX6FS.js → protocol-handler-CE3Q6LY4.js} +2 -2
  451. package/dist/cli/chunks/{prove-QVNE4V3J.js → prove-7XPN53PY.js} +2 -2
  452. package/dist/cli/chunks/qe-reasoning-bank-DJ2JL6QB.js +2 -0
  453. package/dist/cli/chunks/{quality-DNE2RKE5.js → quality-TT23JRFX.js} +2 -2
  454. package/dist/cli/chunks/{quality-gate-2K35GCSI.js → quality-gate-PPPRP255.js} +3 -3
  455. package/dist/cli/chunks/queen-coordinator-F7E3AS26.js +2 -0
  456. package/dist/cli/chunks/real-embeddings-EYNZIFJE.js +2 -0
  457. package/dist/cli/chunks/ref-validation-QQR64ZXD.js +2 -0
  458. package/dist/cli/chunks/{roocode-installer-NCEZPF5L.js → roocode-installer-UIGS7ZJD.js} +2 -2
  459. package/dist/cli/chunks/router-OZH3QSAU.js +2 -0
  460. package/dist/cli/chunks/routing-feedback-J2E3ADZB.js +2 -0
  461. package/dist/cli/chunks/{routing-handler-4MXXZRYP.js → routing-handler-6AENUIRG.js} +4 -4
  462. package/dist/cli/chunks/{ruvector-commands-WDFMMCMK.js → ruvector-commands-5AWMEV34.js} +2 -2
  463. package/dist/cli/chunks/rvf-dual-writer-HK525Y5Y.js +2 -0
  464. package/dist/cli/chunks/rvf-migration-adapter-Q7FB3BKR.js +2 -0
  465. package/dist/cli/chunks/rvf-migration-coordinator-NWRJ7C22.js +2 -0
  466. package/dist/cli/chunks/rvf-native-adapter-5ZRCGUI6.js +2 -0
  467. package/dist/cli/chunks/rvf-store-integrity-ISKRP563.js +2 -0
  468. package/dist/cli/chunks/safe-db-3OYEPVEH.js +2 -0
  469. package/dist/cli/chunks/schedule-AG4C2EIQ.js +2 -0
  470. package/dist/cli/chunks/scheduler-SQS2CZFZ.js +2 -0
  471. package/dist/cli/chunks/{security-CJJ3WJSB.js → security-325A7FMB.js} +3 -3
  472. package/dist/cli/chunks/{shared-rvf-adapter-6RGCTLHD.js → shared-rvf-adapter-NFL6QSZ6.js} +2 -2
  473. package/dist/cli/chunks/{shared-rvf-dual-writer-KIA6Q6MT.js → shared-rvf-dual-writer-THFDYS2Z.js} +2 -2
  474. package/dist/cli/chunks/sqlite-persistence-MAKDFSHC.js +2 -0
  475. package/dist/cli/chunks/standalone-memory-UD4MJ6GZ.js +2 -0
  476. package/dist/cli/chunks/{status-handler-BADQV2KA.js → status-handler-CPFTN4XL.js} +2 -2
  477. package/dist/cli/chunks/{structural-health-VMYEYRZG.js → structural-health-2MG2IVBL.js} +2 -2
  478. package/dist/cli/chunks/{sync-PXLROLHB.js → sync-EE4VVKOW.js} +2 -2
  479. package/dist/cli/chunks/{sync-ULY7T5II.js → sync-MBTW5XBF.js} +2 -2
  480. package/dist/cli/chunks/task-handler-7H5OYJG4.js +54 -0
  481. package/dist/cli/chunks/task-handlers-NH4GJHCJ.js +9 -0
  482. package/dist/cli/chunks/{test-WCLURQUT.js → test-MPHGT4T6.js} +4 -4
  483. package/dist/cli/chunks/test-scheduling-CHQ4ZLLJ.js +15 -0
  484. package/dist/cli/chunks/token-bootstrap-SSDCYEKK.js +2 -0
  485. package/dist/cli/chunks/{token-usage-DRVG6PKO.js → token-usage-EBXUJNRB.js} +2 -2
  486. package/dist/cli/chunks/{transformers-IMDDAMYQ.js → transformers-ZEKS2OJZ.js} +2 -2
  487. package/dist/cli/chunks/{tree-sitter-wasm-parser-WBZIHVFA.js → tree-sitter-wasm-parser-J6ZMAK37.js} +2 -2
  488. package/dist/cli/chunks/types-KYAA5VLV.js +2 -0
  489. package/dist/cli/chunks/unified-memory-DDWMC435.js +2 -0
  490. package/dist/cli/chunks/unified-memory-hnsw-4JA7SGBK.js +2 -0
  491. package/dist/cli/chunks/unified-persistence-F6OSNTXY.js +2 -0
  492. package/dist/cli/chunks/{upgrade-6ALSDWDD.js → upgrade-UJBJ5AYM.js} +2 -2
  493. package/dist/cli/chunks/{validate-XF4ZG3LC.js → validate-RUV6YMWS.js} +2 -2
  494. package/dist/cli/chunks/{validate-swarm-P5TAFRDA.js → validate-swarm-IVEVMGVM.js} +2 -2
  495. package/dist/cli/chunks/{vibium-2XDXKNKZ.js → vibium-HOGMFJ2Z.js} +2 -2
  496. package/dist/cli/chunks/visual-security-25SMBIYT.js +2 -0
  497. package/dist/cli/chunks/{web-tree-sitter-4JVRQPX5.js → web-tree-sitter-AVWA6HKE.js} +2 -2
  498. package/dist/cli/chunks/{windsurf-installer-WYJXVDO5.js → windsurf-installer-DAH7HI2W.js} +2 -2
  499. package/dist/cli/chunks/{witness-chain-RPZ2SE2V.js → witness-chain-PJOQPFUX.js} +2 -2
  500. package/dist/cli/chunks/witness-chain-ZW6KKUZU.js +2 -0
  501. package/dist/cli/chunks/{witness-key-manager-LXG2VBQQ.js → witness-key-manager-JSTBMG43.js} +2 -2
  502. package/dist/cli/chunks/workflow-TWOIA6LZ.js +51 -0
  503. package/dist/cli/chunks/workflow-orchestrator-UKSIDM7Q.js +2 -0
  504. package/dist/cli/chunks/{wrappers-DIJNNFU6.js → wrappers-UR7BLXKV.js} +2 -2
  505. package/dist/cli/commands/ci.js +54 -28
  506. package/dist/cli/commands/code.js +6 -0
  507. package/dist/cli/commands/eval.js +3 -2
  508. package/dist/cli/commands/fleet.js +35 -16
  509. package/dist/cli/commands/learning-snapshot.d.ts +38 -0
  510. package/dist/cli/commands/learning-snapshot.js +171 -0
  511. package/dist/cli/commands/learning.js +16 -64
  512. package/dist/cli/commands/llm-router.js +13 -12
  513. package/dist/cli/commands/mcp.js +6 -0
  514. package/dist/cli/commands/memory.d.ts +1 -1
  515. package/dist/cli/commands/memory.js +8 -8
  516. package/dist/cli/commands/pipeline.js +9 -0
  517. package/dist/cli/commands/platform.js +15 -2
  518. package/dist/cli/commands/upgrade.d.ts +3 -3
  519. package/dist/cli/commands/upgrade.js +3 -3
  520. package/dist/cli/commands/workflow.js +9 -1
  521. package/dist/cli/handlers/init-handler.d.ts +10 -0
  522. package/dist/cli/handlers/task-handler.js +43 -12
  523. package/dist/cli/helpers/domain-plugins.d.ts +5 -0
  524. package/dist/cli/helpers/domain-plugins.js +11 -0
  525. package/dist/cli/helpers/standalone-memory.d.ts +12 -0
  526. package/dist/cli/helpers/standalone-memory.js +46 -0
  527. package/dist/cli/index.js +54 -49
  528. package/dist/cli/log-gate.d.ts +66 -0
  529. package/dist/cli/log-gate.js +170 -0
  530. package/dist/cli/utils/ci-config.d.ts +3 -0
  531. package/dist/context/sources/git-source.d.ts +2 -0
  532. package/dist/context/sources/git-source.js +9 -2
  533. package/dist/coordination/cancelled-task-settlement.d.ts +11 -0
  534. package/dist/coordination/cancelled-task-settlement.js +15 -0
  535. package/dist/coordination/consensus/providers/claude-provider.d.ts +2 -2
  536. package/dist/coordination/consensus/providers/claude-provider.js +18 -25
  537. package/dist/coordination/consensus/providers/gemini-provider.d.ts +14 -4
  538. package/dist/coordination/consensus/providers/gemini-provider.js +39 -36
  539. package/dist/coordination/consensus/providers/ollama-provider.d.ts +8 -7
  540. package/dist/coordination/consensus/providers/ollama-provider.js +16 -18
  541. package/dist/coordination/consensus/providers/openai-provider.d.ts +14 -4
  542. package/dist/coordination/consensus/providers/openai-provider.js +36 -34
  543. package/dist/coordination/consensus/providers/openrouter-provider.d.ts +5 -5
  544. package/dist/coordination/consensus/providers/openrouter-provider.js +64 -37
  545. package/dist/coordination/handlers/test-execution-handlers.js +5 -3
  546. package/dist/coordination/interfaces.d.ts +2 -2
  547. package/dist/coordination/protocol-executor.js +68 -9
  548. package/dist/coordination/queen-coordinator.js +10 -4
  549. package/dist/coordination/queen-event-handlers.js +17 -0
  550. package/dist/coordination/queen-task-management.js +25 -0
  551. package/dist/coordination/queen-types.d.ts +2 -0
  552. package/dist/coordination/task-executor.js +4 -8
  553. package/dist/coordination/workflow-composition.d.ts +19 -0
  554. package/dist/coordination/workflow-composition.js +114 -0
  555. package/dist/coordination/workflow-orchestrator.d.ts +3 -2
  556. package/dist/coordination/workflow-orchestrator.js +219 -85
  557. package/dist/coordination/workflow-types.d.ts +30 -1
  558. package/dist/coordination/yaml-pipeline-loader.js +9 -5
  559. package/dist/domains/chaos-resilience/services/chaos-engineer.js +2 -7
  560. package/dist/domains/code-intelligence/services/knowledge-graph.js +2 -7
  561. package/dist/domains/code-intelligence/services/metric-collector/test-counter.js +9 -40
  562. package/dist/domains/constants.d.ts +1 -6
  563. package/dist/domains/constants.js +2 -6
  564. package/dist/domains/contract-testing/services/contract-validator.js +2 -7
  565. package/dist/domains/coverage-analysis/services/coverage-analyzer.js +2 -12
  566. package/dist/domains/coverage-analysis/services/gap-detector.js +2 -7
  567. package/dist/domains/defect-intelligence/services/defect-predictor.js +2 -12
  568. package/dist/domains/defect-intelligence/services/root-cause-analyzer.js +2 -7
  569. package/dist/domains/learning-optimization/services/learning-coordinator.js +2 -7
  570. package/dist/domains/quality-assessment/services/deployment-advisor.js +2 -7
  571. package/dist/domains/quality-assessment/services/quality-analyzer.js +2 -7
  572. package/dist/domains/requirements-validation/services/requirements-validator.js +2 -7
  573. package/dist/domains/security-compliance/services/scanners/sast-scanner.js +3 -7
  574. package/dist/domains/test-execution/services/flaky-detector.js +33 -3
  575. package/dist/domains/test-execution/services/retry-handler.js +22 -14
  576. package/dist/domains/test-execution/services/test-executor.js +42 -21
  577. package/dist/domains/test-generation/services/test-generator.js +2 -7
  578. package/dist/domains/visual-accessibility/services/visual-tester.js +2 -7
  579. package/dist/init/codex-installer.js +18 -6
  580. package/dist/init/init-wizard-steps.js +1 -1
  581. package/dist/init/kiro-installer.js +9 -8
  582. package/dist/init/opencode-installer.js +1 -1
  583. package/dist/init/orchestrator.js +1 -0
  584. package/dist/init/phases/07-hooks.js +4 -2
  585. package/dist/init/phases/09-assets.d.ts +10 -0
  586. package/dist/init/phases/09-assets.js +3 -0
  587. package/dist/init/phases/12-verification.js +1 -1
  588. package/dist/init/settings-merge.d.ts +10 -3
  589. package/dist/init/settings-merge.js +40 -9
  590. package/dist/init/token-bootstrap.d.ts +1 -1
  591. package/dist/init/token-bootstrap.js +12 -2
  592. package/dist/init/types.d.ts +10 -0
  593. package/dist/integrations/agentic-flow/model-router/types.js +6 -8
  594. package/dist/integrations/ruvector/brain-exporter.js +26 -15
  595. package/dist/integrations/ruvector/brain-import-audit.d.ts +20 -0
  596. package/dist/integrations/ruvector/brain-import-audit.js +22 -0
  597. package/dist/integrations/ruvector/brain-rvf-exporter.js +33 -30
  598. package/dist/integrations/ruvector/brain-shared.d.ts +5 -1
  599. package/dist/integrations/ruvector/brain-shared.js +70 -4
  600. package/dist/integrations/ruvector/rvf-dual-writer.js +42 -16
  601. package/dist/integrations/ruvector/rvf-store-integrity.d.ts +14 -9
  602. package/dist/integrations/ruvector/rvf-store-integrity.js +39 -9
  603. package/dist/integrations/ruvector/shared-rvf-adapter.js +20 -23
  604. package/dist/kernel/hybrid-backend.d.ts +6 -0
  605. package/dist/kernel/hybrid-backend.js +18 -0
  606. package/dist/kernel/kernel.js +9 -14
  607. package/dist/kernel/memory-factory.js +14 -4
  608. package/dist/kernel/project-root.d.ts +1 -1
  609. package/dist/kernel/project-root.js +33 -10
  610. package/dist/kernel/unified-memory.js +1 -1
  611. package/dist/learning/embedder-identity-store.js +4 -3
  612. package/dist/learning/local-judge-client.d.ts +6 -5
  613. package/dist/learning/local-judge-client.js +7 -6
  614. package/dist/learning/pattern-store.js +34 -12
  615. package/dist/learning/real-embeddings.d.ts +8 -0
  616. package/dist/learning/real-embeddings.js +16 -0
  617. package/dist/learning/rvf-pattern-store.js +10 -3
  618. package/dist/mcp/bundle.js +480 -480
  619. package/dist/mcp/entry.js +2 -0
  620. package/dist/mcp/handlers/index.d.ts +1 -1
  621. package/dist/mcp/handlers/index.js +1 -1
  622. package/dist/mcp/handlers/memory-handlers.d.ts +6 -1
  623. package/dist/mcp/handlers/memory-handlers.js +44 -22
  624. package/dist/mcp/handlers/pipeline-handlers.d.ts +31 -1
  625. package/dist/mcp/handlers/pipeline-handlers.js +63 -0
  626. package/dist/mcp/handlers/task-handlers.d.ts +1 -0
  627. package/dist/mcp/handlers/task-handlers.js +26 -5
  628. package/dist/mcp/protocol-server.d.ts +2 -0
  629. package/dist/mcp/protocol-server.js +105 -49
  630. package/dist/mcp/security/sampling-server.js +2 -1
  631. package/dist/mcp/services/session-store.js +5 -1
  632. package/dist/mcp/tool-annotations.js +1 -1
  633. package/dist/mcp/tools/test-execution/schedule.js +7 -0
  634. package/dist/mcp/types.d.ts +5 -1
  635. package/dist/optimization/session-cache.d.ts +5 -0
  636. package/dist/optimization/session-cache.js +23 -0
  637. package/dist/plugins/cache.d.ts +2 -0
  638. package/dist/plugins/cache.js +15 -2
  639. package/dist/plugins/lifecycle.js +15 -2
  640. package/dist/plugins/manifest.js +7 -5
  641. package/dist/plugins/resolver.d.ts +13 -22
  642. package/dist/plugins/resolver.js +169 -61
  643. package/dist/plugins/version-policy.d.ts +13 -0
  644. package/dist/plugins/version-policy.js +18 -0
  645. package/dist/routing/advisor/multi-model-executor.d.ts +4 -1
  646. package/dist/routing/advisor/multi-model-executor.js +8 -1
  647. package/dist/routing/free-tier/ladder.d.ts +2 -1
  648. package/dist/routing/free-tier/ladder.js +3 -2
  649. package/dist/routing/security/cyber-pin.d.ts +35 -11
  650. package/dist/routing/security/cyber-pin.js +76 -14
  651. package/dist/routing/value-score.js +1 -1
  652. package/dist/shared/git/index.d.ts +1 -0
  653. package/dist/shared/git/index.js +1 -0
  654. package/dist/shared/git/ref-validation.d.ts +20 -0
  655. package/dist/shared/git/ref-validation.js +43 -0
  656. package/dist/shared/llm/anthropic-params.d.ts +40 -0
  657. package/dist/shared/llm/anthropic-params.js +51 -0
  658. package/dist/shared/llm/cost-tracker.d.ts +15 -2
  659. package/dist/shared/llm/cost-tracker.js +62 -10
  660. package/dist/shared/llm/index.d.ts +2 -2
  661. package/dist/shared/llm/index.js +2 -2
  662. package/dist/shared/llm/interfaces.d.ts +1 -1
  663. package/dist/shared/llm/metrics/cost-metrics.js +5 -4
  664. package/dist/shared/llm/model-mapping.js +131 -0
  665. package/dist/shared/llm/model-registry.d.ts +37 -11
  666. package/dist/shared/llm/model-registry.js +393 -18
  667. package/dist/shared/llm/openai-params.d.ts +35 -0
  668. package/dist/shared/llm/openai-params.js +54 -0
  669. package/dist/shared/llm/provider-manager.js +4 -3
  670. package/dist/shared/llm/providers/azure-openai.d.ts +11 -0
  671. package/dist/shared/llm/providers/azure-openai.js +26 -15
  672. package/dist/shared/llm/providers/bedrock.js +11 -19
  673. package/dist/shared/llm/providers/claude.js +6 -29
  674. package/dist/shared/llm/providers/codex.js +4 -3
  675. package/dist/shared/llm/providers/gemini.d.ts +3 -2
  676. package/dist/shared/llm/providers/gemini.js +19 -10
  677. package/dist/shared/llm/providers/ollama.d.ts +2 -0
  678. package/dist/shared/llm/providers/ollama.js +30 -20
  679. package/dist/shared/llm/providers/openai.js +10 -17
  680. package/dist/shared/llm/providers/openrouter.d.ts +1 -1
  681. package/dist/shared/llm/providers/openrouter.js +57 -21
  682. package/dist/shared/llm/router/agent-router-config.js +33 -32
  683. package/dist/shared/llm/router/hybrid-router.js +21 -9
  684. package/dist/shared/llm/router/routing-rules.js +9 -8
  685. package/dist/shared/llm/router/types.js +81 -13
  686. package/dist/shared/llm/translation/message-formatter.js +4 -23
  687. package/dist/shared/types/index.d.ts +6 -0
  688. package/dist/shared/types/index.js +8 -0
  689. package/dist/shared/vitest-json-report.d.ts +7 -7
  690. package/dist/shared/vitest-json-report.js +23 -14
  691. package/dist/test-scheduling/executors/vitest-executor.d.ts +7 -2
  692. package/dist/test-scheduling/executors/vitest-executor.js +157 -47
  693. package/dist/test-scheduling/git-aware/test-selector.js +3 -0
  694. package/dist/test-scheduling/phase-scheduler.d.ts +1 -0
  695. package/dist/test-scheduling/phase-scheduler.js +23 -1
  696. package/package.json +2 -1
  697. package/dist/cli/chunks/adapter-AKQYU6UH.js +0 -2
  698. package/dist/cli/chunks/aqe-learning-engine-MICRPL3N.js +0 -2
  699. package/dist/cli/chunks/base-DZK36ITB.js +0 -2
  700. package/dist/cli/chunks/brain-handler-H5OVZ22L.js +0 -90
  701. package/dist/cli/chunks/browser-workflow-ADK54DOE.js +0 -2
  702. package/dist/cli/chunks/chunk-26GM5CWD.js +0 -13
  703. package/dist/cli/chunks/chunk-42VSQ2MX.js +0 -4
  704. package/dist/cli/chunks/chunk-44WISFTU.js +0 -2
  705. package/dist/cli/chunks/chunk-4OUPCTBS.js +0 -16
  706. package/dist/cli/chunks/chunk-4TXAP3YH.js +0 -2
  707. package/dist/cli/chunks/chunk-4W7QVUNO.js +0 -2
  708. package/dist/cli/chunks/chunk-527HQAY7.js +0 -14
  709. package/dist/cli/chunks/chunk-5DFHE4H5.js +0 -180
  710. package/dist/cli/chunks/chunk-5P3G6ZW4.js +0 -2
  711. package/dist/cli/chunks/chunk-6F2RM6X2.js +0 -2
  712. package/dist/cli/chunks/chunk-74PK3NEW.js +0 -15
  713. package/dist/cli/chunks/chunk-7Y2CEXRS.js +0 -65
  714. package/dist/cli/chunks/chunk-AWNYEAGB.js +0 -2
  715. package/dist/cli/chunks/chunk-CBOPBYPU.js +0 -2
  716. package/dist/cli/chunks/chunk-FD2JFEQC.js +0 -2
  717. package/dist/cli/chunks/chunk-G6DCESPU.js +0 -2
  718. package/dist/cli/chunks/chunk-I4NDQGKP.js +0 -2
  719. package/dist/cli/chunks/chunk-L2GKMBDP.js +0 -2
  720. package/dist/cli/chunks/chunk-QLWNXBRU.js +0 -2
  721. package/dist/cli/chunks/chunk-R2AFVFRF.js +0 -2
  722. package/dist/cli/chunks/chunk-ROX7NLS4.js +0 -14
  723. package/dist/cli/chunks/chunk-SHGKY3QB.js +0 -2
  724. package/dist/cli/chunks/chunk-SJPZSCZP.js +0 -27
  725. package/dist/cli/chunks/chunk-T62DH4GG.js +0 -11
  726. package/dist/cli/chunks/chunk-TGLAWI62.js +0 -4
  727. package/dist/cli/chunks/chunk-UMNYF5EZ.js +0 -2
  728. package/dist/cli/chunks/chunk-UTVRQEZM.js +0 -54
  729. package/dist/cli/chunks/chunk-Y2DVFVGI.js +0 -2
  730. package/dist/cli/chunks/chunk-Y5SQBI2F.js +0 -2
  731. package/dist/cli/chunks/ci-YVKDQWIX.js +0 -81
  732. package/dist/cli/chunks/client-M72GXFVQ.js +0 -2
  733. package/dist/cli/chunks/codex-installer-2AVEO4EA.js +0 -14
  734. package/dist/cli/chunks/complexity-analyzer-LEDG62YK.js +0 -2
  735. package/dist/cli/chunks/core-handlers-C32RAMVI.js +0 -2
  736. package/dist/cli/chunks/cost-tracker-GJIFB2BM.js +0 -2
  737. package/dist/cli/chunks/cross-domain-router-UGFUCPKC.js +0 -2
  738. package/dist/cli/chunks/dream-UFBBXY5W.js +0 -2
  739. package/dist/cli/chunks/embed-and-insert-pattern-DUW6K35A.js +0 -3
  740. package/dist/cli/chunks/eval-PR6YWDFM.js +0 -17
  741. package/dist/cli/chunks/fleet-QNT6X2YI.js +0 -43
  742. package/dist/cli/chunks/heartbeat-scheduler-VQWHSGTY.js +0 -2
  743. package/dist/cli/chunks/hnsw-adapter-BS3NXWGU.js +0 -2
  744. package/dist/cli/chunks/hnsw-index-JP26B4HW.js +0 -2
  745. package/dist/cli/chunks/impact-analyzer-WRE4CWPJ.js +0 -2
  746. package/dist/cli/chunks/init-wizard-OFOEYB75.js +0 -2
  747. package/dist/cli/chunks/kernel-MXNFWNUD.js +0 -2
  748. package/dist/cli/chunks/knowledge-graph-7JE2TVKJ.js +0 -2
  749. package/dist/cli/chunks/learning-7B5NITDV.js +0 -122
  750. package/dist/cli/chunks/llm-router-BNEPT5OB.js +0 -37
  751. package/dist/cli/chunks/llm-router-service-GTDVDKSU.js +0 -2
  752. package/dist/cli/chunks/load-test-JZ4CLSBF.js +0 -2
  753. package/dist/cli/chunks/mcp-THXEINCL.js +0 -2
  754. package/dist/cli/chunks/memory-backend-Q54CC5A5.js +0 -2
  755. package/dist/cli/chunks/memory-handlers-IIBJXKHZ.js +0 -2
  756. package/dist/cli/chunks/multi-model-executor-HEDVOZ6X.js +0 -14
  757. package/dist/cli/chunks/pattern-null-store-W33O7FYO.js +0 -2
  758. package/dist/cli/chunks/pipeline-UOG6UO6D.js +0 -19
  759. package/dist/cli/chunks/platform-Q7UH7FZQ.js +0 -2
  760. package/dist/cli/chunks/protocol-executor-VGN4M7XY.js +0 -2
  761. package/dist/cli/chunks/qe-reasoning-bank-7VB5LJGS.js +0 -2
  762. package/dist/cli/chunks/queen-coordinator-HIDMJMMG.js +0 -2
  763. package/dist/cli/chunks/real-embeddings-SF42ML7G.js +0 -2
  764. package/dist/cli/chunks/router-CTIJS4D7.js +0 -2
  765. package/dist/cli/chunks/routing-feedback-LFYYZS5J.js +0 -2
  766. package/dist/cli/chunks/rvf-dual-writer-MNPMIWVM.js +0 -2
  767. package/dist/cli/chunks/rvf-migration-adapter-DXOKSSNW.js +0 -2
  768. package/dist/cli/chunks/rvf-migration-coordinator-JT7ZCJY7.js +0 -2
  769. package/dist/cli/chunks/rvf-native-adapter-PZKUKA7R.js +0 -2
  770. package/dist/cli/chunks/rvf-store-integrity-Q3FGYKFT.js +0 -2
  771. package/dist/cli/chunks/safe-db-73BLFV2C.js +0 -2
  772. package/dist/cli/chunks/schedule-YVTGTTI4.js +0 -2
  773. package/dist/cli/chunks/scheduler-5DSAFIRQ.js +0 -2
  774. package/dist/cli/chunks/sqlite-persistence-LRG4IPCU.js +0 -2
  775. package/dist/cli/chunks/task-handler-L7E2I267.js +0 -49
  776. package/dist/cli/chunks/task-handlers-6DPKE4AK.js +0 -9
  777. package/dist/cli/chunks/test-scheduling-4CNJA6TW.js +0 -15
  778. package/dist/cli/chunks/token-bootstrap-GTI24JAL.js +0 -2
  779. package/dist/cli/chunks/types-TXMY5M2K.js +0 -2
  780. package/dist/cli/chunks/unified-memory-VBQ572X4.js +0 -2
  781. package/dist/cli/chunks/unified-memory-hnsw-J3L74ZRY.js +0 -2
  782. package/dist/cli/chunks/unified-persistence-EM2VYRTQ.js +0 -2
  783. package/dist/cli/chunks/visual-security-GX4S7K6O.js +0 -2
  784. package/dist/cli/chunks/witness-chain-QGKMHCNW.js +0 -2
  785. package/dist/cli/chunks/workflow-2OYNO7UU.js +0 -51
  786. package/dist/cli/chunks/workflow-orchestrator-KWHIJMFV.js +0 -2
@@ -0,0 +1,16 @@
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.14.5");process.exit(0)}
2
+ import{a as q}from"./chunk-CYE2TJFV.js";import{n as Q,o as V}from"./chunk-EFV4ADMO.js";import{a as F,c as y,d}from"./chunk-XEZIIQYJ.js";import{a as h,b as M,c as H}from"./chunk-J5UNP6W3.js";import{i as N}from"./chunk-W2XCZU62.js";import{f as U}from"./chunk-JSZ663MU.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 +1,2 @@
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.14.3");process.exit(0)}
2
- import{a as N,d as P}from"./chunk-5IAB5NRZ.js";import{b,e as k}from"./chunk-OVDKWCD7.js";import{a as p,d as F}from"./chunk-XA7CG3LH.js";import{a as T,b as E}from"./chunk-YEXPFHV6.js";import{a as H,b as O}from"./chunk-IP7NSFQQ.js";import{c as z,g as S}from"./chunk-Y2DVFVGI.js";function x(l){let e=0;for(let t=0;t<l.length;t++)e+=l[t]*l[t];return Math.sqrt(e)}function C(l,e,t,s){let n=t*s;if(n===0)return 0;let o=0;for(let r=0;r<l.length;r++)o+=l[r]*e[r];return o/n}function U(l={}){let{name:e="default",...t}=l;return new M(e,t)}var f,w,v,I,A,M,D=z(()=>{F();P();k();E();f=null,w=null;try{let l=(O(),S(H));f=l.differentiableSearch,w=l.init}catch{}v=class{data=[];compareFn;constructor(e){this.compareFn=e}push(e){this.data.push(e),this.bubbleUp(this.data.length-1)}pop(){if(this.data.length===0)return;let e=this.data[0],t=this.data.pop();return this.data.length>0&&(this.data[0]=t,this.sinkDown(0)),e}peek(){return this.data[0]}size(){return this.data.length}bubbleUp(e){for(;e>0;){let t=e-1>>1;if(this.compareFn(this.data[e],this.data[t])<0)[this.data[e],this.data[t]]=[this.data[t],this.data[e]],e=t;else break}}sinkDown(e){let t=this.data.length;for(;;){let s=e,n=2*e+1,o=2*e+2;if(n<t&&this.compareFn(this.data[n],this.data[s])<0&&(s=n),o<t&&this.compareFn(this.data[o],this.data[s])<0&&(s=o),s!==e)[this.data[e],this.data[s]]=[this.data[s],this.data[e]],e=s;else break}}},I=class{nodes=new Map;M=b.M_CONNECTIONS;Mmax0=b.M_CONNECTIONS*2;efConstruction=b.EF_CONSTRUCTION;efSearch=b.EF_SEARCH;mL=1/Math.log(b.M_CONNECTIONS);maxLevel=16;entryPoint=null;currentMaxLevel=-1;randomLevel(){return Math.min(Math.floor(-Math.log(N())*this.mL),this.maxLevel)}similarity(e,t){let s=this.nodes.get(t);return s?p(e,s.embedding):-1}searchLayer(e,t,s){let n=t,o=this.similarity(e,n),r=!0;for(;r;){r=!1;let a=this.nodes.get(n);if(!a)break;let h=a.neighbors.get(s)??[];for(let d of h){if(!this.nodes.has(d))continue;let i=this.similarity(e,d);i>o&&(n=d,o=i,r=!0)}}return n}searchLayerBeam(e,t,s,n){let o=new Set(t),r=t.filter(i=>this.nodes.has(i)).map(i=>({id:i,score:this.similarity(e,i)})),a=new v((i,c)=>c.score-i.score),h=new v((i,c)=>i.score-c.score);for(let i of r)a.push(i),h.push(i);for(;a.size()>0;){let i=a.pop();if(h.size()>=n&&i.score<h.peek().score)break;let c=this.nodes.get(i.id);if(!c)continue;let u=c.neighbors.get(s)??[];for(let m of u){if(o.has(m)||(o.add(m),!this.nodes.has(m)))continue;let g=this.similarity(e,m),y=h.size()>=n?h.peek().score:-1/0;if(h.size()<n||g>y){let L={id:m,score:g};a.push(L),h.push(L),h.size()>n&&h.pop()}}}let d=[];for(;h.size()>0;)d.push(h.pop());return d.reverse(),d}selectNeighbors(e,t,s){return t.sort((n,o)=>o.score-n.score).slice(0,s).map(n=>n.id)}getMaxConnections(e){return e===0?this.Mmax0:this.M}add(e,t){this.nodes.has(e)&&this.remove(e);let s=this.randomLevel(),n={id:e,embedding:t,neighbors:new Map};for(let r=0;r<=s;r++)n.neighbors.set(r,[]);if(this.nodes.set(e,n),this.entryPoint===null){this.entryPoint=e,this.currentMaxLevel=s;return}let o=this.entryPoint;for(let r=this.currentMaxLevel;r>s;r--)o=this.searchLayer(t,o,r);for(let r=Math.min(s,this.currentMaxLevel);r>=0;r--){let a=this.getMaxConnections(r),h=this.searchLayerBeam(t,[o],r,this.efConstruction),d=this.selectNeighbors(t,h,a);n.neighbors.set(r,[...d]);for(let i of d){let c=this.nodes.get(i);if(!c)continue;let u=c.neighbors.get(r)??[];if(u.push(e),u.length>a){let m=u.filter(g=>this.nodes.has(g)).map(g=>({id:g,score:p(c.embedding,this.nodes.get(g).embedding)}));m.sort((g,y)=>y.score-g.score),c.neighbors.set(r,m.slice(0,a).map(g=>g.id))}else c.neighbors.set(r,u)}h.length>0&&(o=h[0].id)}s>this.currentMaxLevel&&(this.entryPoint=e,this.currentMaxLevel=s)}remove(e){let t=this.nodes.get(e);if(!t)return!1;for(let[s,n]of t.neighbors.entries())for(let o of n){let r=this.nodes.get(o);if(!r)continue;let a=r.neighbors.get(s);if(!a)continue;let h=a.indexOf(e);h!==-1&&a.splice(h,1);let d=this.getMaxConnections(s);if(a.length<d){for(let i of n)if(i!==o&&i!==e&&this.nodes.has(i)&&!a.includes(i)){a.push(i);let c=this.nodes.get(i);if(c){let u=c.neighbors.get(s)??[];!u.includes(o)&&u.length<d&&(u.push(o),c.neighbors.set(s,u))}if(a.length>=d)break}}r.neighbors.set(s,a)}if(this.nodes.delete(e),this.entryPoint===e)if(this.nodes.size===0)this.entryPoint=null,this.currentMaxLevel=-1;else{let s=null,n=-1;for(let[o,r]of this.nodes.entries()){let a=-1;for(let h of r.neighbors.keys())h>a&&(a=h);a>n&&(n=a,s=o)}this.entryPoint=s,this.currentMaxLevel=n}return!0}search(e,t){if(this.nodes.size===0||this.entryPoint===null)return[];if(this.nodes.size===1){let r=this.nodes.get(this.entryPoint);return[{id:r.id,score:p(e,r.embedding)}]}let s=this.entryPoint;for(let r=this.currentMaxLevel;r>0;r--)s=this.searchLayer(e,s,r);let n=Math.max(this.efSearch,t);return this.searchLayerBeam(e,[s],0,n).slice(0,t)}size(){return this.nodes.size}clear(){this.nodes.clear(),this.entryPoint=null,this.currentMaxLevel=-1}};A=class{ids=[];vectors=[];norms=[];idToIndex=new Map;initialized=!1;constructor(){if(w&&!this.initialized)try{w(),this.initialized=!0}catch{this.initialized=f!==null}}add(e,t){let s=new Float32Array(t),n=x(s);if(this.idToIndex.has(e)){let r=this.idToIndex.get(e);this.vectors[r]=s,this.norms[r]=n;return}let o=this.ids.length;this.ids.push(e),this.vectors.push(s),this.norms.push(n),this.idToIndex.set(e,o)}search(e,t){if(this.ids.length===0)return[];let s=Math.min(t,this.ids.length),n=this.vectors.length>0?this.vectors[0].length:0,o=e.length,r=n===o;if(f&&this.vectors.length>0&&r){let i=new Float32Array(e),c=x(i);return f(i,this.vectors,s,1).indices.map(m=>({id:this.ids[m],score:C(i,this.vectors[m],c,this.norms[m])}))}let a=new Float32Array(e),h=x(a),d=[];for(let i=0;i<this.ids.length;i++){let c=this.vectors[i];if(c.length!==a.length){i===0&&console.warn(`[RuvectorFlatIndex] Dimension mismatch: query=${a.length}, stored=${c.length}. Skipping ${this.ids.length} mismatched vectors. Re-index with correct dimensions.`);continue}else d.push({id:this.ids[i],score:C(a,c,h,this.norms[i])})}return d.sort((i,c)=>c.score-i.score),d.slice(0,s)}remove(e){let t=this.idToIndex.get(e);if(t===void 0)return!1;let s=this.ids.length-1;if(t!==s){let n=this.ids[s];this.ids[t]=n,this.vectors[t]=this.vectors[s],this.norms[t]=this.norms[s],this.idToIndex.set(n,t)}return this.ids.pop(),this.vectors.pop(),this.norms.pop(),this.idToIndex.delete(e),!0}clear(){this.ids=[],this.vectors=[],this.norms=[],this.idToIndex.clear()}size(){return this.ids.length}},M=class{adapter;constructor(e,t){this.adapter=T.create(e,t)}add(e,t){this.adapter.addByStringId(e,t)}search(e,t){return this.adapter.searchByArray(e,t)}remove(e){return this.adapter.removeByStringId(e)}clear(){this.adapter.clear()}size(){return this.adapter.size()}recall(){return this.adapter.recall()}getProvider(){return this.adapter}}});export{v as a,I as b,A as c,M as d,U as e,D as f};
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.14.5");process.exit(0)}
2
+ import{a as N,d as P}from"./chunk-XZSMZHM2.js";import{b,e as k}from"./chunk-CVMNJSCB.js";import{a as p,d as F}from"./chunk-NU7UTXMP.js";import{a as T,b as E}from"./chunk-D6OUCB2H.js";import{a as H,b as O}from"./chunk-6A44AOGN.js";import{b as z,f as S}from"./chunk-JSZ663MU.js";function x(l){let e=0;for(let t=0;t<l.length;t++)e+=l[t]*l[t];return Math.sqrt(e)}function C(l,e,t,s){let n=t*s;if(n===0)return 0;let o=0;for(let r=0;r<l.length;r++)o+=l[r]*e[r];return o/n}function U(l={}){let{name:e="default",...t}=l;return new M(e,t)}var f,w,v,I,A,M,D=z(()=>{F();P();k();E();f=null,w=null;try{let l=(O(),S(H));f=l.differentiableSearch,w=l.init}catch{}v=class{data=[];compareFn;constructor(e){this.compareFn=e}push(e){this.data.push(e),this.bubbleUp(this.data.length-1)}pop(){if(this.data.length===0)return;let e=this.data[0],t=this.data.pop();return this.data.length>0&&(this.data[0]=t,this.sinkDown(0)),e}peek(){return this.data[0]}size(){return this.data.length}bubbleUp(e){for(;e>0;){let t=e-1>>1;if(this.compareFn(this.data[e],this.data[t])<0)[this.data[e],this.data[t]]=[this.data[t],this.data[e]],e=t;else break}}sinkDown(e){let t=this.data.length;for(;;){let s=e,n=2*e+1,o=2*e+2;if(n<t&&this.compareFn(this.data[n],this.data[s])<0&&(s=n),o<t&&this.compareFn(this.data[o],this.data[s])<0&&(s=o),s!==e)[this.data[e],this.data[s]]=[this.data[s],this.data[e]],e=s;else break}}},I=class{nodes=new Map;M=b.M_CONNECTIONS;Mmax0=b.M_CONNECTIONS*2;efConstruction=b.EF_CONSTRUCTION;efSearch=b.EF_SEARCH;mL=1/Math.log(b.M_CONNECTIONS);maxLevel=16;entryPoint=null;currentMaxLevel=-1;randomLevel(){return Math.min(Math.floor(-Math.log(N())*this.mL),this.maxLevel)}similarity(e,t){let s=this.nodes.get(t);return s?p(e,s.embedding):-1}searchLayer(e,t,s){let n=t,o=this.similarity(e,n),r=!0;for(;r;){r=!1;let a=this.nodes.get(n);if(!a)break;let h=a.neighbors.get(s)??[];for(let d of h){if(!this.nodes.has(d))continue;let i=this.similarity(e,d);i>o&&(n=d,o=i,r=!0)}}return n}searchLayerBeam(e,t,s,n){let o=new Set(t),r=t.filter(i=>this.nodes.has(i)).map(i=>({id:i,score:this.similarity(e,i)})),a=new v((i,c)=>c.score-i.score),h=new v((i,c)=>i.score-c.score);for(let i of r)a.push(i),h.push(i);for(;a.size()>0;){let i=a.pop();if(h.size()>=n&&i.score<h.peek().score)break;let c=this.nodes.get(i.id);if(!c)continue;let u=c.neighbors.get(s)??[];for(let m of u){if(o.has(m)||(o.add(m),!this.nodes.has(m)))continue;let g=this.similarity(e,m),y=h.size()>=n?h.peek().score:-1/0;if(h.size()<n||g>y){let L={id:m,score:g};a.push(L),h.push(L),h.size()>n&&h.pop()}}}let d=[];for(;h.size()>0;)d.push(h.pop());return d.reverse(),d}selectNeighbors(e,t,s){return t.sort((n,o)=>o.score-n.score).slice(0,s).map(n=>n.id)}getMaxConnections(e){return e===0?this.Mmax0:this.M}add(e,t){this.nodes.has(e)&&this.remove(e);let s=this.randomLevel(),n={id:e,embedding:t,neighbors:new Map};for(let r=0;r<=s;r++)n.neighbors.set(r,[]);if(this.nodes.set(e,n),this.entryPoint===null){this.entryPoint=e,this.currentMaxLevel=s;return}let o=this.entryPoint;for(let r=this.currentMaxLevel;r>s;r--)o=this.searchLayer(t,o,r);for(let r=Math.min(s,this.currentMaxLevel);r>=0;r--){let a=this.getMaxConnections(r),h=this.searchLayerBeam(t,[o],r,this.efConstruction),d=this.selectNeighbors(t,h,a);n.neighbors.set(r,[...d]);for(let i of d){let c=this.nodes.get(i);if(!c)continue;let u=c.neighbors.get(r)??[];if(u.push(e),u.length>a){let m=u.filter(g=>this.nodes.has(g)).map(g=>({id:g,score:p(c.embedding,this.nodes.get(g).embedding)}));m.sort((g,y)=>y.score-g.score),c.neighbors.set(r,m.slice(0,a).map(g=>g.id))}else c.neighbors.set(r,u)}h.length>0&&(o=h[0].id)}s>this.currentMaxLevel&&(this.entryPoint=e,this.currentMaxLevel=s)}remove(e){let t=this.nodes.get(e);if(!t)return!1;for(let[s,n]of t.neighbors.entries())for(let o of n){let r=this.nodes.get(o);if(!r)continue;let a=r.neighbors.get(s);if(!a)continue;let h=a.indexOf(e);h!==-1&&a.splice(h,1);let d=this.getMaxConnections(s);if(a.length<d){for(let i of n)if(i!==o&&i!==e&&this.nodes.has(i)&&!a.includes(i)){a.push(i);let c=this.nodes.get(i);if(c){let u=c.neighbors.get(s)??[];!u.includes(o)&&u.length<d&&(u.push(o),c.neighbors.set(s,u))}if(a.length>=d)break}}r.neighbors.set(s,a)}if(this.nodes.delete(e),this.entryPoint===e)if(this.nodes.size===0)this.entryPoint=null,this.currentMaxLevel=-1;else{let s=null,n=-1;for(let[o,r]of this.nodes.entries()){let a=-1;for(let h of r.neighbors.keys())h>a&&(a=h);a>n&&(n=a,s=o)}this.entryPoint=s,this.currentMaxLevel=n}return!0}search(e,t){if(this.nodes.size===0||this.entryPoint===null)return[];if(this.nodes.size===1){let r=this.nodes.get(this.entryPoint);return[{id:r.id,score:p(e,r.embedding)}]}let s=this.entryPoint;for(let r=this.currentMaxLevel;r>0;r--)s=this.searchLayer(e,s,r);let n=Math.max(this.efSearch,t);return this.searchLayerBeam(e,[s],0,n).slice(0,t)}size(){return this.nodes.size}clear(){this.nodes.clear(),this.entryPoint=null,this.currentMaxLevel=-1}};A=class{ids=[];vectors=[];norms=[];idToIndex=new Map;initialized=!1;constructor(){if(w&&!this.initialized)try{w(),this.initialized=!0}catch{this.initialized=f!==null}}add(e,t){let s=new Float32Array(t),n=x(s);if(this.idToIndex.has(e)){let r=this.idToIndex.get(e);this.vectors[r]=s,this.norms[r]=n;return}let o=this.ids.length;this.ids.push(e),this.vectors.push(s),this.norms.push(n),this.idToIndex.set(e,o)}search(e,t){if(this.ids.length===0)return[];let s=Math.min(t,this.ids.length),n=this.vectors.length>0?this.vectors[0].length:0,o=e.length,r=n===o;if(f&&this.vectors.length>0&&r){let i=new Float32Array(e),c=x(i);return f(i,this.vectors,s,1).indices.map(m=>({id:this.ids[m],score:C(i,this.vectors[m],c,this.norms[m])}))}let a=new Float32Array(e),h=x(a),d=[];for(let i=0;i<this.ids.length;i++){let c=this.vectors[i];if(c.length!==a.length){i===0&&console.warn(`[RuvectorFlatIndex] Dimension mismatch: query=${a.length}, stored=${c.length}. Skipping ${this.ids.length} mismatched vectors. Re-index with correct dimensions.`);continue}else d.push({id:this.ids[i],score:C(a,c,h,this.norms[i])})}return d.sort((i,c)=>c.score-i.score),d.slice(0,s)}remove(e){let t=this.idToIndex.get(e);if(t===void 0)return!1;let s=this.ids.length-1;if(t!==s){let n=this.ids[s];this.ids[t]=n,this.vectors[t]=this.vectors[s],this.norms[t]=this.norms[s],this.idToIndex.set(n,t)}return this.ids.pop(),this.vectors.pop(),this.norms.pop(),this.idToIndex.delete(e),!0}clear(){this.ids=[],this.vectors=[],this.norms=[],this.idToIndex.clear()}size(){return this.ids.length}},M=class{adapter;constructor(e,t){this.adapter=T.create(e,t)}add(e,t){this.adapter.addByStringId(e,t)}search(e,t){return this.adapter.searchByArray(e,t)}remove(e){return this.adapter.removeByStringId(e)}clear(){this.adapter.clear()}size(){return this.adapter.size()}recall(){return this.adapter.recall()}getProvider(){return this.adapter}}});export{v as a,I as b,A as c,M as d,U as e,D as f};
@@ -1,5 +1,5 @@
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.14.3");process.exit(0)}
2
- import{b as P,c as q,d as R,e as D,g as O,h as j,i as x,j as $,k as L,l as N,m as Q,n as M}from"./chunk-V4AOVDCJ.js";import{b as v,d as T}from"./chunk-YAKS3CAB.js";import{a as y,c as A}from"./chunk-HRUU7E3D.js";import{a as _,b as re}from"./chunk-MXMFGSWR.js";T();import{existsSync as f,mkdirSync as U,writeFileSync as b,readFileSync as C,copyFileSync as se}from"fs";import{join as p,dirname as ae}from"path";async function z(t,e){if(!e.hooks.claudeCode)return!1;let n=p(t,".claude");f(n)||U(n,{recursive:!0});let r=p(n,"settings.json"),s={};if(f(r))try{let m=C(r,"utf-8");s=v(m)}catch{s={}}let i={PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" guard --file "$TOOL_INPUT_file_path" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-command --command "$TOOL_INPUT_command" --json',timeout:3,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-command --command "$TOOL_INPUT_command" --success true --json',timeout:5,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-task --task-id "$TOOL_RESULT_agent_id" --agent "$TOOL_INPUT_subagent_type" --success true --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" route --json',timeout:5,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-start --session-id "$SESSION_ID" --json',timeout:10,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-end --save-state --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-route --success true --json',timeout:5,continueOnError:!0}]}]},u=s.hooks||{};s.hooks=O(u,i);let l=s.env;s.env=j(l,x(e));let d=L(e,t);$(s,d);let a=s.enabledMcpjsonServers||[];return a=a.filter(m=>m!=="aqe"),a.includes("agentic-qe")||a.push("agentic-qe"),s.enabledMcpjsonServers=a,D(r),b(r,JSON.stringify(s,null,2),"utf-8"),await oe(t),!0}async function oe(t){let e=p(t,".claude","hooks");f(e)||U(e,{recursive:!0});let n=p(e,"cross-phase-memory.yaml");if(f(n))return;let r=[p(ae(import.meta.url.replace("file://","")),"..","..","assets","hooks","cross-phase-memory.yaml"),p(process.cwd(),"assets","hooks","cross-phase-memory.yaml"),p(process.cwd(),"v3","assets","hooks","cross-phase-memory.yaml")];for(let i of r)try{if(f(i)){se(i,n),console.log(" \u2713 Cross-phase memory hooks installed");return}}catch{}b(n,`# Cross-Phase Memory Hooks Configuration
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.14.5");process.exit(0)}
2
+ import{b as P,c as q,d as R,e as D,g as O,h as j,i as x,j as $,k as L,l as N,m as Q,n as M}from"./chunk-XQSIRBKT.js";import{b as v,d as T}from"./chunk-IJHCIXJC.js";import{a as y,c as A}from"./chunk-J5UNP6W3.js";import{a as _,b as re}from"./chunk-HVU64GP5.js";T();import{existsSync as f,mkdirSync as U,writeFileSync as b,readFileSync as C,copyFileSync as se}from"fs";import{join as p,dirname as ae}from"path";async function z(t,e){if(!e.hooks.claudeCode)return!1;let n=p(t,".claude");f(n)||U(n,{recursive:!0});let r=p(n,"settings.json"),s={};if(f(r))try{let m=C(r,"utf-8");s=v(m)}catch{s={}}let i={PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" guard --file "$TOOL_INPUT_file_path" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-command --command "$TOOL_INPUT_command" --json',timeout:3,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-command --command "$TOOL_INPUT_command" --success true --json',timeout:5,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-task --task-id "$TOOL_RESULT_agent_id" --agent "$TOOL_INPUT_subagent_type" --success true --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" route --json',timeout:5,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-start --session-id "$SESSION_ID" --json',timeout:10,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-end --save-state --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-route --success true --json',timeout:5,continueOnError:!0}]}]},u=s.hooks||{};s.hooks=O(u,i);let l=s.env;s.env=j(l,x(e));let d=L(e,t);$(s,d);let a=s.enabledMcpjsonServers||[];return a=a.filter(m=>m!=="aqe"),a.includes("agentic-qe")||a.push("agentic-qe"),s.enabledMcpjsonServers=a,D(r),b(r,JSON.stringify(s,null,2),"utf-8"),await oe(t),!0}async function oe(t){let e=p(t,".claude","hooks");f(e)||U(e,{recursive:!0});let n=p(e,"cross-phase-memory.yaml");if(f(n))return;let r=[p(ae(import.meta.url.replace("file://","")),"..","..","assets","hooks","cross-phase-memory.yaml"),p(process.cwd(),"assets","hooks","cross-phase-memory.yaml"),p(process.cwd(),"v3","assets","hooks","cross-phase-memory.yaml")];for(let i of r)try{if(f(i)){se(i,n),console.log(" \u2713 Cross-phase memory hooks installed");return}}catch{}b(n,`# Cross-Phase Memory Hooks Configuration
3
3
  # Generated by aqe init
4
4
  # See: https://github.com/anthropics/agentic-qe/docs/cross-phase-memory.md
5
5
 
@@ -276,7 +276,7 @@ aqe init --auto
276
276
  `).run("aqe_version",JSON.stringify(e),i),s.prepare(`
277
277
  INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
278
278
  VALUES (?, '_system', ?, ?)
279
- `).run("init_timestamp",JSON.stringify(new Date().toISOString()),i),s.close(),console.log(` \u2713 Version ${e} written to memory.db`),!0}catch(i){return s.close(),console.warn(` \u26A0 Could not write version: ${y(i)}`),!1}}catch(r){return console.warn(` \u26A0 Could not open memory.db: ${y(r)}`),!1}}async function V(t){let e=null;try{e=(await import("./better-sqlite3-RP4DEGK3.js")).default}catch{throw new Error(`SQLite persistence REQUIRED but better-sqlite3 is not installed.
279
+ `).run("init_timestamp",JSON.stringify(new Date().toISOString()),i),s.close(),console.log(` \u2713 Version ${e} written to memory.db`),!0}catch(i){return s.close(),console.warn(` \u26A0 Could not write version: ${y(i)}`),!1}}catch(r){return console.warn(` \u26A0 Could not open memory.db: ${y(r)}`),!1}}async function V(t){let e=null;try{e=(await import("./better-sqlite3-4DSBPDRH.js")).default}catch{throw new Error(`SQLite persistence REQUIRED but better-sqlite3 is not installed.
280
280
  Install it with: npm install better-sqlite3
281
281
  If you see native compilation errors, ensure build tools are installed:
282
282
  - macOS: xcode-select --install
@@ -302,7 +302,7 @@ Database path: ${r}
302
302
  Ensure the directory is writable and has sufficient disk space.`)}}async function J(t){let e=o(t,".agentic-qe","memory.db");if(!h(e))return!1;try{let n=_(e),r=n.prepare(`
303
303
  SELECT COUNT(*) as count FROM kv_store
304
304
  WHERE namespace = 'code-intelligence:kg'
305
- `).get();return n.close(),r.count>0}catch{return!1}}async function B(t){try{let{KnowledgeGraphService:e}=await import("./knowledge-graph-7JE2TVKJ.js"),{InMemoryBackend:n}=await import("./memory-backend-Q54CC5A5.js"),r=new n;await r.initialize();let s=new e(r,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0}),u=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:t,ignore:["node_modules/**","dist/**","coverage/**",".agentic-qe/**"]}),l=await s.index({paths:u.map(d=>o(t,d)),incremental:!1,includeTests:!0});return s.destroy(),l.success?{status:"indexed",entries:l.value.nodesCreated+l.value.edgesCreated}:{status:"error",entries:0}}catch(e){return console.warn("Code intelligence scan warning:",y(e)),{status:"skipped",entries:0}}}async function H(t){let e=o(t,".agentic-qe","memory.db");try{let n=_(e),r=n.prepare(`
305
+ `).get();return n.close(),r.count>0}catch{return!1}}async function B(t){try{let{KnowledgeGraphService:e}=await import("./knowledge-graph-4ACGVJQK.js"),{InMemoryBackend:n}=await import("./memory-backend-2MPGI6JW.js"),r=new n;await r.initialize();let s=new e(r,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0}),u=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:t,ignore:["node_modules/**","dist/**","coverage/**",".agentic-qe/**"]}),l=await s.index({paths:u.map(d=>o(t,d)),incremental:!1,includeTests:!0});return s.destroy(),l.success?{status:"indexed",entries:l.value.nodesCreated+l.value.edgesCreated}:{status:"error",entries:0}}catch(e){return console.warn("Code intelligence scan warning:",y(e)),{status:"skipped",entries:0}}}async function H(t){let e=o(t,".agentic-qe","memory.db");try{let n=_(e),r=n.prepare(`
306
306
  SELECT COUNT(*) as count FROM kv_store
307
307
  WHERE namespace LIKE 'code-intelligence:kg%'
308
308
  `).get();return n.close(),r.count}catch{return 0}}async function X(t,e,n){if(!e.learning.enabled)return 0;let r=o(t,".agentic-qe","data");h(r)||k(r,{recursive:!0});let s=o(r,"hnsw");h(s)||k(s,{recursive:!0});let i=o(r,"learning-config.json"),u={embeddingModel:e.learning.embeddingModel,hnswConfig:e.learning.hnswConfig,qualityThreshold:e.learning.qualityThreshold,promotionThreshold:e.learning.promotionThreshold,databasePath:o(r,"memory.db"),hnswIndexPath:o(s,"index.bin"),initialized:new Date().toISOString()};E(i,JSON.stringify(u,null,2),"utf-8");let l=0;if(e.learning.pretrainedPatterns&&n){let d=n,a=new Map;for(let g of d.patterns){let c=g.domain||"general";a.has(c)||a.set(c,[]),a.get(c).push(g)}let m=o(r,"pretrained-index.json"),S={version:d.version,totalPatterns:d.statistics.totalPatterns,domains:Array.from(a.entries()).map(([g,c])=>({name:g,patternCount:c.length})),loadedAt:new Date().toISOString()};E(m,JSON.stringify(S,null,2),"utf-8");for(let[g,c]of a){let w=o(r,"patterns",g);h(w)||k(w,{recursive:!0});let ne=o(w,"patterns.json");E(ne,JSON.stringify(c,null,2),"utf-8"),l+=c.length}return l}return 0}async function K(t,e){if(!e.workers.daemonAutoStart||e.workers.enabled.length===0)return 0;let n=o(t,".agentic-qe","workers");h(n)||k(n,{recursive:!0});let r={},s={"pattern-consolidator":6e4,"coverage-gap-scanner":3e5,"flaky-test-detector":6e5,"routing-accuracy-monitor":12e4};for(let a of e.workers.enabled)r[a]={name:a,enabled:!0,interval:e.workers.intervals[a]||s[a]||6e4,lastRun:null,status:"pending"};let i=o(n,"registry.json"),u={version:e.version,maxConcurrent:e.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};E(i,JSON.stringify(u,null,2),"utf-8");for(let a of e.workers.enabled){let m=o(n,`${a}.json`),S={name:a,enabled:!0,interval:e.workers.intervals[a]||s[a]||6e4,projectRoot:t,dataDir:o(t,".agentic-qe","data"),createdAt:new Date().toISOString()};E(m,JSON.stringify(S,null,2),"utf-8")}let l=o(n,"start-daemon.cjs");return E(l,`#!/usr/bin/env node
@@ -311,6 +311,6 @@ Ensure the directory is writable and has sufficient disk space.`)}}async functio
311
311
 
312
312
  console.log("AQE v3 hooks work via CLI commands (no daemon required)");
313
313
  console.log("Use: npx aqe hooks session-start");
314
- `),e.workers.enabled.length}async function Y(t,e){if(!e.skills.install)return 0;let r=await N({projectRoot:t,installV2Skills:e.skills.installV2,installV3Skills:e.skills.installV3,overwrite:e.skills.overwrite}).install();return r.errors.length>0&&console.warn("Skills installation warnings:",r.errors),r.installed.length}async function Z(t){let n=await Q({projectRoot:t,installQEAgents:!0,installSubagents:!0,overwrite:!1}).install();return n.errors.length>0&&console.warn("Agents installation warnings:",n.errors),n.installed.length}async function ee(t,e,n){let s=await M({projectRoot:t,installAgents:!0,installSkills:!0,overwrite:!1,n8nApiConfig:n}).install();return s.errors.length>0&&console.warn("N8n installation warnings:",s.errors),e.platforms||(e.platforms={}),e.platforms.n8n={enabled:!0,installAgents:!0,installSkills:!0,installTypeScriptAgents:!1,n8nApiConfig:n},{agents:s.agentsInstalled.length,skills:s.skillsInstalled.length}}async function te(t,e){if(!e)throw new Error("No configuration to save");let n=o(t,".agentic-qe");h(n)||k(n,{recursive:!0});let r=ce(e),s=o(n,"config.yaml");E(s,r,"utf-8")}function ce(t){let e=["# Agentic QE v3 Configuration","# Generated by aqe init",`# ${new Date().toISOString()}`,""];e.push(`version: "${t.version}"`),e.push(""),e.push("project:"),e.push(` name: "${t.project.name}"`),e.push(` root: "${t.project.root}"`),e.push(` type: "${t.project.type}"`),e.push(""),e.push("learning:"),e.push(` enabled: ${t.learning.enabled}`),e.push(` embeddingModel: "${t.learning.embeddingModel}"`),e.push(" hnswConfig:"),e.push(` M: ${t.learning.hnswConfig.M}`),e.push(` efConstruction: ${t.learning.hnswConfig.efConstruction}`),e.push(` efSearch: ${t.learning.hnswConfig.efSearch}`),e.push(` qualityThreshold: ${t.learning.qualityThreshold}`),e.push(` promotionThreshold: ${t.learning.promotionThreshold}`),e.push(` pretrainedPatterns: ${t.learning.pretrainedPatterns}`),e.push(""),e.push("routing:"),e.push(` mode: "${t.routing.mode}"`),e.push(` confidenceThreshold: ${t.routing.confidenceThreshold}`),e.push(` feedbackEnabled: ${t.routing.feedbackEnabled}`),e.push(""),e.push("# ADR-092: Advisor Strategy \u2014 agents consult a stronger model for strategic guidance"),e.push("# Set provider/model to override auto-detection from environment API keys"),e.push("advisor:"),e.push(' # provider: "openrouter" # openrouter | claude | ollama (auto-detected if not set)'),e.push(' # model: "anthropic/claude-opus-4.7" # provider-specific model ID'),e.push(' # maxUses: "3" # per-task advisor call cap'),e.push(' redact: "strict" # strict | balanced | off'),e.push(""),e.push("workers:"),e.push(" enabled:");for(let n of t.workers.enabled)e.push(` - "${n}"`);e.push(" intervals:");for(let[n,r]of Object.entries(t.workers.intervals))e.push(` ${n}: ${r}`);e.push(` maxConcurrent: ${t.workers.maxConcurrent}`),e.push(` daemonAutoStart: ${t.workers.daemonAutoStart}`),e.push(""),e.push("hooks:"),e.push(` claudeCode: ${t.hooks.claudeCode}`),e.push(` preCommit: ${t.hooks.preCommit}`),e.push(` ciIntegration: ${t.hooks.ciIntegration}`),e.push(""),e.push("skills:"),e.push(` install: ${t.skills.install}`),e.push(` installV2: ${t.skills.installV2}`),e.push(` installV3: ${t.skills.installV3}`),e.push(` overwrite: ${t.skills.overwrite}`),e.push(""),e.push("autoTuning:"),e.push(` enabled: ${t.autoTuning.enabled}`),e.push(" parameters:");for(let n of t.autoTuning.parameters)e.push(` - "${n}"`);e.push(` evaluationPeriodMs: ${t.autoTuning.evaluationPeriodMs}`),e.push(""),e.push("domains:"),e.push(" enabled:");for(let n of t.domains.enabled)e.push(` - "${n}"`);e.push(" disabled:");for(let n of t.domains.disabled)e.push(` - "${n}"`);return e.push(""),e.push("agents:"),e.push(` maxConcurrent: ${t.agents.maxConcurrent}`),e.push(` defaultTimeout: ${t.agents.defaultTimeout}`),e.push(""),e.join(`
314
+ `),e.workers.enabled.length}async function Y(t,e){if(!e.skills.install)return 0;let r=await N({projectRoot:t,installV2Skills:e.skills.installV2,installV3Skills:e.skills.installV3,overwrite:e.skills.overwrite}).install();return r.errors.length>0&&console.warn("Skills installation warnings:",r.errors),r.installed.length}async function Z(t){let n=await Q({projectRoot:t,installQEAgents:!0,installSubagents:!0,overwrite:!1}).install();return n.errors.length>0&&console.warn("Agents installation warnings:",n.errors),n.installed.length}async function ee(t,e,n){let s=await M({projectRoot:t,installAgents:!0,installSkills:!0,overwrite:!1,n8nApiConfig:n}).install();return s.errors.length>0&&console.warn("N8n installation warnings:",s.errors),e.platforms||(e.platforms={}),e.platforms.n8n={enabled:!0,installAgents:!0,installSkills:!0,installTypeScriptAgents:!1,n8nApiConfig:n},{agents:s.agentsInstalled.length,skills:s.skillsInstalled.length}}async function te(t,e){if(!e)throw new Error("No configuration to save");let n=o(t,".agentic-qe");h(n)||k(n,{recursive:!0});let r=ce(e),s=o(n,"config.yaml");E(s,r,"utf-8")}function ce(t){let e=["# Agentic QE v3 Configuration","# Generated by aqe init",`# ${new Date().toISOString()}`,""];e.push(`version: "${t.version}"`),e.push(""),e.push("project:"),e.push(` name: "${t.project.name}"`),e.push(` root: "${t.project.root}"`),e.push(` type: "${t.project.type}"`),e.push(""),e.push("learning:"),e.push(` enabled: ${t.learning.enabled}`),e.push(` embeddingModel: "${t.learning.embeddingModel}"`),e.push(" hnswConfig:"),e.push(` M: ${t.learning.hnswConfig.M}`),e.push(` efConstruction: ${t.learning.hnswConfig.efConstruction}`),e.push(` efSearch: ${t.learning.hnswConfig.efSearch}`),e.push(` qualityThreshold: ${t.learning.qualityThreshold}`),e.push(` promotionThreshold: ${t.learning.promotionThreshold}`),e.push(` pretrainedPatterns: ${t.learning.pretrainedPatterns}`),e.push(""),e.push("routing:"),e.push(` mode: "${t.routing.mode}"`),e.push(` confidenceThreshold: ${t.routing.confidenceThreshold}`),e.push(` feedbackEnabled: ${t.routing.feedbackEnabled}`),e.push(""),e.push("# ADR-092: Advisor Strategy \u2014 agents consult a stronger model for strategic guidance"),e.push("# Set provider/model to override auto-detection from environment API keys"),e.push("advisor:"),e.push(' # provider: "openrouter" # openrouter | claude | ollama (auto-detected if not set)'),e.push(' # model: "anthropic/claude-opus-5.5" # provider-specific model ID'),e.push(' # maxUses: "3" # per-task advisor call cap'),e.push(' redact: "strict" # strict | balanced | off'),e.push(""),e.push("workers:"),e.push(" enabled:");for(let n of t.workers.enabled)e.push(` - "${n}"`);e.push(" intervals:");for(let[n,r]of Object.entries(t.workers.intervals))e.push(` ${n}: ${r}`);e.push(` maxConcurrent: ${t.workers.maxConcurrent}`),e.push(` daemonAutoStart: ${t.workers.daemonAutoStart}`),e.push(""),e.push("hooks:"),e.push(` claudeCode: ${t.hooks.claudeCode}`),e.push(` preCommit: ${t.hooks.preCommit}`),e.push(` ciIntegration: ${t.hooks.ciIntegration}`),e.push(""),e.push("skills:"),e.push(` install: ${t.skills.install}`),e.push(` installV2: ${t.skills.installV2}`),e.push(` installV3: ${t.skills.installV3}`),e.push(` overwrite: ${t.skills.overwrite}`),e.push(""),e.push("autoTuning:"),e.push(` enabled: ${t.autoTuning.enabled}`),e.push(" parameters:");for(let n of t.autoTuning.parameters)e.push(` - "${n}"`);e.push(` evaluationPeriodMs: ${t.autoTuning.evaluationPeriodMs}`),e.push(""),e.push("domains:"),e.push(" enabled:");for(let n of t.domains.enabled)e.push(` - "${n}"`);e.push(" disabled:");for(let n of t.domains.disabled)e.push(` - "${n}"`);return e.push(""),e.push("agents:"),e.push(` maxConcurrent: ${t.agents.maxConcurrent}`),e.push(` defaultTimeout: ${t.agents.defaultTimeout}`),e.push(""),e.join(`
315
315
  `)}var ue=[{id:"welcome",title:"Welcome to AQE v3",description:"This wizard will configure Agentic QE for your project.",type:"info"},{id:"project-type",title:"Project Type",description:"What type of project is this?",type:"choice",options:[{value:"auto",label:"Auto-detect",description:"Let AQE analyze your project",recommended:!0},{value:"single",label:"Single Package",description:"Standard single-package project"},{value:"monorepo",label:"Monorepo",description:"Multi-package workspace"},{value:"library",label:"Library",description:"Publishable package/library"}],default:"auto"},{id:"learning-mode",title:"Learning System",description:"How should AQE learn from your project?",type:"choice",options:[{value:"full",label:"Full Learning",description:"Transformer embeddings + SQLite persistence",recommended:!0},{value:"basic",label:"Basic Learning",description:"Hash-based embeddings, in-memory"},{value:"disabled",label:"Disabled",description:"No pattern learning"}],default:"full"},{id:"load-patterns",title:"Pre-trained Patterns",description:"Load pre-trained QE patterns for faster results?",type:"confirm",default:!0},{id:"hooks",title:"Claude Code Integration",description:"Enable Claude Code hooks for seamless integration?",type:"confirm",default:!0},{id:"workers",title:"Background Workers",description:"Start background workers for continuous monitoring?",type:"confirm",default:!0},{id:"skills",title:"Install Skills",description:"Install AQE skills (v2 methodology + v3 domain skills)?",type:"confirm",default:!0},{id:"agents",title:"Install Agents",description:"Install V3 QE agents for Claude Code Task tool?",type:"confirm",default:!0}],I=class{projectRoot;options;analyzer;configurator;steps=[];constructor(e){this.options=e,this.projectRoot=e.projectRoot,this.analyzer=q(e.projectRoot),this.configurator=R({minimal:e.minimal})}async initialize(){let e=Date.now();try{let n=await this.runStep("Project Analysis",async()=>await this.analyzer.analyze()),r=await this.runStep("Configuration Generation",async()=>this.options.autoMode?this.configurator.recommend(n):this.applyWizardAnswers(n));await this.runStep("Persistence Database Setup",async()=>await V(this.projectRoot));let s=await this.runStep("Code Intelligence Pre-Scan",async()=>{if(!await J(this.projectRoot))return console.log(" Building knowledge graph for code intelligence..."),await B(n.projectRoot);let w=await H(this.projectRoot);return console.log(` Using existing code intelligence index (${w} entries)`),{status:"existing",entries:w}}),i=await this.runStep("Learning System Setup",async()=>r.learning.enabled&&!this.options.skipPatterns?await X(this.projectRoot,r,this.options.pretrainedLibrary):0),u=await this.runStep("Hooks Configuration",async()=>r.hooks.claudeCode?await z(this.projectRoot,r):!1),l=await this.runStep("MCP Configuration",async()=>await F(this.projectRoot)),d=await this.runStep("CLAUDE.md Generation",async()=>await W(this.projectRoot,r)),a=await this.runStep("Background Workers",async()=>r.workers.daemonAutoStart?await K(this.projectRoot,r):0),m=await this.runStep("Skills Installation",async()=>r.skills.install?await Y(this.projectRoot,r):0),S=await this.runStep("Agents Installation",async()=>await Z(this.projectRoot)),g;if(this.options.withN8n){let c=await this.runStep("N8n Platform Installation",async()=>await ee(this.projectRoot,r,this.options.n8nApiConfig));c&&(g=c)}return await this.runStep("Save Configuration",async()=>await te(this.projectRoot,r)),await this.runStep("Version Marker",async()=>await G(this.projectRoot,r.version)),{success:!0,config:r,steps:this.steps,summary:{projectAnalyzed:!0,configGenerated:!0,codeIntelligenceIndexed:s?.entries??0,patternsLoaded:i,skillsInstalled:m,agentsInstalled:S,hooksConfigured:u,mcpConfigured:l,claudeMdGenerated:d,workersStarted:a,n8nInstalled:g},totalDurationMs:Date.now()-e,timestamp:new Date}}catch(n){return this.steps.push({step:"Initialization Failed",status:"error",message:y(n),durationMs:0}),{success:!1,config:P("unknown",this.projectRoot),steps:this.steps,summary:{projectAnalyzed:!1,configGenerated:!1,codeIntelligenceIndexed:0,patternsLoaded:0,skillsInstalled:0,agentsInstalled:0,hooksConfigured:!1,mcpConfigured:!1,claudeMdGenerated:!1,workersStarted:0},totalDurationMs:Date.now()-e,timestamp:new Date}}}getWizardSteps(){return ue}async runStep(e,n){let r=Date.now();try{let s=await n();return this.steps.push({step:e,status:"success",message:`${e} completed successfully`,durationMs:Date.now()-r}),s}catch(s){throw this.steps.push({step:e,status:"error",message:y(s),durationMs:Date.now()-r}),s}}applyWizardAnswers(e){let n=this.options.wizardAnswers||{},r=this.configurator.recommend(e);switch(n["project-type"]&&n["project-type"]!=="auto"&&(r.project.type=n["project-type"]),n["learning-mode"]){case"full":r.learning.enabled=!0,r.learning.embeddingModel="transformer";break;case"basic":r.learning.enabled=!0,r.learning.embeddingModel="hash";break;case"disabled":r.learning.enabled=!1;break}return n["load-patterns"]===!1&&(r.learning.pretrainedPatterns=!1),n.hooks===!1&&(r.hooks.claudeCode=!1),n.workers===!1&&(r.workers.daemonAutoStart=!1),n.skills===!1&&(r.skills.install=!1),r}};function de(t){return new I(t)}async function je(t){return await de({projectRoot:t,autoMode:!0}).initialize()}function xe(t){let e=[];e.push(""),e.push("+-------------------------------------------------------------+"),e.push("| AQE v3 Initialization |"),e.push("+-------------------------------------------------------------+");for(let r of t.steps){let s=r.status==="success"?"[OK]":r.status==="error"?"[!!]":"[ ]";e.push(`| ${s} ${r.step.padEnd(50)} ${String(r.durationMs).padStart(4)}ms |`)}e.push("+-------------------------------------------------------------+"),e.push(`| Project: ${t.config.project.name.padEnd(47)} |`),e.push(`| Type: ${t.config.project.type.padEnd(50)} |`),e.push(`| Code Intel Indexed: ${String(t.summary.codeIntelligenceIndexed).padEnd(36)} |`),e.push(`| Patterns Loaded: ${String(t.summary.patternsLoaded).padEnd(39)} |`),e.push(`| Skills Installed: ${String(t.summary.skillsInstalled).padEnd(38)} |`),e.push(`| Agents Installed: ${String(t.summary.agentsInstalled).padEnd(38)} |`),e.push(`| Workers Started: ${String(t.summary.workersStarted).padEnd(39)} |`),e.push(`| Hooks Configured: ${t.summary.hooksConfigured?"Yes":"No".padEnd(38)} |`),e.push(`| MCP Server: ${t.summary.mcpConfigured?"Yes":"No".padEnd(44)} |`),e.push(`| CLAUDE.md: ${t.summary.claudeMdGenerated?"Yes":"No".padEnd(45)} |`),e.push("+-------------------------------------------------------------+");let n=t.success?"[OK] AQE v3 initialized as self-learning platform":"[!!] Initialization failed";return e.push(`| ${n.padEnd(57)} |`),e.push("+-------------------------------------------------------------+"),e.push(""),e.join(`
316
316
  `)}export{I as a,de as b,je as c,xe as d};
@@ -1,2 +1,2 @@
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.14.3");process.exit(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.14.5");process.exit(0)}
2
2
  var s={"test-generation":/test|spec|describe|it\(|expect|assert|mock|stub|fixture|tdd|bdd/i,"test-execution":/run|execute|parallel|retry|flaky|timeout|worker|orchestrat/i,"coverage-analysis":/coverage|branch|line|uncovered|gap|untested|percentage|sublinear/i,"quality-assessment":/quality|gate|deploy|readiness|metric|threshold|sla|score/i,"defect-intelligence":/defect|bug|predict|root.?cause|regression|failure|incident/i,"requirements-validation":/requirement|bdd|gherkin|testabil|accept|criteri|scenario/i,"code-intelligence":/semantic|knowledge|graph|ast|symbol|reference|impact|depend/i,"security-compliance":/vuln|cve|owasp|xss|sqli|injection|csrf|auth|secret|compliance|sast|dast/i,"contract-testing":/contract|pact|openapi|swagger|graphql|schema|endpoint|api/i,"visual-accessibility":/screenshot|visual|snapshot|pixel|percy|a11y|aria|wcag|screen.?reader|accessible|contrast/i,"chaos-resilience":/chaos|resilience|fault|inject|blast|recover|latency|failure|stress|load/i,"learning-optimization":/learn|pattern|optim|neural|embedding|vector|memory|adapt|train/i};function l(e){for(let[t,a]of Object.entries(s))if(a.test(e))return t;return null}function m(e){let t=[];for(let[a,n]of Object.entries(s))n.test(e)&&t.push(a);return t}function u(e){return e}function d(e){let t=Math.min(e.usageCount/100,1);return e.confidence*.3+t*.2+e.successRate*.5}var c=3;function p(e,t,a=.4){let n=e.tier==="short-term"&&e.successfulUses>=c,r=e.successRate>=.7&&e.confidence>=.6,i=t===void 0||t<a,o;return n?r?i||(o="coherence_violation"):o="low_quality":o="insufficient_usage",{meetsUsageCriteria:n,meetsQualityCriteria:r,meetsCoherenceCriteria:i,blockReason:o}}function y(e){let t=[];if(e.id||t.push("Pattern ID is required"),e.patternType||t.push("Pattern type is required"),e.qeDomain||t.push("QE domain is required"),e.name||t.push("Pattern name is required"),e.template?.content||t.push("Template content is required"),e.confidence!==void 0&&(e.confidence<0||e.confidence>1)&&t.push("Confidence must be between 0 and 1"),e.successRate!==void 0&&(e.successRate<0||e.successRate>1)&&t.push("Success rate must be between 0 and 1"),e.template?.variables){let a=new Set;for(let n of e.template.variables)a.has(n.name)&&t.push(`Duplicate variable name: ${n.name}`),a.add(n.name),e.template.content.includes(`{{${n.name}}}`)||t.push(`Variable ${n.name} not referenced in template`)}return{valid:t.length===0,errors:t}}function f(e,t){let a=e.content;for(let n of e.variables){let r=t[n.name]??n.defaultValue;if(n.required&&r===void 0)throw new Error(`Required variable ${n.name} not provided`);if(r!==void 0){let i=`{{${n.name}}}`,o=typeof r=="object"?JSON.stringify(r):String(r);a=a.split(i).join(o)}}return a}var g=Object.keys(s);export{l as a,m as b,u as c,d,c as e,p as f,y as g,f as h,g as i};
@@ -1,2 +1,2 @@
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.14.3");process.exit(0)}
2
- import{b as A,d as M}from"./chunk-YAKS3CAB.js";import{a as S,b as D}from"./chunk-IP7NSFQQ.js";import{S as Q,l as E}from"./chunk-T35GZXTU.js";import{g as C}from"./chunk-Y2DVFVGI.js";M();Q();var v=(1+Math.sqrt(5))/2,R=1/v;function k(t,e=0){if(t<0||!Number.isFinite(t))throw new Error(`Invalid dither sequence length: ${t}`);if(!Number.isFinite(e))throw new Error(`Invalid dither seed: ${e}`);let n=new Float32Array(t),r=(e*R%1+1)%1;for(let i=0;i<t;i++)n[i]=((r+(i+1)*v)%1+1)%1;return n}function I(t,e,n=0){if(!(t instanceof Float32Array))throw new Error("Input vector must be a Float32Array");if(t.length===0)return{quantized:new Int32Array(0),dequantized:new Float32Array(0),bitDepth:e,seed:n,stepSize:0,minValue:0,maxValue:0};if(e<1||e>32||!Number.isInteger(e))throw new Error(`Invalid bit depth: ${e}. Must be an integer in [1, 32].`);let r=t[0],i=t[0];for(let d=1;d<t.length;d++)t[d]<r&&(r=t[d]),t[d]>i&&(i=t[d]);let s=(1<<e)-1,a=i-r,o=a===0?1:a/s,m=k(t.length,n),l=new Int32Array(t.length),u=new Float32Array(t.length);for(let d=0;d<t.length;d++){if(a===0)l[d]=Math.round(s/2);else{let L=(t[d]-r)/o+(m[d]-.5);l[d]=Math.max(0,Math.min(s,Math.round(L)))}u[d]=l[d]*o+r}return{quantized:l,dequantized:u,bitDepth:e,seed:n,stepSize:o,minValue:r,maxValue:i}}var h=null,b=null,p=null,g=null,f=null,w=null,x=!1;try{let t=(D(),C(S));h=t.RuvectorLayer,b=t.TensorCompress,p=t.differentiableSearch,g=t.hierarchicalForward,f=t.getCompressionLevel,w=t.init,x=!0}catch{}function H(){return x}function c(){if(!x)throw new Error("@ruvector/gnn native module is not available on this platform. Install the appropriate optional dependency for your platform, or use a platform where pre-built binaries are available.")}var F=!1;function V(){if(!F){c();let t=w();return F=!0,t}return"@ruvector/gnn already initialized"}var y=class{indexes;config;nextId;gnnLayers;compressor;constructor(e={}){this.config={M:e.M||16,efConstruction:e.efConstruction||200,efSearch:e.efSearch||50,dimension:e.dimension||384,metric:e.metric||"cosine",quantization:e.quantization||"none"},this.indexes=new Map,this.nextId=new Map,this.gnnLayers=new Map,c(),this.compressor=new b,V()}initializeIndex(e){this.indexes.has(e)||(this.indexes.set(e,new Map),this.nextId.set(e,0))}addEmbedding(e,n){let r=e.namespace;this.indexes.has(r)||this.initializeIndex(r);let i=this.indexes.get(r),s=n??this.nextId.get(r);return n===void 0&&this.nextId.set(r,s+1),i.set(s,e),s}addEmbeddingsBatch(e){let n=[];for(let r of e){let i=this.addEmbedding(r.embedding,r.id);n.push(i)}return n}search(e,n={}){let r=n.namespace||e.namespace;if(!this.indexes.has(r))return[];let i=this.indexes.get(r),s=n.limit||10,a=[];for(let[u,d]of i.entries())a.push({id:u,vector:Array.from(d.vector)});if(a.length===0)return[];let o=new Float32Array(e.vector),m=a.map(u=>new Float32Array(u.vector)),l=p(o,m,Math.min(s,a.length),1);return l.indices.map((u,d)=>({id:a[u]?.id??u,distance:1-l.weights[d]}))}differentiableSearchWithWeights(e,n,r,i=1){let s=new Float32Array(e.vector),a=n.map(m=>new Float32Array(m.embedding.vector)),o=p(s,a,Math.min(r,n.length),i);return{indices:o.indices.map(m=>n[m]?.id??m),weights:o.weights}}hierarchicalForward(e,n,r){let i=r.map(l=>`${l.inputDim}-${l.hiddenDim}`).join(",");if(!this.gnnLayers.has(i)){let l=[];for(let u of r){let d=new h(u.inputDim,u.hiddenDim,u.heads,u.dropout);l.push(d)}this.gnnLayers.set(i,l[0])}let a=this.gnnLayers.get(i).toJson(),o=new Float32Array(e),m=n.map(l=>l.map(u=>new Float32Array(u)));return Array.from(g(o,m,[a]))}compressEmbedding(e,n){let r=f(n),s={none:"none",half:"half",pq8:"pq8",pq4:"pq4",binary:"binary"}[r]??"none",a=new Float32Array(e.vector),o=this.compressor.compress(a,n);return{dimension:Array.from(e.vector).length,level:s,data:o,accessFreq:n}}decompressEmbedding(e){let n=this.compressor.decompress(e.data),r={none:"none",half:"fp16",pq8:"int8",pq4:"int8",binary:"binary"};return{vector:n,dimension:e.dimension,namespace:"code",text:"",timestamp:Date.now(),quantization:r[e.level]??"none"}}getCompressionLevelForFrequency(e){return c(),f(e)}getIndexStats(e){return this.indexes.has(e)?{size:this.indexes.get(e).size,maxElements:1e4,dimension:this.config.dimension,metric:this.config.metric}:null}clearIndex(e){this.indexes.delete(e),this.nextId.delete(e)}clearAll(){this.indexes.clear(),this.nextId.clear()}resizeIndex(e){}setEfSearch(e){this.config.efSearch=e}getConfig(){return{...this.config}}isInitialized(e){return this.indexes.has(e)}getInitializedNamespaces(){return Array.from(this.indexes.keys())}getSize(e){return this.indexes.get(e)?.size??0}async saveIndex(e,n){let r=this.indexes.get(e);if(!r)throw new Error(`Namespace ${e} not initialized`);let i=Array.from(r.entries()).map(([a,o])=>({id:a,vector:Array.from(o.vector),metadata:o.metadata}));await(await import("fs/promises")).writeFile(n,JSON.stringify(i,null,2))}async loadIndex(e,n){let i=await(await import("fs/promises")).readFile(n,"utf-8"),s=A(i);this.initializeIndex(e);for(let a of s){let o={vector:a.vector,dimension:a.vector.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none",metadata:a.metadata};this.addEmbedding(o,a.id)}}},q=class{static instances=new Map;static getInstance(e,n){return this.instances.has(e)||this.instances.set(e,new y(n)),this.instances.get(e)}static closeInstance(e){let n=this.instances.get(e);n&&(n.clearAll(),this.instances.delete(e))}static closeAll(){for(let e of this.instances.values())e.clearAll();this.instances.clear()}},z=class{static layers=new Map;static getLayer(e){let n=`${e.inputDim}-${e.hiddenDim}-${e.heads}-${e.dropout}`;if(!this.layers.has(n)){c();let r=new h(e.inputDim,e.hiddenDim,e.heads,e.dropout);this.layers.set(n,r)}return this.layers.get(n)}static layerFromJson(e){return c(),h.fromJson(e)}static clearCache(){this.layers.clear()}},N=class{static _compressor=null;static get compressor(){return this._compressor||(c(),this._compressor=new b),this._compressor}static compressWithLevel(e,n){let r={levelType:n,scale:1,subvectors:n==="pq8"?8:n==="pq4"?16:void 0,centroids:n==="pq8"?256:void 0,outlierThreshold:n==="pq4"?3:void 0,threshold:n==="binary"?0:void 0},i=e instanceof Float32Array?e:new Float32Array(e);return this.compressor.compressWithLevel(i,r)}static decompress(e){return this.compressor.decompress(e)}static getLevel(e){return c(),f(e)}static compressWithDither(e,n,r){let i=e instanceof Float32Array?e:new Float32Array(e),s;if(E()){let o={none:32,half:16,pq8:8,pq4:4,binary:1},m=r?.bitDepth??o[n]??8,l=r?.seed??0;s=I(i,m,l)}return{compressed:this.compressWithLevel(s?s.dequantized:e,n),ditherResult:s}}};function G(){return c(),h}function J(){return c(),b}function O(){return c(),p}function j(){return c(),g}function B(){return c(),f}function K(){return c(),w}function U(t){return t instanceof Float32Array?t:"vector"in t?t.vector instanceof Float32Array?t.vector:new Float32Array(t.vector):new Float32Array(t)}function X(t){return"vector"in t?Array.from(t.vector):Array.from(t)}function Y(t,e="code"){return{vector:t,dimension:t.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none"}}function Z(t,e,n,r=1){let i=[],s=e.map(a=>a instanceof Float32Array?a:new Float32Array(a));for(let a of t){let o=a instanceof Float32Array?a:new Float32Array(a),m=p(o,s,n,r);i.push({indices:m.indices,weights:m.weights})}return i}export{H as a,V as b,y as c,q as d,z as e,N as f,G as g,J as h,O as i,j,B as k,K as l,U as m,X as n,Y as o,Z as p};
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.14.5");process.exit(0)}
2
+ import{b as E,d as S}from"./chunk-IJHCIXJC.js";import{a as D,b as Q}from"./chunk-6A44AOGN.js";import{S as M,l as A}from"./chunk-WJHWH5D2.js";import{f as C}from"./chunk-JSZ663MU.js";S();M();var v=(1+Math.sqrt(5))/2,R=1/v;function k(t,e=0){if(t<0||!Number.isFinite(t))throw new Error(`Invalid dither sequence length: ${t}`);if(!Number.isFinite(e))throw new Error(`Invalid dither seed: ${e}`);let n=new Float32Array(t),r=(e*R%1+1)%1;for(let i=0;i<t;i++)n[i]=((r+(i+1)*v)%1+1)%1;return n}function I(t,e,n=0){if(!(t instanceof Float32Array))throw new Error("Input vector must be a Float32Array");if(t.length===0)return{quantized:new Int32Array(0),dequantized:new Float32Array(0),bitDepth:e,seed:n,stepSize:0,minValue:0,maxValue:0};if(e<1||e>32||!Number.isInteger(e))throw new Error(`Invalid bit depth: ${e}. Must be an integer in [1, 32].`);let r=t[0],i=t[0];for(let d=1;d<t.length;d++)t[d]<r&&(r=t[d]),t[d]>i&&(i=t[d]);let s=(1<<e)-1,a=i-r,o=a===0?1:a/s,m=k(t.length,n),l=new Int32Array(t.length),u=new Float32Array(t.length);for(let d=0;d<t.length;d++){if(a===0)l[d]=Math.round(s/2);else{let L=(t[d]-r)/o+(m[d]-.5);l[d]=Math.max(0,Math.min(s,Math.round(L)))}u[d]=l[d]*o+r}return{quantized:l,dequantized:u,bitDepth:e,seed:n,stepSize:o,minValue:r,maxValue:i}}var h=null,b=null,p=null,g=null,f=null,w=null,x=!1;try{let t=(Q(),C(D));h=t.RuvectorLayer,b=t.TensorCompress,p=t.differentiableSearch,g=t.hierarchicalForward,f=t.getCompressionLevel,w=t.init,x=!0}catch{}function H(){return x}function c(){if(!x)throw new Error("@ruvector/gnn native module is not available on this platform. Install the appropriate optional dependency for your platform, or use a platform where pre-built binaries are available.")}var F=!1;function V(){if(!F){c();let t=w();return F=!0,t}return"@ruvector/gnn already initialized"}var y=class{indexes;config;nextId;gnnLayers;compressor;constructor(e={}){this.config={M:e.M||16,efConstruction:e.efConstruction||200,efSearch:e.efSearch||50,dimension:e.dimension||384,metric:e.metric||"cosine",quantization:e.quantization||"none"},this.indexes=new Map,this.nextId=new Map,this.gnnLayers=new Map,c(),this.compressor=new b,V()}initializeIndex(e){this.indexes.has(e)||(this.indexes.set(e,new Map),this.nextId.set(e,0))}addEmbedding(e,n){let r=e.namespace;this.indexes.has(r)||this.initializeIndex(r);let i=this.indexes.get(r),s=n??this.nextId.get(r);return n===void 0&&this.nextId.set(r,s+1),i.set(s,e),s}addEmbeddingsBatch(e){let n=[];for(let r of e){let i=this.addEmbedding(r.embedding,r.id);n.push(i)}return n}search(e,n={}){let r=n.namespace||e.namespace;if(!this.indexes.has(r))return[];let i=this.indexes.get(r),s=n.limit||10,a=[];for(let[u,d]of i.entries())a.push({id:u,vector:Array.from(d.vector)});if(a.length===0)return[];let o=new Float32Array(e.vector),m=a.map(u=>new Float32Array(u.vector)),l=p(o,m,Math.min(s,a.length),1);return l.indices.map((u,d)=>({id:a[u]?.id??u,distance:1-l.weights[d]}))}differentiableSearchWithWeights(e,n,r,i=1){let s=new Float32Array(e.vector),a=n.map(m=>new Float32Array(m.embedding.vector)),o=p(s,a,Math.min(r,n.length),i);return{indices:o.indices.map(m=>n[m]?.id??m),weights:o.weights}}hierarchicalForward(e,n,r){let i=r.map(l=>`${l.inputDim}-${l.hiddenDim}`).join(",");if(!this.gnnLayers.has(i)){let l=[];for(let u of r){let d=new h(u.inputDim,u.hiddenDim,u.heads,u.dropout);l.push(d)}this.gnnLayers.set(i,l[0])}let a=this.gnnLayers.get(i).toJson(),o=new Float32Array(e),m=n.map(l=>l.map(u=>new Float32Array(u)));return Array.from(g(o,m,[a]))}compressEmbedding(e,n){let r=f(n),s={none:"none",half:"half",pq8:"pq8",pq4:"pq4",binary:"binary"}[r]??"none",a=new Float32Array(e.vector),o=this.compressor.compress(a,n);return{dimension:Array.from(e.vector).length,level:s,data:o,accessFreq:n}}decompressEmbedding(e){let n=this.compressor.decompress(e.data),r={none:"none",half:"fp16",pq8:"int8",pq4:"int8",binary:"binary"};return{vector:n,dimension:e.dimension,namespace:"code",text:"",timestamp:Date.now(),quantization:r[e.level]??"none"}}getCompressionLevelForFrequency(e){return c(),f(e)}getIndexStats(e){return this.indexes.has(e)?{size:this.indexes.get(e).size,maxElements:1e4,dimension:this.config.dimension,metric:this.config.metric}:null}clearIndex(e){this.indexes.delete(e),this.nextId.delete(e)}clearAll(){this.indexes.clear(),this.nextId.clear()}resizeIndex(e){}setEfSearch(e){this.config.efSearch=e}getConfig(){return{...this.config}}isInitialized(e){return this.indexes.has(e)}getInitializedNamespaces(){return Array.from(this.indexes.keys())}getSize(e){return this.indexes.get(e)?.size??0}async saveIndex(e,n){let r=this.indexes.get(e);if(!r)throw new Error(`Namespace ${e} not initialized`);let i=Array.from(r.entries()).map(([a,o])=>({id:a,vector:Array.from(o.vector),metadata:o.metadata}));await(await import("fs/promises")).writeFile(n,JSON.stringify(i,null,2))}async loadIndex(e,n){let i=await(await import("fs/promises")).readFile(n,"utf-8"),s=E(i);this.initializeIndex(e);for(let a of s){let o={vector:a.vector,dimension:a.vector.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none",metadata:a.metadata};this.addEmbedding(o,a.id)}}},q=class{static instances=new Map;static getInstance(e,n){return this.instances.has(e)||this.instances.set(e,new y(n)),this.instances.get(e)}static closeInstance(e){let n=this.instances.get(e);n&&(n.clearAll(),this.instances.delete(e))}static closeAll(){for(let e of this.instances.values())e.clearAll();this.instances.clear()}},z=class{static layers=new Map;static getLayer(e){let n=`${e.inputDim}-${e.hiddenDim}-${e.heads}-${e.dropout}`;if(!this.layers.has(n)){c();let r=new h(e.inputDim,e.hiddenDim,e.heads,e.dropout);this.layers.set(n,r)}return this.layers.get(n)}static layerFromJson(e){return c(),h.fromJson(e)}static clearCache(){this.layers.clear()}},N=class{static _compressor=null;static get compressor(){return this._compressor||(c(),this._compressor=new b),this._compressor}static compressWithLevel(e,n){let r={levelType:n,scale:1,subvectors:n==="pq8"?8:n==="pq4"?16:void 0,centroids:n==="pq8"?256:void 0,outlierThreshold:n==="pq4"?3:void 0,threshold:n==="binary"?0:void 0},i=e instanceof Float32Array?e:new Float32Array(e);return this.compressor.compressWithLevel(i,r)}static decompress(e){return this.compressor.decompress(e)}static getLevel(e){return c(),f(e)}static compressWithDither(e,n,r){let i=e instanceof Float32Array?e:new Float32Array(e),s;if(A()){let o={none:32,half:16,pq8:8,pq4:4,binary:1},m=r?.bitDepth??o[n]??8,l=r?.seed??0;s=I(i,m,l)}return{compressed:this.compressWithLevel(s?s.dequantized:e,n),ditherResult:s}}};function G(){return c(),h}function J(){return c(),b}function O(){return c(),p}function j(){return c(),g}function B(){return c(),f}function K(){return c(),w}function U(t){return t instanceof Float32Array?t:"vector"in t?t.vector instanceof Float32Array?t.vector:new Float32Array(t.vector):new Float32Array(t)}function X(t){return"vector"in t?Array.from(t.vector):Array.from(t)}function Y(t,e="code"){return{vector:t,dimension:t.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none"}}function Z(t,e,n,r=1){let i=[],s=e.map(a=>a instanceof Float32Array?a:new Float32Array(a));for(let a of t){let o=a instanceof Float32Array?a:new Float32Array(a),m=p(o,s,n,r);i.push({indices:m.indices,weights:m.weights})}return i}export{H as a,V as b,y as c,q as d,z as e,N as f,G as g,J as h,O as i,j,B as k,K as l,U as m,X as n,Y as o,Z as p};
@@ -1,2 +1,2 @@
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.14.3");process.exit(0)}
2
- import{c as t,e as o}from"./chunk-Y2DVFVGI.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>m,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>g,TensorCompress:()=>c,default:()=>i,differentiableSearch:()=>l,getCompressionLevel:()=>s,hierarchicalForward:()=>p,init:()=>u,pipeline:()=>v});import{createRequire as n}from"module";var r,e,i,a,c,l,p,s,u,m,d,A,f,h,_,g,v,b=t(()=>{r=n(import.meta.url),e=r("@ruvector/gnn"),i=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:p,getCompressionLevel:s,init:u,FlashAttention:m,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:g,pipeline:v}=e||{}});export{L as a,b};
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.14.5");process.exit(0)}
2
+ import{b as t,d as o}from"./chunk-JSZ663MU.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>m,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>g,TensorCompress:()=>c,default:()=>i,differentiableSearch:()=>l,getCompressionLevel:()=>s,hierarchicalForward:()=>p,init:()=>u,pipeline:()=>v});import{createRequire as n}from"module";var r,e,i,a,c,l,p,s,u,m,d,A,f,h,_,g,v,b=t(()=>{r=n(import.meta.url),e=r("@ruvector/gnn"),i=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:p,getCompressionLevel:s,init:u,FlashAttention:m,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:g,pipeline:v}=e||{}});export{L as a,b};
@@ -1,5 +1,5 @@
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.14.3");process.exit(0)}
2
- import{b as l,c}from"./chunk-5F6DWHQG.js";import{i}from"./chunk-OYMLHX2B.js";c();var u=.15,d=.03,p=.25,s=class{constructor(t){this.db=t;l(t)}db;recordNull(t){this.db.prepare(`
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.14.5");process.exit(0)}
2
+ import{b as l,c}from"./chunk-NQI7FWCS.js";import{i}from"./chunk-W2XCZU62.js";c();var u=.15,d=.03,p=.25,s=class{constructor(t){this.db=t;l(t)}db;recordNull(t){this.db.prepare(`
3
3
  INSERT INTO qe_pattern_nulls (id, pattern_id, context_fingerprint, failure_mode, trajectory_ref, evidence_class)
4
4
  VALUES (?, ?, ?, ?, ?, ?)
5
5
  ON CONFLICT(pattern_id, context_fingerprint) DO UPDATE SET
@@ -0,0 +1,2 @@
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.14.5");process.exit(0)}
2
+ import{e as l,l as c}from"./chunk-YDFL445W.js";import{a as i}from"./chunk-RD2VGOUH.js";import{a as n,c as h}from"./chunk-J5UNP6W3.js";h();var d=class extends c{config={name:"qe/tests/schedule",description:"Schedule and execute tests using phase-based pipeline with git-aware selection and flaky tracking. Runs tests in phases (unit, integration, e2e), selects affected tests from git changes, and tracks flaky tests.",domain:"test-execution",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{cwd:{type:"string",description:"Working directory for test execution (defaults to project root)"},gitRef:{type:"string",description:'Git ref to compare for affected test selection (e.g., "main", "HEAD~3")'},useGitAware:{type:"boolean",description:"Enable git-aware test selection to only run affected tests",default:!0},trackFlaky:{type:"boolean",description:"Enable flaky test tracking and quarantine",default:!0}}}}async execute(s,o){if(s.gitRef!==void 0){let a=i(s.gitRef,"gitRef");if(a)return{success:!1,error:a}}try{let{runTestPipeline:a}=await import("./test-scheduling-CHQ4ZLLJ.js"),u=await l(o),t=await a({cwd:s.cwd||process.cwd(),memory:u,baseRef:s.gitRef,flakyHistoryPath:s.trackFlaky!==!1?".agentic-qe/flaky-history.json":void 0,runAllTests:s.useGitAware===!1}),f=t.phaseResults.reduce((e,r)=>e+r.totalTests,0),p=t.phaseResults.reduce((e,r)=>e+r.passed,0),g=t.phaseResults.reduce((e,r)=>e+r.failed,0);return{success:!0,data:{pipelineId:o.requestId,phases:t.phaseResults.map(e=>({phaseId:e.phaseId,phaseName:e.phaseName,totalTests:e.totalTests,passed:e.passed,failed:e.failed,passRate:e.passRate,durationMs:e.durationMs})),gitAware:{enabled:!t.ranAllTests,selectedTests:t.selectedTests.length,gitRef:s.gitRef},flakyTracking:{enabled:s.trackFlaky!==!1},totalDuration:t.totalDurationMs,ranAllTests:t.ranAllTests,summary:`Executed ${t.phaseResults.length} phases, ${f} tests (${p} passed, ${g} failed) in ${t.totalDurationMs}ms`}}}catch(a){return{success:!1,error:n(a)}}}};export{d as a};
@@ -1,2 +1,2 @@
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.14.3");process.exit(0)}
2
- import{b as y,d as p}from"./chunk-HXE5NBJG.js";import{i as h}from"./chunk-OYMLHX2B.js";var f={healthyThreshold:3,warningThreshold:2,checkIntervalMs:5e3,maxHistoryEntries:100,alertsEnabled:!0,alertCooldownMs:6e4,selfHealingEnabled:!1,maxHealingActionsPerMinute:5};var g=class{calculator;config;eventBus;persistence;graph;history=[];alerts=new Map;lastAlertTime=new Map;monitoringInterval=null;isMonitoring=!1;constructor(e,t={},r,i){this.graph=e,this.config={...f,...t},this.calculator=p(),this.eventBus=r,this.persistence=i}start(){this.isMonitoring||(this.isMonitoring=!0,this.monitoringInterval=setInterval(()=>this.checkHealth(),this.config.checkIntervalMs),this.checkHealth())}stop(){this.monitoringInterval&&(clearInterval(this.monitoringInterval),this.monitoringInterval=null),this.isMonitoring=!1}updateGraph(e){this.graph=e,this.isMonitoring&&this.checkHealth()}isEmptyTopology(){return this.graph.getVerticesByType("agent").length===0}checkHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph),r=this.isEmptyTopology()?"idle":this.determineStatus(e),i=this.calculateTrend();return this.recordHistory(e),this.isEmptyTopology()||this.checkAlertConditions(e,t,r),this.persistence&&t.length>0&&this.persistence.saveWeakVertices(t).catch(n=>console.warn("[MinCutHealthMonitor] Failed to persist weak vertices:",n)),this.emitEvent("mincut.updated",e,{status:r,weakVertexCount:t.length}),{status:r,minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:i,history:this.history.slice(-20),lastUpdated:new Date}}getHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph);return{status:this.isEmptyTopology()?"idle":this.determineStatus(e),minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:this.calculateTrend(),history:this.history.slice(-20),lastUpdated:new Date}}getMinCutValue(){return this.calculator.getMinCutValue(this.graph)}getWeakVertices(){return this.calculator.findWeakVertices(this.graph)}isCritical(){return this.calculator.getMinCutValue(this.graph)<this.config.warningThreshold}isHealthy(){return this.calculator.getMinCutValue(this.graph)>=this.config.healthyThreshold}getActiveAlerts(){return Array.from(this.alerts.values()).filter(e=>!e.acknowledged).sort((e,t)=>{let r={critical:0,high:1,medium:2,low:3,info:4};return r[e.severity]-r[t.severity]})}getAllAlerts(){return Array.from(this.alerts.values())}acknowledgeAlert(e){let t=this.alerts.get(e);return t?(t.acknowledged=!0,!0):!1}clearAcknowledgedAlerts(){let e=[];for(let[t,r]of this.alerts)r.acknowledged&&e.push(t);for(let t of e)this.alerts.delete(t);return e.length}getHistory(){return[...this.history]}getTrend(){return this.calculateTrend()}getStats(e=6e4){let t=Date.now()-e,r=this.history.filter(n=>n.timestamp.getTime()>t);if(r.length===0){let n=this.calculator.getMinCutValue(this.graph);return{min:n,max:n,average:n,count:0}}let i=r.map(n=>n.value);return{min:Math.min(...i),max:Math.max(...i),average:i.reduce((n,a)=>n+a,0)/i.length,count:r.length}}updateConfig(e){Object.assign(this.config,e),e.checkIntervalMs&&this.isMonitoring&&(this.stop(),this.start())}getConfig(){return{...this.config}}determineStatus(e){return e>=this.config.healthyThreshold?"healthy":e>=this.config.warningThreshold?"warning":"critical"}calculateTrend(){if(this.history.length<3)return"stable";let e=this.history.slice(-5),t=e[0].value,i=e[e.length-1].value-t,a=e.reduce((o,c)=>o+c.value,0)/e.length*.1;return i>a?"improving":i<-a?"degrading":"stable"}recordHistory(e){let t={timestamp:new Date,value:e,vertexCount:this.graph.vertexCount,edgeCount:this.graph.edgeCount};for(this.history.push(t);this.history.length>this.config.maxHistoryEntries;)this.history.shift()}checkAlertConditions(e,t,r){if(!this.config.alertsEnabled)return;let i=Date.now();r==="critical"?this.maybeGenerateAlert("critical-threshold","critical",`MinCut value (${e.toFixed(2)}) is below critical threshold (${this.config.warningThreshold})`,e,this.config.warningThreshold,t):r==="warning"&&this.maybeGenerateAlert("warning-threshold","high",`MinCut value (${e.toFixed(2)}) is below healthy threshold (${this.config.healthyThreshold})`,e,this.config.healthyThreshold,t);let n=t.filter(o=>o.weightedDegree===0);n.length>0&&this.maybeGenerateAlert("isolated-vertices","high",`${n.length} isolated vertex(es) detected`,e,0,n);let a=t.filter(o=>o.riskScore>.8);a.length>0&&this.maybeGenerateAlert("critical-vertices","medium",`${a.length} critical vertex(es) with high risk score`,e,0,a)}maybeGenerateAlert(e,t,r,i,n,a){let o=Date.now(),c=this.lastAlertTime.get(e)||0;if(o-c<this.config.alertCooldownMs)return;let s={id:h(),severity:t,message:r,minCutValue:i,threshold:n,affectedVertices:a.map(l=>l.vertexId),timestamp:new Date,acknowledged:!1,remediations:a.flatMap(l=>l.suggestions).slice(0,5)};this.alerts.set(s.id,s),this.persistence&&this.persistence.saveAlert(s).catch(l=>console.warn("[MinCutHealthMonitor] Failed to persist alert:",l)),this.lastAlertTime.set(e,o),this.emitEvent("mincut.alert.generated",i,{alert:s})}emitEvent(e,t,r){if(!this.eventBus)return;let i={id:h(),type:e,source:"coordination",timestamp:new Date,correlationId:h(),payload:{minCutValue:t,...r}};this.eventBus.publish(i).catch(n=>{console.error("Failed to publish MinCut event:",n)})}};function v(m,e,t,r){return new g(m,e,t,r)}var d=null,u=null;function C(){return d||(d=y()),d}function P(){return u||(u=v(C())),u}function B(){return d!==null}function F(){return u!==null}export{f as a,v as b,C as c,P as d,B as e,F as f};
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.14.5");process.exit(0)}
2
+ import{b as y,d as p}from"./chunk-BJPL6THQ.js";import{i as h}from"./chunk-W2XCZU62.js";var f={healthyThreshold:3,warningThreshold:2,checkIntervalMs:5e3,maxHistoryEntries:100,alertsEnabled:!0,alertCooldownMs:6e4,selfHealingEnabled:!1,maxHealingActionsPerMinute:5};var g=class{calculator;config;eventBus;persistence;graph;history=[];alerts=new Map;lastAlertTime=new Map;monitoringInterval=null;isMonitoring=!1;constructor(e,t={},r,i){this.graph=e,this.config={...f,...t},this.calculator=p(),this.eventBus=r,this.persistence=i}start(){this.isMonitoring||(this.isMonitoring=!0,this.monitoringInterval=setInterval(()=>this.checkHealth(),this.config.checkIntervalMs),this.checkHealth())}stop(){this.monitoringInterval&&(clearInterval(this.monitoringInterval),this.monitoringInterval=null),this.isMonitoring=!1}updateGraph(e){this.graph=e,this.isMonitoring&&this.checkHealth()}isEmptyTopology(){return this.graph.getVerticesByType("agent").length===0}checkHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph),r=this.isEmptyTopology()?"idle":this.determineStatus(e),i=this.calculateTrend();return this.recordHistory(e),this.isEmptyTopology()||this.checkAlertConditions(e,t,r),this.persistence&&t.length>0&&this.persistence.saveWeakVertices(t).catch(n=>console.warn("[MinCutHealthMonitor] Failed to persist weak vertices:",n)),this.emitEvent("mincut.updated",e,{status:r,weakVertexCount:t.length}),{status:r,minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:i,history:this.history.slice(-20),lastUpdated:new Date}}getHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph);return{status:this.isEmptyTopology()?"idle":this.determineStatus(e),minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:this.calculateTrend(),history:this.history.slice(-20),lastUpdated:new Date}}getMinCutValue(){return this.calculator.getMinCutValue(this.graph)}getWeakVertices(){return this.calculator.findWeakVertices(this.graph)}isCritical(){return this.calculator.getMinCutValue(this.graph)<this.config.warningThreshold}isHealthy(){return this.calculator.getMinCutValue(this.graph)>=this.config.healthyThreshold}getActiveAlerts(){return Array.from(this.alerts.values()).filter(e=>!e.acknowledged).sort((e,t)=>{let r={critical:0,high:1,medium:2,low:3,info:4};return r[e.severity]-r[t.severity]})}getAllAlerts(){return Array.from(this.alerts.values())}acknowledgeAlert(e){let t=this.alerts.get(e);return t?(t.acknowledged=!0,!0):!1}clearAcknowledgedAlerts(){let e=[];for(let[t,r]of this.alerts)r.acknowledged&&e.push(t);for(let t of e)this.alerts.delete(t);return e.length}getHistory(){return[...this.history]}getTrend(){return this.calculateTrend()}getStats(e=6e4){let t=Date.now()-e,r=this.history.filter(n=>n.timestamp.getTime()>t);if(r.length===0){let n=this.calculator.getMinCutValue(this.graph);return{min:n,max:n,average:n,count:0}}let i=r.map(n=>n.value);return{min:Math.min(...i),max:Math.max(...i),average:i.reduce((n,a)=>n+a,0)/i.length,count:r.length}}updateConfig(e){Object.assign(this.config,e),e.checkIntervalMs&&this.isMonitoring&&(this.stop(),this.start())}getConfig(){return{...this.config}}determineStatus(e){return e>=this.config.healthyThreshold?"healthy":e>=this.config.warningThreshold?"warning":"critical"}calculateTrend(){if(this.history.length<3)return"stable";let e=this.history.slice(-5),t=e[0].value,i=e[e.length-1].value-t,a=e.reduce((o,c)=>o+c.value,0)/e.length*.1;return i>a?"improving":i<-a?"degrading":"stable"}recordHistory(e){let t={timestamp:new Date,value:e,vertexCount:this.graph.vertexCount,edgeCount:this.graph.edgeCount};for(this.history.push(t);this.history.length>this.config.maxHistoryEntries;)this.history.shift()}checkAlertConditions(e,t,r){if(!this.config.alertsEnabled)return;let i=Date.now();r==="critical"?this.maybeGenerateAlert("critical-threshold","critical",`MinCut value (${e.toFixed(2)}) is below critical threshold (${this.config.warningThreshold})`,e,this.config.warningThreshold,t):r==="warning"&&this.maybeGenerateAlert("warning-threshold","high",`MinCut value (${e.toFixed(2)}) is below healthy threshold (${this.config.healthyThreshold})`,e,this.config.healthyThreshold,t);let n=t.filter(o=>o.weightedDegree===0);n.length>0&&this.maybeGenerateAlert("isolated-vertices","high",`${n.length} isolated vertex(es) detected`,e,0,n);let a=t.filter(o=>o.riskScore>.8);a.length>0&&this.maybeGenerateAlert("critical-vertices","medium",`${a.length} critical vertex(es) with high risk score`,e,0,a)}maybeGenerateAlert(e,t,r,i,n,a){let o=Date.now(),c=this.lastAlertTime.get(e)||0;if(o-c<this.config.alertCooldownMs)return;let s={id:h(),severity:t,message:r,minCutValue:i,threshold:n,affectedVertices:a.map(l=>l.vertexId),timestamp:new Date,acknowledged:!1,remediations:a.flatMap(l=>l.suggestions).slice(0,5)};this.alerts.set(s.id,s),this.persistence&&this.persistence.saveAlert(s).catch(l=>console.warn("[MinCutHealthMonitor] Failed to persist alert:",l)),this.lastAlertTime.set(e,o),this.emitEvent("mincut.alert.generated",i,{alert:s})}emitEvent(e,t,r){if(!this.eventBus)return;let i={id:h(),type:e,source:"coordination",timestamp:new Date,correlationId:h(),payload:{minCutValue:t,...r}};this.eventBus.publish(i).catch(n=>{console.error("Failed to publish MinCut event:",n)})}};function v(m,e,t,r){return new g(m,e,t,r)}var d=null,u=null;function C(){return d||(d=y()),d}function P(){return u||(u=v(C())),u}function B(){return d!==null}function F(){return u!==null}export{f as a,v as b,C as c,P as d,B as e,F as f};
@@ -1,2 +1,2 @@
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.14.3");process.exit(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.14.5");process.exit(0)}
2
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 +1,2 @@
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.14.3");process.exit(0)}
2
- import{l as m}from"./chunk-44WISFTU.js";import{a as l,c as d}from"./chunk-HRUU7E3D.js";d();var c=class extends m{config={name:"qe/tests/load",description:"Run agent load tests to validate fleet scalability. Supports light, medium, and heavy workload profiles. Uses mock agents by default (safe); set mockMode=false to test with real fleet agents (requires fleet_init). Reports bottlenecks and pass/fail criteria.",domain:"test-execution",schema:this.buildSchema(),timeout:3e5};buildSchema(){return{type:"object",properties:{targetAgents:{type:"number",description:"Target number of concurrent agents to simulate",default:10,minimum:1,maximum:200},profile:{type:"string",description:"Workload profile: light, medium, or heavy",enum:["light","medium","heavy"],default:"medium"},durationMs:{type:"number",description:"Test duration in milliseconds",default:3e4,minimum:5e3,maximum:3e5},mockMode:{type:"boolean",description:"Use mock agents (true, default) or real fleet agents (false, requires fleet_init)",default:!0}}}}async execute(t,u){try{let{createAgentLoadTester:r}=await import("./load-VO7ABNHV.js"),a=t.profile||"medium",o=t.targetAgents||10,i=t.durationMs||3e4,n=t.mockMode!==!1,s=await r({maxAgents:o,workloadProfile:a,mockMode:n}).runTest(o,i),e=s.bottlenecks;return{success:!0,data:{testId:u.requestId,profile:a,targetAgents:o,duration:s.duration,mockMode:n,passed:s.success,bottleneckCount:e?.bottlenecks?.length??0,report:{overallSeverity:e?.overallSeverity??"none",hasCritical:e?.hasCritical??!1,checksPerformed:e?.summary?.totalChecks??0,bottlenecksDetected:e?.summary?.detected??0},summary:`Load test (${a}, ${n?"mock":"real"}): ${o} agents, ${i}ms \u2014 ${s.success?"PASSED":"FAILED"}`+(e?.hasCritical?" [CRITICAL BOTTLENECKS]":"")}}}catch(r){return{success:!1,error:l(r)}}}};export{c as a};
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.14.5");process.exit(0)}
2
+ import{l as m}from"./chunk-YDFL445W.js";import{a as l,c as d}from"./chunk-J5UNP6W3.js";d();var c=class extends m{config={name:"qe/tests/load",description:"Run agent load tests to validate fleet scalability. Supports light, medium, and heavy workload profiles. Uses mock agents by default (safe); set mockMode=false to test with real fleet agents (requires fleet_init). Reports bottlenecks and pass/fail criteria.",domain:"test-execution",schema:this.buildSchema(),timeout:3e5};buildSchema(){return{type:"object",properties:{targetAgents:{type:"number",description:"Target number of concurrent agents to simulate",default:10,minimum:1,maximum:200},profile:{type:"string",description:"Workload profile: light, medium, or heavy",enum:["light","medium","heavy"],default:"medium"},durationMs:{type:"number",description:"Test duration in milliseconds",default:3e4,minimum:5e3,maximum:3e5},mockMode:{type:"boolean",description:"Use mock agents (true, default) or real fleet agents (false, requires fleet_init)",default:!0}}}}async execute(t,u){try{let{createAgentLoadTester:r}=await import("./load-B2T77UJQ.js"),a=t.profile||"medium",o=t.targetAgents||10,i=t.durationMs||3e4,n=t.mockMode!==!1,s=await r({maxAgents:o,workloadProfile:a,mockMode:n}).runTest(o,i),e=s.bottlenecks;return{success:!0,data:{testId:u.requestId,profile:a,targetAgents:o,duration:s.duration,mockMode:n,passed:s.success,bottleneckCount:e?.bottlenecks?.length??0,report:{overallSeverity:e?.overallSeverity??"none",hasCritical:e?.hasCritical??!1,checksPerformed:e?.summary?.totalChecks??0,bottlenecksDetected:e?.summary?.detected??0},summary:`Load test (${a}, ${n?"mock":"real"}): ${o} agents, ${i}ms \u2014 ${s.success?"PASSED":"FAILED"}`+(e?.hasCritical?" [CRITICAL BOTTLENECKS]":"")}}}catch(r){return{success:!1,error:l(r)}}}};export{c as a};
@@ -1,2 +1,2 @@
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.14.3");process.exit(0)}
2
- import{d as s}from"./chunk-YAKS3CAB.js";s();
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.14.5");process.exit(0)}
2
+ import{d as s}from"./chunk-IJHCIXJC.js";s();
@@ -0,0 +1,14 @@
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.14.5");process.exit(0)}
2
+ import{a as _}from"./chunk-3DDXWYMO.js";import{a as w}from"./chunk-CPC7FN52.js";import{d as k,f as q}from"./chunk-E4EYPYR3.js";import{k as M,o as U}from"./chunk-EFV4ADMO.js";import{b as f,d as P}from"./chunk-IJHCIXJC.js";import{a as g,c as F}from"./chunk-J5UNP6W3.js";import{a as R}from"./chunk-JSZ663MU.js";import{randomUUID as Q}from"crypto";U();P();F();var x={alpha:.1,minOutcomes:10,weightFloor:.2,weightCeiling:2},p=class{records=new Map;config;constructor(e){this.config={...x,...e}}recordOutcome(e,t,o){let{alpha:i,minOutcomes:r,weightFloor:s,weightCeiling:n}=this.config,c=this.records.get(e),d=t?1:0,a=Math.max(0,Math.min(1,o)),l,u;c?(l=i*d+(1-i)*c.emaAccuracy,u=i*a+(1-i)*c.emaQuality):(l=d,u=a);let h=(c?.totalOutcomes??0)+1,C;h>=r?C=Math.max(s,Math.min(n,l*2)):C=1;let S={agentId:e,emaAccuracy:l,emaQuality:u,calibratedWeight:C,totalOutcomes:h,lastUpdated:new Date};return this.records.set(e,S),S}getCalibration(e){return this.records.get(e)??null}getCalibratedWeight(e){let t=this.records.get(e);return!t||t.totalOutcomes<this.config.minOutcomes?1:t.calibratedWeight}getAllCalibrations(){return Array.from(this.records.values())}reset(e){e!==void 0?this.records.delete(e):this.records.clear()}serialize(){let e={};for(let[t,o]of this.records)e[t]={...o};return e}deserialize(e){this.records.clear();for(let[t,o]of Object.entries(e))this.records.set(t,{...o,lastUpdated:new Date(o.lastUpdated)})}};var D={escalateAfterFailures:2,deEscalateAfterSuccesses:5,maxTier:"opus",minTier:"haiku"},I=["booster","haiku","sonnet","opus"],b=class{config;tierOrder;states=new Map;constructor(e){this.config={...D,...e},this.tierOrder=this.config.tierOrder??I}tierIndex(e){return this.tierOrder.indexOf(e)}recordOutcome(e,t,o){let i=this.states.get(e);i||(i={agentId:e,currentTier:o,baseTier:o,consecutiveFailures:0,consecutiveSuccesses:0,escalationCount:0,deEscalationCount:0,lastAction:"none",lastActionTimestamp:new Date},this.states.set(e,i));let r=i.currentTier;if(t){if(i.consecutiveSuccesses++,i.consecutiveFailures=0,i.consecutiveSuccesses>=this.config.deEscalateAfterSuccesses){let s=this.tierIndex(i.currentTier),n=this.tierIndex(this.config.minTier);if(s>n)return i.currentTier=this.tierOrder[s-1],i.deEscalationCount++,i.consecutiveSuccesses=0,i.lastAction="de-escalate",i.lastActionTimestamp=new Date,{action:"de-escalate",previousTier:r,newTier:i.currentTier}}}else if(i.consecutiveFailures++,i.consecutiveSuccesses=0,i.consecutiveFailures>=this.config.escalateAfterFailures){let s=this.tierIndex(i.currentTier),n=this.tierIndex(this.config.maxTier);if(s>=0&&s<n)return i.currentTier=this.tierOrder[s+1],i.escalationCount++,i.consecutiveFailures=0,i.lastAction="escalate",i.lastActionTimestamp=new Date,{action:"escalate",previousTier:r,newTier:i.currentTier}}return{action:"none",previousTier:r,newTier:i.currentTier}}getCurrentTier(e){return this.states.get(e)?.currentTier??null}getState(e){return this.states.get(e)??null}getAllStates(){return Array.from(this.states.values())}reset(e){e?this.states.delete(e):this.states.clear()}};var T={booster:{avgInputTokens:0,avgOutputTokens:0,costPerTask:0},haiku:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.0035},sonnet:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.021},opus:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.105}},v=["booster","haiku","sonnet","opus"],y=T.opus.costPerTask,L={qualityWeight:.6,costWeight:.4,budgetPerHourUsd:0,budgetPerDayUsd:0,minQualityThreshold:.5,enabled:!0},N=.15,E=class{config;costTracker;tierQualityEstimates=new Map;tierOutcomeCounts=new Map;constructor(e,t){let o={...L,...t};o.qualityWeight=Math.max(0,Math.min(1,o.qualityWeight)),o.costWeight=Math.max(0,Math.min(1,o.costWeight)),o.minQualityThreshold=Math.max(0,Math.min(1,o.minQualityThreshold)),o.budgetPerHourUsd=Math.max(0,o.budgetPerHourUsd),o.budgetPerDayUsd=Math.max(0,o.budgetPerDayUsd);let i=o.qualityWeight+o.costWeight;i>0&&i!==1&&(o.qualityWeight/=i,o.costWeight/=i),this.config=o,this.costTracker=e,this.tierQualityEstimates.set("booster",.3),this.tierQualityEstimates.set("haiku",.55),this.tierQualityEstimates.set("sonnet",.75),this.tierQualityEstimates.set("opus",.9)}scoreTiers(e){let t=v.map(o=>{let i=this.getQualityEstimate(o,e),r=T[o].costPerTask,s=r>0?i/r:i>0?1/0:0,n=y>0?1-r/y:1,c=this.config.qualityWeight*i+this.config.costWeight*n;return{tier:o,qualityScore:i,estimatedCostUsd:r,qualityPerDollar:s,economicScore:c}});return t.sort((o,i)=>i.economicScore-o.economicScore),t}selectTier(e){let t=this.scoreTiers(e);for(let r of t)if(!(r.qualityScore<this.config.minQualityThreshold)&&!this.wouldExceedBudget(r.tier))return{tier:r.tier,reason:`Best economic score (${r.economicScore.toFixed(3)}): quality=${r.qualityScore.toFixed(2)}, cost=$${r.estimatedCostUsd.toFixed(4)}`,scores:t};let o=t.filter(r=>r.qualityScore>=this.config.minQualityThreshold);if(o.length>0){let r=[...o].sort((s,n)=>s.estimatedCostUsd-n.estimatedCostUsd)[0];return{tier:r.tier,reason:`Budget constrained fallback to ${r.tier}`,scores:t}}let i=[...t].sort((r,s)=>s.qualityScore-r.qualityScore)[0];return{tier:i.tier,reason:`No tier meets quality threshold ${this.config.minQualityThreshold}; using best quality: ${i.tier}`,scores:t}}wouldExceedBudget(e){let t=T[e].costPerTask;if(t===0)return!1;let o=this.costTracker.getCurrentCost("hour"),i=this.costTracker.getCurrentCost("day");return this.config.budgetPerHourUsd>0&&o+t>this.config.budgetPerHourUsd||this.config.budgetPerDayUsd>0&&i+t>this.config.budgetPerDayUsd}updateFromOutcome(e,t){let o=e.outcome.qualityScore,i=this.tierQualityEstimates.get(t)??.5,r=this.tierOutcomeCounts.get(t)??0,s=r<5?.4:N,n=i*(1-s)+o*s;this.tierQualityEstimates.set(t,n),this.tierOutcomeCounts.set(t,r+1)}getEconomicReport(){let e=this.scoreTiers(.5),t=this.costTracker.getCurrentCost("hour"),o=this.costTracker.getCurrentCost("day"),i={hourly:this.config.budgetPerHourUsd>0?Math.max(0,this.config.budgetPerHourUsd-t):null,daily:this.config.budgetPerDayUsd>0?Math.max(0,this.config.budgetPerDayUsd-o):null},r=null,s=[...e].sort((a,l)=>l.qualityPerDollar-a.qualityPerDollar),n=s.find(a=>a.estimatedCostUsd>0&&isFinite(a.qualityPerDollar)),c=[...s].reverse().find(a=>a.estimatedCostUsd>0&&isFinite(a.qualityPerDollar));if(n&&c&&n.tier!==c.tier){let a=c.estimatedCostUsd-n.estimatedCostUsd;a>0&&(r={usd:a,description:`Switch from ${c.tier} ($${c.estimatedCostUsd.toFixed(4)}/task) to ${n.tier} ($${n.estimatedCostUsd.toFixed(4)}/task) for comparable tasks to save ~$${a.toFixed(4)}/task`})}let d=this.generateRecommendation(e,i);return{tierEfficiency:e,currentHourlyCostUsd:t,currentDailyCostUsd:o,budgetRemaining:i,recommendation:d,savingsOpportunity:r}}computeCostAdjustedReward(e,t,o){let i=T[t].costPerTask;if(y===0)return e;let r=i/y,s=Math.max(0,o-this.config.minQualityThreshold),n=r*(1-s),c=e-n*this.config.costWeight;return Math.max(-1,Math.min(1,c))}serializeEstimates(){let e={};for(let t of v)e[t]={quality:this.tierQualityEstimates.get(t)??.5,count:this.tierOutcomeCounts.get(t)??0};return e}deserializeEstimates(e){for(let t of v)e[t]&&(this.tierQualityEstimates.set(t,e[t].quality),this.tierOutcomeCounts.set(t,e[t].count))}getConfig(){return{...this.config}}getQualityEstimate(e,t){let o=this.tierQualityEstimates.get(e)??.5,i=e==="booster"?t*.4:e==="haiku"?t*.2:0;return Math.max(0,Math.min(1,o-i))}generateRecommendation(e,t){if(t.hourly!==null&&t.hourly<.01)return"Hourly budget nearly exhausted. Consider increasing budget or routing to cheaper tiers.";if(t.daily!==null&&t.daily<.1)return"Daily budget nearly exhausted. Only critical tasks should use expensive tiers.";let o=e[0];return o?`Most cost-efficient tier: ${o.tier} (score=${o.economicScore.toFixed(3)}, quality=${o.qualityScore.toFixed(2)})`:"No economic data available yet."}};q();var A=class{outcomes=[];maxOutcomes;constructor(e=1e4){this.maxOutcomes=e}add(e){this.outcomes.push(e),this.outcomes.length>this.maxOutcomes&&(this.outcomes=this.outcomes.slice(-this.maxOutcomes))}getByAgent(e,t=100){return this.outcomes.filter(o=>o.usedAgent===e).slice(-t)}getAll(e=1e3){return this.outcomes.slice(-e)}getRecentOverrides(e=50){return this.outcomes.filter(t=>!t.followedRecommendation).slice(-e)}clear(){this.outcomes=[]}get size(){return this.outcomes.length}},O=class m{static schemaMigrated=!1;outcomeStore;router=null;db=null;calibrator=null;escalationTracker=null;economicModel=null;economicPersistCounter=0;static ECONOMIC_PERSIST_INTERVAL=10;persistCount=0;maxOutcomes;static RETENTION_CLEANUP_INTERVAL=100;constructor(e=1e4,t){this.maxOutcomes=e,this.outcomeStore=new A(e),t?.enableEMACalibration&&this.enableCalibration(),t?.enableAutoEscalation&&this.enableAutoEscalation()}async initialize(){try{this.db=M(),this.db.isInitialized()||await this.db.initialize(),await this.loadFromDb(),this.loadCalibratorState()}catch(e){console.warn("[RoutingFeedbackCollector] DB init failed, using memory-only:",g(e)),this.db=null}}async loadFromDb(){if(!this.db)return;let t=this.db.getDatabase().prepare(`
3
+ SELECT * FROM routing_outcomes ORDER BY created_at DESC LIMIT ?
4
+ `).all(this.maxOutcomes);for(let o of t.reverse()){let i={id:o.id,task:f(o.task_json),decision:f(o.decision_json),usedAgent:o.used_agent,followedRecommendation:!!o.followed_recommendation,outcome:{success:!!o.success,qualityScore:o.quality_score,durationMs:o.duration_ms,error:o.error||void 0},timestamp:new Date(o.created_at),advisorConsultation:o.advisor_consultation_json?f(o.advisor_consultation_json):void 0};this.outcomeStore.add(i)}t.length>0&&console.log(`[RoutingFeedbackCollector] Loaded ${t.length} outcomes from DB`)}persistOutcome(e){if(this.db)try{let t=this.db.getDatabase();if(!m.schemaMigrated){for(let r of["ALTER TABLE routing_outcomes ADD COLUMN model_tier TEXT","ALTER TABLE routing_outcomes ADD COLUMN advisor_consultation_json TEXT"])try{t.prepare(r).run()}catch{}_(t),m.schemaMigrated=!0}let o=this.inferTier(e.usedAgent),i=e.advisorConsultation?JSON.stringify(e.advisorConsultation):null;t.prepare(`
5
+ INSERT OR REPLACE INTO routing_outcomes (
6
+ id, task_json, decision_json, used_agent,
7
+ followed_recommendation, success, quality_score,
8
+ duration_ms, error, model_tier, advisor_consultation_json
9
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
10
+ `).run(e.id,JSON.stringify(e.task),JSON.stringify(e.decision),e.usedAgent,e.followedRecommendation?1:0,e.outcome.success?1:0,e.outcome.qualityScore,e.outcome.durationMs,e.outcome.error||null,o,i),this.persistCount++,this.persistCount%m.RETENTION_CLEANUP_INTERVAL===0&&this.enforceRetention(t)}catch(t){console.warn("[RoutingFeedbackCollector] Failed to persist outcome:",g(t))}}loadAdvisorConsultationSidecar(e){try{let{readdirSync:t,readFileSync:o}=R("fs"),{join:i}=R("path"),{homedir:r}=R("os"),s=i(r(),".agentic-qe","advisor","consultations"),n=t(s).filter(l=>l.endsWith(".json")).sort().reverse();if(n.length===0)return;let c=n[0],d=JSON.parse(o(i(s,c),"utf-8"));return Date.now()-new Date(d.timestamp).getTime()>300*1e3?void 0:d}catch{return}}inferTier(e){let t=e.toLowerCase();return t.includes("booster")||t==="tier-0"?"booster":t==="tier-1"||t.includes("haiku")?"haiku":t==="tier-2"||t.includes("sonnet")?"sonnet":t.includes("opus")?"opus":"sonnet"}enforceRetention(e){try{let t=this.maxOutcomes*2;e.prepare(`
11
+ DELETE FROM routing_outcomes WHERE id NOT IN (
12
+ SELECT id FROM routing_outcomes ORDER BY created_at DESC LIMIT ?
13
+ )
14
+ `).run(t)}catch(t){console.warn("[RoutingFeedbackCollector] Retention cleanup failed:",g(t))}}loadCalibratorState(){if(!(!this.db||!this.calibrator))try{let t=this.db.getDatabase().prepare("SELECT value FROM kv_store WHERE key = 'routing:ema_calibrator_state'").get();if(t){let o=f(t.value);o&&typeof o=="object"&&(this.calibrator.deserialize(o),console.log("[RoutingFeedbackCollector] Loaded EMA calibrator state from DB"))}}catch(e){console.warn("[RoutingFeedbackCollector] Failed to load calibrator state:",g(e))}}persistCalibratorState(){if(!(!this.db||!this.calibrator))try{let e=this.db.getDatabase(),t=JSON.stringify(this.calibrator.serialize());e.prepare("INSERT OR REPLACE INTO kv_store (key, value, updated_at) VALUES (?, ?, datetime('now'))").run("routing:ema_calibrator_state",t)}catch(e){console.warn("[RoutingFeedbackCollector] Failed to persist calibrator state:",g(e))}}loadEconomicState(){if(!(!this.db||!this.economicModel))try{let t=this.db.getDatabase().prepare("SELECT value FROM kv_store WHERE key = 'routing:economic_quality_estimates'").get();if(t){let o=f(t.value);o&&typeof o=="object"&&(this.economicModel.deserializeEstimates(o),console.log("[RoutingFeedbackCollector] Loaded economic quality estimates from DB"))}}catch(e){console.warn("[RoutingFeedbackCollector] Failed to load economic state:",g(e))}}persistEconomicState(){if(!(!this.db||!this.economicModel))try{let e=this.db.getDatabase(),t=JSON.stringify(this.economicModel.serializeEstimates());e.prepare("INSERT OR REPLACE INTO kv_store (key, value, updated_at) VALUES (?, ?, datetime('now'))").run("routing:economic_quality_estimates",t)}catch(e){console.warn("[RoutingFeedbackCollector] Failed to persist economic state:",g(e))}}connectRouter(e){this.router=e}enableCalibration(e){this.calibrator=new p(e)}getCalibratedWeight(e){return this.calibrator?.getCalibratedWeight(e)??1}enableAutoEscalation(e){this.escalationTracker=new b(e)}getEscalationState(e){return this.escalationTracker?.getState(e)??null}enableEconomicRouting(e,t){let o=t??k();this.economicModel=new E(o,e),this.loadEconomicState()}getEconomicReport(){return this.economicModel?.getEconomicReport()??null}getEconomicScore(e){return this.economicModel?.scoreTiers(e)??null}recordOutcome(e,t,o,i,r){let s=r;s||(s=this.loadAdvisorConsultationSidecar(e));let n={id:`outcome-${Date.now()}-${Q().slice(0,8)}`,task:e,decision:t,usedAgent:o,followedRecommendation:o===t.recommended,outcome:i,timestamp:new Date,advisorConsultation:s};if(this.outcomeStore.add(n),this.persistOutcome(n),this.router&&this.router.updateAgentPerformance(o,i.success,i.qualityScore,i.durationMs),this.calibrator&&(this.calibrator.recordOutcome(o,i.success,i.qualityScore),this.persistCount%10===0&&this.persistCalibratorState()),this.escalationTracker){let c=t.recommended===o?"sonnet":"haiku",d=this.escalationTracker.recordOutcome(o,i.success,c);d.action!=="none"&&console.log(`[RoutingFeedbackCollector] Agent "${o}" ${d.action}d: ${d.previousTier} \u2192 ${d.newTier}`)}if(this.economicModel){let c=this.inferTier(o);this.economicModel.updateFromOutcome(n,c),this.economicPersistCounter++,this.economicPersistCounter%m.ECONOMIC_PERSIST_INTERVAL===0&&this.persistEconomicState()}return n}getAgentMetrics(e){let t=this.outcomeStore.getByAgent(e);if(t.length===0)return null;let o=t.filter(u=>u.outcome.success).length,i=t.reduce((u,h)=>u+h.outcome.durationMs,0),r=t.reduce((u,h)=>u+h.outcome.qualityScore,0),s=t.filter(u=>u.decision.recommended!==u.usedAgent&&u.decision.recommended===e).length,n=t.filter(u=>u.decision.recommended!==u.usedAgent&&u.usedAgent===e).length,c=t.slice(-10),d=c.filter(u=>u.outcome.success).length/c.length,a=o/t.length,l;return d>a+.1?l="improving":d<a-.1?l="declining":l="stable",{agentId:e,totalTasks:t.length,successfulTasks:o,successRate:o/t.length,avgQualityScore:r/t.length,avgDurationMs:i/t.length,overriddenCount:s,selectedOverOthersCount:n,trend:l,updatedAt:new Date}}getAllAgentMetrics(){let e=[];for(let t of w){let o=this.getAgentMetrics(t.id);o&&e.push(o)}return e.sort((t,o)=>o.successRate-t.successRate)}analyzeRoutingAccuracy(){let e=this.outcomeStore.getAll();if(e.length===0)return{totalOutcomes:0,followedRecommendations:0,overrideRate:0,recommendationSuccessRate:0,overrideSuccessRate:0,confidenceCorrelation:0};let t=e.filter(n=>n.followedRecommendation),o=e.filter(n=>!n.followedRecommendation),i=t.filter(n=>n.outcome.success).length,r=o.filter(n=>n.outcome.success).length,s=this.calculateConfidenceCorrelation(e);return{totalOutcomes:e.length,followedRecommendations:t.length,overrideRate:o.length/e.length,recommendationSuccessRate:t.length>0?i/t.length:0,overrideSuccessRate:o.length>0?r/o.length:0,confidenceCorrelation:s}}calculateConfidenceCorrelation(e){if(e.length<2)return 0;let t=e.map(a=>a.decision.confidence),o=e.map(a=>a.outcome.success?1:0),i=t.reduce((a,l)=>a+l,0)/t.length,r=o.reduce((a,l)=>a+l,0)/o.length,s=0,n=0,c=0;for(let a=0;a<e.length;a++){let l=t[a]-i,u=o[a]-r;s+=l*u,n+=l*l,c+=u*u}let d=Math.sqrt(n*c);return d===0?0:s/d}getImprovementRecommendations(){let e=[],t=this.analyzeRoutingAccuracy();if(t.totalOutcomes<50)return e.push("Collect more routing outcomes for reliable analysis (at least 50)"),e;t.overrideRate>.3&&t.overrideSuccessRate>t.recommendationSuccessRate&&e.push("Users are frequently overriding recommendations with better results. Consider adjusting routing weights or updating agent capabilities."),t.confidenceCorrelation<.3&&e.push("Low correlation between confidence and success. Consider improving semantic matching or adjusting weight distribution.");let o=this.getAllAgentMetrics(),i=o.filter(s=>s.successRate<.5&&s.totalTasks>=10);i.length>0&&e.push(`Agents with low success rates: ${i.map(s=>s.agentId).join(", ")}. Consider reviewing their capability mappings.`);let r=o.filter(s=>s.trend==="declining"&&s.totalTasks>=10);return r.length>0&&e.push(`Agents with declining performance: ${r.map(s=>s.agentId).join(", ")}. Monitor for potential issues.`),e.length===0&&e.push("Routing performance is healthy. Continue collecting feedback."),e}exportOutcomes(){return this.outcomeStore.getAll()}importOutcomes(e){for(let t of e)this.outcomeStore.add(t)}getStats(){let e=this.outcomeStore.getAll(),t=new Set(e.map(o=>o.usedAgent));return{totalOutcomes:this.outcomeStore.size,uniqueAgentsUsed:t.size,recentOverrides:this.outcomeStore.getRecentOverrides().length}}clear(){this.outcomeStore.clear()}};function se(m=1e4,e){return new O(m,e)}export{b as a,O as b,se as c};
@@ -1,3 +1,3 @@
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.14.3");process.exit(0)}
2
- import{c}from"./chunk-Y2DVFVGI.js";function u(r){switch(r.toUpperCase()){case"DEBUG":return 0;case"INFO":return 1;case"WARN":case"WARNING":return 2;case"ERROR":return 3;case"SILENT":case"NONE":case"OFF":return 4;default:return 1}}var f,l=c(()=>{"use strict";f={0:"DEBUG",1:"INFO",2:"WARN",3:"ERROR",4:"SILENT"}});var a,s,g,d=c(()=>{"use strict";l();a={includeTimestamp:!0,includeLevel:!0,timestampFormat:"short",prettyPrint:!1,maxContextDepth:3},s=class r{domain;level;config;inheritedContext;constructor(e,n=1,o={},t={}){this.domain=e,this.level=n,this.config={...a,...o},this.inheritedContext=t}debug(e,n){this.level<=0&&this.output(0,e,n)}info(e,n){this.level<=1&&this.output(1,e,n)}warn(e,n){this.level<=2&&this.output(2,e,n)}error(e,n,o){if(this.level<=3){let t={...o};if(n){t.errorName=n.name,t.errorMessage=n.message,n.stack&&(t.stack=n.stack);let i=n;i.cause!==void 0&&(t.cause=String(i.cause))}this.output(3,e,t)}}isEnabled(e){return this.level<=e}getDomain(){return this.domain}child(e){return new r(this.domain,this.level,this.config,{...this.inheritedContext,...e})}output(e,n,o){let t=this.format(e,n,o);switch(e){case 0:console.debug(t);break;case 1:console.info(t);break;case 2:console.warn(t);break;case 3:console.error(t);break}}format(e,n,o){let t=[];this.config.includeTimestamp&&t.push(this.formatTimestamp()),this.config.includeLevel&&t.push(this.formatLevel(e)),t.push(`[${this.domain}]`),t.push(n);let i=this.mergeContext(o);return i&&Object.keys(i).length>0&&t.push(this.formatContext(i)),t.join(" ")}formatTimestamp(){let e=new Date;if(this.config.timestampFormat==="iso")return`[${e.toISOString()}]`;let n=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),t=String(e.getSeconds()).padStart(2,"0"),i=String(e.getMilliseconds()).padStart(3,"0");return`[${n}:${o}:${t}.${i}]`}formatLevel(e){return`[${f[e].padEnd(5)}]`}mergeContext(e){if(!(!e&&Object.keys(this.inheritedContext).length===0))return{...this.inheritedContext,...e}}formatContext(e){try{return this.config.prettyPrint?`
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.14.5");process.exit(0)}
2
+ import{b as c}from"./chunk-JSZ663MU.js";function u(r){switch(r.toUpperCase()){case"DEBUG":return 0;case"INFO":return 1;case"WARN":case"WARNING":return 2;case"ERROR":return 3;case"SILENT":case"NONE":case"OFF":return 4;default:return 1}}var f,l=c(()=>{"use strict";f={0:"DEBUG",1:"INFO",2:"WARN",3:"ERROR",4:"SILENT"}});var a,s,g,d=c(()=>{"use strict";l();a={includeTimestamp:!0,includeLevel:!0,timestampFormat:"short",prettyPrint:!1,maxContextDepth:3},s=class r{domain;level;config;inheritedContext;constructor(e,n=1,o={},t={}){this.domain=e,this.level=n,this.config={...a,...o},this.inheritedContext=t}debug(e,n){this.level<=0&&this.output(0,e,n)}info(e,n){this.level<=1&&this.output(1,e,n)}warn(e,n){this.level<=2&&this.output(2,e,n)}error(e,n,o){if(this.level<=3){let t={...o};if(n){t.errorName=n.name,t.errorMessage=n.message,n.stack&&(t.stack=n.stack);let i=n;i.cause!==void 0&&(t.cause=String(i.cause))}this.output(3,e,t)}}isEnabled(e){return this.level<=e}getDomain(){return this.domain}child(e){return new r(this.domain,this.level,this.config,{...this.inheritedContext,...e})}output(e,n,o){let t=this.format(e,n,o);switch(e){case 0:console.debug(t);break;case 1:console.info(t);break;case 2:console.warn(t);break;case 3:console.error(t);break}}format(e,n,o){let t=[];this.config.includeTimestamp&&t.push(this.formatTimestamp()),this.config.includeLevel&&t.push(this.formatLevel(e)),t.push(`[${this.domain}]`),t.push(n);let i=this.mergeContext(o);return i&&Object.keys(i).length>0&&t.push(this.formatContext(i)),t.join(" ")}formatTimestamp(){let e=new Date;if(this.config.timestampFormat==="iso")return`[${e.toISOString()}]`;let n=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),t=String(e.getSeconds()).padStart(2,"0"),i=String(e.getMilliseconds()).padStart(3,"0");return`[${n}:${o}:${t}.${i}]`}formatLevel(e){return`[${f[e].padEnd(5)}]`}mergeContext(e){if(!(!e&&Object.keys(this.inheritedContext).length===0))return{...this.inheritedContext,...e}}formatContext(e){try{return this.config.prettyPrint?`
3
3
  `+JSON.stringify(e,this.createReplacer(),2):JSON.stringify(e,this.createReplacer())}catch{return"[unserializable context]"}}createReplacer(){let e=new WeakSet,n=0;return(o,t)=>{if(typeof t=="object"&&t!==null){if(n>=this.config.maxContextDepth)return"[object]";if(e.has(t))return"[circular]";e.add(t),n++}return t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:typeof t=="bigint"?t.toString():typeof t=="function"?"[function]":typeof t=="symbol"?t.toString():t}}},g=class{domain;constructor(e="null"){this.domain=e}debug(e,n){}info(e,n){}warn(e,n){}error(e,n,o){}isEnabled(e){return!1}getDomain(){return this.domain}child(e){return this}}});function F(r,e){return L.create(r,e)}var v,L,m=c(()=>{"use strict";l();d();v={defaultLevel:1,domainLevels:new Map,consoleConfig:a,silent:!1},L=class{static config={...v};static customProvider=null;static instances=new Map;static setLevel(e){this.config.defaultLevel=e,this.instances.clear()}static setLevelFromString(e){this.setLevel(u(e))}static getLevel(){return this.config.defaultLevel}static setDomainLevel(e,n){this.config.domainLevels.set(e,n),this.instances.delete(e)}static getDomainLevel(e){return this.config.domainLevels.get(e)??this.config.defaultLevel}static clearDomainLevel(e){this.config.domainLevels.delete(e),this.instances.delete(e)}static configure(e){this.config.consoleConfig={...this.config.consoleConfig,...e},this.instances.clear()}static setSilent(e){this.config.silent=e,this.instances.clear()}static isSilent(){return this.config.silent}static setProvider(e){this.customProvider=e,this.instances.clear()}static create(e,n){if(!n&&this.instances.has(e))return this.instances.get(e);let o=this.getDomainLevel(e),t;return this.config.silent?t=new g(e):this.customProvider?t=this.customProvider(e,o,n):t=new s(e,o,this.config.consoleConfig,n),n||this.instances.set(e,t),t}static getLogger(e,n){return this.create(e,n)}static reset(){this.config={defaultLevel:1,domainLevels:new Map,consoleConfig:{...a},silent:!1},this.customProvider=null,this.instances.clear()}static initFromEnv(){let e=process.env.LOG_LEVEL;e&&this.setLevelFromString(e);let n=process.env.LOG_TIMESTAMP;n!==void 0&&this.configure({includeTimestamp:n.toLowerCase()==="true"});let o=process.env.LOG_PRETTY;o!==void 0&&this.configure({prettyPrint:o.toLowerCase()==="true"})}static getStats(){return{cachedLoggers:this.instances.size,domains:Array.from(this.instances.keys()),domainOverrides:this.config.domainLevels.size,currentLevel:this.config.defaultLevel,silent:this.config.silent}}}});export{l as a,d as b,L as c,F as d,m as e};
@@ -0,0 +1,14 @@
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.14.5");process.exit(0)}
2
+ import{c as g,n as S,o as _}from"./chunk-KIP6WZGV.js";function q(i,e){return{ingest(t){i.ingest(t)},search(t,r){return i.search(t,r).map(s=>({id:s.id,score:s.score}))},delete(t){i.delete(t)},status(){let t=i.status();return{totalVectors:t.totalVectors,dimensions:e,totalSegments:t.totalSegments,fileSizeBytes:t.fileSizeBytes,epoch:t.epoch,witnessValid:t.witnessValid,witnessEntries:t.witnessEntries}},close(){i.close()},compact(){return i.compact()}}}function f(i,e){return(i.prepare("SELECT COUNT(*) as cnt FROM sqlite_master WHERE type='table' AND name=?").get(e)?.cnt??0)>0}function m(i,e,t){return i.prepare(`PRAGMA table_info(${e})`).all().some(s=>s.name===t)}var h=class{db;config;rvfStore=null;rvfAvailable=!1;constructor(e,t){this.db=e,this.config={...t,dimensions:t.dimensions??384},f(this.db,"qe_pattern_embeddings")&&!m(this.db,"qe_pattern_embeddings","space_id")&&(this.db.exec("ALTER TABLE qe_pattern_embeddings ADD COLUMN space_id TEXT"),this.db.exec("CREATE INDEX IF NOT EXISTS idx_qe_pattern_embeddings_space ON qe_pattern_embeddings(space_id)"))}activeSpaceId(){return this.config.embeddingSpaceId??S()?.spaceId}async initialize(){if(this.config.mode==="sqlite-only"){this.rvfAvailable=!1;return}try{let e=await import("./rvf-native-adapter-5ZRCGUI6.js");if(!e.isRvfNativeAvailable()){this.rvfAvailable=!1;return}this.activeSpaceId()||await _();let{isRvfLockHeldError:t,removeStaleRvfLock:r,quarantineUnusableStore:s}=await import("./rvf-store-integrity-ISKRP563.js"),l=()=>{try{return{store:e.openRvfStore(this.config.rvfPath),error:null}}catch(o){return{store:null,error:o}}},{store:n,error:a}=l();if(!n&&t(a)&&(!r(this.config.rvfPath)||({store:n,error:a}=l(),!n&&t(a))))throw a;if(!n)try{n=e.createRvfStore(this.config.rvfPath,this.config.dimensions)}catch(o){if({store:n,error:a}=l(),!n){if(t(a))throw a;if(!s(this.config.rvfPath,o instanceof Error?o.message:String(o),a))throw o;n=e.createRvfStore(this.config.rvfPath,this.config.dimensions)}}this.rvfStore=q(n,this.config.dimensions),g(this.config.rvfPath,this.activeSpaceId()??null,this.rvfStore.status().totalVectors),this.rvfAvailable=!0}catch(e){try{this.rvfStore?.close()}catch{}this.rvfStore=null,this.rvfAvailable=!1,console.warn(`[RVF] Dual-writer disabled for ${this.config.rvfPath}; falling back to SQLite: ${e instanceof Error?e.message:String(e)}`)}}setRvfStore(e){this.rvfStore=e,this.rvfAvailable=!0}writePattern(e,t){let r={sqliteSuccess:!1,rvfSuccess:!1};if(!m(this.db,"qe_pattern_embeddings","space_id")||!this.activeSpaceId())return{...r,divergence:"VECTOR_SPACE_UNVERIFIED"};try{this.writeSqliteEmbedding(e,t),r.sqliteSuccess=!0}catch{r.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.ingest([{id:e,vector:t instanceof Float32Array?Array.from(t):t}]),r.rvfSuccess=!0}catch{r.rvfSuccess=!1,r.divergence="rvf-write-failed"}return r}deletePattern(e){let t={sqliteSuccess:!1,rvfSuccess:!1};try{this.deleteSqliteEmbedding(e),t.sqliteSuccess=!0}catch{t.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.delete([e]),t.rvfSuccess=!0}catch{t.rvfSuccess=!1,t.divergence="rvf-delete-failed"}return t}search(e,t){if(!this.hasCompatibleEmbeddingSpace())return[];if(this.config.mode==="rvf-primary"&&this.rvfAvailable&&this.rvfStore)try{return this.rvfStore.search(e,t)}catch{}return this.searchSqlite(e,t)}getDivergenceReport(){let e={totalChecked:0,divergences:0,details:[]},t=this.getSqliteEmbeddingCount();if(e.totalChecked=t,!this.rvfAvailable||!this.rvfStore)return this.config.mode!=="sqlite-only"&&t>0&&(e.divergences=1,e.details.push({patternId:"*",issue:"count-mismatch"})),e;let s=this.rvfStore.status().totalVectors;return t!==s&&(e.divergences=1,e.details.push({patternId:"*",issue:"count-mismatch"})),e}isPromotionSafe(){return this.getDivergenceReport().divergences===0}status(){let e=this.getSqlitePatternCount(),t=this.getSqliteEmbeddingCount(),r=null;if(this.rvfAvailable&&this.rvfStore)try{r=this.rvfStore.status()}catch{r=null}return{sqlite:{patternCount:e,vectorCount:t},rvf:r,mode:this.config.mode}}close(){if(this.rvfStore){try{this.rvfStore.close()}catch{}this.rvfStore=null,this.rvfAvailable=!1}}compact(){if(!this.rvfStore||!this.rvfAvailable||!this.rvfStore.compact)return null;try{return this.rvfStore.compact()??null}catch{return null}}shouldWriteRvf(){return(this.config.mode==="dual-write"||this.config.mode==="rvf-primary")&&this.rvfAvailable&&this.rvfStore!==null}hasCompatibleEmbeddingSpace(){if(!m(this.db,"qe_pattern_embeddings","space_id"))return!1;let e=this.activeSpaceId();return e?(this.db.prepare(`
3
+ SELECT COUNT(*) AS incompatible
4
+ FROM qe_pattern_embeddings
5
+ WHERE space_id IS NULL OR space_id <> ?
6
+ `).get(e)?.incompatible??0)===0:!1}writeSqliteEmbedding(e,t){let r=Buffer.from(t instanceof Float32Array?t.buffer:new Float32Array(t).buffer),s=t.length;if(f(this.db,"qe_pattern_embeddings")){let l=this.activeSpaceId();if(m(this.db,"qe_pattern_embeddings","space_id")){if(!l)throw new Error("VECTOR_SPACE_UNVERIFIED: dual writer has no runtime provenance");this.db.prepare(`
7
+ INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, space_id, created_at)
8
+ VALUES (?, ?, ?, 'all-MiniLM-L6-v2', ?, datetime('now'))
9
+ ON CONFLICT(pattern_id) DO UPDATE SET
10
+ embedding = excluded.embedding,
11
+ dimension = excluded.dimension,
12
+ space_id = excluded.space_id,
13
+ created_at = datetime('now')
14
+ `).run(e,r,s,l);return}throw new Error("VECTOR_SPACE_UNVERIFIED: canonical space_id column is unavailable")}}deleteSqliteEmbedding(e){f(this.db,"qe_pattern_embeddings")&&this.db.prepare("DELETE FROM qe_pattern_embeddings WHERE pattern_id = ?").run(e)}getSqliteEmbeddingCount(){return f(this.db,"qe_pattern_embeddings")?this.db.prepare("SELECT COUNT(*) as cnt FROM qe_pattern_embeddings").get()?.cnt??0:0}getSqlitePatternCount(){return f(this.db,"qe_patterns")?this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get()?.cnt??0:0}searchSqlite(e,t){if(!f(this.db,"qe_pattern_embeddings"))return[];let r=this.activeSpaceId();if(!m(this.db,"qe_pattern_embeddings","space_id")||!r)return[];let l=this.db.prepare("SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings WHERE space_id = ?").all(r),n=e instanceof Float32Array?Array.from(e):e,a=Math.sqrt(n.reduce((c,u)=>c+u*u,0));if(a===0)return[];let o=[];for(let c of l){let u=new Float32Array(c.embedding.buffer,c.embedding.byteOffset,c.dimension),p=Array.from(u),b=0,v=0;for(let d=0;d<p.length&&d<n.length;d++)b+=p[d]*n[d],v+=p[d]*p[d];v=Math.sqrt(v);let E=v>0?b/(a*v):0;o.push({id:c.pattern_id,score:E})}return o.sort((c,u)=>u.score-c.score),o.slice(0,t)}};function A(i,e){return new h(i,e)}export{h as a,A as b};