agentic-qe 3.14.4 → 3.14.6
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 +169 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/adapters/ag-ui/event-types.d.ts +1 -1
- package/dist/audit/witness-chain-hash.d.ts +18 -0
- package/dist/audit/witness-chain-hash.js +37 -0
- package/dist/audit/witness-chain-repair.d.ts +71 -0
- package/dist/audit/witness-chain-repair.js +203 -0
- package/dist/audit/witness-chain-verifier.d.ts +152 -0
- package/dist/audit/witness-chain-verifier.js +293 -0
- package/dist/audit/witness-chain.d.ts +10 -43
- package/dist/audit/witness-chain.js +43 -126
- package/dist/audit/witness-findings.js +4 -1
- package/dist/cli/bundle.js +13 -10
- package/dist/cli/chunks/adapter-UYOJPTOX.js +2 -0
- package/dist/cli/chunks/agent-booster-wasm-2YGML6OU.js +2 -0
- package/dist/cli/chunks/{agent-handler-RDNTK4CA.js → agent-handler-D5SSQYNU.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-NAAMBWIR.js → agent-memory-branch-YHPLTITV.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-JR5AVQXR.js +2 -0
- package/dist/cli/chunks/{arena-KXFHRWX4.js → arena-7BGOXGXO.js} +2 -2
- package/dist/cli/chunks/{arena-HXTWJ5YY.js → arena-MCE6EU7K.js} +4 -4
- package/dist/cli/chunks/audit-BMWTQECB.js +4 -0
- package/dist/cli/chunks/base-DRZ2LS6X.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-UICJZIDG.js → better-sqlite3-PMUNGASU.js} +2 -2
- package/dist/cli/chunks/brain-handler-QPUFYX7F.js +94 -0
- package/dist/cli/chunks/{branch-enumerator-SS7UNVIA.js → branch-enumerator-WKFDGRN4.js} +2 -2
- package/dist/cli/chunks/{browser-77GI6KBE.js → browser-VY5HKH5X.js} +2 -2
- package/dist/cli/chunks/browser-workflow-CJ7T3MXF.js +2 -0
- package/dist/cli/chunks/{chunk-PZJOPURC.js → chunk-257E2A5M.js} +5 -5
- package/dist/cli/chunks/{chunk-55RWDRJD.js → chunk-2JVWITNK.js} +4 -4
- package/dist/cli/chunks/{chunk-BOARZKU3.js → chunk-2NPKIBAZ.js} +2 -2
- package/dist/cli/chunks/chunk-2TMWAQQ3.js +13 -0
- package/dist/cli/chunks/{chunk-M4WJKGVK.js → chunk-2YXGBZWV.js} +1 -1
- package/dist/cli/chunks/{chunk-3VOQRIQM.js → chunk-3EA536JF.js} +2 -2
- package/dist/cli/chunks/{chunk-ZZDIMOOV.js → chunk-3EZOZN25.js} +2 -2
- package/dist/cli/chunks/{chunk-MNW6QGNJ.js → chunk-3HZS4M3O.js} +2 -2
- package/dist/cli/chunks/{chunk-EKQ673SA.js → chunk-3NIG7S5W.js} +1 -1
- package/dist/cli/chunks/{chunk-7D777LTF.js → chunk-4N23RFDU.js} +2 -2
- package/dist/cli/chunks/{chunk-BOZZYWCR.js → chunk-5J6W7SIA.js} +1 -1
- package/dist/cli/chunks/{chunk-HIVA55CJ.js → chunk-5OOMJGFN.js} +1 -1
- package/dist/cli/chunks/{chunk-W7BWUTVV.js → chunk-5QQSIGUA.js} +2 -2
- package/dist/cli/chunks/{chunk-PAWXJ73E.js → chunk-5VFPCSK7.js} +1 -1
- package/dist/cli/chunks/{chunk-KPA7MZ6C.js → chunk-62N4NUJH.js} +2 -2
- package/dist/cli/chunks/chunk-64VGZQLB.js +2 -0
- package/dist/cli/chunks/{chunk-64PFWE2F.js → chunk-66VWCR67.js} +2 -2
- package/dist/cli/chunks/{chunk-XRT2WRMS.js → chunk-6LIHFV7O.js} +2 -2
- package/dist/cli/chunks/{chunk-STJCATGN.js → chunk-6OS76PHI.js} +2 -2
- package/dist/cli/chunks/{chunk-ZNPKDCZR.js → chunk-6RE3X4V5.js} +2 -2
- package/dist/cli/chunks/{chunk-BFP7KO7P.js → chunk-6SH5VZUD.js} +2 -2
- package/dist/cli/chunks/chunk-6SQM2MUX.js +4 -0
- package/dist/cli/chunks/{chunk-IPR4QP3H.js → chunk-6U7LNMWZ.js} +2 -2
- package/dist/cli/chunks/{chunk-MIQTXNBG.js → chunk-72KXSMWI.js} +1 -1
- package/dist/cli/chunks/chunk-7CUQCCMD.js +27 -0
- package/dist/cli/chunks/chunk-7D3V65N5.js +2 -0
- package/dist/cli/chunks/{chunk-JZ3ORVZ3.js → chunk-7J6QC567.js} +3 -3
- package/dist/cli/chunks/{chunk-4OYFXLBK.js → chunk-7LPR6HJG.js} +2 -2
- package/dist/cli/chunks/{chunk-4MHXCAG2.js → chunk-7NITCZWD.js} +1 -1
- package/dist/cli/chunks/{chunk-M5QUBZY6.js → chunk-7Z5LHRC3.js} +2 -2
- package/dist/cli/chunks/{chunk-CSU5NYOX.js → chunk-AHKELLIO.js} +4 -4
- package/dist/cli/chunks/{chunk-DHJPWQBR.js → chunk-AIRGNL55.js} +2 -2
- package/dist/cli/chunks/{chunk-C2WU3533.js → chunk-AJRUJAAK.js} +1 -1
- package/dist/cli/chunks/{chunk-HIYXCDEP.js → chunk-AVBJYI5I.js} +1 -1
- package/dist/cli/chunks/{chunk-U5K45TFH.js → chunk-B6D2CHEH.js} +1 -1
- package/dist/cli/chunks/{chunk-FRH6VAUS.js → chunk-B6MOJC3X.js} +1 -1
- package/dist/cli/chunks/{chunk-HUWNIPZ5.js → chunk-BAMN2CHI.js} +1 -1
- package/dist/cli/chunks/{chunk-ONII3572.js → chunk-BBT64TII.js} +3 -3
- package/dist/cli/chunks/{chunk-KSKEF7LZ.js → chunk-BJTJLJRZ.js} +3 -3
- package/dist/cli/chunks/chunk-BMAPORJ7.js +15 -0
- package/dist/cli/chunks/{chunk-CIZ5JPDC.js → chunk-BPEDWS6O.js} +3 -3
- package/dist/cli/chunks/{chunk-Z3RHREWF.js → chunk-BVR7RMC5.js} +1 -1
- package/dist/cli/chunks/{chunk-HDSAM2RE.js → chunk-C6KWXUFJ.js} +2 -2
- package/dist/cli/chunks/{chunk-ZBAKA4YB.js → chunk-CCK4BF76.js} +1 -1
- package/dist/cli/chunks/{chunk-IFCLB7FJ.js → chunk-CD542DNJ.js} +1 -1
- package/dist/cli/chunks/{chunk-6KJABXAR.js → chunk-CF2ISEOJ.js} +2 -2
- package/dist/cli/chunks/chunk-CM7U6TAX.js +5 -0
- package/dist/cli/chunks/{chunk-3X3DJZJJ.js → chunk-D45SG6CP.js} +1 -1
- package/dist/cli/chunks/{chunk-DAEFDCJ4.js → chunk-D6CJIGRU.js} +89 -83
- package/dist/cli/chunks/{chunk-MVPCNSPY.js → chunk-DBDPRORT.js} +2 -2
- package/dist/cli/chunks/{chunk-AUXFKCQL.js → chunk-DHVX5UB2.js} +2 -2
- package/dist/cli/chunks/{chunk-GPLQ6DOK.js → chunk-DK4XN4CU.js} +2 -2
- package/dist/cli/chunks/{chunk-SRKETSFF.js → chunk-DPYSUDAO.js} +1 -1
- package/dist/cli/chunks/{chunk-CNG6GQEZ.js → chunk-DUYOVM5I.js} +2 -2
- package/dist/cli/chunks/{chunk-VIHTL3U2.js → chunk-DZ3AUAAB.js} +2 -2
- package/dist/cli/chunks/{chunk-CU46J64M.js → chunk-E6G2RD5H.js} +2 -2
- package/dist/cli/chunks/{chunk-5YPYDPBJ.js → chunk-EAY2JMZG.js} +2 -2
- package/dist/cli/chunks/{chunk-V3QLFNA2.js → chunk-ELLBS5RP.js} +4 -4
- package/dist/cli/chunks/chunk-ENGZ4D5V.js +2 -0
- package/dist/cli/chunks/chunk-FBMN7B46.js +4 -0
- package/dist/cli/chunks/{chunk-EDJ3O7RH.js → chunk-FWASDOT2.js} +2 -2
- package/dist/cli/chunks/{chunk-MDWCE7YW.js → chunk-FZOBD67M.js} +1 -1
- package/dist/cli/chunks/{chunk-A4FYONNU.js → chunk-GDSXITFH.js} +2 -2
- package/dist/cli/chunks/{chunk-2JW3BCGG.js → chunk-GGRHV6D7.js} +1 -1
- package/dist/cli/chunks/{chunk-ISDMD6EU.js → chunk-GPYVDFB3.js} +90 -90
- package/dist/cli/chunks/{chunk-CDKG6EI7.js → chunk-GSF6MB64.js} +2 -2
- package/dist/cli/chunks/{chunk-WLG5AJ4N.js → chunk-H52HZ67P.js} +2 -2
- package/dist/cli/chunks/{chunk-FGYMFUE2.js → chunk-H5BS5VH7.js} +2 -2
- package/dist/cli/chunks/{chunk-34WO57CW.js → chunk-H6ZM3PUT.js} +1 -1
- package/dist/cli/chunks/{chunk-6CQN24ZK.js → chunk-HM6ZSCPI.js} +1 -1
- package/dist/cli/chunks/{chunk-DPFRKBOG.js → chunk-HNFVJP4I.js} +2 -2
- package/dist/cli/chunks/{chunk-TPGED2IF.js → chunk-I33ERSGB.js} +2 -2
- package/dist/cli/chunks/{chunk-UEM7ZF5K.js → chunk-IAF6T27S.js} +2 -2
- package/dist/cli/chunks/{chunk-KCZR45PA.js → chunk-IB27QACC.js} +2 -2
- package/dist/cli/chunks/{chunk-SGYJ4NFZ.js → chunk-ICTXTNQZ.js} +1 -1
- package/dist/cli/chunks/chunk-IG5GNEC6.js +4 -0
- package/dist/cli/chunks/{chunk-KHFNNVJA.js → chunk-IQO7UCFR.js} +2 -2
- package/dist/cli/chunks/{chunk-3TW5W5LX.js → chunk-IV5UZOHH.js} +2 -2
- package/dist/cli/chunks/{chunk-7ZIOFPL3.js → chunk-JBTPOIAC.js} +2 -2
- package/dist/cli/chunks/{chunk-ZNEMGX5O.js → chunk-JIXUMYKZ.js} +1 -1
- package/dist/cli/chunks/{chunk-MTZH7AHC.js → chunk-JMONHE4B.js} +1 -1
- package/dist/cli/chunks/{chunk-TDZ53WO2.js → chunk-JVNTSNWU.js} +2 -2
- package/dist/cli/chunks/{chunk-PFR4G3DJ.js → chunk-JXGFRBUO.js} +2 -2
- package/dist/cli/chunks/chunk-JZOS5FCX.js +2 -0
- package/dist/cli/chunks/{chunk-STM3UDNO.js → chunk-KNNISEDY.js} +2 -2
- package/dist/cli/chunks/{chunk-TWAWHOP7.js → chunk-L4RUBPLR.js} +2 -2
- package/dist/cli/chunks/chunk-LL3IGZBI.js +2 -0
- package/dist/cli/chunks/{chunk-CIKSHTEQ.js → chunk-MBRHSU6W.js} +10 -10
- package/dist/cli/chunks/{chunk-G6T45OIC.js → chunk-MJS53PRX.js} +2 -2
- package/dist/cli/chunks/{chunk-PO3IXGMQ.js → chunk-MQROI74N.js} +2 -2
- package/dist/cli/chunks/{chunk-DOTK76IJ.js → chunk-MUOG6QXR.js} +2 -2
- package/dist/cli/chunks/{chunk-MVNP7GIR.js → chunk-MW2GGZZ5.js} +1 -1
- package/dist/cli/chunks/{chunk-FWGOHAAB.js → chunk-NHWGMJAP.js} +2 -2
- package/dist/cli/chunks/{chunk-ZBJ4XOOV.js → chunk-NMAIY4PX.js} +4 -4
- package/dist/cli/chunks/{chunk-CDHQFHRP.js → chunk-NQZ5AR3D.js} +2 -2
- package/dist/cli/chunks/{chunk-FLYOJOKN.js → chunk-P6OYS755.js} +1 -1
- package/dist/cli/chunks/{chunk-BGE6FOLM.js → chunk-PI7TJS62.js} +2 -2
- package/dist/cli/chunks/chunk-PX5YDCRH.js +4 -0
- package/dist/cli/chunks/{chunk-Q5DO24IJ.js → chunk-PZPWRQ2M.js} +3 -3
- package/dist/cli/chunks/{chunk-R4VL6E65.js → chunk-Q5XTSMWR.js} +2 -2
- package/dist/cli/chunks/{chunk-JBNEE5UH.js → chunk-Q7EAGKAE.js} +2 -2
- package/dist/cli/chunks/{chunk-R5NE6B2M.js → chunk-QDFTT3RF.js} +2 -2
- package/dist/cli/chunks/{chunk-DFZCKIGY.js → chunk-QGA55PFM.js} +3 -3
- package/dist/cli/chunks/{chunk-RJCYCLZV.js → chunk-QW6VMTBR.js} +2 -2
- package/dist/cli/chunks/{chunk-6VRA2QGL.js → chunk-QZANMBIT.js} +1 -1
- package/dist/cli/chunks/{chunk-MEGDYJPV.js → chunk-RETBYIAC.js} +4 -4
- package/dist/cli/chunks/{chunk-XJ7QNVI5.js → chunk-RFNPJK6N.js} +3 -3
- package/dist/cli/chunks/{chunk-NJBGXDQ7.js → chunk-RG52OKAM.js} +1 -1
- package/dist/cli/chunks/{chunk-DA5K5754.js → chunk-RSXXCL4A.js} +1 -1
- package/dist/cli/chunks/{chunk-HV2J7KKQ.js → chunk-RTFO5UQH.js} +2 -2
- package/dist/cli/chunks/{chunk-6UWGMOND.js → chunk-RZZCUIAI.js} +2 -2
- package/dist/cli/chunks/chunk-SDRHUMJB.js +2 -0
- package/dist/cli/chunks/{chunk-TSRSV3LD.js → chunk-SE4WIB26.js} +1 -1
- package/dist/cli/chunks/{chunk-ODKLFVYC.js → chunk-SESK3ARK.js} +2 -2
- package/dist/cli/chunks/{chunk-AWWNB2T7.js → chunk-SJUXE4IC.js} +2 -2
- package/dist/cli/chunks/{chunk-QGIU2WRL.js → chunk-SMDN3BQZ.js} +1 -1
- package/dist/cli/chunks/{chunk-VD6QRULW.js → chunk-SNOBH4AZ.js} +2 -2
- package/dist/cli/chunks/{chunk-OSLYSG3B.js → chunk-SPV2VKC5.js} +2 -2
- package/dist/cli/chunks/chunk-TCHGOB2N.js +2 -0
- package/dist/cli/chunks/{chunk-MOBNBMFW.js → chunk-TVYY3OCX.js} +1 -1
- package/dist/cli/chunks/{chunk-UGVHCMUN.js → chunk-UCFQALXO.js} +3 -3
- package/dist/cli/chunks/{chunk-3QHGWY7T.js → chunk-UKA2KOXE.js} +2 -2
- package/dist/cli/chunks/{chunk-MCUJEZT6.js → chunk-UNFFDHER.js} +16 -11
- package/dist/cli/chunks/{chunk-6QYNWR7U.js → chunk-UQ32JHES.js} +2 -2
- package/dist/cli/chunks/{chunk-OULHKEVH.js → chunk-V4DM6ELU.js} +2 -2
- package/dist/cli/chunks/{chunk-M2JBBZQB.js → chunk-VGFFFKGK.js} +2 -2
- package/dist/cli/chunks/{chunk-OCWWP5PL.js → chunk-VMNWDJIZ.js} +2 -2
- package/dist/cli/chunks/chunk-W6HXLH5G.js +180 -0
- package/dist/cli/chunks/{chunk-AIHDEEJO.js → chunk-WCJBU2KI.js} +2 -2
- package/dist/cli/chunks/{chunk-ZBQY5GLF.js → chunk-WGM35YWL.js} +2 -2
- package/dist/cli/chunks/chunk-WO4QMXIG.js +3 -0
- package/dist/cli/chunks/{chunk-3UPAMMCB.js → chunk-XAS3XRYM.js} +1 -1
- package/dist/cli/chunks/chunk-Y3LZ35OG.js +2 -0
- package/dist/cli/chunks/{chunk-5R3QL7WN.js → chunk-Y3UOUNHM.js} +2 -2
- package/dist/cli/chunks/{chunk-ZJ26AQA5.js → chunk-YFBSPLJG.js} +1 -1
- package/dist/cli/chunks/{chunk-BDESSCVR.js → chunk-YHKEDEAA.js} +3 -3
- package/dist/cli/chunks/{chunk-CXQPR5MY.js → chunk-YS4FCTWF.js} +1 -1
- package/dist/cli/chunks/{chunk-CLTMDCSE.js → chunk-YSLL6VSL.js} +2 -2
- package/dist/cli/chunks/chunk-Z6GGIRQQ.js +65 -0
- package/dist/cli/chunks/{chunk-F3SBRQC6.js → chunk-Z7WODOTH.js} +2 -2
- package/dist/cli/chunks/chunk-ZCRTRYXK.js +14 -0
- package/dist/cli/chunks/{chunk-XRYF6JV7.js → chunk-ZEV3YTO7.js} +2 -2
- package/dist/cli/chunks/{chunk-YNXS6CGV.js → chunk-ZL6SYKUK.js} +1 -1
- package/dist/cli/chunks/{chunk-5SJHQ2CO.js → chunk-ZSPU4MOS.js} +2 -2
- package/dist/cli/chunks/{chunk-UDHKLT4C.js → chunk-ZVWVV4EX.js} +1 -1
- package/dist/cli/chunks/{ci-464KPQNP.js → ci-W6K6G2KZ.js} +2 -2
- package/dist/cli/chunks/{ci-output-I7FX2RSO.js → ci-output-LDT24TS3.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-3FW237WW.js → circuit-breaker-F5V4KITU.js} +2 -2
- package/dist/cli/chunks/claude-flow-setup-DT6WQQVD.js +2 -0
- package/dist/cli/chunks/client-KHWJT6FB.js +2 -0
- package/dist/cli/chunks/{cline-installer-UWFHT6VY.js → cline-installer-G7TJOAEX.js} +2 -2
- package/dist/cli/chunks/{code-KQSUT3FS.js → code-PGE6A42V.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-PABBNUSC.js → code-index-extractor-RNITH372.js} +2 -2
- package/dist/cli/chunks/codex-installer-LBX77AI3.js +14 -0
- package/dist/cli/chunks/{completions-7RWHAUAR.js → completions-4AWLAARX.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-XPOAF33E.js → complexity-analyzer-ZPNSS476.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-V4F2FIZP.js → continuedev-installer-UAPWX6OA.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-JMICURQB.js → copilot-installer-BJN2YJGI.js} +2 -2
- package/dist/cli/chunks/core-handlers-HING5RRG.js +2 -0
- package/dist/cli/chunks/{cost-tracker-5OFHEYFJ.js → cost-tracker-MHP2VJ63.js} +2 -2
- package/dist/cli/chunks/{coverage-QKN57JDS.js → coverage-PQB4IEFG.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-PQTD6AZN.js +2 -0
- package/dist/cli/chunks/{cursor-installer-GBJ7YXSM.js → cursor-installer-ZXBWYAS3.js} +2 -2
- package/dist/cli/chunks/{daemon-GKP7CMEK.js → daemon-64C7R6OJ.js} +3 -3
- package/dist/cli/chunks/{daemon-IAVSO6HK.js → daemon-N2BEGEFY.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-S225TCI7.js → dag-attention-scheduler-SPZDAPNL.js} +2 -2
- package/dist/cli/chunks/{detect-IUYH422U.js → detect-LXJBSSZW.js} +2 -2
- package/dist/cli/chunks/{dist-node-2YRE6A7C.js → dist-node-U3TKZ2IZ.js} +2 -2
- package/dist/cli/chunks/{domain-handler-PL2TZC6H.js → domain-handler-3DDWUVSR.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-HCGLXKIT.js → domain-plugins-JJVWI4OQ.js} +2 -2
- package/dist/cli/chunks/domain-transfer-M36KUJ2U.js +2 -0
- package/dist/cli/chunks/dream-WUGRSNCV.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-JPAR7TXX.js +3 -0
- package/dist/cli/chunks/{eval-WCK7KNFN.js → eval-SOLG23EA.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-2MSQWSAR.js → experience-capture-middleware-T7G2VOOD.js} +4 -4
- package/dist/cli/chunks/{fast-paths-VYOSIBKF.js → fast-paths-32N3ELI4.js} +2 -2
- package/dist/cli/chunks/{feature-flags-WCFUKHNQ.js → feature-flags-APJDQ4N7.js} +2 -2
- package/dist/cli/chunks/{feature-flags-UJRHFBRX.js → feature-flags-NAHKLDRN.js} +2 -2
- package/dist/cli/chunks/{file-discovery-JDGL4ZWS.js → file-discovery-YKVM3MDB.js} +2 -2
- package/dist/cli/chunks/{fleet-ROXVMZ2F.js → fleet-55M5CJS4.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-NIO4ZCO3.js → gnn-wrapper-UD6E6S6Z.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-PI42WD3C.js → heartbeat-handler-OYVW3VSC.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-33XX5XNQ.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-XQPERX3H.js +2 -0
- package/dist/cli/chunks/hnsw-index-2GNXTWHH.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-YLC7SPK2.js → hnsw-legacy-bridge-HBYIS3ZW.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-LG6OS3B7.js → hnswlib-node-EQPM42OU.js} +2 -2
- package/dist/cli/chunks/{hooks-WVALP5GX.js → hooks-5ZSSJWO6.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-CCF7URKI.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-GJEMW3EG.js → hypergraph-engine-XBGVQ4PD.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-BLF6LXEV.js → hypergraph-handler-CAWAQ673.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-HGKAZWIG.js +2 -0
- package/dist/cli/chunks/{init-handler-K25RWRYY.js → init-handler-PRHXSARK.js} +6 -6
- package/dist/cli/chunks/init-wizard-72MFBI3G.js +2 -0
- package/dist/cli/chunks/kernel-BRCBVMSK.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-BXN6WZ7G.js → kilocode-installer-F7LXBM7I.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-PM362DLN.js → kiro-installer-NM723ZRG.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-DG44IPEI.js +2 -0
- package/dist/cli/chunks/{learning-CPERDDRG.js → learning-5QYIDHH3.js} +3 -3
- package/dist/cli/chunks/{llm-router-GOAV5FPI.js → llm-router-43HKWPSX.js} +4 -4
- package/dist/cli/chunks/llm-router-service-24KXFX32.js +2 -0
- package/dist/cli/chunks/{load-2BG6SHAK.js → load-5YDBWSCS.js} +2 -2
- package/dist/cli/chunks/load-test-N4TAYJY3.js +2 -0
- package/dist/cli/chunks/mcp-UMAPMNMY.js +2 -0
- package/dist/cli/chunks/{memory-4NHBYT6S.js → memory-FWCPCQFP.js} +6 -6
- package/dist/cli/chunks/memory-backend-NVYFYVAU.js +2 -0
- package/dist/cli/chunks/memory-handlers-UTWCNCHL.js +2 -0
- package/dist/cli/chunks/multi-model-executor-2XTBGLE4.js +14 -0
- package/dist/cli/chunks/{opencode-installer-ATZLLK74.js → opencode-installer-GIXOJ6NS.js} +2 -2
- package/dist/cli/chunks/orchestrator-VW6BKHLI.js +393 -0
- package/dist/cli/chunks/pattern-null-store-SBPNYDBR.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-7VE4XDAI.js → pattern-usage-recorder-7CEUC3J7.js} +2 -2
- package/dist/cli/chunks/{pipeline-LQZSNDD2.js → pipeline-IGUQPPPO.js} +2 -2
- package/dist/cli/chunks/platform-2P636I7B.js +2 -0
- package/dist/cli/chunks/{plugin-EJ6K2MGU.js → plugin-NY6SWDPE.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-OIHTKJMN.js → prime-radiant-advanced-wasm-2UUDTIO2.js} +2 -2
- package/dist/cli/chunks/project-root-IOISG5KX.js +2 -0
- package/dist/cli/chunks/protocol-executor-IBYEII5Q.js +2 -0
- package/dist/cli/chunks/{protocol-handler-NRBROAU7.js → protocol-handler-ZTPCRQ5W.js} +2 -2
- package/dist/cli/chunks/{prove-EJOGEGD3.js → prove-SQX5A3IG.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-7IETWW6W.js +2 -0
- package/dist/cli/chunks/{quality-E55UC73D.js → quality-DROILKRY.js} +2 -2
- package/dist/cli/chunks/{quality-gate-OIQATNT3.js → quality-gate-PWKWDJY2.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-NHUK2MWJ.js +2 -0
- package/dist/cli/chunks/real-embeddings-P5U3MGYC.js +2 -0
- package/dist/cli/chunks/{ref-validation-OPO6J7OL.js → ref-validation-KY73NQXD.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-ODY5KRWU.js → roocode-installer-6JPPRB3W.js} +2 -2
- package/dist/cli/chunks/router-SRSO3IHF.js +2 -0
- package/dist/cli/chunks/routing-feedback-PASRE5HY.js +2 -0
- package/dist/cli/chunks/{routing-handler-KQM6VWLC.js → routing-handler-VTJIVFUO.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-U2GVV6PF.js → ruvector-commands-C6RPSJJO.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-4M4J67OU.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-TSXGT5LF.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-R53URRIO.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-MOF3E7BR.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-KMIHD3LP.js → rvf-store-integrity-MMXN5TEJ.js} +2 -2
- package/dist/cli/chunks/safe-db-QJLFO33B.js +2 -0
- package/dist/cli/chunks/schedule-YIVXW5O2.js +2 -0
- package/dist/cli/chunks/scheduler-AON7DWSJ.js +2 -0
- package/dist/cli/chunks/{security-P5NM353C.js → security-3B3R2NL4.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-VIJB7JUS.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-2CSG7C4W.js → shared-rvf-dual-writer-UVWGDUWC.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-75VHKKQB.js +2 -0
- package/dist/cli/chunks/standalone-memory-M4LWAAYZ.js +2 -0
- package/dist/cli/chunks/{status-handler-6TU6O37R.js → status-handler-YYFV6OZL.js} +2 -2
- package/dist/cli/chunks/{structural-health-KBIJSTXJ.js → structural-health-27E6LLKB.js} +2 -2
- package/dist/cli/chunks/sync-26CEGSTC.js +2 -0
- package/dist/cli/chunks/{sync-LNHI5SB7.js → sync-J3LJ56WN.js} +2 -2
- package/dist/cli/chunks/task-handler-4MCEBQZL.js +54 -0
- package/dist/cli/chunks/task-handlers-GYBAWKE2.js +9 -0
- package/dist/cli/chunks/{test-DHAAI3DU.js → test-MPC5HRH5.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-XDBZ3QC2.js → test-scheduling-ZJBFRZ3J.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-2Y2XITBX.js +2 -0
- package/dist/cli/chunks/{token-usage-Q2YG5YQN.js → token-usage-3X5WMTG2.js} +2 -2
- package/dist/cli/chunks/{transformers-F5UQTQCY.js → transformers-MVL4C5IX.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-SLW65ZFO.js +2 -0
- package/dist/cli/chunks/{types-JQ7EQO5Q.js → types-TG5P3CRS.js} +2 -2
- package/dist/cli/chunks/unified-memory-UCQ6AB32.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-IXYUMKRR.js +2 -0
- package/dist/cli/chunks/unified-persistence-7E6JQ4FZ.js +2 -0
- package/dist/cli/chunks/{upgrade-TJRVGHGD.js → upgrade-ETBHDEPY.js} +2 -2
- package/dist/cli/chunks/{validate-BWPCVHBN.js → validate-C2A73LZK.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-QVVKCQLP.js → validate-swarm-67XN42ML.js} +2 -2
- package/dist/cli/chunks/{vibium-ZFATIWHO.js → vibium-NILGKHLN.js} +2 -2
- package/dist/cli/chunks/visual-security-4VZXPEVG.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-KPLY7ONR.js → web-tree-sitter-USJN77P4.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-H7XM7ISA.js → windsurf-installer-5GGZXGJW.js} +2 -2
- package/dist/cli/chunks/witness-chain-IWS5ZHHL.js +2 -0
- package/dist/cli/chunks/witness-chain-JQA2VPZI.js +2 -0
- package/dist/cli/chunks/witness-chain-repair-4UA7IPS3.js +2 -0
- package/dist/cli/chunks/witness-chain-verifier-3GEADWPE.js +2 -0
- package/dist/cli/chunks/{witness-key-manager-DFRL42GE.js → witness-key-manager-ZWEIK3VJ.js} +2 -2
- package/dist/cli/chunks/{workflow-2ZQO6WYI.js → workflow-KHMVVBBA.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-GI5NQH7C.js +2 -0
- package/dist/cli/chunks/wrappers-N6XIK5PT.js +2 -0
- package/dist/cli/commands/audit.d.ts +20 -2
- package/dist/cli/commands/audit.js +158 -16
- package/dist/cli/commands/claude-flow-setup.js +5 -4
- package/dist/cli/commands/mcp.js +6 -0
- package/dist/cli/commands/memory.d.ts +1 -1
- package/dist/cli/commands/memory.js +8 -8
- package/dist/cli/commands/platform.js +15 -2
- package/dist/cli/commands/upgrade.d.ts +3 -3
- package/dist/cli/commands/upgrade.js +3 -3
- package/dist/cli/handlers/init-handler.d.ts +10 -0
- package/dist/cli/handlers/task-handler.js +24 -3
- package/dist/cli/helpers/standalone-memory.d.ts +12 -0
- package/dist/cli/helpers/standalone-memory.js +46 -0
- package/dist/cli/index.js +39 -42
- package/dist/cli/log-gate.d.ts +66 -0
- package/dist/cli/log-gate.js +170 -0
- package/dist/init/agents-installer.d.ts +4 -0
- package/dist/init/agents-installer.js +24 -11
- package/dist/init/codex-installer.js +22 -8
- package/dist/init/idempotent-write.d.ts +53 -0
- package/dist/init/idempotent-write.js +160 -0
- package/dist/init/orchestrator.js +1 -0
- package/dist/init/phases/05-learning.js +3 -1
- package/dist/init/phases/07-hooks.js +32 -16
- package/dist/init/phases/08-mcp.js +4 -2
- package/dist/init/phases/09-assets.d.ts +10 -0
- package/dist/init/phases/09-assets.js +3 -0
- package/dist/init/phases/10-workers.js +7 -5
- package/dist/init/phases/12-verification.js +7 -2
- package/dist/init/project-analyzer.d.ts +9 -0
- package/dist/init/project-analyzer.js +20 -1
- package/dist/init/self-configurator.d.ts +5 -3
- package/dist/init/self-configurator.js +18 -29
- package/dist/init/skills-installer.js +4 -2
- package/dist/init/token-bootstrap.d.ts +1 -1
- package/dist/init/token-bootstrap.js +12 -2
- package/dist/init/types.d.ts +16 -0
- package/dist/init/types.js +20 -24
- package/dist/integrations/coherence/coherence-service.js +84 -24
- package/dist/integrations/coherence/vote-tally.d.ts +38 -0
- package/dist/integrations/coherence/vote-tally.js +39 -0
- package/dist/integrations/ruvector/brain-exporter.js +17 -0
- package/dist/integrations/ruvector/brain-import-audit.d.ts +20 -0
- package/dist/integrations/ruvector/brain-import-audit.js +22 -0
- package/dist/integrations/ruvector/brain-rvf-exporter.js +16 -0
- package/dist/integrations/ruvector/brain-shared.js +1 -1
- package/dist/integrations/ruvector/rvf-dual-writer.js +6 -1
- package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +23 -0
- package/dist/integrations/ruvector/shared-rvf-adapter.js +24 -0
- package/dist/kernel/hybrid-backend.d.ts +6 -0
- package/dist/kernel/hybrid-backend.js +18 -0
- package/dist/kernel/kernel.js +12 -16
- package/dist/kernel/project-root.d.ts +1 -1
- package/dist/kernel/project-root.js +24 -3
- package/dist/learning/embedder-identity-store.js +4 -3
- package/dist/learning/pattern-store.d.ts +11 -0
- package/dist/learning/pattern-store.js +31 -9
- package/dist/learning/qe-patterns.d.ts +6 -0
- package/dist/learning/qe-patterns.js +7 -1
- package/dist/learning/qe-reasoning-bank.js +3 -0
- package/dist/learning/real-embeddings.d.ts +8 -0
- package/dist/learning/real-embeddings.js +16 -0
- package/dist/learning/rvf-pattern-store.js +30 -10
- package/dist/learning/sqlite-persistence.d.ts +8 -1
- package/dist/learning/sqlite-persistence.js +49 -9
- package/dist/logging/console-logger.d.ts +2 -5
- package/dist/logging/console-logger.js +10 -46
- package/dist/logging/index.d.ts +2 -0
- package/dist/logging/index.js +1 -0
- package/dist/logging/redaction.d.ts +27 -0
- package/dist/logging/redaction.js +170 -0
- package/dist/mcp/bundle.js +463 -449
- package/dist/mcp/entry.js +2 -0
- package/dist/mcp/handlers/core-handlers.js +5 -4
- package/dist/mcp/handlers/memory-handlers.d.ts +6 -1
- package/dist/mcp/handlers/memory-handlers.js +44 -22
- package/dist/mcp/handlers/task-handlers.js +14 -1
- package/dist/mcp/protocol-server.js +3 -1
- package/dist/mcp/services/session-store.js +5 -1
- package/dist/mcp/tools/base.d.ts +9 -2
- package/dist/mcp/tools/base.js +7 -0
- package/dist/mcp/tools/coherence/consensus.js +51 -2
- package/dist/mcp/tools/planning/goap-plan.d.ts +20 -7
- package/dist/mcp/tools/planning/goap-plan.js +92 -20
- package/dist/mcp/tools/planning/goap-status.d.ts +37 -12
- package/dist/mcp/tools/planning/goap-status.js +52 -23
- package/dist/mcp/tools/planning/world-state.d.ts +101 -0
- package/dist/mcp/tools/planning/world-state.js +274 -0
- package/dist/mcp/types.d.ts +4 -2
- package/dist/planning/goap-planner.d.ts +60 -4
- package/dist/planning/goap-planner.js +218 -60
- package/dist/planning/index.d.ts +1 -1
- package/dist/planning/index.js +1 -1
- package/dist/planning/plan-executor.d.ts +20 -1
- package/dist/planning/plan-executor.js +209 -100
- package/dist/planning/types.d.ts +16 -0
- package/dist/planning/types.js +17 -0
- package/dist/plugins/cache.d.ts +2 -0
- package/dist/plugins/cache.js +15 -2
- package/dist/plugins/lifecycle.js +15 -2
- package/dist/plugins/manifest.js +7 -5
- package/dist/plugins/resolver.d.ts +13 -22
- package/dist/plugins/resolver.js +169 -61
- package/dist/plugins/version-policy.d.ts +13 -0
- package/dist/plugins/version-policy.js +18 -0
- package/dist/shared/types/index.d.ts +6 -0
- package/dist/shared/types/index.js +8 -0
- package/package.json +2 -1
- package/dist/cli/chunks/adapter-TNNNJRDG.js +0 -2
- package/dist/cli/chunks/agent-booster-wasm-5PC7D2FW.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-5ZRMYJLB.js +0 -2
- package/dist/cli/chunks/audit-YSGA7UWT.js +0 -3
- package/dist/cli/chunks/base-KWZHOPSH.js +0 -2
- package/dist/cli/chunks/brain-handler-ET6YAP4B.js +0 -90
- package/dist/cli/chunks/browser-workflow-2FZTKDUL.js +0 -2
- package/dist/cli/chunks/chunk-33YYYWBQ.js +0 -4
- package/dist/cli/chunks/chunk-5Z6XZV7K.js +0 -65
- package/dist/cli/chunks/chunk-6J62K3SW.js +0 -2
- package/dist/cli/chunks/chunk-6TPKK7LD.js +0 -15
- package/dist/cli/chunks/chunk-DEYLEDJN.js +0 -27
- package/dist/cli/chunks/chunk-J6GNQS62.js +0 -5
- package/dist/cli/chunks/chunk-KGT36Z42.js +0 -14
- package/dist/cli/chunks/chunk-NA7B2QYB.js +0 -2
- package/dist/cli/chunks/chunk-NDPFGIMJ.js +0 -13
- package/dist/cli/chunks/chunk-OBAP2TXZ.js +0 -2
- package/dist/cli/chunks/chunk-PEPFCPES.js +0 -2
- package/dist/cli/chunks/chunk-T6BVLVI5.js +0 -2
- package/dist/cli/chunks/chunk-TT23RRB7.js +0 -2
- package/dist/cli/chunks/chunk-XC7DYDSY.js +0 -180
- package/dist/cli/chunks/chunk-XWMZ6D6N.js +0 -2
- package/dist/cli/chunks/chunk-Y3MW3YBC.js +0 -3
- package/dist/cli/chunks/claude-flow-setup-6JKMBPGU.js +0 -2
- package/dist/cli/chunks/client-7E4LM2WW.js +0 -2
- package/dist/cli/chunks/codex-installer-CQ24DTP5.js +0 -14
- package/dist/cli/chunks/core-handlers-IFG3757P.js +0 -2
- package/dist/cli/chunks/cross-domain-router-EK7W4PGP.js +0 -2
- package/dist/cli/chunks/domain-transfer-KQJRUPXA.js +0 -2
- package/dist/cli/chunks/dream-NFSCSLY7.js +0 -2
- package/dist/cli/chunks/embed-and-insert-pattern-ZPAG7235.js +0 -3
- package/dist/cli/chunks/heartbeat-scheduler-ZATCDJDK.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-WXQABRCA.js +0 -2
- package/dist/cli/chunks/hnsw-index-TPSWLEA5.js +0 -2
- package/dist/cli/chunks/impact-analyzer-HNIU45P5.js +0 -2
- package/dist/cli/chunks/init-wizard-JUIPBMHG.js +0 -2
- package/dist/cli/chunks/kernel-5BOZQ754.js +0 -2
- package/dist/cli/chunks/knowledge-graph-EWDAENWM.js +0 -2
- package/dist/cli/chunks/llm-router-service-3YT7JGBS.js +0 -2
- package/dist/cli/chunks/load-test-BP2CPLIV.js +0 -2
- package/dist/cli/chunks/mcp-5TTB37DC.js +0 -2
- package/dist/cli/chunks/memory-backend-4PYQBPRM.js +0 -2
- package/dist/cli/chunks/memory-handlers-2B27NITS.js +0 -2
- package/dist/cli/chunks/multi-model-executor-KCWSGCDT.js +0 -14
- package/dist/cli/chunks/orchestrator-RKB7XJRG.js +0 -393
- package/dist/cli/chunks/pattern-null-store-OYOQOV2O.js +0 -2
- package/dist/cli/chunks/platform-OD5H5U6G.js +0 -2
- package/dist/cli/chunks/protocol-executor-3ATJTXWG.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-LLMYZT4X.js +0 -2
- package/dist/cli/chunks/queen-coordinator-RN7L6KG5.js +0 -2
- package/dist/cli/chunks/real-embeddings-FPFFNOSZ.js +0 -2
- package/dist/cli/chunks/router-MDHITQ2V.js +0 -2
- package/dist/cli/chunks/routing-feedback-5XLNJ3Y3.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-JBW4O3II.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-BPPQL4XJ.js +0 -2
- package/dist/cli/chunks/rvf-migration-coordinator-V2GHCJKN.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-S4562CG5.js +0 -2
- package/dist/cli/chunks/safe-db-FIRHSXVF.js +0 -2
- package/dist/cli/chunks/schedule-RVXFB4HK.js +0 -2
- package/dist/cli/chunks/scheduler-IKKAMAOO.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-LVIUOO4S.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-SQ3HCUQ7.js +0 -2
- package/dist/cli/chunks/sync-UHOX6RJW.js +0 -2
- package/dist/cli/chunks/task-handler-AVDHMLGI.js +0 -49
- package/dist/cli/chunks/task-handlers-KYK4VTRA.js +0 -9
- package/dist/cli/chunks/token-bootstrap-GUTTLPZX.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-DEGOHS6F.js +0 -2
- package/dist/cli/chunks/unified-memory-CXHLHB5I.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-I7WAE54M.js +0 -2
- package/dist/cli/chunks/unified-persistence-6CPF65WI.js +0 -2
- package/dist/cli/chunks/visual-security-GNPHME5H.js +0 -2
- package/dist/cli/chunks/witness-chain-RRN6NDCH.js +0 -2
- package/dist/cli/chunks/witness-chain-VT4UHHBR.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-DB3HIECD.js +0 -2
- package/dist/cli/chunks/wrappers-SUS6XEJD.js +0 -2
|
@@ -24,6 +24,7 @@ const DEFAULT_CONFIG = {
|
|
|
24
24
|
maxRetries: 2,
|
|
25
25
|
stepTimeoutMs: 60000,
|
|
26
26
|
replanOnFailure: true,
|
|
27
|
+
maxReplans: 3,
|
|
27
28
|
parallelExecution: false,
|
|
28
29
|
recordWorldState: true,
|
|
29
30
|
useUnified: true, // ADR-046: Default to unified storage
|
|
@@ -44,6 +45,24 @@ function safeStringify(value, maxLength = 2000) {
|
|
|
44
45
|
return String(value);
|
|
45
46
|
}
|
|
46
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Issue #535: render the `error` of a domain Result err as text — an Error's
|
|
50
|
+
* message, a string as-is, else a (truncated) JSON rendering.
|
|
51
|
+
*/
|
|
52
|
+
function describeDomainError(reason) {
|
|
53
|
+
if (reason === undefined || reason === null)
|
|
54
|
+
return 'unknown error';
|
|
55
|
+
if (reason instanceof Error || typeof reason === 'string')
|
|
56
|
+
return toErrorMessage(reason);
|
|
57
|
+
const message = reason.message;
|
|
58
|
+
return typeof message === 'string' ? message : safeStringify(reason, 500);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Issue #535: goap_execution_steps marker row recording that an execution
|
|
62
|
+
* was cancelled (see persistExecutionResult). Excluded from step lists.
|
|
63
|
+
*/
|
|
64
|
+
const CANCELLED_MARKER_ACTION_ID = '__execution_cancelled__';
|
|
65
|
+
const CANCELLED_MARKER_STATUS = 'cancelled';
|
|
47
66
|
// ============================================================================
|
|
48
67
|
// Plan Executor Class
|
|
49
68
|
// ============================================================================
|
|
@@ -200,9 +219,30 @@ export class PlanExecutor {
|
|
|
200
219
|
*/
|
|
201
220
|
async executeWithCallbacks(plan, onStepStart, onStepComplete, initialState) {
|
|
202
221
|
await this.initialize();
|
|
203
|
-
const startTime = Date.now();
|
|
204
222
|
const executionId = `exec-${Date.now()}-${randomUUID().slice(0, 8)}`;
|
|
205
223
|
this.currentExecution = { planId: plan.id, cancelled: false };
|
|
224
|
+
try {
|
|
225
|
+
const result = await this.runPlan(plan, onStepStart, onStepComplete, initialState, {
|
|
226
|
+
excludedActions: new Set(),
|
|
227
|
+
replanDepth: 0,
|
|
228
|
+
});
|
|
229
|
+
// Persist once per top-level execution. Issue #535: replanned
|
|
230
|
+
// sub-plans used to persist their own steps AND hand them back to the
|
|
231
|
+
// parent, which persisted them again under the same step ids
|
|
232
|
+
// ("UNIQUE constraint failed: goap_execution_steps.id").
|
|
233
|
+
await this.persistExecutionResult(executionId, result);
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
finally {
|
|
237
|
+
this.currentExecution = null;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Run a plan's steps (and any replacement plans after a failure) without
|
|
242
|
+
* persisting or resetting execution tracking — see executeWithCallbacks.
|
|
243
|
+
*/
|
|
244
|
+
async runPlan(plan, onStepStart, onStepComplete, initialState, replan) {
|
|
245
|
+
const startTime = Date.now();
|
|
206
246
|
const result = {
|
|
207
247
|
planId: plan.id,
|
|
208
248
|
status: 'completed',
|
|
@@ -222,106 +262,115 @@ export class PlanExecutor {
|
|
|
222
262
|
stepOrder: index,
|
|
223
263
|
status: 'pending',
|
|
224
264
|
}));
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
265
|
+
for (const step of steps) {
|
|
266
|
+
// Check for cancellation
|
|
267
|
+
if (this.currentExecution?.cancelled) {
|
|
268
|
+
result.status = 'cancelled';
|
|
269
|
+
result.error = 'Execution was cancelled';
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
// Record world state before execution
|
|
273
|
+
if (this.config.recordWorldState) {
|
|
274
|
+
step.worldStateBefore = this.cloneState(currentState);
|
|
275
|
+
}
|
|
276
|
+
// Notify step start
|
|
277
|
+
onStepStart(step);
|
|
278
|
+
// Execute with retries
|
|
279
|
+
let success = false;
|
|
280
|
+
let lastError;
|
|
281
|
+
let retries = 0;
|
|
282
|
+
let output;
|
|
283
|
+
let agentId;
|
|
284
|
+
const stepStartTime = Date.now();
|
|
285
|
+
for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {
|
|
286
|
+
const execResult = await this.executeStep(step, currentState);
|
|
287
|
+
if (execResult.success) {
|
|
288
|
+
success = true;
|
|
289
|
+
currentState = execResult.newState;
|
|
290
|
+
output = execResult.output;
|
|
291
|
+
agentId = execResult.agentId;
|
|
231
292
|
break;
|
|
232
293
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
let success = false;
|
|
241
|
-
let lastError;
|
|
242
|
-
let retries = 0;
|
|
243
|
-
let output;
|
|
244
|
-
let agentId;
|
|
245
|
-
const stepStartTime = Date.now();
|
|
246
|
-
for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {
|
|
247
|
-
const execResult = await this.executeStep(step, currentState);
|
|
248
|
-
if (execResult.success) {
|
|
249
|
-
success = true;
|
|
250
|
-
currentState = execResult.newState;
|
|
251
|
-
output = execResult.output;
|
|
252
|
-
agentId = execResult.agentId;
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
lastError = execResult.error;
|
|
256
|
-
retries = attempt;
|
|
257
|
-
// Wait before retry (exponential backoff)
|
|
258
|
-
if (attempt < this.config.maxRetries) {
|
|
259
|
-
await this.delay(Math.min(1000 * Math.pow(2, attempt), 5000));
|
|
260
|
-
}
|
|
294
|
+
lastError = execResult.error;
|
|
295
|
+
retries = attempt;
|
|
296
|
+
// Issue #535: deterministic failures (no implementation, domain
|
|
297
|
+
// not loaded, missing method, unmet preconditions) cannot succeed
|
|
298
|
+
// on retry — don't burn seconds of backoff on them.
|
|
299
|
+
if (execResult.retryable === false) {
|
|
300
|
+
break;
|
|
261
301
|
}
|
|
262
|
-
//
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
status: success ? 'completed' : 'failed',
|
|
266
|
-
retries,
|
|
267
|
-
startedAt: new Date(stepStartTime),
|
|
268
|
-
completedAt: new Date(),
|
|
269
|
-
durationMs: Date.now() - stepStartTime,
|
|
270
|
-
agentId,
|
|
271
|
-
agentOutput: output,
|
|
272
|
-
worldStateAfter: this.config.recordWorldState
|
|
273
|
-
? this.cloneState(currentState)
|
|
274
|
-
: undefined,
|
|
275
|
-
error: lastError,
|
|
276
|
-
};
|
|
277
|
-
result.steps.push(executedStep);
|
|
278
|
-
onStepComplete(executedStep);
|
|
279
|
-
if (success) {
|
|
280
|
-
result.stepsCompleted++;
|
|
281
|
-
await this.updateActionStats(step.action.id, true, executedStep.durationMs ?? 0);
|
|
302
|
+
// Wait before retry (exponential backoff)
|
|
303
|
+
if (attempt < this.config.maxRetries) {
|
|
304
|
+
await this.delay(Math.min(1000 * Math.pow(2, attempt), 5000));
|
|
282
305
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
306
|
+
}
|
|
307
|
+
// Record executed step
|
|
308
|
+
const executedStep = {
|
|
309
|
+
...step,
|
|
310
|
+
status: success ? 'completed' : 'failed',
|
|
311
|
+
retries,
|
|
312
|
+
startedAt: new Date(stepStartTime),
|
|
313
|
+
completedAt: new Date(),
|
|
314
|
+
durationMs: Date.now() - stepStartTime,
|
|
315
|
+
agentId,
|
|
316
|
+
agentOutput: output,
|
|
317
|
+
worldStateAfter: this.config.recordWorldState
|
|
318
|
+
? this.cloneState(currentState)
|
|
319
|
+
: undefined,
|
|
320
|
+
error: lastError,
|
|
321
|
+
};
|
|
322
|
+
result.steps.push(executedStep);
|
|
323
|
+
onStepComplete(executedStep);
|
|
324
|
+
if (success) {
|
|
325
|
+
result.stepsCompleted++;
|
|
326
|
+
await this.updateActionStats(step.action.id, true, executedStep.durationMs ?? 0);
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
result.stepsFailed++;
|
|
330
|
+
await this.updateActionStats(step.action.id, false, 0);
|
|
331
|
+
// Try to replan if configured (bounded — issue #535)
|
|
332
|
+
const maxReplans = this.config.maxReplans ?? 3;
|
|
333
|
+
if (this.config.replanOnFailure && replan.replanDepth < maxReplans) {
|
|
334
|
+
// Accumulate exclusions across successive replans so a chain of
|
|
335
|
+
// failures can't bounce back to an action that already failed.
|
|
336
|
+
replan.excludedActions.add(step.action.id);
|
|
337
|
+
const newPlan = await this.replanFromFailure(plan, step.stepOrder, currentState, [...replan.excludedActions]);
|
|
338
|
+
if (newPlan) {
|
|
339
|
+
const replanResult = await this.runPlan(newPlan, onStepStart, onStepComplete, currentState, { excludedActions: replan.excludedActions, replanDepth: replan.replanDepth + 1 });
|
|
340
|
+
result.steps.push(...replanResult.steps);
|
|
341
|
+
result.stepsCompleted += replanResult.stepsCompleted;
|
|
342
|
+
result.stepsFailed += replanResult.stepsFailed;
|
|
343
|
+
if (replanResult.status === 'completed' && replanResult.finalWorldState) {
|
|
344
|
+
currentState = replanResult.finalWorldState;
|
|
302
345
|
}
|
|
303
346
|
else {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
347
|
+
// The goal was not reached — report it as such rather than
|
|
348
|
+
// the old 'partial' ("Replanning partially succeeded").
|
|
349
|
+
result.status = replanResult.status === 'cancelled' ? 'cancelled' : 'failed';
|
|
350
|
+
result.error =
|
|
351
|
+
`Step ${step.stepOrder} failed (${lastError}); replanning did not recover: ` +
|
|
352
|
+
`${replanResult.error || 'unknown error'}`;
|
|
307
353
|
}
|
|
354
|
+
// The replacement plan supersedes the rest of this plan —
|
|
355
|
+
// don't keep executing stale steps after it.
|
|
356
|
+
break;
|
|
308
357
|
}
|
|
309
358
|
else {
|
|
310
359
|
result.status = 'failed';
|
|
311
|
-
result.error = `Step ${step.stepOrder} failed: ${lastError}`;
|
|
360
|
+
result.error = `Step ${step.stepOrder} failed and replanning unsuccessful: ${lastError}`;
|
|
312
361
|
break;
|
|
313
362
|
}
|
|
314
363
|
}
|
|
364
|
+
else {
|
|
365
|
+
result.status = 'failed';
|
|
366
|
+
result.error = `Step ${step.stepOrder} failed: ${lastError}`;
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
315
369
|
}
|
|
316
|
-
result.finalWorldState = currentState;
|
|
317
|
-
result.totalDurationMs = Date.now() - startTime;
|
|
318
|
-
// Persist execution result
|
|
319
|
-
await this.persistExecutionResult(executionId, result);
|
|
320
|
-
return result;
|
|
321
|
-
}
|
|
322
|
-
finally {
|
|
323
|
-
this.currentExecution = null;
|
|
324
370
|
}
|
|
371
|
+
result.finalWorldState = currentState;
|
|
372
|
+
result.totalDurationMs = Date.now() - startTime;
|
|
373
|
+
return result;
|
|
325
374
|
}
|
|
326
375
|
/**
|
|
327
376
|
* Execute a single step
|
|
@@ -334,6 +383,7 @@ export class PlanExecutor {
|
|
|
334
383
|
success: false,
|
|
335
384
|
newState: currentState,
|
|
336
385
|
error: `Preconditions not met for action: ${action.name}`,
|
|
386
|
+
retryable: false,
|
|
337
387
|
};
|
|
338
388
|
}
|
|
339
389
|
// A14: an action explicitly marked as having no real domain backing
|
|
@@ -347,6 +397,7 @@ export class PlanExecutor {
|
|
|
347
397
|
success: false,
|
|
348
398
|
newState: currentState,
|
|
349
399
|
error: `Action '${action.name}' has no real implementation yet (not simulated — see GOAPAction.implemented)`,
|
|
400
|
+
retryable: false,
|
|
350
401
|
};
|
|
351
402
|
}
|
|
352
403
|
// A14: real dispatch — opt-in via constructor-injected getDomainAPI
|
|
@@ -359,9 +410,7 @@ export class PlanExecutor {
|
|
|
359
410
|
const taskDescription = this.buildTaskDescription(action);
|
|
360
411
|
try {
|
|
361
412
|
// Execute with timeout
|
|
362
|
-
const
|
|
363
|
-
const spawnPromise = this.spawner.spawn(action.agentType, taskDescription);
|
|
364
|
-
const agentResult = await Promise.race([spawnPromise, timeoutPromise]);
|
|
413
|
+
const agentResult = await this.withStepTimeout(this.spawner.spawn(action.agentType, taskDescription));
|
|
365
414
|
if (agentResult.success) {
|
|
366
415
|
// Apply action effects to world state
|
|
367
416
|
const newState = this.applyEffects(currentState, action.effects);
|
|
@@ -404,6 +453,7 @@ export class PlanExecutor {
|
|
|
404
453
|
success: false,
|
|
405
454
|
newState: currentState,
|
|
406
455
|
error: `Action '${action.name}' has no qeDomain to resolve a real API from`,
|
|
456
|
+
retryable: false,
|
|
407
457
|
};
|
|
408
458
|
}
|
|
409
459
|
if (!action.method) {
|
|
@@ -411,6 +461,7 @@ export class PlanExecutor {
|
|
|
411
461
|
success: false,
|
|
412
462
|
newState: currentState,
|
|
413
463
|
error: `Action '${action.name}' is marked implemented but has no method binding`,
|
|
464
|
+
retryable: false,
|
|
414
465
|
};
|
|
415
466
|
}
|
|
416
467
|
let api;
|
|
@@ -429,6 +480,7 @@ export class PlanExecutor {
|
|
|
429
480
|
success: false,
|
|
430
481
|
newState: currentState,
|
|
431
482
|
error: `Domain '${action.qeDomain}' is not available (kernel not initialized, or the domain isn't loaded — try fleet_init)`,
|
|
483
|
+
retryable: false,
|
|
432
484
|
};
|
|
433
485
|
}
|
|
434
486
|
const method = api[action.method];
|
|
@@ -437,12 +489,28 @@ export class PlanExecutor {
|
|
|
437
489
|
success: false,
|
|
438
490
|
newState: currentState,
|
|
439
491
|
error: `Domain '${action.qeDomain}' has no method '${action.method}'`,
|
|
492
|
+
retryable: false,
|
|
440
493
|
};
|
|
441
494
|
}
|
|
442
495
|
try {
|
|
443
|
-
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error(`Step timeout after ${this.config.stepTimeoutMs}ms`)), this.config.stepTimeoutMs));
|
|
444
496
|
const invokePromise = method.call(api, action.params ?? {});
|
|
445
|
-
const result = await
|
|
497
|
+
const result = await this.withStepTimeout(invokePromise);
|
|
498
|
+
// Issue #535: domain APIs return Result<T, Error> ({ success: false,
|
|
499
|
+
// error }) rather than throwing. Treating any resolved value as
|
|
500
|
+
// success reported e.g. detectGaps({}) -> err("missing coverageData")
|
|
501
|
+
// as a completed step and applied its effects — a fabricated success.
|
|
502
|
+
if (typeof result === 'object' &&
|
|
503
|
+
result !== null &&
|
|
504
|
+
result.success === false) {
|
|
505
|
+
const reason = result.error;
|
|
506
|
+
return {
|
|
507
|
+
success: false,
|
|
508
|
+
newState: currentState,
|
|
509
|
+
agentId: `domain:${action.qeDomain}`,
|
|
510
|
+
error: `Domain '${action.qeDomain}' method '${action.method}' returned an error: ` +
|
|
511
|
+
describeDomainError(reason),
|
|
512
|
+
};
|
|
513
|
+
}
|
|
446
514
|
const newState = this.applyEffects(currentState, action.effects);
|
|
447
515
|
return {
|
|
448
516
|
success: true,
|
|
@@ -459,6 +527,25 @@ export class PlanExecutor {
|
|
|
459
527
|
};
|
|
460
528
|
}
|
|
461
529
|
}
|
|
530
|
+
/**
|
|
531
|
+
* Race `work` against the per-step timeout, clearing the timer once the
|
|
532
|
+
* race settles so completed steps don't leave a pending timer behind
|
|
533
|
+
* (codex review, #535: it kept short-lived processes alive for up to
|
|
534
|
+
* stepTimeoutMs and accumulated timers across executions).
|
|
535
|
+
*/
|
|
536
|
+
async withStepTimeout(work) {
|
|
537
|
+
let timer;
|
|
538
|
+
const timeout = new Promise((_, reject) => {
|
|
539
|
+
timer = setTimeout(() => reject(new Error(`Step timeout after ${this.config.stepTimeoutMs}ms`)), this.config.stepTimeoutMs);
|
|
540
|
+
});
|
|
541
|
+
try {
|
|
542
|
+
return await Promise.race([work, timeout]);
|
|
543
|
+
}
|
|
544
|
+
finally {
|
|
545
|
+
if (timer !== undefined)
|
|
546
|
+
clearTimeout(timer);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
462
549
|
/**
|
|
463
550
|
* Build a task description for an agent
|
|
464
551
|
*/
|
|
@@ -494,11 +581,12 @@ export class PlanExecutor {
|
|
|
494
581
|
* @param currentState - Current world state at failure point
|
|
495
582
|
* @returns New plan or null if replanning fails
|
|
496
583
|
*/
|
|
497
|
-
async replanFromFailure(originalPlan, failedStepIndex, currentState) {
|
|
584
|
+
async replanFromFailure(originalPlan, failedStepIndex, currentState, additionalExcluded = []) {
|
|
498
585
|
try {
|
|
499
|
-
// Exclude the failed action
|
|
586
|
+
// Exclude the failed action (and any that failed earlier in this
|
|
587
|
+
// execution) from replanning
|
|
500
588
|
const failedAction = originalPlan.actions[failedStepIndex];
|
|
501
|
-
const excludedActions = [failedAction.id];
|
|
589
|
+
const excludedActions = [...new Set([failedAction.id, ...additionalExcluded])];
|
|
502
590
|
// Try to find a new plan
|
|
503
591
|
const newPlan = await this.planner.findPlan(currentState, originalPlan.goalState, { excludedActions });
|
|
504
592
|
return newPlan;
|
|
@@ -555,7 +643,8 @@ export class PlanExecutor {
|
|
|
555
643
|
SUM(CASE WHEN status = 'completed' THEN 1 ELSE 0 END) as steps_completed,
|
|
556
644
|
SUM(CASE WHEN status = 'failed' THEN 1 ELSE 0 END) as steps_failed,
|
|
557
645
|
SUM(COALESCE(duration_ms, 0)) as total_duration_ms,
|
|
558
|
-
|
|
646
|
+
SUM(CASE WHEN action_id = '${CANCELLED_MARKER_ACTION_ID}' THEN 0 ELSE 1 END) as steps_recorded,
|
|
647
|
+
SUM(CASE WHEN action_id = '${CANCELLED_MARKER_ACTION_ID}' THEN 1 ELSE 0 END) as cancelled_markers,
|
|
559
648
|
MAX(CASE WHEN status = 'failed' THEN error_message END) as last_error
|
|
560
649
|
FROM goap_execution_steps
|
|
561
650
|
`;
|
|
@@ -571,9 +660,18 @@ export class PlanExecutor {
|
|
|
571
660
|
const steps = await this.getExecutedSteps(row.execution_id);
|
|
572
661
|
const finalWorldState = [...steps].reverse().find((s) => s.worldStateAfter)?.worldStateAfter;
|
|
573
662
|
const plannedStepCount = this.getPlannedActionCount(row.plan_id);
|
|
663
|
+
// Issue #535: a failed step followed by a successful replacement plan
|
|
664
|
+
// is a recovered (completed) execution; only a run that ENDS on a
|
|
665
|
+
// failed step failed. Without failures, fewer recorded steps than
|
|
666
|
+
// planned means it was cancelled.
|
|
667
|
+
const lastStep = steps[steps.length - 1];
|
|
574
668
|
let status;
|
|
575
|
-
if (row.
|
|
669
|
+
if (row.cancelled_markers > 0)
|
|
670
|
+
status = 'cancelled';
|
|
671
|
+
else if (lastStep?.status === 'failed')
|
|
576
672
|
status = 'failed';
|
|
673
|
+
else if (row.steps_failed > 0)
|
|
674
|
+
status = 'completed';
|
|
577
675
|
else if (plannedStepCount != null && row.steps_recorded < plannedStepCount)
|
|
578
676
|
status = 'cancelled';
|
|
579
677
|
else
|
|
@@ -605,8 +703,8 @@ export class PlanExecutor {
|
|
|
605
703
|
*/
|
|
606
704
|
async getExecutedSteps(executionId) {
|
|
607
705
|
const rows = this.db
|
|
608
|
-
.prepare(`SELECT * FROM goap_execution_steps WHERE execution_id = ? ORDER BY step_order`)
|
|
609
|
-
.all(executionId);
|
|
706
|
+
.prepare(`SELECT * FROM goap_execution_steps WHERE execution_id = ? AND action_id != ? ORDER BY step_order`)
|
|
707
|
+
.all(executionId, CANCELLED_MARKER_ACTION_ID);
|
|
610
708
|
return rows.map((row) => ({
|
|
611
709
|
id: row.id,
|
|
612
710
|
planId: row.plan_id,
|
|
@@ -662,8 +760,19 @@ export class PlanExecutor {
|
|
|
662
760
|
agent_output, world_state_before, world_state_after, error_message
|
|
663
761
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
664
762
|
`);
|
|
665
|
-
|
|
666
|
-
|
|
763
|
+
// Issue #535: steps from replacement plans (replanning) are recorded
|
|
764
|
+
// under the top-level plan id with a chronological step order, so one
|
|
765
|
+
// execution is one history record for the plan the caller executed —
|
|
766
|
+
// not split across sub-plan ids with colliding step orders.
|
|
767
|
+
result.steps.forEach((step, index) => {
|
|
768
|
+
insertStep.run(step.id, result.planId, executionId, step.action.id, index, step.status, step.retries, step.startedAt.toISOString(), step.durationMs ?? null, step.agentId ?? null, step.agentOutput ?? null, step.worldStateBefore ? JSON.stringify(step.worldStateBefore) : null, step.worldStateAfter ? JSON.stringify(step.worldStateAfter) : null, step.error ?? null);
|
|
769
|
+
});
|
|
770
|
+
// Issue #535 (codex review): an execution's cancellation cannot be
|
|
771
|
+
// inferred from its step rows once replanning is involved (the step
|
|
772
|
+
// count no longer matches the executed plan's action count), so record
|
|
773
|
+
// it explicitly with a marker row that history reads and then hides.
|
|
774
|
+
if (result.status === 'cancelled') {
|
|
775
|
+
insertStep.run(`${executionId}-${CANCELLED_MARKER_STATUS}`, result.planId, executionId, CANCELLED_MARKER_ACTION_ID, result.steps.length, CANCELLED_MARKER_STATUS, 0, new Date().toISOString(), null, null, null, null, null, result.error ?? 'Execution was cancelled');
|
|
667
776
|
}
|
|
668
777
|
// Reflects only the most recent execution attempt for this plan — a
|
|
669
778
|
// deliberate, documented scope limit: goap_plans is one row per plan,
|
package/dist/planning/types.d.ts
CHANGED
|
@@ -220,6 +220,12 @@ export interface PlanConstraints {
|
|
|
220
220
|
maxCost?: number;
|
|
221
221
|
/** Maximum total duration in milliseconds */
|
|
222
222
|
maxDurationMs?: number;
|
|
223
|
+
/**
|
|
224
|
+
* Maximum number of actions (steps) in the returned plan. Must be a
|
|
225
|
+
* positive integer; the planner rejects anything else. Defaults to
|
|
226
|
+
* DEFAULT_MAX_PLAN_STEPS when omitted. Issue #535.
|
|
227
|
+
*/
|
|
228
|
+
maxSteps?: number;
|
|
223
229
|
/** Only use actions that these agent types can execute */
|
|
224
230
|
requiredAgentTypes?: string[];
|
|
225
231
|
/** Exclude these specific action IDs */
|
|
@@ -227,6 +233,16 @@ export interface PlanConstraints {
|
|
|
227
233
|
/** Prefer actions in these QE domains */
|
|
228
234
|
preferredQeDomains?: QEDomain[];
|
|
229
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Default A* depth limit (plan length cap) when constraints.maxSteps is unset.
|
|
238
|
+
*/
|
|
239
|
+
export declare const DEFAULT_MAX_PLAN_STEPS = 20;
|
|
240
|
+
/**
|
|
241
|
+
* Validate a constraints.maxSteps value. Returns an error message, or null
|
|
242
|
+
* when the value is absent or a positive integer. Issue #535: shared by the
|
|
243
|
+
* planner and the goap_plan MCP tool so both boundaries reject the same input.
|
|
244
|
+
*/
|
|
245
|
+
export declare function validateMaxSteps(maxSteps: unknown): string | null;
|
|
230
246
|
/**
|
|
231
247
|
* Default world state for initialization
|
|
232
248
|
*/
|
package/dist/planning/types.js
CHANGED
|
@@ -12,6 +12,23 @@
|
|
|
12
12
|
* @module planning/types
|
|
13
13
|
* @version 3.0.0
|
|
14
14
|
*/
|
|
15
|
+
/**
|
|
16
|
+
* Default A* depth limit (plan length cap) when constraints.maxSteps is unset.
|
|
17
|
+
*/
|
|
18
|
+
export const DEFAULT_MAX_PLAN_STEPS = 20;
|
|
19
|
+
/**
|
|
20
|
+
* Validate a constraints.maxSteps value. Returns an error message, or null
|
|
21
|
+
* when the value is absent or a positive integer. Issue #535: shared by the
|
|
22
|
+
* planner and the goap_plan MCP tool so both boundaries reject the same input.
|
|
23
|
+
*/
|
|
24
|
+
export function validateMaxSteps(maxSteps) {
|
|
25
|
+
if (maxSteps === undefined)
|
|
26
|
+
return null;
|
|
27
|
+
if (typeof maxSteps !== 'number' || !Number.isInteger(maxSteps) || maxSteps < 1) {
|
|
28
|
+
return `constraints.maxSteps must be a positive integer, got ${String(maxSteps)}`;
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
15
32
|
// ============================================================================
|
|
16
33
|
// Default World State
|
|
17
34
|
// ============================================================================
|
package/dist/plugins/cache.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export declare class PluginCache {
|
|
|
37
37
|
listVersions(name: string): CachedPlugin[];
|
|
38
38
|
/** List all cached plugins (latest version of each). */
|
|
39
39
|
listAll(): CachedPlugin[];
|
|
40
|
+
/** Every cached candidate, for constraint-aware dependency resolution. */
|
|
41
|
+
listCandidates(): CachedPlugin[];
|
|
40
42
|
private versionDir;
|
|
41
43
|
private pruneOldVersions;
|
|
42
44
|
private copyDir;
|
package/dist/plugins/cache.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as fs from 'fs';
|
|
9
9
|
import * as path from 'path';
|
|
10
|
+
import { validVersion, newestVersionFirst } from './version-policy.js';
|
|
10
11
|
// ============================================================================
|
|
11
12
|
// PluginCache
|
|
12
13
|
// ============================================================================
|
|
@@ -79,6 +80,12 @@ export class PluginCache {
|
|
|
79
80
|
try {
|
|
80
81
|
const raw = fs.readFileSync(manifestPath, 'utf-8');
|
|
81
82
|
const manifest = JSON.parse(raw);
|
|
83
|
+
if (!validVersion(manifest.version)) {
|
|
84
|
+
// Older releases admitted versions SemVer now rejects (e.g. 01.0.0);
|
|
85
|
+
// say why the plugin disappeared instead of dropping it silently.
|
|
86
|
+
console.warn(`[PluginCache] Skipping cached plugin ${name}@${entry}: invalid version ${JSON.stringify(manifest.version)}`);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
82
89
|
const stat = fs.statSync(fullPath);
|
|
83
90
|
results.push({
|
|
84
91
|
manifest,
|
|
@@ -102,13 +109,19 @@ export class PluginCache {
|
|
|
102
109
|
for (const name of entries) {
|
|
103
110
|
const versions = this.listVersions(name);
|
|
104
111
|
if (versions.length > 0) {
|
|
105
|
-
// Return the latest version
|
|
106
|
-
versions.sort((a, b) =>
|
|
112
|
+
// Return the latest version by npm SemVer precedence.
|
|
113
|
+
versions.sort((a, b) => newestVersionFirst(a.manifest.version, b.manifest.version));
|
|
107
114
|
results.push(versions[0]);
|
|
108
115
|
}
|
|
109
116
|
}
|
|
110
117
|
return results;
|
|
111
118
|
}
|
|
119
|
+
/** Every cached candidate, for constraint-aware dependency resolution. */
|
|
120
|
+
listCandidates() {
|
|
121
|
+
if (!fs.existsSync(this.cacheDir))
|
|
122
|
+
return [];
|
|
123
|
+
return fs.readdirSync(this.cacheDir).flatMap(name => this.listVersions(name));
|
|
124
|
+
}
|
|
112
125
|
// --------------------------------------------------------------------------
|
|
113
126
|
// Internal
|
|
114
127
|
// --------------------------------------------------------------------------
|
|
@@ -94,6 +94,19 @@ export class PluginLifecycleManager {
|
|
|
94
94
|
securityViolations: security.violations,
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
+
// Admit only the requested dependency closure, using all cached candidates.
|
|
98
|
+
// Force this manifest's version so an older cached copy cannot mask failure.
|
|
99
|
+
try {
|
|
100
|
+
const candidates = this.cache.listCandidates().map(c => c.manifest)
|
|
101
|
+
.filter(c => c.name !== manifest.name);
|
|
102
|
+
const resolution = this.resolver.resolve([...candidates, manifest], [manifest.name]);
|
|
103
|
+
if (resolution.errors.length) {
|
|
104
|
+
return { success: false, manifest, errors: resolution.errors.map(e => `${e.code}: ${e.message}`), securityViolations: [] };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return { success: false, manifest, errors: [error instanceof Error ? error.message : String(error)], securityViolations: [] };
|
|
109
|
+
}
|
|
97
110
|
// 5. Check if already cached
|
|
98
111
|
if (this.cache.has(manifest.name, manifest.version)) {
|
|
99
112
|
const cached = this.cache.get(manifest.name, manifest.version);
|
|
@@ -162,8 +175,8 @@ export class PluginLifecycleManager {
|
|
|
162
175
|
* Resolve load order for all cached plugins.
|
|
163
176
|
*/
|
|
164
177
|
resolveLoadOrder() {
|
|
165
|
-
const all = this.cache.
|
|
166
|
-
return this.resolver.
|
|
178
|
+
const all = this.cache.listCandidates();
|
|
179
|
+
return this.resolver.resolveAvailable(all.map(c => c.manifest));
|
|
167
180
|
}
|
|
168
181
|
/**
|
|
169
182
|
* Register a plugin source.
|
package/dist/plugins/manifest.js
CHANGED
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
* plugins must provide. Includes validation logic for name, version,
|
|
6
6
|
* entry point, and permissions.
|
|
7
7
|
*/
|
|
8
|
+
import { validVersion, validRange } from './version-policy.js';
|
|
8
9
|
// ============================================================================
|
|
9
10
|
// Constants
|
|
10
11
|
// ============================================================================
|
|
11
12
|
/** Regex for valid plugin names: lowercase, alphanumeric, hyphens */
|
|
12
13
|
const VALID_NAME_REGEX = /^[a-z][a-z0-9-]*$/;
|
|
13
|
-
/** Regex for semver: major.minor.patch with optional pre-release */
|
|
14
|
-
const SEMVER_REGEX = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?$/;
|
|
15
14
|
/** Reserved name prefixes that third-party plugins cannot use */
|
|
16
15
|
const RESERVED_PREFIXES = ['aqe-core-', 'agentic-qe-core-'];
|
|
17
16
|
/** Maximum name length */
|
|
@@ -41,7 +40,7 @@ export function validateManifest(manifest) {
|
|
|
41
40
|
if (!m.version || typeof m.version !== 'string') {
|
|
42
41
|
errors.push('version is required and must be a string');
|
|
43
42
|
}
|
|
44
|
-
else if (!
|
|
43
|
+
else if (!validVersion(m.version)) {
|
|
45
44
|
errors.push(`version "${m.version}" is not valid semver (expected: major.minor.patch)`);
|
|
46
45
|
}
|
|
47
46
|
if (!m.description || typeof m.description !== 'string') {
|
|
@@ -80,6 +79,9 @@ export function validateManifest(manifest) {
|
|
|
80
79
|
if (typeof depVersion !== 'string') {
|
|
81
80
|
errors.push(`Dependency "${depName}" must have a string version range`);
|
|
82
81
|
}
|
|
82
|
+
else if (!validRange(depVersion)) {
|
|
83
|
+
errors.push(`Dependency "${depName}" has an invalid semver range`);
|
|
84
|
+
}
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
}
|
|
@@ -100,8 +102,8 @@ export function validateManifest(manifest) {
|
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
if (m.minAqeVersion !== undefined) {
|
|
103
|
-
if (typeof m.minAqeVersion !== 'string' || !
|
|
104
|
-
|
|
105
|
+
if (typeof m.minAqeVersion !== 'string' || !validVersion(m.minAqeVersion)) {
|
|
106
|
+
errors.push('minAqeVersion must be valid semver');
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
if (m.permissions !== undefined) {
|