agentic-qe 3.9.30 → 3.9.31
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/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +120 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/bridge/captured-experience-bridge.js +31 -2
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-CI2GZYME.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-TOSXWTUQ.js → agent-booster-wasm-AQXZYWZY.js} +2 -2
- package/dist/cli/chunks/{agent-handler-2BU6TYZZ.js → agent-handler-7N4ZPXCY.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-JFG3BXZY.js → agent-memory-branch-FLKF2JVX.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-KNQKALLI.js +2 -0
- package/dist/cli/chunks/{audit-4IGZZKUW.js → audit-B4V4IKTA.js} +2 -2
- package/dist/cli/chunks/base-P7PRMQWY.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-STKRZIU3.js → better-sqlite3-NYOVLWBG.js} +2 -2
- package/dist/cli/chunks/{brain-handler-RIDW27HH.js → brain-handler-OOXJ2KYY.js} +4 -4
- package/dist/cli/chunks/{branch-enumerator-GMYHLLWD.js → branch-enumerator-LFKFW3A4.js} +2 -2
- package/dist/cli/chunks/{browser-N76A3I2P.js → browser-F72IES2I.js} +2 -2
- package/dist/cli/chunks/browser-workflow-QUP4A763.js +2 -0
- package/dist/cli/chunks/{chunk-JCDEMPJS.js → chunk-2NLZXG6V.js} +1 -1
- package/dist/cli/chunks/{chunk-ETEHVG76.js → chunk-35SFAIXE.js} +2 -2
- package/dist/cli/chunks/{chunk-FG5GL26L.js → chunk-3VKB4HVT.js} +2 -2
- package/dist/cli/chunks/{chunk-XKH4E2IQ.js → chunk-462MZLJB.js} +1 -1
- package/dist/cli/chunks/{chunk-MZ7M2CDV.js → chunk-47QIAHUJ.js} +2 -2
- package/dist/cli/chunks/{chunk-IP6ZTXNJ.js → chunk-4N736EES.js} +2 -2
- package/dist/cli/chunks/{chunk-YXR5RYRE.js → chunk-52D3CYE5.js} +2 -2
- package/dist/cli/chunks/{chunk-C6TNYLD7.js → chunk-5AMAJCZS.js} +3 -3
- package/dist/cli/chunks/{chunk-ZKZTSYPU.js → chunk-5G2L4XRU.js} +2 -2
- package/dist/cli/chunks/{chunk-2MKSEL6F.js → chunk-5M4F3PAL.js} +1 -1
- package/dist/cli/chunks/{chunk-37I6K7QO.js → chunk-5WWQLPB4.js} +2 -2
- package/dist/cli/chunks/chunk-5Z6PYYWK.js +2 -0
- package/dist/cli/chunks/{chunk-MHPK4ZPK.js → chunk-62KYX5NH.js} +2 -2
- package/dist/cli/chunks/{chunk-TYZGEVP6.js → chunk-7MXQV7RB.js} +12 -6
- package/dist/cli/chunks/{chunk-XVTZXCHI.js → chunk-7OVVBBOZ.js} +2 -2
- package/dist/cli/chunks/{chunk-MOLOWMON.js → chunk-7RPEBKQZ.js} +2 -2
- package/dist/cli/chunks/{chunk-5F26LSG2.js → chunk-7UHRT5AX.js} +2 -2
- package/dist/cli/chunks/{chunk-MV3NUANS.js → chunk-7V7TP242.js} +1 -1
- package/dist/cli/chunks/{chunk-WTXRPYNN.js → chunk-A424Z7LA.js} +1 -1
- package/dist/cli/chunks/{chunk-UYLHIGNC.js → chunk-AKFRM4IO.js} +2 -2
- package/dist/cli/chunks/{chunk-OEGFOMXP.js → chunk-AKJWBJDK.js} +2 -2
- package/dist/cli/chunks/{chunk-2GBBZLXT.js → chunk-AQN6PDHI.js} +1 -1
- package/dist/cli/chunks/{chunk-ITBPDVK5.js → chunk-BMS7WFDB.js} +1 -1
- package/dist/cli/chunks/{chunk-2O5TT3UT.js → chunk-BYHUGO73.js} +3 -3
- package/dist/cli/chunks/{chunk-CNNVL5W4.js → chunk-CFLA2GBS.js} +2 -2
- package/dist/cli/chunks/{chunk-Y57V4FDT.js → chunk-CNKOIHF6.js} +2 -2
- package/dist/cli/chunks/{chunk-3EP2YZSY.js → chunk-CQWZNVIM.js} +2 -2
- package/dist/cli/chunks/{chunk-GEXVUFK4.js → chunk-CUSLB7MB.js} +2 -2
- package/dist/cli/chunks/chunk-CYUGE5ZQ.js +2 -0
- package/dist/cli/chunks/{chunk-QNSUPXUU.js → chunk-DMF4Z2M6.js} +2 -2
- package/dist/cli/chunks/{chunk-Z3TXQOS7.js → chunk-DUF733Z7.js} +1 -1
- package/dist/cli/chunks/{chunk-XK6YXCS7.js → chunk-EAIPJSKH.js} +2 -2
- package/dist/cli/chunks/{chunk-TULNR2AH.js → chunk-EJXRBAQF.js} +2 -2
- package/dist/cli/chunks/{chunk-XDYTQPJM.js → chunk-EKYPQ5DX.js} +1 -1
- package/dist/cli/chunks/{chunk-QBDXUI2H.js → chunk-ENCFLC44.js} +2 -2
- package/dist/cli/chunks/{chunk-SAVITYEX.js → chunk-FOAWHNOP.js} +2 -2
- package/dist/cli/chunks/{chunk-QOJ7EAF5.js → chunk-FUHPLXJX.js} +1 -1
- package/dist/cli/chunks/{chunk-KR2PGNXX.js → chunk-G2U7Q6V6.js} +2 -2
- package/dist/cli/chunks/{chunk-DDMFTEJP.js → chunk-G3YKCZWQ.js} +3 -3
- package/dist/cli/chunks/{chunk-YETPSL6H.js → chunk-GJSH4UZ3.js} +3 -3
- package/dist/cli/chunks/{chunk-BQLFOJ5G.js → chunk-GN7FUCJH.js} +1 -1
- package/dist/cli/chunks/{chunk-GY4EGQO3.js → chunk-GQFAVT2I.js} +1 -1
- package/dist/cli/chunks/{chunk-IHRFR5SV.js → chunk-HHEIQHLQ.js} +2 -2
- package/dist/cli/chunks/{chunk-YKFURJNP.js → chunk-I3TFGMOQ.js} +1 -1
- package/dist/cli/chunks/{chunk-LDGNVPBZ.js → chunk-IRRGUXAU.js} +1 -1
- package/dist/cli/chunks/{chunk-IWC6GR24.js → chunk-IY4P35N3.js} +2 -2
- package/dist/cli/chunks/{chunk-AWWD3EI3.js → chunk-JF3U456G.js} +2 -2
- package/dist/cli/chunks/{chunk-5E3YCZC5.js → chunk-JJRZOLDY.js} +2 -2
- package/dist/cli/chunks/{chunk-Q53UMLLC.js → chunk-JKKV5KKS.js} +2 -2
- package/dist/cli/chunks/{chunk-MYF7F3ZP.js → chunk-JMLOEW7Y.js} +2 -2
- package/dist/cli/chunks/chunk-JRIDPOEZ.js +95 -0
- package/dist/cli/chunks/{chunk-T2DIMSQF.js → chunk-K37CNLQZ.js} +1 -1
- package/dist/cli/chunks/{chunk-RNO6CE7I.js → chunk-K6MFAVXK.js} +2 -2
- package/dist/cli/chunks/{chunk-UWWX4RK7.js → chunk-KJAIE7SL.js} +4 -4
- package/dist/cli/chunks/{chunk-ND6VCNN5.js → chunk-KXRDQQGN.js} +2 -2
- package/dist/cli/chunks/{chunk-GRPEDIYG.js → chunk-L4JTTPU7.js} +2 -2
- package/dist/cli/chunks/{chunk-BM73MJLE.js → chunk-L63KB63A.js} +2 -2
- package/dist/cli/chunks/{chunk-R57J3O6I.js → chunk-L7DNPOAQ.js} +2 -2
- package/dist/cli/chunks/{chunk-SJCEPKZO.js → chunk-LF5RO6WO.js} +1 -1
- package/dist/cli/chunks/{chunk-GZ3U2QT2.js → chunk-LRWRFKQH.js} +1 -1
- package/dist/cli/chunks/{chunk-QTS2DS42.js → chunk-M6RVKGIP.js} +2 -2
- package/dist/cli/chunks/{chunk-ECX6VXMW.js → chunk-MAJ5QFVY.js} +1 -1
- package/dist/cli/chunks/chunk-MYCVU3D3.js +14 -0
- package/dist/cli/chunks/{chunk-3AICELMQ.js → chunk-N6P7ENG7.js} +2 -2
- package/dist/cli/chunks/{chunk-7D2DM23U.js → chunk-N6SIKSCO.js} +2 -2
- package/dist/cli/chunks/{chunk-FI4HRS2G.js → chunk-NBKM7NKX.js} +2 -2
- package/dist/cli/chunks/{chunk-QSV4ROZD.js → chunk-NLUBN642.js} +2 -2
- package/dist/cli/chunks/{chunk-FGDEM4HU.js → chunk-NNF3GCGF.js} +2 -2
- package/dist/cli/chunks/{chunk-5DJAJPBG.js → chunk-NTVJKQ5S.js} +2 -2
- package/dist/cli/chunks/{chunk-3WIU2E2Y.js → chunk-NZQYNUGM.js} +2 -2
- package/dist/cli/chunks/{chunk-52TRKIAQ.js → chunk-ONMJJ2C3.js} +1 -1
- package/dist/cli/chunks/{chunk-JNRRDG7O.js → chunk-OXOXNAEZ.js} +2 -2
- package/dist/cli/chunks/chunk-PSF6YQQM.js +180 -0
- package/dist/cli/chunks/{chunk-WP6X67YI.js → chunk-PTOTOBOU.js} +1 -1
- package/dist/cli/chunks/{chunk-UEXOMDRS.js → chunk-PUSZ4NBY.js} +2 -2
- package/dist/cli/chunks/chunk-PYYNY7RJ.js +2 -0
- package/dist/cli/chunks/{chunk-L7X3A36M.js → chunk-QEJBJST4.js} +1 -1
- package/dist/cli/chunks/{chunk-TA3QYAZ6.js → chunk-QGLWFZVQ.js} +2 -2
- package/dist/cli/chunks/{chunk-HB52S6IV.js → chunk-QITO7E7Y.js} +1 -1
- package/dist/cli/chunks/{chunk-KJZXBZQR.js → chunk-QMSDKKYG.js} +1 -1
- package/dist/cli/chunks/{chunk-AQJ6XS34.js → chunk-RBDAHW2M.js} +2 -2
- package/dist/cli/chunks/{chunk-VOBNJWZF.js → chunk-RDJWUKIR.js} +2 -2
- package/dist/cli/chunks/{chunk-EWNJ6OAT.js → chunk-REJEFTWX.js} +1 -1
- package/dist/cli/chunks/{chunk-H27XUYWZ.js → chunk-ROEIR3OD.js} +1 -1
- package/dist/cli/chunks/{chunk-JCWHX4XV.js → chunk-RTGNWRQI.js} +2 -2
- package/dist/cli/chunks/{chunk-FU74OETU.js → chunk-SL4TAJOE.js} +2 -2
- package/dist/cli/chunks/{chunk-3PZDXE5E.js → chunk-T4DDCMKG.js} +113 -113
- package/dist/cli/chunks/{chunk-UROPIIB2.js → chunk-TJGIIGKL.js} +2 -2
- package/dist/cli/chunks/{chunk-BFJLKG3D.js → chunk-TLCCM2AF.js} +1 -1
- package/dist/cli/chunks/{chunk-HJDHQBMJ.js → chunk-TVHWI77X.js} +1 -1
- package/dist/cli/chunks/{chunk-ER6BT4GS.js → chunk-TYUIQSSF.js} +2 -2
- package/dist/cli/chunks/{chunk-R5IW5ARI.js → chunk-UIIEZMSM.js} +1 -1
- package/dist/cli/chunks/{chunk-NMBHF7ZD.js → chunk-UIRTXM7C.js} +15 -15
- package/dist/cli/chunks/{chunk-RYMHYTOK.js → chunk-UNXUSYRL.js} +3 -3
- package/dist/cli/chunks/chunk-VA45HLBF.js +2 -0
- package/dist/cli/chunks/{chunk-DEDFPHJL.js → chunk-VAIOZDG5.js} +1 -1
- package/dist/cli/chunks/{chunk-IEGAEXQX.js → chunk-VLAGWLHF.js} +2 -2
- package/dist/cli/chunks/{chunk-WVODEWH5.js → chunk-VOOJDHLI.js} +14 -8
- package/dist/cli/chunks/{chunk-IOINZWNA.js → chunk-VSKABN3B.js} +29 -17
- package/dist/cli/chunks/{chunk-HQIWLMDS.js → chunk-VUL5HIKR.js} +2 -2
- package/dist/cli/chunks/{chunk-OOFWYDG6.js → chunk-W7XVEWKQ.js} +1 -1
- package/dist/cli/chunks/{chunk-Q4HJRYQB.js → chunk-WB6TI6Q3.js} +2 -2
- package/dist/cli/chunks/{chunk-DJRWVNHK.js → chunk-X2FLWV5C.js} +2 -2
- package/dist/cli/chunks/{chunk-QLNS6DGB.js → chunk-XE4YKDIM.js} +2 -2
- package/dist/cli/chunks/{chunk-6EP3GHED.js → chunk-XGBIXRKD.js} +2 -2
- package/dist/cli/chunks/{chunk-AUNNGKLN.js → chunk-XMMWYQJK.js} +2 -2
- package/dist/cli/chunks/{chunk-FGMHVSLV.js → chunk-XNJ6DIEW.js} +2 -2
- package/dist/cli/chunks/{chunk-4UZQSPR4.js → chunk-XTWYCMAM.js} +2 -2
- package/dist/cli/chunks/{chunk-2NFGUFYU.js → chunk-XY3WUGD3.js} +2 -2
- package/dist/cli/chunks/{chunk-VRP4GB4Y.js → chunk-YEZJE2ZW.js} +4 -4
- package/dist/cli/chunks/{chunk-MCXRS2TZ.js → chunk-YLEMSN46.js} +1 -1
- package/dist/cli/chunks/{chunk-Q26GG6WO.js → chunk-YMN4C32S.js} +3 -3
- package/dist/cli/chunks/{chunk-HA7N45KB.js → chunk-YN7HCVUP.js} +2 -2
- package/dist/cli/chunks/{chunk-E7UHOKKL.js → chunk-YQJBE6NX.js} +2 -2
- package/dist/cli/chunks/{chunk-OTFJCZNY.js → chunk-ZBJRNCWX.js} +2 -2
- package/dist/cli/chunks/{chunk-QHKK2H4H.js → chunk-ZG4EKPGV.js} +1 -1
- package/dist/cli/chunks/{chunk-USN2JKUW.js → chunk-ZWSRIJ2T.js} +2 -2
- package/dist/cli/chunks/{ci-BYCH3NPL.js → ci-LRTJSZHT.js} +2 -2
- package/dist/cli/chunks/{ci-output-P7P4XH6F.js → ci-output-LISCHUKD.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-VLX556ZI.js → circuit-breaker-7PMP25KZ.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-JPR425PL.js → claude-flow-setup-DOW4QVMC.js} +2 -2
- package/dist/cli/chunks/client-XF6SJO2C.js +2 -0
- package/dist/cli/chunks/{cline-installer-FOY47NSH.js → cline-installer-2NXQGW73.js} +2 -2
- package/dist/cli/chunks/{code-57SN4ZDY.js → code-3X6RWAS7.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-GT7UFRYU.js → code-index-extractor-4ABP5WCP.js} +2 -2
- package/dist/cli/chunks/{codex-installer-JAGWONAV.js → codex-installer-V7PII6GL.js} +2 -2
- package/dist/cli/chunks/{completions-7YLHPGSV.js → completions-Y7LNQ63I.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-TQUF6BEI.js → complexity-analyzer-XLYMAM6I.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-TICV6IGT.js → continuedev-installer-GOT4TKNT.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-A6PDMI52.js → copilot-installer-D6BAQVIO.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-NZPNHNV2.js → cost-tracker-VT7C5Q52.js} +2 -2
- package/dist/cli/chunks/{coverage-HBEB2LKS.js → coverage-C62MRP4M.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-J2OFPM6R.js +2 -0
- package/dist/cli/chunks/{cursor-installer-R4FM7MGN.js → cursor-installer-WAWSS2K2.js} +2 -2
- package/dist/cli/chunks/{daemon-PHIZPZIE.js → daemon-CP2ETHRF.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-2L7VCYZ3.js → dag-attention-scheduler-SZIZWPV7.js} +2 -2
- package/dist/cli/chunks/{detect-EEWB4IYE.js → detect-AJX6NJEP.js} +2 -2
- package/dist/cli/chunks/{dist-node-7RM6BB2X.js → dist-node-E5X47QTY.js} +2 -2
- package/dist/cli/chunks/{domain-handler-RVGHBDUJ.js → domain-handler-FN3PIP45.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-M5MERQG5.js → domain-transfer-N3TOJEMT.js} +2 -2
- package/dist/cli/chunks/dream-D5LD5SOZ.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-MS55QS73.js → embed-and-insert-pattern-PJI5TZKR.js} +2 -2
- package/dist/cli/chunks/{eval-MBTMI7KN.js → eval-OS54TDQU.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-Z5XB7D6A.js → experience-capture-middleware-FBM4ANZW.js} +3 -3
- package/dist/cli/chunks/{fast-paths-FSWLHI4I.js → fast-paths-2CVAAPQO.js} +2 -2
- package/dist/cli/chunks/{feature-flags-QUPNH2J5.js → feature-flags-A5KFWVFC.js} +2 -2
- package/dist/cli/chunks/{feature-flags-ATYOPR5D.js → feature-flags-GEXTW6OT.js} +2 -2
- package/dist/cli/chunks/{file-discovery-SOJJEQ2E.js → file-discovery-KWLVC7KN.js} +2 -2
- package/dist/cli/chunks/{fleet-PWBTDWVG.js → fleet-MNKH356S.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-2N67VQOQ.js → gnn-wrapper-ALTWYFVZ.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-5PSG2UPO.js → heartbeat-handler-MBMEPEGW.js} +4 -4
- package/dist/cli/chunks/{heartbeat-scheduler-CNJBAO5C.js → heartbeat-scheduler-OH3SS7MH.js} +2 -2
- package/dist/cli/chunks/hnsw-adapter-M2MMM3N6.js +2 -0
- package/dist/cli/chunks/hnsw-index-JO7KNF7M.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-YIXH5T4U.js → hnsw-legacy-bridge-WTD5PR5V.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-3U2AVWQ3.js → hnswlib-node-WENGW3YX.js} +2 -2
- package/dist/cli/chunks/hooks-ELHGEBFK.js +248 -0
- package/dist/cli/chunks/{hybrid-router-RL47S47Z.js → hybrid-router-D6ZMIZCE.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-XW2IHFWW.js → hypergraph-engine-JOQ6TERZ.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-AQXKY4UF.js → hypergraph-handler-HX45YWWN.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-ROQL4J7P.js +2 -0
- package/dist/cli/chunks/{init-handler-KXYGJQI5.js → init-handler-TNVU6NQ6.js} +6 -6
- package/dist/cli/chunks/init-wizard-4BDFZX4M.js +2 -0
- package/dist/cli/chunks/kernel-37Y63WKR.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-VSULDGRO.js → kilocode-installer-YC5RJIY4.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-SH4D2UXW.js → kiro-installer-EAB26M55.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-V3DX6ZCX.js +2 -0
- package/dist/cli/chunks/learning-A2OB7D2B.js +117 -0
- package/dist/cli/chunks/{llm-router-YXXSQX5K.js → llm-router-KEG6PA7C.js} +4 -4
- package/dist/cli/chunks/{load-S52R2SLL.js → load-D6ZDLVA3.js} +2 -2
- package/dist/cli/chunks/load-test-HPBA2CMT.js +2 -0
- package/dist/cli/chunks/{mcp-ZWMAJIU7.js → mcp-ERJHZ6FN.js} +2 -2
- package/dist/cli/chunks/{memory-4YTWWDK7.js → memory-GSRIJIVR.js} +5 -5
- package/dist/cli/chunks/memory-backend-DODDBB46.js +2 -0
- package/dist/cli/chunks/memory-handlers-MFLCRS7V.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-F3VEM2UF.js → multi-model-executor-GK3V7ERC.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-Z2CUJQ6D.js → opencode-installer-6TTN26RG.js} +2 -2
- package/dist/cli/chunks/{orchestrator-UPXR2XOF.js → orchestrator-YVTSM6QW.js} +37 -18
- package/dist/cli/chunks/{pipeline-6MEMAIXM.js → pipeline-EWLJCY5G.js} +2 -2
- package/dist/cli/chunks/{platform-H72FLOM7.js → platform-2ULHQQME.js} +2 -2
- package/dist/cli/chunks/{plugin-GIMQFDVR.js → plugin-PYN2KOXA.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-DM5FR5SV.js → prime-radiant-advanced-wasm-IULCTOGZ.js} +2 -2
- package/dist/cli/chunks/protocol-executor-D56OYMCJ.js +2 -0
- package/dist/cli/chunks/{protocol-handler-YW3N333B.js → protocol-handler-FZYI2SBP.js} +2 -2
- package/dist/cli/chunks/{prove-IJY524KK.js → prove-DN7S74SP.js} +2 -2
- package/dist/cli/chunks/{provider-manager-FNG6YR2V.js → provider-manager-FT3MCROB.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-KXROIEK7.js +2 -0
- package/dist/cli/chunks/{quality-EZLAMSCP.js → quality-ITBU6LGC.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-XOGATERL.js +2 -0
- package/dist/cli/chunks/{real-embeddings-MFRCC6GH.js → real-embeddings-PZUZ5RXJ.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-H3ZIRGWU.js → roocode-installer-2LMVZOUZ.js} +2 -2
- package/dist/cli/chunks/router-3EHNUCOM.js +2 -0
- package/dist/cli/chunks/routing-feedback-ZHKGET22.js +2 -0
- package/dist/cli/chunks/{routing-handler-T2A7FYHW.js → routing-handler-5RB73UCF.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-TCLWBP2M.js → ruvector-commands-VBN4APMG.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-BE3JCPYC.js → rvf-dual-writer-BNY4AUWT.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-MLUX5YGR.js → rvf-migration-adapter-73MKPBGV.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-OAQXTASZ.js → rvf-migration-coordinator-SGVB7ZAZ.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-4YC5IQUW.js +2 -0
- package/dist/cli/chunks/safe-db-PLJRHQIC.js +2 -0
- package/dist/cli/chunks/schedule-7DGELVJE.js +2 -0
- package/dist/cli/chunks/scheduler-VWASEC2J.js +2 -0
- package/dist/cli/chunks/{security-SHWJWJ4M.js → security-XUH4H7R3.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-DCVDY2XW.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-BKSR2FFK.js → shared-rvf-dual-writer-GML4EDYF.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-CTEBGVOW.js +2 -0
- package/dist/cli/chunks/{status-handler-QK5KMKYC.js → status-handler-XI7GJF6Z.js} +2 -2
- package/dist/cli/chunks/{structural-health-3BRNCAYQ.js → structural-health-WPCYKOXV.js} +2 -2
- package/dist/cli/chunks/{sync-5CDYOT3H.js → sync-SFKTCRZC.js} +2 -2
- package/dist/cli/chunks/{task-handler-VH2CLUIA.js → task-handler-FZB55IEG.js} +2 -2
- package/dist/cli/chunks/{task-handlers-BUZNV2VX.js → task-handlers-EXZGFH7F.js} +3 -3
- package/dist/cli/chunks/{test-K24JQQZ2.js → test-XYRN4OVU.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-MHXRV5VI.js → test-scheduling-FLVOPGOT.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-3NZDLG52.js → token-bootstrap-FDCFVRHM.js} +2 -2
- package/dist/cli/chunks/{token-usage-C4BGA2O7.js → token-usage-MHNZF3DM.js} +2 -2
- package/dist/cli/chunks/{transformers-ZIIFB2V4.js → transformers-4CRVTMWY.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-GES2AV7A.js → tree-sitter-wasm-parser-CI3V4AND.js} +2 -2
- package/dist/cli/chunks/{types-L3MO5VNC.js → types-RKCD4BNL.js} +2 -2
- package/dist/cli/chunks/unified-memory-YDKXKW3D.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-6N7YZCLR.js +2 -0
- package/dist/cli/chunks/unified-persistence-UTWLPUQI.js +2 -0
- package/dist/cli/chunks/{upgrade-EKJYS5S5.js → upgrade-463W7VKH.js} +2 -2
- package/dist/cli/chunks/{validate-WYWWB5PQ.js → validate-LENSMEAY.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-SBSWKJ3H.js → validate-swarm-4FEBNAWA.js} +2 -2
- package/dist/cli/chunks/{vibium-VEMTLNFV.js → vibium-TXNVIVWJ.js} +2 -2
- package/dist/cli/chunks/visual-security-DGXSOFKD.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-STW2WR2J.js → web-tree-sitter-BZEGWID4.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-6ZXMJASZ.js → windsurf-installer-7AFXJTPU.js} +2 -2
- package/dist/cli/chunks/{witness-chain-PTULB4MR.js → witness-chain-G6SUZOZG.js} +2 -2
- package/dist/cli/chunks/witness-chain-VP4MF6EU.js +2 -0
- package/dist/cli/chunks/{workflow-TEBAAHNR.js → workflow-EVQPO6FH.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-VXSYAKQY.js +2 -0
- package/dist/cli/chunks/{wrappers-DVMVRKXK.js → wrappers-HR6RUDI2.js} +2 -2
- package/dist/cli/commands/hooks-handlers/editing-hooks.js +9 -3
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +16 -24
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +1 -1
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +8 -1
- package/dist/cli/commands/hooks-handlers/routing-hooks.js +15 -3
- package/dist/cli/commands/hooks-handlers/task-hooks.js +37 -46
- package/dist/cli/commands/learning.js +194 -0
- package/dist/init/phases/10-workers.js +20 -1
- package/dist/kernel/interfaces.d.ts +12 -0
- package/dist/kernel/kernel.d.ts +1 -0
- package/dist/kernel/kernel.js +57 -0
- package/dist/kernel/unified-memory-schemas.d.ts +1 -1
- package/dist/kernel/unified-memory-schemas.js +7 -1
- package/dist/learning/agent-routing.d.ts +134 -1
- package/dist/learning/agent-routing.js +185 -2
- package/dist/learning/dream/dream-insights-pruner.d.ts +49 -0
- package/dist/learning/dream/dream-insights-pruner.js +53 -0
- package/dist/learning/dream/dream-scheduler.js +17 -0
- package/dist/learning/loop-health.d.ts +84 -0
- package/dist/learning/loop-health.js +91 -0
- package/dist/learning/pattern-usage-recorder.d.ts +58 -0
- package/dist/learning/pattern-usage-recorder.js +72 -0
- package/dist/learning/qe-reasoning-bank-types.d.ts +11 -0
- package/dist/learning/qe-reasoning-bank.d.ts +11 -0
- package/dist/learning/qe-reasoning-bank.js +86 -3
- package/dist/learning/routing-topology-gate.d.ts +40 -0
- package/dist/learning/routing-topology-gate.js +55 -0
- package/dist/learning/sqlite-persistence.d.ts +6 -1
- package/dist/learning/sqlite-persistence.js +14 -20
- package/dist/mcp/bundle.js +3831 -3805
- package/dist/routing/routing-feedback.js +7 -3
- package/dist/routing/routing-outcomes-migration.d.ts +31 -0
- package/dist/routing/routing-outcomes-migration.js +60 -0
- package/dist/workers/workers/learning-consolidation.d.ts +28 -0
- package/dist/workers/workers/learning-consolidation.js +204 -0
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-HV42JOZD.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-GL22PE2V.js +0 -2
- package/dist/cli/chunks/base-4KQ2FGUX.js +0 -2
- package/dist/cli/chunks/browser-workflow-CTE7BDM4.js +0 -2
- package/dist/cli/chunks/chunk-3NGNSKL3.js +0 -14
- package/dist/cli/chunks/chunk-6HSFZ6SL.js +0 -180
- package/dist/cli/chunks/chunk-7Z3GBQNV.js +0 -2
- package/dist/cli/chunks/chunk-H2IMXQCJ.js +0 -2
- package/dist/cli/chunks/chunk-SPCANEJY.js +0 -95
- package/dist/cli/chunks/client-FRVNMXQO.js +0 -2
- package/dist/cli/chunks/cross-domain-router-BVCPAWG2.js +0 -2
- package/dist/cli/chunks/dream-77ODIFIF.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-CQGQS3V7.js +0 -2
- package/dist/cli/chunks/hnsw-index-2ACF6FOJ.js +0 -2
- package/dist/cli/chunks/hooks-YROFO6PE.js +0 -259
- package/dist/cli/chunks/impact-analyzer-LWEGK23B.js +0 -2
- package/dist/cli/chunks/init-wizard-7BS3QMWR.js +0 -2
- package/dist/cli/chunks/kernel-TX67WXSI.js +0 -2
- package/dist/cli/chunks/knowledge-graph-TDSP2UE2.js +0 -2
- package/dist/cli/chunks/learning-RRWV3SEL.js +0 -107
- package/dist/cli/chunks/load-test-GEBBBUMV.js +0 -2
- package/dist/cli/chunks/memory-backend-WQS2MLW2.js +0 -2
- package/dist/cli/chunks/memory-handlers-RTY5MBA5.js +0 -2
- package/dist/cli/chunks/protocol-executor-DT7XHMLL.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-LDNETZVA.js +0 -2
- package/dist/cli/chunks/queen-coordinator-AF7HCQSM.js +0 -2
- package/dist/cli/chunks/router-OWQ5EI72.js +0 -2
- package/dist/cli/chunks/routing-feedback-B43DEQMK.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-XBJDXHNI.js +0 -2
- package/dist/cli/chunks/safe-db-RT3LEDUG.js +0 -2
- package/dist/cli/chunks/schedule-EHUDCKS2.js +0 -2
- package/dist/cli/chunks/scheduler-GEGZ4J3C.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-LNBUNRAM.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-3DGRJH3K.js +0 -2
- package/dist/cli/chunks/unified-memory-ZSBX4LYU.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-Y6EKAMRP.js +0 -2
- package/dist/cli/chunks/unified-persistence-2PDVU2U5.js +0 -2
- package/dist/cli/chunks/visual-security-RHMFLKVQ.js +0 -2
- package/dist/cli/chunks/witness-chain-QO237QOF.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-RHM5MIGE.js +0 -2
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{a as W}from"./chunk-ND6VCNN5.js";import{c as V,d as q}from"./chunk-DDMFTEJP.js";import{c as M}from"./chunk-IHRFR5SV.js";import{a as $}from"./chunk-7Z3GBQNV.js";import{c as N}from"./chunk-3WIU2E2Y.js";import{b as D,d as H}from"./chunk-Q4HJRYQB.js";import{a as E,c as k}from"./chunk-RNO6CE7I.js";import{i as y}from"./chunk-GY4EGQO3.js";import{a as R,b as U,d as J}from"./chunk-37I6K7QO.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
|
-
INSERT INTO concept_nodes
|
|
4
|
-
(id, concept_type, content, embedding, activation_level, last_activated, pattern_id, metadata)
|
|
5
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
6
|
-
`)),this.prepared.set("getNode",this.db.prepare(`
|
|
7
|
-
SELECT * FROM concept_nodes WHERE id = ?
|
|
8
|
-
`)),this.prepared.set("updateActivation",this.db.prepare(`
|
|
9
|
-
UPDATE concept_nodes
|
|
10
|
-
SET activation_level = ?, last_activated = datetime('now')
|
|
11
|
-
WHERE id = ?
|
|
12
|
-
`)),this.prepared.set("getActiveNodes",this.db.prepare(`
|
|
13
|
-
SELECT * FROM concept_nodes
|
|
14
|
-
WHERE activation_level >= ?
|
|
15
|
-
ORDER BY activation_level DESC
|
|
16
|
-
`)),this.prepared.set("getNodesByType",this.db.prepare(`
|
|
17
|
-
SELECT * FROM concept_nodes WHERE concept_type = ?
|
|
18
|
-
`)),this.prepared.set("getAllNodes",this.db.prepare(`
|
|
19
|
-
SELECT * FROM concept_nodes
|
|
20
|
-
`)),this.prepared.set("insertEdge",this.db.prepare(`
|
|
21
|
-
INSERT INTO concept_edges
|
|
22
|
-
(id, source, target, edge_type, weight, evidence)
|
|
23
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
24
|
-
`)),this.prepared.set("getEdge",this.db.prepare(`
|
|
25
|
-
SELECT * FROM concept_edges WHERE source = ? AND target = ?
|
|
26
|
-
`)),this.prepared.set("updateEdge",this.db.prepare(`
|
|
27
|
-
UPDATE concept_edges
|
|
28
|
-
SET weight = ?, evidence = evidence + 1, updated_at = datetime('now')
|
|
29
|
-
WHERE source = ? AND target = ?
|
|
30
|
-
`)),this.prepared.set("getOutgoingEdges",this.db.prepare(`
|
|
31
|
-
SELECT * FROM concept_edges WHERE source = ?
|
|
32
|
-
`)),this.prepared.set("getIncomingEdges",this.db.prepare(`
|
|
33
|
-
SELECT * FROM concept_edges WHERE target = ?
|
|
34
|
-
`)),this.prepared.set("countNodes",this.db.prepare(`
|
|
35
|
-
SELECT COUNT(*) as count FROM concept_nodes
|
|
36
|
-
`)),this.prepared.set("countEdges",this.db.prepare(`
|
|
37
|
-
SELECT COUNT(*) as count FROM concept_edges
|
|
38
|
-
`)),this.prepared.set("countByType",this.db.prepare(`
|
|
39
|
-
SELECT concept_type, COUNT(*) as count FROM concept_nodes GROUP BY concept_type
|
|
40
|
-
`))}async addNode(e){this.ensureInitialized();let t=y(),n=new Date().toISOString(),i=this.prepared.get("insertNode");if(!i)throw new Error("Prepared statement not found: insertNode");let a=e.embedding?Buffer.from(new Float32Array(e.embedding).buffer):null;return i.run(t,e.conceptType,e.content,a,0,n,e.patternId||null,e.metadata?JSON.stringify(e.metadata):null),this.config.debug&&console.log(`[ConceptGraph] Added node: ${t} (${e.conceptType})`),t}async getNode(e){this.ensureInitialized();let t=this.prepared.get("getNode");if(!t)throw new Error("Prepared statement not found: getNode");let n=t.get(e);return n?this.rowToNode(n):null}async updateActivation(e,t){this.ensureInitialized();let n=this.prepared.get("updateActivation");if(!n)throw new Error("Prepared statement not found: updateActivation");let i=Math.max(0,Math.min(1,t));n.run(i,e)}async getActiveNodes(e=.1){this.ensureInitialized();let t=this.prepared.get("getActiveNodes");if(!t)throw new Error("Prepared statement not found: getActiveNodes");return t.all(e).map(i=>this.rowToNode(i))}async getNodesByType(e){this.ensureInitialized();let t=this.prepared.get("getNodesByType");if(!t)throw new Error("Prepared statement not found: getNodesByType");return t.all(e).map(i=>this.rowToNode(i))}async addEdge(e,t,n,i=1){this.ensureInitialized();let a=await this.getEdgeBetween(e,t);if(a)return await this.strengthenEdge(e,t,.1),a.id;let r=y(),o=this.prepared.get("insertEdge");if(!o)throw new Error("Prepared statement not found: insertEdge");return o.run(r,e,t,n,Math.max(0,Math.min(1,i)),1),this.config.debug&&console.log(`[ConceptGraph] Added edge: ${e} -> ${t} (${n})`),r}async strengthenEdge(e,t,n=.1){this.ensureInitialized();let i=await this.getEdgeBetween(e,t);if(!i)return;let a=Math.min(1,i.weight+n),r=this.prepared.get("updateEdge");if(!r)throw new Error("Prepared statement not found: updateEdge");r.run(a,e,t)}async getNeighbors(e){this.ensureInitialized();let t=[],n=this.prepared.get("getOutgoingEdges");if(!n)throw new Error("Prepared statement not found: getOutgoingEdges");let i=n.all(e);for(let o of i){let s=await this.getNode(o.target);s&&t.push({node:s,edge:this.rowToEdge(o)})}let a=this.prepared.get("getIncomingEdges");if(!a)throw new Error("Prepared statement not found: getIncomingEdges");let r=a.all(e);for(let o of r){let s=await this.getNode(o.source);s&&t.push({node:s,edge:this.rowToEdge(o)})}return t}async findPath(e,t,n=5){this.ensureInitialized();let i=new Set,a=[{nodeId:e,path:[e]}];for(;a.length>0;){let r=a.shift();if(r.nodeId===t){let s=[];for(let c of r.path){let p=await this.getNode(c);p&&s.push(p)}return s}if(r.path.length>n||i.has(r.nodeId))continue;i.add(r.nodeId);let o=await this.getNeighbors(r.nodeId);for(let{node:s}of o)i.has(s.id)||a.push({nodeId:s.id,path:[...r.path,s.id]})}return[]}async getCluster(e,t=2){this.ensureInitialized();let n=new Set,i=[],a=async(r,o)=>{if(n.has(r)||o>t)return;n.add(r);let s=await this.getNode(r);if(s&&(i.push(s),o<t)){let c=await this.getNeighbors(r);for(let{node:p}of c)await a(p.id,o+1)}};return await a(e,0),i}async loadFromPatterns(e){this.ensureInitialized();let t=0,n=[],i=new Map;for(let a of e)try{if(await this.findNodeByPatternId(a.id))continue;let o=await this.addNode({conceptType:"pattern",content:`${a.name}: ${a.description}`,patternId:a.id,metadata:{domain:a.domain,patternType:a.patternType,confidence:a.confidence,successRate:a.successRate}});t++,n.push(o);let s=a.domain||"unknown";i.has(s)||i.set(s,[]),i.get(s).push(o);let c=await this.findDomainNode(a.domain);if(!c){let p=await this.addNode({conceptType:"domain",content:a.domain,metadata:{patternCount:1}});c=await this.getNode(p)}c&&await this.addEdge(o,c.id,"co_occurrence",.8)}catch(r){this.config.debug&&console.error(`[ConceptGraph] Failed to load pattern: ${a.id}`,r)}if(t>0){let a=await this.discoverSameDomainEdges(i),r=await this.pruneEdges();this.config.debug&&console.log(`[ConceptGraph] Discovered ${a} same-domain edges, pruned ${r}`)}return console.log(`[ConceptGraph] Loaded ${t} new patterns (${e.length-t} already existed)`),t}async discoverSameDomainEdges(e){if(this.ensureInitialized(),!this.db)return 0;let t=15,n=5e3,i=0;if(e&&e.size>0)for(let[a,r]of e){let o=this.countDomainSimilarityEdges(a);if(o>=n){console.log(`[ConceptGraph] Domain '${a}' already at edge cap (${o}/${n}), skipping`);continue}let s=new Set(r),c=n-o,d=this.db.prepare("SELECT id, metadata FROM concept_nodes WHERE concept_type = 'pattern'").all().filter(u=>{if(s.has(u.id))return!1;let m=u.metadata?D(u.metadata):{};return String(m.domain||"unknown")===a}),l=this.db.transaction(()=>{let u=0;for(let m of r){let v=0;for(let f of d){if(v>=t||u>=c)break;if(!this.prepared.get("getEdge")?.get(m,f.id)){let w=y();this.prepared.get("insertEdge").run(w,m,f.id,"similarity",.6,1),u++,v++}}if(u>=c)break}for(let m=0;m<r.length&&u<c;m++){let v=0;for(let f=m+1;f<r.length&&u<c&&!(v>=t);f++)if(!this.prepared.get("getEdge")?.get(r[m],r[f])){let w=y();this.prepared.get("insertEdge").run(w,r[m],r[f],"similarity",.6,1),u++,v++}}return u});i+=l()}else{let a=this.db.prepare("SELECT id, metadata FROM concept_nodes WHERE concept_type = 'pattern'").all(),r=new Map;for(let s of a){let c=s.metadata?D(s.metadata):{},p=String(c.domain||"unknown");r.has(p)||r.set(p,[]),r.get(p).push(s)}let o=this.db.transaction(()=>{let s=0;for(let[c,p]of r){let d=this.countDomainSimilarityEdges(c);if(d>=n)continue;let l=0,u=n-d;for(let m=0;m<p.length&&l<u;m++){let v=0;for(let f=m+1;f<p.length&&l<u&&!(v>=t);f++)if(!this.prepared.get("getEdge")?.get(p[m].id,p[f].id)){let w=y();this.prepared.get("insertEdge").run(w,p[m].id,p[f].id,"similarity",.6,1),s++,l++,v++}}}return s});i+=o()}return i}countDomainSimilarityEdges(e){return this.db?this.db.prepare(`
|
|
41
|
-
SELECT COUNT(*) as count FROM concept_edges e
|
|
42
|
-
JOIN concept_nodes n ON e.source = n.id
|
|
43
|
-
WHERE e.edge_type = 'similarity'
|
|
44
|
-
AND n.concept_type = 'pattern'
|
|
45
|
-
AND json_extract(n.metadata, '$.domain') = ?
|
|
46
|
-
`).get(e).count:0}async pruneEdges(e=15,t=.3){if(this.ensureInitialized(),!this.db)return 0;let n=0;return n=this.db.transaction(()=>{let a=0,r=this.db.prepare(`
|
|
47
|
-
DELETE FROM concept_edges
|
|
48
|
-
WHERE edge_type = 'similarity' AND weight < ?
|
|
49
|
-
`).run(t);a+=r.changes;let o=this.db.prepare(`
|
|
50
|
-
SELECT source, COUNT(*) as cnt FROM concept_edges
|
|
51
|
-
WHERE edge_type = 'similarity'
|
|
52
|
-
GROUP BY source
|
|
53
|
-
HAVING cnt > ?
|
|
54
|
-
`).all(e);for(let{source:s}of o){let c=this.db.prepare(`
|
|
55
|
-
DELETE FROM concept_edges
|
|
56
|
-
WHERE id IN (
|
|
57
|
-
SELECT id FROM concept_edges
|
|
58
|
-
WHERE source = ? AND edge_type = 'similarity'
|
|
59
|
-
ORDER BY weight DESC
|
|
60
|
-
LIMIT -1 OFFSET ?
|
|
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}db;thresholds;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-QUPNH2J5.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}graph;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();try{this.db.pragma("busy_timeout = 60000")}catch{}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
|
-
confidence, success_rate as successRate
|
|
64
|
-
FROM qe_patterns
|
|
65
|
-
WHERE confidence >= 0.3
|
|
66
|
-
ORDER BY quality_score DESC
|
|
67
|
-
LIMIT 200`).all();return t.length===0?0:this.graph.loadFromPatterns(t)}async applyInsight(e){this.ensureInitialized();try{let t=await this.getInsightRowById(e);if(!t)return{success:!1,error:`Insight not found: ${e}`};if(t.actionable!==1)return{success:!1,error:"Insight is not actionable"};if(t.applied===1)return{success:!0,patternId:t.pattern_id??void 0,error:"Insight already applied"};let n=`dream-pattern-${y()}`;return this.db.prepare(`
|
|
68
|
-
UPDATE dream_insights
|
|
69
|
-
SET applied = 1, pattern_id = ?
|
|
70
|
-
WHERE id = ?
|
|
71
|
-
`).run(n,e),{success:!0,patternId:n}}catch(t){return{success:!1,error:E(t)}}}async getPendingInsights(e){this.ensureInitialized();let t=e??20;return this.db.prepare(`
|
|
72
|
-
SELECT * FROM dream_insights
|
|
73
|
-
WHERE applied = 0 AND actionable = 1
|
|
74
|
-
ORDER BY novelty_score DESC, confidence_score DESC
|
|
75
|
-
LIMIT ?
|
|
76
|
-
`).all(t).map(a=>this.rowToInsight(a))}async getDreamHistory(e){this.ensureInitialized();let t=e??20;return this.db.prepare(`
|
|
77
|
-
SELECT * FROM dream_cycles
|
|
78
|
-
ORDER BY start_time DESC
|
|
79
|
-
LIMIT ?
|
|
80
|
-
`).all(t).map(a=>this.rowToCycle(a))}async cancelDream(){this.cancelled=!0}isDreaming(){return this.currentCycle!==null&&this.currentCycle.status==="running"}getCurrentCycle(){return this.currentCycle?{...this.currentCycle}:null}async saveCycle(e){if(!this.db)return;this.db.prepare(`
|
|
81
|
-
INSERT INTO dream_cycles
|
|
82
|
-
(id, start_time, end_time, duration_ms, concepts_processed, associations_found,
|
|
83
|
-
insights_generated, status, error, created_at)
|
|
84
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
85
|
-
`).run(e.id,e.startTime.toISOString(),e.endTime?.toISOString()??null,e.durationMs??null,e.conceptsProcessed,e.associationsFound,e.insightsGenerated,e.status,e.error??null,e.startTime.toISOString())}async updateCycle(e){if(!this.db)return;this.db.prepare(`
|
|
86
|
-
UPDATE dream_cycles
|
|
87
|
-
SET end_time = ?, duration_ms = ?, concepts_processed = ?, associations_found = ?,
|
|
88
|
-
insights_generated = ?, status = ?, error = ?
|
|
89
|
-
WHERE id = ?
|
|
90
|
-
`).run(e.endTime?.toISOString()??null,e.durationMs??null,e.conceptsProcessed,e.associationsFound,e.insightsGenerated,e.status,e.error??null,e.id)}async saveInsight(e){if(!this.db)return;this.db.prepare(`
|
|
91
|
-
INSERT INTO dream_insights
|
|
92
|
-
(id, cycle_id, insight_type, source_concepts, description, novelty_score,
|
|
93
|
-
confidence_score, actionable, applied, suggested_action, pattern_id)
|
|
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-QUPNH2J5.js").then(({isRVFPatternStoreEnabled:t})=>t()?import("./shared-rvf-adapter-LNBUNRAM.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)}db;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 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{c as a,d as b,e as c}from"./chunk-YETPSL6H.js";import"./chunk-FI4HRS2G.js";import"./chunk-RNO6CE7I.js";import"./chunk-ITBPDVK5.js";c();export{a as VibiumClientImpl,b as VibiumClientProvider};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{a,b}from"./chunk-ER6BT4GS.js";import"./chunk-XDYTQPJM.js";import"./chunk-LDGNVPBZ.js";import"./chunk-GY4EGQO3.js";import"./chunk-ITBPDVK5.js";export{a as CrossDomainEventRouter,b as createCrossDomainRouter};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-SPCANEJY.js";import"./chunk-ND6VCNN5.js";import"./chunk-DDMFTEJP.js";import"./chunk-HA7N45KB.js";import"./chunk-WVODEWH5.js";import"./chunk-VRP4GB4Y.js";import"./chunk-R5IW5ARI.js";import"./chunk-2GBBZLXT.js";import"./chunk-QHKK2H4H.js";import"./chunk-IOINZWNA.js";import"./chunk-Y57V4FDT.js";import"./chunk-3AICELMQ.js";import"./chunk-QTS2DS42.js";import"./chunk-5DJAJPBG.js";import"./chunk-4UZQSPR4.js";import"./chunk-IHRFR5SV.js";import"./chunk-TYZGEVP6.js";import"./chunk-DJRWVNHK.js";import"./chunk-7Z3GBQNV.js";import"./chunk-3WIU2E2Y.js";import"./chunk-Q4HJRYQB.js";import"./chunk-LDGNVPBZ.js";import"./chunk-RNO6CE7I.js";import"./chunk-GY4EGQO3.js";import"./chunk-CNNVL5W4.js";import"./chunk-TULNR2AH.js";import"./chunk-7D2DM23U.js";import"./chunk-37I6K7QO.js";import"./chunk-XVTZXCHI.js";import"./chunk-KR2PGNXX.js";import"./chunk-GEXVUFK4.js";import"./chunk-QNSUPXUU.js";import"./chunk-UYLHIGNC.js";import"./chunk-ITBPDVK5.js";export{t as BUILT_IN_STRATEGIES,b as ConceptGraph,g as DEFAULT_ACTIVATION_CONFIG,a as DEFAULT_CONCEPT_GRAPH_CONFIG,m as DEFAULT_DREAM_CONFIG,q as DEFAULT_DREAM_SCHEDULER_CONFIG,i as DEFAULT_INSIGHT_CONFIG,k as DEFAULT_VALIDATION_THRESHOLDS,n as DreamEngine,r as DreamScheduler,f as HISTORY_TRIM_TARGET_RATIO,j as InsightGenerator,d as MAX_ACTIVATION_HISTORY_ENTRIES,e as MAX_COACTIVATION_ENTRIES,l as RVCOWBranchManager,u as SpeculativeDreamer,h as SpreadingActivation,c as createConceptGraph,o as createDreamEngine,s as createDreamScheduler,p as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{a,c as b}from"./chunk-GEXVUFK4.js";import"./chunk-QNSUPXUU.js";import"./chunk-UYLHIGNC.js";import"./chunk-ITBPDVK5.js";b();export{a as HnswAdapter};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{a,b,c,d}from"./chunk-IEGAEXQX.js";import"./chunk-7Z3GBQNV.js";import"./chunk-3WIU2E2Y.js";import"./chunk-37I6K7QO.js";import"./chunk-GEXVUFK4.js";import"./chunk-QNSUPXUU.js";import"./chunk-UYLHIGNC.js";import"./chunk-ITBPDVK5.js";export{a as DEFAULT_HNSW_CONFIG,b as HNSWIndex,d as benchmarkHNSW,c as createHNSWIndex};
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
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.30");process.exit(0)}
|
|
3
|
-
import{a as R,b as oe,c as re}from"./chunk-C6TNYLD7.js";import{a as ae,b as ie}from"./chunk-HA7N45KB.js";import{g as K}from"./chunk-WVODEWH5.js";import"./chunk-VRP4GB4Y.js";import"./chunk-R5IW5ARI.js";import"./chunk-2GBBZLXT.js";import"./chunk-QHKK2H4H.js";import"./chunk-IOINZWNA.js";import"./chunk-3AICELMQ.js";import{a as se}from"./chunk-XK6YXCS7.js";import"./chunk-QTS2DS42.js";import"./chunk-5DJAJPBG.js";import"./chunk-4UZQSPR4.js";import{f as T,k as j,o as H}from"./chunk-TYZGEVP6.js";import"./chunk-DJRWVNHK.js";import"./chunk-7Z3GBQNV.js";import"./chunk-3WIU2E2Y.js";import{b as ne,d as we}from"./chunk-Q4HJRYQB.js";import"./chunk-LDGNVPBZ.js";import"./chunk-RNO6CE7I.js";import"./chunk-GY4EGQO3.js";import"./chunk-CNNVL5W4.js";import"./chunk-TULNR2AH.js";import"./chunk-7D2DM23U.js";import"./chunk-37I6K7QO.js";import"./chunk-XVTZXCHI.js";import"./chunk-KR2PGNXX.js";import"./chunk-GEXVUFK4.js";import"./chunk-QNSUPXUU.js";import"./chunk-UYLHIGNC.js";import"./chunk-ITBPDVK5.js";import{Command as Be}from"commander";import P from"chalk";import me from"node:path";H();import{randomUUID as B}from"crypto";import x from"chalk";var N="dream-scheduler:hook-state",ce=36e5,de=20,ue=3e5;async function Y(n){try{let e=await n.get(N);if(!e)return{triggered:!1,reason:"no-state"};let t=Date.now(),s=e.lastDreamTime?new Date(e.lastDreamTime).getTime():0,o=t-s;if(o<ue)return{triggered:!1,reason:"too-soon"};let r=o>=ce,a=e.experienceCount>=de;if(!r&&!a)return{triggered:!1,reason:"conditions-not-met"};let c=r?"time-interval":"experience-threshold";console.log(x.dim(`[hooks] Dream trigger: ${c} (${e.experienceCount} experiences, ${Math.round(o/6e4)}min since last dream)`));try{let{getUnifiedMemory:m}=await import("./unified-memory-ZSBX4LYU.js"),y=m();if(y.isInitialized()){let I=y.getDatabase().prepare(`SELECT COUNT(*) AS n FROM dream_cycles
|
|
4
|
-
WHERE status = 'running'
|
|
5
|
-
AND start_time > datetime('now', '-60 seconds')`).get();if(I&&I.n>0)return{triggered:!1,reason:"already-running"}}}catch{}let{createDreamEngine:i}=await import("./dream-77ODIFIF.js"),{createQEReasoningBank:h}=await import("./qe-reasoning-bank-LDNETZVA.js"),d=i({maxDurationMs:1e4,minConceptsRequired:3});await d.initialize();let p=h(n,void 0,{enableLearning:!0,enableGuidance:!1,enableRouting:!1,embeddingDimension:384,useONNXEmbeddings:!0});await p.initialize();let u=await p.searchPatterns("",{limit:100,minConfidence:.3});if(u.success&&u.value.length>0){let m=u.value.map(y=>({id:y.pattern.id,name:y.pattern.name,description:y.pattern.description||`${y.pattern.patternType} pattern`,domain:y.pattern.qeDomain||"learning-optimization",patternType:y.pattern.patternType,confidence:y.pattern.confidence,successRate:y.pattern.successRate||.5}));await d.loadPatternsAsConcepts(m)}let l=await d.dream(1e4),f=0;try{for(let m of l.insights)m.actionable&&m.confidenceScore>=.5&&(await d.applyInsight(m.id)).success&&f++}catch(m){console.error(x.dim(`[hooks] Dream apply: ${m instanceof Error?m.message:"unknown"}`))}return e.lastDreamTime=new Date().toISOString(),e.experienceCount=0,e.totalDreamsThisSession++,await n.set(N,e),await d.close(),{triggered:!0,reason:c,insightsGenerated:l.insights.length,insightsApplied:f}}catch(e){return console.error(x.dim(`[hooks] Dream trigger failed: ${e instanceof Error?e.message:"unknown"}`)),{triggered:!1,reason:"error"}}}async function O(n){try{let e=await n.get(N);return e||(e={lastDreamTime:null,experienceCount:0,sessionStartTime:new Date().toISOString(),totalDreamsThisSession:0}),e.experienceCount++,await n.set(N,e),e.experienceCount}catch{return 0}}async function U(n){try{let{getUnifiedMemory:e}=await import("./unified-memory-ZSBX4LYU.js"),t=e();t.isInitialized()||await t.initialize();let{initializeExperienceCapture:s}=await import("./experience-capture-middleware-Z5XB7D6A.js");await s();let o=t.getDatabase();try{o.pragma("busy_timeout = 60000")}catch{}let r=`cli-${Date.now()}-${B().slice(0,8)}`,a=n.durationMs||0,c;if(n.success){let i=a>0&&a<5e3?.1:0,h=n.source.includes("post-task")?.1:n.source.includes("post-edit")?.05:0;c=Math.min(.95,.7+i+h)}else{let i=n.source.includes("post-task")?.15:n.source.includes("post-edit")?.1:0;c=Math.min(.6,.3+i)}o.prepare(`
|
|
6
|
-
INSERT OR REPLACE INTO captured_experiences
|
|
7
|
-
(id, task, agent, domain, success, quality, duration_ms,
|
|
8
|
-
started_at, completed_at, source)
|
|
9
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, datetime('now'), datetime('now'), ?)
|
|
10
|
-
`).run(r,n.task.slice(0,500),n.agent,n.domain,n.success?1:0,c,a,n.source),(async()=>{try{let{computeRealEmbedding:i}=await import("./real-embeddings-MFRCC6GH.js"),h=`${n.domain}: ${n.task}`.slice(0,512),d=await i(h);o.prepare("UPDATE captured_experiences SET embedding = ?, embedding_dimension = ? WHERE id = ?").run(Buffer.from(new Float32Array(d).buffer),d.length,r)}catch{}})()}catch(e){console.error(x.dim(`[hooks] persistCommandExperience: ${e instanceof Error?e.message:"unknown"}`))}}async function Z(n){let{getUnifiedMemory:e}=await import("./unified-memory-ZSBX4LYU.js"),t=e();t.isInitialized()||await t.initialize();let s=t.getDatabase();try{s.pragma("busy_timeout = 60000")}catch{}let o=`exp-${Date.now()}-${B().slice(0,8)}`,r=`${n.agent}:${n.taskId}`,a=n.durationMs??0,c=n.success?1:0,i=a<100?1:a<500?.8:a<2e3?.6:a<5e3?.4:a<1e4?.2:.1,h=.25*c+.325+.1*i,d=null,p=0,u=0,l=s.transaction(()=>{s.prepare(`
|
|
11
|
-
INSERT INTO captured_experiences
|
|
12
|
-
(id, task, agent, domain, success, quality, duration_ms,
|
|
13
|
-
model_tier, started_at, completed_at, source)
|
|
14
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, NULL, datetime('now'), datetime('now'), ?)
|
|
15
|
-
`).run(o,r.slice(0,500),n.agent,n.domain??"general",n.success?1:0,h,a,"cli-hook-post-task"),s.prepare(`
|
|
16
|
-
INSERT INTO experience_applications
|
|
17
|
-
(id, experience_id, task, success, tokens_saved, feedback, applied_at)
|
|
18
|
-
VALUES (?, ?, ?, ?, ?, ?, datetime('now'))
|
|
19
|
-
`).run(`app-${Date.now()}-${B().slice(0,8)}`,o,r,n.success?1:0,Math.round(h*100),`[Patch 060] post-task outcome: ${n.success?"success":"failure"}`);try{let m=s.prepare(`
|
|
20
|
-
SELECT key, value FROM kv_store
|
|
21
|
-
WHERE namespace = 'task-bridge'
|
|
22
|
-
AND (expires_at IS NULL OR expires_at > strftime('%s','now') * 1000)
|
|
23
|
-
ORDER BY created_at DESC
|
|
24
|
-
LIMIT 1
|
|
25
|
-
`).get();if(m?.value)try{d=JSON.parse(m.value)}catch{d=null}if(d&&Array.isArray(d.selectedPatternIds)&&d.selectedPatternIds.length>0){let y=d.estimatedTokenSavings&&d.selectedPatternIds.length?Math.round(d.estimatedTokenSavings/d.selectedPatternIds.length):0,$=s.prepare(`
|
|
26
|
-
INSERT INTO experience_applications
|
|
27
|
-
(id, experience_id, task, success, tokens_saved, feedback, applied_at)
|
|
28
|
-
VALUES (?, ?, ?, ?, ?, ?, datetime('now'))
|
|
29
|
-
`),I=s.prepare(`
|
|
30
|
-
UPDATE qe_patterns SET
|
|
31
|
-
usage_count = usage_count + 1,
|
|
32
|
-
successful_uses = successful_uses + ?,
|
|
33
|
-
success_rate = CAST(successful_uses + ? AS REAL) / CAST(usage_count + 1 AS REAL),
|
|
34
|
-
quality_score = ? * 0.3
|
|
35
|
-
+ MIN(CAST(usage_count + 1 AS REAL) / 100.0, 1.0) * 0.2
|
|
36
|
-
+ (CAST(successful_uses + ? AS REAL) / CAST(usage_count + 1 AS REAL)) * 0.5,
|
|
37
|
-
last_used_at = datetime('now'),
|
|
38
|
-
updated_at = datetime('now')
|
|
39
|
-
WHERE id = ?
|
|
40
|
-
`),J=s.prepare("SELECT confidence FROM qe_patterns WHERE id = ?"),A=s.prepare(`
|
|
41
|
-
SELECT tier, successful_uses, success_rate, confidence
|
|
42
|
-
FROM qe_patterns
|
|
43
|
-
WHERE id = ?
|
|
44
|
-
`),G=s.prepare(`
|
|
45
|
-
UPDATE qe_patterns
|
|
46
|
-
SET tier = 'long-term', updated_at = datetime('now')
|
|
47
|
-
WHERE id = ?
|
|
48
|
-
AND tier = 'short-term'
|
|
49
|
-
AND successful_uses >= 3
|
|
50
|
-
AND success_rate >= 0.7
|
|
51
|
-
AND confidence >= 0.6
|
|
52
|
-
`);for(let M of d.selectedPatternIds){$.run(`app-${Date.now()}-${B().slice(0,8)}`,o,`${r}:pattern:${M}`,n.success?1:0,y,`[Patch 160+300] task-bridge pattern_id=${M} ts=${y}`);try{let q=J.get(M);if(q){let V=n.success?1:0;I.run(V,V,q.confidence,V,M)}}catch{}try{let q=A.get(M);q?.tier==="short-term"&&q.successful_uses>=3&&q.success_rate>=.7&&q.confidence>=.6&&G.run(M)}catch{}}m&&s.prepare("DELETE FROM kv_store WHERE namespace='task-bridge' AND key = ?").run(m.key)}}catch(m){console.error(x.dim(`[hooks] post-task bridge: ${m instanceof Error?m.message:"unknown"}`))}let f=`traj-${Date.now()}-${B().slice(0,8)}`;s.prepare(`
|
|
53
|
-
INSERT INTO qe_trajectories (id, task, agent, domain, started_at, ended_at, success, steps_json)
|
|
54
|
-
VALUES (?, ?, ?, ?, datetime('now'), datetime('now'), ?, ?)
|
|
55
|
-
`).run(f,r,n.agent,n.domain??"general",n.success?1:0,JSON.stringify([{step:1,task:n.taskId,success:n.success}]));try{let m=s.prepare(`
|
|
56
|
-
SELECT id, task, agent, success, started_at, completed_at
|
|
57
|
-
FROM captured_experiences
|
|
58
|
-
WHERE consolidated_into IS NULL
|
|
59
|
-
AND task LIKE ?
|
|
60
|
-
AND started_at > datetime('now', '-1 hour')
|
|
61
|
-
ORDER BY started_at ASC
|
|
62
|
-
`).all(`%:${n.taskId}`);if(m.length>=2){let y=`traj-multi-${Date.now()}-${B().slice(0,8)}`,$=JSON.stringify(m.map((A,G)=>({step:G+1,task:A.task,agent:A.agent,success:!!A.success,started_at:A.started_at,completed_at:A.completed_at}))),I=m.every(A=>!!A.success);s.prepare(`
|
|
63
|
-
INSERT INTO qe_trajectories (id, task, agent, domain, started_at, ended_at, success, steps_json)
|
|
64
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
65
|
-
`).run(y,`multi:${n.taskId}`,n.agent,n.domain??"general",m[0].started_at,m[m.length-1].completed_at,I?1:0,$);let J=m.map(()=>"?").join(",");s.prepare(`UPDATE captured_experiences SET consolidated_into = ? WHERE id IN (${J})`).run(y,...m.map(A=>A.id)),p=m.length}}catch(m){console.error(x.dim(`[hooks] post-task stitch: ${m instanceof Error?m.message:"unknown"}`))}if(n.success)try{u=s.prepare(`
|
|
66
|
-
UPDATE dream_insights
|
|
67
|
-
SET applied = COALESCE(applied, 0) + 1
|
|
68
|
-
WHERE id IN (
|
|
69
|
-
SELECT id FROM dream_insights
|
|
70
|
-
WHERE actionable = 1
|
|
71
|
-
ORDER BY created_at DESC
|
|
72
|
-
LIMIT 3
|
|
73
|
-
)
|
|
74
|
-
`).run().changes??0}catch{}});try{l()}catch(f){console.error(x.dim(`[hooks] persistTaskOutcome txn: ${f instanceof Error?f.message:"unknown"}`))}return(async()=>{try{let{computeRealEmbedding:f}=await import("./real-embeddings-MFRCC6GH.js"),m=`${n.domain??"general"}: ${r}`.slice(0,512),y=await f(m);s.prepare("UPDATE captured_experiences SET embedding = ?, embedding_dimension = ? WHERE id = ?").run(Buffer.from(new Float32Array(y).buffer),y.length,o)}catch{}})(),{experienceId:o,qualityScore:h,bridge:d,stitchedSiblings:p,insightsApplied:u}}async function X(n){try{let{getUnifiedMemory:e}=await import("./unified-memory-ZSBX4LYU.js"),t=e();t.isInitialized()||await t.initialize();let s=t.getDatabase();try{s.pragma("busy_timeout = 60000")}catch{}let o=`${n.taskType}|${n.priority}|${n.domain||"any"}|${n.complexityBucket}`,r=n.agent,a=`q-learning:aqe-hook-router:${o}:${r}`,c=n.success?.1:-1,i=.1,h=.9,d=s.prepare(`
|
|
75
|
-
SELECT q_value FROM rl_q_values WHERE id = ?
|
|
76
|
-
`).get(a),p=d&&typeof d.q_value=="number"?d.q_value:0,u=s.prepare(`
|
|
77
|
-
SELECT MAX(q_value) AS m FROM rl_q_values WHERE state_key = ?
|
|
78
|
-
`).get(o),l=u&&typeof u.m=="number"?u.m:0,f=p+i*(c+h*l-p);s.prepare(`
|
|
79
|
-
INSERT INTO rl_q_values
|
|
80
|
-
(id, algorithm, agent_id, state_key, action_key, q_value, visits, last_reward, domain, created_at, updated_at)
|
|
81
|
-
VALUES (?, 'q-learning', 'aqe-hook-router', ?, ?, ?, 1, ?, ?, datetime('now'), datetime('now'))
|
|
82
|
-
ON CONFLICT(algorithm, agent_id, state_key, action_key) DO UPDATE SET
|
|
83
|
-
q_value = excluded.q_value,
|
|
84
|
-
visits = visits + 1,
|
|
85
|
-
last_reward = excluded.last_reward,
|
|
86
|
-
updated_at = datetime('now')
|
|
87
|
-
`).run(a,o,r,f,c,n.domain||"any")}catch(e){console.error(x.dim(`[hooks] q-learning update: ${e instanceof Error?e.message:"unknown"}`))}}async function ee(n){try{let{getUnifiedMemory:e}=await import("./unified-memory-ZSBX4LYU.js"),t=e();t.isInitialized()||await t.initialize();let s=t.getDatabase();try{s.pragma("busy_timeout = 60000")}catch{}s.prepare(`
|
|
88
|
-
UPDATE routing_outcomes
|
|
89
|
-
SET success = ?, quality_score = ?, duration_ms = ?
|
|
90
|
-
WHERE id IN (
|
|
91
|
-
SELECT id FROM routing_outcomes
|
|
92
|
-
WHERE quality_score = -1
|
|
93
|
-
AND task_json LIKE '%"taskId"%'
|
|
94
|
-
AND created_at > datetime('now', '-30 minutes')
|
|
95
|
-
ORDER BY (CASE WHEN used_agent = ? THEN 0 ELSE 1 END), created_at DESC
|
|
96
|
-
LIMIT 1
|
|
97
|
-
)
|
|
98
|
-
`).run(n.success?1:0,n.qualityScore,n.durationMs,n.agent)}catch(e){console.error(x.dim(`[hooks] routing UPDATE: ${e instanceof Error?e.message:"unknown"}`))}}async function te(){let{getUnifiedMemory:n}=await import("./unified-memory-ZSBX4LYU.js"),e=n();e.isInitialized()||await e.initialize();let t=e.getDatabase();try{t.pragma("busy_timeout = 60000")}catch{}let s=new Set(t.prepare("PRAGMA table_info(captured_experiences)").all().map(i=>i.name)),o=[["consolidated_into","TEXT DEFAULT NULL"],["consolidation_count","INTEGER DEFAULT 1"],["quality_updated_at","TEXT DEFAULT NULL"],["reuse_success_count","INTEGER DEFAULT 0"],["reuse_failure_count","INTEGER DEFAULT 0"]];for(let[i,h]of o)s.has(i)||t.exec(`ALTER TABLE captured_experiences ADD COLUMN ${i} ${h}`);let r=t.prepare(`
|
|
99
|
-
SELECT
|
|
100
|
-
domain,
|
|
101
|
-
agent,
|
|
102
|
-
COUNT(*) as cnt,
|
|
103
|
-
AVG(quality) as avg_quality,
|
|
104
|
-
SUM(success) as successes,
|
|
105
|
-
CAST(SUM(success) AS REAL) / COUNT(*) as success_rate,
|
|
106
|
-
AVG(duration_ms) as avg_duration,
|
|
107
|
-
GROUP_CONCAT(DISTINCT source) as sources
|
|
108
|
-
FROM captured_experiences
|
|
109
|
-
WHERE application_count = 0
|
|
110
|
-
GROUP BY domain, agent
|
|
111
|
-
HAVING cnt >= 3 AND avg_quality >= 0.5 AND success_rate >= 0.6
|
|
112
|
-
ORDER BY avg_quality DESC
|
|
113
|
-
LIMIT 50
|
|
114
|
-
`).all();if(r.length===0)return 0;let{v4:a}=await import("./dist-node-7RM6BB2X.js"),c=0;for(let i of r)try{let h=new Date().toISOString().slice(0,7),d=`${i.agent}-${i.domain}-${h}`,p=t.prepare(`
|
|
115
|
-
SELECT id FROM qe_patterns
|
|
116
|
-
WHERE qe_domain = ? AND name = ?
|
|
117
|
-
LIMIT 1
|
|
118
|
-
`).get(i.domain,d);if(p)t.prepare(`
|
|
119
|
-
UPDATE qe_patterns
|
|
120
|
-
SET usage_count = usage_count + ?,
|
|
121
|
-
successful_uses = successful_uses + ?,
|
|
122
|
-
confidence = MIN(0.99, confidence + 0.01),
|
|
123
|
-
quality_score = MIN(0.99, quality_score + 0.005),
|
|
124
|
-
updated_at = datetime('now')
|
|
125
|
-
WHERE id = ?
|
|
126
|
-
`).run(i.cnt,i.successes,p.id);else{let u=a(),l=Math.min(.95,i.avg_quality*.8+i.success_rate*.2),f=l*.3+Math.min(i.cnt,100)/100*.2+i.success_rate*.5,m=`Auto-consolidated from ${i.cnt} experiences. Agent: ${i.agent}, success rate: ${(i.success_rate*100).toFixed(0)}%`,y=(i.sources||"").split(",").filter(Boolean);t.prepare(`
|
|
127
|
-
INSERT INTO qe_patterns (
|
|
128
|
-
id, pattern_type, qe_domain, domain, name, description,
|
|
129
|
-
confidence, usage_count, success_rate, quality_score, tier,
|
|
130
|
-
template_json, context_json, created_at, successful_uses
|
|
131
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), ?)
|
|
132
|
-
`).run(u,"workflow",i.domain,i.domain,d,m,l,i.cnt,i.success_rate,f,"short-term",JSON.stringify({type:"workflow",content:`${i.agent} pattern for ${i.domain}`,variables:[]}),JSON.stringify({tags:y,sourceType:"session-consolidation",extractedAt:new Date().toISOString()}),i.successes);let{ensurePatternEmbedding:$}=await import("./embed-and-insert-pattern-MS55QS73.js");await $(t,u,d,m,y),c++}t.prepare(`
|
|
133
|
-
UPDATE captured_experiences
|
|
134
|
-
SET application_count = application_count + 1
|
|
135
|
-
WHERE domain = ? AND agent = ? AND application_count = 0
|
|
136
|
-
`).run(i.domain,i.agent)}catch{}return c}var g={reasoningBank:null,hookRegistry:null,coherenceService:null,sessionId:null,initialized:!1,initializationPromise:null};async function S(){if(g.initializationPromise&&await g.initializationPromise,g.initialized&&g.reasoningBank&&g.hookRegistry)return{reasoningBank:g.reasoningBank,hookRegistry:g.hookRegistry};if(g.initializationPromise=be(),await g.initializationPromise,g.initializationPromise=null,!g.reasoningBank||!g.hookRegistry)throw new Error("Failed to initialize hooks system");return{reasoningBank:g.reasoningBank,hookRegistry:g.hookRegistry}}async function be(){if(!g.initialized)try{let n=T(),e=me.join(n,".agentic-qe"),t=await D(e);try{g.coherenceService=await ae(ie),console.log(P.dim("[hooks] CoherenceService initialized with WASM engines"))}catch(a){console.log(P.dim(`[hooks] CoherenceService WASM unavailable, using fallback: ${a instanceof Error?a.message:"unknown"}`))}g.reasoningBank=K(t,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0},g.coherenceService??void 0);let s=1e4,o=new AbortController,r=setTimeout(()=>o.abort(new Error("ReasoningBank init timeout")),s);try{await g.reasoningBank.initialize({signal:o.signal})}finally{clearTimeout(r)}try{let{getSharedRvfDualWriter:a}=await import("./shared-rvf-dual-writer-BKSR2FFK.js"),c=await a();c&&g.reasoningBank.setRvfDualWriter(c)}catch(a){process.env.DEBUG&&console.debug("[hooks] RVF wiring skipped:",a instanceof Error?a.message:a)}g.hookRegistry=re(g.reasoningBank),g.initialized=!0,console.log(P.dim("[hooks] System initialized"))}catch(n){console.warn(P.yellow(`[hooks] Using fallback mode: ${n instanceof Error?n.message:"unknown error"}`));let e=Te();g.reasoningBank=K(e,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0}),g.hookRegistry=new oe,g.hookRegistry.initialize(g.reasoningBank),g.initialized=!0}}function L(n){try{n.pragma("busy_timeout = 60000")}catch{}}async function D(n){let t=new se({sqlite:{path:me.join(n,"memory.db"),walMode:!0,poolSize:3,busyTimeout:6e4},enableFallback:!0,defaultNamespace:"qe-patterns"}),s=!1,o=t.initialize(),r=new Promise((a,c)=>setTimeout(()=>{s=!0,c(new Error("Backend init timeout"))},5e3));try{await Promise.race([o,r])}catch(a){throw s&&o.then(()=>t.dispose()).catch(()=>{}),a}return t}function Te(){let n=new Map;return{initialize:async()=>{},dispose:async()=>{n.clear()},get:async e=>{let t=n.get(e);return t?t.value:void 0},set:async(e,t,s)=>{n.set(e,{value:t})},delete:async e=>n.delete(e),has:async e=>n.has(e),search:async(e,t)=>{let s=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(s.replace(/\*/g,".*"));return Array.from(n.keys()).filter(r=>o.test(r))},vectorSearch:async(e,t)=>[],storeVector:async(e,t,s)=>{},count:async e=>{let t=0,s=`${e}:`;for(let o of n.keys())o.startsWith(s)&&t++;return t},hasCodeIntelligenceIndex:async()=>{let e="code-intelligence:kg:";for(let t of n.keys())if(t.startsWith(e))return!0;return!1}}}function k(n){console.log(JSON.stringify(n,null,2))}function v(n){console.log(P.green("\u2713"),n)}function _(n){console.error(P.red("\u2717"),n)}function W(n){if(n.length===0){console.log(P.dim(" No specific guidance"));return}n.forEach((e,t)=>{console.log(P.cyan(` ${t+1}.`),e)})}async function Q(n=500){return process.stdin.isTTY?"":new Promise(e=>{let t="",s=setTimeout(()=>{process.stdin.removeAllListeners(),process.stdin.pause(),e(t)},n);process.stdin.setEncoding("utf8"),process.stdin.on("data",o=>{t+=o}),process.stdin.on("end",()=>{clearTimeout(s),e(t)}),process.stdin.on("error",()=>{clearTimeout(s),e(t)}),process.stdin.resume()})}function le(n){if(!n.trim())return"";let e;try{e=JSON.parse(n)}catch{return""}let t=e.tool_input,s=e.toolInput,o=[t?.file_path,t?.filePath,s?.file_path,s?.filePath,e.file_path,e.filePath];for(let r of o)if(typeof r=="string"&&r.trim())return r;return""}import C from"chalk";import Re from"node:path";H();function ge(n){n.command("pre-edit").description("Get context and guidance before editing a file").requiredOption("-f, --file <path>","File path to edit").option("-o, --operation <type>","Operation type: create, update, delete, refactor","update").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await S(),o=(await t.emit(R.PreTestGeneration,{targetFile:e.file,testType:"unit",operation:e.operation}))[0]||{success:!0,guidance:[],routing:null};if(e.json){let r=o.guidance||[],c=[o.routing?.recommendedAgent?`Recommended agent: ${o.routing.recommendedAgent} (${(o.routing.confidence*100).toFixed(0)}% confidence).`:"",...r.map(i=>i)].filter(Boolean).join(" ");k({hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:c||void 0},file:e.file,operation:e.operation,patterns:o.routing?.patterns?.length||0})}else console.log(C.bold(`
|
|
137
|
-
\u{1F4DD} Pre-Edit Analysis`)),console.log(C.dim(` File: ${e.file}`)),console.log(C.dim(` Operation: ${e.operation}`)),o.routing&&(console.log(C.bold(`
|
|
138
|
-
\u{1F3AF} Recommended Agent:`),C.cyan(o.routing.recommendedAgent)),console.log(C.dim(` Confidence: ${(o.routing.confidence*100).toFixed(1)}%`))),console.log(C.bold(`
|
|
139
|
-
\u{1F4A1} Guidance:`)),W(o.guidance||[]);return}catch(t){throw _(`pre-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}}),n.command("post-edit").description("Record editing outcome for pattern learning").requiredOption("-f, --file <path>","File path that was edited").option("--success","Edit was successful").option("--failure","Edit failed").option("--pattern-id <id>","Pattern ID that was applied").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await S(),s=e.success||!e.failure,o=e.file||"";if(!o.trim())try{let u=await Q();o=le(u)}catch{}let r=o.split("/").pop()||"unknown",c=/\.(test|spec)\.(ts|js|tsx|jsx)$/.test(r)?"test-generation":"code-intelligence",i=e.patternId||`edit:${c}:${r}`,d=(await t.emit(R.PostTestGeneration,{targetFile:o,success:s,patternId:i,generatedTests:null,testCount:0}))[0]||{success:!0,patternsLearned:0};try{let{reasoningBank:u}=await S();await u.recordOutcome({patternId:i,success:s,metrics:{executionTimeMs:0},feedback:`Edit ${s?"succeeded":"failed"}: ${o}`})}catch{}try{await U({task:`edit: ${o}`,agent:"cli-hook",domain:c,success:s,source:"cli-hook-post-edit"})}catch{}let p=!1;try{let u=T(),l=Re.join(u,".agentic-qe"),f=await D(l);await O(f)}catch{}e.json?k({success:!0,file:o,editSuccess:s,patternsLearned:d.patternsLearned||0,dreamTriggered:p}):(v(`Recorded edit outcome for ${o||"(unknown file)"}`),d.patternsLearned&&console.log(C.green(` Patterns learned: ${d.patternsLearned}`)));return}catch(t){throw _(`post-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}})}H();import{randomUUID as Ae}from"crypto";import w from"chalk";import De from"node:path";function ve(n){if(!n.trim())return"";let e;try{e=JSON.parse(n)}catch{return n.trim()}let t=[e.prompt,e.user_prompt,e.command,e.tool_input?.prompt,e.tool_input?.description,e.toolInput?.prompt,e.toolInput?.description];for(let s of t)if(typeof s=="string"&&s.trim())return s;return""}function pe(n){n.command("route").description("Route a task to the optimal QE agent").option("-t, --task <description>","Task description (falls back to stdin event JSON)").option("-d, --domain <domain>","Target QE domain hint").option("-c, --capabilities <caps...>","Required capabilities").option("--json","Output as JSON").action(async e=>{try{let t=e.task??"";if(!t.trim()){let c=await Q();t=ve(c)}if(!t.trim())throw new Error("No task provided. Pass --task <description> or pipe a Claude Code hook event JSON to stdin.");let{reasoningBank:s}=await S(),o={task:t,domain:e.domain,capabilities:e.capabilities},r=await s.routeTask(o);if(!r.success)throw new Error(r.error.message);let a=r.value;e.json?k({recommendedAgent:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,domains:a.domains,patternCount:a.patterns.length,guidance:a.guidance,reasoning:a.reasoning}):(console.log(w.bold(`
|
|
140
|
-
\u{1F3AF} Task Routing Result`)),console.log(w.dim(` Task: "${t}"`)),console.log(w.bold(`
|
|
141
|
-
\u{1F464} Recommended Agent:`),w.cyan(a.recommendedAgent)),console.log(w.dim(` Confidence: ${(a.confidence*100).toFixed(1)}%`)),a.alternatives.length>0&&(console.log(w.bold(`
|
|
142
|
-
\u{1F504} Alternatives:`)),a.alternatives.forEach(c=>{console.log(w.dim(` - ${c.agent}: ${(c.score*100).toFixed(1)}%`))})),console.log(w.bold(`
|
|
143
|
-
\u{1F4C2} Detected Domains:`),a.domains.join(", ")),console.log(w.bold(`
|
|
144
|
-
\u{1F4A1} Guidance:`)),W(a.guidance),console.log(w.bold(`
|
|
145
|
-
\u{1F4D6} Reasoning:`),w.dim(a.reasoning)));try{let{getUnifiedMemory:c}=await import("./unified-memory-ZSBX4LYU.js"),i=c();i.isInitialized()||await i.initialize();let h=i.getDatabase();L(h);let d=`route-${Date.now()}-${Ae().slice(0,8)}`,p=a.confidence<.5;h.prepare(`
|
|
146
|
-
INSERT OR REPLACE INTO routing_outcomes (
|
|
147
|
-
id, task_json, decision_json, used_agent,
|
|
148
|
-
followed_recommendation, success, quality_score,
|
|
149
|
-
duration_ms, error
|
|
150
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
151
|
-
`).run(d,JSON.stringify({description:t,domain:e.domain}),JSON.stringify({recommended:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,lowConfidence:p}),a.recommendedAgent,1,0,-1,0,p?"low-confidence":null);let u=T(),l=De.join(u,".agentic-qe"),f=await D(l);await O(f)}catch(c){console.error(w.dim(`[hooks] route persist: ${c instanceof Error?c.message:"unknown"}`))}return}catch(t){throw _(`route failed: ${t instanceof Error?t.message:"unknown"}`),t}}),n.command("post-route").description("Close the most-recent route sentinel from a Stop hook (#451)").option("--success <bool>","Whether the turn completed successfully","true").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,s=.325+(t?.25:0)+.1,o=j();o.isInitialized()||await o.initialize();let r=o.getDatabase();L(r);let a=r.prepare(`
|
|
152
|
-
UPDATE routing_outcomes
|
|
153
|
-
SET success = ?, quality_score = ?, duration_ms = 0, error = NULL
|
|
154
|
-
WHERE id = (
|
|
155
|
-
SELECT id FROM routing_outcomes
|
|
156
|
-
WHERE quality_score = -1
|
|
157
|
-
AND task_json NOT LIKE '%"taskId"%'
|
|
158
|
-
ORDER BY created_at DESC
|
|
159
|
-
LIMIT 1
|
|
160
|
-
)
|
|
161
|
-
`).run(t?1:0,s),c=r.prepare(`
|
|
162
|
-
UPDATE routing_outcomes
|
|
163
|
-
SET success = 0,
|
|
164
|
-
quality_score = 0.325,
|
|
165
|
-
duration_ms = 0,
|
|
166
|
-
error = 'stale-sentinel'
|
|
167
|
-
WHERE quality_score = -1
|
|
168
|
-
AND task_json NOT LIKE '%"taskId"%'
|
|
169
|
-
AND created_at < datetime('now', '-300 seconds')
|
|
170
|
-
`).run();e.json?k({success:!0,resolved:a.changes>0,staleSwept:c.changes,qualityScore:s,turnSuccess:t}):c.changes>0&&console.log(w.dim(`[hooks] post-route: swept ${c.changes} stale sentinel(s)`));return}catch(t){e.json?k({success:!1,error:t instanceof Error?t.message:"unknown"}):console.error(w.dim(`[hooks] post-route: ${t instanceof Error?t.message:"unknown"}`));return}})}import E from"chalk";we();function fe(n){n.command("stats").description("Display hooks system statistics").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await S(),s=await t.getStats();if(e.json)k(s);else{console.log(E.bold(`
|
|
171
|
-
\u{1F4CA} Hooks System Statistics
|
|
172
|
-
`)),console.log(E.bold("Patterns:")),console.log(` Total: ${E.cyan(s.totalPatterns)}`),console.log(` Short-term: ${s.patternStoreStats.byTier.shortTerm}`),console.log(` Long-term: ${s.patternStoreStats.byTier.longTerm}`),console.log(E.bold(`
|
|
173
|
-
By Domain:`));for(let[o,r]of Object.entries(s.byDomain))r>0&&console.log(` ${o}: ${r}`);console.log(E.bold(`
|
|
174
|
-
Routing:`)),console.log(` Requests: ${s.routingRequests}`),console.log(` Avg Confidence: ${(s.avgRoutingConfidence*100).toFixed(1)}%`),console.log(E.bold(`
|
|
175
|
-
Learning:`)),console.log(` Outcomes: ${s.learningOutcomes}`),console.log(` Success Rate: ${(s.patternSuccessRate*100).toFixed(1)}%`),console.log(E.bold(`
|
|
176
|
-
Search Performance:`)),console.log(` Operations: ${s.patternStoreStats.searchOperations}`),console.log(` Avg Latency: ${s.patternStoreStats.avgSearchLatencyMs.toFixed(2)}ms`),console.log(` HNSW Native: ${s.patternStoreStats.hnswStats.nativeAvailable?"\u2713":"\u2717"}`)}}catch(t){throw _(`stats failed: ${t instanceof Error?t.message:"unknown"}`),t}}),n.command("list").description("List all registered QE hook events").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await S(),s=t.getRegisteredEvents();if(e.json)k({events:s,totalEvents:Object.keys(R).length,registeredEvents:s.length});else{console.log(E.bold(`
|
|
177
|
-
\u{1F4CB} Registered QE Hook Events
|
|
178
|
-
`)),console.log(E.bold("All Available Events:"));for(let[o,r]of Object.entries(R)){let c=s.includes(r)?E.green("\u2713"):E.dim("\u25CB");console.log(` ${c} ${o}: ${E.dim(r)}`)}console.log(E.dim(`
|
|
179
|
-
Registered: ${s.length}/${Object.keys(R).length}`))}}catch(t){throw _(`list failed: ${t instanceof Error?t.message:"unknown"}`),t}}),n.command("emit").description("Emit a QE hook event").requiredOption("-e, --event <name>","Event name (e.g., qe:pattern-applied)").option("-d, --data <json>","Event data as JSON","{}").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await S(),s;try{s=ne(e.data)}catch{throw new Error(`Invalid JSON data: ${e.data}`)}let o=await t.emit(e.event,s);e.json?k({event:e.event,results:o}):(console.log(E.bold(`
|
|
180
|
-
\u{1F4E1} Hook Event Emitted`)),console.log(E.dim(` Event: ${e.event}`)),console.log(E.dim(` Handlers: ${o.length}`)),o.forEach((r,a)=>{let c=r.success?E.green("\u2713"):E.red("\u2717");console.log(` ${c} Handler ${a+1}: ${r.success?"success":r.error}`),r.patternsLearned&&console.log(E.green(` Patterns learned: ${r.patternsLearned}`))}))}catch(t){throw _(`emit failed: ${t instanceof Error?t.message:"unknown"}`),t}}),n.command("learn").description("Store a new pattern in the reasoning bank").requiredOption("-n, --name <name>","Pattern name").requiredOption("-d, --description <desc>","Pattern description").option("-t, --type <type>","Pattern type","test-template").option("--domain <domain>","QE domain").option("--tags <tags...>","Pattern tags").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await S(),s=await t.storePattern({patternType:e.type,name:e.name,description:e.description,template:{type:"prompt",content:e.description,variables:[]},context:{tags:e.tags||[]}});if(!s.success)throw new Error(s.error.message);let o=s.value;e.json?k({success:!0,pattern:{id:o.id,name:o.name,type:o.patternType,domain:o.qeDomain}}):(v(`Pattern stored: ${o.name}`),console.log(E.dim(` ID: ${o.id}`)),console.log(E.dim(` Domain: ${o.qeDomain}`)),console.log(E.dim(` Tier: ${o.tier}`)))}catch(t){throw _(`learn failed: ${t instanceof Error?t.message:"unknown"}`),t}}),n.command("search").description("Search for patterns in the reasoning bank").requiredOption("-q, --query <query>","Search query").option("-l, --limit <n>","Maximum results","10").option("-d, --domain <domain>","Filter by domain").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await S(),s=await t.searchPatterns(e.query,{limit:parseInt(e.limit,10),domain:e.domain});if(!s.success)throw new Error(s.error.message);let o=s.value;e.json?k({query:e.query,total:o.length,patterns:o.map(r=>({id:r.pattern.id,name:r.pattern.name,score:r.score,domain:r.pattern.qeDomain,matchType:r.matchType}))}):(console.log(E.bold(`
|
|
181
|
-
\u{1F50D} Search Results for "${e.query}"
|
|
182
|
-
`)),o.length===0?console.log(E.dim(" No patterns found")):o.forEach((r,a)=>{console.log(`${E.cyan(`${a+1}.`)} ${r.pattern.name} ${E.dim(`(${(r.score*100).toFixed(1)}%)`)}`),console.log(E.dim(` Domain: ${r.pattern.qeDomain}`)),console.log(E.dim(` Match: ${r.matchType}`)),console.log(E.dim(` ID: ${r.pattern.id}`)),console.log()}),console.log(E.dim(`Found ${o.length} pattern(s)`)))}catch(t){throw _(`search failed: ${t instanceof Error?t.message:"unknown"}`),t}})}H();import F from"chalk";import $e from"node:path";function ke(n){n.command("session-start").description("Initialize session state when Claude Code session starts").option("-s, --session-id <id>","Session ID").option("--json","Output as JSON").action(async e=>{try{let t=e.sessionId||`session-${Date.now()}`;g.sessionId=t;let{reasoningBank:s}=await S(),o=await s.getStats(),r=T(),a=$e.join(r,".agentic-qe"),c=await D(a),i=await c.get(N),h=!i||!i.sessionStartTime;i?(i.sessionStartTime=new Date().toISOString(),i.totalDreamsThisSession=0):i={lastDreamTime:null,experienceCount:0,sessionStartTime:new Date().toISOString(),totalDreamsThisSession:0},await c.set(N,i);let d=[];d.push(`AQE Learning: ${o.totalPatterns} patterns loaded`);let p=Object.entries(o.byDomain).filter(([,l])=>l>0).sort(([,l],[,f])=>f-l).slice(0,5);p.length>0&&d.push(`Top domains: ${p.map(([l,f])=>`${l}(${f})`).join(", ")}`),o.patternSuccessRate>0&&d.push(`Pattern success rate: ${(o.patternSuccessRate*100).toFixed(0)}%`),o.routingRequests>0&&d.push(`Routing confidence: ${(o.avgRoutingConfidence*100).toFixed(0)}% across ${o.routingRequests} requests`);let u=d.join(". ")+".";e.json?k({hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:u},sessionId:t,initialized:!0,patternsLoaded:o.totalPatterns,dreamScheduler:{enabled:!0,lastDreamTime:i.lastDreamTime,pendingExperiences:i.experienceCount}}):(v(`Session started: ${t}`),console.log(F.dim(` Patterns loaded: ${o.totalPatterns}`)),console.log(F.dim(` Dream scheduler: enabled (${i.experienceCount} pending experiences)`)));return}catch(t){e.json&&k({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),n.command("session-end").description("Save session state when Claude Code session ends").option("--save-state","Save learning state to disk").option("--export-metrics","Export session metrics").option("--json","Output as JSON").action(async e=>{try{let t=g.sessionId||"unknown",s=null;if(g.initialized&&g.reasoningBank)try{s=await g.reasoningBank.getStats()}catch{}let o=0;try{o=await te()}catch{}if(e.json){let r=s?`Session complete: ${s.totalPatterns} patterns, ${s.routingRequests} routings, ${(s.patternSuccessRate*100).toFixed(0)}% success rate`:"Session complete";k({continue:!0,sessionId:t,stateSaved:e.saveState||!1,metricsExported:e.exportMetrics||!1,patternsConsolidated:o,finalStats:s?{patternsLearned:s.totalPatterns,routingRequests:s.routingRequests,successRate:s.patternSuccessRate}:null})}else v(`Session ended: ${t}`),s&&(console.log(F.dim(` Patterns: ${s.totalPatterns}`)),console.log(F.dim(` Routing requests: ${s.routingRequests}`))),o>0&&console.log(F.dim(` Patterns consolidated: ${o}`));return}catch(t){e.json&&k({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import{createHash as xe,randomUUID as Oe}from"node:crypto";import b from"chalk";import Ie from"node:path";H();var Ne="task-bridge",Pe=6e5,ye=.5;function Ce(n){let e=n.toLowerCase();return/\bgenerate[- ]?test|\btest[- ]?gen|\bgenerate.+spec/.test(e)?"test-generation":/\bcoverage|\banalyze.+cover/.test(e)?"coverage-analysis":/\bquality|\bassess|\baudit/.test(e)?"quality-assessment":/\bsecurity|\bvulnerab|\bcompliance/.test(e)?"security-compliance":/\bdefect|\bbug|\bdiagnos/.test(e)?"defect-intelligence":/\brequirement|\bspec\b/.test(e)?"requirements-validation":/\brefactor|\brewrite|\boptim/.test(e)?"refactoring":/\btest|\brun.+test/.test(e)?"test-execution":"unknown"}function qe(n){return xe("sha256").update(n).digest("hex").slice(0,16)}function he(n){n.command("pre-task").description("Get context and guidance before spawning a Task agent").option("--task-id <id>","Task identifier").option("-d, --description <desc>","Task description").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await S(),s=null;if(e.description){let d=await t.routeTask({task:e.description});d.success&&(s=d.value)}let o=(s?.patterns??[]).slice(0,5).map(d=>d?.id).filter(d=>typeof d=="string"),r=null,a=[],c=0,i=null;try{let d=j();d.isInitialized()||await d.initialize();let p=d.getDatabase();L(p);try{let u=p.prepare(`
|
|
183
|
-
SELECT used_agent AS agent,
|
|
184
|
-
ROUND(AVG(quality_score), 3) AS avgQuality,
|
|
185
|
-
COUNT(*) AS n
|
|
186
|
-
FROM routing_outcomes
|
|
187
|
-
WHERE success = 1 AND quality_score >= 0
|
|
188
|
-
GROUP BY used_agent
|
|
189
|
-
ORDER BY avgQuality DESC, n DESC
|
|
190
|
-
LIMIT 1
|
|
191
|
-
`).get();u&&(r=u)}catch{}try{a=p.prepare(`
|
|
192
|
-
SELECT key, value
|
|
193
|
-
FROM kv_store
|
|
194
|
-
WHERE namespace = 'verdicts'
|
|
195
|
-
AND created_at > datetime('now', '-7 days')
|
|
196
|
-
ORDER BY created_at DESC
|
|
197
|
-
LIMIT 3
|
|
198
|
-
`).all().map(l=>({key:l.key,summary:String(l.value).slice(0,200)}))}catch{}if(o.length>0)try{let u=o.map(()=>"?").join(","),l=p.prepare(`
|
|
199
|
-
SELECT COALESCE(SUM(average_token_savings), 0) AS sum
|
|
200
|
-
FROM qe_patterns
|
|
201
|
-
WHERE id IN (${u})
|
|
202
|
-
`).get(...o);c=Math.max(0,Math.round(l?.sum??0))}catch{}if(e.description&&o.length>0)try{let u=String(e.description),l=Ce(u),f="normal",m=s?.domains?.[0]??"any",y=Math.max(0,Math.min(10,Math.round(Math.min(u.length/200,1)*10)));i=`task:${qe(u)}`;let $=JSON.stringify({selectedPatternIds:o,agent:s?.recommendedAgent??null,description:u.slice(0,200),taskType:l,priority:f,domain:m,complexityBucket:y,estimatedTokenSavings:c,ts:Date.now()}),I=Date.now()+Pe;p.prepare(`
|
|
203
|
-
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at, created_at)
|
|
204
|
-
VALUES (?, ?, ?, ?, strftime('%s','now')*1000)
|
|
205
|
-
`).run(i,Ne,$,I)}catch(u){console.error(b.dim(`[hooks] pre-task bridge: ${u instanceof Error?u.message:"unknown"}`))}if(s?.recommendedAgent)try{let u=e.taskId||`hook-${Date.now()}`,l=`route-${Date.now()}-${Oe().slice(0,8)}`,f=s.confidence<ye;p.prepare(`
|
|
206
|
-
INSERT INTO routing_outcomes (
|
|
207
|
-
id, task_json, decision_json, used_agent,
|
|
208
|
-
followed_recommendation, success, quality_score,
|
|
209
|
-
duration_ms, error
|
|
210
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
211
|
-
`).run(l,JSON.stringify({description:e.description,taskId:u}),JSON.stringify({recommended:s.recommendedAgent,confidence:s.confidence,alternatives:s.alternatives,lowConfidence:f}),s.recommendedAgent,1,0,-1,0,f?"low-confidence":null)}catch(u){console.error(b.dim(`[hooks] pre-task sentinel: ${u instanceof Error?u.message:"unknown"}`))}}catch(d){console.error(b.dim(`[hooks] pre-task memory: ${d instanceof Error?d.message:"unknown"}`))}let h=s?s.confidence<ye:!1;e.json?k({success:!0,taskId:e.taskId,description:e.description,recommendedAgent:s?.recommendedAgent,confidence:s?.confidence,guidance:s?.guidance||[],selectedPatternIds:o,historicalBest:r,priorVerdicts:a,estimatedTokenSavings:c,lowConfidence:h,bridgeKey:i}):(console.log(b.bold(`
|
|
212
|
-
\u{1F680} Pre-Task Analysis`)),console.log(b.dim(` Task ID: ${e.taskId||"N/A"}`)),s&&(console.log(b.bold(`
|
|
213
|
-
\u{1F3AF} Recommended:`),b.cyan(s.recommendedAgent)),console.log(b.dim(` Confidence: ${(s.confidence*100).toFixed(1)}%`)),h&&console.log(b.yellow(" \u26A0 Low confidence \u2014 consider providing more context"))));return}catch(t){e.json&&k({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),n.command("post-task").description("Record task outcome for pattern learning").option("--task-id <id>","Task identifier").option("--success <bool>","Whether task succeeded","true").option("--agent <name>","Agent that executed the task").option("--duration <ms>","Task duration in milliseconds").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,s=0,o={triggered:!1};try{let{hookRegistry:r,reasoningBank:a}=await S();s=(await r.emit(R.QEAgentCompletion,{taskId:e.taskId,success:t,agent:e.agent,duration:e.duration?parseInt(e.duration,10):void 0,timestamp:Date.now()})).reduce((u,l)=>u+(l.patternsLearned||0),0);{let u=e.taskId||`hook-${Date.now()}`,l=e.agent||"unknown",f=e.duration?parseInt(e.duration,10):0;await a.recordOutcome({patternId:`task:${l}:${u}`,success:t,metrics:{executionTimeMs:f},feedback:`Agent: ${l}, Task: ${u}`});let m=await Z({taskId:u,agent:l,durationMs:f,success:t}),y=l==="unknown"&&m.bridge?.agent?m.bridge.agent:l;await ee({agent:y,success:t,durationMs:f,qualityScore:m.qualityScore}),m.bridge&&await X({taskType:m.bridge.taskType,priority:m.bridge.priority,domain:m.bridge.domain,complexityBucket:m.bridge.complexityBucket,agent:y,success:t})}let i=T(),h=Ie.join(i,".agentic-qe"),d=await D(h),p=await O(d);o=await Y(d)}catch(r){console.error(b.dim(`[hooks] Learning init: ${r instanceof Error?r.message:"unknown"}`))}if(e.json)k({success:!0,taskId:e.taskId,taskSuccess:t,patternsLearned:s,dreamTriggered:o.triggered,dreamReason:o.reason,dreamInsights:o.insightsGenerated,dreamInsightsApplied:o.insightsApplied});else if(v(`Task completed: ${e.taskId||"unknown"}`),console.log(b.dim(` Success: ${t}`)),s>0&&console.log(b.green(` Patterns learned: ${s}`)),o.triggered){let r=typeof o.insightsApplied=="number"?`, ${o.insightsApplied} applied`:"";console.log(b.blue(` \u{1F319} Dream cycle triggered (${o.reason}): ${o.insightsGenerated} insights${r}`))}return}catch(t){e.json&&k({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import{existsSync as Le,readFileSync as Me}from"node:fs";import{randomUUID as Ee}from"node:crypto";import z from"chalk";import Se from"node:path";H();function je(n){return/\bjest\b/i.test(n)?"jest":/\bvitest\b/i.test(n)?"vitest":/\bpytest\b/i.test(n)?"pytest":/\bmocha\b/i.test(n)?"mocha":null}async function He(n){try{let e=j();e.isInitialized()||await e.initialize();let t=e.getDatabase();L(t);let s=n.framework==="pytest"?"python":"javascript",o=n.command.split(/\s+/).slice(0,3).join("-").slice(0,80);t.prepare(`
|
|
214
|
-
INSERT INTO test_outcomes (
|
|
215
|
-
id, test_id, test_name, generated_by, framework, language, domain,
|
|
216
|
-
passed, execution_time_ms, maintainability_score, created_at
|
|
217
|
-
) VALUES (?, ?, ?, 'cli-hook-post-command', ?, ?, 'test-execution',
|
|
218
|
-
?, ?, 0.5, datetime('now'))
|
|
219
|
-
`).run(`to-${Date.now()}-${Ee().slice(0,8)}`,`cmd:${o}`,n.command.slice(0,200),n.framework,s,n.success?1:0,n.durationMs);try{let r=Se.join(process.cwd(),"coverage","coverage-summary.json");if(Le(r)){let c=JSON.parse(Me(r,"utf-8")).total??{},i=Number(c.lines?.pct??0),h=Number(c.branches?.pct??0),d=Number(c.functions?.pct??0),p=t.prepare(`
|
|
220
|
-
SELECT after_lines, after_branches, after_functions
|
|
221
|
-
FROM coverage_sessions
|
|
222
|
-
WHERE target_path = ?
|
|
223
|
-
ORDER BY created_at DESC
|
|
224
|
-
LIMIT 1
|
|
225
|
-
`).get(process.cwd()),u=new Date().toISOString();t.prepare(`
|
|
226
|
-
INSERT INTO coverage_sessions (
|
|
227
|
-
id, target_path, agent_id, technique,
|
|
228
|
-
before_lines, before_branches, before_functions,
|
|
229
|
-
after_lines, after_branches, after_functions,
|
|
230
|
-
tests_generated, tests_passed, duration_ms,
|
|
231
|
-
started_at, completed_at
|
|
232
|
-
) VALUES (?, ?, 'cli-hook-post-command', ?, ?, ?, ?, ?, ?, ?, 0, ?, ?, ?, ?)
|
|
233
|
-
`).run(`cs-${Date.now()}-${Ee().slice(0,8)}`,process.cwd(),n.framework,p?.after_lines??0,p?.after_branches??0,p?.after_functions??0,i,h,d,n.success?1:0,n.durationMs,u,u)}}catch(r){console.error(z.dim(`[hooks] coverage_sessions: ${r instanceof Error?r.message:"unknown"}`))}}catch(e){console.error(z.dim(`[hooks] test_outcomes: ${e instanceof Error?e.message:"unknown"}`))}}function _e(n){n.command("guard").description("File guardian - block edits to protected files").requiredOption("-f, --file <path>","File path to check").option("--json","Output as JSON (required for hook API)").action(async e=>{try{let t=e.file||"",s=t.replace(/\\/g,"/"),r=[{pattern:/^\.env($|\.)/,reason:"Environment file contains secrets"},{pattern:/\.env\.[a-zA-Z]+$/,reason:"Environment file contains secrets"},{pattern:/\.lock$/,reason:"Lock files are auto-generated"},{pattern:/(^|\/)node_modules\//,reason:"node_modules is managed by package manager"},{pattern:/(^|\/)\.agentic-qe\/memory\.db/,reason:"AQE memory database must not be directly edited"},{pattern:/(^|\/)\.agentic-qe\/memory\.db-wal$/,reason:"AQE WAL file must not be directly edited"},{pattern:/(^|\/)\.agentic-qe\/memory\.db-shm$/,reason:"AQE shared memory file must not be directly edited"}].find(a=>a.pattern.test(s));r?e.json?k({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Protected file: ${r.reason} (${t})`}}):_(`Blocked: ${r.reason} (${t})`):e.json?k({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}}):v(`Allowed: ${t}`);return}catch{e.json&&k({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}});return}}),n.command("pre-command").description("Get context before executing a Bash command").option("-c, --command <cmd>","Command to be executed").option("--json","Output as JSON").action(async e=>{try{let t=e.command||"",s=[{pattern:/rm\s+(-[a-zA-Z]*f[a-zA-Z]*\s+)?-[a-zA-Z]*r[a-zA-Z]*\s+\/(?!\w)/,reason:"Recursive delete of root filesystem"},{pattern:/rm\s+(-[a-zA-Z]*r[a-zA-Z]*\s+)?-[a-zA-Z]*f[a-zA-Z]*\s+\/(?!\w)/,reason:"Recursive delete of root filesystem"},{pattern:/rm\s+-rf\s+~/,reason:"Recursive delete of home directory"},{pattern:/DROP\s+(TABLE|DATABASE|SCHEMA)/i,reason:"Destructive SQL operation"},{pattern:/git\s+push\s+.*--force(?!-)/,reason:"Force push can overwrite remote history"},{pattern:/git\s+reset\s+--hard/,reason:"Hard reset discards uncommitted changes"},{pattern:/>\s*\/dev\/sd[a-z]/,reason:"Direct write to block device"},{pattern:/dd\s+if=.*of=\/dev\/sd/,reason:"Direct disk write via dd"},{pattern:/chmod\s+777\s/,reason:"World-writable permissions are a security risk"},{pattern:/:\(\)\s*\{\s*:\|\s*:&\s*\}\s*;?\s*:/,reason:"Fork bomb detected"},{pattern:/mkfs\./,reason:"Filesystem format operation"},{pattern:/>\s*\/dev\/null\s*2>&1\s*&\s*disown/,reason:"Stealth background process"}],o=[{pattern:/\.agentic-qe.*rm/,reason:"Deleting AQE data files"},{pattern:/rm\s+-rf\s/,reason:"Recursive force delete"},{pattern:/git\s+clean\s+-[a-zA-Z]*f/,reason:"Force cleaning untracked files"}],r=s.find(c=>c.pattern.test(t)),a=o.filter(c=>c.pattern.test(t)).map(c=>c.reason);if(r)e.json?k({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Dangerous command blocked: ${r.reason}`}}):_(`Blocked: ${r.reason}`);else if(e.json){let c={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}};a.length>0&&(c.hookSpecificOutput.additionalContext=`Warnings: ${a.join("; ")}`),k(c)}else a.length>0&&(console.log(z.yellow(`
|
|
234
|
-
\u26A0\uFE0F Command Warnings:`)),a.forEach(c=>console.log(z.yellow(` - ${c}`))));return}catch{e.json&&k({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}});return}}),n.command("post-command").description("Record Bash command outcome").option("-c, --command <cmd>","Command that was executed").option("--success <bool>","Whether command succeeded","true").option("--exit-code <code>","Command exit code").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,s=e.exitCode?parseInt(e.exitCode,10):t?0:1,o=(e.command||"").substring(0,200),r=/\b(test|vitest|jest|pytest|mocha)\b/i.test(o),a=/\b(build|compile|tsc)\b/i.test(o),c=/\b(lint|eslint|prettier)\b/i.test(o),i=0,h=!1;try{let{reasoningBank:d}=await S();if(r){let{hookRegistry:$}=await S();await $.emit(R.TestExecutionResult,{runId:`cmd-${Date.now()}`,patternId:`cmd:test:${o.split(/\s+/).slice(0,3).join("-")}`,passed:t?1:0,failed:t?0:1,duration:0,flaky:!1})}let p=o.replace(/[^a-zA-Z0-9]/g,"-").slice(0,80),u=r?"test-execution":a?"code-intelligence":c?"quality-assessment":"code-intelligence";await d.recordOutcome({patternId:`cmd:${p}`,success:t,metrics:{executionTimeMs:0},feedback:`Command: ${o}, exit: ${s}`}),i=1,(r||a||c)&&(await U({task:`bash: ${o}`,agent:"cli-hook",domain:u,success:t,source:"cli-hook-post-command"}),h=!0);let l=je(o);l&&await He({command:o,framework:l,success:t,durationMs:0});let f=T(),m=Se.join(f,".agentic-qe"),y=await D(m);await O(y)}catch(d){console.error(z.dim(`[hooks] post-command learning: ${d instanceof Error?d.message:"unknown"}`))}e.json&&k({success:!0,command:o.substring(0,100),commandSuccess:t,exitCode:s,patternsLearned:i,experienceRecorded:h});return}catch(t){e.json&&k({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}function Gt(){let n=new Be("hooks").description("Self-learning QE hooks for pattern recognition and guidance").addHelpText("after",`
|
|
235
|
-
Examples:
|
|
236
|
-
# File editing hooks (learning from edits)
|
|
237
|
-
aqe hooks pre-edit --file src/utils.ts --operation create
|
|
238
|
-
aqe hooks post-edit --file src/utils.ts --success
|
|
239
|
-
|
|
240
|
-
# Task routing and guidance
|
|
241
|
-
aqe hooks route --task "Generate tests for UserService"
|
|
242
|
-
aqe hooks pre-task --description "Generate tests" --json
|
|
243
|
-
aqe hooks post-task --task-id "task-123" --success true
|
|
244
|
-
aqe hooks post-route --success true --json # Stop hook (#451)
|
|
245
|
-
|
|
246
|
-
# Bash command hooks
|
|
247
|
-
aqe hooks pre-command --command "npm test" --json
|
|
248
|
-
aqe hooks post-command --command "npm test" --success true
|
|
249
|
-
|
|
250
|
-
# Session lifecycle (Stop hook)
|
|
251
|
-
aqe hooks session-start --session-id "session-123"
|
|
252
|
-
aqe hooks session-end --save-state --json
|
|
253
|
-
|
|
254
|
-
# Pattern management
|
|
255
|
-
aqe hooks learn --name "test-pattern" --description "A test pattern"
|
|
256
|
-
aqe hooks search --query "authentication"
|
|
257
|
-
aqe hooks stats
|
|
258
|
-
aqe hooks list
|
|
259
|
-
`);return ge(n),pe(n),fe(n),ke(n),he(n),_e(n),n}export{R as QE_HOOK_EVENTS,Gt as createHooksCommand,S as getHooksSystem,g as hooksState};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{a}from"./chunk-QBDXUI2H.js";import"./chunk-2O5TT3UT.js";import"./chunk-7Z3GBQNV.js";import"./chunk-3WIU2E2Y.js";import"./chunk-Q4HJRYQB.js";import"./chunk-LDGNVPBZ.js";import"./chunk-RNO6CE7I.js";import"./chunk-GY4EGQO3.js";import"./chunk-ITBPDVK5.js";export{a as ImpactAnalyzerService};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{a,b,c,d}from"./chunk-UWWX4RK7.js";import"./chunk-E7UHOKKL.js";import"./chunk-OOFWYDG6.js";import"./chunk-Z3TXQOS7.js";import"./chunk-HJDHQBMJ.js";import"./chunk-Q4HJRYQB.js";import"./chunk-RNO6CE7I.js";import"./chunk-CNNVL5W4.js";import"./chunk-TULNR2AH.js";import"./chunk-ITBPDVK5.js";export{a as InitOrchestrator,b as createInitOrchestrator,d as formatInitResult,c as quickInit};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{y as a,z as b}from"./chunk-3PZDXE5E.js";import"./chunk-XKH4E2IQ.js";import"./chunk-WTXRPYNN.js";import"./chunk-C6TNYLD7.js";import"./chunk-DEDFPHJL.js";import"./chunk-TA3QYAZ6.js";import"./chunk-OTFJCZNY.js";import"./chunk-MV3NUANS.js";import"./chunk-YXR5RYRE.js";import"./chunk-3EP2YZSY.js";import"./chunk-H2IMXQCJ.js";import"./chunk-AWWD3EI3.js";import"./chunk-XDYTQPJM.js";import"./chunk-YETPSL6H.js";import"./chunk-SPCANEJY.js";import"./chunk-ND6VCNN5.js";import"./chunk-DDMFTEJP.js";import"./chunk-HA7N45KB.js";import"./chunk-WVODEWH5.js";import"./chunk-VRP4GB4Y.js";import"./chunk-R5IW5ARI.js";import"./chunk-2GBBZLXT.js";import"./chunk-QHKK2H4H.js";import"./chunk-IOINZWNA.js";import"./chunk-Y57V4FDT.js";import"./chunk-JNRRDG7O.js";import"./chunk-3AICELMQ.js";import"./chunk-XK6YXCS7.js";import"./chunk-JCWHX4XV.js";import"./chunk-FI4HRS2G.js";import"./chunk-FG5GL26L.js";import"./chunk-IEGAEXQX.js";import"./chunk-QTS2DS42.js";import"./chunk-QBDXUI2H.js";import"./chunk-2O5TT3UT.js";import"./chunk-R57J3O6I.js";import"./chunk-UROPIIB2.js";import"./chunk-5DJAJPBG.js";import"./chunk-4UZQSPR4.js";import"./chunk-IHRFR5SV.js";import"./chunk-TYZGEVP6.js";import"./chunk-DJRWVNHK.js";import"./chunk-MZ7M2CDV.js";import"./chunk-7Z3GBQNV.js";import"./chunk-3WIU2E2Y.js";import"./chunk-FGDEM4HU.js";import"./chunk-Q4HJRYQB.js";import"./chunk-LDGNVPBZ.js";import"./chunk-RNO6CE7I.js";import"./chunk-GY4EGQO3.js";import"./chunk-AQJ6XS34.js";import"./chunk-CNNVL5W4.js";import"./chunk-TULNR2AH.js";import"./chunk-7D2DM23U.js";import"./chunk-37I6K7QO.js";import"./chunk-XVTZXCHI.js";import"./chunk-KR2PGNXX.js";import"./chunk-GEXVUFK4.js";import"./chunk-QNSUPXUU.js";import"./chunk-UYLHIGNC.js";import"./chunk-ITBPDVK5.js";export{a as QEKernelImpl,b as createKernel};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.30");process.exit(0)}
|
|
2
|
-
import{g as a}from"./chunk-2O5TT3UT.js";import"./chunk-7Z3GBQNV.js";import"./chunk-3WIU2E2Y.js";import"./chunk-Q4HJRYQB.js";import"./chunk-LDGNVPBZ.js";import"./chunk-RNO6CE7I.js";import"./chunk-ITBPDVK5.js";export{a as KnowledgeGraphService};
|