@unbrained/pm-cli 2026.6.5 → 2026.6.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 +40 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +12 -4
- package/dist/cli/commands/completion.js +21 -7
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/contracts.js +5 -3
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/gc.d.ts +8 -1
- package/dist/cli/commands/gc.js +26 -3
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/health.js +15 -2
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.d.ts +4 -1
- package/dist/cli/commands/history.js +12 -24
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +3 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +8 -1
- package/dist/cli/commands/stats.js +18 -17
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +8 -0
- package/dist/cli/commands/telemetry.js +253 -0
- package/dist/cli/commands/telemetry.js.map +1 -0
- package/dist/cli/help-content.js +11 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/register-list-query.js +7 -4
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.js +29 -6
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +16 -0
- package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js → activity-JM6DTDND.js} +11 -11
- package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js → aggregate-GI7WSZPH.js} +10 -10
- package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js → aggregate-VNAHUNNF.js} +10 -10
- package/dist/cli-bundle/chunks/{append-5JE3YGXU.js → append-7H5N64R2.js} +8 -8
- package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js → append-WMKRXKCE.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js → chunk-23YFZ3IG.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js → chunk-2HVRUSQA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-V3JQ4IPL.js → chunk-2RSPZI5H.js} +102 -22
- package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js → chunk-2VBQ6ZXS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js → chunk-2VVCGBNV.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js → chunk-3BWOVLTH.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js → chunk-3FI4SEFT.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js → chunk-3LB74A67.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js → chunk-3VAM3NNM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js → chunk-4LL6TK5B.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js → chunk-52MAOQ6J.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js → chunk-5FDATVEZ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js → chunk-5SFCOO6B.js} +76 -7
- package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js.map → chunk-5SFCOO6B.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js → chunk-6ER6DXH5.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js → chunk-6P6GGMOG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js → chunk-77GFDHGF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js → chunk-AO442XLN.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js → chunk-AY43SBIN.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js → chunk-BQHUILZS.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js → chunk-E5FJNAZA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js → chunk-ECCMVXGM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js → chunk-FRAUKRU2.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js → chunk-GCOQW437.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js → chunk-GGYWB3Y2.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js → chunk-GU2ZJ2VV.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js → chunk-GXSUPCBV.js} +5 -4
- package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js → chunk-HZGUAH22.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js → chunk-I2HSTRJF.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js → chunk-I6BNFU5X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js → chunk-IJGCZSIQ.js} +12 -12
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js +1491 -0
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js → chunk-KAG77BY3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js → chunk-KJ33AOCY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js → chunk-KJE2FOS4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GNHVV4SY.js → chunk-KWU6HG75.js} +37 -14
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js → chunk-LB3RUL2N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js → chunk-LCM63IXU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js → chunk-ME2YH6FN.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js → chunk-MITFDD35.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js → chunk-N7ACFE26.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js → chunk-NUZ5HKR4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js → chunk-OVQCEJPG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js → chunk-OZ7NSQHL.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-TK633IVD.js → chunk-PDDFYW4X.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js → chunk-PIU6RSL3.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js → chunk-PO3GSVFV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WIKR7KFL.js → chunk-PRJCELV4.js} +108 -21
- package/dist/cli-bundle/chunks/chunk-PRJCELV4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZQ4F6EC4.js → chunk-PROOHX4K.js} +38 -15
- package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js → chunk-Q7SPNHLW.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-RANZIID5.js → chunk-QO7EBBOM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js → chunk-R6UFP2GE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js → chunk-RWPSOIEE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js → chunk-RZN6VURO.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js +1501 -0
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KA24HME7.js → chunk-T3LC5LKB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js → chunk-TCD3R2PF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js → chunk-TPH5XEVD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js → chunk-U5SXYXSY.js} +75 -6
- package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js.map → chunk-U5SXYXSY.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js → chunk-UBOPJT3S.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js → chunk-UM2GBHS4.js} +5 -4
- package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js → chunk-W7XABV4H.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js → chunk-WKY2IBOQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7K24QB23.js → chunk-WOPXVEZP.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js → chunk-WSMOSYRD.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js → chunk-XLTD2HN3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js → chunk-XSJCLN2R.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js → chunk-XTGLRY2Y.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js → chunk-YL2DJGYS.js} +7 -7
- package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js → claim-4DBF6RVG.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js → claim-X2P4IB7J.js} +10 -10
- package/dist/cli-bundle/chunks/close-3HDWDA3L.js +13 -0
- package/dist/cli-bundle/chunks/{close-65DFYAVS.js → close-PTYFA45H.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js → close-many-7CGIDPTJ.js} +15 -15
- package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js → close-many-ERFO6LHR.js} +15 -15
- package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js → comments-OONGABK5.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js → comments-QKBYCWKD.js} +10 -10
- package/dist/cli-bundle/chunks/{config-DDPYIA6J.js → config-6FXCQKIF.js} +8 -8
- package/dist/cli-bundle/chunks/{config-5ON3ADRH.js → config-U4RZ4CQB.js} +8 -8
- package/dist/cli-bundle/chunks/{context-E6U3DWVM.js → context-FYYJGFWS.js} +13 -13
- package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js → context-YMJ3Z2HQ.js} +13 -13
- package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js → contracts-QDB6OMLQ.js} +10 -6
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-CXSFM45B.js → contracts-RFSPGVVJ.js} +9 -5
- package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js.map → contracts-RFSPGVVJ.js.map} +7 -1
- package/dist/cli-bundle/chunks/{create-WYFKN2U4.js → create-I5L4EYYZ.js} +13 -13
- package/dist/cli-bundle/chunks/create-JTZNCTQC.js +27 -0
- package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js → delete-7HPGI4GZ.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-RONNH4F4.js → delete-VXUPH5RS.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-WII3O4HB.js → deps-JSRRWC3Z.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js → deps-SCZIFK2Z.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-PDREIMLS.js → docs-GJK6K4VP.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js → docs-WW4N3MBM.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js → extension-J7IBMFTD.js} +4 -4
- package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js → extension-VDY2U33M.js} +4 -4
- package/dist/cli-bundle/chunks/{files-2PN7UM2D.js → files-ISZJGILQ.js} +9 -9
- package/dist/cli-bundle/chunks/{files-MXYS5W4M.js → files-WKOD326U.js} +9 -9
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js +362 -0
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +1 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js +372 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-WXMLRG7M.js → get-RV37HT3G.js} +10 -10
- package/dist/cli-bundle/chunks/{get-CINFEUIY.js → get-WXU6WI5P.js} +10 -10
- package/dist/cli-bundle/chunks/{health-IT5DBPRJ.js → health-6L6EH4WR.js} +26 -13
- package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-5VPOJQ53.js → health-LOI2HHKB.js} +27 -14
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +1 -0
- package/dist/cli-bundle/chunks/history-2BA3T5AE.js +20 -0
- package/dist/cli-bundle/chunks/{history-FLZIP7PM.js → history-PKN67D5O.js} +10 -10
- package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js → history-redact-V4FOJGS7.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js → history-repair-HIBCBIKK.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js → history-repair-SDMHR7JT.js} +11 -11
- package/dist/cli-bundle/chunks/init-HIVSNX3O.js +16 -0
- package/dist/cli-bundle/chunks/{init-6MRFVOLH.js → init-P56QYWJF.js} +8 -8
- package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js → learnings-GDFRG5J7.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js → learnings-MIXSESLK.js} +10 -10
- package/dist/cli-bundle/chunks/{list-DBRECOG4.js → list-FGOWQMSM.js} +10 -10
- package/dist/cli-bundle/chunks/list-MUSQNMTD.js +20 -0
- package/dist/cli-bundle/chunks/{notes-42LIC3UE.js → notes-4XVSH2AZ.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js → notes-5UK3GEH2.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js → plan-DUMBV3QB.js} +13 -13
- package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js → plan-SLMODHWX.js} +13 -13
- package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js → register-list-query-POCFZ5JW.js} +24 -22
- package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js.map → register-list-query-POCFZ5JW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js → register-list-query-WST76HSQ.js} +23 -21
- package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js.map → register-list-query-WST76HSQ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js → register-mutation-N5GSUZJV.js} +30 -30
- package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js → register-mutation-OA675SOU.js} +30 -30
- package/dist/cli-bundle/chunks/{register-operations-KYUOOOOD.js → register-operations-GNHBE5I3.js} +47 -34
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js → register-operations-N3PMHXH5.js} +46 -33
- package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js.map → register-operations-N3PMHXH5.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js → register-setup-JIMPKJKV.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js → register-setup-ZHJI2DI3.js} +15 -15
- package/dist/cli-bundle/chunks/restore-D4RGNX33.js +17 -0
- package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js → restore-PBL6T5TW.js} +11 -11
- package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js → schema-2NOO6NGB.js} +8 -8
- package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js → schema-EBI4NLUO.js} +8 -8
- package/dist/cli-bundle/chunks/{search-C7NPB7G7.js → search-JPUQTVCY.js} +10 -10
- package/dist/cli-bundle/chunks/{search-5A3BMFA7.js → search-OA6JX27A.js} +10 -10
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js +202 -0
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js +212 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js +251 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js +248 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js → test-MXX3E5JL.js} +13 -13
- package/dist/cli-bundle/chunks/{test-OFYONO3C.js → test-WBROAJIE.js} +13 -13
- package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js → test-all-N6NSRDTV.js} +13 -13
- package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js → test-all-NTOZ7C3M.js} +13 -13
- package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js → test-runs-V6A7LPWZ.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js → test-runs-WMVTQU3Y.js} +5 -5
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js +25 -0
- package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +21 -0
- package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js → update-many-EM6OXYGO.js} +22 -22
- package/dist/cli-bundle/chunks/{update-many-322CCH2L.js → update-many-KGGEYABR.js} +22 -22
- package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js → upgrade-BLI7XBAJ.js} +4 -4
- package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js → upgrade-LXPOQKFV.js} +4 -4
- package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js → validate-AGOAUOVW.js} +15 -15
- package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js → validate-L5J6A7YO.js} +15 -15
- package/dist/cli-bundle/main.js +42 -1451
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/history/history-diff.d.ts +47 -0
- package/dist/core/history/history-diff.js +152 -0
- package/dist/core/history/history-diff.js.map +1 -0
- package/dist/core/history/history-storage-stats.d.ts +31 -0
- package/dist/core/history/history-storage-stats.js +101 -0
- package/dist/core/history/history-storage-stats.js.map +1 -0
- package/dist/core/lock/lock-gc.d.ts +46 -0
- package/dist/core/lock/lock-gc.js +194 -0
- package/dist/core/lock/lock-gc.js.map +1 -0
- package/dist/core/shared/serial-queue.d.ts +12 -0
- package/dist/core/shared/serial-queue.js +43 -0
- package/dist/core/shared/serial-queue.js.map +1 -0
- package/dist/core/store/settings.d.ts +19 -1
- package/dist/core/store/settings.js +92 -7
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/observability.js +3 -3
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +16 -4
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +155 -37
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -7
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +23 -0
- package/dist/sdk/cli-contracts.js +41 -7
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/ARCHITECTURE.md +11 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +33 -2
- package/docs/CONFIGURATION.md +9 -1
- package/docs/EXTENSIONS.md +7 -0
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
- package/docs/ONBOARDING.md +165 -0
- package/docs/QUICKSTART.md +1 -1
- package/docs/README.md +12 -4
- package/docs/RELEASING.md +36 -1
- package/docs/TESTING.md +19 -1
- package/package.json +5 -2
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +7 -4
- package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +0 -16
- package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +0 -7
- package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +0 -13
- package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +0 -7
- package/dist/cli-bundle/chunks/create-ATONSAZW.js +0 -27
- package/dist/cli-bundle/chunks/gc-GT552UJH.js +0 -178
- package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +0 -1
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +0 -181
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +0 -7
- package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +0 -1
- package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-6FC4H6HI.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +0 -19
- package/dist/cli-bundle/chunks/init-KHX3FEEM.js +0 -16
- package/dist/cli-bundle/chunks/list-53LZ2AEO.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +0 -17
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +0 -120
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +0 -123
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +0 -7
- package/dist/cli-bundle/chunks/update-6YEHPVXH.js +0 -25
- package/dist/cli-bundle/chunks/update-PYLVHMRD.js +0 -21
- /package/dist/cli-bundle/chunks/{activity-P5BUMWP3.js.map → activity-CVXTCHYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js.map → activity-JM6DTDND.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js.map → aggregate-GI7WSZPH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js.map → aggregate-VNAHUNNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-5JE3YGXU.js.map → append-7H5N64R2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js.map → append-WMKRXKCE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js.map → chunk-23YFZ3IG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js.map → chunk-2HVRUSQA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js.map → chunk-2VBQ6ZXS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js.map → chunk-2VVCGBNV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js.map → chunk-3BWOVLTH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js.map → chunk-3FI4SEFT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js.map → chunk-3LB74A67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js.map → chunk-3VAM3NNM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js.map → chunk-4LL6TK5B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js.map → chunk-52MAOQ6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js.map → chunk-5FDATVEZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js.map → chunk-6ER6DXH5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js.map → chunk-6P6GGMOG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js.map → chunk-77GFDHGF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js.map → chunk-AO442XLN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js.map → chunk-AY43SBIN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js.map → chunk-BQHUILZS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js.map → chunk-E5FJNAZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js.map → chunk-ECCMVXGM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js.map → chunk-FRAUKRU2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js.map → chunk-GCOQW437.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js.map → chunk-GGYWB3Y2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js.map → chunk-GU2ZJ2VV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js.map → chunk-GXSUPCBV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js.map → chunk-HZGUAH22.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js.map → chunk-I2HSTRJF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js.map → chunk-I6BNFU5X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js.map → chunk-IJGCZSIQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js.map → chunk-KAG77BY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js.map → chunk-KJ33AOCY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js.map → chunk-KJE2FOS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js.map → chunk-LB3RUL2N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js.map → chunk-LCM63IXU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js.map → chunk-ME2YH6FN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js.map → chunk-MITFDD35.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js.map → chunk-N7ACFE26.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js.map → chunk-NUZ5HKR4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js.map → chunk-OVQCEJPG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js.map → chunk-OZ7NSQHL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TK633IVD.js.map → chunk-PDDFYW4X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js.map → chunk-PIU6RSL3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js.map → chunk-PO3GSVFV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js.map → chunk-Q7SPNHLW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RANZIID5.js.map → chunk-QO7EBBOM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js.map → chunk-R6UFP2GE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js.map → chunk-RWPSOIEE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js.map → chunk-RZN6VURO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KA24HME7.js.map → chunk-T3LC5LKB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js.map → chunk-TCD3R2PF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js.map → chunk-TPH5XEVD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js.map → chunk-UBOPJT3S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js.map → chunk-UM2GBHS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js.map → chunk-W7XABV4H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js.map → chunk-WKY2IBOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7K24QB23.js.map → chunk-WOPXVEZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js.map → chunk-WSMOSYRD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js.map → chunk-XLTD2HN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js.map → chunk-XSJCLN2R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js.map → chunk-XTGLRY2Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js.map → chunk-YL2DJGYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js.map → claim-4DBF6RVG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js.map → claim-X2P4IB7J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-RMHQ3KWH.js.map → close-3HDWDA3L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-65DFYAVS.js.map → close-PTYFA45H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js.map → close-many-7CGIDPTJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js.map → close-many-ERFO6LHR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js.map → comments-OONGABK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js.map → comments-QKBYCWKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-DDPYIA6J.js.map → config-6FXCQKIF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-5ON3ADRH.js.map → config-U4RZ4CQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-E6U3DWVM.js.map → context-FYYJGFWS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js.map → context-YMJ3Z2HQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-WYFKN2U4.js.map → create-I5L4EYYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-ATONSAZW.js.map → create-JTZNCTQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js.map → delete-7HPGI4GZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RONNH4F4.js.map → delete-VXUPH5RS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-WII3O4HB.js.map → deps-JSRRWC3Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js.map → deps-SCZIFK2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-PDREIMLS.js.map → docs-GJK6K4VP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js.map → docs-WW4N3MBM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js.map → extension-J7IBMFTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js.map → extension-VDY2U33M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-2PN7UM2D.js.map → files-ISZJGILQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-MXYS5W4M.js.map → files-WKOD326U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-WXMLRG7M.js.map → get-RV37HT3G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-CINFEUIY.js.map → get-WXU6WI5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-6FC4H6HI.js.map → history-2BA3T5AE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-FLZIP7PM.js.map → history-PKN67D5O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-XKYEZDBL.js.map → history-redact-JBZNXHGR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js.map → history-redact-V4FOJGS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js.map → history-repair-HIBCBIKK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js.map → history-repair-SDMHR7JT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-KHX3FEEM.js.map → init-HIVSNX3O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-6MRFVOLH.js.map → init-P56QYWJF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js.map → learnings-GDFRG5J7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js.map → learnings-MIXSESLK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DBRECOG4.js.map → list-FGOWQMSM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-53LZ2AEO.js.map → list-MUSQNMTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-42LIC3UE.js.map → notes-4XVSH2AZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js.map → notes-5UK3GEH2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js.map → plan-DUMBV3QB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js.map → plan-SLMODHWX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js.map → register-mutation-N5GSUZJV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js.map → register-mutation-OA675SOU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js.map → register-setup-JIMPKJKV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js.map → register-setup-ZHJI2DI3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-JL5QIH7H.js.map → restore-D4RGNX33.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js.map → restore-PBL6T5TW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js.map → schema-2NOO6NGB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js.map → schema-EBI4NLUO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-C7NPB7G7.js.map → search-JPUQTVCY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-5A3BMFA7.js.map → search-OA6JX27A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js.map → test-MXX3E5JL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-OFYONO3C.js.map → test-WBROAJIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js.map → test-all-N6NSRDTV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js.map → test-all-NTOZ7C3M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js.map → test-runs-V6A7LPWZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js.map → test-runs-WMVTQU3Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-6YEHPVXH.js.map → update-OSV3NAQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-PYLVHMRD.js.map → update-YRXSUGYQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js.map → update-many-EM6OXYGO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-322CCH2L.js.map → update-many-KGGEYABR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js.map → upgrade-BLI7XBAJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js.map → upgrade-LXPOQKFV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js.map → validate-AGOAUOVW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js.map → validate-L5J6A7YO.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../core/telemetry/observability.ts","../../../../../../../../core/telemetry/runtime.ts"],"sourcesContent":["import { EXIT_CODE, type TelemetryErrorCategory } from \"../shared/constants.js\";\n\nexport type TelemetryResolutionStage = \"parse\" | \"preflight\" | \"execute\" | \"unknown\";\n\nexport type TelemetryCommandResolution =\n | \"success\"\n | \"nonexistent_command\"\n | \"invalid_option\"\n | \"missing_required_option\"\n | \"missing_required_argument\"\n | \"invalid_usage\"\n | \"validation_failed\"\n | \"health_findings\"\n | \"validation_findings\"\n | \"conflict\"\n | \"runtime_failed\"\n | \"unknown_failed\";\n\nexport interface TelemetryCommandTaxonomy {\n command_path: string;\n command_root: string;\n command_leaf: string;\n command_depth: number;\n command_family: \"setup\" | \"query\" | \"mutation\" | \"testing\" | \"extension\" | \"diagnostics\" | \"other\";\n}\n\ninterface InferTelemetryErrorCodeParams {\n ok: boolean;\n errorCode?: string;\n errorMessage?: string;\n exitCode?: number;\n}\n\nconst SETUP_ROOT_COMMANDS = new Set([\"init\", \"config\", \"completion\", \"completion-statuses\", \"completion-tags\", \"completion-types\"]);\nconst QUERY_ROOT_COMMANDS = new Set([\n \"list\",\n \"list-all\",\n \"list-open\",\n \"list-in-progress\",\n \"list-blocked\",\n \"list-closed\",\n \"list-canceled\",\n \"list-draft\",\n \"search\",\n \"get\",\n \"context\",\n \"calendar\",\n \"history\",\n \"activity\",\n \"aggregate\",\n \"deps\",\n \"contracts\",\n \"stats\",\n \"dedupe-audit\",\n]);\nconst MUTATION_ROOT_COMMANDS = new Set([\n \"create\",\n \"update\",\n \"update-many\",\n \"close-many\",\n \"append\",\n \"close\",\n \"delete\",\n \"restore\",\n \"claim\",\n \"release\",\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"docs\",\n \"start-task\",\n \"pause-task\",\n \"close-task\",\n]);\nconst TESTING_ROOT_COMMANDS = new Set([\"test\", \"test-all\", \"test-runs\", \"test-verify\", \"trace-test\", \"test-ping\"]);\nconst DIAGNOSTICS_ROOT_COMMANDS = new Set([\"health\", \"validate\", \"normalize\", \"reindex\", \"gc\", \"telemetry\", \"extension-doctor\"]);\n\nfunction normalizeCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .replaceAll(/\\s+/g, \" \")\n .toLowerCase();\n}\n\nfunction normalizeErrorCode(errorCode: string | undefined): string | undefined {\n const normalized = errorCode?.trim().toLowerCase();\n return normalized && normalized.length > 0 ? normalized : undefined;\n}\n\nexport function deriveTelemetryCommandTaxonomy(commandPath: string): TelemetryCommandTaxonomy {\n const normalizedPath = normalizeCommandPath(commandPath);\n const tokens = normalizedPath.length > 0 ? normalizedPath.split(\" \") : [\"<unknown>\"];\n const root = tokens[0] ?? \"<unknown>\";\n const leaf = tokens[tokens.length - 1] ?? root;\n\n let family: TelemetryCommandTaxonomy[\"command_family\"] = \"other\";\n if (SETUP_ROOT_COMMANDS.has(root)) {\n family = \"setup\";\n } else if (QUERY_ROOT_COMMANDS.has(root)) {\n family = \"query\";\n } else if (MUTATION_ROOT_COMMANDS.has(root)) {\n family = \"mutation\";\n } else if (TESTING_ROOT_COMMANDS.has(root)) {\n family = \"testing\";\n } else if (root === \"extension\") {\n family = \"extension\";\n } else if (DIAGNOSTICS_ROOT_COMMANDS.has(root)) {\n family = \"diagnostics\";\n }\n\n return {\n command_path: normalizedPath.length > 0 ? normalizedPath : \"<unknown>\",\n command_root: root,\n command_leaf: leaf,\n command_depth: tokens.length,\n command_family: family,\n };\n}\n\nexport function inferTelemetryErrorCode(params: InferTelemetryErrorCodeParams): string | undefined {\n if (params.ok) {\n return undefined;\n }\n\n const explicit = normalizeErrorCode(params.errorCode);\n if (explicit) {\n return explicit;\n }\n\n const message = (params.errorMessage ?? \"\").trim().toLowerCase();\n if (message.includes(\"unknown command\")) {\n return \"unknown_command\";\n }\n if (message.includes(\"unknown option\")) {\n return \"unknown_option\";\n }\n if (message.includes(\"missing required options\") || message.includes(\"missing required option\")) {\n return \"missing_required_option\";\n }\n if (message.includes(\"missing required argument\")) {\n return \"missing_required_argument\";\n }\n if (message.includes(\"no update flags provided\")) {\n return \"no_update_fields\";\n }\n if (message.includes(\"is assigned to\") && message.includes(\"use --force\")) {\n return \"ownership_conflict\";\n }\n if (message.includes(\"is locked\")) {\n return \"lock_conflict\";\n }\n if (message.includes(\"already terminal\") && message.includes(\"use --force\")) {\n return \"terminal_state_conflict\";\n }\n if (message.includes(\"tracker is not initialized\")) {\n return \"tracker_not_initialized\";\n }\n if (message.includes(\" not found\")) {\n return \"item_not_found\";\n }\n if (\n message.includes(\"use \\\"pm close <id> <text>\\\" to close an item\") ||\n (message.includes(\"invalid --status value\") && message.includes(\"\\\"closed\\\"\"))\n ) {\n return \"close_through_update\";\n }\n if (message.startsWith(\"invalid \") || message.includes(\" must be \") || message.includes(\" requires \")) {\n return \"invalid_argument_value\";\n }\n if (message.includes(\"strict create mode requires concrete values for --\")) {\n return \"missing_required_option\";\n }\n if (message.includes(\"either as positional\") && message.includes(\"not both\")) {\n return \"invalid_command_usage\";\n }\n\n const exitCode = Number.isFinite(params.exitCode) ? Math.max(0, Math.trunc(params.exitCode ?? 0)) : undefined;\n if (exitCode === EXIT_CODE.USAGE) {\n return \"invalid_command_usage\";\n }\n if (exitCode === EXIT_CODE.NOT_FOUND) {\n return \"item_not_found\";\n }\n if (exitCode === EXIT_CODE.CONFLICT) {\n return \"lock_conflict\";\n }\n if (exitCode === EXIT_CODE.DEPENDENCY_FAILED) {\n return \"dependency_failed\";\n }\n return \"command_failed\";\n}\n\nexport function deriveTelemetryCommandResolution(params: {\n ok: boolean;\n errorCode?: string;\n errorCategory?: TelemetryErrorCategory;\n}): TelemetryCommandResolution {\n if (params.ok) {\n return \"success\";\n }\n\n const normalizedCode = normalizeErrorCode(params.errorCode);\n if (normalizedCode === \"unknown_command\") {\n return \"nonexistent_command\";\n }\n if (normalizedCode === \"unknown_option\") {\n return \"invalid_option\";\n }\n if (normalizedCode === \"missing_required_option\") {\n return \"missing_required_option\";\n }\n if (normalizedCode === \"missing_required_argument\") {\n return \"missing_required_argument\";\n }\n if (normalizedCode === \"health_findings\") {\n return \"health_findings\";\n }\n if (normalizedCode === \"validation_findings\") {\n return \"validation_findings\";\n }\n\n if (params.errorCategory === \"usage\") {\n return \"invalid_usage\";\n }\n if (params.errorCategory === \"validation\") {\n return \"validation_failed\";\n }\n if (params.errorCategory === \"conflict\") {\n return \"conflict\";\n }\n if (params.errorCategory === \"runtime\") {\n return \"runtime_failed\";\n }\n return \"unknown_failed\";\n}\n","import crypto from \"node:crypto\";\nimport { spawn } from \"node:child_process\";\nimport { mkdirSync, rmSync, statSync } from \"node:fs\";\nimport { mkdir, readdir, rm, stat } from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport type { GlobalOptions } from \"../shared/command-types.js\";\nimport { resolvePmPackageRootFromModule } from \"../packages/root.js\";\nimport { appendLineAtomic, readFileIfExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { resolveTelemetryErrorCategory, type TelemetryErrorCategory } from \"../shared/constants.js\";\nimport { nowIso } from \"../shared/time.js\";\nimport { resolveGlobalPmRoot } from \"../store/paths.js\";\nimport { readSettings, writeSettings } from \"../store/settings.js\";\nimport {\n deriveTelemetryCommandResolution,\n deriveTelemetryCommandTaxonomy,\n inferTelemetryErrorCode,\n type TelemetryCommandResolution,\n type TelemetryCommandTaxonomy,\n type TelemetryResolutionStage,\n} from \"./observability.js\";\n\nconst TELEMETRY_QUEUE_RELATIVE_PATH = path.join(\"runtime\", \"telemetry\", \"events.jsonl\");\nconst TELEMETRY_STATE_RELATIVE_PATH = path.join(\"runtime\", \"telemetry\", \"state.json\");\nconst TELEMETRY_SCHEMA_VERSION = 1;\nconst TELEMETRY_CLIENT_SCHEMA_VERSION = 1;\nconst TELEMETRY_FLUSH_BATCH_SIZE = 100;\nconst TELEMETRY_MAX_RETRY_DELAY_MS = 3_600_000;\nconst TELEMETRY_RETRY_BASE_DELAY_MS = 30_000;\nconst TELEMETRY_HTTP_TIMEOUT_MS = 5_000;\nconst MILLISECONDS_PER_DAY = 86_400_000;\nconst TELEMETRY_MAX_EVENT_BYTES = 65_536;\nconst TELEMETRY_SANITIZE_MAX_DEPTH = 6;\nconst TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS = 20;\nconst TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS = 15;\nconst TELEMETRY_RESULT_PREVIEW_MAX_BYTES = 8_192;\nconst TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS = [25, 50, 100, 200] as const;\nconst TELEMETRY_QUEUE_TMP_ORPHAN_MAX_AGE_MS = 60 * 60 * 1000;\nconst TELEMETRY_FLUSH_LOCK_STALE_MS = 60_000;\nconst TELEMETRY_FLUSH_SPAWN_LOCK_STALE_MS = 60_000;\nconst OTEL_TRACES_ENDPOINT_ENV = \"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT\";\nconst OTEL_BASE_ENDPOINT_ENV = \"OTEL_EXPORTER_OTLP_ENDPOINT\";\nconst OTEL_SERVICE_NAME_ENV = \"OTEL_SERVICE_NAME\";\nconst PM_TELEMETRY_DISABLED_ENV = \"PM_TELEMETRY_DISABLED\";\nconst PM_NO_TELEMETRY_ENV = \"PM_NO_TELEMETRY\";\nconst PM_TELEMETRY_DISABLED_VALUES = new Set([\"1\", \"true\", \"yes\", \"on\"]);\nconst PM_TELEMETRY_OTEL_DISABLED_ENV = \"PM_TELEMETRY_OTEL_DISABLED\";\nconst PM_TELEMETRY_OTEL_DISABLED_VALUES = new Set([\"1\", \"true\", \"yes\", \"on\"]);\nconst PM_TELEMETRY_INLINE_FLUSH_ENV = \"PM_TELEMETRY_INLINE_FLUSH\";\nconst PM_TELEMETRY_FLUSH_CHILD_ENV = \"PM_TELEMETRY_FLUSH_CHILD\";\nconst PM_TELEMETRY_SOURCE_CONTEXT_ENV = \"PM_TELEMETRY_SOURCE_CONTEXT\";\nconst PM_TELEMETRY_SOURCE_CONTEXT_VALUES = [\"user\", \"automation\", \"test\", \"dogfood\", \"audit_smoke\"] as const;\n\nlet _lastFlushPromise: Promise<void> = Promise.resolve();\nlet _queueMutationPromise: Promise<unknown> = Promise.resolve();\n\n/** Wait for the most recent background flush to settle. Test-only helper. */\nexport async function waitForPendingFlush(): Promise<void> {\n await _lastFlushPromise;\n await _queueMutationPromise;\n}\nconst PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set<string>(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);\nconst BOOLEAN_TRUE_VALUES = new Set([\"1\", \"true\", \"yes\", \"on\"]);\nconst PROCESS_SESSION_ID = crypto.randomUUID();\n\nconst SENSITIVE_KEYWORDS = [\n \"token\",\n \"secret\",\n \"password\",\n \"passwd\",\n \"api_key\",\n \"apikey\",\n \"authorization\",\n \"cookie\",\n \"session\",\n \"credentials\",\n \"bearer\",\n] as const;\nconst SENSITIVE_INLINE_KEY_PATTERN =\n \"(?:token|secret|password|passwd|api[_-]?key|apikey|authorization|cookie|session|credentials|bearer)\";\nconst INLINE_SENSITIVE_ASSIGNMENT_PATTERN = new RegExp(\n `\\\\b(${SENSITIVE_INLINE_KEY_PATTERN})\\\\s*([:=])\\\\s*([^\\\\s,;]+)`,\n \"giu\",\n);\nconst INLINE_SENSITIVE_FLAG_PATTERN = new RegExp(\n `(--${SENSITIVE_INLINE_KEY_PATTERN})(=|\\\\s+)([^\\\\s,;]+)`,\n \"giu\",\n);\nconst ABSOLUTE_PATH_TOKEN_PATTERN = /(^|[\\s\"'`(=])\\/(?:[^\\s\"'`),;]+)/g;\nconst EMAIL_PATTERN = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}/giu;\nconst BEARER_TOKEN_PATTERN = /bearer\\s+[a-z0-9._=-]+/giu;\nconst PRIVATE_IP_PATTERN =\n /\\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;\n\ninterface TelemetryEvent {\n schema_version: number;\n event_id: string;\n event_type: \"command_start\" | \"command_finish\" | \"command_error\";\n occurred_at: string;\n installation_id: string;\n session_id: string;\n command: string;\n payload: Record<string, unknown>;\n}\n\ninterface QueuedTelemetryEvent {\n client_schema_version?: number;\n event: TelemetryEvent;\n attempts: number;\n last_attempt_at?: string;\n next_attempt_after?: string;\n}\n\ninterface TelemetryRuntimeState {\n last_attempted_flush_at?: string;\n last_successful_flush_at?: string;\n last_failed_flush_at?: string;\n last_failed_flush_error?: string;\n endpoint?: string;\n queue_entries?: number;\n}\n\ntype TelemetryCaptureLevel = \"minimal\" | \"redacted\" | \"max\";\ntype TelemetrySourceContext = (typeof PM_TELEMETRY_SOURCE_CONTEXT_VALUES)[number];\ntype TelemetrySourceContextSource = \"inferred\" | \"env_override\";\n\ninterface ResolvedTelemetrySourceContext {\n source_context: TelemetrySourceContext;\n source_context_source: TelemetrySourceContextSource;\n}\n\nexport interface ActiveTelemetryCommand {\n started_at: string;\n started_at_ms: number;\n command: string;\n command_taxonomy: TelemetryCommandTaxonomy;\n pm_version: string;\n source_context: TelemetrySourceContext;\n source_context_source: TelemetrySourceContextSource;\n installation_id: string;\n pm_root_hash: string;\n cwd_hash: string;\n endpoint: string;\n retention_days: number;\n global_pm_root: string;\n capture_level: TelemetryCaptureLevel;\n otel_traces_endpoint?: string;\n otel_trace_id?: string;\n otel_span_id?: string;\n}\n\nexport interface TelemetryCommandContext {\n command: string;\n pm_version: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\nexport interface TelemetryCommandOutcome {\n ok: boolean;\n error?: string;\n result?: unknown;\n exit_code?: number;\n error_code?: string;\n error_category?: TelemetryErrorCategory;\n command_resolution?: TelemetryCommandResolution;\n resolution_stage?: TelemetryResolutionStage;\n}\n\nexport interface TelemetryErrorEventContext {\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_version: string;\n pm_root: string;\n error_code: string;\n error_message: string;\n exit_code: number;\n error_category?: TelemetryErrorCategory;\n command_resolution?: TelemetryCommandResolution;\n resolution_stage?: TelemetryResolutionStage;\n}\n\n\nfunction queuePath(globalPmRoot: string): string {\n return path.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH);\n}\n\nfunction telemetryRuntimeDirectory(globalPmRoot: string): string {\n return path.dirname(queuePath(globalPmRoot));\n}\n\nfunction runtimeStatePath(globalPmRoot: string): string {\n return path.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH);\n}\n\nfunction flushLockPath(globalPmRoot: string): string {\n return path.join(globalPmRoot, \"runtime\", \"telemetry\", \"flush.lock\");\n}\n\nfunction flushSpawnLockPath(globalPmRoot: string): string {\n return path.join(globalPmRoot, \"runtime\", \"telemetry\", \"flush.spawn.lock\");\n}\n\nfunction telemetryFlushRunnerPath(): string {\n return path.join(resolvePmPackageRootFromModule(import.meta.url, [\"../../..\"]), \"dist\", \"cli\", \"telemetry-flush.js\");\n}\n\nfunction shouldFlushInline(): boolean {\n if (parseBooleanTrueLike(process.env[PM_TELEMETRY_INLINE_FLUSH_ENV])) {\n return true;\n }\n if (parseBooleanTrueLike(process.env[PM_TELEMETRY_FLUSH_CHILD_ENV])) {\n return true;\n }\n const nodeEnv = (process.env.NODE_ENV ?? \"\").trim().toLowerCase();\n return typeof process.env.VITEST === \"string\" || typeof process.env.VITEST_WORKER_ID === \"string\" || nodeEnv === \"test\";\n}\n\nasync function readRuntimeState(globalPmRoot: string): Promise<TelemetryRuntimeState> {\n const raw = await readFileIfExists(runtimeStatePath(globalPmRoot));\n if (!raw || raw.trim().length === 0) {\n return {};\n }\n try {\n const parsed = JSON.parse(raw) as TelemetryRuntimeState;\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return {};\n }\n return parsed;\n } catch {\n return {};\n }\n}\n\nasync function writeRuntimeState(globalPmRoot: string, patch: TelemetryRuntimeState): Promise<void> {\n try {\n const current = await readRuntimeState(globalPmRoot);\n const next: TelemetryRuntimeState = {\n ...current,\n ...patch,\n };\n const normalized = Object.fromEntries(\n Object.entries(next)\n .filter(([, value]) => value !== undefined)\n .sort((left, right) => left[0].localeCompare(right[0])),\n );\n await writeFileAtomic(runtimeStatePath(globalPmRoot), `${JSON.stringify(normalized, null, 2)}\\n`);\n } catch {\n // Runtime state persistence is best effort and must not block command execution.\n }\n}\n\nfunction isSensitiveKey(key: string): boolean {\n const normalized = key.trim().toLowerCase().replaceAll(\"-\", \"_\").replaceAll(/[^a-z0-9_]+/g, \"_\");\n const tokens = normalized.split(\"_\").filter((token) => token.length > 0);\n return SENSITIVE_KEYWORDS.some(\n (keyword) => normalized === keyword || normalized.endsWith(`_${keyword}`) || tokens.includes(keyword),\n );\n}\n\nfunction redactInlineSensitiveAssignments(input: string): string {\n const withoutAssignments = input.replaceAll(\n INLINE_SENSITIVE_ASSIGNMENT_PATTERN,\n (_match: string, key: string, delimiter: string): string => `${key}${delimiter}[redacted]`,\n );\n return withoutAssignments.replaceAll(\n INLINE_SENSITIVE_FLAG_PATTERN,\n (_match: string, flag: string, delimiter: string): string => `${flag}${delimiter}[redacted]`,\n );\n}\n\nfunction redactAbsolutePathTokens(input: string): string {\n return input.replaceAll(\n ABSOLUTE_PATH_TOKEN_PATTERN,\n (_match: string, prefix: string): string => `${prefix}[redacted_path]`,\n );\n}\n\nfunction sanitizeCommonSensitiveTokens(input: string): string {\n const withoutEmails = input.replaceAll(EMAIL_PATTERN, \"[redacted_email]\");\n const withoutBearer = withoutEmails.replaceAll(BEARER_TOKEN_PATTERN, \"bearer [redacted_token]\");\n return withoutBearer.replaceAll(PRIVATE_IP_PATTERN, \"[redacted_ip]\");\n}\n\nfunction sanitizeStringRedacted(input: string): string {\n const withoutCommonSensitiveTokens = sanitizeCommonSensitiveTokens(input);\n const withoutInlineSecrets = redactInlineSensitiveAssignments(withoutCommonSensitiveTokens);\n const withoutAbsolutePaths = redactAbsolutePathTokens(withoutInlineSecrets);\n const trimmed = withoutAbsolutePaths.trim();\n if (trimmed.startsWith(\"/\") && trimmed.length > 1) {\n return \"[redacted_path]\";\n }\n if (withoutAbsolutePaths.length > 512) {\n return `${withoutAbsolutePaths.slice(0, 509)}...`;\n }\n return withoutAbsolutePaths;\n}\n\nfunction sanitizeStringMax(input: string): string {\n const withoutCommonSensitiveTokens = sanitizeCommonSensitiveTokens(input);\n const withoutInlineSecrets = redactInlineSensitiveAssignments(withoutCommonSensitiveTokens);\n const withoutAbsolutePaths = redactAbsolutePathTokens(withoutInlineSecrets);\n const trimmed = withoutAbsolutePaths.trim();\n if (trimmed.startsWith(\"/\") && trimmed.length > 1) {\n return \"[redacted_path]\";\n }\n if (withoutAbsolutePaths.length > 2048) {\n return `${withoutAbsolutePaths.slice(0, 2045)}...`;\n }\n return withoutAbsolutePaths;\n}\n\nfunction sanitizeString(input: string, captureLevel: Exclude<TelemetryCaptureLevel, \"minimal\"> = \"redacted\"): string {\n if (captureLevel === \"max\") {\n return sanitizeStringMax(input);\n }\n return sanitizeStringRedacted(input);\n}\n\nfunction sanitizeValue(\n value: unknown,\n keyHint?: string,\n captureLevel: Exclude<TelemetryCaptureLevel, \"minimal\"> = \"redacted\",\n depth = 0,\n): unknown {\n if (keyHint && isSensitiveKey(keyHint)) {\n return \"[redacted]\";\n }\n if (value === null || value === undefined) {\n return value;\n }\n if (typeof value === \"string\") {\n return sanitizeString(value, captureLevel);\n }\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return value;\n }\n if (depth >= TELEMETRY_SANITIZE_MAX_DEPTH) {\n return \"[depth_truncated]\";\n }\n if (Array.isArray(value)) {\n return value.slice(0, TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS).map((entry) => sanitizeValue(entry, undefined, captureLevel, depth + 1));\n }\n if (typeof value === \"object\") {\n const record = value as Record<string, unknown>;\n const sanitized: Record<string, unknown> = {};\n for (const [key, nested] of Object.entries(record)) {\n sanitized[key] = sanitizeValue(nested, key, captureLevel, depth + 1);\n }\n return sanitized;\n }\n return String(value);\n}\n\nfunction sanitizeCommandArgs(\n args: string[],\n captureLevel: Exclude<TelemetryCaptureLevel, \"minimal\"> = \"redacted\",\n): string[] {\n const sanitized: string[] = [];\n let nextIsSensitiveValue = false;\n for (const rawArg of args) {\n const arg = sanitizeString(rawArg, captureLevel);\n if (nextIsSensitiveValue) {\n sanitized.push(\"[redacted]\");\n nextIsSensitiveValue = false;\n continue;\n }\n if (arg.startsWith(\"--\")) {\n const withoutPrefix = arg.slice(2);\n const delimiterIndex = withoutPrefix.indexOf(\"=\");\n if (delimiterIndex >= 0) {\n const key = withoutPrefix.slice(0, delimiterIndex);\n const value = withoutPrefix.slice(delimiterIndex + 1);\n if (isSensitiveKey(key)) {\n sanitized.push(`--${key}=[redacted]`);\n } else {\n sanitized.push(`--${key}=${sanitizeString(value, captureLevel)}`);\n }\n continue;\n }\n if (isSensitiveKey(withoutPrefix)) {\n sanitized.push(`--${withoutPrefix}`);\n nextIsSensitiveValue = true;\n continue;\n }\n }\n sanitized.push(arg);\n }\n return sanitized;\n}\n\nfunction normalizeCaptureLevel(value: string | undefined): TelemetryCaptureLevel {\n const normalized = value?.trim().toLowerCase();\n if (normalized === \"minimal\" || normalized === \"redacted\" || normalized === \"max\") {\n return normalized;\n }\n return \"redacted\";\n}\n\nfunction parseBooleanTrueLike(value: string | undefined): boolean {\n return BOOLEAN_TRUE_VALUES.has((value ?? \"\").trim().toLowerCase());\n}\n\nfunction normalizePmVersion(value: string | undefined): string {\n const trimmed = value?.trim() ?? \"\";\n return trimmed.length > 0 ? trimmed : \"0.0.0\";\n}\n\nfunction normalizeTelemetryErrorCode(value: string | undefined): string | undefined {\n const normalized = value?.trim();\n return normalized && normalized.length > 0 ? normalized : undefined;\n}\n\nfunction normalizeTelemetryExitCode(exitCode: number | undefined, ok: boolean): number {\n if (Number.isFinite(exitCode)) {\n return Math.max(0, Math.trunc(exitCode ?? 0));\n }\n return ok ? 0 : 1;\n}\n\nfunction normalizeTelemetryErrorCategory(params: {\n ok: boolean;\n errorCode?: string;\n errorCategory?: TelemetryErrorCategory;\n}): TelemetryErrorCategory | undefined {\n if (params.ok) {\n return undefined;\n }\n if (typeof params.errorCategory === \"string\" && params.errorCategory.trim().length > 0) {\n return params.errorCategory;\n }\n if (typeof params.errorCode === \"string\" && params.errorCode.trim().length > 0) {\n return resolveTelemetryErrorCategory(params.errorCode);\n }\n return \"unknown\";\n}\n\nfunction resolveTelemetrySourceContext(globalOptions: GlobalOptions): ResolvedTelemetrySourceContext {\n const override = (process.env[PM_TELEMETRY_SOURCE_CONTEXT_ENV] ?? \"\").trim().toLowerCase();\n if (PM_TELEMETRY_SOURCE_CONTEXT_SET.has(override)) {\n return {\n source_context: override as TelemetrySourceContext,\n source_context_source: \"env_override\",\n };\n }\n const nodeEnv = (process.env.NODE_ENV ?? \"\").trim().toLowerCase();\n if (typeof process.env.VITEST === \"string\" || typeof process.env.VITEST_WORKER_ID === \"string\" || nodeEnv === \"test\") {\n return {\n source_context: \"test\",\n source_context_source: \"inferred\",\n };\n }\n const nonTty = process.stdin.isTTY !== true || process.stdout.isTTY !== true;\n const ci = parseBooleanTrueLike(process.env.CI);\n const scriptLikeMode = globalOptions.json === true || globalOptions.quiet === true;\n if (nonTty || ci || scriptLikeMode) {\n return {\n source_context: \"automation\",\n source_context_source: \"inferred\",\n };\n }\n return {\n source_context: \"user\",\n source_context_source: \"inferred\",\n };\n}\n\nfunction hashWithInstallationId(installationId: string, value: string): string {\n return crypto.createHash(\"sha256\").update(`${installationId}:${value}`).digest(\"hex\");\n}\n\nfunction normalizeForHash(value: unknown, depth = 0): unknown {\n if (value === null || value === undefined) {\n return value;\n }\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n return value;\n }\n if (depth >= TELEMETRY_SANITIZE_MAX_DEPTH) {\n return \"[depth_truncated]\";\n }\n if (Array.isArray(value)) {\n return value.slice(0, TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS).map((entry) => normalizeForHash(entry, depth + 1));\n }\n if (typeof value === \"object\") {\n const record = value as Record<string, unknown>;\n const normalized: Record<string, unknown> = {};\n const sortedKeys = Object.keys(record).sort((left, right) => left.localeCompare(right));\n for (const key of sortedKeys) {\n normalized[key] = normalizeForHash(record[key], depth + 1);\n }\n return normalized;\n }\n return String(value);\n}\n\nfunction hashTelemetryValue(installationId: string, value: unknown): string {\n return hashWithInstallationId(installationId, JSON.stringify(normalizeForHash(value)));\n}\n\nfunction hashCommandArgs(installationId: string, args: string[]): { hashes: string[]; digest: string } {\n return {\n hashes: args.map((arg) => hashWithInstallationId(installationId, arg)),\n digest: hashWithInstallationId(installationId, args.join(\"\\u0000\")),\n };\n}\n\nfunction hashTelemetryErrorFingerprint(\n installationId: string,\n command: string,\n errorCode: string | undefined,\n errorMessage: string | undefined,\n): string {\n const normalizedMessage = sanitizeString(errorMessage ?? \"\", \"redacted\");\n const fingerprintSource = `${command}\\u0000${errorCode ?? \"unknown_error\"}\\u0000${normalizedMessage}`;\n return hashWithInstallationId(installationId, fingerprintSource);\n}\n\nfunction telemetryDisabledByEnvironment(): boolean {\n return (\n PM_TELEMETRY_DISABLED_VALUES.has((process.env[PM_TELEMETRY_DISABLED_ENV] ?? \"\").trim().toLowerCase()) ||\n PM_TELEMETRY_DISABLED_VALUES.has((process.env[PM_NO_TELEMETRY_ENV] ?? \"\").trim().toLowerCase())\n );\n}\n\nfunction resolveOtelTracesEndpoint(): string | null {\n if (PM_TELEMETRY_OTEL_DISABLED_VALUES.has((process.env[PM_TELEMETRY_OTEL_DISABLED_ENV] ?? \"\").trim().toLowerCase())) {\n return null;\n }\n\n const directEndpoint = (process.env[OTEL_TRACES_ENDPOINT_ENV] ?? \"\").trim();\n if (directEndpoint.length > 0) {\n try {\n return new URL(directEndpoint).toString();\n } catch {\n return null;\n }\n }\n\n const baseEndpoint = (process.env[OTEL_BASE_ENDPOINT_ENV] ?? \"\").trim();\n if (baseEndpoint.length === 0) {\n return null;\n }\n\n try {\n const url = new URL(baseEndpoint);\n const normalizedPath = url.pathname.replace(/\\/+$/, \"\");\n if (!normalizedPath.endsWith(\"/v1/traces\")) {\n url.pathname = `${normalizedPath.length === 0 ? \"\" : normalizedPath}/v1/traces`;\n }\n return url.toString();\n } catch {\n return null;\n }\n}\n\nfunction isoToUnixNano(iso: string): string {\n const parsedMs = Date.parse(iso);\n const epochMs = Number.isNaN(parsedMs) ? Date.now() : parsedMs;\n return `${BigInt(epochMs) * 1_000_000n}`;\n}\n\nfunction otlpStringAttribute(key: string, value: string): { key: string; value: { stringValue: string } } {\n return {\n key,\n value: { stringValue: value },\n };\n}\n\nfunction otlpBoolAttribute(key: string, value: boolean): { key: string; value: { boolValue: boolean } } {\n return {\n key,\n value: { boolValue: value },\n };\n}\n\nfunction otlpIntAttribute(key: string, value: number): { key: string; value: { intValue: string } } {\n return {\n key,\n value: { intValue: String(Math.max(0, Math.trunc(value))) },\n };\n}\n\nasync function exportLocalOtelSpan(\n activeCommand: ActiveTelemetryCommand,\n outcome: { ok: boolean; error?: string; exit_code?: number; error_code?: string; error_category?: TelemetryErrorCategory },\n finishedAtIso: string,\n durationMs: number,\n): Promise<void> {\n if (\n typeof activeCommand.otel_traces_endpoint !== \"string\" ||\n activeCommand.otel_traces_endpoint.trim().length === 0 ||\n typeof activeCommand.otel_trace_id !== \"string\" ||\n activeCommand.otel_trace_id.length === 0 ||\n typeof activeCommand.otel_span_id !== \"string\" ||\n activeCommand.otel_span_id.length === 0\n ) {\n return;\n }\n\n const serviceNameCandidate = sanitizeString((process.env[OTEL_SERVICE_NAME_ENV] ?? \"\").trim());\n const serviceName = serviceNameCandidate.length > 0 ? serviceNameCandidate : \"pm-cli\";\n const normalizedExitCode = normalizeTelemetryExitCode(outcome.exit_code, outcome.ok);\n const normalizedErrorCode = normalizeTelemetryErrorCode(outcome.error_code);\n const normalizedErrorCategory = normalizeTelemetryErrorCategory({\n ok: outcome.ok,\n errorCode: normalizedErrorCode,\n errorCategory: outcome.error_category,\n });\n const attributes: Array<\n | ReturnType<typeof otlpStringAttribute>\n | ReturnType<typeof otlpBoolAttribute>\n | ReturnType<typeof otlpIntAttribute>\n > = [\n otlpStringAttribute(\"pm.command\", sanitizeString(activeCommand.command)),\n otlpStringAttribute(\"pm.version\", activeCommand.pm_version),\n otlpStringAttribute(\"pm.source_context\", activeCommand.source_context),\n otlpStringAttribute(\"pm.source_context_source\", activeCommand.source_context_source),\n otlpStringAttribute(\"pm.installation_id\", activeCommand.installation_id),\n otlpStringAttribute(\"pm.session_id\", PROCESS_SESSION_ID),\n otlpStringAttribute(\"pm.pm_root_hash\", activeCommand.pm_root_hash),\n otlpStringAttribute(\"pm.cwd_hash\", activeCommand.cwd_hash),\n otlpBoolAttribute(\"pm.ok\", outcome.ok),\n otlpIntAttribute(\"pm.exit_code\", normalizedExitCode),\n otlpIntAttribute(\"pm.duration_ms\", durationMs),\n ];\n if (typeof normalizedErrorCode === \"string\") {\n attributes.push(otlpStringAttribute(\"pm.error_code\", normalizedErrorCode));\n }\n if (typeof normalizedErrorCategory === \"string\") {\n attributes.push(otlpStringAttribute(\"pm.error_category\", normalizedErrorCategory));\n }\n if (typeof outcome.error === \"string\" && outcome.error.trim().length > 0) {\n attributes.push(otlpStringAttribute(\"pm.error\", sanitizeString(outcome.error)));\n }\n\n const payload = {\n resourceSpans: [\n {\n resource: {\n attributes: [otlpStringAttribute(\"service.name\", serviceName)],\n },\n scopeSpans: [\n {\n scope: {\n name: \"pm-cli.telemetry\",\n version: \"1\",\n },\n spans: [\n {\n traceId: activeCommand.otel_trace_id,\n spanId: activeCommand.otel_span_id,\n name: `pm.command.${sanitizeString(activeCommand.command)}`,\n kind: 1,\n startTimeUnixNano: isoToUnixNano(activeCommand.started_at),\n endTimeUnixNano: isoToUnixNano(finishedAtIso),\n attributes,\n status: {\n code: outcome.ok ? 1 : 2,\n message: outcome.ok ? \"\" : sanitizeString(outcome.error ?? \"command_failed\"),\n },\n },\n ],\n },\n ],\n },\n ],\n };\n\n const response = await fetch(activeCommand.otel_traces_endpoint, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: JSON.stringify(payload),\n signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS),\n });\n if (!response.ok) {\n throw new Error(`local_otel_export_http_${response.status}`);\n }\n}\n\nfunction summarizeResult(\n result: unknown,\n captureLevel: Exclude<TelemetryCaptureLevel, \"minimal\"> = \"redacted\",\n): Record<string, unknown> {\n if (result === null || result === undefined) {\n return { type: \"nullish\" };\n }\n if (typeof result === \"string\") {\n return { type: \"string\", value: sanitizeString(result, captureLevel) };\n }\n if (typeof result === \"number\" || typeof result === \"boolean\") {\n return { type: typeof result, value: result };\n }\n if (Array.isArray(result)) {\n return {\n type: \"array\",\n length: result.length,\n sample: result.slice(0, 5).map((entry) => sanitizeValue(entry, undefined, captureLevel)),\n };\n }\n if (typeof result === \"object\") {\n const record = result as Record<string, unknown>;\n const keys = Object.keys(record).sort((left, right) => left.localeCompare(right));\n const sanitized: Record<string, unknown> = {};\n let previewBytes = 0;\n for (const key of keys.slice(0, 25)) {\n const sanitizedValue = sanitizeValue(record[key], key, captureLevel);\n const entrySize = JSON.stringify(sanitizedValue)?.length ?? 0;\n if (previewBytes + entrySize > TELEMETRY_RESULT_PREVIEW_MAX_BYTES) {\n sanitized[key] = \"[preview_truncated]\";\n break;\n }\n previewBytes += entrySize;\n sanitized[key] = sanitizedValue;\n }\n return {\n type: \"object\",\n key_count: keys.length,\n keys_preview: keys.slice(0, 50),\n preview: sanitized,\n };\n }\n return { type: typeof result, value: String(result) };\n}\n\nfunction buildCommandStartPayload(params: {\n captureLevel: TelemetryCaptureLevel;\n context: TelemetryCommandContext;\n pmVersion: string;\n sourceContext: ResolvedTelemetrySourceContext;\n pmRootHash: string;\n cwdHash: string;\n installationId: string;\n}): Record<string, unknown> {\n const { captureLevel, context, pmVersion, sourceContext, pmRootHash, cwdHash, installationId } = params;\n const commandTaxonomy = deriveTelemetryCommandTaxonomy(context.command);\n const hashedArgs = hashCommandArgs(installationId, context.args);\n const commandInvocationDigest = hashWithInstallationId(installationId, `${context.command}\\u0000${context.args.join(\"\\u0000\")}`);\n const commandOptionsDigest = hashTelemetryValue(installationId, context.options);\n const globalOptionsDigest = hashTelemetryValue(installationId, context.global);\n if (captureLevel === \"minimal\") {\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_args_digest: hashedArgs.digest,\n command_invocation_digest: commandInvocationDigest,\n command_options_digest: commandOptionsDigest,\n global_options_digest: globalOptionsDigest,\n };\n }\n return {\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_args: sanitizeCommandArgs(context.args, captureLevel),\n command_args_hashes: hashedArgs.hashes,\n command_args_digest: hashedArgs.digest,\n command_invocation_digest: commandInvocationDigest,\n command_options: sanitizeValue(context.options, undefined, captureLevel) as Record<string, unknown>,\n command_options_digest: commandOptionsDigest,\n global_options: sanitizeValue(context.global, undefined, captureLevel) as Record<string, unknown>,\n global_options_digest: globalOptionsDigest,\n pm_root_hash: pmRootHash,\n cwd_hash: cwdHash,\n capture_level: captureLevel,\n runtime: {\n node: process.version,\n platform: process.platform,\n arch: process.arch,\n hostname_hash: hashWithInstallationId(installationId, os.hostname()),\n stdin_tty: process.stdin.isTTY === true,\n stdout_tty: process.stdout.isTTY === true,\n },\n };\n}\n\nfunction buildCommandFinishPayload(params: {\n captureLevel: TelemetryCaptureLevel;\n pmVersion: string;\n sourceContext: ResolvedTelemetrySourceContext;\n outcome: TelemetryCommandOutcome;\n durationMs: number;\n startedAt: string;\n command: string;\n installationId: string;\n commandTaxonomy: TelemetryCommandTaxonomy;\n exitCode: number;\n errorCode?: string;\n errorCategory?: TelemetryErrorCategory;\n commandResolution: TelemetryCommandResolution;\n resolutionStage: TelemetryResolutionStage;\n}): Record<string, unknown> {\n const {\n captureLevel,\n pmVersion,\n sourceContext,\n outcome,\n durationMs,\n startedAt,\n command,\n installationId,\n commandTaxonomy,\n exitCode,\n errorCode,\n errorCategory,\n commandResolution,\n resolutionStage,\n } = params;\n const errorFingerprint =\n outcome.ok === false\n ? hashTelemetryErrorFingerprint(installationId, command, errorCode, outcome.error)\n : undefined;\n if (captureLevel === \"minimal\") {\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_resolution: commandResolution,\n resolution_stage: resolutionStage,\n ok: outcome.ok,\n exit_code: exitCode,\n error_code: errorCode,\n error_category: errorCategory,\n error: outcome.error ? sanitizeString(outcome.error, \"redacted\") : undefined,\n error_fingerprint: errorFingerprint,\n duration_ms: durationMs,\n };\n }\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_resolution: commandResolution,\n resolution_stage: resolutionStage,\n ok: outcome.ok,\n exit_code: exitCode,\n error_code: errorCode,\n error_category: errorCategory,\n error: outcome.error ? sanitizeString(outcome.error, captureLevel) : undefined,\n error_fingerprint: errorFingerprint,\n duration_ms: durationMs,\n started_at: startedAt,\n result_summary: summarizeResult(outcome.result, captureLevel),\n };\n}\n\nfunction buildCommandErrorPayload(params: {\n captureLevel: TelemetryCaptureLevel;\n pmVersion: string;\n sourceContext: ResolvedTelemetrySourceContext;\n command: string;\n commandTaxonomy: TelemetryCommandTaxonomy;\n commandResolution: TelemetryCommandResolution;\n resolutionStage: TelemetryResolutionStage;\n args: string[];\n options: Record<string, unknown>;\n pmRootHash: string;\n cwdHash: string;\n installationId: string;\n errorCode: string;\n errorMessage: string;\n errorCategory: TelemetryErrorCategory;\n exitCode: number;\n}): Record<string, unknown> {\n const {\n captureLevel,\n pmVersion,\n sourceContext,\n command,\n commandTaxonomy,\n commandResolution,\n resolutionStage,\n args,\n options,\n pmRootHash,\n cwdHash,\n installationId,\n errorCode,\n errorMessage,\n errorCategory,\n exitCode,\n } = params;\n const attemptedArgHashes = hashCommandArgs(installationId, args);\n const attemptedCommandDigest = hashWithInstallationId(installationId, command);\n const attemptedOptionsDigest = hashTelemetryValue(installationId, options);\n const errorFingerprint = hashTelemetryErrorFingerprint(installationId, command, errorCode, errorMessage);\n if (captureLevel === \"minimal\") {\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_resolution: commandResolution,\n resolution_stage: resolutionStage,\n attempted_command_digest: attemptedCommandDigest,\n attempted_args_digest: attemptedArgHashes.digest,\n attempted_options_digest: attemptedOptionsDigest,\n error_code: errorCode,\n error_category: errorCategory,\n exit_code: exitCode,\n error: sanitizeString(errorMessage, \"redacted\"),\n error_fingerprint: errorFingerprint,\n };\n }\n\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_resolution: commandResolution,\n resolution_stage: resolutionStage,\n attempted_command: sanitizeString(command, captureLevel),\n attempted_command_digest: attemptedCommandDigest,\n attempted_args: sanitizeCommandArgs(args, captureLevel),\n attempted_args_hashes: attemptedArgHashes.hashes,\n attempted_args_digest: attemptedArgHashes.digest,\n attempted_options: sanitizeValue(options, undefined, captureLevel) as Record<string, unknown>,\n attempted_options_digest: attemptedOptionsDigest,\n error_code: errorCode,\n error_category: errorCategory,\n exit_code: exitCode,\n error: sanitizeString(errorMessage, captureLevel),\n error_fingerprint: errorFingerprint,\n pm_root_hash: pmRootHash,\n cwd_hash: cwdHash,\n runtime: {\n node: process.version,\n platform: process.platform,\n arch: process.arch,\n hostname_hash: hashWithInstallationId(installationId, os.hostname()),\n stdin_tty: process.stdin.isTTY === true,\n stdout_tty: process.stdout.isTTY === true,\n },\n };\n}\n\nasync function ensureInstallationId(\n globalPmRoot: string,\n): Promise<{ installationId: string; endpoint: string; retentionDays: number }> {\n const settings = await readSettings(globalPmRoot);\n let changed = false;\n if (settings.telemetry.installation_id.trim().length === 0) {\n settings.telemetry.installation_id = crypto.randomUUID();\n changed = true;\n }\n if (changed) {\n await writeSettings(globalPmRoot, settings, \"telemetry:install_id\");\n }\n return {\n installationId: settings.telemetry.installation_id,\n endpoint: settings.telemetry.endpoint,\n retentionDays: Math.max(1, Math.trunc(settings.telemetry.retention_days)),\n };\n}\n\nasync function enqueueTelemetryEvent(globalPmRoot: string, event: TelemetryEvent): Promise<void> {\n const queued: QueuedTelemetryEvent = {\n client_schema_version: TELEMETRY_CLIENT_SCHEMA_VERSION,\n event,\n attempts: 0,\n };\n let serialized = JSON.stringify(queued);\n if (serialized.length > TELEMETRY_MAX_EVENT_BYTES) {\n const trimmed = { ...event, payload: { ...event.payload, result_summary: { truncated: true, reason: \"payload_size_exceeded\", original_bytes: serialized.length } } };\n const trimmedQueued: QueuedTelemetryEvent = {\n client_schema_version: TELEMETRY_CLIENT_SCHEMA_VERSION,\n event: trimmed,\n attempts: 0,\n };\n serialized = JSON.stringify(trimmedQueued);\n }\n await withQueueMutation(async () => {\n await appendLineAtomic(queuePath(globalPmRoot), serialized);\n });\n}\n\nfunction parseQueueLines(raw: string): QueuedTelemetryEvent[] {\n const entries: QueuedTelemetryEvent[] = [];\n for (const line of raw.split(\"\\n\")) {\n const trimmed = line.trim();\n if (trimmed.length === 0) {\n continue;\n }\n try {\n const parsed = JSON.parse(trimmed) as QueuedTelemetryEvent;\n if (\n parsed &&\n typeof parsed === \"object\" &&\n parsed.event &&\n typeof parsed.event === \"object\" &&\n typeof parsed.attempts === \"number\" &&\n (\n parsed.client_schema_version === undefined ||\n (typeof parsed.client_schema_version === \"number\" && Number.isFinite(parsed.client_schema_version))\n )\n ) {\n entries.push(parsed);\n }\n } catch {\n // Drop malformed lines to preserve queue forward progress.\n }\n }\n return entries;\n}\n\nfunction nextRetryIso(attempts: number): string {\n const delay = Math.min(TELEMETRY_RETRY_BASE_DELAY_MS * 2 ** Math.max(attempts - 1, 0), TELEMETRY_MAX_RETRY_DELAY_MS);\n return new Date(Date.now() + delay).toISOString();\n}\n\nfunction isDueForRetry(entry: QueuedTelemetryEvent): boolean {\n if (typeof entry.next_attempt_after !== \"string\" || entry.next_attempt_after.trim().length === 0) {\n return true;\n }\n const dueAtMs = Date.parse(entry.next_attempt_after);\n if (Number.isNaN(dueAtMs)) {\n return true;\n }\n return dueAtMs <= Date.now();\n}\n\nfunction retentionCutoffMs(retentionDays: number): number {\n const normalizedDays = Number.isFinite(retentionDays) ? Math.max(1, Math.trunc(retentionDays)) : 1;\n return Date.now() - normalizedDays * MILLISECONDS_PER_DAY;\n}\n\nfunction isExpiredQueueEntry(entry: QueuedTelemetryEvent, cutoffMs: number): boolean {\n const occurredAt = entry.event?.occurred_at;\n if (typeof occurredAt !== \"string\" || occurredAt.trim().length === 0) {\n return false;\n }\n const occurredAtMs = Date.parse(occurredAt);\n if (Number.isNaN(occurredAtMs)) {\n return false;\n }\n return occurredAtMs < cutoffMs;\n}\n\nfunction pruneExpiredQueueEntries(\n entries: QueuedTelemetryEvent[],\n retentionDays: number,\n): { entries: QueuedTelemetryEvent[]; prunedCount: number } {\n const cutoffMs = retentionCutoffMs(retentionDays);\n const retained: QueuedTelemetryEvent[] = [];\n let prunedCount = 0;\n for (const entry of entries) {\n const serializedSize = JSON.stringify(entry).length;\n const oversized = serializedSize > TELEMETRY_MAX_EVENT_BYTES;\n if (oversized || isExpiredQueueEntry(entry, cutoffMs) || entry.attempts >= TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS) {\n prunedCount += 1;\n continue;\n }\n retained.push(entry);\n }\n return { entries: retained, prunedCount };\n}\n\nasync function rewriteQueue(globalPmRoot: string, entries: QueuedTelemetryEvent[]): Promise<void> {\n const serialized = entries.map((entry) => JSON.stringify(entry)).join(\"\\n\");\n const contents = serialized.length > 0 ? `${serialized}\\n` : \"\";\n for (let attempt = 0; ; attempt += 1) {\n try {\n await writeFileAtomic(queuePath(globalPmRoot), contents);\n return;\n } catch (error: unknown) {\n const retryDelay = TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS[attempt];\n if (retryDelay === undefined || !isRetryableQueueRewriteError(error)) {\n throw error;\n }\n await sleep(retryDelay);\n }\n }\n}\n\nfunction isRetryableQueueRewriteError(error: unknown): boolean {\n if (typeof error !== \"object\" || error === null || !(\"code\" in error)) {\n return false;\n }\n const code = (error as { code?: unknown }).code;\n return code === \"EACCES\" || code === \"EBUSY\" || code === \"EPERM\";\n}\n\nfunction sleep(milliseconds: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, milliseconds);\n });\n}\n\nasync function cleanupTelemetryQueueTempOrphans(\n globalPmRoot: string,\n maxAgeMs = TELEMETRY_QUEUE_TMP_ORPHAN_MAX_AGE_MS,\n): Promise<void> {\n try {\n const dirPath = telemetryRuntimeDirectory(globalPmRoot);\n const entries = await readdir(dirPath, { withFileTypes: true });\n const cutoffMs = Date.now() - Math.max(0, maxAgeMs);\n await Promise.all(\n entries\n .filter((entry) => entry.isFile() && /^\\.events\\.jsonl\\.\\d+\\.\\d+\\.[a-f0-9]+\\.tmp$/.test(entry.name))\n .map(async (entry) => {\n const candidate = path.join(dirPath, entry.name);\n const candidateStats = await stat(candidate);\n if (candidateStats.mtimeMs < cutoffMs) {\n await rm(candidate, { force: true });\n }\n }),\n );\n } catch {\n // Telemetry cleanup is best-effort and must not affect command execution.\n }\n}\n\nasync function withQueueMutation<T>(operation: () => Promise<T>): Promise<T> {\n const run = _queueMutationPromise.catch(() => {}).then(operation);\n _queueMutationPromise = run.catch(() => {});\n return run;\n}\n\nasync function readCurrentQueueEntries(globalPmRoot: string): Promise<QueuedTelemetryEvent[]> {\n const raw = await readFileIfExists(queuePath(globalPmRoot));\n if (raw === null || raw.trim().length === 0) {\n return [];\n }\n return parseQueueLines(raw);\n}\n\nasync function removeFlushedEntriesFromCurrentQueue(\n globalPmRoot: string,\n flushedIds: ReadonlySet<string>,\n retentionDays: number,\n): Promise<QueuedTelemetryEvent[]> {\n return withQueueMutation(async () => {\n const currentEntries = await readCurrentQueueEntries(globalPmRoot);\n const { entries: retainedEntries } = pruneExpiredQueueEntries(currentEntries, retentionDays);\n const remaining = retainedEntries.filter((entry) => !flushedIds.has(entry.event.event_id));\n await rewriteQueue(globalPmRoot, remaining);\n return remaining;\n });\n}\n\nasync function markFailedEntriesInCurrentQueue(\n globalPmRoot: string,\n failedIds: ReadonlySet<string>,\n attemptTime: string,\n retentionDays: number,\n): Promise<QueuedTelemetryEvent[]> {\n return withQueueMutation(async () => {\n const currentEntries = await readCurrentQueueEntries(globalPmRoot);\n const { entries: retainedEntries } = pruneExpiredQueueEntries(currentEntries, retentionDays);\n const retried = retainedEntries.map((entry) => {\n if (!failedIds.has(entry.event.event_id)) {\n return entry;\n }\n const attempts = entry.attempts + 1;\n return {\n ...entry,\n attempts,\n last_attempt_at: attemptTime,\n next_attempt_after: nextRetryIso(attempts),\n };\n });\n await rewriteQueue(globalPmRoot, retried);\n return retried;\n });\n}\n\nasync function flushQueue(globalPmRoot: string, endpoint: string, retentionDays: number): Promise<void> {\n await cleanupTelemetryQueueTempOrphans(globalPmRoot);\n const normalizedEndpoint = endpoint.trim();\n if (normalizedEndpoint.length === 0) {\n return;\n }\n const raw = await readFileIfExists(queuePath(globalPmRoot));\n if (raw === null || raw.trim().length === 0) {\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: 0,\n });\n return;\n }\n const queueEntries = parseQueueLines(raw);\n if (queueEntries.length === 0) {\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: 0,\n });\n return;\n }\n const { entries: retainedEntries, prunedCount } = pruneExpiredQueueEntries(queueEntries, retentionDays);\n if (retainedEntries.length === 0) {\n if (prunedCount > 0) {\n await rewriteQueue(globalPmRoot, []);\n }\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: 0,\n });\n return;\n }\n const dueEntries = retainedEntries.filter((entry) => isDueForRetry(entry)).slice(0, TELEMETRY_FLUSH_BATCH_SIZE);\n if (dueEntries.length === 0) {\n if (prunedCount > 0) {\n await rewriteQueue(globalPmRoot, retainedEntries);\n }\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: retainedEntries.length,\n });\n return;\n }\n const dueIds = new Set(dueEntries.map((entry) => entry.event.event_id));\n const attemptTime = nowIso();\n const requestHeaders: Record<string, string> = {\n \"content-type\": \"application/json\",\n };\n const ingestKey = process.env.PM_TELEMETRY_INGEST_KEY?.trim();\n if (ingestKey) {\n requestHeaders[\"x-pm-telemetry-key\"] = ingestKey;\n }\n\n try {\n const response = await fetch(normalizedEndpoint, {\n method: \"POST\",\n headers: requestHeaders,\n body: JSON.stringify({\n schema_version: TELEMETRY_SCHEMA_VERSION,\n events: dueEntries.map((entry) => entry.event),\n }),\n signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS),\n });\n if (!response.ok) {\n throw new Error(`telemetry_flush_http_${response.status}`);\n }\n } catch (error: unknown) {\n const retried = await markFailedEntriesInCurrentQueue(globalPmRoot, dueIds, attemptTime, retentionDays);\n const errorMessage = (() => {\n if (error instanceof Error) {\n return sanitizeString(error.message, \"redacted\");\n }\n return \"telemetry_flush_failed\";\n })();\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: retried.length,\n last_attempted_flush_at: attemptTime,\n last_failed_flush_at: attemptTime,\n last_failed_flush_error: errorMessage,\n });\n return;\n }\n\n try {\n const remaining = await removeFlushedEntriesFromCurrentQueue(globalPmRoot, dueIds, retentionDays);\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: remaining.length,\n last_attempted_flush_at: attemptTime,\n last_successful_flush_at: attemptTime,\n last_failed_flush_at: undefined,\n last_failed_flush_error: undefined,\n });\n } catch (error: unknown) {\n const errorMessage = (() => {\n if (error instanceof Error) {\n return sanitizeString(error.message, \"redacted\");\n }\n return \"telemetry_flush_failed\";\n })();\n const currentEntries = await readCurrentQueueEntries(globalPmRoot).catch(() => retainedEntries);\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: currentEntries.length,\n last_attempted_flush_at: attemptTime,\n last_failed_flush_at: attemptTime,\n last_failed_flush_error: errorMessage,\n });\n }\n}\n\nasync function acquireTelemetryFlushLock(globalPmRoot: string): Promise<boolean> {\n const lockPath = flushLockPath(globalPmRoot);\n await mkdir(path.dirname(lockPath), { recursive: true });\n try {\n await mkdir(lockPath);\n return true;\n } catch (error: unknown) {\n if (typeof error !== \"object\" || error === null || !(\"code\" in error) || (error as { code?: unknown }).code !== \"EEXIST\") {\n throw error;\n }\n }\n\n try {\n const lockStats = await stat(lockPath);\n if (Date.now() - lockStats.mtimeMs < TELEMETRY_FLUSH_LOCK_STALE_MS) {\n return false;\n }\n await rm(lockPath, { recursive: true, force: true });\n await mkdir(lockPath);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isFreshDirectoryLock(lockPath: string, staleMs: number): boolean {\n try {\n return Date.now() - statSync(lockPath).mtimeMs < staleMs;\n } catch {\n return false;\n }\n}\n\nfunction removeDirectoryLockBestEffort(lockPath: string): void {\n try {\n rmSync(lockPath, { recursive: true, force: true });\n } catch {\n // Flush scheduling is best effort and must never fail user commands.\n }\n}\n\nfunction errorCode(error: unknown): string | undefined {\n if (typeof error !== \"object\" || error === null || !(\"code\" in error)) {\n return undefined;\n }\n const code = (error as { code?: unknown }).code;\n return typeof code === \"string\" ? code : undefined;\n}\n\nfunction createDirectoryLock(lockPath: string): boolean {\n try {\n mkdirSync(lockPath);\n return true;\n } catch (error: unknown) {\n const code = errorCode(error);\n if (code === \"EEXIST\") {\n return false;\n }\n if (code !== \"ENOENT\") {\n return false;\n }\n }\n\n try {\n mkdirSync(path.dirname(lockPath), { recursive: true });\n mkdirSync(lockPath);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction acquireTelemetryFlushSpawnGate(globalPmRoot: string): boolean {\n if (isFreshDirectoryLock(flushLockPath(globalPmRoot), TELEMETRY_FLUSH_LOCK_STALE_MS)) {\n return false;\n }\n\n const lockPath = flushSpawnLockPath(globalPmRoot);\n try {\n if (Date.now() - statSync(lockPath).mtimeMs < TELEMETRY_FLUSH_SPAWN_LOCK_STALE_MS) {\n return false;\n }\n removeDirectoryLockBestEffort(lockPath);\n } catch (error: unknown) {\n if (errorCode(error) !== \"ENOENT\") {\n return false;\n }\n }\n\n return createDirectoryLock(lockPath);\n}\n\nfunction releaseTelemetryFlushSpawnGate(globalPmRoot: string): void {\n removeDirectoryLockBestEffort(flushSpawnLockPath(globalPmRoot));\n}\n\nexport const _testOnly = {\n acquireTelemetryFlushSpawnGate,\n releaseTelemetryFlushSpawnGate,\n flushLockPath,\n flushSpawnLockPath,\n};\n\nasync function flushQueueWithProcessLock(globalPmRoot: string, endpoint: string, retentionDays: number): Promise<void> {\n const acquired = await acquireTelemetryFlushLock(globalPmRoot);\n releaseTelemetryFlushSpawnGate(globalPmRoot);\n if (!acquired) {\n return;\n }\n try {\n await flushQueue(globalPmRoot, endpoint, retentionDays);\n } finally {\n await rm(flushLockPath(globalPmRoot), { recursive: true, force: true }).catch(() => {});\n }\n}\n\nfunction scheduleTelemetryFlush(globalPmRoot: string, endpoint: string, retentionDays: number): void {\n if (shouldFlushInline()) {\n const previousFlush = _lastFlushPromise;\n const nextFlush = flushQueue(globalPmRoot, endpoint, retentionDays).catch(() => {});\n _lastFlushPromise = Promise.allSettled([previousFlush, nextFlush]).then(() => {});\n return;\n }\n\n try {\n const acquiredSpawnGate = acquireTelemetryFlushSpawnGate(globalPmRoot);\n if (!acquiredSpawnGate) {\n return;\n }\n const child = spawn(process.execPath, [telemetryFlushRunnerPath()], {\n detached: true,\n stdio: \"ignore\",\n env: {\n ...process.env,\n PM_GLOBAL_PATH: globalPmRoot,\n [PM_TELEMETRY_FLUSH_CHILD_ENV]: \"1\",\n },\n });\n child.unref();\n } catch {\n releaseTelemetryFlushSpawnGate(globalPmRoot);\n // Flush scheduling is best effort and must not keep the CLI alive.\n }\n}\n\nexport async function flushTelemetryQueueNow(globalPmRoot = resolveGlobalPmRoot(process.cwd())): Promise<void> {\n if (telemetryDisabledByEnvironment()) {\n return;\n }\n try {\n const settings = await readSettings(globalPmRoot);\n if (!settings.telemetry.enabled) {\n return;\n }\n const { endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);\n await flushQueueWithProcessLock(globalPmRoot, endpoint, retentionDays);\n } catch {\n // Telemetry workers are best effort and must never fail user commands.\n }\n}\n\nexport async function startTelemetryCommand(context: TelemetryCommandContext): Promise<ActiveTelemetryCommand | null> {\n if (telemetryDisabledByEnvironment()) {\n return null;\n }\n if (\n context.command === \"telemetry\" &&\n context.args.some((token) => token.trim().toLowerCase() === \"clear\")\n ) {\n return null;\n }\n try {\n const globalPmRoot = resolveGlobalPmRoot(process.cwd());\n const settings = await readSettings(globalPmRoot);\n if (!settings.telemetry.enabled) {\n return null;\n }\n const captureLevel = normalizeCaptureLevel(settings.telemetry.capture_level);\n const { installationId, endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);\n const pmVersion = normalizePmVersion(context.pm_version);\n const sourceContext = resolveTelemetrySourceContext(context.global);\n const pmRootHash = hashWithInstallationId(installationId, context.pm_root);\n const cwdHash = hashWithInstallationId(installationId, process.cwd());\n const otelTracesEndpoint = resolveOtelTracesEndpoint();\n const occurredAt = nowIso();\n const event: TelemetryEvent = {\n schema_version: TELEMETRY_SCHEMA_VERSION,\n event_id: crypto.randomUUID(),\n event_type: \"command_start\",\n occurred_at: occurredAt,\n installation_id: installationId,\n session_id: PROCESS_SESSION_ID,\n command: context.command,\n payload: buildCommandStartPayload({\n captureLevel,\n context,\n pmVersion,\n sourceContext,\n pmRootHash,\n cwdHash,\n installationId,\n }),\n };\n await enqueueTelemetryEvent(globalPmRoot, event);\n scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays);\n const commandTaxonomy = deriveTelemetryCommandTaxonomy(context.command);\n return {\n started_at: occurredAt,\n started_at_ms: Date.now(),\n command: context.command,\n command_taxonomy: commandTaxonomy,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n installation_id: installationId,\n pm_root_hash: pmRootHash,\n cwd_hash: cwdHash,\n endpoint,\n retention_days: retentionDays,\n global_pm_root: globalPmRoot,\n capture_level: captureLevel,\n otel_traces_endpoint: otelTracesEndpoint ?? undefined,\n otel_trace_id: otelTracesEndpoint ? crypto.randomBytes(16).toString(\"hex\") : undefined,\n otel_span_id: otelTracesEndpoint ? crypto.randomBytes(8).toString(\"hex\") : undefined,\n };\n } catch {\n // Telemetry must never block command execution.\n return null;\n }\n}\n\nexport async function finishTelemetryCommand(\n activeCommand: ActiveTelemetryCommand | null,\n outcome: TelemetryCommandOutcome,\n): Promise<void> {\n if (!activeCommand) {\n return;\n }\n try {\n const finishedAt = nowIso();\n const durationMs = Math.max(0, Date.now() - activeCommand.started_at_ms);\n const normalizedErrorCode = normalizeTelemetryErrorCode(\n inferTelemetryErrorCode({\n ok: outcome.ok,\n errorCode: outcome.error_code,\n errorMessage: outcome.error,\n exitCode: outcome.exit_code,\n }),\n );\n const normalizedErrorCategory = normalizeTelemetryErrorCategory({\n ok: outcome.ok,\n errorCode: normalizedErrorCode,\n errorCategory: outcome.error_category,\n });\n const normalizedExitCode = normalizeTelemetryExitCode(outcome.exit_code, outcome.ok);\n const commandResolution =\n outcome.command_resolution ??\n deriveTelemetryCommandResolution({\n ok: outcome.ok,\n errorCode: normalizedErrorCode,\n errorCategory: normalizedErrorCategory,\n });\n const resolutionStage = outcome.resolution_stage ?? \"execute\";\n const event: TelemetryEvent = {\n schema_version: TELEMETRY_SCHEMA_VERSION,\n event_id: crypto.randomUUID(),\n event_type: \"command_finish\",\n occurred_at: finishedAt,\n installation_id: activeCommand.installation_id,\n session_id: PROCESS_SESSION_ID,\n command: activeCommand.command,\n payload: buildCommandFinishPayload({\n captureLevel: activeCommand.capture_level,\n pmVersion: activeCommand.pm_version,\n sourceContext: {\n source_context: activeCommand.source_context,\n source_context_source: activeCommand.source_context_source,\n },\n outcome,\n durationMs,\n startedAt: activeCommand.started_at,\n command: activeCommand.command,\n installationId: activeCommand.installation_id,\n commandTaxonomy: activeCommand.command_taxonomy,\n exitCode: normalizedExitCode,\n errorCode: normalizedErrorCode,\n errorCategory: normalizedErrorCategory,\n commandResolution,\n resolutionStage,\n }),\n };\n await enqueueTelemetryEvent(activeCommand.global_pm_root, event);\n scheduleTelemetryFlush(activeCommand.global_pm_root, activeCommand.endpoint, activeCommand.retention_days);\n void exportLocalOtelSpan(\n activeCommand,\n {\n ...outcome,\n exit_code: normalizedExitCode,\n error_code: normalizedErrorCode,\n error_category: normalizedErrorCategory,\n },\n finishedAt,\n durationMs,\n ).catch(() => {});\n } catch {\n // Telemetry must never block command execution.\n }\n}\n\nexport async function emitTelemetryErrorEvent(context: TelemetryErrorEventContext): Promise<void> {\n if (telemetryDisabledByEnvironment()) {\n return;\n }\n try {\n const globalPmRoot = resolveGlobalPmRoot(process.cwd());\n const settings = await readSettings(globalPmRoot);\n if (!settings.telemetry.enabled) {\n return;\n }\n const captureLevel = normalizeCaptureLevel(settings.telemetry.capture_level);\n const { installationId, endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);\n const pmVersion = normalizePmVersion(context.pm_version);\n const sourceContext = resolveTelemetrySourceContext(context.global);\n const pmRootHash = hashWithInstallationId(installationId, context.pm_root);\n const cwdHash = hashWithInstallationId(installationId, process.cwd());\n const occurredAt = nowIso();\n const normalizedErrorCode =\n normalizeTelemetryErrorCode(\n inferTelemetryErrorCode({\n ok: false,\n errorCode: context.error_code,\n errorMessage: context.error_message,\n exitCode: context.exit_code,\n }),\n ) ?? \"unknown_error\";\n const normalizedErrorCategory =\n context.error_category ?? resolveTelemetryErrorCategory(normalizedErrorCode);\n const normalizedExitCode = normalizeTelemetryExitCode(context.exit_code, false);\n const normalizedCommand = context.command.trim().length > 0 ? context.command : \"<unknown>\";\n const commandTaxonomy = deriveTelemetryCommandTaxonomy(normalizedCommand);\n const commandResolution =\n context.command_resolution ??\n deriveTelemetryCommandResolution({\n ok: false,\n errorCode: normalizedErrorCode,\n errorCategory: normalizedErrorCategory,\n });\n const resolutionStage = context.resolution_stage ?? \"unknown\";\n\n const event: TelemetryEvent = {\n schema_version: TELEMETRY_SCHEMA_VERSION,\n event_id: crypto.randomUUID(),\n event_type: \"command_error\",\n occurred_at: occurredAt,\n installation_id: installationId,\n session_id: PROCESS_SESSION_ID,\n command: sanitizeString(normalizedCommand, \"redacted\"),\n payload: buildCommandErrorPayload({\n captureLevel,\n pmVersion,\n sourceContext,\n command: normalizedCommand,\n commandTaxonomy,\n commandResolution,\n resolutionStage,\n args: context.args,\n options: context.options,\n pmRootHash,\n cwdHash,\n installationId,\n errorCode: normalizedErrorCode,\n errorCategory: normalizedErrorCategory,\n exitCode: normalizedExitCode,\n errorMessage: context.error_message,\n }),\n };\n await enqueueTelemetryEvent(globalPmRoot, event);\n scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays);\n } catch {\n // Telemetry must never block command execution.\n }\n}\n"],"names":["errorCode","errorCode"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,IAAM,sBAAsB,oBAAI,IAAI,CAAC,QAAQ,UAAU,cAAc,uBAAuB,mBAAmB,kBAAkB,CAAC;AAClI,IAAM,sBAAsB,oBAAI,IAAI;EAClC;EACA;EACA;EACA;EACA;EACA;EACA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,CAAC,KACC;AACP,UAAM,0BACJ,QAAQ,kBAAkB,8BAA8B,mBAAmB;AAC7E,UAAM,qBAAqB,2BAA2B,QAAQ,WAAW,KAAK;AAC9E,UAAM,oBAAoB,QAAQ,QAAQ,KAAI,EAAG,SAAS,IAAI,QAAQ,UAAU;AAChF,UAAM,kBAAkB,+BAA+B,iBAAiB;AACxE,UAAM,oBACJ,QAAQ,sBACR,iCAAiC;MAC/B,IAAI;MACJ,WAAW;MACX,eAAe;KAChB;AACH,UAAM,kBAAkB,QAAQ,oBAAoB;AAEpD,UAAM,QAAwB;MAC5B,gBAAgB;MAChB,UAAU,OAAO,WAAU;MAC3B,YAAY;MACZ,aAAa;MACb,iBAAiB;MACjB,YAAY;MACZ,SAAS,eAAe,mBAAmB,UAAU;MACrD,SAAS,yBAAyB;QAChC;QACA;QACA;QACA,SAAS;QACT;QACA;QACA;QACA,MAAM,QAAQ;QACd,SAAS,QAAQ;QACjB;QACA;QACA;QACA,WAAW;QACX,eAAe;QACf,UAAU;QACV,cAAc,QAAQ;OACvB;;AAEH,UAAM,sBAAsB,cAAc,KAAK;AAC/C,2BAAuB,cAAc,UAAU,aAAa;EAC9D,QAAQ;EAER;AACF","debugId":"705a511a-3aa8-5101-b1fa-07ed6544814a"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EXIT_CODE,
|
|
3
3
|
PmCliError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-U5SXYXSY.js";
|
|
5
5
|
|
|
6
6
|
// dist/core/item/parent-reference-policy.js
|
|
7
7
|
!(function() {
|
|
@@ -87,4 +87,4 @@ export {
|
|
|
87
87
|
normalizeSprintReleaseFormatPolicy,
|
|
88
88
|
validateSprintOrReleaseValue
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-KAG77BY3.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseItemDocument,
|
|
3
3
|
serializeItemDocument
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AO442XLN.js";
|
|
5
5
|
import {
|
|
6
6
|
TYPE_TO_FOLDER,
|
|
7
7
|
getItemFormatFromPath,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
removeFileIfExists,
|
|
11
11
|
runActiveOnWriteHooks,
|
|
12
12
|
writeFileAtomic
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-U5SXYXSY.js";
|
|
14
14
|
|
|
15
15
|
// dist/core/store/item-format-migration.js
|
|
16
16
|
import fs from "node:fs/promises";
|
|
@@ -119,4 +119,4 @@ async function migrateItemFilesToFormat(pmRoot, targetFormat, op = "item_format:
|
|
|
119
119
|
export {
|
|
120
120
|
migrateItemFilesToFormat
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-KJ33AOCY.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
normalizeItemTypeDefinition,
|
|
5
5
|
normalizeItemTypeStringList,
|
|
6
6
|
strictPolicyCommand
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-U5SXYXSY.js";
|
|
8
8
|
|
|
9
9
|
// dist/core/item/type-registry.js
|
|
10
10
|
!(function() {
|
|
@@ -631,4 +631,4 @@ export {
|
|
|
631
631
|
resolveCommandOptionPolicyState,
|
|
632
632
|
validateTypeOptions
|
|
633
633
|
};
|
|
634
|
-
//# sourceMappingURL=chunk-
|
|
634
|
+
//# sourceMappingURL=chunk-KJE2FOS4.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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]="
|
|
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]="0dc8cba8-e66c-5f6c-a4e0-3632e88cdd5b")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
KNOWN_EXTENSION_CAPABILITIES,
|
|
5
5
|
KNOWN_EXTENSION_POLICY_MODES,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
PLAN_MODE_VALUES,
|
|
12
12
|
PLAN_STEP_LINK_KIND_VALUES,
|
|
13
13
|
PLAN_STEP_STATUS_VALUES
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5SFCOO6B.js";
|
|
15
15
|
|
|
16
16
|
// dist/sdk/cli-contracts/commander-types.js
|
|
17
17
|
var LIST_COMMANDER_STRING_OPTION_CONTRACTS = [
|
|
@@ -685,6 +685,7 @@ var PM_CORE_COMMAND_NAMES = [
|
|
|
685
685
|
"plan",
|
|
686
686
|
"test",
|
|
687
687
|
"test-all",
|
|
688
|
+
"telemetry",
|
|
688
689
|
"stats",
|
|
689
690
|
"health",
|
|
690
691
|
"validate",
|
|
@@ -763,6 +764,7 @@ var PM_TOOL_ACTIONS = [
|
|
|
763
764
|
"deps",
|
|
764
765
|
"test",
|
|
765
766
|
"test-all",
|
|
767
|
+
"telemetry",
|
|
766
768
|
"stats",
|
|
767
769
|
"health",
|
|
768
770
|
"validate",
|
|
@@ -1203,6 +1205,7 @@ var PM_TOOL_PARAMETER_PROPERTIES = {
|
|
|
1203
1205
|
checkContext: { type: "boolean" },
|
|
1204
1206
|
autoPmContext: { type: "boolean" },
|
|
1205
1207
|
diff: { type: "boolean" },
|
|
1208
|
+
storage: { type: "boolean" },
|
|
1206
1209
|
verify: { type: "boolean" },
|
|
1207
1210
|
literal: { type: "array", items: { type: "string" } },
|
|
1208
1211
|
regex: { type: "array", items: { type: "string" } },
|
|
@@ -1253,7 +1256,7 @@ var PM_TOOL_PARAMETER_PROPERTIES = {
|
|
|
1253
1256
|
includeUnparented: { type: "boolean" },
|
|
1254
1257
|
gcScope: {
|
|
1255
1258
|
type: "array",
|
|
1256
|
-
items: { type: "string", enum: ["index", "embeddings", "runtime"] }
|
|
1259
|
+
items: { type: "string", enum: ["index", "embeddings", "runtime", "locks"] }
|
|
1257
1260
|
},
|
|
1258
1261
|
maxDepth: { anyOf: [{ type: "string" }, { type: "number" }] },
|
|
1259
1262
|
collapse: { type: "string", enum: ["none", "repeated"] },
|
|
@@ -1508,8 +1511,7 @@ var PM_TOOL_PARAMETER_METADATA = {
|
|
|
1508
1511
|
examples: ["Task", "Feature"]
|
|
1509
1512
|
},
|
|
1510
1513
|
subcommand: {
|
|
1511
|
-
description: "Subcommand for
|
|
1512
|
-
examples: ["list", "show", "add-type", "remove-type", "add-status", "remove-status"]
|
|
1514
|
+
description: "Subcommand selector for schema and telemetry actions."
|
|
1513
1515
|
},
|
|
1514
1516
|
name: {
|
|
1515
1517
|
description: "Custom item type name (schema add-type/remove-type/show) or custom status id (schema add-status/remove-status).",
|
|
@@ -1714,8 +1716,11 @@ var PM_TOOL_PARAMETER_METADATA = {
|
|
|
1714
1716
|
description: "Preview command effects without mutating storage artifacts."
|
|
1715
1717
|
},
|
|
1716
1718
|
gcScope: {
|
|
1717
|
-
description: "Repeatable gc scope selector values (index, embeddings, runtime).",
|
|
1718
|
-
examples: [["index", "embeddings"], ["runtime"]]
|
|
1719
|
+
description: "Repeatable gc scope selector values (index, embeddings, runtime, locks).",
|
|
1720
|
+
examples: [["index", "embeddings"], ["runtime"], ["locks"]]
|
|
1721
|
+
},
|
|
1722
|
+
storage: {
|
|
1723
|
+
description: "For stats action: include aggregate history-stream storage metrics (total streams/lines/bytes, largest + deepest streams, oldest/newest entries) for compaction and storage planning."
|
|
1719
1724
|
},
|
|
1720
1725
|
offset: {
|
|
1721
1726
|
description: "Number of matching rows to skip before limit is applied.",
|
|
@@ -2176,6 +2181,7 @@ var HISTORY_FLAG_CONTRACTS = [
|
|
|
2176
2181
|
{ flag: "--compact" },
|
|
2177
2182
|
{ flag: "--full" },
|
|
2178
2183
|
{ flag: "--diff" },
|
|
2184
|
+
{ flag: "--field" },
|
|
2179
2185
|
{ flag: "--verify" }
|
|
2180
2186
|
];
|
|
2181
2187
|
var HISTORY_REDACT_FLAG_CONTRACTS = [
|
|
@@ -2510,6 +2516,9 @@ var TEST_ALL_FLAG_CONTRACTS = [
|
|
|
2510
2516
|
{ flag: "--check-context" },
|
|
2511
2517
|
{ flag: "--auto-pm-context" }
|
|
2512
2518
|
];
|
|
2519
|
+
var TELEMETRY_FLAG_CONTRACTS = [
|
|
2520
|
+
{ flag: "--limit" }
|
|
2521
|
+
];
|
|
2513
2522
|
var TEST_RUNS_FLAG_CONTRACTS = [
|
|
2514
2523
|
{ flag: "--status" },
|
|
2515
2524
|
{ flag: "--limit" },
|
|
@@ -2522,6 +2531,9 @@ var GC_FLAG_CONTRACTS = [
|
|
|
2522
2531
|
{ flag: "--dry-run" },
|
|
2523
2532
|
{ flag: "--scope" }
|
|
2524
2533
|
];
|
|
2534
|
+
var STATS_FLAG_CONTRACTS = [
|
|
2535
|
+
{ flag: "--storage" }
|
|
2536
|
+
];
|
|
2525
2537
|
var HEALTH_FLAG_CONTRACTS = [
|
|
2526
2538
|
{ flag: "--strict-directories" },
|
|
2527
2539
|
{ flag: "--strict-exit" },
|
|
@@ -3016,7 +3028,6 @@ var LIST_COMMAND_NAME_CONTRACTS = /* @__PURE__ */ new Set([
|
|
|
3016
3028
|
"list-canceled"
|
|
3017
3029
|
]);
|
|
3018
3030
|
var NO_SURFACE_COMMAND_NAME_CONTRACTS = /* @__PURE__ */ new Set([
|
|
3019
|
-
"stats",
|
|
3020
3031
|
"reindex",
|
|
3021
3032
|
"help"
|
|
3022
3033
|
]);
|
|
@@ -3147,12 +3158,16 @@ function resolveSubcommandFlagContractsForCommand(commandName) {
|
|
|
3147
3158
|
return withSubcommandGlobalFlags(TEST_FLAG_CONTRACTS);
|
|
3148
3159
|
case "test-all":
|
|
3149
3160
|
return withSubcommandGlobalFlags(TEST_ALL_FLAG_CONTRACTS);
|
|
3161
|
+
case "telemetry":
|
|
3162
|
+
return withSubcommandGlobalFlags(TELEMETRY_FLAG_CONTRACTS);
|
|
3150
3163
|
case "health":
|
|
3151
3164
|
return withSubcommandGlobalFlags(HEALTH_FLAG_CONTRACTS);
|
|
3152
3165
|
case "validate":
|
|
3153
3166
|
return withSubcommandGlobalFlags(VALIDATE_FLAG_CONTRACTS);
|
|
3154
3167
|
case "gc":
|
|
3155
3168
|
return withSubcommandGlobalFlags(GC_FLAG_CONTRACTS);
|
|
3169
|
+
case "stats":
|
|
3170
|
+
return withSubcommandGlobalFlags(STATS_FLAG_CONTRACTS);
|
|
3156
3171
|
case "contracts":
|
|
3157
3172
|
return withSubcommandGlobalFlags(CONTRACTS_FLAG_CONTRACTS);
|
|
3158
3173
|
case "claim":
|
|
@@ -3551,6 +3566,9 @@ var PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
3551
3566
|
"autoPmContext"
|
|
3552
3567
|
]
|
|
3553
3568
|
},
|
|
3569
|
+
telemetry: {
|
|
3570
|
+
optional: ["subcommand", "limit"]
|
|
3571
|
+
},
|
|
3554
3572
|
"test-runs-list": {
|
|
3555
3573
|
optional: ["status", "limit"]
|
|
3556
3574
|
},
|
|
@@ -3569,7 +3587,7 @@ var PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
3569
3587
|
required: ["runId"],
|
|
3570
3588
|
optional: ["author"]
|
|
3571
3589
|
},
|
|
3572
|
-
stats: {},
|
|
3590
|
+
stats: { optional: ["storage"] },
|
|
3573
3591
|
health: {
|
|
3574
3592
|
optional: [
|
|
3575
3593
|
"strictDirectories",
|
|
@@ -3713,11 +3731,14 @@ function createLazyContractSchema(build) {
|
|
|
3713
3731
|
}
|
|
3714
3732
|
});
|
|
3715
3733
|
}
|
|
3734
|
+
var PM_TOOL_PARAMETERS_SCHEMA_VERSION = "4.0.2";
|
|
3735
|
+
var PM_TOOL_PARAMETERS_SCHEMA_MAJOR = PM_TOOL_PARAMETERS_SCHEMA_VERSION.split(".")[0];
|
|
3736
|
+
var PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION = "1.0.0";
|
|
3716
3737
|
var PM_TOOL_PARAMETERS_SCHEMA = createLazyContractSchema(() => ({
|
|
3717
3738
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
3718
|
-
$id:
|
|
3739
|
+
$id: `https://schema.unbrained.dev/pm-cli/tool-parameters-v${PM_TOOL_PARAMETERS_SCHEMA_MAJOR}.schema.json`,
|
|
3719
3740
|
title: "pm-cli tool parameters (action-scoped strict schema)",
|
|
3720
|
-
"x-schema-version":
|
|
3741
|
+
"x-schema-version": PM_TOOL_PARAMETERS_SCHEMA_VERSION,
|
|
3721
3742
|
type: "object",
|
|
3722
3743
|
oneOf: PM_TOOL_ACTIONS.map((action) => buildActionScopedToolSchema(action))
|
|
3723
3744
|
}));
|
|
@@ -3758,7 +3779,7 @@ function buildProviderCompatibleToolSchema() {
|
|
|
3758
3779
|
}
|
|
3759
3780
|
return {
|
|
3760
3781
|
title: "pm-cli tool parameters (provider-compatible flat schema)",
|
|
3761
|
-
"x-schema-version":
|
|
3782
|
+
"x-schema-version": PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,
|
|
3762
3783
|
type: "object",
|
|
3763
3784
|
additionalProperties: false,
|
|
3764
3785
|
required: ["action"],
|
|
@@ -3835,8 +3856,10 @@ export {
|
|
|
3835
3856
|
CLOSE_TASK_FLAG_CONTRACTS,
|
|
3836
3857
|
TEST_FLAG_CONTRACTS,
|
|
3837
3858
|
TEST_ALL_FLAG_CONTRACTS,
|
|
3859
|
+
TELEMETRY_FLAG_CONTRACTS,
|
|
3838
3860
|
TEST_RUNS_FLAG_CONTRACTS,
|
|
3839
3861
|
GC_FLAG_CONTRACTS,
|
|
3862
|
+
STATS_FLAG_CONTRACTS,
|
|
3840
3863
|
HEALTH_FLAG_CONTRACTS,
|
|
3841
3864
|
VALIDATE_FLAG_CONTRACTS,
|
|
3842
3865
|
CREATE_FLAG_CONTRACTS,
|
|
@@ -3855,6 +3878,6 @@ export {
|
|
|
3855
3878
|
resolveSubcommandFlagContractsForCommand,
|
|
3856
3879
|
PM_TOOL_PARAMETERS_SCHEMA
|
|
3857
3880
|
};
|
|
3858
|
-
//# sourceMappingURL=chunk-
|
|
3881
|
+
//# sourceMappingURL=chunk-KWU6HG75.js.map
|
|
3859
3882
|
|
|
3860
|
-
//# debugId=
|
|
3883
|
+
//# debugId=0dc8cba8-e66c-5f6c-a4e0-3632e88cdd5b
|