@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.
Files changed (413) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/CONTRIBUTING.md +1 -0
  3. package/README.md +12 -4
  4. package/dist/cli/commands/completion.js +21 -7
  5. package/dist/cli/commands/completion.js.map +1 -1
  6. package/dist/cli/commands/contracts.js +5 -3
  7. package/dist/cli/commands/contracts.js.map +1 -1
  8. package/dist/cli/commands/gc.d.ts +8 -1
  9. package/dist/cli/commands/gc.js +26 -3
  10. package/dist/cli/commands/gc.js.map +1 -1
  11. package/dist/cli/commands/health.js +15 -2
  12. package/dist/cli/commands/health.js.map +1 -1
  13. package/dist/cli/commands/history.d.ts +4 -1
  14. package/dist/cli/commands/history.js +12 -24
  15. package/dist/cli/commands/history.js.map +1 -1
  16. package/dist/cli/commands/index.d.ts +1 -0
  17. package/dist/cli/commands/index.js +3 -2
  18. package/dist/cli/commands/index.js.map +1 -1
  19. package/dist/cli/commands/stats.d.ts +8 -1
  20. package/dist/cli/commands/stats.js +18 -17
  21. package/dist/cli/commands/stats.js.map +1 -1
  22. package/dist/cli/commands/telemetry.d.ts +8 -0
  23. package/dist/cli/commands/telemetry.js +253 -0
  24. package/dist/cli/commands/telemetry.js.map +1 -0
  25. package/dist/cli/help-content.js +11 -2
  26. package/dist/cli/help-content.js.map +1 -1
  27. package/dist/cli/register-list-query.js +7 -4
  28. package/dist/cli/register-list-query.js.map +1 -1
  29. package/dist/cli/register-operations.js +29 -6
  30. package/dist/cli/register-operations.js.map +1 -1
  31. package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +16 -0
  32. package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js → activity-JM6DTDND.js} +11 -11
  33. package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js → aggregate-GI7WSZPH.js} +10 -10
  34. package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js → aggregate-VNAHUNNF.js} +10 -10
  35. package/dist/cli-bundle/chunks/{append-5JE3YGXU.js → append-7H5N64R2.js} +8 -8
  36. package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js → append-WMKRXKCE.js} +8 -8
  37. package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js → chunk-23YFZ3IG.js} +12 -12
  38. package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js → chunk-2HVRUSQA.js} +3 -3
  39. package/dist/cli-bundle/chunks/{chunk-V3JQ4IPL.js → chunk-2RSPZI5H.js} +102 -22
  40. package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js.map +1 -0
  41. package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js → chunk-2VBQ6ZXS.js} +2 -2
  42. package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js → chunk-2VVCGBNV.js} +9 -9
  43. package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js → chunk-3BWOVLTH.js} +8 -8
  44. package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js → chunk-3FI4SEFT.js} +5 -5
  45. package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js → chunk-3LB74A67.js} +6 -6
  46. package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js → chunk-3VAM3NNM.js} +3 -3
  47. package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js → chunk-4LL6TK5B.js} +5 -5
  48. package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js → chunk-52MAOQ6J.js} +4 -4
  49. package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js → chunk-5FDATVEZ.js} +4 -4
  50. package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js → chunk-5SFCOO6B.js} +76 -7
  51. package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js.map → chunk-5SFCOO6B.js.map} +1 -1
  52. package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js → chunk-6ER6DXH5.js} +9 -9
  53. package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js → chunk-6P6GGMOG.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js → chunk-77GFDHGF.js} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js → chunk-AO442XLN.js} +3 -3
  56. package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js → chunk-AY43SBIN.js} +6 -6
  57. package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js → chunk-BQHUILZS.js} +5 -5
  58. package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js → chunk-E5FJNAZA.js} +3 -3
  59. package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js → chunk-ECCMVXGM.js} +3 -3
  60. package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js → chunk-FRAUKRU2.js} +5 -5
  61. package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js → chunk-GCOQW437.js} +3 -3
  62. package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js → chunk-GGYWB3Y2.js} +6 -6
  63. package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js → chunk-GU2ZJ2VV.js} +5 -5
  64. package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js → chunk-GXSUPCBV.js} +5 -4
  65. package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js → chunk-HZGUAH22.js} +2 -2
  66. package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js → chunk-I2HSTRJF.js} +5 -5
  67. package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js → chunk-I6BNFU5X.js} +3 -3
  68. package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js → chunk-IJGCZSIQ.js} +12 -12
  69. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js +1491 -0
  70. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js → chunk-KAG77BY3.js} +2 -2
  72. package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js → chunk-KJ33AOCY.js} +3 -3
  73. package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js → chunk-KJE2FOS4.js} +2 -2
  74. package/dist/cli-bundle/chunks/{chunk-GNHVV4SY.js → chunk-KWU6HG75.js} +37 -14
  75. package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +1 -0
  76. package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js → chunk-LB3RUL2N.js} +3 -3
  77. package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js → chunk-LCM63IXU.js} +2 -2
  78. package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js → chunk-ME2YH6FN.js} +7 -7
  79. package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js → chunk-MITFDD35.js} +12 -12
  80. package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js → chunk-N7ACFE26.js} +3 -3
  81. package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js → chunk-NUZ5HKR4.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js → chunk-OVQCEJPG.js} +2 -2
  83. package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js → chunk-OZ7NSQHL.js} +8 -8
  84. package/dist/cli-bundle/chunks/{chunk-TK633IVD.js → chunk-PDDFYW4X.js} +5 -5
  85. package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js → chunk-PIU6RSL3.js} +9 -9
  86. package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js → chunk-PO3GSVFV.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-WIKR7KFL.js → chunk-PRJCELV4.js} +108 -21
  88. package/dist/cli-bundle/chunks/chunk-PRJCELV4.js.map +7 -0
  89. package/dist/cli-bundle/chunks/{chunk-ZQ4F6EC4.js → chunk-PROOHX4K.js} +38 -15
  90. package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +7 -0
  91. package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js → chunk-Q7SPNHLW.js} +8 -8
  92. package/dist/cli-bundle/chunks/{chunk-RANZIID5.js → chunk-QO7EBBOM.js} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js → chunk-R6UFP2GE.js} +7 -7
  94. package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js → chunk-RWPSOIEE.js} +7 -7
  95. package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js → chunk-RZN6VURO.js} +3 -3
  96. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js +1501 -0
  97. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +7 -0
  98. package/dist/cli-bundle/chunks/{chunk-KA24HME7.js → chunk-T3LC5LKB.js} +2 -2
  99. package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js → chunk-TCD3R2PF.js} +2 -2
  100. package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js → chunk-TPH5XEVD.js} +3 -3
  101. package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js → chunk-U5SXYXSY.js} +75 -6
  102. package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js.map → chunk-U5SXYXSY.js.map} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js → chunk-UBOPJT3S.js} +9 -9
  104. package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js → chunk-UM2GBHS4.js} +5 -4
  105. package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js → chunk-W7XABV4H.js} +8 -8
  106. package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js → chunk-WKY2IBOQ.js} +3 -3
  107. package/dist/cli-bundle/chunks/{chunk-7K24QB23.js → chunk-WOPXVEZP.js} +5 -5
  108. package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js → chunk-WSMOSYRD.js} +12 -12
  109. package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js → chunk-XLTD2HN3.js} +2 -2
  110. package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js → chunk-XSJCLN2R.js} +3 -3
  111. package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js → chunk-XTGLRY2Y.js} +6 -6
  112. package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js → chunk-YL2DJGYS.js} +7 -7
  113. package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js → claim-4DBF6RVG.js} +10 -10
  114. package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js → claim-X2P4IB7J.js} +10 -10
  115. package/dist/cli-bundle/chunks/close-3HDWDA3L.js +13 -0
  116. package/dist/cli-bundle/chunks/{close-65DFYAVS.js → close-PTYFA45H.js} +8 -8
  117. package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js → close-many-7CGIDPTJ.js} +15 -15
  118. package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js → close-many-ERFO6LHR.js} +15 -15
  119. package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js → comments-OONGABK5.js} +10 -10
  120. package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js → comments-QKBYCWKD.js} +10 -10
  121. package/dist/cli-bundle/chunks/{config-DDPYIA6J.js → config-6FXCQKIF.js} +8 -8
  122. package/dist/cli-bundle/chunks/{config-5ON3ADRH.js → config-U4RZ4CQB.js} +8 -8
  123. package/dist/cli-bundle/chunks/{context-E6U3DWVM.js → context-FYYJGFWS.js} +13 -13
  124. package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js → context-YMJ3Z2HQ.js} +13 -13
  125. package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js → contracts-QDB6OMLQ.js} +10 -6
  126. package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +1 -0
  127. package/dist/cli-bundle/chunks/{contracts-CXSFM45B.js → contracts-RFSPGVVJ.js} +9 -5
  128. package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js.map → contracts-RFSPGVVJ.js.map} +7 -1
  129. package/dist/cli-bundle/chunks/{create-WYFKN2U4.js → create-I5L4EYYZ.js} +13 -13
  130. package/dist/cli-bundle/chunks/create-JTZNCTQC.js +27 -0
  131. package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js → delete-7HPGI4GZ.js} +7 -7
  132. package/dist/cli-bundle/chunks/{delete-RONNH4F4.js → delete-VXUPH5RS.js} +7 -7
  133. package/dist/cli-bundle/chunks/{deps-WII3O4HB.js → deps-JSRRWC3Z.js} +7 -7
  134. package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js → deps-SCZIFK2Z.js} +7 -7
  135. package/dist/cli-bundle/chunks/{docs-PDREIMLS.js → docs-GJK6K4VP.js} +9 -9
  136. package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js → docs-WW4N3MBM.js} +9 -9
  137. package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js → extension-J7IBMFTD.js} +4 -4
  138. package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js → extension-VDY2U33M.js} +4 -4
  139. package/dist/cli-bundle/chunks/{files-2PN7UM2D.js → files-ISZJGILQ.js} +9 -9
  140. package/dist/cli-bundle/chunks/{files-MXYS5W4M.js → files-WKOD326U.js} +9 -9
  141. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js +362 -0
  142. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +1 -0
  143. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js +372 -0
  144. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{get-WXMLRG7M.js → get-RV37HT3G.js} +10 -10
  146. package/dist/cli-bundle/chunks/{get-CINFEUIY.js → get-WXU6WI5P.js} +10 -10
  147. package/dist/cli-bundle/chunks/{health-IT5DBPRJ.js → health-6L6EH4WR.js} +26 -13
  148. package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{health-5VPOJQ53.js → health-LOI2HHKB.js} +27 -14
  150. package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +1 -0
  151. package/dist/cli-bundle/chunks/history-2BA3T5AE.js +20 -0
  152. package/dist/cli-bundle/chunks/{history-FLZIP7PM.js → history-PKN67D5O.js} +10 -10
  153. package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +19 -0
  154. package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js → history-redact-V4FOJGS7.js} +11 -11
  155. package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js → history-repair-HIBCBIKK.js} +11 -11
  156. package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js → history-repair-SDMHR7JT.js} +11 -11
  157. package/dist/cli-bundle/chunks/init-HIVSNX3O.js +16 -0
  158. package/dist/cli-bundle/chunks/{init-6MRFVOLH.js → init-P56QYWJF.js} +8 -8
  159. package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js → learnings-GDFRG5J7.js} +10 -10
  160. package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js → learnings-MIXSESLK.js} +10 -10
  161. package/dist/cli-bundle/chunks/{list-DBRECOG4.js → list-FGOWQMSM.js} +10 -10
  162. package/dist/cli-bundle/chunks/list-MUSQNMTD.js +20 -0
  163. package/dist/cli-bundle/chunks/{notes-42LIC3UE.js → notes-4XVSH2AZ.js} +10 -10
  164. package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js → notes-5UK3GEH2.js} +10 -10
  165. package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js → plan-DUMBV3QB.js} +13 -13
  166. package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js → plan-SLMODHWX.js} +13 -13
  167. package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js → register-list-query-POCFZ5JW.js} +24 -22
  168. package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js.map → register-list-query-POCFZ5JW.js.map} +1 -1
  169. package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js → register-list-query-WST76HSQ.js} +23 -21
  170. package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js.map → register-list-query-WST76HSQ.js.map} +2 -2
  171. package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js → register-mutation-N5GSUZJV.js} +30 -30
  172. package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js → register-mutation-OA675SOU.js} +30 -30
  173. package/dist/cli-bundle/chunks/{register-operations-KYUOOOOD.js → register-operations-GNHBE5I3.js} +47 -34
  174. package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +1 -0
  175. package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js → register-operations-N3PMHXH5.js} +46 -33
  176. package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js.map → register-operations-N3PMHXH5.js.map} +2 -2
  177. package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js → register-setup-JIMPKJKV.js} +15 -15
  178. package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js → register-setup-ZHJI2DI3.js} +15 -15
  179. package/dist/cli-bundle/chunks/restore-D4RGNX33.js +17 -0
  180. package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js → restore-PBL6T5TW.js} +11 -11
  181. package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js → schema-2NOO6NGB.js} +8 -8
  182. package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js → schema-EBI4NLUO.js} +8 -8
  183. package/dist/cli-bundle/chunks/{search-C7NPB7G7.js → search-JPUQTVCY.js} +10 -10
  184. package/dist/cli-bundle/chunks/{search-5A3BMFA7.js → search-OA6JX27A.js} +10 -10
  185. package/dist/cli-bundle/chunks/stats-CV54BAWY.js +202 -0
  186. package/dist/cli-bundle/chunks/stats-CV54BAWY.js.map +1 -0
  187. package/dist/cli-bundle/chunks/stats-XYB6KTFG.js +212 -0
  188. package/dist/cli-bundle/chunks/stats-XYB6KTFG.js.map +7 -0
  189. package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js +251 -0
  190. package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js.map +7 -0
  191. package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js +248 -0
  192. package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js → test-MXX3E5JL.js} +13 -13
  194. package/dist/cli-bundle/chunks/{test-OFYONO3C.js → test-WBROAJIE.js} +13 -13
  195. package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js → test-all-N6NSRDTV.js} +13 -13
  196. package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js → test-all-NTOZ7C3M.js} +13 -13
  197. package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js → test-runs-V6A7LPWZ.js} +5 -5
  198. package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js → test-runs-WMVTQU3Y.js} +5 -5
  199. package/dist/cli-bundle/chunks/update-OSV3NAQB.js +25 -0
  200. package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +21 -0
  201. package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js → update-many-EM6OXYGO.js} +22 -22
  202. package/dist/cli-bundle/chunks/{update-many-322CCH2L.js → update-many-KGGEYABR.js} +22 -22
  203. package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js → upgrade-BLI7XBAJ.js} +4 -4
  204. package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js → upgrade-LXPOQKFV.js} +4 -4
  205. package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js → validate-AGOAUOVW.js} +15 -15
  206. package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js → validate-L5J6A7YO.js} +15 -15
  207. package/dist/cli-bundle/main.js +42 -1451
  208. package/dist/cli-bundle/main.js.map +4 -4
  209. package/dist/core/history/history-diff.d.ts +47 -0
  210. package/dist/core/history/history-diff.js +152 -0
  211. package/dist/core/history/history-diff.js.map +1 -0
  212. package/dist/core/history/history-storage-stats.d.ts +31 -0
  213. package/dist/core/history/history-storage-stats.js +101 -0
  214. package/dist/core/history/history-storage-stats.js.map +1 -0
  215. package/dist/core/lock/lock-gc.d.ts +46 -0
  216. package/dist/core/lock/lock-gc.js +194 -0
  217. package/dist/core/lock/lock-gc.js.map +1 -0
  218. package/dist/core/shared/serial-queue.d.ts +12 -0
  219. package/dist/core/shared/serial-queue.js +43 -0
  220. package/dist/core/shared/serial-queue.js.map +1 -0
  221. package/dist/core/store/settings.d.ts +19 -1
  222. package/dist/core/store/settings.js +92 -7
  223. package/dist/core/store/settings.js.map +1 -1
  224. package/dist/core/telemetry/observability.js +3 -3
  225. package/dist/core/telemetry/observability.js.map +1 -1
  226. package/dist/core/telemetry/runtime.js +16 -4
  227. package/dist/core/telemetry/runtime.js.map +1 -1
  228. package/dist/mcp/server.d.ts +1 -0
  229. package/dist/mcp/server.js +155 -37
  230. package/dist/mcp/server.js.map +1 -1
  231. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  232. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  233. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  234. package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -7
  235. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  236. package/dist/sdk/cli-contracts.d.ts +23 -0
  237. package/dist/sdk/cli-contracts.js +41 -7
  238. package/dist/sdk/cli-contracts.js.map +1 -1
  239. package/docs/AGENT_GUIDE.md +1 -1
  240. package/docs/ARCHITECTURE.md +11 -1
  241. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  242. package/docs/COMMANDS.md +33 -2
  243. package/docs/CONFIGURATION.md +9 -1
  244. package/docs/EXTENSIONS.md +7 -0
  245. package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
  246. package/docs/ONBOARDING.md +165 -0
  247. package/docs/QUICKSTART.md +1 -1
  248. package/docs/README.md +12 -4
  249. package/docs/RELEASING.md +36 -1
  250. package/docs/TESTING.md +19 -1
  251. package/package.json +5 -2
  252. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  253. package/plugins/pm-claude/README.md +7 -4
  254. package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
  255. package/plugins/pm-claude/commands/pm-init.md +1 -1
  256. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +0 -16
  257. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +0 -1
  258. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +0 -1
  259. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +0 -7
  260. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +0 -7
  261. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +0 -13
  262. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +0 -7
  263. package/dist/cli-bundle/chunks/create-ATONSAZW.js +0 -27
  264. package/dist/cli-bundle/chunks/gc-GT552UJH.js +0 -178
  265. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +0 -1
  266. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +0 -181
  267. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +0 -7
  268. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +0 -1
  269. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +0 -7
  270. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +0 -20
  271. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +0 -19
  272. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +0 -16
  273. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +0 -20
  274. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +0 -1
  275. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +0 -17
  276. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +0 -120
  277. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +0 -1
  278. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +0 -123
  279. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +0 -7
  280. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +0 -25
  281. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +0 -21
  282. /package/dist/cli-bundle/chunks/{activity-P5BUMWP3.js.map → activity-CVXTCHYY.js.map} +0 -0
  283. /package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js.map → activity-JM6DTDND.js.map} +0 -0
  284. /package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js.map → aggregate-GI7WSZPH.js.map} +0 -0
  285. /package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js.map → aggregate-VNAHUNNF.js.map} +0 -0
  286. /package/dist/cli-bundle/chunks/{append-5JE3YGXU.js.map → append-7H5N64R2.js.map} +0 -0
  287. /package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js.map → append-WMKRXKCE.js.map} +0 -0
  288. /package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js.map → chunk-23YFZ3IG.js.map} +0 -0
  289. /package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js.map → chunk-2HVRUSQA.js.map} +0 -0
  290. /package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js.map → chunk-2VBQ6ZXS.js.map} +0 -0
  291. /package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js.map → chunk-2VVCGBNV.js.map} +0 -0
  292. /package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js.map → chunk-3BWOVLTH.js.map} +0 -0
  293. /package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js.map → chunk-3FI4SEFT.js.map} +0 -0
  294. /package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js.map → chunk-3LB74A67.js.map} +0 -0
  295. /package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js.map → chunk-3VAM3NNM.js.map} +0 -0
  296. /package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js.map → chunk-4LL6TK5B.js.map} +0 -0
  297. /package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js.map → chunk-52MAOQ6J.js.map} +0 -0
  298. /package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js.map → chunk-5FDATVEZ.js.map} +0 -0
  299. /package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js.map → chunk-6ER6DXH5.js.map} +0 -0
  300. /package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js.map → chunk-6P6GGMOG.js.map} +0 -0
  301. /package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js.map → chunk-77GFDHGF.js.map} +0 -0
  302. /package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js.map → chunk-AO442XLN.js.map} +0 -0
  303. /package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js.map → chunk-AY43SBIN.js.map} +0 -0
  304. /package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js.map → chunk-BQHUILZS.js.map} +0 -0
  305. /package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js.map → chunk-E5FJNAZA.js.map} +0 -0
  306. /package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js.map → chunk-ECCMVXGM.js.map} +0 -0
  307. /package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js.map → chunk-FRAUKRU2.js.map} +0 -0
  308. /package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js.map → chunk-GCOQW437.js.map} +0 -0
  309. /package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js.map → chunk-GGYWB3Y2.js.map} +0 -0
  310. /package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js.map → chunk-GU2ZJ2VV.js.map} +0 -0
  311. /package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js.map → chunk-GXSUPCBV.js.map} +0 -0
  312. /package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js.map → chunk-HZGUAH22.js.map} +0 -0
  313. /package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js.map → chunk-I2HSTRJF.js.map} +0 -0
  314. /package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js.map → chunk-I6BNFU5X.js.map} +0 -0
  315. /package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js.map → chunk-IJGCZSIQ.js.map} +0 -0
  316. /package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js.map → chunk-KAG77BY3.js.map} +0 -0
  317. /package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js.map → chunk-KJ33AOCY.js.map} +0 -0
  318. /package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js.map → chunk-KJE2FOS4.js.map} +0 -0
  319. /package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js.map → chunk-LB3RUL2N.js.map} +0 -0
  320. /package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js.map → chunk-LCM63IXU.js.map} +0 -0
  321. /package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js.map → chunk-ME2YH6FN.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js.map → chunk-MITFDD35.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js.map → chunk-N7ACFE26.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js.map → chunk-NUZ5HKR4.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js.map → chunk-OVQCEJPG.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js.map → chunk-OZ7NSQHL.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{chunk-TK633IVD.js.map → chunk-PDDFYW4X.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js.map → chunk-PIU6RSL3.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js.map → chunk-PO3GSVFV.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js.map → chunk-Q7SPNHLW.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{chunk-RANZIID5.js.map → chunk-QO7EBBOM.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js.map → chunk-R6UFP2GE.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js.map → chunk-RWPSOIEE.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js.map → chunk-RZN6VURO.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{chunk-KA24HME7.js.map → chunk-T3LC5LKB.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js.map → chunk-TCD3R2PF.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js.map → chunk-TPH5XEVD.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js.map → chunk-UBOPJT3S.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js.map → chunk-UM2GBHS4.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js.map → chunk-W7XABV4H.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js.map → chunk-WKY2IBOQ.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{chunk-7K24QB23.js.map → chunk-WOPXVEZP.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js.map → chunk-WSMOSYRD.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js.map → chunk-XLTD2HN3.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js.map → chunk-XSJCLN2R.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js.map → chunk-XTGLRY2Y.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js.map → chunk-YL2DJGYS.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js.map → claim-4DBF6RVG.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js.map → claim-X2P4IB7J.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{close-RMHQ3KWH.js.map → close-3HDWDA3L.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{close-65DFYAVS.js.map → close-PTYFA45H.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js.map → close-many-7CGIDPTJ.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js.map → close-many-ERFO6LHR.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js.map → comments-OONGABK5.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js.map → comments-QKBYCWKD.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{config-DDPYIA6J.js.map → config-6FXCQKIF.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{config-5ON3ADRH.js.map → config-U4RZ4CQB.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{context-E6U3DWVM.js.map → context-FYYJGFWS.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js.map → context-YMJ3Z2HQ.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{create-WYFKN2U4.js.map → create-I5L4EYYZ.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{create-ATONSAZW.js.map → create-JTZNCTQC.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js.map → delete-7HPGI4GZ.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{delete-RONNH4F4.js.map → delete-VXUPH5RS.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{deps-WII3O4HB.js.map → deps-JSRRWC3Z.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js.map → deps-SCZIFK2Z.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{docs-PDREIMLS.js.map → docs-GJK6K4VP.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js.map → docs-WW4N3MBM.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js.map → extension-J7IBMFTD.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js.map → extension-VDY2U33M.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{files-2PN7UM2D.js.map → files-ISZJGILQ.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{files-MXYS5W4M.js.map → files-WKOD326U.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{get-WXMLRG7M.js.map → get-RV37HT3G.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{get-CINFEUIY.js.map → get-WXU6WI5P.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{history-6FC4H6HI.js.map → history-2BA3T5AE.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{history-FLZIP7PM.js.map → history-PKN67D5O.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{history-redact-XKYEZDBL.js.map → history-redact-JBZNXHGR.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js.map → history-redact-V4FOJGS7.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js.map → history-repair-HIBCBIKK.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js.map → history-repair-SDMHR7JT.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{init-KHX3FEEM.js.map → init-HIVSNX3O.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{init-6MRFVOLH.js.map → init-P56QYWJF.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js.map → learnings-GDFRG5J7.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js.map → learnings-MIXSESLK.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{list-DBRECOG4.js.map → list-FGOWQMSM.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{list-53LZ2AEO.js.map → list-MUSQNMTD.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{notes-42LIC3UE.js.map → notes-4XVSH2AZ.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js.map → notes-5UK3GEH2.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js.map → plan-DUMBV3QB.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js.map → plan-SLMODHWX.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js.map → register-mutation-N5GSUZJV.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js.map → register-mutation-OA675SOU.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js.map → register-setup-JIMPKJKV.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js.map → register-setup-ZHJI2DI3.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{restore-JL5QIH7H.js.map → restore-D4RGNX33.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js.map → restore-PBL6T5TW.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js.map → schema-2NOO6NGB.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js.map → schema-EBI4NLUO.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{search-C7NPB7G7.js.map → search-JPUQTVCY.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{search-5A3BMFA7.js.map → search-OA6JX27A.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js.map → test-MXX3E5JL.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{test-OFYONO3C.js.map → test-WBROAJIE.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js.map → test-all-N6NSRDTV.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js.map → test-all-NTOZ7C3M.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js.map → test-runs-V6A7LPWZ.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js.map → test-runs-WMVTQU3Y.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{update-6YEHPVXH.js.map → update-OSV3NAQB.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{update-PYLVHMRD.js.map → update-YRXSUGYQ.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js.map → update-many-EM6OXYGO.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{update-many-322CCH2L.js.map → update-many-KGGEYABR.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js.map → upgrade-BLI7XBAJ.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js.map → upgrade-LXPOQKFV.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js.map → validate-AGOAUOVW.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js.map → validate-L5J6A7YO.js.map} +0 -0
@@ -1,7 +1,14 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ deriveTelemetryCommandResolution,
4
+ deriveTelemetryCommandTaxonomy,
5
+ emitTelemetryErrorEvent,
6
+ finishTelemetryCommand,
7
+ startTelemetryCommand
8
+ } from "./chunks/chunk-SKJWX3QB.js";
2
9
  import {
3
10
  migrateItemFilesToFormat
4
- } from "./chunks/chunk-BNL6S7QH.js";
11
+ } from "./chunks/chunk-KJ33AOCY.js";
5
12
  import {
6
13
  applyDefaultOutputFormat,
7
14
  clearResolvedGlobalOptions,
@@ -11,38 +18,35 @@ import {
11
18
  getGlobalOptions,
12
19
  invalidateSearchCachesForMutation,
13
20
  setResolvedGlobalOptions
14
- } from "./chunks/chunk-TK633IVD.js";
21
+ } from "./chunks/chunk-PDDFYW4X.js";
15
22
  import {
16
23
  PM_CORE_COMMAND_NAMES,
17
24
  resolveSubcommandFlagContractsForCommand
18
- } from "./chunks/chunk-ZQ4F6EC4.js";
19
- import "./chunks/chunk-5IRA6IYD.js";
25
+ } from "./chunks/chunk-PROOHX4K.js";
26
+ import "./chunks/chunk-3FI4SEFT.js";
20
27
  import {
21
28
  printError,
22
29
  printResult,
23
30
  writeStdout
24
- } from "./chunks/chunk-HZOS2UG5.js";
31
+ } from "./chunks/chunk-LCM63IXU.js";
25
32
  import {
26
33
  levenshteinDistanceWithinLimit
27
34
  } from "./chunks/chunk-EAOG77HM.js";
28
- import "./chunks/chunk-XG7RJYHV.js";
29
- import "./chunks/chunk-KA24HME7.js";
30
- import "./chunks/chunk-HPH6X4ZZ.js";
35
+ import "./chunks/chunk-XTGLRY2Y.js";
36
+ import "./chunks/chunk-T3LC5LKB.js";
37
+ import "./chunks/chunk-AO442XLN.js";
31
38
  import {
32
39
  commandOptionFlagLabel,
33
40
  resolveCommandOptionPolicyState,
34
41
  resolveItemTypeRegistry,
35
42
  resolveTypeDefinition
36
- } from "./chunks/chunk-4PJQSECJ.js";
37
- import {
38
- nowIso
39
- } from "./chunks/chunk-RANZIID5.js";
43
+ } from "./chunks/chunk-KJE2FOS4.js";
44
+ import "./chunks/chunk-QO7EBBOM.js";
40
45
  import {
41
46
  BUILTIN_ITEM_TYPE_VALUES,
42
47
  EXIT_CODE,
43
48
  PmCliError,
44
49
  activateExtensions,
45
- appendLineAtomic,
46
50
  asRecordOrNull,
47
51
  clearActiveExtensionHooks,
48
52
  consumeAfterCommandAffectedItems,
@@ -53,7 +57,6 @@ import {
53
57
  getSettingsPath,
54
58
  loadExtensions,
55
59
  pathExists,
56
- readFileIfExists,
57
60
  readSettings,
58
61
  readSettingsWithMetadata,
59
62
  resolveGlobalPmRoot,
@@ -77,13 +80,12 @@ import {
77
80
  setActiveExtensionRenderers,
78
81
  setActiveExtensionServices,
79
82
  toNonEmptyStringOrUndefined,
80
- writeFileAtomic,
81
83
  writeSettings
82
- } from "./chunks/chunk-SRVKTWPR.js";
84
+ } from "./chunks/chunk-U5SXYXSY.js";
83
85
 
84
86
  // dist/cli/main.js
85
87
  import fs2 from "node:fs";
86
- import path3 from "node:path";
88
+ import path2 from "node:path";
87
89
  import { Command } from "commander";
88
90
 
89
91
  // dist/core/telemetry/consent.js
@@ -168,1429 +170,9 @@ async function maybeRunFirstUseTelemetryPrompt(commandPath, globalOptions) {
168
170
  }
169
171
  }
170
172
 
171
- // dist/core/telemetry/runtime.js
172
- import crypto from "node:crypto";
173
- import { spawn } from "node:child_process";
174
- import { mkdirSync, rmSync, statSync } from "node:fs";
175
- import { mkdir, readdir, rm, stat } from "node:fs/promises";
176
- import os from "node:os";
177
- import path from "node:path";
178
-
179
- // dist/core/telemetry/observability.js
180
- !(function() {
181
- try {
182
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
183
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ad10a6ab-5a76-55e1-9750-1613c8210700");
184
- } catch (e2) {
185
- }
186
- })();
187
- var SETUP_ROOT_COMMANDS = /* @__PURE__ */ new Set(["init", "config", "completion", "completion-statuses", "completion-tags", "completion-types"]);
188
- var QUERY_ROOT_COMMANDS = /* @__PURE__ */ new Set([
189
- "list",
190
- "list-all",
191
- "list-open",
192
- "list-in-progress",
193
- "list-blocked",
194
- "list-closed",
195
- "list-canceled",
196
- "list-draft",
197
- "search",
198
- "get",
199
- "context",
200
- "calendar",
201
- "history",
202
- "activity",
203
- "aggregate",
204
- "deps",
205
- "contracts",
206
- "stats",
207
- "dedupe-audit"
208
- ]);
209
- var MUTATION_ROOT_COMMANDS = /* @__PURE__ */ new Set([
210
- "create",
211
- "update",
212
- "update-many",
213
- "close-many",
214
- "append",
215
- "close",
216
- "delete",
217
- "restore",
218
- "claim",
219
- "release",
220
- "comments",
221
- "notes",
222
- "learnings",
223
- "files",
224
- "docs",
225
- "start-task",
226
- "pause-task",
227
- "close-task"
228
- ]);
229
- var TESTING_ROOT_COMMANDS = /* @__PURE__ */ new Set(["test", "test-all", "test-runs", "test-verify", "trace-test", "test-ping"]);
230
- var DIAGNOSTICS_ROOT_COMMANDS = /* @__PURE__ */ new Set(["health", "validate", "normalize", "reindex", "gc", "extension-doctor"]);
231
- function normalizeCommandPath(commandPath) {
232
- return commandPath.trim().replaceAll(/\s+/g, " ").toLowerCase();
233
- }
234
- function normalizeErrorCode(errorCode2) {
235
- const normalized = errorCode2?.trim().toLowerCase();
236
- return normalized && normalized.length > 0 ? normalized : void 0;
237
- }
238
- function deriveTelemetryCommandTaxonomy(commandPath) {
239
- const normalizedPath = normalizeCommandPath(commandPath);
240
- const tokens = normalizedPath.length > 0 ? normalizedPath.split(" ") : ["<unknown>"];
241
- const root = tokens[0] ?? "<unknown>";
242
- const leaf = tokens[tokens.length - 1] ?? root;
243
- let family = "other";
244
- if (SETUP_ROOT_COMMANDS.has(root)) {
245
- family = "setup";
246
- } else if (QUERY_ROOT_COMMANDS.has(root)) {
247
- family = "query";
248
- } else if (MUTATION_ROOT_COMMANDS.has(root)) {
249
- family = "mutation";
250
- } else if (TESTING_ROOT_COMMANDS.has(root)) {
251
- family = "testing";
252
- } else if (root === "extension") {
253
- family = "extension";
254
- } else if (DIAGNOSTICS_ROOT_COMMANDS.has(root)) {
255
- family = "diagnostics";
256
- }
257
- return {
258
- command_path: normalizedPath.length > 0 ? normalizedPath : "<unknown>",
259
- command_root: root,
260
- command_leaf: leaf,
261
- command_depth: tokens.length,
262
- command_family: family
263
- };
264
- }
265
- function inferTelemetryErrorCode(params) {
266
- if (params.ok) {
267
- return void 0;
268
- }
269
- const explicit = normalizeErrorCode(params.errorCode);
270
- if (explicit) {
271
- return explicit;
272
- }
273
- const message = (params.errorMessage ?? "").trim().toLowerCase();
274
- if (message.includes("unknown command")) {
275
- return "unknown_command";
276
- }
277
- if (message.includes("unknown option")) {
278
- return "unknown_option";
279
- }
280
- if (message.includes("missing required options") || message.includes("missing required option")) {
281
- return "missing_required_option";
282
- }
283
- if (message.includes("missing required argument")) {
284
- return "missing_required_argument";
285
- }
286
- if (message.includes("no update flags provided")) {
287
- return "no_update_fields";
288
- }
289
- if (message.includes("is assigned to") && message.includes("use --force")) {
290
- return "ownership_conflict";
291
- }
292
- if (message.includes("is locked")) {
293
- return "lock_conflict";
294
- }
295
- if (message.includes("already terminal") && message.includes("use --force")) {
296
- return "terminal_state_conflict";
297
- }
298
- if (message.includes("tracker is not initialized")) {
299
- return "tracker_not_initialized";
300
- }
301
- if (message.includes(" not found")) {
302
- return "item_not_found";
303
- }
304
- if (message.includes('use "pm close <id> <text>" to close an item') || message.includes("invalid --status value") && message.includes('"closed"')) {
305
- return "close_through_update";
306
- }
307
- if (message.startsWith("invalid ") || message.includes(" must be ") || message.includes(" requires ")) {
308
- return "invalid_argument_value";
309
- }
310
- if (message.includes("strict create mode requires concrete values for --")) {
311
- return "missing_required_option";
312
- }
313
- if (message.includes("either as positional") && message.includes("not both")) {
314
- return "invalid_command_usage";
315
- }
316
- const exitCode = Number.isFinite(params.exitCode) ? Math.max(0, Math.trunc(params.exitCode ?? 0)) : void 0;
317
- if (exitCode === EXIT_CODE.USAGE) {
318
- return "invalid_command_usage";
319
- }
320
- if (exitCode === EXIT_CODE.NOT_FOUND) {
321
- return "item_not_found";
322
- }
323
- if (exitCode === EXIT_CODE.CONFLICT) {
324
- return "lock_conflict";
325
- }
326
- if (exitCode === EXIT_CODE.DEPENDENCY_FAILED) {
327
- return "dependency_failed";
328
- }
329
- return "command_failed";
330
- }
331
- function deriveTelemetryCommandResolution(params) {
332
- if (params.ok) {
333
- return "success";
334
- }
335
- const normalizedCode = normalizeErrorCode(params.errorCode);
336
- if (normalizedCode === "unknown_command") {
337
- return "nonexistent_command";
338
- }
339
- if (normalizedCode === "unknown_option") {
340
- return "invalid_option";
341
- }
342
- if (normalizedCode === "missing_required_option") {
343
- return "missing_required_option";
344
- }
345
- if (normalizedCode === "missing_required_argument") {
346
- return "missing_required_argument";
347
- }
348
- if (normalizedCode === "health_findings") {
349
- return "health_findings";
350
- }
351
- if (normalizedCode === "validation_findings") {
352
- return "validation_findings";
353
- }
354
- if (params.errorCategory === "usage") {
355
- return "invalid_usage";
356
- }
357
- if (params.errorCategory === "validation") {
358
- return "validation_failed";
359
- }
360
- if (params.errorCategory === "conflict") {
361
- return "conflict";
362
- }
363
- if (params.errorCategory === "runtime") {
364
- return "runtime_failed";
365
- }
366
- return "unknown_failed";
367
- }
368
-
369
- // dist/core/telemetry/runtime.js
370
- !(function() {
371
- try {
372
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
373
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b2cd9110-8de0-5e79-a029-c0902f862999");
374
- } catch (e2) {
375
- }
376
- })();
377
- var TELEMETRY_QUEUE_RELATIVE_PATH = path.join("runtime", "telemetry", "events.jsonl");
378
- var TELEMETRY_STATE_RELATIVE_PATH = path.join("runtime", "telemetry", "state.json");
379
- var TELEMETRY_SCHEMA_VERSION = 1;
380
- var TELEMETRY_FLUSH_BATCH_SIZE = 100;
381
- var TELEMETRY_MAX_RETRY_DELAY_MS = 36e5;
382
- var TELEMETRY_RETRY_BASE_DELAY_MS = 3e4;
383
- var TELEMETRY_HTTP_TIMEOUT_MS = 5e3;
384
- var MILLISECONDS_PER_DAY = 864e5;
385
- var TELEMETRY_MAX_EVENT_BYTES = 65536;
386
- var TELEMETRY_SANITIZE_MAX_DEPTH = 6;
387
- var TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS = 20;
388
- var TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS = 15;
389
- var TELEMETRY_RESULT_PREVIEW_MAX_BYTES = 8192;
390
- var TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS = [25, 50, 100, 200];
391
- var TELEMETRY_QUEUE_TMP_ORPHAN_MAX_AGE_MS = 60 * 60 * 1e3;
392
- var TELEMETRY_FLUSH_LOCK_STALE_MS = 6e4;
393
- var TELEMETRY_FLUSH_SPAWN_LOCK_STALE_MS = 6e4;
394
- var OTEL_TRACES_ENDPOINT_ENV = "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT";
395
- var OTEL_BASE_ENDPOINT_ENV = "OTEL_EXPORTER_OTLP_ENDPOINT";
396
- var OTEL_SERVICE_NAME_ENV = "OTEL_SERVICE_NAME";
397
- var PM_TELEMETRY_DISABLED_ENV = "PM_TELEMETRY_DISABLED";
398
- var PM_NO_TELEMETRY_ENV = "PM_NO_TELEMETRY";
399
- var PM_TELEMETRY_DISABLED_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
400
- var PM_TELEMETRY_OTEL_DISABLED_ENV = "PM_TELEMETRY_OTEL_DISABLED";
401
- var PM_TELEMETRY_OTEL_DISABLED_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
402
- var PM_TELEMETRY_INLINE_FLUSH_ENV = "PM_TELEMETRY_INLINE_FLUSH";
403
- var PM_TELEMETRY_FLUSH_CHILD_ENV = "PM_TELEMETRY_FLUSH_CHILD";
404
- var PM_TELEMETRY_SOURCE_CONTEXT_ENV = "PM_TELEMETRY_SOURCE_CONTEXT";
405
- var PM_TELEMETRY_SOURCE_CONTEXT_VALUES = ["user", "automation", "test", "dogfood", "audit_smoke"];
406
- var _lastFlushPromise = Promise.resolve();
407
- var _queueMutationPromise = Promise.resolve();
408
- var PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);
409
- var BOOLEAN_TRUE_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
410
- var PROCESS_SESSION_ID = crypto.randomUUID();
411
- var SENSITIVE_KEYWORDS = [
412
- "token",
413
- "secret",
414
- "password",
415
- "passwd",
416
- "api_key",
417
- "apikey",
418
- "authorization",
419
- "cookie",
420
- "session",
421
- "credentials",
422
- "bearer"
423
- ];
424
- var SENSITIVE_INLINE_KEY_PATTERN = "(?:token|secret|password|passwd|api[_-]?key|apikey|authorization|cookie|session|credentials|bearer)";
425
- var INLINE_SENSITIVE_ASSIGNMENT_PATTERN = new RegExp(`\\b(${SENSITIVE_INLINE_KEY_PATTERN})\\s*([:=])\\s*([^\\s,;]+)`, "giu");
426
- var INLINE_SENSITIVE_FLAG_PATTERN = new RegExp(`(--${SENSITIVE_INLINE_KEY_PATTERN})(=|\\s+)([^\\s,;]+)`, "giu");
427
- var ABSOLUTE_PATH_TOKEN_PATTERN = /(^|[\s"'`(=])\/(?:[^\s"'`),;]+)/g;
428
- var EMAIL_PATTERN = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/giu;
429
- var BEARER_TOKEN_PATTERN = /bearer\s+[a-z0-9._=-]+/giu;
430
- var PRIVATE_IP_PATTERN = /\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g;
431
- function queuePath(globalPmRoot) {
432
- return path.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH);
433
- }
434
- function telemetryRuntimeDirectory(globalPmRoot) {
435
- return path.dirname(queuePath(globalPmRoot));
436
- }
437
- function runtimeStatePath(globalPmRoot) {
438
- return path.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH);
439
- }
440
- function flushLockPath(globalPmRoot) {
441
- return path.join(globalPmRoot, "runtime", "telemetry", "flush.lock");
442
- }
443
- function flushSpawnLockPath(globalPmRoot) {
444
- return path.join(globalPmRoot, "runtime", "telemetry", "flush.spawn.lock");
445
- }
446
- function telemetryFlushRunnerPath() {
447
- return path.join(resolvePmPackageRootFromModule(import.meta.url, ["../../.."]), "dist", "cli", "telemetry-flush.js");
448
- }
449
- function shouldFlushInline() {
450
- if (parseBooleanTrueLike(process.env[PM_TELEMETRY_INLINE_FLUSH_ENV])) {
451
- return true;
452
- }
453
- if (parseBooleanTrueLike(process.env[PM_TELEMETRY_FLUSH_CHILD_ENV])) {
454
- return true;
455
- }
456
- const nodeEnv = (process.env.NODE_ENV ?? "").trim().toLowerCase();
457
- return typeof process.env.VITEST === "string" || typeof process.env.VITEST_WORKER_ID === "string" || nodeEnv === "test";
458
- }
459
- async function readRuntimeState(globalPmRoot) {
460
- const raw = await readFileIfExists(runtimeStatePath(globalPmRoot));
461
- if (!raw || raw.trim().length === 0) {
462
- return {};
463
- }
464
- try {
465
- const parsed = JSON.parse(raw);
466
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
467
- return {};
468
- }
469
- return parsed;
470
- } catch {
471
- return {};
472
- }
473
- }
474
- async function writeRuntimeState(globalPmRoot, patch) {
475
- try {
476
- const current = await readRuntimeState(globalPmRoot);
477
- const next = {
478
- ...current,
479
- ...patch
480
- };
481
- const normalized = Object.fromEntries(Object.entries(next).filter(([, value]) => value !== void 0).sort((left, right) => left[0].localeCompare(right[0])));
482
- await writeFileAtomic(runtimeStatePath(globalPmRoot), `${JSON.stringify(normalized, null, 2)}
483
- `);
484
- } catch {
485
- }
486
- }
487
- function isSensitiveKey(key) {
488
- const normalized = key.trim().toLowerCase().replaceAll("-", "_").replaceAll(/[^a-z0-9_]+/g, "_");
489
- const tokens = normalized.split("_").filter((token) => token.length > 0);
490
- return SENSITIVE_KEYWORDS.some((keyword) => normalized === keyword || normalized.endsWith(`_${keyword}`) || tokens.includes(keyword));
491
- }
492
- function redactInlineSensitiveAssignments(input2) {
493
- const withoutAssignments = input2.replaceAll(INLINE_SENSITIVE_ASSIGNMENT_PATTERN, (_match, key, delimiter) => `${key}${delimiter}[redacted]`);
494
- return withoutAssignments.replaceAll(INLINE_SENSITIVE_FLAG_PATTERN, (_match, flag, delimiter) => `${flag}${delimiter}[redacted]`);
495
- }
496
- function redactAbsolutePathTokens(input2) {
497
- return input2.replaceAll(ABSOLUTE_PATH_TOKEN_PATTERN, (_match, prefix) => `${prefix}[redacted_path]`);
498
- }
499
- function sanitizeCommonSensitiveTokens(input2) {
500
- const withoutEmails = input2.replaceAll(EMAIL_PATTERN, "[redacted_email]");
501
- const withoutBearer = withoutEmails.replaceAll(BEARER_TOKEN_PATTERN, "bearer [redacted_token]");
502
- return withoutBearer.replaceAll(PRIVATE_IP_PATTERN, "[redacted_ip]");
503
- }
504
- function sanitizeStringRedacted(input2) {
505
- const withoutCommonSensitiveTokens = sanitizeCommonSensitiveTokens(input2);
506
- const withoutInlineSecrets = redactInlineSensitiveAssignments(withoutCommonSensitiveTokens);
507
- const withoutAbsolutePaths = redactAbsolutePathTokens(withoutInlineSecrets);
508
- const trimmed = withoutAbsolutePaths.trim();
509
- if (trimmed.startsWith("/") && trimmed.length > 1) {
510
- return "[redacted_path]";
511
- }
512
- if (withoutAbsolutePaths.length > 512) {
513
- return `${withoutAbsolutePaths.slice(0, 509)}...`;
514
- }
515
- return withoutAbsolutePaths;
516
- }
517
- function sanitizeStringMax(input2) {
518
- const withoutCommonSensitiveTokens = sanitizeCommonSensitiveTokens(input2);
519
- const withoutInlineSecrets = redactInlineSensitiveAssignments(withoutCommonSensitiveTokens);
520
- const withoutAbsolutePaths = redactAbsolutePathTokens(withoutInlineSecrets);
521
- const trimmed = withoutAbsolutePaths.trim();
522
- if (trimmed.startsWith("/") && trimmed.length > 1) {
523
- return "[redacted_path]";
524
- }
525
- if (withoutAbsolutePaths.length > 2048) {
526
- return `${withoutAbsolutePaths.slice(0, 2045)}...`;
527
- }
528
- return withoutAbsolutePaths;
529
- }
530
- function sanitizeString(input2, captureLevel = "redacted") {
531
- if (captureLevel === "max") {
532
- return sanitizeStringMax(input2);
533
- }
534
- return sanitizeStringRedacted(input2);
535
- }
536
- function sanitizeValue(value, keyHint, captureLevel = "redacted", depth = 0) {
537
- if (keyHint && isSensitiveKey(keyHint)) {
538
- return "[redacted]";
539
- }
540
- if (value === null || value === void 0) {
541
- return value;
542
- }
543
- if (typeof value === "string") {
544
- return sanitizeString(value, captureLevel);
545
- }
546
- if (typeof value === "number" || typeof value === "boolean") {
547
- return value;
548
- }
549
- if (depth >= TELEMETRY_SANITIZE_MAX_DEPTH) {
550
- return "[depth_truncated]";
551
- }
552
- if (Array.isArray(value)) {
553
- return value.slice(0, TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS).map((entry) => sanitizeValue(entry, void 0, captureLevel, depth + 1));
554
- }
555
- if (typeof value === "object") {
556
- const record = value;
557
- const sanitized = {};
558
- for (const [key, nested] of Object.entries(record)) {
559
- sanitized[key] = sanitizeValue(nested, key, captureLevel, depth + 1);
560
- }
561
- return sanitized;
562
- }
563
- return String(value);
564
- }
565
- function sanitizeCommandArgs(args, captureLevel = "redacted") {
566
- const sanitized = [];
567
- let nextIsSensitiveValue = false;
568
- for (const rawArg of args) {
569
- const arg = sanitizeString(rawArg, captureLevel);
570
- if (nextIsSensitiveValue) {
571
- sanitized.push("[redacted]");
572
- nextIsSensitiveValue = false;
573
- continue;
574
- }
575
- if (arg.startsWith("--")) {
576
- const withoutPrefix = arg.slice(2);
577
- const delimiterIndex = withoutPrefix.indexOf("=");
578
- if (delimiterIndex >= 0) {
579
- const key = withoutPrefix.slice(0, delimiterIndex);
580
- const value = withoutPrefix.slice(delimiterIndex + 1);
581
- if (isSensitiveKey(key)) {
582
- sanitized.push(`--${key}=[redacted]`);
583
- } else {
584
- sanitized.push(`--${key}=${sanitizeString(value, captureLevel)}`);
585
- }
586
- continue;
587
- }
588
- if (isSensitiveKey(withoutPrefix)) {
589
- sanitized.push(`--${withoutPrefix}`);
590
- nextIsSensitiveValue = true;
591
- continue;
592
- }
593
- }
594
- sanitized.push(arg);
595
- }
596
- return sanitized;
597
- }
598
- function normalizeCaptureLevel(value) {
599
- const normalized = value?.trim().toLowerCase();
600
- if (normalized === "minimal" || normalized === "redacted" || normalized === "max") {
601
- return normalized;
602
- }
603
- return "redacted";
604
- }
605
- function parseBooleanTrueLike(value) {
606
- return BOOLEAN_TRUE_VALUES.has((value ?? "").trim().toLowerCase());
607
- }
608
- function normalizePmVersion(value) {
609
- const trimmed = value?.trim() ?? "";
610
- return trimmed.length > 0 ? trimmed : "0.0.0";
611
- }
612
- function normalizeTelemetryErrorCode(value) {
613
- const normalized = value?.trim();
614
- return normalized && normalized.length > 0 ? normalized : void 0;
615
- }
616
- function normalizeTelemetryExitCode(exitCode, ok) {
617
- if (Number.isFinite(exitCode)) {
618
- return Math.max(0, Math.trunc(exitCode ?? 0));
619
- }
620
- return ok ? 0 : 1;
621
- }
622
- function normalizeTelemetryErrorCategory(params) {
623
- if (params.ok) {
624
- return void 0;
625
- }
626
- if (typeof params.errorCategory === "string" && params.errorCategory.trim().length > 0) {
627
- return params.errorCategory;
628
- }
629
- if (typeof params.errorCode === "string" && params.errorCode.trim().length > 0) {
630
- return resolveTelemetryErrorCategory(params.errorCode);
631
- }
632
- return "unknown";
633
- }
634
- function resolveTelemetrySourceContext(globalOptions) {
635
- const override = (process.env[PM_TELEMETRY_SOURCE_CONTEXT_ENV] ?? "").trim().toLowerCase();
636
- if (PM_TELEMETRY_SOURCE_CONTEXT_SET.has(override)) {
637
- return {
638
- source_context: override,
639
- source_context_source: "env_override"
640
- };
641
- }
642
- const nodeEnv = (process.env.NODE_ENV ?? "").trim().toLowerCase();
643
- if (typeof process.env.VITEST === "string" || typeof process.env.VITEST_WORKER_ID === "string" || nodeEnv === "test") {
644
- return {
645
- source_context: "test",
646
- source_context_source: "inferred"
647
- };
648
- }
649
- const nonTty = process.stdin.isTTY !== true || process.stdout.isTTY !== true;
650
- const ci = parseBooleanTrueLike(process.env.CI);
651
- const scriptLikeMode = globalOptions.json === true || globalOptions.quiet === true;
652
- if (nonTty || ci || scriptLikeMode) {
653
- return {
654
- source_context: "automation",
655
- source_context_source: "inferred"
656
- };
657
- }
658
- return {
659
- source_context: "user",
660
- source_context_source: "inferred"
661
- };
662
- }
663
- function hashWithInstallationId(installationId, value) {
664
- return crypto.createHash("sha256").update(`${installationId}:${value}`).digest("hex");
665
- }
666
- function normalizeForHash(value, depth = 0) {
667
- if (value === null || value === void 0) {
668
- return value;
669
- }
670
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
671
- return value;
672
- }
673
- if (depth >= TELEMETRY_SANITIZE_MAX_DEPTH) {
674
- return "[depth_truncated]";
675
- }
676
- if (Array.isArray(value)) {
677
- return value.slice(0, TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS).map((entry) => normalizeForHash(entry, depth + 1));
678
- }
679
- if (typeof value === "object") {
680
- const record = value;
681
- const normalized = {};
682
- const sortedKeys = Object.keys(record).sort((left, right) => left.localeCompare(right));
683
- for (const key of sortedKeys) {
684
- normalized[key] = normalizeForHash(record[key], depth + 1);
685
- }
686
- return normalized;
687
- }
688
- return String(value);
689
- }
690
- function hashTelemetryValue(installationId, value) {
691
- return hashWithInstallationId(installationId, JSON.stringify(normalizeForHash(value)));
692
- }
693
- function hashCommandArgs(installationId, args) {
694
- return {
695
- hashes: args.map((arg) => hashWithInstallationId(installationId, arg)),
696
- digest: hashWithInstallationId(installationId, args.join("\0"))
697
- };
698
- }
699
- function hashTelemetryErrorFingerprint(installationId, command, errorCode2, errorMessage) {
700
- const normalizedMessage = sanitizeString(errorMessage ?? "", "redacted");
701
- const fingerprintSource = `${command}\0${errorCode2 ?? "unknown_error"}\0${normalizedMessage}`;
702
- return hashWithInstallationId(installationId, fingerprintSource);
703
- }
704
- function telemetryDisabledByEnvironment() {
705
- return PM_TELEMETRY_DISABLED_VALUES.has((process.env[PM_TELEMETRY_DISABLED_ENV] ?? "").trim().toLowerCase()) || PM_TELEMETRY_DISABLED_VALUES.has((process.env[PM_NO_TELEMETRY_ENV] ?? "").trim().toLowerCase());
706
- }
707
- function resolveOtelTracesEndpoint() {
708
- if (PM_TELEMETRY_OTEL_DISABLED_VALUES.has((process.env[PM_TELEMETRY_OTEL_DISABLED_ENV] ?? "").trim().toLowerCase())) {
709
- return null;
710
- }
711
- const directEndpoint = (process.env[OTEL_TRACES_ENDPOINT_ENV] ?? "").trim();
712
- if (directEndpoint.length > 0) {
713
- try {
714
- return new URL(directEndpoint).toString();
715
- } catch {
716
- return null;
717
- }
718
- }
719
- const baseEndpoint = (process.env[OTEL_BASE_ENDPOINT_ENV] ?? "").trim();
720
- if (baseEndpoint.length === 0) {
721
- return null;
722
- }
723
- try {
724
- const url = new URL(baseEndpoint);
725
- const normalizedPath = url.pathname.replace(/\/+$/, "");
726
- if (!normalizedPath.endsWith("/v1/traces")) {
727
- url.pathname = `${normalizedPath.length === 0 ? "" : normalizedPath}/v1/traces`;
728
- }
729
- return url.toString();
730
- } catch {
731
- return null;
732
- }
733
- }
734
- function isoToUnixNano(iso) {
735
- const parsedMs = Date.parse(iso);
736
- const epochMs = Number.isNaN(parsedMs) ? Date.now() : parsedMs;
737
- return `${BigInt(epochMs) * 1000000n}`;
738
- }
739
- function otlpStringAttribute(key, value) {
740
- return {
741
- key,
742
- value: { stringValue: value }
743
- };
744
- }
745
- function otlpBoolAttribute(key, value) {
746
- return {
747
- key,
748
- value: { boolValue: value }
749
- };
750
- }
751
- function otlpIntAttribute(key, value) {
752
- return {
753
- key,
754
- value: { intValue: String(Math.max(0, Math.trunc(value))) }
755
- };
756
- }
757
- async function exportLocalOtelSpan(activeCommand, outcome, finishedAtIso, durationMs) {
758
- if (typeof activeCommand.otel_traces_endpoint !== "string" || activeCommand.otel_traces_endpoint.trim().length === 0 || typeof activeCommand.otel_trace_id !== "string" || activeCommand.otel_trace_id.length === 0 || typeof activeCommand.otel_span_id !== "string" || activeCommand.otel_span_id.length === 0) {
759
- return;
760
- }
761
- const serviceNameCandidate = sanitizeString((process.env[OTEL_SERVICE_NAME_ENV] ?? "").trim());
762
- const serviceName = serviceNameCandidate.length > 0 ? serviceNameCandidate : "pm-cli";
763
- const normalizedExitCode = normalizeTelemetryExitCode(outcome.exit_code, outcome.ok);
764
- const normalizedErrorCode = normalizeTelemetryErrorCode(outcome.error_code);
765
- const normalizedErrorCategory = normalizeTelemetryErrorCategory({
766
- ok: outcome.ok,
767
- errorCode: normalizedErrorCode,
768
- errorCategory: outcome.error_category
769
- });
770
- const attributes = [
771
- otlpStringAttribute("pm.command", sanitizeString(activeCommand.command)),
772
- otlpStringAttribute("pm.version", activeCommand.pm_version),
773
- otlpStringAttribute("pm.source_context", activeCommand.source_context),
774
- otlpStringAttribute("pm.source_context_source", activeCommand.source_context_source),
775
- otlpStringAttribute("pm.installation_id", activeCommand.installation_id),
776
- otlpStringAttribute("pm.session_id", PROCESS_SESSION_ID),
777
- otlpStringAttribute("pm.pm_root_hash", activeCommand.pm_root_hash),
778
- otlpStringAttribute("pm.cwd_hash", activeCommand.cwd_hash),
779
- otlpBoolAttribute("pm.ok", outcome.ok),
780
- otlpIntAttribute("pm.exit_code", normalizedExitCode),
781
- otlpIntAttribute("pm.duration_ms", durationMs)
782
- ];
783
- if (typeof normalizedErrorCode === "string") {
784
- attributes.push(otlpStringAttribute("pm.error_code", normalizedErrorCode));
785
- }
786
- if (typeof normalizedErrorCategory === "string") {
787
- attributes.push(otlpStringAttribute("pm.error_category", normalizedErrorCategory));
788
- }
789
- if (typeof outcome.error === "string" && outcome.error.trim().length > 0) {
790
- attributes.push(otlpStringAttribute("pm.error", sanitizeString(outcome.error)));
791
- }
792
- const payload = {
793
- resourceSpans: [
794
- {
795
- resource: {
796
- attributes: [otlpStringAttribute("service.name", serviceName)]
797
- },
798
- scopeSpans: [
799
- {
800
- scope: {
801
- name: "pm-cli.telemetry",
802
- version: "1"
803
- },
804
- spans: [
805
- {
806
- traceId: activeCommand.otel_trace_id,
807
- spanId: activeCommand.otel_span_id,
808
- name: `pm.command.${sanitizeString(activeCommand.command)}`,
809
- kind: 1,
810
- startTimeUnixNano: isoToUnixNano(activeCommand.started_at),
811
- endTimeUnixNano: isoToUnixNano(finishedAtIso),
812
- attributes,
813
- status: {
814
- code: outcome.ok ? 1 : 2,
815
- message: outcome.ok ? "" : sanitizeString(outcome.error ?? "command_failed")
816
- }
817
- }
818
- ]
819
- }
820
- ]
821
- }
822
- ]
823
- };
824
- const response = await fetch(activeCommand.otel_traces_endpoint, {
825
- method: "POST",
826
- headers: {
827
- "content-type": "application/json"
828
- },
829
- body: JSON.stringify(payload),
830
- signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS)
831
- });
832
- if (!response.ok) {
833
- throw new Error(`local_otel_export_http_${response.status}`);
834
- }
835
- }
836
- function summarizeResult(result, captureLevel = "redacted") {
837
- if (result === null || result === void 0) {
838
- return { type: "nullish" };
839
- }
840
- if (typeof result === "string") {
841
- return { type: "string", value: sanitizeString(result, captureLevel) };
842
- }
843
- if (typeof result === "number" || typeof result === "boolean") {
844
- return { type: typeof result, value: result };
845
- }
846
- if (Array.isArray(result)) {
847
- return {
848
- type: "array",
849
- length: result.length,
850
- sample: result.slice(0, 5).map((entry) => sanitizeValue(entry, void 0, captureLevel))
851
- };
852
- }
853
- if (typeof result === "object") {
854
- const record = result;
855
- const keys = Object.keys(record).sort((left, right) => left.localeCompare(right));
856
- const sanitized = {};
857
- let previewBytes = 0;
858
- for (const key of keys.slice(0, 25)) {
859
- const sanitizedValue = sanitizeValue(record[key], key, captureLevel);
860
- const entrySize = JSON.stringify(sanitizedValue)?.length ?? 0;
861
- if (previewBytes + entrySize > TELEMETRY_RESULT_PREVIEW_MAX_BYTES) {
862
- sanitized[key] = "[preview_truncated]";
863
- break;
864
- }
865
- previewBytes += entrySize;
866
- sanitized[key] = sanitizedValue;
867
- }
868
- return {
869
- type: "object",
870
- key_count: keys.length,
871
- keys_preview: keys.slice(0, 50),
872
- preview: sanitized
873
- };
874
- }
875
- return { type: typeof result, value: String(result) };
876
- }
877
- function buildCommandStartPayload(params) {
878
- const { captureLevel, context, pmVersion, sourceContext, pmRootHash, cwdHash, installationId } = params;
879
- const commandTaxonomy = deriveTelemetryCommandTaxonomy(context.command);
880
- const hashedArgs = hashCommandArgs(installationId, context.args);
881
- const commandInvocationDigest = hashWithInstallationId(installationId, `${context.command}\0${context.args.join("\0")}`);
882
- const commandOptionsDigest = hashTelemetryValue(installationId, context.options);
883
- const globalOptionsDigest = hashTelemetryValue(installationId, context.global);
884
- if (captureLevel === "minimal") {
885
- return {
886
- capture_level: captureLevel,
887
- pm_version: pmVersion,
888
- source_context: sourceContext.source_context,
889
- source_context_source: sourceContext.source_context_source,
890
- command_taxonomy: commandTaxonomy,
891
- command_args_digest: hashedArgs.digest,
892
- command_invocation_digest: commandInvocationDigest,
893
- command_options_digest: commandOptionsDigest,
894
- global_options_digest: globalOptionsDigest
895
- };
896
- }
897
- return {
898
- pm_version: pmVersion,
899
- source_context: sourceContext.source_context,
900
- source_context_source: sourceContext.source_context_source,
901
- command_taxonomy: commandTaxonomy,
902
- command_args: sanitizeCommandArgs(context.args, captureLevel),
903
- command_args_hashes: hashedArgs.hashes,
904
- command_args_digest: hashedArgs.digest,
905
- command_invocation_digest: commandInvocationDigest,
906
- command_options: sanitizeValue(context.options, void 0, captureLevel),
907
- command_options_digest: commandOptionsDigest,
908
- global_options: sanitizeValue(context.global, void 0, captureLevel),
909
- global_options_digest: globalOptionsDigest,
910
- pm_root_hash: pmRootHash,
911
- cwd_hash: cwdHash,
912
- capture_level: captureLevel,
913
- runtime: {
914
- node: process.version,
915
- platform: process.platform,
916
- arch: process.arch,
917
- hostname_hash: hashWithInstallationId(installationId, os.hostname()),
918
- stdin_tty: process.stdin.isTTY === true,
919
- stdout_tty: process.stdout.isTTY === true
920
- }
921
- };
922
- }
923
- function buildCommandFinishPayload(params) {
924
- const { captureLevel, pmVersion, sourceContext, outcome, durationMs, startedAt, command, installationId, commandTaxonomy, exitCode, errorCode: errorCode2, errorCategory, commandResolution, resolutionStage } = params;
925
- const errorFingerprint = outcome.ok === false ? hashTelemetryErrorFingerprint(installationId, command, errorCode2, outcome.error) : void 0;
926
- if (captureLevel === "minimal") {
927
- return {
928
- capture_level: captureLevel,
929
- pm_version: pmVersion,
930
- source_context: sourceContext.source_context,
931
- source_context_source: sourceContext.source_context_source,
932
- command_taxonomy: commandTaxonomy,
933
- command_resolution: commandResolution,
934
- resolution_stage: resolutionStage,
935
- ok: outcome.ok,
936
- exit_code: exitCode,
937
- error_code: errorCode2,
938
- error_category: errorCategory,
939
- error: outcome.error ? sanitizeString(outcome.error, "redacted") : void 0,
940
- error_fingerprint: errorFingerprint,
941
- duration_ms: durationMs
942
- };
943
- }
944
- return {
945
- capture_level: captureLevel,
946
- pm_version: pmVersion,
947
- source_context: sourceContext.source_context,
948
- source_context_source: sourceContext.source_context_source,
949
- command_taxonomy: commandTaxonomy,
950
- command_resolution: commandResolution,
951
- resolution_stage: resolutionStage,
952
- ok: outcome.ok,
953
- exit_code: exitCode,
954
- error_code: errorCode2,
955
- error_category: errorCategory,
956
- error: outcome.error ? sanitizeString(outcome.error, captureLevel) : void 0,
957
- error_fingerprint: errorFingerprint,
958
- duration_ms: durationMs,
959
- started_at: startedAt,
960
- result_summary: summarizeResult(outcome.result, captureLevel)
961
- };
962
- }
963
- function buildCommandErrorPayload(params) {
964
- const { captureLevel, pmVersion, sourceContext, command, commandTaxonomy, commandResolution, resolutionStage, args, options, pmRootHash, cwdHash, installationId, errorCode: errorCode2, errorMessage, errorCategory, exitCode } = params;
965
- const attemptedArgHashes = hashCommandArgs(installationId, args);
966
- const attemptedCommandDigest = hashWithInstallationId(installationId, command);
967
- const attemptedOptionsDigest = hashTelemetryValue(installationId, options);
968
- const errorFingerprint = hashTelemetryErrorFingerprint(installationId, command, errorCode2, errorMessage);
969
- if (captureLevel === "minimal") {
970
- return {
971
- capture_level: captureLevel,
972
- pm_version: pmVersion,
973
- source_context: sourceContext.source_context,
974
- source_context_source: sourceContext.source_context_source,
975
- command_taxonomy: commandTaxonomy,
976
- command_resolution: commandResolution,
977
- resolution_stage: resolutionStage,
978
- attempted_command_digest: attemptedCommandDigest,
979
- attempted_args_digest: attemptedArgHashes.digest,
980
- attempted_options_digest: attemptedOptionsDigest,
981
- error_code: errorCode2,
982
- error_category: errorCategory,
983
- exit_code: exitCode,
984
- error: sanitizeString(errorMessage, "redacted"),
985
- error_fingerprint: errorFingerprint
986
- };
987
- }
988
- return {
989
- capture_level: captureLevel,
990
- pm_version: pmVersion,
991
- source_context: sourceContext.source_context,
992
- source_context_source: sourceContext.source_context_source,
993
- command_taxonomy: commandTaxonomy,
994
- command_resolution: commandResolution,
995
- resolution_stage: resolutionStage,
996
- attempted_command: sanitizeString(command, captureLevel),
997
- attempted_command_digest: attemptedCommandDigest,
998
- attempted_args: sanitizeCommandArgs(args, captureLevel),
999
- attempted_args_hashes: attemptedArgHashes.hashes,
1000
- attempted_args_digest: attemptedArgHashes.digest,
1001
- attempted_options: sanitizeValue(options, void 0, captureLevel),
1002
- attempted_options_digest: attemptedOptionsDigest,
1003
- error_code: errorCode2,
1004
- error_category: errorCategory,
1005
- exit_code: exitCode,
1006
- error: sanitizeString(errorMessage, captureLevel),
1007
- error_fingerprint: errorFingerprint,
1008
- pm_root_hash: pmRootHash,
1009
- cwd_hash: cwdHash,
1010
- runtime: {
1011
- node: process.version,
1012
- platform: process.platform,
1013
- arch: process.arch,
1014
- hostname_hash: hashWithInstallationId(installationId, os.hostname()),
1015
- stdin_tty: process.stdin.isTTY === true,
1016
- stdout_tty: process.stdout.isTTY === true
1017
- }
1018
- };
1019
- }
1020
- async function ensureInstallationId(globalPmRoot) {
1021
- const settings = await readSettings(globalPmRoot);
1022
- let changed = false;
1023
- if (settings.telemetry.installation_id.trim().length === 0) {
1024
- settings.telemetry.installation_id = crypto.randomUUID();
1025
- changed = true;
1026
- }
1027
- if (changed) {
1028
- await writeSettings(globalPmRoot, settings, "telemetry:install_id");
1029
- }
1030
- return {
1031
- installationId: settings.telemetry.installation_id,
1032
- endpoint: settings.telemetry.endpoint,
1033
- retentionDays: Math.max(1, Math.trunc(settings.telemetry.retention_days))
1034
- };
1035
- }
1036
- async function enqueueTelemetryEvent(globalPmRoot, event) {
1037
- const queued = {
1038
- event,
1039
- attempts: 0
1040
- };
1041
- let serialized = JSON.stringify(queued);
1042
- if (serialized.length > TELEMETRY_MAX_EVENT_BYTES) {
1043
- const trimmed = { ...event, payload: { ...event.payload, result_summary: { truncated: true, reason: "payload_size_exceeded", original_bytes: serialized.length } } };
1044
- const trimmedQueued = { event: trimmed, attempts: 0 };
1045
- serialized = JSON.stringify(trimmedQueued);
1046
- }
1047
- await withQueueMutation(async () => {
1048
- await appendLineAtomic(queuePath(globalPmRoot), serialized);
1049
- });
1050
- }
1051
- function parseQueueLines(raw) {
1052
- const entries = [];
1053
- for (const line of raw.split("\n")) {
1054
- const trimmed = line.trim();
1055
- if (trimmed.length === 0) {
1056
- continue;
1057
- }
1058
- try {
1059
- const parsed = JSON.parse(trimmed);
1060
- if (parsed && typeof parsed === "object" && parsed.event && typeof parsed.event === "object" && typeof parsed.attempts === "number") {
1061
- entries.push(parsed);
1062
- }
1063
- } catch {
1064
- }
1065
- }
1066
- return entries;
1067
- }
1068
- function nextRetryIso(attempts) {
1069
- const delay = Math.min(TELEMETRY_RETRY_BASE_DELAY_MS * 2 ** Math.max(attempts - 1, 0), TELEMETRY_MAX_RETRY_DELAY_MS);
1070
- return new Date(Date.now() + delay).toISOString();
1071
- }
1072
- function isDueForRetry(entry) {
1073
- if (typeof entry.next_attempt_after !== "string" || entry.next_attempt_after.trim().length === 0) {
1074
- return true;
1075
- }
1076
- const dueAtMs = Date.parse(entry.next_attempt_after);
1077
- if (Number.isNaN(dueAtMs)) {
1078
- return true;
1079
- }
1080
- return dueAtMs <= Date.now();
1081
- }
1082
- function retentionCutoffMs(retentionDays) {
1083
- const normalizedDays = Number.isFinite(retentionDays) ? Math.max(1, Math.trunc(retentionDays)) : 1;
1084
- return Date.now() - normalizedDays * MILLISECONDS_PER_DAY;
1085
- }
1086
- function isExpiredQueueEntry(entry, cutoffMs) {
1087
- const occurredAt = entry.event?.occurred_at;
1088
- if (typeof occurredAt !== "string" || occurredAt.trim().length === 0) {
1089
- return false;
1090
- }
1091
- const occurredAtMs = Date.parse(occurredAt);
1092
- if (Number.isNaN(occurredAtMs)) {
1093
- return false;
1094
- }
1095
- return occurredAtMs < cutoffMs;
1096
- }
1097
- function pruneExpiredQueueEntries(entries, retentionDays) {
1098
- const cutoffMs = retentionCutoffMs(retentionDays);
1099
- const retained = [];
1100
- let prunedCount = 0;
1101
- for (const entry of entries) {
1102
- const serializedSize = JSON.stringify(entry).length;
1103
- const oversized = serializedSize > TELEMETRY_MAX_EVENT_BYTES;
1104
- if (oversized || isExpiredQueueEntry(entry, cutoffMs) || entry.attempts >= TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS) {
1105
- prunedCount += 1;
1106
- continue;
1107
- }
1108
- retained.push(entry);
1109
- }
1110
- return { entries: retained, prunedCount };
1111
- }
1112
- async function rewriteQueue(globalPmRoot, entries) {
1113
- const serialized = entries.map((entry) => JSON.stringify(entry)).join("\n");
1114
- const contents = serialized.length > 0 ? `${serialized}
1115
- ` : "";
1116
- for (let attempt = 0; ; attempt += 1) {
1117
- try {
1118
- await writeFileAtomic(queuePath(globalPmRoot), contents);
1119
- return;
1120
- } catch (error) {
1121
- const retryDelay = TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS[attempt];
1122
- if (retryDelay === void 0 || !isRetryableQueueRewriteError(error)) {
1123
- throw error;
1124
- }
1125
- await sleep(retryDelay);
1126
- }
1127
- }
1128
- }
1129
- function isRetryableQueueRewriteError(error) {
1130
- if (typeof error !== "object" || error === null || !("code" in error)) {
1131
- return false;
1132
- }
1133
- const code = error.code;
1134
- return code === "EACCES" || code === "EBUSY" || code === "EPERM";
1135
- }
1136
- function sleep(milliseconds) {
1137
- return new Promise((resolve) => {
1138
- setTimeout(resolve, milliseconds);
1139
- });
1140
- }
1141
- async function cleanupTelemetryQueueTempOrphans(globalPmRoot, maxAgeMs = TELEMETRY_QUEUE_TMP_ORPHAN_MAX_AGE_MS) {
1142
- try {
1143
- const dirPath = telemetryRuntimeDirectory(globalPmRoot);
1144
- const entries = await readdir(dirPath, { withFileTypes: true });
1145
- const cutoffMs = Date.now() - Math.max(0, maxAgeMs);
1146
- await Promise.all(entries.filter((entry) => entry.isFile() && /^\.events\.jsonl\.\d+\.\d+\.[a-f0-9]+\.tmp$/.test(entry.name)).map(async (entry) => {
1147
- const candidate = path.join(dirPath, entry.name);
1148
- const candidateStats = await stat(candidate);
1149
- if (candidateStats.mtimeMs < cutoffMs) {
1150
- await rm(candidate, { force: true });
1151
- }
1152
- }));
1153
- } catch {
1154
- }
1155
- }
1156
- async function withQueueMutation(operation) {
1157
- const run = _queueMutationPromise.catch(() => {
1158
- }).then(operation);
1159
- _queueMutationPromise = run.catch(() => {
1160
- });
1161
- return run;
1162
- }
1163
- async function readCurrentQueueEntries(globalPmRoot) {
1164
- const raw = await readFileIfExists(queuePath(globalPmRoot));
1165
- if (raw === null || raw.trim().length === 0) {
1166
- return [];
1167
- }
1168
- return parseQueueLines(raw);
1169
- }
1170
- async function removeFlushedEntriesFromCurrentQueue(globalPmRoot, flushedIds, retentionDays) {
1171
- return withQueueMutation(async () => {
1172
- const currentEntries = await readCurrentQueueEntries(globalPmRoot);
1173
- const { entries: retainedEntries } = pruneExpiredQueueEntries(currentEntries, retentionDays);
1174
- const remaining = retainedEntries.filter((entry) => !flushedIds.has(entry.event.event_id));
1175
- await rewriteQueue(globalPmRoot, remaining);
1176
- return remaining;
1177
- });
1178
- }
1179
- async function markFailedEntriesInCurrentQueue(globalPmRoot, failedIds, attemptTime, retentionDays) {
1180
- return withQueueMutation(async () => {
1181
- const currentEntries = await readCurrentQueueEntries(globalPmRoot);
1182
- const { entries: retainedEntries } = pruneExpiredQueueEntries(currentEntries, retentionDays);
1183
- const retried = retainedEntries.map((entry) => {
1184
- if (!failedIds.has(entry.event.event_id)) {
1185
- return entry;
1186
- }
1187
- const attempts = entry.attempts + 1;
1188
- return {
1189
- ...entry,
1190
- attempts,
1191
- last_attempt_at: attemptTime,
1192
- next_attempt_after: nextRetryIso(attempts)
1193
- };
1194
- });
1195
- await rewriteQueue(globalPmRoot, retried);
1196
- return retried;
1197
- });
1198
- }
1199
- async function flushQueue(globalPmRoot, endpoint, retentionDays) {
1200
- await cleanupTelemetryQueueTempOrphans(globalPmRoot);
1201
- const normalizedEndpoint = endpoint.trim();
1202
- if (normalizedEndpoint.length === 0) {
1203
- return;
1204
- }
1205
- const raw = await readFileIfExists(queuePath(globalPmRoot));
1206
- if (raw === null || raw.trim().length === 0) {
1207
- await writeRuntimeState(globalPmRoot, {
1208
- endpoint: normalizedEndpoint,
1209
- queue_entries: 0
1210
- });
1211
- return;
1212
- }
1213
- const queueEntries = parseQueueLines(raw);
1214
- if (queueEntries.length === 0) {
1215
- await writeRuntimeState(globalPmRoot, {
1216
- endpoint: normalizedEndpoint,
1217
- queue_entries: 0
1218
- });
1219
- return;
1220
- }
1221
- const { entries: retainedEntries, prunedCount } = pruneExpiredQueueEntries(queueEntries, retentionDays);
1222
- if (retainedEntries.length === 0) {
1223
- if (prunedCount > 0) {
1224
- await rewriteQueue(globalPmRoot, []);
1225
- }
1226
- await writeRuntimeState(globalPmRoot, {
1227
- endpoint: normalizedEndpoint,
1228
- queue_entries: 0
1229
- });
1230
- return;
1231
- }
1232
- const dueEntries = retainedEntries.filter((entry) => isDueForRetry(entry)).slice(0, TELEMETRY_FLUSH_BATCH_SIZE);
1233
- if (dueEntries.length === 0) {
1234
- if (prunedCount > 0) {
1235
- await rewriteQueue(globalPmRoot, retainedEntries);
1236
- }
1237
- await writeRuntimeState(globalPmRoot, {
1238
- endpoint: normalizedEndpoint,
1239
- queue_entries: retainedEntries.length
1240
- });
1241
- return;
1242
- }
1243
- const dueIds = new Set(dueEntries.map((entry) => entry.event.event_id));
1244
- const attemptTime = nowIso();
1245
- const requestHeaders = {
1246
- "content-type": "application/json"
1247
- };
1248
- const ingestKey = process.env.PM_TELEMETRY_INGEST_KEY?.trim();
1249
- if (ingestKey) {
1250
- requestHeaders["x-pm-telemetry-key"] = ingestKey;
1251
- }
1252
- try {
1253
- const response = await fetch(normalizedEndpoint, {
1254
- method: "POST",
1255
- headers: requestHeaders,
1256
- body: JSON.stringify({
1257
- schema_version: TELEMETRY_SCHEMA_VERSION,
1258
- events: dueEntries.map((entry) => entry.event)
1259
- }),
1260
- signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS)
1261
- });
1262
- if (!response.ok) {
1263
- throw new Error(`telemetry_flush_http_${response.status}`);
1264
- }
1265
- } catch (error) {
1266
- const retried = await markFailedEntriesInCurrentQueue(globalPmRoot, dueIds, attemptTime, retentionDays);
1267
- const errorMessage = (() => {
1268
- if (error instanceof Error) {
1269
- return sanitizeString(error.message, "redacted");
1270
- }
1271
- return "telemetry_flush_failed";
1272
- })();
1273
- await writeRuntimeState(globalPmRoot, {
1274
- endpoint: normalizedEndpoint,
1275
- queue_entries: retried.length,
1276
- last_attempted_flush_at: attemptTime,
1277
- last_failed_flush_at: attemptTime,
1278
- last_failed_flush_error: errorMessage
1279
- });
1280
- return;
1281
- }
1282
- try {
1283
- const remaining = await removeFlushedEntriesFromCurrentQueue(globalPmRoot, dueIds, retentionDays);
1284
- await writeRuntimeState(globalPmRoot, {
1285
- endpoint: normalizedEndpoint,
1286
- queue_entries: remaining.length,
1287
- last_attempted_flush_at: attemptTime,
1288
- last_successful_flush_at: attemptTime,
1289
- last_failed_flush_at: void 0,
1290
- last_failed_flush_error: void 0
1291
- });
1292
- } catch (error) {
1293
- const errorMessage = (() => {
1294
- if (error instanceof Error) {
1295
- return sanitizeString(error.message, "redacted");
1296
- }
1297
- return "telemetry_flush_failed";
1298
- })();
1299
- const currentEntries = await readCurrentQueueEntries(globalPmRoot).catch(() => retainedEntries);
1300
- await writeRuntimeState(globalPmRoot, {
1301
- endpoint: normalizedEndpoint,
1302
- queue_entries: currentEntries.length,
1303
- last_attempted_flush_at: attemptTime,
1304
- last_failed_flush_at: attemptTime,
1305
- last_failed_flush_error: errorMessage
1306
- });
1307
- }
1308
- }
1309
- function isFreshDirectoryLock(lockPath, staleMs) {
1310
- try {
1311
- return Date.now() - statSync(lockPath).mtimeMs < staleMs;
1312
- } catch {
1313
- return false;
1314
- }
1315
- }
1316
- function removeDirectoryLockBestEffort(lockPath) {
1317
- try {
1318
- rmSync(lockPath, { recursive: true, force: true });
1319
- } catch {
1320
- }
1321
- }
1322
- function errorCode(error) {
1323
- if (typeof error !== "object" || error === null || !("code" in error)) {
1324
- return void 0;
1325
- }
1326
- const code = error.code;
1327
- return typeof code === "string" ? code : void 0;
1328
- }
1329
- function createDirectoryLock(lockPath) {
1330
- try {
1331
- mkdirSync(lockPath);
1332
- return true;
1333
- } catch (error) {
1334
- const code = errorCode(error);
1335
- if (code === "EEXIST") {
1336
- return false;
1337
- }
1338
- if (code !== "ENOENT") {
1339
- return false;
1340
- }
1341
- }
1342
- try {
1343
- mkdirSync(path.dirname(lockPath), { recursive: true });
1344
- mkdirSync(lockPath);
1345
- return true;
1346
- } catch {
1347
- return false;
1348
- }
1349
- }
1350
- function acquireTelemetryFlushSpawnGate(globalPmRoot) {
1351
- if (isFreshDirectoryLock(flushLockPath(globalPmRoot), TELEMETRY_FLUSH_LOCK_STALE_MS)) {
1352
- return false;
1353
- }
1354
- const lockPath = flushSpawnLockPath(globalPmRoot);
1355
- try {
1356
- if (Date.now() - statSync(lockPath).mtimeMs < TELEMETRY_FLUSH_SPAWN_LOCK_STALE_MS) {
1357
- return false;
1358
- }
1359
- removeDirectoryLockBestEffort(lockPath);
1360
- } catch (error) {
1361
- if (errorCode(error) !== "ENOENT") {
1362
- return false;
1363
- }
1364
- }
1365
- return createDirectoryLock(lockPath);
1366
- }
1367
- function releaseTelemetryFlushSpawnGate(globalPmRoot) {
1368
- removeDirectoryLockBestEffort(flushSpawnLockPath(globalPmRoot));
1369
- }
1370
- function scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays) {
1371
- if (shouldFlushInline()) {
1372
- const previousFlush = _lastFlushPromise;
1373
- const nextFlush = flushQueue(globalPmRoot, endpoint, retentionDays).catch(() => {
1374
- });
1375
- _lastFlushPromise = Promise.allSettled([previousFlush, nextFlush]).then(() => {
1376
- });
1377
- return;
1378
- }
1379
- try {
1380
- const acquiredSpawnGate = acquireTelemetryFlushSpawnGate(globalPmRoot);
1381
- if (!acquiredSpawnGate) {
1382
- return;
1383
- }
1384
- const child = spawn(process.execPath, [telemetryFlushRunnerPath()], {
1385
- detached: true,
1386
- stdio: "ignore",
1387
- env: {
1388
- ...process.env,
1389
- PM_GLOBAL_PATH: globalPmRoot,
1390
- [PM_TELEMETRY_FLUSH_CHILD_ENV]: "1"
1391
- }
1392
- });
1393
- child.unref();
1394
- } catch {
1395
- releaseTelemetryFlushSpawnGate(globalPmRoot);
1396
- }
1397
- }
1398
- async function startTelemetryCommand(context) {
1399
- if (telemetryDisabledByEnvironment()) {
1400
- return null;
1401
- }
1402
- try {
1403
- const globalPmRoot = resolveGlobalPmRoot(process.cwd());
1404
- const settings = await readSettings(globalPmRoot);
1405
- if (!settings.telemetry.enabled) {
1406
- return null;
1407
- }
1408
- const captureLevel = normalizeCaptureLevel(settings.telemetry.capture_level);
1409
- const { installationId, endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);
1410
- const pmVersion = normalizePmVersion(context.pm_version);
1411
- const sourceContext = resolveTelemetrySourceContext(context.global);
1412
- const pmRootHash = hashWithInstallationId(installationId, context.pm_root);
1413
- const cwdHash = hashWithInstallationId(installationId, process.cwd());
1414
- const otelTracesEndpoint = resolveOtelTracesEndpoint();
1415
- const occurredAt = nowIso();
1416
- const event = {
1417
- schema_version: TELEMETRY_SCHEMA_VERSION,
1418
- event_id: crypto.randomUUID(),
1419
- event_type: "command_start",
1420
- occurred_at: occurredAt,
1421
- installation_id: installationId,
1422
- session_id: PROCESS_SESSION_ID,
1423
- command: context.command,
1424
- payload: buildCommandStartPayload({
1425
- captureLevel,
1426
- context,
1427
- pmVersion,
1428
- sourceContext,
1429
- pmRootHash,
1430
- cwdHash,
1431
- installationId
1432
- })
1433
- };
1434
- await enqueueTelemetryEvent(globalPmRoot, event);
1435
- scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays);
1436
- const commandTaxonomy = deriveTelemetryCommandTaxonomy(context.command);
1437
- return {
1438
- started_at: occurredAt,
1439
- started_at_ms: Date.now(),
1440
- command: context.command,
1441
- command_taxonomy: commandTaxonomy,
1442
- pm_version: pmVersion,
1443
- source_context: sourceContext.source_context,
1444
- source_context_source: sourceContext.source_context_source,
1445
- installation_id: installationId,
1446
- pm_root_hash: pmRootHash,
1447
- cwd_hash: cwdHash,
1448
- endpoint,
1449
- retention_days: retentionDays,
1450
- global_pm_root: globalPmRoot,
1451
- capture_level: captureLevel,
1452
- otel_traces_endpoint: otelTracesEndpoint ?? void 0,
1453
- otel_trace_id: otelTracesEndpoint ? crypto.randomBytes(16).toString("hex") : void 0,
1454
- otel_span_id: otelTracesEndpoint ? crypto.randomBytes(8).toString("hex") : void 0
1455
- };
1456
- } catch {
1457
- return null;
1458
- }
1459
- }
1460
- async function finishTelemetryCommand(activeCommand, outcome) {
1461
- if (!activeCommand) {
1462
- return;
1463
- }
1464
- try {
1465
- const finishedAt = nowIso();
1466
- const durationMs = Math.max(0, Date.now() - activeCommand.started_at_ms);
1467
- const normalizedErrorCode = normalizeTelemetryErrorCode(inferTelemetryErrorCode({
1468
- ok: outcome.ok,
1469
- errorCode: outcome.error_code,
1470
- errorMessage: outcome.error,
1471
- exitCode: outcome.exit_code
1472
- }));
1473
- const normalizedErrorCategory = normalizeTelemetryErrorCategory({
1474
- ok: outcome.ok,
1475
- errorCode: normalizedErrorCode,
1476
- errorCategory: outcome.error_category
1477
- });
1478
- const normalizedExitCode = normalizeTelemetryExitCode(outcome.exit_code, outcome.ok);
1479
- const commandResolution = outcome.command_resolution ?? deriveTelemetryCommandResolution({
1480
- ok: outcome.ok,
1481
- errorCode: normalizedErrorCode,
1482
- errorCategory: normalizedErrorCategory
1483
- });
1484
- const resolutionStage = outcome.resolution_stage ?? "execute";
1485
- const event = {
1486
- schema_version: TELEMETRY_SCHEMA_VERSION,
1487
- event_id: crypto.randomUUID(),
1488
- event_type: "command_finish",
1489
- occurred_at: finishedAt,
1490
- installation_id: activeCommand.installation_id,
1491
- session_id: PROCESS_SESSION_ID,
1492
- command: activeCommand.command,
1493
- payload: buildCommandFinishPayload({
1494
- captureLevel: activeCommand.capture_level,
1495
- pmVersion: activeCommand.pm_version,
1496
- sourceContext: {
1497
- source_context: activeCommand.source_context,
1498
- source_context_source: activeCommand.source_context_source
1499
- },
1500
- outcome,
1501
- durationMs,
1502
- startedAt: activeCommand.started_at,
1503
- command: activeCommand.command,
1504
- installationId: activeCommand.installation_id,
1505
- commandTaxonomy: activeCommand.command_taxonomy,
1506
- exitCode: normalizedExitCode,
1507
- errorCode: normalizedErrorCode,
1508
- errorCategory: normalizedErrorCategory,
1509
- commandResolution,
1510
- resolutionStage
1511
- })
1512
- };
1513
- await enqueueTelemetryEvent(activeCommand.global_pm_root, event);
1514
- scheduleTelemetryFlush(activeCommand.global_pm_root, activeCommand.endpoint, activeCommand.retention_days);
1515
- void exportLocalOtelSpan(activeCommand, {
1516
- ...outcome,
1517
- exit_code: normalizedExitCode,
1518
- error_code: normalizedErrorCode,
1519
- error_category: normalizedErrorCategory
1520
- }, finishedAt, durationMs).catch(() => {
1521
- });
1522
- } catch {
1523
- }
1524
- }
1525
- async function emitTelemetryErrorEvent(context) {
1526
- if (telemetryDisabledByEnvironment()) {
1527
- return;
1528
- }
1529
- try {
1530
- const globalPmRoot = resolveGlobalPmRoot(process.cwd());
1531
- const settings = await readSettings(globalPmRoot);
1532
- if (!settings.telemetry.enabled) {
1533
- return;
1534
- }
1535
- const captureLevel = normalizeCaptureLevel(settings.telemetry.capture_level);
1536
- const { installationId, endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);
1537
- const pmVersion = normalizePmVersion(context.pm_version);
1538
- const sourceContext = resolveTelemetrySourceContext(context.global);
1539
- const pmRootHash = hashWithInstallationId(installationId, context.pm_root);
1540
- const cwdHash = hashWithInstallationId(installationId, process.cwd());
1541
- const occurredAt = nowIso();
1542
- const normalizedErrorCode = normalizeTelemetryErrorCode(inferTelemetryErrorCode({
1543
- ok: false,
1544
- errorCode: context.error_code,
1545
- errorMessage: context.error_message,
1546
- exitCode: context.exit_code
1547
- })) ?? "unknown_error";
1548
- const normalizedErrorCategory = context.error_category ?? resolveTelemetryErrorCategory(normalizedErrorCode);
1549
- const normalizedExitCode = normalizeTelemetryExitCode(context.exit_code, false);
1550
- const normalizedCommand = context.command.trim().length > 0 ? context.command : "<unknown>";
1551
- const commandTaxonomy = deriveTelemetryCommandTaxonomy(normalizedCommand);
1552
- const commandResolution = context.command_resolution ?? deriveTelemetryCommandResolution({
1553
- ok: false,
1554
- errorCode: normalizedErrorCode,
1555
- errorCategory: normalizedErrorCategory
1556
- });
1557
- const resolutionStage = context.resolution_stage ?? "unknown";
1558
- const event = {
1559
- schema_version: TELEMETRY_SCHEMA_VERSION,
1560
- event_id: crypto.randomUUID(),
1561
- event_type: "command_error",
1562
- occurred_at: occurredAt,
1563
- installation_id: installationId,
1564
- session_id: PROCESS_SESSION_ID,
1565
- command: sanitizeString(normalizedCommand, "redacted"),
1566
- payload: buildCommandErrorPayload({
1567
- captureLevel,
1568
- pmVersion,
1569
- sourceContext,
1570
- command: normalizedCommand,
1571
- commandTaxonomy,
1572
- commandResolution,
1573
- resolutionStage,
1574
- args: context.args,
1575
- options: context.options,
1576
- pmRootHash,
1577
- cwdHash,
1578
- installationId,
1579
- errorCode: normalizedErrorCode,
1580
- errorCategory: normalizedErrorCategory,
1581
- exitCode: normalizedExitCode,
1582
- errorMessage: context.error_message
1583
- })
1584
- };
1585
- await enqueueTelemetryEvent(globalPmRoot, event);
1586
- scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays);
1587
- } catch {
1588
- }
1589
- }
1590
-
1591
173
  // dist/core/sentry/instrument.js
1592
174
  import fs from "node:fs";
1593
- import path2 from "node:path";
175
+ import path from "node:path";
1594
176
  !(function() {
1595
177
  try {
1596
178
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
@@ -1737,7 +319,7 @@ function isKnownNoisyConsoleBreadcrumb(breadcrumb) {
1737
319
  }
1738
320
  function resolveCliVersion() {
1739
321
  try {
1740
- const candidate = path2.join(resolvePmPackageRootFromModule(import.meta.url, ["../../.."]), "package.json");
322
+ const candidate = path.join(resolvePmPackageRootFromModule(import.meta.url, ["../../.."]), "package.json");
1741
323
  if (fs.existsSync(candidate)) {
1742
324
  const parsed = JSON.parse(fs.readFileSync(candidate, "utf8"));
1743
325
  if (typeof parsed.version === "string")
@@ -2345,7 +927,7 @@ function parseLooseCommandOptions(args) {
2345
927
  !(function() {
2346
928
  try {
2347
929
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
2348
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ed65d7db-f9b0-5c53-ba96-b13eb4d6cd35");
930
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "74a0432a-8374-53db-8e95-5ebd38cf8557");
2349
931
  } catch (e2) {
2350
932
  }
2351
933
  })();
@@ -2937,6 +1519,15 @@ var HELP_BY_COMMAND_PATH = {
2937
1519
  why: "Reports tracker-level totals and distribution by type/status.",
2938
1520
  examples: ["pm stats", "pm stats --json"]
2939
1521
  },
1522
+ telemetry: {
1523
+ why: "Inspects and manages local telemetry queue/runtime state for observability diagnostics.",
1524
+ examples: [
1525
+ "pm telemetry status",
1526
+ "pm telemetry stats --limit 10",
1527
+ "pm telemetry flush",
1528
+ "pm telemetry clear"
1529
+ ]
1530
+ },
2940
1531
  health: {
2941
1532
  why: "Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.",
2942
1533
  examples: [
@@ -5126,7 +3717,7 @@ function buildUnknownCommandGuidanceFromRuntime(rawMessage, root, extensionDescr
5126
3717
  const fallbackTopLevel = [...new Set(commandPaths.map((commandPath) => commandPath.split(" ")[0]).filter((segment) => segment.length > 0))];
5127
3718
  fallbackTopLevel.sort((left, right) => left.localeCompare(right));
5128
3719
  const suggestedPaths = (combinedCandidates.length > 0 ? combinedCandidates : fallbackTopLevel).slice(0, 3);
5129
- const examples = [.../* @__PURE__ */ new Set(["pm --help", ...suggestedPaths.map((path4) => `pm ${path4} --help`)])];
3720
+ const examples = [.../* @__PURE__ */ new Set(["pm --help", ...suggestedPaths.map((path3) => `pm ${path3} --help`)])];
5130
3721
  const optionalPackageHint = resolveOptionalPackageInstallHint(normalizedUnknown);
5131
3722
  const didYouMean = combinedCandidates.length > 0 ? `Did you mean: ${combinedCandidates.slice(0, 3).join(", ")}?` : null;
5132
3723
  return {
@@ -5580,10 +4171,10 @@ var EXPECTED_HANDLED_ERROR_EXIT_CODES = /* @__PURE__ */ new Set([
5580
4171
  EXIT_CODE.CONFLICT
5581
4172
  ]);
5582
4173
  var TRUE_LIKE_ENV_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
5583
- var loadSetupRegistrationModule = createLazyModule(() => import("./chunks/register-setup-YJKIQRKA.js"));
5584
- var loadListQueryRegistrationModule = createLazyModule(() => import("./chunks/register-list-query-AG3XKXWL.js"));
5585
- var loadMutationRegistrationModule = createLazyModule(() => import("./chunks/register-mutation-RSMT6DPK.js"));
5586
- var loadOperationRegistrationModule = createLazyModule(() => import("./chunks/register-operations-Q54JQZUN.js"));
4174
+ var loadSetupRegistrationModule = createLazyModule(() => import("./chunks/register-setup-ZHJI2DI3.js"));
4175
+ var loadListQueryRegistrationModule = createLazyModule(() => import("./chunks/register-list-query-WST76HSQ.js"));
4176
+ var loadMutationRegistrationModule = createLazyModule(() => import("./chunks/register-mutation-OA675SOU.js"));
4177
+ var loadOperationRegistrationModule = createLazyModule(() => import("./chunks/register-operations-N3PMHXH5.js"));
5587
4178
  function describeUnknownError(error) {
5588
4179
  if (error instanceof PmCliError) {
5589
4180
  return error.message;
@@ -5722,7 +4313,7 @@ function normalizeTelemetryResolutionStage(value) {
5722
4313
  }
5723
4314
  return normalized;
5724
4315
  }
5725
- function normalizeTelemetryErrorCategory2(value) {
4316
+ function normalizeTelemetryErrorCategory(value) {
5726
4317
  if (!value) {
5727
4318
  return void 0;
5728
4319
  }
@@ -5788,12 +4379,12 @@ function buildPostActionTelemetryOutcome() {
5788
4379
  const resultExitCode = readRecordNumber(result, "exit_code", "exitCode");
5789
4380
  const exitCode = processExitCode ?? resultExitCode ?? EXIT_CODE.SUCCESS;
5790
4381
  const ok = exitCode === EXIT_CODE.SUCCESS;
5791
- const errorCode2 = readRecordString(result, "error_code", "errorCode") ?? inferPostActionErrorCode(ok, exitCode);
5792
- const errorCategory = normalizeTelemetryErrorCategory2(readRecordString(result, "error_category", "errorCategory")) ?? (!ok ? resolveTelemetryErrorCategory(errorCode2) : void 0);
4382
+ const errorCode = readRecordString(result, "error_code", "errorCode") ?? inferPostActionErrorCode(ok, exitCode);
4383
+ const errorCategory = normalizeTelemetryErrorCategory(readRecordString(result, "error_category", "errorCategory")) ?? (!ok ? resolveTelemetryErrorCategory(errorCode) : void 0);
5793
4384
  const errorMessage = !ok ? inferPostActionFailureMessage(result) ?? `command_exit_${exitCode}` : void 0;
5794
4385
  const commandResolution = normalizeTelemetryCommandResolution(readRecordString(result, "command_resolution", "commandResolution")) ?? deriveTelemetryCommandResolution({
5795
4386
  ok,
5796
- errorCode: errorCode2,
4387
+ errorCode,
5797
4388
  errorCategory
5798
4389
  });
5799
4390
  const resolutionStage = normalizeTelemetryResolutionStage(readRecordString(result, "resolution_stage", "resolutionStage")) ?? "execute";
@@ -5801,7 +4392,7 @@ function buildPostActionTelemetryOutcome() {
5801
4392
  ok,
5802
4393
  error: errorMessage,
5803
4394
  exit_code: exitCode,
5804
- error_code: errorCode2,
4395
+ error_code: errorCode,
5805
4396
  error_category: errorCategory,
5806
4397
  command_resolution: commandResolution,
5807
4398
  resolution_stage: resolutionStage
@@ -6665,7 +5256,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
6665
5256
  }
6666
5257
  function resolveCliVersion2() {
6667
5258
  try {
6668
- const packageJsonPath = path3.join(resolvePmPackageRoot(), "package.json");
5259
+ const packageJsonPath = path2.join(resolvePmPackageRoot(), "package.json");
6669
5260
  const raw = fs2.readFileSync(packageJsonPath, "utf8");
6670
5261
  const parsed = JSON.parse(raw);
6671
5262
  return typeof parsed.version === "string" ? parsed.version : "0.0.0";