agentic-qe 3.14.0 → 3.14.2
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 +2 -1
- package/.claude/helpers/validate-v3-config.sh +6 -5
- package/.claude/hooks/aqe-hook.cjs +14 -14
- package/.claude/skills/qe-browser/evals/qe-browser.yaml +30 -41
- package/.claude/skills/qe-browser/fixtures/serve-skills.js +37 -0
- package/.claude/skills/qe-browser/scripts/lib/vibium.js +1 -1
- package/.claude/skills/qe-browser/scripts/smoke-test.sh +56 -25
- package/.claude/skills/qe-browser/scripts/visual-diff.js +24 -15
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +114 -0
- package/assets/skills/qe-browser/evals/qe-browser.yaml +30 -41
- package/assets/skills/qe-browser/fixtures/serve-skills.js +37 -0
- package/assets/skills/qe-browser/scripts/lib/vibium.js +1 -1
- package/assets/skills/qe-browser/scripts/smoke-test.sh +56 -25
- package/assets/skills/qe-browser/scripts/visual-diff.js +24 -15
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +7 -7
- package/dist/cli/chunks/adapter-OJF6LAJV.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-JZO6VUW4.js → agent-booster-wasm-SD5N32MX.js} +2 -2
- package/dist/cli/chunks/{agent-handler-534KFGEJ.js → agent-handler-OZRSJM7F.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-B7KWLWY4.js → agent-memory-branch-NYTRANRN.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-FGT474XB.js +2 -0
- package/dist/cli/chunks/{arena-OW5MELJX.js → arena-EX3SC2DP.js} +4 -4
- package/dist/cli/chunks/{arena-7CCD3S3I.js → arena-FOTVSRK4.js} +2 -2
- package/dist/cli/chunks/{audit-BHVKN4E2.js → audit-Q5GHSUQY.js} +3 -3
- package/dist/cli/chunks/base-HH765JFV.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-P5FA6WFK.js → better-sqlite3-S7M5R2HS.js} +2 -2
- package/dist/cli/chunks/{brain-handler-WNW5LOV7.js → brain-handler-5FSA46R5.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-TVZ2ODKH.js → branch-enumerator-RWAXTGEU.js} +2 -2
- package/dist/cli/chunks/{browser-TCEB2W2F.js → browser-IGDESJGF.js} +2 -2
- package/dist/cli/chunks/browser-workflow-NPM4FUPI.js +2 -0
- package/dist/cli/chunks/{chunk-Q73RRTLE.js → chunk-2EHFEMRU.js} +2 -2
- package/dist/cli/chunks/{chunk-ZBOWR4XT.js → chunk-2H5YJ5ZK.js} +2 -2
- package/dist/cli/chunks/chunk-2LKAMMMI.js +2 -0
- package/dist/cli/chunks/{chunk-A2WZEMWT.js → chunk-2TG24LYQ.js} +1 -1
- package/dist/cli/chunks/{chunk-3QT6S3A3.js → chunk-3C2K4YMS.js} +3 -3
- package/dist/cli/chunks/{chunk-VESOYP6A.js → chunk-3DFFFXXO.js} +2 -2
- package/dist/cli/chunks/{chunk-K6CGQR5R.js → chunk-3WV4H33V.js} +1 -1
- package/dist/cli/chunks/{chunk-IL4AEB3J.js → chunk-42WUDDUU.js} +2 -2
- package/dist/cli/chunks/chunk-4AKGBUYD.js +4 -0
- package/dist/cli/chunks/{chunk-4FEJEVG7.js → chunk-4K27ESCA.js} +1 -1
- package/dist/cli/chunks/{chunk-TGOGCA74.js → chunk-4M6A3PVJ.js} +2 -2
- package/dist/cli/chunks/{chunk-RGVD6ZUX.js → chunk-4MH22236.js} +1 -1
- package/dist/cli/chunks/{chunk-6DPAMYLU.js → chunk-4N44UJGI.js} +2 -2
- package/dist/cli/chunks/{chunk-DJITEQYS.js → chunk-4PH7O5ZH.js} +2 -2
- package/dist/cli/chunks/{chunk-M3HUZD2I.js → chunk-4RT7I7PI.js} +1 -1
- package/dist/cli/chunks/chunk-4UCMTYFQ.js +65 -0
- package/dist/cli/chunks/{chunk-ZI3UO7QR.js → chunk-4ZUZDFAA.js} +2 -2
- package/dist/cli/chunks/{chunk-QSPRQPEL.js → chunk-57TNBR2P.js} +2 -2
- package/dist/cli/chunks/{chunk-ZCVJCCQQ.js → chunk-5EHLGOWW.js} +2 -2
- package/dist/cli/chunks/{chunk-ZAAYOENS.js → chunk-5WJUNRTY.js} +2 -2
- package/dist/cli/chunks/{chunk-QZPFUFZG.js → chunk-67A6PEZM.js} +2 -2
- package/dist/cli/chunks/{chunk-7BOPFN3Y.js → chunk-6EHN7Q2Q.js} +2 -2
- package/dist/cli/chunks/{chunk-2HYVOX6N.js → chunk-6F4WHN7D.js} +1 -1
- package/dist/cli/chunks/{chunk-GVEJP5T7.js → chunk-6LMLN5R2.js} +2 -2
- package/dist/cli/chunks/{chunk-QKQZ4IJF.js → chunk-6SZKLWZT.js} +5 -5
- package/dist/cli/chunks/{chunk-PEW6FZ47.js → chunk-6VKJAMZY.js} +1 -1
- package/dist/cli/chunks/{chunk-VYENTZ45.js → chunk-7AFBNU6K.js} +2 -2
- package/dist/cli/chunks/{chunk-6IJMD2ZL.js → chunk-7FWP7CZY.js} +3 -3
- package/dist/cli/chunks/{chunk-IE5LC7MB.js → chunk-7SK6IMGZ.js} +2 -2
- package/dist/cli/chunks/{chunk-3EM2MK3Z.js → chunk-A7N3YUDJ.js} +2 -2
- package/dist/cli/chunks/{chunk-J3XSHJGK.js → chunk-ADK7DF3G.js} +2 -2
- package/dist/cli/chunks/{chunk-EJ6IP7DE.js → chunk-ARMZYHYL.js} +2 -2
- package/dist/cli/chunks/{chunk-BZ4QVFP2.js → chunk-BWRHOIYC.js} +2 -2
- package/dist/cli/chunks/{chunk-A7SKM6JL.js → chunk-C7AXRI7E.js} +1 -1
- package/dist/cli/chunks/{chunk-4XTHRAUV.js → chunk-CG2MUD7U.js} +1 -1
- package/dist/cli/chunks/{chunk-HLNQDRHA.js → chunk-CH2TQCV5.js} +1 -1
- package/dist/cli/chunks/{chunk-JGROLJ33.js → chunk-CIESXO73.js} +1 -1
- package/dist/cli/chunks/{chunk-AR6SATU3.js → chunk-CJCT452S.js} +2 -2
- package/dist/cli/chunks/{chunk-UUJ5VQJM.js → chunk-CJHVOBJY.js} +1 -1
- package/dist/cli/chunks/{chunk-VOSISOFD.js → chunk-CTCQOYBS.js} +1 -1
- package/dist/cli/chunks/{chunk-XITTURP2.js → chunk-D4RCV4LY.js} +2 -2
- package/dist/cli/chunks/{chunk-5XGVSQS2.js → chunk-DRO5NJZA.js} +2 -2
- package/dist/cli/chunks/{chunk-QMMDN4WX.js → chunk-DVHWLAEO.js} +3 -3
- package/dist/cli/chunks/{chunk-5LEAGKX5.js → chunk-DW6ZMNMR.js} +2 -2
- package/dist/cli/chunks/{chunk-ZBKGX72B.js → chunk-E3Q7WNJD.js} +3 -3
- package/dist/cli/chunks/{chunk-5MZF4N4Q.js → chunk-EAJK25IS.js} +1 -1
- package/dist/cli/chunks/{chunk-3RYTAYR6.js → chunk-EH5OCHAJ.js} +1 -1
- package/dist/cli/chunks/{chunk-UI6WSPEK.js → chunk-F2KRT2II.js} +3 -3
- package/dist/cli/chunks/{chunk-NDPQ2WPU.js → chunk-FPHPP5TQ.js} +1 -1
- package/dist/cli/chunks/{chunk-WWWX76QB.js → chunk-FREF6Y4L.js} +2 -2
- package/dist/cli/chunks/{chunk-SROZXIMT.js → chunk-FVGTINVR.js} +54 -54
- package/dist/cli/chunks/{chunk-H3YDDKBW.js → chunk-G2CLZVYI.js} +3 -3
- package/dist/cli/chunks/{chunk-2O4DDPEA.js → chunk-G6AV2HGY.js} +3 -3
- package/dist/cli/chunks/{chunk-ENGKLFLY.js → chunk-GHQ5PUOV.js} +2 -2
- package/dist/cli/chunks/{chunk-NKWO2X3T.js → chunk-GHUPID5E.js} +1 -1
- package/dist/cli/chunks/{chunk-S5YVLPXU.js → chunk-GJAWEUIN.js} +2 -2
- package/dist/cli/chunks/{chunk-6IZQSLYZ.js → chunk-HBTC4L53.js} +2 -2
- package/dist/cli/chunks/{chunk-DDPJUAXQ.js → chunk-HSJ5FQCF.js} +2 -2
- package/dist/cli/chunks/{chunk-OONCRNFA.js → chunk-HZ6NEJMO.js} +2 -2
- package/dist/cli/chunks/{chunk-LCSVROU7.js → chunk-HZMLNM2T.js} +10 -10
- package/dist/cli/chunks/{chunk-JY4VZ6BN.js → chunk-ICKLBATY.js} +2 -2
- package/dist/cli/chunks/{chunk-JMKMDSXG.js → chunk-IUNMW454.js} +2 -2
- package/dist/cli/chunks/{chunk-XXFKN7LB.js → chunk-IVGVOGIZ.js} +1 -1
- package/dist/cli/chunks/{chunk-3GUO4ERR.js → chunk-IWFL6EFI.js} +2 -2
- package/dist/cli/chunks/{chunk-FRL3X2QA.js → chunk-JDXLCNKV.js} +2 -2
- package/dist/cli/chunks/{chunk-YW4RNZWT.js → chunk-JIUF6NV6.js} +2 -2
- package/dist/cli/chunks/{chunk-JAK5UUWH.js → chunk-JQ2ZD3WO.js} +2 -2
- package/dist/cli/chunks/{chunk-YEAC3DC6.js → chunk-K574FLVB.js} +2 -2
- package/dist/cli/chunks/{chunk-LZHTCUCO.js → chunk-KEEBUVGV.js} +2 -2
- package/dist/cli/chunks/{chunk-LKR7T3OZ.js → chunk-KFXZDQ5J.js} +1 -1
- package/dist/cli/chunks/{chunk-7OUMJCJT.js → chunk-KPFG4OIM.js} +1 -1
- package/dist/cli/chunks/{chunk-HQ7243G3.js → chunk-KZOBLLXW.js} +2 -2
- package/dist/cli/chunks/{chunk-R6WJF4D5.js → chunk-L2F7FVIU.js} +2 -2
- package/dist/cli/chunks/{chunk-VRRG66XB.js → chunk-LML5VTFK.js} +1 -1
- package/dist/cli/chunks/{chunk-JTWJR2KY.js → chunk-LWUJQGCS.js} +2 -2
- package/dist/cli/chunks/{chunk-BQCTO7UB.js → chunk-MH73D5TN.js} +2 -2
- package/dist/cli/chunks/{chunk-U4GZWPKM.js → chunk-MWQTACNA.js} +2 -2
- package/dist/cli/chunks/{chunk-CIZ6LSNV.js → chunk-N3RN4QTC.js} +2 -2
- package/dist/cli/chunks/{chunk-ZQSXG7FA.js → chunk-N5ZRUOMR.js} +2 -2
- package/dist/cli/chunks/{chunk-AFGT26NR.js → chunk-NAZVPZJS.js} +2 -2
- package/dist/cli/chunks/{chunk-FOHYBR3O.js → chunk-NG2UVPTW.js} +1 -1
- package/dist/cli/chunks/{chunk-2D7UBX5S.js → chunk-NHHWLJQF.js} +1 -1
- package/dist/cli/chunks/{chunk-JRKEBESE.js → chunk-NNOMDM4N.js} +2 -2
- package/dist/cli/chunks/{chunk-YKWMKRYB.js → chunk-NRR23SJV.js} +1 -1
- package/dist/cli/chunks/{chunk-WKNWRDA5.js → chunk-NWFIJNEB.js} +1 -1
- package/dist/cli/chunks/{chunk-4MK2G6TK.js → chunk-OBCKP3G4.js} +2 -2
- package/dist/cli/chunks/{chunk-YKZV7O65.js → chunk-OC2CKU7I.js} +2 -2
- package/dist/cli/chunks/{chunk-7RVAHJQZ.js → chunk-OX6T26CD.js} +3 -3
- package/dist/cli/chunks/chunk-P64DMQ2C.js +2 -0
- package/dist/cli/chunks/{chunk-RKUYVVGJ.js → chunk-PFXX5Q32.js} +2 -2
- package/dist/cli/chunks/chunk-PHHXHG2W.js +2 -0
- package/dist/cli/chunks/{chunk-N2YAUDAV.js → chunk-PMUBG2RU.js} +2 -2
- package/dist/cli/chunks/{chunk-WTHAVFIC.js → chunk-PVHO6KLB.js} +1 -1
- package/dist/cli/chunks/{chunk-MO7EITJK.js → chunk-PWEIDHT7.js} +2 -2
- package/dist/cli/chunks/{chunk-52DFCV57.js → chunk-PZKZY6PB.js} +2 -2
- package/dist/cli/chunks/{chunk-I3VHXA2W.js → chunk-Q335R4MR.js} +2 -2
- package/dist/cli/chunks/{chunk-ECTPFCON.js → chunk-Q3JHS3UD.js} +2 -2
- package/dist/cli/chunks/{chunk-HJIAVR6P.js → chunk-QFUX7ELG.js} +2 -2
- package/dist/cli/chunks/{chunk-L4C42WYI.js → chunk-QW4LN5NK.js} +2 -2
- package/dist/cli/chunks/{chunk-HQHLHSJO.js → chunk-QXTW7XCS.js} +2 -2
- package/dist/cli/chunks/{chunk-SSV6KSFT.js → chunk-R5RNOLHI.js} +1 -1
- package/dist/cli/chunks/{chunk-AVLA5PBJ.js → chunk-RCI64RIJ.js} +2 -2
- package/dist/cli/chunks/{chunk-T3BZAFLP.js → chunk-RFNEHNJV.js} +1 -1
- package/dist/cli/chunks/{chunk-IL6QRXRP.js → chunk-RGH3WGWD.js} +10 -10
- package/dist/cli/chunks/{chunk-E4NU4BJA.js → chunk-RHJVDCLV.js} +2 -2
- package/dist/cli/chunks/{chunk-KTSCZ7AW.js → chunk-RVCWSAXI.js} +2 -2
- package/dist/cli/chunks/{chunk-TQJE7DNL.js → chunk-RYJHREYS.js} +2 -2
- package/dist/cli/chunks/{chunk-HNKPLVYS.js → chunk-S4MR6RTE.js} +1 -1
- package/dist/cli/chunks/{chunk-6AYO3IR2.js → chunk-S7N4BKI3.js} +2 -2
- package/dist/cli/chunks/{chunk-2NO4H35K.js → chunk-SEHCX4NH.js} +1 -1
- package/dist/cli/chunks/{chunk-GKNDP5VK.js → chunk-T46LOLW3.js} +2 -2
- package/dist/cli/chunks/{chunk-VXU53F7Z.js → chunk-T4C56HBW.js} +2 -2
- package/dist/cli/chunks/{chunk-43GPSYAL.js → chunk-TENYL5TI.js} +2 -2
- package/dist/cli/chunks/{chunk-6AOZU3UN.js → chunk-TLPL3EQY.js} +2 -2
- package/dist/cli/chunks/{chunk-4ZVGSVHV.js → chunk-TYVQNYXX.js} +4 -4
- package/dist/cli/chunks/{chunk-NOPVFBQM.js → chunk-U2AY57XZ.js} +2 -2
- package/dist/cli/chunks/{chunk-IQLRA4FV.js → chunk-U54OOA24.js} +1 -1
- package/dist/cli/chunks/{chunk-IQ3JFHZN.js → chunk-UHTAI4ZB.js} +1 -1
- package/dist/cli/chunks/{chunk-KDIZQHG5.js → chunk-UIGEUEBT.js} +2 -2
- package/dist/cli/chunks/{chunk-5VDVYTO5.js → chunk-UYTWDS2R.js} +2 -2
- package/dist/cli/chunks/{chunk-ZNSMVQCG.js → chunk-VNAKBHJI.js} +2 -2
- package/dist/cli/chunks/{chunk-SUSMHSXT.js → chunk-VOYJJ3KA.js} +2 -2
- package/dist/cli/chunks/{chunk-QQCENKCX.js → chunk-VSYBMNIR.js} +1 -1
- package/dist/cli/chunks/{chunk-7RAB2BZY.js → chunk-W2FLULF4.js} +2 -2
- package/dist/cli/chunks/{chunk-NYARYONH.js → chunk-W4OQYLYO.js} +1 -1
- package/dist/cli/chunks/{chunk-DOWCOZDO.js → chunk-WBH4C4BG.js} +2 -2
- package/dist/cli/chunks/{chunk-OIYUSWHX.js → chunk-WBMRADQP.js} +1 -1
- package/dist/cli/chunks/{chunk-B3H4K7CY.js → chunk-WMW47QMR.js} +2 -2
- package/dist/cli/chunks/{chunk-VPVZHJSU.js → chunk-WVY22NHZ.js} +2 -2
- package/dist/cli/chunks/{chunk-6W42XWLL.js → chunk-WXMSRBQF.js} +2 -2
- package/dist/cli/chunks/{chunk-CIUOC5F3.js → chunk-XPLSLHRB.js} +1 -1
- package/dist/cli/chunks/{chunk-E722WNWC.js → chunk-YF5OP6CR.js} +2 -2
- package/dist/cli/chunks/{chunk-H76TV4UU.js → chunk-YN6W2XIT.js} +3 -3
- package/dist/cli/chunks/{chunk-FF43SRP6.js → chunk-ZCDXJ27H.js} +1 -1
- package/dist/cli/chunks/{chunk-TKYEP7OR.js → chunk-ZFGND4QK.js} +1 -1
- package/dist/cli/chunks/{chunk-O2MZZL54.js → chunk-ZWRQ5VAU.js} +2 -2
- package/dist/cli/chunks/{chunk-H6NFDOMK.js → chunk-ZYLSOBOR.js} +1 -1
- package/dist/cli/chunks/{ci-B432UH6N.js → ci-NTRH7PAW.js} +2 -2
- package/dist/cli/chunks/{ci-output-GTHH7WYG.js → ci-output-F57RSD35.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-VW75DLME.js → circuit-breaker-4WST3QSA.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-RE3IVT7U.js → claude-flow-setup-KB4TKMYI.js} +2 -2
- package/dist/cli/chunks/client-GPZEC54E.js +2 -0
- package/dist/cli/chunks/{cline-installer-NUBZZ55N.js → cline-installer-W2ZHQ6WM.js} +2 -2
- package/dist/cli/chunks/{code-K6JCWKNW.js → code-TF2AVR5D.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-I4ILB5JN.js → code-index-extractor-RMDRUVQJ.js} +2 -2
- package/dist/cli/chunks/codex-installer-VSTRHJHV.js +14 -0
- package/dist/cli/chunks/{completions-V3KJVJF4.js → completions-3Q37QVFR.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-HRG7OOY3.js → complexity-analyzer-3FNFLACD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-CNTDONWG.js → continuedev-installer-VTEXM455.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-XPWWIWYA.js → copilot-installer-AGY7DQUS.js} +2 -2
- package/dist/cli/chunks/core-handlers-YMGHYIBR.js +2 -0
- package/dist/cli/chunks/{cost-tracker-MFNLQ56K.js → cost-tracker-LTZAQBX7.js} +2 -2
- package/dist/cli/chunks/{coverage-KOIK654V.js → coverage-TT64IOS4.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-ECBNTGYJ.js +2 -0
- package/dist/cli/chunks/{cursor-installer-S5MKLRQQ.js → cursor-installer-OVOJIOHN.js} +2 -2
- package/dist/cli/chunks/{daemon-DUS6JYW6.js → daemon-DMFZMXKA.js} +8 -8
- package/dist/cli/chunks/{daemon-Z7VPGWHY.js → daemon-XCULEHWY.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-7CQ3ARNI.js → dag-attention-scheduler-WW2RX4B5.js} +2 -2
- package/dist/cli/chunks/{detect-WORBCAYF.js → detect-QNWIM232.js} +2 -2
- package/dist/cli/chunks/{dist-node-KRNI6OYW.js → dist-node-6GQIY3CG.js} +2 -2
- package/dist/cli/chunks/{domain-handler-KRUR2VQG.js → domain-handler-6RJPDELX.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-VEOVLV54.js → domain-transfer-WK524LBS.js} +2 -2
- package/dist/cli/chunks/dream-EHGKCFWH.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-QU3NQVA5.js → embed-and-insert-pattern-SO6GWJW7.js} +2 -2
- package/dist/cli/chunks/{eval-AYQ7BSUP.js → eval-GL544IPO.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-AWQBL6LT.js → experience-capture-middleware-BCCJ35OX.js} +3 -3
- package/dist/cli/chunks/{fast-paths-V5EL4BYJ.js → fast-paths-CATDDBEU.js} +2 -2
- package/dist/cli/chunks/{feature-flags-P34BPRWU.js → feature-flags-BUXNAORY.js} +2 -2
- package/dist/cli/chunks/{feature-flags-BXX7BP22.js → feature-flags-KNNWWP5G.js} +2 -2
- package/dist/cli/chunks/{file-discovery-MS6BKQ2U.js → file-discovery-S4HF3O7D.js} +2 -2
- package/dist/cli/chunks/{fleet-7WVVPA4W.js → fleet-DQVQQONW.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-7WQ3LEPG.js → gnn-wrapper-G7ABZUG7.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-P7QD3BZH.js → heartbeat-handler-UFMELIWT.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-UFEL2CBW.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-BLSD45CX.js +2 -0
- package/dist/cli/chunks/hnsw-index-A3RZODEN.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-Y3GAR3UP.js → hnsw-legacy-bridge-YIILSRXI.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-5QUXZQWQ.js → hnswlib-node-TSVRMXDH.js} +2 -2
- package/dist/cli/chunks/{hooks-2D64KPRY.js → hooks-OHQPNK74.js} +10 -10
- package/dist/cli/chunks/{hypergraph-engine-5INXEZDP.js → hypergraph-engine-LY7PJDSL.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-YJJJ3ESZ.js → hypergraph-handler-YGDYZO6H.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-OXHD3FOH.js +2 -0
- package/dist/cli/chunks/{init-handler-QSFYJN5Q.js → init-handler-MTK65LI3.js} +9 -8
- package/dist/cli/chunks/init-wizard-PKZL7QBU.js +2 -0
- package/dist/cli/chunks/kernel-XWPM72UJ.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-3N3QGTJU.js → kilocode-installer-3IICU4RS.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-GIWVTFZQ.js → kiro-installer-MXOVQYQA.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-FRKR5XWI.js +2 -0
- package/dist/cli/chunks/{learning-SGO2DQ5Q.js → learning-EV5LSOOM.js} +3 -3
- package/dist/cli/chunks/{llm-router-HBBULO65.js → llm-router-7LYDJUOT.js} +4 -4
- package/dist/cli/chunks/llm-router-service-R7A5HHDM.js +2 -0
- package/dist/cli/chunks/{load-B5OFYB4H.js → load-F4PVAMXQ.js} +2 -2
- package/dist/cli/chunks/load-test-5IKDWSYL.js +2 -0
- package/dist/cli/chunks/{mcp-FG3LNQR4.js → mcp-DUYJUEME.js} +2 -2
- package/dist/cli/chunks/{memory-SPS7ZWLC.js → memory-XTTYORAS.js} +5 -5
- package/dist/cli/chunks/memory-backend-7VW5QCMO.js +2 -0
- package/dist/cli/chunks/{memory-handlers-P7FTPWP3.js → memory-handlers-VZH3R2TQ.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-PUB7E6KH.js → multi-model-executor-R6XCTMCF.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-TGCSGVG2.js → opencode-installer-33ULBU2F.js} +2 -2
- package/dist/cli/chunks/{orchestrator-S5FTJFGB.js → orchestrator-34ZJEKTJ.js} +22 -21
- package/dist/cli/chunks/pattern-null-store-BU6LCB2W.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-LCXXGRAB.js → pattern-usage-recorder-GZ2M3F2E.js} +2 -2
- package/dist/cli/chunks/{pipeline-ENOSRHKW.js → pipeline-SR5OTY45.js} +2 -2
- package/dist/cli/chunks/platform-VKJFJIAW.js +2 -0
- package/dist/cli/chunks/{plugin-JZ5ODJSU.js → plugin-5C5UBQUQ.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-DPJUPNCG.js → prime-radiant-advanced-wasm-KO2PQI3D.js} +2 -2
- package/dist/cli/chunks/protocol-executor-BSP5LWJN.js +2 -0
- package/dist/cli/chunks/{protocol-handler-IP4NLVY3.js → protocol-handler-ZF74NIKA.js} +2 -2
- package/dist/cli/chunks/{prove-P6FM4RU7.js → prove-MO5TQQU4.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-J2RC7P25.js +2 -0
- package/dist/cli/chunks/{quality-UHP4XO26.js → quality-EYIN6AER.js} +2 -2
- package/dist/cli/chunks/quality-gate-V6OQM57O.js +7 -0
- package/dist/cli/chunks/queen-coordinator-XI5AJV2V.js +2 -0
- package/dist/cli/chunks/{real-embeddings-6SO5MFRQ.js → real-embeddings-AR7TZX7U.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-WTWUOFCH.js → roocode-installer-46E626VZ.js} +2 -2
- package/dist/cli/chunks/router-VXQYYA3D.js +2 -0
- package/dist/cli/chunks/routing-feedback-HZQTASFF.js +2 -0
- package/dist/cli/chunks/{routing-handler-IK7HYERQ.js → routing-handler-ZNRVW6QW.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-THLB4NIM.js → ruvector-commands-4L2CQMWS.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-BDTLLJER.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-IB343MDN.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-BUKCSHBD.js → rvf-migration-coordinator-H4RVGBIA.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-Y7SN7LHU.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-ECTADZIN.js → rvf-store-integrity-OJGWWPLL.js} +2 -2
- package/dist/cli/chunks/safe-db-2VTKKBJU.js +2 -0
- package/dist/cli/chunks/schedule-QJ4CFGJY.js +2 -0
- package/dist/cli/chunks/scheduler-2NHDQPC3.js +2 -0
- package/dist/cli/chunks/{security-HN4UXFXX.js → security-JF3BVNRO.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-XJCPX5SN.js → shared-rvf-adapter-M6NNIZ5W.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-23X5PNY5.js → shared-rvf-dual-writer-LHMFCYVE.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-NVVAPZN3.js +2 -0
- package/dist/cli/chunks/{status-handler-ZXANTHKT.js → status-handler-GMIOXQIE.js} +2 -2
- package/dist/cli/chunks/{structural-health-LR6WI3AH.js → structural-health-YZXHVHM6.js} +2 -2
- package/dist/cli/chunks/{sync-I5IUJF33.js → sync-GMPCPV5L.js} +2 -2
- package/dist/cli/chunks/{sync-4OEI3BC2.js → sync-N56UQGCS.js} +2 -2
- package/dist/cli/chunks/{task-handler-R3ATJKU5.js → task-handler-VTNRGAXP.js} +2 -2
- package/dist/cli/chunks/{task-handlers-4X357AEW.js → task-handlers-FYSDH55N.js} +3 -3
- package/dist/cli/chunks/{test-PR2B5H2F.js → test-GQNCKRSP.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-ZNOSQVLD.js → test-scheduling-GPRXSIRP.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-LYXOI72S.js → token-bootstrap-76SRNXGG.js} +2 -2
- package/dist/cli/chunks/{token-usage-R6EQZBX2.js → token-usage-O7CZDP5Q.js} +2 -2
- package/dist/cli/chunks/{transformers-COQWK27J.js → transformers-LTU4LSSC.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-LLIW2X3M.js → tree-sitter-wasm-parser-NQSQCMBM.js} +2 -2
- package/dist/cli/chunks/{types-MEYTZITK.js → types-OP6IWE6N.js} +2 -2
- package/dist/cli/chunks/unified-memory-DSTIEDSH.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-KBV3P4OS.js +2 -0
- package/dist/cli/chunks/unified-persistence-XKCOUBKY.js +2 -0
- package/dist/cli/chunks/{upgrade-DVIJ456A.js → upgrade-OQWRBZ3R.js} +2 -2
- package/dist/cli/chunks/{validate-UYTSMJ5X.js → validate-TH5SRP3E.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-P32WCJR6.js → validate-swarm-UITL2JUS.js} +2 -2
- package/dist/cli/chunks/{vibium-JGVOLM6X.js → vibium-O6PRAG4J.js} +2 -2
- package/dist/cli/chunks/visual-security-TTWSPZTZ.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-5ZGNCTPN.js → web-tree-sitter-XBFBY4OF.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-IILSSQAE.js → windsurf-installer-DVT5NRNY.js} +2 -2
- package/dist/cli/chunks/witness-chain-2KY73HPN.js +2 -0
- package/dist/cli/chunks/{witness-chain-JZMXCG3B.js → witness-chain-VRSH2F36.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-UUTLNUIH.js → witness-key-manager-GFHRDKQ4.js} +2 -2
- package/dist/cli/chunks/{workflow-NS7HXVHZ.js → workflow-HAZ6YKOG.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-UK56AVOT.js +2 -0
- package/dist/cli/chunks/{wrappers-XKEDSV5W.js → wrappers-5LLLT7GM.js} +2 -2
- package/dist/cli/commands/daemon.js +3 -0
- package/dist/cli/commands/platform.d.ts +1 -0
- package/dist/cli/commands/platform.js +28 -6
- package/dist/cli/commands/quality-gate.js +25 -3
- package/dist/cli/foreground-command.d.ts +3 -0
- package/dist/cli/foreground-command.js +22 -0
- package/dist/cli/handlers/init-handler.d.ts +5 -0
- package/dist/cli/handlers/init-handler.js +6 -0
- package/dist/cli/index.js +8 -1
- package/dist/contracts/verdicts.d.ts +625 -0
- package/dist/contracts/verdicts.js +202 -14
- package/dist/coordination/handlers/coverage-handlers.js +8 -1
- package/dist/domains/chaos-resilience/diagnosis/corpus.d.ts +5 -0
- package/dist/domains/chaos-resilience/diagnosis/corpus.js +141 -0
- package/dist/domains/chaos-resilience/diagnosis/detectors.d.ts +11 -0
- package/dist/domains/chaos-resilience/diagnosis/detectors.js +109 -0
- package/dist/domains/chaos-resilience/diagnosis/index.d.ts +5 -0
- package/dist/domains/chaos-resilience/diagnosis/index.js +5 -0
- package/dist/domains/chaos-resilience/diagnosis/scorer.d.ts +8 -0
- package/dist/domains/chaos-resilience/diagnosis/scorer.js +128 -0
- package/dist/domains/chaos-resilience/diagnosis/types.d.ts +171 -0
- package/dist/domains/chaos-resilience/diagnosis/types.js +3 -0
- package/dist/domains/chaos-resilience/index.d.ts +1 -0
- package/dist/domains/chaos-resilience/index.js +1 -0
- package/dist/domains/index.d.ts +1 -0
- package/dist/domains/index.js +1 -0
- package/dist/early-exit/early-exit-controller.d.ts +4 -2
- package/dist/early-exit/early-exit-controller.js +95 -7
- package/dist/early-exit/index.d.ts +1 -1
- package/dist/early-exit/speculative-executor.js +3 -0
- package/dist/early-exit/types.d.ts +51 -0
- package/dist/early-exit/types.js +3 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/init/browser-engine-installer.d.ts +11 -0
- package/dist/init/browser-engine-installer.js +35 -5
- package/dist/init/codex-installer.d.ts +11 -1
- package/dist/init/codex-installer.js +90 -24
- package/dist/init/init-wizard-hooks.js +11 -11
- package/dist/init/orchestrator.js +2 -0
- package/dist/init/phases/07-hooks.d.ts +3 -3
- package/dist/init/phases/07-hooks.js +19 -18
- package/dist/init/phases/09-assets.d.ts +4 -0
- package/dist/init/phases/09-assets.js +13 -10
- package/dist/init/phases/phase-interface.d.ts +2 -0
- package/dist/init/types.d.ts +4 -0
- package/dist/learning/index.d.ts +3 -0
- package/dist/learning/index.js +2 -0
- package/dist/learning/pattern-mutation-error.d.ts +9 -0
- package/dist/learning/pattern-mutation-error.js +14 -0
- package/dist/learning/pattern-store.js +24 -2
- package/dist/learning/qe-reasoning-bank.js +24 -5
- package/dist/learning/rvf-pattern-store.js +23 -5
- package/dist/learning/structural-retrieval/corpus.d.ts +5 -0
- package/dist/learning/structural-retrieval/corpus.js +97 -0
- package/dist/learning/structural-retrieval/evaluate.d.ts +7 -0
- package/dist/learning/structural-retrieval/evaluate.js +124 -0
- package/dist/learning/structural-retrieval/index.d.ts +6 -0
- package/dist/learning/structural-retrieval/index.js +4 -0
- package/dist/learning/structural-retrieval/receipt.d.ts +14 -0
- package/dist/learning/structural-retrieval/receipt.js +36 -0
- package/dist/learning/structural-retrieval/types.d.ts +83 -0
- package/dist/learning/structural-retrieval/types.js +2 -0
- package/dist/mcp/bundle.js +423 -423
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/protocol-server.js +11 -2
- package/dist/mcp/qe-tool-bridge.js +1 -0
- package/dist/mcp/services/session-resume.d.ts +15 -19
- package/dist/mcp/services/session-resume.js +204 -194
- package/dist/mcp/tool-annotations.d.ts +25 -0
- package/dist/mcp/tool-annotations.js +75 -0
- package/dist/mcp/tool-registry.js +17 -12
- package/dist/mcp/tools/base.d.ts +7 -1
- package/dist/mcp/tools/base.js +8 -0
- package/dist/mcp/tools/quality-assessment/gate.d.ts +8 -5
- package/dist/mcp/tools/quality-assessment/gate.js +9 -4
- package/dist/mcp/tools/registry.d.ts +3 -0
- package/dist/mcp/tools/registry.js +1 -0
- package/dist/mcp/types.d.ts +15 -0
- package/dist/skills/qe-court/cli.js +0 -0
- package/dist/validation/quality-gate-runner.d.ts +27 -4
- package/dist/validation/quality-gate-runner.js +33 -4
- package/dist/validation/verification-reach.d.ts +90 -0
- package/dist/validation/verification-reach.js +187 -0
- package/dist/verification/adversarial-verify/index.d.ts +1 -1
- package/dist/verification/adversarial-verify/measurement-receipt.d.ts +13 -0
- package/dist/verification/adversarial-verify/measurement-receipt.js +136 -0
- package/dist/verification/adversarial-verify/synthesize.js +7 -10
- package/dist/verification/adversarial-verify/types.d.ts +35 -0
- package/dist/verification/adversarial-verify/verify.js +6 -1
- package/package.json +9 -5
- package/schemas/coverage-gap.schema.json +41 -0
- package/schemas/finding-verdict.schema.json +470 -0
- package/schemas/risk-decision.schema.json +41 -0
- package/dist/cli/chunks/adapter-3VBXL7DO.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-NXRNKJNA.js +0 -2
- package/dist/cli/chunks/base-F6GMOKU2.js +0 -2
- package/dist/cli/chunks/browser-workflow-QRDC46LR.js +0 -2
- package/dist/cli/chunks/chunk-3JIJBR4V.js +0 -2
- package/dist/cli/chunks/chunk-R2B6EE45.js +0 -2
- package/dist/cli/chunks/chunk-TRDEULS7.js +0 -4
- package/dist/cli/chunks/chunk-WJXHE52V.js +0 -65
- package/dist/cli/chunks/client-HNBZUEVV.js +0 -2
- package/dist/cli/chunks/codex-installer-AKQ5BCHU.js +0 -15
- package/dist/cli/chunks/core-handlers-TB7NLYXL.js +0 -2
- package/dist/cli/chunks/cross-domain-router-MDSI553U.js +0 -2
- package/dist/cli/chunks/dream-X7ISHFEE.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-2C5XGFQT.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-KCVMXLUL.js +0 -2
- package/dist/cli/chunks/hnsw-index-OGWZS6MP.js +0 -2
- package/dist/cli/chunks/impact-analyzer-IBJ43GQL.js +0 -2
- package/dist/cli/chunks/init-wizard-6XMFD5LP.js +0 -2
- package/dist/cli/chunks/kernel-UDUMUPB3.js +0 -2
- package/dist/cli/chunks/knowledge-graph-JRYTUG3W.js +0 -2
- package/dist/cli/chunks/llm-router-service-KF5ZALUQ.js +0 -2
- package/dist/cli/chunks/load-test-LHMBCNCH.js +0 -2
- package/dist/cli/chunks/memory-backend-WZHKHBZK.js +0 -2
- package/dist/cli/chunks/pattern-null-store-UZSHCRL2.js +0 -2
- package/dist/cli/chunks/platform-WCRBO3Z7.js +0 -2
- package/dist/cli/chunks/protocol-executor-42NLVDTC.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-W74RSMMU.js +0 -2
- package/dist/cli/chunks/quality-gate-63DDBSGM.js +0 -7
- package/dist/cli/chunks/queen-coordinator-XELKSRMS.js +0 -2
- package/dist/cli/chunks/router-GTW2EQZV.js +0 -2
- package/dist/cli/chunks/routing-feedback-NVOBWEMK.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-5OPVMXNL.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-5S4YFTX4.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-LYSJHEVX.js +0 -2
- package/dist/cli/chunks/safe-db-AEB3JMLD.js +0 -2
- package/dist/cli/chunks/schedule-4QNPCQNT.js +0 -2
- package/dist/cli/chunks/scheduler-S3DFHX6A.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-L2KISU2H.js +0 -2
- package/dist/cli/chunks/unified-memory-5KQMA7FV.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-PQRPTYOD.js +0 -2
- package/dist/cli/chunks/unified-persistence-YDONVPJB.js +0 -2
- package/dist/cli/chunks/visual-security-RJ7RTNGJ.js +0 -2
- package/dist/cli/chunks/witness-chain-YXXXNGAM.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-5KUAVSTH.js +0 -2
package/dist/mcp/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Model Context Protocol server and tools
|
|
4
4
|
*/
|
|
5
5
|
export * from './types';
|
|
6
|
+
export { CONSERVATIVE_TOOL_ANNOTATIONS, BUILT_IN_TOOL_NAMES, BUILT_IN_TOOL_SAFETY_INVENTORY, getBuiltInToolAnnotations, getBuiltInToolSafetyInventory, resolveToolAnnotations, type ResolvedToolAnnotations, } from './tool-annotations';
|
|
6
7
|
export { ToolRegistry, createToolRegistry } from './tool-registry';
|
|
7
8
|
export { getConnectionPool, initializeConnectionPool, shutdownConnectionPool, createConnectionPool, type PoolConnection, type ConnectionMetrics, type ConnectionPoolConfig, type PoolStats, DEFAULT_POOL_CONFIG, } from './connection-pool';
|
|
8
9
|
export { getLoadBalancer, resetLoadBalancer, createLoadBalancer, type AgentLoadInfo, type LoadBalancingStrategy, type LoadBalancerConfig, type LoadBalancerStats, DEFAULT_LOAD_BALANCER_CONFIG, } from './load-balancer';
|
package/dist/mcp/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// Types
|
|
6
6
|
export * from './types.js';
|
|
7
|
+
export { CONSERVATIVE_TOOL_ANNOTATIONS, BUILT_IN_TOOL_NAMES, BUILT_IN_TOOL_SAFETY_INVENTORY, getBuiltInToolAnnotations, getBuiltInToolSafetyInventory, resolveToolAnnotations, } from './tool-annotations.js';
|
|
7
8
|
// Tool Registry (O(1) hash-indexed lookup via Map)
|
|
8
9
|
export { ToolRegistry, createToolRegistry } from './tool-registry.js';
|
|
9
10
|
// Connection Pool (ADR-039)
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { createStdioTransport, JSON_RPC_ERRORS, isJsonRpcCodedError, McpError, } from './transport/index.js';
|
|
9
9
|
import { createToolRegistry } from './tool-registry.js';
|
|
10
|
+
import { resolveToolAnnotations } from './tool-annotations.js';
|
|
10
11
|
import { MiddlewareChain } from './middleware/middleware-chain.js';
|
|
11
12
|
import { createMicrocompactMiddleware } from './middleware/microcompact.js';
|
|
12
13
|
import { SessionStore } from './services/session-store.js';
|
|
@@ -374,6 +375,7 @@ export class MCPProtocolServer {
|
|
|
374
375
|
const tools = Array.from(this.tools.values()).map((entry) => ({
|
|
375
376
|
name: entry.definition.name,
|
|
376
377
|
description: entry.definition.description,
|
|
378
|
+
annotations: entry.definition.annotations,
|
|
377
379
|
inputSchema: this.buildInputSchema(entry.definition),
|
|
378
380
|
}));
|
|
379
381
|
return { tools };
|
|
@@ -1446,8 +1448,15 @@ export class MCPProtocolServer {
|
|
|
1446
1448
|
console.error(`[MCP] Registered ${this.tools.size} tools (${bridgedCount} via QE bridge)`);
|
|
1447
1449
|
}
|
|
1448
1450
|
registerTool(entry) {
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
+
const normalizedEntry = {
|
|
1452
|
+
...entry,
|
|
1453
|
+
definition: {
|
|
1454
|
+
...entry.definition,
|
|
1455
|
+
annotations: resolveToolAnnotations(entry.definition.name, entry.definition.annotations),
|
|
1456
|
+
},
|
|
1457
|
+
};
|
|
1458
|
+
this.tools.set(normalizedEntry.definition.name, normalizedEntry);
|
|
1459
|
+
this.registry.register(normalizedEntry.definition, normalizedEntry.handler);
|
|
1451
1460
|
}
|
|
1452
1461
|
buildInputSchema(definition) {
|
|
1453
1462
|
const properties = {};
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agentic QE v3 - Session Resume Service
|
|
3
|
-
*
|
|
4
|
-
* IMP-04: Transcript-First Session Durability
|
|
5
|
-
* Reads an existing JSONL session file by sampling the head (first 4KB)
|
|
6
|
-
* and tail (last 64KB) to reconstruct metadata and recent entries
|
|
7
|
-
* without reading the entire file.
|
|
8
|
-
*
|
|
9
|
-
* @module mcp/services/session-resume
|
|
10
|
-
*/
|
|
11
1
|
import type { SessionEntry, SessionMetadata } from './session-store';
|
|
2
|
+
export type SessionRecoveryDisposition = 'MISSING' | 'EMPTY' | 'LEGACY_UNVERIFIED' | 'INVALID' | 'UNTRUSTED' | 'RESOURCE_LIMIT';
|
|
3
|
+
export interface SessionResumeOptions {
|
|
4
|
+
/** Canonical directory that must contain the session file. */
|
|
5
|
+
sessionRoot: string;
|
|
6
|
+
/** Explicit compatibility opt-in; legacy JSONL has no commit proof. */
|
|
7
|
+
allowLegacyUnverified?: boolean;
|
|
8
|
+
maxFileBytes?: number;
|
|
9
|
+
maxRecordBytes?: number;
|
|
10
|
+
maxRecords?: number;
|
|
11
|
+
}
|
|
12
12
|
export interface SessionResumeResult {
|
|
13
13
|
metadata: SessionMetadata;
|
|
14
14
|
recentEntries: SessionEntry[];
|
|
15
15
|
lastState: 'idle' | 'running' | 'requires_action';
|
|
16
16
|
canResume: boolean;
|
|
17
|
+
disposition: SessionRecoveryDisposition;
|
|
18
|
+
diagnostics: string[];
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Reads the first 4KB (head) to extract session start metadata and
|
|
22
|
-
* the last 64KB (tail) to get recent entries. Parses JSONL lines,
|
|
23
|
-
* reconstructs the parentUuid linked list, and returns metadata +
|
|
24
|
-
* recent entries + resume capability.
|
|
25
|
-
*
|
|
26
|
-
* Corrupt or incomplete lines are skipped gracefully.
|
|
21
|
+
* Inspect a legacy transcript through one no-follow descriptor. Automatic
|
|
22
|
+
* resume requires an explicit opt-in because this format has no commit marker.
|
|
27
23
|
*/
|
|
28
|
-
export declare function resumeSession(filePath: string): SessionResumeResult;
|
|
24
|
+
export declare function resumeSession(filePath: string, options: SessionResumeOptions): SessionResumeResult;
|
|
29
25
|
//# sourceMappingURL=session-resume.d.ts.map
|
|
@@ -1,221 +1,231 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agentic QE v3 - Session Resume Service
|
|
3
|
-
*
|
|
4
|
-
* IMP-04: Transcript-First Session Durability
|
|
5
|
-
* Reads an existing JSONL session file by sampling the head (first 4KB)
|
|
6
|
-
* and tail (last 64KB) to reconstruct metadata and recent entries
|
|
7
|
-
* without reading the entire file.
|
|
8
|
-
*
|
|
9
|
-
* @module mcp/services/session-resume
|
|
10
|
-
*/
|
|
1
|
+
/** Bounded, fail-closed recovery for legacy JSONL session transcripts. */
|
|
11
2
|
import * as fs from 'fs';
|
|
12
3
|
import * as path from 'path';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* Reads the first 4KB (head) to extract session start metadata and
|
|
25
|
-
* the last 64KB (tail) to get recent entries. Parses JSONL lines,
|
|
26
|
-
* reconstructs the parentUuid linked list, and returns metadata +
|
|
27
|
-
* recent entries + resume capability.
|
|
28
|
-
*
|
|
29
|
-
* Corrupt or incomplete lines are skipped gracefully.
|
|
30
|
-
*/
|
|
31
|
-
export function resumeSession(filePath) {
|
|
32
|
-
// If file doesn't exist, return non-resumable result
|
|
33
|
-
if (!fs.existsSync(filePath)) {
|
|
34
|
-
return {
|
|
35
|
-
metadata: {
|
|
36
|
-
sessionId: extractSessionId(filePath),
|
|
37
|
-
createdAt: 0,
|
|
38
|
-
lastActivityAt: 0,
|
|
39
|
-
entryCount: 0,
|
|
40
|
-
state: 'idle',
|
|
41
|
-
},
|
|
42
|
-
recentEntries: [],
|
|
43
|
-
lastState: 'idle',
|
|
44
|
-
canResume: false,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
const stat = fs.statSync(filePath);
|
|
48
|
-
const fileSize = stat.size;
|
|
49
|
-
if (fileSize === 0) {
|
|
50
|
-
return {
|
|
51
|
-
metadata: {
|
|
52
|
-
sessionId: extractSessionId(filePath),
|
|
53
|
-
createdAt: 0,
|
|
54
|
-
lastActivityAt: 0,
|
|
55
|
-
entryCount: 0,
|
|
56
|
-
state: 'idle',
|
|
57
|
-
},
|
|
58
|
-
recentEntries: [],
|
|
59
|
-
lastState: 'idle',
|
|
60
|
-
canResume: false,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
// Read head (first 4KB)
|
|
64
|
-
const headEntries = readHead(filePath, fileSize);
|
|
65
|
-
// Read tail (last 64KB)
|
|
66
|
-
const tailEntries = readTail(filePath, fileSize);
|
|
67
|
-
// Merge and deduplicate: use a Map keyed by uuid to ensure uniqueness
|
|
68
|
-
const entryMap = new Map();
|
|
69
|
-
for (const entry of headEntries) {
|
|
70
|
-
entryMap.set(entry.uuid, entry);
|
|
71
|
-
}
|
|
72
|
-
for (const entry of tailEntries) {
|
|
73
|
-
entryMap.set(entry.uuid, entry);
|
|
74
|
-
}
|
|
75
|
-
const allEntries = Array.from(entryMap.values());
|
|
76
|
-
allEntries.sort((a, b) => a.timestamp - b.timestamp);
|
|
77
|
-
// Reconstruct metadata from available entries
|
|
78
|
-
const firstEntry = headEntries[0] ?? allEntries[0];
|
|
79
|
-
const lastEntry = tailEntries[tailEntries.length - 1] ?? allEntries[allEntries.length - 1];
|
|
80
|
-
// For entry count: if file is small enough that head+tail overlap,
|
|
81
|
-
// allEntries.length is accurate. Otherwise, count total lines.
|
|
82
|
-
let entryCount;
|
|
83
|
-
if (fileSize <= HEAD_BYTES + TAIL_BYTES) {
|
|
84
|
-
entryCount = allEntries.length;
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
entryCount = countLines(filePath);
|
|
88
|
-
}
|
|
89
|
-
const lastState = lastEntry?.state ?? 'idle';
|
|
90
|
-
const metadata = {
|
|
91
|
-
sessionId: extractSessionId(filePath),
|
|
92
|
-
createdAt: firstEntry?.timestamp ?? 0,
|
|
93
|
-
lastActivityAt: lastEntry?.timestamp ?? 0,
|
|
94
|
-
entryCount,
|
|
95
|
-
state: lastState,
|
|
96
|
-
};
|
|
4
|
+
const DEFAULT_MAX_FILE_BYTES = 16 * 1024 * 1024;
|
|
5
|
+
const DEFAULT_MAX_RECORD_BYTES = 1024 * 1024;
|
|
6
|
+
const DEFAULT_MAX_RECORDS = 100_000;
|
|
7
|
+
const RECENT_ENTRY_LIMIT = 256;
|
|
8
|
+
const ENTRY_TYPES = new Set(['tool_call', 'tool_result', 'state_change', 'error']);
|
|
9
|
+
const ENTRY_STATES = new Set(['idle', 'running', 'requires_action']);
|
|
10
|
+
const ENTRY_KEYS = new Set([
|
|
11
|
+
'uuid', 'parentUuid', 'timestamp', 'type', 'toolName', 'params', 'result', 'state', 'tokenEstimate',
|
|
12
|
+
]);
|
|
13
|
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
14
|
+
function emptyResult(filePath, disposition, diagnostics = []) {
|
|
97
15
|
return {
|
|
98
|
-
metadata
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
16
|
+
metadata: {
|
|
17
|
+
sessionId: path.basename(filePath, '.jsonl'), createdAt: 0, lastActivityAt: 0,
|
|
18
|
+
entryCount: 0, state: 'idle',
|
|
19
|
+
},
|
|
20
|
+
recentEntries: [], lastState: 'idle', canResume: false, disposition, diagnostics,
|
|
102
21
|
};
|
|
103
22
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Extract session ID from file path (filename without extension).
|
|
109
|
-
*/
|
|
110
|
-
function extractSessionId(filePath) {
|
|
111
|
-
return path.basename(filePath, '.jsonl');
|
|
23
|
+
function isWithin(root, candidate) {
|
|
24
|
+
const relative = path.relative(root, candidate);
|
|
25
|
+
return relative === '' || (!relative.startsWith(`..${path.sep}`) && relative !== '..' && !path.isAbsolute(relative));
|
|
112
26
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
27
|
+
function isValidEntry(value) {
|
|
28
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
29
|
+
return false;
|
|
30
|
+
const entry = value;
|
|
31
|
+
if (Object.keys(entry).some(key => !ENTRY_KEYS.has(key)))
|
|
32
|
+
return false;
|
|
33
|
+
const params = entry.params;
|
|
34
|
+
return typeof entry.uuid === 'string' && UUID_PATTERN.test(entry.uuid)
|
|
35
|
+
&& (entry.parentUuid === null
|
|
36
|
+
|| (typeof entry.parentUuid === 'string' && UUID_PATTERN.test(entry.parentUuid)))
|
|
37
|
+
&& typeof entry.timestamp === 'number' && Number.isSafeInteger(entry.timestamp) && entry.timestamp >= 0
|
|
38
|
+
&& typeof entry.type === 'string' && ENTRY_TYPES.has(entry.type)
|
|
39
|
+
&& typeof entry.state === 'string' && ENTRY_STATES.has(entry.state)
|
|
40
|
+
&& (entry.toolName === undefined || (typeof entry.toolName === 'string' && entry.toolName.length > 0))
|
|
41
|
+
&& (params === undefined || (typeof params === 'object' && params !== null && !Array.isArray(params)))
|
|
42
|
+
&& (entry.tokenEstimate === undefined || (typeof entry.tokenEstimate === 'number'
|
|
43
|
+
&& Number.isSafeInteger(entry.tokenEstimate)
|
|
44
|
+
&& entry.tokenEstimate >= 0));
|
|
45
|
+
}
|
|
46
|
+
function resolveLimit(value, defaultValue) {
|
|
47
|
+
const limit = value ?? defaultValue;
|
|
48
|
+
return Number.isSafeInteger(limit) && limit > 0 && limit <= defaultValue ? limit : undefined;
|
|
49
|
+
}
|
|
50
|
+
function sameFile(left, right) {
|
|
51
|
+
return left.dev === right.dev && left.ino === right.ino;
|
|
52
|
+
}
|
|
53
|
+
function validateOpenedPath(fd, candidate, root, openedStat) {
|
|
119
54
|
try {
|
|
120
|
-
const
|
|
121
|
-
fs.
|
|
122
|
-
|
|
123
|
-
|
|
55
|
+
const canonicalTarget = fs.realpathSync(candidate);
|
|
56
|
+
const currentStat = fs.lstatSync(candidate);
|
|
57
|
+
if (!isWithin(root, canonicalTarget) || currentStat.isSymbolicLink() || !sameFile(openedStat, currentStat)) {
|
|
58
|
+
return 'session path changed or escaped the configured root';
|
|
59
|
+
}
|
|
60
|
+
// Linux exposes the descriptor target directly. This closes intermediate
|
|
61
|
+
// component substitution without relying only on the current pathname.
|
|
62
|
+
if (process.platform === 'linux') {
|
|
63
|
+
const descriptorTarget = fs.realpathSync(`/proc/self/fd/${fd}`);
|
|
64
|
+
if (!isWithin(root, descriptorTarget))
|
|
65
|
+
return 'opened session descriptor escapes the configured root';
|
|
66
|
+
}
|
|
124
67
|
}
|
|
125
|
-
|
|
126
|
-
|
|
68
|
+
catch {
|
|
69
|
+
return 'opened session path cannot be verified';
|
|
127
70
|
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
function readExactly(fd, fileSize) {
|
|
74
|
+
const buffer = Buffer.alloc(fileSize);
|
|
75
|
+
let offset = 0;
|
|
76
|
+
while (offset < fileSize) {
|
|
77
|
+
const count = fs.readSync(fd, buffer, offset, fileSize - offset, offset);
|
|
78
|
+
if (count === 0)
|
|
79
|
+
throw new Error('unexpected EOF while reading session transcript');
|
|
80
|
+
offset += count;
|
|
81
|
+
}
|
|
82
|
+
return buffer;
|
|
128
83
|
}
|
|
129
84
|
/**
|
|
130
|
-
*
|
|
85
|
+
* Inspect a legacy transcript through one no-follow descriptor. Automatic
|
|
86
|
+
* resume requires an explicit opt-in because this format has no commit marker.
|
|
131
87
|
*/
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
88
|
+
export function resumeSession(filePath, options) {
|
|
89
|
+
if (!options || typeof options.sessionRoot !== 'string' || options.sessionRoot.trim().length === 0) {
|
|
90
|
+
return emptyResult(filePath, 'UNTRUSTED', ['a non-empty session root is required']);
|
|
91
|
+
}
|
|
92
|
+
const maxFileBytes = resolveLimit(options.maxFileBytes, DEFAULT_MAX_FILE_BYTES);
|
|
93
|
+
const maxRecordBytes = resolveLimit(options.maxRecordBytes, DEFAULT_MAX_RECORD_BYTES);
|
|
94
|
+
const maxRecords = resolveLimit(options.maxRecords, DEFAULT_MAX_RECORDS);
|
|
95
|
+
if (maxFileBytes === undefined || maxRecordBytes === undefined || maxRecords === undefined) {
|
|
96
|
+
return emptyResult(filePath, 'RESOURCE_LIMIT', ['recovery limits must be finite positive integers within hard ceilings']);
|
|
97
|
+
}
|
|
98
|
+
const candidate = path.resolve(filePath);
|
|
99
|
+
let root;
|
|
100
|
+
let parent;
|
|
136
101
|
try {
|
|
137
|
-
|
|
138
|
-
fs.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
// the first line is complete -- don't skip it.
|
|
142
|
-
const isMidFileRead = offset > 0;
|
|
143
|
-
return parseJsonlLines(text, /* isHead */ false, isMidFileRead);
|
|
102
|
+
root = fs.realpathSync(options.sessionRoot);
|
|
103
|
+
parent = fs.realpathSync(path.dirname(candidate));
|
|
104
|
+
if (!fs.statSync(root).isDirectory())
|
|
105
|
+
throw new Error('session root is not a directory');
|
|
144
106
|
}
|
|
145
|
-
|
|
146
|
-
|
|
107
|
+
catch {
|
|
108
|
+
return emptyResult(filePath, 'UNTRUSTED', ['session root or parent cannot be resolved']);
|
|
147
109
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
110
|
+
if (!isWithin(root, parent)) {
|
|
111
|
+
return emptyResult(filePath, 'UNTRUSTED', ['session path escapes the configured root']);
|
|
112
|
+
}
|
|
113
|
+
let linkStat;
|
|
114
|
+
try {
|
|
115
|
+
linkStat = fs.lstatSync(candidate);
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
const code = error.code;
|
|
119
|
+
return emptyResult(filePath, code === 'ENOENT' ? 'MISSING' : 'UNTRUSTED', [`lstat failed: ${code ?? 'UNKNOWN'}`]);
|
|
120
|
+
}
|
|
121
|
+
if (linkStat.isSymbolicLink() || !linkStat.isFile()) {
|
|
122
|
+
return emptyResult(filePath, 'UNTRUSTED', ['session path is not a regular, non-symlink file']);
|
|
123
|
+
}
|
|
124
|
+
let fd;
|
|
125
|
+
try {
|
|
126
|
+
fd = fs.openSync(candidate, fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW ?? 0));
|
|
127
|
+
const stat = fs.fstatSync(fd);
|
|
128
|
+
if (!sameFile(linkStat, stat)) {
|
|
129
|
+
return emptyResult(filePath, 'UNTRUSTED', ['session path changed before secure open']);
|
|
130
|
+
}
|
|
131
|
+
if (!stat.isFile() || stat.nlink !== 1) {
|
|
132
|
+
return emptyResult(filePath, 'UNTRUSTED', ['opened session is not an exclusive regular file']);
|
|
133
|
+
}
|
|
134
|
+
if (stat.size === 0)
|
|
135
|
+
return emptyResult(filePath, 'EMPTY');
|
|
136
|
+
if (stat.size > maxFileBytes) {
|
|
137
|
+
return emptyResult(filePath, 'RESOURCE_LIMIT', [`file exceeds ${maxFileBytes} bytes`]);
|
|
138
|
+
}
|
|
139
|
+
const pathError = validateOpenedPath(fd, candidate, root, stat);
|
|
140
|
+
if (pathError)
|
|
141
|
+
return emptyResult(filePath, 'UNTRUSTED', [pathError]);
|
|
142
|
+
const bytes = readExactly(fd, stat.size);
|
|
143
|
+
const finalStat = fs.fstatSync(fd);
|
|
144
|
+
const finalPathError = validateOpenedPath(fd, candidate, root, finalStat);
|
|
145
|
+
if (finalPathError || !sameFile(stat, finalStat) || stat.size !== finalStat.size
|
|
146
|
+
|| stat.mtimeMs !== finalStat.mtimeMs || stat.ctimeMs !== finalStat.ctimeMs) {
|
|
147
|
+
return emptyResult(filePath, 'UNTRUSTED', [finalPathError ?? 'session changed while it was being inspected']);
|
|
148
|
+
}
|
|
149
|
+
const hasTornTail = bytes[bytes.length - 1] !== 0x0a;
|
|
150
|
+
let committedBytes = bytes;
|
|
151
|
+
if (hasTornTail) {
|
|
152
|
+
const finalLineBreak = bytes.lastIndexOf(0x0a);
|
|
153
|
+
const tornTailStart = finalLineBreak + 1;
|
|
154
|
+
const tornTailBytes = bytes.length - tornTailStart;
|
|
155
|
+
if (tornTailBytes > maxRecordBytes) {
|
|
156
|
+
return emptyResult(filePath, 'RESOURCE_LIMIT', [`record exceeds ${maxRecordBytes} bytes`]);
|
|
179
157
|
}
|
|
158
|
+
committedBytes = bytes.subarray(0, tornTailStart);
|
|
159
|
+
}
|
|
160
|
+
let text;
|
|
161
|
+
try {
|
|
162
|
+
text = new TextDecoder('utf-8', { fatal: true }).decode(committedBytes);
|
|
180
163
|
}
|
|
181
164
|
catch {
|
|
182
|
-
|
|
183
|
-
continue;
|
|
165
|
+
return emptyResult(filePath, 'INVALID', ['transcript is not valid UTF-8']);
|
|
184
166
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Count total lines in a file (for large files where head+tail don't overlap).
|
|
202
|
-
* Only counts non-empty lines that parse as valid JSON.
|
|
203
|
-
*/
|
|
204
|
-
function countLines(filePath) {
|
|
205
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
206
|
-
let count = 0;
|
|
207
|
-
for (const line of content.split('\n')) {
|
|
208
|
-
const trimmed = line.trim();
|
|
209
|
-
if (trimmed) {
|
|
167
|
+
const lines = text.split('\n');
|
|
168
|
+
const entries = [];
|
|
169
|
+
const seen = new Set();
|
|
170
|
+
let previous;
|
|
171
|
+
for (const rawLine of lines) {
|
|
172
|
+
if (!rawLine.trim())
|
|
173
|
+
continue;
|
|
174
|
+
if (Buffer.byteLength(rawLine, 'utf8') > maxRecordBytes) {
|
|
175
|
+
return emptyResult(filePath, 'RESOURCE_LIMIT', [`record exceeds ${maxRecordBytes} bytes`]);
|
|
176
|
+
}
|
|
177
|
+
if (entries.length >= maxRecords) {
|
|
178
|
+
return emptyResult(filePath, 'RESOURCE_LIMIT', [`record count exceeds ${maxRecords}`]);
|
|
179
|
+
}
|
|
180
|
+
let parsed;
|
|
210
181
|
try {
|
|
211
|
-
JSON.parse(
|
|
212
|
-
count++;
|
|
182
|
+
parsed = JSON.parse(rawLine);
|
|
213
183
|
}
|
|
214
184
|
catch {
|
|
215
|
-
|
|
185
|
+
return emptyResult(filePath, 'INVALID', ['corrupt JSON occurs before the final torn record']);
|
|
186
|
+
}
|
|
187
|
+
if (!isValidEntry(parsed))
|
|
188
|
+
return emptyResult(filePath, 'INVALID', ['entry fails the session schema']);
|
|
189
|
+
if (seen.has(parsed.uuid))
|
|
190
|
+
return emptyResult(filePath, 'INVALID', ['duplicate entry UUID']);
|
|
191
|
+
if (previous) {
|
|
192
|
+
if (parsed.parentUuid !== previous.uuid)
|
|
193
|
+
return emptyResult(filePath, 'INVALID', ['broken parentUuid lineage']);
|
|
194
|
+
if (parsed.timestamp < previous.timestamp)
|
|
195
|
+
return emptyResult(filePath, 'INVALID', ['timestamps are not monotonic']);
|
|
216
196
|
}
|
|
197
|
+
else if (parsed.parentUuid !== null) {
|
|
198
|
+
return emptyResult(filePath, 'INVALID', ['first entry has a forged parentUuid']);
|
|
199
|
+
}
|
|
200
|
+
seen.add(parsed.uuid);
|
|
201
|
+
entries.push(parsed);
|
|
202
|
+
previous = parsed;
|
|
203
|
+
}
|
|
204
|
+
if (entries.length === 0) {
|
|
205
|
+
return emptyResult(filePath, hasTornTail ? 'INVALID' : 'EMPTY', hasTornTail ? ['only record is torn'] : []);
|
|
217
206
|
}
|
|
207
|
+
const lastEntry = entries[entries.length - 1];
|
|
208
|
+
const diagnostics = [
|
|
209
|
+
'legacy JSONL has no durable commit marker',
|
|
210
|
+
...(hasTornTail ? ['discarded an incomplete final record'] : []),
|
|
211
|
+
];
|
|
212
|
+
return {
|
|
213
|
+
metadata: {
|
|
214
|
+
sessionId: path.basename(filePath, '.jsonl'), createdAt: entries[0].timestamp,
|
|
215
|
+
lastActivityAt: lastEntry.timestamp, entryCount: entries.length, state: lastEntry.state,
|
|
216
|
+
},
|
|
217
|
+
recentEntries: entries.slice(-RECENT_ENTRY_LIMIT), lastState: lastEntry.state,
|
|
218
|
+
canResume: options.allowLegacyUnverified === true,
|
|
219
|
+
disposition: 'LEGACY_UNVERIFIED', diagnostics,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
const code = error.code;
|
|
224
|
+
return emptyResult(filePath, 'UNTRUSTED', [`secure open/read failed: ${code ?? 'UNKNOWN'}`]);
|
|
225
|
+
}
|
|
226
|
+
finally {
|
|
227
|
+
if (fd !== undefined)
|
|
228
|
+
fs.closeSync(fd);
|
|
218
229
|
}
|
|
219
|
-
return count;
|
|
220
230
|
}
|
|
221
231
|
//# sourceMappingURL=session-resume.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool safety annotations and the built-in safety inventory.
|
|
3
|
+
*
|
|
4
|
+
* The inventory is deliberately conservative. A tool is marked read-only
|
|
5
|
+
* only when its registered operation is an observation/query with no write or
|
|
6
|
+
* execution path. Every other built-in receives the MCP-safe fallback: it may
|
|
7
|
+
* be destructive, is not assumed idempotent, and may interact with the world.
|
|
8
|
+
* These values guide clients but never replace authorization, sandbox, or
|
|
9
|
+
* policy enforcement.
|
|
10
|
+
*/
|
|
11
|
+
import type { ToolAnnotations } from './types';
|
|
12
|
+
export type ResolvedToolAnnotations = Required<Pick<ToolAnnotations, 'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>> & Pick<ToolAnnotations, 'title'>;
|
|
13
|
+
export interface BuiltInToolSafetyDisposition {
|
|
14
|
+
annotations: ResolvedToolAnnotations;
|
|
15
|
+
reason: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const CONSERVATIVE_TOOL_ANNOTATIONS: ResolvedToolAnnotations;
|
|
18
|
+
/** Complete deterministic inventory of names advertised by both MCP paths. */
|
|
19
|
+
export declare const BUILT_IN_TOOL_NAMES: readonly string[];
|
|
20
|
+
export declare const BUILT_IN_TOOL_SAFETY_INVENTORY: Readonly<Record<string, BuiltInToolSafetyDisposition>>;
|
|
21
|
+
/** Resolve explicit metadata over inventory metadata over conservative defaults. */
|
|
22
|
+
export declare function resolveToolAnnotations(name: string, annotations?: ToolAnnotations): ResolvedToolAnnotations;
|
|
23
|
+
export declare function getBuiltInToolAnnotations(): Readonly<Record<string, ToolAnnotations>>;
|
|
24
|
+
export declare function getBuiltInToolSafetyInventory(): Readonly<Record<string, BuiltInToolSafetyDisposition>>;
|
|
25
|
+
//# sourceMappingURL=tool-annotations.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool safety annotations and the built-in safety inventory.
|
|
3
|
+
*
|
|
4
|
+
* The inventory is deliberately conservative. A tool is marked read-only
|
|
5
|
+
* only when its registered operation is an observation/query with no write or
|
|
6
|
+
* execution path. Every other built-in receives the MCP-safe fallback: it may
|
|
7
|
+
* be destructive, is not assumed idempotent, and may interact with the world.
|
|
8
|
+
* These values guide clients but never replace authorization, sandbox, or
|
|
9
|
+
* policy enforcement.
|
|
10
|
+
*/
|
|
11
|
+
export const CONSERVATIVE_TOOL_ANNOTATIONS = Object.freeze({
|
|
12
|
+
readOnlyHint: false,
|
|
13
|
+
destructiveHint: true,
|
|
14
|
+
idempotentHint: false,
|
|
15
|
+
openWorldHint: true,
|
|
16
|
+
});
|
|
17
|
+
const HARD_CODED_TOOL_NAMES = [
|
|
18
|
+
'accessibility_test', 'advisor_consult', 'agent_complete', 'agent_list',
|
|
19
|
+
'agent_metrics', 'agent_spawn', 'agent_status', 'aqe_health', 'chaos_test',
|
|
20
|
+
'code_index', 'contract_validate', 'coverage_analyze_sublinear',
|
|
21
|
+
'cross_phase_cleanup', 'cross_phase_query', 'cross_phase_stats',
|
|
22
|
+
'cross_phase_store', 'defect_predict', 'fleet_health', 'fleet_init',
|
|
23
|
+
'fleet_status', 'format_signals', 'infra_healing_feed_output',
|
|
24
|
+
'infra_healing_recover', 'infra_healing_status', 'memory_delete',
|
|
25
|
+
'memory_query', 'memory_retrieve', 'memory_share', 'memory_store',
|
|
26
|
+
'memory_usage', 'migration_check', 'migration_promote', 'migration_status',
|
|
27
|
+
'model_route', 'phase_end', 'phase_start', 'pipeline_list', 'pipeline_load',
|
|
28
|
+
'pipeline_run', 'pipeline_validate', 'quality_assess',
|
|
29
|
+
'requirements_validate', 'routing_economics', 'routing_metrics',
|
|
30
|
+
'security_scan_comprehensive', 'session_cache_stats', 'task_cancel',
|
|
31
|
+
'task_list', 'task_orchestrate', 'task_status', 'task_submit',
|
|
32
|
+
'team_broadcast', 'team_health', 'team_list', 'team_message', 'team_rebalance',
|
|
33
|
+
'team_scale', 'test_execute_parallel', 'test_generate_enhanced',
|
|
34
|
+
'validation_pipeline',
|
|
35
|
+
];
|
|
36
|
+
// QE tools not duplicated by the hard-coded protocol registrations.
|
|
37
|
+
const BRIDGED_TOOL_NAMES = [
|
|
38
|
+
'qe/analysis/token_usage', 'qe/code/c4',
|
|
39
|
+
'qe/coherence/audit', 'qe/coherence/check', 'qe/coherence/collapse',
|
|
40
|
+
'qe/coherence/consensus', 'qe/coverage/gaps',
|
|
41
|
+
'qe/embeddings/compare', 'qe/embeddings/generate', 'qe/embeddings/search',
|
|
42
|
+
'qe/embeddings/stats', 'qe/embeddings/store',
|
|
43
|
+
'qe/learning/dream', 'qe/learning/optimize',
|
|
44
|
+
'qe/mincut/health', 'qe/mincut/analyze', 'qe/mincut/strengthen',
|
|
45
|
+
'qe/planning/goap_execute', 'qe/planning/goap_plan', 'qe/planning/goap_status',
|
|
46
|
+
'qe/quality/gate', 'qe/qx/analyze', 'qe/requirements/quality-criteria',
|
|
47
|
+
'qe/security/url-validate', 'qe/tests/load', 'qe/tests/schedule',
|
|
48
|
+
'qe/visual/compare', 'qe/workflows/browser-load',
|
|
49
|
+
];
|
|
50
|
+
/** Complete deterministic inventory of names advertised by both MCP paths. */
|
|
51
|
+
export const BUILT_IN_TOOL_NAMES = Object.freeze([...HARD_CODED_TOOL_NAMES, ...BRIDGED_TOOL_NAMES].sort());
|
|
52
|
+
function conservativeDisposition() {
|
|
53
|
+
return {
|
|
54
|
+
annotations: CONSERVATIVE_TOOL_ANNOTATIONS,
|
|
55
|
+
reason: 'No narrow side-effect-free guarantee is recorded for this built-in; retain conservative policy defaults.',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export const BUILT_IN_TOOL_SAFETY_INVENTORY = Object.freeze(Object.fromEntries(BUILT_IN_TOOL_NAMES.map((name) => [name, conservativeDisposition()])));
|
|
59
|
+
/** Resolve explicit metadata over inventory metadata over conservative defaults. */
|
|
60
|
+
export function resolveToolAnnotations(name, annotations) {
|
|
61
|
+
const reviewedDisposition = BUILT_IN_TOOL_SAFETY_INVENTORY[name];
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
...(reviewedDisposition?.annotations ?? CONSERVATIVE_TOOL_ANNOTATIONS),
|
|
64
|
+
// Dynamic and plugin-supplied names cannot self-assert optimistic hints.
|
|
65
|
+
// Add the name to the reviewed inventory before accepting overrides.
|
|
66
|
+
...(reviewedDisposition ? annotations : undefined),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
export function getBuiltInToolAnnotations() {
|
|
70
|
+
return Object.fromEntries(Object.entries(BUILT_IN_TOOL_SAFETY_INVENTORY).map(([name, disposition]) => [name, disposition.annotations]));
|
|
71
|
+
}
|
|
72
|
+
export function getBuiltInToolSafetyInventory() {
|
|
73
|
+
return BUILT_IN_TOOL_SAFETY_INVENTORY;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=tool-annotations.js.map
|