@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,55 +1,55 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1a18538c-3ee2-5ab6-b7c2-b913c780563a")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="afd69b46-3b50-57d8-b120-4dcf45f8ff19")}catch(e){}}();
3
3
  import {
4
4
  runDocs
5
- } from "./chunk-IA5FKNII.js";
5
+ } from "./chunk-X2MGQMZO.js";
6
6
  import {
7
7
  collectDanglingDependencyReferences,
8
8
  createRelationshipKindRegistry
9
- } from "./chunk-JFTKLTEF.js";
9
+ } from "./chunk-YQCWK2MB.js";
10
10
  import {
11
11
  scanHistoryDrift
12
- } from "./chunk-SDQLJWBO.js";
12
+ } from "./chunk-NVZ6NVHJ.js";
13
13
  import {
14
14
  runFiles
15
- } from "./chunk-TQSZFPIS.js";
15
+ } from "./chunk-AFGKSHAM.js";
16
16
  import {
17
17
  isRemoteLinkedArtifactReference
18
- } from "./chunk-2JKGO6QX.js";
18
+ } from "./chunk-H5IOT54C.js";
19
19
  import {
20
20
  runUpdate
21
- } from "./chunk-EACOH7AU.js";
21
+ } from "./chunk-FZGM3PNA.js";
22
22
  import {
23
23
  wrapOwnershipConflict
24
- } from "./chunk-UY2ACEMF.js";
24
+ } from "./chunk-ILVOOAT4.js";
25
25
  import {
26
26
  PM_TELEMETRY_SOURCE_CONTEXT_VALUES,
27
27
  TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS,
28
28
  TELEMETRY_SCHEMA_VERSION,
29
29
  flushTelemetryQueueNow
30
- } from "./chunk-ONREO4ST.js";
30
+ } from "./chunk-EY7ZE3TG.js";
31
31
  import {
32
32
  buildCapabilityContractMetadata,
33
33
  buildRegistrationCollisionRemediation,
34
34
  collectUnknownCapabilityGuidance,
35
35
  readManagedExtensionState,
36
36
  runInit
37
- } from "./chunk-J6EY5V4N.js";
37
+ } from "./chunk-KOEZCHRF.js";
38
38
  import {
39
39
  collectStaleVectorizationIds,
40
40
  runNext
41
- } from "./chunk-7Z4LKRS4.js";
41
+ } from "./chunk-SPFZV2GR.js";
42
42
  import {
43
43
  computeContentFieldUtilization
44
- } from "./chunk-UXONS674.js";
44
+ } from "./chunk-SIJV365F.js";
45
45
  import {
46
46
  computeMetadataCoverage,
47
47
  groupItemsByDimension,
48
48
  lifecycleClassifierFromStatusRegistry
49
- } from "./chunk-2VPAVL7O.js";
49
+ } from "./chunk-CKX4WOPC.js";
50
50
  import {
51
51
  parseLimit
52
- } from "./chunk-NVPZIJVR.js";
52
+ } from "./chunk-PT7MCCGD.js";
53
53
  import {
54
54
  resolveAuthor
55
55
  } from "./chunk-CUFW7ITY.js";
@@ -62,7 +62,7 @@ import {
62
62
  resolveProviderConfigSource,
63
63
  resolveSettingsWithSemanticRuntimeDefaults,
64
64
  resolveVectorStores
65
- } from "./chunk-JXQUXVMI.js";
65
+ } from "./chunk-AFSV5HBB.js";
66
66
  import {
67
67
  ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,
68
68
  ACTIVITY_FLAG_CONTRACTS,
@@ -152,7 +152,7 @@ import {
152
152
  UPGRADE_FLAG_CONTRACTS,
153
153
  VALIDATE_FLAG_CONTRACTS,
154
154
  compactFlagAliasContracts
155
- } from "./chunk-3S5QVM5H.js";
155
+ } from "./chunk-NCAFUBJX.js";
156
156
  import {
157
157
  LINKED_TEST_PM_CONTEXT_MODE_VALUES,
158
158
  LINKED_TEST_PROTECTED_ENV_KEYS,
@@ -169,12 +169,12 @@ import {
169
169
  parseLinkedTestRegexList,
170
170
  parseLinkedTestStringList,
171
171
  runCreate
172
- } from "./chunk-EH2OPHBI.js";
172
+ } from "./chunk-HTXXXF45.js";
173
173
  import {
174
174
  createStdinTokenResolver,
175
175
  parseCsvKv,
176
176
  parseOptionalNumber
177
- } from "./chunk-EJEXHTY5.js";
177
+ } from "./chunk-FHOBCGQO.js";
178
178
  import {
179
179
  CURRENT_ITEM_FORMAT_VERSION,
180
180
  compareTimestampStrings,
@@ -201,7 +201,7 @@ import {
201
201
  stableValueEquals,
202
202
  toItemRecord,
203
203
  writeSettings
204
- } from "./chunk-Q7A43DS4.js";
204
+ } from "./chunk-P22HGFFI.js";
205
205
  import {
206
206
  DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS,
207
207
  DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS,
@@ -243,7 +243,7 @@ import {
243
243
  statusIsTerminal,
244
244
  toNonEmptyStringOrUndefined,
245
245
  writeFileAtomic
246
- } from "./chunk-QKECXBBG.js";
246
+ } from "./chunk-KX62NMZC.js";
247
247
 
248
248
  // dist/sdk/start-task-status.js
249
249
  function resolveStartTaskInProgressStatus(statusRegistry) {
@@ -5082,7 +5082,7 @@ function runRemind(title, options, global) {
5082
5082
  return runCreate(createOptions, global);
5083
5083
  }
5084
5084
 
5085
- // dist/cli/commands/stats.js
5085
+ // dist/sdk/stats.js
5086
5086
  import fs6 from "node:fs/promises";
5087
5087
  import path6 from "node:path";
5088
5088
 
@@ -5171,7 +5171,7 @@ function computeHistoryStorageStats(streams, options) {
5171
5171
  };
5172
5172
  }
5173
5173
 
5174
- // dist/cli/commands/stats.js
5174
+ // dist/sdk/stats.js
5175
5175
  function zeroByType(itemTypes) {
5176
5176
  return itemTypes.reduce((acc, value) => {
5177
5177
  acc[value] = 0;
@@ -5190,9 +5190,6 @@ function countNonEmptyLines(raw) {
5190
5190
  }
5191
5191
  return raw.split(/\r?\n/u).filter((line) => line.trim().length > 0).length;
5192
5192
  }
5193
- function isNotFoundError(error) {
5194
- return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
5195
- }
5196
5193
  async function readHistoryStreamContents(pmRoot) {
5197
5194
  const historyDir = path6.join(pmRoot, "history");
5198
5195
  if (!await pathExists(historyDir)) {
@@ -5206,14 +5203,9 @@ async function readHistoryStreamContents(pmRoot) {
5206
5203
  const streams = [];
5207
5204
  for (const file of historyFiles) {
5208
5205
  const historyPath = path6.join(historyDir, file);
5209
- let raw;
5210
- try {
5211
- raw = await fs6.readFile(historyPath, "utf8");
5212
- } catch (error) {
5213
- if (isNotFoundError(error)) {
5214
- continue;
5215
- }
5216
- throw error;
5206
+ const raw = await readFileIfExists(historyPath);
5207
+ if (raw === null) {
5208
+ continue;
5217
5209
  }
5218
5210
  await runActiveOnReadHooks({
5219
5211
  path: historyPath,
@@ -5282,7 +5274,7 @@ async function runStats(global, options = {}) {
5282
5274
  };
5283
5275
  }
5284
5276
 
5285
- // dist/cli/commands/telemetry.js
5277
+ // dist/sdk/telemetry.js
5286
5278
  import fs7 from "node:fs/promises";
5287
5279
  import path7 from "node:path";
5288
5280
  var TELEMETRY_QUEUE_RELATIVE_PATH2 = path7.join("runtime", "telemetry", "events.jsonl");
@@ -5295,19 +5287,32 @@ var TELEMETRY_SUBCOMMANDS = [
5295
5287
  "stats",
5296
5288
  "clear"
5297
5289
  ];
5298
- function nearestRankPercentile(sortedAscending, fraction) {
5290
+ var nearestRankPercentile = (sortedAscending, fraction) => {
5299
5291
  const rank = Math.ceil(fraction * sortedAscending.length);
5300
5292
  const index = Math.min(sortedAscending.length - 1, Math.max(0, rank - 1));
5301
5293
  return sortedAscending[index];
5302
- }
5303
- function normalizeTelemetryQueueEntry(entry) {
5304
- const command = typeof entry.event.command === "string" && entry.event.command.trim().length > 0 ? entry.event.command : "<unknown>";
5305
- const eventType = typeof entry.event.event_type === "string" && entry.event.event_type.trim().length > 0 ? entry.event.event_type : "unknown";
5306
- const eventSchemaVersion = typeof entry.event.schema_version === "number" && Number.isFinite(entry.event.schema_version) ? Math.trunc(entry.event.schema_version) : void 0;
5307
- const clientSchemaVersion = typeof entry.client_schema_version === "number" && Number.isFinite(entry.client_schema_version) ? Math.trunc(entry.client_schema_version) : void 0;
5308
- return { command, eventType, eventSchemaVersion, clientSchemaVersion };
5309
- }
5310
- function createTelemetryStatsAccumulator() {
5294
+ };
5295
+ var normalizeTelemetryText = (value, fallback) => {
5296
+ if (typeof value !== "string") {
5297
+ return fallback;
5298
+ }
5299
+ return value.trim().length > 0 ? value : fallback;
5300
+ };
5301
+ var normalizeFiniteInteger = (value) => {
5302
+ if (typeof value !== "number" || !Number.isFinite(value)) {
5303
+ return void 0;
5304
+ }
5305
+ return Math.trunc(value);
5306
+ };
5307
+ var normalizeTelemetryQueueEntry = (entry) => {
5308
+ return {
5309
+ command: normalizeTelemetryText(entry.event.command, "<unknown>"),
5310
+ eventType: normalizeTelemetryText(entry.event.event_type, "unknown"),
5311
+ eventSchemaVersion: normalizeFiniteInteger(entry.event.schema_version),
5312
+ clientSchemaVersion: normalizeFiniteInteger(entry.client_schema_version)
5313
+ };
5314
+ };
5315
+ var createTelemetryStatsAccumulator = () => {
5311
5316
  return {
5312
5317
  count: 0,
5313
5318
  max_attempts: 0,
@@ -5319,9 +5324,20 @@ function createTelemetryStatsAccumulator() {
5319
5324
  error_count: 0,
5320
5325
  resolution_counts: {}
5321
5326
  };
5322
- }
5323
- function recordTelemetryFinishPayload(current, payload) {
5324
- const durationMs = typeof payload?.duration_ms === "number" && Number.isFinite(payload.duration_ms) ? payload.duration_ms : void 0;
5327
+ };
5328
+ var readTelemetryDuration = (payload) => {
5329
+ const value = payload?.duration_ms;
5330
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
5331
+ };
5332
+ var readTelemetryResolution = (payload) => {
5333
+ const value = payload?.command_resolution;
5334
+ return normalizeTelemetryText(value, "") || void 0;
5335
+ };
5336
+ var incrementTelemetryCount = (counts, key) => {
5337
+ counts[key] = (counts[key] ?? 0) + 1;
5338
+ };
5339
+ var recordTelemetryFinishPayload = (current, payload) => {
5340
+ const durationMs = readTelemetryDuration(payload);
5325
5341
  if (durationMs !== void 0) {
5326
5342
  current.finish_durations_ms.push(durationMs);
5327
5343
  }
@@ -5330,30 +5346,31 @@ function recordTelemetryFinishPayload(current, payload) {
5330
5346
  } else {
5331
5347
  current.error_count += 1;
5332
5348
  }
5333
- const resolution = typeof payload?.command_resolution === "string" && payload.command_resolution.trim().length > 0 ? payload.command_resolution : void 0;
5349
+ const resolution = readTelemetryResolution(payload);
5334
5350
  if (resolution !== void 0) {
5335
- current.resolution_counts[resolution] = (current.resolution_counts[resolution] ?? 0) + 1;
5351
+ incrementTelemetryCount(current.resolution_counts, resolution);
5336
5352
  }
5337
- }
5338
- function recordTelemetryQueueEntry(grouped, entry) {
5353
+ };
5354
+ var normalizeTelemetryAttempts = (attempts) => Number.isFinite(attempts) ? Math.max(0, Math.trunc(attempts)) : 0;
5355
+ var addTelemetryDimension = (values, value) => {
5356
+ if (value !== void 0) {
5357
+ values.add(value);
5358
+ }
5359
+ };
5360
+ var recordTelemetryQueueEntry = (grouped, entry) => {
5339
5361
  const normalized = normalizeTelemetryQueueEntry(entry);
5340
5362
  const current = grouped.get(normalized.command) ?? createTelemetryStatsAccumulator();
5341
- const attempts = Number.isFinite(entry.attempts) ? Math.max(0, Math.trunc(entry.attempts)) : 0;
5342
5363
  current.count += 1;
5343
- current.max_attempts = Math.max(current.max_attempts, attempts);
5344
- current.event_type_counts[normalized.eventType] = (current.event_type_counts[normalized.eventType] ?? 0) + 1;
5345
- if (normalized.eventSchemaVersion !== void 0) {
5346
- current.event_schema_versions.add(normalized.eventSchemaVersion);
5347
- }
5348
- if (normalized.clientSchemaVersion !== void 0) {
5349
- current.client_schema_versions.add(normalized.clientSchemaVersion);
5350
- }
5364
+ current.max_attempts = Math.max(current.max_attempts, normalizeTelemetryAttempts(entry.attempts));
5365
+ incrementTelemetryCount(current.event_type_counts, normalized.eventType);
5366
+ addTelemetryDimension(current.event_schema_versions, normalized.eventSchemaVersion);
5367
+ addTelemetryDimension(current.client_schema_versions, normalized.clientSchemaVersion);
5351
5368
  if (normalized.eventType === "command_finish") {
5352
5369
  recordTelemetryFinishPayload(current, entry.event.payload);
5353
5370
  }
5354
5371
  grouped.set(normalized.command, current);
5355
- }
5356
- function buildTelemetryStatsBucket(command, value) {
5372
+ };
5373
+ var buildTelemetryStatsBucket = (command, value) => {
5357
5374
  const finishCount = value.ok_count + value.error_count;
5358
5375
  const sortedDurations = [...value.finish_durations_ms].sort((left, right) => left - right);
5359
5376
  const resolutionEntries = Object.entries(value.resolution_counts).sort((left, right) => left[0].localeCompare(right[0]));
@@ -5376,8 +5393,8 @@ function buildTelemetryStatsBucket(command, value) {
5376
5393
  } : {},
5377
5394
  ...resolutionEntries.length > 0 ? { command_resolution_counts: Object.fromEntries(resolutionEntries) } : {}
5378
5395
  };
5379
- }
5380
- function normalizeTelemetrySubcommand(value) {
5396
+ };
5397
+ var normalizeTelemetrySubcommand = (value) => {
5381
5398
  const normalized = (value ?? "status").trim().toLowerCase();
5382
5399
  if (TELEMETRY_SUBCOMMANDS.includes(normalized)) {
5383
5400
  return normalized;
@@ -5391,78 +5408,93 @@ function normalizeTelemetrySubcommand(value) {
5391
5408
  "pm telemetry clear"
5392
5409
  ]
5393
5410
  });
5394
- }
5395
- function parseTelemetryStatsLimit(raw) {
5411
+ };
5412
+ var throwInvalidTelemetryLimit = () => {
5413
+ throw new PmCliError("--limit must be a positive integer", EXIT_CODE.USAGE);
5414
+ };
5415
+ var requirePositiveTelemetryLimit = (value) => {
5416
+ if ([!Number.isFinite(value), !Number.isInteger(value), value <= 0].includes(true)) {
5417
+ return throwInvalidTelemetryLimit();
5418
+ }
5419
+ return value;
5420
+ };
5421
+ var parseTelemetryStringLimit = (raw) => {
5422
+ const trimmed = raw.trim();
5423
+ if ([trimmed.length === 0, !/^\d+$/.test(trimmed)].includes(true)) {
5424
+ return throwInvalidTelemetryLimit();
5425
+ }
5426
+ return requirePositiveTelemetryLimit(Number.parseInt(trimmed, 10));
5427
+ };
5428
+ var parseTelemetryStatsLimit = (raw) => {
5396
5429
  if (raw === void 0) {
5397
5430
  return DEFAULT_STATS_LIMIT;
5398
5431
  }
5399
5432
  if (typeof raw === "number") {
5400
- if (!Number.isFinite(raw) || !Number.isInteger(raw) || raw <= 0) {
5401
- throw new PmCliError("--limit must be a positive integer", EXIT_CODE.USAGE);
5402
- }
5403
- return raw;
5433
+ return requirePositiveTelemetryLimit(raw);
5404
5434
  }
5405
- const trimmed = raw.trim();
5406
- if (trimmed.length === 0 || !/^\d+$/.test(trimmed)) {
5407
- throw new PmCliError("--limit must be a positive integer", EXIT_CODE.USAGE);
5435
+ if (typeof raw === "string") {
5436
+ return parseTelemetryStringLimit(raw);
5408
5437
  }
5409
- const parsed = Number.parseInt(trimmed, 10);
5410
- if (!Number.isFinite(parsed) || parsed <= 0) {
5411
- throw new PmCliError("--limit must be a positive integer", EXIT_CODE.USAGE);
5438
+ return throwInvalidTelemetryLimit();
5439
+ };
5440
+ var isTelemetryQueueEntry = (value) => {
5441
+ if (typeof value !== "object" || value === null) {
5442
+ return false;
5412
5443
  }
5413
- return parsed;
5414
- }
5415
- function parseTelemetryQueue2(raw) {
5416
- if (raw === null || raw.trim().length === 0) {
5417
- return {
5418
- rows_total: 0,
5419
- valid_entries: 0,
5420
- invalid_rows: 0,
5421
- entries: []
5422
- };
5444
+ const candidate = value;
5445
+ return typeof candidate.attempts === "number" && typeof candidate.event === "object" && candidate.event !== null;
5446
+ };
5447
+ var parseTelemetryQueueRow = (row) => {
5448
+ try {
5449
+ const parsed = JSON.parse(row);
5450
+ return isTelemetryQueueEntry(parsed) ? parsed : void 0;
5451
+ } catch {
5452
+ return void 0;
5423
5453
  }
5454
+ };
5455
+ var splitTelemetryQueueRows = (raw) => {
5456
+ if (raw === null) {
5457
+ return [];
5458
+ }
5459
+ return raw.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
5460
+ };
5461
+ var parseTelemetryQueue2 = (raw) => {
5462
+ const rows = splitTelemetryQueueRows(raw);
5424
5463
  const entries = [];
5425
- let rowsTotal = 0;
5426
5464
  let invalidRows = 0;
5427
- for (const line of raw.split("\n")) {
5428
- const trimmed = line.trim();
5429
- if (trimmed.length === 0) {
5430
- continue;
5431
- }
5432
- rowsTotal += 1;
5433
- try {
5434
- const parsed = JSON.parse(trimmed);
5435
- if (typeof parsed === "object" && parsed !== null && typeof parsed.attempts === "number" && typeof parsed.event === "object" && parsed.event !== null) {
5436
- entries.push(parsed);
5437
- } else {
5438
- invalidRows += 1;
5439
- }
5440
- } catch {
5465
+ for (const row of rows) {
5466
+ const parsed = parseTelemetryQueueRow(row);
5467
+ if (parsed === void 0) {
5441
5468
  invalidRows += 1;
5469
+ } else {
5470
+ entries.push(parsed);
5442
5471
  }
5443
5472
  }
5444
5473
  return {
5445
- rows_total: rowsTotal,
5474
+ rows_total: rows.length,
5446
5475
  valid_entries: entries.length,
5447
5476
  invalid_rows: invalidRows,
5448
5477
  entries
5449
5478
  };
5450
- }
5451
- async function readTelemetryRuntimeState(statePath) {
5479
+ };
5480
+ var isTelemetryRuntimeState = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
5481
+ var parseTelemetryRuntimeState2 = (raw) => {
5482
+ try {
5483
+ const parsed = JSON.parse(raw);
5484
+ return isTelemetryRuntimeState(parsed) ? parsed : {};
5485
+ } catch {
5486
+ return {};
5487
+ }
5488
+ };
5489
+ var readTelemetryRuntimeState = async (statePath) => {
5452
5490
  const stateRaw = await readFileIfExists(statePath);
5453
5491
  if (stateRaw === null || stateRaw.trim().length === 0) {
5454
5492
  return {};
5455
5493
  }
5456
- try {
5457
- const parsed = JSON.parse(stateRaw);
5458
- if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
5459
- return parsed;
5460
- }
5461
- } catch {
5462
- }
5463
- return {};
5464
- }
5465
- async function buildTelemetryStatusSummary(globalPmRoot) {
5494
+ return parseTelemetryRuntimeState2(stateRaw);
5495
+ };
5496
+ var nullableTelemetryStateValue = (value) => value ?? null;
5497
+ var buildTelemetryStatusSummary = async (globalPmRoot) => {
5466
5498
  const settings = await readSettings(globalPmRoot);
5467
5499
  const queuePath = path7.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH2);
5468
5500
  const statePath = path7.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH2);
@@ -5477,253 +5509,102 @@ async function buildTelemetryStatusSummary(globalPmRoot) {
5477
5509
  queue_rows_total: queue.rows_total,
5478
5510
  queue_entries: queue.valid_entries,
5479
5511
  queue_invalid_rows: queue.invalid_rows,
5480
- queue_size_bytes: queueRaw === null ? 0 : Buffer.byteLength(queueRaw, "utf8"),
5481
- last_attempted_flush_at: runtimeState.last_attempted_flush_at ?? null,
5482
- last_successful_flush_at: runtimeState.last_successful_flush_at ?? null,
5483
- last_failed_flush_at: runtimeState.last_failed_flush_at ?? null,
5484
- last_failed_flush_error: runtimeState.last_failed_flush_error ?? null
5512
+ queue_size_bytes: Buffer.byteLength(queueRaw ?? "", "utf8"),
5513
+ last_attempted_flush_at: nullableTelemetryStateValue(runtimeState.last_attempted_flush_at),
5514
+ last_successful_flush_at: nullableTelemetryStateValue(runtimeState.last_successful_flush_at),
5515
+ last_failed_flush_at: nullableTelemetryStateValue(runtimeState.last_failed_flush_at),
5516
+ last_failed_flush_error: nullableTelemetryStateValue(runtimeState.last_failed_flush_error)
5485
5517
  };
5486
- }
5487
- function buildTelemetryStatsBuckets(entries) {
5518
+ };
5519
+ var buildTelemetryStatsBuckets = (entries) => {
5488
5520
  const grouped = /* @__PURE__ */ new Map();
5489
5521
  for (const entry of entries) {
5490
5522
  recordTelemetryQueueEntry(grouped, entry);
5491
5523
  }
5492
5524
  return [...grouped.entries()].map(([command, value]) => buildTelemetryStatsBucket(command, value)).sort((left, right) => right.count - left.count || left.command.localeCompare(right.command));
5493
- }
5494
- async function runTelemetry(options, _global) {
5495
- void _global;
5496
- const subcommand = normalizeTelemetrySubcommand(options.subcommand);
5497
- const globalPmRoot = resolveGlobalPmRoot(process.cwd());
5498
- const queuePath = path7.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH2);
5499
- const statePath = path7.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH2);
5500
- if (subcommand === "status") {
5501
- return {
5502
- action: "telemetry",
5503
- subcommand,
5504
- status: await buildTelemetryStatusSummary(globalPmRoot),
5505
- generated_at: nowIso()
5506
- };
5507
- }
5508
- if (subcommand === "flush") {
5509
- const before = await buildTelemetryStatusSummary(globalPmRoot);
5510
- await flushTelemetryQueueNow(globalPmRoot);
5511
- const after = await buildTelemetryStatusSummary(globalPmRoot);
5512
- return {
5513
- action: "telemetry",
5514
- subcommand,
5515
- queue_entries_before: before.queue_entries,
5516
- queue_entries_after: after.queue_entries,
5517
- queue_drained: after.queue_entries < before.queue_entries,
5518
- status: after,
5519
- generated_at: nowIso()
5520
- };
5521
- }
5522
- if (subcommand === "stats") {
5523
- const limit = parseTelemetryStatsLimit(options.limit);
5524
- const queueRaw = await readFileIfExists(queuePath);
5525
- const queue = parseTelemetryQueue2(queueRaw);
5526
- const buckets = buildTelemetryStatsBuckets(queue.entries);
5527
- const selected = buckets.slice(0, limit);
5528
- return {
5529
- action: "telemetry",
5530
- subcommand,
5531
- limit,
5532
- total_commands: buckets.length,
5533
- queue_entries: queue.valid_entries,
5534
- queue_invalid_rows: queue.invalid_rows,
5535
- queue_rows_total: queue.rows_total,
5536
- truncated: buckets.length > selected.length,
5537
- stats: selected,
5538
- generated_at: nowIso()
5539
- };
5540
- }
5541
- const settings = await readSettings(globalPmRoot);
5542
- const previousEnabled = settings.telemetry.enabled;
5543
- const previousInstallationId = settings.telemetry.installation_id;
5544
- const previousFirstRunPromptCompleted = settings.telemetry.first_run_prompt_completed;
5525
+ };
5526
+ var runTelemetryStatus = async (_options, context) => ({
5527
+ action: "telemetry",
5528
+ subcommand: "status",
5529
+ status: await buildTelemetryStatusSummary(context.globalPmRoot),
5530
+ generated_at: nowIso()
5531
+ });
5532
+ var runTelemetryFlush = async (_options, context) => {
5533
+ const before = await buildTelemetryStatusSummary(context.globalPmRoot);
5534
+ await flushTelemetryQueueNow(context.globalPmRoot);
5535
+ const after = await buildTelemetryStatusSummary(context.globalPmRoot);
5536
+ return {
5537
+ action: "telemetry",
5538
+ subcommand: "flush",
5539
+ queue_entries_before: before.queue_entries,
5540
+ queue_entries_after: after.queue_entries,
5541
+ queue_drained: after.queue_entries < before.queue_entries,
5542
+ status: after,
5543
+ generated_at: nowIso()
5544
+ };
5545
+ };
5546
+ var runTelemetryStats = async (options, context) => {
5547
+ const limit = parseTelemetryStatsLimit(options.limit);
5548
+ const queueRaw = await readFileIfExists(context.queuePath);
5549
+ const queue = parseTelemetryQueue2(queueRaw);
5550
+ const buckets = buildTelemetryStatsBuckets(queue.entries);
5551
+ const selected = buckets.slice(0, limit);
5552
+ return {
5553
+ action: "telemetry",
5554
+ subcommand: "stats",
5555
+ limit,
5556
+ total_commands: buckets.length,
5557
+ queue_entries: queue.valid_entries,
5558
+ queue_invalid_rows: queue.invalid_rows,
5559
+ queue_rows_total: queue.rows_total,
5560
+ truncated: buckets.length > selected.length,
5561
+ stats: selected,
5562
+ generated_at: nowIso()
5563
+ };
5564
+ };
5565
+ var runTelemetryClear = async (_options, context) => {
5566
+ const settings = await readSettings(context.globalPmRoot);
5567
+ const settingsChanged = [
5568
+ settings.telemetry.enabled !== false,
5569
+ settings.telemetry.installation_id !== "",
5570
+ settings.telemetry.first_run_prompt_completed !== true
5571
+ ].includes(true);
5545
5572
  settings.telemetry.enabled = false;
5546
5573
  settings.telemetry.first_run_prompt_completed = true;
5547
5574
  settings.telemetry.installation_id = "";
5548
- const settingsChanged = previousEnabled !== settings.telemetry.enabled || previousInstallationId !== settings.telemetry.installation_id || previousFirstRunPromptCompleted !== settings.telemetry.first_run_prompt_completed;
5549
5575
  if (settingsChanged) {
5550
- await writeSettings(globalPmRoot, settings, "telemetry:clear");
5576
+ await writeSettings(context.globalPmRoot, settings, "telemetry:clear");
5551
5577
  }
5552
- const telemetryRuntimePath = path7.join(globalPmRoot, TELEMETRY_RUNTIME_RELATIVE_PATH);
5578
+ const telemetryRuntimePath = path7.join(context.globalPmRoot, TELEMETRY_RUNTIME_RELATIVE_PATH);
5553
5579
  const existed = await pathExists(telemetryRuntimePath);
5554
5580
  await fs7.rm(telemetryRuntimePath, { recursive: true, force: true });
5555
- const queueExistsAfter = await pathExists(queuePath);
5556
- const stateExistsAfter = await pathExists(statePath);
5557
- return {
5558
- action: "telemetry",
5559
- subcommand,
5560
- settings_changed: settingsChanged,
5561
- runtime_dir_removed: existed && !await pathExists(telemetryRuntimePath),
5562
- queue_exists_after: queueExistsAfter,
5563
- state_exists_after: stateExistsAfter,
5564
- status: await buildTelemetryStatusSummary(globalPmRoot),
5565
- generated_at: nowIso()
5566
- };
5567
- }
5568
-
5569
- // dist/cli/commands/test.js
5570
- import { spawn } from "node:child_process";
5571
- import { cp, mkdir, mkdtemp, readdir, rm } from "node:fs/promises";
5572
- import { tmpdir } from "node:os";
5573
- import path8 from "node:path";
5574
-
5575
- // dist/core/test/item-test-run-tracking.js
5576
- var DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT = 20;
5577
- function trackedTestRunHistoryLimit() {
5578
- const raw = process.env.PM_TRACKED_TEST_RUN_HISTORY_LIMIT;
5579
- if (!raw || raw.trim().length === 0) {
5580
- return DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT;
5581
- }
5582
- const parsed = Number.parseInt(raw, 10);
5583
- if (!Number.isFinite(parsed) || parsed <= 0) {
5584
- return DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT;
5585
- }
5586
- return parsed;
5587
- }
5588
- function normalizeTrackedTestRunSummaries(entries) {
5589
- return [...entries].filter((entry) => entry.run_id.trim().length > 0 && entry.started_at.trim().length > 0 && entry.finished_at.trim().length > 0 && entry.recorded_at.trim().length > 0).sort((left, right) => {
5590
- const byRecorded = compareTimestampStrings(left.recorded_at, right.recorded_at);
5591
- if (byRecorded !== 0)
5592
- return byRecorded;
5593
- const byRunId = left.run_id.localeCompare(right.run_id);
5594
- if (byRunId !== 0)
5595
- return byRunId;
5596
- return left.kind.localeCompare(right.kind);
5597
- });
5598
- }
5599
- async function appendTrackedTestRunSummary(options) {
5600
- const historyLimit = trackedTestRunHistoryLimit();
5601
- await mutateItem({
5602
- pmRoot: options.pmRoot,
5603
- settings: options.settings,
5604
- id: options.itemId,
5605
- op: "test_run_track",
5606
- author: options.author,
5607
- message: options.message,
5608
- force: false,
5609
- mutate(document) {
5610
- const current = document.metadata.test_runs ?? [];
5611
- const next = normalizeTrackedTestRunSummaries([
5612
- ...current,
5613
- options.entry
5614
- ]);
5615
- const bounded = next.length > historyLimit ? next.slice(next.length - historyLimit) : next;
5616
- document.metadata.test_runs = bounded;
5617
- return { changedFields: ["test_runs"] };
5618
- }
5619
- });
5620
- }
5621
-
5622
- // dist/core/test/run-selectors.js
5623
- var MAX_SELECTOR_ENTRY_LABEL_LENGTH = 100;
5624
- function parseOnlyIndexValue(raw, optionName = "--only-index") {
5625
- const value = typeof raw === "number" ? raw : Number(String(raw).trim());
5626
- if (!Number.isInteger(value) || value < 1) {
5627
- throw new PmCliError(`${optionName} requires a 1-based integer index into the linked-test list (got "${raw}"). Use pm test <id> --list to inspect positions.`, EXIT_CODE.USAGE);
5628
- }
5629
- return value;
5630
- }
5631
- function summarizeSelectorEntry(entry) {
5632
- const label = entry.command ?? entry.path ?? "<no command>";
5633
- const normalized = label.replaceAll(/\s+/g, " ").trim() || "<no command>";
5634
- if (normalized.length <= MAX_SELECTOR_ENTRY_LABEL_LENGTH) {
5635
- return normalized;
5636
- }
5637
- return `${normalized.slice(0, MAX_SELECTOR_ENTRY_LABEL_LENGTH - 3)}...`;
5638
- }
5639
- function describeLinkedTestEntries(tests) {
5640
- return tests.map((entry, index) => `${index + 1}. ${summarizeSelectorEntry(entry)}`).join("; ");
5641
- }
5642
- function activeSelectorKinds(selector) {
5643
- const kinds = [];
5644
- if (selector.match !== void 0) {
5645
- kinds.push("match");
5646
- }
5647
- if (selector.onlyIndex !== void 0) {
5648
- kinds.push("only-index");
5649
- }
5650
- if (selector.onlyLast === true) {
5651
- kinds.push("only-last");
5652
- }
5653
- return kinds;
5654
- }
5655
- function entryMatchesSubstring(entry, needle) {
5656
- const command = entry.command?.toLowerCase() ?? "";
5657
- const entryPath = entry.path?.toLowerCase() ?? "";
5658
- return command.includes(needle) || entryPath.includes(needle);
5659
- }
5660
- function resolveLinkedTestRunSelection(tests, selector) {
5661
- const kinds = activeSelectorKinds(selector);
5662
- if (kinds.length === 0) {
5663
- return {
5664
- selector: null,
5665
- requested: null,
5666
- selected: tests,
5667
- selected_indexes: tests.map((_, index) => index + 1),
5668
- selected_count: tests.length,
5669
- skipped_count: 0
5670
- };
5671
- }
5672
- if (kinds.length > 1) {
5673
- throw new PmCliError(`Combine at most one linked-test selector per run: ${kinds.map((kind2) => `--${kind2}`).join(" and ")} were provided. Pick one of --match, --only-index, --only-last.`, EXIT_CODE.USAGE);
5674
- }
5675
- const kind = kinds[0];
5676
- if (tests.length === 0) {
5677
- throw new PmCliError(`--${kind} matched no linked tests because this item has none. Add one first with --add, --command, or --add-json.`, EXIT_CODE.USAGE);
5678
- }
5679
- if (kind === "match") {
5680
- const needle = selector.match.trim().toLowerCase();
5681
- if (needle.length === 0) {
5682
- throw new PmCliError("--match requires a non-empty substring to match against linked-test command/path values", EXIT_CODE.USAGE);
5683
- }
5684
- const selectedIndexes = [];
5685
- const selected = [];
5686
- for (let index = 0; index < tests.length; index += 1) {
5687
- if (entryMatchesSubstring(tests[index], needle)) {
5688
- selected.push(tests[index]);
5689
- selectedIndexes.push(index + 1);
5690
- }
5691
- }
5692
- if (selected.length === 0) {
5693
- throw new PmCliError(`--match "${selector.match}" matched none of the ${tests.length} linked test(s). Available entries: ${describeLinkedTestEntries(tests)}`, EXIT_CODE.USAGE);
5694
- }
5695
- return {
5696
- selector: "match",
5697
- requested: selector.match,
5698
- selected,
5699
- selected_indexes: selectedIndexes,
5700
- selected_count: selected.length,
5701
- skipped_count: tests.length - selected.length
5702
- };
5703
- }
5704
- if (kind === "only-index") {
5705
- const index = parseOnlyIndexValue(selector.onlyIndex);
5706
- if (index > tests.length) {
5707
- throw new PmCliError(`--only-index ${index} is out of range: this item has ${tests.length} linked test(s). Available entries: ${describeLinkedTestEntries(tests)}`, EXIT_CODE.USAGE);
5708
- }
5709
- return {
5710
- selector: "only-index",
5711
- requested: String(index),
5712
- selected: [tests[index - 1]],
5713
- selected_indexes: [index],
5714
- selected_count: 1,
5715
- skipped_count: tests.length - 1
5716
- };
5717
- }
5718
- return {
5719
- selector: "only-last",
5720
- requested: "last",
5721
- selected: [tests[tests.length - 1]],
5722
- selected_indexes: [tests.length],
5723
- selected_count: 1,
5724
- skipped_count: tests.length - 1
5581
+ return {
5582
+ action: "telemetry",
5583
+ subcommand: "clear",
5584
+ settings_changed: settingsChanged,
5585
+ runtime_dir_removed: existed && !await pathExists(telemetryRuntimePath),
5586
+ queue_exists_after: await pathExists(context.queuePath),
5587
+ state_exists_after: await pathExists(context.statePath),
5588
+ status: await buildTelemetryStatusSummary(context.globalPmRoot),
5589
+ generated_at: nowIso()
5725
5590
  };
5726
- }
5591
+ };
5592
+ var TELEMETRY_COMMAND_HANDLERS = {
5593
+ status: runTelemetryStatus,
5594
+ flush: runTelemetryFlush,
5595
+ stats: runTelemetryStats,
5596
+ clear: runTelemetryClear
5597
+ };
5598
+ var runTelemetry = async (options, _global) => {
5599
+ void _global;
5600
+ const subcommand = normalizeTelemetrySubcommand(options.subcommand);
5601
+ const globalPmRoot = resolveGlobalPmRoot(process.cwd());
5602
+ return TELEMETRY_COMMAND_HANDLERS[subcommand](options, {
5603
+ globalPmRoot,
5604
+ queuePath: path7.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH2),
5605
+ statePath: path7.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH2)
5606
+ });
5607
+ };
5727
5608
 
5728
5609
  // dist/sdk/test/linked-command-detection.js
5729
5610
  var PM_SUBCOMMANDS_WITH_ITEM_REFERENCE = /* @__PURE__ */ new Set([
@@ -6175,7 +6056,166 @@ function firstPositionalToken(tokens, flagsWithValue = /* @__PURE__ */ new Set()
6175
6056
  return void 0;
6176
6057
  }
6177
6058
 
6178
- // dist/cli/commands/test.js
6059
+ // dist/sdk/test/execution.js
6060
+ import { spawn } from "node:child_process";
6061
+ import { cp, mkdir, mkdtemp, readdir, rm } from "node:fs/promises";
6062
+ import { tmpdir } from "node:os";
6063
+ import path8 from "node:path";
6064
+
6065
+ // dist/core/test/item-test-run-tracking.js
6066
+ var DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT = 20;
6067
+ function trackedTestRunHistoryLimit() {
6068
+ const raw = process.env.PM_TRACKED_TEST_RUN_HISTORY_LIMIT;
6069
+ if (!raw || raw.trim().length === 0) {
6070
+ return DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT;
6071
+ }
6072
+ const parsed = Number.parseInt(raw, 10);
6073
+ if (!Number.isFinite(parsed) || parsed <= 0) {
6074
+ return DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT;
6075
+ }
6076
+ return parsed;
6077
+ }
6078
+ function normalizeTrackedTestRunSummaries(entries) {
6079
+ return [...entries].filter((entry) => entry.run_id.trim().length > 0 && entry.started_at.trim().length > 0 && entry.finished_at.trim().length > 0 && entry.recorded_at.trim().length > 0).sort((left, right) => {
6080
+ const byRecorded = compareTimestampStrings(left.recorded_at, right.recorded_at);
6081
+ if (byRecorded !== 0)
6082
+ return byRecorded;
6083
+ const byRunId = left.run_id.localeCompare(right.run_id);
6084
+ if (byRunId !== 0)
6085
+ return byRunId;
6086
+ return left.kind.localeCompare(right.kind);
6087
+ });
6088
+ }
6089
+ async function appendTrackedTestRunSummary(options) {
6090
+ const historyLimit = trackedTestRunHistoryLimit();
6091
+ await mutateItem({
6092
+ pmRoot: options.pmRoot,
6093
+ settings: options.settings,
6094
+ id: options.itemId,
6095
+ op: "test_run_track",
6096
+ author: options.author,
6097
+ message: options.message,
6098
+ force: false,
6099
+ mutate(document) {
6100
+ const current = document.metadata.test_runs ?? [];
6101
+ const next = normalizeTrackedTestRunSummaries([
6102
+ ...current,
6103
+ options.entry
6104
+ ]);
6105
+ const bounded = next.length > historyLimit ? next.slice(next.length - historyLimit) : next;
6106
+ document.metadata.test_runs = bounded;
6107
+ return { changedFields: ["test_runs"] };
6108
+ }
6109
+ });
6110
+ }
6111
+
6112
+ // dist/core/test/run-selectors.js
6113
+ var MAX_SELECTOR_ENTRY_LABEL_LENGTH = 100;
6114
+ function parseOnlyIndexValue(raw, optionName = "--only-index") {
6115
+ const value = typeof raw === "number" ? raw : Number(String(raw).trim());
6116
+ if (!Number.isInteger(value) || value < 1) {
6117
+ throw new PmCliError(`${optionName} requires a 1-based integer index into the linked-test list (got "${raw}"). Use pm test <id> --list to inspect positions.`, EXIT_CODE.USAGE);
6118
+ }
6119
+ return value;
6120
+ }
6121
+ function summarizeSelectorEntry(entry) {
6122
+ const label = entry.command ?? entry.path ?? "<no command>";
6123
+ const normalized = label.replaceAll(/\s+/g, " ").trim() || "<no command>";
6124
+ if (normalized.length <= MAX_SELECTOR_ENTRY_LABEL_LENGTH) {
6125
+ return normalized;
6126
+ }
6127
+ return `${normalized.slice(0, MAX_SELECTOR_ENTRY_LABEL_LENGTH - 3)}...`;
6128
+ }
6129
+ function describeLinkedTestEntries(tests) {
6130
+ return tests.map((entry, index) => `${index + 1}. ${summarizeSelectorEntry(entry)}`).join("; ");
6131
+ }
6132
+ function activeSelectorKinds(selector) {
6133
+ const kinds = [];
6134
+ if (selector.match !== void 0) {
6135
+ kinds.push("match");
6136
+ }
6137
+ if (selector.onlyIndex !== void 0) {
6138
+ kinds.push("only-index");
6139
+ }
6140
+ if (selector.onlyLast === true) {
6141
+ kinds.push("only-last");
6142
+ }
6143
+ return kinds;
6144
+ }
6145
+ function entryMatchesSubstring(entry, needle) {
6146
+ const command = entry.command?.toLowerCase() ?? "";
6147
+ const entryPath = entry.path?.toLowerCase() ?? "";
6148
+ return command.includes(needle) || entryPath.includes(needle);
6149
+ }
6150
+ function resolveLinkedTestRunSelection(tests, selector) {
6151
+ const kinds = activeSelectorKinds(selector);
6152
+ if (kinds.length === 0) {
6153
+ return {
6154
+ selector: null,
6155
+ requested: null,
6156
+ selected: tests,
6157
+ selected_indexes: tests.map((_, index) => index + 1),
6158
+ selected_count: tests.length,
6159
+ skipped_count: 0
6160
+ };
6161
+ }
6162
+ if (kinds.length > 1) {
6163
+ throw new PmCliError(`Combine at most one linked-test selector per run: ${kinds.map((kind2) => `--${kind2}`).join(" and ")} were provided. Pick one of --match, --only-index, --only-last.`, EXIT_CODE.USAGE);
6164
+ }
6165
+ const kind = kinds[0];
6166
+ if (tests.length === 0) {
6167
+ throw new PmCliError(`--${kind} matched no linked tests because this item has none. Add one first with --add, --command, or --add-json.`, EXIT_CODE.USAGE);
6168
+ }
6169
+ if (kind === "match") {
6170
+ const needle = selector.match.trim().toLowerCase();
6171
+ if (needle.length === 0) {
6172
+ throw new PmCliError("--match requires a non-empty substring to match against linked-test command/path values", EXIT_CODE.USAGE);
6173
+ }
6174
+ const selectedIndexes = [];
6175
+ const selected = [];
6176
+ for (let index = 0; index < tests.length; index += 1) {
6177
+ if (entryMatchesSubstring(tests[index], needle)) {
6178
+ selected.push(tests[index]);
6179
+ selectedIndexes.push(index + 1);
6180
+ }
6181
+ }
6182
+ if (selected.length === 0) {
6183
+ throw new PmCliError(`--match "${selector.match}" matched none of the ${tests.length} linked test(s). Available entries: ${describeLinkedTestEntries(tests)}`, EXIT_CODE.USAGE);
6184
+ }
6185
+ return {
6186
+ selector: "match",
6187
+ requested: selector.match,
6188
+ selected,
6189
+ selected_indexes: selectedIndexes,
6190
+ selected_count: selected.length,
6191
+ skipped_count: tests.length - selected.length
6192
+ };
6193
+ }
6194
+ if (kind === "only-index") {
6195
+ const index = parseOnlyIndexValue(selector.onlyIndex);
6196
+ if (index > tests.length) {
6197
+ throw new PmCliError(`--only-index ${index} is out of range: this item has ${tests.length} linked test(s). Available entries: ${describeLinkedTestEntries(tests)}`, EXIT_CODE.USAGE);
6198
+ }
6199
+ return {
6200
+ selector: "only-index",
6201
+ requested: String(index),
6202
+ selected: [tests[index - 1]],
6203
+ selected_indexes: [index],
6204
+ selected_count: 1,
6205
+ skipped_count: tests.length - 1
6206
+ };
6207
+ }
6208
+ return {
6209
+ selector: "only-last",
6210
+ requested: "last",
6211
+ selected: [tests[tests.length - 1]],
6212
+ selected_indexes: [tests.length],
6213
+ selected_count: 1,
6214
+ skipped_count: tests.length - 1
6215
+ };
6216
+ }
6217
+
6218
+ // dist/sdk/test/execution.js
6179
6219
  var TEST_OUTPUT_MAX_BUFFER_BYTES = 20 * 1024 * 1024;
6180
6220
  var DEFAULT_LINKED_TEST_TIMEOUT_FORCE_KILL_DELAY_MS = 3e3;
6181
6221
  var DEFAULT_LINKED_TEST_HEARTBEAT_INTERVAL_MS = 1e4;
@@ -6333,7 +6373,17 @@ function resolveLinkedTestEffectiveContextMode(requestedMode, isPmTrackerReadCom
6333
6373
  return requestedMode;
6334
6374
  }
6335
6375
  function hasLinkedTestAssertions(linkedTest) {
6336
- return (linkedTest.assert_stdout_contains?.length ?? 0) > 0 || (linkedTest.assert_stdout_regex?.length ?? 0) > 0 || (linkedTest.assert_stderr_contains?.length ?? 0) > 0 || (linkedTest.assert_stderr_regex?.length ?? 0) > 0 || typeof linkedTest.assert_stdout_min_lines === "number" || Object.keys(linkedTest.assert_json_field_equals ?? {}).length > 0 || Object.keys(linkedTest.assert_json_field_gte ?? {}).length > 0;
6376
+ return Object.entries(linkedTest).filter(([key]) => key.startsWith("assert_")).some(([, value]) => {
6377
+ if (value === void 0 || value === null)
6378
+ return false;
6379
+ if (Array.isArray(value))
6380
+ return value.length > 0;
6381
+ if (typeof value === "object")
6382
+ return Object.keys(value).length > 0;
6383
+ if (typeof value === "string")
6384
+ return value.trim().length > 0;
6385
+ return true;
6386
+ });
6337
6387
  }
6338
6388
  function buildPmContextMismatchHint(params) {
6339
6389
  const { executionContext, runLevelPmContextMode, linkedOverridePmContextMode } = params;
@@ -6437,6 +6487,12 @@ function parsedLauncherInvokesRecursiveTestAll(parsed) {
6437
6487
  }
6438
6488
  return firstPmSubcommand(parsed.args) === "test-all";
6439
6489
  }
6490
+ var SHELL_COMMAND_FLAG_PATTERNS = new Map([
6491
+ ...["sh", "bash", "dash", "zsh"].map((executable) => [executable, /^(?:-c|-[a-z]*c[a-z]*)$/u]),
6492
+ ...["cmd", "cmd.exe"].map((executable) => [executable, /^\/[ck]$/u]),
6493
+ ...["powershell", "powershell.exe", "pwsh", "pwsh.exe"].map((executable) => [executable, /^-(?:c|command)$/u])
6494
+ ]);
6495
+ var PACKAGE_EXEC_EXECUTABLES = /* @__PURE__ */ new Set(["npx", "bunx"]);
6440
6496
  function segmentInvokesRecursiveTestAll(segment) {
6441
6497
  const rawTokens = segment.split(" ").filter((token) => token.length > 0);
6442
6498
  const tokens = stripLeadingEnvAssignments(rawTokens);
@@ -6444,13 +6500,18 @@ function segmentInvokesRecursiveTestAll(segment) {
6444
6500
  return false;
6445
6501
  }
6446
6502
  const [executable, ...args] = tokens;
6503
+ const shellCommandFlagPattern = SHELL_COMMAND_FLAG_PATTERNS.get(executable);
6504
+ if (shellCommandFlagPattern) {
6505
+ const commandFlagIndex = args.findIndex((arg) => shellCommandFlagPattern.test(arg));
6506
+ return commandFlagIndex >= 0 ? segmentInvokesRecursiveTestAll(args.slice(commandFlagIndex + 1).join(" ")) : false;
6507
+ }
6447
6508
  if (isPmExecutableToken(executable) || isPmCliScriptToken(executable)) {
6448
6509
  return firstPmSubcommand(args) === "test-all";
6449
6510
  }
6450
6511
  if (executable === "node" && args.length > 0 && isPmCliScriptToken(args[0])) {
6451
6512
  return firstPmSubcommand(args.slice(1)) === "test-all";
6452
6513
  }
6453
- if (executable === "npx" || executable === "bunx") {
6514
+ if (PACKAGE_EXEC_EXECUTABLES.has(executable)) {
6454
6515
  return parsedLauncherInvokesRecursiveTestAll(parseNpxCommand(args));
6455
6516
  }
6456
6517
  if (executable === "pnpm") {
@@ -6564,7 +6625,13 @@ function parseLinkedTestTimeoutSeconds(timeoutSecondsRaw, timeoutAliasRaw) {
6564
6625
  throw new PmCliError("--add timeout and timeout_seconds must match when both are provided", EXIT_CODE.USAGE);
6565
6626
  }
6566
6627
  const timeoutRaw = timeoutSecondsRaw ?? timeoutAliasRaw;
6567
- return timeoutRaw === void 0 ? void 0 : Math.floor(parseOptionalNumber(timeoutRaw, "timeout_seconds"));
6628
+ if (timeoutRaw === void 0)
6629
+ return void 0;
6630
+ const timeout = Math.floor(parseOptionalNumber(timeoutRaw, "timeout_seconds"));
6631
+ if (timeout <= 0) {
6632
+ throw new PmCliError("--add timeout_seconds must be a positive integer", EXIT_CODE.USAGE);
6633
+ }
6634
+ return timeout;
6568
6635
  }
6569
6636
  function parseAddJsonEntries(raw) {
6570
6637
  if (!raw)
@@ -6762,7 +6829,7 @@ function appendLinkedTestOutputChunk(state, chunk, target) {
6762
6829
  state.stderrBytes += bytes;
6763
6830
  }
6764
6831
  const bufferExceeded = state.stdoutBytes > TEST_OUTPUT_MAX_BUFFER_BYTES || state.stderrBytes > TEST_OUTPUT_MAX_BUFFER_BYTES;
6765
- if (!state.maxBufferExceeded && bufferExceeded) {
6832
+ if (bufferExceeded) {
6766
6833
  state.maxBufferExceeded = true;
6767
6834
  return true;
6768
6835
  }
@@ -7090,7 +7157,7 @@ function readJsonPathValue(root, fieldPath) {
7090
7157
  current = current[segment];
7091
7158
  continue;
7092
7159
  }
7093
- if (typeof current !== "object" || current === null || !(segment in current)) {
7160
+ if (typeof current !== "object" || current === null || !Object.prototype.hasOwnProperty.call(current, segment)) {
7094
7161
  return { found: false, value: void 0 };
7095
7162
  }
7096
7163
  current = current[segment];
@@ -7277,7 +7344,7 @@ function buildLinkedTestExecutionContext(params) {
7277
7344
  sandbox_project_item_count: selectedSandboxProjectItemCount,
7278
7345
  source_global_item_count: params.counts.sourceGlobalItemCount,
7279
7346
  sandbox_global_item_count: selectedSandboxGlobalItemCount,
7280
- mismatch_detected: params.isPmCommand && params.counts.sourceProjectItemCount !== selectedSandboxProjectItemCount,
7347
+ mismatch_detected: params.isPmCommand && (params.counts.sourceProjectItemCount !== selectedSandboxProjectItemCount || params.counts.sourceGlobalItemCount !== selectedSandboxGlobalItemCount),
7281
7348
  project_extensions_seeded: Boolean(params.sourceRoots),
7282
7349
  global_extensions_seeded: Boolean(params.sourceRoots)
7283
7350
  };
@@ -7564,8 +7631,12 @@ function resolveTestRunOptions(options, tests) {
7564
7631
  onlyLast: options.onlyLast
7565
7632
  };
7566
7633
  const runSelection = options.run === true ? resolveLinkedTestRunSelection(tests, selectorInput) : void 0;
7634
+ const defaultTimeoutSeconds = options.timeout === void 0 ? void 0 : parseOptionalNumber(options.timeout, "timeout");
7635
+ if (defaultTimeoutSeconds !== void 0 && defaultTimeoutSeconds <= 0) {
7636
+ throw new PmCliError("Test timeout must be a positive number", EXIT_CODE.USAGE);
7637
+ }
7567
7638
  return {
7568
- defaultTimeoutSeconds: options.timeout === void 0 ? void 0 : parseOptionalNumber(options.timeout, "timeout"),
7639
+ defaultTimeoutSeconds,
7569
7640
  pmContextMode: parsePmContextMode(options.pmContext),
7570
7641
  runSelection,
7571
7642
  testsToRun: runSelection?.selected ?? tests
@@ -7706,8 +7777,8 @@ async function runTest(id, options, global) {
7706
7777
  };
7707
7778
  }
7708
7779
 
7709
- // dist/cli/commands/test-all.js
7710
- function parseStatus(raw, statusRegistry) {
7780
+ // dist/sdk/test/batch.js
7781
+ var parseStatus = (raw, statusRegistry) => {
7711
7782
  if (raw === void 0) {
7712
7783
  return void 0;
7713
7784
  }
@@ -7717,14 +7788,18 @@ function parseStatus(raw, statusRegistry) {
7717
7788
  throw new PmCliError(`Invalid --status value "${raw}". Allowed: ${allowedStatuses.join(", ")}`, EXIT_CODE.USAGE);
7718
7789
  }
7719
7790
  return normalized;
7720
- }
7721
- function parseTimeout(raw) {
7791
+ };
7792
+ var parseTimeout = (raw) => {
7722
7793
  if (raw === void 0) {
7723
7794
  return void 0;
7724
7795
  }
7725
- return parseOptionalNumber(raw, "timeout");
7726
- }
7727
- function parseNonNegativeInteger(raw, flag) {
7796
+ const parsed = parseOptionalNumber(raw, "timeout");
7797
+ if (parsed <= 0) {
7798
+ throw new PmCliError("timeout must be a positive number", EXIT_CODE.USAGE);
7799
+ }
7800
+ return parsed;
7801
+ };
7802
+ var parseNonNegativeInteger = (raw, flag) => {
7728
7803
  if (raw === void 0) {
7729
7804
  return void 0;
7730
7805
  }
@@ -7733,66 +7808,67 @@ function parseNonNegativeInteger(raw, flag) {
7733
7808
  throw new PmCliError(`${flag} must be a non-negative integer`, EXIT_CODE.USAGE);
7734
7809
  }
7735
7810
  return parsed;
7736
- }
7737
- function formatTrackingError(error) {
7811
+ };
7812
+ var formatTrackingError = (error) => {
7738
7813
  return error instanceof Error ? error.message : String(error);
7739
- }
7740
- function resolveTrackedRunId2() {
7814
+ };
7815
+ var resolveTrackedRunId2 = () => {
7741
7816
  const fromEnv = process.env.PM_BACKGROUND_TEST_RUN_ID?.trim();
7742
7817
  if (fromEnv && fromEnv.length > 0) {
7743
7818
  return fromEnv;
7744
7819
  }
7745
7820
  return `test-all-local-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
7746
- }
7747
- function normalizeCommand(command) {
7821
+ };
7822
+ var normalizeCommand = (command) => {
7748
7823
  return command.trim().replaceAll(/\s+/g, " ");
7749
- }
7750
- function normalizeEnvSetSignature(value) {
7824
+ };
7825
+ var normalizeEnvSetSignature = (value) => {
7751
7826
  if (!value || Object.keys(value).length === 0) {
7752
7827
  return "{}";
7753
7828
  }
7754
7829
  return JSON.stringify(Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right))));
7755
- }
7756
- function normalizeEnvClearSignature(value) {
7830
+ };
7831
+ var normalizeEnvClearSignature = (value) => {
7757
7832
  if (!value || value.length === 0) {
7758
7833
  return "[]";
7759
7834
  }
7760
7835
  return JSON.stringify([...value].sort((left, right) => left.localeCompare(right)));
7761
- }
7762
- function normalizePmContextModeSignature(value) {
7836
+ };
7837
+ var normalizePmContextModeSignature = (value) => {
7763
7838
  const normalized = value?.trim().toLowerCase();
7764
7839
  return normalized && normalized.length > 0 ? normalized : "none";
7765
- }
7766
- function normalizeAssertionSignature(test) {
7840
+ };
7841
+ var normalizeAssertionStrings = (values) => [...new Set(values ?? [])].sort((left, right) => left.localeCompare(right));
7842
+ var normalizeAssertionMap = (value) => Object.fromEntries(Object.entries(value ?? {}).sort(([left], [right]) => left.localeCompare(right)));
7843
+ var normalizeAssertionLineCount = (value) => typeof value === "number" ? value : void 0;
7844
+ var normalizeAssertionSignature = (test) => {
7767
7845
  const normalized = {
7768
- assert_stdout_contains: [
7769
- ...new Set(test.assert_stdout_contains ?? [])
7770
- ].sort((left, right) => left.localeCompare(right)),
7771
- assert_stdout_regex: [...new Set(test.assert_stdout_regex ?? [])].sort((left, right) => left.localeCompare(right)),
7772
- assert_stderr_contains: [
7773
- ...new Set(test.assert_stderr_contains ?? [])
7774
- ].sort((left, right) => left.localeCompare(right)),
7775
- assert_stderr_regex: [...new Set(test.assert_stderr_regex ?? [])].sort((left, right) => left.localeCompare(right)),
7776
- assert_stdout_min_lines: typeof test.assert_stdout_min_lines === "number" ? test.assert_stdout_min_lines : void 0,
7777
- assert_json_field_equals: Object.fromEntries(Object.entries(test.assert_json_field_equals ?? {}).sort(([left], [right]) => left.localeCompare(right))),
7778
- assert_json_field_gte: Object.fromEntries(Object.entries(test.assert_json_field_gte ?? {}).sort(([left], [right]) => left.localeCompare(right)))
7846
+ assert_stdout_contains: normalizeAssertionStrings(test.assert_stdout_contains),
7847
+ assert_stdout_regex: normalizeAssertionStrings(test.assert_stdout_regex),
7848
+ assert_stderr_contains: normalizeAssertionStrings(test.assert_stderr_contains),
7849
+ assert_stderr_regex: normalizeAssertionStrings(test.assert_stderr_regex),
7850
+ assert_stdout_min_lines: normalizeAssertionLineCount(test.assert_stdout_min_lines),
7851
+ assert_json_field_equals: normalizeAssertionMap(test.assert_json_field_equals),
7852
+ assert_json_field_gte: normalizeAssertionMap(test.assert_json_field_gte)
7779
7853
  };
7780
7854
  return JSON.stringify(normalized);
7781
- }
7782
- function buildLinkedTestKey(test) {
7783
- const command = test.command?.trim();
7784
- if (command && command.length > 0) {
7785
- const envSet = normalizeEnvSetSignature(test.env_set);
7786
- const envClear = normalizeEnvClearSignature(test.env_clear);
7787
- const pmContextMode = normalizePmContextModeSignature(test.pm_context_mode);
7788
- const sharedHostSafe = test.shared_host_safe === true ? "true" : "false";
7789
- const assertions = normalizeAssertionSignature(test);
7790
- return `command:${test.scope}:${normalizeCommand(command)}:${envSet}:${envClear}:${pmContextMode}:${sharedHostSafe}:${assertions}`;
7855
+ };
7856
+ var resolveLinkedTestTargetSignature = (test) => {
7857
+ const command = resolveOptionalEnvironmentValue(test.command);
7858
+ if (command !== void 0) {
7859
+ return `command:${test.scope}:${normalizeCommand(command)}`;
7791
7860
  }
7792
- const linkedPath = test.path?.trim() ?? "";
7793
- return `path:${test.scope}:${linkedPath}`;
7794
- }
7795
- function maxTimeoutSeconds(current, candidate) {
7861
+ return `path:${test.scope}:${resolveOptionalEnvironmentValue(test.path) ?? ""}`;
7862
+ };
7863
+ var buildLinkedTestKey = (test) => {
7864
+ const envSet = normalizeEnvSetSignature(test.env_set);
7865
+ const envClear = normalizeEnvClearSignature(test.env_clear);
7866
+ const pmContextMode = normalizePmContextModeSignature(test.pm_context_mode);
7867
+ const sharedHostSafe = test.shared_host_safe === true ? "true" : "false";
7868
+ const assertions = normalizeAssertionSignature(test);
7869
+ return `${resolveLinkedTestTargetSignature(test)}:${envSet}:${envClear}:${pmContextMode}:${sharedHostSafe}:${assertions}`;
7870
+ };
7871
+ var maxTimeoutSeconds = (current, candidate) => {
7796
7872
  if (candidate === void 0) {
7797
7873
  return current;
7798
7874
  }
@@ -7800,8 +7876,8 @@ function maxTimeoutSeconds(current, candidate) {
7800
7876
  return candidate;
7801
7877
  }
7802
7878
  return current;
7803
- }
7804
- function countStatuses(runResults) {
7879
+ };
7880
+ var countStatuses = (runResults) => {
7805
7881
  let passed = 0;
7806
7882
  let failed = 0;
7807
7883
  let skipped = 0;
@@ -7817,13 +7893,13 @@ function countStatuses(runResults) {
7817
7893
  skipped += 1;
7818
7894
  }
7819
7895
  return { passed, failed, skipped };
7820
- }
7821
- function mergeFailureCategoryCounts(target, source) {
7896
+ };
7897
+ var mergeFailureCategoryCounts = (target, source) => {
7822
7898
  for (const [key, value] of Object.entries(source)) {
7823
7899
  target[key] += value;
7824
7900
  }
7825
- }
7826
- function emitTestAllProgress(options, message) {
7901
+ };
7902
+ var emitTestAllProgress = (options, message) => {
7827
7903
  if (options.progress !== true) {
7828
7904
  return;
7829
7905
  }
@@ -7832,8 +7908,8 @@ function emitTestAllProgress(options, message) {
7832
7908
  `);
7833
7909
  } catch {
7834
7910
  }
7835
- }
7836
- async function collectTestAllItemTests(filteredItems, global, pmRoot) {
7911
+ };
7912
+ var collectTestAllItemTests = async (filteredItems, global, pmRoot) => {
7837
7913
  const itemTests = [];
7838
7914
  let linkedTests = 0;
7839
7915
  for (const item of filteredItems) {
@@ -7845,8 +7921,8 @@ async function collectTestAllItemTests(filteredItems, global, pmRoot) {
7845
7921
  itemTests.push({ item, tests: readResult.tests });
7846
7922
  }
7847
7923
  return { itemTests, linkedTests };
7848
- }
7849
- async function selectTestAllItems(params) {
7924
+ };
7925
+ var selectTestAllItems = async (params) => {
7850
7926
  const statusRegistry = resolveRuntimeStatusRegistry(params.settings.schema);
7851
7927
  const typeRegistry = resolveItemTypeRegistry(params.settings, getActiveExtensionRegistrations());
7852
7928
  const statusFilter = parseStatus(params.options.status, statusRegistry);
@@ -7856,8 +7932,8 @@ async function selectTestAllItems(params) {
7856
7932
  const statusFilteredItems = allItems.filter((item) => statusFilter ? item.status === statusFilter : true).sort((a, b) => a.id.localeCompare(b.id));
7857
7933
  const filteredItems = limitFilter === void 0 ? statusFilteredItems.slice(offsetFilter) : statusFilteredItems.slice(offsetFilter, offsetFilter + limitFilter);
7858
7934
  return { filteredItems, statusFilter, limitFilter, offsetFilter };
7859
- }
7860
- function buildEffectiveTimeoutByKey(itemTests) {
7935
+ };
7936
+ var buildEffectiveTimeoutByKey = (itemTests) => {
7861
7937
  const effectiveTimeoutByKey = /* @__PURE__ */ new Map();
7862
7938
  for (const { tests } of itemTests) {
7863
7939
  for (const test of tests) {
@@ -7870,8 +7946,8 @@ function buildEffectiveTimeoutByKey(itemTests) {
7870
7946
  }
7871
7947
  }
7872
7948
  return effectiveTimeoutByKey;
7873
- }
7874
- async function runTestAllItem(entry, context) {
7949
+ };
7950
+ var runTestAllItem = async (entry, context) => {
7875
7951
  const testsToRun = [];
7876
7952
  const keyedTests = entry.tests.map((test) => {
7877
7953
  const key = buildLinkedTestKey(test);
@@ -7932,12 +8008,18 @@ async function runTestAllItem(entry, context) {
7932
8008
  failure_categories: failureCategories
7933
8009
  }
7934
8010
  };
7935
- }
7936
- async function appendTestAllItemTracking(entry, summary, context) {
8011
+ };
8012
+ var trackedRunFailed = (summary, options) => [
8013
+ summary.failed > 0,
8014
+ options.failOnSkipped === true && summary.skipped > 0
8015
+ ].includes(true);
8016
+ var optionalTrue = (value) => value ? true : void 0;
8017
+ var appendTestAllItemTracking = async (entry, summary, context) => {
7937
8018
  if (!context.trackingEnabled) {
7938
8019
  return [];
7939
8020
  }
7940
8021
  try {
8022
+ const failed = trackedRunFailed(summary, context.options);
7941
8023
  await appendTrackedTestRunSummary({
7942
8024
  pmRoot: context.pmRoot,
7943
8025
  settings: context.settings,
@@ -7947,7 +8029,7 @@ async function appendTestAllItemTracking(entry, summary, context) {
7947
8029
  entry: {
7948
8030
  run_id: context.trackingRunId,
7949
8031
  kind: "test-all",
7950
- status: summary.failed > 0 || context.options.failOnSkipped === true && summary.skipped > 0 ? "failed" : "passed",
8032
+ status: failed ? "failed" : "passed",
7951
8033
  started_at: context.runStartedAt,
7952
8034
  finished_at: nowIso(),
7953
8035
  recorded_at: nowIso(),
@@ -7958,7 +8040,7 @@ async function appendTestAllItemTracking(entry, summary, context) {
7958
8040
  skipped: summary.skipped,
7959
8041
  items: 1,
7960
8042
  linked_tests: entry.tests.length,
7961
- fail_on_skipped_triggered: context.options.failOnSkipped === true && summary.skipped > 0 ? true : void 0
8043
+ fail_on_skipped_triggered: optionalTrue(context.options.failOnSkipped === true && summary.skipped > 0)
7962
8044
  }
7963
8045
  });
7964
8046
  } catch (error) {
@@ -7967,11 +8049,17 @@ async function appendTestAllItemTracking(entry, summary, context) {
7967
8049
  ];
7968
8050
  }
7969
8051
  return [];
7970
- }
7971
- function buildTestAllItemRunContext(params) {
7972
- const trackingAttemptRaw = process.env.PM_BACKGROUND_TEST_RUN_ATTEMPT?.trim();
7973
- const trackingParsedAttempt = trackingAttemptRaw ? Number.parseInt(trackingAttemptRaw, 10) : Number.NaN;
7974
- const trackingResumedFrom = process.env.PM_BACKGROUND_TEST_RUN_RESUMED_FROM?.trim();
8052
+ };
8053
+ var resolveTrackingAttempt = () => {
8054
+ const raw = process.env.PM_BACKGROUND_TEST_RUN_ATTEMPT?.trim();
8055
+ const parsed = raw ? Number.parseInt(raw, 10) : Number.NaN;
8056
+ return Number.isFinite(parsed) && parsed >= 1 ? parsed : void 0;
8057
+ };
8058
+ var resolveOptionalEnvironmentValue = (value) => {
8059
+ const trimmed = value?.trim();
8060
+ return trimmed && trimmed.length > 0 ? trimmed : void 0;
8061
+ };
8062
+ var buildTestAllItemRunContext = (params) => {
7975
8063
  return {
7976
8064
  pmRoot: params.pmRoot,
7977
8065
  settings: params.settings,
@@ -7986,12 +8074,12 @@ function buildTestAllItemRunContext(params) {
7986
8074
  trackingEnabled: params.settings.testing.record_results_to_items === true,
7987
8075
  trackingAuthor: resolveAuthor(void 0, params.settings.author_default),
7988
8076
  trackingRunId: resolveTrackedRunId2(),
7989
- trackingAttempt: Number.isFinite(trackingParsedAttempt) && trackingParsedAttempt >= 1 ? trackingParsedAttempt : void 0,
7990
- trackingResumedFrom: trackingResumedFrom && trackingResumedFrom.length > 0 ? trackingResumedFrom : void 0,
8077
+ trackingAttempt: resolveTrackingAttempt(),
8078
+ trackingResumedFrom: resolveOptionalEnvironmentValue(process.env.PM_BACKGROUND_TEST_RUN_RESUMED_FROM),
7991
8079
  runStartedAt: params.runStartedAt
7992
8080
  };
7993
- }
7994
- function initializeTestAllAccumulation(options, linkedTests, filteredItems) {
8081
+ };
8082
+ var initializeTestAllAccumulation = (options, linkedTests, filteredItems) => {
7995
8083
  const accumulation = {
7996
8084
  results: [],
7997
8085
  passed: 0,
@@ -8007,8 +8095,8 @@ function initializeTestAllAccumulation(options, linkedTests, filteredItems) {
8007
8095
  accumulation.trackingWarnings.push(`empty_linked_test_selection:items=${filteredItems.length};linked_tests=0;fail_on_empty_test_run=true`);
8008
8096
  }
8009
8097
  return { accumulation, failOnEmptyTestRunTriggered };
8010
- }
8011
- async function runTestAllItems(itemTests, context, accumulation) {
8098
+ };
8099
+ var runTestAllItems = async (itemTests, context, accumulation) => {
8012
8100
  for (const [itemIndex, entry] of itemTests.entries()) {
8013
8101
  emitTestAllProgress(context.options, `item ${itemIndex + 1}/${itemTests.length} start id=${entry.item.id} linked_tests=${entry.tests.length}`);
8014
8102
  const execution = await runTestAllItem(entry, context);
@@ -8020,16 +8108,16 @@ async function runTestAllItems(itemTests, context, accumulation) {
8020
8108
  accumulation.results.push(execution.result);
8021
8109
  emitTestAllProgress(context.options, `item ${itemIndex + 1}/${itemTests.length} end id=${entry.item.id} status=${execution.failed === 0 ? "passed" : "failed"} passed=${execution.passed} failed=${execution.failed} skipped=${execution.skipped}`);
8022
8110
  }
8023
- }
8024
- function appendContextPreflightWarning(options, accumulation) {
8111
+ };
8112
+ var appendContextPreflightWarning = (options, accumulation) => {
8025
8113
  if (options.checkContext !== true) {
8026
8114
  return;
8027
8115
  }
8028
8116
  const allRunResults = accumulation.results.flatMap((entry) => entry.run_results);
8029
8117
  const preflight = summarizeContextPreflight(allRunResults);
8030
8118
  accumulation.trackingWarnings.push(`context_preflight:checked_pm_commands=${preflight.checked_pm_commands};tracker_read_commands=${preflight.tracker_read_commands};mismatches=${preflight.mismatches};auto_remediated=${preflight.auto_remediated}`);
8031
- }
8032
- function buildTestAllResult(params) {
8119
+ };
8120
+ var buildTestAllResult = (params) => {
8033
8121
  return {
8034
8122
  ok: params.ok,
8035
8123
  totals: {
@@ -8048,43 +8136,77 @@ function buildTestAllResult(params) {
8048
8136
  warnings: params.accumulation.trackingWarnings.length > 0 ? params.accumulation.trackingWarnings : void 0,
8049
8137
  results: params.accumulation.results
8050
8138
  };
8051
- }
8052
- async function runTestAll(options, global) {
8139
+ };
8140
+ var buildTestAllSelectionProgress = (params) => [
8141
+ `selection items=${params.filteredItems.length}`,
8142
+ `linked_tests=${params.linkedTests}`,
8143
+ params.statusFilter === void 0 ? "" : `status=${params.statusFilter}`,
8144
+ params.limitFilter === void 0 ? "" : `limit=${params.limitFilter}`,
8145
+ params.offsetFilter > 0 ? `offset=${params.offsetFilter}` : ""
8146
+ ].filter((entry) => entry.length > 0).join(" ");
8147
+ var prepareTestAllRun = async (options, global) => {
8053
8148
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
8054
8149
  if (!await pathExists(getSettingsPath(pmRoot))) {
8055
8150
  throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
8056
8151
  }
8057
8152
  const settings = await readSettings(pmRoot);
8058
- const { filteredItems, statusFilter, limitFilter, offsetFilter } = await selectTestAllItems({ pmRoot, settings, options });
8153
+ const selection = await selectTestAllItems({ pmRoot, settings, options });
8059
8154
  const defaultTimeoutSeconds = parseTimeout(options.timeout);
8060
8155
  const runStartedAt = nowIso();
8061
- const { itemTests, linkedTests } = await collectTestAllItemTests(filteredItems, global, pmRoot);
8062
- emitTestAllProgress(options, `selection items=${filteredItems.length} linked_tests=${linkedTests}${statusFilter ? ` status=${statusFilter}` : ""}${limitFilter === void 0 ? "" : ` limit=${limitFilter}`}${offsetFilter > 0 ? ` offset=${offsetFilter}` : ""}`);
8063
- const { accumulation, failOnEmptyTestRunTriggered } = initializeTestAllAccumulation(options, linkedTests, filteredItems);
8064
- const itemRunContext = buildTestAllItemRunContext({
8156
+ const collected = await collectTestAllItemTests(selection.filteredItems, global, pmRoot);
8157
+ emitTestAllProgress(options, buildTestAllSelectionProgress({
8158
+ ...selection,
8159
+ linkedTests: collected.linkedTests
8160
+ }));
8161
+ return {
8065
8162
  pmRoot,
8066
8163
  settings,
8067
- options,
8068
- itemTests,
8164
+ filteredItems: selection.filteredItems,
8165
+ itemTests: collected.itemTests,
8166
+ linkedTests: collected.linkedTests,
8069
8167
  defaultTimeoutSeconds,
8070
8168
  runStartedAt
8169
+ };
8170
+ };
8171
+ var resolveTestAllOutcome = (params) => {
8172
+ const failOnSkippedTriggered = params.options.failOnSkipped === true && params.accumulation.skipped > 0;
8173
+ const ok = ![
8174
+ params.accumulation.failed > 0,
8175
+ failOnSkippedTriggered,
8176
+ params.failOnEmptyTestRunTriggered
8177
+ ].includes(true);
8178
+ return { failOnSkippedTriggered, ok };
8179
+ };
8180
+ var runTestAll = async (options, global) => {
8181
+ const prepared = await prepareTestAllRun(options, global);
8182
+ const { accumulation, failOnEmptyTestRunTriggered } = initializeTestAllAccumulation(options, prepared.linkedTests, prepared.filteredItems);
8183
+ const itemRunContext = buildTestAllItemRunContext({
8184
+ pmRoot: prepared.pmRoot,
8185
+ settings: prepared.settings,
8186
+ options,
8187
+ itemTests: prepared.itemTests,
8188
+ defaultTimeoutSeconds: prepared.defaultTimeoutSeconds,
8189
+ runStartedAt: prepared.runStartedAt
8071
8190
  });
8072
- await runTestAllItems(itemTests, itemRunContext, accumulation);
8073
- const failOnSkippedTriggered = options.failOnSkipped === true && accumulation.skipped > 0;
8191
+ await runTestAllItems(prepared.itemTests, itemRunContext, accumulation);
8074
8192
  appendContextPreflightWarning(options, accumulation);
8075
- const ok = accumulation.failed === 0 && failOnSkippedTriggered !== true && failOnEmptyTestRunTriggered !== true;
8076
- emitTestAllProgress(options, `end status=${ok ? "passed" : "failed"} items=${filteredItems.length} linked_tests=${linkedTests} passed=${accumulation.passed} failed=${accumulation.failed} skipped=${accumulation.skipped}`);
8193
+ const outcome = resolveTestAllOutcome({
8194
+ options,
8195
+ accumulation,
8196
+ failOnEmptyTestRunTriggered
8197
+ });
8198
+ emitTestAllProgress(options, `end status=${outcome.ok ? "passed" : "failed"} items=${prepared.filteredItems.length} linked_tests=${prepared.linkedTests} passed=${accumulation.passed} failed=${accumulation.failed} skipped=${accumulation.skipped}`);
8077
8199
  return buildTestAllResult({
8078
- ok,
8079
- filteredItems,
8080
- linkedTests,
8200
+ ok: outcome.ok,
8201
+ filteredItems: prepared.filteredItems,
8202
+ linkedTests: prepared.linkedTests,
8081
8203
  accumulation,
8082
- failOnSkippedTriggered,
8204
+ failOnSkippedTriggered: outcome.failOnSkippedTriggered,
8083
8205
  failOnEmptyTestRunTriggered
8084
8206
  });
8085
- }
8207
+ };
8086
8208
 
8087
- // dist/cli/commands/test-runs.js
8209
+ // dist/sdk/test/runs.js
8088
8210
  import os from "node:os";
8089
8211
 
8090
8212
  // dist/core/test/background-runs.js
@@ -8919,7 +9041,7 @@ async function readBackgroundTestRunLogs(pmRoot, runId, stream, tail) {
8919
9041
  };
8920
9042
  }
8921
9043
 
8922
- // dist/cli/commands/test-runs.js
9044
+ // dist/sdk/test/runs.js
8923
9045
  var BACKGROUND_STATUS_VALUES = [
8924
9046
  "queued",
8925
9047
  "running",
@@ -11269,7 +11391,14 @@ export {
11269
11391
  runEvent,
11270
11392
  runRemind,
11271
11393
  runStats,
11394
+ TELEMETRY_SUBCOMMANDS,
11272
11395
  runTelemetry,
11396
+ extractReferencedPmItemIdsFromCommand,
11397
+ summarizeContextPreflight,
11398
+ classifyLinkedTestFailure,
11399
+ countFailureCategories,
11400
+ resolveLinkedTestFailureExitCode,
11401
+ runLinkedTests,
11273
11402
  runTest,
11274
11403
  runTestAll,
11275
11404
  runStartBackgroundRun,
@@ -11283,6 +11412,6 @@ export {
11283
11412
  runValidate,
11284
11413
  runValidate2
11285
11414
  };
11286
- //# sourceMappingURL=chunk-5ZSLZLDN.js.map
11415
+ //# sourceMappingURL=chunk-HF63SBLC.js.map
11287
11416
 
11288
- //# debugId=1a18538c-3ee2-5ab6-b7c2-b913c780563a
11417
+ //# debugId=afd69b46-3b50-57d8-b120-4dcf45f8ff19