@unbrained/pm-cli 2026.7.6 → 2026.7.7

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 (666) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/cli/commands/annotation-command.d.ts +1 -0
  3. package/dist/cli/commands/annotation-command.js +29 -2
  4. package/dist/cli/commands/annotation-command.js.map +1 -1
  5. package/dist/cli/commands/comments.js +3 -4
  6. package/dist/cli/commands/comments.js.map +1 -1
  7. package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
  8. package/dist/cli/commands/extension/bundled-catalog.js +38 -28
  9. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  10. package/dist/cli/commands/extension/install-sources.js +81 -18
  11. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  12. package/dist/cli/commands/health.js +9 -5
  13. package/dist/cli/commands/health.js.map +1 -1
  14. package/dist/cli/commands/learnings.js +5 -3
  15. package/dist/cli/commands/learnings.js.map +1 -1
  16. package/dist/cli/commands/notes.js +5 -3
  17. package/dist/cli/commands/notes.js.map +1 -1
  18. package/dist/cli/commands/reindex.js +4 -3
  19. package/dist/cli/commands/reindex.js.map +1 -1
  20. package/dist/cli/commands/search.js +3 -3
  21. package/dist/cli/commands/search.js.map +1 -1
  22. package/dist/cli/commands/test.d.ts +9 -0
  23. package/dist/cli/commands/test.js +144 -105
  24. package/dist/cli/commands/test.js.map +1 -1
  25. package/dist/cli/extension-command-help.js +10 -2
  26. package/dist/cli/extension-command-help.js.map +1 -1
  27. package/dist/cli/register-list-query.d.ts +1 -1
  28. package/dist/cli/register-list-query.js +18 -27
  29. package/dist/cli/register-list-query.js.map +1 -1
  30. package/dist/cli/register-operations.d.ts +0 -8
  31. package/dist/cli/register-operations.js +41 -46
  32. package/dist/cli/register-operations.js.map +1 -1
  33. package/dist/cli/register-setup.js +113 -13
  34. package/dist/cli/register-setup.js.map +1 -1
  35. package/dist/cli/registration-helpers.d.ts +5 -1
  36. package/dist/cli/registration-helpers.js +14 -2
  37. package/dist/cli/registration-helpers.js.map +1 -1
  38. package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
  39. package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js → append-PVCTBVJG.js} +8 -9
  40. package/dist/cli-bundle/chunks/{chunk-EGAP5OWD.js → chunk-2APXX4TZ.js} +16 -14
  41. package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
  42. package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js → chunk-2LEJGRQ7.js} +2 -2
  43. package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js → chunk-2TILG6F2.js} +3 -3
  44. package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js → chunk-3G6UMXT3.js} +6 -8
  45. package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js.map → chunk-3G6UMXT3.js.map} +1 -1
  46. package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js → chunk-3TYOW6RR.js} +8 -8
  47. package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js → chunk-3X542TEY.js} +7 -7
  48. package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js → chunk-42LXP4VO.js} +12 -16
  49. package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js.map → chunk-42LXP4VO.js.map} +1 -1
  50. package/dist/cli-bundle/chunks/{chunk-CL36D4PC.js → chunk-43SIHQND.js} +36 -15
  51. package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
  52. package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js → chunk-43UQN754.js} +10 -14
  53. package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js.map → chunk-43UQN754.js.map} +1 -1
  54. package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js → chunk-43YSKY75.js} +4 -6
  55. package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js.map → chunk-43YSKY75.js.map} +1 -1
  56. package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js → chunk-4BKDAEDF.js} +5 -5
  57. package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js.map → chunk-4BKDAEDF.js.map} +2 -2
  58. package/dist/cli-bundle/chunks/{chunk-4LELACOL.js → chunk-4IQKDKGE.js} +15 -23
  59. package/dist/cli-bundle/chunks/{chunk-4LELACOL.js.map → chunk-4IQKDKGE.js.map} +1 -1
  60. package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js → chunk-4MZOKTI2.js} +6 -8
  61. package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js.map → chunk-4MZOKTI2.js.map} +1 -1
  62. package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js → chunk-52NS7JDP.js} +14 -20
  63. package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js.map → chunk-52NS7JDP.js.map} +1 -1
  64. package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js → chunk-565WYS5W.js} +12 -16
  65. package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js.map → chunk-565WYS5W.js.map} +1 -1
  66. package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js → chunk-5FIQ4EX3.js} +12 -18
  67. package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js.map → chunk-5FIQ4EX3.js.map} +1 -1
  68. package/dist/cli-bundle/chunks/{chunk-DMRNBQOI.js → chunk-6G6O3OPQ.js} +256 -36
  69. package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
  70. package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js → chunk-6LCJRGPD.js} +9 -13
  71. package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js.map → chunk-6LCJRGPD.js.map} +1 -1
  72. package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js → chunk-6UQCNWFV.js} +6 -8
  73. package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js.map → chunk-6UQCNWFV.js.map} +1 -1
  74. package/dist/cli-bundle/chunks/{chunk-ZSUS2OD3.js → chunk-6XTSYPPO.js} +1216 -387
  75. package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
  76. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
  77. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
  78. package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js → chunk-7PNQA24K.js} +30 -36
  79. package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js.map → chunk-7PNQA24K.js.map} +1 -1
  80. package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js → chunk-7VQ3JJN5.js} +2 -2
  81. package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js → chunk-7Y5N34HX.js} +8 -12
  82. package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js.map → chunk-7Y5N34HX.js.map} +1 -1
  83. package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js → chunk-AGAVEDIE.js} +7 -7
  84. package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js → chunk-AJUON7E6.js} +3 -3
  85. package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js → chunk-ARKHKYYS.js} +13 -21
  86. package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js.map → chunk-ARKHKYYS.js.map} +1 -1
  87. package/dist/cli-bundle/chunks/{chunk-46CUF5L6.js → chunk-C5ACVMOI.js} +99 -51
  88. package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
  89. package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js → chunk-CJQM7O7R.js} +16 -20
  90. package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js.map → chunk-CJQM7O7R.js.map} +1 -1
  91. package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js → chunk-D2DCTFTL.js} +10 -12
  92. package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js.map → chunk-D2DCTFTL.js.map} +1 -1
  93. package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js → chunk-DDDWVPID.js} +8 -10
  94. package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js.map → chunk-DDDWVPID.js.map} +1 -1
  95. package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js → chunk-DG6BSXZ7.js} +5 -5
  96. package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js.map → chunk-DG6BSXZ7.js.map} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js → chunk-DR2V5OIV.js} +3 -3
  98. package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js → chunk-E3LWJUGF.js} +4 -6
  99. package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js.map → chunk-E3LWJUGF.js.map} +1 -1
  100. package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js → chunk-E3YQFSFE.js} +6 -10
  101. package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js.map → chunk-E3YQFSFE.js.map} +1 -1
  102. package/dist/cli-bundle/chunks/{chunk-XG625QP4.js → chunk-EDO7VXSO.js} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js → chunk-EIUBK2LT.js} +12 -18
  104. package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js.map → chunk-EIUBK2LT.js.map} +1 -1
  105. package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js → chunk-EMXPI36L.js} +14 -20
  106. package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js.map → chunk-EMXPI36L.js.map} +1 -1
  107. package/dist/cli-bundle/chunks/{chunk-MLIYFOE7.js → chunk-EOUVR7JN.js} +12 -8
  108. package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js → chunk-EVEPHNXJ.js} +4 -4
  110. package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js → chunk-F6MT7KKE.js} +4 -6
  111. package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js.map → chunk-F6MT7KKE.js.map} +1 -1
  112. package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js → chunk-F6YC2A6X.js} +7 -11
  113. package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js.map → chunk-F6YC2A6X.js.map} +1 -1
  114. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
  115. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js → chunk-FN6SB4HU.js} +2 -2
  117. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
  118. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
  119. package/dist/cli-bundle/chunks/{chunk-EKFNL33R.js → chunk-GLS6VMWI.js} +37 -16
  120. package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
  121. package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js → chunk-GPIDUMMN.js} +9 -11
  122. package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js.map → chunk-GPIDUMMN.js.map} +1 -1
  123. package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js → chunk-GTM5HQL4.js} +11 -15
  124. package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js.map → chunk-GTM5HQL4.js.map} +1 -1
  125. package/dist/cli-bundle/chunks/{chunk-24YG75HI.js → chunk-H2SMKL2N.js} +8 -8
  126. package/dist/cli-bundle/chunks/{chunk-QLMX7SRD.js → chunk-HHEWQXPD.js} +6 -6
  127. package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js → chunk-HX6QXV5P.js} +2 -2
  129. package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js → chunk-I74FMIWA.js} +10 -16
  130. package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js.map → chunk-I74FMIWA.js.map} +1 -1
  131. package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js → chunk-IDIBF4E2.js} +20 -24
  132. package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js.map → chunk-IDIBF4E2.js.map} +1 -1
  133. package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js → chunk-II7R6KD4.js} +8 -7
  134. package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js.map → chunk-II7R6KD4.js.map} +1 -1
  135. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
  136. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
  137. package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js → chunk-J7BOLHAV.js} +5 -7
  138. package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js.map → chunk-J7BOLHAV.js.map} +1 -1
  139. package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js → chunk-KTGJ2CBU.js} +4 -6
  140. package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js.map → chunk-KTGJ2CBU.js.map} +1 -1
  141. package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js → chunk-LCFJ7XAM.js} +22 -2
  142. package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js.map → chunk-LCFJ7XAM.js.map} +3 -3
  143. package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js → chunk-LZQU6XJG.js} +28 -34
  144. package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js.map → chunk-LZQU6XJG.js.map} +1 -1
  145. package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js → chunk-M62RO3XK.js} +10 -14
  146. package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js.map → chunk-M62RO3XK.js.map} +1 -1
  147. package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js → chunk-MCEUKJKW.js} +12 -14
  148. package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js.map → chunk-MCEUKJKW.js.map} +1 -1
  149. package/dist/cli-bundle/chunks/{chunk-TKD5VCTD.js → chunk-MHNMCDWR.js} +343 -195
  150. package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js → chunk-MRFWUSVA.js} +4 -6
  152. package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
  153. package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js → chunk-N6ZHDLUY.js} +6 -8
  154. package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js.map → chunk-N6ZHDLUY.js.map} +1 -1
  155. package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js → chunk-NWWL22C7.js} +7 -9
  156. package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js.map → chunk-NWWL22C7.js.map} +1 -1
  157. package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js → chunk-P3MJJW7P.js} +2 -2
  158. package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js → chunk-PDXJXEZJ.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js → chunk-Q64AYQYW.js} +10 -12
  160. package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js.map → chunk-Q64AYQYW.js.map} +1 -1
  161. package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js → chunk-QDABF2RB.js} +26 -34
  162. package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js.map → chunk-QDABF2RB.js.map} +1 -1
  163. package/dist/cli-bundle/chunks/{chunk-TULGS6X6.js → chunk-QFBSP3NI.js} +529 -46
  164. package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
  165. package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js → chunk-RB3KLPAH.js} +10 -14
  166. package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js.map → chunk-RB3KLPAH.js.map} +1 -1
  167. package/dist/cli-bundle/chunks/{chunk-3VHSI5FL.js → chunk-RY7PTTUB.js} +94 -53
  168. package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
  169. package/dist/cli-bundle/chunks/{chunk-COSPOP7H.js → chunk-S547WBYG.js} +343 -195
  170. package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
  171. package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js → chunk-S5BNGFN5.js} +24 -32
  172. package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js.map → chunk-S5BNGFN5.js.map} +1 -1
  173. package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js → chunk-S6VC2A2K.js} +8 -12
  174. package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js.map → chunk-S6VC2A2K.js.map} +1 -1
  175. package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js → chunk-SIM5JDON.js} +6 -6
  176. package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js.map → chunk-SIM5JDON.js.map} +1 -1
  177. package/dist/cli-bundle/chunks/{chunk-VPIM42PC.js → chunk-SY75LYXR.js} +11 -7
  178. package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
  179. package/dist/cli-bundle/chunks/{chunk-K46RF36U.js → chunk-TEISGNSH.js} +7 -7
  180. package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
  181. package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js → chunk-TEKZOS7M.js} +2 -2
  182. package/dist/cli-bundle/chunks/{chunk-W572BIEB.js → chunk-TGUK6XN6.js} +14 -18
  183. package/dist/cli-bundle/chunks/{chunk-W572BIEB.js.map → chunk-TGUK6XN6.js.map} +1 -1
  184. package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js → chunk-TNC6MZUD.js} +8 -12
  185. package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js.map → chunk-TNC6MZUD.js.map} +1 -1
  186. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
  187. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
  188. package/dist/cli-bundle/chunks/{chunk-57NWPFF2.js → chunk-UO7XAZK6.js} +17 -4
  189. package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js → chunk-V5ZWKJNY.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js → chunk-VGO73OCK.js} +6 -6
  192. package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js.map → chunk-VGO73OCK.js.map} +1 -1
  193. package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js → chunk-VLEA2UTQ.js} +2 -2
  194. package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js → chunk-W5HXHC7C.js} +7 -9
  195. package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js.map → chunk-W5HXHC7C.js.map} +1 -1
  196. package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js → chunk-WCWVEXGA.js} +2 -2
  197. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
  198. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
  199. package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js → chunk-XBX5CBRQ.js} +5 -7
  200. package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js.map → chunk-XBX5CBRQ.js.map} +1 -1
  201. package/dist/cli-bundle/chunks/{chunk-SCUR7K7N.js → chunk-XC3X7BQR.js} +541 -44
  202. package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
  203. package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js → chunk-XHCVAZGM.js} +13 -17
  204. package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js.map → chunk-XHCVAZGM.js.map} +1 -1
  205. package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js → chunk-XPMXPR7K.js} +7 -9
  206. package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js.map → chunk-XPMXPR7K.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js → chunk-XS2TMNXR.js} +6 -8
  208. package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js.map → chunk-XS2TMNXR.js.map} +1 -1
  209. package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js → chunk-XXIYUTLK.js} +10 -14
  210. package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js.map → chunk-XXIYUTLK.js.map} +1 -1
  211. package/dist/cli-bundle/chunks/{chunk-EOKXK3R3.js → chunk-XZWL7VNE.js} +1220 -398
  212. package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
  213. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
  214. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js → chunk-Y7KYVCZM.js} +12 -18
  216. package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js.map → chunk-Y7KYVCZM.js.map} +1 -1
  217. package/dist/cli-bundle/chunks/{chunk-VIIUS6N6.js → chunk-YCVWWIKY.js} +16 -14
  218. package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
  219. package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js → chunk-YH5NBDFA.js} +22 -26
  220. package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js.map → chunk-YH5NBDFA.js.map} +1 -1
  221. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
  222. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
  223. package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js → chunk-YPD7SQ5P.js} +7 -6
  224. package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js.map → chunk-YPD7SQ5P.js.map} +2 -2
  225. package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js → chunk-YPMZMKN7.js} +2 -2
  226. package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js → chunk-YTD5GICJ.js} +4 -4
  227. package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js → chunk-ZNEG2UDO.js} +261 -34
  228. package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js.map → chunk-ZNEG2UDO.js.map} +4 -4
  229. package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js → chunk-ZO7CLOY2.js} +3 -3
  230. package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js → close-3YYQ5OG2.js} +5 -9
  231. package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
  232. package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
  233. package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
  234. package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
  235. package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
  236. package/dist/cli-bundle/chunks/{copy-32ROBIDL.js → copy-44RT5GDW.js} +4 -8
  237. package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
  238. package/dist/cli-bundle/chunks/{create-E77SDCUP.js → create-4GWJWPXG.js} +9 -14
  239. package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
  240. package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
  241. package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js → delete-YQ2VPXNF.js} +4 -8
  242. package/dist/cli-bundle/chunks/{deps-32SU7HO5.js → deps-BU5EBJDU.js} +4 -8
  243. package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
  244. package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js → docs-OQBSJNIA.js} +6 -10
  245. package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
  246. package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
  247. package/dist/cli-bundle/chunks/{files-PYKR2UUG.js → files-HTSB2KJG.js} +6 -10
  248. package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js → focus-FOG4ALC2.js} +7 -9
  249. package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
  250. package/dist/cli-bundle/chunks/{history-compact-3MNXLKAT.js → history-compact-M6IFAMBP.js} +9 -13
  251. package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
  252. package/dist/cli-bundle/chunks/{history-redact-P6DYF55G.js → history-redact-NQX3OGZP.js} +7 -11
  253. package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
  254. package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
  255. package/dist/cli-bundle/chunks/{history-repair-ZJQFMWPD.js → history-repair-NHOJG7WO.js} +9 -13
  256. package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
  257. package/dist/cli-bundle/chunks/{append-BGML6VLD.js → learnings-T63JGKKN.js} +9 -11
  258. package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
  259. package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
  260. package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
  261. package/dist/cli-bundle/chunks/{plan-CHVE7PBR.js → plan-TN537L24.js} +10 -15
  262. package/dist/cli-bundle/chunks/{profile-ZXGSKBJD.js → profile-MHAMXMHQ.js} +9 -13
  263. package/dist/cli-bundle/chunks/{profile-LD23PSI6.js → profile-TIGLAKJ7.js} +9 -13
  264. package/dist/cli-bundle/chunks/{register-list-query-OEYQHFXO.js → register-list-query-OHXD7G5N.js} +41 -33
  265. package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{register-list-query-B42JCCOI.js → register-list-query-ZCRABAPN.js} +42 -34
  267. package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
  268. package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js → register-mutation-P3G4XP6Q.js} +36 -41
  269. package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
  270. package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js → register-mutation-XX4H56PE.js} +34 -39
  271. package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js.map → register-mutation-XX4H56PE.js.map} +1 -1
  272. package/dist/cli-bundle/chunks/{chunk-5BMM6XQY.js → register-operations-V6PIYEDU.js} +79 -46
  273. package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{chunk-Z3U3U5KD.js → register-operations-V6VKTG54.js} +78 -45
  275. package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
  276. package/dist/cli-bundle/chunks/{register-setup-3ZVVX2VN.js → register-setup-6RVAWT6W.js} +129 -29
  277. package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
  278. package/dist/cli-bundle/chunks/{register-setup-Q6KFNIOZ.js → register-setup-6YVUSQYD.js} +130 -30
  279. package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
  280. package/dist/cli-bundle/chunks/{restore-5RQHAPMA.js → restore-HC3YSWF7.js} +7 -11
  281. package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
  282. package/dist/cli-bundle/chunks/{schema-HBORFC6B.js → schema-DAGSYO6E.js} +6 -10
  283. package/dist/cli-bundle/chunks/{schema-245WW4G2.js → schema-UBXJCQAC.js} +6 -10
  284. package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
  285. package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
  286. package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
  287. package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
  288. package/dist/cli-bundle/main.js +29 -31
  289. package/dist/cli-bundle/main.js.map +2 -2
  290. package/dist/cli-bundle/sdk-runtime.js +129 -107
  291. package/dist/cli-bundle/sdk-testing.js +7 -8
  292. package/dist/cli-bundle/sdk.js +122 -117
  293. package/dist/cli-bundle/sdk.js.map +2 -2
  294. package/dist/core/history/drift-scan.js +3 -8
  295. package/dist/core/history/drift-scan.js.map +1 -1
  296. package/dist/core/output/mutation-projection.js +11 -5
  297. package/dist/core/output/mutation-projection.js.map +1 -1
  298. package/dist/core/search/cache.js +3 -3
  299. package/dist/core/search/cache.js.map +1 -1
  300. package/dist/core/search/semantic-defaults.d.ts +2 -0
  301. package/dist/core/search/semantic-defaults.js +11 -4
  302. package/dist/core/search/semantic-defaults.js.map +1 -1
  303. package/dist/core/search/vector-stores.d.ts +1 -1
  304. package/dist/core/search/vector-stores.js +33 -7
  305. package/dist/core/search/vector-stores.js.map +1 -1
  306. package/dist/mcp/server.d.ts +1 -1
  307. package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
  308. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  309. package/dist/sdk/cli-contracts/tool-schema.js +9 -7
  310. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  311. package/dist/sdk/index.d.ts +1 -1
  312. package/dist/sdk/index.js +3 -3
  313. package/dist/sdk/index.js.map +1 -1
  314. package/dist/sdk/runtime.d.ts +151 -8
  315. package/dist/sdk/runtime.js +255 -14
  316. package/dist/sdk/runtime.js.map +1 -1
  317. package/dist/sdk/start-task-status.d.ts +13 -0
  318. package/dist/sdk/start-task-status.js +19 -0
  319. package/dist/sdk/start-task-status.js.map +1 -0
  320. package/docs/COMMANDS.md +10 -1
  321. package/docs/SDK.md +35 -0
  322. package/docs/TESTING.md +3 -0
  323. package/package.json +1 -1
  324. package/dist/cli-bundle/chunks/activity-WJCGCYPU.js +0 -18
  325. package/dist/cli-bundle/chunks/activity-Z6QUAUSG.js +0 -22
  326. package/dist/cli-bundle/chunks/aggregate-BDM6EIAR.js +0 -25
  327. package/dist/cli-bundle/chunks/aggregate-VQ2DHU3S.js +0 -21
  328. package/dist/cli-bundle/chunks/append-RKJYPU74.js +0 -15
  329. package/dist/cli-bundle/chunks/chunk-2XG4IZON.js +0 -218
  330. package/dist/cli-bundle/chunks/chunk-2XG4IZON.js.map +0 -7
  331. package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
  332. package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
  333. package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js +0 -228
  334. package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js +0 -2330
  336. package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js.map +0 -7
  337. package/dist/cli-bundle/chunks/chunk-3VHSI5FL.js.map +0 -1
  338. package/dist/cli-bundle/chunks/chunk-425E4QL5.js +0 -278
  339. package/dist/cli-bundle/chunks/chunk-425E4QL5.js.map +0 -7
  340. package/dist/cli-bundle/chunks/chunk-46CUF5L6.js.map +0 -7
  341. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
  342. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js +0 -249
  344. package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js.map +0 -7
  345. package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js +0 -819
  346. package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js.map +0 -1
  347. package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js +0 -279
  348. package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js.map +0 -1
  349. package/dist/cli-bundle/chunks/chunk-57NWPFF2.js.map +0 -1
  350. package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js +0 -268
  351. package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js.map +0 -1
  352. package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js +0 -1868
  354. package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js.map +0 -7
  355. package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js +0 -1749
  356. package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js.map +0 -7
  357. package/dist/cli-bundle/chunks/chunk-64YKRTSV.js +0 -1961
  358. package/dist/cli-bundle/chunks/chunk-64YKRTSV.js.map +0 -1
  359. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
  360. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
  361. package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js +0 -421
  362. package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js.map +0 -1
  363. package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js +0 -1985
  364. package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js.map +0 -7
  365. package/dist/cli-bundle/chunks/chunk-CL36D4PC.js.map +0 -7
  366. package/dist/cli-bundle/chunks/chunk-COSPOP7H.js.map +0 -7
  367. package/dist/cli-bundle/chunks/chunk-COWTDV6B.js +0 -3461
  368. package/dist/cli-bundle/chunks/chunk-COWTDV6B.js.map +0 -7
  369. package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js +0 -1858
  370. package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js.map +0 -1
  371. package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js.map +0 -1
  372. package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js +0 -1932
  373. package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js.map +0 -1
  374. package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js.map +0 -1
  375. package/dist/cli-bundle/chunks/chunk-EKFNL33R.js.map +0 -1
  376. package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js +0 -1704
  377. package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js.map +0 -1
  378. package/dist/cli-bundle/chunks/chunk-EOKXK3R3.js.map +0 -1
  379. package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js +0 -231
  380. package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js.map +0 -7
  381. package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js +0 -2090
  382. package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js.map +0 -1
  383. package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js +0 -1570
  384. package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js.map +0 -1
  385. package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js +0 -239
  386. package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js.map +0 -1
  387. package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js +0 -530
  388. package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js.map +0 -7
  389. package/dist/cli-bundle/chunks/chunk-GZRDYONU.js +0 -1005
  390. package/dist/cli-bundle/chunks/chunk-GZRDYONU.js.map +0 -7
  391. package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js +0 -277
  392. package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js.map +0 -7
  393. package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js +0 -309
  394. package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js.map +0 -7
  395. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
  396. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
  397. package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js +0 -2257
  398. package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js.map +0 -7
  399. package/dist/cli-bundle/chunks/chunk-K46RF36U.js.map +0 -1
  400. package/dist/cli-bundle/chunks/chunk-KERMZVY5.js +0 -371
  401. package/dist/cli-bundle/chunks/chunk-KERMZVY5.js.map +0 -7
  402. package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js +0 -76
  403. package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js.map +0 -1
  404. package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js +0 -140
  405. package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js.map +0 -1
  406. package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js +0 -1601
  407. package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js.map +0 -1
  408. package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js +0 -1031
  409. package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js.map +0 -1
  410. package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js +0 -995
  411. package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js.map +0 -1
  412. package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js +0 -296
  413. package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js.map +0 -1
  414. package/dist/cli-bundle/chunks/chunk-MLIYFOE7.js.map +0 -1
  415. package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js +0 -2043
  416. package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js.map +0 -7
  417. package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js +0 -2033
  418. package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js.map +0 -1
  419. package/dist/cli-bundle/chunks/chunk-N745W3B3.js +0 -1604
  420. package/dist/cli-bundle/chunks/chunk-N745W3B3.js.map +0 -7
  421. package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js +0 -1615
  422. package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js.map +0 -7
  423. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
  424. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
  425. package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js +0 -143
  426. package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js.map +0 -7
  427. package/dist/cli-bundle/chunks/chunk-QLMX7SRD.js.map +0 -7
  428. package/dist/cli-bundle/chunks/chunk-QX6HM775.js +0 -398
  429. package/dist/cli-bundle/chunks/chunk-QX6HM775.js.map +0 -7
  430. package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
  431. package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
  432. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
  433. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
  434. package/dist/cli-bundle/chunks/chunk-RFNYTESG.js +0 -520
  435. package/dist/cli-bundle/chunks/chunk-RFNYTESG.js.map +0 -1
  436. package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js +0 -79
  437. package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js.map +0 -7
  438. package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js +0 -282
  439. package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js.map +0 -7
  440. package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js +0 -274
  441. package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js.map +0 -1
  442. package/dist/cli-bundle/chunks/chunk-SCUR7K7N.js.map +0 -7
  443. package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js +0 -1977
  444. package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js +0 -1041
  446. package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-T42JWV3F.js +0 -822
  448. package/dist/cli-bundle/chunks/chunk-T42JWV3F.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-TULGS6X6.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js +0 -2306
  452. package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js.map +0 -7
  454. package/dist/cli-bundle/chunks/chunk-VPIM42PC.js.map +0 -7
  455. package/dist/cli-bundle/chunks/chunk-VQRSPVME.js +0 -368
  456. package/dist/cli-bundle/chunks/chunk-VQRSPVME.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
  458. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
  459. package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js +0 -3423
  460. package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-WLSM645P.js +0 -2247
  462. package/dist/cli-bundle/chunks/chunk-WLSM645P.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-WRTENIX3.js +0 -215
  464. package/dist/cli-bundle/chunks/chunk-WRTENIX3.js.map +0 -1
  465. package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js +0 -388
  466. package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js.map +0 -1
  467. package/dist/cli-bundle/chunks/chunk-XC5BURG2.js +0 -306
  468. package/dist/cli-bundle/chunks/chunk-XC5BURG2.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js +0 -424
  470. package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js +0 -2128
  472. package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js.map +0 -7
  473. package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js.map +0 -7
  474. package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js +0 -299
  475. package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js.map +0 -7
  476. package/dist/cli-bundle/chunks/chunk-ZSUS2OD3.js.map +0 -7
  477. package/dist/cli-bundle/chunks/claim-RFS7BROJ.js +0 -19
  478. package/dist/cli-bundle/chunks/claim-XP5AWZ5H.js +0 -23
  479. package/dist/cli-bundle/chunks/close-GEANHQ2J.js +0 -16
  480. package/dist/cli-bundle/chunks/close-many-CMZW7ITN.js +0 -31
  481. package/dist/cli-bundle/chunks/close-many-ZFDIG6M7.js +0 -27
  482. package/dist/cli-bundle/chunks/comments-MFSYVNNU.js +0 -21
  483. package/dist/cli-bundle/chunks/comments-XUBPXDYX.js +0 -17
  484. package/dist/cli-bundle/chunks/config-D7XQMONX.js +0 -18
  485. package/dist/cli-bundle/chunks/config-T4FHBSYN.js +0 -22
  486. package/dist/cli-bundle/chunks/context-DIU275XI.js +0 -48
  487. package/dist/cli-bundle/chunks/context-JCOYB4LZ.js +0 -44
  488. package/dist/cli-bundle/chunks/contracts-BVO7CSLK.js +0 -12
  489. package/dist/cli-bundle/chunks/copy-NAGLGMHZ.js +0 -13
  490. package/dist/cli-bundle/chunks/create-4V7SWNBB.js +0 -30
  491. package/dist/cli-bundle/chunks/delete-NQI5OSKN.js +0 -14
  492. package/dist/cli-bundle/chunks/deps-T7SCWXEX.js +0 -17
  493. package/dist/cli-bundle/chunks/docs-WL2IWGWV.js +0 -18
  494. package/dist/cli-bundle/chunks/eval-NF2J5SHR.js +0 -23
  495. package/dist/cli-bundle/chunks/eval-SKDT3MZU.js +0 -27
  496. package/dist/cli-bundle/chunks/extension-LAXKCAYE.js +0 -42
  497. package/dist/cli-bundle/chunks/extension-ZISPBRBC.js +0 -38
  498. package/dist/cli-bundle/chunks/files-EWRQHGIS.js +0 -22
  499. package/dist/cli-bundle/chunks/focus-4T7TM4MT.js +0 -18
  500. package/dist/cli-bundle/chunks/focus-L3YUASOD.js +0 -14
  501. package/dist/cli-bundle/chunks/gc-2PCTYYRI.js +0 -12
  502. package/dist/cli-bundle/chunks/get-7DMITJ3G.js +0 -23
  503. package/dist/cli-bundle/chunks/get-VKQXCXLL.js +0 -19
  504. package/dist/cli-bundle/chunks/health-CVSTAR2F.js +0 -31
  505. package/dist/cli-bundle/chunks/health-TV3GKTFN.js +0 -35
  506. package/dist/cli-bundle/chunks/history-D4JUX5XV.js +0 -20
  507. package/dist/cli-bundle/chunks/history-D4JUX5XV.js.map +0 -7
  508. package/dist/cli-bundle/chunks/history-LQ2UWZTE.js +0 -24
  509. package/dist/cli-bundle/chunks/history-LQ2UWZTE.js.map +0 -1
  510. package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js.map +0 -1
  511. package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js +0 -25
  512. package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js.map +0 -7
  513. package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js +0 -21
  514. package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js.map +0 -7
  515. package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js.map +0 -1
  516. package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js +0 -23
  517. package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js.map +0 -7
  518. package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js.map +0 -1
  519. package/dist/cli-bundle/chunks/init-C3LJPWQZ.js +0 -30
  520. package/dist/cli-bundle/chunks/init-C3LJPWQZ.js.map +0 -1
  521. package/dist/cli-bundle/chunks/init-J3DPGWQI.js +0 -26
  522. package/dist/cli-bundle/chunks/init-J3DPGWQI.js.map +0 -7
  523. package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js +0 -21
  524. package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js.map +0 -1
  525. package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js +0 -17
  526. package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js.map +0 -7
  527. package/dist/cli-bundle/chunks/list-O5NZVSPN.js +0 -36
  528. package/dist/cli-bundle/chunks/list-O5NZVSPN.js.map +0 -1
  529. package/dist/cli-bundle/chunks/list-Z55YCNTC.js +0 -32
  530. package/dist/cli-bundle/chunks/list-Z55YCNTC.js.map +0 -7
  531. package/dist/cli-bundle/chunks/next-GBNTGXFC.js +0 -28
  532. package/dist/cli-bundle/chunks/next-GBNTGXFC.js.map +0 -7
  533. package/dist/cli-bundle/chunks/next-QKW7PTKE.js +0 -32
  534. package/dist/cli-bundle/chunks/next-QKW7PTKE.js.map +0 -1
  535. package/dist/cli-bundle/chunks/notes-R5FZTKWF.js +0 -17
  536. package/dist/cli-bundle/chunks/notes-R5FZTKWF.js.map +0 -7
  537. package/dist/cli-bundle/chunks/notes-WCGIULVG.js +0 -21
  538. package/dist/cli-bundle/chunks/notes-WCGIULVG.js.map +0 -1
  539. package/dist/cli-bundle/chunks/plan-ADISFYH4.js +0 -29
  540. package/dist/cli-bundle/chunks/plan-ADISFYH4.js.map +0 -7
  541. package/dist/cli-bundle/chunks/plan-CHVE7PBR.js.map +0 -1
  542. package/dist/cli-bundle/chunks/profile-LD23PSI6.js.map +0 -7
  543. package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js.map +0 -1
  544. package/dist/cli-bundle/chunks/register-list-query-B42JCCOI.js.map +0 -1
  545. package/dist/cli-bundle/chunks/register-list-query-OEYQHFXO.js.map +0 -7
  546. package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js +0 -19
  547. package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js.map +0 -7
  548. package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js +0 -23
  549. package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js.map +0 -1
  550. package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js.map +0 -7
  551. package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js.map +0 -1
  552. package/dist/cli-bundle/chunks/restore-5RQHAPMA.js.map +0 -1
  553. package/dist/cli-bundle/chunks/restore-PNEIBBLW.js +0 -19
  554. package/dist/cli-bundle/chunks/restore-PNEIBBLW.js.map +0 -7
  555. package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js +0 -29
  556. package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js.map +0 -1
  557. package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js +0 -25
  558. package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js.map +0 -7
  559. package/dist/cli-bundle/chunks/schema-245WW4G2.js.map +0 -1
  560. package/dist/cli-bundle/chunks/schema-HBORFC6B.js.map +0 -7
  561. package/dist/cli-bundle/chunks/search-AOZC5SIK.js +0 -34
  562. package/dist/cli-bundle/chunks/search-AOZC5SIK.js.map +0 -7
  563. package/dist/cli-bundle/chunks/search-DRXPGHD7.js +0 -38
  564. package/dist/cli-bundle/chunks/search-DRXPGHD7.js.map +0 -1
  565. package/dist/cli-bundle/chunks/stats-NJG4NLHG.js +0 -21
  566. package/dist/cli-bundle/chunks/stats-NJG4NLHG.js.map +0 -1
  567. package/dist/cli-bundle/chunks/stats-RG6AG4N2.js +0 -17
  568. package/dist/cli-bundle/chunks/stats-RG6AG4N2.js.map +0 -7
  569. package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js +0 -14
  570. package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js.map +0 -7
  571. package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js +0 -18
  572. package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js.map +0 -1
  573. package/dist/cli-bundle/chunks/test-6CMOCWUC.js +0 -39
  574. package/dist/cli-bundle/chunks/test-6CMOCWUC.js.map +0 -7
  575. package/dist/cli-bundle/chunks/test-RI7XHBZL.js +0 -43
  576. package/dist/cli-bundle/chunks/test-RI7XHBZL.js.map +0 -1
  577. package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js +0 -29
  578. package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js.map +0 -7
  579. package/dist/cli-bundle/chunks/test-all-QEIORFYW.js +0 -33
  580. package/dist/cli-bundle/chunks/test-all-QEIORFYW.js.map +0 -1
  581. package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js +0 -28
  582. package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js.map +0 -1
  583. package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js +0 -24
  584. package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js.map +0 -7
  585. package/dist/cli-bundle/chunks/update-QVJDFEAP.js +0 -30
  586. package/dist/cli-bundle/chunks/update-QVJDFEAP.js.map +0 -1
  587. package/dist/cli-bundle/chunks/update-VQVHAY6X.js +0 -26
  588. package/dist/cli-bundle/chunks/update-VQVHAY6X.js.map +0 -7
  589. package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js +0 -37
  590. package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js.map +0 -7
  591. package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js +0 -41
  592. package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js.map +0 -1
  593. package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js +0 -24
  594. package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js.map +0 -7
  595. package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js +0 -28
  596. package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js.map +0 -1
  597. package/dist/cli-bundle/chunks/validate-4NTXSB62.js +0 -36
  598. package/dist/cli-bundle/chunks/validate-4NTXSB62.js.map +0 -1
  599. package/dist/cli-bundle/chunks/validate-MUFXQZMI.js +0 -32
  600. package/dist/cli-bundle/chunks/validate-MUFXQZMI.js.map +0 -7
  601. /package/dist/cli-bundle/chunks/{activity-WJCGCYPU.js.map → append-F7WPGIQL.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{activity-Z6QUAUSG.js.map → append-PVCTBVJG.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js.map → chunk-2LEJGRQ7.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js.map → chunk-2TILG6F2.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js.map → chunk-3TYOW6RR.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js.map → chunk-3X542TEY.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js.map → chunk-7VQ3JJN5.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js.map → chunk-AGAVEDIE.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js.map → chunk-AJUON7E6.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js.map → chunk-DR2V5OIV.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{chunk-XG625QP4.js.map → chunk-EDO7VXSO.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js.map → chunk-EVEPHNXJ.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js.map → chunk-FN6SB4HU.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{chunk-24YG75HI.js.map → chunk-H2SMKL2N.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js.map → chunk-HX6QXV5P.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js.map → chunk-P3MJJW7P.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js.map → chunk-PDXJXEZJ.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js.map → chunk-TEKZOS7M.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js.map → chunk-V5ZWKJNY.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js.map → chunk-VLEA2UTQ.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js.map → chunk-WCWVEXGA.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js.map → chunk-YPMZMKN7.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js.map → chunk-YTD5GICJ.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js.map → chunk-ZO7CLOY2.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{aggregate-BDM6EIAR.js.map → close-3YYQ5OG2.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{aggregate-VQ2DHU3S.js.map → close-Z3Q4U7TS.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{append-RKJYPU74.js.map → close-many-3L2RXH3M.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{append-BGML6VLD.js.map → close-many-D366FTIG.js.map} +0 -0
  629. /package/dist/cli-bundle/chunks/{claim-XP5AWZ5H.js.map → comments-54XDJNFE.js.map} +0 -0
  630. /package/dist/cli-bundle/chunks/{claim-RFS7BROJ.js.map → comments-HGHC2PN6.js.map} +0 -0
  631. /package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js.map → copy-44RT5GDW.js.map} +0 -0
  632. /package/dist/cli-bundle/chunks/{close-GEANHQ2J.js.map → copy-UGMUGHZA.js.map} +0 -0
  633. /package/dist/cli-bundle/chunks/{close-many-CMZW7ITN.js.map → create-4GWJWPXG.js.map} +0 -0
  634. /package/dist/cli-bundle/chunks/{close-many-ZFDIG6M7.js.map → create-AZXCUYKP.js.map} +0 -0
  635. /package/dist/cli-bundle/chunks/{comments-XUBPXDYX.js.map → delete-Y6SXIQ4X.js.map} +0 -0
  636. /package/dist/cli-bundle/chunks/{comments-MFSYVNNU.js.map → delete-YQ2VPXNF.js.map} +0 -0
  637. /package/dist/cli-bundle/chunks/{config-T4FHBSYN.js.map → deps-BU5EBJDU.js.map} +0 -0
  638. /package/dist/cli-bundle/chunks/{config-D7XQMONX.js.map → deps-FMANWFRP.js.map} +0 -0
  639. /package/dist/cli-bundle/chunks/{context-DIU275XI.js.map → docs-OQBSJNIA.js.map} +0 -0
  640. /package/dist/cli-bundle/chunks/{context-JCOYB4LZ.js.map → docs-VNPBZXEL.js.map} +0 -0
  641. /package/dist/cli-bundle/chunks/{contracts-BVO7CSLK.js.map → files-72HZEBOE.js.map} +0 -0
  642. /package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js.map → files-HTSB2KJG.js.map} +0 -0
  643. /package/dist/cli-bundle/chunks/{copy-32ROBIDL.js.map → focus-FOG4ALC2.js.map} +0 -0
  644. /package/dist/cli-bundle/chunks/{copy-NAGLGMHZ.js.map → focus-SUTMKXGX.js.map} +0 -0
  645. /package/dist/cli-bundle/chunks/{create-E77SDCUP.js.map → history-compact-M6IFAMBP.js.map} +0 -0
  646. /package/dist/cli-bundle/chunks/{create-4V7SWNBB.js.map → history-compact-NEXRPP2O.js.map} +0 -0
  647. /package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js.map → history-redact-NQX3OGZP.js.map} +0 -0
  648. /package/dist/cli-bundle/chunks/{delete-NQI5OSKN.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
  649. /package/dist/cli-bundle/chunks/{deps-T7SCWXEX.js.map → history-repair-CBHMHAJO.js.map} +0 -0
  650. /package/dist/cli-bundle/chunks/{deps-32SU7HO5.js.map → history-repair-NHOJG7WO.js.map} +0 -0
  651. /package/dist/cli-bundle/chunks/{docs-WL2IWGWV.js.map → learnings-M64NTSOR.js.map} +0 -0
  652. /package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js.map → learnings-T63JGKKN.js.map} +0 -0
  653. /package/dist/cli-bundle/chunks/{eval-NF2J5SHR.js.map → notes-73WE2UV2.js.map} +0 -0
  654. /package/dist/cli-bundle/chunks/{eval-SKDT3MZU.js.map → notes-U7L6HQQ2.js.map} +0 -0
  655. /package/dist/cli-bundle/chunks/{extension-ZISPBRBC.js.map → plan-OSCNYFGC.js.map} +0 -0
  656. /package/dist/cli-bundle/chunks/{extension-LAXKCAYE.js.map → plan-TN537L24.js.map} +0 -0
  657. /package/dist/cli-bundle/chunks/{files-PYKR2UUG.js.map → profile-MHAMXMHQ.js.map} +0 -0
  658. /package/dist/cli-bundle/chunks/{files-EWRQHGIS.js.map → profile-TIGLAKJ7.js.map} +0 -0
  659. /package/dist/cli-bundle/chunks/{focus-4T7TM4MT.js.map → restore-HC3YSWF7.js.map} +0 -0
  660. /package/dist/cli-bundle/chunks/{focus-L3YUASOD.js.map → restore-LFAMMRYZ.js.map} +0 -0
  661. /package/dist/cli-bundle/chunks/{gc-2PCTYYRI.js.map → schema-DAGSYO6E.js.map} +0 -0
  662. /package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js.map → schema-UBXJCQAC.js.map} +0 -0
  663. /package/dist/cli-bundle/chunks/{get-VKQXCXLL.js.map → update-CJGG5WMV.js.map} +0 -0
  664. /package/dist/cli-bundle/chunks/{get-7DMITJ3G.js.map → update-LKD64AFP.js.map} +0 -0
  665. /package/dist/cli-bundle/chunks/{health-CVSTAR2F.js.map → update-many-G4SM7BHC.js.map} +0 -0
  666. /package/dist/cli-bundle/chunks/{health-TV3GKTFN.js.map → update-many-VLIV3D7R.js.map} +0 -0
@@ -1,15 +1,13 @@
1
1
  import {
2
2
  normalizeAddTypeInput
3
- } from "./chunk-NGXQ3PFT.js";
4
- import {
5
- evictOldestMemoEntries
6
- } from "./chunk-7C2O74AE.js";
3
+ } from "./chunk-YPMZMKN7.js";
7
4
  import {
8
5
  DEFAULT_RUNTIME_STATUS_DEFINITIONS,
9
6
  RUNTIME_FIELD_COMMAND_VALUES,
10
7
  RUNTIME_FIELD_TYPE_VALUES,
11
- RUNTIME_STATUS_ROLE_VALUES
12
- } from "./chunk-LK6XLOGP.js";
8
+ RUNTIME_STATUS_ROLE_VALUES,
9
+ evictOldestMemoEntries
10
+ } from "./chunk-LCFJ7XAM.js";
13
11
 
14
12
  // dist/core/schema/status-defs-file.js
15
13
  !(function() {
@@ -547,4 +545,4 @@ export {
547
545
  normalizeTypePresetName,
548
546
  resolveTypePresetDefinitions
549
547
  };
550
- //# sourceMappingURL=chunk-FT3QTERD.js.map
548
+ //# sourceMappingURL=chunk-J7BOLHAV.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../core/schema/status-defs-file.ts", "../../../../../../../../core/schema/fields-file.ts", "../../../../../../../../core/schema/type-presets.ts"],
4
4
  "sourcesContent": ["/**\n * @module core/schema/status-defs-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Status Defs File.\n */\nimport { RUNTIME_STATUS_ROLE_VALUES } from \"../../types/index.js\";\nimport type { RuntimeStatusDefinition, RuntimeStatusRole } from \"../../types/index.js\";\nimport { DEFAULT_RUNTIME_STATUS_DEFINITIONS } from \"./runtime-schema.js\";\nimport { evictOldestMemoEntries } from \"../shared/memo.js\";\n\nexport type { RuntimeStatusDefinition, RuntimeStatusRole } from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-status` / `pm schema remove-status`\n * commands. The CLI command file (schema.ts) owns IO/governance; everything\n * testable and side-effect-free lives here so it can be coverage-gated to 100%.\n *\n * Statuses persist at `.agents/pm/schema/statuses.json` under the shape\n * `{ statuses: RuntimeStatusDefinition[] }`. When the file is absent the runtime\n * merge layer (src/core/store/settings.ts) still supplies the built-in defaults\n * from DEFAULT_RUNTIME_STATUS_DEFINITIONS, so this module never duplicates them\n * into the persisted file.\n */\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\n\n/**\n * Memo for {@link normalizeStatusToken}. Status ranking inside sort comparators\n * normalizes the same handful of status strings O(n log n) times per corpus scan, and\n * the trim/lowercase/regex pipeline shows up in list/next/context profiles. The cap\n * bounds memory in long-lived hosts against unbounded arbitrary inputs; half-eviction keeps the\n * newest-inserted half when the cap is hit. Declared before\n * BUILTIN_STATUS_IDS, whose module-level initializer already normalizes tokens.\n */\nconst STATUS_TOKEN_MEMO_MAX_ENTRIES = 2_000;\nconst statusTokenMemo = new Map<string, string>();\n\n/**\n * The 5 lifecycle status ids that ship as built-in defaults and may never be\n * removed (their normalized ids match DEFAULT_RUNTIME_STATUS_DEFINITIONS:\n * open/in_progress/blocked/closed/canceled). `draft` is also a default but the\n * acceptance criteria enumerate the 5 terminal/active ids explicitly, so the\n * guard derives the full set from the canonical defaults to stay in sync.\n */\nexport const BUILTIN_STATUS_IDS: ReadonlySet<string> = new Set(\n DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) => normalizeStatusToken(definition.id)).filter(\n (id) => id.length > 0,\n ),\n);\n\n/**\n * The shape persisted at `.agents/pm/schema/statuses.json`.\n */\nexport interface StatusDefsFile {\n statuses: RuntimeStatusDefinition[];\n}\n\n/**\n * Documents the raw add status input payload exchanged by command, SDK, and package integrations.\n */\nexport interface RawAddStatusInput {\n id: string | undefined;\n roles?: string[];\n aliases?: string[];\n description?: string;\n order?: number;\n}\n\n/**\n * Documents the normalized add status input payload exchanged by command, SDK, and package integrations.\n */\nexport interface NormalizedAddStatusInput {\n id: string;\n /**\n * Normalized roles, or `undefined` when the raw input did not supply a roles\n * field at all. `undefined` means \"leave existing roles untouched\" on upsert;\n * an explicit empty array means \"clear roles\". This distinction is what keeps\n * `add-status review --description x` from wiping a previously-set role.\n */\n roles?: RuntimeStatusRole[];\n /** Same omitted-vs-explicit-empty semantics as `roles`. */\n aliases?: string[];\n description?: string;\n order?: number;\n}\n\n/**\n * Documents the upsert status def result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpsertStatusDefResult {\n file: StatusDefsFile;\n /** The definition as stored after the upsert (existing fields preserved). */\n definition: RuntimeStatusDefinition;\n /** True when an existing definition with the same (normalized) id was replaced. */\n replaced: boolean;\n}\n\n/**\n * Documents the remove status def result payload exchanged by command, SDK, and package integrations.\n */\nexport interface RemoveStatusDefResult {\n file: StatusDefsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested id. */\n definition?: RuntimeStatusDefinition;\n}\n\n/**\n * Normalizes a status token using the same rules as runtime-schema.ts: lowercase\n * and collapse any run of whitespace/hyphens into a single underscore.\n */\nexport function normalizeStatusToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const memoized = statusTokenMemo.get(value);\n if (memoized !== undefined) {\n return memoized;\n }\n const normalized = value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\");\n if (statusTokenMemo.size >= STATUS_TOKEN_MEMO_MAX_ENTRIES) {\n evictOldestMemoEntries(statusTokenMemo);\n }\n statusTokenMemo.set(value, normalized);\n return normalized;\n}\n\nfunction dedupeTokens(values: Iterable<string>): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeStatusToken(value);\n if (token.length > 0) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-status CLI input. Throws a plain Error with a\n * stable message when the id is missing/empty or a role is not one of\n * RUNTIME_STATUS_ROLE_VALUES; the CLI layer maps these to PmCliError exit codes.\n *\n * Omitted vs explicit-empty is preserved end-to-end: when `raw.roles`/`raw.aliases`\n * is `undefined` (flag not supplied) the normalized field is `undefined` so the\n * upsert leaves the existing value untouched; when supplied (even an empty array)\n * the field is normalized to an array so the upsert can apply an explicit clear.\n */\nexport function normalizeAddStatusInput(raw: RawAddStatusInput): NormalizedAddStatusInput {\n const id = normalizeStatusToken(raw.id);\n if (id.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n // Built-in lifecycle statuses are reserved and cannot be overridden: an\n // add-status override would change reserved metadata yet remove-status refuses\n // to delete a built-in id, leaving no CLI path to undo it. Reject up front,\n // symmetric with removeStatusDef.\n if (BUILTIN_STATUS_IDS.has(id)) {\n throw new Error(\n `Cannot add-status the built-in status \"${id}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n let roles: RuntimeStatusRole[] | undefined;\n if (raw.roles !== undefined) {\n roles = [];\n const seenRoles = new Set<string>();\n for (const rawRole of raw.roles) {\n const role = typeof rawRole === \"string\" ? rawRole.trim().toLowerCase() : \"\";\n if (role.length === 0) {\n continue;\n }\n if (!RUNTIME_STATUS_ROLE_SET.has(role)) {\n throw new Error(\n `Invalid status role \"${rawRole}\". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n );\n }\n if (!seenRoles.has(role)) {\n seenRoles.add(role);\n roles.push(role as RuntimeStatusRole);\n }\n }\n }\n const aliases =\n raw.aliases === undefined ? undefined : dedupeTokens(raw.aliases).filter((alias) => alias !== id);\n const description = raw.description?.trim();\n const order =\n typeof raw.order === \"number\" && Number.isFinite(raw.order) ? Math.trunc(raw.order) : undefined;\n return {\n id,\n roles,\n aliases,\n description: description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction selectStatusesArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.statuses)) {\n return record.statuses;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractStatusDefinitions(parsed: unknown): RuntimeStatusDefinition[] {\n const candidate = selectStatusesArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeStatusDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.id !== \"string\" || record.id.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeStatusDefinition);\n }\n return definitions;\n}\n\n/**\n * Coerces an arbitrary parsed value from statuses.json into a StatusDefsFile.\n * Accepts the canonical `{ statuses: [...] }` shape, a bare array of\n * definitions, or a `{ definitions: [...] }` form, and tolerates a\n * missing/invalid file by returning an empty statuses list.\n */\nexport function parseStatusDefsFile(raw: string | null | undefined): StatusDefsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { statuses: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/statuses.json contains invalid JSON.\");\n }\n return { statuses: extractStatusDefinitions(parsed) };\n}\n\n/**\n * Serializes the status definitions file with a trailing newline (matches the\n * rest of the schema scaffold files written by pm).\n */\nexport function serializeStatusDefsFile(file: StatusDefsFile): string {\n return `${JSON.stringify({ statuses: file.statuses }, null, 2)}\\n`;\n}\n\n/**\n * Idempotent UPSERT of a status definition into the parsed file. Matching is by\n * normalized id. When a definition already exists, fields supplied in `input`\n * override the previous values (roles/aliases replace when a non-empty array is\n * given, clear when an explicit empty array is given, and are left UNTOUCHED\n * when the field is `undefined` — i.e. the add-status flag was omitted);\n * description/order override when provided. Fields not addressed by add-status\n * flags are preserved untouched, so `add-status <id> --description x` keeps any\n * previously-set roles/aliases.\n */\nexport function upsertStatusDef(\n file: StatusDefsFile,\n input: NormalizedAddStatusInput,\n baseDefinition?: RuntimeStatusDefinition,\n): UpsertStatusDefResult {\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === input.id,\n );\n // A file-backed definition is the primary seed; when the status is not yet in\n // statuses.json fall back to `baseDefinition` (the resolved settings-backed\n // definition) so omitting --role/--alias preserves metadata that lives in\n // settings.schema.statuses rather than the file.\n const existing = existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;\n\n const next: RuntimeStatusDefinition = {\n ...existing,\n id: input.id,\n };\n if (input.roles !== undefined) {\n if (input.roles.length > 0) {\n next.roles = [...input.roles];\n } else if (next.roles !== undefined) {\n delete next.roles;\n }\n }\n if (input.aliases !== undefined) {\n if (input.aliases.length > 0) {\n next.aliases = [...input.aliases];\n } else if (next.aliases !== undefined) {\n delete next.aliases;\n }\n }\n if (input.description !== undefined) {\n next.description = input.description;\n }\n if (input.order !== undefined) {\n next.order = input.order;\n }\n\n if (existingIndex >= 0) {\n statuses[existingIndex] = next;\n } else {\n statuses.push(next);\n }\n\n return {\n file: { statuses },\n definition: next,\n // \"replaced\" reflects whether the status already existed effectively (in the\n // file OR in resolved settings), so the CLI reports \"Updated\" vs \"Registered\"\n // correctly even when the prior definition lived only in settings.\n replaced: existing !== undefined,\n };\n}\n\n/**\n * Removes a status definition from the parsed file by id (normalized). Throws a\n * plain Error when `id` is empty or matches a reserved built-in default status\n * (those are never stored in the file and must never be deletable). Returns\n * `removed: false` when no matching definition exists so the CLI layer can treat\n * the call as an idempotent no-op.\n */\nexport function removeStatusDef(file: StatusDefsFile, id: string | undefined): RemoveStatusDefResult {\n const normalizedId = normalizeStatusToken(id);\n if (normalizedId.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n if (BUILTIN_STATUS_IDS.has(normalizedId)) {\n throw new Error(\n `Cannot remove built-in status \"${normalizedId}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === normalizedId,\n );\n if (existingIndex < 0) {\n return { file: { statuses }, removed: false };\n }\n const [definition] = statuses.splice(existingIndex, 1);\n return { file: { statuses }, removed: true, definition };\n}\n\n/**\n * Throws when the new status id or any explicitly-supplied alias collides with a\n * DIFFERENT existing status's id/alias. `resolvedAliasToId` maps a normalized\n * token to its owning status id (the runtime status registry's alias_to_id map,\n * which stores ids and aliases in one namespace). Re-adding the same status\n * (matching id) is allowed — only cross-status collisions throw. This prevents a\n * custom status from shadowing a built-in lifecycle token (for example\n * `add-status review --alias open`, or a custom id `cancelled` that aliases the\n * built-in `canceled`), which would make `pm update --status open` resolve to the\n * wrong status. The CLI layer maps the thrown Error to a USAGE exit code.\n */\nexport function assertStatusTokensAvailable(\n input: { id: string; aliases?: string[] },\n resolvedAliasToId: ReadonlyMap<string, string>,\n): void {\n const candidates = [input.id, ...(input.aliases ?? [])];\n for (const candidate of candidates) {\n const token = normalizeStatusToken(candidate);\n if (token.length === 0) {\n continue;\n }\n const owner = resolvedAliasToId.get(token);\n if (owner !== undefined && owner !== input.id) {\n throw new Error(\n `Status token \"${token}\" already belongs to status \"${owner}\". Choose a different id/alias to avoid shadowing it.`,\n );\n }\n }\n}\n", "/**\n * @module core/schema/fields-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Fields File.\n */\nimport {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n} from \"../../types/index.js\";\nimport type { RuntimeFieldCommand, RuntimeFieldDefinition, RuntimeFieldType } from \"../../types/index.js\";\n\nexport type { RuntimeFieldCommand, RuntimeFieldDefinition, RuntimeFieldType } from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-field` / `pm schema remove-field` commands\n * and the `list-fields` / `show-field` inspectors. The CLI command file\n * (schema.ts) owns IO/governance; everything testable and side-effect-free lives\n * here so it can be coverage-gated to 100%.\n *\n * Custom fields persist at `.agents/pm/schema/fields.json` under the shape\n * `{ fields: RuntimeFieldDefinition[] }`. The runtime merge layer\n * (loadRuntimeSchemaFromOptionalFiles) reads that file and dynamically registers\n * a CLI flag per field on create/update/list/search/context, so this module only\n * has to manage the persisted entries; it never duplicates the registration.\n */\n\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\n\n/**\n * Built-in front-matter field names a custom field key must never shadow. A\n * custom key that collides with one of these would let `pm create --<key>` write\n * over reserved metadata, so add-field rejects them up front (symmetric with the\n * built-in-type guard in item-types-file.ts).\n */\nexport const BUILTIN_FIELD_KEYS: ReadonlySet<string> = new Set([\n \"id\",\n \"title\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"assignee\",\n \"parent\",\n \"description\",\n \"body\",\n \"created_at\",\n \"updated_at\",\n \"closed_at\",\n \"author\",\n \"deadline\",\n \"estimate\",\n \"sprint\",\n \"release\",\n \"risk\",\n \"confidence\",\n \"reviewer\",\n \"resolution\",\n \"expected\",\n \"actual\",\n]);\n\n/**\n * The default commands a field is wired onto when `--commands` is omitted,\n * matching the runtime default in runtime-schema.ts (normalizeRuntimeFieldDefinition).\n */\nconst DEFAULT_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\n/**\n * The shape persisted at `.agents/pm/schema/fields.json`.\n */\nexport interface FieldsFile {\n fields: RuntimeFieldDefinition[];\n}\n\n/**\n * Documents the raw add field input payload exchanged by command, SDK, and package integrations.\n */\nexport interface RawAddFieldInput {\n key: string | undefined;\n type?: string;\n commands?: string[];\n description?: string;\n cliFlag?: string;\n aliases?: string[];\n required?: boolean;\n requiredOnCreate?: boolean;\n allowUnset?: boolean;\n requiredTypes?: string[];\n}\n\n/**\n * Documents the normalized add field input payload exchanged by command, SDK, and package integrations.\n */\nexport interface NormalizedAddFieldInput {\n key: string;\n type: RuntimeFieldType;\n commands: RuntimeFieldCommand[];\n description?: string;\n cliFlag?: string;\n cliAliases: string[];\n required: boolean;\n requiredOnCreate: boolean;\n allowUnset: boolean;\n requiredTypes: string[];\n}\n\n/**\n * Documents the upsert field result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpsertFieldResult {\n file: FieldsFile;\n /** The definition as stored after the upsert. */\n definition: RuntimeFieldDefinition;\n /** True when an existing definition with the same (normalized) key was replaced. */\n replaced: boolean;\n}\n\n/**\n * Documents the remove field result payload exchanged by command, SDK, and package integrations.\n */\nexport interface RemoveFieldResult {\n file: FieldsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested key. */\n definition?: RuntimeFieldDefinition;\n}\n\n/**\n * Normalizes a field key using the same rule as runtime-schema.ts: lowercase and\n * collapse any run of whitespace/hyphens into a single underscore.\n */\nexport function normalizeFieldKey(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\n/**\n * Normalizes a CLI flag token: strip a leading `--`, lowercase, and collapse\n * whitespace/underscore runs to a single hyphen (matches normalizeCliToken in\n * runtime-schema.ts).\n */\nfunction normalizeCliToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const collapsed = value.trim().toLowerCase().replaceAll(/[\\s_]+/g, \"-\");\n return collapsed.startsWith(\"--\") ? collapsed.slice(2) : collapsed;\n}\n\nfunction keyToDefaultCliFlag(key: string): string {\n return key.replaceAll(\"_\", \"-\");\n}\n\nfunction dedupeCliTokens(values: Iterable<string>, exclude: string): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeCliToken(value);\n if (token.length > 0 && token !== exclude) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\nfunction dedupeStringList(values: string[] | undefined): string[] {\n const seen = new Set<string>();\n for (const value of values ?? []) {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n seen.add(trimmed);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Normalizes the command allow-list stored for a custom field definition.\n */\nfunction normalizeFieldCommands(rawCommands: string[] | undefined): RuntimeFieldCommand[] {\n const seen = new Set<string>();\n const normalized: RuntimeFieldCommand[] = [];\n for (const rawCommand of rawCommands ?? []) {\n const command = rawCommand.trim().toLowerCase();\n if (command.length === 0) {\n continue;\n }\n if (!RUNTIME_FIELD_COMMAND_SET.has(command)) {\n throw new Error(`Invalid field command \"${rawCommand}\". Allowed: ${RUNTIME_FIELD_COMMAND_VALUES.join(\", \")}.`);\n }\n if (!seen.has(command)) {\n seen.add(command);\n normalized.push(command as RuntimeFieldCommand);\n }\n }\n return rawCommands === undefined || normalized.length === 0 ? [...DEFAULT_FIELD_COMMANDS] : normalized;\n}\n\n/**\n * Validates and normalizes raw add-field CLI input. Throws a plain Error with a\n * stable message when the key is missing/empty, collides with a built-in field,\n * or carries an invalid type/command; the CLI layer maps these to PmCliError\n * exit codes. A `string_array` type implies a repeatable field downstream\n * (runtime-schema.ts derives `repeatable`), so no separate repeatable flag is\n * exposed.\n */\nexport function normalizeAddFieldInput(raw: RawAddFieldInput): NormalizedAddFieldInput {\n const key = normalizeFieldKey(raw.key);\n if (key.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n if (BUILTIN_FIELD_KEYS.has(key)) {\n throw new Error(\n `Cannot define custom field \"${key}\": it shadows a built-in field. Built-in fields are reserved.`,\n );\n }\n\n const typeCandidate =\n typeof raw.type === \"string\" && raw.type.trim().length > 0 ? raw.type.trim().toLowerCase() : \"string\";\n if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {\n throw new Error(`Invalid field type \"${raw.type}\". Allowed: ${RUNTIME_FIELD_TYPE_VALUES.join(\", \")}.`);\n }\n const type = typeCandidate as RuntimeFieldType;\n\n const commands = normalizeFieldCommands(raw.commands);\n\n const cliFlagToken = normalizeCliToken(raw.cliFlag);\n const cliFlag = cliFlagToken.length > 0 && cliFlagToken !== keyToDefaultCliFlag(key) ? cliFlagToken : undefined;\n const effectiveFlag = cliFlag ?? keyToDefaultCliFlag(key);\n const cliAliases = dedupeCliTokens(raw.aliases ?? [], effectiveFlag);\n\n const description = raw.description?.trim();\n return {\n key,\n type,\n commands,\n description: description && description.length > 0 ? description : undefined,\n cliFlag,\n cliAliases,\n required: raw.required === true,\n requiredOnCreate: raw.requiredOnCreate === true,\n // allow_unset defaults to true (omitted) and is only persisted when an\n // operator explicitly disables it with --no-allow-unset (allowUnset === false).\n allowUnset: raw.allowUnset !== false,\n requiredTypes: dedupeStringList(raw.requiredTypes),\n };\n}\n\nfunction selectFieldsArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.fields)) {\n return record.fields;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractFieldDefinitions(parsed: unknown): RuntimeFieldDefinition[] {\n const candidate = selectFieldsArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeFieldDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.key !== \"string\" || record.key.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeFieldDefinition);\n }\n return definitions;\n}\n\n/**\n * Coerces an arbitrary parsed value from fields.json into a FieldsFile. Accepts\n * the canonical `{ fields: [...] }` shape, a bare array, or a `{ definitions: [...] }`\n * form, and tolerates a missing/invalid file by returning an empty fields list.\n */\nexport function parseFieldsFile(raw: string | null | undefined): FieldsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { fields: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/fields.json contains invalid JSON.\");\n }\n return { fields: extractFieldDefinitions(parsed) };\n}\n\n/**\n * Serializes the fields file with a trailing newline (matches the rest of the\n * schema scaffold files written by pm).\n */\nexport function serializeFieldsFile(file: FieldsFile): string {\n return `${JSON.stringify({ fields: file.fields }, null, 2)}\\n`;\n}\n\n/**\n * Idempotent UPSERT of a custom field into the parsed file. Matching is by\n * normalized key. When a definition already exists, the supplied input fully\n * replaces its add-field-managed attributes (type/commands/description/flags/\n * required flags) while preserving any unrelated keys the file may carry; any\n * `metadata_key` already stored is preserved so existing item data keeps mapping\n * to the same front-matter column.\n */\nexport function upsertField(file: FieldsFile, input: NormalizedAddFieldInput): UpsertFieldResult {\n // Match by normalized key. A hand-authored file may carry more than one entry\n // for the same key, so drop ALL matches and re-insert a single merged result\n // (collapsing duplicates) rather than only rewriting the first occurrence. The\n // first existing match seeds preserved attributes (e.g. metadata_key).\n const existing = file.fields.find((definition) => normalizeFieldKey(definition.key) === input.key);\n const replaced = existing !== undefined;\n const fields = file.fields.filter((definition) => normalizeFieldKey(definition.key) !== input.key);\n\n const next: RuntimeFieldDefinition = {\n ...existing,\n key: input.key,\n type: input.type,\n commands: [...input.commands],\n };\n applyOptionalString(next, \"description\", input.description);\n applyOptionalString(next, \"cli_flag\", input.cliFlag);\n if (input.cliAliases.length > 0) {\n next.cli_aliases = [...input.cliAliases];\n } else {\n delete next.cli_aliases;\n }\n applyBooleanFlag(next, \"required\", input.required);\n applyBooleanFlag(next, \"required_on_create\", input.requiredOnCreate);\n // allow_unset defaults true; only persist the explicit false override.\n if (input.allowUnset === false) {\n next.allow_unset = false;\n } else {\n delete next.allow_unset;\n }\n if (input.requiredTypes.length > 0) {\n next.required_types = [...input.requiredTypes];\n } else {\n delete next.required_types;\n }\n\n fields.push(next);\n fields.sort((left, right) => normalizeFieldKey(left.key).localeCompare(normalizeFieldKey(right.key)));\n\n return {\n file: { fields },\n definition: next,\n replaced,\n };\n}\n\n/**\n * Removes a custom field definition from the parsed file by key (normalized).\n * Throws a plain Error when `key` is empty. Returns `removed: false` when no\n * matching definition exists so the CLI layer can treat the call as an\n * idempotent no-op.\n */\nexport function removeField(file: FieldsFile, key: string | undefined): RemoveFieldResult {\n const normalizedKey = normalizeFieldKey(key);\n if (normalizedKey.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n // Remove ALL matches (a hand-authored file may carry duplicate entries for the\n // same normalized key) so no stale duplicate survives the removal.\n const removed: RuntimeFieldDefinition[] = [];\n const fields = file.fields.filter((definition) => {\n if (normalizeFieldKey(definition.key) === normalizedKey) {\n removed.push(definition);\n return false;\n }\n return true;\n });\n if (removed.length === 0) {\n return { file: { fields }, removed: false };\n }\n return { file: { fields }, removed: true, definition: removed[0] };\n}\n\nfunction applyOptionalString(definition: RuntimeFieldDefinition, key: string, value: string | undefined): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value !== undefined && value.length > 0) {\n record[key] = value;\n } else {\n delete record[key];\n }\n}\n\nfunction applyBooleanFlag(definition: RuntimeFieldDefinition, key: string, value: boolean): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value) {\n record[key] = true;\n } else {\n delete record[key];\n }\n}\n", "/**\n * @module core/schema/type-presets\n *\n * Resolves configurable schema, fields, statuses, and workflows for Type Presets.\n */\nimport { normalizeAddTypeInput, type NormalizedAddTypeInput, type RawAddTypeInput } from \"./item-types-file.js\";\n\n/**\n * Shared domain item-type presets. These power both `pm init --type-preset`\n * (registered during initialization) and the standalone `pm schema apply-preset`\n * subcommand (adopting a preset into an already-initialized project). Keeping the\n * raw definitions and the preset-name normalizer in one place guarantees init and\n * schema register byte-identical types.\n */\n\nexport const TYPE_PRESET_NAMES = [\"agile\", \"ops\", \"research\"] as const;\n/**\n * Restricts type preset name values accepted by command, SDK, and storage contracts.\n */\nexport type TypePresetName = (typeof TYPE_PRESET_NAMES)[number];\n\n/**\n * Raw (pre-normalization) preset definitions keyed by preset name. Each entry is\n * fed through {@link normalizeAddTypeInput} before being upserted so the same\n * validation/normalization the `pm schema add-type` CLI applies governs preset\n * registration too.\n */\nexport const TYPE_PRESET_DEFINITIONS: Record<TypePresetName, RawAddTypeInput[]> = {\n agile: [\n {\n name: \"Story\",\n description: \"User-facing outcome or capability slice expressed from a stakeholder perspective.\",\n defaultStatus: \"open\",\n folder: \"stories\",\n aliases: [\"user-story\"],\n },\n {\n name: \"Spike\",\n description: \"Time-boxed investigation used to reduce uncertainty before implementation.\",\n defaultStatus: \"open\",\n folder: \"spikes\",\n aliases: [\"research-spike\"],\n },\n ],\n ops: [\n {\n name: \"Incident\",\n description: \"Operational disruption, degradation, or support escalation with recovery tracking.\",\n defaultStatus: \"open\",\n folder: \"incidents\",\n aliases: [\"outage\"],\n },\n {\n name: \"Runbook\",\n description: \"Repeatable operational procedure, diagnostic path, or response playbook.\",\n defaultStatus: \"open\",\n folder: \"runbooks\",\n aliases: [\"playbook\"],\n },\n ],\n research: [\n {\n name: \"Experiment\",\n description: \"Validated-learning activity with hypothesis, method, and outcome tracking.\",\n defaultStatus: \"open\",\n folder: \"experiments\",\n aliases: [\"study\"],\n },\n {\n name: \"Hypothesis\",\n description: \"Testable claim or assumption that should be supported, rejected, or refined.\",\n defaultStatus: \"open\",\n folder: \"hypotheses\",\n aliases: [\"assumption\"],\n },\n ],\n};\n\n/**\n * Validates and normalizes a raw preset-name CLI value. Returns `undefined` when\n * the value is omitted (no preset requested). Throws a plain Error with a stable\n * message for an empty or unknown preset; CLI layers map it to a USAGE exit code.\n * Accepts hyphen/underscore-insensitive casing for ergonomics.\n */\nexport function normalizeTypePresetName(rawValue: string | undefined): TypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new Error(\"Type preset name must not be empty.\");\n }\n if (normalized === \"agile\" || normalized === \"ops\" || normalized === \"research\") {\n return normalized;\n }\n throw new Error(`Invalid type preset \"${rawValue}\". Allowed: ${TYPE_PRESET_NAMES.join(\", \")}.`);\n}\n\n/**\n * Returns the normalized add-type inputs for a preset, in the order they should\n * be upserted. Each raw definition is run through normalizeAddTypeInput so callers\n * get the same validated shape as an individual `add-type` invocation.\n */\nexport function resolveTypePresetDefinitions(preset: TypePresetName): NormalizedAddTypeInput[] {\n return TYPE_PRESET_DEFINITIONS[preset].map((rawDefinition) => normalizeAddTypeInput(rawDefinition));\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAwBA,IAAM,0BAA0B,IAAI,IAAY,0BAA0B;AAU1E,IAAM,gCAAgC;AACtC,IAAM,kBAAkB,oBAAI,IAAG;AASxB,IAAM,qBAA0C,IAAI,IACzD,mCAAmC,IAAI,CAAC,eAAe,qBAAqB,WAAW,EAAE,CAAC,EAAE,OAC1F,CAAC,OAAO,GAAG,SAAS,CAAC,CACtB;AAiEG,SAAU,qBAAqB,OAAc;AACjD,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;EACT;AACA,QAAM,WAAW,gBAAgB,IAAI,KAAK;AAC1C,MAAI,aAAa,QAAW;AAC1B,WAAO;EACT;AACA,QAAM,aAAa,MAAM,KAAI,EAAG,YAAW,EAAG,WAAW,WAAW,GAAG;AACvE,MAAI,gBAAgB,QAAQ,+BAA+B;AACzD,2BAAuB,eAAe;EACxC;AACA,kBAAgB,IAAI,OAAO,UAAU;AACrC,SAAO;AACT;AAEA,SAAS,aAAa,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M,aAAa,SAAS,KAAI,EAAG,YAAW,EAAG,WAAW,KAAK,GAAG;AACpE,MAAI,WAAW,WAAW,GAAG;AAC3B,UAAM,IAAI,MAAM,qCAAqC;EACvD;AACA,MAAI,eAAe,WAAW,eAAe,SAAS,eAAe,YAAY;AAC/E,WAAO;EACT;AACA,QAAM,IAAI,MAAM,wBAAwB,QAAQ,eAAe,kBAAkB,KAAK,IAAI,CAAC,GAAG;AAChG;AAOM,SAAU,6BAA6B,QAAsB;AACjE,SAAO,wBAAwB,MAAM,EAAE,IAAI,CAAC,kBAAkB,sBAAsB,aAAa,CAAC;AACpG;",
6
6
  "names": ["definition"]
7
7
  }
@@ -1,10 +1,8 @@
1
1
  import {
2
- nowIso
3
- } from "./chunk-FLZSGSQR.js";
4
- import {
2
+ nowIso,
5
3
  readSettings,
6
4
  writeSettings
7
- } from "./chunk-SHQY2IDC.js";
5
+ } from "./chunk-YNCFP5AR.js";
8
6
  import {
9
7
  EXIT_CODE,
10
8
  appendLineAtomic,
@@ -13,7 +11,7 @@ import {
13
11
  resolvePmPackageRootFromModule,
14
12
  resolveTelemetryErrorCategory,
15
13
  writeFileAtomic
16
- } from "./chunk-LK6XLOGP.js";
14
+ } from "./chunk-LCFJ7XAM.js";
17
15
 
18
16
  // dist/core/telemetry/observability.js
19
17
  !(function() {
@@ -1772,4 +1770,4 @@ export {
1772
1770
  finishTelemetryCommand,
1773
1771
  emitTelemetryErrorEvent
1774
1772
  };
1775
- //# sourceMappingURL=chunk-GANUTS7W.js.map
1773
+ //# sourceMappingURL=chunk-KTGJ2CBU.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../core/telemetry/observability.ts", "../../../../../../../../core/telemetry/runtime.ts"],
4
4
  "sourcesContent": ["/**\n * @module core/telemetry/observability\n *\n * Captures consent-aware telemetry and observability events for Observability.\n */\nimport { EXIT_CODE, type TelemetryErrorCategory } from \"../shared/constants.js\";\n\n/**\n * Restricts telemetry resolution stage values accepted by command, SDK, and storage contracts.\n */\nexport type TelemetryResolutionStage = \"parse\" | \"preflight\" | \"execute\" | \"unknown\";\n\n/**\n * Restricts telemetry command resolution values accepted by command, SDK, and storage contracts.\n */\nexport type TelemetryCommandResolution =\n | \"success\"\n | \"nonexistent_command\"\n | \"invalid_option\"\n | \"missing_required_option\"\n | \"missing_required_argument\"\n | \"invalid_usage\"\n | \"validation_failed\"\n | \"health_findings\"\n | \"validation_findings\"\n | \"conflict\"\n | \"runtime_failed\"\n | \"unknown_failed\";\n\n/**\n * Documents the telemetry command taxonomy payload exchanged by command, SDK, and package integrations.\n */\nexport interface TelemetryCommandTaxonomy {\n command_path: string;\n command_root: string;\n command_leaf: string;\n command_depth: number;\n command_family: \"setup\" | \"query\" | \"mutation\" | \"testing\" | \"extension\" | \"diagnostics\" | \"other\";\n}\n\ninterface InferTelemetryErrorCodeParams {\n ok: boolean;\n errorCode?: string;\n errorMessage?: string;\n exitCode?: number;\n}\n\ninterface TelemetryErrorMessageClassifier {\n code: string;\n matches: (message: string) => boolean;\n}\n\nconst SETUP_ROOT_COMMANDS = new Set([\"init\", \"config\", \"completion\", \"completion-statuses\", \"completion-tags\", \"completion-types\"]);\nconst QUERY_ROOT_COMMANDS = new Set([\n \"list\",\n \"list-all\",\n \"list-open\",\n \"list-in-progress\",\n \"list-blocked\",\n \"list-closed\",\n \"list-canceled\",\n \"list-draft\",\n \"search\",\n \"get\",\n \"context\",\n \"calendar\",\n \"history\",\n \"activity\",\n \"aggregate\",\n \"deps\",\n \"contracts\",\n \"stats\",\n \"dedupe-audit\",\n]);\nconst MUTATION_ROOT_COMMANDS = new Set([\n \"create\",\n \"update\",\n \"update-many\",\n \"close-many\",\n \"append\",\n \"close\",\n \"delete\",\n \"restore\",\n \"claim\",\n \"release\",\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"docs\",\n \"start-task\",\n \"pause-task\",\n \"close-task\",\n]);\nconst TESTING_ROOT_COMMANDS = new Set([\"test\", \"test-all\", \"test-runs\", \"test-verify\", \"trace-test\", \"test-ping\"]);\nconst DIAGNOSTICS_ROOT_COMMANDS = new Set([\"health\", \"validate\", \"normalize\", \"reindex\", \"gc\", \"telemetry\", \"extension-doctor\"]);\n\nfunction normalizeCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .replaceAll(/\\s+/g, \" \")\n .toLowerCase();\n}\n\nfunction normalizeErrorCode(errorCode: string | undefined): string | undefined {\n const normalized = errorCode?.trim().toLowerCase();\n return normalized && normalized.length > 0 ? normalized : undefined;\n}\n\nconst TELEMETRY_ERROR_MESSAGE_CLASSIFIERS: readonly TelemetryErrorMessageClassifier[] = [\n { code: \"unknown_command\", matches: (message) => message.includes(\"unknown command\") },\n { code: \"unknown_option\", matches: (message) => message.includes(\"unknown option\") },\n {\n code: \"missing_required_option\",\n matches: (message) => message.includes(\"missing required options\") || message.includes(\"missing required option\"),\n },\n { code: \"missing_required_argument\", matches: (message) => message.includes(\"missing required argument\") },\n { code: \"no_update_fields\", matches: (message) => message.includes(\"no update flags provided\") },\n {\n code: \"ownership_conflict\",\n matches: (message) => message.includes(\"is assigned to\") && message.includes(\"use --force\"),\n },\n { code: \"lock_conflict\", matches: (message) => message.includes(\"is locked\") },\n {\n code: \"terminal_state_conflict\",\n matches: (message) => message.includes(\"already terminal\") && message.includes(\"use --force\"),\n },\n { code: \"tracker_not_initialized\", matches: (message) => message.includes(\"tracker is not initialized\") },\n { code: \"item_not_found\", matches: (message) => message.includes(\" not found\") },\n {\n code: \"close_through_update\",\n matches: (message) =>\n message.includes(\"use \\\"pm close <id> <text>\\\" to close an item\") ||\n (message.includes(\"invalid --status value\") && message.includes(\"\\\"closed\\\"\")),\n },\n {\n code: \"invalid_argument_value\",\n matches: (message) => message.startsWith(\"invalid \") || message.includes(\" must be \") || message.includes(\" requires \"),\n },\n {\n code: \"invalid_command_usage\",\n matches: (message) => message.includes(\"either as positional\") && message.includes(\"not both\"),\n },\n];\n\nconst TELEMETRY_EXIT_CODE_FALLBACKS: ReadonlyMap<number, string> = new Map([\n [EXIT_CODE.USAGE, \"invalid_command_usage\"],\n [EXIT_CODE.NOT_FOUND, \"item_not_found\"],\n [EXIT_CODE.CONFLICT, \"lock_conflict\"],\n [EXIT_CODE.DEPENDENCY_FAILED, \"dependency_failed\"],\n]);\n\n/**\n * Implements derive telemetry command taxonomy for the public runtime surface of this module.\n */\nexport function deriveTelemetryCommandTaxonomy(commandPath: string): TelemetryCommandTaxonomy {\n const normalizedPath = normalizeCommandPath(commandPath);\n // tokens always has at least one element (the fallback [\"<unknown>\"]), so the\n // first/last lookups are never undefined.\n const tokens = normalizedPath.length > 0 ? normalizedPath.split(\" \") : [\"<unknown>\"];\n const root = tokens[0] as string;\n const leaf = tokens[tokens.length - 1] as string;\n\n let family: TelemetryCommandTaxonomy[\"command_family\"] = \"other\";\n if (SETUP_ROOT_COMMANDS.has(root)) {\n family = \"setup\";\n } else if (QUERY_ROOT_COMMANDS.has(root)) {\n family = \"query\";\n } else if (MUTATION_ROOT_COMMANDS.has(root)) {\n family = \"mutation\";\n } else if (TESTING_ROOT_COMMANDS.has(root)) {\n family = \"testing\";\n } else if (root === \"extension\") {\n family = \"extension\";\n } else if (DIAGNOSTICS_ROOT_COMMANDS.has(root)) {\n family = \"diagnostics\";\n }\n\n return {\n command_path: normalizedPath.length > 0 ? normalizedPath : \"<unknown>\",\n command_root: root,\n command_leaf: leaf,\n command_depth: tokens.length,\n command_family: family,\n };\n}\n\n/**\n * Implements infer telemetry error code for the public runtime surface of this module.\n */\nexport function inferTelemetryErrorCode(params: InferTelemetryErrorCodeParams): string | undefined {\n if (params.ok) {\n return undefined;\n }\n\n const explicit = normalizeErrorCode(params.errorCode);\n if (explicit) {\n return explicit;\n }\n\n const message = (params.errorMessage ?? \"\").trim().toLowerCase();\n // NOTE: A \"strict create mode requires concrete values for --\" message is always\n // classified as invalid_argument_value by the ordered ` requires ` classifier,\n // so a dedicated branch would be unreachable and is intentionally omitted.\n for (const classifier of TELEMETRY_ERROR_MESSAGE_CLASSIFIERS) {\n if (classifier.matches(message)) {\n return classifier.code;\n }\n }\n\n const exitCode = Number.isFinite(params.exitCode) ? Math.max(0, Math.trunc(params.exitCode as number)) : undefined;\n if (exitCode !== undefined) {\n return TELEMETRY_EXIT_CODE_FALLBACKS.get(exitCode) ?? \"command_failed\";\n }\n return \"command_failed\";\n}\n\n/**\n * Implements derive telemetry command resolution for the public runtime surface of this module.\n */\nexport function deriveTelemetryCommandResolution(params: {\n ok: boolean;\n errorCode?: string;\n errorCategory?: TelemetryErrorCategory;\n}): TelemetryCommandResolution {\n if (params.ok) {\n return \"success\";\n }\n\n const normalizedCode = normalizeErrorCode(params.errorCode);\n if (normalizedCode === \"unknown_command\") {\n return \"nonexistent_command\";\n }\n if (normalizedCode === \"unknown_option\") {\n return \"invalid_option\";\n }\n if (normalizedCode === \"missing_required_option\") {\n return \"missing_required_option\";\n }\n if (normalizedCode === \"missing_required_argument\") {\n return \"missing_required_argument\";\n }\n if (normalizedCode === \"health_findings\") {\n return \"health_findings\";\n }\n if (normalizedCode === \"validation_findings\") {\n return \"validation_findings\";\n }\n\n if (params.errorCategory === \"usage\") {\n return \"invalid_usage\";\n }\n if (params.errorCategory === \"validation\") {\n return \"validation_failed\";\n }\n if (params.errorCategory === \"conflict\") {\n return \"conflict\";\n }\n if (params.errorCategory === \"runtime\") {\n return \"runtime_failed\";\n }\n return \"unknown_failed\";\n}\n", "/**\n * @module core/telemetry/runtime\n *\n * Captures consent-aware telemetry and observability events for Runtime.\n */\nimport crypto from \"node:crypto\";\nimport { spawn } from \"node:child_process\";\nimport { mkdirSync, rmSync, statSync } from \"node:fs\";\nimport { mkdir, readdir, rm, stat } from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport type { GlobalOptions } from \"../shared/command-types.js\";\nimport { resolvePmPackageRootFromModule } from \"../packages/root.js\";\nimport { appendLineAtomic, readFileIfExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { resolveTelemetryErrorCategory, type TelemetryErrorCategory } from \"../shared/constants.js\";\nimport { nowIso } from \"../shared/time.js\";\nimport { resolveGlobalPmRoot } from \"../store/paths.js\";\nimport { readSettings, writeSettings } from \"../store/settings.js\";\nimport {\n deriveTelemetryCommandResolution,\n deriveTelemetryCommandTaxonomy,\n inferTelemetryErrorCode,\n type TelemetryCommandResolution,\n type TelemetryCommandTaxonomy,\n type TelemetryResolutionStage,\n} from \"./observability.js\";\n\nconst TELEMETRY_QUEUE_RELATIVE_PATH = path.join(\"runtime\", \"telemetry\", \"events.jsonl\");\nconst TELEMETRY_STATE_RELATIVE_PATH = path.join(\"runtime\", \"telemetry\", \"state.json\");\nconst TELEMETRY_OTEL_SPANS_RELATIVE_PATH = path.join(\"runtime\", \"telemetry\", \"otel-spans.jsonl\");\n// Kept small so a worst-case batch against a blackholed collector\n// (TELEMETRY_OTEL_SPANS_FLUSH_BATCH_SIZE * TELEMETRY_HTTP_TIMEOUT_MS plus the\n// preceding event flush) stays well under TELEMETRY_FLUSH_LOCK_STALE_MS (60s).\n// Otherwise a later command could treat the still-held flush lock as stale and\n// start a second concurrent worker.\nconst TELEMETRY_OTEL_SPANS_FLUSH_BATCH_SIZE = 8;\nconst TELEMETRY_OTEL_SPANS_MAX_PENDING = 500;\nexport const TELEMETRY_SCHEMA_VERSION = 1;\nconst TELEMETRY_CLIENT_SCHEMA_VERSION = 1;\nconst TELEMETRY_FLUSH_BATCH_SIZE = 100;\nconst TELEMETRY_MAX_RETRY_DELAY_MS = 3_600_000;\nconst TELEMETRY_RETRY_BASE_DELAY_MS = 30_000;\nconst TELEMETRY_HTTP_TIMEOUT_MS = 5_000;\nconst MILLISECONDS_PER_DAY = 86_400_000;\nconst TELEMETRY_MAX_EVENT_BYTES = 65_536;\nconst TELEMETRY_SANITIZE_MAX_DEPTH = 6;\nconst TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS = 20;\nexport const TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS = 15;\nconst TELEMETRY_RESULT_PREVIEW_MAX_BYTES = 8_192;\nconst TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS = [25, 50, 100, 200] as const;\nconst TELEMETRY_QUEUE_TMP_ORPHAN_MAX_AGE_MS = 60 * 60 * 1000;\nconst TELEMETRY_FLUSH_LOCK_STALE_MS = 60_000;\nconst TELEMETRY_FLUSH_SPAWN_LOCK_STALE_MS = 60_000;\nconst OTEL_TRACES_ENDPOINT_ENV = \"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT\";\nconst OTEL_BASE_ENDPOINT_ENV = \"OTEL_EXPORTER_OTLP_ENDPOINT\";\nconst OTEL_SERVICE_NAME_ENV = \"OTEL_SERVICE_NAME\";\nconst PM_TELEMETRY_DISABLED_ENV = \"PM_TELEMETRY_DISABLED\";\nconst PM_NO_TELEMETRY_ENV = \"PM_NO_TELEMETRY\";\nconst PM_TELEMETRY_DISABLED_VALUES = new Set([\"1\", \"true\", \"yes\", \"on\"]);\nconst PM_TELEMETRY_OTEL_DISABLED_ENV = \"PM_TELEMETRY_OTEL_DISABLED\";\nconst PM_TELEMETRY_OTEL_DISABLED_VALUES = new Set([\"1\", \"true\", \"yes\", \"on\"]);\nconst PM_TELEMETRY_INLINE_FLUSH_ENV = \"PM_TELEMETRY_INLINE_FLUSH\";\nconst PM_TELEMETRY_FLUSH_CHILD_ENV = \"PM_TELEMETRY_FLUSH_CHILD\";\nconst PM_TELEMETRY_SOURCE_CONTEXT_ENV = \"PM_TELEMETRY_SOURCE_CONTEXT\";\nconst PM_AUTHOR_ENV = \"PM_AUTHOR\";\nexport const PM_TELEMETRY_SOURCE_CONTEXT_VALUES = [\"user\", \"automation\", \"test\", \"dogfood\", \"audit_smoke\"] as const;\n\nlet _lastFlushPromise: Promise<void> = Promise.resolve();\nlet _queueMutationPromise: Promise<unknown> = Promise.resolve();\n\n/** Wait for the most recent background flush to settle. Test-only helper. */\nexport async function waitForPendingFlush(): Promise<void> {\n await _lastFlushPromise;\n await _queueMutationPromise;\n}\nconst PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set<string>(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);\nconst BOOLEAN_TRUE_VALUES = new Set([\"1\", \"true\", \"yes\", \"on\"]);\nconst PROCESS_SESSION_ID = crypto.randomUUID();\n\nconst SENSITIVE_KEYWORDS = [\n \"token\",\n \"secret\",\n \"password\",\n \"passwd\",\n \"api_key\",\n \"apikey\",\n \"authorization\",\n \"cookie\",\n \"session\",\n \"credentials\",\n \"bearer\",\n] as const;\nconst SENSITIVE_INLINE_KEY_PATTERN =\n \"(?:token|secret|password|passwd|api[_-]?key|apikey|authorization|cookie|session|credentials|bearer)\";\nconst INLINE_SENSITIVE_ASSIGNMENT_PATTERN = new RegExp(\n `\\\\b(${SENSITIVE_INLINE_KEY_PATTERN})\\\\s*([:=])\\\\s*([^\\\\s,;]+)`,\n \"giu\",\n);\nconst INLINE_SENSITIVE_FLAG_PATTERN = new RegExp(\n `(--${SENSITIVE_INLINE_KEY_PATTERN})(=|\\\\s+)([^\\\\s,;]+)`,\n \"giu\",\n);\nconst ABSOLUTE_PATH_TOKEN_PATTERN = /(^|[\\s\"'`(=])\\/(?:[^\\s\"'`),;]+)/g;\nconst BEARER_TOKEN_PATTERN = /bearer\\s+[a-z0-9._=-]+/giu;\nconst PRIVATE_IP_PATTERN =\n /\\b(?:10\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)|172\\.(?:1[6-9]|2\\d|3[01])\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)|192\\.168\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))\\b/g;\n\ninterface TelemetryEvent {\n schema_version: number;\n event_id: string;\n event_type: \"command_start\" | \"command_finish\" | \"command_error\";\n occurred_at: string;\n installation_id: string;\n session_id: string;\n command: string;\n payload: Record<string, unknown>;\n}\n\ninterface QueuedTelemetryEvent {\n client_schema_version?: number;\n event: TelemetryEvent;\n attempts: number;\n last_attempt_at?: string;\n next_attempt_after?: string;\n}\n\ninterface TelemetryRuntimeState {\n last_attempted_flush_at?: string;\n last_successful_flush_at?: string;\n last_failed_flush_at?: string;\n last_failed_flush_error?: string;\n endpoint?: string;\n queue_entries?: number;\n pending_otel_spans?: number;\n last_otel_attempt_at?: string;\n last_otel_success_at?: string;\n last_otel_failure_at?: string;\n last_otel_failure_error?: string;\n}\n\n/**\n * A built OpenTelemetry span request awaiting export. Persisted to a small,\n * bounded queue so the OTLP trace POST happens in the detached, unref'd flush\n * worker instead of inline in the foreground command. This keeps the CLI process\n * from staying alive while a connecting socket to an unreachable traces endpoint\n * drains its 5s timeout (the GH-209 root cause). `payload` is the fully built\n * OTLP resourceSpans body; `endpoint` is the per-span traces endpoint.\n */\ninterface PendingOtelSpan {\n /**\n * Stable id used to reconcile the queue after the network flush: the worker\n * re-reads the file and removes/updates only the spans it processed, by id, so\n * spans appended by a concurrent foreground process during the flush are never\n * overwritten. Mirrors the event-queue's event_id-based reconciliation.\n */\n id: string;\n endpoint: string;\n payload: unknown;\n enqueued_at: string;\n attempts: number;\n next_attempt_after?: string;\n}\n\ntype TelemetryCaptureLevel = \"minimal\" | \"redacted\" | \"max\";\ntype TelemetrySourceContext = (typeof PM_TELEMETRY_SOURCE_CONTEXT_VALUES)[number];\ntype TelemetrySourceContextSource = \"inferred\" | \"env_override\";\n\ninterface ResolvedTelemetrySourceContext {\n source_context: TelemetrySourceContext;\n source_context_source: TelemetrySourceContextSource;\n}\n\n/**\n * Documents the active telemetry command payload exchanged by command, SDK, and package integrations.\n */\nexport interface ActiveTelemetryCommand {\n started_at: string;\n started_at_ms: number;\n command: string;\n command_taxonomy: TelemetryCommandTaxonomy;\n pm_version: string;\n source_context: TelemetrySourceContext;\n source_context_source: TelemetrySourceContextSource;\n installation_id: string;\n pm_root_hash: string;\n cwd_hash: string;\n endpoint: string;\n retention_days: number;\n global_pm_root: string;\n capture_level: TelemetryCaptureLevel;\n otel_traces_endpoint?: string;\n otel_trace_id?: string;\n otel_span_id?: string;\n}\n\n/**\n * Documents the telemetry command context payload exchanged by command, SDK, and package integrations.\n */\nexport interface TelemetryCommandContext {\n command: string;\n pm_version: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\n/**\n * Documents the telemetry command outcome payload exchanged by command, SDK, and package integrations.\n */\nexport interface TelemetryCommandOutcome {\n ok: boolean;\n error?: string;\n result?: unknown;\n exit_code?: number;\n error_code?: string;\n error_category?: TelemetryErrorCategory;\n command_resolution?: TelemetryCommandResolution;\n resolution_stage?: TelemetryResolutionStage;\n}\n\n/**\n * Documents the telemetry error event context payload exchanged by command, SDK, and package integrations.\n */\nexport interface TelemetryErrorEventContext {\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_version: string;\n pm_root: string;\n error_code: string;\n error_message: string;\n exit_code: number;\n error_category?: TelemetryErrorCategory;\n command_resolution?: TelemetryCommandResolution;\n resolution_stage?: TelemetryResolutionStage;\n}\n\n\nfunction queuePath(globalPmRoot: string): string {\n return path.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH);\n}\n\nfunction otelSpansQueuePath(globalPmRoot: string): string {\n return path.join(globalPmRoot, TELEMETRY_OTEL_SPANS_RELATIVE_PATH);\n}\n\nfunction telemetryRuntimeDirectory(globalPmRoot: string): string {\n return path.dirname(queuePath(globalPmRoot));\n}\n\nfunction runtimeStatePath(globalPmRoot: string): string {\n return path.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH);\n}\n\nfunction flushLockPath(globalPmRoot: string): string {\n return path.join(globalPmRoot, \"runtime\", \"telemetry\", \"flush.lock\");\n}\n\nfunction flushSpawnLockPath(globalPmRoot: string): string {\n return path.join(globalPmRoot, \"runtime\", \"telemetry\", \"flush.spawn.lock\");\n}\n\nfunction telemetryFlushRunnerPath(): string {\n return path.join(resolvePmPackageRootFromModule(import.meta.url, [\"../../..\"]), \"dist\", \"cli\", \"telemetry-flush.js\");\n}\n\nfunction shouldFlushInline(): boolean {\n if (parseBooleanTrueLike(process.env[PM_TELEMETRY_INLINE_FLUSH_ENV])) {\n return true;\n }\n if (parseBooleanTrueLike(process.env[PM_TELEMETRY_FLUSH_CHILD_ENV])) {\n return true;\n }\n const nodeEnv = (process.env.NODE_ENV ?? \"\").trim().toLowerCase();\n return typeof process.env.VITEST === \"string\" || typeof process.env.VITEST_WORKER_ID === \"string\" || nodeEnv === \"test\";\n}\n\nasync function readRuntimeState(globalPmRoot: string): Promise<TelemetryRuntimeState> {\n const raw = await readFileIfExists(runtimeStatePath(globalPmRoot));\n if (!raw || raw.trim().length === 0) {\n return {};\n }\n try {\n const parsed = JSON.parse(raw) as TelemetryRuntimeState;\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return {};\n }\n return parsed;\n } catch {\n return {};\n }\n}\n\nasync function writeRuntimeState(globalPmRoot: string, patch: TelemetryRuntimeState): Promise<void> {\n try {\n const current = await readRuntimeState(globalPmRoot);\n const next: TelemetryRuntimeState = {\n ...current,\n ...patch,\n };\n const normalized = Object.fromEntries(\n Object.entries(next)\n .filter(([, value]) => value !== undefined)\n .sort((left, right) => left[0].localeCompare(right[0])),\n );\n await writeFileAtomic(runtimeStatePath(globalPmRoot), `${JSON.stringify(normalized, null, 2)}\\n`);\n } catch {\n // Runtime state persistence is best effort and must not block command execution.\n }\n}\n\nfunction isSensitiveKey(key: string): boolean {\n const normalized = key.trim().toLowerCase().replaceAll(\"-\", \"_\").replaceAll(/[^a-z0-9_]+/g, \"_\");\n const tokens = normalized.split(\"_\").filter((token) => token.length > 0);\n return SENSITIVE_KEYWORDS.some(\n (keyword) => normalized === keyword || normalized.endsWith(`_${keyword}`) || tokens.includes(keyword),\n );\n}\n\nfunction redactInlineSensitiveAssignments(input: string): string {\n const withoutAssignments = input.replaceAll(\n INLINE_SENSITIVE_ASSIGNMENT_PATTERN,\n (_match: string, key: string, delimiter: string): string => `${key}${delimiter}[redacted]`,\n );\n return withoutAssignments.replaceAll(\n INLINE_SENSITIVE_FLAG_PATTERN,\n (_match: string, flag: string, delimiter: string): string => `${flag}${delimiter}[redacted]`,\n );\n}\n\nfunction redactAbsolutePathTokens(input: string): string {\n return input.replaceAll(\n ABSOLUTE_PATH_TOKEN_PATTERN,\n (_match: string, prefix: string): string => `${prefix}[redacted_path]`,\n );\n}\n\nfunction isAsciiLetterOrDigitCode(code: number): boolean {\n const isUpper = code >= 65 && code <= 90;\n const isLower = code >= 97 && code <= 122;\n const isDigit = code >= 48 && code <= 57;\n return isUpper || isLower || isDigit;\n}\n\nfunction isEmailLocalCharacter(character: string | undefined): boolean {\n if (!character) {\n return false;\n }\n const code = character.charCodeAt(0);\n if (isAsciiLetterOrDigitCode(code)) {\n return true;\n }\n return character === \".\" || character === \"_\" || character === \"%\" || character === \"+\" || character === \"-\";\n}\n\nfunction isEmailDomainCharacter(character: string | undefined): boolean {\n if (!character) {\n return false;\n }\n const code = character.charCodeAt(0);\n if (isAsciiLetterOrDigitCode(code)) {\n return true;\n }\n return character === \".\" || character === \"-\";\n}\n\nfunction looksLikeEmailToken(token: string): boolean {\n const atIndex = token.indexOf(\"@\");\n if (atIndex <= 0 || atIndex !== token.lastIndexOf(\"@\") || atIndex === token.length - 1) {\n return false;\n }\n const localPart = token.slice(0, atIndex);\n const domainPart = token.slice(atIndex + 1);\n const lastDot = domainPart.lastIndexOf(\".\");\n if (lastDot <= 0 || lastDot === domainPart.length - 1) {\n return false;\n }\n if (domainPart.length - (lastDot + 1) < 2) {\n return false;\n }\n for (const character of localPart) {\n if (!isEmailLocalCharacter(character)) {\n return false;\n }\n }\n for (const character of domainPart) {\n if (!isEmailDomainCharacter(character)) {\n return false;\n }\n }\n return true;\n}\n\nfunction redactEmailTokens(input: string): string {\n let redacted = \"\";\n let cursor = 0;\n while (cursor < input.length) {\n const atIndex = input.indexOf(\"@\", cursor);\n if (atIndex < 0) {\n redacted += input.slice(cursor);\n break;\n }\n let start = atIndex - 1;\n while (start >= cursor && isEmailLocalCharacter(input[start])) {\n start -= 1;\n }\n start += 1;\n let end = atIndex + 1;\n while (end < input.length && isEmailDomainCharacter(input[end])) {\n end += 1;\n }\n const candidate = input.slice(start, end);\n if (looksLikeEmailToken(candidate)) {\n redacted += input.slice(cursor, start);\n redacted += \"[redacted_email]\";\n cursor = end;\n continue;\n }\n redacted += input.slice(cursor, atIndex + 1);\n cursor = atIndex + 1;\n }\n return redacted;\n}\n\nfunction sanitizeCommonSensitiveTokens(input: string): string {\n const withoutEmails = redactEmailTokens(input);\n const withoutBearer = withoutEmails.replaceAll(BEARER_TOKEN_PATTERN, \"bearer [redacted_token]\");\n return withoutBearer.replaceAll(PRIVATE_IP_PATTERN, \"[redacted_ip]\");\n}\n\nfunction sanitizeStringRedacted(input: string): string {\n const withoutCommonSensitiveTokens = sanitizeCommonSensitiveTokens(input);\n const withoutInlineSecrets = redactInlineSensitiveAssignments(withoutCommonSensitiveTokens);\n const withoutAbsolutePaths = redactAbsolutePathTokens(withoutInlineSecrets);\n const trimmed = withoutAbsolutePaths.trim();\n if (trimmed.startsWith(\"/\") && trimmed.length > 1) {\n return \"[redacted_path]\";\n }\n if (withoutAbsolutePaths.length > 512) {\n return `${withoutAbsolutePaths.slice(0, 509)}...`;\n }\n return withoutAbsolutePaths;\n}\n\nfunction sanitizeStringMax(input: string): string {\n const withoutCommonSensitiveTokens = sanitizeCommonSensitiveTokens(input);\n const withoutInlineSecrets = redactInlineSensitiveAssignments(withoutCommonSensitiveTokens);\n const withoutAbsolutePaths = redactAbsolutePathTokens(withoutInlineSecrets);\n const trimmed = withoutAbsolutePaths.trim();\n if (trimmed.startsWith(\"/\") && trimmed.length > 1) {\n return \"[redacted_path]\";\n }\n if (withoutAbsolutePaths.length > 2048) {\n return `${withoutAbsolutePaths.slice(0, 2045)}...`;\n }\n return withoutAbsolutePaths;\n}\n\nfunction sanitizeString(input: string, captureLevel: Exclude<TelemetryCaptureLevel, \"minimal\"> = \"redacted\"): string {\n if (captureLevel === \"max\") {\n return sanitizeStringMax(input);\n }\n return sanitizeStringRedacted(input);\n}\n\nfunction sanitizeValue(\n value: unknown,\n keyHint?: string,\n captureLevel: Exclude<TelemetryCaptureLevel, \"minimal\"> = \"redacted\",\n depth = 0,\n): unknown {\n if (keyHint && isSensitiveKey(keyHint)) {\n return \"[redacted]\";\n }\n if (value === null || value === undefined) {\n return value;\n }\n if (typeof value === \"string\") {\n return sanitizeString(value, captureLevel);\n }\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return value;\n }\n if (depth >= TELEMETRY_SANITIZE_MAX_DEPTH) {\n return \"[depth_truncated]\";\n }\n if (Array.isArray(value)) {\n return value.slice(0, TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS).map((entry) => sanitizeValue(entry, undefined, captureLevel, depth + 1));\n }\n if (typeof value === \"object\") {\n const record = value as Record<string, unknown>;\n const sanitized: Record<string, unknown> = {};\n for (const [key, nested] of Object.entries(record)) {\n sanitized[key] = sanitizeValue(nested, key, captureLevel, depth + 1);\n }\n return sanitized;\n }\n return String(value);\n}\n\nfunction sanitizeCommandArgs(\n args: string[],\n captureLevel: Exclude<TelemetryCaptureLevel, \"minimal\"> = \"redacted\",\n): string[] {\n const sanitized: string[] = [];\n let nextIsSensitiveValue = false;\n for (const rawArg of args) {\n const arg = sanitizeString(rawArg, captureLevel);\n if (nextIsSensitiveValue) {\n sanitized.push(\"[redacted]\");\n nextIsSensitiveValue = false;\n continue;\n }\n if (arg.startsWith(\"--\")) {\n const withoutPrefix = arg.slice(2);\n const delimiterIndex = withoutPrefix.indexOf(\"=\");\n if (delimiterIndex >= 0) {\n const key = withoutPrefix.slice(0, delimiterIndex);\n const value = withoutPrefix.slice(delimiterIndex + 1);\n if (isSensitiveKey(key)) {\n sanitized.push(`--${key}=[redacted]`);\n } else {\n sanitized.push(`--${key}=${sanitizeString(value, captureLevel)}`);\n }\n continue;\n }\n if (isSensitiveKey(withoutPrefix)) {\n sanitized.push(`--${withoutPrefix}`);\n nextIsSensitiveValue = true;\n continue;\n }\n }\n sanitized.push(arg);\n }\n return sanitized;\n}\n\nfunction normalizeCaptureLevel(value: string | undefined): TelemetryCaptureLevel {\n const normalized = value?.trim().toLowerCase();\n if (normalized === \"minimal\" || normalized === \"redacted\" || normalized === \"max\") {\n return normalized;\n }\n return \"redacted\";\n}\n\nfunction parseBooleanTrueLike(value: string | undefined): boolean {\n return BOOLEAN_TRUE_VALUES.has((value ?? \"\").trim().toLowerCase());\n}\n\nfunction normalizePmVersion(value: string | undefined): string {\n const trimmed = typeof value === \"string\" ? value.trim() : \"\";\n return trimmed.length > 0 ? trimmed : \"0.0.0\";\n}\n\nfunction normalizeTelemetryErrorCode(value: string | undefined): string | undefined {\n const normalized = value?.trim();\n return normalized && normalized.length > 0 ? normalized : undefined;\n}\n\nfunction normalizeTelemetryExitCode(exitCode: number | undefined, ok: boolean): number {\n if (Number.isFinite(exitCode)) {\n return Math.max(0, Math.trunc(exitCode as number));\n }\n return ok ? 0 : 1;\n}\n\nfunction normalizeTelemetryErrorCategory(params: {\n ok: boolean;\n errorCode?: string;\n errorCategory?: TelemetryErrorCategory;\n}): TelemetryErrorCategory | undefined {\n if (params.ok) {\n return undefined;\n }\n if (typeof params.errorCategory === \"string\" && params.errorCategory.trim().length > 0) {\n return params.errorCategory;\n }\n if (typeof params.errorCode === \"string\" && params.errorCode.trim().length > 0) {\n return resolveTelemetryErrorCategory(params.errorCode);\n }\n return \"unknown\";\n}\n\nfunction resolveTelemetrySourceContext(globalOptions: GlobalOptions): ResolvedTelemetrySourceContext {\n const override = (process.env[PM_TELEMETRY_SOURCE_CONTEXT_ENV] ?? \"\").trim().toLowerCase();\n if (PM_TELEMETRY_SOURCE_CONTEXT_SET.has(override)) {\n return {\n source_context: override as TelemetrySourceContext,\n source_context_source: \"env_override\",\n };\n }\n const nodeEnv = (process.env.NODE_ENV ?? \"\").trim().toLowerCase();\n if (typeof process.env.VITEST === \"string\" || typeof process.env.VITEST_WORKER_ID === \"string\" || nodeEnv === \"test\") {\n return {\n source_context: \"test\",\n source_context_source: \"inferred\",\n };\n }\n const nonTty = process.stdin.isTTY !== true || process.stdout.isTTY !== true;\n const ci = parseBooleanTrueLike(process.env.CI);\n const scriptLikeMode = globalOptions.json === true || globalOptions.quiet === true;\n if (nonTty || ci || scriptLikeMode) {\n return {\n source_context: \"automation\",\n source_context_source: \"inferred\",\n };\n }\n return {\n source_context: \"user\",\n source_context_source: \"inferred\",\n };\n}\n\nfunction hashWithInstallationId(installationId: string, value: string): string {\n return crypto.createHash(\"sha256\").update(`${installationId}:${value}`).digest(\"hex\");\n}\n\n/**\n * Builds the agent-identity dimension for a telemetry payload from `PM_AUTHOR`.\n *\n * The raw `PM_AUTHOR` value (e.g. `claude-code-agent`) is never emitted. At\n * non-minimal capture levels a stable `author_context_hash` is attached — the\n * same installation-id-keyed one-way hash used for `pm_root_hash`/`cwd_hash`, so\n * agent-driven invocations can be segmented in Sentry/dashboards while the same\n * author hashes differently across installations. Because the field is a one-way\n * hash, it intentionally bypasses the {@link SENSITIVE_KEYWORDS} redaction path.\n * At minimal capture only a `has_author_context` boolean is surfaced.\n */\nfunction buildAuthorContextPayloadFields(\n captureLevel: TelemetryCaptureLevel,\n installationId: string,\n): Record<string, unknown> {\n const author = (process.env[PM_AUTHOR_ENV] ?? \"\").trim();\n if (captureLevel === \"minimal\") {\n return { has_author_context: author.length > 0 };\n }\n return author.length > 0\n ? { author_context_hash: hashWithInstallationId(installationId, author) }\n : {};\n}\n\nfunction normalizeForHash(value: unknown, depth = 0): unknown {\n if (value === null || value === undefined) {\n return value;\n }\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n return value;\n }\n if (depth >= TELEMETRY_SANITIZE_MAX_DEPTH) {\n return \"[depth_truncated]\";\n }\n if (Array.isArray(value)) {\n return value.slice(0, TELEMETRY_SANITIZE_MAX_ARRAY_ITEMS).map((entry) => normalizeForHash(entry, depth + 1));\n }\n if (typeof value === \"object\") {\n const record = value as Record<string, unknown>;\n const normalized: Record<string, unknown> = {};\n const sortedKeys = Object.keys(record).sort((left, right) => left.localeCompare(right));\n for (const key of sortedKeys) {\n normalized[key] = normalizeForHash(record[key], depth + 1);\n }\n return normalized;\n }\n return String(value);\n}\n\nfunction hashTelemetryValue(installationId: string, value: unknown): string {\n return hashWithInstallationId(installationId, JSON.stringify(normalizeForHash(value)));\n}\n\nfunction hashCommandArgs(installationId: string, args: string[]): { hashes: string[]; digest: string } {\n return {\n hashes: args.map((arg) => hashWithInstallationId(installationId, arg)),\n digest: hashWithInstallationId(installationId, args.join(\"\\u0000\")),\n };\n}\n\nfunction hashTelemetryErrorFingerprint(\n installationId: string,\n command: string,\n errorCode: string | undefined,\n errorMessage: string | undefined,\n): string {\n const normalizedMessage = sanitizeString(typeof errorMessage === \"string\" ? errorMessage : \"\", \"redacted\");\n const normalizedCode = typeof errorCode === \"string\" && errorCode.length > 0 ? errorCode : \"unknown_error\";\n const fingerprintSource = `${command}\\u0000${normalizedCode}\\u0000${normalizedMessage}`;\n return hashWithInstallationId(installationId, fingerprintSource);\n}\n\nfunction telemetryDisabledByEnvironment(): boolean {\n return (\n PM_TELEMETRY_DISABLED_VALUES.has((process.env[PM_TELEMETRY_DISABLED_ENV] ?? \"\").trim().toLowerCase()) ||\n PM_TELEMETRY_DISABLED_VALUES.has((process.env[PM_NO_TELEMETRY_ENV] ?? \"\").trim().toLowerCase())\n );\n}\n\nfunction resolveOtelTracesEndpoint(): string | null {\n if (PM_TELEMETRY_OTEL_DISABLED_VALUES.has((process.env[PM_TELEMETRY_OTEL_DISABLED_ENV] ?? \"\").trim().toLowerCase())) {\n return null;\n }\n\n const directEndpoint = (process.env[OTEL_TRACES_ENDPOINT_ENV] ?? \"\").trim();\n if (directEndpoint.length > 0) {\n try {\n return new URL(directEndpoint).toString();\n } catch {\n return null;\n }\n }\n\n const baseEndpoint = (process.env[OTEL_BASE_ENDPOINT_ENV] ?? \"\").trim();\n if (baseEndpoint.length === 0) {\n return null;\n }\n\n try {\n const url = new URL(baseEndpoint);\n const normalizedPath = url.pathname.replace(/\\/+$/, \"\");\n if (!normalizedPath.endsWith(\"/v1/traces\")) {\n url.pathname = `${normalizedPath.length === 0 ? \"\" : normalizedPath}/v1/traces`;\n }\n return url.toString();\n } catch {\n return null;\n }\n}\n\nfunction isoToUnixNano(iso: string): string {\n const parsedMs = Date.parse(iso);\n const epochMs = Number.isNaN(parsedMs) ? Date.now() : parsedMs;\n return `${BigInt(epochMs) * 1_000_000n}`;\n}\n\nfunction otlpStringAttribute(key: string, value: string): { key: string; value: { stringValue: string } } {\n return {\n key,\n value: { stringValue: value },\n };\n}\n\nfunction otlpBoolAttribute(key: string, value: boolean): { key: string; value: { boolValue: boolean } } {\n return {\n key,\n value: { boolValue: value },\n };\n}\n\nfunction otlpIntAttribute(key: string, value: number): { key: string; value: { intValue: string } } {\n return {\n key,\n value: { intValue: String(Math.max(0, Math.trunc(value))) },\n };\n}\n\n/**\n * Build the OTLP trace-export request for a finished command without performing\n * any network I/O. Returns `null` when OTLP export is not configured (no traces\n * endpoint / trace ids). The actual POST is deferred to the detached flush worker\n * via {@link enqueuePendingOtelSpan} so the foreground command never blocks on a\n * connecting socket (GH-209).\n */\nfunction buildOtelSpanRequest(\n activeCommand: ActiveTelemetryCommand,\n outcome: { ok: boolean; error?: string; exit_code?: number; error_code?: string; error_category?: TelemetryErrorCategory },\n finishedAtIso: string,\n durationMs: number,\n): { endpoint: string; payload: unknown } | null {\n if (\n typeof activeCommand.otel_traces_endpoint !== \"string\" ||\n activeCommand.otel_traces_endpoint.trim().length === 0 ||\n typeof activeCommand.otel_trace_id !== \"string\" ||\n activeCommand.otel_trace_id.length === 0 ||\n typeof activeCommand.otel_span_id !== \"string\" ||\n activeCommand.otel_span_id.length === 0\n ) {\n return null;\n }\n\n const serviceNameCandidate = sanitizeString((process.env[OTEL_SERVICE_NAME_ENV] ?? \"\").trim());\n const serviceName = serviceNameCandidate.length > 0 ? serviceNameCandidate : \"pm-cli\";\n const normalizedExitCode = normalizeTelemetryExitCode(outcome.exit_code, outcome.ok);\n const normalizedErrorCode = normalizeTelemetryErrorCode(outcome.error_code);\n const normalizedErrorCategory = normalizeTelemetryErrorCategory({\n ok: outcome.ok,\n errorCode: normalizedErrorCode,\n errorCategory: outcome.error_category,\n });\n const attributes: Array<\n | ReturnType<typeof otlpStringAttribute>\n | ReturnType<typeof otlpBoolAttribute>\n | ReturnType<typeof otlpIntAttribute>\n > = [\n otlpStringAttribute(\"pm.command\", sanitizeString(activeCommand.command)),\n otlpStringAttribute(\"pm.version\", activeCommand.pm_version),\n otlpStringAttribute(\"pm.source_context\", activeCommand.source_context),\n otlpStringAttribute(\"pm.source_context_source\", activeCommand.source_context_source),\n otlpStringAttribute(\"pm.installation_id\", activeCommand.installation_id),\n otlpStringAttribute(\"pm.session_id\", PROCESS_SESSION_ID),\n otlpStringAttribute(\"pm.pm_root_hash\", activeCommand.pm_root_hash),\n otlpStringAttribute(\"pm.cwd_hash\", activeCommand.cwd_hash),\n otlpBoolAttribute(\"pm.ok\", outcome.ok),\n otlpIntAttribute(\"pm.exit_code\", normalizedExitCode),\n otlpIntAttribute(\"pm.duration_ms\", durationMs),\n ];\n if (typeof normalizedErrorCode === \"string\") {\n attributes.push(otlpStringAttribute(\"pm.error_code\", normalizedErrorCode));\n }\n if (typeof normalizedErrorCategory === \"string\") {\n attributes.push(otlpStringAttribute(\"pm.error_category\", normalizedErrorCategory));\n }\n if (typeof outcome.error === \"string\" && outcome.error.trim().length > 0) {\n attributes.push(otlpStringAttribute(\"pm.error\", sanitizeString(outcome.error)));\n }\n\n const payload = {\n resourceSpans: [\n {\n resource: {\n attributes: [otlpStringAttribute(\"service.name\", serviceName)],\n },\n scopeSpans: [\n {\n scope: {\n name: \"pm-cli.telemetry\",\n version: \"1\",\n },\n spans: [\n {\n traceId: activeCommand.otel_trace_id,\n spanId: activeCommand.otel_span_id,\n name: `pm.command.${sanitizeString(activeCommand.command)}`,\n kind: 1,\n startTimeUnixNano: isoToUnixNano(activeCommand.started_at),\n endTimeUnixNano: isoToUnixNano(finishedAtIso),\n attributes,\n status: {\n code: outcome.ok ? 1 : 2,\n message: outcome.ok\n ? \"\"\n : sanitizeString(typeof outcome.error === \"string\" ? outcome.error : \"command_failed\"),\n },\n },\n ],\n },\n ],\n },\n ],\n };\n\n return { endpoint: activeCommand.otel_traces_endpoint, payload };\n}\n\nfunction summarizeResult(\n result: unknown,\n captureLevel: Exclude<TelemetryCaptureLevel, \"minimal\"> = \"redacted\",\n): Record<string, unknown> {\n if (result === null || result === undefined) {\n return { type: \"nullish\" };\n }\n if (typeof result === \"string\") {\n return { type: \"string\", value: sanitizeString(result, captureLevel) };\n }\n if (typeof result === \"number\" || typeof result === \"boolean\") {\n return { type: typeof result, value: result };\n }\n if (Array.isArray(result)) {\n return {\n type: \"array\",\n length: result.length,\n sample: result.slice(0, 5).map((entry) => sanitizeValue(entry, undefined, captureLevel)),\n };\n }\n if (typeof result === \"object\") {\n const record = result as Record<string, unknown>;\n const keys = Object.keys(record).sort((left, right) => left.localeCompare(right));\n const sanitized: Record<string, unknown> = {};\n let previewBytes = 0;\n for (const key of keys.slice(0, 25)) {\n const sanitizedValue = sanitizeValue(record[key], key, captureLevel);\n const entrySize = JSON.stringify(sanitizedValue).length;\n if (previewBytes + entrySize > TELEMETRY_RESULT_PREVIEW_MAX_BYTES) {\n sanitized[key] = \"[preview_truncated]\";\n break;\n }\n previewBytes += entrySize;\n sanitized[key] = sanitizedValue;\n }\n return {\n type: \"object\",\n key_count: keys.length,\n keys_preview: keys.slice(0, 50),\n preview: sanitized,\n };\n }\n return { type: typeof result, value: String(result) };\n}\n\nfunction buildCommandStartPayload(params: {\n captureLevel: TelemetryCaptureLevel;\n context: TelemetryCommandContext;\n pmVersion: string;\n sourceContext: ResolvedTelemetrySourceContext;\n pmRootHash: string;\n cwdHash: string;\n installationId: string;\n}): Record<string, unknown> {\n const { captureLevel, context, pmVersion, sourceContext, pmRootHash, cwdHash, installationId } = params;\n const commandTaxonomy = deriveTelemetryCommandTaxonomy(context.command);\n const hashedArgs = hashCommandArgs(installationId, context.args);\n const commandInvocationDigest = hashWithInstallationId(installationId, `${context.command}\\u0000${context.args.join(\"\\u0000\")}`);\n const commandOptionsDigest = hashTelemetryValue(installationId, context.options);\n const globalOptionsDigest = hashTelemetryValue(installationId, context.global);\n const authorContextFields = buildAuthorContextPayloadFields(captureLevel, installationId);\n if (captureLevel === \"minimal\") {\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_args_digest: hashedArgs.digest,\n command_invocation_digest: commandInvocationDigest,\n command_options_digest: commandOptionsDigest,\n global_options_digest: globalOptionsDigest,\n ...authorContextFields,\n };\n }\n return {\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n ...authorContextFields,\n command_args: sanitizeCommandArgs(context.args, captureLevel),\n command_args_hashes: hashedArgs.hashes,\n command_args_digest: hashedArgs.digest,\n command_invocation_digest: commandInvocationDigest,\n command_options: sanitizeValue(context.options, undefined, captureLevel) as Record<string, unknown>,\n command_options_digest: commandOptionsDigest,\n global_options: sanitizeValue(context.global, undefined, captureLevel) as Record<string, unknown>,\n global_options_digest: globalOptionsDigest,\n pm_root_hash: pmRootHash,\n cwd_hash: cwdHash,\n capture_level: captureLevel,\n runtime: {\n node: process.version,\n platform: process.platform,\n arch: process.arch,\n hostname_hash: hashWithInstallationId(installationId, os.hostname()),\n stdin_tty: process.stdin.isTTY === true,\n stdout_tty: process.stdout.isTTY === true,\n },\n };\n}\n\nfunction buildCommandFinishPayload(params: {\n captureLevel: TelemetryCaptureLevel;\n pmVersion: string;\n sourceContext: ResolvedTelemetrySourceContext;\n outcome: TelemetryCommandOutcome;\n durationMs: number;\n startedAt: string;\n command: string;\n installationId: string;\n commandTaxonomy: TelemetryCommandTaxonomy;\n exitCode: number;\n errorCode?: string;\n errorCategory?: TelemetryErrorCategory;\n commandResolution: TelemetryCommandResolution;\n resolutionStage: TelemetryResolutionStage;\n}): Record<string, unknown> {\n const {\n captureLevel,\n pmVersion,\n sourceContext,\n outcome,\n durationMs,\n startedAt,\n command,\n installationId,\n commandTaxonomy,\n exitCode,\n errorCode,\n errorCategory,\n commandResolution,\n resolutionStage,\n } = params;\n const errorFingerprint =\n outcome.ok === false\n ? hashTelemetryErrorFingerprint(installationId, command, errorCode, outcome.error)\n : undefined;\n const authorContextFields = buildAuthorContextPayloadFields(captureLevel, installationId);\n if (captureLevel === \"minimal\") {\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_resolution: commandResolution,\n resolution_stage: resolutionStage,\n ok: outcome.ok,\n exit_code: exitCode,\n error_code: errorCode,\n error_category: errorCategory,\n error: outcome.error ? sanitizeString(outcome.error, \"redacted\") : undefined,\n error_fingerprint: errorFingerprint,\n duration_ms: durationMs,\n ...authorContextFields,\n };\n }\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_resolution: commandResolution,\n resolution_stage: resolutionStage,\n ...authorContextFields,\n ok: outcome.ok,\n exit_code: exitCode,\n error_code: errorCode,\n error_category: errorCategory,\n error: outcome.error ? sanitizeString(outcome.error, captureLevel) : undefined,\n error_fingerprint: errorFingerprint,\n duration_ms: durationMs,\n started_at: startedAt,\n result_summary: summarizeResult(outcome.result, captureLevel),\n };\n}\n\nfunction buildCommandErrorPayload(params: {\n captureLevel: TelemetryCaptureLevel;\n pmVersion: string;\n sourceContext: ResolvedTelemetrySourceContext;\n command: string;\n commandTaxonomy: TelemetryCommandTaxonomy;\n commandResolution: TelemetryCommandResolution;\n resolutionStage: TelemetryResolutionStage;\n args: string[];\n options: Record<string, unknown>;\n pmRootHash: string;\n cwdHash: string;\n installationId: string;\n errorCode: string;\n errorMessage: string;\n errorCategory: TelemetryErrorCategory;\n exitCode: number;\n}): Record<string, unknown> {\n const {\n captureLevel,\n pmVersion,\n sourceContext,\n command,\n commandTaxonomy,\n commandResolution,\n resolutionStage,\n args,\n options,\n pmRootHash,\n cwdHash,\n installationId,\n errorCode,\n errorMessage,\n errorCategory,\n exitCode,\n } = params;\n const attemptedArgHashes = hashCommandArgs(installationId, args);\n const attemptedCommandDigest = hashWithInstallationId(installationId, command);\n const attemptedOptionsDigest = hashTelemetryValue(installationId, options);\n const errorFingerprint = hashTelemetryErrorFingerprint(installationId, command, errorCode, errorMessage);\n if (captureLevel === \"minimal\") {\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_resolution: commandResolution,\n resolution_stage: resolutionStage,\n attempted_command_digest: attemptedCommandDigest,\n attempted_args_digest: attemptedArgHashes.digest,\n attempted_options_digest: attemptedOptionsDigest,\n error_code: errorCode,\n error_category: errorCategory,\n exit_code: exitCode,\n error: sanitizeString(errorMessage, \"redacted\"),\n error_fingerprint: errorFingerprint,\n };\n }\n\n return {\n capture_level: captureLevel,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n command_taxonomy: commandTaxonomy,\n command_resolution: commandResolution,\n resolution_stage: resolutionStage,\n attempted_command: sanitizeString(command, captureLevel),\n attempted_command_digest: attemptedCommandDigest,\n attempted_args: sanitizeCommandArgs(args, captureLevel),\n attempted_args_hashes: attemptedArgHashes.hashes,\n attempted_args_digest: attemptedArgHashes.digest,\n attempted_options: sanitizeValue(options, undefined, captureLevel) as Record<string, unknown>,\n attempted_options_digest: attemptedOptionsDigest,\n error_code: errorCode,\n error_category: errorCategory,\n exit_code: exitCode,\n error: sanitizeString(errorMessage, captureLevel),\n error_fingerprint: errorFingerprint,\n pm_root_hash: pmRootHash,\n cwd_hash: cwdHash,\n runtime: {\n node: process.version,\n platform: process.platform,\n arch: process.arch,\n hostname_hash: hashWithInstallationId(installationId, os.hostname()),\n stdin_tty: process.stdin.isTTY === true,\n stdout_tty: process.stdout.isTTY === true,\n },\n };\n}\n\nasync function ensureInstallationId(\n globalPmRoot: string,\n): Promise<{ installationId: string; endpoint: string; retentionDays: number }> {\n const settings = await readSettings(globalPmRoot);\n let changed = false;\n if (settings.telemetry.installation_id.trim().length === 0) {\n settings.telemetry.installation_id = crypto.randomUUID();\n changed = true;\n }\n if (changed) {\n await writeSettings(globalPmRoot, settings, \"telemetry:install_id\");\n }\n return {\n installationId: settings.telemetry.installation_id,\n endpoint: settings.telemetry.endpoint,\n retentionDays: Math.max(1, Math.trunc(settings.telemetry.retention_days)),\n };\n}\n\nasync function enqueueTelemetryEvent(globalPmRoot: string, event: TelemetryEvent): Promise<void> {\n const queued: QueuedTelemetryEvent = {\n client_schema_version: TELEMETRY_CLIENT_SCHEMA_VERSION,\n event,\n attempts: 0,\n };\n let serialized = JSON.stringify(queued);\n if (serialized.length > TELEMETRY_MAX_EVENT_BYTES) {\n const trimmed = { ...event, payload: { ...event.payload, result_summary: { truncated: true, reason: \"payload_size_exceeded\", original_bytes: serialized.length } } };\n const trimmedQueued: QueuedTelemetryEvent = {\n client_schema_version: TELEMETRY_CLIENT_SCHEMA_VERSION,\n event: trimmed,\n attempts: 0,\n };\n serialized = JSON.stringify(trimmedQueued);\n }\n await withQueueMutation(async () => {\n await appendLineAtomic(queuePath(globalPmRoot), serialized);\n });\n}\n\nfunction parseQueueLines(raw: string): QueuedTelemetryEvent[] {\n const entries: QueuedTelemetryEvent[] = [];\n for (const line of raw.split(\"\\n\")) {\n const trimmed = line.trim();\n if (trimmed.length === 0) {\n continue;\n }\n try {\n const parsed = JSON.parse(trimmed) as QueuedTelemetryEvent;\n if (\n parsed &&\n typeof parsed === \"object\" &&\n parsed.event &&\n typeof parsed.event === \"object\" &&\n typeof parsed.attempts === \"number\" &&\n (\n parsed.client_schema_version === undefined ||\n (typeof parsed.client_schema_version === \"number\" && Number.isFinite(parsed.client_schema_version))\n )\n ) {\n entries.push(parsed);\n }\n } catch {\n // Drop malformed lines to preserve queue forward progress.\n }\n }\n return entries;\n}\n\nfunction nextRetryIso(attempts: number): string {\n const delay = Math.min(TELEMETRY_RETRY_BASE_DELAY_MS * 2 ** Math.max(attempts - 1, 0), TELEMETRY_MAX_RETRY_DELAY_MS);\n return new Date(Date.now() + delay).toISOString();\n}\n\nfunction isDueForRetryAt(nextAttemptAfter: string | undefined): boolean {\n if (typeof nextAttemptAfter !== \"string\" || nextAttemptAfter.trim().length === 0) {\n return true;\n }\n const dueAtMs = Date.parse(nextAttemptAfter);\n if (Number.isNaN(dueAtMs)) {\n return true;\n }\n return dueAtMs <= Date.now();\n}\n\nfunction isDueForRetry(entry: QueuedTelemetryEvent): boolean {\n return isDueForRetryAt(entry.next_attempt_after);\n}\n\nfunction retentionCutoffMs(retentionDays: number): number {\n const normalizedDays = Number.isFinite(retentionDays) ? Math.max(1, Math.trunc(retentionDays)) : 1;\n return Date.now() - normalizedDays * MILLISECONDS_PER_DAY;\n}\n\nfunction isExpiredQueueEntry(entry: QueuedTelemetryEvent, cutoffMs: number): boolean {\n const occurredAt = entry.event?.occurred_at;\n if (typeof occurredAt !== \"string\" || occurredAt.trim().length === 0) {\n return false;\n }\n const occurredAtMs = Date.parse(occurredAt);\n if (Number.isNaN(occurredAtMs)) {\n return false;\n }\n return occurredAtMs < cutoffMs;\n}\n\nfunction pruneExpiredQueueEntries(\n entries: QueuedTelemetryEvent[],\n retentionDays: number,\n): { entries: QueuedTelemetryEvent[]; prunedCount: number } {\n const cutoffMs = retentionCutoffMs(retentionDays);\n const retained: QueuedTelemetryEvent[] = [];\n let prunedCount = 0;\n for (const entry of entries) {\n const serializedSize = JSON.stringify(entry).length;\n const oversized = serializedSize > TELEMETRY_MAX_EVENT_BYTES;\n if (oversized || isExpiredQueueEntry(entry, cutoffMs) || entry.attempts >= TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS) {\n prunedCount += 1;\n continue;\n }\n retained.push(entry);\n }\n return { entries: retained, prunedCount };\n}\n\nasync function rewriteQueue(globalPmRoot: string, entries: QueuedTelemetryEvent[]): Promise<void> {\n const serialized = entries.map((entry) => JSON.stringify(entry)).join(\"\\n\");\n const contents = serialized.length > 0 ? `${serialized}\\n` : \"\";\n for (let attempt = 0; ; attempt += 1) {\n try {\n await writeFileAtomic(queuePath(globalPmRoot), contents);\n return;\n } catch (error: unknown) {\n const retryDelay = TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS[attempt];\n if (retryDelay === undefined || !isRetryableQueueRewriteError(error)) {\n throw error;\n }\n await sleep(retryDelay);\n }\n }\n}\n\nfunction isRetryableQueueRewriteError(error: unknown): boolean {\n if (typeof error !== \"object\" || error === null || !(\"code\" in error)) {\n return false;\n }\n const code = (error as { code?: unknown }).code;\n return code === \"EACCES\" || code === \"EBUSY\" || code === \"EPERM\";\n}\n\nfunction sleep(milliseconds: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, milliseconds);\n });\n}\n\n/**\n * Append a built OTLP span request to the bounded pending-spans queue. The\n * detached flush worker drains and POSTs these so the foreground command never\n * performs OTLP network I/O (GH-209). Best effort: a write failure never blocks\n * the command, and the span is simply not exported.\n */\nasync function enqueuePendingOtelSpan(globalPmRoot: string, request: { endpoint: string; payload: unknown }): Promise<void> {\n const pending: PendingOtelSpan = {\n id: crypto.randomUUID(),\n endpoint: request.endpoint,\n payload: request.payload,\n enqueued_at: nowIso(),\n attempts: 0,\n };\n const serialized = JSON.stringify(pending);\n // Drop oversized spans rather than poison the queue; they would never flush.\n if (serialized.length > TELEMETRY_MAX_EVENT_BYTES) {\n return;\n }\n await withQueueMutation(async () => {\n await appendLineAtomic(otelSpansQueuePath(globalPmRoot), serialized);\n });\n}\n\n/**\n * Derive a stable id for a legacy id-less pending span from its identity fields.\n * Deterministic so the same on-disk line yields the same id across reads, which\n * is what lets reconciliation remove/update it after a flush.\n */\nfunction backfillPendingOtelSpanId(entry: { endpoint: string; enqueued_at: string; payload: unknown }): string {\n const material = JSON.stringify([entry.endpoint, entry.enqueued_at, entry.payload]);\n return crypto.createHash(\"sha256\").update(material).digest(\"hex\").slice(0, 32);\n}\n\nfunction parsePendingOtelSpanLines(raw: string): PendingOtelSpan[] {\n const entries: PendingOtelSpan[] = [];\n for (const line of raw.split(\"\\n\")) {\n const trimmed = line.trim();\n if (trimmed.length === 0) {\n continue;\n }\n try {\n const parsed = JSON.parse(trimmed) as PendingOtelSpan;\n if (\n parsed &&\n typeof parsed === \"object\" &&\n typeof parsed.endpoint === \"string\" &&\n parsed.endpoint.trim().length > 0 &&\n \"payload\" in parsed &&\n typeof parsed.attempts === \"number\" &&\n Number.isFinite(parsed.attempts)\n ) {\n // Backfill an id for legacy entries written before id tracking existed.\n // It MUST be deterministic from the entry's content so the post-flush\n // re-read derives the same id and reconciliation can address the entry;\n // a random id would differ between reads and strand the span.\n if (typeof parsed.id !== \"string\" || parsed.id.length === 0) {\n parsed.id = backfillPendingOtelSpanId(parsed);\n }\n entries.push(parsed);\n }\n } catch {\n // Drop malformed lines to preserve forward progress.\n }\n }\n return entries;\n}\n\nfunction isExpiredPendingOtelSpan(entry: PendingOtelSpan, cutoffMs: number): boolean {\n if (typeof entry.enqueued_at !== \"string\" || entry.enqueued_at.trim().length === 0) {\n return false;\n }\n const enqueuedAtMs = Date.parse(entry.enqueued_at);\n if (Number.isNaN(enqueuedAtMs)) {\n return false;\n }\n return enqueuedAtMs < cutoffMs;\n}\n\nfunction prunePendingOtelSpans(\n entries: PendingOtelSpan[],\n retentionDays: number,\n): { entries: PendingOtelSpan[]; prunedCount: number } {\n const cutoffMs = retentionCutoffMs(retentionDays);\n const retained: PendingOtelSpan[] = [];\n let prunedCount = 0;\n for (const entry of entries) {\n const oversized = JSON.stringify(entry).length > TELEMETRY_MAX_EVENT_BYTES;\n if (oversized || isExpiredPendingOtelSpan(entry, cutoffMs) || entry.attempts >= TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS) {\n prunedCount += 1;\n continue;\n }\n retained.push(entry);\n }\n if (retained.length > TELEMETRY_OTEL_SPANS_MAX_PENDING) {\n const overflow = retained.length - TELEMETRY_OTEL_SPANS_MAX_PENDING;\n prunedCount += overflow;\n // Keep the most recently enqueued spans; oldest beyond the cap are dropped.\n return { entries: retained.slice(overflow), prunedCount };\n }\n return { entries: retained, prunedCount };\n}\n\nasync function rewritePendingOtelSpans(globalPmRoot: string, entries: PendingOtelSpan[]): Promise<void> {\n const serialized = entries.map((entry) => JSON.stringify(entry)).join(\"\\n\");\n const contents = serialized.length > 0 ? `${serialized}\\n` : \"\";\n for (let attempt = 0; ; attempt += 1) {\n try {\n await writeFileAtomic(otelSpansQueuePath(globalPmRoot), contents);\n return;\n } catch (error: unknown) {\n const retryDelay = TELEMETRY_QUEUE_REWRITE_RETRY_DELAYS_MS[attempt];\n if (retryDelay === undefined || !isRetryableQueueRewriteError(error)) {\n throw error;\n }\n await sleep(retryDelay);\n }\n }\n}\n\n/**\n * Drain the pending OTLP span queue and POST due spans to their traces endpoint.\n * Runs only inside the flush worker (detached child) or the inline test path, so\n * the foreground command never makes OTLP network calls. Failures increment\n * per-span attempts with backoff and are retried by a later flush; runtime state\n * records OTLP export diagnostics for `pm health` (GH-205).\n */\n/**\n * Re-read the spans queue under the mutation serializer and rewrite it with the\n * processed spans removed/updated by id, preserving any spans a concurrent\n * foreground process appended during the (network) flush window. `succeededIds`\n * are dropped; `failedUpdates` patch attempts/next_attempt_after by id; all other\n * (incl. newly-appended) entries are retained, then pruned. Returns the count of\n * spans left in the queue. Mirrors removeFlushedEntriesFromCurrentQueue.\n */\nasync function reconcilePendingOtelSpansAfterFlush(\n globalPmRoot: string,\n retentionDays: number,\n succeededIds: ReadonlySet<string>,\n failedUpdates: ReadonlyMap<string, { attempts: number; next_attempt_after: string }>,\n): Promise<number> {\n return withQueueMutation(async () => {\n const raw = await readFileIfExists(otelSpansQueuePath(globalPmRoot));\n const current = raw === null ? [] : parsePendingOtelSpanLines(raw);\n const reconciled: PendingOtelSpan[] = [];\n for (const entry of current) {\n if (succeededIds.has(entry.id)) {\n continue;\n }\n const failure = failedUpdates.get(entry.id);\n reconciled.push(failure ? { ...entry, attempts: failure.attempts, next_attempt_after: failure.next_attempt_after } : entry);\n }\n const { entries: retained } = prunePendingOtelSpans(reconciled, retentionDays);\n await rewritePendingOtelSpans(globalPmRoot, retained);\n return retained.length;\n });\n}\n\nasync function flushPendingOtelSpans(globalPmRoot: string, retentionDays: number): Promise<void> {\n const raw = await readFileIfExists(otelSpansQueuePath(globalPmRoot));\n if (raw === null || raw.trim().length === 0) {\n await writeRuntimeState(globalPmRoot, { pending_otel_spans: 0 });\n return;\n }\n const entries = parsePendingOtelSpanLines(raw);\n const { entries: retained, prunedCount } = prunePendingOtelSpans(entries, retentionDays);\n const due = retained.filter((entry) => isDueForRetryAt(entry.next_attempt_after)).slice(\n 0,\n TELEMETRY_OTEL_SPANS_FLUSH_BATCH_SIZE,\n );\n if (due.length === 0) {\n // Nothing to POST. Still reconcile so pruning persists, but only if pruning\n // actually changed the on-disk set (avoids a redundant rewrite each command).\n const remaining = prunedCount > 0 ? await reconcilePendingOtelSpansAfterFlush(globalPmRoot, retentionDays, new Set(), new Map()) : retained.length;\n await writeRuntimeState(globalPmRoot, { pending_otel_spans: remaining });\n return;\n }\n\n const attemptTime = nowIso();\n const succeededIds = new Set<string>();\n const failedUpdates = new Map<string, { attempts: number; next_attempt_after: string }>();\n let succeededCount = 0;\n let lastError: string | undefined;\n // Export the batch concurrently so a slow/blackholed collector caps the worker\n // at one TELEMETRY_HTTP_TIMEOUT_MS rather than batch-size x timeout — keeping it\n // well within the flush-lock TTL. The Set/Map/counter mutations are synchronous\n // and safe under Node's single-threaded event loop.\n await Promise.all(\n due.map(async (span) => {\n try {\n const response = await fetch(span.endpoint, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify(span.payload),\n signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS),\n });\n if (!response.ok) {\n throw new Error(`local_otel_export_http_${response.status}`);\n }\n succeededIds.add(span.id);\n succeededCount += 1;\n } catch (error: unknown) {\n lastError = error instanceof Error ? sanitizeString(error.message, \"redacted\") : \"local_otel_export_failed\";\n const nextAttempts = span.attempts + 1;\n failedUpdates.set(span.id, { attempts: nextAttempts, next_attempt_after: nextRetryIso(nextAttempts) });\n }\n }),\n );\n\n const remaining = await reconcilePendingOtelSpansAfterFlush(globalPmRoot, retentionDays, succeededIds, failedUpdates);\n const statePatch: TelemetryRuntimeState = {\n pending_otel_spans: remaining,\n last_otel_attempt_at: attemptTime,\n };\n if (succeededCount > 0) {\n statePatch.last_otel_success_at = attemptTime;\n }\n if (lastError !== undefined) {\n statePatch.last_otel_failure_at = attemptTime;\n statePatch.last_otel_failure_error = lastError;\n } else if (remaining === 0) {\n // Only clear the failure diagnostic once the queue is fully drained. A\n // clean batch while other (not-yet-due) spans still wait could be hiding\n // earlier failures; keep the last known failure until nothing is pending.\n statePatch.last_otel_failure_at = undefined;\n statePatch.last_otel_failure_error = undefined;\n }\n await writeRuntimeState(globalPmRoot, statePatch);\n}\n\n/**\n * Flush both telemetry artifacts under the same worker invocation: the event\n * ingest queue and the pending OTLP span queue. Used by the detached flush\n * worker and the inline (test) path so OTLP export always happens off the\n * foreground command's critical path.\n */\nasync function flushTelemetryArtifacts(globalPmRoot: string, endpoint: string, retentionDays: number): Promise<void> {\n // Isolate the two artifacts: a failure flushing the event queue (e.g. a corrupt\n // queue file) must not strand the OTLP span flush in the same pass, and vice\n // versa. Both are best effort and retried on the next dispatch.\n try {\n await flushQueue(globalPmRoot, endpoint, retentionDays);\n } catch {\n // Best effort; event-queue flush is retried on the next dispatch.\n }\n try {\n await flushPendingOtelSpans(globalPmRoot, retentionDays);\n } catch {\n // Best effort; span flush is retried on the next dispatch.\n }\n}\n\nasync function cleanupTelemetryQueueTempOrphans(\n globalPmRoot: string,\n maxAgeMs = TELEMETRY_QUEUE_TMP_ORPHAN_MAX_AGE_MS,\n): Promise<void> {\n try {\n const dirPath = telemetryRuntimeDirectory(globalPmRoot);\n const entries = await readdir(dirPath, { withFileTypes: true });\n const cutoffMs = Date.now() - Math.max(0, maxAgeMs);\n await Promise.all(\n entries\n .filter((entry) => entry.isFile() && /^\\.events\\.jsonl\\.\\d+\\.\\d+\\.[a-f0-9]+\\.tmp$/.test(entry.name))\n .map(async (entry) => {\n const candidate = path.join(dirPath, entry.name);\n const candidateStats = await stat(candidate);\n if (candidateStats.mtimeMs < cutoffMs) {\n await rm(candidate, { force: true });\n }\n }),\n );\n } catch {\n // Telemetry cleanup is best-effort and must not affect command execution.\n }\n}\n\nasync function withQueueMutation<T>(operation: () => Promise<T>): Promise<T> {\n const run = _queueMutationPromise.catch(\n /* c8 ignore next */\n () => {},\n ).then(operation);\n _queueMutationPromise = run.catch(\n /* c8 ignore next */\n () => {},\n );\n return run;\n}\n\nasync function readCurrentQueueEntries(globalPmRoot: string): Promise<QueuedTelemetryEvent[]> {\n const raw = await readFileIfExists(queuePath(globalPmRoot));\n if (raw === null || raw.trim().length === 0) {\n return [];\n }\n return parseQueueLines(raw);\n}\n\nasync function removeFlushedEntriesFromCurrentQueue(\n globalPmRoot: string,\n flushedIds: ReadonlySet<string>,\n retentionDays: number,\n): Promise<QueuedTelemetryEvent[]> {\n return withQueueMutation(async () => {\n const currentEntries = await readCurrentQueueEntries(globalPmRoot);\n const { entries: retainedEntries } = pruneExpiredQueueEntries(currentEntries, retentionDays);\n const remaining = retainedEntries.filter((entry) => !flushedIds.has(entry.event.event_id));\n await rewriteQueue(globalPmRoot, remaining);\n return remaining;\n });\n}\n\nasync function markFailedEntriesInCurrentQueue(\n globalPmRoot: string,\n failedIds: ReadonlySet<string>,\n attemptTime: string,\n retentionDays: number,\n): Promise<QueuedTelemetryEvent[]> {\n return withQueueMutation(async () => {\n const currentEntries = await readCurrentQueueEntries(globalPmRoot);\n const { entries: retainedEntries } = pruneExpiredQueueEntries(currentEntries, retentionDays);\n const retried = retainedEntries.map((entry) => {\n if (!failedIds.has(entry.event.event_id)) {\n return entry;\n }\n const attempts = entry.attempts + 1;\n return {\n ...entry,\n attempts,\n last_attempt_at: attemptTime,\n next_attempt_after: nextRetryIso(attempts),\n };\n });\n await rewriteQueue(globalPmRoot, retried);\n return retried;\n });\n}\n\nasync function flushQueue(globalPmRoot: string, endpoint: string, retentionDays: number): Promise<void> {\n await cleanupTelemetryQueueTempOrphans(globalPmRoot);\n const normalizedEndpoint = endpoint.trim();\n if (normalizedEndpoint.length === 0) {\n return;\n }\n const raw = await readFileIfExists(queuePath(globalPmRoot));\n if (raw === null || raw.trim().length === 0) {\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: 0,\n });\n return;\n }\n const queueEntries = parseQueueLines(raw);\n if (queueEntries.length === 0) {\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: 0,\n });\n return;\n }\n const { entries: retainedEntries, prunedCount } = pruneExpiredQueueEntries(queueEntries, retentionDays);\n if (retainedEntries.length === 0) {\n await rewriteQueue(globalPmRoot, []);\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: 0,\n });\n return;\n }\n const dueEntries = retainedEntries.filter((entry) => isDueForRetry(entry)).slice(0, TELEMETRY_FLUSH_BATCH_SIZE);\n if (dueEntries.length === 0) {\n if (prunedCount > 0) {\n await rewriteQueue(globalPmRoot, retainedEntries);\n }\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: retainedEntries.length,\n });\n return;\n }\n const dueIds = new Set(dueEntries.map((entry) => entry.event.event_id));\n const attemptTime = nowIso();\n const requestHeaders: Record<string, string> = {\n \"content-type\": \"application/json\",\n };\n const ingestKey = process.env.PM_TELEMETRY_INGEST_KEY?.trim();\n if (ingestKey) {\n requestHeaders[\"x-pm-telemetry-key\"] = ingestKey;\n }\n\n try {\n const response = await fetch(normalizedEndpoint, {\n method: \"POST\",\n headers: requestHeaders,\n body: JSON.stringify({\n schema_version: TELEMETRY_SCHEMA_VERSION,\n events: dueEntries.map((entry) => entry.event),\n }),\n signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS),\n });\n if (!response.ok) {\n throw new Error(`telemetry_flush_http_${response.status}`);\n }\n } catch (error: unknown) {\n const retried = await markFailedEntriesInCurrentQueue(globalPmRoot, dueIds, attemptTime, retentionDays);\n const errorMessage = (() => {\n if (error instanceof Error) {\n return sanitizeString(error.message, \"redacted\");\n }\n return \"telemetry_flush_failed\";\n })();\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: retried.length,\n last_attempted_flush_at: attemptTime,\n last_failed_flush_at: attemptTime,\n last_failed_flush_error: errorMessage,\n });\n return;\n }\n\n try {\n const remaining = await removeFlushedEntriesFromCurrentQueue(globalPmRoot, dueIds, retentionDays);\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: remaining.length,\n last_attempted_flush_at: attemptTime,\n last_successful_flush_at: attemptTime,\n last_failed_flush_at: undefined,\n last_failed_flush_error: undefined,\n });\n /* c8 ignore start */\n } catch (error: unknown) {\n const errorMessage = (() => {\n if (error instanceof Error) {\n return sanitizeString(error.message, \"redacted\");\n }\n return \"telemetry_flush_failed\";\n })();\n const currentEntries = await readCurrentQueueEntries(globalPmRoot).catch(() => retainedEntries);\n await writeRuntimeState(globalPmRoot, {\n endpoint: normalizedEndpoint,\n queue_entries: currentEntries.length,\n last_attempted_flush_at: attemptTime,\n last_failed_flush_at: attemptTime,\n last_failed_flush_error: errorMessage,\n });\n }\n /* c8 ignore stop */\n}\n\nasync function acquireTelemetryFlushLock(globalPmRoot: string): Promise<boolean> {\n const lockPath = flushLockPath(globalPmRoot);\n await mkdir(path.dirname(lockPath), { recursive: true });\n try {\n await mkdir(lockPath);\n return true;\n } catch (error: unknown) {\n if (typeof error !== \"object\" || error === null || !(\"code\" in error) || (error as { code?: unknown }).code !== \"EEXIST\") {\n throw error;\n }\n }\n\n try {\n const lockStats = await stat(lockPath);\n if (Date.now() - lockStats.mtimeMs < TELEMETRY_FLUSH_LOCK_STALE_MS) {\n return false;\n }\n await rm(lockPath, { recursive: true, force: true });\n await mkdir(lockPath);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isFreshDirectoryLock(lockPath: string, staleMs: number): boolean {\n try {\n return Date.now() - statSync(lockPath).mtimeMs < staleMs;\n } catch {\n return false;\n }\n}\n\nfunction removeDirectoryLockBestEffort(lockPath: string): void {\n try {\n rmSync(lockPath, { recursive: true, force: true });\n } catch {\n // Flush scheduling is best effort and must never fail user commands.\n }\n}\n\nfunction errorCode(error: unknown): string | undefined {\n if (typeof error !== \"object\" || error === null || !(\"code\" in error)) {\n return undefined;\n }\n const code = (error as { code?: unknown }).code;\n return typeof code === \"string\" ? code : undefined;\n}\n\nfunction createDirectoryLock(lockPath: string): boolean {\n try {\n mkdirSync(lockPath);\n return true;\n } catch (error: unknown) {\n const code = errorCode(error);\n if (code === \"EEXIST\") {\n return false;\n }\n if (code !== \"ENOENT\") {\n return false;\n }\n }\n\n /* c8 ignore start */\n try {\n mkdirSync(path.dirname(lockPath), { recursive: true });\n mkdirSync(lockPath);\n return true;\n } catch {\n return false;\n }\n /* c8 ignore stop */\n}\n\nfunction acquireTelemetryFlushSpawnGate(globalPmRoot: string): boolean {\n if (isFreshDirectoryLock(flushLockPath(globalPmRoot), TELEMETRY_FLUSH_LOCK_STALE_MS)) {\n return false;\n }\n\n const lockPath = flushSpawnLockPath(globalPmRoot);\n try {\n if (Date.now() - statSync(lockPath).mtimeMs < TELEMETRY_FLUSH_SPAWN_LOCK_STALE_MS) {\n return false;\n }\n removeDirectoryLockBestEffort(lockPath);\n } catch (error: unknown) {\n if (errorCode(error) !== \"ENOENT\") {\n return false;\n }\n }\n\n return createDirectoryLock(lockPath);\n}\n\nfunction releaseTelemetryFlushSpawnGate(globalPmRoot: string): void {\n removeDirectoryLockBestEffort(flushSpawnLockPath(globalPmRoot));\n}\n\nexport const _testOnly = {\n acquireTelemetryFlushSpawnGate,\n acquireTelemetryFlushLock,\n buildAuthorContextPayloadFields,\n buildCommandErrorPayload,\n buildCommandFinishPayload,\n buildCommandStartPayload,\n buildOtelSpanRequest,\n createDirectoryLock,\n enqueuePendingOtelSpan,\n enqueueTelemetryEvent,\n errorCode,\n flushPendingOtelSpans,\n flushQueue,\n flushQueueWithProcessLock,\n flushTelemetryArtifacts,\n hashTelemetryErrorFingerprint,\n hashTelemetryValue,\n isEmailDomainCharacter,\n isEmailLocalCharacter,\n isExpiredPendingOtelSpan,\n isExpiredQueueEntry,\n isFreshDirectoryLock,\n isDueForRetry,\n isDueForRetryAt,\n isRetryableQueueRewriteError,\n looksLikeEmailToken,\n otelSpansQueuePath,\n parseBooleanTrueLike,\n parsePendingOtelSpanLines,\n prunePendingOtelSpans,\n reconcilePendingOtelSpansAfterFlush,\n retentionCutoffMs,\n resolveOtelTracesEndpoint,\n rewritePendingOtelSpans,\n normalizeForHash,\n normalizeCaptureLevel,\n normalizePmVersion,\n normalizeTelemetryErrorCategory,\n normalizeTelemetryErrorCode,\n normalizeTelemetryExitCode,\n parseQueueLines,\n pruneExpiredQueueEntries,\n readRuntimeState,\n readCurrentQueueEntries,\n releaseTelemetryFlushSpawnGate,\n removeFlushedEntriesFromCurrentQueue,\n removeDirectoryLockBestEffort,\n resolveTelemetrySourceContext,\n rewriteQueue,\n sanitizeCommandArgs,\n sanitizeStringMax,\n sanitizeStringRedacted,\n sanitizeValue,\n scheduleTelemetryFlush,\n shouldFlushInline,\n sleep,\n summarizeResult,\n telemetryFlushRunnerPath,\n withQueueMutation,\n flushLockPath,\n flushSpawnLockPath,\n runtimeStatePath,\n writeRuntimeState,\n};\n\nasync function flushQueueWithProcessLock(globalPmRoot: string, endpoint: string, retentionDays: number): Promise<void> {\n const acquired = await acquireTelemetryFlushLock(globalPmRoot);\n releaseTelemetryFlushSpawnGate(globalPmRoot);\n if (!acquired) {\n return;\n }\n try {\n await flushTelemetryArtifacts(globalPmRoot, endpoint, retentionDays);\n } finally {\n try {\n await rm(flushLockPath(globalPmRoot), { recursive: true, force: true });\n } catch {\n // Best effort lock cleanup; stale locks are recovered by TTL checks.\n }\n }\n}\n\nfunction scheduleTelemetryFlush(globalPmRoot: string, endpoint: string, retentionDays: number): void {\n if (shouldFlushInline()) {\n const previousFlush = _lastFlushPromise;\n const nextFlush = flushTelemetryArtifacts(globalPmRoot, endpoint, retentionDays);\n _lastFlushPromise = Promise.allSettled([previousFlush, nextFlush]).then(() => {});\n return;\n }\n\n try {\n const acquiredSpawnGate = acquireTelemetryFlushSpawnGate(globalPmRoot);\n if (!acquiredSpawnGate) {\n return;\n }\n const child = spawn(process.execPath, [telemetryFlushRunnerPath()], {\n detached: true,\n stdio: \"ignore\",\n // Detached workers inherit cwd by default. On Windows that can keep a\n // disposable project directory locked after the foreground command exits.\n cwd: os.tmpdir(),\n env: {\n ...process.env,\n PM_GLOBAL_PATH: globalPmRoot,\n [PM_TELEMETRY_FLUSH_CHILD_ENV]: \"1\",\n },\n });\n // A detached spawn can fail asynchronously — the runtime cannot launch the\n // executable (locked-down Windows runners, missing flush runner, EACCES).\n // Node re-throws an 'error' event with no listener as an uncaught exception,\n // which would crash the foreground CLI and, under the test runner, the\n // vitest worker during teardown (GH-348). Flush is strictly best effort, so\n // swallow the failure and release the spawn gate to permit a later retry.\n child.on(\"error\", () => {\n releaseTelemetryFlushSpawnGate(globalPmRoot);\n });\n child.unref();\n } catch {\n releaseTelemetryFlushSpawnGate(globalPmRoot);\n // Flush scheduling is best effort and must not keep the CLI alive.\n }\n}\n\n/**\n * Implements flush telemetry queue now for the public runtime surface of this module.\n */\nexport async function flushTelemetryQueueNow(globalPmRoot = resolveGlobalPmRoot(process.cwd())): Promise<void> {\n if (telemetryDisabledByEnvironment()) {\n return;\n }\n try {\n const settings = await readSettings(globalPmRoot);\n if (!settings.telemetry.enabled) {\n return;\n }\n const { endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);\n await flushQueueWithProcessLock(globalPmRoot, endpoint, retentionDays);\n } catch {\n // Telemetry workers are best effort and must never fail user commands.\n }\n}\n\n/**\n * Implements start telemetry command for the public runtime surface of this module.\n */\nexport async function startTelemetryCommand(context: TelemetryCommandContext): Promise<ActiveTelemetryCommand | null> {\n if (telemetryDisabledByEnvironment()) {\n return null;\n }\n if (\n context.command === \"telemetry\" &&\n context.args.some((token) => token.trim().toLowerCase() === \"clear\")\n ) {\n return null;\n }\n try {\n const globalPmRoot = resolveGlobalPmRoot(process.cwd());\n const settings = await readSettings(globalPmRoot);\n if (!settings.telemetry.enabled) {\n return null;\n }\n const captureLevel = normalizeCaptureLevel(settings.telemetry.capture_level);\n const { installationId, endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);\n const pmVersion = normalizePmVersion(context.pm_version);\n const sourceContext = resolveTelemetrySourceContext(context.global);\n const pmRootHash = hashWithInstallationId(installationId, context.pm_root);\n const cwdHash = hashWithInstallationId(installationId, process.cwd());\n const otelTracesEndpoint = resolveOtelTracesEndpoint();\n const occurredAt = nowIso();\n const event: TelemetryEvent = {\n schema_version: TELEMETRY_SCHEMA_VERSION,\n event_id: crypto.randomUUID(),\n event_type: \"command_start\",\n occurred_at: occurredAt,\n installation_id: installationId,\n session_id: PROCESS_SESSION_ID,\n command: context.command,\n payload: buildCommandStartPayload({\n captureLevel,\n context,\n pmVersion,\n sourceContext,\n pmRootHash,\n cwdHash,\n installationId,\n }),\n };\n await enqueueTelemetryEvent(globalPmRoot, event);\n scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays);\n const commandTaxonomy = deriveTelemetryCommandTaxonomy(context.command);\n return {\n started_at: occurredAt,\n started_at_ms: Date.now(),\n command: context.command,\n command_taxonomy: commandTaxonomy,\n pm_version: pmVersion,\n source_context: sourceContext.source_context,\n source_context_source: sourceContext.source_context_source,\n installation_id: installationId,\n pm_root_hash: pmRootHash,\n cwd_hash: cwdHash,\n endpoint,\n retention_days: retentionDays,\n global_pm_root: globalPmRoot,\n capture_level: captureLevel,\n otel_traces_endpoint: otelTracesEndpoint ?? undefined,\n otel_trace_id: otelTracesEndpoint ? crypto.randomBytes(16).toString(\"hex\") : undefined,\n otel_span_id: otelTracesEndpoint ? crypto.randomBytes(8).toString(\"hex\") : undefined,\n };\n } catch {\n // Telemetry must never block command execution.\n return null;\n }\n}\n\n/**\n * Implements finish telemetry command for the public runtime surface of this module.\n */\nexport async function finishTelemetryCommand(\n activeCommand: ActiveTelemetryCommand | null,\n outcome: TelemetryCommandOutcome,\n): Promise<void> {\n if (!activeCommand) {\n return;\n }\n try {\n const finishedAt = nowIso();\n const durationMs = Math.max(0, Date.now() - activeCommand.started_at_ms);\n const normalizedErrorCode = normalizeTelemetryErrorCode(\n inferTelemetryErrorCode({\n ok: outcome.ok,\n errorCode: outcome.error_code,\n errorMessage: outcome.error,\n exitCode: outcome.exit_code,\n }),\n );\n const normalizedErrorCategory = normalizeTelemetryErrorCategory({\n ok: outcome.ok,\n errorCode: normalizedErrorCode,\n errorCategory: outcome.error_category,\n });\n const normalizedExitCode = normalizeTelemetryExitCode(outcome.exit_code, outcome.ok);\n const commandResolution =\n outcome.command_resolution ??\n deriveTelemetryCommandResolution({\n ok: outcome.ok,\n errorCode: normalizedErrorCode,\n errorCategory: normalizedErrorCategory,\n });\n const resolutionStage = outcome.resolution_stage ?? \"execute\";\n const event: TelemetryEvent = {\n schema_version: TELEMETRY_SCHEMA_VERSION,\n event_id: crypto.randomUUID(),\n event_type: \"command_finish\",\n occurred_at: finishedAt,\n installation_id: activeCommand.installation_id,\n session_id: PROCESS_SESSION_ID,\n command: activeCommand.command,\n payload: buildCommandFinishPayload({\n captureLevel: activeCommand.capture_level,\n pmVersion: activeCommand.pm_version,\n sourceContext: {\n source_context: activeCommand.source_context,\n source_context_source: activeCommand.source_context_source,\n },\n outcome,\n durationMs,\n startedAt: activeCommand.started_at,\n command: activeCommand.command,\n installationId: activeCommand.installation_id,\n commandTaxonomy: activeCommand.command_taxonomy,\n exitCode: normalizedExitCode,\n errorCode: normalizedErrorCode,\n errorCategory: normalizedErrorCategory,\n commandResolution,\n resolutionStage,\n }),\n };\n await enqueueTelemetryEvent(activeCommand.global_pm_root, event);\n const otelRequest = buildOtelSpanRequest(\n activeCommand,\n {\n ...outcome,\n exit_code: normalizedExitCode,\n error_code: normalizedErrorCode,\n error_category: normalizedErrorCategory,\n },\n finishedAt,\n durationMs,\n );\n if (otelRequest) {\n // Persist the span for the detached worker; never POST inline so the\n // foreground command exits promptly even if the traces endpoint is\n // unreachable (GH-209).\n await enqueuePendingOtelSpan(activeCommand.global_pm_root, otelRequest);\n }\n scheduleTelemetryFlush(activeCommand.global_pm_root, activeCommand.endpoint, activeCommand.retention_days);\n } catch {\n // Telemetry must never block command execution.\n }\n}\n\n/**\n * Implements emit telemetry error event for the public runtime surface of this module.\n */\nexport async function emitTelemetryErrorEvent(context: TelemetryErrorEventContext): Promise<void> {\n if (telemetryDisabledByEnvironment()) {\n return;\n }\n try {\n const globalPmRoot = resolveGlobalPmRoot(process.cwd());\n const settings = await readSettings(globalPmRoot);\n if (!settings.telemetry.enabled) {\n return;\n }\n const captureLevel = normalizeCaptureLevel(settings.telemetry.capture_level);\n const { installationId, endpoint, retentionDays } = await ensureInstallationId(globalPmRoot);\n const pmVersion = normalizePmVersion(context.pm_version);\n const sourceContext = resolveTelemetrySourceContext(context.global);\n const pmRootHash = hashWithInstallationId(installationId, context.pm_root);\n const cwdHash = hashWithInstallationId(installationId, process.cwd());\n const occurredAt = nowIso();\n const normalizedErrorCode =\n normalizeTelemetryErrorCode(\n inferTelemetryErrorCode({\n ok: false,\n errorCode: context.error_code,\n errorMessage: context.error_message,\n exitCode: context.exit_code,\n }),\n ) as string;\n const normalizedErrorCategory =\n context.error_category ?? resolveTelemetryErrorCategory(normalizedErrorCode);\n const normalizedExitCode = normalizeTelemetryExitCode(context.exit_code, false);\n const normalizedCommand = context.command.trim().length > 0 ? context.command : \"<unknown>\";\n const commandTaxonomy = deriveTelemetryCommandTaxonomy(normalizedCommand);\n const commandResolution =\n context.command_resolution ??\n deriveTelemetryCommandResolution({\n ok: false,\n errorCode: normalizedErrorCode,\n errorCategory: normalizedErrorCategory,\n });\n const resolutionStage = context.resolution_stage ?? \"unknown\";\n\n const event: TelemetryEvent = {\n schema_version: TELEMETRY_SCHEMA_VERSION,\n event_id: crypto.randomUUID(),\n event_type: \"command_error\",\n occurred_at: occurredAt,\n installation_id: installationId,\n session_id: PROCESS_SESSION_ID,\n command: sanitizeString(normalizedCommand, \"redacted\"),\n payload: buildCommandErrorPayload({\n captureLevel,\n pmVersion,\n sourceContext,\n command: normalizedCommand,\n commandTaxonomy,\n commandResolution,\n resolutionStage,\n args: context.args,\n options: context.options,\n pmRootHash,\n cwdHash,\n installationId,\n errorCode: normalizedErrorCode,\n errorCategory: normalizedErrorCategory,\n exitCode: normalizedExitCode,\n errorMessage: context.error_message,\n }),\n };\n await enqueueTelemetryEvent(globalPmRoot, event);\n scheduleTelemetryFlush(globalPmRoot, endpoint, retentionDays);\n } catch {\n // Telemetry must never block command execution.\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,IAAM,sBAAsB,oBAAI,IAAI,CAAC,QAAQ,UAAU,cAAc,uBAAuB,mBAAmB,kBAAkB,CAAC;AAClI,IAAM,sBAAsB,oBAAI,IAAI;EAClC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD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