agentic-qe 3.15.2 → 3.15.4
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/helpers/brain-checkpoint.cjs +46 -6
- package/.claude/hooks/aqe-hook.cjs +280 -51
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +155 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/adapters/ag-ui/state-delta-cache.js +14 -5
- package/dist/adapters/trajectory-adapter.js +3 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-T54G3TBK.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-664M7426.js → agent-booster-wasm-MHJBRXMK.js} +2 -2
- package/dist/cli/chunks/{agent-handler-E47ITH45.js → agent-handler-G64SD7J2.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-CFWVOJX3.js → agent-memory-branch-G4UXFPKH.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-HLCJJ3JM.js +2 -0
- package/dist/cli/chunks/{arena-ZU5CGBGH.js → arena-63M3M6EW.js} +2 -2
- package/dist/cli/chunks/{arena-JM3OY263.js → arena-QJMKYPHS.js} +4 -4
- package/dist/cli/chunks/{audit-HVBRC5AS.js → audit-UDFVTWSX.js} +3 -3
- package/dist/cli/chunks/base-VLD755UU.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-45JLBQX3.js → better-sqlite3-JLX2G56I.js} +2 -2
- package/dist/cli/chunks/{brain-handler-FKDONZYA.js → brain-handler-PWF32LLW.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-M3DPS3D5.js → branch-enumerator-PB7QWXDP.js} +2 -2
- package/dist/cli/chunks/{browser-TG2TV6NR.js → browser-CYNV2F3U.js} +2 -2
- package/dist/cli/chunks/browser-workflow-6M6VLWRF.js +2 -0
- package/dist/cli/chunks/{chunk-JFFVYCTV.js → chunk-2534PXIV.js} +2 -2
- package/dist/cli/chunks/{chunk-GHXNRF63.js → chunk-2DRMTRBM.js} +2 -2
- package/dist/cli/chunks/{chunk-L77Z3Q6L.js → chunk-2ICC4H6K.js} +2 -2
- package/dist/cli/chunks/{chunk-EATZW5T2.js → chunk-2LL35V3A.js} +2 -2
- package/dist/cli/chunks/{chunk-MEUJWTOX.js → chunk-2MU4WCMQ.js} +2 -2
- package/dist/cli/chunks/{chunk-3RC5UMRJ.js → chunk-33IUCP34.js} +2 -2
- package/dist/cli/chunks/{chunk-UX4BOI6K.js → chunk-35A22AUL.js} +1 -1
- package/dist/cli/chunks/{chunk-Z7XCXHEB.js → chunk-3BDDOFYW.js} +2 -2
- package/dist/cli/chunks/chunk-3C2BFLYC.js +54 -0
- package/dist/cli/chunks/{chunk-56CE7UO4.js → chunk-3MSBVOYW.js} +6 -6
- package/dist/cli/chunks/{chunk-EDRIROCG.js → chunk-3ZIVBTX6.js} +2 -2
- package/dist/cli/chunks/{chunk-CRYZXTSQ.js → chunk-4GLR2S2M.js} +2 -2
- package/dist/cli/chunks/{chunk-DHSGCI6H.js → chunk-54ITMOFM.js} +6 -6
- package/dist/cli/chunks/{chunk-2AWU2E6R.js → chunk-54XTJBHV.js} +1 -1
- package/dist/cli/chunks/{chunk-JSTKSPYT.js → chunk-5B5D5KCV.js} +1 -1
- package/dist/cli/chunks/{chunk-NP2WWIZ3.js → chunk-5GWTJJEO.js} +1 -1
- package/dist/cli/chunks/{chunk-D75HDHX3.js → chunk-5H7MR6HP.js} +1 -1
- package/dist/cli/chunks/{chunk-NWYAV2UG.js → chunk-5SS2Z7JC.js} +2 -2
- package/dist/cli/chunks/chunk-5XXLWJU7.js +2 -0
- package/dist/cli/chunks/{chunk-B4H66LPR.js → chunk-6EHVPFHW.js} +1 -1
- package/dist/cli/chunks/{chunk-HSXLHNSS.js → chunk-6HO3XRXE.js} +2 -2
- package/dist/cli/chunks/chunk-6HTO4BLV.js +2 -0
- package/dist/cli/chunks/{chunk-SVHFSOGT.js → chunk-6QPW4OVH.js} +1 -1
- package/dist/cli/chunks/{chunk-BKZSTZDB.js → chunk-6TMUZGM2.js} +1 -1
- package/dist/cli/chunks/{chunk-2AOAEMJG.js → chunk-73MTUM6F.js} +2 -2
- package/dist/cli/chunks/{chunk-ANI3KPB7.js → chunk-73PCVMGA.js} +2 -2
- package/dist/cli/chunks/{chunk-HADOG2PT.js → chunk-76PRW2KY.js} +2 -2
- package/dist/cli/chunks/{chunk-NL6HKEPR.js → chunk-7INP6HZH.js} +3 -3
- package/dist/cli/chunks/{chunk-QB7H62A4.js → chunk-7X2IVMXN.js} +2 -2
- package/dist/cli/chunks/{chunk-ZVQSIH7Y.js → chunk-A4OPQJ4A.js} +8 -8
- package/dist/cli/chunks/{chunk-SKQTRYE7.js → chunk-ADF6LGHZ.js} +2 -2
- package/dist/cli/chunks/{chunk-5YS2DF5G.js → chunk-AHVN3UQZ.js} +2 -2
- package/dist/cli/chunks/{chunk-3XF7YTQC.js → chunk-AOKSLWON.js} +54 -54
- package/dist/cli/chunks/{chunk-CFDIYZGA.js → chunk-ASKPTGUU.js} +2 -2
- package/dist/cli/chunks/{chunk-LH3H4V7C.js → chunk-B7GJXQD2.js} +2 -2
- package/dist/cli/chunks/{chunk-HOBBYORR.js → chunk-B7J3O2WM.js} +1 -1
- package/dist/cli/chunks/{chunk-J4EJMAH3.js → chunk-BBKLVHDQ.js} +1 -1
- package/dist/cli/chunks/{chunk-WMNVFCKY.js → chunk-BND6M2JX.js} +2 -2
- package/dist/cli/chunks/{chunk-LRVR56PD.js → chunk-BPGFCUDO.js} +1 -1
- package/dist/cli/chunks/{chunk-O6QTCUSL.js → chunk-BY3IL56R.js} +1 -1
- package/dist/cli/chunks/{chunk-3KXKJSKS.js → chunk-BY5PLEPZ.js} +32 -32
- package/dist/cli/chunks/{chunk-DGKPGRBT.js → chunk-BZWZTGMF.js} +2 -2
- package/dist/cli/chunks/{chunk-AS27JP67.js → chunk-C5EN5WB6.js} +1 -1
- package/dist/cli/chunks/chunk-CFXFGQEN.js +15 -0
- package/dist/cli/chunks/{chunk-X4CADOSD.js → chunk-CQ3WSTJ2.js} +2 -2
- package/dist/cli/chunks/{chunk-HFF5ERIE.js → chunk-D7RVZ5C2.js} +2 -2
- package/dist/cli/chunks/{chunk-HS3O763N.js → chunk-DAYMT7TH.js} +21 -21
- package/dist/cli/chunks/{chunk-W6PLBRRS.js → chunk-DBIK4OFX.js} +1 -1
- package/dist/cli/chunks/{chunk-OWZ3F7DJ.js → chunk-DEJM2P5K.js} +1 -1
- package/dist/cli/chunks/{chunk-TC4B5D4Z.js → chunk-DF4Y3HPO.js} +1 -1
- package/dist/cli/chunks/{chunk-7UA7SMM4.js → chunk-DFJGXXCL.js} +1 -1
- package/dist/cli/chunks/{chunk-SZYK5JL7.js → chunk-DPL4ZXTE.js} +1 -1
- package/dist/cli/chunks/{chunk-6WVEICL2.js → chunk-DVE5SM5G.js} +4 -4
- package/dist/cli/chunks/{chunk-QR5ILM34.js → chunk-EGHK6NMH.js} +2 -2
- package/dist/cli/chunks/{chunk-E6GANSLP.js → chunk-EWUFVWRT.js} +2 -2
- package/dist/cli/chunks/{chunk-HBMBO4FD.js → chunk-EY5IUF7U.js} +2 -2
- package/dist/cli/chunks/{chunk-JCB6K24D.js → chunk-FDK2GF4G.js} +2 -2
- package/dist/cli/chunks/{chunk-QZNFZ5IQ.js → chunk-FRBCX46J.js} +2 -2
- package/dist/cli/chunks/{chunk-FCMCQ6OX.js → chunk-G3ZUB3HD.js} +2 -2
- package/dist/cli/chunks/{chunk-QGCFMACF.js → chunk-GAXTPQCZ.js} +2 -2
- package/dist/cli/chunks/{chunk-6O4KVU4K.js → chunk-GJVRQBLI.js} +2 -2
- package/dist/cli/chunks/{chunk-NLY5NUHZ.js → chunk-GLKLEHK3.js} +2 -2
- package/dist/cli/chunks/{chunk-IM67YHDK.js → chunk-HCDTLV5J.js} +2 -2
- package/dist/cli/chunks/{chunk-MY2XZHW3.js → chunk-HEDLZWPM.js} +1 -1
- package/dist/cli/chunks/{chunk-WUSSZ2S6.js → chunk-HEKCN5XQ.js} +2 -2
- package/dist/cli/chunks/{chunk-FRZVLRVR.js → chunk-HFSBONCS.js} +2 -2
- package/dist/cli/chunks/{chunk-IAOB2G3X.js → chunk-HX5KQK7I.js} +2 -2
- package/dist/cli/chunks/{chunk-BT6TZTCL.js → chunk-I43QRLLB.js} +2 -2
- package/dist/cli/chunks/{chunk-QJN5RW2U.js → chunk-I53365HG.js} +3 -3
- package/dist/cli/chunks/{chunk-55T7PDYP.js → chunk-I5A3HGO6.js} +2 -2
- package/dist/cli/chunks/{chunk-AR5V7VNC.js → chunk-I6E4X3L3.js} +1 -1
- package/dist/cli/chunks/chunk-IKWAPHJA.js +2 -0
- package/dist/cli/chunks/{chunk-UKRK3IE3.js → chunk-ISASRHZP.js} +2 -2
- package/dist/cli/chunks/{chunk-IHKRKRAV.js → chunk-J3RNVHDH.js} +1 -1
- package/dist/cli/chunks/{chunk-T75PWWK4.js → chunk-JFQDWAU3.js} +2 -2
- package/dist/cli/chunks/{chunk-3KTAMNKI.js → chunk-JL3TI43V.js} +2 -2
- package/dist/cli/chunks/{chunk-3DCRAW43.js → chunk-K2VUYRMG.js} +2 -2
- package/dist/cli/chunks/{chunk-RIAKRZCZ.js → chunk-KOLHZSEC.js} +2 -2
- package/dist/cli/chunks/{chunk-HXT4XDQO.js → chunk-LGA6J4I4.js} +2 -2
- package/dist/cli/chunks/{chunk-MDDECCAC.js → chunk-LJRZAALA.js} +169 -168
- package/dist/cli/chunks/{chunk-2B2MGJ2W.js → chunk-LOLAEDZD.js} +2 -2
- package/dist/cli/chunks/{chunk-2JEPRQMT.js → chunk-LPSE6DOQ.js} +1 -1
- package/dist/cli/chunks/{chunk-6KEYA4EH.js → chunk-LRTF5RMG.js} +4 -4
- package/dist/cli/chunks/{chunk-CV7E627D.js → chunk-LXYTC62V.js} +2 -2
- package/dist/cli/chunks/{chunk-YYVLMW65.js → chunk-LY53L6NH.js} +2 -2
- package/dist/cli/chunks/{chunk-HMDSBWF6.js → chunk-LZSLJJII.js} +2 -2
- package/dist/cli/chunks/{chunk-IT753IPZ.js → chunk-M6SJALLA.js} +2 -2
- package/dist/cli/chunks/{chunk-GDSLQTJC.js → chunk-MBV57LKC.js} +2 -2
- package/dist/cli/chunks/{chunk-I7J2ESGR.js → chunk-MGH4XIHH.js} +2 -2
- package/dist/cli/chunks/{chunk-Q32UGPWK.js → chunk-MVTUFPM2.js} +2 -2
- package/dist/cli/chunks/{chunk-UZL4JYVW.js → chunk-N6CRIUTO.js} +2 -2
- package/dist/cli/chunks/{chunk-326V7N25.js → chunk-NBMQOP2R.js} +1 -1
- package/dist/cli/chunks/{chunk-ZIKH7U5A.js → chunk-NIJMLEAX.js} +2 -2
- package/dist/cli/chunks/{chunk-MYDZBABD.js → chunk-O7TMY4GS.js} +2 -2
- package/dist/cli/chunks/{chunk-LVDZ25VX.js → chunk-OFQDM73J.js} +2 -2
- package/dist/cli/chunks/{chunk-WBZIOTY6.js → chunk-OG4KHX7S.js} +2 -2
- package/dist/cli/chunks/{chunk-GJTH6VBH.js → chunk-OHH6BUZK.js} +1 -1
- package/dist/cli/chunks/{chunk-T5N2PIPS.js → chunk-OOK6GPJR.js} +2 -2
- package/dist/cli/chunks/{chunk-AXJ75X6I.js → chunk-P7GM3EE7.js} +1 -1
- package/dist/cli/chunks/{chunk-IQB5ZBYO.js → chunk-PB2WSCBW.js} +3 -3
- package/dist/cli/chunks/{chunk-M36DAETL.js → chunk-PCWZCXBD.js} +2 -2
- package/dist/cli/chunks/{chunk-Z3PANQUT.js → chunk-PEA4DVXW.js} +1 -1
- package/dist/cli/chunks/{chunk-WBCE6V2N.js → chunk-PJAXWCFC.js} +1 -1
- package/dist/cli/chunks/{chunk-V67UQRQN.js → chunk-PMXWDTDK.js} +2 -2
- package/dist/cli/chunks/chunk-QIAX3JJB.js +3 -0
- package/dist/cli/chunks/chunk-R47LNH5W.js +2 -0
- package/dist/cli/chunks/{chunk-A6L2OCMO.js → chunk-RA3MI5WK.js} +2 -2
- package/dist/cli/chunks/{chunk-ITM26I6O.js → chunk-RB2SL5GD.js} +2 -2
- package/dist/cli/chunks/{chunk-XQBH3366.js → chunk-RG67RZIX.js} +2 -2
- package/dist/cli/chunks/{chunk-NBV37CEK.js → chunk-RI4JPBZD.js} +2 -2
- package/dist/cli/chunks/{chunk-2Q4Y3VQ6.js → chunk-RJ5CZ7B6.js} +2 -2
- package/dist/cli/chunks/{chunk-ATGIGJSL.js → chunk-RJMBHZYL.js} +1 -1
- package/dist/cli/chunks/{chunk-MOSXT6AO.js → chunk-RWZ4F44Y.js} +2 -2
- package/dist/cli/chunks/{chunk-URWT3EQT.js → chunk-S5D3HCGN.js} +2 -2
- package/dist/cli/chunks/{chunk-KQMCCHPO.js → chunk-SCL2OYN7.js} +2 -2
- package/dist/cli/chunks/{chunk-Y5VPLOA7.js → chunk-SIUUAKCE.js} +1 -1
- package/dist/cli/chunks/{chunk-JIRX6KUR.js → chunk-SJB4KMZS.js} +3 -3
- package/dist/cli/chunks/{chunk-TZH2QAFZ.js → chunk-SOSJFEFB.js} +2 -2
- package/dist/cli/chunks/{chunk-IBAXNCR2.js → chunk-SZWXUG36.js} +2 -2
- package/dist/cli/chunks/{chunk-KTLYL3BS.js → chunk-T3BMCEQR.js} +2 -2
- package/dist/cli/chunks/chunk-TB22Y3WW.js +4 -0
- package/dist/cli/chunks/{chunk-GJ7DON5S.js → chunk-TVQPYP2Z.js} +3 -3
- package/dist/cli/chunks/chunk-U2E5F3VZ.js +14 -0
- package/dist/cli/chunks/{chunk-ZSKQPXRW.js → chunk-UK5HY6LC.js} +1 -1
- package/dist/cli/chunks/{chunk-RO6HAZLV.js → chunk-UORI2CZ4.js} +1 -1
- package/dist/cli/chunks/{chunk-VTGAPHJE.js → chunk-V3NZ23X6.js} +2 -2
- package/dist/cli/chunks/{chunk-W7P7EOJ4.js → chunk-VAXQUD5G.js} +1 -1
- package/dist/cli/chunks/{chunk-EQG3JYSV.js → chunk-VMSO6DMF.js} +2 -2
- package/dist/cli/chunks/{chunk-6UO5YSNN.js → chunk-W3PPYNHF.js} +2 -2
- package/dist/cli/chunks/{chunk-FH6N2LKG.js → chunk-W6TJXK5Y.js} +2 -2
- package/dist/cli/chunks/{chunk-WJ7657IX.js → chunk-WEDVLKRB.js} +2 -2
- package/dist/cli/chunks/{chunk-N653RGT3.js → chunk-WI5AEB7Q.js} +2 -2
- package/dist/cli/chunks/{chunk-W5EKSBS4.js → chunk-WO4NSPLX.js} +2 -2
- package/dist/cli/chunks/{chunk-YH7VOLBP.js → chunk-WW6WUMS7.js} +2 -2
- package/dist/cli/chunks/{chunk-6OL2WES5.js → chunk-WYO5VN2L.js} +1 -1
- package/dist/cli/chunks/{chunk-PZK7O445.js → chunk-X5S5UEM6.js} +2 -2
- package/dist/cli/chunks/{chunk-NKWMTXBL.js → chunk-XHCCH7UC.js} +3 -3
- package/dist/cli/chunks/{chunk-GSC6JXDE.js → chunk-XKIFNKHV.js} +1 -1
- package/dist/cli/chunks/{chunk-FNPZINHV.js → chunk-XZ5Z56OP.js} +1 -1
- package/dist/cli/chunks/{chunk-6XLCFDIB.js → chunk-YQ6BK7QC.js} +2 -2
- package/dist/cli/chunks/{chunk-DNS37AHW.js → chunk-YUWUFYHK.js} +1 -1
- package/dist/cli/chunks/{chunk-YJSKT6G6.js → chunk-YZ2AGC7O.js} +1 -1
- package/dist/cli/chunks/{chunk-5TEPPW4J.js → chunk-Z56QTRRB.js} +2 -2
- package/dist/cli/chunks/{chunk-4MCO43NX.js → chunk-ZAOQIVHG.js} +4 -4
- package/dist/cli/chunks/{chunk-TMYGGYRY.js → chunk-ZF5JTQEE.js} +1 -1
- package/dist/cli/chunks/{chunk-HYWW4A2E.js → chunk-ZKXZTIVF.js} +2 -2
- package/dist/cli/chunks/{chunk-N4MNSEKY.js → chunk-ZP6ANUP7.js} +1 -1
- package/dist/cli/chunks/{chunk-5DFPAJ5O.js → chunk-ZURYZEHX.js} +2 -2
- package/dist/cli/chunks/{ci-JNBOR6FP.js → ci-NGMGB43T.js} +3 -3
- package/dist/cli/chunks/{ci-output-FYNKONEQ.js → ci-output-BMJABAEX.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-KOIXRDAD.js → circuit-breaker-GYD5CMJQ.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-4CO7KHRN.js → claude-flow-setup-MMOYVBVD.js} +2 -2
- package/dist/cli/chunks/client-FUHNNK5O.js +2 -0
- package/dist/cli/chunks/{cline-installer-CMYAPKK5.js → cline-installer-B2SOZ44R.js} +2 -2
- package/dist/cli/chunks/{code-WFIAEP3H.js → code-V3FIRAXD.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-IYM6HWJN.js → code-index-extractor-CV6A756Z.js} +2 -2
- package/dist/cli/chunks/{codex-installer-DORVWRSU.js → codex-installer-EUC6J47Y.js} +2 -2
- package/dist/cli/chunks/{completions-54VM2MX2.js → completions-DQQIBAHR.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-EGZDP5N4.js → complexity-analyzer-HPXMXP5I.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-4SDVDD4T.js → continuedev-installer-RCIYXH6V.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-7FJQ7PCL.js → copilot-installer-VUH32SHF.js} +2 -2
- package/dist/cli/chunks/core-handlers-F7TLX4LM.js +2 -0
- package/dist/cli/chunks/cost-tracker-YLCKLOAL.js +2 -0
- package/dist/cli/chunks/{coverage-DI5LDRJ7.js → coverage-IVKDV236.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-EGWPY67O.js +2 -0
- package/dist/cli/chunks/{cursor-installer-RTSZP5YD.js → cursor-installer-B42FN62K.js} +2 -2
- package/dist/cli/chunks/{daemon-SP3APEZY.js → daemon-DECQRQII.js} +3 -3
- package/dist/cli/chunks/{daemon-LM7LETPV.js → daemon-IPTOSCHM.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-C3QBODFE.js → dag-attention-scheduler-RY7CDYSC.js} +2 -2
- package/dist/cli/chunks/{detect-I4RBUFFJ.js → detect-NW53BMJN.js} +2 -2
- package/dist/cli/chunks/{dist-node-PT6TCBCO.js → dist-node-LE6KHXAB.js} +2 -2
- package/dist/cli/chunks/{domain-handler-MJMTMB5X.js → domain-handler-JGXFT4LW.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-Y4A2WYJW.js → domain-plugins-GY3RYKKK.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-DUO42TLA.js → domain-transfer-CGBRXNTC.js} +2 -2
- package/dist/cli/chunks/dream-V4QN6OF5.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-66ZQK4AI.js → embed-and-insert-pattern-65H4XHWR.js} +2 -2
- package/dist/cli/chunks/{eval-NQ7H27UF.js → eval-YPYIZQUR.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-MHEYPTIG.js → experience-capture-middleware-4JXVF5PL.js} +3 -3
- package/dist/cli/chunks/{fast-paths-YYDGN6ZC.js → fast-paths-HYQTAF2S.js} +2 -2
- package/dist/cli/chunks/{feature-flags-FY4DOYS2.js → feature-flags-HNSAFFX2.js} +2 -2
- package/dist/cli/chunks/{feature-flags-YFGUORHY.js → feature-flags-YACUH6OW.js} +2 -2
- package/dist/cli/chunks/{file-discovery-TOMDY7TK.js → file-discovery-R73BYEXB.js} +2 -2
- package/dist/cli/chunks/{fleet-MO3UCWB4.js → fleet-6M3BP4OO.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-SLW4PPXQ.js → gnn-wrapper-QLD7KHXV.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-36RFCP4E.js → heartbeat-handler-EZP333X4.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-3N3L6CRM.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-2BXJYDXI.js +2 -0
- package/dist/cli/chunks/hnsw-index-2DLI5OVO.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-BJLWBKHE.js → hnsw-legacy-bridge-47CUCSAU.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-RAYNVJCJ.js → hnswlib-node-SVNYDJZH.js} +2 -2
- package/dist/cli/chunks/{hooks-JMHFWVEQ.js → hooks-6V5LMWP6.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-OW4J65YH.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-JUDBKPOX.js → hypergraph-engine-L2FOBIFF.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-AXTWXOZU.js → hypergraph-handler-DU6Z57EE.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-ZH5I2RG6.js +2 -0
- package/dist/cli/chunks/{init-handler-PARJNZFF.js → init-handler-HETPWU67.js} +6 -6
- package/dist/cli/chunks/init-wizard-NIKM3ZOK.js +2 -0
- package/dist/cli/chunks/kernel-2EOSVM6X.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-22HX2E4V.js → kilocode-installer-NHKYGJ7Q.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-OVPBLY7J.js → kiro-installer-24UK6GGR.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-D3BPWNNO.js +2 -0
- package/dist/cli/chunks/{learning-DWXPJ3R6.js → learning-QLVRZNHT.js} +3 -3
- package/dist/cli/chunks/{llm-router-7PPVVKNG.js → llm-router-XRMI2VMG.js} +4 -4
- package/dist/cli/chunks/llm-router-service-TJPPZFUN.js +2 -0
- package/dist/cli/chunks/{load-VI5XHNZA.js → load-W5UWL5C7.js} +2 -2
- package/dist/cli/chunks/load-test-RFT7IDOL.js +2 -0
- package/dist/cli/chunks/{mcp-UW4Z3Z64.js → mcp-N7ALQ4BL.js} +2 -2
- package/dist/cli/chunks/{memory-UD2KCB5M.js → memory-WV52DLSA.js} +5 -5
- package/dist/cli/chunks/memory-backend-O2O4CFKZ.js +2 -0
- package/dist/cli/chunks/memory-handlers-DAEGUDBD.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-5O4WWU5Z.js → multi-model-executor-3FVTZCSO.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-DTRFDGM7.js → opencode-installer-NTPWGHUW.js} +2 -2
- package/dist/cli/chunks/{orchestrator-ENJIKV6Z.js → orchestrator-ORGJ6VAA.js} +85 -26
- package/dist/cli/chunks/pattern-null-store-TUBNXS34.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-QPNIU5PD.js → pattern-usage-recorder-WWXHUH5U.js} +2 -2
- package/dist/cli/chunks/{pipeline-G3JYDNPE.js → pipeline-ZOKZFXTH.js} +2 -2
- package/dist/cli/chunks/{platform-P4WR6N3D.js → platform-CDNL322F.js} +2 -2
- package/dist/cli/chunks/{plugin-C7763Q5W.js → plugin-ZVLFNZZ4.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-DH6R3XSZ.js → prime-radiant-advanced-wasm-FVJDU2JY.js} +2 -2
- package/dist/cli/chunks/{project-root-7DTXDLEG.js → project-root-UCHQH3QL.js} +2 -2
- package/dist/cli/chunks/protocol-executor-6FQTTO3Y.js +2 -0
- package/dist/cli/chunks/{protocol-handler-EODULGOZ.js → protocol-handler-4YBN5R23.js} +2 -2
- package/dist/cli/chunks/{prove-A7G3SIOF.js → prove-BHDHY664.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-TKPND56C.js +2 -0
- package/dist/cli/chunks/{quality-JTURFUX3.js → quality-46AK277P.js} +2 -2
- package/dist/cli/chunks/{quality-gate-M2EI754V.js → quality-gate-WANE7TCN.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-DWMXLPJG.js +2 -0
- package/dist/cli/chunks/{real-embeddings-DI7JMCG7.js → real-embeddings-56MNGJGJ.js} +2 -2
- package/dist/cli/chunks/{ref-validation-MSFMNKDR.js → ref-validation-S7UWXQIP.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-XIMFFHOH.js → roocode-installer-TEYOQYL6.js} +2 -2
- package/dist/cli/chunks/router-QIMUYRCC.js +2 -0
- package/dist/cli/chunks/routing-feedback-4OH5ZNF4.js +2 -0
- package/dist/cli/chunks/{routing-handler-MCDKNBQW.js → routing-handler-KDTLMRWD.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-OBSYAK2X.js → ruvector-commands-AOUDXCYE.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-S6JBZL54.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-TSGMLMYR.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-4DTRIHY6.js → rvf-migration-coordinator-V74MVBHS.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-Z7QOW47S.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-CWAVMRC4.js → rvf-store-integrity-QI47Y354.js} +2 -2
- package/dist/cli/chunks/safe-db-JLOVBJNC.js +2 -0
- package/dist/cli/chunks/schedule-IM6XOBGR.js +2 -0
- package/dist/cli/chunks/scheduler-XL2SVVK5.js +2 -0
- package/dist/cli/chunks/{security-74TWSO74.js → security-SN6MWOJT.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-ZHNAGE5H.js → shared-rvf-adapter-2LB56LP4.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-BS5WAVCC.js → shared-rvf-dual-writer-WU7PFKQM.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-LWMIIC4U.js +2 -0
- package/dist/cli/chunks/{standalone-memory-3HGHTE7S.js → standalone-memory-F6FSRFWC.js} +2 -2
- package/dist/cli/chunks/{status-handler-XWEEGNGH.js → status-handler-DHD5MS4G.js} +2 -2
- package/dist/cli/chunks/{structural-health-TB5JGMVS.js → structural-health-P6HPSQMR.js} +2 -2
- package/dist/cli/chunks/{sync-T4VLBURM.js → sync-LISJGDSE.js} +2 -2
- package/dist/cli/chunks/sync-SNAXAVCN.js +2 -0
- package/dist/cli/chunks/{task-handler-RQ65QKXX.js → task-handler-ZT44NT5Z.js} +2 -2
- package/dist/cli/chunks/{task-handlers-USYWJ4H2.js → task-handlers-R6DQ5324.js} +3 -3
- package/dist/cli/chunks/test-MUFHR4JQ.js +34 -0
- package/dist/cli/chunks/test-scheduling-TAUSLZJP.js +15 -0
- package/dist/cli/chunks/token-bootstrap-UGRH7OPU.js +2 -0
- package/dist/cli/chunks/{token-usage-CISTB5K5.js → token-usage-IX65ECBR.js} +2 -2
- package/dist/cli/chunks/{transformers-C7LV763N.js → transformers-QKPSVW2W.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-P26JC3YV.js → tree-sitter-wasm-parser-Z7PPA2JO.js} +2 -2
- package/dist/cli/chunks/{types-YMVMKIWB.js → types-ULNNGGGH.js} +2 -2
- package/dist/cli/chunks/unified-memory-F5IJY7W7.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-C3WAMAQL.js +2 -0
- package/dist/cli/chunks/unified-persistence-EWXXOTCB.js +2 -0
- package/dist/cli/chunks/{upgrade-U2REOPAW.js → upgrade-ECI3YUYA.js} +2 -2
- package/dist/cli/chunks/{validate-NDTCKN7P.js → validate-3JKRUW2S.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-OJUGVH5Q.js → validate-swarm-LZWANCIE.js} +2 -2
- package/dist/cli/chunks/visual-security-CKLTAIAB.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-2CLRSA7K.js → web-tree-sitter-N5V4A6XG.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-DSUJJ4PG.js → windsurf-installer-5TBM5B3C.js} +2 -2
- package/dist/cli/chunks/{witness-chain-TEGL4ZWB.js → witness-chain-MFP3HBWQ.js} +2 -2
- package/dist/cli/chunks/witness-chain-Z6LWFEZS.js +2 -0
- package/dist/cli/chunks/witness-chain-repair-5QWRFVUK.js +2 -0
- package/dist/cli/chunks/{witness-chain-verifier-SPXKFC67.js → witness-chain-verifier-SRAT7LVY.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-EALOV4OV.js → witness-key-manager-FYZXQTLJ.js} +2 -2
- package/dist/cli/chunks/{workflow-PYI6HCAG.js → workflow-M7TUYYXY.js} +5 -5
- package/dist/cli/chunks/workflow-orchestrator-OFTAR2NA.js +2 -0
- package/dist/cli/chunks/wrappers-COU73OQ6.js +2 -0
- package/dist/cli/commands/test.js +30 -12
- package/dist/cli/commands/workflow.js +3 -0
- package/dist/cli/scheduler/persistent-scheduler.d.ts +2 -0
- package/dist/cli/scheduler/persistent-scheduler.js +12 -2
- package/dist/cli/utils/generated-test-writer.d.ts +35 -0
- package/dist/cli/utils/generated-test-writer.js +44 -0
- package/dist/context/compiler.js +4 -1
- package/dist/coordination/consensus/providers/ollama-provider.js +16 -27
- package/dist/coordination/consensus/providers/openrouter-provider.js +13 -24
- package/dist/coordination/handlers/test-execution-handlers.js +4 -2
- package/dist/coordination/protocols/defect-investigation.js +4 -1
- package/dist/domains/code-intelligence/services/metric-collector/listing-process-owner.d.ts +3 -0
- package/dist/domains/code-intelligence/services/metric-collector/listing-process-owner.js +57 -0
- package/dist/domains/code-intelligence/services/metric-collector/test-counter.js +127 -39
- package/dist/domains/coverage-analysis/services/gap-detector.js +3 -1
- package/dist/domains/learning-optimization/services/learning-coordinator.js +4 -2
- package/dist/domains/test-execution/services/flaky-detector.js +8 -2
- package/dist/domains/test-execution/services/retry-handler.js +23 -20
- package/dist/domains/test-execution/services/test-executor.js +5 -2
- package/dist/domains/test-generation/services/test-generator.js +5 -2
- package/dist/governance/compliance-reporter.js +8 -7
- package/dist/governance/proof-envelope-integration.js +3 -1
- package/dist/init/phases/07-hooks.js +30 -4
- package/dist/init/phases/10-workers.js +42 -6
- package/dist/integrations/agentic-flow/onnx-embeddings/embedding-generator.d.ts +4 -1
- package/dist/integrations/agentic-flow/onnx-embeddings/embedding-generator.js +6 -2
- package/dist/integrations/browser/qe-dashboard/wasm-vector-store.js +2 -1
- package/dist/integrations/ruvector/coverage-router.d.ts +3 -1
- package/dist/integrations/ruvector/coverage-router.js +7 -6
- package/dist/integrations/ruvector/diff-risk-classifier.js +5 -4
- package/dist/integrations/ruvector/rvf-dual-writer.js +10 -1
- package/dist/integrations/vibium/runtime.js +2 -6
- package/dist/learning/dream/dream-engine.d.ts +5 -0
- package/dist/learning/dream/dream-engine.js +20 -3
- package/dist/learning/embedding-space.d.ts +18 -0
- package/dist/learning/embedding-space.js +33 -0
- package/dist/learning/rvf-pattern-store.js +19 -5
- package/dist/mcp/bundle.js +442 -441
- package/dist/mcp/handlers/domain-handler-configs.d.ts +42 -0
- package/dist/mcp/handlers/handler-factory.js +3 -1
- package/dist/mcp/handlers/save-results-option.d.ts +62 -0
- package/dist/mcp/handlers/save-results-option.js +35 -0
- package/dist/mcp/protocol-server.js +22 -11
- package/dist/mcp/security/rate-limiter.d.ts +8 -1
- package/dist/mcp/security/rate-limiter.js +33 -4
- package/dist/mcp/services/session-resume.js +11 -0
- package/dist/mcp/services/session-store.d.ts +31 -2
- package/dist/mcp/services/session-store.js +95 -16
- package/dist/mcp/services/session-write-buffer.d.ts +55 -0
- package/dist/mcp/services/session-write-buffer.js +144 -0
- package/dist/mcp/types.d.ts +18 -0
- package/dist/memory/crdt/convergence-tracker.js +14 -24
- package/dist/memory/crdt/crdt-store.js +15 -0
- package/dist/memory/crdt/g-counter.js +10 -8
- package/dist/memory/crdt/lww-register.js +3 -3
- package/dist/memory/crdt/or-set.js +18 -0
- package/dist/planning/goap-planner.js +18 -10
- package/dist/shared/embeddings/embedding-cache.d.ts +3 -3
- package/dist/shared/embeddings/embedding-cache.js +8 -8
- package/dist/shared/embeddings/nomic-embedder.js +9 -6
- package/dist/shared/embeddings/ollama-client.d.ts +1 -1
- package/dist/shared/embeddings/ollama-client.js +30 -31
- package/dist/shared/git/git-analyzer.d.ts +4 -1
- package/dist/shared/git/git-analyzer.js +9 -4
- package/dist/shared/llm/cache.js +1 -1
- package/dist/shared/llm/cost-tracker.js +8 -6
- package/dist/shared/llm/providers/azure-openai.js +5 -21
- package/dist/shared/llm/providers/bedrock.js +5 -21
- package/dist/shared/llm/providers/claude.js +5 -21
- package/dist/shared/llm/providers/cognitum.js +5 -17
- package/dist/shared/llm/providers/gemini.js +9 -23
- package/dist/shared/llm/providers/ollama.js +5 -21
- package/dist/shared/llm/providers/openai.js +5 -21
- package/dist/shared/llm/providers/openrouter.js +9 -23
- package/dist/shared/llm/providers/response-deadline.d.ts +3 -0
- package/dist/shared/llm/providers/response-deadline.js +100 -0
- package/dist/shared/llm/spend-ledger.js +3 -2
- package/dist/shared/metrics/code-metrics.d.ts +1 -0
- package/dist/shared/metrics/code-metrics.js +3 -44
- package/dist/shared/metrics/cognitive-complexity.d.ts +17 -0
- package/dist/shared/metrics/cognitive-complexity.js +108 -0
- package/dist/shared/npm-cli-invocation.d.ts +21 -0
- package/dist/shared/npm-cli-invocation.js +28 -0
- package/dist/shared/optional-module.js +24 -0
- package/dist/shared/test-runner-args.d.ts +42 -0
- package/dist/shared/test-runner-args.js +74 -0
- package/dist/shared/utils/safe-record.d.ts +18 -0
- package/dist/shared/utils/safe-record.js +28 -0
- package/dist/test-scheduling/executors/vitest-executor.js +23 -5
- package/dist/workers/quality-daemon/git-watcher.js +5 -0
- package/package.json +1 -1
- package/dist/adapters/ag-ui/json-patch-utils.d.ts +0 -136
- package/dist/adapters/ag-ui/json-patch-utils.js +0 -575
- package/dist/cli/chunks/adapter-EUIELRLI.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-LXRKHASR.js +0 -2
- package/dist/cli/chunks/base-4DSLX33Y.js +0 -2
- package/dist/cli/chunks/browser-workflow-AWCQLQZK.js +0 -2
- package/dist/cli/chunks/chunk-E2QHUMCR.js +0 -2
- package/dist/cli/chunks/chunk-I7ECEOFV.js +0 -2
- package/dist/cli/chunks/chunk-LW4BCFIV.js +0 -15
- package/dist/cli/chunks/chunk-QJGKL67W.js +0 -54
- package/dist/cli/chunks/chunk-RLQ4MYB6.js +0 -3
- package/dist/cli/chunks/chunk-X43HA3RF.js +0 -14
- package/dist/cli/chunks/chunk-Z3K4JZXQ.js +0 -4
- package/dist/cli/chunks/client-UJVHZXNQ.js +0 -2
- package/dist/cli/chunks/core-handlers-AFXZOSH3.js +0 -2
- package/dist/cli/chunks/cost-tracker-D6YSKTQC.js +0 -2
- package/dist/cli/chunks/cross-domain-router-ZLNVKLIR.js +0 -2
- package/dist/cli/chunks/dream-4OPJXXEG.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-J5KLHO6C.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-56P6XSFR.js +0 -2
- package/dist/cli/chunks/hnsw-index-GFZ6XCEW.js +0 -2
- package/dist/cli/chunks/hybrid-backend-TUBWJDDN.js +0 -2
- package/dist/cli/chunks/impact-analyzer-FXVGKS6B.js +0 -2
- package/dist/cli/chunks/init-wizard-LK73HQ7W.js +0 -2
- package/dist/cli/chunks/kernel-TCZDKRSI.js +0 -2
- package/dist/cli/chunks/knowledge-graph-TWMB2GH2.js +0 -2
- package/dist/cli/chunks/llm-router-service-HPDH3P77.js +0 -2
- package/dist/cli/chunks/load-test-HTYOUYSN.js +0 -2
- package/dist/cli/chunks/memory-backend-X5BE2MPK.js +0 -2
- package/dist/cli/chunks/memory-handlers-SQXMFX5X.js +0 -2
- package/dist/cli/chunks/pattern-null-store-OCQGQZU6.js +0 -2
- package/dist/cli/chunks/protocol-executor-CYEQHQCL.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-GSTA5WJ4.js +0 -2
- package/dist/cli/chunks/queen-coordinator-Y2Q5RQL7.js +0 -2
- package/dist/cli/chunks/router-4QB5L4IW.js +0 -2
- package/dist/cli/chunks/routing-feedback-YBVHJY5L.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-T5B456SW.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-2O2NL7ZF.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-RDB3GWTW.js +0 -2
- package/dist/cli/chunks/safe-db-YXVMLFU4.js +0 -2
- package/dist/cli/chunks/schedule-K6XWCCSK.js +0 -2
- package/dist/cli/chunks/scheduler-4MW22D6Q.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-UVDHUSAU.js +0 -2
- package/dist/cli/chunks/sync-LSPNSVDI.js +0 -2
- package/dist/cli/chunks/test-M2XTKD62.js +0 -33
- package/dist/cli/chunks/test-scheduling-GYXJQHJL.js +0 -15
- package/dist/cli/chunks/token-bootstrap-OTEMRUFR.js +0 -2
- package/dist/cli/chunks/unified-memory-UUK77NSE.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-JOUE6WNF.js +0 -2
- package/dist/cli/chunks/unified-persistence-3DRJGNQE.js +0 -2
- package/dist/cli/chunks/visual-security-EM7FQG5X.js +0 -2
- package/dist/cli/chunks/witness-chain-7NZ6IIUN.js +0 -2
- package/dist/cli/chunks/witness-chain-repair-ZWS5WXFL.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-3C3S5FIM.js +0 -2
- package/dist/cli/chunks/wrappers-NXJHGK3W.js +0 -2
|
@@ -1,575 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JSON Patch Utilities (RFC 6902)
|
|
3
|
-
*
|
|
4
|
-
* Provides utilities for computing and applying JSON Patch operations
|
|
5
|
-
* for AG-UI STATE_DELTA event synchronization.
|
|
6
|
-
*
|
|
7
|
-
* Reference: https://datatracker.ietf.org/doc/html/rfc6902
|
|
8
|
-
*
|
|
9
|
-
* @module adapters/ag-ui/json-patch-utils
|
|
10
|
-
*/
|
|
11
|
-
import { toErrorMessage } from '../../shared/error-utils.js';
|
|
12
|
-
// ============================================================================
|
|
13
|
-
// Path Utilities
|
|
14
|
-
// ============================================================================
|
|
15
|
-
/**
|
|
16
|
-
* Escape special characters in a JSON Pointer token (RFC 6901)
|
|
17
|
-
* ~ becomes ~0
|
|
18
|
-
* / becomes ~1
|
|
19
|
-
*/
|
|
20
|
-
export function escapePathToken(token) {
|
|
21
|
-
return token.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Unescape special characters in a JSON Pointer token (RFC 6901)
|
|
25
|
-
* ~0 becomes ~
|
|
26
|
-
* ~1 becomes /
|
|
27
|
-
*/
|
|
28
|
-
export function unescapePathToken(token) {
|
|
29
|
-
return token.replace(/~1/g, '/').replace(/~0/g, '~');
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Parse a JSON Pointer path into tokens
|
|
33
|
-
*/
|
|
34
|
-
export function parsePath(path) {
|
|
35
|
-
if (path === '') {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
if (!path.startsWith('/')) {
|
|
39
|
-
throw new Error(`Invalid JSON Pointer: path must start with '/' or be empty, got '${path}'`);
|
|
40
|
-
}
|
|
41
|
-
return path.slice(1).split('/').map(unescapePathToken);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Build a JSON Pointer path from tokens
|
|
45
|
-
*/
|
|
46
|
-
export function buildPath(tokens) {
|
|
47
|
-
if (tokens.length === 0) {
|
|
48
|
-
return '';
|
|
49
|
-
}
|
|
50
|
-
return '/' + tokens.map(escapePathToken).join('/');
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Get a value from an object using a JSON Pointer path
|
|
54
|
-
*/
|
|
55
|
-
export function getValueAtPath(document, path) {
|
|
56
|
-
if (path === '') {
|
|
57
|
-
return document;
|
|
58
|
-
}
|
|
59
|
-
const tokens = parsePath(path);
|
|
60
|
-
let current = document;
|
|
61
|
-
for (const token of tokens) {
|
|
62
|
-
if (current === null || current === undefined) {
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
if (Array.isArray(current)) {
|
|
66
|
-
const index = token === '-' ? current.length : parseInt(token, 10);
|
|
67
|
-
if (isNaN(index) || index < 0) {
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
current = current[index];
|
|
71
|
-
}
|
|
72
|
-
else if (typeof current === 'object') {
|
|
73
|
-
current = current[token];
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
return undefined;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return current;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Set a value at a JSON Pointer path (mutates the document)
|
|
83
|
-
*/
|
|
84
|
-
export function setValueAtPath(document, path, value) {
|
|
85
|
-
if (path === '') {
|
|
86
|
-
throw new Error('Cannot replace root document');
|
|
87
|
-
}
|
|
88
|
-
const tokens = parsePath(path);
|
|
89
|
-
const lastToken = tokens.pop();
|
|
90
|
-
let current = document;
|
|
91
|
-
for (const token of tokens) {
|
|
92
|
-
if (current === null || current === undefined) {
|
|
93
|
-
throw new Error(`Path does not exist: ${path}`);
|
|
94
|
-
}
|
|
95
|
-
if (Array.isArray(current)) {
|
|
96
|
-
const index = parseInt(token, 10);
|
|
97
|
-
if (isNaN(index) || index < 0 || index >= current.length) {
|
|
98
|
-
throw new Error(`Invalid array index: ${token}`);
|
|
99
|
-
}
|
|
100
|
-
current = current[index];
|
|
101
|
-
}
|
|
102
|
-
else if (typeof current === 'object') {
|
|
103
|
-
if (!(token in current)) {
|
|
104
|
-
throw new Error(`Path does not exist: ${path}`);
|
|
105
|
-
}
|
|
106
|
-
current = current[token];
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
throw new Error(`Cannot traverse non-object: ${path}`);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
if (Array.isArray(current)) {
|
|
113
|
-
const index = lastToken === '-' ? current.length : parseInt(lastToken, 10);
|
|
114
|
-
if (isNaN(index) || index < 0) {
|
|
115
|
-
throw new Error(`Invalid array index: ${lastToken}`);
|
|
116
|
-
}
|
|
117
|
-
current[index] = value;
|
|
118
|
-
}
|
|
119
|
-
else if (typeof current === 'object' && current !== null) {
|
|
120
|
-
current[lastToken] = value;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
throw new Error(`Cannot set value at path: ${path}`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Delete a value at a JSON Pointer path (mutates the document)
|
|
128
|
-
*/
|
|
129
|
-
export function deleteValueAtPath(document, path) {
|
|
130
|
-
if (path === '') {
|
|
131
|
-
throw new Error('Cannot remove root document');
|
|
132
|
-
}
|
|
133
|
-
const tokens = parsePath(path);
|
|
134
|
-
const lastToken = tokens.pop();
|
|
135
|
-
let current = document;
|
|
136
|
-
for (const token of tokens) {
|
|
137
|
-
if (current === null || current === undefined) {
|
|
138
|
-
throw new Error(`Path does not exist: ${path}`);
|
|
139
|
-
}
|
|
140
|
-
if (Array.isArray(current)) {
|
|
141
|
-
const index = parseInt(token, 10);
|
|
142
|
-
if (isNaN(index) || index < 0 || index >= current.length) {
|
|
143
|
-
throw new Error(`Invalid array index: ${token}`);
|
|
144
|
-
}
|
|
145
|
-
current = current[index];
|
|
146
|
-
}
|
|
147
|
-
else if (typeof current === 'object') {
|
|
148
|
-
current = current[token];
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
throw new Error(`Cannot traverse non-object: ${path}`);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if (Array.isArray(current)) {
|
|
155
|
-
const index = parseInt(lastToken, 10);
|
|
156
|
-
if (isNaN(index) || index < 0 || index >= current.length) {
|
|
157
|
-
throw new Error(`Invalid array index: ${lastToken}`);
|
|
158
|
-
}
|
|
159
|
-
current.splice(index, 1);
|
|
160
|
-
}
|
|
161
|
-
else if (typeof current === 'object' && current !== null) {
|
|
162
|
-
if (!(lastToken in current)) {
|
|
163
|
-
throw new Error(`Path does not exist: ${path}`);
|
|
164
|
-
}
|
|
165
|
-
delete current[lastToken];
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
throw new Error(`Cannot delete value at path: ${path}`);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Check if a path exists in the document
|
|
173
|
-
*/
|
|
174
|
-
export function pathExists(document, path) {
|
|
175
|
-
if (path === '') {
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
|
-
const tokens = parsePath(path);
|
|
179
|
-
let current = document;
|
|
180
|
-
for (const token of tokens) {
|
|
181
|
-
if (current === null || current === undefined) {
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
if (Array.isArray(current)) {
|
|
185
|
-
const index = parseInt(token, 10);
|
|
186
|
-
if (isNaN(index) || index < 0 || index >= current.length) {
|
|
187
|
-
return false;
|
|
188
|
-
}
|
|
189
|
-
current = current[index];
|
|
190
|
-
}
|
|
191
|
-
else if (typeof current === 'object') {
|
|
192
|
-
if (!(token in current)) {
|
|
193
|
-
return false;
|
|
194
|
-
}
|
|
195
|
-
current = current[token];
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return true;
|
|
202
|
-
}
|
|
203
|
-
// ============================================================================
|
|
204
|
-
// Validation
|
|
205
|
-
// ============================================================================
|
|
206
|
-
/**
|
|
207
|
-
* Validate a single patch operation
|
|
208
|
-
*/
|
|
209
|
-
export function validateOperation(op) {
|
|
210
|
-
// Check operation type
|
|
211
|
-
const validOps = ['add', 'remove', 'replace', 'move', 'copy', 'test'];
|
|
212
|
-
if (!validOps.includes(op.op)) {
|
|
213
|
-
return { valid: false, error: `Invalid operation: ${op.op}` };
|
|
214
|
-
}
|
|
215
|
-
// Check path
|
|
216
|
-
if (typeof op.path !== 'string') {
|
|
217
|
-
return { valid: false, error: 'Path must be a string' };
|
|
218
|
-
}
|
|
219
|
-
if (op.path !== '' && !op.path.startsWith('/')) {
|
|
220
|
-
return { valid: false, error: 'Path must start with / or be empty' };
|
|
221
|
-
}
|
|
222
|
-
// Check value for operations that require it
|
|
223
|
-
if (['add', 'replace', 'test'].includes(op.op) && !('value' in op)) {
|
|
224
|
-
return { valid: false, error: `Operation '${op.op}' requires a value` };
|
|
225
|
-
}
|
|
226
|
-
// Check from for move/copy operations
|
|
227
|
-
if (['move', 'copy'].includes(op.op)) {
|
|
228
|
-
if (!('from' in op) || typeof op.from !== 'string') {
|
|
229
|
-
return { valid: false, error: `Operation '${op.op}' requires 'from' path` };
|
|
230
|
-
}
|
|
231
|
-
if (op.from !== '' && !op.from.startsWith('/')) {
|
|
232
|
-
return { valid: false, error: "'from' path must start with / or be empty" };
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
return { valid: true };
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Validate an array of patch operations
|
|
239
|
-
*/
|
|
240
|
-
export function validatePatch(patch) {
|
|
241
|
-
for (let i = 0; i < patch.length; i++) {
|
|
242
|
-
const result = validateOperation(patch[i]);
|
|
243
|
-
if (!result.valid) {
|
|
244
|
-
return { valid: false, error: `Operation ${i}: ${result.error}` };
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
return { valid: true };
|
|
248
|
-
}
|
|
249
|
-
// ============================================================================
|
|
250
|
-
// Patch Application
|
|
251
|
-
// ============================================================================
|
|
252
|
-
/**
|
|
253
|
-
* Apply a single patch operation to a document
|
|
254
|
-
* Returns a new document (immutable)
|
|
255
|
-
*/
|
|
256
|
-
export function applyOperation(document, op) {
|
|
257
|
-
// Deep clone to avoid mutation
|
|
258
|
-
const result = structuredClone(document);
|
|
259
|
-
switch (op.op) {
|
|
260
|
-
case 'add': {
|
|
261
|
-
if (op.path === '') {
|
|
262
|
-
// Replace entire document
|
|
263
|
-
if (typeof op.value !== 'object' || op.value === null) {
|
|
264
|
-
throw new Error('Cannot replace root with non-object');
|
|
265
|
-
}
|
|
266
|
-
return structuredClone(op.value);
|
|
267
|
-
}
|
|
268
|
-
addValue(result, op.path, op.value);
|
|
269
|
-
break;
|
|
270
|
-
}
|
|
271
|
-
case 'remove': {
|
|
272
|
-
deleteValueAtPath(result, op.path);
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
case 'replace': {
|
|
276
|
-
if (!pathExists(result, op.path)) {
|
|
277
|
-
throw new Error(`Path does not exist for replace: ${op.path}`);
|
|
278
|
-
}
|
|
279
|
-
setValueAtPath(result, op.path, structuredClone(op.value));
|
|
280
|
-
break;
|
|
281
|
-
}
|
|
282
|
-
case 'move': {
|
|
283
|
-
const from = op.from;
|
|
284
|
-
const value = getValueAtPath(result, from);
|
|
285
|
-
if (value === undefined && !pathExists(result, from)) {
|
|
286
|
-
throw new Error(`Source path does not exist for move: ${from}`);
|
|
287
|
-
}
|
|
288
|
-
deleteValueAtPath(result, from);
|
|
289
|
-
addValue(result, op.path, structuredClone(value));
|
|
290
|
-
break;
|
|
291
|
-
}
|
|
292
|
-
case 'copy': {
|
|
293
|
-
const from = op.from;
|
|
294
|
-
const value = getValueAtPath(result, from);
|
|
295
|
-
if (value === undefined && !pathExists(result, from)) {
|
|
296
|
-
throw new Error(`Source path does not exist for copy: ${from}`);
|
|
297
|
-
}
|
|
298
|
-
addValue(result, op.path, structuredClone(value));
|
|
299
|
-
break;
|
|
300
|
-
}
|
|
301
|
-
case 'test': {
|
|
302
|
-
const currentValue = getValueAtPath(result, op.path);
|
|
303
|
-
if (!deepEqual(currentValue, op.value)) {
|
|
304
|
-
throw new Error(`Test failed at path ${op.path}: expected ${JSON.stringify(op.value)}, got ${JSON.stringify(currentValue)}`);
|
|
305
|
-
}
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
default:
|
|
309
|
-
throw new Error(`Unknown operation: ${op.op}`);
|
|
310
|
-
}
|
|
311
|
-
return result;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Add a value at a path (handles array insertion)
|
|
315
|
-
*/
|
|
316
|
-
function addValue(document, path, value) {
|
|
317
|
-
const tokens = parsePath(path);
|
|
318
|
-
const lastToken = tokens.pop();
|
|
319
|
-
let current = document;
|
|
320
|
-
// Navigate to parent
|
|
321
|
-
for (const token of tokens) {
|
|
322
|
-
if (current === null || current === undefined) {
|
|
323
|
-
throw new Error(`Path does not exist: ${path}`);
|
|
324
|
-
}
|
|
325
|
-
if (Array.isArray(current)) {
|
|
326
|
-
const index = parseInt(token, 10);
|
|
327
|
-
if (isNaN(index) || index < 0 || index >= current.length) {
|
|
328
|
-
throw new Error(`Invalid array index: ${token}`);
|
|
329
|
-
}
|
|
330
|
-
current = current[index];
|
|
331
|
-
}
|
|
332
|
-
else if (typeof current === 'object') {
|
|
333
|
-
if (!(token in current)) {
|
|
334
|
-
// Create intermediate object
|
|
335
|
-
current[token] = {};
|
|
336
|
-
}
|
|
337
|
-
current = current[token];
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
throw new Error(`Cannot traverse non-object: ${path}`);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
// Add value
|
|
344
|
-
if (Array.isArray(current)) {
|
|
345
|
-
const index = lastToken === '-' ? current.length : parseInt(lastToken, 10);
|
|
346
|
-
if (isNaN(index) || index < 0 || index > current.length) {
|
|
347
|
-
throw new Error(`Invalid array index for add: ${lastToken}`);
|
|
348
|
-
}
|
|
349
|
-
current.splice(index, 0, structuredClone(value));
|
|
350
|
-
}
|
|
351
|
-
else if (typeof current === 'object' && current !== null) {
|
|
352
|
-
current[lastToken] = structuredClone(value);
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
throw new Error(`Cannot add value at path: ${path}`);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Apply a JSON Patch to a document
|
|
360
|
-
* Returns result with success status and either new document or error info
|
|
361
|
-
*/
|
|
362
|
-
export function applyPatch(document, patch) {
|
|
363
|
-
// Validate first
|
|
364
|
-
const validation = validatePatch(patch);
|
|
365
|
-
if (!validation.valid) {
|
|
366
|
-
return {
|
|
367
|
-
success: false,
|
|
368
|
-
document,
|
|
369
|
-
error: validation.error,
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
let result = structuredClone(document);
|
|
373
|
-
for (let i = 0; i < patch.length; i++) {
|
|
374
|
-
try {
|
|
375
|
-
result = applyOperation(result, patch[i]);
|
|
376
|
-
}
|
|
377
|
-
catch (error) {
|
|
378
|
-
return {
|
|
379
|
-
success: false,
|
|
380
|
-
document, // Return original document (rollback)
|
|
381
|
-
error: toErrorMessage(error),
|
|
382
|
-
failedOperationIndex: i,
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
return {
|
|
387
|
-
success: true,
|
|
388
|
-
document: result,
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* Apply a JSON Patch atomically with automatic rollback on failure
|
|
393
|
-
* Returns the new document if successful, throws on error
|
|
394
|
-
*/
|
|
395
|
-
export function applyPatchAtomic(document, patch) {
|
|
396
|
-
const result = applyPatch(document, patch);
|
|
397
|
-
if (!result.success) {
|
|
398
|
-
throw new Error(result.error ?? 'Patch application failed');
|
|
399
|
-
}
|
|
400
|
-
return result.document;
|
|
401
|
-
}
|
|
402
|
-
// ============================================================================
|
|
403
|
-
// Diff Computation
|
|
404
|
-
// ============================================================================
|
|
405
|
-
/**
|
|
406
|
-
* Deep equality comparison for JSON values
|
|
407
|
-
*/
|
|
408
|
-
export function deepEqual(a, b) {
|
|
409
|
-
if (a === b)
|
|
410
|
-
return true;
|
|
411
|
-
if (a === null || b === null)
|
|
412
|
-
return a === b;
|
|
413
|
-
if (typeof a !== typeof b)
|
|
414
|
-
return false;
|
|
415
|
-
if (typeof a !== 'object')
|
|
416
|
-
return a === b;
|
|
417
|
-
if (Array.isArray(a)) {
|
|
418
|
-
if (!Array.isArray(b))
|
|
419
|
-
return false;
|
|
420
|
-
if (a.length !== b.length)
|
|
421
|
-
return false;
|
|
422
|
-
return a.every((val, i) => deepEqual(val, b[i]));
|
|
423
|
-
}
|
|
424
|
-
const aObj = a;
|
|
425
|
-
const bObj = b;
|
|
426
|
-
const aKeys = Object.keys(aObj);
|
|
427
|
-
const bKeys = Object.keys(bObj);
|
|
428
|
-
if (aKeys.length !== bKeys.length)
|
|
429
|
-
return false;
|
|
430
|
-
return aKeys.every((key) => key in bObj && deepEqual(aObj[key], bObj[key]));
|
|
431
|
-
}
|
|
432
|
-
/**
|
|
433
|
-
* Compute the JSON Patch to transform oldState into newState
|
|
434
|
-
*/
|
|
435
|
-
export function computeDiff(oldState, newState, config = {}) {
|
|
436
|
-
const { maxDepth = Infinity } = config;
|
|
437
|
-
const operations = [];
|
|
438
|
-
computeDiffRecursive(oldState, newState, '', operations, 0, maxDepth);
|
|
439
|
-
return operations;
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
|
-
* Recursive diff computation
|
|
443
|
-
*/
|
|
444
|
-
function computeDiffRecursive(oldVal, newVal, path, ops, depth, maxDepth) {
|
|
445
|
-
// If values are equal, no operation needed
|
|
446
|
-
if (deepEqual(oldVal, newVal)) {
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
// If types differ or we're at max depth, replace
|
|
450
|
-
if (typeof oldVal !== typeof newVal ||
|
|
451
|
-
oldVal === null ||
|
|
452
|
-
newVal === null ||
|
|
453
|
-
depth >= maxDepth) {
|
|
454
|
-
if (oldVal === undefined) {
|
|
455
|
-
ops.push({ op: 'add', path, value: newVal });
|
|
456
|
-
}
|
|
457
|
-
else if (newVal === undefined) {
|
|
458
|
-
ops.push({ op: 'remove', path });
|
|
459
|
-
}
|
|
460
|
-
else {
|
|
461
|
-
ops.push({ op: 'replace', path, value: newVal });
|
|
462
|
-
}
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
|
-
// Handle arrays
|
|
466
|
-
if (Array.isArray(oldVal) && Array.isArray(newVal)) {
|
|
467
|
-
computeArrayDiff(oldVal, newVal, path, ops, depth, maxDepth);
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
// Handle objects
|
|
471
|
-
if (typeof oldVal === 'object' && typeof newVal === 'object') {
|
|
472
|
-
const oldObj = oldVal;
|
|
473
|
-
const newObj = newVal;
|
|
474
|
-
// Find removed keys
|
|
475
|
-
for (const key of Object.keys(oldObj)) {
|
|
476
|
-
if (!(key in newObj)) {
|
|
477
|
-
ops.push({ op: 'remove', path: buildPath([...parsePath(path), key]) });
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
// Find added and changed keys
|
|
481
|
-
for (const key of Object.keys(newObj)) {
|
|
482
|
-
const childPath = buildPath([...parsePath(path), key]);
|
|
483
|
-
if (!(key in oldObj)) {
|
|
484
|
-
ops.push({ op: 'add', path: childPath, value: newObj[key] });
|
|
485
|
-
}
|
|
486
|
-
else {
|
|
487
|
-
computeDiffRecursive(oldObj[key], newObj[key], childPath, ops, depth + 1, maxDepth);
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
// Primitive values that differ
|
|
493
|
-
ops.push({ op: 'replace', path, value: newVal });
|
|
494
|
-
}
|
|
495
|
-
/**
|
|
496
|
-
* Compute diff for arrays
|
|
497
|
-
* Uses simple index-based comparison for efficiency
|
|
498
|
-
*/
|
|
499
|
-
function computeArrayDiff(oldArr, newArr, path, ops, depth, maxDepth) {
|
|
500
|
-
const maxLen = Math.max(oldArr.length, newArr.length);
|
|
501
|
-
// Process from end to start to preserve indices during removal
|
|
502
|
-
const removals = [];
|
|
503
|
-
const modifications = [];
|
|
504
|
-
for (let i = 0; i < maxLen; i++) {
|
|
505
|
-
const childPath = `${path}/${i}`;
|
|
506
|
-
if (i >= newArr.length) {
|
|
507
|
-
// Element removed
|
|
508
|
-
removals.push({ op: 'remove', path: childPath });
|
|
509
|
-
}
|
|
510
|
-
else if (i >= oldArr.length) {
|
|
511
|
-
// Element added
|
|
512
|
-
modifications.push({ op: 'add', path: childPath, value: newArr[i] });
|
|
513
|
-
}
|
|
514
|
-
else if (!deepEqual(oldArr[i], newArr[i])) {
|
|
515
|
-
// Element changed
|
|
516
|
-
const oldItem = oldArr[i];
|
|
517
|
-
const newItem = newArr[i];
|
|
518
|
-
// For complex objects, recurse
|
|
519
|
-
if (typeof oldItem === 'object' &&
|
|
520
|
-
typeof newItem === 'object' &&
|
|
521
|
-
oldItem !== null &&
|
|
522
|
-
newItem !== null &&
|
|
523
|
-
!Array.isArray(oldItem) === !Array.isArray(newItem) &&
|
|
524
|
-
depth < maxDepth) {
|
|
525
|
-
computeDiffRecursive(oldItem, newItem, childPath, modifications, depth + 1, maxDepth);
|
|
526
|
-
}
|
|
527
|
-
else {
|
|
528
|
-
modifications.push({ op: 'replace', path: childPath, value: newItem });
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
// Add removals in reverse order to preserve indices
|
|
533
|
-
for (let i = removals.length - 1; i >= 0; i--) {
|
|
534
|
-
ops.push(removals[i]);
|
|
535
|
-
}
|
|
536
|
-
// Add modifications and additions
|
|
537
|
-
ops.push(...modifications);
|
|
538
|
-
}
|
|
539
|
-
/**
|
|
540
|
-
* Create a test operation to validate state before applying patches
|
|
541
|
-
*/
|
|
542
|
-
export function createTestOperation(path, value) {
|
|
543
|
-
return { op: 'test', path, value };
|
|
544
|
-
}
|
|
545
|
-
/**
|
|
546
|
-
* Create an add operation
|
|
547
|
-
*/
|
|
548
|
-
export function createAddOperation(path, value) {
|
|
549
|
-
return { op: 'add', path, value };
|
|
550
|
-
}
|
|
551
|
-
/**
|
|
552
|
-
* Create a remove operation
|
|
553
|
-
*/
|
|
554
|
-
export function createRemoveOperation(path) {
|
|
555
|
-
return { op: 'remove', path };
|
|
556
|
-
}
|
|
557
|
-
/**
|
|
558
|
-
* Create a replace operation
|
|
559
|
-
*/
|
|
560
|
-
export function createReplaceOperation(path, value) {
|
|
561
|
-
return { op: 'replace', path, value };
|
|
562
|
-
}
|
|
563
|
-
/**
|
|
564
|
-
* Create a move operation
|
|
565
|
-
*/
|
|
566
|
-
export function createMoveOperation(from, path) {
|
|
567
|
-
return { op: 'move', from, path };
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Create a copy operation
|
|
571
|
-
*/
|
|
572
|
-
export function createCopyOperation(from, path) {
|
|
573
|
-
return { op: 'copy', from, path };
|
|
574
|
-
}
|
|
575
|
-
//# sourceMappingURL=json-patch-utils.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
|
|
2
|
-
import{a,b,c}from"./chunk-NL6HKEPR.js";import"./chunk-WMNVFCKY.js";import"./chunk-GJTH6VBH.js";import"./chunk-URWT3EQT.js";import"./chunk-3KTAMNKI.js";import"./chunk-D75HDHX3.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-GJ7DON5S.js";import"./chunk-HSXLHNSS.js";import"./chunk-NKWMTXBL.js";import"./chunk-Y5VPLOA7.js";import"./chunk-DHSGCI6H.js";import"./chunk-M36DAETL.js";import"./chunk-YJSKT6G6.js";import"./chunk-BKZSTZDB.js";import"./chunk-TC4B5D4Z.js";import"./chunk-JCB6K24D.js";import"./chunk-DGKPGRBT.js";import"./chunk-ZSKQPXRW.js";import"./chunk-CRYZXTSQ.js";import"./chunk-UKRK3IE3.js";import"./chunk-WBCE6V2N.js";import"./chunk-L77Z3Q6L.js";import"./chunk-3KXKJSKS.js";import"./chunk-QZNFZ5IQ.js";import"./chunk-URWT3EQT.js";import"./chunk-IM67YHDK.js";import"./chunk-2Q4Y3VQ6.js";import"./chunk-FH6N2LKG.js";import"./chunk-ZIKH7U5A.js";import"./chunk-WBZIOTY6.js";import"./chunk-ITM26I6O.js";import"./chunk-6WVEICL2.js";import"./chunk-3RC5UMRJ.js";import"./chunk-Z3PANQUT.js";import"./chunk-2AWU2E6R.js";import"./chunk-YH7VOLBP.js";import"./chunk-I7ECEOFV.js";import"./chunk-CV7E627D.js";import"./chunk-5TEPPW4J.js";import"./chunk-3KTAMNKI.js";import"./chunk-3DCRAW43.js";import"./chunk-GHXNRF63.js";import"./chunk-MYDZBABD.js";import"./chunk-JSTKSPYT.js";import"./chunk-N653RGT3.js";import"./chunk-W5EKSBS4.js";import"./chunk-PZK7O445.js";import"./chunk-D75HDHX3.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-GDSLQTJC.js";import"./chunk-XQBH3366.js";import"./chunk-6UO5YSNN.js";import"./chunk-3KXKJSKS.js";import"./chunk-QZNFZ5IQ.js";import"./chunk-URWT3EQT.js";import"./chunk-IM67YHDK.js";import"./chunk-2Q4Y3VQ6.js";import"./chunk-FH6N2LKG.js";import"./chunk-ZIKH7U5A.js";import"./chunk-WBZIOTY6.js";import"./chunk-ITM26I6O.js";import"./chunk-3RC5UMRJ.js";import"./chunk-Z3PANQUT.js";import"./chunk-YH7VOLBP.js";import"./chunk-I7ECEOFV.js";import"./chunk-CV7E627D.js";import"./chunk-5TEPPW4J.js";import"./chunk-3KTAMNKI.js";import"./chunk-3DCRAW43.js";import"./chunk-MYDZBABD.js";import"./chunk-W5EKSBS4.js";import"./chunk-PZK7O445.js";import"./chunk-D75HDHX3.js";export{l as MCPToolBase,k as defaultToolLogger,j as getKernel,i as getLLMRouter,e as getMemoryBackend,g as getSharedLLMRouter,c as getSharedMemoryBackend,a as isMemoryOnlyMode,b as registerRvfResetFn,h as resetSharedLLMRouter,d as resetSharedMemoryBackend,f as setSharedLLMRouter};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
|
|
2
|
-
import{a}from"./chunk-QGCFMACF.js";import"./chunk-GDSLQTJC.js";import"./chunk-XQBH3366.js";import"./chunk-6UO5YSNN.js";import"./chunk-3KXKJSKS.js";import"./chunk-QZNFZ5IQ.js";import"./chunk-URWT3EQT.js";import"./chunk-IM67YHDK.js";import"./chunk-2Q4Y3VQ6.js";import"./chunk-FH6N2LKG.js";import"./chunk-ZIKH7U5A.js";import"./chunk-WBZIOTY6.js";import"./chunk-ITM26I6O.js";import"./chunk-3RC5UMRJ.js";import"./chunk-Z3PANQUT.js";import"./chunk-YH7VOLBP.js";import"./chunk-I7ECEOFV.js";import"./chunk-CV7E627D.js";import"./chunk-5TEPPW4J.js";import"./chunk-3KTAMNKI.js";import"./chunk-3DCRAW43.js";import"./chunk-MYDZBABD.js";import"./chunk-W5EKSBS4.js";import"./chunk-PZK7O445.js";import"./chunk-D75HDHX3.js";export{a as BrowserWorkflowTool};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
|
|
2
|
-
import{g as m,n as b}from"./chunk-CFDIYZGA.js";import{b as h}from"./chunk-D75HDHX3.js";import{randomUUID as C}from"crypto";function v(d){let t=k[d];if(t)return{input:t.input,output:t.output};let e=m(d);if(e.inputCostPerMillion>0||e.outputCostPerMillion>0)return{input:e.inputCostPerMillion,output:e.outputCostPerMillion}}function P(){return s||(s=new l),s}function y(){s&&(s.dispose(),s=void 0)}var k,l,s,f=h(()=>{b();k={"claude-sonnet-5":{input:2,output:10,provider:"claude"},"claude-opus-5":{input:5,output:25,provider:"claude"},"claude-opus-5-5":{input:4,output:20,provider:"claude"},"claude-fable-5-1":{input:10,output:50,provider:"claude"},"claude-fable-5":{input:10,output:50,provider:"claude"},"claude-opus-4-8":{input:5,output:25,provider:"claude"},"claude-opus-4-7":{input:5,output:25,provider:"claude"},"claude-sonnet-4-6":{input:3,output:15,provider:"claude"},"claude-haiku-4-5-20251001":{input:1,output:5,provider:"claude"},"claude-haiku-4-5":{input:1,output:5,provider:"claude"},"claude-opus-4-5-20251101":{input:5,output:25,provider:"claude"},"claude-opus-4-6":{input:5,output:25,provider:"claude"},"claude-sonnet-4-20250514":{input:3,output:15,provider:"claude"},"claude-3-5-haiku-20241022":{input:1,output:5,provider:"claude"},"claude-3-opus-20240229":{input:15,output:75,provider:"claude"},"claude-3-sonnet-20240229":{input:3,output:15,provider:"claude"},"claude-3-haiku-20240307":{input:.25,output:1.25,provider:"claude"},"gpt-6-astra":{input:10,output:50,provider:"openai"},"gpt-6-sol":{input:2,output:10,provider:"openai"},"gpt-6-luna":{input:.1,output:.5,provider:"openai"},"gpt-4o":{input:5,output:15,provider:"openai"},"gpt-4o-mini":{input:.15,output:.6,provider:"openai"},"gpt-4-turbo":{input:10,output:30,provider:"openai"},"gpt-4":{input:30,output:60,provider:"openai"},"gpt-3.5-turbo":{input:.5,output:1.5,provider:"openai"},llama3:{input:0,output:0,provider:"ollama"},"llama3.1":{input:0,output:0,provider:"ollama"},codellama:{input:0,output:0,provider:"ollama"},mistral:{input:0,output:0,provider:"ollama"},mixtral:{input:0,output:0,provider:"ollama"},phi3:{input:0,output:0,provider:"ollama"},qwen2:{input:0,output:0,provider:"ollama"},"anthropic/claude-sonnet-5":{input:2,output:10,provider:"openrouter"},"anthropic/claude-opus-5":{input:5,output:25,provider:"openrouter"},"anthropic/claude-opus-5.5":{input:4,output:20,provider:"openrouter"},"anthropic/claude-haiku-4.5":{input:1,output:5,provider:"openrouter"},"openai/gpt-6-sol":{input:2,output:10,provider:"openrouter"},"openai/gpt-6-luna":{input:.1,output:.5,provider:"openrouter"},"google/gemini-3.8-flash":{input:.75,output:3.75,provider:"openrouter"},"meta-llama/llama-4-maverick":{input:.1875,output:.6525,provider:"openrouter"},"openai/gpt-oss-120b":{input:.15,output:.6,provider:"openrouter"},"qwen/qwen3-coder":{input:.3,output:1,provider:"openrouter"},"anthropic/claude-3.5-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3.5-sonnet:beta":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-opus":{input:15,output:75,provider:"openrouter"},"anthropic/claude-3-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-haiku":{input:.25,output:1.25,provider:"openrouter"},"openai/gpt-4o":{input:5,output:15,provider:"openrouter"},"openai/gpt-4o-mini":{input:.15,output:.6,provider:"openrouter"},"openai/gpt-4-turbo":{input:10,output:30,provider:"openrouter"},"openai/gpt-3.5-turbo":{input:.5,output:1.5,provider:"openrouter"},"google/gemini-pro":{input:.125,output:.375,provider:"openrouter"},"google/gemini-pro-1.5":{input:3.5,output:10.5,provider:"openrouter"},"meta-llama/llama-3.1-70b-instruct":{input:.59,output:.79,provider:"openrouter"},"meta-llama/llama-3.1-8b-instruct":{input:.06,output:.06,provider:"openrouter"},"mistralai/mistral-large":{input:2,output:6,provider:"openrouter"},"mistralai/mixtral-8x7b-instruct":{input:.24,output:.24,provider:"openrouter"},"mistralai/mistral-7b-instruct":{input:.06,output:.06,provider:"openrouter"},"anthropic.claude-opus-4-5-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-opus-4-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-sonnet-4-5-v2:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-sonnet-4-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-5-haiku-v1:0":{input:1,output:5,provider:"bedrock"},"anthropic.claude-3-opus-20240229-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-3-sonnet-20240229-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-haiku-20240307-v1:0":{input:.25,output:1.25,provider:"bedrock"},"anthropic.claude-3-5-sonnet-20241022-v2:0":{input:3,output:15,provider:"bedrock"},"azure/gpt-4o":{input:5,output:15,provider:"azure-openai"},"azure/gpt-4o-mini":{input:.15,output:.6,provider:"azure-openai"},"azure/gpt-4-turbo":{input:10,output:30,provider:"azure-openai"},"azure/gpt-4":{input:30,output:60,provider:"azure-openai"},"azure/gpt-35-turbo":{input:.5,output:1.5,provider:"azure-openai"},"azure/text-embedding-ada-002":{input:.1,output:0,provider:"azure-openai"},"azure/text-embedding-3-small":{input:.02,output:0,provider:"azure-openai"},"azure/text-embedding-3-large":{input:.13,output:0,provider:"azure-openai"},"gemini-3.8-flash":{input:.75,output:3.75,provider:"gemini"},"gemini-3.5-flash":{input:1.5,output:9,provider:"gemini"},"gemini-3.1-pro-preview":{input:2,output:12,provider:"gemini"},"gemini-2.5-flash":{input:.3,output:2.5,provider:"gemini"},"gemini-2.5-pro":{input:1.25,output:10,provider:"gemini"},"gemini-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.0-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.5-pro":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-pro-latest":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-flash":{input:.075,output:.3,provider:"gemini"},"gemini-1.5-flash-latest":{input:.075,output:.3,provider:"gemini"},"gemini-2.0-flash-exp":{input:.075,output:.3,provider:"gemini"},"gemini-ultra":{input:7,output:21,provider:"gemini"},"gemini-1.0-ultra":{input:7,output:21,provider:"gemini"},"text-embedding-004":{input:.025,output:0,provider:"gemini"}};l=class d{records=[];alerts=[];maxRecords;alertCheckInterval;constructor(t=1e4){this.maxRecords=t}static calculateCost(t,e){let o=v(t);if(!o)return{inputCost:0,outputCost:0,totalCost:0,currency:"USD"};let i=e.promptTokens/1e6*o.input+(e.cacheReadTokens??0)/1e6*o.input*.1+(e.cacheCreationTokens??0)/1e6*o.input*1.25,r=e.completionTokens/1e6*o.output;return{inputCost:i,outputCost:r,totalCost:i+r,currency:"USD"}}static getCostPerToken(t){let e=v(t);return e?{input:e.input/1e6,output:e.output/1e6}:{input:0,output:0}}recordUsage(t,e,o,i,r){let p=d.calculateCost(e,o),a={timestamp:new Date,provider:t,model:e,usage:o,cost:p,requestId:i,metadata:r};return this.records.push(a),this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords)),this.checkAlerts(),p}getSummary(t){let e=new Date,o=this.getPeriodStart(e,t),i=e,r=this.records.filter(n=>n.timestamp>=o&&n.timestamp<=i),p={claude:0,"claude-code":0,codex:0,openai:0,ollama:0,openrouter:0,bedrock:0,"azure-openai":0,gemini:0,cognitum:0},a={},u=0,c=0;for(let n of r){u+=n.cost.totalCost,c+=n.usage.totalTokens;let g=Object.hasOwn(p,n.provider)?p[n.provider]:0;p[n.provider]=g+n.cost.totalCost,a[n.model]=(a[n.model]||0)+n.cost.totalCost}return{period:t,periodStart:o,periodEnd:i,totalCost:u,byProvider:p,byModel:a,totalTokens:c,totalRequests:r.length}}getCurrentCost(t){return this.getSummary(t).totalCost}getTotalTokens(t){return this.getSummary(t).totalTokens}getUsageByProvider(t,e="all"){let o=this.getPeriodStart(new Date,e),i=this.records.filter(u=>u.provider===t&&u.timestamp>=o),r={},p=0,a=0;for(let u of i)p+=u.cost.totalCost,a+=u.usage.totalTokens,r[u.model]||(r[u.model]={cost:0,tokens:0,requests:0}),r[u.model].cost+=u.cost.totalCost,r[u.model].tokens+=u.usage.totalTokens,r[u.model].requests+=1;return{totalCost:p,totalTokens:a,totalRequests:i.length,models:r}}addAlert(t,e,o){let i=`alert-${Date.now()}-${C().slice(0,12)}`;return this.alerts.push({threshold:t,period:e,onThreshold:o,active:!0}),this.alertCheckInterval||(this.alertCheckInterval=setInterval(()=>this.checkAlerts(),6e4)),i}removeAlert(t){return t>=0&&t<this.alerts.length?(this.alerts.splice(t,1),this.alerts.length===0&&this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0),!0):!1}getRecords(){return[...this.records]}importRecords(t){for(let e of t)e.timestamp=new Date(e.timestamp),this.records.push(e);this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords))}clear(){this.records=[]}getRecentRequests(t=10){return this.records.slice(-t)}estimateCost(t,e,o){return d.calculateCost(t,{promptTokens:e,completionTokens:o,totalTokens:e+o})}wouldExceedLimit(t,e,o,i,r){let p=this.getCurrentCost(r),a=this.estimateCost(t,e,o);return p+a.totalCost>i}dispose(){this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}getPeriodStart(t,e){let o=new Date(t);switch(e){case"minute":o.setSeconds(0,0),o.setMinutes(o.getMinutes()-1);break;case"hour":o.setMinutes(0,0,0),o.setHours(o.getHours()-1);break;case"day":o.setHours(0,0,0,0);break;case"week":o.setHours(0,0,0,0),o.setDate(o.getDate()-7);break;case"month":o.setHours(0,0,0,0),o.setDate(1);break;case"all":return new Date(0)}return o}checkAlerts(){for(let t of this.alerts){if(!t.active)continue;let e=this.getSummary(t.period);if(e.totalCost>=t.threshold){t.active=!1;try{t.onThreshold(e)}catch(o){console.error("Cost alert callback error:",o)}}}}}});export{k as a,v as b,l as c,P as d,y as e,f};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
|
|
2
|
-
import{a as e,c as r,d as g,g as t}from"./chunk-CV7E627D.js";import{b as o}from"./chunk-D75HDHX3.js";var L=o(()=>{"use strict";e();g();t();r()});export{L as a};
|