@unbrained/pm-cli 2026.7.16 → 2026.7.17

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 (508) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +17 -2
  3. package/CONTRIBUTING.md +2 -2
  4. package/dist/cli/bootstrap-args.d.ts +2 -115
  5. package/dist/cli/bootstrap-args.js +4 -831
  6. package/dist/cli/bootstrap-args.js.map +1 -1
  7. package/dist/cli/commands/eval.d.ts +4 -64
  8. package/dist/cli/commands/eval.js +4 -153
  9. package/dist/cli/commands/eval.js.map +1 -1
  10. package/dist/cli/commands/linked-test-entry.d.ts +6 -6
  11. package/dist/cli/commands/linked-test-entry.js +4 -65
  12. package/dist/cli/commands/linked-test-entry.js.map +1 -1
  13. package/dist/cli/commands/linked-test-parsers.d.ts +3 -45
  14. package/dist/cli/commands/linked-test-parsers.js +4 -516
  15. package/dist/cli/commands/linked-test-parsers.js.map +1 -1
  16. package/dist/cli/commands/list.d.ts +3 -210
  17. package/dist/cli/commands/list.js +4 -1068
  18. package/dist/cli/commands/list.js.map +1 -1
  19. package/dist/cli/commands/search.d.ts +3 -464
  20. package/dist/cli/commands/search.js +4 -2236
  21. package/dist/cli/commands/search.js.map +1 -1
  22. package/dist/cli/commands/stats.d.ts +6 -66
  23. package/dist/cli/commands/stats.js +4 -157
  24. package/dist/cli/commands/stats.js.map +1 -1
  25. package/dist/cli/commands/telemetry.d.ts +6 -14
  26. package/dist/cli/commands/telemetry.js +4 -349
  27. package/dist/cli/commands/telemetry.js.map +1 -1
  28. package/dist/cli/commands/test-all.d.ts +6 -95
  29. package/dist/cli/commands/test-all.js +4 -439
  30. package/dist/cli/commands/test-all.js.map +1 -1
  31. package/dist/cli/commands/test-runs.d.ts +6 -92
  32. package/dist/cli/commands/test-runs.js +4 -189
  33. package/dist/cli/commands/test-runs.js.map +1 -1
  34. package/dist/cli/commands/test.d.ts +6 -244
  35. package/dist/cli/commands/test.js +4 -1780
  36. package/dist/cli/commands/test.js.map +1 -1
  37. package/dist/cli/commands/update-many.d.ts +15 -29
  38. package/dist/cli/commands/update-many.js +355 -259
  39. package/dist/cli/commands/update-many.js.map +1 -1
  40. package/dist/cli/main.js +140 -133
  41. package/dist/cli/main.js.map +1 -1
  42. package/dist/cli/search-refresh.js +4 -9
  43. package/dist/cli/search-refresh.js.map +1 -1
  44. package/dist/cli/shared-parsers.d.ts +6 -9
  45. package/dist/cli/shared-parsers.js +4 -37
  46. package/dist/cli/shared-parsers.js.map +1 -1
  47. package/dist/cli/telemetry-flush.js +4 -4
  48. package/dist/cli/telemetry-flush.js.map +1 -1
  49. package/dist/cli-bundle/bundle-manifest.json +341 -341
  50. package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js → append-5YF3TO7I.js} +5 -5
  51. package/dist/cli-bundle/chunks/append-JHO5K6RP.js +11 -0
  52. package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js → chunk-23TCGBRK.js} +16 -7
  53. package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js.map → chunk-23TCGBRK.js.map} +1 -1
  54. package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js → chunk-2BX74BAS.js} +3 -3
  55. package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js → chunk-2CXL335K.js} +3 -3
  56. package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js → chunk-2FUOXSRN.js} +4 -4
  57. package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js → chunk-2IPNL3DR.js} +3 -3
  58. package/dist/cli-bundle/chunks/{chunk-J6364LFM.js → chunk-2MPMKJF2.js} +9 -18
  59. package/dist/cli-bundle/chunks/{chunk-J6364LFM.js.map → chunk-2MPMKJF2.js.map} +1 -1
  60. package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js → chunk-2XOSFSTH.js} +5 -5
  61. package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js → chunk-37DRDP2B.js} +5 -5
  62. package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js → chunk-37V5MXAU.js} +4 -4
  63. package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js → chunk-3D4YVTNG.js} +8 -8
  64. package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js → chunk-47HXN6RX.js} +3 -3
  65. package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js → chunk-5HGZKQUL.js} +4 -4
  66. package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js → chunk-5UKQLQM2.js} +2 -2
  67. package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js → chunk-633PKXLT.js} +3 -3
  68. package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js → chunk-646MQXFW.js} +2 -2
  69. package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js → chunk-66MKH7SZ.js} +4 -4
  70. package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js → chunk-67RO3H4N.js} +4 -4
  71. package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js → chunk-6DYOZS6C.js} +2 -2
  72. package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js → chunk-6O44IN44.js} +2 -2
  73. package/dist/cli-bundle/chunks/{chunk-ONG5V5CI.js → chunk-6XAZB6SE.js} +97 -69
  74. package/dist/cli-bundle/chunks/chunk-6XAZB6SE.js.map +1 -0
  75. package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js → chunk-74FKFFXO.js} +2 -2
  76. package/dist/cli-bundle/chunks/{chunk-LPYWLWDS.js → chunk-7CTQ7WW5.js} +37 -37
  77. package/dist/cli-bundle/chunks/chunk-7CTQ7WW5.js.map +1 -0
  78. package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js → chunk-7H5NNCJ5.js} +4 -4
  79. package/dist/cli-bundle/chunks/{chunk-XXXF6PAQ.js → chunk-7LTCLTRG.js} +69 -61
  80. package/dist/cli-bundle/chunks/chunk-7LTCLTRG.js.map +7 -0
  81. package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js → chunk-AFGKSHAM.js} +4 -4
  82. package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js → chunk-AFSV5HBB.js} +77 -7
  83. package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js.map → chunk-AFSV5HBB.js.map} +1 -1
  84. package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js → chunk-ARGDWQ4J.js} +2 -2
  85. package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js → chunk-B57RJHBZ.js} +4 -4
  86. package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js → chunk-B6SH2YNN.js} +75 -5
  87. package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js.map → chunk-B6SH2YNN.js.map} +1 -1
  88. package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js → chunk-BAP7G3N2.js} +2 -2
  89. package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js → chunk-BIRYX32V.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js → chunk-BVLOMU6O.js} +2 -2
  91. package/dist/cli-bundle/chunks/{chunk-YBLZ2VE7.js → chunk-CFSUNEL7.js} +320 -239
  92. package/dist/cli-bundle/chunks/chunk-CFSUNEL7.js.map +7 -0
  93. package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js → chunk-CKX4WOPC.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js → chunk-D52ZN3BF.js} +2 -2
  95. package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js → chunk-D53RTYVI.js} +4 -4
  96. package/dist/cli-bundle/chunks/{chunk-ODALILG3.js → chunk-D5XHO4Q7.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-E2OJMKML.js → chunk-DCC2AQBD.js} +18 -9
  98. package/dist/cli-bundle/chunks/{chunk-E2OJMKML.js.map → chunk-DCC2AQBD.js.map} +1 -1
  99. package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js → chunk-DDFGYUCQ.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js → chunk-DG2EQRIH.js} +4 -4
  101. package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js → chunk-EHJFUOXL.js} +3 -3
  102. package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js → chunk-EY7ZE3TG.js} +3 -3
  103. package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js → chunk-FHOBCGQO.js} +2 -2
  104. package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js → chunk-FL4D53ND.js} +2 -2
  105. package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js → chunk-FVNWHUME.js} +4 -4
  106. package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js → chunk-FXFCFL73.js} +5 -5
  107. package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js → chunk-FY4RLHSC.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js → chunk-FZGM3PNA.js} +8 -8
  109. package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js → chunk-G6KM4YKY.js} +7 -7
  110. package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js → chunk-G6MYGULG.js} +4 -4
  111. package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js → chunk-GLZKZON6.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js → chunk-H5IOT54C.js} +4 -4
  113. package/dist/cli-bundle/chunks/{chunk-5ZSLZLDN.js → chunk-HF63SBLC.js} +585 -456
  114. package/dist/cli-bundle/chunks/chunk-HF63SBLC.js.map +1 -0
  115. package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js → chunk-HO4DLBNK.js} +2 -2
  116. package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js → chunk-HSYV4ZYT.js} +4 -4
  117. package/dist/cli-bundle/chunks/{chunk-EH2OPHBI.js → chunk-HTXXXF45.js} +23 -19
  118. package/dist/cli-bundle/chunks/chunk-HTXXXF45.js.map +1 -0
  119. package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js → chunk-HXVHBERL.js} +8 -8
  120. package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js → chunk-I7DIDUSP.js} +2 -2
  121. package/dist/cli-bundle/chunks/{chunk-2NCIPMQP.js → chunk-I7GY4X6Y.js} +2 -2
  122. package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js → chunk-IE5KRAKN.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js → chunk-ILVOOAT4.js} +5 -5
  124. package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js → chunk-KH6QAHME.js} +3 -3
  125. package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js → chunk-KOEZCHRF.js} +9 -9
  126. package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js → chunk-KX62NMZC.js} +3 -3
  127. package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js.map → chunk-KX62NMZC.js.map} +1 -1
  128. package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js → chunk-L337QKWJ.js} +5 -5
  129. package/dist/cli-bundle/chunks/{chunk-LSG2U345.js → chunk-L6FVNR7X.js} +5 -5
  130. package/dist/cli-bundle/chunks/{chunk-ILX33QXL.js → chunk-LLODAQMP.js} +706 -532
  131. package/dist/cli-bundle/chunks/chunk-LLODAQMP.js.map +7 -0
  132. package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js → chunk-LSOWTLEM.js} +2 -2
  133. package/dist/cli-bundle/chunks/{chunk-4223PVZT.js → chunk-M7MVOKVV.js} +3 -3
  134. package/dist/cli-bundle/chunks/chunk-MNV226E4.js +834 -0
  135. package/dist/cli-bundle/chunks/chunk-MNV226E4.js.map +1 -0
  136. package/dist/cli-bundle/chunks/{chunk-UMOPHQSU.js → chunk-MR4SHYR4.js} +41 -19
  137. package/dist/cli-bundle/chunks/chunk-MR4SHYR4.js.map +7 -0
  138. package/dist/cli-bundle/chunks/{chunk-BKVG6XOA.js → chunk-MSGETE6I.js} +4 -4
  139. package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js → chunk-N33FD2UI.js} +3 -3
  140. package/dist/cli-bundle/chunks/{chunk-UFXU44HV.js → chunk-N7I2DGLP.js} +4 -4
  141. package/dist/cli-bundle/chunks/{chunk-3S5QVM5H.js → chunk-NCAFUBJX.js} +13 -13
  142. package/dist/cli-bundle/chunks/chunk-NCAFUBJX.js.map +1 -0
  143. package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js → chunk-NNANAWFH.js} +3 -3
  144. package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js → chunk-NTRQLE2R.js} +2 -2
  145. package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js → chunk-NVZ6NVHJ.js} +4 -4
  146. package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js → chunk-OWP6QFBV.js} +4 -4
  147. package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js → chunk-P22HGFFI.js} +2 -2
  148. package/dist/cli-bundle/chunks/{chunk-NLDFBC6J.js → chunk-P56LKFQX.js} +2 -2
  149. package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js → chunk-PT7MCCGD.js} +2 -2
  150. package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js → chunk-QKVVV6QO.js} +7 -7
  151. package/dist/cli-bundle/chunks/{chunk-5JLUII3O.js → chunk-QNUAZYGW.js} +321 -240
  152. package/dist/cli-bundle/chunks/chunk-QNUAZYGW.js.map +1 -0
  153. package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js → chunk-QWBKN3QC.js} +5 -5
  154. package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js → chunk-R5XTTZSJ.js} +5 -5
  155. package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js → chunk-RC4UOUXA.js} +3 -3
  156. package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js → chunk-RGMWJLXF.js} +4 -4
  157. package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js → chunk-RTBX3C4C.js} +3 -3
  158. package/dist/cli-bundle/chunks/{chunk-HYB5AZ63.js → chunk-S46R2M3W.js} +117 -71
  159. package/dist/cli-bundle/chunks/chunk-S46R2M3W.js.map +7 -0
  160. package/dist/cli-bundle/chunks/{chunk-H5APFTHZ.js → chunk-S6FF7VW6.js} +18 -18
  161. package/dist/cli-bundle/chunks/chunk-S6FF7VW6.js.map +7 -0
  162. package/dist/cli-bundle/chunks/{chunk-UXONS674.js → chunk-SIJV365F.js} +54 -55
  163. package/dist/cli-bundle/chunks/chunk-SIJV365F.js.map +1 -0
  164. package/dist/cli-bundle/chunks/{chunk-7Z4LKRS4.js → chunk-SPFZV2GR.js} +9 -9
  165. package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js → chunk-TM5CIO3F.js} +3 -3
  166. package/dist/cli-bundle/chunks/{chunk-4XQ3BDV4.js → chunk-V3VBXQQV.js} +36 -36
  167. package/dist/cli-bundle/chunks/chunk-V3VBXQQV.js.map +7 -0
  168. package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js → chunk-V7MP6YTN.js} +7 -7
  169. package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js → chunk-VAHZIPWS.js} +4 -4
  170. package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js → chunk-VE6ZSTQW.js} +4 -4
  171. package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js → chunk-W5E2UUSH.js} +3 -3
  172. package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js → chunk-WACRQ26A.js} +2 -2
  173. package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js.map → chunk-WACRQ26A.js.map} +1 -1
  174. package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js → chunk-WL3SS45P.js} +3 -3
  175. package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js → chunk-WU3KAN6A.js} +3 -3
  176. package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js → chunk-X2MGQMZO.js} +2 -2
  177. package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js → chunk-X5YCTFKT.js} +3 -3
  178. package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js → chunk-XC2HEEOV.js} +4 -4
  179. package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js → chunk-XNPMDSQQ.js} +8 -8
  180. package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js → chunk-XXLXJL7V.js} +4 -4
  181. package/dist/cli-bundle/chunks/chunk-XYJK6GIQ.js +851 -0
  182. package/dist/cli-bundle/chunks/chunk-XYJK6GIQ.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js → chunk-YJSURTBB.js} +2 -2
  184. package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js → chunk-YKFHF37B.js} +3 -3
  185. package/dist/cli-bundle/chunks/{chunk-JFTKLTEF.js → chunk-YQCWK2MB.js} +4 -4
  186. package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js → chunk-YQEZWI3R.js} +2 -2
  187. package/dist/cli-bundle/chunks/close-BEP7MHF3.js +12 -0
  188. package/dist/cli-bundle/chunks/{close-CWODTPKG.js → close-Y6QFUJQN.js} +5 -5
  189. package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js → close-many-JJFW7KTT.js} +14 -14
  190. package/dist/cli-bundle/chunks/close-many-QJ6FKJUE.js +23 -0
  191. package/dist/cli-bundle/chunks/comments-2AOZQ5D2.js +13 -0
  192. package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js → comments-TMHMALA5.js} +7 -7
  193. package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js → copy-FWQA5OU4.js} +4 -4
  194. package/dist/cli-bundle/chunks/copy-N3LCQBMC.js +9 -0
  195. package/dist/cli-bundle/chunks/{create-LBVCYMEG.js → create-AQ5SIGZC.js} +9 -9
  196. package/dist/cli-bundle/chunks/{create-J5U6ND4K.js → create-KOGQ3JKD.js} +9 -9
  197. package/dist/cli-bundle/chunks/delete-6G3MBZ6S.js +10 -0
  198. package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js → delete-YYYFOSEA.js} +4 -4
  199. package/dist/cli-bundle/chunks/{deps-OA26IS25.js → deps-5NC4IZH7.js} +5 -5
  200. package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js → deps-EVTOQMKW.js} +5 -5
  201. package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js → docs-53NUGMIQ.js} +6 -6
  202. package/dist/cli-bundle/chunks/docs-OWRGDMNY.js +14 -0
  203. package/dist/cli-bundle/chunks/{files-EFIWKFTM.js → files-3PXGXYDB.js} +6 -6
  204. package/dist/cli-bundle/chunks/{files-6YFBJRBG.js → files-EGLKHD7O.js} +6 -6
  205. package/dist/cli-bundle/chunks/focus-KZLIA6WS.js +10 -0
  206. package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js → focus-SRPASFTN.js} +5 -5
  207. package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js → history-compact-G4DULDCX.js} +6 -6
  208. package/dist/cli-bundle/chunks/history-compact-HHIUOMZ7.js +16 -0
  209. package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js → history-redact-IUSJ6X3E.js} +4 -4
  210. package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js → history-redact-THHGRQXV.js} +4 -4
  211. package/dist/cli-bundle/chunks/history-repair-KG7SWXI6.js +16 -0
  212. package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js → history-repair-LUQWRS7X.js} +6 -6
  213. package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js → learnings-2MRNBFJF.js} +7 -7
  214. package/dist/cli-bundle/chunks/learnings-ZVHSALJY.js +13 -0
  215. package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js → notes-73JWKWUD.js} +7 -7
  216. package/dist/cli-bundle/chunks/notes-BAKUL5DJ.js +13 -0
  217. package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js → plan-AZPMCG37.js} +10 -10
  218. package/dist/cli-bundle/chunks/plan-LEAGLPGP.js +24 -0
  219. package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js → profile-AGUKS52S.js} +9 -9
  220. package/dist/cli-bundle/chunks/{profile-FAU7NZML.js → profile-U2B6Y7GE.js} +9 -9
  221. package/dist/cli-bundle/chunks/{register-list-query-UL4UKBBN.js → register-list-query-A5KRJ5J2.js} +16 -16
  222. package/dist/cli-bundle/chunks/{register-list-query-DKA3EH5D.js → register-list-query-NEYP3TXO.js} +16 -16
  223. package/dist/cli-bundle/chunks/{register-mutation-RBBJ52DK.js → register-mutation-6LOPBAHC.js} +29 -29
  224. package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js → register-mutation-GCZOALNJ.js} +29 -29
  225. package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js → register-operations-6ZZIF27A.js} +35 -35
  226. package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js → register-operations-REDIAEGI.js} +35 -35
  227. package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js → register-setup-BHPMN5SK.js} +15 -15
  228. package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js → register-setup-J3JS2ZVT.js} +15 -15
  229. package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js → restore-E3PRGDN3.js} +6 -6
  230. package/dist/cli-bundle/chunks/restore-KIUYTAEJ.js +14 -0
  231. package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js → schema-5JNFQFUW.js} +6 -6
  232. package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js → schema-TMIW4XZC.js} +6 -6
  233. package/dist/cli-bundle/chunks/update-PQQHLYCC.js +21 -0
  234. package/dist/cli-bundle/chunks/{update-XHSIAIXE.js → update-SA6AG23P.js} +12 -12
  235. package/dist/cli-bundle/chunks/update-many-RQVTFJPD.js +36 -0
  236. package/dist/cli-bundle/chunks/update-many-TV3L3KBX.js +32 -0
  237. package/dist/cli-bundle/main.js +153 -855
  238. package/dist/cli-bundle/main.js.map +4 -4
  239. package/dist/cli-bundle/sdk-runtime.js +54 -54
  240. package/dist/cli-bundle/sdk-testing.js +6 -6
  241. package/dist/cli-bundle/sdk.js +195 -59
  242. package/dist/cli-bundle/sdk.js.map +3 -3
  243. package/dist/core/extensions/item-fields.js +2 -2
  244. package/dist/core/extensions/item-fields.js.map +1 -1
  245. package/dist/sdk/cli-bootstrap.d.ts +122 -0
  246. package/dist/sdk/cli-bootstrap.js +879 -0
  247. package/dist/sdk/cli-bootstrap.js.map +1 -0
  248. package/dist/sdk/eval.d.ts +66 -0
  249. package/dist/sdk/eval.js +186 -0
  250. package/dist/sdk/eval.js.map +1 -0
  251. package/dist/sdk/index.d.ts +16 -4
  252. package/dist/sdk/index.js +18 -6
  253. package/dist/sdk/index.js.map +1 -1
  254. package/dist/{cli/commands → sdk/query}/item-filter-options.d.ts +1 -1
  255. package/dist/{cli/commands → sdk/query}/item-filter-options.js +3 -3
  256. package/dist/sdk/query/item-filter-options.js.map +1 -0
  257. package/dist/sdk/query/list.d.ts +254 -0
  258. package/dist/sdk/query/list.js +1073 -0
  259. package/dist/sdk/query/list.js.map +1 -0
  260. package/dist/sdk/query/parsers.d.ts +9 -0
  261. package/dist/sdk/query/parsers.js +45 -0
  262. package/dist/sdk/query/parsers.js.map +1 -0
  263. package/dist/{cli/commands → sdk/query}/search-pagination.js +4 -4
  264. package/dist/sdk/query/search-pagination.js.map +1 -0
  265. package/dist/{cli/commands → sdk/query}/search-rendering.js +3 -3
  266. package/dist/sdk/query/search-rendering.js.map +1 -0
  267. package/dist/sdk/query/search.d.ts +469 -0
  268. package/dist/sdk/query/search.js +2247 -0
  269. package/dist/sdk/query/search.js.map +1 -0
  270. package/dist/sdk/runtime.d.ts +7 -7
  271. package/dist/sdk/runtime.js +13 -7
  272. package/dist/sdk/runtime.js.map +1 -1
  273. package/dist/sdk/search-refresh-worker.d.ts +2 -0
  274. package/dist/sdk/search-refresh-worker.js +19 -0
  275. package/dist/sdk/search-refresh-worker.js.map +1 -0
  276. package/dist/sdk/stats.d.ts +66 -0
  277. package/dist/sdk/stats.js +151 -0
  278. package/dist/sdk/stats.js.map +1 -0
  279. package/dist/sdk/telemetry-flush.d.ts +2 -0
  280. package/dist/sdk/telemetry-flush.js +14 -0
  281. package/dist/sdk/telemetry-flush.js.map +1 -0
  282. package/dist/sdk/telemetry.d.ts +14 -0
  283. package/dist/sdk/telemetry.js +398 -0
  284. package/dist/sdk/telemetry.js.map +1 -0
  285. package/dist/sdk/test/batch.d.ts +94 -0
  286. package/dist/sdk/test/batch.js +492 -0
  287. package/dist/sdk/test/batch.js.map +1 -0
  288. package/dist/sdk/test/entry.d.ts +6 -0
  289. package/dist/sdk/test/entry.js +74 -0
  290. package/dist/sdk/test/entry.js.map +1 -0
  291. package/dist/sdk/test/execution.d.ts +282 -0
  292. package/dist/sdk/test/execution.js +1817 -0
  293. package/dist/sdk/test/execution.js.map +1 -0
  294. package/dist/sdk/test/parsers.d.ts +48 -0
  295. package/dist/sdk/test/parsers.js +522 -0
  296. package/dist/sdk/test/parsers.js.map +1 -0
  297. package/dist/sdk/test/runs.d.ts +92 -0
  298. package/dist/sdk/test/runs.js +195 -0
  299. package/dist/sdk/test/runs.js.map +1 -0
  300. package/docs/SDK.md +122 -0
  301. package/docs/SDK_PRIMITIVE_INVENTORY.md +5 -3
  302. package/docs/examples/sdk-custom-tool/README.md +27 -0
  303. package/docs/examples/sdk-custom-tool/package.json +13 -0
  304. package/docs/examples/sdk-custom-tool/src/cli.ts +36 -0
  305. package/docs/examples/sdk-custom-tool/src/entry.ts +15 -0
  306. package/docs/examples/sdk-custom-tool/src/index.ts +223 -0
  307. package/marketplace.json +2 -2
  308. package/package.json +4 -4
  309. package/packages/pm-beads/package.json +1 -1
  310. package/packages/pm-calendar/package.json +1 -1
  311. package/packages/pm-command-kit/package.json +1 -1
  312. package/packages/pm-governance-audit/extensions/governance-audit/comments-audit.ts +77 -57
  313. package/packages/pm-governance-audit/extensions/governance-audit/dedupe-audit.ts +202 -194
  314. package/packages/pm-governance-audit/extensions/governance-audit/dedupe-merge.ts +227 -153
  315. package/packages/pm-governance-audit/extensions/governance-audit/normalize.ts +169 -125
  316. package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +130 -81
  317. package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +53 -4
  318. package/packages/pm-governance-audit/package.json +1 -1
  319. package/packages/pm-guide-shell/package.json +1 -1
  320. package/packages/pm-kanban/package.json +1 -1
  321. package/packages/pm-lifecycle-hooks/package.json +1 -1
  322. package/packages/pm-linked-test-adapters/package.json +1 -1
  323. package/packages/pm-search-advanced/package.json +1 -1
  324. package/packages/pm-templates/package.json +1 -1
  325. package/packages/pm-todos/package.json +1 -1
  326. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  327. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  328. package/dist/cli/commands/item-filter-options.js.map +0 -1
  329. package/dist/cli/commands/search-pagination.js.map +0 -1
  330. package/dist/cli/commands/search-rendering.js.map +0 -1
  331. package/dist/cli-bundle/chunks/append-UZVHUO74.js +0 -11
  332. package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +0 -1
  333. package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +0 -7
  334. package/dist/cli-bundle/chunks/chunk-5JLUII3O.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +0 -1
  336. package/dist/cli-bundle/chunks/chunk-EH2OPHBI.js.map +0 -1
  337. package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +0 -7
  338. package/dist/cli-bundle/chunks/chunk-HYB5AZ63.js.map +0 -7
  339. package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +0 -7
  340. package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +0 -1
  341. package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +0 -1
  342. package/dist/cli-bundle/chunks/chunk-UMOPHQSU.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +0 -1
  344. package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +0 -7
  345. package/dist/cli-bundle/chunks/chunk-YBLZ2VE7.js.map +0 -7
  346. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +0 -58
  347. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +0 -1
  348. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +0 -68
  349. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +0 -7
  350. package/dist/cli-bundle/chunks/close-W6LI2PKM.js +0 -12
  351. package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +0 -23
  352. package/dist/cli-bundle/chunks/comments-E3TNTK24.js +0 -13
  353. package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +0 -9
  354. package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +0 -10
  355. package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +0 -14
  356. package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +0 -10
  357. package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +0 -16
  358. package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +0 -16
  359. package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +0 -13
  360. package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +0 -13
  361. package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +0 -24
  362. package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +0 -14
  363. package/dist/cli-bundle/chunks/update-WWBYOPXO.js +0 -21
  364. package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +0 -32
  365. package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +0 -36
  366. /package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js.map → append-5YF3TO7I.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{append-UZVHUO74.js.map → append-JHO5K6RP.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js.map → chunk-2BX74BAS.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js.map → chunk-2CXL335K.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js.map → chunk-2FUOXSRN.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js.map → chunk-2IPNL3DR.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js.map → chunk-2XOSFSTH.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js.map → chunk-37DRDP2B.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js.map → chunk-37V5MXAU.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js.map → chunk-3D4YVTNG.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js.map → chunk-47HXN6RX.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js.map → chunk-5HGZKQUL.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js.map → chunk-5UKQLQM2.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js.map → chunk-633PKXLT.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js.map → chunk-646MQXFW.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js.map → chunk-66MKH7SZ.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js.map → chunk-67RO3H4N.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js.map → chunk-6DYOZS6C.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js.map → chunk-6O44IN44.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js.map → chunk-74FKFFXO.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js.map → chunk-7H5NNCJ5.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js.map → chunk-AFGKSHAM.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js.map → chunk-ARGDWQ4J.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js.map → chunk-B57RJHBZ.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js.map → chunk-BAP7G3N2.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js.map → chunk-BIRYX32V.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js.map → chunk-BVLOMU6O.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js.map → chunk-CKX4WOPC.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js.map → chunk-D52ZN3BF.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js.map → chunk-D53RTYVI.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-ODALILG3.js.map → chunk-D5XHO4Q7.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js.map → chunk-DDFGYUCQ.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js.map → chunk-DG2EQRIH.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js.map → chunk-EHJFUOXL.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js.map → chunk-EY7ZE3TG.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js.map → chunk-FHOBCGQO.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js.map → chunk-FL4D53ND.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js.map → chunk-FVNWHUME.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js.map → chunk-FXFCFL73.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js.map → chunk-FY4RLHSC.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js.map → chunk-FZGM3PNA.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js.map → chunk-G6KM4YKY.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js.map → chunk-G6MYGULG.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js.map → chunk-GLZKZON6.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js.map → chunk-H5IOT54C.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js.map → chunk-HO4DLBNK.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js.map → chunk-HSYV4ZYT.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js.map → chunk-HXVHBERL.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js.map → chunk-I7DIDUSP.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{chunk-2NCIPMQP.js.map → chunk-I7GY4X6Y.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js.map → chunk-IE5KRAKN.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js.map → chunk-ILVOOAT4.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js.map → chunk-KH6QAHME.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js.map → chunk-KOEZCHRF.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js.map → chunk-L337QKWJ.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{chunk-LSG2U345.js.map → chunk-L6FVNR7X.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js.map → chunk-LSOWTLEM.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{chunk-4223PVZT.js.map → chunk-M7MVOKVV.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{chunk-BKVG6XOA.js.map → chunk-MSGETE6I.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js.map → chunk-N33FD2UI.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-UFXU44HV.js.map → chunk-N7I2DGLP.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js.map → chunk-NNANAWFH.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js.map → chunk-NTRQLE2R.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js.map → chunk-NVZ6NVHJ.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js.map → chunk-OWP6QFBV.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js.map → chunk-P22HGFFI.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-NLDFBC6J.js.map → chunk-P56LKFQX.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js.map → chunk-PT7MCCGD.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js.map → chunk-QKVVV6QO.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js.map → chunk-QWBKN3QC.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js.map → chunk-R5XTTZSJ.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js.map → chunk-RC4UOUXA.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js.map → chunk-RGMWJLXF.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js.map → chunk-RTBX3C4C.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-7Z4LKRS4.js.map → chunk-SPFZV2GR.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js.map → chunk-TM5CIO3F.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js.map → chunk-V7MP6YTN.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js.map → chunk-VAHZIPWS.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js.map → chunk-VE6ZSTQW.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js.map → chunk-W5E2UUSH.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js.map → chunk-WL3SS45P.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js.map → chunk-WU3KAN6A.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js.map → chunk-X2MGQMZO.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js.map → chunk-X5YCTFKT.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js.map → chunk-XC2HEEOV.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js.map → chunk-XNPMDSQQ.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js.map → chunk-XXLXJL7V.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js.map → chunk-YJSURTBB.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js.map → chunk-YKFHF37B.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{chunk-JFTKLTEF.js.map → chunk-YQCWK2MB.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js.map → chunk-YQEZWI3R.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{close-W6LI2PKM.js.map → close-BEP7MHF3.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{close-CWODTPKG.js.map → close-Y6QFUJQN.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js.map → close-many-JJFW7KTT.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{close-many-DLDDVSH5.js.map → close-many-QJ6FKJUE.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{comments-E3TNTK24.js.map → comments-2AOZQ5D2.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js.map → comments-TMHMALA5.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js.map → copy-FWQA5OU4.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{copy-Q5ZJPUKR.js.map → copy-N3LCQBMC.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{create-LBVCYMEG.js.map → create-AQ5SIGZC.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{create-J5U6ND4K.js.map → create-KOGQ3JKD.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{delete-WNHB3LYW.js.map → delete-6G3MBZ6S.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js.map → delete-YYYFOSEA.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{deps-OA26IS25.js.map → deps-5NC4IZH7.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js.map → deps-EVTOQMKW.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js.map → docs-53NUGMIQ.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{docs-HA2AIDBB.js.map → docs-OWRGDMNY.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{files-EFIWKFTM.js.map → files-3PXGXYDB.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{files-6YFBJRBG.js.map → files-EGLKHD7O.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{focus-POIW5LTJ.js.map → focus-KZLIA6WS.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js.map → focus-SRPASFTN.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js.map → history-compact-G4DULDCX.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{history-compact-FWG2C7FZ.js.map → history-compact-HHIUOMZ7.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js.map → history-redact-IUSJ6X3E.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js.map → history-redact-THHGRQXV.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{history-repair-6GEAM7HE.js.map → history-repair-KG7SWXI6.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js.map → history-repair-LUQWRS7X.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js.map → learnings-2MRNBFJF.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{learnings-RSNLSWDC.js.map → learnings-ZVHSALJY.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js.map → notes-73JWKWUD.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{notes-2WDH6DXU.js.map → notes-BAKUL5DJ.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js.map → plan-AZPMCG37.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{plan-DOVI2VMW.js.map → plan-LEAGLPGP.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js.map → profile-AGUKS52S.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{profile-FAU7NZML.js.map → profile-U2B6Y7GE.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{register-list-query-UL4UKBBN.js.map → register-list-query-A5KRJ5J2.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{register-list-query-DKA3EH5D.js.map → register-list-query-NEYP3TXO.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{register-mutation-RBBJ52DK.js.map → register-mutation-6LOPBAHC.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js.map → register-mutation-GCZOALNJ.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js.map → register-operations-6ZZIF27A.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js.map → register-operations-REDIAEGI.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js.map → register-setup-BHPMN5SK.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js.map → register-setup-J3JS2ZVT.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js.map → restore-E3PRGDN3.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{restore-YPMVUUEX.js.map → restore-KIUYTAEJ.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js.map → schema-5JNFQFUW.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js.map → schema-TMIW4XZC.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{update-WWBYOPXO.js.map → update-PQQHLYCC.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{update-XHSIAIXE.js.map → update-SA6AG23P.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{update-many-TA7NGQBO.js.map → update-many-RQVTFJPD.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{update-many-OUGIU5SF.js.map → update-many-TV3L3KBX.js.map} +0 -0
  507. /package/dist/{cli/commands → sdk/query}/search-pagination.d.ts +0 -0
  508. /package/dist/{cli/commands → sdk/query}/search-rendering.d.ts +0 -0
@@ -1,163 +1,10 @@
1
1
  /**
2
2
  * @module cli/commands/stats
3
3
  *
4
- * Implements the pm stats command surface and its agent-facing runtime behavior.
4
+ * Compatibility export for SDK-owned tracker statistics.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f76ffd47-6478-5a3f-b18f-990a9332c774")}catch(e){}}();
8
- import fs from "node:fs/promises";
9
- import path from "node:path";
10
- import { getActiveExtensionRegistrations, runActiveOnReadHooks, } from "../../core/extensions/index.js";
11
- import { computeContentFieldUtilization, } from "../../core/governance/content-fields.js";
12
- import { computeMetadataCoverage, groupItemsByDimension, lifecycleClassifierFromStatusRegistry, } from "../../core/governance/metadata-coverage.js";
13
- import { pathExists } from "../../core/fs/fs-utils.js";
14
- import { enforceHistoryStreamPolicyForItems } from "../../core/history/history-stream-policy.js";
15
- import { computeHistoryStorageStats, } from "../../core/history/history-storage-stats.js";
16
- import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
17
- import { resolveRuntimeStatusRegistry } from "../../core/schema/runtime-schema.js";
18
- import { EXIT_CODE } from "../../core/shared/constants.js";
19
- import { PmCliError } from "../../core/shared/errors.js";
20
- import { nowIso } from "../../core/shared/time.js";
21
- import { listAllItemMetadataLight, listAllItemMetadataWithBody, } from "../../core/store/item-store.js";
22
- import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
23
- import { readSettings } from "../../core/store/settings.js";
24
- function zeroByType(itemTypes) {
25
- return itemTypes.reduce((acc, value) => {
26
- acc[value] = 0;
27
- return acc;
28
- }, {});
29
- }
30
- function zeroByStatus(statuses) {
31
- return statuses.reduce((acc, value) => {
32
- acc[value] = 0;
33
- return acc;
34
- }, {});
35
- }
36
- function countNonEmptyLines(raw) {
37
- if (raw.trim().length === 0) {
38
- return 0;
39
- }
40
- return raw.split(/\r?\n/u).filter((line) => line.trim().length > 0).length;
41
- }
42
- function isNotFoundError(error) {
43
- return (typeof error === "object" &&
44
- error !== null &&
45
- "code" in error &&
46
- error.code === "ENOENT");
47
- }
48
- async function readHistoryStreamContents(pmRoot) {
49
- const historyDir = path.join(pmRoot, "history");
50
- if (!(await pathExists(historyDir))) {
51
- return [];
52
- }
53
- await runActiveOnReadHooks({
54
- path: historyDir,
55
- scope: "project",
56
- });
57
- const historyFiles = (await fs.readdir(historyDir))
58
- .filter((entry) => entry.endsWith(".jsonl"))
59
- .sort((a, b) => a.localeCompare(b));
60
- const streams = [];
61
- for (const file of historyFiles) {
62
- const historyPath = path.join(historyDir, file);
63
- let raw;
64
- try {
65
- raw = await fs.readFile(historyPath, "utf8");
66
- }
67
- catch (error) {
68
- if (isNotFoundError(error)) {
69
- continue;
70
- }
71
- throw error;
72
- }
73
- await runActiveOnReadHooks({
74
- path: historyPath,
75
- scope: "project",
76
- });
77
- streams.push({ id: file.slice(0, -".jsonl".length), raw });
78
- }
79
- return streams;
80
- }
81
- /** Public contract for test only, shared by SDK and presentation-layer consumers. */
82
- export const _testOnly = {
83
- zeroByType,
84
- zeroByStatus,
85
- countNonEmptyLines,
86
- readHistoryStreamContents,
87
- };
88
- /** Implements run stats for the public runtime surface of this module. */
89
- export async function runStats(global, options = {}) {
90
- const pmRoot = resolvePmRoot(process.cwd(), global.path);
91
- if (!(await pathExists(getSettingsPath(pmRoot)))) {
92
- throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
93
- }
94
- const settings = await readSettings(pmRoot);
95
- const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
96
- const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
97
- // Field utilization needs the heavy collections (notes/learnings/files/docs/
98
- // tests/comments/deps) AND the body, which the light reader drops — so when it
99
- // is requested we read the WithBody rows and use them for every section.
100
- const items = options.fieldUtilization
101
- ? await listAllItemMetadataWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema)
102
- : await listAllItemMetadataLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);
103
- await enforceHistoryStreamPolicyForItems({
104
- pmRoot,
105
- settings,
106
- itemIds: items.map((item) => item.id),
107
- commandLabel: "stats",
108
- });
109
- const byType = zeroByType(typeRegistry.types);
110
- const byStatus = zeroByStatus(statusRegistry.definitions.map((definition) => definition.id));
111
- // zeroByType/zeroByStatus pre-seed a bucket for every registry type/status, and
112
- // the light item-metadata reader drops any item whose type/status falls outside
113
- // the active registry (parse rejects them) — so every item's bucket is already
114
- // present here and no on-the-fly initialization is reachable.
115
- for (const item of items) {
116
- byType[item.type] += 1;
117
- byStatus[item.status] += 1;
118
- }
119
- const streams = await readHistoryStreamContents(pmRoot);
120
- let historyEntries = 0;
121
- for (const stream of streams) {
122
- historyEntries += countNonEmptyLines(stream.raw);
123
- }
124
- const storage = options.storage
125
- ? computeHistoryStorageStats(streams)
126
- : undefined;
127
- const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);
128
- const metadataCoverage = options.metadataCoverage
129
- ? computeMetadataCoverage(items, classifier)
130
- : undefined;
131
- const breakdowns = {};
132
- if (options.byAssignee) {
133
- breakdowns.assignee = groupItemsByDimension(items, "assignee", classifier);
134
- }
135
- if (options.byTag) {
136
- breakdowns.tag = groupItemsByDimension(items, "tag", classifier, {
137
- tagPrefix: options.tagPrefix,
138
- });
139
- }
140
- if (options.byPriority) {
141
- breakdowns.priority = groupItemsByDimension(items, "priority", classifier);
142
- }
143
- const hasBreakdowns = Object.keys(breakdowns).length > 0;
144
- const fieldUtilization = options.fieldUtilization
145
- ? computeContentFieldUtilization(items)
146
- : undefined;
147
- return {
148
- totals: {
149
- items: items.length,
150
- history_streams: streams.length,
151
- history_entries: historyEntries,
152
- },
153
- by_type: byType,
154
- by_status: byStatus,
155
- ...(metadataCoverage ? { metadata_coverage: metadataCoverage } : {}),
156
- ...(hasBreakdowns ? { breakdowns } : {}),
157
- ...(storage ? { storage } : {}),
158
- ...(fieldUtilization ? { field_utilization: fieldUtilization } : {}),
159
- generated_at: nowIso(),
160
- };
161
- }
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="81afc203-9f08-5d9d-ac28-566f521ccfba")}catch(e){}}();
8
+ export * from "../../sdk/stats.js";
162
9
  //# sourceMappingURL=stats.js.map
163
- //# debugId=f76ffd47-6478-5a3f-b18f-990a9332c774
10
+ //# debugId=81afc203-9f08-5d9d-ac28-566f521ccfba
@@ -1 +1 @@
1
- {"version":3,"file":"stats.js","sources":["cli/commands/stats.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/stats\n *\n * Implements the pm stats command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n getActiveExtensionRegistrations,\n runActiveOnReadHooks,\n} from \"../../core/extensions/index.js\";\nimport {\n computeContentFieldUtilization,\n type ContentFieldUtilizationReport,\n} from \"../../core/governance/content-fields.js\";\nimport {\n computeMetadataCoverage,\n groupItemsByDimension,\n lifecycleClassifierFromStatusRegistry,\n type GroupedBreakdown,\n type MetadataCoverageReport,\n} from \"../../core/governance/metadata-coverage.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { enforceHistoryStreamPolicyForItems } from \"../../core/history/history-stream-policy.js\";\nimport {\n computeHistoryStorageStats,\n type HistoryStorageStats,\n} from \"../../core/history/history-storage-stats.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport {\n listAllItemMetadataLight,\n listAllItemMetadataWithBody,\n} from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemStatus, ItemType } from \"../../types/index.js\";\n\n/** Documents the stats command options payload exchanged by command, SDK, and package integrations. */\nexport interface StatsCommandOptions {\n /** Include aggregate per-stream history storage metrics (sizes, depth, oldest/newest). */\n storage?: boolean;\n /** Include metadata coverage percentages (AC, estimates, resolution, tags, parent) overall and by type. */\n metadataCoverage?: boolean;\n /** Include a lifecycle-bucketed breakdown grouped by assignee. */\n byAssignee?: boolean;\n /** Include a lifecycle-bucketed breakdown grouped by tag (optionally filtered by --tag-prefix). */\n byTag?: boolean;\n /** Include a lifecycle-bucketed breakdown grouped by priority. */\n byPriority?: boolean;\n /** With --by-tag: only consider tags starting with this prefix (e.g. \"domain:\"). */\n tagPrefix?: string;\n /** Include a content-field utilization breakdown (notes/learnings/files/docs/tests/comments/deps/body usage rates). */\n fieldUtilization?: boolean;\n}\n\n/** Documents the stats result payload exchanged by command, SDK, and package integrations. */\nexport interface StatsResult {\n /** Value that configures or reports totals for this contract. */\n totals: {\n items: number;\n history_streams: number;\n history_entries: number;\n };\n /** Schema type that determines the shape and validation rules for this value. */\n by_type: Record<ItemType, number>;\n /** Lifecycle state reported for bythe record. */\n by_status: Record<ItemStatus, number>;\n /** Present only with --metadata-coverage: per-field coverage overall and by type. */\n metadata_coverage?: MetadataCoverageReport;\n /** Present only with --by-assignee/--by-tag/--by-priority: lifecycle-bucketed group breakdowns. */\n breakdowns?: {\n assignee?: GroupedBreakdown;\n tag?: GroupedBreakdown;\n priority?: GroupedBreakdown;\n };\n /** Present only with --storage: aggregate history-stream metrics for compaction/planning. */\n storage?: HistoryStorageStats;\n /** Present only with --field-utilization: content-field utilization rates across all items. */\n field_utilization?: ContentFieldUtilizationReport;\n /** ISO 8601 timestamp recording when generated occurred. */\n generated_at: string;\n}\n\nfunction zeroByType(itemTypes: string[]): Record<ItemType, number> {\n return itemTypes.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemType, number>,\n );\n}\n\nfunction zeroByStatus(statuses: string[]): Record<ItemStatus, number> {\n return statuses.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemStatus, number>,\n );\n}\n\nfunction countNonEmptyLines(raw: string): number {\n if (raw.trim().length === 0) {\n return 0;\n }\n return raw.split(/\\r?\\n/u).filter((line) => line.trim().length > 0).length;\n}\n\nfunction isNotFoundError(error: unknown): boolean {\n return (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n (error as { code?: unknown }).code === \"ENOENT\"\n );\n}\n\nasync function readHistoryStreamContents(\n pmRoot: string,\n): Promise<Array<{ id: string; raw: string }>> {\n const historyDir = path.join(pmRoot, \"history\");\n if (!(await pathExists(historyDir))) {\n return [];\n }\n\n await runActiveOnReadHooks({\n path: historyDir,\n scope: \"project\",\n });\n const historyFiles = (await fs.readdir(historyDir))\n .filter((entry) => entry.endsWith(\".jsonl\"))\n .sort((a, b) => a.localeCompare(b));\n\n const streams: Array<{ id: string; raw: string }> = [];\n for (const file of historyFiles) {\n const historyPath = path.join(historyDir, file);\n let raw: string;\n try {\n raw = await fs.readFile(historyPath, \"utf8\");\n } catch (error) {\n if (isNotFoundError(error)) {\n continue;\n }\n throw error;\n }\n await runActiveOnReadHooks({\n path: historyPath,\n scope: \"project\",\n });\n streams.push({ id: file.slice(0, -\".jsonl\".length), raw });\n }\n\n return streams;\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n zeroByType,\n zeroByStatus,\n countNonEmptyLines,\n readHistoryStreamContents,\n};\n\n/** Implements run stats for the public runtime surface of this module. */\nexport async function runStats(\n global: GlobalOptions,\n options: StatsCommandOptions = {},\n): Promise<StatsResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n // Field utilization needs the heavy collections (notes/learnings/files/docs/\n // tests/comments/deps) AND the body, which the light reader drops — so when it\n // is requested we read the WithBody rows and use them for every section.\n const items = options.fieldUtilization\n ? await listAllItemMetadataWithBody(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n )\n : await listAllItemMetadataLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n await enforceHistoryStreamPolicyForItems({\n pmRoot,\n settings,\n itemIds: items.map((item) => item.id),\n commandLabel: \"stats\",\n });\n\n const byType = zeroByType(typeRegistry.types);\n const byStatus = zeroByStatus(\n statusRegistry.definitions.map((definition) => definition.id),\n );\n // zeroByType/zeroByStatus pre-seed a bucket for every registry type/status, and\n // the light item-metadata reader drops any item whose type/status falls outside\n // the active registry (parse rejects them) — so every item's bucket is already\n // present here and no on-the-fly initialization is reachable.\n for (const item of items) {\n byType[item.type] += 1;\n byStatus[item.status] += 1;\n }\n\n const streams = await readHistoryStreamContents(pmRoot);\n let historyEntries = 0;\n for (const stream of streams) {\n historyEntries += countNonEmptyLines(stream.raw);\n }\n const storage = options.storage\n ? computeHistoryStorageStats(streams)\n : undefined;\n\n const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);\n const metadataCoverage = options.metadataCoverage\n ? computeMetadataCoverage(items, classifier)\n : undefined;\n const breakdowns: NonNullable<StatsResult[\"breakdowns\"]> = {};\n if (options.byAssignee) {\n breakdowns.assignee = groupItemsByDimension(items, \"assignee\", classifier);\n }\n if (options.byTag) {\n breakdowns.tag = groupItemsByDimension(items, \"tag\", classifier, {\n tagPrefix: options.tagPrefix,\n });\n }\n if (options.byPriority) {\n breakdowns.priority = groupItemsByDimension(items, \"priority\", classifier);\n }\n const hasBreakdowns = Object.keys(breakdowns).length > 0;\n const fieldUtilization = options.fieldUtilization\n ? computeContentFieldUtilization(items)\n : undefined;\n\n return {\n totals: {\n items: items.length,\n history_streams: streams.length,\n history_entries: historyEntries,\n },\n by_type: byType,\n by_status: byStatus,\n ...(metadataCoverage ? { metadata_coverage: metadataCoverage } : {}),\n ...(hasBreakdowns ? { breakdowns } : {}),\n ...(storage ? { storage } : {}),\n ...(fieldUtilization ? { field_utilization: fieldUtilization } : {}),\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,8BAA8B,GAE/B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,qCAAqC,GAGtC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO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E,CAAC;QAC/B,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,YAAY,EAAE,MAAM,EAAE;KACvB,CAAC;AACJ,CAAC","debugId":"f76ffd47-6478-5a3f-b18f-990a9332c774"}
1
+ {"version":3,"file":"stats.js","sources":["cli/commands/stats.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/stats\n *\n * Compatibility export for SDK-owned tracker statistics.\n */\nexport * from \"../../sdk/stats.js\";\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,cAAc,oBAAoB,CAAC","debugId":"81afc203-9f08-5d9d-ac28-566f521ccfba"}
@@ -1,14 +1,6 @@
1
- import type { GlobalOptions } from "../../core/shared/command-types.js";
2
- /** Public contract for telemetry subcommands, shared by SDK and presentation-layer consumers. */
3
- export declare const TELEMETRY_SUBCOMMANDS: readonly ["status", "flush", "stats", "clear"];
4
- /** Restricts telemetry subcommand values accepted by command, SDK, and storage contracts. */
5
- export type TelemetrySubcommand = (typeof TELEMETRY_SUBCOMMANDS)[number];
6
- /** Documents the telemetry command options payload exchanged by command, SDK, and package integrations. */
7
- export interface TelemetryCommandOptions {
8
- /** Value that configures or reports subcommand for this contract. */
9
- subcommand?: string;
10
- /** Value that configures or reports limit for this contract. */
11
- limit?: string | number;
12
- }
13
- /** Implements run telemetry for the public runtime surface of this module. */
14
- export declare function runTelemetry(options: TelemetryCommandOptions, _global: GlobalOptions): Promise<Record<string, unknown>>;
1
+ /**
2
+ * @module cli/commands/telemetry
3
+ *
4
+ * Compatibility export for SDK-owned telemetry diagnostics.
5
+ */
6
+ export * from "../../sdk/telemetry.js";
@@ -1,355 +1,10 @@
1
1
  /**
2
2
  * @module cli/commands/telemetry
3
3
  *
4
- * Implements the pm telemetry command surface and its agent-facing runtime behavior.
4
+ * Compatibility export for SDK-owned telemetry diagnostics.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a0a5873e-adac-517e-901b-9462c208164c")}catch(e){}}();
8
- import fs from "node:fs/promises";
9
- import path from "node:path";
10
- import { pathExists, readFileIfExists } from "../../core/fs/fs-utils.js";
11
- import { EXIT_CODE } from "../../core/shared/constants.js";
12
- import { PmCliError } from "../../core/shared/errors.js";
13
- import { nowIso } from "../../core/shared/time.js";
14
- import { resolveGlobalPmRoot } from "../../core/store/paths.js";
15
- import { readSettings, writeSettings } from "../../core/store/settings.js";
16
- import { flushTelemetryQueueNow } from "../../core/telemetry/runtime.js";
17
- const TELEMETRY_QUEUE_RELATIVE_PATH = path.join("runtime", "telemetry", "events.jsonl");
18
- const TELEMETRY_STATE_RELATIVE_PATH = path.join("runtime", "telemetry", "state.json");
19
- const TELEMETRY_RUNTIME_RELATIVE_PATH = path.join("runtime", "telemetry");
20
- const DEFAULT_STATS_LIMIT = 20;
21
- /** Public contract for telemetry subcommands, shared by SDK and presentation-layer consumers. */
22
- export const TELEMETRY_SUBCOMMANDS = [
23
- "status",
24
- "flush",
25
- "stats",
26
- "clear",
27
- ];
28
- /**
29
- * Returns the nearest-rank percentile of an ascending-sorted, non-empty array.
30
- *
31
- * Uses the nearest-rank method (rank = ceil(fraction × n), 1-based, clamped into
32
- * range) so the result is always an observed sample value with no interpolation.
33
- */
34
- function nearestRankPercentile(sortedAscending, fraction) {
35
- const rank = Math.ceil(fraction * sortedAscending.length);
36
- const index = Math.min(sortedAscending.length - 1, Math.max(0, rank - 1));
37
- return sortedAscending[index];
38
- }
39
- function normalizeTelemetryQueueEntry(entry) {
40
- const command = typeof entry.event.command === "string" &&
41
- entry.event.command.trim().length > 0
42
- ? entry.event.command
43
- : "<unknown>";
44
- const eventType = typeof entry.event.event_type === "string" &&
45
- entry.event.event_type.trim().length > 0
46
- ? entry.event.event_type
47
- : "unknown";
48
- const eventSchemaVersion = typeof entry.event.schema_version === "number" &&
49
- Number.isFinite(entry.event.schema_version)
50
- ? Math.trunc(entry.event.schema_version)
51
- : undefined;
52
- const clientSchemaVersion = typeof entry.client_schema_version === "number" &&
53
- Number.isFinite(entry.client_schema_version)
54
- ? Math.trunc(entry.client_schema_version)
55
- : undefined;
56
- return { command, eventType, eventSchemaVersion, clientSchemaVersion };
57
- }
58
- function createTelemetryStatsAccumulator() {
59
- return {
60
- count: 0,
61
- max_attempts: 0,
62
- event_type_counts: {},
63
- event_schema_versions: new Set(),
64
- client_schema_versions: new Set(),
65
- finish_durations_ms: [],
66
- ok_count: 0,
67
- error_count: 0,
68
- resolution_counts: {},
69
- };
70
- }
71
- function recordTelemetryFinishPayload(current, payload) {
72
- const durationMs = typeof payload?.duration_ms === "number" &&
73
- Number.isFinite(payload.duration_ms)
74
- ? payload.duration_ms
75
- : undefined;
76
- if (durationMs !== undefined) {
77
- current.finish_durations_ms.push(durationMs);
78
- }
79
- if (payload?.ok === true) {
80
- current.ok_count += 1;
81
- }
82
- else {
83
- current.error_count += 1;
84
- }
85
- const resolution = typeof payload?.command_resolution === "string" &&
86
- payload.command_resolution.trim().length > 0
87
- ? payload.command_resolution
88
- : undefined;
89
- if (resolution !== undefined) {
90
- current.resolution_counts[resolution] =
91
- (current.resolution_counts[resolution] ?? 0) + 1;
92
- }
93
- }
94
- function recordTelemetryQueueEntry(grouped, entry) {
95
- const normalized = normalizeTelemetryQueueEntry(entry);
96
- const current = grouped.get(normalized.command) ?? createTelemetryStatsAccumulator();
97
- const attempts = Number.isFinite(entry.attempts)
98
- ? Math.max(0, Math.trunc(entry.attempts))
99
- : 0;
100
- current.count += 1;
101
- current.max_attempts = Math.max(current.max_attempts, attempts);
102
- current.event_type_counts[normalized.eventType] =
103
- (current.event_type_counts[normalized.eventType] ?? 0) + 1;
104
- if (normalized.eventSchemaVersion !== undefined) {
105
- current.event_schema_versions.add(normalized.eventSchemaVersion);
106
- }
107
- if (normalized.clientSchemaVersion !== undefined) {
108
- current.client_schema_versions.add(normalized.clientSchemaVersion);
109
- }
110
- if (normalized.eventType === "command_finish") {
111
- recordTelemetryFinishPayload(current, entry.event.payload);
112
- }
113
- grouped.set(normalized.command, current);
114
- }
115
- function buildTelemetryStatsBucket(command, value) {
116
- const finishCount = value.ok_count + value.error_count;
117
- const sortedDurations = [...value.finish_durations_ms].sort((left, right) => left - right);
118
- const resolutionEntries = Object.entries(value.resolution_counts).sort((left, right) => left[0].localeCompare(right[0]));
119
- return {
120
- command,
121
- count: value.count,
122
- event_type_counts: Object.fromEntries(Object.entries(value.event_type_counts).sort((left, right) => left[0].localeCompare(right[0]))),
123
- max_attempts: value.max_attempts,
124
- event_schema_versions: [...value.event_schema_versions].sort((left, right) => left - right),
125
- client_schema_versions: [...value.client_schema_versions].sort((left, right) => left - right),
126
- ...(sortedDurations.length > 0
127
- ? {
128
- duration_p50_ms: nearestRankPercentile(sortedDurations, 0.5),
129
- duration_p95_ms: nearestRankPercentile(sortedDurations, 0.95),
130
- duration_max_ms: sortedDurations[sortedDurations.length - 1],
131
- }
132
- : {}),
133
- ...(finishCount > 0
134
- ? {
135
- ok_count: value.ok_count,
136
- error_count: value.error_count,
137
- error_rate: value.error_count / finishCount,
138
- }
139
- : {}),
140
- ...(resolutionEntries.length > 0
141
- ? { command_resolution_counts: Object.fromEntries(resolutionEntries) }
142
- : {}),
143
- };
144
- }
145
- function normalizeTelemetrySubcommand(value) {
146
- const normalized = (value ?? "status").trim().toLowerCase();
147
- if (TELEMETRY_SUBCOMMANDS.includes(normalized)) {
148
- return normalized;
149
- }
150
- // `value` is always a defined string here: an undefined subcommand normalizes
151
- // to "status" above (a valid value) and never reaches this throw.
152
- throw new PmCliError(`Unknown pm telemetry subcommand "${value}". Allowed: ${TELEMETRY_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, {
153
- code: "unknown_subcommand",
154
- examples: [
155
- "pm telemetry status",
156
- "pm telemetry flush",
157
- "pm telemetry stats --limit 10",
158
- "pm telemetry clear",
159
- ],
160
- });
161
- }
162
- function parseTelemetryStatsLimit(raw) {
163
- if (raw === undefined) {
164
- return DEFAULT_STATS_LIMIT;
165
- }
166
- if (typeof raw === "number") {
167
- if (!Number.isFinite(raw) || !Number.isInteger(raw) || raw <= 0) {
168
- throw new PmCliError("--limit must be a positive integer", EXIT_CODE.USAGE);
169
- }
170
- return raw;
171
- }
172
- const trimmed = raw.trim();
173
- if (trimmed.length === 0 || !/^\d+$/.test(trimmed)) {
174
- throw new PmCliError("--limit must be a positive integer", EXIT_CODE.USAGE);
175
- }
176
- const parsed = Number.parseInt(trimmed, 10);
177
- if (!Number.isFinite(parsed) || parsed <= 0) {
178
- throw new PmCliError("--limit must be a positive integer", EXIT_CODE.USAGE);
179
- }
180
- return parsed;
181
- }
182
- function parseTelemetryQueue(raw) {
183
- if (raw === null || raw.trim().length === 0) {
184
- return {
185
- rows_total: 0,
186
- valid_entries: 0,
187
- invalid_rows: 0,
188
- entries: [],
189
- };
190
- }
191
- const entries = [];
192
- let rowsTotal = 0;
193
- let invalidRows = 0;
194
- for (const line of raw.split("\n")) {
195
- const trimmed = line.trim();
196
- if (trimmed.length === 0) {
197
- continue;
198
- }
199
- rowsTotal += 1;
200
- try {
201
- const parsed = JSON.parse(trimmed);
202
- if (typeof parsed === "object" &&
203
- parsed !== null &&
204
- typeof parsed.attempts === "number" &&
205
- typeof parsed.event === "object" &&
206
- parsed.event !== null) {
207
- entries.push(parsed);
208
- }
209
- else {
210
- invalidRows += 1;
211
- }
212
- }
213
- catch {
214
- invalidRows += 1;
215
- }
216
- }
217
- return {
218
- rows_total: rowsTotal,
219
- valid_entries: entries.length,
220
- invalid_rows: invalidRows,
221
- entries,
222
- };
223
- }
224
- async function readTelemetryRuntimeState(statePath) {
225
- const stateRaw = await readFileIfExists(statePath);
226
- if (stateRaw === null || stateRaw.trim().length === 0) {
227
- return {};
228
- }
229
- try {
230
- const parsed = JSON.parse(stateRaw);
231
- if (typeof parsed === "object" &&
232
- parsed !== null &&
233
- !Array.isArray(parsed)) {
234
- return parsed;
235
- }
236
- }
237
- catch {
238
- // Ignore malformed state files; status command is observational.
239
- }
240
- return {};
241
- }
242
- async function buildTelemetryStatusSummary(globalPmRoot) {
243
- const settings = await readSettings(globalPmRoot);
244
- const queuePath = path.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH);
245
- const statePath = path.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH);
246
- const queueRaw = await readFileIfExists(queuePath);
247
- const queue = parseTelemetryQueue(queueRaw);
248
- const runtimeState = await readTelemetryRuntimeState(statePath);
249
- return {
250
- enabled: settings.telemetry.enabled,
251
- endpoint: settings.telemetry.endpoint,
252
- queue_path: queuePath,
253
- state_path: statePath,
254
- queue_rows_total: queue.rows_total,
255
- queue_entries: queue.valid_entries,
256
- queue_invalid_rows: queue.invalid_rows,
257
- queue_size_bytes: queueRaw === null ? 0 : Buffer.byteLength(queueRaw, "utf8"),
258
- last_attempted_flush_at: runtimeState.last_attempted_flush_at ?? null,
259
- last_successful_flush_at: runtimeState.last_successful_flush_at ?? null,
260
- last_failed_flush_at: runtimeState.last_failed_flush_at ?? null,
261
- last_failed_flush_error: runtimeState.last_failed_flush_error ?? null,
262
- };
263
- }
264
- function buildTelemetryStatsBuckets(entries) {
265
- const grouped = new Map();
266
- for (const entry of entries) {
267
- // Latency + outcome distribution come from command_finish payloads only:
268
- // command_finish always carries duration_ms/ok/command_resolution at every
269
- // capture level, while start/error events do not.
270
- recordTelemetryQueueEntry(grouped, entry);
271
- }
272
- return [...grouped.entries()]
273
- .map(([command, value]) => buildTelemetryStatsBucket(command, value))
274
- .sort((left, right) => right.count - left.count || left.command.localeCompare(right.command));
275
- }
276
- /** Implements run telemetry for the public runtime surface of this module. */
277
- export async function runTelemetry(options, _global) {
278
- void _global;
279
- const subcommand = normalizeTelemetrySubcommand(options.subcommand);
280
- const globalPmRoot = resolveGlobalPmRoot(process.cwd());
281
- const queuePath = path.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH);
282
- const statePath = path.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH);
283
- if (subcommand === "status") {
284
- return {
285
- action: "telemetry",
286
- subcommand,
287
- status: await buildTelemetryStatusSummary(globalPmRoot),
288
- generated_at: nowIso(),
289
- };
290
- }
291
- if (subcommand === "flush") {
292
- const before = await buildTelemetryStatusSummary(globalPmRoot);
293
- await flushTelemetryQueueNow(globalPmRoot);
294
- const after = await buildTelemetryStatusSummary(globalPmRoot);
295
- return {
296
- action: "telemetry",
297
- subcommand,
298
- queue_entries_before: before.queue_entries,
299
- queue_entries_after: after.queue_entries,
300
- queue_drained: after.queue_entries < before.queue_entries,
301
- status: after,
302
- generated_at: nowIso(),
303
- };
304
- }
305
- if (subcommand === "stats") {
306
- const limit = parseTelemetryStatsLimit(options.limit);
307
- const queueRaw = await readFileIfExists(queuePath);
308
- const queue = parseTelemetryQueue(queueRaw);
309
- const buckets = buildTelemetryStatsBuckets(queue.entries);
310
- const selected = buckets.slice(0, limit);
311
- return {
312
- action: "telemetry",
313
- subcommand,
314
- limit,
315
- total_commands: buckets.length,
316
- queue_entries: queue.valid_entries,
317
- queue_invalid_rows: queue.invalid_rows,
318
- queue_rows_total: queue.rows_total,
319
- truncated: buckets.length > selected.length,
320
- stats: selected,
321
- generated_at: nowIso(),
322
- };
323
- }
324
- const settings = await readSettings(globalPmRoot);
325
- const previousEnabled = settings.telemetry.enabled;
326
- const previousInstallationId = settings.telemetry.installation_id;
327
- const previousFirstRunPromptCompleted = settings.telemetry.first_run_prompt_completed;
328
- settings.telemetry.enabled = false;
329
- settings.telemetry.first_run_prompt_completed = true;
330
- settings.telemetry.installation_id = "";
331
- const settingsChanged = previousEnabled !== settings.telemetry.enabled ||
332
- previousInstallationId !== settings.telemetry.installation_id ||
333
- previousFirstRunPromptCompleted !==
334
- settings.telemetry.first_run_prompt_completed;
335
- if (settingsChanged) {
336
- await writeSettings(globalPmRoot, settings, "telemetry:clear");
337
- }
338
- const telemetryRuntimePath = path.join(globalPmRoot, TELEMETRY_RUNTIME_RELATIVE_PATH);
339
- const existed = await pathExists(telemetryRuntimePath);
340
- await fs.rm(telemetryRuntimePath, { recursive: true, force: true });
341
- const queueExistsAfter = await pathExists(queuePath);
342
- const stateExistsAfter = await pathExists(statePath);
343
- return {
344
- action: "telemetry",
345
- subcommand,
346
- settings_changed: settingsChanged,
347
- runtime_dir_removed: existed && !(await pathExists(telemetryRuntimePath)),
348
- queue_exists_after: queueExistsAfter,
349
- state_exists_after: stateExistsAfter,
350
- status: await buildTelemetryStatusSummary(globalPmRoot),
351
- generated_at: nowIso(),
352
- };
353
- }
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d305520e-3ead-55e7-8382-3a12e9692e93")}catch(e){}}();
8
+ export * from "../../sdk/telemetry.js";
354
9
  //# sourceMappingURL=telemetry.js.map
355
- //# debugId=a0a5873e-adac-517e-901b-9462c208164c
10
+ //# debugId=d305520e-3ead-55e7-8382-3a12e9692e93