agentic-qe 3.9.3 → 3.9.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.
- package/CHANGELOG.md +40 -0
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-HOBCL2VF.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-W6GGSB43.js → agent-booster-wasm-AW36VJXL.js} +2 -2
- package/dist/cli/chunks/{agent-handler-3IRN5WBS.js → agent-handler-AQFW2CMW.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-SO63CIPJ.js → agent-memory-branch-VA6A47U5.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-77FVV2ZJ.js +2 -0
- package/dist/cli/chunks/{audit-TONGHW5H.js → audit-WVJHTVUU.js} +2 -2
- package/dist/cli/chunks/base-2IXMPGJV.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-OK5DP5FC.js → better-sqlite3-HCMGVEDO.js} +2 -2
- package/dist/cli/chunks/{brain-handler-MC2S3UHL.js → brain-handler-JZISBH2W.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-PRKJKPAE.js → branch-enumerator-3TQXIETD.js} +2 -2
- package/dist/cli/chunks/{browser-WTMMBSU3.js → browser-4GZXU4YT.js} +2 -2
- package/dist/cli/chunks/browser-workflow-AQYKV2NE.js +2 -0
- package/dist/cli/chunks/{chunk-OJKGRB6D.js → chunk-2XJRSIM5.js} +2 -2
- package/dist/cli/chunks/{chunk-ITFNPXZL.js → chunk-35DP6LX6.js} +2 -2
- package/dist/cli/chunks/{chunk-D5AQDGTS.js → chunk-3DGO7NJK.js} +1 -1
- package/dist/cli/chunks/{chunk-AS5WPUDR.js → chunk-3KYKE7B6.js} +1 -1
- package/dist/cli/chunks/{chunk-UC3RA5LW.js → chunk-3QH67ZYC.js} +2 -2
- package/dist/cli/chunks/{chunk-SFFI3MDN.js → chunk-3UE5GART.js} +2 -2
- package/dist/cli/chunks/{chunk-WDTFG5AG.js → chunk-3UFAEGSS.js} +1 -1
- package/dist/cli/chunks/{chunk-JTIWAUWW.js → chunk-3VNEMHOO.js} +1 -1
- package/dist/cli/chunks/{chunk-SDHZLA45.js → chunk-45WEXMKC.js} +2 -2
- package/dist/cli/chunks/{chunk-5YUNMBIH.js → chunk-4EOSDCDM.js} +1 -1
- package/dist/cli/chunks/{chunk-KV32LAKU.js → chunk-4FPCCKNQ.js} +1 -1
- package/dist/cli/chunks/{chunk-TPFE3BAI.js → chunk-4QGNSNQL.js} +2 -2
- package/dist/cli/chunks/{chunk-TUHIFT65.js → chunk-53J3R7PZ.js} +2 -2
- package/dist/cli/chunks/{chunk-M3EFT3XR.js → chunk-55EAFHVH.js} +3 -3
- package/dist/cli/chunks/{chunk-F6O5XLIE.js → chunk-5NBYV7FL.js} +1 -1
- package/dist/cli/chunks/{chunk-QAXJOCTW.js → chunk-673PL3DG.js} +1 -1
- package/dist/cli/chunks/{chunk-T5MWENBA.js → chunk-6AMXWB6Y.js} +2 -2
- package/dist/cli/chunks/{chunk-JF6AXXAL.js → chunk-6FM5DJHR.js} +4 -4
- package/dist/cli/chunks/{chunk-CF4T4YSL.js → chunk-6QKGLIIY.js} +2 -2
- package/dist/cli/chunks/{chunk-7HTSXZ77.js → chunk-6QR7GSNJ.js} +2 -2
- package/dist/cli/chunks/{chunk-MNZ2HHKI.js → chunk-6VB4VZCR.js} +2 -2
- package/dist/cli/chunks/{chunk-OBOCKH47.js → chunk-73LG5ELL.js} +2 -2
- package/dist/cli/chunks/{chunk-6B4CTO5D.js → chunk-74YG34UH.js} +2 -2
- package/dist/cli/chunks/{chunk-VNSRA5PY.js → chunk-7JQOOPA2.js} +2 -2
- package/dist/cli/chunks/{chunk-GGKV5IQR.js → chunk-ALX5RJSR.js} +2 -2
- package/dist/cli/chunks/{chunk-T4GTFSB2.js → chunk-BM7VSJTE.js} +2 -2
- package/dist/cli/chunks/{chunk-P4RYVWIR.js → chunk-BNYHBEDE.js} +2 -2
- package/dist/cli/chunks/{chunk-ERWNQ6NC.js → chunk-BQUN2NB4.js} +3 -3
- package/dist/cli/chunks/{chunk-2IU6WK32.js → chunk-BYD54ZUF.js} +2 -2
- package/dist/cli/chunks/{chunk-LMN72H3V.js → chunk-CGYOMD6X.js} +1 -1
- package/dist/cli/chunks/{chunk-FR26EINS.js → chunk-CGYTM7AB.js} +2 -2
- package/dist/cli/chunks/{chunk-CU36MONI.js → chunk-CNGRXBKO.js} +2 -2
- package/dist/cli/chunks/{chunk-PKIBG7OJ.js → chunk-CQT3IEEX.js} +2 -2
- package/dist/cli/chunks/{chunk-TA454OEB.js → chunk-DFOANC7Z.js} +1 -1
- package/dist/cli/chunks/{chunk-JXE2DFXM.js → chunk-DPEX4UOC.js} +1 -1
- package/dist/cli/chunks/{chunk-FSUS5TV6.js → chunk-DSOEKRQL.js} +2 -2
- package/dist/cli/chunks/{chunk-BRCCPQXN.js → chunk-E55RROAP.js} +1 -1
- package/dist/cli/chunks/{chunk-3GMN3PNP.js → chunk-EPH2GZQM.js} +2 -2
- package/dist/cli/chunks/{chunk-OZNJZMQL.js → chunk-ERV3OVUG.js} +2 -2
- package/dist/cli/chunks/{chunk-LHDR6E6F.js → chunk-FDFJHGRZ.js} +2 -2
- package/dist/cli/chunks/{chunk-P6OZKWNK.js → chunk-G7XBTBM7.js} +2 -2
- package/dist/cli/chunks/{chunk-COIFERYS.js → chunk-GFXAKQ77.js} +2 -2
- package/dist/cli/chunks/{chunk-ZTIPMKUS.js → chunk-GFZRXQWH.js} +1 -1
- package/dist/cli/chunks/{chunk-7ASGPJWU.js → chunk-GHFXURNS.js} +1 -1
- package/dist/cli/chunks/{chunk-SJLDTV5B.js → chunk-GSTDQLXR.js} +2 -2
- package/dist/cli/chunks/{chunk-PS6KLLLQ.js → chunk-HA4COQ66.js} +2 -2
- package/dist/cli/chunks/{chunk-LQDAH47F.js → chunk-HT5EZYPZ.js} +2 -2
- package/dist/cli/chunks/{chunk-O2O5RO4H.js → chunk-I27OTSC7.js} +2 -2
- package/dist/cli/chunks/{chunk-RRELDHZY.js → chunk-I4HGIQC2.js} +2 -2
- package/dist/cli/chunks/{chunk-TSS6LXJ6.js → chunk-IHXDXFUX.js} +1 -1
- package/dist/cli/chunks/{chunk-JZXSKPQB.js → chunk-IMCYFQWF.js} +2 -2
- package/dist/cli/chunks/{chunk-HJEWQD2B.js → chunk-IMGRYCAT.js} +1 -1
- package/dist/cli/chunks/{chunk-GBLX5XOH.js → chunk-ITIYGUIL.js} +2 -2
- package/dist/cli/chunks/{chunk-TTEXJW2U.js → chunk-J4SEGMXL.js} +2 -2
- package/dist/cli/chunks/{chunk-WAWCNUIJ.js → chunk-JUBICWL2.js} +1 -1
- package/dist/cli/chunks/{chunk-PRIWFNVU.js → chunk-JYJXVTUP.js} +2 -2
- package/dist/cli/chunks/{chunk-53YFAERL.js → chunk-KCQ2GFRN.js} +2 -2
- package/dist/cli/chunks/{chunk-X5C73DW5.js → chunk-KQ7VBUO4.js} +2 -2
- package/dist/cli/chunks/{chunk-YTBE2MEW.js → chunk-KUDPFLL4.js} +4 -4
- package/dist/cli/chunks/{chunk-66RCUQCI.js → chunk-KWIDDPKG.js} +2 -2
- package/dist/cli/chunks/{chunk-5B2KXDWF.js → chunk-LLXBL36X.js} +1 -1
- package/dist/cli/chunks/{chunk-2CPNZVGL.js → chunk-LPVQ6QCW.js} +2 -2
- package/dist/cli/chunks/{chunk-5UMSMRJC.js → chunk-MBXSHGDD.js} +2 -2
- package/dist/cli/chunks/{chunk-DTNXHRUF.js → chunk-MO3IIM7L.js} +1 -1
- package/dist/cli/chunks/{chunk-IOW7QTYT.js → chunk-MRTDOSHR.js} +2 -2
- package/dist/cli/chunks/{chunk-OXR2FPHK.js → chunk-MYIDAWGQ.js} +2 -2
- package/dist/cli/chunks/{chunk-EXTVDKH7.js → chunk-N66G743A.js} +3 -3
- package/dist/cli/chunks/{chunk-PD5YPC2A.js → chunk-NDWWN2YC.js} +4 -4
- package/dist/cli/chunks/{chunk-JI5MNJSU.js → chunk-NGP3DRFU.js} +1 -1
- package/dist/cli/chunks/{chunk-3Q5FG6M3.js → chunk-NHIQ5HP3.js} +2 -2
- package/dist/cli/chunks/{chunk-Z4V3XV7E.js → chunk-NNNH36RU.js} +2 -2
- package/dist/cli/chunks/{chunk-UVWKIP3U.js → chunk-OPOTKH42.js} +3 -3
- package/dist/cli/chunks/{chunk-6N26CWST.js → chunk-OQCEI7Q4.js} +2 -2
- package/dist/cli/chunks/{chunk-MSKVWOND.js → chunk-OTOQXMP6.js} +3 -3
- package/dist/cli/chunks/{chunk-AWSYGQEB.js → chunk-PGFHFPDP.js} +2 -2
- package/dist/cli/chunks/{chunk-M7PGW5Z5.js → chunk-PMFZHFCB.js} +2 -2
- package/dist/cli/chunks/{chunk-D5GIV6O7.js → chunk-PTAUZ3XL.js} +1 -1
- package/dist/cli/chunks/{chunk-DGRO6LSI.js → chunk-PVLOT5BL.js} +2 -2
- package/dist/cli/chunks/{chunk-ZVMAE5JD.js → chunk-QHMDETCU.js} +1 -1
- package/dist/cli/chunks/{chunk-WIY3V5VQ.js → chunk-QPW2O5TR.js} +9 -9
- package/dist/cli/chunks/{chunk-K2DDNM4V.js → chunk-REXMKRR2.js} +8 -8
- package/dist/cli/chunks/{chunk-ZQCU62JJ.js → chunk-S4F3CNSP.js} +2 -2
- package/dist/cli/chunks/{chunk-FIQ62VOQ.js → chunk-T4KMG3GJ.js} +1 -1
- package/dist/cli/chunks/{chunk-EVIXQR4O.js → chunk-TRO45ZLC.js} +1 -1
- package/dist/cli/chunks/{chunk-DBSVEWWL.js → chunk-TRPCOY3C.js} +1 -1
- package/dist/cli/chunks/{chunk-XJII5WMD.js → chunk-TRRJP27A.js} +1 -1
- package/dist/cli/chunks/{chunk-WSVWVIVR.js → chunk-TSA5MUTQ.js} +2 -2
- package/dist/cli/chunks/{chunk-5OL6UOBM.js → chunk-TUMXWCB7.js} +3 -3
- package/dist/cli/chunks/{chunk-J7QGH6PG.js → chunk-UO2R7ZN3.js} +2 -2
- package/dist/cli/chunks/{chunk-OV6H3TRU.js → chunk-UPFCV7MX.js} +2 -2
- package/dist/cli/chunks/{chunk-HVOOYPW6.js → chunk-VKT4STAE.js} +2 -2
- package/dist/cli/chunks/{chunk-2GZ4EG3L.js → chunk-W73AYMDP.js} +1 -1
- package/dist/cli/chunks/{chunk-ZMUVSL5Q.js → chunk-WIZOYPFT.js} +2 -2
- package/dist/cli/chunks/{chunk-U6QQS5Z3.js → chunk-WTGUS7DD.js} +2 -2
- package/dist/cli/chunks/{chunk-LRE4A464.js → chunk-WV7K5A7J.js} +2 -2
- package/dist/cli/chunks/{chunk-QB2LOM5O.js → chunk-X6J7VYVD.js} +2 -2
- package/dist/cli/chunks/{chunk-S23UV7FV.js → chunk-XG2JAIQT.js} +1 -1
- package/dist/cli/chunks/{chunk-SVXIAQRW.js → chunk-Y6XYH7EV.js} +2 -2
- package/dist/cli/chunks/{chunk-DBEU5ISS.js → chunk-YDBMYTOV.js} +2 -2
- package/dist/cli/chunks/{chunk-GGEVILIS.js → chunk-YGZBS4RW.js} +2 -2
- package/dist/cli/chunks/{chunk-WLK5UVRJ.js → chunk-YHKJYBWK.js} +1 -1
- package/dist/cli/chunks/{chunk-DKOOKULB.js → chunk-YHSIUFFY.js} +2 -2
- package/dist/cli/chunks/{chunk-7JBIDAXT.js → chunk-YQTPEQO6.js} +2 -2
- package/dist/cli/chunks/{chunk-BK445WWE.js → chunk-YZ3WB4TN.js} +2 -2
- package/dist/cli/chunks/chunk-Z2GK7COI.js +2 -0
- package/dist/cli/chunks/{chunk-LDLLHLKE.js → chunk-ZD2FS4Q7.js} +2 -2
- package/dist/cli/chunks/{chunk-GGQCAQM4.js → chunk-ZFCRDCHW.js} +2 -2
- package/dist/cli/chunks/{chunk-ELU576GE.js → chunk-ZJWDWM6B.js} +3 -3
- package/dist/cli/chunks/{chunk-NZLJWXXM.js → chunk-ZP237D7K.js} +2 -2
- package/dist/cli/chunks/{chunk-T4RR4YMH.js → chunk-ZWS7J73Q.js} +1 -1
- package/dist/cli/chunks/{ci-XQEZTRJN.js → ci-3ATT6NMC.js} +2 -2
- package/dist/cli/chunks/{ci-output-ZWGXOIUD.js → ci-output-2JR3J753.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-PFJFHZSD.js → claude-flow-setup-SG2BSEED.js} +2 -2
- package/dist/cli/chunks/client-3CA57H5P.js +2 -0
- package/dist/cli/chunks/{cline-installer-L3WC4KUM.js → cline-installer-A26SXDX6.js} +2 -2
- package/dist/cli/chunks/{code-QMDXXY6C.js → code-WIXKPGAQ.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-YTPMAZPU.js → code-index-extractor-W2NO6MR3.js} +2 -2
- package/dist/cli/chunks/{codex-installer-KO5G7LHQ.js → codex-installer-VBSJHXI4.js} +2 -2
- package/dist/cli/chunks/{completions-KVDPIXMY.js → completions-JFXIUS2V.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-KNIBPEC3.js → complexity-analyzer-GPO4ZAIZ.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-N2GWI5PC.js → continuedev-installer-OULSFVLB.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-EX3UTDQN.js → copilot-installer-QS7EG5DW.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-XX6OMP37.js → cost-tracker-D7LNB633.js} +2 -2
- package/dist/cli/chunks/{coverage-FHDDNCPO.js → coverage-YUQ4MQYK.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-GECFIALH.js +2 -0
- package/dist/cli/chunks/{cursor-installer-M47YCQU7.js → cursor-installer-UOZGHZHD.js} +2 -2
- package/dist/cli/chunks/{daemon-EV3RXWAG.js → daemon-27TMWDPY.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-J7JDWG5J.js → dag-attention-scheduler-PVAFQBDL.js} +2 -2
- package/dist/cli/chunks/{detect-4P5RKV5J.js → detect-FUKMZ37Y.js} +2 -2
- package/dist/cli/chunks/{domain-handler-Q35TYDGA.js → domain-handler-SP3QB5VN.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-XC34MV5U.js → domain-transfer-A2WL6HEJ.js} +2 -2
- package/dist/cli/chunks/dream-CJ4MKM5G.js +2 -0
- package/dist/cli/chunks/esm-node-X7U3YS4M.js +2 -0
- package/dist/cli/chunks/{eval-QZGRW7XD.js → eval-6MIZUXEO.js} +2 -2
- package/dist/cli/chunks/{fast-paths-O42GG56B.js → fast-paths-XT542LOU.js} +2 -2
- package/dist/cli/chunks/{feature-flags-G6SJTDVO.js → feature-flags-NWACCWCB.js} +2 -2
- package/dist/cli/chunks/{feature-flags-GIGWUPEX.js → feature-flags-WBF5B6WE.js} +2 -2
- package/dist/cli/chunks/{file-discovery-D4NXB3JP.js → file-discovery-GKCJFWTD.js} +2 -2
- package/dist/cli/chunks/{fleet-ZXZ5AAPW.js → fleet-V2MKGNMG.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-YK6NAPJV.js → gnn-wrapper-HUUMTTSV.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-DD4T6U36.js → heartbeat-handler-UY3TCEN7.js} +4 -4
- package/dist/cli/chunks/{heartbeat-scheduler-CBPO5KUB.js → heartbeat-scheduler-YWXPSCH2.js} +2 -2
- package/dist/cli/chunks/hnsw-adapter-LJGOH772.js +2 -0
- package/dist/cli/chunks/hnsw-index-V6SST2MB.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-REKPPJ75.js → hnsw-legacy-bridge-IYYYSRK5.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-PMWK24KT.js → hnswlib-node-WDWAE74R.js} +2 -2
- package/dist/cli/chunks/{hooks-UDKFTCJ7.js → hooks-DTBJK6LL.js} +6 -6
- package/dist/cli/chunks/{hypergraph-engine-FIAZJD7K.js → hypergraph-engine-K47IBQNO.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-NN2EBNBW.js → hypergraph-handler-2NDPG2N4.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-MTOVFD3O.js +2 -0
- package/dist/cli/chunks/init-handler-VRZS6KO2.js +68 -0
- package/dist/cli/chunks/init-wizard-IH6PSRJY.js +2 -0
- package/dist/cli/chunks/kernel-3MC7WV5G.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-6XPW7IAO.js → kilocode-installer-XZAHWQEA.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-DOHZGTBZ.js → kiro-installer-53C7DXEF.js} +15 -15
- package/dist/cli/chunks/knowledge-graph-HLUQJ2GI.js +2 -0
- package/dist/cli/chunks/{learning-GRSMZRPZ.js → learning-XYW2EEVX.js} +3 -3
- package/dist/cli/chunks/{llm-router-MTZPLM7A.js → llm-router-64SKMJ7B.js} +2 -2
- package/dist/cli/chunks/{load-CQXXMUR7.js → load-HVL4O7EY.js} +2 -2
- package/dist/cli/chunks/load-test-VVVME7GZ.js +2 -0
- package/dist/cli/chunks/{mcp-IIPV4IWF.js → mcp-4H2NJ3EO.js} +2 -2
- package/dist/cli/chunks/{memory-GIODHUAL.js → memory-2CD4BAJK.js} +5 -5
- package/dist/cli/chunks/memory-backend-O3U2QDU3.js +2 -0
- package/dist/cli/chunks/{memory-handlers-O6UVJSAG.js → memory-handlers-XRYZBE5I.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-DDIIEIKL.js → opencode-installer-I23QAZC6.js} +2 -2
- package/dist/cli/chunks/{orchestrator-PAQTJDA3.js → orchestrator-7BL6R54P.js} +16 -16
- package/dist/cli/chunks/{pipeline-6HFLH75G.js → pipeline-7UN7LP6B.js} +2 -2
- package/dist/cli/chunks/{platform-UKK776G2.js → platform-P44YUHPK.js} +2 -2
- package/dist/cli/chunks/{plugin-ERW5YBXU.js → plugin-YWYR7FKS.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-WB5A4ULB.js → prime-radiant-advanced-wasm-A7CDGUK6.js} +2 -2
- package/dist/cli/chunks/protocol-executor-HLNTSRYC.js +2 -0
- package/dist/cli/chunks/{protocol-handler-AKDFZI6G.js → protocol-handler-BM7RLC4Z.js} +2 -2
- package/dist/cli/chunks/{prove-GT5XEWVF.js → prove-UVBYODRV.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-JK5CK4D4.js +2 -0
- package/dist/cli/chunks/{quality-VZAG6B54.js → quality-4L42LN5Q.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-FLF6XYLX.js +2 -0
- package/dist/cli/chunks/{real-embeddings-KOOT5MTA.js → real-embeddings-4CYZTWHT.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-KHGDU6QK.js → roocode-installer-UOSJS7KT.js} +2 -2
- package/dist/cli/chunks/router-DUFZW3WQ.js +2 -0
- package/dist/cli/chunks/routing-feedback-6U76TI6X.js +2 -0
- package/dist/cli/chunks/{routing-handler-HVCNYSJM.js → routing-handler-43G4D5UP.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-D46MOJ32.js → ruvector-commands-H7A7LG6Q.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-WASNBBMN.js → rvf-dual-writer-USU2IWO7.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-ESLGEE5X.js → rvf-migration-adapter-DZMYVJJY.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-S5NAMHTP.js → rvf-migration-coordinator-AZ5JDT33.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-4UD7SUMB.js +2 -0
- package/dist/cli/chunks/safe-db-32Q5RXHR.js +2 -0
- package/dist/cli/chunks/schedule-ZHCM3L6H.js +2 -0
- package/dist/cli/chunks/scheduler-HBSSLDOD.js +2 -0
- package/dist/cli/chunks/{security-4AHBDCJJ.js → security-RXG4H3UK.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-PLZVKKW7.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-ZFNW4C3N.js → shared-rvf-dual-writer-2PUFIGX5.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-YUZMB44Y.js +2 -0
- package/dist/cli/chunks/{status-handler-ZVC4HX5J.js → status-handler-SXQKG6VP.js} +2 -2
- package/dist/cli/chunks/{structural-health-DPFQ4GEF.js → structural-health-LPXOOMG3.js} +2 -2
- package/dist/cli/chunks/{sync-7A5JMQNB.js → sync-5NX7GQQY.js} +10 -10
- package/dist/cli/chunks/{task-handler-OFZ5YMXH.js → task-handler-Y4KVNCOI.js} +2 -2
- package/dist/cli/chunks/{task-handlers-IRSHSFQW.js → task-handlers-CG27Z3CP.js} +2 -2
- package/dist/cli/chunks/{test-F6XPB2DN.js → test-PWVTWOWS.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-CPHQ7DBP.js → test-scheduling-5S5EBVE7.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-5YD6K4LL.js → token-bootstrap-QMPUKGQC.js} +2 -2
- package/dist/cli/chunks/{token-usage-KQYGQAEK.js → token-usage-OZNRTJLE.js} +2 -2
- package/dist/cli/chunks/{transformers-P7TT2MJB.js → transformers-DRPOBWCW.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-SUSDXGOP.js → tree-sitter-wasm-parser-VLX6HQW2.js} +2 -2
- package/dist/cli/chunks/{types-OEGMO7AH.js → types-TUF6HUPE.js} +2 -2
- package/dist/cli/chunks/unified-memory-3D4VDY4G.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-AAQ5IA6M.js +2 -0
- package/dist/cli/chunks/unified-persistence-PY7MVJTL.js +2 -0
- package/dist/cli/chunks/{validate-XI4GTLQR.js → validate-H7QFV2CI.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-UZQR6AWZ.js → validate-swarm-BGH6YM4S.js} +2 -2
- package/dist/cli/chunks/{vibium-VPJH2KD5.js → vibium-DQOGR2PH.js} +2 -2
- package/dist/cli/chunks/visual-security-ZBNB7LEG.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-LUNFY67E.js → web-tree-sitter-TOI4XJIL.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-LTJCP7AT.js → windsurf-installer-EUMBFA42.js} +2 -2
- package/dist/cli/chunks/witness-chain-CS76OJFL.js +2 -0
- package/dist/cli/chunks/{witness-chain-YWBIN5MQ.js → witness-chain-MWPUR4Q2.js} +2 -2
- package/dist/cli/chunks/{workflow-UGXLNO36.js → workflow-V5HI3AQR.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-FS4HGYI7.js +2 -0
- package/dist/cli/chunks/{wrappers-LUJRP2YI.js → wrappers-VOU4IVAQ.js} +2 -2
- package/dist/cli/commands/init.js +2 -0
- package/dist/cli/commands/sync.js +25 -8
- package/dist/cli/handlers/init-handler.d.ts +1 -0
- package/dist/cli/handlers/init-handler.js +2 -0
- package/dist/init/governance-installer.js +46 -14
- package/dist/init/kiro-installer.js +15 -2
- package/dist/init/orchestrator.js +1 -0
- package/dist/init/phases/06-code-intelligence.d.ts +13 -0
- package/dist/init/phases/06-code-intelligence.js +46 -7
- package/dist/init/phases/phase-interface.d.ts +9 -0
- package/dist/integrations/ruvector/feature-flags.js +1 -1
- package/dist/mcp/bundle.js +2 -2
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-WKI55MLS.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-QQHHH3ZL.js +0 -2
- package/dist/cli/chunks/base-3ENVJTIL.js +0 -2
- package/dist/cli/chunks/browser-workflow-QVT343YP.js +0 -2
- package/dist/cli/chunks/chunk-FONTSK2O.js +0 -2
- package/dist/cli/chunks/client-VUKA3X4R.js +0 -2
- package/dist/cli/chunks/cross-domain-router-5SUV5AP6.js +0 -2
- package/dist/cli/chunks/dream-2UNEPNI2.js +0 -2
- package/dist/cli/chunks/esm-node-TPR2KU6L.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-BLMGBVDE.js +0 -2
- package/dist/cli/chunks/hnsw-index-UWMXU7RN.js +0 -2
- package/dist/cli/chunks/impact-analyzer-RK2VPRRL.js +0 -2
- package/dist/cli/chunks/init-handler-RK256F2M.js +0 -68
- package/dist/cli/chunks/init-wizard-HA2VADPV.js +0 -2
- package/dist/cli/chunks/kernel-QMZBPOWP.js +0 -2
- package/dist/cli/chunks/knowledge-graph-INYQCVMS.js +0 -2
- package/dist/cli/chunks/load-test-YSEU2TUL.js +0 -2
- package/dist/cli/chunks/memory-backend-MNSPY44E.js +0 -2
- package/dist/cli/chunks/protocol-executor-CBKER6RL.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-C3J4RA2M.js +0 -2
- package/dist/cli/chunks/queen-coordinator-ZXTNAEYV.js +0 -2
- package/dist/cli/chunks/router-YMQF6M2D.js +0 -2
- package/dist/cli/chunks/routing-feedback-MM7LNDS7.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-3EEWPK4C.js +0 -2
- package/dist/cli/chunks/safe-db-5P6ABYNG.js +0 -2
- package/dist/cli/chunks/schedule-ZGESH3FK.js +0 -2
- package/dist/cli/chunks/scheduler-AC4AA2BD.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-UQQUEC52.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-KXDW2Q66.js +0 -2
- package/dist/cli/chunks/unified-memory-MNW25PVU.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-4RZRP37O.js +0 -2
- package/dist/cli/chunks/unified-persistence-6UBNXF25.js +0 -2
- package/dist/cli/chunks/visual-security-7742DBSK.js +0 -2
- package/dist/cli/chunks/witness-chain-QVPNOHDC.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-K3Q2GOEG.js +0 -2
|
@@ -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.9.
|
|
2
|
-
import{a as c}from"./chunk-WLK5UVRJ.js";function e(i){return{...i,performanceScore:.7,tasksCompleted:0,successRate:0,avgDurationMs:0}}var u=[e({id:"v3-qe-tdd-specialist",name:"V3 QE TDD Specialist",description:"V3 QE TDD specialist covering RED, GREEN, REFACTOR phases with comprehensive test-driven development support",domains:["test-generation"],capabilities:["test-generation","tdd","unit-test","test-quality"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"simple",max:"complex"},tags:["v3","tdd","red-green-refactor"]}),e({id:"v3-qe-test-architect",name:"V3 QE Test Architect",description:"V3 QE Test Architect for AI-powered test generation strategy, test pyramid design, and cross-framework test orchestration",domains:["test-generation"],capabilities:["test-generation","test-orchestration","unit-test","integration-test","e2e-test"],languages:["typescript","javascript","python","java","go"],frameworks:["jest","vitest","pytest","junit5","playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","architect","strategy"]}),e({id:"v3-qe-parallel-executor",name:"V3 QE Parallel Executor",description:"V3 QE Parallel test executor with intelligent sharding, worker pool management, retry logic, and real-time reporting",domains:["test-execution"],capabilities:["test-orchestration","retry","flaky-detection"],languages:["typescript","javascript","python","java","go"],frameworks:["jest","vitest","pytest","junit5","go-test","playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","parallel","retry","sharding"]}),e({id:"v3-qe-flaky-hunter",name:"V3 QE Flaky Hunter",description:"V3 QE Flaky test detection and stabilization through pattern recognition, auto-remediation, and retry orchestration",domains:["test-execution"],capabilities:["flaky-detection","test-stability","retry"],frameworks:["jest","vitest","pytest","playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","flaky","stability","remediation"]}),e({id:"v3-qe-retry-handler",name:"V3 QE Retry Handler",description:"V3 QE Intelligent retry handler with adaptive backoff, circuit breakers, and failure classification",domains:["test-execution"],capabilities:["retry","test-stability"],frameworks:["jest","vitest","pytest","playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","retry","adaptive-backoff"]}),e({id:"v3-qe-coverage-specialist",name:"V3 QE Coverage Specialist",description:"V3 QE Coverage Specialist for O(log n) sublinear coverage analysis, risk-weighted gap detection, and intelligent test prioritization",domains:["coverage-analysis"],capabilities:["coverage-analysis","gap-detection","sublinear-analysis","risk-scoring","branch-coverage"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","sublinear","prioritization"]}),e({id:"v3-qe-gap-detector",name:"V3 QE Gap Detector",description:"V3 QE Coverage gap detection with sublinear algorithms (O(log n) analysis), risk scoring, and intelligent test recommendations",domains:["coverage-analysis"],capabilities:["coverage-analysis","gap-detection","sublinear-analysis","risk-scoring"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","sublinear","gap-detection"]}),e({id:"v3-qe-quality-gate",name:"V3 QE Quality Gate",description:"V3 QE Quality gate enforcement with risk assessment, policy validation, and deployment readiness evaluation",domains:["quality-assessment"],capabilities:["quality-gate","deployment-readiness","risk-scoring"],complexity:{min:"medium",max:"complex"},tags:["v3","gate","deployment","policy"]}),e({id:"v3-qe-deployment-advisor",name:"V3 QE Deployment Advisor",description:"V3 QE Aggregates quality signals for deployment risk assessment and go/no-go decisions with predictive analytics",domains:["quality-assessment"],capabilities:["deployment-readiness","quality-gate","risk-scoring"],complexity:{min:"medium",max:"complex"},tags:["v3","deployment","go-no-go","analytics"]}),e({id:"v3-qe-code-complexity",name:"V3 QE Code Complexity",description:"V3 QE AI-powered code complexity analysis with refactoring recommendations and technical debt tracking",domains:["quality-assessment"],capabilities:["quality-gate","risk-scoring"],languages:["typescript","javascript","python","java","go"],complexity:{min:"simple",max:"complex"},tags:["v3","complexity","refactoring","debt"]}),e({id:"v3-qe-qx-partner",name:"V3 QE QX Partner",description:"V3 QE Quality Experience (QX) analysis combining QA advocacy and UX perspectives to co-create quality for all stakeholders",domains:["quality-assessment"],capabilities:["quality-gate"],complexity:{min:"medium",max:"complex"},tags:["v3","qx","ux","advocacy"]}),e({id:"v3-qe-security-scanner",name:"V3 QE Security Scanner",description:"V3 QE Security scanning with SAST/DAST, vulnerability detection, OWASP compliance, and threat modeling",domains:["security-compliance"],capabilities:["sast","dast","vulnerability","owasp","security-scanning"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","sast","dast","owasp"]}),e({id:"v3-qe-security-auditor",name:"V3 QE Security Auditor",description:"V3 QE Security audits for vulnerabilities, compliance validation, and security best practices enforcement",domains:["security-compliance"],capabilities:["sast","vulnerability","owasp","security-scanning"],languages:["typescript","javascript","python","java"],complexity:{min:"medium",max:"complex"},tags:["v3","audit","compliance"]}),e({id:"v3-qe-contract-validator",name:"V3 QE Contract Validator",description:"V3 QE API contract validation, breaking change detection, and backward compatibility with consumer-driven contract testing",domains:["contract-testing"],capabilities:["api-testing","contract-testing","pact","openapi"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","contract","api","pact"]}),e({id:"v3-qe-integration-tester",name:"V3 QE Integration Tester",description:"V3 QE Validates component interactions and system integration with comprehensive test scenarios",domains:["contract-testing"],capabilities:["integration-test","api-testing","contract-testing"],languages:["typescript","javascript","python","java"],frameworks:["jest","vitest","pytest","junit5"],complexity:{min:"medium",max:"complex"},tags:["v3","integration","component"]}),e({id:"v3-qe-graphql-tester",name:"V3 QE GraphQL Tester",description:"V3 QE GraphQL API testing with schema validation, query/mutation testing, and security analysis",domains:["contract-testing"],capabilities:["api-testing","contract-testing","graphql"],languages:["typescript","javascript","python"],complexity:{min:"medium",max:"complex"},tags:["v3","graphql","api"]}),e({id:"v3-qe-visual-tester",name:"V3 QE Visual Tester",description:"V3 QE Visual regression testing with AI-powered screenshot comparison and accessibility validation",domains:["visual-accessibility"],capabilities:["visual-regression","screenshot","percy","chromatic","wcag","aria"],frameworks:["playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","visual","regression","screenshots"]}),e({id:"v3-qe-accessibility-auditor",name:"V3 QE Accessibility Auditor",description:"V3 QE Accessibility testing with WCAG 2.2 compliance, screen reader validation, and copy-paste ready fixes",domains:["visual-accessibility"],capabilities:["wcag","aria","screen-reader","contrast"],frameworks:["playwright","cypress"],complexity:{min:"simple",max:"complex"},tags:["v3","wcag","a11y","accessibility"]}),e({id:"v3-qe-responsive-tester",name:"V3 QE Responsive Tester",description:"V3 QE Responsive design testing across viewports, devices, and breakpoints with layout regression detection",domains:["visual-accessibility"],capabilities:["visual-regression"],frameworks:["playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","responsive","viewport","breakpoints"]}),e({id:"v3-qe-performance-tester",name:"V3 QE Performance Tester",description:"V3 QE Performance testing with load orchestration, bottleneck detection, and SLA validation",domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery","benchmark"],complexity:{min:"medium",max:"complex"},tags:["v3","load","stress","performance"]}),e({id:"v3-qe-load-tester",name:"V3 QE Load Tester",description:"V3 QE Load and stress testing with execution time analysis, rate limit testing, and bottleneck detection",domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery"],complexity:{min:"medium",max:"complex"},tags:["v3","load","stress","k6"]}),e({id:"v3-qe-chaos-engineer",name:"V3 QE Chaos Engineer",description:"V3 QE Resilience testing with controlled fault injection, blast radius management, and recovery validation",domains:["chaos-resilience"],capabilities:["chaos-testing","resilience","fault-injection"],complexity:{min:"complex",max:"complex"},tags:["v3","chaos","fault-injection","resilience"]}),e({id:"v3-qe-code-intelligence",name:"V3 QE Code Intelligence",description:"V3 QE Knowledge graph-based code understanding with semantic search and AST analysis",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","knowledge-graph","ast","semantic"]}),e({id:"v3-qe-dependency-mapper",name:"V3 QE Dependency Mapper",description:"V3 QE Dependency graph analysis with coupling metrics and security advisories",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection"],languages:["typescript","javascript","python","java"],complexity:{min:"medium",max:"complex"},tags:["v3","dependency","graph"]}),e({id:"v3-qe-kg-builder",name:"V3 QE Knowledge Graph Builder",description:"V3 QE Knowledge graph construction with entity extraction and relationship inference",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection"],languages:["typescript","javascript","python"],complexity:{min:"complex",max:"complex"},tags:["v3","knowledge-graph","entity-extraction"]}),e({id:"v3-qe-integration-architect",name:"V3 QE Integration Architect",description:"V3 QE deep agentic-flow integration specialist implementing ADR-001 for duplicate elimination and extension architecture",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection","quality-gate"],languages:["typescript","javascript"],complexity:{min:"complex",max:"complex"},tags:["v3","integration","adr-001","architecture"]}),e({id:"v3-qe-requirements-validator",name:"V3 QE Requirements Validator",description:"V3 QE Validates requirements testability and generates BDD scenarios with testability scoring",domains:["requirements-validation"],capabilities:["bdd","test-generation"],complexity:{min:"medium",max:"complex"},tags:["v3","requirements","bdd","testability"]}),e({id:"v3-qe-bdd-generator",name:"V3 QE BDD Generator",description:"V3 QE BDD scenario generation with Gherkin syntax, example discovery, and step definition mapping",domains:["requirements-validation"],capabilities:["bdd","test-generation"],complexity:{min:"medium",max:"complex"},tags:["v3","bdd","gherkin","cucumber"]}),e({id:"v3-qe-product-factors-assessor",name:"V3 QE Product Factors Assessor",description:"V3 QE SFDIPOT product factors analysis using James Bach's HTSM framework for comprehensive test strategy generation with prioritized test ideas (P0-P3) and automation fitness recommendations",domains:["requirements-validation"],capabilities:["bdd","test-generation","risk-scoring"],complexity:{min:"medium",max:"complex"},tags:["v3","sfdipot","htsm","product-factors","james-bach"]}),e({id:"v3-qe-test-idea-rewriter",name:"V3 QE Test Idea Rewriter",description:'V3 QE Transform passive "Verify X" test descriptions into active, observable test actions using action verbs for clearer, more testable descriptions',domains:["test-generation"],capabilities:["test-generation","test-quality"],complexity:{min:"simple",max:"medium"},tags:["v3","test-ideas","rewriting","action-verbs","quality"]}),e({id:"v3-qe-quality-criteria-recommender",name:"V3 QE Quality Criteria Recommender",description:"V3 QE HTSM v6.3 Quality Criteria analysis for shift-left quality engineering during PI/Sprint Planning with evidence-based recommendations",domains:["requirements-validation"],capabilities:["bdd","test-generation","quality-gate"],complexity:{min:"medium",max:"complex"},tags:["v3","htsm","quality-criteria","shift-left","qcsd"]}),e({id:"v3-qe-defect-predictor",name:"V3 QE Defect Predictor",description:"V3 QE AI-powered defect prediction using historical data and code metrics",domains:["defect-intelligence"],capabilities:["risk-scoring","coverage-analysis"],languages:["typescript","javascript","python","java"],complexity:{min:"complex",max:"complex"},tags:["v3","defect","prediction","ml"]}),e({id:"v3-qe-root-cause-analyzer",name:"V3 QE Root Cause Analyzer",description:"V3 QE Systematic root cause analysis for test failures with prevention recommendations",domains:["defect-intelligence"],capabilities:["risk-scoring"],complexity:{min:"complex",max:"complex"},tags:["v3","root-cause","failure-analysis"]}),e({id:"v3-qe-regression-analyzer",name:"V3 QE Regression Analyzer",description:"V3 QE Analyzes code changes to predict regression risk and intelligently select minimal test suites",domains:["defect-intelligence"],capabilities:["risk-scoring","coverage-analysis"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","regression","risk","selection"]}),e({id:"v3-qe-impact-analyzer",name:"V3 QE Impact Analyzer",description:"V3 QE Change impact analysis with blast radius calculation and test selection",domains:["defect-intelligence"],capabilities:["risk-scoring","coverage-analysis"],languages:["typescript","javascript","python","java"],complexity:{min:"medium",max:"complex"},tags:["v3","impact","blast-radius"]}),e({id:"v3-qe-risk-assessor",name:"V3 QE Risk Assessor",description:"V3 QE Quality risk assessment with multi-factor scoring and mitigation recommendations",domains:["defect-intelligence"],capabilities:["risk-scoring"],complexity:{min:"medium",max:"complex"},tags:["v3","risk","assessment"]}),e({id:"v3-qe-learning-coordinator",name:"V3 QE Learning Coordinator",description:"V3 QE Fleet-wide learning coordination with pattern recognition and knowledge synthesis",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","learning","coordination","patterns"]}),e({id:"v3-qe-pattern-learner",name:"V3 QE Pattern Learner",description:"V3 QE Pattern discovery and learning from QE activities for test generation and defect prediction",domains:["learning-optimization"],capabilities:["test-generation","risk-scoring"],complexity:{min:"complex",max:"complex"},tags:["v3","pattern","learning","ml"]}),e({id:"v3-qe-transfer-specialist",name:"V3 QE Transfer Specialist",description:"V3 QE Knowledge transfer learning with domain adaptation and knowledge distillation",domains:["learning-optimization"],capabilities:["test-generation"],complexity:{min:"complex",max:"complex"},tags:["v3","transfer","learning","adaptation"]}),e({id:"v3-qe-metrics-optimizer",name:"V3 QE Metrics Optimizer",description:"V3 QE Learning metrics optimization with hyperparameter tuning and A/B testing",domains:["learning-optimization"],capabilities:["quality-gate"],complexity:{min:"complex",max:"complex"},tags:["v3","metrics","optimization","tuning"]}),e({id:"v3-qe-fleet-commander",name:"V3 QE Fleet Commander",description:"V3 QE Hierarchical fleet coordinator for 50+ agent orchestration with dynamic topology management and resource optimization",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","fleet","orchestration","coordination"]}),e({id:"v3-qe-queen-coordinator",name:"V3 QE Queen Coordinator",description:"V3 QE Queen Coordinator for multi-agent concurrent swarm orchestration, quality engineering workflows, and cross-agent coordination",domains:["learning-optimization"],capabilities:["test-orchestration","quality-gate"],complexity:{min:"complex",max:"complex"},tags:["v3","queen","swarm"]}),e({id:"v3-qe-property-tester",name:"V3 QE Property Tester",description:"V3 QE Property-based testing with fast-check for edge case discovery through randomized input generation",domains:["test-generation"],capabilities:["test-generation","unit-test"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","mocha"],complexity:{min:"medium",max:"complex"},tags:["v3","property","pbt","edge-cases"]}),e({id:"v3-qe-mutation-tester",name:"V3 QE Mutation Tester",description:"V3 QE Mutation testing for test suite effectiveness evaluation with mutation score analysis",domains:["test-generation"],capabilities:["test-quality","coverage-analysis"],languages:["typescript","javascript","python"],frameworks:["jest","vitest"],complexity:{min:"medium",max:"complex"},tags:["v3","mutation","test-quality"]})],y=[e({id:"v3-qe-tdd-red",name:"V3 QE TDD RED Phase",description:"V3 QE TDD RED phase specialist - writes failing tests that define expected behavior before implementation",domains:["test-generation"],capabilities:["test-generation","tdd","unit-test"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"simple",max:"medium"},tags:["v3","tdd","red-phase","subagent"]}),e({id:"v3-qe-tdd-green",name:"V3 QE TDD GREEN Phase",description:"V3 QE TDD GREEN phase specialist - implements minimal code to make failing tests pass",domains:["test-generation"],capabilities:["test-generation","tdd","unit-test"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"simple",max:"medium"},tags:["v3","tdd","green-phase","subagent"]}),e({id:"v3-qe-tdd-refactor",name:"V3 QE TDD REFACTOR Phase",description:"V3 QE TDD REFACTOR phase specialist - improves code quality while keeping all tests passing",domains:["test-generation"],capabilities:["test-generation","tdd","test-quality"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"medium",max:"complex"},tags:["v3","tdd","refactor-phase","subagent"]}),e({id:"v3-qe-code-reviewer",name:"V3 QE Code Reviewer",description:"V3 QE Code review specialist enforcing quality standards, linting, complexity, and security",domains:["quality-assessment"],capabilities:["quality-gate","security-scanning"],languages:["typescript","javascript","python","java","go"],complexity:{min:"simple",max:"complex"},tags:["v3","code-review","standards","subagent"]}),e({id:"v3-qe-integration-reviewer",name:"V3 QE Integration Reviewer",description:"V3 QE Integration review specialist for API compatibility and cross-service interactions",domains:["contract-testing"],capabilities:["integration-test","api-testing"],languages:["typescript","javascript","python","java"],complexity:{min:"medium",max:"complex"},tags:["v3","integration","review","subagent"]}),e({id:"v3-qe-performance-reviewer",name:"V3 QE Performance Reviewer",description:"V3 QE Performance review specialist for algorithmic complexity and resource usage",domains:["chaos-resilience"],capabilities:["load-testing","benchmark"],languages:["typescript","javascript","python","go"],complexity:{min:"medium",max:"complex"},tags:["v3","performance","review","subagent"]}),e({id:"v3-qe-security-reviewer",name:"V3 QE Security Reviewer",description:"V3 QE Security review specialist for vulnerability detection and secure coding practices",domains:["security-compliance"],capabilities:["sast","vulnerability","security-scanning"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","security","review","subagent"]})],v=[e({id:"n8n-base-agent",name:"n8n Base Agent",description:"Abstract base agent for n8n workflow automation testing - provides common utilities for all n8n testing agents",domains:["test-generation"],capabilities:["test-generation","test-orchestration"],complexity:{min:"simple",max:"simple"},tags:["n8n","base","workflow"]}),e({id:"n8n-workflow-executor",name:"n8n Workflow Executor",description:"Execute and validate n8n workflows programmatically with test data injection, output assertions, and data flow validation",domains:["test-execution"],capabilities:["test-orchestration","integration-test"],complexity:{min:"medium",max:"complex"},tags:["n8n","execution","validation"]}),e({id:"n8n-unit-tester",name:"n8n Unit Tester",description:"Unit test custom n8n node functions with Jest/Vitest integration, function isolation, mock data injection, and coverage reporting",domains:["test-generation"],capabilities:["unit-test","test-generation"],frameworks:["jest","vitest"],complexity:{min:"simple",max:"medium"},tags:["n8n","unit","isolation"]}),e({id:"n8n-integration-test",name:"n8n Integration Tester",description:"Test n8n node integrations with external services including API contract validation, authentication flows, rate limiting, and error handling",domains:["contract-testing"],capabilities:["integration-test","api-testing","contract-testing"],complexity:{min:"medium",max:"complex"},tags:["n8n","integration","api"]}),e({id:"n8n-trigger-test",name:"n8n Trigger Tester",description:"Test n8n workflow triggers including webhooks, schedules, polling triggers, and event-driven activation",domains:["test-execution"],capabilities:["integration-test","test-generation"],complexity:{min:"medium",max:"complex"},tags:["n8n","triggers","webhooks"]}),e({id:"n8n-node-validator",name:"n8n Node Validator",description:"Validate n8n node configurations, connections, data mappings, and conditional routing logic",domains:["contract-testing"],capabilities:["contract-testing","test-generation"],complexity:{min:"simple",max:"medium"},tags:["n8n","validation","nodes"]}),e({id:"n8n-performance-tester",name:"n8n Performance Tester",description:"Load and stress testing for n8n workflows using k6/Artillery with execution time analysis, rate limit testing, and bottleneck detection",domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery","benchmark"],complexity:{min:"medium",max:"complex"},tags:["n8n","performance","load"]}),e({id:"n8n-security-auditor",name:"n8n Security Auditor",description:"Security vulnerability scanning for n8n workflows including credential exposure, injection risks, OWASP compliance, and secret detection",domains:["security-compliance"],capabilities:["sast","vulnerability","owasp","security-scanning"],complexity:{min:"medium",max:"complex"},tags:["n8n","security","owasp"]}),e({id:"n8n-compliance-validator",name:"n8n Compliance Validator",description:"Regulatory compliance testing for n8n workflows including GDPR, CCPA, HIPAA, SOC2, and PCI-DSS validation",domains:["security-compliance"],capabilities:["security-scanning"],complexity:{min:"medium",max:"complex"},tags:["n8n","compliance","gdpr"]}),e({id:"n8n-bdd-scenario-tester",name:"n8n BDD Scenario Tester",description:"BDD/Gherkin scenario testing for n8n workflows with Cucumber integration, business requirement mapping, and stakeholder-friendly reports",domains:["requirements-validation"],capabilities:["bdd","test-generation"],complexity:{min:"medium",max:"complex"},tags:["n8n","bdd","gherkin"]}),e({id:"n8n-expression-validator",name:"n8n Expression Validator",description:"Validate n8n expressions and data transformations with syntax checking, context-aware testing, and security analysis",domains:["code-intelligence"],capabilities:["test-generation","security-scanning"],complexity:{min:"simple",max:"medium"},tags:["n8n","expressions","validation"]}),e({id:"n8n-version-comparator",name:"n8n Version Comparator",description:"Workflow version diff and regression detection with JSON comparison, change impact analysis, migration validation, and rollback testing",domains:["defect-intelligence"],capabilities:["risk-scoring","test-generation"],complexity:{min:"medium",max:"complex"},tags:["n8n","version","diff"]}),e({id:"n8n-chaos-tester",name:"n8n Chaos Tester",description:"Chaos engineering for n8n workflows with controlled fault injection, service failure simulation, recovery validation, and resilience testing",domains:["chaos-resilience"],capabilities:["chaos-testing","resilience","fault-injection"],complexity:{min:"complex",max:"complex"},tags:["n8n","chaos","resilience"]}),e({id:"n8n-ci-orchestrator",name:"n8n CI Orchestrator",description:"CI/CD pipeline integration for n8n workflows with REST API triggers, automated regression testing, GitHub Actions/Jenkins integration, and test scheduling",domains:["test-execution"],capabilities:["test-orchestration","integration-test"],complexity:{min:"medium",max:"complex"},tags:["n8n","ci","cd"]}),e({id:"n8n-monitoring-validator",name:"n8n Monitoring Validator",description:"Validate monitoring and alerting configurations for n8n workflows including error tracking, alert rules, SLA compliance, and observability checks",domains:["quality-assessment"],capabilities:["quality-gate","deployment-readiness"],complexity:{min:"medium",max:"complex"},tags:["n8n","monitoring","alerting"]})],x=[e({id:"tester",name:"Tester",description:"Comprehensive testing and quality assurance specialist with AI-powered test generation",domains:["test-generation","test-execution"],capabilities:["test-generation","unit-test","integration-test","e2e-test"],languages:["typescript","javascript","python","java","go","rust"],frameworks:["jest","vitest","mocha","pytest","junit5","go-test","rust-test","playwright","cypress"],complexity:{min:"simple",max:"complex"},tags:["general","versatile"]}),e({id:"reviewer",name:"Reviewer",description:"Code review and quality assurance specialist with AI-powered pattern detection",domains:["quality-assessment"],capabilities:["quality-gate","security-scanning"],languages:["typescript","javascript","python","java","go","rust"],complexity:{min:"simple",max:"complex"},tags:["general","code-review"]}),e({id:"security-auditor",name:"Security Auditor",description:"Advanced security auditor with self-learning vulnerability detection, CVE database search, and compliance auditing",domains:["security-compliance"],capabilities:["sast","dast","vulnerability","owasp","security-scanning"],languages:["typescript","javascript","python","java","go","rust"],complexity:{min:"medium",max:"complex"},tags:["security","cve","compliance"]}),e({id:"security-architect",name:"Security Architect",description:"V3 Security Architecture specialist with ReasoningBank learning, HNSW threat pattern search, and zero-trust design capabilities",domains:["security-compliance"],capabilities:["sast","vulnerability","owasp","security-scanning"],languages:["typescript","javascript","python","java","go"],complexity:{min:"complex",max:"complex"},tags:["architecture","zero-trust"]}),e({id:"performance-engineer",name:"Performance Engineer",description:"V3 Performance Engineering Agent specialized in Flash Attention optimization, WASM SIMD acceleration, and comprehensive performance profiling",domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","benchmark"],languages:["typescript","javascript","python","go","rust"],complexity:{min:"medium",max:"complex"},tags:["performance","optimization"]}),e({id:"code-analyzer",name:"Code Analyzer",description:"Advanced code quality analysis agent for comprehensive code reviews and improvements",domains:["code-intelligence","quality-assessment"],capabilities:["coverage-analysis","gap-detection","quality-gate"],languages:["typescript","javascript","python","java","go","rust"],complexity:{min:"simple",max:"complex"},tags:["analysis","quality"]}),e({id:"cicd-engineer",name:"CI/CD Engineer",description:"Specialized agent for GitHub Actions CI/CD pipeline creation and optimization",domains:["test-execution"],capabilities:["test-orchestration","deployment-readiness"],complexity:{min:"medium",max:"complex"},tags:["cicd","github-actions"]})],h=[e({id:"reasoningbank-learner",name:"ReasoningBank Learner",description:"V3 ReasoningBank integration specialist for trajectory tracking, verdict judgment, pattern distillation, and experience replay using HNSW-indexed memory",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","reasoningbank","learning"]}),e({id:"adr-architect",name:"ADR Architect",description:"V3 Architecture Decision Record specialist that documents, tracks, and enforces architectural decisions with ReasoningBank integration for pattern learning",domains:["learning-optimization"],capabilities:["quality-gate"],complexity:{min:"medium",max:"complex"},tags:["v3","adr","architecture"]}),e({id:"ddd-domain-expert",name:"DDD Domain Expert",description:"V3 Domain-Driven Design specialist for bounded context identification, aggregate design, domain modeling, and ubiquitous language enforcement",domains:["code-intelligence"],capabilities:["quality-gate"],complexity:{min:"complex",max:"complex"},tags:["v3","ddd","domain"]}),e({id:"v3-integration-architect",name:"V3 Integration Architect",description:"V3 deep agentic-flow integration specialist implementing ADR-001 for eliminating duplicate code and building claude-flow as a specialized extension",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","integration","agentic-flow"]}),e({id:"memory-specialist",name:"Memory Specialist",description:"V3 memory optimization specialist with HNSW indexing, hybrid backend management, vector quantization, and EWC++ for preventing catastrophic forgetting",domains:["learning-optimization"],capabilities:["sublinear-analysis"],complexity:{min:"complex",max:"complex"},tags:["v3","memory","hnsw"]}),e({id:"claims-authorizer",name:"Claims Authorizer",description:"V3 Claims-based authorization specialist implementing ADR-010 for fine-grained access control across swarm agents and MCP tools",domains:["security-compliance"],capabilities:["security-scanning"],complexity:{min:"medium",max:"complex"},tags:["v3","claims","authorization"]}),e({id:"sparc-orchestrator",name:"SPARC Orchestrator",description:"V3 SPARC methodology orchestrator that coordinates Specification, Pseudocode, Architecture, Refinement, and Completion phases with ReasoningBank learning",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","sparc","methodology"]}),e({id:"sona-learning-optimizer",name:"SONA Learning Optimizer",description:"V3 SONA-powered self-optimizing agent using claude-flow neural tools for adaptive learning, pattern discovery, and continuous quality improvement with sub-millisecond overhead",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","sona","self-learning"]}),e({id:"safla-neural",name:"SAFLA Neural",description:"Self-Aware Feedback Loop Algorithm (SAFLA) neural specialist that creates intelligent, memory-persistent AI systems with self-learning capabilities",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","safla","neural"]}),e({id:"production-validator",name:"Production Validator",description:"Production validation specialist ensuring applications are fully implemented and deployment-ready",domains:["quality-assessment"],capabilities:["deployment-readiness","quality-gate"],complexity:{min:"medium",max:"complex"},tags:["production","validation"]}),e({id:"tdd-london-swarm",name:"TDD London Swarm",description:"TDD London School specialist for mock-driven development within swarm coordination",domains:["test-generation"],capabilities:["tdd","unit-test","test-generation"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"medium",max:"complex"},tags:["tdd","london","mocks"]})],f=[e({id:"queen-coordinator",name:"Queen Coordinator",description:"The sovereign orchestrator of hierarchical hive operations, managing strategic decisions, resource allocation, and maintaining hive coherence",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["queen","hive","orchestration"]}),e({id:"swarm-memory-manager",name:"Swarm Memory Manager",description:"V3 distributed memory manager for cross-agent state synchronization, CRDT replication, and namespace coordination across the swarm",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["swarm","memory","crdt"]}),e({id:"worker-specialist",name:"Worker Specialist",description:"Dedicated task execution specialist that carries out assigned work with precision, continuously reporting progress through memory coordination",domains:["test-execution"],capabilities:["test-orchestration"],complexity:{min:"simple",max:"complex"},tags:["worker","execution"]}),e({id:"collective-intelligence-coordinator",name:"Collective Intelligence Coordinator",description:"Hive-mind collective decision making with Byzantine fault-tolerant consensus, attention-based coordination, and emergent intelligence patterns",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["collective","consensus"]}),e({id:"scout-explorer",name:"Scout Explorer",description:"Information reconnaissance specialist that explores unknown territories, gathers intelligence, and reports findings to the hive mind",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection"],complexity:{min:"simple",max:"medium"},tags:["scout","exploration"]}),e({id:"adaptive-coordinator",name:"Adaptive Coordinator",description:"Dynamic topology switching coordinator with self-organizing swarm patterns and real-time optimization",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["adaptive","topology"]}),e({id:"mesh-coordinator",name:"Mesh Coordinator",description:"Peer-to-peer mesh network swarm with distributed decision making and fault tolerance",domains:["learning-optimization"],capabilities:["test-orchestration","resilience"],complexity:{min:"complex",max:"complex"},tags:["mesh","p2p"]}),e({id:"hierarchical-coordinator",name:"Hierarchical Coordinator",description:"Queen-led hierarchical swarm coordination with specialized worker delegation",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["hierarchical","delegation"]})],b=[e({id:"consensus-coordinator",name:"Consensus Coordinator",description:"Distributed consensus agent that uses sublinear solvers for fast agreement protocols in multi-agent systems",domains:["learning-optimization"],capabilities:["test-orchestration","resilience"],complexity:{min:"complex",max:"complex"},tags:["consensus","distributed"]}),e({id:"byzantine-coordinator",name:"Byzantine Coordinator",description:"Coordinates Byzantine fault-tolerant consensus protocols with malicious actor detection",domains:["security-compliance"],capabilities:["resilience","security-scanning"],complexity:{min:"complex",max:"complex"},tags:["byzantine","fault-tolerance"]}),e({id:"raft-manager",name:"Raft Manager",description:"Manages Raft consensus algorithm with leader election and log replication",domains:["learning-optimization"],capabilities:["test-orchestration","resilience"],complexity:{min:"complex",max:"complex"},tags:["raft","leader-election"]}),e({id:"crdt-synchronizer",name:"CRDT Synchronizer",description:"Implements Conflict-free Replicated Data Types for eventually consistent state synchronization",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["crdt","eventual-consistency"]})],m=Object.freeze([...u,...y,...v,...x,...h,...f,...b]);function E(i,t){let a=m.find(n=>n.id===i);if(!a){let n=m.find(o=>o.id.includes(i)||i.includes(o.id));if(!n){console.error(`[AgentRegistry] Agent not found: ${i}`);return}l(n,t);return}l(a,t)}function l(i,t){let a=i.tasksCompleted,n=Math.round(i.successRate*a);i.tasksCompleted++;let o=n+(t.success?1:0);i.successRate=i.tasksCompleted>0?o/i.tasksCompleted:0,a===0?i.avgDurationMs=t.executionTimeMs:i.avgDurationMs=.3*t.executionTimeMs+(1-.3)*i.avgDurationMs;let p=t.qualityScore??(t.success?.7:.3),d=i.successRate,r=.4*p+.6*d;a===0?i.performanceScore=r:i.performanceScore=.2*r+(1-.2)*i.performanceScore,i.performanceScore=Math.max(0,Math.min(1,i.performanceScore)),console.error(`[AgentRegistry] Updated ${i.id}: tasks=${i.tasksCompleted} successRate=${(i.successRate*100).toFixed(1)}% performanceScore=${i.performanceScore.toFixed(3)} avgDurationMs=${i.avgDurationMs.toFixed(0)}`)}var s=new Map;function k(i){s=new Map;let t=c(i);for(let a of t.overlays)a.config&&s.set(a.agent,a.config);if(s.size>0&&console.error(`[AgentRegistry] Loaded overlay configs for ${s.size} agent(s): ${[...s.keys()].join(", ")}`),t.warnings.length>0)for(let a of t.warnings)console.error(`[AgentRegistry] Overlay warning: ${a}`)}function Q(i){return s.get(i)}export{m as a,E as b,k as c,Q as d};
|
|
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.9.5");process.exit(0)}
|
|
2
|
+
import{a as c}from"./chunk-YHKJYBWK.js";function e(i){return{...i,performanceScore:.7,tasksCompleted:0,successRate:0,avgDurationMs:0}}var u=[e({id:"v3-qe-tdd-specialist",name:"V3 QE TDD Specialist",description:"V3 QE TDD specialist covering RED, GREEN, REFACTOR phases with comprehensive test-driven development support",domains:["test-generation"],capabilities:["test-generation","tdd","unit-test","test-quality"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"simple",max:"complex"},tags:["v3","tdd","red-green-refactor"]}),e({id:"v3-qe-test-architect",name:"V3 QE Test Architect",description:"V3 QE Test Architect for AI-powered test generation strategy, test pyramid design, and cross-framework test orchestration",domains:["test-generation"],capabilities:["test-generation","test-orchestration","unit-test","integration-test","e2e-test"],languages:["typescript","javascript","python","java","go"],frameworks:["jest","vitest","pytest","junit5","playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","architect","strategy"]}),e({id:"v3-qe-parallel-executor",name:"V3 QE Parallel Executor",description:"V3 QE Parallel test executor with intelligent sharding, worker pool management, retry logic, and real-time reporting",domains:["test-execution"],capabilities:["test-orchestration","retry","flaky-detection"],languages:["typescript","javascript","python","java","go"],frameworks:["jest","vitest","pytest","junit5","go-test","playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","parallel","retry","sharding"]}),e({id:"v3-qe-flaky-hunter",name:"V3 QE Flaky Hunter",description:"V3 QE Flaky test detection and stabilization through pattern recognition, auto-remediation, and retry orchestration",domains:["test-execution"],capabilities:["flaky-detection","test-stability","retry"],frameworks:["jest","vitest","pytest","playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","flaky","stability","remediation"]}),e({id:"v3-qe-retry-handler",name:"V3 QE Retry Handler",description:"V3 QE Intelligent retry handler with adaptive backoff, circuit breakers, and failure classification",domains:["test-execution"],capabilities:["retry","test-stability"],frameworks:["jest","vitest","pytest","playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","retry","adaptive-backoff"]}),e({id:"v3-qe-coverage-specialist",name:"V3 QE Coverage Specialist",description:"V3 QE Coverage Specialist for O(log n) sublinear coverage analysis, risk-weighted gap detection, and intelligent test prioritization",domains:["coverage-analysis"],capabilities:["coverage-analysis","gap-detection","sublinear-analysis","risk-scoring","branch-coverage"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","sublinear","prioritization"]}),e({id:"v3-qe-gap-detector",name:"V3 QE Gap Detector",description:"V3 QE Coverage gap detection with sublinear algorithms (O(log n) analysis), risk scoring, and intelligent test recommendations",domains:["coverage-analysis"],capabilities:["coverage-analysis","gap-detection","sublinear-analysis","risk-scoring"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","sublinear","gap-detection"]}),e({id:"v3-qe-quality-gate",name:"V3 QE Quality Gate",description:"V3 QE Quality gate enforcement with risk assessment, policy validation, and deployment readiness evaluation",domains:["quality-assessment"],capabilities:["quality-gate","deployment-readiness","risk-scoring"],complexity:{min:"medium",max:"complex"},tags:["v3","gate","deployment","policy"]}),e({id:"v3-qe-deployment-advisor",name:"V3 QE Deployment Advisor",description:"V3 QE Aggregates quality signals for deployment risk assessment and go/no-go decisions with predictive analytics",domains:["quality-assessment"],capabilities:["deployment-readiness","quality-gate","risk-scoring"],complexity:{min:"medium",max:"complex"},tags:["v3","deployment","go-no-go","analytics"]}),e({id:"v3-qe-code-complexity",name:"V3 QE Code Complexity",description:"V3 QE AI-powered code complexity analysis with refactoring recommendations and technical debt tracking",domains:["quality-assessment"],capabilities:["quality-gate","risk-scoring"],languages:["typescript","javascript","python","java","go"],complexity:{min:"simple",max:"complex"},tags:["v3","complexity","refactoring","debt"]}),e({id:"v3-qe-qx-partner",name:"V3 QE QX Partner",description:"V3 QE Quality Experience (QX) analysis combining QA advocacy and UX perspectives to co-create quality for all stakeholders",domains:["quality-assessment"],capabilities:["quality-gate"],complexity:{min:"medium",max:"complex"},tags:["v3","qx","ux","advocacy"]}),e({id:"v3-qe-security-scanner",name:"V3 QE Security Scanner",description:"V3 QE Security scanning with SAST/DAST, vulnerability detection, OWASP compliance, and threat modeling",domains:["security-compliance"],capabilities:["sast","dast","vulnerability","owasp","security-scanning"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","sast","dast","owasp"]}),e({id:"v3-qe-security-auditor",name:"V3 QE Security Auditor",description:"V3 QE Security audits for vulnerabilities, compliance validation, and security best practices enforcement",domains:["security-compliance"],capabilities:["sast","vulnerability","owasp","security-scanning"],languages:["typescript","javascript","python","java"],complexity:{min:"medium",max:"complex"},tags:["v3","audit","compliance"]}),e({id:"v3-qe-contract-validator",name:"V3 QE Contract Validator",description:"V3 QE API contract validation, breaking change detection, and backward compatibility with consumer-driven contract testing",domains:["contract-testing"],capabilities:["api-testing","contract-testing","pact","openapi"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","contract","api","pact"]}),e({id:"v3-qe-integration-tester",name:"V3 QE Integration Tester",description:"V3 QE Validates component interactions and system integration with comprehensive test scenarios",domains:["contract-testing"],capabilities:["integration-test","api-testing","contract-testing"],languages:["typescript","javascript","python","java"],frameworks:["jest","vitest","pytest","junit5"],complexity:{min:"medium",max:"complex"},tags:["v3","integration","component"]}),e({id:"v3-qe-graphql-tester",name:"V3 QE GraphQL Tester",description:"V3 QE GraphQL API testing with schema validation, query/mutation testing, and security analysis",domains:["contract-testing"],capabilities:["api-testing","contract-testing","graphql"],languages:["typescript","javascript","python"],complexity:{min:"medium",max:"complex"},tags:["v3","graphql","api"]}),e({id:"v3-qe-visual-tester",name:"V3 QE Visual Tester",description:"V3 QE Visual regression testing with AI-powered screenshot comparison and accessibility validation",domains:["visual-accessibility"],capabilities:["visual-regression","screenshot","percy","chromatic","wcag","aria"],frameworks:["playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","visual","regression","screenshots"]}),e({id:"v3-qe-accessibility-auditor",name:"V3 QE Accessibility Auditor",description:"V3 QE Accessibility testing with WCAG 2.2 compliance, screen reader validation, and copy-paste ready fixes",domains:["visual-accessibility"],capabilities:["wcag","aria","screen-reader","contrast"],frameworks:["playwright","cypress"],complexity:{min:"simple",max:"complex"},tags:["v3","wcag","a11y","accessibility"]}),e({id:"v3-qe-responsive-tester",name:"V3 QE Responsive Tester",description:"V3 QE Responsive design testing across viewports, devices, and breakpoints with layout regression detection",domains:["visual-accessibility"],capabilities:["visual-regression"],frameworks:["playwright","cypress"],complexity:{min:"medium",max:"complex"},tags:["v3","responsive","viewport","breakpoints"]}),e({id:"v3-qe-performance-tester",name:"V3 QE Performance Tester",description:"V3 QE Performance testing with load orchestration, bottleneck detection, and SLA validation",domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery","benchmark"],complexity:{min:"medium",max:"complex"},tags:["v3","load","stress","performance"]}),e({id:"v3-qe-load-tester",name:"V3 QE Load Tester",description:"V3 QE Load and stress testing with execution time analysis, rate limit testing, and bottleneck detection",domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery"],complexity:{min:"medium",max:"complex"},tags:["v3","load","stress","k6"]}),e({id:"v3-qe-chaos-engineer",name:"V3 QE Chaos Engineer",description:"V3 QE Resilience testing with controlled fault injection, blast radius management, and recovery validation",domains:["chaos-resilience"],capabilities:["chaos-testing","resilience","fault-injection"],complexity:{min:"complex",max:"complex"},tags:["v3","chaos","fault-injection","resilience"]}),e({id:"v3-qe-code-intelligence",name:"V3 QE Code Intelligence",description:"V3 QE Knowledge graph-based code understanding with semantic search and AST analysis",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","knowledge-graph","ast","semantic"]}),e({id:"v3-qe-dependency-mapper",name:"V3 QE Dependency Mapper",description:"V3 QE Dependency graph analysis with coupling metrics and security advisories",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection"],languages:["typescript","javascript","python","java"],complexity:{min:"medium",max:"complex"},tags:["v3","dependency","graph"]}),e({id:"v3-qe-kg-builder",name:"V3 QE Knowledge Graph Builder",description:"V3 QE Knowledge graph construction with entity extraction and relationship inference",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection"],languages:["typescript","javascript","python"],complexity:{min:"complex",max:"complex"},tags:["v3","knowledge-graph","entity-extraction"]}),e({id:"v3-qe-integration-architect",name:"V3 QE Integration Architect",description:"V3 QE deep agentic-flow integration specialist implementing ADR-001 for duplicate elimination and extension architecture",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection","quality-gate"],languages:["typescript","javascript"],complexity:{min:"complex",max:"complex"},tags:["v3","integration","adr-001","architecture"]}),e({id:"v3-qe-requirements-validator",name:"V3 QE Requirements Validator",description:"V3 QE Validates requirements testability and generates BDD scenarios with testability scoring",domains:["requirements-validation"],capabilities:["bdd","test-generation"],complexity:{min:"medium",max:"complex"},tags:["v3","requirements","bdd","testability"]}),e({id:"v3-qe-bdd-generator",name:"V3 QE BDD Generator",description:"V3 QE BDD scenario generation with Gherkin syntax, example discovery, and step definition mapping",domains:["requirements-validation"],capabilities:["bdd","test-generation"],complexity:{min:"medium",max:"complex"},tags:["v3","bdd","gherkin","cucumber"]}),e({id:"v3-qe-product-factors-assessor",name:"V3 QE Product Factors Assessor",description:"V3 QE SFDIPOT product factors analysis using James Bach's HTSM framework for comprehensive test strategy generation with prioritized test ideas (P0-P3) and automation fitness recommendations",domains:["requirements-validation"],capabilities:["bdd","test-generation","risk-scoring"],complexity:{min:"medium",max:"complex"},tags:["v3","sfdipot","htsm","product-factors","james-bach"]}),e({id:"v3-qe-test-idea-rewriter",name:"V3 QE Test Idea Rewriter",description:'V3 QE Transform passive "Verify X" test descriptions into active, observable test actions using action verbs for clearer, more testable descriptions',domains:["test-generation"],capabilities:["test-generation","test-quality"],complexity:{min:"simple",max:"medium"},tags:["v3","test-ideas","rewriting","action-verbs","quality"]}),e({id:"v3-qe-quality-criteria-recommender",name:"V3 QE Quality Criteria Recommender",description:"V3 QE HTSM v6.3 Quality Criteria analysis for shift-left quality engineering during PI/Sprint Planning with evidence-based recommendations",domains:["requirements-validation"],capabilities:["bdd","test-generation","quality-gate"],complexity:{min:"medium",max:"complex"},tags:["v3","htsm","quality-criteria","shift-left","qcsd"]}),e({id:"v3-qe-defect-predictor",name:"V3 QE Defect Predictor",description:"V3 QE AI-powered defect prediction using historical data and code metrics",domains:["defect-intelligence"],capabilities:["risk-scoring","coverage-analysis"],languages:["typescript","javascript","python","java"],complexity:{min:"complex",max:"complex"},tags:["v3","defect","prediction","ml"]}),e({id:"v3-qe-root-cause-analyzer",name:"V3 QE Root Cause Analyzer",description:"V3 QE Systematic root cause analysis for test failures with prevention recommendations",domains:["defect-intelligence"],capabilities:["risk-scoring"],complexity:{min:"complex",max:"complex"},tags:["v3","root-cause","failure-analysis"]}),e({id:"v3-qe-regression-analyzer",name:"V3 QE Regression Analyzer",description:"V3 QE Analyzes code changes to predict regression risk and intelligently select minimal test suites",domains:["defect-intelligence"],capabilities:["risk-scoring","coverage-analysis"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","regression","risk","selection"]}),e({id:"v3-qe-impact-analyzer",name:"V3 QE Impact Analyzer",description:"V3 QE Change impact analysis with blast radius calculation and test selection",domains:["defect-intelligence"],capabilities:["risk-scoring","coverage-analysis"],languages:["typescript","javascript","python","java"],complexity:{min:"medium",max:"complex"},tags:["v3","impact","blast-radius"]}),e({id:"v3-qe-risk-assessor",name:"V3 QE Risk Assessor",description:"V3 QE Quality risk assessment with multi-factor scoring and mitigation recommendations",domains:["defect-intelligence"],capabilities:["risk-scoring"],complexity:{min:"medium",max:"complex"},tags:["v3","risk","assessment"]}),e({id:"v3-qe-learning-coordinator",name:"V3 QE Learning Coordinator",description:"V3 QE Fleet-wide learning coordination with pattern recognition and knowledge synthesis",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","learning","coordination","patterns"]}),e({id:"v3-qe-pattern-learner",name:"V3 QE Pattern Learner",description:"V3 QE Pattern discovery and learning from QE activities for test generation and defect prediction",domains:["learning-optimization"],capabilities:["test-generation","risk-scoring"],complexity:{min:"complex",max:"complex"},tags:["v3","pattern","learning","ml"]}),e({id:"v3-qe-transfer-specialist",name:"V3 QE Transfer Specialist",description:"V3 QE Knowledge transfer learning with domain adaptation and knowledge distillation",domains:["learning-optimization"],capabilities:["test-generation"],complexity:{min:"complex",max:"complex"},tags:["v3","transfer","learning","adaptation"]}),e({id:"v3-qe-metrics-optimizer",name:"V3 QE Metrics Optimizer",description:"V3 QE Learning metrics optimization with hyperparameter tuning and A/B testing",domains:["learning-optimization"],capabilities:["quality-gate"],complexity:{min:"complex",max:"complex"},tags:["v3","metrics","optimization","tuning"]}),e({id:"v3-qe-fleet-commander",name:"V3 QE Fleet Commander",description:"V3 QE Hierarchical fleet coordinator for 50+ agent orchestration with dynamic topology management and resource optimization",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","fleet","orchestration","coordination"]}),e({id:"v3-qe-queen-coordinator",name:"V3 QE Queen Coordinator",description:"V3 QE Queen Coordinator for multi-agent concurrent swarm orchestration, quality engineering workflows, and cross-agent coordination",domains:["learning-optimization"],capabilities:["test-orchestration","quality-gate"],complexity:{min:"complex",max:"complex"},tags:["v3","queen","swarm"]}),e({id:"v3-qe-property-tester",name:"V3 QE Property Tester",description:"V3 QE Property-based testing with fast-check for edge case discovery through randomized input generation",domains:["test-generation"],capabilities:["test-generation","unit-test"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","mocha"],complexity:{min:"medium",max:"complex"},tags:["v3","property","pbt","edge-cases"]}),e({id:"v3-qe-mutation-tester",name:"V3 QE Mutation Tester",description:"V3 QE Mutation testing for test suite effectiveness evaluation with mutation score analysis",domains:["test-generation"],capabilities:["test-quality","coverage-analysis"],languages:["typescript","javascript","python"],frameworks:["jest","vitest"],complexity:{min:"medium",max:"complex"},tags:["v3","mutation","test-quality"]})],y=[e({id:"v3-qe-tdd-red",name:"V3 QE TDD RED Phase",description:"V3 QE TDD RED phase specialist - writes failing tests that define expected behavior before implementation",domains:["test-generation"],capabilities:["test-generation","tdd","unit-test"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"simple",max:"medium"},tags:["v3","tdd","red-phase","subagent"]}),e({id:"v3-qe-tdd-green",name:"V3 QE TDD GREEN Phase",description:"V3 QE TDD GREEN phase specialist - implements minimal code to make failing tests pass",domains:["test-generation"],capabilities:["test-generation","tdd","unit-test"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"simple",max:"medium"},tags:["v3","tdd","green-phase","subagent"]}),e({id:"v3-qe-tdd-refactor",name:"V3 QE TDD REFACTOR Phase",description:"V3 QE TDD REFACTOR phase specialist - improves code quality while keeping all tests passing",domains:["test-generation"],capabilities:["test-generation","tdd","test-quality"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"medium",max:"complex"},tags:["v3","tdd","refactor-phase","subagent"]}),e({id:"v3-qe-code-reviewer",name:"V3 QE Code Reviewer",description:"V3 QE Code review specialist enforcing quality standards, linting, complexity, and security",domains:["quality-assessment"],capabilities:["quality-gate","security-scanning"],languages:["typescript","javascript","python","java","go"],complexity:{min:"simple",max:"complex"},tags:["v3","code-review","standards","subagent"]}),e({id:"v3-qe-integration-reviewer",name:"V3 QE Integration Reviewer",description:"V3 QE Integration review specialist for API compatibility and cross-service interactions",domains:["contract-testing"],capabilities:["integration-test","api-testing"],languages:["typescript","javascript","python","java"],complexity:{min:"medium",max:"complex"},tags:["v3","integration","review","subagent"]}),e({id:"v3-qe-performance-reviewer",name:"V3 QE Performance Reviewer",description:"V3 QE Performance review specialist for algorithmic complexity and resource usage",domains:["chaos-resilience"],capabilities:["load-testing","benchmark"],languages:["typescript","javascript","python","go"],complexity:{min:"medium",max:"complex"},tags:["v3","performance","review","subagent"]}),e({id:"v3-qe-security-reviewer",name:"V3 QE Security Reviewer",description:"V3 QE Security review specialist for vulnerability detection and secure coding practices",domains:["security-compliance"],capabilities:["sast","vulnerability","security-scanning"],languages:["typescript","javascript","python","java","go"],complexity:{min:"medium",max:"complex"},tags:["v3","security","review","subagent"]})],v=[e({id:"n8n-base-agent",name:"n8n Base Agent",description:"Abstract base agent for n8n workflow automation testing - provides common utilities for all n8n testing agents",domains:["test-generation"],capabilities:["test-generation","test-orchestration"],complexity:{min:"simple",max:"simple"},tags:["n8n","base","workflow"]}),e({id:"n8n-workflow-executor",name:"n8n Workflow Executor",description:"Execute and validate n8n workflows programmatically with test data injection, output assertions, and data flow validation",domains:["test-execution"],capabilities:["test-orchestration","integration-test"],complexity:{min:"medium",max:"complex"},tags:["n8n","execution","validation"]}),e({id:"n8n-unit-tester",name:"n8n Unit Tester",description:"Unit test custom n8n node functions with Jest/Vitest integration, function isolation, mock data injection, and coverage reporting",domains:["test-generation"],capabilities:["unit-test","test-generation"],frameworks:["jest","vitest"],complexity:{min:"simple",max:"medium"},tags:["n8n","unit","isolation"]}),e({id:"n8n-integration-test",name:"n8n Integration Tester",description:"Test n8n node integrations with external services including API contract validation, authentication flows, rate limiting, and error handling",domains:["contract-testing"],capabilities:["integration-test","api-testing","contract-testing"],complexity:{min:"medium",max:"complex"},tags:["n8n","integration","api"]}),e({id:"n8n-trigger-test",name:"n8n Trigger Tester",description:"Test n8n workflow triggers including webhooks, schedules, polling triggers, and event-driven activation",domains:["test-execution"],capabilities:["integration-test","test-generation"],complexity:{min:"medium",max:"complex"},tags:["n8n","triggers","webhooks"]}),e({id:"n8n-node-validator",name:"n8n Node Validator",description:"Validate n8n node configurations, connections, data mappings, and conditional routing logic",domains:["contract-testing"],capabilities:["contract-testing","test-generation"],complexity:{min:"simple",max:"medium"},tags:["n8n","validation","nodes"]}),e({id:"n8n-performance-tester",name:"n8n Performance Tester",description:"Load and stress testing for n8n workflows using k6/Artillery with execution time analysis, rate limit testing, and bottleneck detection",domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery","benchmark"],complexity:{min:"medium",max:"complex"},tags:["n8n","performance","load"]}),e({id:"n8n-security-auditor",name:"n8n Security Auditor",description:"Security vulnerability scanning for n8n workflows including credential exposure, injection risks, OWASP compliance, and secret detection",domains:["security-compliance"],capabilities:["sast","vulnerability","owasp","security-scanning"],complexity:{min:"medium",max:"complex"},tags:["n8n","security","owasp"]}),e({id:"n8n-compliance-validator",name:"n8n Compliance Validator",description:"Regulatory compliance testing for n8n workflows including GDPR, CCPA, HIPAA, SOC2, and PCI-DSS validation",domains:["security-compliance"],capabilities:["security-scanning"],complexity:{min:"medium",max:"complex"},tags:["n8n","compliance","gdpr"]}),e({id:"n8n-bdd-scenario-tester",name:"n8n BDD Scenario Tester",description:"BDD/Gherkin scenario testing for n8n workflows with Cucumber integration, business requirement mapping, and stakeholder-friendly reports",domains:["requirements-validation"],capabilities:["bdd","test-generation"],complexity:{min:"medium",max:"complex"},tags:["n8n","bdd","gherkin"]}),e({id:"n8n-expression-validator",name:"n8n Expression Validator",description:"Validate n8n expressions and data transformations with syntax checking, context-aware testing, and security analysis",domains:["code-intelligence"],capabilities:["test-generation","security-scanning"],complexity:{min:"simple",max:"medium"},tags:["n8n","expressions","validation"]}),e({id:"n8n-version-comparator",name:"n8n Version Comparator",description:"Workflow version diff and regression detection with JSON comparison, change impact analysis, migration validation, and rollback testing",domains:["defect-intelligence"],capabilities:["risk-scoring","test-generation"],complexity:{min:"medium",max:"complex"},tags:["n8n","version","diff"]}),e({id:"n8n-chaos-tester",name:"n8n Chaos Tester",description:"Chaos engineering for n8n workflows with controlled fault injection, service failure simulation, recovery validation, and resilience testing",domains:["chaos-resilience"],capabilities:["chaos-testing","resilience","fault-injection"],complexity:{min:"complex",max:"complex"},tags:["n8n","chaos","resilience"]}),e({id:"n8n-ci-orchestrator",name:"n8n CI Orchestrator",description:"CI/CD pipeline integration for n8n workflows with REST API triggers, automated regression testing, GitHub Actions/Jenkins integration, and test scheduling",domains:["test-execution"],capabilities:["test-orchestration","integration-test"],complexity:{min:"medium",max:"complex"},tags:["n8n","ci","cd"]}),e({id:"n8n-monitoring-validator",name:"n8n Monitoring Validator",description:"Validate monitoring and alerting configurations for n8n workflows including error tracking, alert rules, SLA compliance, and observability checks",domains:["quality-assessment"],capabilities:["quality-gate","deployment-readiness"],complexity:{min:"medium",max:"complex"},tags:["n8n","monitoring","alerting"]})],x=[e({id:"tester",name:"Tester",description:"Comprehensive testing and quality assurance specialist with AI-powered test generation",domains:["test-generation","test-execution"],capabilities:["test-generation","unit-test","integration-test","e2e-test"],languages:["typescript","javascript","python","java","go","rust"],frameworks:["jest","vitest","mocha","pytest","junit5","go-test","rust-test","playwright","cypress"],complexity:{min:"simple",max:"complex"},tags:["general","versatile"]}),e({id:"reviewer",name:"Reviewer",description:"Code review and quality assurance specialist with AI-powered pattern detection",domains:["quality-assessment"],capabilities:["quality-gate","security-scanning"],languages:["typescript","javascript","python","java","go","rust"],complexity:{min:"simple",max:"complex"},tags:["general","code-review"]}),e({id:"security-auditor",name:"Security Auditor",description:"Advanced security auditor with self-learning vulnerability detection, CVE database search, and compliance auditing",domains:["security-compliance"],capabilities:["sast","dast","vulnerability","owasp","security-scanning"],languages:["typescript","javascript","python","java","go","rust"],complexity:{min:"medium",max:"complex"},tags:["security","cve","compliance"]}),e({id:"security-architect",name:"Security Architect",description:"V3 Security Architecture specialist with ReasoningBank learning, HNSW threat pattern search, and zero-trust design capabilities",domains:["security-compliance"],capabilities:["sast","vulnerability","owasp","security-scanning"],languages:["typescript","javascript","python","java","go"],complexity:{min:"complex",max:"complex"},tags:["architecture","zero-trust"]}),e({id:"performance-engineer",name:"Performance Engineer",description:"V3 Performance Engineering Agent specialized in Flash Attention optimization, WASM SIMD acceleration, and comprehensive performance profiling",domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","benchmark"],languages:["typescript","javascript","python","go","rust"],complexity:{min:"medium",max:"complex"},tags:["performance","optimization"]}),e({id:"code-analyzer",name:"Code Analyzer",description:"Advanced code quality analysis agent for comprehensive code reviews and improvements",domains:["code-intelligence","quality-assessment"],capabilities:["coverage-analysis","gap-detection","quality-gate"],languages:["typescript","javascript","python","java","go","rust"],complexity:{min:"simple",max:"complex"},tags:["analysis","quality"]}),e({id:"cicd-engineer",name:"CI/CD Engineer",description:"Specialized agent for GitHub Actions CI/CD pipeline creation and optimization",domains:["test-execution"],capabilities:["test-orchestration","deployment-readiness"],complexity:{min:"medium",max:"complex"},tags:["cicd","github-actions"]})],h=[e({id:"reasoningbank-learner",name:"ReasoningBank Learner",description:"V3 ReasoningBank integration specialist for trajectory tracking, verdict judgment, pattern distillation, and experience replay using HNSW-indexed memory",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","reasoningbank","learning"]}),e({id:"adr-architect",name:"ADR Architect",description:"V3 Architecture Decision Record specialist that documents, tracks, and enforces architectural decisions with ReasoningBank integration for pattern learning",domains:["learning-optimization"],capabilities:["quality-gate"],complexity:{min:"medium",max:"complex"},tags:["v3","adr","architecture"]}),e({id:"ddd-domain-expert",name:"DDD Domain Expert",description:"V3 Domain-Driven Design specialist for bounded context identification, aggregate design, domain modeling, and ubiquitous language enforcement",domains:["code-intelligence"],capabilities:["quality-gate"],complexity:{min:"complex",max:"complex"},tags:["v3","ddd","domain"]}),e({id:"v3-integration-architect",name:"V3 Integration Architect",description:"V3 deep agentic-flow integration specialist implementing ADR-001 for eliminating duplicate code and building claude-flow as a specialized extension",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","integration","agentic-flow"]}),e({id:"memory-specialist",name:"Memory Specialist",description:"V3 memory optimization specialist with HNSW indexing, hybrid backend management, vector quantization, and EWC++ for preventing catastrophic forgetting",domains:["learning-optimization"],capabilities:["sublinear-analysis"],complexity:{min:"complex",max:"complex"},tags:["v3","memory","hnsw"]}),e({id:"claims-authorizer",name:"Claims Authorizer",description:"V3 Claims-based authorization specialist implementing ADR-010 for fine-grained access control across swarm agents and MCP tools",domains:["security-compliance"],capabilities:["security-scanning"],complexity:{min:"medium",max:"complex"},tags:["v3","claims","authorization"]}),e({id:"sparc-orchestrator",name:"SPARC Orchestrator",description:"V3 SPARC methodology orchestrator that coordinates Specification, Pseudocode, Architecture, Refinement, and Completion phases with ReasoningBank learning",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","sparc","methodology"]}),e({id:"sona-learning-optimizer",name:"SONA Learning Optimizer",description:"V3 SONA-powered self-optimizing agent using claude-flow neural tools for adaptive learning, pattern discovery, and continuous quality improvement with sub-millisecond overhead",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","sona","self-learning"]}),e({id:"safla-neural",name:"SAFLA Neural",description:"Self-Aware Feedback Loop Algorithm (SAFLA) neural specialist that creates intelligent, memory-persistent AI systems with self-learning capabilities",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["v3","safla","neural"]}),e({id:"production-validator",name:"Production Validator",description:"Production validation specialist ensuring applications are fully implemented and deployment-ready",domains:["quality-assessment"],capabilities:["deployment-readiness","quality-gate"],complexity:{min:"medium",max:"complex"},tags:["production","validation"]}),e({id:"tdd-london-swarm",name:"TDD London Swarm",description:"TDD London School specialist for mock-driven development within swarm coordination",domains:["test-generation"],capabilities:["tdd","unit-test","test-generation"],languages:["typescript","javascript","python"],frameworks:["jest","vitest","pytest"],complexity:{min:"medium",max:"complex"},tags:["tdd","london","mocks"]})],f=[e({id:"queen-coordinator",name:"Queen Coordinator",description:"The sovereign orchestrator of hierarchical hive operations, managing strategic decisions, resource allocation, and maintaining hive coherence",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["queen","hive","orchestration"]}),e({id:"swarm-memory-manager",name:"Swarm Memory Manager",description:"V3 distributed memory manager for cross-agent state synchronization, CRDT replication, and namespace coordination across the swarm",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["swarm","memory","crdt"]}),e({id:"worker-specialist",name:"Worker Specialist",description:"Dedicated task execution specialist that carries out assigned work with precision, continuously reporting progress through memory coordination",domains:["test-execution"],capabilities:["test-orchestration"],complexity:{min:"simple",max:"complex"},tags:["worker","execution"]}),e({id:"collective-intelligence-coordinator",name:"Collective Intelligence Coordinator",description:"Hive-mind collective decision making with Byzantine fault-tolerant consensus, attention-based coordination, and emergent intelligence patterns",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["collective","consensus"]}),e({id:"scout-explorer",name:"Scout Explorer",description:"Information reconnaissance specialist that explores unknown territories, gathers intelligence, and reports findings to the hive mind",domains:["code-intelligence"],capabilities:["coverage-analysis","gap-detection"],complexity:{min:"simple",max:"medium"},tags:["scout","exploration"]}),e({id:"adaptive-coordinator",name:"Adaptive Coordinator",description:"Dynamic topology switching coordinator with self-organizing swarm patterns and real-time optimization",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["adaptive","topology"]}),e({id:"mesh-coordinator",name:"Mesh Coordinator",description:"Peer-to-peer mesh network swarm with distributed decision making and fault tolerance",domains:["learning-optimization"],capabilities:["test-orchestration","resilience"],complexity:{min:"complex",max:"complex"},tags:["mesh","p2p"]}),e({id:"hierarchical-coordinator",name:"Hierarchical Coordinator",description:"Queen-led hierarchical swarm coordination with specialized worker delegation",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["hierarchical","delegation"]})],b=[e({id:"consensus-coordinator",name:"Consensus Coordinator",description:"Distributed consensus agent that uses sublinear solvers for fast agreement protocols in multi-agent systems",domains:["learning-optimization"],capabilities:["test-orchestration","resilience"],complexity:{min:"complex",max:"complex"},tags:["consensus","distributed"]}),e({id:"byzantine-coordinator",name:"Byzantine Coordinator",description:"Coordinates Byzantine fault-tolerant consensus protocols with malicious actor detection",domains:["security-compliance"],capabilities:["resilience","security-scanning"],complexity:{min:"complex",max:"complex"},tags:["byzantine","fault-tolerance"]}),e({id:"raft-manager",name:"Raft Manager",description:"Manages Raft consensus algorithm with leader election and log replication",domains:["learning-optimization"],capabilities:["test-orchestration","resilience"],complexity:{min:"complex",max:"complex"},tags:["raft","leader-election"]}),e({id:"crdt-synchronizer",name:"CRDT Synchronizer",description:"Implements Conflict-free Replicated Data Types for eventually consistent state synchronization",domains:["learning-optimization"],capabilities:["test-orchestration"],complexity:{min:"complex",max:"complex"},tags:["crdt","eventual-consistency"]})],m=Object.freeze([...u,...y,...v,...x,...h,...f,...b]);function E(i,t){let a=m.find(n=>n.id===i);if(!a){let n=m.find(o=>o.id.includes(i)||i.includes(o.id));if(!n){console.error(`[AgentRegistry] Agent not found: ${i}`);return}l(n,t);return}l(a,t)}function l(i,t){let a=i.tasksCompleted,n=Math.round(i.successRate*a);i.tasksCompleted++;let o=n+(t.success?1:0);i.successRate=i.tasksCompleted>0?o/i.tasksCompleted:0,a===0?i.avgDurationMs=t.executionTimeMs:i.avgDurationMs=.3*t.executionTimeMs+(1-.3)*i.avgDurationMs;let p=t.qualityScore??(t.success?.7:.3),d=i.successRate,r=.4*p+.6*d;a===0?i.performanceScore=r:i.performanceScore=.2*r+(1-.2)*i.performanceScore,i.performanceScore=Math.max(0,Math.min(1,i.performanceScore)),console.error(`[AgentRegistry] Updated ${i.id}: tasks=${i.tasksCompleted} successRate=${(i.successRate*100).toFixed(1)}% performanceScore=${i.performanceScore.toFixed(3)} avgDurationMs=${i.avgDurationMs.toFixed(0)}`)}var s=new Map;function k(i){s=new Map;let t=c(i);for(let a of t.overlays)a.config&&s.set(a.agent,a.config);if(s.size>0&&console.error(`[AgentRegistry] Loaded overlay configs for ${s.size} agent(s): ${[...s.keys()].join(", ")}`),t.warnings.length>0)for(let a of t.warnings)console.error(`[AgentRegistry] Overlay warning: ${a}`)}function Q(i){return s.get(i)}export{m as a,E as b,k as c,Q 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.9.
|
|
2
|
-
import{S as f,b as p}from"./chunk-
|
|
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.9.5");process.exit(0)}
|
|
2
|
+
import{S as f,b as p}from"./chunk-2XJRSIM5.js";f();var y={predictionWindowSize:10,compressionThreshold:.3,maxConcurrentStreams:8,oscillationFrequencyMs:100};function d(s){try{return JSON.stringify(s).length}catch{return 0}}function w(s,t){let e={},n=!1;for(let r of Object.keys(t))JSON.stringify(s[r])!==JSON.stringify(t[r])&&(e[r]=t[r],n=!0);for(let r of Object.keys(s))r in t||(e[r]=void 0,n=!0);return n?e:null}function v(s,t){let e={...s};for(let[n,r]of Object.entries(t))r===void 0?delete e[n]:e[n]=r;return e}var l=class{windowSize;windows=new Map;constructor(t){this.windowSize=Math.max(1,t)}predict(t){let e=this.windows.get(t);if(!e||e.length===0)return null;let n=e[e.length-1];return typeof n!="object"||n===null||Array.isArray(n)?null:{...n}}record(t,e){let n=this.windows.get(t);n||(n=[],this.windows.set(t,n)),n.push(e),n.length>this.windowSize&&n.shift()}removeStream(t){this.windows.delete(t)}},h=class{maxStreams;cycleMs;streamIds=[];currentIndex=0;constructor(t,e){this.maxStreams=Math.max(1,t),this.cycleMs=Math.max(1,e)}addStream(t){return this.streamIds.includes(t)||this.streamIds.length>=this.maxStreams?!1:(this.streamIds.push(t),!0)}removeStream(t){let e=this.streamIds.indexOf(t);return e===-1?!1:(this.streamIds.splice(e,1),this.currentIndex>=this.streamIds.length&&(this.currentIndex=0),!0)}nextStream(){if(this.streamIds.length===0)return null;let t=this.streamIds[this.currentIndex];return this.currentIndex=(this.currentIndex+1)%this.streamIds.length,t}getActiveStreams(){return[...this.streamIds]}get activeCount(){return this.streamIds.length}},g=class{config;predictor;router;lastPayloads=new Map;totalMessages=0;compressedMessages=0;totalOriginalBytes=0;totalCompressedBytes=0;constructor(t){this.config={...y,...t},this.predictor=new l(this.config.predictionWindowSize),this.router=new h(this.config.maxConcurrentStreams,this.config.oscillationFrequencyMs)}send(t,e,n,r){this.totalMessages++;let i=d(r);this.totalOriginalBytes+=i;let c=!1,o=r,a=i;if(typeof r=="object"&&r!==null&&!Array.isArray(r)){let m=this.predictor.predict(t);if(m){let u=w(m,r);u?1-d(u)/Math.max(i,1)>=this.config.compressionThreshold&&(o={__delta:!0,__changes:u},a=d(o),c=!0,this.compressedMessages++):(o={__delta:!0,__changes:{}},a=d(o),c=!0,this.compressedMessages++)}}return this.totalCompressedBytes+=a,this.predictor.record(t,r),this.lastPayloads.set(t,r),{streamId:t,senderId:e,receiverId:n,payload:o,compressed:c,originalSize:i,compressedSize:a,timestamp:Date.now()}}receive(t){if(!t.compressed||typeof t.payload!="object"||t.payload===null)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let e=t.payload;if(!e.__delta)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let n=this.predictor.predict(t.streamId),r=e.__changes??{};if(!n)return r;let i=v(n,r);return this.predictor.record(t.streamId,i),this.lastPayloads.set(t.streamId,i),i}getStats(){let t=this.totalOriginalBytes-this.totalCompressedBytes;return{totalMessages:this.totalMessages,compressedMessages:this.compressedMessages,bandwidthSavedBytes:Math.max(0,t),bandwidthReductionPercent:this.totalOriginalBytes>0?Math.max(0,t)/this.totalOriginalBytes*100:0,activeStreams:this.router.activeCount}}addStream(t){this.router.addStream(t)}removeStream(t){this.router.removeStream(t),this.predictor.removeStream(t),this.lastPayloads.delete(t)}};function M(s){return S()?new g(s):null}function S(){return p().useCognitiveRouting}export{M as a,S as 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.9.
|
|
2
|
-
import{a as W}from"./chunk-
|
|
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.9.5");process.exit(0)}
|
|
2
|
+
import{a as W}from"./chunk-UO2R7ZN3.js";import{c as V,d as q}from"./chunk-OPOTKH42.js";import{c as M}from"./chunk-KWIDDPKG.js";import{a as $}from"./chunk-Z2GK7COI.js";import{c as N}from"./chunk-OQCEI7Q4.js";import{b as D,d as H}from"./chunk-CNGRXBKO.js";import{a as E,c as k}from"./chunk-MYIDAWGQ.js";import{f as y}from"./chunk-TRO45ZLC.js";import{a as R,b as U,d as J}from"./chunk-TSA5MUTQ.js";var P={dbPath:".agentic-qe/dream.db",similarityThreshold:.5,maxEdgesPerNode:20,walMode:!0,debug:!1};H();k();var A=class{config;db=null;persistence=null;prepared=new Map;initialized=!1;constructor(e){this.config={...P,...e}}async initialize(){if(!this.initialized)try{if(this.persistence=M(),this.persistence.isInitialized()||await this.persistence.initialize(),this.db=this.persistence.getDatabase(),this.prepareStatements(),this.initialized=!0,this.config.debug){let e=await this.getStats();console.log(`[ConceptGraph] Initialized: ${this.persistence.getDbPath()}`,e)}}catch(e){throw new Error(`Failed to initialize ConceptGraph: ${E(e)}`)}}prepareStatements(){if(!this.db)throw new Error("Database not initialized");this.prepared.set("insertNode",this.db.prepare(`
|
|
3
3
|
INSERT INTO concept_nodes
|
|
4
4
|
(id, concept_type, content, embedding, activation_level, last_activated, pattern_id, metadata)
|
|
5
5
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
@@ -59,7 +59,7 @@ import{a as W}from"./chunk-J7QGH6PG.js";import{c as V,d as q}from"./chunk-UVWKIP
|
|
|
59
59
|
ORDER BY weight DESC
|
|
60
60
|
LIMIT -1 OFFSET ?
|
|
61
61
|
)
|
|
62
|
-
`).run(s,e);a+=c.changes}return a})(),n>0&&console.log(`[ConceptGraph] Pruned ${n} edges (maxPerNode=${e}, minWeight=${t})`),n}async getStats(){this.ensureInitialized();let e=this.prepared.get("countNodes"),t=this.prepared.get("countEdges"),n=this.prepared.get("countByType");if(!e||!t||!n)throw new Error("Prepared statements not found");let i=e.get().count,a=t.get().count,r={pattern:0,technique:0,domain:0,outcome:0,error:0},o=n.all();for(let c of o)r[c.concept_type]=c.count;let s=0;return i>0&&(s=this.db.prepare("SELECT AVG(activation_level) as avg FROM concept_nodes").get().avg||0),{nodeCount:i,edgeCount:a,byType:r,avgEdgesPerNode:i>0?a/i:0,avgActivation:s}}async close(){this.prepared.clear(),this.db=null,this.persistence=null,this.initialized=!1}ensureInitialized(){if(!this.initialized||!this.db)throw new Error("ConceptGraph not initialized. Call initialize() first.")}async getEdgeBetween(e,t){let n=this.prepared.get("getEdge");if(!n)throw new Error("Prepared statement not found: getEdge");let i=n.get(e,t);return i?this.rowToEdge(i):null}async findDomainNode(e){if(!this.db)return null;let n=this.db.prepare("SELECT * FROM concept_nodes WHERE concept_type = 'domain' AND content = ?").get(e);return n?this.rowToNode(n):null}async findNodeByPatternId(e){if(!this.db)return null;let n=this.db.prepare("SELECT * FROM concept_nodes WHERE pattern_id = ? LIMIT 1").get(e);return n?this.rowToNode(n):null}rowToNode(e){let t;if(e.embedding){let n=e.embedding,i=new Float32Array(n.buffer,n.byteOffset,n.byteLength/4);t=Array.from(i)}return{id:e.id,conceptType:e.concept_type,content:e.content,embedding:t,activationLevel:e.activation_level||0,lastActivated:e.last_activated?new Date(e.last_activated):void 0,patternId:e.pattern_id||void 0,metadata:e.metadata?D(e.metadata):void 0,createdAt:e.created_at?new Date(e.created_at):void 0}}rowToEdge(e){return{id:e.id,source:e.source,target:e.target,weight:e.weight,edgeType:e.edge_type,evidence:e.evidence,createdAt:e.created_at?new Date(e.created_at):void 0,updatedAt:e.updated_at?new Date(e.updated_at):void 0}}};function K(h){return new A(h)}J();function Z(h,e){if(e<0||e>=h.length)return h[0]??0;let t=0,n=h.length-1;for(;t<n;){let i=t+n>>1;if(h[i]<h[t]){let s=h[t];h[t]=h[i],h[i]=s}if(h[n]<h[t]){let s=h[t];h[t]=h[n],h[n]=s}if(h[i]<h[n]){let s=h[i];h[i]=h[n],h[n]=s}let a=h[n],r=t;for(let s=t;s<n;s++)if(h[s]<=a){let c=h[r];h[r]=h[s],h[s]=c,r++}let o=h[r];if(h[r]=h[n],h[n]=o,r===e)return h[r];r<e?t=r+1:n=r-1}return h[t]}var B=1e4,O=5e4,F=.8,j={decayRate:.1,spreadFactor:.5,threshold:.1,maxIterations:20,noiseLevel:.05},S=class{graph;config;activationHistory=new Map;coActivationCounts=new Map;constructor(e,t={}){this.graph=e,this.config={...j,...t}}async spread(e,t=1,n){let i=e.filter(d=>this.graph.getConcept(d)!==void 0);if(i.length===0)return{iterations:0,nodesActivated:0,peakActivation:0,activatedNodes:[],novelAssociations:[]};for(let d of i)this.graph.setActivation(d,t),this.recordActivation(d,t);let a=0,r=t,o=0,s=0;for(;a<this.config.maxIterations&&!(n!==void 0&&Date.now()>=n);){let d=await this.spreadIteration(),l=this.graph.getActiveNodes(this.config.threshold);for(let u of l)u.activationLevel>r&&(r=u.activationLevel);if(l.length===o&&d===0){if(s++,s>=3)break}else s=0;o=l.length,a++}let c=this.graph.getActiveNodes(this.config.threshold).map(d=>({nodeId:d.id,activation:d.activationLevel})).sort((d,l)=>l.activation-d.activation),p=await this.findNovelAssociations(this.config.threshold);return this.trimHistory(),{iterations:a,nodesActivated:c.length,peakActivation:r,activatedNodes:c,novelAssociations:p.map(d=>({source:d.source.id,target:d.target.id,strength:d.coActivation}))}}async dream(e){let t=Date.now(),n=[],i=0,a=0,r=new Set,o=this.graph.getAllConcepts(0);if(o.length===0)return{iterations:0,nodesActivated:0,peakActivation:0,activatedNodes:[],novelAssociations:[]};let s=t+e;for(;Date.now()<s;){let d=U(0,o.length),l=o[d];if(l){let u=this.config.noiseLevel+R()*this.config.noiseLevel*2,m=l.activationLevel,v=Math.min(1,m+u+.3);this.graph.setActivation(l.id,v);let f=await this.spread([l.id],v,s);i+=f.iterations,f.peakActivation>a&&(a=f.peakActivation);for(let b of f.activatedNodes)r.add(b.nodeId);for(let b of f.novelAssociations)n.push(b)}if(Date.now()>=s)break;await this.sleep(50+R()*50)}let c=this.deduplicateAssociations(n),p=Array.from(r).map(d=>{let l=this.graph.getConcept(d);return{nodeId:d,activation:l?.activationLevel??0}}).filter(d=>d.activation>0).sort((d,l)=>l.activation-d.activation);return this.trimHistory(),{iterations:i,nodesActivated:p.length,peakActivation:a,activatedNodes:p,novelAssociations:c.slice(0,20)}}async findNovelAssociations(e){let t=e??this.config.threshold,n=this.graph.getActiveNodes(t);if(n.length<2)return[];let i=200;n.length>i&&(n=n.sort((r,o)=>o.activationLevel-r.activationLevel).slice(0,i));let a=[];for(let r=0;r<n.length;r++)for(let o=r+1;o<n.length;o++){let s=n[r],c=n[o],p=Math.sqrt(s.activationLevel*c.activationLevel),d=this.graph.getEdge(s.id,c.id),l=this.graph.getEdge(c.id,s.id),u=d!==void 0||l!==void 0,m=d?.weight??l?.weight??0,v=!u||m<.3;p>.3&&(a.push({source:s,target:c,coActivation:p,isNovel:v}),this.trackCoActivation(s.id,c.id))}return a.sort((r,o)=>r.isNovel!==o.isNovel?r.isNovel?-1:1:o.coActivation-r.coActivation).slice(0,10)}async reset(){let e=this.graph.getAllConcepts(0);for(let t of e)this.graph.setActivation(t.id,0);this.activationHistory.clear(),this.coActivationCounts.clear()}getConfig(){return{...this.config}}trimActivationHistory(){if(this.activationHistory.size<=B)return;let e=Math.floor(B*F),t=this.activationHistory.size-e,n=Array.from(this.activationHistory.keys()).slice(0,t);for(let i of n)this.activationHistory.delete(i)}trimCoActivationCounts(){if(this.coActivationCounts.size<=O)return;let e=Math.floor(O*F),t=this.coActivationCounts.size-e,n=Array.from(this.coActivationCounts.values()),i=Z(n,t-1),a=[];for(let[r,o]of this.coActivationCounts){if(a.length>=t)break;o<=i&&a.push(r)}for(let r of a)this.coActivationCounts.delete(r)}trimHistory(){this.trimActivationHistory(),this.trimCoActivationCounts()}getHistorySizes(){return{activationHistorySize:this.activationHistory.size,coActivationCountsSize:this.coActivationCounts.size}}async spreadIteration(){let e=this.graph.getActiveNodes(this.config.threshold),t=0,n=[];for(let i of e){let a=this.graph.getEdges(i.id);for(let r of a){let o=this.graph.getConcept(r.target);if(!o)continue;let s=i.activationLevel*r.weight*this.config.spreadFactor;if(s>.01){let c=o.activationLevel,p=Math.min(1,c+s);n.push({nodeId:r.target,newActivation:p})}}}for(let i of n){let a=this.graph.getConcept(i.nodeId);a&&i.newActivation>a.activationLevel&&(this.graph.setActivation(i.nodeId,i.newActivation),this.recordActivation(i.nodeId,i.newActivation),t++)}return this.applyDecay(),this.injectNoise(),t}applyDecay(){let e=1-this.config.decayRate;this.graph.decayActivations(e)}injectNoise(){if(this.config.noiseLevel<=0)return;let e=this.graph.getAllConcepts(0);for(let t of e)if(t.activationLevel>0){let n=(R()-.5)*2*this.config.noiseLevel,i=Math.max(0,Math.min(1,t.activationLevel+n));this.graph.setActivation(t.id,i)}}recordActivation(e,t){let n=this.activationHistory.get(e)||[];n.push(t),n.length>50&&n.shift(),this.activationHistory.set(e,n)}trackCoActivation(e,t){let n=[e,t].sort().join(":"),i=this.coActivationCounts.get(n)||0;this.coActivationCounts.set(n,i+1)}deduplicateAssociations(e){let t=new Map;for(let n of e){let i=[n.source,n.target].sort().join(":"),a=t.get(i);(!a||n.strength>a.strength)&&t.set(i,n)}return Array.from(t.values()).sort((n,i)=>i.strength-n.strength)}sleep(e){return new Promise(t=>setTimeout(t,e))}};import{randomUUID as ee}from"crypto";var Q={minNoveltyScore:.3,minConfidence:.5,maxInsightsPerCycle:10},I=class{graph;config;constructor(e,t={}){this.graph=e,this.config={...Q,...t}}async generateFromActivation(e,t){let n=[],i=t.activatedNodes.map(c=>this.graph.getConcept(c.nodeId)).filter(c=>c!==void 0);if(i.length<2)return[];let a=await this.detectPatternMerges(i);for(let c of a)c.cycleId=e,n.push(c);let r=await this.detectNovelAssociations(t.novelAssociations);for(let c of r)c.cycleId=e,n.push(c);let o=await this.detectOptimizations(i);for(let c of o)c.cycleId=e,n.push(c);let s=await this.detectGaps(i);for(let c of s)c.cycleId=e,n.push(c);return n.filter(c=>c.noveltyScore>=this.config.minNoveltyScore).sort((c,p)=>p.noveltyScore-c.noveltyScore).slice(0,this.config.maxInsightsPerCycle)}async detectPatternMerges(e){let t=[],n=e.filter(i=>i.conceptType==="pattern"||i.conceptType==="technique");if(n.length<2)return t;for(let i=0;i<n.length;i++)for(let a=i+1;a<n.length;a++){let r=n[i],o=n[a],s=this.graph.getEdge(r.id,o.id),c=this.graph.getEdge(o.id,r.id),p=Math.max(s?.weight??0,c?.weight??0),d=this.calculateContentSimilarity(r.content,o.content),l=Math.sqrt(r.activationLevel*o.activationLevel),u=p*.4+d*.3+l*.3;if(u>.5){let m=this.calculateNovelty({type:"pattern_merge",sourceConcepts:[r.id,o.id]}),v=this.calculateConfidence({type:"pattern_merge",sourceConcepts:[r.id,o.id],edgeWeight:p,contentSimilarity:d,coActivation:l});t.push({id:this.generateId(),cycleId:"",type:"pattern_merge",sourceConcepts:[r.id,o.id],description:this.generatePatternMergeDescription(r,o,u),noveltyScore:m,confidenceScore:v,actionable:v>=this.config.minConfidence,applied:!1,suggestedAction:v>=this.config.minConfidence?`Merge "${this.truncate(r.content,30)}" with "${this.truncate(o.content,30)}" into a unified pattern.`:void 0,createdAt:new Date})}}return t}async detectNovelAssociations(e){let t=[];for(let n of e){let i=this.graph.getConcept(n.source),a=this.graph.getConcept(n.target);if(!i||!a)continue;let r=this.graph.getEdge(n.source,n.target);if(r&&r.weight>.5)continue;let o=i.conceptType!==a.conceptType,s=this.calculateNovelty({type:"novel_association",sourceConcepts:[n.source,n.target],isCrossDomain:o,strength:n.strength}),c=this.calculateConfidence({type:"novel_association",sourceConcepts:[n.source,n.target],coActivation:n.strength,isCrossDomain:o});t.push({id:this.generateId(),cycleId:"",type:"novel_association",sourceConcepts:[n.source,n.target],description:this.generateNovelAssociationDescription(i,a,n.strength,o),noveltyScore:s,confidenceScore:c,actionable:c>=this.config.minConfidence,applied:!1,suggestedAction:c>=this.config.minConfidence?`Investigate connection between "${this.truncate(i.content,25)}" and "${this.truncate(a.content,25)}".`:void 0,createdAt:new Date})}return t}async detectOptimizations(e){let t=[];for(let n of e){if(n.conceptType!=="pattern"&&n.conceptType!=="technique")continue;let i=n.metadata??{},a=i.successRate,r=i.executionCount,o=i.confidence,s=a!==void 0&&a<.7,c=r!==void 0&&r>10,p=o!==void 0&&o<.6;if(s||c&&p){let d=this.calculateNovelty({type:"optimization",sourceConcepts:[n.id],hasLowSuccess:s,hasHighUsage:c}),l=this.calculateConfidence({type:"optimization",sourceConcepts:[n.id],hasLowSuccess:s,hasHighUsage:c,metadata:i});t.push({id:this.generateId(),cycleId:"",type:"optimization",sourceConcepts:[n.id],description:this.generateOptimizationDescription(n,a,r),noveltyScore:d,confidenceScore:l,actionable:l>=this.config.minConfidence,applied:!1,suggestedAction:l>=this.config.minConfidence?`Review and optimize "${this.truncate(n.content,40)}" to improve success rate.`:void 0,createdAt:new Date})}}return t}async detectGaps(e){let t=[],n={pattern:[],technique:[],domain:[],outcome:[],error:[]};for(let i of e){let a=i.conceptType??"pattern";n[a]||(n[a]=[]),n[a].push(i)}for(let i of n.error??[])if(!this.graph.getEdges(i.id).some(o=>{let s=this.graph.getConcept(o.target);return s&&(s.conceptType==="pattern"||s.conceptType==="technique")})){let o=this.calculateNovelty({type:"gap_detection",sourceConcepts:[i.id],gapType:"missing_resolution"}),s=this.calculateConfidence({type:"gap_detection",sourceConcepts:[i.id],gapType:"missing_resolution"});t.push({id:this.generateId(),cycleId:"",type:"gap_detection",sourceConcepts:[i.id],description:`No resolution pattern found for error: "${this.truncate(i.content,50)}". Consider creating a fix pattern.`,noveltyScore:o,confidenceScore:s,actionable:!0,applied:!1,suggestedAction:`Create a resolution pattern for: "${this.truncate(i.content,40)}".`,createdAt:new Date})}for(let i of n.outcome??[])if(!this.graph.getEdges(i.id).some(o=>{let s=this.graph.getConcept(o.target);return s&&s.conceptType==="technique"})&&(n.technique?.length??0)===0){let o=this.calculateNovelty({type:"gap_detection",sourceConcepts:[i.id],gapType:"missing_technique"}),s=this.calculateConfidence({type:"gap_detection",sourceConcepts:[i.id],gapType:"missing_technique"});t.push({id:this.generateId(),cycleId:"",type:"gap_detection",sourceConcepts:[i.id],description:`Outcome "${this.truncate(i.content,40)}" has no associated technique. Document how this outcome is achieved.`,noveltyScore:o,confidenceScore:s,actionable:!0,applied:!1,suggestedAction:`Document the technique for achieving: "${this.truncate(i.content,35)}".`,createdAt:new Date})}return t}calculateNovelty(e){let t=.5;if(e.isCrossDomain&&(t+=.2),e.strength!==void 0&&e.strength>.5&&(t+=.15),e.type==="gap_detection"&&(t+=.2),e.hasHighUsage&&e.hasLowSuccess&&(t+=.15),e.sourceConcepts.length>=2){let n=this.graph.getEdge(e.sourceConcepts[0],e.sourceConcepts[1]);n?n.weight<.3&&(t+=.05):t+=.1}return Math.min(1,Math.max(0,t))}calculateConfidence(e){let t=.4;if(e.coActivation!==void 0&&(t+=e.coActivation*.3),e.edgeWeight!==void 0&&(t+=e.edgeWeight*.2),e.contentSimilarity!==void 0&&e.type==="pattern_merge"&&(t+=e.contentSimilarity*.2),e.isCrossDomain&&(t-=.1),e.hasHighUsage&&e.hasLowSuccess&&(t+=.15),e.metadata){let n=Math.min(Object.keys(e.metadata).length*.05,.15);t+=n}return e.gapType&&(t+=.1),Math.min(1,Math.max(0,t))}async insightToPattern(e){if(!e.actionable)return null;let t=e.sourceConcepts.map(n=>this.graph.getConcept(n)).filter(n=>n!==void 0);if(t.length===0)return null;switch(e.type){case"pattern_merge":{let[n,i]=t;return{name:`Merged: ${this.truncate(n?.content??"",20)} + ${this.truncate(i?.content??"",20)}`,description:e.description,template:{type:"merged_pattern",sourcePatterns:e.sourceConcepts,mergedContent:t.map(a=>a.content).join(" | "),metadata:{noveltyScore:e.noveltyScore,confidenceScore:e.confidenceScore,createdFrom:"dream_insight"}}}}case"novel_association":{let[n,i]=t;return{name:`Association: ${n?.conceptType} - ${i?.conceptType}`,description:e.description,template:{type:"association_pattern",source:{id:n?.id,type:n?.conceptType,content:n?.content},target:{id:i?.id,type:i?.conceptType,content:i?.content},metadata:{noveltyScore:e.noveltyScore,confidenceScore:e.confidenceScore,createdFrom:"dream_insight"}}}}case"optimization":{let[n]=t;return{name:`Optimized: ${this.truncate(n?.content??"",30)}`,description:e.description,template:{type:"optimization_pattern",originalPattern:n?.id,suggestedAction:e.suggestedAction,metadata:{noveltyScore:e.noveltyScore,confidenceScore:e.confidenceScore,createdFrom:"dream_insight"}}}}case"gap_detection":{let[n]=t;return{name:`Gap Fill: ${this.truncate(n?.content??"",30)}`,description:e.description,template:{type:"gap_fill_pattern",relatedConcept:n?.id,gapType:n?.conceptType==="error"?"missing_resolution":"missing_technique",suggestedAction:e.suggestedAction,metadata:{noveltyScore:e.noveltyScore,confidenceScore:e.confidenceScore,createdFrom:"dream_insight"}}}}default:return null}}generateId(){let e=Date.now(),t=ee().slice(0,8);return`insight-${e}-${t}`}calculateContentSimilarity(e,t){let n=e.toLowerCase().split(/\s+/),i=t.toLowerCase().split(/\s+/),a=new Set(n),r=new Set(i),o=n.filter(c=>r.has(c)),s=a.size+r.size-o.length;return s===0?0:o.length/s}truncate(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}generatePatternMergeDescription(e,t,n){return`Pattern merge opportunity (${Math.round(n*100)}% match): "${this.truncate(e.content,40)}" and "${this.truncate(t.content,40)}" share similar structure and could be combined.`}generateNovelAssociationDescription(e,t,n,i){let a=Math.round(n*100);return`Novel association discovered${i?" (cross-domain)":""}: [${e.conceptType}] "${this.truncate(e.content,30)}" is connected to [${t.conceptType}] "${this.truncate(t.content,30)}" with ${a}% co-activation strength.`}generateOptimizationDescription(e,t,n){let i=[`Optimization opportunity for "${this.truncate(e.content,40)}":`];return t!==void 0&&i.push(`Success rate is ${Math.round(t*100)}%.`),n!==void 0&&i.push(`Used ${n} times.`),i.push("Consider reviewing and improving this pattern."),i.join(" ")}getConfig(){return{...this.config}}};H();k();$();import{existsSync as te,unlinkSync as ne}from"fs";var T={maxPatternCountDrop:.05,maxAvgConfidenceDrop:.02,maxHighConfidenceLoss:.05},C=class{constructor(e,t=T){this.db=e;this.thresholds=t}activeBranches=new Map;listeners=[];rvfAdapter;useRvfFork=!1;_witnessChain=null;set witnessChain(e){this._witnessChain=e}setRvfAdapter(e,t=!0){this.rvfAdapter=e,this.useRvfFork=t,import("./feature-flags-GIGWUPEX.js").then(({isRVFPatternStoreEnabled:n})=>{this.useRvfFork=n()}).catch(()=>{})}createBranch(e){if(this.activeBranches.has(e))throw new Error(`Branch '${e}' already exists`);let t=this.sanitizeSavepointName(e),n=this.captureBaseline();this.db.exec(`SAVEPOINT "${t}"`);let i={name:e,createdAt:new Date,status:"active",baselineSnapshot:n};if(this.rvfAdapter&&this.useRvfFork)try{let a=`/tmp/dream-branch-${t}.rvf`,r=this.rvfAdapter.derive(a),o=i;o._rvfBranchPath=a,o._rvfChildAdapter=r}catch{}return this.activeBranches.set(e,i),this.emit("dream:branch_created",i),i}validateBranch(e,t){this.ensureBranchActive(e.name);let n=t??e.baselineSnapshot,i=this.captureBaseline(),a=i.patternCount-n.patternCount,r=i.avgConfidence-n.avgConfidence,o=n.highConfidenceCount-i.highConfidenceCount,s=[],c=!0;if(n.patternCount>0){let d=-a/n.patternCount;d>this.thresholds.maxPatternCountDrop&&(c=!1,s.push(`Pattern count dropped by ${(d*100).toFixed(1)}% (threshold: ${(this.thresholds.maxPatternCountDrop*100).toFixed(1)}%)`))}if(r<-this.thresholds.maxAvgConfidenceDrop&&(c=!1,s.push(`Avg confidence dropped by ${(-r).toFixed(4)} (threshold: ${this.thresholds.maxAvgConfidenceDrop})`)),n.highConfidenceCount>0&&o>0){let d=o/n.highConfidenceCount;d>this.thresholds.maxHighConfidenceLoss&&(c=!1,s.push(`${o} high-confidence patterns lost (${(d*100).toFixed(1)}%, threshold: ${(this.thresholds.maxHighConfidenceLoss*100).toFixed(1)}%)`))}if(this.rvfAdapter&&this.useRvfFork&&n.patternCount>0)try{let d=this.rvfAdapter.dimension?.()??384,l=new Float32Array(d);for(let m=0;m<d;m++)l[m]=Math.sin(m*.1);let u=this.rvfAdapter.search?.(l,10)??[];u.length<Math.min(5,n.patternCount)&&s.push(`Search recall degraded: only ${u.length} results returned (expected \u2265${Math.min(5,n.patternCount)})`)}catch{}let p=c?"All quality checks passed":`Validation failed: ${s.join("; ")}`;return{passed:c,reason:p,patternCountDelta:a,avgConfidenceDelta:r,highConfidenceLost:Math.max(0,o),postDreamMetrics:i}}mergeBranch(e){this.ensureBranchActive(e.name);let t=this.sanitizeSavepointName(e.name);this.db.exec(`RELEASE SAVEPOINT "${t}"`),e.status="merged",this.activeBranches.delete(e.name),this.cleanupRvfBranch(e),this.emit("dream:branch_merged",e);try{this._witnessChain?.append("BRANCH_MERGE",{branchName:e.name},"rvcow-branch-manager")}catch{}}discardBranch(e){this.ensureBranchActive(e.name);let t=this.sanitizeSavepointName(e.name);this.db.exec(`ROLLBACK TO SAVEPOINT "${t}"`),this.db.exec(`RELEASE SAVEPOINT "${t}"`),e.status="discarded",this.activeBranches.delete(e.name),this.cleanupRvfBranch(e),this.emit("dream:branch_discarded",e)}listBranches(){return Array.from(this.activeBranches.values())}onEvent(e){this.listeners.push(e)}offEvent(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}captureBaseline(){let e=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get(),t=this.db.prepare("SELECT AVG(confidence) as avg_conf FROM qe_patterns").get(),n=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns WHERE confidence >= 0.8").get();return{patternCount:e?.cnt??0,avgConfidence:t?.avg_conf??0,highConfidenceCount:n?.cnt??0,capturedAt:new Date}}ensureBranchActive(e){let t=this.activeBranches.get(e);if(!t)throw new Error(`Branch '${e}' not found or not active`);if(t.status!=="active")throw new Error(`Branch '${e}' is ${t.status}, not active`)}cleanupRvfBranch(e){let t=e;try{t._rvfChildAdapter?.close?.()}catch{}try{let n=t._rvfBranchPath;n&&te(n)&&ne(n)}catch{}}sanitizeSavepointName(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")}emit(e,t,n){for(let i of this.listeners)try{i(e,t,n)}catch{}}};var x=N.create("dream-engine"),X={maxDurationMs:3e4,minConceptsRequired:10,activationConfig:{decayRate:.1,spreadFactor:.5,threshold:.1,maxIterations:20,noiseLevel:.05},insightConfig:{minNoveltyScore:.3,minConfidence:.5,maxInsightsPerCycle:10},enableBranching:!0,branchValidationThresholds:{...T}},z=class{constructor(e){this.graph=e}nodeCache=new Map;edgeCache=new Map;activationLevels=new Map;async loadIntoMemory(e){this.nodeCache.clear(),this.edgeCache.clear(),this.activationLevels.clear();let t=await this.graph.getActiveNodes(0);e&&t.length>e&&(t=t.sort((n,i)=>i.activationLevel-n.activationLevel).slice(0,e));for(let n of t)this.nodeCache.set(n.id,n),this.activationLevels.set(n.id,n.activationLevel);for(let n of t){let a=(await this.graph.getNeighbors(n.id)).map(r=>r.edge);this.edgeCache.set(n.id,a)}}async persistActivations(){let e=Array.from(this.activationLevels.entries());for(let[t,n]of e)await this.graph.updateActivation(t,n)}getConcept(e){let t=this.nodeCache.get(e);if(t)return{...t,activationLevel:this.activationLevels.get(e)??t.activationLevel}}getAllConcepts(e){let t=e??0;return Array.from(this.nodeCache.values()).map(n=>({...n,activationLevel:this.activationLevels.get(n.id)??n.activationLevel})).filter(n=>n.activationLevel>=t)}getActiveNodes(e){return this.getAllConcepts(e)}getEdges(e){return this.edgeCache.get(e)??[]}getEdge(e,t){return(this.edgeCache.get(e)??[]).find(i=>i.target===t)}setActivation(e,t){this.activationLevels.set(e,Math.max(0,Math.min(1,t)))}decayActivations(e){let t=Array.from(this.activationLevels.entries());for(let[n,i]of t)this.activationLevels.set(n,i*e)}getStats(){let e=Array.from(this.nodeCache.values()),t={pattern:0,technique:0,domain:0,outcome:0,error:0},n=0;for(let r of e)t[r.conceptType]=(t[r.conceptType]??0)+1,n+=this.activationLevels.get(r.id)??r.activationLevel;let i=0,a=Array.from(this.edgeCache.values());for(let r of a)i+=r.length;return{nodeCount:e.length,edgeCount:i,byType:t,avgEdgesPerNode:e.length>0?i/e.length:0,avgActivation:e.length>0?n/e.length:0}}},_=class{config;persistence=null;graph=null;db=null;branchManager=null;currentCycle=null;initialized=!1;cancelled=!1;branchEventListeners=[];_witnessChain=null;set witnessChain(e){this._witnessChain=e}_rvfAdapter=null;set rvfAdapter(e){this._rvfAdapter=e}constructor(e){this.config={...X,...e}}async initialize(){if(!this.initialized)try{this.persistence=M(),this.persistence.isInitialized()||await this.persistence.initialize(),this.db=this.persistence.getDatabase(),this.migrateSchema(),this.graph=new A,await this.graph.initialize(),this.config.enableBranching&&(this.branchManager=new C(this.db,this.config.branchValidationThresholds),this._rvfAdapter&&(this.branchManager.setRvfAdapter(this._rvfAdapter,!0),console.log("[DreamEngine] RVF COW branching activated (ADR-069)"))),this.initialized=!0,console.log(`[DreamEngine] Initialized: ${this.persistence.getDbPath()}`)}catch(e){throw new Error(`Failed to initialize DreamEngine: ${E(e)}`)}}migrateSchema(){if(this.db)try{let e=this.db.prepare("PRAGMA table_info(dream_cycles)").all(),t=e.some(s=>s.name==="duration_ms"),n=e.some(s=>s.name==="duration");!t&&n&&this.db.exec("ALTER TABLE dream_cycles RENAME COLUMN duration TO duration_ms");let i=this.db.prepare("PRAGMA table_info(dream_insights)").all(),a=new Set(i.map(s=>s.name)),r=a.has("insight_type"),o=a.has("source_concepts");if(!r)try{this.db.exec("ALTER TABLE dream_insights ADD COLUMN insight_type TEXT NOT NULL DEFAULT 'general'"),x.info("Added insight_type column to dream_insights (safe migration)")}catch{}if(!o)try{this.db.exec("ALTER TABLE dream_insights ADD COLUMN source_concepts TEXT NOT NULL DEFAULT '[]'"),x.info("Added source_concepts column to dream_insights (safe migration)")}catch{}this.db.exec("CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id)"),this.db.exec("CREATE INDEX IF NOT EXISTS idx_insight_type ON dream_insights(insight_type)"),this.db.exec("CREATE INDEX IF NOT EXISTS idx_insight_novelty ON dream_insights(novelty_score DESC)")}catch(e){x.debug("Dream schema migration skipped",{error:e instanceof Error?e.message:String(e)})}}async dream(e){this.ensureInitialized(),this.cancelled=!1;let t=e??this.config.maxDurationMs,n=Date.now();this.currentCycle={id:y(),startTime:new Date,conceptsProcessed:0,associationsFound:0,insightsGenerated:0,status:"running"},await this.saveCycle(this.currentCycle);let i=null;if(this.branchManager){let a=`dream-${this.currentCycle.id}-${Date.now()}`;i=this.branchManager.createBranch(a),this.emitBranchEvent("dream:branch_created",i)}try{let a=await this.graph.getActiveNodes(0);if(a.length<this.config.minConceptsRequired)throw new Error(`Insufficient concepts: ${a.length} < ${this.config.minConceptsRequired}`);let r=new z(this.graph);await r.loadIntoMemory(30);let s=await new S(r,this.config.activationConfig).dream(t);if(this.cancelled)throw this.currentCycle.status="interrupted",this.currentCycle.endTime=new Date,this.currentCycle.durationMs=Date.now()-n,await this.updateCycle(this.currentCycle),new Error("Dream cycle cancelled");this.currentCycle.conceptsProcessed=s.nodesActivated,this.currentCycle.associationsFound=s.novelAssociations.length,await r.persistActivations();let p=await new I(r,this.config.insightConfig).generateFromActivation(this.currentCycle.id,s);this.currentCycle.insightsGenerated=p.length;for(let l of p)await this.saveInsight(l);if(this.currentCycle.endTime=new Date,this.currentCycle.durationMs=Date.now()-n,this.currentCycle.status="completed",await this.updateCycle(this.currentCycle),i&&this.branchManager){let l=this.branchManager.validateBranch(i);if(l.passed){this.branchManager.mergeBranch(i),this.emitBranchEvent("dream:branch_merged",i,l);try{this._witnessChain?.append("DREAM_MERGE",{cycleId:this.currentCycle.id,branchName:i.name},"dream-engine")}catch{}}else{this.branchManager.discardBranch(i),this.emitBranchEvent("dream:branch_discarded",i,l);try{this._witnessChain?.append("DREAM_DISCARD",{cycleId:this.currentCycle.id,branchName:i.name,reason:l.reason},"dream-engine")}catch{}x.warn("Dream branch discarded: quality validation failed",{cycleId:this.currentCycle.id,reason:l.reason})}i=null}let d={cycle:{...this.currentCycle},insights:p,activationStats:{totalIterations:s.iterations,peakActivation:s.peakActivation,nodesActivated:s.nodesActivated},patternsCreated:0};return this.currentCycle=null,d}catch(a){if(i&&this.branchManager)try{this.branchManager.discardBranch(i),this.emitBranchEvent("dream:branch_discarded",i)}catch{}throw this.currentCycle&&(this.currentCycle.status==="running"&&(this.currentCycle.status="failed"),this.currentCycle.error=E(a),this.currentCycle.endTime=new Date,this.currentCycle.durationMs=Date.now()-n,await this.updateCycle(this.currentCycle)),this.currentCycle=null,a}}async loadPatternsAsConcepts(e){return this.ensureInitialized(),this.graph.loadFromPatterns(e)}async ensureConceptsLoaded(){if(this.ensureInitialized(),(await this.graph.getActiveNodes(0)).length>=this.config.minConceptsRequired)return 0;let t=this.db.prepare(`SELECT id, name, description, qe_domain as domain, pattern_type as patternType,
|
|
62
|
+
`).run(s,e);a+=c.changes}return a})(),n>0&&console.log(`[ConceptGraph] Pruned ${n} edges (maxPerNode=${e}, minWeight=${t})`),n}async getStats(){this.ensureInitialized();let e=this.prepared.get("countNodes"),t=this.prepared.get("countEdges"),n=this.prepared.get("countByType");if(!e||!t||!n)throw new Error("Prepared statements not found");let i=e.get().count,a=t.get().count,r={pattern:0,technique:0,domain:0,outcome:0,error:0},o=n.all();for(let c of o)r[c.concept_type]=c.count;let s=0;return i>0&&(s=this.db.prepare("SELECT AVG(activation_level) as avg FROM concept_nodes").get().avg||0),{nodeCount:i,edgeCount:a,byType:r,avgEdgesPerNode:i>0?a/i:0,avgActivation:s}}async close(){this.prepared.clear(),this.db=null,this.persistence=null,this.initialized=!1}ensureInitialized(){if(!this.initialized||!this.db)throw new Error("ConceptGraph not initialized. Call initialize() first.")}async getEdgeBetween(e,t){let n=this.prepared.get("getEdge");if(!n)throw new Error("Prepared statement not found: getEdge");let i=n.get(e,t);return i?this.rowToEdge(i):null}async findDomainNode(e){if(!this.db)return null;let n=this.db.prepare("SELECT * FROM concept_nodes WHERE concept_type = 'domain' AND content = ?").get(e);return n?this.rowToNode(n):null}async findNodeByPatternId(e){if(!this.db)return null;let n=this.db.prepare("SELECT * FROM concept_nodes WHERE pattern_id = ? LIMIT 1").get(e);return n?this.rowToNode(n):null}rowToNode(e){let t;if(e.embedding){let n=e.embedding,i=new Float32Array(n.buffer,n.byteOffset,n.byteLength/4);t=Array.from(i)}return{id:e.id,conceptType:e.concept_type,content:e.content,embedding:t,activationLevel:e.activation_level||0,lastActivated:e.last_activated?new Date(e.last_activated):void 0,patternId:e.pattern_id||void 0,metadata:e.metadata?D(e.metadata):void 0,createdAt:e.created_at?new Date(e.created_at):void 0}}rowToEdge(e){return{id:e.id,source:e.source,target:e.target,weight:e.weight,edgeType:e.edge_type,evidence:e.evidence,createdAt:e.created_at?new Date(e.created_at):void 0,updatedAt:e.updated_at?new Date(e.updated_at):void 0}}};function K(h){return new A(h)}J();function Z(h,e){if(e<0||e>=h.length)return h[0]??0;let t=0,n=h.length-1;for(;t<n;){let i=t+n>>1;if(h[i]<h[t]){let s=h[t];h[t]=h[i],h[i]=s}if(h[n]<h[t]){let s=h[t];h[t]=h[n],h[n]=s}if(h[i]<h[n]){let s=h[i];h[i]=h[n],h[n]=s}let a=h[n],r=t;for(let s=t;s<n;s++)if(h[s]<=a){let c=h[r];h[r]=h[s],h[s]=c,r++}let o=h[r];if(h[r]=h[n],h[n]=o,r===e)return h[r];r<e?t=r+1:n=r-1}return h[t]}var B=1e4,O=5e4,F=.8,j={decayRate:.1,spreadFactor:.5,threshold:.1,maxIterations:20,noiseLevel:.05},S=class{graph;config;activationHistory=new Map;coActivationCounts=new Map;constructor(e,t={}){this.graph=e,this.config={...j,...t}}async spread(e,t=1,n){let i=e.filter(d=>this.graph.getConcept(d)!==void 0);if(i.length===0)return{iterations:0,nodesActivated:0,peakActivation:0,activatedNodes:[],novelAssociations:[]};for(let d of i)this.graph.setActivation(d,t),this.recordActivation(d,t);let a=0,r=t,o=0,s=0;for(;a<this.config.maxIterations&&!(n!==void 0&&Date.now()>=n);){let d=await this.spreadIteration(),l=this.graph.getActiveNodes(this.config.threshold);for(let u of l)u.activationLevel>r&&(r=u.activationLevel);if(l.length===o&&d===0){if(s++,s>=3)break}else s=0;o=l.length,a++}let c=this.graph.getActiveNodes(this.config.threshold).map(d=>({nodeId:d.id,activation:d.activationLevel})).sort((d,l)=>l.activation-d.activation),p=await this.findNovelAssociations(this.config.threshold);return this.trimHistory(),{iterations:a,nodesActivated:c.length,peakActivation:r,activatedNodes:c,novelAssociations:p.map(d=>({source:d.source.id,target:d.target.id,strength:d.coActivation}))}}async dream(e){let t=Date.now(),n=[],i=0,a=0,r=new Set,o=this.graph.getAllConcepts(0);if(o.length===0)return{iterations:0,nodesActivated:0,peakActivation:0,activatedNodes:[],novelAssociations:[]};let s=t+e;for(;Date.now()<s;){let d=U(0,o.length),l=o[d];if(l){let u=this.config.noiseLevel+R()*this.config.noiseLevel*2,m=l.activationLevel,v=Math.min(1,m+u+.3);this.graph.setActivation(l.id,v);let f=await this.spread([l.id],v,s);i+=f.iterations,f.peakActivation>a&&(a=f.peakActivation);for(let b of f.activatedNodes)r.add(b.nodeId);for(let b of f.novelAssociations)n.push(b)}if(Date.now()>=s)break;await this.sleep(50+R()*50)}let c=this.deduplicateAssociations(n),p=Array.from(r).map(d=>{let l=this.graph.getConcept(d);return{nodeId:d,activation:l?.activationLevel??0}}).filter(d=>d.activation>0).sort((d,l)=>l.activation-d.activation);return this.trimHistory(),{iterations:i,nodesActivated:p.length,peakActivation:a,activatedNodes:p,novelAssociations:c.slice(0,20)}}async findNovelAssociations(e){let t=e??this.config.threshold,n=this.graph.getActiveNodes(t);if(n.length<2)return[];let i=200;n.length>i&&(n=n.sort((r,o)=>o.activationLevel-r.activationLevel).slice(0,i));let a=[];for(let r=0;r<n.length;r++)for(let o=r+1;o<n.length;o++){let s=n[r],c=n[o],p=Math.sqrt(s.activationLevel*c.activationLevel),d=this.graph.getEdge(s.id,c.id),l=this.graph.getEdge(c.id,s.id),u=d!==void 0||l!==void 0,m=d?.weight??l?.weight??0,v=!u||m<.3;p>.3&&(a.push({source:s,target:c,coActivation:p,isNovel:v}),this.trackCoActivation(s.id,c.id))}return a.sort((r,o)=>r.isNovel!==o.isNovel?r.isNovel?-1:1:o.coActivation-r.coActivation).slice(0,10)}async reset(){let e=this.graph.getAllConcepts(0);for(let t of e)this.graph.setActivation(t.id,0);this.activationHistory.clear(),this.coActivationCounts.clear()}getConfig(){return{...this.config}}trimActivationHistory(){if(this.activationHistory.size<=B)return;let e=Math.floor(B*F),t=this.activationHistory.size-e,n=Array.from(this.activationHistory.keys()).slice(0,t);for(let i of n)this.activationHistory.delete(i)}trimCoActivationCounts(){if(this.coActivationCounts.size<=O)return;let e=Math.floor(O*F),t=this.coActivationCounts.size-e,n=Array.from(this.coActivationCounts.values()),i=Z(n,t-1),a=[];for(let[r,o]of this.coActivationCounts){if(a.length>=t)break;o<=i&&a.push(r)}for(let r of a)this.coActivationCounts.delete(r)}trimHistory(){this.trimActivationHistory(),this.trimCoActivationCounts()}getHistorySizes(){return{activationHistorySize:this.activationHistory.size,coActivationCountsSize:this.coActivationCounts.size}}async spreadIteration(){let e=this.graph.getActiveNodes(this.config.threshold),t=0,n=[];for(let i of e){let a=this.graph.getEdges(i.id);for(let r of a){let o=this.graph.getConcept(r.target);if(!o)continue;let s=i.activationLevel*r.weight*this.config.spreadFactor;if(s>.01){let c=o.activationLevel,p=Math.min(1,c+s);n.push({nodeId:r.target,newActivation:p})}}}for(let i of n){let a=this.graph.getConcept(i.nodeId);a&&i.newActivation>a.activationLevel&&(this.graph.setActivation(i.nodeId,i.newActivation),this.recordActivation(i.nodeId,i.newActivation),t++)}return this.applyDecay(),this.injectNoise(),t}applyDecay(){let e=1-this.config.decayRate;this.graph.decayActivations(e)}injectNoise(){if(this.config.noiseLevel<=0)return;let e=this.graph.getAllConcepts(0);for(let t of e)if(t.activationLevel>0){let n=(R()-.5)*2*this.config.noiseLevel,i=Math.max(0,Math.min(1,t.activationLevel+n));this.graph.setActivation(t.id,i)}}recordActivation(e,t){let n=this.activationHistory.get(e)||[];n.push(t),n.length>50&&n.shift(),this.activationHistory.set(e,n)}trackCoActivation(e,t){let n=[e,t].sort().join(":"),i=this.coActivationCounts.get(n)||0;this.coActivationCounts.set(n,i+1)}deduplicateAssociations(e){let t=new Map;for(let n of e){let i=[n.source,n.target].sort().join(":"),a=t.get(i);(!a||n.strength>a.strength)&&t.set(i,n)}return Array.from(t.values()).sort((n,i)=>i.strength-n.strength)}sleep(e){return new Promise(t=>setTimeout(t,e))}};import{randomUUID as ee}from"crypto";var Q={minNoveltyScore:.3,minConfidence:.5,maxInsightsPerCycle:10},I=class{graph;config;constructor(e,t={}){this.graph=e,this.config={...Q,...t}}async generateFromActivation(e,t){let n=[],i=t.activatedNodes.map(c=>this.graph.getConcept(c.nodeId)).filter(c=>c!==void 0);if(i.length<2)return[];let a=await this.detectPatternMerges(i);for(let c of a)c.cycleId=e,n.push(c);let r=await this.detectNovelAssociations(t.novelAssociations);for(let c of r)c.cycleId=e,n.push(c);let o=await this.detectOptimizations(i);for(let c of o)c.cycleId=e,n.push(c);let s=await this.detectGaps(i);for(let c of s)c.cycleId=e,n.push(c);return n.filter(c=>c.noveltyScore>=this.config.minNoveltyScore).sort((c,p)=>p.noveltyScore-c.noveltyScore).slice(0,this.config.maxInsightsPerCycle)}async detectPatternMerges(e){let t=[],n=e.filter(i=>i.conceptType==="pattern"||i.conceptType==="technique");if(n.length<2)return t;for(let i=0;i<n.length;i++)for(let a=i+1;a<n.length;a++){let r=n[i],o=n[a],s=this.graph.getEdge(r.id,o.id),c=this.graph.getEdge(o.id,r.id),p=Math.max(s?.weight??0,c?.weight??0),d=this.calculateContentSimilarity(r.content,o.content),l=Math.sqrt(r.activationLevel*o.activationLevel),u=p*.4+d*.3+l*.3;if(u>.5){let m=this.calculateNovelty({type:"pattern_merge",sourceConcepts:[r.id,o.id]}),v=this.calculateConfidence({type:"pattern_merge",sourceConcepts:[r.id,o.id],edgeWeight:p,contentSimilarity:d,coActivation:l});t.push({id:this.generateId(),cycleId:"",type:"pattern_merge",sourceConcepts:[r.id,o.id],description:this.generatePatternMergeDescription(r,o,u),noveltyScore:m,confidenceScore:v,actionable:v>=this.config.minConfidence,applied:!1,suggestedAction:v>=this.config.minConfidence?`Merge "${this.truncate(r.content,30)}" with "${this.truncate(o.content,30)}" into a unified pattern.`:void 0,createdAt:new Date})}}return t}async detectNovelAssociations(e){let t=[];for(let n of e){let i=this.graph.getConcept(n.source),a=this.graph.getConcept(n.target);if(!i||!a)continue;let r=this.graph.getEdge(n.source,n.target);if(r&&r.weight>.5)continue;let o=i.conceptType!==a.conceptType,s=this.calculateNovelty({type:"novel_association",sourceConcepts:[n.source,n.target],isCrossDomain:o,strength:n.strength}),c=this.calculateConfidence({type:"novel_association",sourceConcepts:[n.source,n.target],coActivation:n.strength,isCrossDomain:o});t.push({id:this.generateId(),cycleId:"",type:"novel_association",sourceConcepts:[n.source,n.target],description:this.generateNovelAssociationDescription(i,a,n.strength,o),noveltyScore:s,confidenceScore:c,actionable:c>=this.config.minConfidence,applied:!1,suggestedAction:c>=this.config.minConfidence?`Investigate connection between "${this.truncate(i.content,25)}" and "${this.truncate(a.content,25)}".`:void 0,createdAt:new Date})}return t}async detectOptimizations(e){let t=[];for(let n of e){if(n.conceptType!=="pattern"&&n.conceptType!=="technique")continue;let i=n.metadata??{},a=i.successRate,r=i.executionCount,o=i.confidence,s=a!==void 0&&a<.7,c=r!==void 0&&r>10,p=o!==void 0&&o<.6;if(s||c&&p){let d=this.calculateNovelty({type:"optimization",sourceConcepts:[n.id],hasLowSuccess:s,hasHighUsage:c}),l=this.calculateConfidence({type:"optimization",sourceConcepts:[n.id],hasLowSuccess:s,hasHighUsage:c,metadata:i});t.push({id:this.generateId(),cycleId:"",type:"optimization",sourceConcepts:[n.id],description:this.generateOptimizationDescription(n,a,r),noveltyScore:d,confidenceScore:l,actionable:l>=this.config.minConfidence,applied:!1,suggestedAction:l>=this.config.minConfidence?`Review and optimize "${this.truncate(n.content,40)}" to improve success rate.`:void 0,createdAt:new Date})}}return t}async detectGaps(e){let t=[],n={pattern:[],technique:[],domain:[],outcome:[],error:[]};for(let i of e){let a=i.conceptType??"pattern";n[a]||(n[a]=[]),n[a].push(i)}for(let i of n.error??[])if(!this.graph.getEdges(i.id).some(o=>{let s=this.graph.getConcept(o.target);return s&&(s.conceptType==="pattern"||s.conceptType==="technique")})){let o=this.calculateNovelty({type:"gap_detection",sourceConcepts:[i.id],gapType:"missing_resolution"}),s=this.calculateConfidence({type:"gap_detection",sourceConcepts:[i.id],gapType:"missing_resolution"});t.push({id:this.generateId(),cycleId:"",type:"gap_detection",sourceConcepts:[i.id],description:`No resolution pattern found for error: "${this.truncate(i.content,50)}". Consider creating a fix pattern.`,noveltyScore:o,confidenceScore:s,actionable:!0,applied:!1,suggestedAction:`Create a resolution pattern for: "${this.truncate(i.content,40)}".`,createdAt:new Date})}for(let i of n.outcome??[])if(!this.graph.getEdges(i.id).some(o=>{let s=this.graph.getConcept(o.target);return s&&s.conceptType==="technique"})&&(n.technique?.length??0)===0){let o=this.calculateNovelty({type:"gap_detection",sourceConcepts:[i.id],gapType:"missing_technique"}),s=this.calculateConfidence({type:"gap_detection",sourceConcepts:[i.id],gapType:"missing_technique"});t.push({id:this.generateId(),cycleId:"",type:"gap_detection",sourceConcepts:[i.id],description:`Outcome "${this.truncate(i.content,40)}" has no associated technique. Document how this outcome is achieved.`,noveltyScore:o,confidenceScore:s,actionable:!0,applied:!1,suggestedAction:`Document the technique for achieving: "${this.truncate(i.content,35)}".`,createdAt:new Date})}return t}calculateNovelty(e){let t=.5;if(e.isCrossDomain&&(t+=.2),e.strength!==void 0&&e.strength>.5&&(t+=.15),e.type==="gap_detection"&&(t+=.2),e.hasHighUsage&&e.hasLowSuccess&&(t+=.15),e.sourceConcepts.length>=2){let n=this.graph.getEdge(e.sourceConcepts[0],e.sourceConcepts[1]);n?n.weight<.3&&(t+=.05):t+=.1}return Math.min(1,Math.max(0,t))}calculateConfidence(e){let t=.4;if(e.coActivation!==void 0&&(t+=e.coActivation*.3),e.edgeWeight!==void 0&&(t+=e.edgeWeight*.2),e.contentSimilarity!==void 0&&e.type==="pattern_merge"&&(t+=e.contentSimilarity*.2),e.isCrossDomain&&(t-=.1),e.hasHighUsage&&e.hasLowSuccess&&(t+=.15),e.metadata){let n=Math.min(Object.keys(e.metadata).length*.05,.15);t+=n}return e.gapType&&(t+=.1),Math.min(1,Math.max(0,t))}async insightToPattern(e){if(!e.actionable)return null;let t=e.sourceConcepts.map(n=>this.graph.getConcept(n)).filter(n=>n!==void 0);if(t.length===0)return null;switch(e.type){case"pattern_merge":{let[n,i]=t;return{name:`Merged: ${this.truncate(n?.content??"",20)} + ${this.truncate(i?.content??"",20)}`,description:e.description,template:{type:"merged_pattern",sourcePatterns:e.sourceConcepts,mergedContent:t.map(a=>a.content).join(" | "),metadata:{noveltyScore:e.noveltyScore,confidenceScore:e.confidenceScore,createdFrom:"dream_insight"}}}}case"novel_association":{let[n,i]=t;return{name:`Association: ${n?.conceptType} - ${i?.conceptType}`,description:e.description,template:{type:"association_pattern",source:{id:n?.id,type:n?.conceptType,content:n?.content},target:{id:i?.id,type:i?.conceptType,content:i?.content},metadata:{noveltyScore:e.noveltyScore,confidenceScore:e.confidenceScore,createdFrom:"dream_insight"}}}}case"optimization":{let[n]=t;return{name:`Optimized: ${this.truncate(n?.content??"",30)}`,description:e.description,template:{type:"optimization_pattern",originalPattern:n?.id,suggestedAction:e.suggestedAction,metadata:{noveltyScore:e.noveltyScore,confidenceScore:e.confidenceScore,createdFrom:"dream_insight"}}}}case"gap_detection":{let[n]=t;return{name:`Gap Fill: ${this.truncate(n?.content??"",30)}`,description:e.description,template:{type:"gap_fill_pattern",relatedConcept:n?.id,gapType:n?.conceptType==="error"?"missing_resolution":"missing_technique",suggestedAction:e.suggestedAction,metadata:{noveltyScore:e.noveltyScore,confidenceScore:e.confidenceScore,createdFrom:"dream_insight"}}}}default:return null}}generateId(){let e=Date.now(),t=ee().slice(0,8);return`insight-${e}-${t}`}calculateContentSimilarity(e,t){let n=e.toLowerCase().split(/\s+/),i=t.toLowerCase().split(/\s+/),a=new Set(n),r=new Set(i),o=n.filter(c=>r.has(c)),s=a.size+r.size-o.length;return s===0?0:o.length/s}truncate(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}generatePatternMergeDescription(e,t,n){return`Pattern merge opportunity (${Math.round(n*100)}% match): "${this.truncate(e.content,40)}" and "${this.truncate(t.content,40)}" share similar structure and could be combined.`}generateNovelAssociationDescription(e,t,n,i){let a=Math.round(n*100);return`Novel association discovered${i?" (cross-domain)":""}: [${e.conceptType}] "${this.truncate(e.content,30)}" is connected to [${t.conceptType}] "${this.truncate(t.content,30)}" with ${a}% co-activation strength.`}generateOptimizationDescription(e,t,n){let i=[`Optimization opportunity for "${this.truncate(e.content,40)}":`];return t!==void 0&&i.push(`Success rate is ${Math.round(t*100)}%.`),n!==void 0&&i.push(`Used ${n} times.`),i.push("Consider reviewing and improving this pattern."),i.join(" ")}getConfig(){return{...this.config}}};H();k();$();import{existsSync as te,unlinkSync as ne}from"fs";var T={maxPatternCountDrop:.05,maxAvgConfidenceDrop:.02,maxHighConfidenceLoss:.05},C=class{constructor(e,t=T){this.db=e;this.thresholds=t}activeBranches=new Map;listeners=[];rvfAdapter;useRvfFork=!1;_witnessChain=null;set witnessChain(e){this._witnessChain=e}setRvfAdapter(e,t=!0){this.rvfAdapter=e,this.useRvfFork=t,import("./feature-flags-WBF5B6WE.js").then(({isRVFPatternStoreEnabled:n})=>{this.useRvfFork=n()}).catch(()=>{})}createBranch(e){if(this.activeBranches.has(e))throw new Error(`Branch '${e}' already exists`);let t=this.sanitizeSavepointName(e),n=this.captureBaseline();this.db.exec(`SAVEPOINT "${t}"`);let i={name:e,createdAt:new Date,status:"active",baselineSnapshot:n};if(this.rvfAdapter&&this.useRvfFork)try{let a=`/tmp/dream-branch-${t}.rvf`,r=this.rvfAdapter.derive(a),o=i;o._rvfBranchPath=a,o._rvfChildAdapter=r}catch{}return this.activeBranches.set(e,i),this.emit("dream:branch_created",i),i}validateBranch(e,t){this.ensureBranchActive(e.name);let n=t??e.baselineSnapshot,i=this.captureBaseline(),a=i.patternCount-n.patternCount,r=i.avgConfidence-n.avgConfidence,o=n.highConfidenceCount-i.highConfidenceCount,s=[],c=!0;if(n.patternCount>0){let d=-a/n.patternCount;d>this.thresholds.maxPatternCountDrop&&(c=!1,s.push(`Pattern count dropped by ${(d*100).toFixed(1)}% (threshold: ${(this.thresholds.maxPatternCountDrop*100).toFixed(1)}%)`))}if(r<-this.thresholds.maxAvgConfidenceDrop&&(c=!1,s.push(`Avg confidence dropped by ${(-r).toFixed(4)} (threshold: ${this.thresholds.maxAvgConfidenceDrop})`)),n.highConfidenceCount>0&&o>0){let d=o/n.highConfidenceCount;d>this.thresholds.maxHighConfidenceLoss&&(c=!1,s.push(`${o} high-confidence patterns lost (${(d*100).toFixed(1)}%, threshold: ${(this.thresholds.maxHighConfidenceLoss*100).toFixed(1)}%)`))}if(this.rvfAdapter&&this.useRvfFork&&n.patternCount>0)try{let d=this.rvfAdapter.dimension?.()??384,l=new Float32Array(d);for(let m=0;m<d;m++)l[m]=Math.sin(m*.1);let u=this.rvfAdapter.search?.(l,10)??[];u.length<Math.min(5,n.patternCount)&&s.push(`Search recall degraded: only ${u.length} results returned (expected \u2265${Math.min(5,n.patternCount)})`)}catch{}let p=c?"All quality checks passed":`Validation failed: ${s.join("; ")}`;return{passed:c,reason:p,patternCountDelta:a,avgConfidenceDelta:r,highConfidenceLost:Math.max(0,o),postDreamMetrics:i}}mergeBranch(e){this.ensureBranchActive(e.name);let t=this.sanitizeSavepointName(e.name);this.db.exec(`RELEASE SAVEPOINT "${t}"`),e.status="merged",this.activeBranches.delete(e.name),this.cleanupRvfBranch(e),this.emit("dream:branch_merged",e);try{this._witnessChain?.append("BRANCH_MERGE",{branchName:e.name},"rvcow-branch-manager")}catch{}}discardBranch(e){this.ensureBranchActive(e.name);let t=this.sanitizeSavepointName(e.name);this.db.exec(`ROLLBACK TO SAVEPOINT "${t}"`),this.db.exec(`RELEASE SAVEPOINT "${t}"`),e.status="discarded",this.activeBranches.delete(e.name),this.cleanupRvfBranch(e),this.emit("dream:branch_discarded",e)}listBranches(){return Array.from(this.activeBranches.values())}onEvent(e){this.listeners.push(e)}offEvent(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}captureBaseline(){let e=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get(),t=this.db.prepare("SELECT AVG(confidence) as avg_conf FROM qe_patterns").get(),n=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns WHERE confidence >= 0.8").get();return{patternCount:e?.cnt??0,avgConfidence:t?.avg_conf??0,highConfidenceCount:n?.cnt??0,capturedAt:new Date}}ensureBranchActive(e){let t=this.activeBranches.get(e);if(!t)throw new Error(`Branch '${e}' not found or not active`);if(t.status!=="active")throw new Error(`Branch '${e}' is ${t.status}, not active`)}cleanupRvfBranch(e){let t=e;try{t._rvfChildAdapter?.close?.()}catch{}try{let n=t._rvfBranchPath;n&&te(n)&&ne(n)}catch{}}sanitizeSavepointName(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")}emit(e,t,n){for(let i of this.listeners)try{i(e,t,n)}catch{}}};var x=N.create("dream-engine"),X={maxDurationMs:3e4,minConceptsRequired:10,activationConfig:{decayRate:.1,spreadFactor:.5,threshold:.1,maxIterations:20,noiseLevel:.05},insightConfig:{minNoveltyScore:.3,minConfidence:.5,maxInsightsPerCycle:10},enableBranching:!0,branchValidationThresholds:{...T}},z=class{constructor(e){this.graph=e}nodeCache=new Map;edgeCache=new Map;activationLevels=new Map;async loadIntoMemory(e){this.nodeCache.clear(),this.edgeCache.clear(),this.activationLevels.clear();let t=await this.graph.getActiveNodes(0);e&&t.length>e&&(t=t.sort((n,i)=>i.activationLevel-n.activationLevel).slice(0,e));for(let n of t)this.nodeCache.set(n.id,n),this.activationLevels.set(n.id,n.activationLevel);for(let n of t){let a=(await this.graph.getNeighbors(n.id)).map(r=>r.edge);this.edgeCache.set(n.id,a)}}async persistActivations(){let e=Array.from(this.activationLevels.entries());for(let[t,n]of e)await this.graph.updateActivation(t,n)}getConcept(e){let t=this.nodeCache.get(e);if(t)return{...t,activationLevel:this.activationLevels.get(e)??t.activationLevel}}getAllConcepts(e){let t=e??0;return Array.from(this.nodeCache.values()).map(n=>({...n,activationLevel:this.activationLevels.get(n.id)??n.activationLevel})).filter(n=>n.activationLevel>=t)}getActiveNodes(e){return this.getAllConcepts(e)}getEdges(e){return this.edgeCache.get(e)??[]}getEdge(e,t){return(this.edgeCache.get(e)??[]).find(i=>i.target===t)}setActivation(e,t){this.activationLevels.set(e,Math.max(0,Math.min(1,t)))}decayActivations(e){let t=Array.from(this.activationLevels.entries());for(let[n,i]of t)this.activationLevels.set(n,i*e)}getStats(){let e=Array.from(this.nodeCache.values()),t={pattern:0,technique:0,domain:0,outcome:0,error:0},n=0;for(let r of e)t[r.conceptType]=(t[r.conceptType]??0)+1,n+=this.activationLevels.get(r.id)??r.activationLevel;let i=0,a=Array.from(this.edgeCache.values());for(let r of a)i+=r.length;return{nodeCount:e.length,edgeCount:i,byType:t,avgEdgesPerNode:e.length>0?i/e.length:0,avgActivation:e.length>0?n/e.length:0}}},_=class{config;persistence=null;graph=null;db=null;branchManager=null;currentCycle=null;initialized=!1;cancelled=!1;branchEventListeners=[];_witnessChain=null;set witnessChain(e){this._witnessChain=e}_rvfAdapter=null;set rvfAdapter(e){this._rvfAdapter=e}constructor(e){this.config={...X,...e}}async initialize(){if(!this.initialized)try{this.persistence=M(),this.persistence.isInitialized()||await this.persistence.initialize(),this.db=this.persistence.getDatabase(),this.migrateSchema(),this.graph=new A,await this.graph.initialize(),this.config.enableBranching&&(this.branchManager=new C(this.db,this.config.branchValidationThresholds),this._rvfAdapter&&(this.branchManager.setRvfAdapter(this._rvfAdapter,!0),console.log("[DreamEngine] RVF COW branching activated (ADR-069)"))),this.initialized=!0,console.log(`[DreamEngine] Initialized: ${this.persistence.getDbPath()}`)}catch(e){throw new Error(`Failed to initialize DreamEngine: ${E(e)}`)}}migrateSchema(){if(this.db)try{let e=this.db.prepare("PRAGMA table_info(dream_cycles)").all(),t=e.some(s=>s.name==="duration_ms"),n=e.some(s=>s.name==="duration");!t&&n&&this.db.exec("ALTER TABLE dream_cycles RENAME COLUMN duration TO duration_ms");let i=this.db.prepare("PRAGMA table_info(dream_insights)").all(),a=new Set(i.map(s=>s.name)),r=a.has("insight_type"),o=a.has("source_concepts");if(!r)try{this.db.exec("ALTER TABLE dream_insights ADD COLUMN insight_type TEXT NOT NULL DEFAULT 'general'"),x.info("Added insight_type column to dream_insights (safe migration)")}catch{}if(!o)try{this.db.exec("ALTER TABLE dream_insights ADD COLUMN source_concepts TEXT NOT NULL DEFAULT '[]'"),x.info("Added source_concepts column to dream_insights (safe migration)")}catch{}this.db.exec("CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id)"),this.db.exec("CREATE INDEX IF NOT EXISTS idx_insight_type ON dream_insights(insight_type)"),this.db.exec("CREATE INDEX IF NOT EXISTS idx_insight_novelty ON dream_insights(novelty_score DESC)")}catch(e){x.debug("Dream schema migration skipped",{error:e instanceof Error?e.message:String(e)})}}async dream(e){this.ensureInitialized(),this.cancelled=!1;let t=e??this.config.maxDurationMs,n=Date.now();this.currentCycle={id:y(),startTime:new Date,conceptsProcessed:0,associationsFound:0,insightsGenerated:0,status:"running"},await this.saveCycle(this.currentCycle);let i=null;if(this.branchManager){let a=`dream-${this.currentCycle.id}-${Date.now()}`;i=this.branchManager.createBranch(a),this.emitBranchEvent("dream:branch_created",i)}try{let a=await this.graph.getActiveNodes(0);if(a.length<this.config.minConceptsRequired)throw new Error(`Insufficient concepts: ${a.length} < ${this.config.minConceptsRequired}`);let r=new z(this.graph);await r.loadIntoMemory(30);let s=await new S(r,this.config.activationConfig).dream(t);if(this.cancelled)throw this.currentCycle.status="interrupted",this.currentCycle.endTime=new Date,this.currentCycle.durationMs=Date.now()-n,await this.updateCycle(this.currentCycle),new Error("Dream cycle cancelled");this.currentCycle.conceptsProcessed=s.nodesActivated,this.currentCycle.associationsFound=s.novelAssociations.length,await r.persistActivations();let p=await new I(r,this.config.insightConfig).generateFromActivation(this.currentCycle.id,s);this.currentCycle.insightsGenerated=p.length;for(let l of p)await this.saveInsight(l);if(this.currentCycle.endTime=new Date,this.currentCycle.durationMs=Date.now()-n,this.currentCycle.status="completed",await this.updateCycle(this.currentCycle),i&&this.branchManager){let l=this.branchManager.validateBranch(i);if(l.passed){this.branchManager.mergeBranch(i),this.emitBranchEvent("dream:branch_merged",i,l);try{this._witnessChain?.append("DREAM_MERGE",{cycleId:this.currentCycle.id,branchName:i.name},"dream-engine")}catch{}}else{this.branchManager.discardBranch(i),this.emitBranchEvent("dream:branch_discarded",i,l);try{this._witnessChain?.append("DREAM_DISCARD",{cycleId:this.currentCycle.id,branchName:i.name,reason:l.reason},"dream-engine")}catch{}x.warn("Dream branch discarded: quality validation failed",{cycleId:this.currentCycle.id,reason:l.reason})}i=null}let d={cycle:{...this.currentCycle},insights:p,activationStats:{totalIterations:s.iterations,peakActivation:s.peakActivation,nodesActivated:s.nodesActivated},patternsCreated:0};return this.currentCycle=null,d}catch(a){if(i&&this.branchManager)try{this.branchManager.discardBranch(i),this.emitBranchEvent("dream:branch_discarded",i)}catch{}throw this.currentCycle&&(this.currentCycle.status==="running"&&(this.currentCycle.status="failed"),this.currentCycle.error=E(a),this.currentCycle.endTime=new Date,this.currentCycle.durationMs=Date.now()-n,await this.updateCycle(this.currentCycle)),this.currentCycle=null,a}}async loadPatternsAsConcepts(e){return this.ensureInitialized(),this.graph.loadFromPatterns(e)}async ensureConceptsLoaded(){if(this.ensureInitialized(),(await this.graph.getActiveNodes(0)).length>=this.config.minConceptsRequired)return 0;let t=this.db.prepare(`SELECT id, name, description, qe_domain as domain, pattern_type as patternType,
|
|
63
63
|
confidence, success_rate as successRate
|
|
64
64
|
FROM qe_patterns
|
|
65
65
|
WHERE confidence >= 0.3
|
|
@@ -92,4 +92,4 @@ import{a as W}from"./chunk-J7QGH6PG.js";import{c as V,d as q}from"./chunk-UVWKIP
|
|
|
92
92
|
(id, cycle_id, insight_type, source_concepts, description, novelty_score,
|
|
93
93
|
confidence_score, actionable, applied, suggested_action, pattern_id)
|
|
94
94
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
95
|
-
`).run(e.id,e.cycleId,e.type,JSON.stringify(e.sourceConcepts),e.description,e.noveltyScore,e.confidenceScore,e.actionable?1:0,0,e.suggestedAction??null,null)}async getInsightRowById(e){return this.db?this.db.prepare("SELECT * FROM dream_insights WHERE id = ?").get(e)??null:null}getBranchManager(){return this.branchManager}onBranchEvent(e){this.branchEventListeners.push(e)}emitBranchEvent(e,t,n){for(let i of this.branchEventListeners)try{i(e,t,n)}catch{}}async close(){this.graph&&(await this.graph.close(),this.graph=null),this.db=null,this.persistence=null,this.branchManager=null,this.initialized=!1,this.currentCycle=null}ensureInitialized(){if(!this.initialized||!this.graph||!this.db)throw new Error("DreamEngine not initialized. Call initialize() first.")}rowToCycle(e){return{id:e.id,startTime:new Date(e.start_time),endTime:e.end_time?new Date(e.end_time):void 0,durationMs:e.duration_ms??void 0,conceptsProcessed:e.concepts_processed,associationsFound:e.associations_found,insightsGenerated:e.insights_generated,status:e.status,error:e.error??void 0}}rowToInsight(e){return{id:e.id,cycleId:e.cycle_id,type:e.insight_type,sourceConcepts:D(e.source_concepts),description:e.description,noveltyScore:e.novelty_score,confidenceScore:e.confidence_score,actionable:e.actionable===1,applied:e.applied===1,patternId:e.pattern_id??void 0,suggestedAction:e.suggested_action??void 0,createdAt:new Date(e.created_at)}}};function ie(h){let e=new _(h);return import("./feature-flags-GIGWUPEX.js").then(({isRVFPatternStoreEnabled:t})=>t()?import("./shared-rvf-adapter-UQQUEC52.js"):null).then(t=>{if(!t)return;let n=t.getSharedRvfAdapter();n&&(e.rvfAdapter=n)}).catch(()=>{}),e}var re=_;$();var g=N.create("DreamScheduler"),Y={autoScheduleIntervalMs:36e5,minTimeBetweenDreamsMs:3e5,experienceThreshold:20,enableExperienceTrigger:!0,enableQualityGateFailureTrigger:!0,enableDomainMilestoneTrigger:!1,defaultDreamDurationMs:1e4,quickDreamDurationMs:5e3,fullDreamDurationMs:3e4,autoApplyHighConfidenceInsights:!1,insightConfidenceThreshold:.8},L=class h{config;dreamEngine;eventBus;memoryBackend;initialized=!1;running=!1;dreaming=!1;experienceBuffer=[];lastDreamTime=null;scheduledDreamTimer=null;totalDreamsCompleted=0;subscriptions=[];lastDreamResult=null;metaLearningEngine;metaLearningSnapshots=[];metricsTracker=null;static MAX_META_SNAPSHOTS=20;detectedInsights=[];static MAX_DETECTED_INSIGHTS=100;constructor(e,t){if(!e.dreamEngine)throw new Error("DreamScheduler requires dreamEngine dependency");if(!e.eventBus)throw new Error("DreamScheduler requires eventBus dependency");this.dreamEngine=e.dreamEngine,this.eventBus=e.eventBus,this.memoryBackend=e.memoryBackend,this.config={...Y,...t},this.metaLearningEngine=new q}async initialize(){if(!this.initialized){if(this.config.enableQualityGateFailureTrigger){let e=this.eventBus.subscribe("quality-assessment:gate:completed",this.handleQualityGateEvent.bind(this));this.subscriptions.push(e)}if(this.config.enableDomainMilestoneTrigger){let e=this.eventBus.subscribe("coordination:milestone:reached",this.handleDomainMilestoneEvent.bind(this));this.subscriptions.push(e)}await this.restoreState(),this.initialized=!0,g.info("Initialized")}}start(){this.ensureInitialized(),!this.running&&(this.running=!0,this.scheduleNextDream(),g.info("Started"))}stop(){this.running&&(this.running=!1,this.clearScheduledDream(),g.info("Stopped"))}async dispose(){this.stop();for(let e of this.subscriptions)e.unsubscribe();this.subscriptions=[],this.metricsTracker&&(this.metricsTracker.close(),this.metricsTracker=null),await this.saveState(),this.initialized=!1,g.info("Disposed")}async triggerDream(e){if(this.ensureInitialized(),!this.canDream()){let t=this.getTimeUntilCanDream();throw new Error(`Cannot start dream: minimum interval not met. Wait ${Math.ceil(t/1e3)}s.`)}return this.executeDream(e??this.config.defaultDreamDurationMs)}async triggerQuickDream(){return this.triggerDream(this.config.quickDreamDurationMs)}async triggerFullDream(){return this.triggerDream(this.config.fullDreamDurationMs)}recordExperience(e){this.experienceBuffer.push(e),this.config.enableExperienceTrigger&&this.experienceBuffer.length>=this.config.experienceThreshold&&this.canDream()&&!this.dreaming&&(g.info("Experience threshold reached, triggering dream",{threshold:this.config.experienceThreshold}),this.executeDream(this.config.defaultDreamDurationMs).catch(t=>{g.error("Experience-triggered dream failed",t instanceof Error?t:void 0)}))}getExperienceBuffer(){return[...this.experienceBuffer]}clearExperienceBuffer(){this.experienceBuffer=[]}getStatus(){let e=this.scheduledDreamTimer?this.getTimeUntilScheduledDream():null;return{initialized:this.initialized,running:this.running,dreaming:this.dreaming,experienceCount:this.experienceBuffer.length,experienceThreshold:this.config.experienceThreshold,timeUntilNextDream:e,totalDreamsCompleted:this.totalDreamsCompleted,lastDreamTime:this.lastDreamTime,autoSchedulingEnabled:this.running}}getLastDreamResult(){return this.lastDreamResult}getMetaInsights(e){let t=[...this.detectedInsights].reverse();return e!==void 0?t.slice(0,e):t}async executeDream(e){if(this.dreaming)throw new Error("A dream is already in progress");this.dreaming=!0,g.info("Starting dream cycle",{durationMs:e});try{let t=await this.dreamEngine.ensureConceptsLoaded();t>0&&g.info("Auto-loaded concepts for dream",{loaded:t});let n=await this.dreamEngine.dream(e);if(this.lastDreamTime=new Date,this.lastDreamResult=n,this.totalDreamsCompleted++,this.clearExperienceBuffer(),this.config.autoApplyHighConfidenceInsights&&await this.autoApplyInsights(n),await this.publishDreamCompletedEvent(n),process.env.AQE_META_LEARNING_ENABLED==="true")try{await this.runPostDreamMetaLearning()}catch(i){g.warn("Post-dream meta-learning failed (non-critical)",{error:i instanceof Error?i.message:String(i)})}return this.running&&this.scheduleNextDream(),g.info("Dream completed",{insightsGenerated:n.insights.length}),n}finally{this.dreaming=!1}}async autoApplyInsights(e){let t=e.insights.filter(n=>n.actionable&&n.confidenceScore>=this.config.insightConfidenceThreshold);for(let n of t)try{let i=await this.dreamEngine.applyInsight(n.id);i.success&&g.info("Auto-applied insight",{insightId:n.id,patternId:i.patternId})}catch(i){g.error("Failed to auto-apply insight",i instanceof Error?i:void 0,{insightId:n.id})}}async runPostDreamMetaLearning(){this.metricsTracker||(this.metricsTracker=new W,await this.metricsTracker.initialize());let e=await this.metricsTracker.collectUnifiedSnapshot();for(this.metaLearningSnapshots.push(e);this.metaLearningSnapshots.length>h.MAX_META_SNAPSHOTS;)this.metaLearningSnapshots.shift();let t=V.minSnapshotsForAnalysis;if(this.metaLearningSnapshots.length>=t){let n=this.metaLearningEngine.runMetaLearningCycle(this.metaLearningSnapshots);if(n.length>0){g.info("Meta-learning insights detected",{count:n.length,types:n.map(i=>i.type)});for(let i of n)g.info(`Meta-insight [${i.type}]: ${i.description}`,{confidence:i.confidence.toFixed(2),suggestedAction:i.suggestedAction}),this.detectedInsights.push(i);for(;this.detectedInsights.length>h.MAX_DETECTED_INSIGHTS;)this.detectedInsights.shift();try{this.eventBus.publish({id:y(),type:"meta-learning.insight-detected",timestamp:new Date,source:"learning-optimization",payload:{count:n.length,insights:n.map(i=>({id:i.id,type:i.type,description:i.description,confidence:i.confidence,suggestedAction:i.suggestedAction,detectedAt:i.detectedAt}))}})}catch{g.debug("Failed to publish meta-learning insight event")}}}else g.debug("Meta-learning: accumulating snapshots",{current:this.metaLearningSnapshots.length,required:t})}scheduleNextDream(){if(this.clearScheduledDream(),!this.running)return;let e=this.calculateNextDreamDelay();this.scheduledDreamTimer=setTimeout(async()=>{if(!(!this.running||this.dreaming))try{await this.executeDream(this.config.defaultDreamDurationMs)}catch(t){g.error("Scheduled dream failed",t instanceof Error?t:void 0),this.running&&this.scheduleNextDream()}},e),g.info("Next dream scheduled",{delaySeconds:Math.ceil(e/1e3)})}clearScheduledDream(){this.scheduledDreamTimer&&(clearTimeout(this.scheduledDreamTimer),this.scheduledDreamTimer=null)}calculateNextDreamDelay(){if(!this.lastDreamTime)return this.config.autoScheduleIntervalMs;let e=Date.now()-this.lastDreamTime.getTime(),t=this.config.autoScheduleIntervalMs-e;return Math.max(t,this.config.minTimeBetweenDreamsMs)}getTimeUntilScheduledDream(){return this.calculateNextDreamDelay()}canDream(){return this.lastDreamTime?Date.now()-this.lastDreamTime.getTime()>=this.config.minTimeBetweenDreamsMs:!0}getTimeUntilCanDream(){if(!this.lastDreamTime)return 0;let e=Date.now()-this.lastDreamTime.getTime();return Math.max(0,this.config.minTimeBetweenDreamsMs-e)}async handleQualityGateEvent(e){if(!e.payload.passed){if(!this.canDream()||this.dreaming){g.info("Quality gate failed but cannot start dream yet");return}g.info("Quality gate failed, triggering analysis dream");try{await this.executeDream(this.config.quickDreamDurationMs)}catch(t){g.error("Quality gate triggered dream failed",t instanceof Error?t:void 0)}}}async handleDomainMilestoneEvent(e){if(!this.canDream()||this.dreaming){g.info("Milestone reached but cannot start dream yet");return}g.info("Domain milestone reached, triggering consolidation dream");try{await this.executeDream(this.config.defaultDreamDurationMs)}catch(t){g.error("Milestone triggered dream failed",t instanceof Error?t:void 0)}}async publishDreamCompletedEvent(e){try{await this.eventBus.publish({id:y(),type:"learning-optimization:dream:completed",timestamp:new Date,source:"learning-optimization",payload:{cycleId:e.cycle.id,insightsGenerated:e.insights.length,patternsCreated:e.patternsCreated,duration:e.cycle.durationMs}})}catch(t){g.error("Failed to publish dream completed event",t instanceof Error?t:void 0)}}async saveState(){if(this.memoryBackend)try{await this.memoryBackend.set("dream-scheduler:state",{lastDreamTime:this.lastDreamTime?.toISOString()??null,totalDreamsCompleted:this.totalDreamsCompleted,experienceBuffer:this.experienceBuffer},{namespace:"learning-optimization",persist:!0})}catch(e){g.error("Failed to save state",e instanceof Error?e:void 0)}}async restoreState(){if(this.memoryBackend)try{let e=await this.memoryBackend.get("dream-scheduler:state");e&&(this.lastDreamTime=e.lastDreamTime?new Date(e.lastDreamTime):null,this.totalDreamsCompleted=e.totalDreamsCompleted??0,this.experienceBuffer=e.experienceBuffer??[],g.info("Restored state",{totalDreamsCompleted:this.totalDreamsCompleted,experienceCount:this.experienceBuffer.length}))}catch(e){g.error("Failed to restore state",e instanceof Error?e:void 0)}}ensureInitialized(){if(!this.initialized)throw new Error("DreamScheduler not initialized. Call initialize() first.")}};function ae(h,e){return new L(h,e)}var se=[{name:"aggressive-exploration",description:"High noise, fast decay -- explores widely but forgets quickly",activationConfig:{decayRate:.2,spreadFactor:.7,noiseLevel:.15,maxIterations:30}},{name:"conservative-consolidation",description:"Low noise, slow decay -- strengthens existing associations",activationConfig:{decayRate:.05,spreadFactor:.3,noiseLevel:.02,maxIterations:15}},{name:"balanced-discovery",description:"Moderate parameters -- balanced between exploration and consolidation",activationConfig:{decayRate:.1,spreadFactor:.5,noiseLevel:.05,maxIterations:20}}],G=class{constructor(e,t){this.db=e;this.branchManager=new C(e,t??T)}branchManager;async dream(e,t){if(e.length<1)throw new Error("At least one strategy is required");if(e.length>5)throw new Error("Maximum 5 strategies allowed to limit resource usage");let n=Date.now(),i=this.branchManager.captureBaseline(),a=[];for(let s of e){let c=await this.executeStrategy(s,i,t);a.push(c)}let r=a.filter(s=>s.validation.passed),o=null;if(r.length>0){o=r.reduce((c,p)=>{let d=this.scoreValidation(c.validation);return this.scoreValidation(p.validation)>d?p:c});let s=this.branchManager.createBranch(`dream-final-${o.strategy.name}-${Date.now()}`);try{await t(o.strategy.activationConfig),this.branchManager.mergeBranch(s),o.selected=!0}catch{this.branchManager.discardBranch(s),o.selected=!1,o=null}}return{strategies:a,winner:o,totalDurationMs:Date.now()-n}}getBranchManager(){return this.branchManager}async executeStrategy(e,t,n){let i=`dream-spec-${e.name}-${Date.now()}`,a=this.branchManager.createBranch(i),r=Date.now();try{await n(e.activationConfig);let o=this.branchManager.validateBranch(a,t);return this.branchManager.discardBranch(a),{strategy:e,branch:a,validation:o,selected:!1,durationMs:Date.now()-r}}catch{return this.branchManager.discardBranch(a),{strategy:e,branch:a,validation:{passed:!1,reason:"Dream execution threw an error",patternCountDelta:0,avgConfidenceDelta:0,highConfidenceLost:0,postDreamMetrics:t},selected:!1,durationMs:Date.now()-r}}}scoreValidation(e){return e.avgConfidenceDelta*100+e.patternCountDelta*.1-e.highConfidenceLost*5}};export{P as a,A as b,K as c,B as d,O as e,F as f,j as g,S as h,Q as i,I as j,T as k,C as l,X as m,_ as n,ie as o,re as p,Y as q,L as r,ae as s,se as t,G as u};
|
|
95
|
+
`).run(e.id,e.cycleId,e.type,JSON.stringify(e.sourceConcepts),e.description,e.noveltyScore,e.confidenceScore,e.actionable?1:0,0,e.suggestedAction??null,null)}async getInsightRowById(e){return this.db?this.db.prepare("SELECT * FROM dream_insights WHERE id = ?").get(e)??null:null}getBranchManager(){return this.branchManager}onBranchEvent(e){this.branchEventListeners.push(e)}emitBranchEvent(e,t,n){for(let i of this.branchEventListeners)try{i(e,t,n)}catch{}}async close(){this.graph&&(await this.graph.close(),this.graph=null),this.db=null,this.persistence=null,this.branchManager=null,this.initialized=!1,this.currentCycle=null}ensureInitialized(){if(!this.initialized||!this.graph||!this.db)throw new Error("DreamEngine not initialized. Call initialize() first.")}rowToCycle(e){return{id:e.id,startTime:new Date(e.start_time),endTime:e.end_time?new Date(e.end_time):void 0,durationMs:e.duration_ms??void 0,conceptsProcessed:e.concepts_processed,associationsFound:e.associations_found,insightsGenerated:e.insights_generated,status:e.status,error:e.error??void 0}}rowToInsight(e){return{id:e.id,cycleId:e.cycle_id,type:e.insight_type,sourceConcepts:D(e.source_concepts),description:e.description,noveltyScore:e.novelty_score,confidenceScore:e.confidence_score,actionable:e.actionable===1,applied:e.applied===1,patternId:e.pattern_id??void 0,suggestedAction:e.suggested_action??void 0,createdAt:new Date(e.created_at)}}};function ie(h){let e=new _(h);return import("./feature-flags-WBF5B6WE.js").then(({isRVFPatternStoreEnabled:t})=>t()?import("./shared-rvf-adapter-PLZVKKW7.js"):null).then(t=>{if(!t)return;let n=t.getSharedRvfAdapter();n&&(e.rvfAdapter=n)}).catch(()=>{}),e}var re=_;$();var g=N.create("DreamScheduler"),Y={autoScheduleIntervalMs:36e5,minTimeBetweenDreamsMs:3e5,experienceThreshold:20,enableExperienceTrigger:!0,enableQualityGateFailureTrigger:!0,enableDomainMilestoneTrigger:!1,defaultDreamDurationMs:1e4,quickDreamDurationMs:5e3,fullDreamDurationMs:3e4,autoApplyHighConfidenceInsights:!1,insightConfidenceThreshold:.8},L=class h{config;dreamEngine;eventBus;memoryBackend;initialized=!1;running=!1;dreaming=!1;experienceBuffer=[];lastDreamTime=null;scheduledDreamTimer=null;totalDreamsCompleted=0;subscriptions=[];lastDreamResult=null;metaLearningEngine;metaLearningSnapshots=[];metricsTracker=null;static MAX_META_SNAPSHOTS=20;detectedInsights=[];static MAX_DETECTED_INSIGHTS=100;constructor(e,t){if(!e.dreamEngine)throw new Error("DreamScheduler requires dreamEngine dependency");if(!e.eventBus)throw new Error("DreamScheduler requires eventBus dependency");this.dreamEngine=e.dreamEngine,this.eventBus=e.eventBus,this.memoryBackend=e.memoryBackend,this.config={...Y,...t},this.metaLearningEngine=new q}async initialize(){if(!this.initialized){if(this.config.enableQualityGateFailureTrigger){let e=this.eventBus.subscribe("quality-assessment:gate:completed",this.handleQualityGateEvent.bind(this));this.subscriptions.push(e)}if(this.config.enableDomainMilestoneTrigger){let e=this.eventBus.subscribe("coordination:milestone:reached",this.handleDomainMilestoneEvent.bind(this));this.subscriptions.push(e)}await this.restoreState(),this.initialized=!0,g.info("Initialized")}}start(){this.ensureInitialized(),!this.running&&(this.running=!0,this.scheduleNextDream(),g.info("Started"))}stop(){this.running&&(this.running=!1,this.clearScheduledDream(),g.info("Stopped"))}async dispose(){this.stop();for(let e of this.subscriptions)e.unsubscribe();this.subscriptions=[],this.metricsTracker&&(this.metricsTracker.close(),this.metricsTracker=null),await this.saveState(),this.initialized=!1,g.info("Disposed")}async triggerDream(e){if(this.ensureInitialized(),!this.canDream()){let t=this.getTimeUntilCanDream();throw new Error(`Cannot start dream: minimum interval not met. Wait ${Math.ceil(t/1e3)}s.`)}return this.executeDream(e??this.config.defaultDreamDurationMs)}async triggerQuickDream(){return this.triggerDream(this.config.quickDreamDurationMs)}async triggerFullDream(){return this.triggerDream(this.config.fullDreamDurationMs)}recordExperience(e){this.experienceBuffer.push(e),this.config.enableExperienceTrigger&&this.experienceBuffer.length>=this.config.experienceThreshold&&this.canDream()&&!this.dreaming&&(g.info("Experience threshold reached, triggering dream",{threshold:this.config.experienceThreshold}),this.executeDream(this.config.defaultDreamDurationMs).catch(t=>{g.error("Experience-triggered dream failed",t instanceof Error?t:void 0)}))}getExperienceBuffer(){return[...this.experienceBuffer]}clearExperienceBuffer(){this.experienceBuffer=[]}getStatus(){let e=this.scheduledDreamTimer?this.getTimeUntilScheduledDream():null;return{initialized:this.initialized,running:this.running,dreaming:this.dreaming,experienceCount:this.experienceBuffer.length,experienceThreshold:this.config.experienceThreshold,timeUntilNextDream:e,totalDreamsCompleted:this.totalDreamsCompleted,lastDreamTime:this.lastDreamTime,autoSchedulingEnabled:this.running}}getLastDreamResult(){return this.lastDreamResult}getMetaInsights(e){let t=[...this.detectedInsights].reverse();return e!==void 0?t.slice(0,e):t}async executeDream(e){if(this.dreaming)throw new Error("A dream is already in progress");this.dreaming=!0,g.info("Starting dream cycle",{durationMs:e});try{let t=await this.dreamEngine.ensureConceptsLoaded();t>0&&g.info("Auto-loaded concepts for dream",{loaded:t});let n=await this.dreamEngine.dream(e);if(this.lastDreamTime=new Date,this.lastDreamResult=n,this.totalDreamsCompleted++,this.clearExperienceBuffer(),this.config.autoApplyHighConfidenceInsights&&await this.autoApplyInsights(n),await this.publishDreamCompletedEvent(n),process.env.AQE_META_LEARNING_ENABLED==="true")try{await this.runPostDreamMetaLearning()}catch(i){g.warn("Post-dream meta-learning failed (non-critical)",{error:i instanceof Error?i.message:String(i)})}return this.running&&this.scheduleNextDream(),g.info("Dream completed",{insightsGenerated:n.insights.length}),n}finally{this.dreaming=!1}}async autoApplyInsights(e){let t=e.insights.filter(n=>n.actionable&&n.confidenceScore>=this.config.insightConfidenceThreshold);for(let n of t)try{let i=await this.dreamEngine.applyInsight(n.id);i.success&&g.info("Auto-applied insight",{insightId:n.id,patternId:i.patternId})}catch(i){g.error("Failed to auto-apply insight",i instanceof Error?i:void 0,{insightId:n.id})}}async runPostDreamMetaLearning(){this.metricsTracker||(this.metricsTracker=new W,await this.metricsTracker.initialize());let e=await this.metricsTracker.collectUnifiedSnapshot();for(this.metaLearningSnapshots.push(e);this.metaLearningSnapshots.length>h.MAX_META_SNAPSHOTS;)this.metaLearningSnapshots.shift();let t=V.minSnapshotsForAnalysis;if(this.metaLearningSnapshots.length>=t){let n=this.metaLearningEngine.runMetaLearningCycle(this.metaLearningSnapshots);if(n.length>0){g.info("Meta-learning insights detected",{count:n.length,types:n.map(i=>i.type)});for(let i of n)g.info(`Meta-insight [${i.type}]: ${i.description}`,{confidence:i.confidence.toFixed(2),suggestedAction:i.suggestedAction}),this.detectedInsights.push(i);for(;this.detectedInsights.length>h.MAX_DETECTED_INSIGHTS;)this.detectedInsights.shift();try{this.eventBus.publish({id:y(),type:"meta-learning.insight-detected",timestamp:new Date,source:"learning-optimization",payload:{count:n.length,insights:n.map(i=>({id:i.id,type:i.type,description:i.description,confidence:i.confidence,suggestedAction:i.suggestedAction,detectedAt:i.detectedAt}))}})}catch{g.debug("Failed to publish meta-learning insight event")}}}else g.debug("Meta-learning: accumulating snapshots",{current:this.metaLearningSnapshots.length,required:t})}scheduleNextDream(){if(this.clearScheduledDream(),!this.running)return;let e=this.calculateNextDreamDelay();this.scheduledDreamTimer=setTimeout(async()=>{if(!(!this.running||this.dreaming))try{await this.executeDream(this.config.defaultDreamDurationMs)}catch(t){g.error("Scheduled dream failed",t instanceof Error?t:void 0),this.running&&this.scheduleNextDream()}},e),g.info("Next dream scheduled",{delaySeconds:Math.ceil(e/1e3)})}clearScheduledDream(){this.scheduledDreamTimer&&(clearTimeout(this.scheduledDreamTimer),this.scheduledDreamTimer=null)}calculateNextDreamDelay(){if(!this.lastDreamTime)return this.config.autoScheduleIntervalMs;let e=Date.now()-this.lastDreamTime.getTime(),t=this.config.autoScheduleIntervalMs-e;return Math.max(t,this.config.minTimeBetweenDreamsMs)}getTimeUntilScheduledDream(){return this.calculateNextDreamDelay()}canDream(){return this.lastDreamTime?Date.now()-this.lastDreamTime.getTime()>=this.config.minTimeBetweenDreamsMs:!0}getTimeUntilCanDream(){if(!this.lastDreamTime)return 0;let e=Date.now()-this.lastDreamTime.getTime();return Math.max(0,this.config.minTimeBetweenDreamsMs-e)}async handleQualityGateEvent(e){if(!e.payload.passed){if(!this.canDream()||this.dreaming){g.info("Quality gate failed but cannot start dream yet");return}g.info("Quality gate failed, triggering analysis dream");try{await this.executeDream(this.config.quickDreamDurationMs)}catch(t){g.error("Quality gate triggered dream failed",t instanceof Error?t:void 0)}}}async handleDomainMilestoneEvent(e){if(!this.canDream()||this.dreaming){g.info("Milestone reached but cannot start dream yet");return}g.info("Domain milestone reached, triggering consolidation dream");try{await this.executeDream(this.config.defaultDreamDurationMs)}catch(t){g.error("Milestone triggered dream failed",t instanceof Error?t:void 0)}}async publishDreamCompletedEvent(e){try{await this.eventBus.publish({id:y(),type:"learning-optimization:dream:completed",timestamp:new Date,source:"learning-optimization",payload:{cycleId:e.cycle.id,insightsGenerated:e.insights.length,patternsCreated:e.patternsCreated,duration:e.cycle.durationMs}})}catch(t){g.error("Failed to publish dream completed event",t instanceof Error?t:void 0)}}async saveState(){if(this.memoryBackend)try{await this.memoryBackend.set("dream-scheduler:state",{lastDreamTime:this.lastDreamTime?.toISOString()??null,totalDreamsCompleted:this.totalDreamsCompleted,experienceBuffer:this.experienceBuffer},{namespace:"learning-optimization",persist:!0})}catch(e){g.error("Failed to save state",e instanceof Error?e:void 0)}}async restoreState(){if(this.memoryBackend)try{let e=await this.memoryBackend.get("dream-scheduler:state");e&&(this.lastDreamTime=e.lastDreamTime?new Date(e.lastDreamTime):null,this.totalDreamsCompleted=e.totalDreamsCompleted??0,this.experienceBuffer=e.experienceBuffer??[],g.info("Restored state",{totalDreamsCompleted:this.totalDreamsCompleted,experienceCount:this.experienceBuffer.length}))}catch(e){g.error("Failed to restore state",e instanceof Error?e:void 0)}}ensureInitialized(){if(!this.initialized)throw new Error("DreamScheduler not initialized. Call initialize() first.")}};function ae(h,e){return new L(h,e)}var se=[{name:"aggressive-exploration",description:"High noise, fast decay -- explores widely but forgets quickly",activationConfig:{decayRate:.2,spreadFactor:.7,noiseLevel:.15,maxIterations:30}},{name:"conservative-consolidation",description:"Low noise, slow decay -- strengthens existing associations",activationConfig:{decayRate:.05,spreadFactor:.3,noiseLevel:.02,maxIterations:15}},{name:"balanced-discovery",description:"Moderate parameters -- balanced between exploration and consolidation",activationConfig:{decayRate:.1,spreadFactor:.5,noiseLevel:.05,maxIterations:20}}],G=class{constructor(e,t){this.db=e;this.branchManager=new C(e,t??T)}branchManager;async dream(e,t){if(e.length<1)throw new Error("At least one strategy is required");if(e.length>5)throw new Error("Maximum 5 strategies allowed to limit resource usage");let n=Date.now(),i=this.branchManager.captureBaseline(),a=[];for(let s of e){let c=await this.executeStrategy(s,i,t);a.push(c)}let r=a.filter(s=>s.validation.passed),o=null;if(r.length>0){o=r.reduce((c,p)=>{let d=this.scoreValidation(c.validation);return this.scoreValidation(p.validation)>d?p:c});let s=this.branchManager.createBranch(`dream-final-${o.strategy.name}-${Date.now()}`);try{await t(o.strategy.activationConfig),this.branchManager.mergeBranch(s),o.selected=!0}catch{this.branchManager.discardBranch(s),o.selected=!1,o=null}}return{strategies:a,winner:o,totalDurationMs:Date.now()-n}}getBranchManager(){return this.branchManager}async executeStrategy(e,t,n){let i=`dream-spec-${e.name}-${Date.now()}`,a=this.branchManager.createBranch(i),r=Date.now();try{await n(e.activationConfig);let o=this.branchManager.validateBranch(a,t);return this.branchManager.discardBranch(a),{strategy:e,branch:a,validation:o,selected:!1,durationMs:Date.now()-r}}catch{return this.branchManager.discardBranch(a),{strategy:e,branch:a,validation:{passed:!1,reason:"Dream execution threw an error",patternCountDelta:0,avgConfidenceDelta:0,highConfidenceLost:0,postDreamMetrics:t},selected:!1,durationMs:Date.now()-r}}}scoreValidation(e){return e.avgConfidenceDelta*100+e.patternCountDelta*.1-e.highConfidenceLost*5}};export{P as a,A as b,K as c,B as d,O as e,F as f,j as g,S as h,Q as i,I as j,T as k,C as l,X as m,_ as n,ie as o,re as p,Y as q,L as r,ae as s,se as t,G as u};
|
|
@@ -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.9.
|
|
2
|
-
import{h as s,k as o,m as c,o as m}from"./chunk-
|
|
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.9.5");process.exit(0)}
|
|
2
|
+
import{h as s,k as o,m as c,o as m}from"./chunk-HT5EZYPZ.js";import{a,c as d}from"./chunk-MYIDAWGQ.js";import{a as r,e as l}from"./chunk-4QGNSNQL.js";d();m();l();var u={dbPath:s.dbPath,walMode:!0,mmapSize:r.MMAP_SIZE_BYTES,cacheSize:r.CACHE_SIZE_KB,busyTimeout:r.BUSY_TIMEOUT_MS},n=class e{static instance=null;static instancePromise=null;unifiedMemory=null;config;initialized=!1;initPromise=null;constructor(i){this.config={...u,...i}}static getInstance(i){return e.instance||(e.instance=new e(i)),e.instance}static async getInstanceAsync(i){return e.instance?.initialized?e.instance:(e.instancePromise||(e.instancePromise=(async()=>{let t=e.getInstance(i);return await t.initialize(),t})()),e.instancePromise)}static resetInstance(){e.instance&&(e.instance.close(),e.instance=null),e.instancePromise=null,c()}async initialize(){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize()),this.initPromise}async _doInitialize(){if(!this.initialized)try{let i={dbPath:this.config.dbPath,walMode:this.config.walMode,busyTimeout:this.config.busyTimeout,mmapSize:this.config.mmapSize,cacheSize:this.config.cacheSize};this.unifiedMemory=o(i),await this.unifiedMemory.initialize(),this.initialized=!0,console.log(`[UnifiedPersistence] Initialized via UnifiedMemoryManager: ${this.config.dbPath}`)}catch(i){throw this.initPromise=null,new Error(`Failed to initialize UnifiedPersistenceManager: ${a(i)}`)}}getDatabase(){if(!this.unifiedMemory||!this.initialized)throw new Error("UnifiedPersistenceManager not initialized");return this.unifiedMemory.getDatabase()}isInitialized(){return this.initialized}getDbPath(){return this.config.dbPath}prepare(i,t){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.prepare(i,t)}transaction(i){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.transaction(i)}getStats(){if(!this.unifiedMemory)throw new Error("Database not initialized");let i=this.unifiedMemory.getStats();return{tables:i.tables,fileSize:i.fileSize,walSize:i.walSize}}vacuum(){this.getDatabase().exec("VACUUM")}checkpoint(){this.getDatabase().pragma("wal_checkpoint(TRUNCATE)")}close(){this.initialized=!1,console.log("[UnifiedPersistence] Facade closed")}};function g(e){return n.getInstance(e)}async function U(e){let i=g(e);return await i.initialize(),i}function z(){n.resetInstance()}var f=!1;function h(){if(f)return;f=!0;let e=()=>{try{let i=n.instance;i&&i.close()}catch(i){console.debug("[UnifiedPersistence] Cleanup error:",i instanceof Error?i.message:i)}};process.on("beforeExit",e),process.on("SIGINT",()=>{e(),process.exit(0)}),process.on("SIGTERM",()=>{e(),process.exit(0)})}h();export{u as a,n as b,g as c,U as d,z as e};
|
|
@@ -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.9.
|
|
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.9.5");process.exit(0)}
|
|
2
2
|
import a from"chalk";import{existsSync as m,statSync as V}from"fs";import{join as p,relative as P}from"path";var l=class{static prompt(t,e){return new Promise(r=>{t.question(e,s=>{r(s)})})}static printStepHeader(t,e,r){console.log(""),console.log(a.cyan(`Step ${t}: ${e}`)),r&&console.log(a.gray(r)),console.log("")}static printWizardHeader(t,e){console.log(""),console.log(a.blue("========================================")),console.log(a.blue.bold(` ${t}`)),console.log(a.blue("========================================")),e&&console.log(a.gray(e)),console.log(a.gray("Press Ctrl+C to cancel at any time")),console.log("")}static printSummaryHeader(){console.log(""),console.log(a.blue("========================================")),console.log(a.blue.bold(" Configuration Summary")),console.log(a.blue("========================================")),console.log("")}static printSummaryField(t,e,r){let s=r?.indent??" ",i=r?.maxItems??5,c=r?.formatValue??(o=>a.cyan(o));if(Array.isArray(e))e.length===0?console.log(a.white(`${s}${t}: ${a.gray("(none)")}`)):e.length<=i?console.log(a.white(`${s}${t}: ${c(e.join(", "))}`)):(console.log(a.white(`${s}${t}:`)),e.slice(0,i).forEach(o=>{console.log(a.gray(`${s} - ${o}`))}),console.log(a.gray(`${s} ... and ${e.length-i} more`)));else{let o=t.padEnd(16);console.log(a.white(`${s}${o}${c(e)}`))}}static printDerivedSettings(t,e=" "){console.log(""),console.log(a.gray(`${e}Derived settings:`));for(let[r,s]of Object.entries(t))console.log(a.gray(`${e} ${r}: ${s}`));console.log("")}};var h=class u{static getSourceDirectories(t){let e=[],r=["src","lib","app","packages","api"];for(let s of r){let i=p(t,s);m(i)&&V(i).isDirectory()&&e.push(s)}return e}static getCoverageTargets(t){let e=u.getSourceDirectories(t),r=["coverage","coverage/lcov.info","coverage/coverage-final.json",".nyc_output"];for(let s of r){let i=p(t,s);m(i)&&e.push(s)}return e}static getSecurityTargets(t){let e=u.getSourceDirectories(t),r=["package.json","package-lock.json","yarn.lock","pnpm-lock.yaml",".env",".env.example","docker-compose.yml","Dockerfile"];for(let s of r){let i=p(t,s);m(i)&&e.push(s)}return e}static getTestSourceFiles(t){let e=[],r=["src","lib","app","packages"];for(let s of r){let i=p(t,s);m(i)&&V(i).isDirectory()&&(e.push(`${s}/**/*.ts`),e.push(s))}return m(p(t,"src"))&&(e.push("src/services/**/*.ts"),e.push("src/utils/**/*.ts"),e.push("src/components/**/*.tsx")),e}static checkPatternsExist(t){return[p(t,".agentic-qe","patterns"),p(t,".agentic-qe","memory.db"),p(t,".aqe","patterns"),p(t,"data","patterns")].some(r=>m(r))}},f=class{static relativePath(t,e){return P(e,t)||"."}static yesNo(t){return t?"Yes":"No"}static enabledDisabled(t){return t?"Enabled":"Disabled"}static percentage(t){return`${t}%`}static truncatedList(t,e=5){return t.length===0?"(none)":t.length<=e?t.join(", "):`${t.slice(0,e).join(", ")}... and ${t.length-e} more`}};import n from"chalk";import{existsSync as w}from"fs";import{resolve as I}from"path";var d=class{constructor(t){this.defaultValue=t}description;getDefaultValue(){return this.defaultValue}success(t){return{value:t,continue:!0}}cancelled(){return{value:this.defaultValue,continue:!1}}error(t){return{value:this.defaultValue,continue:!1,error:t}}};var y=class extends d{id;stepNumber;title;description;options;validValues;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.options=t.options,this.validValues=t.validValues}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.options.forEach(i=>{let c=[];i.isRecommended?c.push(n.green(" (recommended)")):(i.isDefault||i.value===this.defaultValue)&&c.push(n.green(" (default)")),console.log(n.white(` ${i.key}. ${i.label||i.value}${c.join("")}`)),i.description&&console.log(n.gray(` ${i.description}`))}),console.log("");let r=(await l.prompt(t.rl,`Select ${this.title.toLowerCase()} [${n.gray(String(this.defaultValue))}]: `)).trim();if(!r)return this.success(this.defaultValue);let s=parseInt(r,10);return s>=1&&s<=this.options.length?this.success(this.options[s-1].value):this.validValues.includes(r)?this.success(r):(console.log(n.yellow(` Invalid input, using default: ${this.defaultValue}`)),this.success(this.defaultValue))}},b=class extends d{id;stepNumber;title;description;options;validValues;instructions;allowEmpty;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.options=t.options,this.validValues=t.validValues,this.instructions=t.instructions,this.allowEmpty=t.allowEmpty??!1}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.instructions&&(console.log(n.gray(this.instructions)),console.log("")),this.options.forEach(o=>{let N=o.isDefaultSelected||this.defaultValue.includes(o.value)?n.green(" *"):"";console.log(n.white(` ${o.key}. ${o.label||o.value}${N}`)),o.description&&console.log(n.gray(` ${o.description}`))}),console.log(""),console.log(n.gray(" * = included in default selection")),console.log("");let e=this.defaultValue.join(","),s=(await l.prompt(t.rl,`Select options [${n.gray(e)}]: `)).trim();if(!s)return this.success(this.defaultValue);let i=s.split(",").map(o=>o.trim().toLowerCase()).filter(o=>o.length>0),c=[];for(let o of i){let g=parseInt(o,10);g>=1&&g<=this.options.length?c.push(this.options[g-1].value):this.validValues.includes(o)&&c.push(o)}return c.length===0?this.allowEmpty?this.success([]):(console.log(n.yellow(` Invalid input, using default: ${e}`)),this.success(this.defaultValue)):this.success([...new Set(c)])}},v=class extends d{id;stepNumber;title;description;additionalInfo;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.additionalInfo=t.additionalInfo}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.additionalInfo&&(console.log(n.gray(this.additionalInfo)),console.log(""));let e=this.defaultValue?"Y/n":"y/N",s=(await l.prompt(t.rl,`${this.title}? [${n.gray(e)}]: `)).trim().toLowerCase();return s===""?this.success(this.defaultValue):s==="n"||s==="no"?this.success(!1):s==="y"||s==="yes"?this.success(!0):this.success(this.defaultValue)}},x=class extends d{id;stepNumber;title;description;presets;min;max;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.presets=t.presets,this.min=t.min,this.max=t.max}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.presets&&this.presets.length>0&&(this.presets.forEach(i=>{let c=i.value===this.defaultValue?n.green(" (default)"):"";console.log(n.gray(` ${i.key}. ${i.label}${c}`))}),this.min!==void 0&&this.max!==void 0&&console.log(n.gray(` Or enter a custom number (${this.min}-${this.max})`)),console.log(""));let r=(await l.prompt(t.rl,`${this.title} [${n.gray(String(this.defaultValue))}]: `)).trim();if(!r)return this.success(this.defaultValue);let s=parseInt(r,10);if(this.presets){let i=s;if(i>=1&&i<=this.presets.length)return this.success(this.presets[i-1].value)}return isNaN(s)?(console.log(n.yellow(` Invalid input, using default: ${this.defaultValue}`)),this.success(this.defaultValue)):this.min!==void 0&&s<this.min?(console.log(n.yellow(` Value too low, using minimum: ${this.min}`)),this.success(this.min)):this.max!==void 0&&s>this.max?(console.log(n.yellow(` Value too high, using maximum: ${this.max}`)),this.success(this.max)):this.success(s)}},C=class extends d{id;stepNumber;title;description;examples;suggestionsProvider;validatePath;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.examples=t.examples,this.suggestionsProvider=t.suggestionsProvider,this.validatePath=t.validatePath??!0}async execute(t){if(t.nonInteractive){let i=I(t.cwd,this.defaultValue);return this.success(w(i)?i:t.cwd)}if(l.printStepHeader(this.stepNumber,this.title,this.description),this.examples&&(console.log(n.gray(`Examples: ${this.examples}`)),console.log("")),this.suggestionsProvider){let i=this.suggestionsProvider(t.cwd);i.length>0&&(console.log(n.yellow("Detected directories:")),i.slice(0,5).forEach((c,o)=>{console.log(n.gray(` ${o+1}. ${c}`))}),console.log(""))}let r=(await l.prompt(t.rl,`${this.title} [${n.gray(this.defaultValue)}]: `)).trim()||this.defaultValue,s=I(t.cwd,r);return this.validatePath&&!w(s)?(console.log(n.yellow(` Warning: '${r}' does not exist, using current directory.`)),this.success(t.cwd)):this.success(s)}};var T=class extends d{id;stepNumber;title;description;constructor(t){super({}),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description}async execute(t){if(t.nonInteractive)return this.success({});l.printStepHeader(this.stepNumber,this.title,this.description);let e=await l.prompt(t.rl,`Include patterns [${n.gray("e.g., src/**/*.ts")}]: `),r=await l.prompt(t.rl,`Exclude patterns [${n.gray("e.g., **/*.test.ts,dist/**")}]: `),s={};return e.trim()&&(s.include=e.split(",").map(i=>i.trim()).filter(i=>i.length>0)),r.trim()&&(s.exclude=r.split(",").map(i=>i.trim()).filter(i=>i.length>0)),this.success(s)}};import{createInterface as R}from"readline";import $ from"chalk";var S=class{options;cwd;constructor(t){this.options=t,this.cwd=process.cwd()}async run(){if(this.isNonInteractive())return this.getDefaults();let t=R({input:process.stdin,output:process.stdout});try{this.printHeader();let e={},r=this.getCommands();for(let c of r){let o={rl:t,cwd:this.cwd,results:e,nonInteractive:!1},g=await c.execute(o);if(!g.continue)return this.getCancelled();e[c.id]=g.value}let s=this.buildResult(e);return this.printSummary(s),await this.promptConfirmation(t)?s:this.getCancelled()}finally{t.close()}}printHeader(){l.printWizardHeader(this.getTitle(),this.getSubtitle())}async promptConfirmation(t){console.log("");let r=(await l.prompt(t,`${$.green(this.getConfirmationPrompt())} [${$.gray("Y/n")}]: `)).trim().toLowerCase();return r==="n"||r==="no"?(console.log($.yellow(`
|
|
3
3
|
Wizard cancelled.`)),!1):!0}};export{l as a,h as b,f as c,y as d,b as e,v as f,x as g,C as h,T as i,S as j};
|
|
@@ -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.9.
|
|
2
|
-
import{a as F,c as D}from"./chunk-
|
|
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.9.5");process.exit(0)}
|
|
2
|
+
import{a as F,c as D}from"./chunk-MYIDAWGQ.js";import{d as $}from"./chunk-UPFCV7MX.js";$();D();var b=null,l=null,d=null,g=!1,f="",h={modelName:"Xenova/all-MiniLM-L6-v2",quantized:!0,enableCache:!0,maxCacheSize:1e4},o=new Map,P=36e5;function I(t){let e=t.trim();return!!(e.startsWith("{")&&/["']metrics["']/.test(e)||e.startsWith("[")&&e.endsWith("]")&&e.length>50||(e.match(/[a-zA-Z]/g)||[]).length/Math.max(e.length,1)<.3&&e.length>20)}async function A(t={}){if(g)throw new Error(`Transformer initialization previously failed: ${f}`);if(d)return d;let e={...h,...t};return d=(async()=>{try{b=(await import("./transformers-DRPOBWCW.js")).pipeline,console.log(`[RealEmbeddings] Loading model: ${e.modelName}`);let a=performance.now();l=await b("feature-extraction",e.modelName,{quantized:e.quantized});let s=performance.now()-a;console.log(`[RealEmbeddings] Model loaded in ${s.toFixed(0)}ms`)}catch(r){throw g=!0,f=F(r),new Error(`Failed to initialize transformer model: ${f}`)}})(),d}async function q(t,e={}){let r={...h,...e};if(I(t))return new Array(N()).fill(0);if(r.enableCache){let i=o.get(t);if(i&&Date.now()-i.timestamp<P)return i.embedding}if(l||await A(e),!l)throw new Error("Embedding model failed to initialize");let a=performance.now(),s=await l(t,{pooling:"mean",normalize:!0}),m=Array.from(s.data),n=performance.now()-a;if(n>500&&console.warn(`[RealEmbeddings] Slow embedding computation: ${n.toFixed(1)}ms for "${t.slice(0,50)}..."`),r.enableCache){if(o.size>=r.maxCacheSize){let i=o.keys().next().value;i&&o.delete(i)}o.set(t,{embedding:m,timestamp:Date.now()})}return m}async function B(t,e={}){let r={...h,...e},a=[],s=[],m=new Array(t.length).fill(null);if(r.enableCache)for(let n=0;n<t.length;n++){let i=o.get(t[n]);i&&Date.now()-i.timestamp<P?m[n]=i.embedding:(a.push(t[n]),s.push(n))}else{a.push(...t);for(let n=0;n<t.length;n++)s.push(n)}if(a.length>0){if(l||await A(e),!l)throw new Error("Embedding model failed to initialize");let n=performance.now(),i=32;for(let c=0;c<a.length;c+=i){let M=Math.min(c+i,a.length),p=a.slice(c,M),E=await l(p,{pooling:"mean",normalize:!0}),w=E.dims||[p.length,384],R=w[0],C=w[1];for(let u=0;u<R;u++){let z=u*C,x=Array.from(E.data.slice(z,z+C)),y=c+u,v=s[y];if(m[v]=x,r.enableCache){if(o.size>=r.maxCacheSize){let T=o.keys().next().value;T&&o.delete(T)}o.set(a[y],{embedding:x,timestamp:Date.now()})}}}let S=performance.now()-n;console.log(`[RealEmbeddings] Batch computed ${a.length} embeddings in ${S.toFixed(0)}ms`)}return m.filter(n=>n!==null)}function O(){o.clear(),console.log("[RealEmbeddings] Cache cleared")}function W(){return{size:o.size,hitRate:0}}function k(){return!g&&l!==null}function N(){return 384}function G(){b=null,l=null,d=null,g=!1,f="",o.clear()}export{h as a,q as b,B as c,O as d,W as e,k as f,N as g,G as h};
|
|
@@ -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.9.
|
|
2
|
-
import{f as p}from"./chunk-
|
|
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.9.5");process.exit(0)}
|
|
2
|
+
import{f as p}from"./chunk-YZ3WB4TN.js";import{a as f,c as R}from"./chunk-MYIDAWGQ.js";R();var u=class extends p{config={name:"qe/workflows/browser-load",description:"Load, validate, and prepare browser automation workflows from inline YAML or built-in templates. Returns the resolved workflow with steps and variable bindings, ready for browser execution. Templates: login-flow, form-validation, visual-regression, oauth-flow, etc.",domain:"test-execution",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{workflowYaml:{type:"string",description:"Inline YAML workflow definition. Mutually exclusive with templateName."},templateName:{type:"string",description:"Built-in template name to load.",enum:["login-flow","oauth-flow","scraping-workflow","visual-regression","form-validation","navigation-flow","api-integration","performance-audit","accessibility-audit"]},variables:{type:"object",description:'Runtime variable overrides (e.g., { "baseUrl": "https://example.com" })'}}}}async execute(r,C){try{let{WorkflowLoader:n,WORKFLOW_TEMPLATES:g,WORKFLOW_DESCRIPTIONS:v,interpolateVariables:b}=await import("./browser-4GZXU4YT.js"),{parse:k}=await import("yaml"),d=new n,l=[...g],y=v;if(!r.workflowYaml&&!r.templateName)return{success:!0,data:{workflowName:"none",description:"No workflow specified. Use templateName or workflowYaml.",source:"none",templateUsed:null,steps:[],variables:{defined:[],provided:{}},validation:{valid:!0,errors:[],warnings:[]},availableTemplates:l,summary:`Available templates: ${l.join(", ")}`}};let e,i,t=null;r.workflowYaml?(i="inline-yaml",e=k(r.workflowYaml)):(i="template",t=r.templateName,e=await d.load(r.templateName));let a=await d.validate(e),w=(e.steps??[]).map(o=>{let s=o.config;if(r.variables){let c={};for(let[h,m]of Object.entries(s))c[h]=typeof m=="string"?b(m,r.variables):m;s=c}return{name:o.name,action:o.action,config:s,optional:o.optional??!1,assertionCount:o.assertions?.length??0}});return{success:!0,data:{workflowName:e.name||t||"custom",description:e.description||t&&y[t]||"",source:i,templateUsed:t,steps:w,variables:{defined:(e.variables??[]).map(o=>({name:o.name,type:o.type,required:o.required,hasDefault:o.default!==void 0})),provided:r.variables||{}},validation:{valid:a.valid,errors:a.errors,warnings:a.warnings},availableTemplates:l,summary:a.valid?`Workflow "${e.name}" loaded (${i}): ${w.length} steps, ${(e.variables??[]).length} variables`:`Workflow "${e.name}" has validation errors: ${a.errors.join("; ")}`}}}catch(n){return{success:!1,error:f(n)}}}};export{u as a};
|