@unbrained/pm-cli 2026.7.5 → 2026.7.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/CHANGELOG.md +10 -0
- package/dist/cli-bundle/chunks/activity-WJCGCYPU.js +18 -0
- package/dist/cli-bundle/chunks/activity-Z6QUAUSG.js +22 -0
- package/dist/cli-bundle/chunks/aggregate-BDM6EIAR.js +25 -0
- package/dist/cli-bundle/chunks/aggregate-VQ2DHU3S.js +21 -0
- package/dist/cli-bundle/chunks/append-BGML6VLD.js +19 -0
- package/dist/cli-bundle/chunks/append-RKJYPU74.js +15 -0
- package/dist/cli-bundle/chunks/chunk-22KBU3MW.js +57 -0
- package/dist/cli-bundle/chunks/chunk-24YG75HI.js +634 -0
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js +218 -0
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js +228 -0
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js +2330 -0
- package/dist/cli-bundle/chunks/chunk-3N6RRO2Q.js +808 -0
- package/dist/cli-bundle/chunks/chunk-3N6RRO2Q.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-3UJRFJ5R.js +1573 -0
- package/dist/cli-bundle/chunks/chunk-3VHSI5FL.js +1001 -0
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js +278 -0
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-45FYNUFJ.js +38 -0
- package/dist/cli-bundle/chunks/chunk-45FYNUFJ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-46CUF5L6.js +1018 -0
- package/dist/cli-bundle/chunks/chunk-4CJFCTLM.js +222 -0
- package/dist/cli-bundle/chunks/chunk-4CJFCTLM.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js +249 -0
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js +819 -0
- package/dist/cli-bundle/chunks/chunk-4LELACOL.js +391 -0
- package/dist/cli-bundle/chunks/chunk-4LELACOL.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js +279 -0
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4ZBE5GUN.js +184 -0
- package/dist/cli-bundle/chunks/chunk-4ZBE5GUN.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-57NWPFF2.js +5640 -0
- package/dist/cli-bundle/chunks/chunk-57NWPFF2.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js +268 -0
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js +508 -0
- package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js +1868 -0
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js +1749 -0
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js +1961 -0
- package/dist/cli-bundle/chunks/chunk-6LLVNJXT.js +429 -0
- package/dist/cli-bundle/chunks/chunk-6QBJLYBP.js +120 -0
- package/dist/cli-bundle/chunks/chunk-6QBJLYBP.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-7D7OOEYG.js +278 -0
- package/dist/cli-bundle/chunks/chunk-7D7OOEYG.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-7DT4WSH2.js +60 -0
- package/dist/cli-bundle/chunks/chunk-7WBAJSS6.js +102 -0
- package/dist/cli-bundle/chunks/chunk-AGHMOTGM.js +150 -0
- package/dist/cli-bundle/chunks/chunk-ALFPSEWO.js +112 -0
- package/dist/cli-bundle/chunks/chunk-AZYGZGGI.js +361 -0
- package/dist/cli-bundle/chunks/chunk-B6DUFX6H.js +1413 -0
- package/dist/cli-bundle/chunks/chunk-B6XS3R3O.js +275 -0
- package/dist/cli-bundle/chunks/chunk-B6XS3R3O.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js +421 -0
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js +1985 -0
- package/dist/cli-bundle/chunks/chunk-CFB33L7W.js +398 -0
- package/dist/cli-bundle/chunks/chunk-CFNGIXZP.js +784 -0
- package/dist/cli-bundle/chunks/chunk-CFNGIXZP.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-CL36D4PC.js +225 -0
- package/dist/cli-bundle/chunks/chunk-COSPOP7H.js +6677 -0
- package/dist/cli-bundle/chunks/chunk-COSPOP7H.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js +3461 -0
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-CRVYGJUI.js +553 -0
- package/dist/cli-bundle/chunks/chunk-CRVYGJUI.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-D2XRLB55.js +645 -0
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js +1858 -0
- package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js +1063 -0
- package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js +1932 -0
- package/dist/cli-bundle/chunks/chunk-E42XTBSP.js +1359 -0
- package/dist/cli-bundle/chunks/chunk-E42XTBSP.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-EBRZZ54H.js +655 -0
- package/dist/cli-bundle/chunks/chunk-EBRZZ54H.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js +4712 -0
- package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-EGY6JBQ3.js +160 -0
- package/dist/cli-bundle/chunks/chunk-EKFNL33R.js +222 -0
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js +1704 -0
- package/dist/cli-bundle/chunks/chunk-EOKXK3R3.js +2046 -0
- package/dist/cli-bundle/chunks/chunk-F3K4JGFD.js +121 -0
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js +231 -0
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js +2090 -0
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-FT3QTERD.js +550 -0
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js +1570 -0
- package/dist/cli-bundle/chunks/chunk-G64OCSKU.js +444 -0
- package/dist/cli-bundle/chunks/chunk-GANUTS7W.js +1775 -0
- package/dist/cli-bundle/chunks/chunk-GBAX2ZAQ.js +401 -0
- package/dist/cli-bundle/chunks/chunk-GDDAGPWJ.js +105 -0
- package/dist/cli-bundle/chunks/chunk-GDDAGPWJ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js +239 -0
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GJ7QC5DJ.js +624 -0
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js +530 -0
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js +1005 -0
- package/dist/cli-bundle/chunks/chunk-HFDADVJZ.js +1356 -0
- package/dist/cli-bundle/chunks/chunk-HFDADVJZ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-HIHMT6WS.js +41 -0
- package/dist/cli-bundle/chunks/chunk-HIHMT6WS.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js +277 -0
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-HOVCGJSD.js +293 -0
- package/dist/cli-bundle/chunks/chunk-HOVCGJSD.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-I36Y7PCE.js +38 -0
- package/dist/cli-bundle/chunks/chunk-I36Y7PCE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js +309 -0
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-IWVU4C2F.js +358 -0
- package/dist/cli-bundle/chunks/chunk-IX5BXEMX.js +267 -0
- package/dist/cli-bundle/chunks/chunk-JDDLOQAE.js +265 -0
- package/dist/cli-bundle/chunks/chunk-JJP45OEI.js +119 -0
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js +2257 -0
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-JVH7QBVV.js +24 -0
- package/dist/cli-bundle/chunks/chunk-JVH7QBVV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-K46RF36U.js +207 -0
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js +371 -0
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-KGFUY7WN.js +814 -0
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js +76 -0
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-KUOOJR35.js +260 -0
- package/dist/cli-bundle/chunks/chunk-L5PSPMZ4.js +277 -0
- package/dist/cli-bundle/chunks/chunk-LK6XLOGP.js +5799 -0
- package/dist/cli-bundle/chunks/chunk-LK6XLOGP.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js +140 -0
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-LPSSSDJR.js +1239 -0
- package/dist/cli-bundle/chunks/chunk-M7JNBQAD.js +225 -0
- package/dist/cli-bundle/chunks/chunk-M7JNBQAD.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-MA4SM3QZ.js +655 -0
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js +1601 -0
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js +1031 -0
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js +995 -0
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js +296 -0
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-MLIYFOE7.js +357 -0
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js +2043 -0
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-MUH7A3FD.js +61 -0
- package/dist/cli-bundle/chunks/chunk-MVSP7WGJ.js +108 -0
- package/dist/cli-bundle/chunks/chunk-MVSP7WGJ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-MVYWGY2A.js +262 -0
- package/dist/cli-bundle/chunks/chunk-MWMVPCIE.js +1423 -0
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js +2033 -0
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js +1604 -0
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-NB7RLQFW.js +57 -0
- package/dist/cli-bundle/chunks/chunk-NB7RLQFW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-NC33K5ZS.js +123 -0
- package/dist/cli-bundle/chunks/chunk-NC33K5ZS.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-NGXQ3PFT.js +263 -0
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js +1615 -0
- package/dist/cli-bundle/chunks/chunk-NO442GWJ.js +41 -0
- package/dist/cli-bundle/chunks/chunk-NO442GWJ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-NZEHECMW.js +658 -0
- package/dist/cli-bundle/chunks/chunk-NZEHECMW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-O6AWCQRQ.js +124 -0
- package/dist/cli-bundle/chunks/chunk-OGWQ2IEP.js +240 -0
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js +143 -0
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-QLMX7SRD.js +210 -0
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js +398 -0
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-R5BMJX33.js +27 -0
- package/dist/cli-bundle/chunks/chunk-R5BMJX33.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-RCQZK2GO.js +296 -0
- package/dist/cli-bundle/chunks/chunk-RCQZK2GO.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js +520 -0
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js +79 -0
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js +282 -0
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js +274 -0
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-SCUR7K7N.js +2198 -0
- package/dist/cli-bundle/chunks/chunk-SGMFPXKR.js +68 -0
- package/dist/cli-bundle/chunks/chunk-SGMFPXKR.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js +1977 -0
- package/dist/cli-bundle/chunks/chunk-SMB7RV23.js +130 -0
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js +1041 -0
- package/dist/cli-bundle/chunks/chunk-SQOIV3OQ.js +563 -0
- package/dist/cli-bundle/chunks/chunk-SQOIV3OQ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-SQYJ4HF2.js +1765 -0
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js +822 -0
- package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js +6567 -0
- package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-TULGS6X6.js +2132 -0
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js +2306 -0
- package/dist/cli-bundle/chunks/chunk-UH7T2DAX.js +181 -0
- package/dist/cli-bundle/chunks/chunk-UH7T2DAX.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js +4773 -0
- package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-VPIM42PC.js +367 -0
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js +368 -0
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-W3DSJQIO.js +447 -0
- package/dist/cli-bundle/chunks/chunk-W572BIEB.js +1249 -0
- package/dist/cli-bundle/chunks/chunk-W6DYWXPQ.js +1073 -0
- package/dist/cli-bundle/chunks/chunk-W6DYWXPQ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js +3423 -0
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js +2247 -0
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js +215 -0
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js +388 -0
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-XB7KFVFI.js +533 -0
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js +306 -0
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js +424 -0
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-XG625QP4.js +58 -0
- package/dist/cli-bundle/chunks/chunk-XHET7YUZ.js +71 -0
- package/dist/cli-bundle/chunks/chunk-XHET7YUZ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-XUC7PI2H.js +243 -0
- package/dist/cli-bundle/chunks/chunk-Y46GD4IX.js +116 -0
- package/dist/cli-bundle/chunks/chunk-Y4M7CPQP.js +804 -0
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js +2128 -0
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-YN7Y6DQZ.js +426 -0
- package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js +511 -0
- package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-ZGK4L4JM.js +133 -0
- package/dist/cli-bundle/chunks/chunk-ZJ262CED.js +394 -0
- package/dist/cli-bundle/chunks/chunk-ZJ262CED.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js +299 -0
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-ZSUS2OD3.js +2105 -0
- package/dist/cli-bundle/chunks/chunk-ZWBEPGD7.js +54 -0
- package/dist/cli-bundle/chunks/chunk-ZWBEPGD7.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-ZZD4J5XY.js +1570 -0
- package/dist/cli-bundle/chunks/claim-RFS7BROJ.js +19 -0
- package/dist/cli-bundle/chunks/claim-XP5AWZ5H.js +23 -0
- package/dist/cli-bundle/chunks/close-2SSSHHUZ.js +20 -0
- package/dist/cli-bundle/chunks/close-GEANHQ2J.js +16 -0
- package/dist/cli-bundle/chunks/close-many-CMZW7ITN.js +31 -0
- package/dist/cli-bundle/chunks/close-many-ZFDIG6M7.js +27 -0
- package/dist/cli-bundle/chunks/comments-MFSYVNNU.js +21 -0
- package/dist/cli-bundle/chunks/comments-XUBPXDYX.js +17 -0
- package/dist/cli-bundle/chunks/config-D7XQMONX.js +18 -0
- package/dist/cli-bundle/chunks/config-T4FHBSYN.js +22 -0
- package/dist/cli-bundle/chunks/context-DIU275XI.js +48 -0
- package/dist/cli-bundle/chunks/context-JCOYB4LZ.js +44 -0
- package/dist/cli-bundle/chunks/contracts-BVO7CSLK.js +12 -0
- package/dist/cli-bundle/chunks/contracts-NYPEW2G4.js +16 -0
- package/dist/cli-bundle/chunks/copy-32ROBIDL.js +17 -0
- package/dist/cli-bundle/chunks/copy-NAGLGMHZ.js +13 -0
- package/dist/cli-bundle/chunks/create-4V7SWNBB.js +30 -0
- package/dist/cli-bundle/chunks/create-E77SDCUP.js +34 -0
- package/dist/cli-bundle/chunks/delete-NQI5OSKN.js +14 -0
- package/dist/cli-bundle/chunks/delete-RA5KTCLB.js +18 -0
- package/dist/cli-bundle/chunks/deps-32SU7HO5.js +21 -0
- package/dist/cli-bundle/chunks/deps-T7SCWXEX.js +17 -0
- package/dist/cli-bundle/chunks/docs-RRUPT7O2.js +22 -0
- package/dist/cli-bundle/chunks/docs-WL2IWGWV.js +18 -0
- package/dist/cli-bundle/chunks/eval-NF2J5SHR.js +23 -0
- package/dist/cli-bundle/chunks/eval-SKDT3MZU.js +27 -0
- package/dist/cli-bundle/chunks/extension-LAXKCAYE.js +42 -0
- package/dist/cli-bundle/chunks/extension-LAXKCAYE.js.map +1 -0
- package/dist/cli-bundle/chunks/extension-ZISPBRBC.js +38 -0
- package/dist/cli-bundle/chunks/extension-ZISPBRBC.js.map +7 -0
- package/dist/cli-bundle/chunks/files-EWRQHGIS.js +22 -0
- package/dist/cli-bundle/chunks/files-EWRQHGIS.js.map +7 -0
- package/dist/cli-bundle/chunks/files-PYKR2UUG.js +26 -0
- package/dist/cli-bundle/chunks/files-PYKR2UUG.js.map +1 -0
- package/dist/cli-bundle/chunks/focus-4T7TM4MT.js +18 -0
- package/dist/cli-bundle/chunks/focus-4T7TM4MT.js.map +1 -0
- package/dist/cli-bundle/chunks/focus-L3YUASOD.js +14 -0
- package/dist/cli-bundle/chunks/focus-L3YUASOD.js.map +7 -0
- package/dist/cli-bundle/chunks/gc-2DNMPXMC.js +16 -0
- package/dist/cli-bundle/chunks/gc-2DNMPXMC.js.map +1 -0
- package/dist/cli-bundle/chunks/gc-2PCTYYRI.js +12 -0
- package/dist/cli-bundle/chunks/gc-2PCTYYRI.js.map +7 -0
- package/dist/cli-bundle/chunks/get-7DMITJ3G.js +23 -0
- package/dist/cli-bundle/chunks/get-7DMITJ3G.js.map +1 -0
- package/dist/cli-bundle/chunks/get-VKQXCXLL.js +19 -0
- package/dist/cli-bundle/chunks/get-VKQXCXLL.js.map +7 -0
- package/dist/cli-bundle/chunks/health-CVSTAR2F.js +31 -0
- package/dist/cli-bundle/chunks/health-CVSTAR2F.js.map +7 -0
- package/dist/cli-bundle/chunks/health-TV3GKTFN.js +35 -0
- package/dist/cli-bundle/chunks/health-TV3GKTFN.js.map +1 -0
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js +20 -0
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js.map +7 -0
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js +24 -0
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js.map +1 -0
- package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js +29 -0
- package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js.map +1 -0
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js +25 -0
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js.map +7 -0
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js +21 -0
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js.map +7 -0
- package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js +25 -0
- package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js.map +1 -0
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js +23 -0
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js.map +7 -0
- package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js +27 -0
- package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js.map +1 -0
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js +30 -0
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js.map +1 -0
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js +26 -0
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js.map +7 -0
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js +21 -0
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js.map +1 -0
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js +17 -0
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js.map +7 -0
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js +36 -0
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js.map +1 -0
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js +32 -0
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js.map +7 -0
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js +28 -0
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js.map +7 -0
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js +32 -0
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js.map +1 -0
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js +17 -0
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js.map +7 -0
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js +21 -0
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js.map +1 -0
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js +29 -0
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js.map +7 -0
- package/dist/cli-bundle/chunks/plan-CHVE7PBR.js +33 -0
- package/dist/cli-bundle/chunks/plan-CHVE7PBR.js.map +1 -0
- package/dist/cli-bundle/chunks/profile-LD23PSI6.js +37 -0
- package/dist/cli-bundle/chunks/profile-LD23PSI6.js.map +7 -0
- package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js +41 -0
- package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js.map +1 -0
- package/dist/cli-bundle/chunks/register-list-query-B42JCCOI.js +409 -0
- package/dist/cli-bundle/chunks/register-list-query-OEYQHFXO.js +419 -0
- package/dist/cli-bundle/chunks/register-mutation-3QXIHCQG.js +1273 -0
- package/dist/cli-bundle/chunks/register-mutation-IAEST26S.js +1256 -0
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js +19 -0
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js +23 -0
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js.map +1 -0
- package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js +324 -0
- package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js.map +7 -0
- package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js +321 -0
- package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-5RQHAPMA.js +23 -0
- package/dist/cli-bundle/chunks/restore-5RQHAPMA.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js +19 -0
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js.map +7 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js +29 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js.map +1 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js +25 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js.map +7 -0
- package/dist/cli-bundle/chunks/schema-245WW4G2.js +78 -0
- package/dist/cli-bundle/chunks/schema-245WW4G2.js.map +1 -0
- package/dist/cli-bundle/chunks/schema-HBORFC6B.js +74 -0
- package/dist/cli-bundle/chunks/schema-HBORFC6B.js.map +7 -0
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js +34 -0
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js.map +7 -0
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js +38 -0
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js +21 -0
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js +17 -0
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js +14 -0
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js +18 -0
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js.map +1 -0
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js +39 -0
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js.map +7 -0
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js +43 -0
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js.map +1 -0
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js +29 -0
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js.map +7 -0
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js +33 -0
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js.map +1 -0
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js +28 -0
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js.map +1 -0
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js +24 -0
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js.map +7 -0
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js +30 -0
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js.map +1 -0
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js +26 -0
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js +37 -0
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js +41 -0
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js.map +1 -0
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js +24 -0
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js.map +7 -0
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js +28 -0
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js.map +1 -0
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js +36 -0
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js.map +1 -0
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js +32 -0
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js.map +7 -0
- package/dist/cli-bundle/main.js +16 -16
- package/dist/cli-bundle/sdk-runtime.js +88 -28
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +92 -49
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/mcp/server.d.ts +22 -50
- package/dist/mcp/server.js +62 -916
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/index.d.ts +4 -2
- package/dist/sdk/index.js +4 -4
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +168 -4
- package/dist/sdk/runtime.js +1149 -25
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/workspace-contracts-cache.d.ts +17 -0
- package/dist/sdk/workspace-contracts-cache.js +36 -0
- package/dist/sdk/workspace-contracts-cache.js.map +1 -0
- package/docs/RELEASING.md +3 -1
- package/docs/SDK.md +46 -0
- package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +16 -2
- package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +16 -1
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +0 -18
- package/dist/cli-bundle/chunks/activity-YKAKZTZ4.js +0 -22
- package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js +0 -375
- package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js.map +0 -7
- package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js +0 -372
- package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js.map +0 -1
- package/dist/cli-bundle/chunks/append-CZGUZ45Q.js +0 -73
- package/dist/cli-bundle/chunks/append-CZGUZ45Q.js.map +0 -7
- package/dist/cli-bundle/chunks/append-NSQBCXZJ.js +0 -70
- package/dist/cli-bundle/chunks/append-NSQBCXZJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3JZNEQBA.js +0 -1413
- package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js +0 -1961
- package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js +0 -1749
- package/dist/cli-bundle/chunks/chunk-3Y4OESPP.js +0 -277
- package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js +0 -822
- package/dist/cli-bundle/chunks/chunk-4OFLJHX6.js +0 -356
- package/dist/cli-bundle/chunks/chunk-4QQ6PM7M.js +0 -1249
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js +0 -2181
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57C2RLW5.js +0 -1704
- package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js +0 -2330
- package/dist/cli-bundle/chunks/chunk-5J2XPTAD.js +0 -225
- package/dist/cli-bundle/chunks/chunk-5JE6SMYS.js +0 -262
- package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js +0 -995
- package/dist/cli-bundle/chunks/chunk-5VVUKE3U.js +0 -5789
- package/dist/cli-bundle/chunks/chunk-5VVUKE3U.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js +0 -819
- package/dist/cli-bundle/chunks/chunk-7EQNAZX2.js +0 -1018
- package/dist/cli-bundle/chunks/chunk-7MDXZAZS.js +0 -102
- package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js +0 -2046
- package/dist/cli-bundle/chunks/chunk-7WYXBPYQ.js +0 -358
- package/dist/cli-bundle/chunks/chunk-AAEQMOC6.js +0 -150
- package/dist/cli-bundle/chunks/chunk-ABRA3BHY.js +0 -429
- package/dist/cli-bundle/chunks/chunk-BFVHCAOO.js +0 -240
- package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js +0 -530
- package/dist/cli-bundle/chunks/chunk-C3PMDWGX.js +0 -160
- package/dist/cli-bundle/chunks/chunk-D3UCE7RW.js +0 -243
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +0 -275
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DLQ4ZTCU.js +0 -634
- package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js +0 -231
- package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js +0 -2184
- package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EEY54JMF.js +0 -60
- package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js +0 -1615
- package/dist/cli-bundle/chunks/chunk-FDBARR33.js +0 -655
- package/dist/cli-bundle/chunks/chunk-FGQKEDE4.js +0 -447
- package/dist/cli-bundle/chunks/chunk-FJRKQREY.js +0 -228
- package/dist/cli-bundle/chunks/chunk-FUM6UMY4.js +0 -804
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js +0 -3237
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HBYZDSK5.js +0 -426
- package/dist/cli-bundle/chunks/chunk-HJE4JTKQ.js +0 -124
- package/dist/cli-bundle/chunks/chunk-HK72NWAD.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-IJ6CO3JV.js +0 -645
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js +0 -3206
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JLA7EVYV.js +0 -222
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +0 -76
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K3AGVXSF.js +0 -444
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +0 -79
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +0 -915
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js +0 -218
- package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js +0 -2105
- package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js +0 -1858
- package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js +0 -2198
- package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js +0 -520
- package/dist/cli-bundle/chunks/chunk-N6DNM2FA.js +0 -116
- package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js +0 -1041
- package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js +0 -2132
- package/dist/cli-bundle/chunks/chunk-NER3KUUS.js +0 -260
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +0 -918
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js +0 -1985
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +0 -238
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OWTIRHX4.js +0 -112
- package/dist/cli-bundle/chunks/chunk-P3VRG72Q.js +0 -1765
- package/dist/cli-bundle/chunks/chunk-P5TFTLWW.js +0 -1423
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +0 -1977
- package/dist/cli-bundle/chunks/chunk-PDXT6Q55.js +0 -58
- package/dist/cli-bundle/chunks/chunk-PJ3A56YF.js +0 -1239
- package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js +0 -1031
- package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js +0 -4725
- package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QHZO65XW.js +0 -1775
- package/dist/cli-bundle/chunks/chunk-R3ZBLGTC.js +0 -814
- package/dist/cli-bundle/chunks/chunk-RCT3YJOK.js +0 -624
- package/dist/cli-bundle/chunks/chunk-RX3HQSYG.js +0 -265
- package/dist/cli-bundle/chunks/chunk-S4APD35C.js +0 -210
- package/dist/cli-bundle/chunks/chunk-S5AYOUT5.js +0 -130
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js +0 -1149
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T35XLYZF.js +0 -263
- package/dist/cli-bundle/chunks/chunk-T3ABIMGW.js +0 -361
- package/dist/cli-bundle/chunks/chunk-T3F4DF23.js +0 -267
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +0 -272
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js +0 -5354
- package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TSPKZRRW.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-TT42JUMF.js +0 -207
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +0 -165
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js +0 -4786
- package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +0 -1932
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +0 -175
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js +0 -1868
- package/dist/cli-bundle/chunks/chunk-WISPVC2E.js +0 -401
- package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js +0 -5434
- package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js +0 -1152
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Y76TWC45.js +0 -550
- package/dist/cli-bundle/chunks/chunk-YD5FML7K.js +0 -5630
- package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YFIE7YK6.js +0 -57
- package/dist/cli-bundle/chunks/chunk-YMABYTNG.js +0 -1573
- package/dist/cli-bundle/chunks/chunk-YOF5VPKM.js +0 -119
- package/dist/cli-bundle/chunks/chunk-YPPVU5GX.js +0 -398
- package/dist/cli-bundle/chunks/chunk-YQMMMONE.js +0 -133
- package/dist/cli-bundle/chunks/chunk-YSAH5FY5.js +0 -1001
- package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js +0 -1005
- package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js +0 -215
- package/dist/cli-bundle/chunks/chunk-ZAHXPXVY.js +0 -533
- package/dist/cli-bundle/chunks/chunk-ZCJAA3JK.js +0 -121
- package/dist/cli-bundle/chunks/chunk-ZD34OFFQ.js +0 -366
- package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js +0 -2306
- package/dist/cli-bundle/chunks/chunk-ZMD35NYG.js +0 -61
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +0 -241
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js +0 -144
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +0 -1
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js +0 -147
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +0 -7
- package/dist/cli-bundle/chunks/close-3YRR3XY6.js +0 -20
- package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +0 -16
- package/dist/cli-bundle/chunks/close-many-AP4MWU36.js +0 -397
- package/dist/cli-bundle/chunks/close-many-AP4MWU36.js.map +0 -1
- package/dist/cli-bundle/chunks/close-many-OMZIGZB4.js +0 -400
- package/dist/cli-bundle/chunks/close-many-OMZIGZB4.js.map +0 -7
- package/dist/cli-bundle/chunks/comments-MIW5MZOX.js +0 -128
- package/dist/cli-bundle/chunks/comments-MIW5MZOX.js.map +0 -7
- package/dist/cli-bundle/chunks/comments-SAG5LSKL.js +0 -125
- package/dist/cli-bundle/chunks/comments-SAG5LSKL.js.map +0 -1
- package/dist/cli-bundle/chunks/config-DJJKZB5R.js +0 -1075
- package/dist/cli-bundle/chunks/config-DJJKZB5R.js.map +0 -7
- package/dist/cli-bundle/chunks/config-V57QD47V.js +0 -1065
- package/dist/cli-bundle/chunks/config-V57QD47V.js.map +0 -1
- package/dist/cli-bundle/chunks/context-4OQGIPSO.js +0 -45
- package/dist/cli-bundle/chunks/context-WLA6IAWE.js +0 -49
- package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +0 -12
- package/dist/cli-bundle/chunks/contracts-OJEXMKVW.js +0 -16
- package/dist/cli-bundle/chunks/copy-LEE6P6EM.js +0 -184
- package/dist/cli-bundle/chunks/copy-LEE6P6EM.js.map +0 -7
- package/dist/cli-bundle/chunks/copy-OTJOWFL6.js +0 -181
- package/dist/cli-bundle/chunks/copy-OTJOWFL6.js.map +0 -1
- package/dist/cli-bundle/chunks/create-WKOZKPQR.js +0 -30
- package/dist/cli-bundle/chunks/create-XWWQFQ6S.js +0 -34
- package/dist/cli-bundle/chunks/delete-62JQTYT4.js +0 -59
- package/dist/cli-bundle/chunks/delete-62JQTYT4.js.map +0 -7
- package/dist/cli-bundle/chunks/delete-HQKGRNRZ.js +0 -56
- package/dist/cli-bundle/chunks/delete-HQKGRNRZ.js.map +0 -1
- package/dist/cli-bundle/chunks/deps-55FTG6Z5.js +0 -224
- package/dist/cli-bundle/chunks/deps-55FTG6Z5.js.map +0 -1
- package/dist/cli-bundle/chunks/deps-L2FPIAD3.js +0 -227
- package/dist/cli-bundle/chunks/deps-L2FPIAD3.js.map +0 -7
- package/dist/cli-bundle/chunks/docs-6CRCSVKK.js +0 -33
- package/dist/cli-bundle/chunks/docs-6CRCSVKK.js.map +0 -1
- package/dist/cli-bundle/chunks/docs-S6UTOTO5.js +0 -36
- package/dist/cli-bundle/chunks/docs-S6UTOTO5.js.map +0 -7
- package/dist/cli-bundle/chunks/eval-N6UHFWVO.js +0 -288
- package/dist/cli-bundle/chunks/eval-N6UHFWVO.js.map +0 -7
- package/dist/cli-bundle/chunks/eval-PHOTWYHI.js +0 -278
- package/dist/cli-bundle/chunks/eval-PHOTWYHI.js.map +0 -1
- package/dist/cli-bundle/chunks/extension-NBAH62ML.js +0 -40
- package/dist/cli-bundle/chunks/extension-ZF6ZZPOU.js +0 -44
- package/dist/cli-bundle/chunks/files-6P57MRKL.js +0 -301
- package/dist/cli-bundle/chunks/files-6P57MRKL.js.map +0 -7
- package/dist/cli-bundle/chunks/files-JPU3FNJ7.js +0 -298
- package/dist/cli-bundle/chunks/files-JPU3FNJ7.js.map +0 -1
- package/dist/cli-bundle/chunks/focus-LFZ6IDBR.js +0 -106
- package/dist/cli-bundle/chunks/focus-LFZ6IDBR.js.map +0 -1
- package/dist/cli-bundle/chunks/focus-WNMYCVYA.js +0 -109
- package/dist/cli-bundle/chunks/focus-WNMYCVYA.js.map +0 -7
- package/dist/cli-bundle/chunks/gc-AETFKZ44.js +0 -398
- package/dist/cli-bundle/chunks/gc-AETFKZ44.js.map +0 -7
- package/dist/cli-bundle/chunks/gc-RLBP4QVN.js +0 -388
- package/dist/cli-bundle/chunks/gc-RLBP4QVN.js.map +0 -1
- package/dist/cli-bundle/chunks/get-NH2MPBCI.js +0 -283
- package/dist/cli-bundle/chunks/get-NH2MPBCI.js.map +0 -1
- package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js +0 -286
- package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-3GVPMQBL.js +0 -1612
- package/dist/cli-bundle/chunks/health-3GVPMQBL.js.map +0 -1
- package/dist/cli-bundle/chunks/health-DNTM72GJ.js +0 -1615
- package/dist/cli-bundle/chunks/health-DNTM72GJ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-RYKLC72X.js +0 -20
- package/dist/cli-bundle/chunks/history-SGPYRAFT.js +0 -24
- package/dist/cli-bundle/chunks/history-compact-3F6VELO7.js +0 -565
- package/dist/cli-bundle/chunks/history-compact-3F6VELO7.js.map +0 -7
- package/dist/cli-bundle/chunks/history-compact-656Y2TN4.js +0 -555
- package/dist/cli-bundle/chunks/history-compact-656Y2TN4.js.map +0 -1
- package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-54ICFKXM.js +0 -25
- package/dist/cli-bundle/chunks/history-repair-4N6SDVHK.js +0 -281
- package/dist/cli-bundle/chunks/history-repair-4N6SDVHK.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-EVTO6LIH.js +0 -278
- package/dist/cli-bundle/chunks/history-repair-EVTO6LIH.js.map +0 -1
- package/dist/cli-bundle/chunks/init-RPIPQUNV.js +0 -32
- package/dist/cli-bundle/chunks/init-SKQAESQS.js +0 -28
- package/dist/cli-bundle/chunks/learnings-2HTPZNGZ.js +0 -48
- package/dist/cli-bundle/chunks/learnings-2HTPZNGZ.js.map +0 -7
- package/dist/cli-bundle/chunks/learnings-YBIHY3D6.js +0 -45
- package/dist/cli-bundle/chunks/learnings-YBIHY3D6.js.map +0 -1
- package/dist/cli-bundle/chunks/list-64LHZ3HM.js +0 -32
- package/dist/cli-bundle/chunks/list-7LXBTEKI.js +0 -36
- package/dist/cli-bundle/chunks/next-7ODPAQ4U.js +0 -306
- package/dist/cli-bundle/chunks/next-7ODPAQ4U.js.map +0 -7
- package/dist/cli-bundle/chunks/next-ODJUM4ZM.js +0 -303
- package/dist/cli-bundle/chunks/next-ODJUM4ZM.js.map +0 -1
- package/dist/cli-bundle/chunks/notes-72YXN5JX.js +0 -48
- package/dist/cli-bundle/chunks/notes-72YXN5JX.js.map +0 -7
- package/dist/cli-bundle/chunks/notes-NJ7IQJX4.js +0 -45
- package/dist/cli-bundle/chunks/notes-NJ7IQJX4.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-R4NDQ27E.js +0 -1366
- package/dist/cli-bundle/chunks/plan-R4NDQ27E.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-XWY5T67S.js +0 -1363
- package/dist/cli-bundle/chunks/plan-XWY5T67S.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +0 -397
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +0 -400
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-5H66WFYF.js +0 -419
- package/dist/cli-bundle/chunks/register-list-query-FB3FNDLZ.js +0 -409
- package/dist/cli-bundle/chunks/register-mutation-UJO23C7R.js +0 -1256
- package/dist/cli-bundle/chunks/register-mutation-Z2ETYHKS.js +0 -1273
- package/dist/cli-bundle/chunks/register-operations-A3XAM5J7.js +0 -513
- package/dist/cli-bundle/chunks/register-operations-A3XAM5J7.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-SG7HBSUP.js +0 -516
- package/dist/cli-bundle/chunks/register-operations-SG7HBSUP.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-I45OGJUV.js +0 -323
- package/dist/cli-bundle/chunks/register-setup-I45OGJUV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-K6U3NVY5.js +0 -326
- package/dist/cli-bundle/chunks/register-setup-K6U3NVY5.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +0 -19
- package/dist/cli-bundle/chunks/restore-YJ2ET6AT.js +0 -23
- package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js +0 -91
- package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js.map +0 -7
- package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js +0 -88
- package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js.map +0 -1
- package/dist/cli-bundle/chunks/schema-2PUXCZ25.js +0 -74
- package/dist/cli-bundle/chunks/schema-Y6DXXK2F.js +0 -78
- package/dist/cli-bundle/chunks/search-3S72CTD6.js +0 -38
- package/dist/cli-bundle/chunks/search-WNUNBQXO.js +0 -34
- package/dist/cli-bundle/chunks/stats-IJYTRQGV.js +0 -250
- package/dist/cli-bundle/chunks/stats-IJYTRQGV.js.map +0 -7
- package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js +0 -240
- package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js.map +0 -1
- package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js +0 -309
- package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js +0 -306
- package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js.map +0 -1
- package/dist/cli-bundle/chunks/test-DQ2QFJ7W.js +0 -45
- package/dist/cli-bundle/chunks/test-W7QBLVJS.js +0 -41
- package/dist/cli-bundle/chunks/test-all-636NTRTT.js +0 -434
- package/dist/cli-bundle/chunks/test-all-636NTRTT.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js +0 -437
- package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-245OINZR.js +0 -28
- package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +0 -24
- package/dist/cli-bundle/chunks/update-SFLZPJXX.js +0 -30
- package/dist/cli-bundle/chunks/update-SJZ6S77U.js +0 -26
- package/dist/cli-bundle/chunks/update-many-DC7X3EWM.js +0 -671
- package/dist/cli-bundle/chunks/update-many-DC7X3EWM.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-SLLAMHT7.js +0 -668
- package/dist/cli-bundle/chunks/update-many-SLLAMHT7.js.map +0 -1
- package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js +0 -290
- package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js +0 -287
- package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-PA4FDTOV.js +0 -2143
- package/dist/cli-bundle/chunks/validate-PA4FDTOV.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js +0 -2105
- package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-4XQIDNM5.js.map → activity-WJCGCYPU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js.map → activity-Z6QUAUSG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-3YRR3XY6.js.map → aggregate-BDM6EIAR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-OB2Y4QP5.js.map → aggregate-VQ2DHU3S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-WLA6IAWE.js.map → append-BGML6VLD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-4OQGIPSO.js.map → append-RKJYPU74.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js.map → chunk-22KBU3MW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js.map → chunk-24YG75HI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KLG4ZULO.js.map → chunk-2XG4IZON.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FJRKQREY.js.map → chunk-3GCS5SKL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5B3X4Y22.js.map → chunk-3KTN6IBA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js.map → chunk-3UJRFJ5R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YSAH5FY5.js.map → chunk-3VHSI5FL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7EQNAZX2.js.map → chunk-46CUF5L6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-75U6M5ZD.js.map → chunk-4IWYTWGF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VZIYHZDX.js.map → chunk-5GZ7TDD6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3U3VEWK6.js.map → chunk-5VAA4YHR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3PL6LEKP.js.map → chunk-64YKRTSV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js.map → chunk-6LLVNJXT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js.map → chunk-7DT4WSH2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js.map → chunk-7WBAJSS6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js.map → chunk-AGHMOTGM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js.map → chunk-ALFPSEWO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js.map → chunk-AZYGZGGI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js.map → chunk-B6DUFX6H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OESSOFJ4.js.map → chunk-C5JBZRPU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js.map → chunk-CFB33L7W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5J2XPTAD.js.map → chunk-CL36D4PC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js.map → chunk-D2XRLB55.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MNZ7DRNC.js.map → chunk-DEWEK6AN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-US3T3W5J.js.map → chunk-E3SZTQ4K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js.map → chunk-EGY6JBQ3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JLA7EVYV.js.map → chunk-EKFNL33R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-57C2RLW5.js.map → chunk-ENGQOEUY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7QH7DHUB.js.map → chunk-EOKXK3R3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js.map → chunk-F3K4JGFD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DRBV5UC2.js.map → chunk-FLZSGSQR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js.map → chunk-FT3QTERD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HK72NWAD.js.map → chunk-G24G7ZAV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js.map → chunk-G64OCSKU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js.map → chunk-GANUTS7W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js.map → chunk-GBAX2ZAQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js.map → chunk-GJ7QC5DJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BVEUCSH2.js.map → chunk-GPLPTGOV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YZIR4R3U.js.map → chunk-GZRDYONU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js.map → chunk-IWVU4C2F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js.map → chunk-IX5BXEMX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js.map → chunk-JDDLOQAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js.map → chunk-JJP45OEI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TT42JUMF.js.map → chunk-K46RF36U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js.map → chunk-KGFUY7WN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js.map → chunk-KUOOJR35.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js.map → chunk-L5PSPMZ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js.map → chunk-LPSSSDJR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FDBARR33.js.map → chunk-MA4SM3QZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PPAJG4GB.js.map → chunk-MFAZSEM5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5JZ7APJU.js.map → chunk-MFSCBT5Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4OFLJHX6.js.map → chunk-MLIYFOE7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js.map → chunk-MUH7A3FD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js.map → chunk-MVYWGY2A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js.map → chunk-MWMVPCIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js.map → chunk-NGXQ3PFT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EZFKWSC7.js.map → chunk-NMP5I3I5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js.map → chunk-O6AWCQRQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js.map → chunk-OGWQ2IEP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S4APD35C.js.map → chunk-QLMX7SRD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MZ7VNEVY.js.map → chunk-RFNYTESG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MTTXDAK4.js.map → chunk-SCUR7K7N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P5YORJRH.js.map → chunk-SHQY2IDC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js.map → chunk-SMB7RV23.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N7X4WP6L.js.map → chunk-SPZ6DOGY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js.map → chunk-SQYJ4HF2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4LRVSBO6.js.map → chunk-T42JWV3F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NBFCNJ7Q.js.map → chunk-TULGS6X6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZJB3UV5U.js.map → chunk-TZXRBVAM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZD34OFFQ.js.map → chunk-VPIM42PC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js.map → chunk-W3DSJQIO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js.map → chunk-W572BIEB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Z2CRRZYF.js.map → chunk-WRTENIX3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js.map → chunk-XB7KFVFI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js.map → chunk-XG625QP4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js.map → chunk-XUC7PI2H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js.map → chunk-Y46GD4IX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js.map → chunk-Y4M7CPQP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js.map → chunk-YN7Y6DQZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js.map → chunk-ZGK4L4JM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LEKT4K7I.js.map → chunk-ZSUS2OD3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js.map → chunk-ZZD4J5XY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-HXJLKCRI.js.map → claim-RFS7BROJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js.map → claim-XP5AWZ5H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js.map → close-2SSSHHUZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-WKOZKPQR.js.map → close-GEANHQ2J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ZF6ZZPOU.js.map → close-many-CMZW7ITN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-NBAH62ML.js.map → close-many-ZFDIG6M7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-SGPYRAFT.js.map → comments-MFSYVNNU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-RYKLC72X.js.map → comments-XUBPXDYX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-4H3FCKF3.js.map → config-D7XQMONX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js.map → config-T4FHBSYN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-RPIPQUNV.js.map → context-DIU275XI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-SKQAESQS.js.map → context-JCOYB4LZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-64LHZ3HM.js.map → contracts-BVO7CSLK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-7LXBTEKI.js.map → contracts-NYPEW2G4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js.map → copy-32ROBIDL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-PXOFL6AM.js.map → copy-NAGLGMHZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js.map → create-4V7SWNBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js.map → create-E77SDCUP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-WNUNBQXO.js.map → delete-NQI5OSKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-3S72CTD6.js.map → delete-RA5KTCLB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-DQ2QFJ7W.js.map → deps-32SU7HO5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-W7QBLVJS.js.map → deps-T7SCWXEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-245OINZR.js.map → docs-RRUPT7O2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-ZRD4GCTT.js.map → docs-WL2IWGWV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SJZ6S77U.js.map → eval-NF2J5SHR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SFLZPJXX.js.map → eval-SKDT3MZU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-FB3FNDLZ.js.map → register-list-query-B42JCCOI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-5H66WFYF.js.map → register-list-query-OEYQHFXO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js.map → register-mutation-3QXIHCQG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js.map → register-mutation-IAEST26S.js.map} +0 -0
|
@@ -0,0 +1,1765 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="825d45fe-c7c3-54cc-b538-e616300b0747")}catch(e){}}();
|
|
3
|
+
import {
|
|
4
|
+
nowIso
|
|
5
|
+
} from "./chunk-3GCS5SKL.js";
|
|
6
|
+
import {
|
|
7
|
+
readSettings,
|
|
8
|
+
writeSettings
|
|
9
|
+
} from "./chunk-E3SZTQ4K.js";
|
|
10
|
+
import {
|
|
11
|
+
EXIT_CODE,
|
|
12
|
+
appendLineAtomic,
|
|
13
|
+
readFileIfExists,
|
|
14
|
+
resolveGlobalPmRoot,
|
|
15
|
+
resolvePmPackageRootFromModule,
|
|
16
|
+
resolveTelemetryErrorCategory,
|
|
17
|
+
writeFileAtomic
|
|
18
|
+
} from "./chunk-57NWPFF2.js";
|
|
19
|
+
|
|
20
|
+
// dist/core/telemetry/observability.js
|
|
21
|
+
var SETUP_ROOT_COMMANDS = /* @__PURE__ */ new Set(["init", "config", "completion", "completion-statuses", "completion-tags", "completion-types"]);
|
|
22
|
+
var QUERY_ROOT_COMMANDS = /* @__PURE__ */ new Set([
|
|
23
|
+
"list",
|
|
24
|
+
"list-all",
|
|
25
|
+
"list-open",
|
|
26
|
+
"list-in-progress",
|
|
27
|
+
"list-blocked",
|
|
28
|
+
"list-closed",
|
|
29
|
+
"list-canceled",
|
|
30
|
+
"list-draft",
|
|
31
|
+
"search",
|
|
32
|
+
"get",
|
|
33
|
+
"context",
|
|
34
|
+
"calendar",
|
|
35
|
+
"history",
|
|
36
|
+
"activity",
|
|
37
|
+
"aggregate",
|
|
38
|
+
"deps",
|
|
39
|
+
"contracts",
|
|
40
|
+
"stats",
|
|
41
|
+
"dedupe-audit"
|
|
42
|
+
]);
|
|
43
|
+
var MUTATION_ROOT_COMMANDS = /* @__PURE__ */ new Set([
|
|
44
|
+
"create",
|
|
45
|
+
"update",
|
|
46
|
+
"update-many",
|
|
47
|
+
"close-many",
|
|
48
|
+
"append",
|
|
49
|
+
"close",
|
|
50
|
+
"delete",
|
|
51
|
+
"restore",
|
|
52
|
+
"claim",
|
|
53
|
+
"release",
|
|
54
|
+
"comments",
|
|
55
|
+
"notes",
|
|
56
|
+
"learnings",
|
|
57
|
+
"files",
|
|
58
|
+
"docs",
|
|
59
|
+
"start-task",
|
|
60
|
+
"pause-task",
|
|
61
|
+
"close-task"
|
|
62
|
+
]);
|
|
63
|
+
var TESTING_ROOT_COMMANDS = /* @__PURE__ */ new Set(["test", "test-all", "test-runs", "test-verify", "trace-test", "test-ping"]);
|
|
64
|
+
var DIAGNOSTICS_ROOT_COMMANDS = /* @__PURE__ */ new Set(["health", "validate", "normalize", "reindex", "gc", "telemetry", "extension-doctor"]);
|
|
65
|
+
function normalizeCommandPath(commandPath) {
|
|
66
|
+
return commandPath.trim().replaceAll(/\s+/g, " ").toLowerCase();
|
|
67
|
+
}
|
|
68
|
+
function normalizeErrorCode(errorCode2) {
|
|
69
|
+
const normalized = errorCode2?.trim().toLowerCase();
|
|
70
|
+
return normalized && normalized.length > 0 ? normalized : void 0;
|
|
71
|
+
}
|
|
72
|
+
var TELEMETRY_ERROR_MESSAGE_CLASSIFIERS = [
|
|
73
|
+
{ code: "unknown_command", matches: (message) => message.includes("unknown command") },
|
|
74
|
+
{ code: "unknown_option", matches: (message) => message.includes("unknown option") },
|
|
75
|
+
{
|
|
76
|
+
code: "missing_required_option",
|
|
77
|
+
matches: (message) => message.includes("missing required options") || message.includes("missing required option")
|
|
78
|
+
},
|
|
79
|
+
{ code: "missing_required_argument", matches: (message) => message.includes("missing required argument") },
|
|
80
|
+
{ code: "no_update_fields", matches: (message) => message.includes("no update flags provided") },
|
|
81
|
+
{
|
|
82
|
+
code: "ownership_conflict",
|
|
83
|
+
matches: (message) => message.includes("is assigned to") && message.includes("use --force")
|
|
84
|
+
},
|
|
85
|
+
{ code: "lock_conflict", matches: (message) => message.includes("is locked") },
|
|
86
|
+
{
|
|
87
|
+
code: "terminal_state_conflict",
|
|
88
|
+
matches: (message) => message.includes("already terminal") && message.includes("use --force")
|
|
89
|
+
},
|
|
90
|
+
{ code: "tracker_not_initialized", matches: (message) => message.includes("tracker is not initialized") },
|
|
91
|
+
{ code: "item_not_found", matches: (message) => message.includes(" not found") },
|
|
92
|
+
{
|
|
93
|
+
code: "close_through_update",
|
|
94
|
+
matches: (message) => message.includes('use "pm close <id> <text>" to close an item') || message.includes("invalid --status value") && message.includes('"closed"')
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
code: "invalid_argument_value",
|
|
98
|
+
matches: (message) => message.startsWith("invalid ") || message.includes(" must be ") || message.includes(" requires ")
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
code: "invalid_command_usage",
|
|
102
|
+
matches: (message) => message.includes("either as positional") && message.includes("not both")
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
var TELEMETRY_EXIT_CODE_FALLBACKS = /* @__PURE__ */ new Map([
|
|
106
|
+
[EXIT_CODE.USAGE, "invalid_command_usage"],
|
|
107
|
+
[EXIT_CODE.NOT_FOUND, "item_not_found"],
|
|
108
|
+
[EXIT_CODE.CONFLICT, "lock_conflict"],
|
|
109
|
+
[EXIT_CODE.DEPENDENCY_FAILED, "dependency_failed"]
|
|
110
|
+
]);
|
|
111
|
+
function deriveTelemetryCommandTaxonomy(commandPath) {
|
|
112
|
+
const normalizedPath = normalizeCommandPath(commandPath);
|
|
113
|
+
const tokens = normalizedPath.length > 0 ? normalizedPath.split(" ") : ["<unknown>"];
|
|
114
|
+
const root = tokens[0];
|
|
115
|
+
const leaf = tokens[tokens.length - 1];
|
|
116
|
+
let family = "other";
|
|
117
|
+
if (SETUP_ROOT_COMMANDS.has(root)) {
|
|
118
|
+
family = "setup";
|
|
119
|
+
} else if (QUERY_ROOT_COMMANDS.has(root)) {
|
|
120
|
+
family = "query";
|
|
121
|
+
} else if (MUTATION_ROOT_COMMANDS.has(root)) {
|
|
122
|
+
family = "mutation";
|
|
123
|
+
} else if (TESTING_ROOT_COMMANDS.has(root)) {
|
|
124
|
+
family = "testing";
|
|
125
|
+
} else if (root === "extension") {
|
|
126
|
+
family = "extension";
|
|
127
|
+
} else if (DIAGNOSTICS_ROOT_COMMANDS.has(root)) {
|
|
128
|
+
family = "diagnostics";
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
command_path: normalizedPath.length > 0 ? normalizedPath : "<unknown>",
|
|
132
|
+
command_root: root,
|
|
133
|
+
command_leaf: leaf,
|
|
134
|
+
command_depth: tokens.length,
|
|
135
|
+
command_family: family
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function inferTelemetryErrorCode(params) {
|
|
139
|
+
if (params.ok) {
|
|
140
|
+
return void 0;
|
|
141
|
+
}
|
|
142
|
+
const explicit = normalizeErrorCode(params.errorCode);
|
|
143
|
+
if (explicit) {
|
|
144
|
+
return explicit;
|
|
145
|
+
}
|
|
146
|
+
const message = (params.errorMessage ?? "").trim().toLowerCase();
|
|
147
|
+
for (const classifier of TELEMETRY_ERROR_MESSAGE_CLASSIFIERS) {
|
|
148
|
+
if (classifier.matches(message)) {
|
|
149
|
+
return classifier.code;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const exitCode = Number.isFinite(params.exitCode) ? Math.max(0, Math.trunc(params.exitCode)) : void 0;
|
|
153
|
+
if (exitCode !== void 0) {
|
|
154
|
+
return TELEMETRY_EXIT_CODE_FALLBACKS.get(exitCode) ?? "command_failed";
|
|
155
|
+
}
|
|
156
|
+
return "command_failed";
|
|
157
|
+
}
|
|
158
|
+
function deriveTelemetryCommandResolution(params) {
|
|
159
|
+
if (params.ok) {
|
|
160
|
+
return "success";
|
|
161
|
+
}
|
|
162
|
+
const normalizedCode = normalizeErrorCode(params.errorCode);
|
|
163
|
+
if (normalizedCode === "unknown_command") {
|
|
164
|
+
return "nonexistent_command";
|
|
165
|
+
}
|
|
166
|
+
if (normalizedCode === "unknown_option") {
|
|
167
|
+
return "invalid_option";
|
|
168
|
+
}
|
|
169
|
+
if (normalizedCode === "missing_required_option") {
|
|
170
|
+
return "missing_required_option";
|
|
171
|
+
}
|
|
172
|
+
if (normalizedCode === "missing_required_argument") {
|
|
173
|
+
return "missing_required_argument";
|
|
174
|
+
}
|
|
175
|
+
if (normalizedCode === "health_findings") {
|
|
176
|
+
return "health_findings";
|
|
177
|
+
}
|
|
178
|
+
if (normalizedCode === "validation_findings") {
|
|
179
|
+
return "validation_findings";
|
|
180
|
+
}
|
|
181
|
+
if (params.errorCategory === "usage") {
|
|
182
|
+
return "invalid_usage";
|
|
183
|
+
}
|
|
184
|
+
if (params.errorCategory === "validation") {
|
|
185
|
+
return "validation_failed";
|
|
186
|
+
}
|
|
187
|
+
if (params.errorCategory === "conflict") {
|
|
188
|
+
return "conflict";
|
|
189
|
+
}
|
|
190
|
+
if (params.errorCategory === "runtime") {
|
|
191
|
+
return "runtime_failed";
|
|
192
|
+
}
|
|
193
|
+
return "unknown_failed";
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// dist/core/telemetry/runtime.js
|
|
197
|
+
import crypto from "node:crypto";
|
|
198
|
+
import { spawn } from "node:child_process";
|
|
199
|
+
import { mkdirSync, rmSync, statSync } from "node:fs";
|
|
200
|
+
import { mkdir, readdir, rm, stat } from "node:fs/promises";
|
|
201
|
+
import os from "node:os";
|
|
202
|
+
import path from "node:path";
|
|
203
|
+
var TELEMETRY_QUEUE_RELATIVE_PATH = path.join("runtime", "telemetry", "events.jsonl");
|
|
204
|
+
var TELEMETRY_STATE_RELATIVE_PATH = path.join("runtime", "telemetry", "state.json");
|
|
205
|
+
var TELEMETRY_OTEL_SPANS_RELATIVE_PATH = path.join("runtime", "telemetry", "otel-spans.jsonl");
|
|
206
|
+
var TELEMETRY_OTEL_SPANS_FLUSH_BATCH_SIZE = 8;
|
|
207
|
+
var TELEMETRY_OTEL_SPANS_MAX_PENDING = 500;
|
|
208
|
+
var TELEMETRY_SCHEMA_VERSION = 1;
|
|
209
|
+
var TELEMETRY_CLIENT_SCHEMA_VERSION = 1;
|
|
210
|
+
var TELEMETRY_FLUSH_BATCH_SIZE = 100;
|
|
211
|
+
var TELEMETRY_MAX_RETRY_DELAY_MS = 36e5;
|
|
212
|
+
var TELEMETRY_RETRY_BASE_DELAY_MS = 3e4;
|
|
213
|
+
var TELEMETRY_HTTP_TIMEOUT_MS = 5e3;
|
|
214
|
+
var MILLISECONDS_PER_DAY = 864e5;
|
|
215
|
+
var TELEMETRY_MAX_EVENT_BYTES = 65536;
|
|
216
|
+
var TELEMETRY_SANITIZE_MAX_DEPTH = 6;
|
|
217
|
+
var TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS = 20;
|
|
218
|
+
var TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS = 15;
|
|
219
|
+
var TELEMETRY_RESULT_PREVIEW_MAX_BYTES = 8192;
|
|
220
|
+
var TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS = [25, 50, 100, 200];
|
|
221
|
+
var TELEMETRY_QUEUE_TMP_ORPHAN_MAX_AGE_MS = 60 * 60 * 1e3;
|
|
222
|
+
var TELEMETRY_FLUSH_LOCK_STALE_MS = 6e4;
|
|
223
|
+
var TELEMETRY_FLUSH_SPAWN_LOCK_STALE_MS = 6e4;
|
|
224
|
+
var OTEL_TRACES_ENDPOINT_ENV = "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT";
|
|
225
|
+
var OTEL_BASE_ENDPOINT_ENV = "OTEL_EXPORTER_OTLP_ENDPOINT";
|
|
226
|
+
var OTEL_SERVICE_NAME_ENV = "OTEL_SERVICE_NAME";
|
|
227
|
+
var PM_TELEMETRY_DISABLED_ENV = "PM_TELEMETRY_DISABLED";
|
|
228
|
+
var PM_NO_TELEMETRY_ENV = "PM_NO_TELEMETRY";
|
|
229
|
+
var PM_TELEMETRY_DISABLED_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
|
|
230
|
+
var PM_TELEMETRY_OTEL_DISABLED_ENV = "PM_TELEMETRY_OTEL_DISABLED";
|
|
231
|
+
var PM_TELEMETRY_OTEL_DISABLED_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
|
|
232
|
+
var PM_TELEMETRY_INLINE_FLUSH_ENV = "PM_TELEMETRY_INLINE_FLUSH";
|
|
233
|
+
var PM_TELEMETRY_FLUSH_CHILD_ENV = "PM_TELEMETRY_FLUSH_CHILD";
|
|
234
|
+
var PM_TELEMETRY_SOURCE_CONTEXT_ENV = "PM_TELEMETRY_SOURCE_CONTEXT";
|
|
235
|
+
var PM_AUTHOR_ENV = "PM_AUTHOR";
|
|
236
|
+
var PM_TELEMETRY_SOURCE_CONTEXT_VALUES = ["user", "automation", "test", "dogfood", "audit_smoke"];
|
|
237
|
+
var _lastFlushPromise = Promise.resolve();
|
|
238
|
+
var _queueMutationPromise = Promise.resolve();
|
|
239
|
+
var PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);
|
|
240
|
+
var BOOLEAN_TRUE_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
|
|
241
|
+
var PROCESS_SESSION_ID = crypto.randomUUID();
|
|
242
|
+
var SENSITIVE_KEYWORDS = [
|
|
243
|
+
"token",
|
|
244
|
+
"secret",
|
|
245
|
+
"password",
|
|
246
|
+
"passwd",
|
|
247
|
+
"api_key",
|
|
248
|
+
"apikey",
|
|
249
|
+
"authorization",
|
|
250
|
+
"cookie",
|
|
251
|
+
"session",
|
|
252
|
+
"credentials",
|
|
253
|
+
"bearer"
|
|
254
|
+
];
|
|
255
|
+
var SENSITIVE_INLINE_KEY_PATTERN = "(?:token|secret|password|passwd|api[_-]?key|apikey|authorization|cookie|session|credentials|bearer)";
|
|
256
|
+
var INLINE_SENSITIVE_ASSIGNMENT_PATTERN = new RegExp(`\\b(${SENSITIVE_INLINE_KEY_PATTERN})\\s*([:=])\\s*([^\\s,;]+)`, "giu");
|
|
257
|
+
var INLINE_SENSITIVE_FLAG_PATTERN = new RegExp(`(--${SENSITIVE_INLINE_KEY_PATTERN})(=|\\s+)([^\\s,;]+)`, "giu");
|
|
258
|
+
var ABSOLUTE_PATH_TOKEN_PATTERN = /(^|[\s"'`(=])\/(?:[^\s"'`),;]+)/g;
|
|
259
|
+
var BEARER_TOKEN_PATTERN = /bearer\s+[a-z0-9._=-]+/giu;
|
|
260
|
+
var PRIVATE_IP_PATTERN = /\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g;
|
|
261
|
+
function queuePath(globalPmRoot) {
|
|
262
|
+
return path.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH);
|
|
263
|
+
}
|
|
264
|
+
function otelSpansQueuePath(globalPmRoot) {
|
|
265
|
+
return path.join(globalPmRoot, TELEMETRY_OTEL_SPANS_RELATIVE_PATH);
|
|
266
|
+
}
|
|
267
|
+
function telemetryRuntimeDirectory(globalPmRoot) {
|
|
268
|
+
return path.dirname(queuePath(globalPmRoot));
|
|
269
|
+
}
|
|
270
|
+
function runtimeStatePath(globalPmRoot) {
|
|
271
|
+
return path.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH);
|
|
272
|
+
}
|
|
273
|
+
function flushLockPath(globalPmRoot) {
|
|
274
|
+
return path.join(globalPmRoot, "runtime", "telemetry", "flush.lock");
|
|
275
|
+
}
|
|
276
|
+
function flushSpawnLockPath(globalPmRoot) {
|
|
277
|
+
return path.join(globalPmRoot, "runtime", "telemetry", "flush.spawn.lock");
|
|
278
|
+
}
|
|
279
|
+
function telemetryFlushRunnerPath() {
|
|
280
|
+
return path.join(resolvePmPackageRootFromModule(import.meta.url, ["../../.."]), "dist", "cli", "telemetry-flush.js");
|
|
281
|
+
}
|
|
282
|
+
function shouldFlushInline() {
|
|
283
|
+
if (parseBooleanTrueLike(process.env[PM_TELEMETRY_INLINE_FLUSH_ENV])) {
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
if (parseBooleanTrueLike(process.env[PM_TELEMETRY_FLUSH_CHILD_ENV])) {
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
const nodeEnv = (process.env.NODE_ENV ?? "").trim().toLowerCase();
|
|
290
|
+
return typeof process.env.VITEST === "string" || typeof process.env.VITEST_WORKER_ID === "string" || nodeEnv === "test";
|
|
291
|
+
}
|
|
292
|
+
async function readRuntimeState(globalPmRoot) {
|
|
293
|
+
const raw = await readFileIfExists(runtimeStatePath(globalPmRoot));
|
|
294
|
+
if (!raw || raw.trim().length === 0) {
|
|
295
|
+
return {};
|
|
296
|
+
}
|
|
297
|
+
try {
|
|
298
|
+
const parsed = JSON.parse(raw);
|
|
299
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
300
|
+
return {};
|
|
301
|
+
}
|
|
302
|
+
return parsed;
|
|
303
|
+
} catch {
|
|
304
|
+
return {};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
async function writeRuntimeState(globalPmRoot, patch) {
|
|
308
|
+
try {
|
|
309
|
+
const current = await readRuntimeState(globalPmRoot);
|
|
310
|
+
const next = {
|
|
311
|
+
...current,
|
|
312
|
+
...patch
|
|
313
|
+
};
|
|
314
|
+
const normalized = Object.fromEntries(Object.entries(next).filter(([, value]) => value !== void 0).sort((left, right) => left[0].localeCompare(right[0])));
|
|
315
|
+
await writeFileAtomic(runtimeStatePath(globalPmRoot), `${JSON.stringify(normalized, null, 2)}
|
|
316
|
+
`);
|
|
317
|
+
} catch {
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function isSensitiveKey(key) {
|
|
321
|
+
const normalized = key.trim().toLowerCase().replaceAll("-", "_").replaceAll(/[^a-z0-9_]+/g, "_");
|
|
322
|
+
const tokens = normalized.split("_").filter((token) => token.length > 0);
|
|
323
|
+
return SENSITIVE_KEYWORDS.some((keyword) => normalized === keyword || normalized.endsWith(`_${keyword}`) || tokens.includes(keyword));
|
|
324
|
+
}
|
|
325
|
+
function redactInlineSensitiveAssignments(input) {
|
|
326
|
+
const withoutAssignments = input.replaceAll(INLINE_SENSITIVE_ASSIGNMENT_PATTERN, (_match, key, delimiter) => `${key}${delimiter}[redacted]`);
|
|
327
|
+
return withoutAssignments.replaceAll(INLINE_SENSITIVE_FLAG_PATTERN, (_match, flag, delimiter) => `${flag}${delimiter}[redacted]`);
|
|
328
|
+
}
|
|
329
|
+
function redactAbsolutePathTokens(input) {
|
|
330
|
+
return input.replaceAll(ABSOLUTE_PATH_TOKEN_PATTERN, (_match, prefix) => `${prefix}[redacted_path]`);
|
|
331
|
+
}
|
|
332
|
+
function isAsciiLetterOrDigitCode(code) {
|
|
333
|
+
const isUpper = code >= 65 && code <= 90;
|
|
334
|
+
const isLower = code >= 97 && code <= 122;
|
|
335
|
+
const isDigit = code >= 48 && code <= 57;
|
|
336
|
+
return isUpper || isLower || isDigit;
|
|
337
|
+
}
|
|
338
|
+
function isEmailLocalCharacter(character) {
|
|
339
|
+
if (!character) {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
const code = character.charCodeAt(0);
|
|
343
|
+
if (isAsciiLetterOrDigitCode(code)) {
|
|
344
|
+
return true;
|
|
345
|
+
}
|
|
346
|
+
return character === "." || character === "_" || character === "%" || character === "+" || character === "-";
|
|
347
|
+
}
|
|
348
|
+
function isEmailDomainCharacter(character) {
|
|
349
|
+
if (!character) {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
const code = character.charCodeAt(0);
|
|
353
|
+
if (isAsciiLetterOrDigitCode(code)) {
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
return character === "." || character === "-";
|
|
357
|
+
}
|
|
358
|
+
function looksLikeEmailToken(token) {
|
|
359
|
+
const atIndex = token.indexOf("@");
|
|
360
|
+
if (atIndex <= 0 || atIndex !== token.lastIndexOf("@") || atIndex === token.length - 1) {
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
363
|
+
const localPart = token.slice(0, atIndex);
|
|
364
|
+
const domainPart = token.slice(atIndex + 1);
|
|
365
|
+
const lastDot = domainPart.lastIndexOf(".");
|
|
366
|
+
if (lastDot <= 0 || lastDot === domainPart.length - 1) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
if (domainPart.length - (lastDot + 1) < 2) {
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
for (const character of localPart) {
|
|
373
|
+
if (!isEmailLocalCharacter(character)) {
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
for (const character of domainPart) {
|
|
378
|
+
if (!isEmailDomainCharacter(character)) {
|
|
379
|
+
return false;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return true;
|
|
383
|
+
}
|
|
384
|
+
function redactEmailTokens(input) {
|
|
385
|
+
let redacted = "";
|
|
386
|
+
let cursor = 0;
|
|
387
|
+
while (cursor < input.length) {
|
|
388
|
+
const atIndex = input.indexOf("@", cursor);
|
|
389
|
+
if (atIndex < 0) {
|
|
390
|
+
redacted += input.slice(cursor);
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
let start = atIndex - 1;
|
|
394
|
+
while (start >= cursor && isEmailLocalCharacter(input[start])) {
|
|
395
|
+
start -= 1;
|
|
396
|
+
}
|
|
397
|
+
start += 1;
|
|
398
|
+
let end = atIndex + 1;
|
|
399
|
+
while (end < input.length && isEmailDomainCharacter(input[end])) {
|
|
400
|
+
end += 1;
|
|
401
|
+
}
|
|
402
|
+
const candidate = input.slice(start, end);
|
|
403
|
+
if (looksLikeEmailToken(candidate)) {
|
|
404
|
+
redacted += input.slice(cursor, start);
|
|
405
|
+
redacted += "[redacted_email]";
|
|
406
|
+
cursor = end;
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
redacted += input.slice(cursor, atIndex + 1);
|
|
410
|
+
cursor = atIndex + 1;
|
|
411
|
+
}
|
|
412
|
+
return redacted;
|
|
413
|
+
}
|
|
414
|
+
function sanitizeCommonSensitiveTokens(input) {
|
|
415
|
+
const withoutEmails = redactEmailTokens(input);
|
|
416
|
+
const withoutBearer = withoutEmails.replaceAll(BEARER_TOKEN_PATTERN, "bearer [redacted_token]");
|
|
417
|
+
return withoutBearer.replaceAll(PRIVATE_IP_PATTERN, "[redacted_ip]");
|
|
418
|
+
}
|
|
419
|
+
function sanitizeStringRedacted(input) {
|
|
420
|
+
const withoutCommonSensitiveTokens = sanitizeCommonSensitiveTokens(input);
|
|
421
|
+
const withoutInlineSecrets = redactInlineSensitiveAssignments(withoutCommonSensitiveTokens);
|
|
422
|
+
const withoutAbsolutePaths = redactAbsolutePathTokens(withoutInlineSecrets);
|
|
423
|
+
const trimmed = withoutAbsolutePaths.trim();
|
|
424
|
+
if (trimmed.startsWith("/") && trimmed.length > 1) {
|
|
425
|
+
return "[redacted_path]";
|
|
426
|
+
}
|
|
427
|
+
if (withoutAbsolutePaths.length > 512) {
|
|
428
|
+
return `${withoutAbsolutePaths.slice(0, 509)}...`;
|
|
429
|
+
}
|
|
430
|
+
return withoutAbsolutePaths;
|
|
431
|
+
}
|
|
432
|
+
function sanitizeStringMax(input) {
|
|
433
|
+
const withoutCommonSensitiveTokens = sanitizeCommonSensitiveTokens(input);
|
|
434
|
+
const withoutInlineSecrets = redactInlineSensitiveAssignments(withoutCommonSensitiveTokens);
|
|
435
|
+
const withoutAbsolutePaths = redactAbsolutePathTokens(withoutInlineSecrets);
|
|
436
|
+
const trimmed = withoutAbsolutePaths.trim();
|
|
437
|
+
if (trimmed.startsWith("/") && trimmed.length > 1) {
|
|
438
|
+
return "[redacted_path]";
|
|
439
|
+
}
|
|
440
|
+
if (withoutAbsolutePaths.length > 2048) {
|
|
441
|
+
return `${withoutAbsolutePaths.slice(0, 2045)}...`;
|
|
442
|
+
}
|
|
443
|
+
return withoutAbsolutePaths;
|
|
444
|
+
}
|
|
445
|
+
function sanitizeString(input, captureLevel = "redacted") {
|
|
446
|
+
if (captureLevel === "max") {
|
|
447
|
+
return sanitizeStringMax(input);
|
|
448
|
+
}
|
|
449
|
+
return sanitizeStringRedacted(input);
|
|
450
|
+
}
|
|
451
|
+
function sanitizeValue(value, keyHint, captureLevel = "redacted", depth = 0) {
|
|
452
|
+
if (keyHint && isSensitiveKey(keyHint)) {
|
|
453
|
+
return "[redacted]";
|
|
454
|
+
}
|
|
455
|
+
if (value === null || value === void 0) {
|
|
456
|
+
return value;
|
|
457
|
+
}
|
|
458
|
+
if (typeof value === "string") {
|
|
459
|
+
return sanitizeString(value, captureLevel);
|
|
460
|
+
}
|
|
461
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
462
|
+
return value;
|
|
463
|
+
}
|
|
464
|
+
if (depth >= TELEMETRY_SANITIZE_MAX_DEPTH) {
|
|
465
|
+
return "[depth_truncated]";
|
|
466
|
+
}
|
|
467
|
+
if (Array.isArray(value)) {
|
|
468
|
+
return value.slice(0, TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS).map((entry) => sanitizeValue(entry, void 0, captureLevel, depth + 1));
|
|
469
|
+
}
|
|
470
|
+
if (typeof value === "object") {
|
|
471
|
+
const record = value;
|
|
472
|
+
const sanitized = {};
|
|
473
|
+
for (const [key, nested] of Object.entries(record)) {
|
|
474
|
+
sanitized[key] = sanitizeValue(nested, key, captureLevel, depth + 1);
|
|
475
|
+
}
|
|
476
|
+
return sanitized;
|
|
477
|
+
}
|
|
478
|
+
return String(value);
|
|
479
|
+
}
|
|
480
|
+
function sanitizeCommandArgs(args, captureLevel = "redacted") {
|
|
481
|
+
const sanitized = [];
|
|
482
|
+
let nextIsSensitiveValue = false;
|
|
483
|
+
for (const rawArg of args) {
|
|
484
|
+
const arg = sanitizeString(rawArg, captureLevel);
|
|
485
|
+
if (nextIsSensitiveValue) {
|
|
486
|
+
sanitized.push("[redacted]");
|
|
487
|
+
nextIsSensitiveValue = false;
|
|
488
|
+
continue;
|
|
489
|
+
}
|
|
490
|
+
if (arg.startsWith("--")) {
|
|
491
|
+
const withoutPrefix = arg.slice(2);
|
|
492
|
+
const delimiterIndex = withoutPrefix.indexOf("=");
|
|
493
|
+
if (delimiterIndex >= 0) {
|
|
494
|
+
const key = withoutPrefix.slice(0, delimiterIndex);
|
|
495
|
+
const value = withoutPrefix.slice(delimiterIndex + 1);
|
|
496
|
+
if (isSensitiveKey(key)) {
|
|
497
|
+
sanitized.push(`--${key}=[redacted]`);
|
|
498
|
+
} else {
|
|
499
|
+
sanitized.push(`--${key}=${sanitizeString(value, captureLevel)}`);
|
|
500
|
+
}
|
|
501
|
+
continue;
|
|
502
|
+
}
|
|
503
|
+
if (isSensitiveKey(withoutPrefix)) {
|
|
504
|
+
sanitized.push(`--${withoutPrefix}`);
|
|
505
|
+
nextIsSensitiveValue = true;
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
sanitized.push(arg);
|
|
510
|
+
}
|
|
511
|
+
return sanitized;
|
|
512
|
+
}
|
|
513
|
+
function normalizeCaptureLevel(value) {
|
|
514
|
+
const normalized = value?.trim().toLowerCase();
|
|
515
|
+
if (normalized === "minimal" || normalized === "redacted" || normalized === "max") {
|
|
516
|
+
return normalized;
|
|
517
|
+
}
|
|
518
|
+
return "redacted";
|
|
519
|
+
}
|
|
520
|
+
function parseBooleanTrueLike(value) {
|
|
521
|
+
return BOOLEAN_TRUE_VALUES.has((value ?? "").trim().toLowerCase());
|
|
522
|
+
}
|
|
523
|
+
function normalizePmVersion(value) {
|
|
524
|
+
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
525
|
+
return trimmed.length > 0 ? trimmed : "0.0.0";
|
|
526
|
+
}
|
|
527
|
+
function normalizeTelemetryErrorCode(value) {
|
|
528
|
+
const normalized = value?.trim();
|
|
529
|
+
return normalized && normalized.length > 0 ? normalized : void 0;
|
|
530
|
+
}
|
|
531
|
+
function normalizeTelemetryExitCode(exitCode, ok) {
|
|
532
|
+
if (Number.isFinite(exitCode)) {
|
|
533
|
+
return Math.max(0, Math.trunc(exitCode));
|
|
534
|
+
}
|
|
535
|
+
return ok ? 0 : 1;
|
|
536
|
+
}
|
|
537
|
+
function normalizeTelemetryErrorCategory(params) {
|
|
538
|
+
if (params.ok) {
|
|
539
|
+
return void 0;
|
|
540
|
+
}
|
|
541
|
+
if (typeof params.errorCategory === "string" && params.errorCategory.trim().length > 0) {
|
|
542
|
+
return params.errorCategory;
|
|
543
|
+
}
|
|
544
|
+
if (typeof params.errorCode === "string" && params.errorCode.trim().length > 0) {
|
|
545
|
+
return resolveTelemetryErrorCategory(params.errorCode);
|
|
546
|
+
}
|
|
547
|
+
return "unknown";
|
|
548
|
+
}
|
|
549
|
+
function resolveTelemetrySourceContext(globalOptions) {
|
|
550
|
+
const override = (process.env[PM_TELEMETRY_SOURCE_CONTEXT_ENV] ?? "").trim().toLowerCase();
|
|
551
|
+
if (PM_TELEMETRY_SOURCE_CONTEXT_SET.has(override)) {
|
|
552
|
+
return {
|
|
553
|
+
source_context: override,
|
|
554
|
+
source_context_source: "env_override"
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
const nodeEnv = (process.env.NODE_ENV ?? "").trim().toLowerCase();
|
|
558
|
+
if (typeof process.env.VITEST === "string" || typeof process.env.VITEST_WORKER_ID === "string" || nodeEnv === "test") {
|
|
559
|
+
return {
|
|
560
|
+
source_context: "test",
|
|
561
|
+
source_context_source: "inferred"
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
const nonTty = process.stdin.isTTY !== true || process.stdout.isTTY !== true;
|
|
565
|
+
const ci = parseBooleanTrueLike(process.env.CI);
|
|
566
|
+
const scriptLikeMode = globalOptions.json === true || globalOptions.quiet === true;
|
|
567
|
+
if (nonTty || ci || scriptLikeMode) {
|
|
568
|
+
return {
|
|
569
|
+
source_context: "automation",
|
|
570
|
+
source_context_source: "inferred"
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
return {
|
|
574
|
+
source_context: "user",
|
|
575
|
+
source_context_source: "inferred"
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
function hashWithInstallationId(installationId, value) {
|
|
579
|
+
return crypto.createHash("sha256").update(`${installationId}:${value}`).digest("hex");
|
|
580
|
+
}
|
|
581
|
+
function buildAuthorContextPayloadFields(captureLevel, installationId) {
|
|
582
|
+
const author = (process.env[PM_AUTHOR_ENV] ?? "").trim();
|
|
583
|
+
if (captureLevel === "minimal") {
|
|
584
|
+
return { has_author_context: author.length > 0 };
|
|
585
|
+
}
|
|
586
|
+
return author.length > 0 ? { author_context_hash: hashWithInstallationId(installationId, author) } : {};
|
|
587
|
+
}
|
|
588
|
+
function normalizeForHash(value, depth = 0) {
|
|
589
|
+
if (value === null || value === void 0) {
|
|
590
|
+
return value;
|
|
591
|
+
}
|
|
592
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
593
|
+
return value;
|
|
594
|
+
}
|
|
595
|
+
if (depth >= TELEMETRY_SANITIZE_MAX_DEPTH) {
|
|
596
|
+
return "[depth_truncated]";
|
|
597
|
+
}
|
|
598
|
+
if (Array.isArray(value)) {
|
|
599
|
+
return value.slice(0, TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS).map((entry) => normalizeForHash(entry, depth + 1));
|
|
600
|
+
}
|
|
601
|
+
if (typeof value === "object") {
|
|
602
|
+
const record = value;
|
|
603
|
+
const normalized = {};
|
|
604
|
+
const sortedKeys = Object.keys(record).sort((left, right) => left.localeCompare(right));
|
|
605
|
+
for (const key of sortedKeys) {
|
|
606
|
+
normalized[key] = normalizeForHash(record[key], depth + 1);
|
|
607
|
+
}
|
|
608
|
+
return normalized;
|
|
609
|
+
}
|
|
610
|
+
return String(value);
|
|
611
|
+
}
|
|
612
|
+
function hashTelemetryValue(installationId, value) {
|
|
613
|
+
return hashWithInstallationId(installationId, JSON.stringify(normalizeForHash(value)));
|
|
614
|
+
}
|
|
615
|
+
function hashCommandArgs(installationId, args) {
|
|
616
|
+
return {
|
|
617
|
+
hashes: args.map((arg) => hashWithInstallationId(installationId, arg)),
|
|
618
|
+
digest: hashWithInstallationId(installationId, args.join("\0"))
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
function hashTelemetryErrorFingerprint(installationId, command, errorCode2, errorMessage) {
|
|
622
|
+
const normalizedMessage = sanitizeString(typeof errorMessage === "string" ? errorMessage : "", "redacted");
|
|
623
|
+
const normalizedCode = typeof errorCode2 === "string" && errorCode2.length > 0 ? errorCode2 : "unknown_error";
|
|
624
|
+
const fingerprintSource = `${command}\0${normalizedCode}\0${normalizedMessage}`;
|
|
625
|
+
return hashWithInstallationId(installationId, fingerprintSource);
|
|
626
|
+
}
|
|
627
|
+
function telemetryDisabledByEnvironment() {
|
|
628
|
+
return PM_TELEMETRY_DISABLED_VALUES.has((process.env[PM_TELEMETRY_DISABLED_ENV] ?? "").trim().toLowerCase()) || PM_TELEMETRY_DISABLED_VALUES.has((process.env[PM_NO_TELEMETRY_ENV] ?? "").trim().toLowerCase());
|
|
629
|
+
}
|
|
630
|
+
function resolveOtelTracesEndpoint() {
|
|
631
|
+
if (PM_TELEMETRY_OTEL_DISABLED_VALUES.has((process.env[PM_TELEMETRY_OTEL_DISABLED_ENV] ?? "").trim().toLowerCase())) {
|
|
632
|
+
return null;
|
|
633
|
+
}
|
|
634
|
+
const directEndpoint = (process.env[OTEL_TRACES_ENDPOINT_ENV] ?? "").trim();
|
|
635
|
+
if (directEndpoint.length > 0) {
|
|
636
|
+
try {
|
|
637
|
+
return new URL(directEndpoint).toString();
|
|
638
|
+
} catch {
|
|
639
|
+
return null;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
const baseEndpoint = (process.env[OTEL_BASE_ENDPOINT_ENV] ?? "").trim();
|
|
643
|
+
if (baseEndpoint.length === 0) {
|
|
644
|
+
return null;
|
|
645
|
+
}
|
|
646
|
+
try {
|
|
647
|
+
const url = new URL(baseEndpoint);
|
|
648
|
+
const normalizedPath = url.pathname.replace(/\/+$/, "");
|
|
649
|
+
if (!normalizedPath.endsWith("/v1/traces")) {
|
|
650
|
+
url.pathname = `${normalizedPath.length === 0 ? "" : normalizedPath}/v1/traces`;
|
|
651
|
+
}
|
|
652
|
+
return url.toString();
|
|
653
|
+
} catch {
|
|
654
|
+
return null;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
function isoToUnixNano(iso) {
|
|
658
|
+
const parsedMs = Date.parse(iso);
|
|
659
|
+
const epochMs = Number.isNaN(parsedMs) ? Date.now() : parsedMs;
|
|
660
|
+
return `${BigInt(epochMs) * 1000000n}`;
|
|
661
|
+
}
|
|
662
|
+
function otlpStringAttribute(key, value) {
|
|
663
|
+
return {
|
|
664
|
+
key,
|
|
665
|
+
value: { stringValue: value }
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
function otlpBoolAttribute(key, value) {
|
|
669
|
+
return {
|
|
670
|
+
key,
|
|
671
|
+
value: { boolValue: value }
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
function otlpIntAttribute(key, value) {
|
|
675
|
+
return {
|
|
676
|
+
key,
|
|
677
|
+
value: { intValue: String(Math.max(0, Math.trunc(value))) }
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
function buildOtelSpanRequest(activeCommand, outcome, finishedAtIso, durationMs) {
|
|
681
|
+
if (typeof activeCommand.otel_traces_endpoint !== "string" || activeCommand.otel_traces_endpoint.trim().length === 0 || typeof activeCommand.otel_trace_id !== "string" || activeCommand.otel_trace_id.length === 0 || typeof activeCommand.otel_span_id !== "string" || activeCommand.otel_span_id.length === 0) {
|
|
682
|
+
return null;
|
|
683
|
+
}
|
|
684
|
+
const serviceNameCandidate = sanitizeString((process.env[OTEL_SERVICE_NAME_ENV] ?? "").trim());
|
|
685
|
+
const serviceName = serviceNameCandidate.length > 0 ? serviceNameCandidate : "pm-cli";
|
|
686
|
+
const normalizedExitCode = normalizeTelemetryExitCode(outcome.exit_code, outcome.ok);
|
|
687
|
+
const normalizedErrorCode = normalizeTelemetryErrorCode(outcome.error_code);
|
|
688
|
+
const normalizedErrorCategory = normalizeTelemetryErrorCategory({
|
|
689
|
+
ok: outcome.ok,
|
|
690
|
+
errorCode: normalizedErrorCode,
|
|
691
|
+
errorCategory: outcome.error_category
|
|
692
|
+
});
|
|
693
|
+
const attributes = [
|
|
694
|
+
otlpStringAttribute("pm.command", sanitizeString(activeCommand.command)),
|
|
695
|
+
otlpStringAttribute("pm.version", activeCommand.pm_version),
|
|
696
|
+
otlpStringAttribute("pm.source_context", activeCommand.source_context),
|
|
697
|
+
otlpStringAttribute("pm.source_context_source", activeCommand.source_context_source),
|
|
698
|
+
otlpStringAttribute("pm.installation_id", activeCommand.installation_id),
|
|
699
|
+
otlpStringAttribute("pm.session_id", PROCESS_SESSION_ID),
|
|
700
|
+
otlpStringAttribute("pm.pm_root_hash", activeCommand.pm_root_hash),
|
|
701
|
+
otlpStringAttribute("pm.cwd_hash", activeCommand.cwd_hash),
|
|
702
|
+
otlpBoolAttribute("pm.ok", outcome.ok),
|
|
703
|
+
otlpIntAttribute("pm.exit_code", normalizedExitCode),
|
|
704
|
+
otlpIntAttribute("pm.duration_ms", durationMs)
|
|
705
|
+
];
|
|
706
|
+
if (typeof normalizedErrorCode === "string") {
|
|
707
|
+
attributes.push(otlpStringAttribute("pm.error_code", normalizedErrorCode));
|
|
708
|
+
}
|
|
709
|
+
if (typeof normalizedErrorCategory === "string") {
|
|
710
|
+
attributes.push(otlpStringAttribute("pm.error_category", normalizedErrorCategory));
|
|
711
|
+
}
|
|
712
|
+
if (typeof outcome.error === "string" && outcome.error.trim().length > 0) {
|
|
713
|
+
attributes.push(otlpStringAttribute("pm.error", sanitizeString(outcome.error)));
|
|
714
|
+
}
|
|
715
|
+
const payload = {
|
|
716
|
+
resourceSpans: [
|
|
717
|
+
{
|
|
718
|
+
resource: {
|
|
719
|
+
attributes: [otlpStringAttribute("service.name", serviceName)]
|
|
720
|
+
},
|
|
721
|
+
scopeSpans: [
|
|
722
|
+
{
|
|
723
|
+
scope: {
|
|
724
|
+
name: "pm-cli.telemetry",
|
|
725
|
+
version: "1"
|
|
726
|
+
},
|
|
727
|
+
spans: [
|
|
728
|
+
{
|
|
729
|
+
traceId: activeCommand.otel_trace_id,
|
|
730
|
+
spanId: activeCommand.otel_span_id,
|
|
731
|
+
name: `pm.command.${sanitizeString(activeCommand.command)}`,
|
|
732
|
+
kind: 1,
|
|
733
|
+
startTimeUnixNano: isoToUnixNano(activeCommand.started_at),
|
|
734
|
+
endTimeUnixNano: isoToUnixNano(finishedAtIso),
|
|
735
|
+
attributes,
|
|
736
|
+
status: {
|
|
737
|
+
code: outcome.ok ? 1 : 2,
|
|
738
|
+
message: outcome.ok ? "" : sanitizeString(typeof outcome.error === "string" ? outcome.error : "command_failed")
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
]
|
|
742
|
+
}
|
|
743
|
+
]
|
|
744
|
+
}
|
|
745
|
+
]
|
|
746
|
+
};
|
|
747
|
+
return { endpoint: activeCommand.otel_traces_endpoint, payload };
|
|
748
|
+
}
|
|
749
|
+
function summarizeResult(result, captureLevel = "redacted") {
|
|
750
|
+
if (result === null || result === void 0) {
|
|
751
|
+
return { type: "nullish" };
|
|
752
|
+
}
|
|
753
|
+
if (typeof result === "string") {
|
|
754
|
+
return { type: "string", value: sanitizeString(result, captureLevel) };
|
|
755
|
+
}
|
|
756
|
+
if (typeof result === "number" || typeof result === "boolean") {
|
|
757
|
+
return { type: typeof result, value: result };
|
|
758
|
+
}
|
|
759
|
+
if (Array.isArray(result)) {
|
|
760
|
+
return {
|
|
761
|
+
type: "array",
|
|
762
|
+
length: result.length,
|
|
763
|
+
sample: result.slice(0, 5).map((entry) => sanitizeValue(entry, void 0, captureLevel))
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
if (typeof result === "object") {
|
|
767
|
+
const record = result;
|
|
768
|
+
const keys = Object.keys(record).sort((left, right) => left.localeCompare(right));
|
|
769
|
+
const sanitized = {};
|
|
770
|
+
let previewBytes = 0;
|
|
771
|
+
for (const key of keys.slice(0, 25)) {
|
|
772
|
+
const sanitizedValue = sanitizeValue(record[key], key, captureLevel);
|
|
773
|
+
const entrySize = JSON.stringify(sanitizedValue).length;
|
|
774
|
+
if (previewBytes + entrySize > TELEMETRY_RESULT_PREVIEW_MAX_BYTES) {
|
|
775
|
+
sanitized[key] = "[preview_truncated]";
|
|
776
|
+
break;
|
|
777
|
+
}
|
|
778
|
+
previewBytes += entrySize;
|
|
779
|
+
sanitized[key] = sanitizedValue;
|
|
780
|
+
}
|
|
781
|
+
return {
|
|
782
|
+
type: "object",
|
|
783
|
+
key_count: keys.length,
|
|
784
|
+
keys_preview: keys.slice(0, 50),
|
|
785
|
+
preview: sanitized
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
return { type: typeof result, value: String(result) };
|
|
789
|
+
}
|
|
790
|
+
function buildCommandStartPayload(params) {
|
|
791
|
+
const { captureLevel, context, pmVersion, sourceContext, pmRootHash, cwdHash, installationId } = params;
|
|
792
|
+
const commandTaxonomy = deriveTelemetryCommandTaxonomy(context.command);
|
|
793
|
+
const hashedArgs = hashCommandArgs(installationId, context.args);
|
|
794
|
+
const commandInvocationDigest = hashWithInstallationId(installationId, `${context.command}\0${context.args.join("\0")}`);
|
|
795
|
+
const commandOptionsDigest = hashTelemetryValue(installationId, context.options);
|
|
796
|
+
const globalOptionsDigest = hashTelemetryValue(installationId, context.global);
|
|
797
|
+
const authorContextFields = buildAuthorContextPayloadFields(captureLevel, installationId);
|
|
798
|
+
if (captureLevel === "minimal") {
|
|
799
|
+
return {
|
|
800
|
+
capture_level: captureLevel,
|
|
801
|
+
pm_version: pmVersion,
|
|
802
|
+
source_context: sourceContext.source_context,
|
|
803
|
+
source_context_source: sourceContext.source_context_source,
|
|
804
|
+
command_taxonomy: commandTaxonomy,
|
|
805
|
+
command_args_digest: hashedArgs.digest,
|
|
806
|
+
command_invocation_digest: commandInvocationDigest,
|
|
807
|
+
command_options_digest: commandOptionsDigest,
|
|
808
|
+
global_options_digest: globalOptionsDigest,
|
|
809
|
+
...authorContextFields
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
return {
|
|
813
|
+
pm_version: pmVersion,
|
|
814
|
+
source_context: sourceContext.source_context,
|
|
815
|
+
source_context_source: sourceContext.source_context_source,
|
|
816
|
+
command_taxonomy: commandTaxonomy,
|
|
817
|
+
...authorContextFields,
|
|
818
|
+
command_args: sanitizeCommandArgs(context.args, captureLevel),
|
|
819
|
+
command_args_hashes: hashedArgs.hashes,
|
|
820
|
+
command_args_digest: hashedArgs.digest,
|
|
821
|
+
command_invocation_digest: commandInvocationDigest,
|
|
822
|
+
command_options: sanitizeValue(context.options, void 0, captureLevel),
|
|
823
|
+
command_options_digest: commandOptionsDigest,
|
|
824
|
+
global_options: sanitizeValue(context.global, void 0, captureLevel),
|
|
825
|
+
global_options_digest: globalOptionsDigest,
|
|
826
|
+
pm_root_hash: pmRootHash,
|
|
827
|
+
cwd_hash: cwdHash,
|
|
828
|
+
capture_level: captureLevel,
|
|
829
|
+
runtime: {
|
|
830
|
+
node: process.version,
|
|
831
|
+
platform: process.platform,
|
|
832
|
+
arch: process.arch,
|
|
833
|
+
hostname_hash: hashWithInstallationId(installationId, os.hostname()),
|
|
834
|
+
stdin_tty: process.stdin.isTTY === true,
|
|
835
|
+
stdout_tty: process.stdout.isTTY === true
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
function buildCommandFinishPayload(params) {
|
|
840
|
+
const { captureLevel, pmVersion, sourceContext, outcome, durationMs, startedAt, command, installationId, commandTaxonomy, exitCode, errorCode: errorCode2, errorCategory, commandResolution, resolutionStage } = params;
|
|
841
|
+
const errorFingerprint = outcome.ok === false ? hashTelemetryErrorFingerprint(installationId, command, errorCode2, outcome.error) : void 0;
|
|
842
|
+
const authorContextFields = buildAuthorContextPayloadFields(captureLevel, installationId);
|
|
843
|
+
if (captureLevel === "minimal") {
|
|
844
|
+
return {
|
|
845
|
+
capture_level: captureLevel,
|
|
846
|
+
pm_version: pmVersion,
|
|
847
|
+
source_context: sourceContext.source_context,
|
|
848
|
+
source_context_source: sourceContext.source_context_source,
|
|
849
|
+
command_taxonomy: commandTaxonomy,
|
|
850
|
+
command_resolution: commandResolution,
|
|
851
|
+
resolution_stage: resolutionStage,
|
|
852
|
+
ok: outcome.ok,
|
|
853
|
+
exit_code: exitCode,
|
|
854
|
+
error_code: errorCode2,
|
|
855
|
+
error_category: errorCategory,
|
|
856
|
+
error: outcome.error ? sanitizeString(outcome.error, "redacted") : void 0,
|
|
857
|
+
error_fingerprint: errorFingerprint,
|
|
858
|
+
duration_ms: durationMs,
|
|
859
|
+
...authorContextFields
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
return {
|
|
863
|
+
capture_level: captureLevel,
|
|
864
|
+
pm_version: pmVersion,
|
|
865
|
+
source_context: sourceContext.source_context,
|
|
866
|
+
source_context_source: sourceContext.source_context_source,
|
|
867
|
+
command_taxonomy: commandTaxonomy,
|
|
868
|
+
command_resolution: commandResolution,
|
|
869
|
+
resolution_stage: resolutionStage,
|
|
870
|
+
...authorContextFields,
|
|
871
|
+
ok: outcome.ok,
|
|
872
|
+
exit_code: exitCode,
|
|
873
|
+
error_code: errorCode2,
|
|
874
|
+
error_category: errorCategory,
|
|
875
|
+
error: outcome.error ? sanitizeString(outcome.error, captureLevel) : void 0,
|
|
876
|
+
error_fingerprint: errorFingerprint,
|
|
877
|
+
duration_ms: durationMs,
|
|
878
|
+
started_at: startedAt,
|
|
879
|
+
result_summary: summarizeResult(outcome.result, captureLevel)
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
function buildCommandErrorPayload(params) {
|
|
883
|
+
const { captureLevel, pmVersion, sourceContext, command, commandTaxonomy, commandResolution, resolutionStage, args, options, pmRootHash, cwdHash, installationId, errorCode: errorCode2, errorMessage, errorCategory, exitCode } = params;
|
|
884
|
+
const attemptedArgHashes = hashCommandArgs(installationId, args);
|
|
885
|
+
const attemptedCommandDigest = hashWithInstallationId(installationId, command);
|
|
886
|
+
const attemptedOptionsDigest = hashTelemetryValue(installationId, options);
|
|
887
|
+
const errorFingerprint = hashTelemetryErrorFingerprint(installationId, command, errorCode2, errorMessage);
|
|
888
|
+
if (captureLevel === "minimal") {
|
|
889
|
+
return {
|
|
890
|
+
capture_level: captureLevel,
|
|
891
|
+
pm_version: pmVersion,
|
|
892
|
+
source_context: sourceContext.source_context,
|
|
893
|
+
source_context_source: sourceContext.source_context_source,
|
|
894
|
+
command_taxonomy: commandTaxonomy,
|
|
895
|
+
command_resolution: commandResolution,
|
|
896
|
+
resolution_stage: resolutionStage,
|
|
897
|
+
attempted_command_digest: attemptedCommandDigest,
|
|
898
|
+
attempted_args_digest: attemptedArgHashes.digest,
|
|
899
|
+
attempted_options_digest: attemptedOptionsDigest,
|
|
900
|
+
error_code: errorCode2,
|
|
901
|
+
error_category: errorCategory,
|
|
902
|
+
exit_code: exitCode,
|
|
903
|
+
error: sanitizeString(errorMessage, "redacted"),
|
|
904
|
+
error_fingerprint: errorFingerprint
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
return {
|
|
908
|
+
capture_level: captureLevel,
|
|
909
|
+
pm_version: pmVersion,
|
|
910
|
+
source_context: sourceContext.source_context,
|
|
911
|
+
source_context_source: sourceContext.source_context_source,
|
|
912
|
+
command_taxonomy: commandTaxonomy,
|
|
913
|
+
command_resolution: commandResolution,
|
|
914
|
+
resolution_stage: resolutionStage,
|
|
915
|
+
attempted_command: sanitizeString(command, captureLevel),
|
|
916
|
+
attempted_command_digest: attemptedCommandDigest,
|
|
917
|
+
attempted_args: sanitizeCommandArgs(args, captureLevel),
|
|
918
|
+
attempted_args_hashes: attemptedArgHashes.hashes,
|
|
919
|
+
attempted_args_digest: attemptedArgHashes.digest,
|
|
920
|
+
attempted_options: sanitizeValue(options, void 0, captureLevel),
|
|
921
|
+
attempted_options_digest: attemptedOptionsDigest,
|
|
922
|
+
error_code: errorCode2,
|
|
923
|
+
error_category: errorCategory,
|
|
924
|
+
exit_code: exitCode,
|
|
925
|
+
error: sanitizeString(errorMessage, captureLevel),
|
|
926
|
+
error_fingerprint: errorFingerprint,
|
|
927
|
+
pm_root_hash: pmRootHash,
|
|
928
|
+
cwd_hash: cwdHash,
|
|
929
|
+
runtime: {
|
|
930
|
+
node: process.version,
|
|
931
|
+
platform: process.platform,
|
|
932
|
+
arch: process.arch,
|
|
933
|
+
hostname_hash: hashWithInstallationId(installationId, os.hostname()),
|
|
934
|
+
stdin_tty: process.stdin.isTTY === true,
|
|
935
|
+
stdout_tty: process.stdout.isTTY === true
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
async function ensureInstallationId(globalPmRoot) {
|
|
940
|
+
const settings = await readSettings(globalPmRoot);
|
|
941
|
+
let changed = false;
|
|
942
|
+
if (settings.telemetry.installation_id.trim().length === 0) {
|
|
943
|
+
settings.telemetry.installation_id = crypto.randomUUID();
|
|
944
|
+
changed = true;
|
|
945
|
+
}
|
|
946
|
+
if (changed) {
|
|
947
|
+
await writeSettings(globalPmRoot, settings, "telemetry:install_id");
|
|
948
|
+
}
|
|
949
|
+
return {
|
|
950
|
+
installationId: settings.telemetry.installation_id,
|
|
951
|
+
endpoint: settings.telemetry.endpoint,
|
|
952
|
+
retentionDays: Math.max(1, Math.trunc(settings.telemetry.retention_days))
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
async function enqueueTelemetryEvent(globalPmRoot, event) {
|
|
956
|
+
const queued = {
|
|
957
|
+
client_schema_version: TELEMETRY_CLIENT_SCHEMA_VERSION,
|
|
958
|
+
event,
|
|
959
|
+
attempts: 0
|
|
960
|
+
};
|
|
961
|
+
let serialized = JSON.stringify(queued);
|
|
962
|
+
if (serialized.length > TELEMETRY_MAX_EVENT_BYTES) {
|
|
963
|
+
const trimmed = { ...event, payload: { ...event.payload, result_summary: { truncated: true, reason: "payload_size_exceeded", original_bytes: serialized.length } } };
|
|
964
|
+
const trimmedQueued = {
|
|
965
|
+
client_schema_version: TELEMETRY_CLIENT_SCHEMA_VERSION,
|
|
966
|
+
event: trimmed,
|
|
967
|
+
attempts: 0
|
|
968
|
+
};
|
|
969
|
+
serialized = JSON.stringify(trimmedQueued);
|
|
970
|
+
}
|
|
971
|
+
await withQueueMutation(async () => {
|
|
972
|
+
await appendLineAtomic(queuePath(globalPmRoot), serialized);
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
function parseQueueLines(raw) {
|
|
976
|
+
const entries = [];
|
|
977
|
+
for (const line of raw.split("\n")) {
|
|
978
|
+
const trimmed = line.trim();
|
|
979
|
+
if (trimmed.length === 0) {
|
|
980
|
+
continue;
|
|
981
|
+
}
|
|
982
|
+
try {
|
|
983
|
+
const parsed = JSON.parse(trimmed);
|
|
984
|
+
if (parsed && typeof parsed === "object" && parsed.event && typeof parsed.event === "object" && typeof parsed.attempts === "number" && (parsed.client_schema_version === void 0 || typeof parsed.client_schema_version === "number" && Number.isFinite(parsed.client_schema_version))) {
|
|
985
|
+
entries.push(parsed);
|
|
986
|
+
}
|
|
987
|
+
} catch {
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
return entries;
|
|
991
|
+
}
|
|
992
|
+
function nextRetryIso(attempts) {
|
|
993
|
+
const delay = Math.min(TELEMETRY_RETRY_BASE_DELAY_MS * 2 ** Math.max(attempts - 1, 0), TELEMETRY_MAX_RETRY_DELAY_MS);
|
|
994
|
+
return new Date(Date.now() + delay).toISOString();
|
|
995
|
+
}
|
|
996
|
+
function isDueForRetryAt(nextAttemptAfter) {
|
|
997
|
+
if (typeof nextAttemptAfter !== "string" || nextAttemptAfter.trim().length === 0) {
|
|
998
|
+
return true;
|
|
999
|
+
}
|
|
1000
|
+
const dueAtMs = Date.parse(nextAttemptAfter);
|
|
1001
|
+
if (Number.isNaN(dueAtMs)) {
|
|
1002
|
+
return true;
|
|
1003
|
+
}
|
|
1004
|
+
return dueAtMs <= Date.now();
|
|
1005
|
+
}
|
|
1006
|
+
function isDueForRetry(entry) {
|
|
1007
|
+
return isDueForRetryAt(entry.next_attempt_after);
|
|
1008
|
+
}
|
|
1009
|
+
function retentionCutoffMs(retentionDays) {
|
|
1010
|
+
const normalizedDays = Number.isFinite(retentionDays) ? Math.max(1, Math.trunc(retentionDays)) : 1;
|
|
1011
|
+
return Date.now() - normalizedDays * MILLISECONDS_PER_DAY;
|
|
1012
|
+
}
|
|
1013
|
+
function isExpiredQueueEntry(entry, cutoffMs) {
|
|
1014
|
+
const occurredAt = entry.event?.occurred_at;
|
|
1015
|
+
if (typeof occurredAt !== "string" || occurredAt.trim().length === 0) {
|
|
1016
|
+
return false;
|
|
1017
|
+
}
|
|
1018
|
+
const occurredAtMs = Date.parse(occurredAt);
|
|
1019
|
+
if (Number.isNaN(occurredAtMs)) {
|
|
1020
|
+
return false;
|
|
1021
|
+
}
|
|
1022
|
+
return occurredAtMs < cutoffMs;
|
|
1023
|
+
}
|
|
1024
|
+
function pruneExpiredQueueEntries(entries, retentionDays) {
|
|
1025
|
+
const cutoffMs = retentionCutoffMs(retentionDays);
|
|
1026
|
+
const retained = [];
|
|
1027
|
+
let prunedCount = 0;
|
|
1028
|
+
for (const entry of entries) {
|
|
1029
|
+
const serializedSize = JSON.stringify(entry).length;
|
|
1030
|
+
const oversized = serializedSize > TELEMETRY_MAX_EVENT_BYTES;
|
|
1031
|
+
if (oversized || isExpiredQueueEntry(entry, cutoffMs) || entry.attempts >= TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS) {
|
|
1032
|
+
prunedCount += 1;
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
retained.push(entry);
|
|
1036
|
+
}
|
|
1037
|
+
return { entries: retained, prunedCount };
|
|
1038
|
+
}
|
|
1039
|
+
async function rewriteQueue(globalPmRoot, entries) {
|
|
1040
|
+
const serialized = entries.map((entry) => JSON.stringify(entry)).join("\n");
|
|
1041
|
+
const contents = serialized.length > 0 ? `${serialized}
|
|
1042
|
+
` : "";
|
|
1043
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
1044
|
+
try {
|
|
1045
|
+
await writeFileAtomic(queuePath(globalPmRoot), contents);
|
|
1046
|
+
return;
|
|
1047
|
+
} catch (error) {
|
|
1048
|
+
const retryDelay = TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS[attempt];
|
|
1049
|
+
if (retryDelay === void 0 || !isRetryableQueueRewriteError(error)) {
|
|
1050
|
+
throw error;
|
|
1051
|
+
}
|
|
1052
|
+
await sleep(retryDelay);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
function isRetryableQueueRewriteError(error) {
|
|
1057
|
+
if (typeof error !== "object" || error === null || !("code" in error)) {
|
|
1058
|
+
return false;
|
|
1059
|
+
}
|
|
1060
|
+
const code = error.code;
|
|
1061
|
+
return code === "EACCES" || code === "EBUSY" || code === "EPERM";
|
|
1062
|
+
}
|
|
1063
|
+
function sleep(milliseconds) {
|
|
1064
|
+
return new Promise((resolve) => {
|
|
1065
|
+
setTimeout(resolve, milliseconds);
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
async function enqueuePendingOtelSpan(globalPmRoot, request) {
|
|
1069
|
+
const pending = {
|
|
1070
|
+
id: crypto.randomUUID(),
|
|
1071
|
+
endpoint: request.endpoint,
|
|
1072
|
+
payload: request.payload,
|
|
1073
|
+
enqueued_at: nowIso(),
|
|
1074
|
+
attempts: 0
|
|
1075
|
+
};
|
|
1076
|
+
const serialized = JSON.stringify(pending);
|
|
1077
|
+
if (serialized.length > TELEMETRY_MAX_EVENT_BYTES) {
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
await withQueueMutation(async () => {
|
|
1081
|
+
await appendLineAtomic(otelSpansQueuePath(globalPmRoot), serialized);
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
function backfillPendingOtelSpanId(entry) {
|
|
1085
|
+
const material = JSON.stringify([entry.endpoint, entry.enqueued_at, entry.payload]);
|
|
1086
|
+
return crypto.createHash("sha256").update(material).digest("hex").slice(0, 32);
|
|
1087
|
+
}
|
|
1088
|
+
function parsePendingOtelSpanLines(raw) {
|
|
1089
|
+
const entries = [];
|
|
1090
|
+
for (const line of raw.split("\n")) {
|
|
1091
|
+
const trimmed = line.trim();
|
|
1092
|
+
if (trimmed.length === 0) {
|
|
1093
|
+
continue;
|
|
1094
|
+
}
|
|
1095
|
+
try {
|
|
1096
|
+
const parsed = JSON.parse(trimmed);
|
|
1097
|
+
if (parsed && typeof parsed === "object" && typeof parsed.endpoint === "string" && parsed.endpoint.trim().length > 0 && "payload" in parsed && typeof parsed.attempts === "number" && Number.isFinite(parsed.attempts)) {
|
|
1098
|
+
if (typeof parsed.id !== "string" || parsed.id.length === 0) {
|
|
1099
|
+
parsed.id = backfillPendingOtelSpanId(parsed);
|
|
1100
|
+
}
|
|
1101
|
+
entries.push(parsed);
|
|
1102
|
+
}
|
|
1103
|
+
} catch {
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
return entries;
|
|
1107
|
+
}
|
|
1108
|
+
function isExpiredPendingOtelSpan(entry, cutoffMs) {
|
|
1109
|
+
if (typeof entry.enqueued_at !== "string" || entry.enqueued_at.trim().length === 0) {
|
|
1110
|
+
return false;
|
|
1111
|
+
}
|
|
1112
|
+
const enqueuedAtMs = Date.parse(entry.enqueued_at);
|
|
1113
|
+
if (Number.isNaN(enqueuedAtMs)) {
|
|
1114
|
+
return false;
|
|
1115
|
+
}
|
|
1116
|
+
return enqueuedAtMs < cutoffMs;
|
|
1117
|
+
}
|
|
1118
|
+
function prunePendingOtelSpans(entries, retentionDays) {
|
|
1119
|
+
const cutoffMs = retentionCutoffMs(retentionDays);
|
|
1120
|
+
const retained = [];
|
|
1121
|
+
let prunedCount = 0;
|
|
1122
|
+
for (const entry of entries) {
|
|
1123
|
+
const oversized = JSON.stringify(entry).length > TELEMETRY_MAX_EVENT_BYTES;
|
|
1124
|
+
if (oversized || isExpiredPendingOtelSpan(entry, cutoffMs) || entry.attempts >= TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS) {
|
|
1125
|
+
prunedCount += 1;
|
|
1126
|
+
continue;
|
|
1127
|
+
}
|
|
1128
|
+
retained.push(entry);
|
|
1129
|
+
}
|
|
1130
|
+
if (retained.length > TELEMETRY_OTEL_SPANS_MAX_PENDING) {
|
|
1131
|
+
const overflow = retained.length - TELEMETRY_OTEL_SPANS_MAX_PENDING;
|
|
1132
|
+
prunedCount += overflow;
|
|
1133
|
+
return { entries: retained.slice(overflow), prunedCount };
|
|
1134
|
+
}
|
|
1135
|
+
return { entries: retained, prunedCount };
|
|
1136
|
+
}
|
|
1137
|
+
async function rewritePendingOtelSpans(globalPmRoot, entries) {
|
|
1138
|
+
const serialized = entries.map((entry) => JSON.stringify(entry)).join("\n");
|
|
1139
|
+
const contents = serialized.length > 0 ? `${serialized}
|
|
1140
|
+
` : "";
|
|
1141
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
1142
|
+
try {
|
|
1143
|
+
await writeFileAtomic(otelSpansQueuePath(globalPmRoot), contents);
|
|
1144
|
+
return;
|
|
1145
|
+
} catch (error) {
|
|
1146
|
+
const retryDelay = TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS[attempt];
|
|
1147
|
+
if (retryDelay === void 0 || !isRetryableQueueRewriteError(error)) {
|
|
1148
|
+
throw error;
|
|
1149
|
+
}
|
|
1150
|
+
await sleep(retryDelay);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
async function reconcilePendingOtelSpansAfterFlush(globalPmRoot, retentionDays, succeededIds, failedUpdates) {
|
|
1155
|
+
return withQueueMutation(async () => {
|
|
1156
|
+
const raw = await readFileIfExists(otelSpansQueuePath(globalPmRoot));
|
|
1157
|
+
const current = raw === null ? [] : parsePendingOtelSpanLines(raw);
|
|
1158
|
+
const reconciled = [];
|
|
1159
|
+
for (const entry of current) {
|
|
1160
|
+
if (succeededIds.has(entry.id)) {
|
|
1161
|
+
continue;
|
|
1162
|
+
}
|
|
1163
|
+
const failure = failedUpdates.get(entry.id);
|
|
1164
|
+
reconciled.push(failure ? { ...entry, attempts: failure.attempts, next_attempt_after: failure.next_attempt_after } : entry);
|
|
1165
|
+
}
|
|
1166
|
+
const { entries: retained } = prunePendingOtelSpans(reconciled, retentionDays);
|
|
1167
|
+
await rewritePendingOtelSpans(globalPmRoot, retained);
|
|
1168
|
+
return retained.length;
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
async function flushPendingOtelSpans(globalPmRoot, retentionDays) {
|
|
1172
|
+
const raw = await readFileIfExists(otelSpansQueuePath(globalPmRoot));
|
|
1173
|
+
if (raw === null || raw.trim().length === 0) {
|
|
1174
|
+
await writeRuntimeState(globalPmRoot, { pending_otel_spans: 0 });
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1177
|
+
const entries = parsePendingOtelSpanLines(raw);
|
|
1178
|
+
const { entries: retained, prunedCount } = prunePendingOtelSpans(entries, retentionDays);
|
|
1179
|
+
const due = retained.filter((entry) => isDueForRetryAt(entry.next_attempt_after)).slice(0, TELEMETRY_OTEL_SPANS_FLUSH_BATCH_SIZE);
|
|
1180
|
+
if (due.length === 0) {
|
|
1181
|
+
const remaining2 = prunedCount > 0 ? await reconcilePendingOtelSpansAfterFlush(globalPmRoot, retentionDays, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Map()) : retained.length;
|
|
1182
|
+
await writeRuntimeState(globalPmRoot, { pending_otel_spans: remaining2 });
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
const attemptTime = nowIso();
|
|
1186
|
+
const succeededIds = /* @__PURE__ */ new Set();
|
|
1187
|
+
const failedUpdates = /* @__PURE__ */ new Map();
|
|
1188
|
+
let succeededCount = 0;
|
|
1189
|
+
let lastError;
|
|
1190
|
+
await Promise.all(due.map(async (span) => {
|
|
1191
|
+
try {
|
|
1192
|
+
const response = await fetch(span.endpoint, {
|
|
1193
|
+
method: "POST",
|
|
1194
|
+
headers: { "content-type": "application/json" },
|
|
1195
|
+
body: JSON.stringify(span.payload),
|
|
1196
|
+
signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS)
|
|
1197
|
+
});
|
|
1198
|
+
if (!response.ok) {
|
|
1199
|
+
throw new Error(`local_otel_export_http_${response.status}`);
|
|
1200
|
+
}
|
|
1201
|
+
succeededIds.add(span.id);
|
|
1202
|
+
succeededCount += 1;
|
|
1203
|
+
} catch (error) {
|
|
1204
|
+
lastError = error instanceof Error ? sanitizeString(error.message, "redacted") : "local_otel_export_failed";
|
|
1205
|
+
const nextAttempts = span.attempts + 1;
|
|
1206
|
+
failedUpdates.set(span.id, { attempts: nextAttempts, next_attempt_after: nextRetryIso(nextAttempts) });
|
|
1207
|
+
}
|
|
1208
|
+
}));
|
|
1209
|
+
const remaining = await reconcilePendingOtelSpansAfterFlush(globalPmRoot, retentionDays, succeededIds, failedUpdates);
|
|
1210
|
+
const statePatch = {
|
|
1211
|
+
pending_otel_spans: remaining,
|
|
1212
|
+
last_otel_attempt_at: attemptTime
|
|
1213
|
+
};
|
|
1214
|
+
if (succeededCount > 0) {
|
|
1215
|
+
statePatch.last_otel_success_at = attemptTime;
|
|
1216
|
+
}
|
|
1217
|
+
if (lastError !== void 0) {
|
|
1218
|
+
statePatch.last_otel_failure_at = attemptTime;
|
|
1219
|
+
statePatch.last_otel_failure_error = lastError;
|
|
1220
|
+
} else if (remaining === 0) {
|
|
1221
|
+
statePatch.last_otel_failure_at = void 0;
|
|
1222
|
+
statePatch.last_otel_failure_error = void 0;
|
|
1223
|
+
}
|
|
1224
|
+
await writeRuntimeState(globalPmRoot, statePatch);
|
|
1225
|
+
}
|
|
1226
|
+
async function flushTelemetryArtifacts(globalPmRoot, endpoint, retentionDays) {
|
|
1227
|
+
try {
|
|
1228
|
+
await flushQueue(globalPmRoot, endpoint, retentionDays);
|
|
1229
|
+
} catch {
|
|
1230
|
+
}
|
|
1231
|
+
try {
|
|
1232
|
+
await flushPendingOtelSpans(globalPmRoot, retentionDays);
|
|
1233
|
+
} catch {
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
async function cleanupTelemetryQueueTempOrphans(globalPmRoot, maxAgeMs = TELEMETRY_QUEUE_TMP_ORPHAN_MAX_AGE_MS) {
|
|
1237
|
+
try {
|
|
1238
|
+
const dirPath = telemetryRuntimeDirectory(globalPmRoot);
|
|
1239
|
+
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
1240
|
+
const cutoffMs = Date.now() - Math.max(0, maxAgeMs);
|
|
1241
|
+
await Promise.all(entries.filter((entry) => entry.isFile() && /^\.events\.jsonl\.\d+\.\d+\.[a-f0-9]+\.tmp$/.test(entry.name)).map(async (entry) => {
|
|
1242
|
+
const candidate = path.join(dirPath, entry.name);
|
|
1243
|
+
const candidateStats = await stat(candidate);
|
|
1244
|
+
if (candidateStats.mtimeMs < cutoffMs) {
|
|
1245
|
+
await rm(candidate, { force: true });
|
|
1246
|
+
}
|
|
1247
|
+
}));
|
|
1248
|
+
} catch {
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
async function withQueueMutation(operation) {
|
|
1252
|
+
const run = _queueMutationPromise.catch(
|
|
1253
|
+
/* c8 ignore next */
|
|
1254
|
+
() => {
|
|
1255
|
+
}
|
|
1256
|
+
).then(operation);
|
|
1257
|
+
_queueMutationPromise = run.catch(
|
|
1258
|
+
/* c8 ignore next */
|
|
1259
|
+
() => {
|
|
1260
|
+
}
|
|
1261
|
+
);
|
|
1262
|
+
return run;
|
|
1263
|
+
}
|
|
1264
|
+
async function readCurrentQueueEntries(globalPmRoot) {
|
|
1265
|
+
const raw = await readFileIfExists(queuePath(globalPmRoot));
|
|
1266
|
+
if (raw === null || raw.trim().length === 0) {
|
|
1267
|
+
return [];
|
|
1268
|
+
}
|
|
1269
|
+
return parseQueueLines(raw);
|
|
1270
|
+
}
|
|
1271
|
+
async function removeFlushedEntriesFromCurrentQueue(globalPmRoot, flushedIds, retentionDays) {
|
|
1272
|
+
return withQueueMutation(async () => {
|
|
1273
|
+
const currentEntries = await readCurrentQueueEntries(globalPmRoot);
|
|
1274
|
+
const { entries: retainedEntries } = pruneExpiredQueueEntries(currentEntries, retentionDays);
|
|
1275
|
+
const remaining = retainedEntries.filter((entry) => !flushedIds.has(entry.event.event_id));
|
|
1276
|
+
await rewriteQueue(globalPmRoot, remaining);
|
|
1277
|
+
return remaining;
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
async function markFailedEntriesInCurrentQueue(globalPmRoot, failedIds, attemptTime, retentionDays) {
|
|
1281
|
+
return withQueueMutation(async () => {
|
|
1282
|
+
const currentEntries = await readCurrentQueueEntries(globalPmRoot);
|
|
1283
|
+
const { entries: retainedEntries } = pruneExpiredQueueEntries(currentEntries, retentionDays);
|
|
1284
|
+
const retried = retainedEntries.map((entry) => {
|
|
1285
|
+
if (!failedIds.has(entry.event.event_id)) {
|
|
1286
|
+
return entry;
|
|
1287
|
+
}
|
|
1288
|
+
const attempts = entry.attempts + 1;
|
|
1289
|
+
return {
|
|
1290
|
+
...entry,
|
|
1291
|
+
attempts,
|
|
1292
|
+
last_attempt_at: attemptTime,
|
|
1293
|
+
next_attempt_after: nextRetryIso(attempts)
|
|
1294
|
+
};
|
|
1295
|
+
});
|
|
1296
|
+
await rewriteQueue(globalPmRoot, retried);
|
|
1297
|
+
return retried;
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
async function flushQueue(globalPmRoot, endpoint, retentionDays) {
|
|
1301
|
+
await cleanupTelemetryQueueTempOrphans(globalPmRoot);
|
|
1302
|
+
const normalizedEndpoint = endpoint.trim();
|
|
1303
|
+
if (normalizedEndpoint.length === 0) {
|
|
1304
|
+
return;
|
|
1305
|
+
}
|
|
1306
|
+
const raw = await readFileIfExists(queuePath(globalPmRoot));
|
|
1307
|
+
if (raw === null || raw.trim().length === 0) {
|
|
1308
|
+
await writeRuntimeState(globalPmRoot, {
|
|
1309
|
+
endpoint: normalizedEndpoint,
|
|
1310
|
+
queue_entries: 0
|
|
1311
|
+
});
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1314
|
+
const queueEntries = parseQueueLines(raw);
|
|
1315
|
+
if (queueEntries.length === 0) {
|
|
1316
|
+
await writeRuntimeState(globalPmRoot, {
|
|
1317
|
+
endpoint: normalizedEndpoint,
|
|
1318
|
+
queue_entries: 0
|
|
1319
|
+
});
|
|
1320
|
+
return;
|
|
1321
|
+
}
|
|
1322
|
+
const { entries: retainedEntries, prunedCount } = pruneExpiredQueueEntries(queueEntries, retentionDays);
|
|
1323
|
+
if (retainedEntries.length === 0) {
|
|
1324
|
+
await rewriteQueue(globalPmRoot, []);
|
|
1325
|
+
await writeRuntimeState(globalPmRoot, {
|
|
1326
|
+
endpoint: normalizedEndpoint,
|
|
1327
|
+
queue_entries: 0
|
|
1328
|
+
});
|
|
1329
|
+
return;
|
|
1330
|
+
}
|
|
1331
|
+
const dueEntries = retainedEntries.filter((entry) => isDueForRetry(entry)).slice(0, TELEMETRY_FLUSH_BATCH_SIZE);
|
|
1332
|
+
if (dueEntries.length === 0) {
|
|
1333
|
+
if (prunedCount > 0) {
|
|
1334
|
+
await rewriteQueue(globalPmRoot, retainedEntries);
|
|
1335
|
+
}
|
|
1336
|
+
await writeRuntimeState(globalPmRoot, {
|
|
1337
|
+
endpoint: normalizedEndpoint,
|
|
1338
|
+
queue_entries: retainedEntries.length
|
|
1339
|
+
});
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
const dueIds = new Set(dueEntries.map((entry) => entry.event.event_id));
|
|
1343
|
+
const attemptTime = nowIso();
|
|
1344
|
+
const requestHeaders = {
|
|
1345
|
+
"content-type": "application/json"
|
|
1346
|
+
};
|
|
1347
|
+
const ingestKey = process.env.PM_TELEMETRY_INGEST_KEY?.trim();
|
|
1348
|
+
if (ingestKey) {
|
|
1349
|
+
requestHeaders["x-pm-telemetry-key"] = ingestKey;
|
|
1350
|
+
}
|
|
1351
|
+
try {
|
|
1352
|
+
const response = await fetch(normalizedEndpoint, {
|
|
1353
|
+
method: "POST",
|
|
1354
|
+
headers: requestHeaders,
|
|
1355
|
+
body: JSON.stringify({
|
|
1356
|
+
schema_version: TELEMETRY_SCHEMA_VERSION,
|
|
1357
|
+
events: dueEntries.map((entry) => entry.event)
|
|
1358
|
+
}),
|
|
1359
|
+
signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS)
|
|
1360
|
+
});
|
|
1361
|
+
if (!response.ok) {
|
|
1362
|
+
throw new Error(`telemetry_flush_http_${response.status}`);
|
|
1363
|
+
}
|
|
1364
|
+
} catch (error) {
|
|
1365
|
+
const retried = await markFailedEntriesInCurrentQueue(globalPmRoot, dueIds, attemptTime, retentionDays);
|
|
1366
|
+
const errorMessage = (() => {
|
|
1367
|
+
if (error instanceof Error) {
|
|
1368
|
+
return sanitizeString(error.message, "redacted");
|
|
1369
|
+
}
|
|
1370
|
+
return "telemetry_flush_failed";
|
|
1371
|
+
})();
|
|
1372
|
+
await writeRuntimeState(globalPmRoot, {
|
|
1373
|
+
endpoint: normalizedEndpoint,
|
|
1374
|
+
queue_entries: retried.length,
|
|
1375
|
+
last_attempted_flush_at: attemptTime,
|
|
1376
|
+
last_failed_flush_at: attemptTime,
|
|
1377
|
+
last_failed_flush_error: errorMessage
|
|
1378
|
+
});
|
|
1379
|
+
return;
|
|
1380
|
+
}
|
|
1381
|
+
try {
|
|
1382
|
+
const remaining = await removeFlushedEntriesFromCurrentQueue(globalPmRoot, dueIds, retentionDays);
|
|
1383
|
+
await writeRuntimeState(globalPmRoot, {
|
|
1384
|
+
endpoint: normalizedEndpoint,
|
|
1385
|
+
queue_entries: remaining.length,
|
|
1386
|
+
last_attempted_flush_at: attemptTime,
|
|
1387
|
+
last_successful_flush_at: attemptTime,
|
|
1388
|
+
last_failed_flush_at: void 0,
|
|
1389
|
+
last_failed_flush_error: void 0
|
|
1390
|
+
});
|
|
1391
|
+
} catch (error) {
|
|
1392
|
+
const errorMessage = (() => {
|
|
1393
|
+
if (error instanceof Error) {
|
|
1394
|
+
return sanitizeString(error.message, "redacted");
|
|
1395
|
+
}
|
|
1396
|
+
return "telemetry_flush_failed";
|
|
1397
|
+
})();
|
|
1398
|
+
const currentEntries = await readCurrentQueueEntries(globalPmRoot).catch(() => retainedEntries);
|
|
1399
|
+
await writeRuntimeState(globalPmRoot, {
|
|
1400
|
+
endpoint: normalizedEndpoint,
|
|
1401
|
+
queue_entries: currentEntries.length,
|
|
1402
|
+
last_attempted_flush_at: attemptTime,
|
|
1403
|
+
last_failed_flush_at: attemptTime,
|
|
1404
|
+
last_failed_flush_error: errorMessage
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
async function acquireTelemetryFlushLock(globalPmRoot) {
|
|
1409
|
+
const lockPath = flushLockPath(globalPmRoot);
|
|
1410
|
+
await mkdir(path.dirname(lockPath), { recursive: true });
|
|
1411
|
+
try {
|
|
1412
|
+
await mkdir(lockPath);
|
|
1413
|
+
return true;
|
|
1414
|
+
} catch (error) {
|
|
1415
|
+
if (typeof error !== "object" || error === null || !("code" in error) || error.code !== "EEXIST") {
|
|
1416
|
+
throw error;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
try {
|
|
1420
|
+
const lockStats = await stat(lockPath);
|
|
1421
|
+
if (Date.now() - lockStats.mtimeMs < TELEMETRY_FLUSH_LOCK_STALE_MS) {
|
|
1422
|
+
return false;
|
|
1423
|
+
}
|
|
1424
|
+
await rm(lockPath, { recursive: true, force: true });
|
|
1425
|
+
await mkdir(lockPath);
|
|
1426
|
+
return true;
|
|
1427
|
+
} catch {
|
|
1428
|
+
return false;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
function isFreshDirectoryLock(lockPath, staleMs) {
|
|
1432
|
+
try {
|
|
1433
|
+
return Date.now() - statSync(lockPath).mtimeMs < staleMs;
|
|
1434
|
+
} catch {
|
|
1435
|
+
return false;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
function removeDirectoryLockBestEffort(lockPath) {
|
|
1439
|
+
try {
|
|
1440
|
+
rmSync(lockPath, { recursive: true, force: true });
|
|
1441
|
+
} catch {
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
function errorCode(error) {
|
|
1445
|
+
if (typeof error !== "object" || error === null || !("code" in error)) {
|
|
1446
|
+
return void 0;
|
|
1447
|
+
}
|
|
1448
|
+
const code = error.code;
|
|
1449
|
+
return typeof code === "string" ? code : void 0;
|
|
1450
|
+
}
|
|
1451
|
+
function createDirectoryLock(lockPath) {
|
|
1452
|
+
try {
|
|
1453
|
+
mkdirSync(lockPath);
|
|
1454
|
+
return true;
|
|
1455
|
+
} catch (error) {
|
|
1456
|
+
const code = errorCode(error);
|
|
1457
|
+
if (code === "EEXIST") {
|
|
1458
|
+
return false;
|
|
1459
|
+
}
|
|
1460
|
+
if (code !== "ENOENT") {
|
|
1461
|
+
return false;
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
try {
|
|
1465
|
+
mkdirSync(path.dirname(lockPath), { recursive: true });
|
|
1466
|
+
mkdirSync(lockPath);
|
|
1467
|
+
return true;
|
|
1468
|
+
} catch {
|
|
1469
|
+
return false;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
function acquireTelemetryFlushSpawnGate(globalPmRoot) {
|
|
1473
|
+
if (isFreshDirectoryLock(flushLockPath(globalPmRoot), TELEMETRY_FLUSH_LOCK_STALE_MS)) {
|
|
1474
|
+
return false;
|
|
1475
|
+
}
|
|
1476
|
+
const lockPath = flushSpawnLockPath(globalPmRoot);
|
|
1477
|
+
try {
|
|
1478
|
+
if (Date.now() - statSync(lockPath).mtimeMs < TELEMETRY_FLUSH_SPAWN_LOCK_STALE_MS) {
|
|
1479
|
+
return false;
|
|
1480
|
+
}
|
|
1481
|
+
removeDirectoryLockBestEffort(lockPath);
|
|
1482
|
+
} catch (error) {
|
|
1483
|
+
if (errorCode(error) !== "ENOENT") {
|
|
1484
|
+
return false;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
return createDirectoryLock(lockPath);
|
|
1488
|
+
}
|
|
1489
|
+
function releaseTelemetryFlushSpawnGate(globalPmRoot) {
|
|
1490
|
+
removeDirectoryLockBestEffort(flushSpawnLockPath(globalPmRoot));
|
|
1491
|
+
}
|
|
1492
|
+
async function flushQueueWithProcessLock(globalPmRoot, endpoint, retentionDays) {
|
|
1493
|
+
const acquired = await acquireTelemetryFlushLock(globalPmRoot);
|
|
1494
|
+
releaseTelemetryFlushSpawnGate(globalPmRoot);
|
|
1495
|
+
if (!acquired) {
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
try {
|
|
1499
|
+
await flushTelemetryArtifacts(globalPmRoot, endpoint, retentionDays);
|
|
1500
|
+
} finally {
|
|
1501
|
+
try {
|
|
1502
|
+
await rm(flushLockPath(globalPmRoot), { recursive: true, force: true });
|
|
1503
|
+
} catch {
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
function scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays) {
|
|
1508
|
+
if (shouldFlushInline()) {
|
|
1509
|
+
const previousFlush = _lastFlushPromise;
|
|
1510
|
+
const nextFlush = flushTelemetryArtifacts(globalPmRoot, endpoint, retentionDays);
|
|
1511
|
+
_lastFlushPromise = Promise.allSettled([previousFlush, nextFlush]).then(() => {
|
|
1512
|
+
});
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
try {
|
|
1516
|
+
const acquiredSpawnGate = acquireTelemetryFlushSpawnGate(globalPmRoot);
|
|
1517
|
+
if (!acquiredSpawnGate) {
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
const child = spawn(process.execPath, [telemetryFlushRunnerPath()], {
|
|
1521
|
+
detached: true,
|
|
1522
|
+
stdio: "ignore",
|
|
1523
|
+
// Detached workers inherit cwd by default. On Windows that can keep a
|
|
1524
|
+
// disposable project directory locked after the foreground command exits.
|
|
1525
|
+
cwd: os.tmpdir(),
|
|
1526
|
+
env: {
|
|
1527
|
+
...process.env,
|
|
1528
|
+
PM_GLOBAL_PATH: globalPmRoot,
|
|
1529
|
+
[PM_TELEMETRY_FLUSH_CHILD_ENV]: "1"
|
|
1530
|
+
}
|
|
1531
|
+
});
|
|
1532
|
+
child.on("error", () => {
|
|
1533
|
+
releaseTelemetryFlushSpawnGate(globalPmRoot);
|
|
1534
|
+
});
|
|
1535
|
+
child.unref();
|
|
1536
|
+
} catch {
|
|
1537
|
+
releaseTelemetryFlushSpawnGate(globalPmRoot);
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
async function flushTelemetryQueueNow(globalPmRoot = resolveGlobalPmRoot(process.cwd())) {
|
|
1541
|
+
if (telemetryDisabledByEnvironment()) {
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
try {
|
|
1545
|
+
const settings = await readSettings(globalPmRoot);
|
|
1546
|
+
if (!settings.telemetry.enabled) {
|
|
1547
|
+
return;
|
|
1548
|
+
}
|
|
1549
|
+
const { endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);
|
|
1550
|
+
await flushQueueWithProcessLock(globalPmRoot, endpoint, retentionDays);
|
|
1551
|
+
} catch {
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
async function startTelemetryCommand(context) {
|
|
1555
|
+
if (telemetryDisabledByEnvironment()) {
|
|
1556
|
+
return null;
|
|
1557
|
+
}
|
|
1558
|
+
if (context.command === "telemetry" && context.args.some((token) => token.trim().toLowerCase() === "clear")) {
|
|
1559
|
+
return null;
|
|
1560
|
+
}
|
|
1561
|
+
try {
|
|
1562
|
+
const globalPmRoot = resolveGlobalPmRoot(process.cwd());
|
|
1563
|
+
const settings = await readSettings(globalPmRoot);
|
|
1564
|
+
if (!settings.telemetry.enabled) {
|
|
1565
|
+
return null;
|
|
1566
|
+
}
|
|
1567
|
+
const captureLevel = normalizeCaptureLevel(settings.telemetry.capture_level);
|
|
1568
|
+
const { installationId, endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);
|
|
1569
|
+
const pmVersion = normalizePmVersion(context.pm_version);
|
|
1570
|
+
const sourceContext = resolveTelemetrySourceContext(context.global);
|
|
1571
|
+
const pmRootHash = hashWithInstallationId(installationId, context.pm_root);
|
|
1572
|
+
const cwdHash = hashWithInstallationId(installationId, process.cwd());
|
|
1573
|
+
const otelTracesEndpoint = resolveOtelTracesEndpoint();
|
|
1574
|
+
const occurredAt = nowIso();
|
|
1575
|
+
const event = {
|
|
1576
|
+
schema_version: TELEMETRY_SCHEMA_VERSION,
|
|
1577
|
+
event_id: crypto.randomUUID(),
|
|
1578
|
+
event_type: "command_start",
|
|
1579
|
+
occurred_at: occurredAt,
|
|
1580
|
+
installation_id: installationId,
|
|
1581
|
+
session_id: PROCESS_SESSION_ID,
|
|
1582
|
+
command: context.command,
|
|
1583
|
+
payload: buildCommandStartPayload({
|
|
1584
|
+
captureLevel,
|
|
1585
|
+
context,
|
|
1586
|
+
pmVersion,
|
|
1587
|
+
sourceContext,
|
|
1588
|
+
pmRootHash,
|
|
1589
|
+
cwdHash,
|
|
1590
|
+
installationId
|
|
1591
|
+
})
|
|
1592
|
+
};
|
|
1593
|
+
await enqueueTelemetryEvent(globalPmRoot, event);
|
|
1594
|
+
scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays);
|
|
1595
|
+
const commandTaxonomy = deriveTelemetryCommandTaxonomy(context.command);
|
|
1596
|
+
return {
|
|
1597
|
+
started_at: occurredAt,
|
|
1598
|
+
started_at_ms: Date.now(),
|
|
1599
|
+
command: context.command,
|
|
1600
|
+
command_taxonomy: commandTaxonomy,
|
|
1601
|
+
pm_version: pmVersion,
|
|
1602
|
+
source_context: sourceContext.source_context,
|
|
1603
|
+
source_context_source: sourceContext.source_context_source,
|
|
1604
|
+
installation_id: installationId,
|
|
1605
|
+
pm_root_hash: pmRootHash,
|
|
1606
|
+
cwd_hash: cwdHash,
|
|
1607
|
+
endpoint,
|
|
1608
|
+
retention_days: retentionDays,
|
|
1609
|
+
global_pm_root: globalPmRoot,
|
|
1610
|
+
capture_level: captureLevel,
|
|
1611
|
+
otel_traces_endpoint: otelTracesEndpoint ?? void 0,
|
|
1612
|
+
otel_trace_id: otelTracesEndpoint ? crypto.randomBytes(16).toString("hex") : void 0,
|
|
1613
|
+
otel_span_id: otelTracesEndpoint ? crypto.randomBytes(8).toString("hex") : void 0
|
|
1614
|
+
};
|
|
1615
|
+
} catch {
|
|
1616
|
+
return null;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
async function finishTelemetryCommand(activeCommand, outcome) {
|
|
1620
|
+
if (!activeCommand) {
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1623
|
+
try {
|
|
1624
|
+
const finishedAt = nowIso();
|
|
1625
|
+
const durationMs = Math.max(0, Date.now() - activeCommand.started_at_ms);
|
|
1626
|
+
const normalizedErrorCode = normalizeTelemetryErrorCode(inferTelemetryErrorCode({
|
|
1627
|
+
ok: outcome.ok,
|
|
1628
|
+
errorCode: outcome.error_code,
|
|
1629
|
+
errorMessage: outcome.error,
|
|
1630
|
+
exitCode: outcome.exit_code
|
|
1631
|
+
}));
|
|
1632
|
+
const normalizedErrorCategory = normalizeTelemetryErrorCategory({
|
|
1633
|
+
ok: outcome.ok,
|
|
1634
|
+
errorCode: normalizedErrorCode,
|
|
1635
|
+
errorCategory: outcome.error_category
|
|
1636
|
+
});
|
|
1637
|
+
const normalizedExitCode = normalizeTelemetryExitCode(outcome.exit_code, outcome.ok);
|
|
1638
|
+
const commandResolution = outcome.command_resolution ?? deriveTelemetryCommandResolution({
|
|
1639
|
+
ok: outcome.ok,
|
|
1640
|
+
errorCode: normalizedErrorCode,
|
|
1641
|
+
errorCategory: normalizedErrorCategory
|
|
1642
|
+
});
|
|
1643
|
+
const resolutionStage = outcome.resolution_stage ?? "execute";
|
|
1644
|
+
const event = {
|
|
1645
|
+
schema_version: TELEMETRY_SCHEMA_VERSION,
|
|
1646
|
+
event_id: crypto.randomUUID(),
|
|
1647
|
+
event_type: "command_finish",
|
|
1648
|
+
occurred_at: finishedAt,
|
|
1649
|
+
installation_id: activeCommand.installation_id,
|
|
1650
|
+
session_id: PROCESS_SESSION_ID,
|
|
1651
|
+
command: activeCommand.command,
|
|
1652
|
+
payload: buildCommandFinishPayload({
|
|
1653
|
+
captureLevel: activeCommand.capture_level,
|
|
1654
|
+
pmVersion: activeCommand.pm_version,
|
|
1655
|
+
sourceContext: {
|
|
1656
|
+
source_context: activeCommand.source_context,
|
|
1657
|
+
source_context_source: activeCommand.source_context_source
|
|
1658
|
+
},
|
|
1659
|
+
outcome,
|
|
1660
|
+
durationMs,
|
|
1661
|
+
startedAt: activeCommand.started_at,
|
|
1662
|
+
command: activeCommand.command,
|
|
1663
|
+
installationId: activeCommand.installation_id,
|
|
1664
|
+
commandTaxonomy: activeCommand.command_taxonomy,
|
|
1665
|
+
exitCode: normalizedExitCode,
|
|
1666
|
+
errorCode: normalizedErrorCode,
|
|
1667
|
+
errorCategory: normalizedErrorCategory,
|
|
1668
|
+
commandResolution,
|
|
1669
|
+
resolutionStage
|
|
1670
|
+
})
|
|
1671
|
+
};
|
|
1672
|
+
await enqueueTelemetryEvent(activeCommand.global_pm_root, event);
|
|
1673
|
+
const otelRequest = buildOtelSpanRequest(activeCommand, {
|
|
1674
|
+
...outcome,
|
|
1675
|
+
exit_code: normalizedExitCode,
|
|
1676
|
+
error_code: normalizedErrorCode,
|
|
1677
|
+
error_category: normalizedErrorCategory
|
|
1678
|
+
}, finishedAt, durationMs);
|
|
1679
|
+
if (otelRequest) {
|
|
1680
|
+
await enqueuePendingOtelSpan(activeCommand.global_pm_root, otelRequest);
|
|
1681
|
+
}
|
|
1682
|
+
scheduleTelemetryFlush(activeCommand.global_pm_root, activeCommand.endpoint, activeCommand.retention_days);
|
|
1683
|
+
} catch {
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
async function emitTelemetryErrorEvent(context) {
|
|
1687
|
+
if (telemetryDisabledByEnvironment()) {
|
|
1688
|
+
return;
|
|
1689
|
+
}
|
|
1690
|
+
try {
|
|
1691
|
+
const globalPmRoot = resolveGlobalPmRoot(process.cwd());
|
|
1692
|
+
const settings = await readSettings(globalPmRoot);
|
|
1693
|
+
if (!settings.telemetry.enabled) {
|
|
1694
|
+
return;
|
|
1695
|
+
}
|
|
1696
|
+
const captureLevel = normalizeCaptureLevel(settings.telemetry.capture_level);
|
|
1697
|
+
const { installationId, endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);
|
|
1698
|
+
const pmVersion = normalizePmVersion(context.pm_version);
|
|
1699
|
+
const sourceContext = resolveTelemetrySourceContext(context.global);
|
|
1700
|
+
const pmRootHash = hashWithInstallationId(installationId, context.pm_root);
|
|
1701
|
+
const cwdHash = hashWithInstallationId(installationId, process.cwd());
|
|
1702
|
+
const occurredAt = nowIso();
|
|
1703
|
+
const normalizedErrorCode = normalizeTelemetryErrorCode(inferTelemetryErrorCode({
|
|
1704
|
+
ok: false,
|
|
1705
|
+
errorCode: context.error_code,
|
|
1706
|
+
errorMessage: context.error_message,
|
|
1707
|
+
exitCode: context.exit_code
|
|
1708
|
+
}));
|
|
1709
|
+
const normalizedErrorCategory = context.error_category ?? resolveTelemetryErrorCategory(normalizedErrorCode);
|
|
1710
|
+
const normalizedExitCode = normalizeTelemetryExitCode(context.exit_code, false);
|
|
1711
|
+
const normalizedCommand = context.command.trim().length > 0 ? context.command : "<unknown>";
|
|
1712
|
+
const commandTaxonomy = deriveTelemetryCommandTaxonomy(normalizedCommand);
|
|
1713
|
+
const commandResolution = context.command_resolution ?? deriveTelemetryCommandResolution({
|
|
1714
|
+
ok: false,
|
|
1715
|
+
errorCode: normalizedErrorCode,
|
|
1716
|
+
errorCategory: normalizedErrorCategory
|
|
1717
|
+
});
|
|
1718
|
+
const resolutionStage = context.resolution_stage ?? "unknown";
|
|
1719
|
+
const event = {
|
|
1720
|
+
schema_version: TELEMETRY_SCHEMA_VERSION,
|
|
1721
|
+
event_id: crypto.randomUUID(),
|
|
1722
|
+
event_type: "command_error",
|
|
1723
|
+
occurred_at: occurredAt,
|
|
1724
|
+
installation_id: installationId,
|
|
1725
|
+
session_id: PROCESS_SESSION_ID,
|
|
1726
|
+
command: sanitizeString(normalizedCommand, "redacted"),
|
|
1727
|
+
payload: buildCommandErrorPayload({
|
|
1728
|
+
captureLevel,
|
|
1729
|
+
pmVersion,
|
|
1730
|
+
sourceContext,
|
|
1731
|
+
command: normalizedCommand,
|
|
1732
|
+
commandTaxonomy,
|
|
1733
|
+
commandResolution,
|
|
1734
|
+
resolutionStage,
|
|
1735
|
+
args: context.args,
|
|
1736
|
+
options: context.options,
|
|
1737
|
+
pmRootHash,
|
|
1738
|
+
cwdHash,
|
|
1739
|
+
installationId,
|
|
1740
|
+
errorCode: normalizedErrorCode,
|
|
1741
|
+
errorCategory: normalizedErrorCategory,
|
|
1742
|
+
exitCode: normalizedExitCode,
|
|
1743
|
+
errorMessage: context.error_message
|
|
1744
|
+
})
|
|
1745
|
+
};
|
|
1746
|
+
await enqueueTelemetryEvent(globalPmRoot, event);
|
|
1747
|
+
scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays);
|
|
1748
|
+
} catch {
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
export {
|
|
1753
|
+
deriveTelemetryCommandTaxonomy,
|
|
1754
|
+
deriveTelemetryCommandResolution,
|
|
1755
|
+
TELEMETRY_SCHEMA_VERSION,
|
|
1756
|
+
TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS,
|
|
1757
|
+
PM_TELEMETRY_SOURCE_CONTEXT_VALUES,
|
|
1758
|
+
flushTelemetryQueueNow,
|
|
1759
|
+
startTelemetryCommand,
|
|
1760
|
+
finishTelemetryCommand,
|
|
1761
|
+
emitTelemetryErrorEvent
|
|
1762
|
+
};
|
|
1763
|
+
//# sourceMappingURL=chunk-SQYJ4HF2.js.map
|
|
1764
|
+
|
|
1765
|
+
//# debugId=825d45fe-c7c3-54cc-b538-e616300b0747
|