@unbrained/pm-cli 2026.7.16 → 2026.7.18

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 (620) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +30 -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/close.d.ts +1 -1
  8. package/dist/cli/commands/close.js +3 -3
  9. package/dist/cli/commands/close.js.map +1 -1
  10. package/dist/cli/commands/completion.js +47 -5
  11. package/dist/cli/commands/completion.js.map +1 -1
  12. package/dist/cli/commands/context.d.ts +2 -2
  13. package/dist/cli/commands/context.js +42 -28
  14. package/dist/cli/commands/context.js.map +1 -1
  15. package/dist/cli/commands/contracts.js +5 -3
  16. package/dist/cli/commands/contracts.js.map +1 -1
  17. package/dist/cli/commands/eval.d.ts +4 -64
  18. package/dist/cli/commands/eval.js +4 -153
  19. package/dist/cli/commands/eval.js.map +1 -1
  20. package/dist/cli/commands/graph.d.ts +7 -0
  21. package/dist/cli/commands/graph.js +11 -0
  22. package/dist/cli/commands/graph.js.map +1 -0
  23. package/dist/cli/commands/index.d.ts +1 -0
  24. package/dist/cli/commands/index.js +3 -2
  25. package/dist/cli/commands/index.js.map +1 -1
  26. package/dist/cli/commands/linked-test-entry.d.ts +6 -6
  27. package/dist/cli/commands/linked-test-entry.js +4 -65
  28. package/dist/cli/commands/linked-test-entry.js.map +1 -1
  29. package/dist/cli/commands/linked-test-parsers.d.ts +3 -45
  30. package/dist/cli/commands/linked-test-parsers.js +4 -516
  31. package/dist/cli/commands/linked-test-parsers.js.map +1 -1
  32. package/dist/cli/commands/list.d.ts +3 -210
  33. package/dist/cli/commands/list.js +4 -1068
  34. package/dist/cli/commands/list.js.map +1 -1
  35. package/dist/cli/commands/next.d.ts +1 -1
  36. package/dist/cli/commands/next.js +3 -3
  37. package/dist/cli/commands/next.js.map +1 -1
  38. package/dist/cli/commands/search.d.ts +3 -464
  39. package/dist/cli/commands/search.js +4 -2236
  40. package/dist/cli/commands/search.js.map +1 -1
  41. package/dist/cli/commands/stats.d.ts +6 -66
  42. package/dist/cli/commands/stats.js +4 -157
  43. package/dist/cli/commands/stats.js.map +1 -1
  44. package/dist/cli/commands/telemetry.d.ts +6 -14
  45. package/dist/cli/commands/telemetry.js +4 -349
  46. package/dist/cli/commands/telemetry.js.map +1 -1
  47. package/dist/cli/commands/test-all.d.ts +6 -95
  48. package/dist/cli/commands/test-all.js +4 -439
  49. package/dist/cli/commands/test-all.js.map +1 -1
  50. package/dist/cli/commands/test-runs.d.ts +6 -92
  51. package/dist/cli/commands/test-runs.js +4 -189
  52. package/dist/cli/commands/test-runs.js.map +1 -1
  53. package/dist/cli/commands/test.d.ts +6 -244
  54. package/dist/cli/commands/test.js +4 -1780
  55. package/dist/cli/commands/test.js.map +1 -1
  56. package/dist/cli/commands/update-many.d.ts +15 -29
  57. package/dist/cli/commands/update-many.js +355 -259
  58. package/dist/cli/commands/update-many.js.map +1 -1
  59. package/dist/cli/main.js +141 -133
  60. package/dist/cli/main.js.map +1 -1
  61. package/dist/cli/register-list-query.js +49 -7
  62. package/dist/cli/register-list-query.js.map +1 -1
  63. package/dist/cli/register-mutation.js +7 -3
  64. package/dist/cli/register-mutation.js.map +1 -1
  65. package/dist/cli/search-refresh.js +4 -9
  66. package/dist/cli/search-refresh.js.map +1 -1
  67. package/dist/cli/shared-parsers.d.ts +6 -9
  68. package/dist/cli/shared-parsers.js +4 -37
  69. package/dist/cli/shared-parsers.js.map +1 -1
  70. package/dist/cli/telemetry-flush.js +4 -4
  71. package/dist/cli/telemetry-flush.js.map +1 -1
  72. package/dist/cli-bundle/bundle-manifest.json +334 -326
  73. package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js → append-5YF3TO7I.js} +5 -5
  74. package/dist/cli-bundle/chunks/append-JHO5K6RP.js +11 -0
  75. package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js → chunk-2BX74BAS.js} +3 -3
  76. package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js → chunk-2CXL335K.js} +3 -3
  77. package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js → chunk-2FUOXSRN.js} +4 -4
  78. package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js → chunk-2IPNL3DR.js} +3 -3
  79. package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js → chunk-2XOSFSTH.js} +5 -5
  80. package/dist/cli-bundle/chunks/{chunk-UFXU44HV.js → chunk-35FHWD4C.js} +6 -6
  81. package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js.map → chunk-35FHWD4C.js.map} +1 -7
  82. package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js → chunk-37DRDP2B.js} +5 -5
  83. package/dist/cli-bundle/chunks/{chunk-BKVG6XOA.js → chunk-3CUQZNQ6.js} +67 -509
  84. package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js.map +7 -0
  85. package/dist/cli-bundle/chunks/chunk-3QDR6ZLU.js +800 -0
  86. package/dist/cli-bundle/chunks/chunk-3QDR6ZLU.js.map +7 -0
  87. package/dist/cli-bundle/chunks/{chunk-5JLUII3O.js → chunk-43UMFKCK.js} +321 -240
  88. package/dist/cli-bundle/chunks/chunk-43UMFKCK.js.map +1 -0
  89. package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js → chunk-47HXN6RX.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js → chunk-5HGZKQUL.js} +4 -4
  91. package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js → chunk-5UKQLQM2.js} +2 -2
  92. package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js → chunk-633PKXLT.js} +3 -3
  93. package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js → chunk-646MQXFW.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js → chunk-66MKH7SZ.js} +4 -4
  95. package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js → chunk-67RO3H4N.js} +4 -4
  96. package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js → chunk-6DYOZS6C.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js → chunk-6O44IN44.js} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-5ZSLZLDN.js → chunk-6VHUGVNP.js} +608 -456
  99. package/dist/cli-bundle/chunks/chunk-6VHUGVNP.js.map +1 -0
  100. package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js → chunk-74FKFFXO.js} +2 -2
  101. package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js → chunk-7H5NNCJ5.js} +4 -4
  102. package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js → chunk-7R6UIHYY.js} +75 -5
  103. package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js.map → chunk-7R6UIHYY.js.map} +1 -1
  104. package/dist/cli-bundle/chunks/{chunk-3S5QVM5H.js → chunk-7UCY6DR5.js} +193 -22
  105. package/dist/cli-bundle/chunks/chunk-7UCY6DR5.js.map +1 -0
  106. package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js → chunk-ADXDCAKP.js} +16 -7
  107. package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js.map → chunk-ADXDCAKP.js.map} +1 -1
  108. package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js → chunk-AFGKSHAM.js} +4 -4
  109. package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js → chunk-ARGDWQ4J.js} +2 -2
  110. package/dist/cli-bundle/chunks/{chunk-XXXF6PAQ.js → chunk-AXRT7K5V.js} +83 -62
  111. package/dist/cli-bundle/chunks/chunk-AXRT7K5V.js.map +7 -0
  112. package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js → chunk-B57RJHBZ.js} +4 -4
  113. package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js → chunk-BAP7G3N2.js} +2 -2
  114. package/dist/cli-bundle/chunks/{chunk-NLDFBC6J.js → chunk-BDA35QG5.js} +35 -5
  115. package/dist/cli-bundle/chunks/chunk-BDA35QG5.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js → chunk-BIRYX32V.js} +3 -3
  117. package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js → chunk-BVLOMU6O.js} +2 -2
  118. package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js → chunk-CKX4WOPC.js} +2 -2
  119. package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js → chunk-D52ZN3BF.js} +2 -2
  120. package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js → chunk-D53RTYVI.js} +4 -4
  121. package/dist/cli-bundle/chunks/{chunk-ODALILG3.js → chunk-D5XHO4Q7.js} +2 -2
  122. package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js → chunk-DDFGYUCQ.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js → chunk-DG2EQRIH.js} +4 -4
  124. package/dist/cli-bundle/chunks/{chunk-J6364LFM.js → chunk-DHNG452T.js} +9 -18
  125. package/dist/cli-bundle/chunks/{chunk-J6364LFM.js.map → chunk-DHNG452T.js.map} +1 -1
  126. package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js → chunk-E4FXM2XB.js} +77 -7
  127. package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js.map → chunk-E4FXM2XB.js.map} +1 -1
  128. package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js → chunk-EHJFUOXL.js} +3 -3
  129. package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js → chunk-EWIT5WIC.js} +7 -7
  130. package/dist/cli-bundle/chunks/chunk-EX7OQT3Y.js +783 -0
  131. package/dist/cli-bundle/chunks/chunk-EX7OQT3Y.js.map +1 -0
  132. package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js → chunk-EY7ZE3TG.js} +3 -3
  133. package/dist/cli-bundle/chunks/{chunk-ILX33QXL.js → chunk-F3VC3GOV.js} +669 -472
  134. package/dist/cli-bundle/chunks/chunk-F3VC3GOV.js.map +7 -0
  135. package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js → chunk-FHOBCGQO.js} +2 -2
  136. package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js → chunk-FL4D53ND.js} +2 -2
  137. package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js → chunk-FVNWHUME.js} +4 -4
  138. package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js → chunk-FXFCFL73.js} +5 -5
  139. package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js → chunk-FY4RLHSC.js} +2 -2
  140. package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js → chunk-G6MYGULG.js} +4 -4
  141. package/dist/cli-bundle/chunks/{chunk-HYB5AZ63.js → chunk-GKPCTQYG.js} +1822 -72
  142. package/dist/cli-bundle/chunks/chunk-GKPCTQYG.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js → chunk-GLZKZON6.js} +2 -2
  144. package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js → chunk-H5IOT54C.js} +4 -4
  145. package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js → chunk-HO4DLBNK.js} +2 -2
  146. package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js → chunk-HPAYDSR2.js} +8 -8
  147. package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js → chunk-HSYV4ZYT.js} +4 -4
  148. package/dist/cli-bundle/chunks/{chunk-EH2OPHBI.js → chunk-HTXXXF45.js} +23 -19
  149. package/dist/cli-bundle/chunks/chunk-HTXXXF45.js.map +1 -0
  150. package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js → chunk-HYTOJW2Q.js} +8 -8
  151. package/dist/cli-bundle/chunks/{chunk-4XQ3BDV4.js → chunk-I3INI567.js} +536 -449
  152. package/dist/cli-bundle/chunks/chunk-I3INI567.js.map +7 -0
  153. package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js → chunk-I7DIDUSP.js} +2 -2
  154. package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js → chunk-IE5KRAKN.js} +4 -4
  155. package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js → chunk-IL5SPRMH.js} +7 -7
  156. package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js → chunk-ILVOOAT4.js} +5 -5
  157. package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js → chunk-KH6QAHME.js} +3 -3
  158. package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js → chunk-KX62NMZC.js} +3 -3
  159. package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js.map → chunk-KX62NMZC.js.map} +1 -1
  160. package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js → chunk-L337QKWJ.js} +5 -5
  161. package/dist/cli-bundle/chunks/{chunk-JFTKLTEF.js → chunk-L5BTTDU5.js} +68 -503
  162. package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js.map +1 -0
  163. package/dist/cli-bundle/chunks/{chunk-LSG2U345.js → chunk-L6FVNR7X.js} +5 -5
  164. package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js → chunk-LSOWTLEM.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-4223PVZT.js → chunk-M7MVOKVV.js} +3 -3
  166. package/dist/cli-bundle/chunks/{chunk-UMOPHQSU.js → chunk-MR4SHYR4.js} +41 -19
  167. package/dist/cli-bundle/chunks/chunk-MR4SHYR4.js.map +7 -0
  168. package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js → chunk-N33FD2UI.js} +3 -3
  169. package/dist/cli-bundle/chunks/{chunk-UXONS674.js → chunk-NCVT6XEL.js} +68 -56
  170. package/dist/cli-bundle/chunks/chunk-NCVT6XEL.js.map +1 -0
  171. package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js → chunk-NNANAWFH.js} +3 -3
  172. package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js → chunk-NTRQLE2R.js} +2 -2
  173. package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js → chunk-NVZ6NVHJ.js} +4 -4
  174. package/dist/cli-bundle/chunks/{chunk-E2OJMKML.js → chunk-OGVTB5VO.js} +47 -37
  175. package/dist/cli-bundle/chunks/chunk-OGVTB5VO.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js → chunk-OWP6QFBV.js} +4 -4
  177. package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js → chunk-P22HGFFI.js} +2 -2
  178. package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js → chunk-PT7MCCGD.js} +2 -2
  179. package/dist/cli-bundle/chunks/{chunk-ONG5V5CI.js → chunk-QPGQNLPI.js} +1751 -70
  180. package/dist/cli-bundle/chunks/chunk-QPGQNLPI.js.map +1 -0
  181. package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js → chunk-QRZNCRNA.js} +9 -9
  182. package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js → chunk-QWBKN3QC.js} +5 -5
  183. package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js → chunk-R5XTTZSJ.js} +5 -5
  184. package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js → chunk-RC4UOUXA.js} +3 -3
  185. package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js → chunk-RGMWJLXF.js} +4 -4
  186. package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js → chunk-RTBX3C4C.js} +3 -3
  187. package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js → chunk-RXPQ5Q23.js} +7 -7
  188. package/dist/cli-bundle/chunks/{chunk-LPYWLWDS.js → chunk-SIPOACV5.js} +534 -447
  189. package/dist/cli-bundle/chunks/chunk-SIPOACV5.js.map +1 -0
  190. package/dist/cli-bundle/chunks/chunk-TGBTLGPX.js +851 -0
  191. package/dist/cli-bundle/chunks/chunk-TGBTLGPX.js.map +7 -0
  192. package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js → chunk-TLWJP5BF.js} +5 -5
  193. package/dist/cli-bundle/chunks/chunk-TLWJP5BF.js.map +7 -0
  194. package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js → chunk-TM5CIO3F.js} +3 -3
  195. package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js → chunk-TZAE66GQ.js} +8 -8
  196. package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js → chunk-VAHZIPWS.js} +4 -4
  197. package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js → chunk-VE6ZSTQW.js} +4 -4
  198. package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js → chunk-W5E2UUSH.js} +3 -3
  199. package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js → chunk-WACRQ26A.js} +2 -2
  200. package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js.map → chunk-WACRQ26A.js.map} +1 -1
  201. package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js → chunk-WL3SS45P.js} +3 -3
  202. package/dist/cli-bundle/chunks/{chunk-H5APFTHZ.js → chunk-WQXRZMFN.js} +204 -33
  203. package/dist/cli-bundle/chunks/chunk-WQXRZMFN.js.map +7 -0
  204. package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js → chunk-WU3KAN6A.js} +3 -3
  205. package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js → chunk-X2MGQMZO.js} +2 -2
  206. package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js → chunk-X5YCTFKT.js} +3 -3
  207. package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js → chunk-XC2HEEOV.js} +4 -4
  208. package/dist/cli-bundle/chunks/{chunk-7Z4LKRS4.js → chunk-XPUTSGJU.js} +38 -37
  209. package/dist/cli-bundle/chunks/chunk-XPUTSGJU.js.map +1 -0
  210. package/dist/cli-bundle/chunks/{chunk-YBLZ2VE7.js → chunk-XWBD6DSR.js} +320 -239
  211. package/dist/cli-bundle/chunks/chunk-XWBD6DSR.js.map +7 -0
  212. package/dist/cli-bundle/chunks/chunk-XWYQ2LT4.js +834 -0
  213. package/dist/cli-bundle/chunks/chunk-XWYQ2LT4.js.map +1 -0
  214. package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js → chunk-XXLXJL7V.js} +4 -4
  215. package/dist/cli-bundle/chunks/{chunk-2NCIPMQP.js → chunk-YFE7JHX3.js} +27 -6
  216. package/dist/cli-bundle/chunks/chunk-YFE7JHX3.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js → chunk-YIIIAKCE.js} +8 -8
  218. package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js → chunk-YJSURTBB.js} +2 -2
  219. package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js → chunk-YKFHF37B.js} +3 -3
  220. package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js → chunk-YQEZWI3R.js} +2 -2
  221. package/dist/cli-bundle/chunks/close-GPD7DTJV.js +12 -0
  222. package/dist/cli-bundle/chunks/{close-CWODTPKG.js → close-X3CF6FQP.js} +5 -5
  223. package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js → close-many-J7A5EHOQ.js} +14 -14
  224. package/dist/cli-bundle/chunks/close-many-NQLYGPYW.js +23 -0
  225. package/dist/cli-bundle/chunks/comments-2AOZQ5D2.js +13 -0
  226. package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js → comments-TMHMALA5.js} +7 -7
  227. package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js → copy-FWQA5OU4.js} +4 -4
  228. package/dist/cli-bundle/chunks/copy-N3LCQBMC.js +9 -0
  229. package/dist/cli-bundle/chunks/{create-LBVCYMEG.js → create-AQ5SIGZC.js} +9 -9
  230. package/dist/cli-bundle/chunks/{create-J5U6ND4K.js → create-KOGQ3JKD.js} +9 -9
  231. package/dist/cli-bundle/chunks/delete-6G3MBZ6S.js +10 -0
  232. package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js → delete-YYYFOSEA.js} +4 -4
  233. package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js → deps-MQ4ZIGZB.js} +16 -7
  234. package/dist/cli-bundle/chunks/deps-NIIKXLPB.js +28 -0
  235. package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js → docs-53NUGMIQ.js} +6 -6
  236. package/dist/cli-bundle/chunks/docs-OWRGDMNY.js +14 -0
  237. package/dist/cli-bundle/chunks/{files-EFIWKFTM.js → files-3PXGXYDB.js} +6 -6
  238. package/dist/cli-bundle/chunks/{files-6YFBJRBG.js → files-EGLKHD7O.js} +6 -6
  239. package/dist/cli-bundle/chunks/focus-KZLIA6WS.js +10 -0
  240. package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js → focus-SRPASFTN.js} +5 -5
  241. package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js → history-compact-G4DULDCX.js} +6 -6
  242. package/dist/cli-bundle/chunks/history-compact-HHIUOMZ7.js +16 -0
  243. package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js → history-redact-IUSJ6X3E.js} +4 -4
  244. package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js → history-redact-THHGRQXV.js} +4 -4
  245. package/dist/cli-bundle/chunks/history-repair-KG7SWXI6.js +16 -0
  246. package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js → history-repair-LUQWRS7X.js} +6 -6
  247. package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js → learnings-2MRNBFJF.js} +7 -7
  248. package/dist/cli-bundle/chunks/learnings-ZVHSALJY.js +13 -0
  249. package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js → notes-73JWKWUD.js} +7 -7
  250. package/dist/cli-bundle/chunks/notes-BAKUL5DJ.js +13 -0
  251. package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js → plan-AZPMCG37.js} +10 -10
  252. package/dist/cli-bundle/chunks/plan-LEAGLPGP.js +24 -0
  253. package/dist/cli-bundle/chunks/{profile-FAU7NZML.js → profile-AVCIIZID.js} +9 -9
  254. package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js → profile-LFYO3HHX.js} +9 -9
  255. package/dist/cli-bundle/chunks/{register-list-query-UL4UKBBN.js → register-list-query-MZUF2EEC.js} +50 -22
  256. package/dist/cli-bundle/chunks/register-list-query-MZUF2EEC.js.map +1 -0
  257. package/dist/cli-bundle/chunks/{register-list-query-DKA3EH5D.js → register-list-query-UKMF55FT.js} +49 -21
  258. package/dist/cli-bundle/chunks/register-list-query-UKMF55FT.js.map +7 -0
  259. package/dist/cli-bundle/chunks/{register-mutation-RBBJ52DK.js → register-mutation-2PBW2GEX.js} +35 -33
  260. package/dist/cli-bundle/chunks/register-mutation-2PBW2GEX.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js → register-mutation-T6RVNJC4.js} +34 -32
  262. package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js.map → register-mutation-T6RVNJC4.js.map} +2 -2
  263. package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js → register-operations-KHZYR6MG.js} +35 -35
  264. package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js → register-operations-WPQ2LWZJ.js} +35 -35
  265. package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js → register-setup-PGDNOXDQ.js} +15 -15
  266. package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js → register-setup-TDN7WAO6.js} +15 -15
  267. package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js → restore-E3PRGDN3.js} +6 -6
  268. package/dist/cli-bundle/chunks/restore-KIUYTAEJ.js +14 -0
  269. package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js → schema-5JNFQFUW.js} +6 -6
  270. package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js → schema-TMIW4XZC.js} +6 -6
  271. package/dist/cli-bundle/chunks/{update-XHSIAIXE.js → update-SQYZA3ZW.js} +12 -12
  272. package/dist/cli-bundle/chunks/update-XZJYS5X7.js +21 -0
  273. package/dist/cli-bundle/chunks/update-many-R24B3GBK.js +36 -0
  274. package/dist/cli-bundle/chunks/update-many-WQ3R3J6N.js +32 -0
  275. package/dist/cli-bundle/main.js +170 -856
  276. package/dist/cli-bundle/main.js.map +4 -4
  277. package/dist/cli-bundle/sdk-runtime.js +57 -54
  278. package/dist/cli-bundle/sdk-testing.js +6 -6
  279. package/dist/cli-bundle/sdk.js +266 -340
  280. package/dist/cli-bundle/sdk.js.map +4 -4
  281. package/dist/core/extensions/item-fields.js +2 -2
  282. package/dist/core/extensions/item-fields.js.map +1 -1
  283. package/dist/core/item/actionability.d.ts +12 -0
  284. package/dist/core/item/actionability.js +39 -4
  285. package/dist/core/item/actionability.js.map +1 -1
  286. package/dist/core/sentry/instrument.d.ts +11 -0
  287. package/dist/core/sentry/instrument.js +21 -2
  288. package/dist/core/sentry/instrument.js.map +1 -1
  289. package/dist/mcp/server.d.ts +16 -18
  290. package/dist/mcp/server.js +84 -31
  291. package/dist/mcp/server.js.map +1 -1
  292. package/dist/mcp/tool-definitions.js +17 -4
  293. package/dist/mcp/tool-definitions.js.map +1 -1
  294. package/dist/sdk/actionability.d.ts +10 -0
  295. package/dist/sdk/actionability.js +14 -0
  296. package/dist/sdk/actionability.js.map +1 -0
  297. package/dist/sdk/cli-bootstrap.d.ts +122 -0
  298. package/dist/sdk/cli-bootstrap.js +879 -0
  299. package/dist/sdk/cli-bootstrap.js.map +1 -0
  300. package/dist/sdk/cli-contracts/enum-contracts.d.ts +6 -2
  301. package/dist/sdk/cli-contracts/enum-contracts.js +19 -2
  302. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  303. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  304. package/dist/sdk/cli-contracts/flag-contracts.js +21 -2
  305. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  306. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +2 -0
  307. package/dist/sdk/cli-contracts/tool-option-contracts.js +16 -2
  308. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  309. package/dist/sdk/cli-contracts/tool-parameter-tables.js +80 -3
  310. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  311. package/dist/sdk/cli-contracts/tool-schema.d.ts +20 -0
  312. package/dist/sdk/cli-contracts/tool-schema.js +97 -9
  313. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  314. package/dist/sdk/cli-contracts.d.ts +2 -2
  315. package/dist/sdk/cli-contracts.js +4 -4
  316. package/dist/sdk/cli-contracts.js.map +1 -1
  317. package/dist/sdk/dependencies.d.ts +42 -53
  318. package/dist/sdk/dependencies.js +177 -125
  319. package/dist/sdk/dependencies.js.map +1 -1
  320. package/dist/sdk/eval.d.ts +66 -0
  321. package/dist/sdk/eval.js +186 -0
  322. package/dist/sdk/eval.js.map +1 -0
  323. package/dist/sdk/governance/validate.js +3 -3
  324. package/dist/sdk/governance/validate.js.map +1 -1
  325. package/dist/sdk/graph/analytics.d.ts +124 -0
  326. package/dist/sdk/graph/analytics.js +464 -0
  327. package/dist/sdk/graph/analytics.js.map +1 -0
  328. package/dist/sdk/graph/assembly.d.ts +97 -0
  329. package/dist/sdk/graph/assembly.js +146 -0
  330. package/dist/sdk/graph/assembly.js.map +1 -0
  331. package/dist/sdk/graph/cache.d.ts +66 -0
  332. package/dist/sdk/graph/cache.js +148 -0
  333. package/dist/sdk/graph/cache.js.map +1 -0
  334. package/dist/sdk/graph/governance.d.ts +108 -0
  335. package/dist/sdk/graph/governance.js +360 -0
  336. package/dist/sdk/graph/governance.js.map +1 -0
  337. package/dist/sdk/graph/index.d.ts +16 -0
  338. package/dist/sdk/graph/index.js +20 -0
  339. package/dist/sdk/graph/index.js.map +1 -0
  340. package/dist/sdk/graph/remediation.d.ts +52 -0
  341. package/dist/sdk/graph/remediation.js +148 -0
  342. package/dist/sdk/graph/remediation.js.map +1 -0
  343. package/dist/sdk/graph/run.d.ts +295 -0
  344. package/dist/sdk/graph/run.js +468 -0
  345. package/dist/sdk/graph/run.js.map +1 -0
  346. package/dist/sdk/graph/traversal.d.ts +77 -0
  347. package/dist/sdk/graph/traversal.js +262 -0
  348. package/dist/sdk/graph/traversal.js.map +1 -0
  349. package/dist/sdk/index.d.ts +19 -5
  350. package/dist/sdk/index.js +21 -7
  351. package/dist/sdk/index.js.map +1 -1
  352. package/dist/{cli/commands → sdk/query}/item-filter-options.d.ts +1 -1
  353. package/dist/{cli/commands → sdk/query}/item-filter-options.js +3 -3
  354. package/dist/sdk/query/item-filter-options.js.map +1 -0
  355. package/dist/sdk/query/list.d.ts +262 -0
  356. package/dist/sdk/query/list.js +1089 -0
  357. package/dist/sdk/query/list.js.map +1 -0
  358. package/dist/sdk/query/parsers.d.ts +9 -0
  359. package/dist/sdk/query/parsers.js +45 -0
  360. package/dist/sdk/query/parsers.js.map +1 -0
  361. package/dist/{cli/commands → sdk/query}/search-pagination.js +4 -4
  362. package/dist/sdk/query/search-pagination.js.map +1 -0
  363. package/dist/{cli/commands → sdk/query}/search-rendering.js +3 -3
  364. package/dist/sdk/query/search-rendering.js.map +1 -0
  365. package/dist/sdk/query/search.d.ts +469 -0
  366. package/dist/sdk/query/search.js +2247 -0
  367. package/dist/sdk/query/search.js.map +1 -0
  368. package/dist/sdk/relationship-context.d.ts +42 -0
  369. package/dist/sdk/relationship-context.js +99 -20
  370. package/dist/sdk/relationship-context.js.map +1 -1
  371. package/dist/sdk/relationships.d.ts +13 -0
  372. package/dist/sdk/relationships.js +30 -2
  373. package/dist/sdk/relationships.js.map +1 -1
  374. package/dist/sdk/runtime-input.d.ts +41 -0
  375. package/dist/sdk/runtime-input.js +422 -2
  376. package/dist/sdk/runtime-input.js.map +1 -1
  377. package/dist/sdk/runtime.d.ts +19 -30
  378. package/dist/sdk/runtime.js +30 -376
  379. package/dist/sdk/runtime.js.map +1 -1
  380. package/dist/sdk/search-refresh-worker.d.ts +2 -0
  381. package/dist/sdk/search-refresh-worker.js +19 -0
  382. package/dist/sdk/search-refresh-worker.js.map +1 -0
  383. package/dist/sdk/stats.d.ts +66 -0
  384. package/dist/sdk/stats.js +151 -0
  385. package/dist/sdk/stats.js.map +1 -0
  386. package/dist/sdk/telemetry-flush.d.ts +2 -0
  387. package/dist/sdk/telemetry-flush.js +14 -0
  388. package/dist/sdk/telemetry-flush.js.map +1 -0
  389. package/dist/sdk/telemetry.d.ts +14 -0
  390. package/dist/sdk/telemetry.js +398 -0
  391. package/dist/sdk/telemetry.js.map +1 -0
  392. package/dist/sdk/test/batch.d.ts +94 -0
  393. package/dist/sdk/test/batch.js +492 -0
  394. package/dist/sdk/test/batch.js.map +1 -0
  395. package/dist/sdk/test/entry.d.ts +6 -0
  396. package/dist/sdk/test/entry.js +74 -0
  397. package/dist/sdk/test/entry.js.map +1 -0
  398. package/dist/sdk/test/execution.d.ts +282 -0
  399. package/dist/sdk/test/execution.js +1817 -0
  400. package/dist/sdk/test/execution.js.map +1 -0
  401. package/dist/sdk/test/linked-command-detection.js +12 -3
  402. package/dist/sdk/test/linked-command-detection.js.map +1 -1
  403. package/dist/sdk/test/parsers.d.ts +48 -0
  404. package/dist/sdk/test/parsers.js +522 -0
  405. package/dist/sdk/test/parsers.js.map +1 -0
  406. package/dist/sdk/test/runs.d.ts +92 -0
  407. package/dist/sdk/test/runs.js +195 -0
  408. package/dist/sdk/test/runs.js.map +1 -0
  409. package/docs/AGENT_GUIDE.md +1 -0
  410. package/docs/COMMANDS.md +19 -1
  411. package/docs/RELATIONSHIP_GRAPH.md +99 -3
  412. package/docs/SDK.md +139 -3
  413. package/docs/SDK_PRIMITIVE_INVENTORY.md +5 -3
  414. package/docs/examples/sdk-custom-tool/README.md +27 -0
  415. package/docs/examples/sdk-custom-tool/package.json +13 -0
  416. package/docs/examples/sdk-custom-tool/src/cli.ts +36 -0
  417. package/docs/examples/sdk-custom-tool/src/entry.ts +15 -0
  418. package/docs/examples/sdk-custom-tool/src/index.ts +223 -0
  419. package/marketplace.json +2 -2
  420. package/package.json +4 -4
  421. package/packages/pm-beads/package.json +1 -1
  422. package/packages/pm-calendar/package.json +1 -1
  423. package/packages/pm-command-kit/package.json +1 -1
  424. package/packages/pm-governance-audit/extensions/governance-audit/comments-audit.ts +77 -57
  425. package/packages/pm-governance-audit/extensions/governance-audit/dedupe-audit.ts +202 -194
  426. package/packages/pm-governance-audit/extensions/governance-audit/dedupe-merge.ts +227 -153
  427. package/packages/pm-governance-audit/extensions/governance-audit/normalize.ts +169 -125
  428. package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +130 -81
  429. package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +53 -4
  430. package/packages/pm-governance-audit/package.json +1 -1
  431. package/packages/pm-guide-shell/package.json +1 -1
  432. package/packages/pm-kanban/package.json +1 -1
  433. package/packages/pm-lifecycle-hooks/package.json +1 -1
  434. package/packages/pm-linked-test-adapters/package.json +1 -1
  435. package/packages/pm-search-advanced/package.json +1 -1
  436. package/packages/pm-templates/package.json +1 -1
  437. package/packages/pm-todos/package.json +1 -1
  438. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  439. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  440. package/dist/cli/commands/item-filter-options.js.map +0 -1
  441. package/dist/cli/commands/search-pagination.js.map +0 -1
  442. package/dist/cli/commands/search-rendering.js.map +0 -1
  443. package/dist/cli-bundle/chunks/append-UZVHUO74.js +0 -11
  444. package/dist/cli-bundle/chunks/chunk-2NCIPMQP.js.map +0 -1
  445. package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-5JLUII3O.js.map +0 -1
  448. package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +0 -1
  449. package/dist/cli-bundle/chunks/chunk-7Z4LKRS4.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js.map +0 -7
  451. package/dist/cli-bundle/chunks/chunk-E2OJMKML.js.map +0 -7
  452. package/dist/cli-bundle/chunks/chunk-EH2OPHBI.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +0 -7
  454. package/dist/cli-bundle/chunks/chunk-HYB5AZ63.js.map +0 -7
  455. package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +0 -7
  456. package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-NLDFBC6J.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-UFXU44HV.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-UMOPHQSU.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +0 -7
  464. package/dist/cli-bundle/chunks/chunk-YBLZ2VE7.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +0 -58
  466. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +0 -1
  467. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +0 -68
  468. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +0 -7
  469. package/dist/cli-bundle/chunks/close-W6LI2PKM.js +0 -12
  470. package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +0 -23
  471. package/dist/cli-bundle/chunks/comments-E3TNTK24.js +0 -13
  472. package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +0 -9
  473. package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +0 -10
  474. package/dist/cli-bundle/chunks/deps-OA26IS25.js +0 -19
  475. package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +0 -14
  476. package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +0 -10
  477. package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +0 -16
  478. package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +0 -16
  479. package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +0 -13
  480. package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +0 -13
  481. package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +0 -24
  482. package/dist/cli-bundle/chunks/register-list-query-DKA3EH5D.js.map +0 -7
  483. package/dist/cli-bundle/chunks/register-list-query-UL4UKBBN.js.map +0 -1
  484. package/dist/cli-bundle/chunks/register-mutation-RBBJ52DK.js.map +0 -1
  485. package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +0 -14
  486. package/dist/cli-bundle/chunks/update-WWBYOPXO.js +0 -21
  487. package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +0 -32
  488. package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +0 -36
  489. /package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js.map → append-5YF3TO7I.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{append-UZVHUO74.js.map → append-JHO5K6RP.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js.map → chunk-2BX74BAS.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js.map → chunk-2CXL335K.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js.map → chunk-2FUOXSRN.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js.map → chunk-2IPNL3DR.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js.map → chunk-2XOSFSTH.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js.map → chunk-37DRDP2B.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js.map → chunk-47HXN6RX.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js.map → chunk-5HGZKQUL.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js.map → chunk-5UKQLQM2.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js.map → chunk-633PKXLT.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js.map → chunk-646MQXFW.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js.map → chunk-66MKH7SZ.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js.map → chunk-67RO3H4N.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js.map → chunk-6DYOZS6C.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js.map → chunk-6O44IN44.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js.map → chunk-74FKFFXO.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js.map → chunk-7H5NNCJ5.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js.map → chunk-AFGKSHAM.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js.map → chunk-ARGDWQ4J.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js.map → chunk-B57RJHBZ.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js.map → chunk-BAP7G3N2.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js.map → chunk-BIRYX32V.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js.map → chunk-BVLOMU6O.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js.map → chunk-CKX4WOPC.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js.map → chunk-D52ZN3BF.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js.map → chunk-D53RTYVI.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{chunk-ODALILG3.js.map → chunk-D5XHO4Q7.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js.map → chunk-DDFGYUCQ.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js.map → chunk-DG2EQRIH.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js.map → chunk-EHJFUOXL.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js.map → chunk-EWIT5WIC.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js.map → chunk-EY7ZE3TG.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js.map → chunk-FHOBCGQO.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js.map → chunk-FL4D53ND.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js.map → chunk-FVNWHUME.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js.map → chunk-FXFCFL73.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js.map → chunk-FY4RLHSC.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js.map → chunk-G6MYGULG.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js.map → chunk-GLZKZON6.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js.map → chunk-H5IOT54C.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js.map → chunk-HO4DLBNK.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js.map → chunk-HPAYDSR2.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js.map → chunk-HSYV4ZYT.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js.map → chunk-HYTOJW2Q.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js.map → chunk-I7DIDUSP.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js.map → chunk-IE5KRAKN.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js.map → chunk-IL5SPRMH.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js.map → chunk-ILVOOAT4.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js.map → chunk-KH6QAHME.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js.map → chunk-L337QKWJ.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-LSG2U345.js.map → chunk-L6FVNR7X.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js.map → chunk-LSOWTLEM.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-4223PVZT.js.map → chunk-M7MVOKVV.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js.map → chunk-N33FD2UI.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js.map → chunk-NNANAWFH.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js.map → chunk-NTRQLE2R.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js.map → chunk-NVZ6NVHJ.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js.map → chunk-OWP6QFBV.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js.map → chunk-P22HGFFI.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js.map → chunk-PT7MCCGD.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js.map → chunk-QRZNCRNA.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js.map → chunk-QWBKN3QC.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js.map → chunk-R5XTTZSJ.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js.map → chunk-RC4UOUXA.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js.map → chunk-RGMWJLXF.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js.map → chunk-RTBX3C4C.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js.map → chunk-RXPQ5Q23.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js.map → chunk-TM5CIO3F.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js.map → chunk-TZAE66GQ.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js.map → chunk-VAHZIPWS.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js.map → chunk-VE6ZSTQW.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js.map → chunk-W5E2UUSH.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js.map → chunk-WL3SS45P.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js.map → chunk-WU3KAN6A.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js.map → chunk-X2MGQMZO.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js.map → chunk-X5YCTFKT.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js.map → chunk-XC2HEEOV.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js.map → chunk-XXLXJL7V.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js.map → chunk-YIIIAKCE.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js.map → chunk-YJSURTBB.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js.map → chunk-YKFHF37B.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js.map → chunk-YQEZWI3R.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{close-W6LI2PKM.js.map → close-GPD7DTJV.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{close-CWODTPKG.js.map → close-X3CF6FQP.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js.map → close-many-J7A5EHOQ.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-many-DLDDVSH5.js.map → close-many-NQLYGPYW.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{comments-E3TNTK24.js.map → comments-2AOZQ5D2.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js.map → comments-TMHMALA5.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js.map → copy-FWQA5OU4.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{copy-Q5ZJPUKR.js.map → copy-N3LCQBMC.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{create-LBVCYMEG.js.map → create-AQ5SIGZC.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{create-J5U6ND4K.js.map → create-KOGQ3JKD.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{delete-WNHB3LYW.js.map → delete-6G3MBZ6S.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js.map → delete-YYYFOSEA.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js.map → deps-MQ4ZIGZB.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{deps-OA26IS25.js.map → deps-NIIKXLPB.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js.map → docs-53NUGMIQ.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{docs-HA2AIDBB.js.map → docs-OWRGDMNY.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{files-EFIWKFTM.js.map → files-3PXGXYDB.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{files-6YFBJRBG.js.map → files-EGLKHD7O.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{focus-POIW5LTJ.js.map → focus-KZLIA6WS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js.map → focus-SRPASFTN.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js.map → history-compact-G4DULDCX.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{history-compact-FWG2C7FZ.js.map → history-compact-HHIUOMZ7.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js.map → history-redact-IUSJ6X3E.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js.map → history-redact-THHGRQXV.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{history-repair-6GEAM7HE.js.map → history-repair-KG7SWXI6.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js.map → history-repair-LUQWRS7X.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js.map → learnings-2MRNBFJF.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{learnings-RSNLSWDC.js.map → learnings-ZVHSALJY.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js.map → notes-73JWKWUD.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{notes-2WDH6DXU.js.map → notes-BAKUL5DJ.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js.map → plan-AZPMCG37.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{plan-DOVI2VMW.js.map → plan-LEAGLPGP.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{profile-FAU7NZML.js.map → profile-AVCIIZID.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js.map → profile-LFYO3HHX.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js.map → register-operations-KHZYR6MG.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js.map → register-operations-WPQ2LWZJ.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js.map → register-setup-PGDNOXDQ.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js.map → register-setup-TDN7WAO6.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js.map → restore-E3PRGDN3.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{restore-YPMVUUEX.js.map → restore-KIUYTAEJ.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js.map → schema-5JNFQFUW.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js.map → schema-TMIW4XZC.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{update-XHSIAIXE.js.map → update-SQYZA3ZW.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{update-WWBYOPXO.js.map → update-XZJYS5X7.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{update-many-TA7NGQBO.js.map → update-many-R24B3GBK.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{update-many-OUGIU5SF.js.map → update-many-WQ3R3J6N.js.map} +0 -0
  619. /package/dist/{cli/commands → sdk/query}/search-pagination.d.ts +0 -0
  620. /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]="85084307-fe97-5ecd-bfa8-3c803663a33c")}catch(e){}}();
3
3
  import {
4
4
  runDocs
5
- } from "./chunk-IA5FKNII.js";
6
- import {
7
- collectDanglingDependencyReferences,
8
- createRelationshipKindRegistry
9
- } from "./chunk-JFTKLTEF.js";
5
+ } from "./chunk-X2MGQMZO.js";
10
6
  import {
11
7
  scanHistoryDrift
12
- } from "./chunk-SDQLJWBO.js";
8
+ } from "./chunk-NVZ6NVHJ.js";
13
9
  import {
14
10
  runFiles
15
- } from "./chunk-TQSZFPIS.js";
11
+ } from "./chunk-AFGKSHAM.js";
16
12
  import {
17
13
  isRemoteLinkedArtifactReference
18
- } from "./chunk-2JKGO6QX.js";
14
+ } from "./chunk-H5IOT54C.js";
19
15
  import {
20
16
  runUpdate
21
- } from "./chunk-EACOH7AU.js";
17
+ } from "./chunk-YIIIAKCE.js";
22
18
  import {
23
19
  wrapOwnershipConflict
24
- } from "./chunk-UY2ACEMF.js";
20
+ } from "./chunk-ILVOOAT4.js";
25
21
  import {
26
22
  PM_TELEMETRY_SOURCE_CONTEXT_VALUES,
27
23
  TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS,
28
24
  TELEMETRY_SCHEMA_VERSION,
29
25
  flushTelemetryQueueNow
30
- } from "./chunk-ONREO4ST.js";
26
+ } from "./chunk-EY7ZE3TG.js";
31
27
  import {
32
28
  buildCapabilityContractMetadata,
33
29
  buildRegistrationCollisionRemediation,
34
30
  collectUnknownCapabilityGuidance,
35
31
  readManagedExtensionState,
36
32
  runInit
37
- } from "./chunk-J6EY5V4N.js";
33
+ } from "./chunk-QRZNCRNA.js";
38
34
  import {
39
35
  collectStaleVectorizationIds,
40
36
  runNext
41
- } from "./chunk-7Z4LKRS4.js";
37
+ } from "./chunk-XPUTSGJU.js";
38
+ import {
39
+ collectDanglingDependencyReferences,
40
+ createRelationshipKindRegistry
41
+ } from "./chunk-L5BTTDU5.js";
42
42
  import {
43
43
  computeContentFieldUtilization
44
- } from "./chunk-UXONS674.js";
44
+ } from "./chunk-NCVT6XEL.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-E4FXM2XB.js";
66
66
  import {
67
67
  ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,
68
68
  ACTIVITY_FLAG_CONTRACTS,
@@ -106,6 +106,8 @@ import {
106
106
  GC_FLAG_CONTRACTS,
107
107
  GET_FLAG_CONTRACTS,
108
108
  GLOBAL_FLAG_CONTRACTS,
109
+ GRAPH_FLAG_CONTRACTS,
110
+ GRAPH_SUBCOMMAND_VALUES,
109
111
  GUIDE_FLAG_CONTRACTS,
110
112
  HEALTH_FLAG_CONTRACTS,
111
113
  HISTORY_COMPACT_FLAG_CONTRACTS,
@@ -152,7 +154,7 @@ import {
152
154
  UPGRADE_FLAG_CONTRACTS,
153
155
  VALIDATE_FLAG_CONTRACTS,
154
156
  compactFlagAliasContracts
155
- } from "./chunk-3S5QVM5H.js";
157
+ } from "./chunk-7UCY6DR5.js";
156
158
  import {
157
159
  LINKED_TEST_PM_CONTEXT_MODE_VALUES,
158
160
  LINKED_TEST_PROTECTED_ENV_KEYS,
@@ -169,12 +171,12 @@ import {
169
171
  parseLinkedTestRegexList,
170
172
  parseLinkedTestStringList,
171
173
  runCreate
172
- } from "./chunk-EH2OPHBI.js";
174
+ } from "./chunk-HTXXXF45.js";
173
175
  import {
174
176
  createStdinTokenResolver,
175
177
  parseCsvKv,
176
178
  parseOptionalNumber
177
- } from "./chunk-EJEXHTY5.js";
179
+ } from "./chunk-FHOBCGQO.js";
178
180
  import {
179
181
  CURRENT_ITEM_FORMAT_VERSION,
180
182
  compareTimestampStrings,
@@ -201,7 +203,7 @@ import {
201
203
  stableValueEquals,
202
204
  toItemRecord,
203
205
  writeSettings
204
- } from "./chunk-Q7A43DS4.js";
206
+ } from "./chunk-P22HGFFI.js";
205
207
  import {
206
208
  DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS,
207
209
  DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS,
@@ -243,7 +245,7 @@ import {
243
245
  statusIsTerminal,
244
246
  toNonEmptyStringOrUndefined,
245
247
  writeFileAtomic
246
- } from "./chunk-QKECXBBG.js";
248
+ } from "./chunk-KX62NMZC.js";
247
249
 
248
250
  // dist/sdk/start-task-status.js
249
251
  function resolveStartTaskInProgressStatus(statusRegistry) {
@@ -721,11 +723,24 @@ var TOOLS = [
721
723
  },
722
724
  {
723
725
  name: "pm_deps",
724
- description: "Read dependency trees/graphs or one bounded explainable relationship context packet. Use options.format=context with depth, node, edge, token, and cursor bounds.",
726
+ description: "Read dependency trees/graphs or one bounded explainable relationship context packet. Use options.format=context with direction, kind, depth, node, edge, token, and cursor bounds; context returns a counts-first summary, per-node roles/reasons, root evidence pointers, and enumerated missing references.",
725
727
  inputSchema: objectSchema({ id: idSchema, options: { type: "object" } }, [
726
728
  "id"
727
729
  ])
728
730
  },
731
+ {
732
+ name: "pm_graph",
733
+ description: "Run bounded workspace relationship-graph queries: ancestors/descendants (hierarchy), predecessors/successors (ordering), paths, impact (blast radius), analyze (execution + knowledge analytics), audit (governance findings), communities (label-propagation clusters), redundancy (transitively implied edges), dominators (structural bottlenecks), and plan (dry-run remediation proposals derived from the audit). Traversals, paths, impact, and dominators require id; paths also requires target. Options support kind, maxDepth, limit, after, direction, maxPaths, sample, exemptIsolate, and counts-first summary.",
734
+ inputSchema: objectSchema({
735
+ subcommand: {
736
+ type: "string",
737
+ enum: [...GRAPH_SUBCOMMAND_VALUES]
738
+ },
739
+ id: idSchema,
740
+ target: idSchema,
741
+ options: { type: "object" }
742
+ }, ["subcommand"])
743
+ },
729
744
  {
730
745
  name: "pm_test",
731
746
  description: "List, add, remove, or run linked tests for a pm item.",
@@ -1057,6 +1072,7 @@ var COMMAND_INTENTS = /* @__PURE__ */ new Map([
1057
1072
  ["focus", "Manage focus."],
1058
1073
  ["gc", "Clean caches."],
1059
1074
  ["get", "Read item."],
1075
+ ["graph", "Query graph."],
1060
1076
  ["guide", "Show user guides."],
1061
1077
  ["health", "Check health."],
1062
1078
  ["help", "Show help."],
@@ -1125,6 +1141,7 @@ var CORE_COMMAND_FLAG_CONTRACT_ENTRIES = [
1125
1141
  ["next", NEXT_FLAG_CONTRACTS],
1126
1142
  ["aggregate", AGGREGATE_FLAG_CONTRACTS],
1127
1143
  ["deps", DEPS_FLAG_CONTRACTS],
1144
+ ["graph", GRAPH_FLAG_CONTRACTS],
1128
1145
  ["guide", GUIDE_FLAG_CONTRACTS],
1129
1146
  ["reindex", REINDEX_FLAG_CONTRACTS],
1130
1147
  ["history", HISTORY_FLAG_CONTRACTS],
@@ -5082,7 +5099,7 @@ function runRemind(title, options, global) {
5082
5099
  return runCreate(createOptions, global);
5083
5100
  }
5084
5101
 
5085
- // dist/cli/commands/stats.js
5102
+ // dist/sdk/stats.js
5086
5103
  import fs6 from "node:fs/promises";
5087
5104
  import path6 from "node:path";
5088
5105
 
@@ -5171,7 +5188,7 @@ function computeHistoryStorageStats(streams, options) {
5171
5188
  };
5172
5189
  }
5173
5190
 
5174
- // dist/cli/commands/stats.js
5191
+ // dist/sdk/stats.js
5175
5192
  function zeroByType(itemTypes) {
5176
5193
  return itemTypes.reduce((acc, value) => {
5177
5194
  acc[value] = 0;
@@ -5190,9 +5207,6 @@ function countNonEmptyLines(raw) {
5190
5207
  }
5191
5208
  return raw.split(/\r?\n/u).filter((line) => line.trim().length > 0).length;
5192
5209
  }
5193
- function isNotFoundError(error) {
5194
- return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
5195
- }
5196
5210
  async function readHistoryStreamContents(pmRoot) {
5197
5211
  const historyDir = path6.join(pmRoot, "history");
5198
5212
  if (!await pathExists(historyDir)) {
@@ -5206,14 +5220,9 @@ async function readHistoryStreamContents(pmRoot) {
5206
5220
  const streams = [];
5207
5221
  for (const file of historyFiles) {
5208
5222
  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;
5223
+ const raw = await readFileIfExists(historyPath);
5224
+ if (raw === null) {
5225
+ continue;
5217
5226
  }
5218
5227
  await runActiveOnReadHooks({
5219
5228
  path: historyPath,
@@ -5282,7 +5291,7 @@ async function runStats(global, options = {}) {
5282
5291
  };
5283
5292
  }
5284
5293
 
5285
- // dist/cli/commands/telemetry.js
5294
+ // dist/sdk/telemetry.js
5286
5295
  import fs7 from "node:fs/promises";
5287
5296
  import path7 from "node:path";
5288
5297
  var TELEMETRY_QUEUE_RELATIVE_PATH2 = path7.join("runtime", "telemetry", "events.jsonl");
@@ -5295,19 +5304,32 @@ var TELEMETRY_SUBCOMMANDS = [
5295
5304
  "stats",
5296
5305
  "clear"
5297
5306
  ];
5298
- function nearestRankPercentile(sortedAscending, fraction) {
5307
+ var nearestRankPercentile = (sortedAscending, fraction) => {
5299
5308
  const rank = Math.ceil(fraction * sortedAscending.length);
5300
5309
  const index = Math.min(sortedAscending.length - 1, Math.max(0, rank - 1));
5301
5310
  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() {
5311
+ };
5312
+ var normalizeTelemetryText = (value, fallback) => {
5313
+ if (typeof value !== "string") {
5314
+ return fallback;
5315
+ }
5316
+ return value.trim().length > 0 ? value : fallback;
5317
+ };
5318
+ var normalizeFiniteInteger = (value) => {
5319
+ if (typeof value !== "number" || !Number.isFinite(value)) {
5320
+ return void 0;
5321
+ }
5322
+ return Math.trunc(value);
5323
+ };
5324
+ var normalizeTelemetryQueueEntry = (entry) => {
5325
+ return {
5326
+ command: normalizeTelemetryText(entry.event.command, "<unknown>"),
5327
+ eventType: normalizeTelemetryText(entry.event.event_type, "unknown"),
5328
+ eventSchemaVersion: normalizeFiniteInteger(entry.event.schema_version),
5329
+ clientSchemaVersion: normalizeFiniteInteger(entry.client_schema_version)
5330
+ };
5331
+ };
5332
+ var createTelemetryStatsAccumulator = () => {
5311
5333
  return {
5312
5334
  count: 0,
5313
5335
  max_attempts: 0,
@@ -5319,9 +5341,20 @@ function createTelemetryStatsAccumulator() {
5319
5341
  error_count: 0,
5320
5342
  resolution_counts: {}
5321
5343
  };
5322
- }
5323
- function recordTelemetryFinishPayload(current, payload) {
5324
- const durationMs = typeof payload?.duration_ms === "number" && Number.isFinite(payload.duration_ms) ? payload.duration_ms : void 0;
5344
+ };
5345
+ var readTelemetryDuration = (payload) => {
5346
+ const value = payload?.duration_ms;
5347
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
5348
+ };
5349
+ var readTelemetryResolution = (payload) => {
5350
+ const value = payload?.command_resolution;
5351
+ return normalizeTelemetryText(value, "") || void 0;
5352
+ };
5353
+ var incrementTelemetryCount = (counts, key) => {
5354
+ counts[key] = (counts[key] ?? 0) + 1;
5355
+ };
5356
+ var recordTelemetryFinishPayload = (current, payload) => {
5357
+ const durationMs = readTelemetryDuration(payload);
5325
5358
  if (durationMs !== void 0) {
5326
5359
  current.finish_durations_ms.push(durationMs);
5327
5360
  }
@@ -5330,30 +5363,31 @@ function recordTelemetryFinishPayload(current, payload) {
5330
5363
  } else {
5331
5364
  current.error_count += 1;
5332
5365
  }
5333
- const resolution = typeof payload?.command_resolution === "string" && payload.command_resolution.trim().length > 0 ? payload.command_resolution : void 0;
5366
+ const resolution = readTelemetryResolution(payload);
5334
5367
  if (resolution !== void 0) {
5335
- current.resolution_counts[resolution] = (current.resolution_counts[resolution] ?? 0) + 1;
5368
+ incrementTelemetryCount(current.resolution_counts, resolution);
5336
5369
  }
5337
- }
5338
- function recordTelemetryQueueEntry(grouped, entry) {
5370
+ };
5371
+ var normalizeTelemetryAttempts = (attempts) => Number.isFinite(attempts) ? Math.max(0, Math.trunc(attempts)) : 0;
5372
+ var addTelemetryDimension = (values, value) => {
5373
+ if (value !== void 0) {
5374
+ values.add(value);
5375
+ }
5376
+ };
5377
+ var recordTelemetryQueueEntry = (grouped, entry) => {
5339
5378
  const normalized = normalizeTelemetryQueueEntry(entry);
5340
5379
  const current = grouped.get(normalized.command) ?? createTelemetryStatsAccumulator();
5341
- const attempts = Number.isFinite(entry.attempts) ? Math.max(0, Math.trunc(entry.attempts)) : 0;
5342
5380
  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
- }
5381
+ current.max_attempts = Math.max(current.max_attempts, normalizeTelemetryAttempts(entry.attempts));
5382
+ incrementTelemetryCount(current.event_type_counts, normalized.eventType);
5383
+ addTelemetryDimension(current.event_schema_versions, normalized.eventSchemaVersion);
5384
+ addTelemetryDimension(current.client_schema_versions, normalized.clientSchemaVersion);
5351
5385
  if (normalized.eventType === "command_finish") {
5352
5386
  recordTelemetryFinishPayload(current, entry.event.payload);
5353
5387
  }
5354
5388
  grouped.set(normalized.command, current);
5355
- }
5356
- function buildTelemetryStatsBucket(command, value) {
5389
+ };
5390
+ var buildTelemetryStatsBucket = (command, value) => {
5357
5391
  const finishCount = value.ok_count + value.error_count;
5358
5392
  const sortedDurations = [...value.finish_durations_ms].sort((left, right) => left - right);
5359
5393
  const resolutionEntries = Object.entries(value.resolution_counts).sort((left, right) => left[0].localeCompare(right[0]));
@@ -5376,8 +5410,8 @@ function buildTelemetryStatsBucket(command, value) {
5376
5410
  } : {},
5377
5411
  ...resolutionEntries.length > 0 ? { command_resolution_counts: Object.fromEntries(resolutionEntries) } : {}
5378
5412
  };
5379
- }
5380
- function normalizeTelemetrySubcommand(value) {
5413
+ };
5414
+ var normalizeTelemetrySubcommand = (value) => {
5381
5415
  const normalized = (value ?? "status").trim().toLowerCase();
5382
5416
  if (TELEMETRY_SUBCOMMANDS.includes(normalized)) {
5383
5417
  return normalized;
@@ -5391,78 +5425,93 @@ function normalizeTelemetrySubcommand(value) {
5391
5425
  "pm telemetry clear"
5392
5426
  ]
5393
5427
  });
5394
- }
5395
- function parseTelemetryStatsLimit(raw) {
5428
+ };
5429
+ var throwInvalidTelemetryLimit = () => {
5430
+ throw new PmCliError("--limit must be a positive integer", EXIT_CODE.USAGE);
5431
+ };
5432
+ var requirePositiveTelemetryLimit = (value) => {
5433
+ if ([!Number.isFinite(value), !Number.isInteger(value), value <= 0].includes(true)) {
5434
+ return throwInvalidTelemetryLimit();
5435
+ }
5436
+ return value;
5437
+ };
5438
+ var parseTelemetryStringLimit = (raw) => {
5439
+ const trimmed = raw.trim();
5440
+ if ([trimmed.length === 0, !/^\d+$/.test(trimmed)].includes(true)) {
5441
+ return throwInvalidTelemetryLimit();
5442
+ }
5443
+ return requirePositiveTelemetryLimit(Number.parseInt(trimmed, 10));
5444
+ };
5445
+ var parseTelemetryStatsLimit = (raw) => {
5396
5446
  if (raw === void 0) {
5397
5447
  return DEFAULT_STATS_LIMIT;
5398
5448
  }
5399
5449
  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;
5450
+ return requirePositiveTelemetryLimit(raw);
5404
5451
  }
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);
5452
+ if (typeof raw === "string") {
5453
+ return parseTelemetryStringLimit(raw);
5408
5454
  }
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);
5455
+ return throwInvalidTelemetryLimit();
5456
+ };
5457
+ var isTelemetryQueueEntry = (value) => {
5458
+ if (typeof value !== "object" || value === null) {
5459
+ return false;
5412
5460
  }
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
- };
5461
+ const candidate = value;
5462
+ return typeof candidate.attempts === "number" && typeof candidate.event === "object" && candidate.event !== null;
5463
+ };
5464
+ var parseTelemetryQueueRow = (row) => {
5465
+ try {
5466
+ const parsed = JSON.parse(row);
5467
+ return isTelemetryQueueEntry(parsed) ? parsed : void 0;
5468
+ } catch {
5469
+ return void 0;
5470
+ }
5471
+ };
5472
+ var splitTelemetryQueueRows = (raw) => {
5473
+ if (raw === null) {
5474
+ return [];
5423
5475
  }
5476
+ return raw.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
5477
+ };
5478
+ var parseTelemetryQueue2 = (raw) => {
5479
+ const rows = splitTelemetryQueueRows(raw);
5424
5480
  const entries = [];
5425
- let rowsTotal = 0;
5426
5481
  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 {
5482
+ for (const row of rows) {
5483
+ const parsed = parseTelemetryQueueRow(row);
5484
+ if (parsed === void 0) {
5441
5485
  invalidRows += 1;
5486
+ } else {
5487
+ entries.push(parsed);
5442
5488
  }
5443
5489
  }
5444
5490
  return {
5445
- rows_total: rowsTotal,
5491
+ rows_total: rows.length,
5446
5492
  valid_entries: entries.length,
5447
5493
  invalid_rows: invalidRows,
5448
5494
  entries
5449
5495
  };
5450
- }
5451
- async function readTelemetryRuntimeState(statePath) {
5496
+ };
5497
+ var isTelemetryRuntimeState = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
5498
+ var parseTelemetryRuntimeState2 = (raw) => {
5499
+ try {
5500
+ const parsed = JSON.parse(raw);
5501
+ return isTelemetryRuntimeState(parsed) ? parsed : {};
5502
+ } catch {
5503
+ return {};
5504
+ }
5505
+ };
5506
+ var readTelemetryRuntimeState = async (statePath) => {
5452
5507
  const stateRaw = await readFileIfExists(statePath);
5453
5508
  if (stateRaw === null || stateRaw.trim().length === 0) {
5454
5509
  return {};
5455
5510
  }
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) {
5511
+ return parseTelemetryRuntimeState2(stateRaw);
5512
+ };
5513
+ var nullableTelemetryStateValue = (value) => value ?? null;
5514
+ var buildTelemetryStatusSummary = async (globalPmRoot) => {
5466
5515
  const settings = await readSettings(globalPmRoot);
5467
5516
  const queuePath = path7.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH2);
5468
5517
  const statePath = path7.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH2);
@@ -5477,253 +5526,102 @@ async function buildTelemetryStatusSummary(globalPmRoot) {
5477
5526
  queue_rows_total: queue.rows_total,
5478
5527
  queue_entries: queue.valid_entries,
5479
5528
  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
5529
+ queue_size_bytes: Buffer.byteLength(queueRaw ?? "", "utf8"),
5530
+ last_attempted_flush_at: nullableTelemetryStateValue(runtimeState.last_attempted_flush_at),
5531
+ last_successful_flush_at: nullableTelemetryStateValue(runtimeState.last_successful_flush_at),
5532
+ last_failed_flush_at: nullableTelemetryStateValue(runtimeState.last_failed_flush_at),
5533
+ last_failed_flush_error: nullableTelemetryStateValue(runtimeState.last_failed_flush_error)
5485
5534
  };
5486
- }
5487
- function buildTelemetryStatsBuckets(entries) {
5535
+ };
5536
+ var buildTelemetryStatsBuckets = (entries) => {
5488
5537
  const grouped = /* @__PURE__ */ new Map();
5489
5538
  for (const entry of entries) {
5490
5539
  recordTelemetryQueueEntry(grouped, entry);
5491
5540
  }
5492
5541
  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;
5542
+ };
5543
+ var runTelemetryStatus = async (_options, context) => ({
5544
+ action: "telemetry",
5545
+ subcommand: "status",
5546
+ status: await buildTelemetryStatusSummary(context.globalPmRoot),
5547
+ generated_at: nowIso()
5548
+ });
5549
+ var runTelemetryFlush = async (_options, context) => {
5550
+ const before = await buildTelemetryStatusSummary(context.globalPmRoot);
5551
+ await flushTelemetryQueueNow(context.globalPmRoot);
5552
+ const after = await buildTelemetryStatusSummary(context.globalPmRoot);
5553
+ return {
5554
+ action: "telemetry",
5555
+ subcommand: "flush",
5556
+ queue_entries_before: before.queue_entries,
5557
+ queue_entries_after: after.queue_entries,
5558
+ queue_drained: after.queue_entries < before.queue_entries,
5559
+ status: after,
5560
+ generated_at: nowIso()
5561
+ };
5562
+ };
5563
+ var runTelemetryStats = async (options, context) => {
5564
+ const limit = parseTelemetryStatsLimit(options.limit);
5565
+ const queueRaw = await readFileIfExists(context.queuePath);
5566
+ const queue = parseTelemetryQueue2(queueRaw);
5567
+ const buckets = buildTelemetryStatsBuckets(queue.entries);
5568
+ const selected = buckets.slice(0, limit);
5569
+ return {
5570
+ action: "telemetry",
5571
+ subcommand: "stats",
5572
+ limit,
5573
+ total_commands: buckets.length,
5574
+ queue_entries: queue.valid_entries,
5575
+ queue_invalid_rows: queue.invalid_rows,
5576
+ queue_rows_total: queue.rows_total,
5577
+ truncated: buckets.length > selected.length,
5578
+ stats: selected,
5579
+ generated_at: nowIso()
5580
+ };
5581
+ };
5582
+ var runTelemetryClear = async (_options, context) => {
5583
+ const settings = await readSettings(context.globalPmRoot);
5584
+ const settingsChanged = [
5585
+ settings.telemetry.enabled !== false,
5586
+ settings.telemetry.installation_id !== "",
5587
+ settings.telemetry.first_run_prompt_completed !== true
5588
+ ].includes(true);
5545
5589
  settings.telemetry.enabled = false;
5546
5590
  settings.telemetry.first_run_prompt_completed = true;
5547
5591
  settings.telemetry.installation_id = "";
5548
- const settingsChanged = previousEnabled !== settings.telemetry.enabled || previousInstallationId !== settings.telemetry.installation_id || previousFirstRunPromptCompleted !== settings.telemetry.first_run_prompt_completed;
5549
5592
  if (settingsChanged) {
5550
- await writeSettings(globalPmRoot, settings, "telemetry:clear");
5593
+ await writeSettings(context.globalPmRoot, settings, "telemetry:clear");
5551
5594
  }
5552
- const telemetryRuntimePath = path7.join(globalPmRoot, TELEMETRY_RUNTIME_RELATIVE_PATH);
5595
+ const telemetryRuntimePath = path7.join(context.globalPmRoot, TELEMETRY_RUNTIME_RELATIVE_PATH);
5553
5596
  const existed = await pathExists(telemetryRuntimePath);
5554
5597
  await fs7.rm(telemetryRuntimePath, { recursive: true, force: true });
5555
- const queueExistsAfter = await pathExists(queuePath);
5556
- const stateExistsAfter = await pathExists(statePath);
5557
5598
  return {
5558
5599
  action: "telemetry",
5559
- subcommand,
5600
+ subcommand: "clear",
5560
5601
  settings_changed: settingsChanged,
5561
5602
  runtime_dir_removed: existed && !await pathExists(telemetryRuntimePath),
5562
- queue_exists_after: queueExistsAfter,
5563
- state_exists_after: stateExistsAfter,
5564
- status: await buildTelemetryStatusSummary(globalPmRoot),
5603
+ queue_exists_after: await pathExists(context.queuePath),
5604
+ state_exists_after: await pathExists(context.statePath),
5605
+ status: await buildTelemetryStatusSummary(context.globalPmRoot),
5565
5606
  generated_at: nowIso()
5566
5607
  };
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
- }
5608
+ };
5609
+ var TELEMETRY_COMMAND_HANDLERS = {
5610
+ status: runTelemetryStatus,
5611
+ flush: runTelemetryFlush,
5612
+ stats: runTelemetryStats,
5613
+ clear: runTelemetryClear
5614
+ };
5615
+ var runTelemetry = async (options, _global) => {
5616
+ void _global;
5617
+ const subcommand = normalizeTelemetrySubcommand(options.subcommand);
5618
+ const globalPmRoot = resolveGlobalPmRoot(process.cwd());
5619
+ return TELEMETRY_COMMAND_HANDLERS[subcommand](options, {
5620
+ globalPmRoot,
5621
+ queuePath: path7.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH2),
5622
+ statePath: path7.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH2)
5619
5623
  });
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
5725
- };
5726
- }
5624
+ };
5727
5625
 
5728
5626
  // dist/sdk/test/linked-command-detection.js
5729
5627
  var PM_SUBCOMMANDS_WITH_ITEM_REFERENCE = /* @__PURE__ */ new Set([
@@ -5929,7 +5827,9 @@ var PM_ITEM_REFERENCE_FLAGS_WITH_VALUE = {
5929
5827
  "--node-limit",
5930
5828
  "--edge-limit",
5931
5829
  "--token-budget",
5932
- "--cursor"
5830
+ "--cursor",
5831
+ "--direction",
5832
+ "--kind"
5933
5833
  ]),
5934
5834
  test: /* @__PURE__ */ new Set([
5935
5835
  "--add",
@@ -5990,7 +5890,11 @@ function extractPmInvocationArgsFromSegment(segment) {
5990
5890
  return invocation && (isPmExecutableToken(invocation.command) || isPmCliPackageToken(invocation.command)) ? invocation.args : null;
5991
5891
  }
5992
5892
  var extractReferencedPmItemIdsFromCommand = (command, idPrefix = "pm") => {
5993
- const normalizedPrefix = idPrefix.trim().toLowerCase().replace(/-+$/, "");
5893
+ const lowered = idPrefix.trim().toLowerCase();
5894
+ let prefixEnd = lowered.length;
5895
+ while (prefixEnd > 0 && lowered[prefixEnd - 1] === "-")
5896
+ prefixEnd -= 1;
5897
+ const normalizedPrefix = lowered.slice(0, prefixEnd);
5994
5898
  if (normalizedPrefix.length === 0)
5995
5899
  return [];
5996
5900
  const normalizedCommand = command.trim().replaceAll("\\", "/").replaceAll('"', "").replaceAll("'", "").replaceAll(/\s+/g, " ").toLowerCase();
@@ -6175,7 +6079,166 @@ function firstPositionalToken(tokens, flagsWithValue = /* @__PURE__ */ new Set()
6175
6079
  return void 0;
6176
6080
  }
6177
6081
 
6178
- // dist/cli/commands/test.js
6082
+ // dist/sdk/test/execution.js
6083
+ import { spawn } from "node:child_process";
6084
+ import { cp, mkdir, mkdtemp, readdir, rm } from "node:fs/promises";
6085
+ import { tmpdir } from "node:os";
6086
+ import path8 from "node:path";
6087
+
6088
+ // dist/core/test/item-test-run-tracking.js
6089
+ var DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT = 20;
6090
+ function trackedTestRunHistoryLimit() {
6091
+ const raw = process.env.PM_TRACKED_TEST_RUN_HISTORY_LIMIT;
6092
+ if (!raw || raw.trim().length === 0) {
6093
+ return DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT;
6094
+ }
6095
+ const parsed = Number.parseInt(raw, 10);
6096
+ if (!Number.isFinite(parsed) || parsed <= 0) {
6097
+ return DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT;
6098
+ }
6099
+ return parsed;
6100
+ }
6101
+ function normalizeTrackedTestRunSummaries(entries) {
6102
+ 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) => {
6103
+ const byRecorded = compareTimestampStrings(left.recorded_at, right.recorded_at);
6104
+ if (byRecorded !== 0)
6105
+ return byRecorded;
6106
+ const byRunId = left.run_id.localeCompare(right.run_id);
6107
+ if (byRunId !== 0)
6108
+ return byRunId;
6109
+ return left.kind.localeCompare(right.kind);
6110
+ });
6111
+ }
6112
+ async function appendTrackedTestRunSummary(options) {
6113
+ const historyLimit = trackedTestRunHistoryLimit();
6114
+ await mutateItem({
6115
+ pmRoot: options.pmRoot,
6116
+ settings: options.settings,
6117
+ id: options.itemId,
6118
+ op: "test_run_track",
6119
+ author: options.author,
6120
+ message: options.message,
6121
+ force: false,
6122
+ mutate(document) {
6123
+ const current = document.metadata.test_runs ?? [];
6124
+ const next = normalizeTrackedTestRunSummaries([
6125
+ ...current,
6126
+ options.entry
6127
+ ]);
6128
+ const bounded = next.length > historyLimit ? next.slice(next.length - historyLimit) : next;
6129
+ document.metadata.test_runs = bounded;
6130
+ return { changedFields: ["test_runs"] };
6131
+ }
6132
+ });
6133
+ }
6134
+
6135
+ // dist/core/test/run-selectors.js
6136
+ var MAX_SELECTOR_ENTRY_LABEL_LENGTH = 100;
6137
+ function parseOnlyIndexValue(raw, optionName = "--only-index") {
6138
+ const value = typeof raw === "number" ? raw : Number(String(raw).trim());
6139
+ if (!Number.isInteger(value) || value < 1) {
6140
+ 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);
6141
+ }
6142
+ return value;
6143
+ }
6144
+ function summarizeSelectorEntry(entry) {
6145
+ const label = entry.command ?? entry.path ?? "<no command>";
6146
+ const normalized = label.replaceAll(/\s+/g, " ").trim() || "<no command>";
6147
+ if (normalized.length <= MAX_SELECTOR_ENTRY_LABEL_LENGTH) {
6148
+ return normalized;
6149
+ }
6150
+ return `${normalized.slice(0, MAX_SELECTOR_ENTRY_LABEL_LENGTH - 3)}...`;
6151
+ }
6152
+ function describeLinkedTestEntries(tests) {
6153
+ return tests.map((entry, index) => `${index + 1}. ${summarizeSelectorEntry(entry)}`).join("; ");
6154
+ }
6155
+ function activeSelectorKinds(selector) {
6156
+ const kinds = [];
6157
+ if (selector.match !== void 0) {
6158
+ kinds.push("match");
6159
+ }
6160
+ if (selector.onlyIndex !== void 0) {
6161
+ kinds.push("only-index");
6162
+ }
6163
+ if (selector.onlyLast === true) {
6164
+ kinds.push("only-last");
6165
+ }
6166
+ return kinds;
6167
+ }
6168
+ function entryMatchesSubstring(entry, needle) {
6169
+ const command = entry.command?.toLowerCase() ?? "";
6170
+ const entryPath = entry.path?.toLowerCase() ?? "";
6171
+ return command.includes(needle) || entryPath.includes(needle);
6172
+ }
6173
+ function resolveLinkedTestRunSelection(tests, selector) {
6174
+ const kinds = activeSelectorKinds(selector);
6175
+ if (kinds.length === 0) {
6176
+ return {
6177
+ selector: null,
6178
+ requested: null,
6179
+ selected: tests,
6180
+ selected_indexes: tests.map((_, index) => index + 1),
6181
+ selected_count: tests.length,
6182
+ skipped_count: 0
6183
+ };
6184
+ }
6185
+ if (kinds.length > 1) {
6186
+ 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);
6187
+ }
6188
+ const kind = kinds[0];
6189
+ if (tests.length === 0) {
6190
+ 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);
6191
+ }
6192
+ if (kind === "match") {
6193
+ const needle = selector.match.trim().toLowerCase();
6194
+ if (needle.length === 0) {
6195
+ throw new PmCliError("--match requires a non-empty substring to match against linked-test command/path values", EXIT_CODE.USAGE);
6196
+ }
6197
+ const selectedIndexes = [];
6198
+ const selected = [];
6199
+ for (let index = 0; index < tests.length; index += 1) {
6200
+ if (entryMatchesSubstring(tests[index], needle)) {
6201
+ selected.push(tests[index]);
6202
+ selectedIndexes.push(index + 1);
6203
+ }
6204
+ }
6205
+ if (selected.length === 0) {
6206
+ throw new PmCliError(`--match "${selector.match}" matched none of the ${tests.length} linked test(s). Available entries: ${describeLinkedTestEntries(tests)}`, EXIT_CODE.USAGE);
6207
+ }
6208
+ return {
6209
+ selector: "match",
6210
+ requested: selector.match,
6211
+ selected,
6212
+ selected_indexes: selectedIndexes,
6213
+ selected_count: selected.length,
6214
+ skipped_count: tests.length - selected.length
6215
+ };
6216
+ }
6217
+ if (kind === "only-index") {
6218
+ const index = parseOnlyIndexValue(selector.onlyIndex);
6219
+ if (index > tests.length) {
6220
+ 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);
6221
+ }
6222
+ return {
6223
+ selector: "only-index",
6224
+ requested: String(index),
6225
+ selected: [tests[index - 1]],
6226
+ selected_indexes: [index],
6227
+ selected_count: 1,
6228
+ skipped_count: tests.length - 1
6229
+ };
6230
+ }
6231
+ return {
6232
+ selector: "only-last",
6233
+ requested: "last",
6234
+ selected: [tests[tests.length - 1]],
6235
+ selected_indexes: [tests.length],
6236
+ selected_count: 1,
6237
+ skipped_count: tests.length - 1
6238
+ };
6239
+ }
6240
+
6241
+ // dist/sdk/test/execution.js
6179
6242
  var TEST_OUTPUT_MAX_BUFFER_BYTES = 20 * 1024 * 1024;
6180
6243
  var DEFAULT_LINKED_TEST_TIMEOUT_FORCE_KILL_DELAY_MS = 3e3;
6181
6244
  var DEFAULT_LINKED_TEST_HEARTBEAT_INTERVAL_MS = 1e4;
@@ -6333,7 +6396,17 @@ function resolveLinkedTestEffectiveContextMode(requestedMode, isPmTrackerReadCom
6333
6396
  return requestedMode;
6334
6397
  }
6335
6398
  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;
6399
+ return Object.entries(linkedTest).filter(([key]) => key.startsWith("assert_")).some(([, value]) => {
6400
+ if (value === void 0 || value === null)
6401
+ return false;
6402
+ if (Array.isArray(value))
6403
+ return value.length > 0;
6404
+ if (typeof value === "object")
6405
+ return Object.keys(value).length > 0;
6406
+ if (typeof value === "string")
6407
+ return value.trim().length > 0;
6408
+ return true;
6409
+ });
6337
6410
  }
6338
6411
  function buildPmContextMismatchHint(params) {
6339
6412
  const { executionContext, runLevelPmContextMode, linkedOverridePmContextMode } = params;
@@ -6437,6 +6510,12 @@ function parsedLauncherInvokesRecursiveTestAll(parsed) {
6437
6510
  }
6438
6511
  return firstPmSubcommand(parsed.args) === "test-all";
6439
6512
  }
6513
+ var SHELL_COMMAND_FLAG_PATTERNS = new Map([
6514
+ ...["sh", "bash", "dash", "zsh"].map((executable) => [executable, /^(?:-c|-[a-z]*c[a-z]*)$/u]),
6515
+ ...["cmd", "cmd.exe"].map((executable) => [executable, /^\/[ck]$/u]),
6516
+ ...["powershell", "powershell.exe", "pwsh", "pwsh.exe"].map((executable) => [executable, /^-(?:c|command)$/u])
6517
+ ]);
6518
+ var PACKAGE_EXEC_EXECUTABLES = /* @__PURE__ */ new Set(["npx", "bunx"]);
6440
6519
  function segmentInvokesRecursiveTestAll(segment) {
6441
6520
  const rawTokens = segment.split(" ").filter((token) => token.length > 0);
6442
6521
  const tokens = stripLeadingEnvAssignments(rawTokens);
@@ -6444,13 +6523,18 @@ function segmentInvokesRecursiveTestAll(segment) {
6444
6523
  return false;
6445
6524
  }
6446
6525
  const [executable, ...args] = tokens;
6526
+ const shellCommandFlagPattern = SHELL_COMMAND_FLAG_PATTERNS.get(executable);
6527
+ if (shellCommandFlagPattern) {
6528
+ const commandFlagIndex = args.findIndex((arg) => shellCommandFlagPattern.test(arg));
6529
+ return commandFlagIndex >= 0 ? segmentInvokesRecursiveTestAll(args.slice(commandFlagIndex + 1).join(" ")) : false;
6530
+ }
6447
6531
  if (isPmExecutableToken(executable) || isPmCliScriptToken(executable)) {
6448
6532
  return firstPmSubcommand(args) === "test-all";
6449
6533
  }
6450
6534
  if (executable === "node" && args.length > 0 && isPmCliScriptToken(args[0])) {
6451
6535
  return firstPmSubcommand(args.slice(1)) === "test-all";
6452
6536
  }
6453
- if (executable === "npx" || executable === "bunx") {
6537
+ if (PACKAGE_EXEC_EXECUTABLES.has(executable)) {
6454
6538
  return parsedLauncherInvokesRecursiveTestAll(parseNpxCommand(args));
6455
6539
  }
6456
6540
  if (executable === "pnpm") {
@@ -6564,7 +6648,13 @@ function parseLinkedTestTimeoutSeconds(timeoutSecondsRaw, timeoutAliasRaw) {
6564
6648
  throw new PmCliError("--add timeout and timeout_seconds must match when both are provided", EXIT_CODE.USAGE);
6565
6649
  }
6566
6650
  const timeoutRaw = timeoutSecondsRaw ?? timeoutAliasRaw;
6567
- return timeoutRaw === void 0 ? void 0 : Math.floor(parseOptionalNumber(timeoutRaw, "timeout_seconds"));
6651
+ if (timeoutRaw === void 0)
6652
+ return void 0;
6653
+ const timeout = Math.floor(parseOptionalNumber(timeoutRaw, "timeout_seconds"));
6654
+ if (timeout <= 0) {
6655
+ throw new PmCliError("--add timeout_seconds must be a positive integer", EXIT_CODE.USAGE);
6656
+ }
6657
+ return timeout;
6568
6658
  }
6569
6659
  function parseAddJsonEntries(raw) {
6570
6660
  if (!raw)
@@ -6762,7 +6852,7 @@ function appendLinkedTestOutputChunk(state, chunk, target) {
6762
6852
  state.stderrBytes += bytes;
6763
6853
  }
6764
6854
  const bufferExceeded = state.stdoutBytes > TEST_OUTPUT_MAX_BUFFER_BYTES || state.stderrBytes > TEST_OUTPUT_MAX_BUFFER_BYTES;
6765
- if (!state.maxBufferExceeded && bufferExceeded) {
6855
+ if (bufferExceeded) {
6766
6856
  state.maxBufferExceeded = true;
6767
6857
  return true;
6768
6858
  }
@@ -7090,7 +7180,7 @@ function readJsonPathValue(root, fieldPath) {
7090
7180
  current = current[segment];
7091
7181
  continue;
7092
7182
  }
7093
- if (typeof current !== "object" || current === null || !(segment in current)) {
7183
+ if (typeof current !== "object" || current === null || !Object.prototype.hasOwnProperty.call(current, segment)) {
7094
7184
  return { found: false, value: void 0 };
7095
7185
  }
7096
7186
  current = current[segment];
@@ -7277,7 +7367,7 @@ function buildLinkedTestExecutionContext(params) {
7277
7367
  sandbox_project_item_count: selectedSandboxProjectItemCount,
7278
7368
  source_global_item_count: params.counts.sourceGlobalItemCount,
7279
7369
  sandbox_global_item_count: selectedSandboxGlobalItemCount,
7280
- mismatch_detected: params.isPmCommand && params.counts.sourceProjectItemCount !== selectedSandboxProjectItemCount,
7370
+ mismatch_detected: params.isPmCommand && (params.counts.sourceProjectItemCount !== selectedSandboxProjectItemCount || params.counts.sourceGlobalItemCount !== selectedSandboxGlobalItemCount),
7281
7371
  project_extensions_seeded: Boolean(params.sourceRoots),
7282
7372
  global_extensions_seeded: Boolean(params.sourceRoots)
7283
7373
  };
@@ -7564,8 +7654,12 @@ function resolveTestRunOptions(options, tests) {
7564
7654
  onlyLast: options.onlyLast
7565
7655
  };
7566
7656
  const runSelection = options.run === true ? resolveLinkedTestRunSelection(tests, selectorInput) : void 0;
7657
+ const defaultTimeoutSeconds = options.timeout === void 0 ? void 0 : parseOptionalNumber(options.timeout, "timeout");
7658
+ if (defaultTimeoutSeconds !== void 0 && defaultTimeoutSeconds <= 0) {
7659
+ throw new PmCliError("Test timeout must be a positive number", EXIT_CODE.USAGE);
7660
+ }
7567
7661
  return {
7568
- defaultTimeoutSeconds: options.timeout === void 0 ? void 0 : parseOptionalNumber(options.timeout, "timeout"),
7662
+ defaultTimeoutSeconds,
7569
7663
  pmContextMode: parsePmContextMode(options.pmContext),
7570
7664
  runSelection,
7571
7665
  testsToRun: runSelection?.selected ?? tests
@@ -7706,8 +7800,8 @@ async function runTest(id, options, global) {
7706
7800
  };
7707
7801
  }
7708
7802
 
7709
- // dist/cli/commands/test-all.js
7710
- function parseStatus(raw, statusRegistry) {
7803
+ // dist/sdk/test/batch.js
7804
+ var parseStatus = (raw, statusRegistry) => {
7711
7805
  if (raw === void 0) {
7712
7806
  return void 0;
7713
7807
  }
@@ -7717,14 +7811,18 @@ function parseStatus(raw, statusRegistry) {
7717
7811
  throw new PmCliError(`Invalid --status value "${raw}". Allowed: ${allowedStatuses.join(", ")}`, EXIT_CODE.USAGE);
7718
7812
  }
7719
7813
  return normalized;
7720
- }
7721
- function parseTimeout(raw) {
7814
+ };
7815
+ var parseTimeout = (raw) => {
7722
7816
  if (raw === void 0) {
7723
7817
  return void 0;
7724
7818
  }
7725
- return parseOptionalNumber(raw, "timeout");
7726
- }
7727
- function parseNonNegativeInteger(raw, flag) {
7819
+ const parsed = parseOptionalNumber(raw, "timeout");
7820
+ if (parsed <= 0) {
7821
+ throw new PmCliError("timeout must be a positive number", EXIT_CODE.USAGE);
7822
+ }
7823
+ return parsed;
7824
+ };
7825
+ var parseNonNegativeInteger = (raw, flag) => {
7728
7826
  if (raw === void 0) {
7729
7827
  return void 0;
7730
7828
  }
@@ -7733,66 +7831,67 @@ function parseNonNegativeInteger(raw, flag) {
7733
7831
  throw new PmCliError(`${flag} must be a non-negative integer`, EXIT_CODE.USAGE);
7734
7832
  }
7735
7833
  return parsed;
7736
- }
7737
- function formatTrackingError(error) {
7834
+ };
7835
+ var formatTrackingError = (error) => {
7738
7836
  return error instanceof Error ? error.message : String(error);
7739
- }
7740
- function resolveTrackedRunId2() {
7837
+ };
7838
+ var resolveTrackedRunId2 = () => {
7741
7839
  const fromEnv = process.env.PM_BACKGROUND_TEST_RUN_ID?.trim();
7742
7840
  if (fromEnv && fromEnv.length > 0) {
7743
7841
  return fromEnv;
7744
7842
  }
7745
7843
  return `test-all-local-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
7746
- }
7747
- function normalizeCommand(command) {
7844
+ };
7845
+ var normalizeCommand = (command) => {
7748
7846
  return command.trim().replaceAll(/\s+/g, " ");
7749
- }
7750
- function normalizeEnvSetSignature(value) {
7847
+ };
7848
+ var normalizeEnvSetSignature = (value) => {
7751
7849
  if (!value || Object.keys(value).length === 0) {
7752
7850
  return "{}";
7753
7851
  }
7754
7852
  return JSON.stringify(Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right))));
7755
- }
7756
- function normalizeEnvClearSignature(value) {
7853
+ };
7854
+ var normalizeEnvClearSignature = (value) => {
7757
7855
  if (!value || value.length === 0) {
7758
7856
  return "[]";
7759
7857
  }
7760
7858
  return JSON.stringify([...value].sort((left, right) => left.localeCompare(right)));
7761
- }
7762
- function normalizePmContextModeSignature(value) {
7859
+ };
7860
+ var normalizePmContextModeSignature = (value) => {
7763
7861
  const normalized = value?.trim().toLowerCase();
7764
7862
  return normalized && normalized.length > 0 ? normalized : "none";
7765
- }
7766
- function normalizeAssertionSignature(test) {
7863
+ };
7864
+ var normalizeAssertionStrings = (values) => [...new Set(values ?? [])].sort((left, right) => left.localeCompare(right));
7865
+ var normalizeAssertionMap = (value) => Object.fromEntries(Object.entries(value ?? {}).sort(([left], [right]) => left.localeCompare(right)));
7866
+ var normalizeAssertionLineCount = (value) => typeof value === "number" ? value : void 0;
7867
+ var normalizeAssertionSignature = (test) => {
7767
7868
  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)))
7869
+ assert_stdout_contains: normalizeAssertionStrings(test.assert_stdout_contains),
7870
+ assert_stdout_regex: normalizeAssertionStrings(test.assert_stdout_regex),
7871
+ assert_stderr_contains: normalizeAssertionStrings(test.assert_stderr_contains),
7872
+ assert_stderr_regex: normalizeAssertionStrings(test.assert_stderr_regex),
7873
+ assert_stdout_min_lines: normalizeAssertionLineCount(test.assert_stdout_min_lines),
7874
+ assert_json_field_equals: normalizeAssertionMap(test.assert_json_field_equals),
7875
+ assert_json_field_gte: normalizeAssertionMap(test.assert_json_field_gte)
7779
7876
  };
7780
7877
  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}`;
7878
+ };
7879
+ var resolveLinkedTestTargetSignature = (test) => {
7880
+ const command = resolveOptionalEnvironmentValue(test.command);
7881
+ if (command !== void 0) {
7882
+ return `command:${test.scope}:${normalizeCommand(command)}`;
7791
7883
  }
7792
- const linkedPath = test.path?.trim() ?? "";
7793
- return `path:${test.scope}:${linkedPath}`;
7794
- }
7795
- function maxTimeoutSeconds(current, candidate) {
7884
+ return `path:${test.scope}:${resolveOptionalEnvironmentValue(test.path) ?? ""}`;
7885
+ };
7886
+ var buildLinkedTestKey = (test) => {
7887
+ const envSet = normalizeEnvSetSignature(test.env_set);
7888
+ const envClear = normalizeEnvClearSignature(test.env_clear);
7889
+ const pmContextMode = normalizePmContextModeSignature(test.pm_context_mode);
7890
+ const sharedHostSafe = test.shared_host_safe === true ? "true" : "false";
7891
+ const assertions = normalizeAssertionSignature(test);
7892
+ return `${resolveLinkedTestTargetSignature(test)}:${envSet}:${envClear}:${pmContextMode}:${sharedHostSafe}:${assertions}`;
7893
+ };
7894
+ var maxTimeoutSeconds = (current, candidate) => {
7796
7895
  if (candidate === void 0) {
7797
7896
  return current;
7798
7897
  }
@@ -7800,8 +7899,8 @@ function maxTimeoutSeconds(current, candidate) {
7800
7899
  return candidate;
7801
7900
  }
7802
7901
  return current;
7803
- }
7804
- function countStatuses(runResults) {
7902
+ };
7903
+ var countStatuses = (runResults) => {
7805
7904
  let passed = 0;
7806
7905
  let failed = 0;
7807
7906
  let skipped = 0;
@@ -7817,13 +7916,13 @@ function countStatuses(runResults) {
7817
7916
  skipped += 1;
7818
7917
  }
7819
7918
  return { passed, failed, skipped };
7820
- }
7821
- function mergeFailureCategoryCounts(target, source) {
7919
+ };
7920
+ var mergeFailureCategoryCounts = (target, source) => {
7822
7921
  for (const [key, value] of Object.entries(source)) {
7823
7922
  target[key] += value;
7824
7923
  }
7825
- }
7826
- function emitTestAllProgress(options, message) {
7924
+ };
7925
+ var emitTestAllProgress = (options, message) => {
7827
7926
  if (options.progress !== true) {
7828
7927
  return;
7829
7928
  }
@@ -7832,8 +7931,8 @@ function emitTestAllProgress(options, message) {
7832
7931
  `);
7833
7932
  } catch {
7834
7933
  }
7835
- }
7836
- async function collectTestAllItemTests(filteredItems, global, pmRoot) {
7934
+ };
7935
+ var collectTestAllItemTests = async (filteredItems, global, pmRoot) => {
7837
7936
  const itemTests = [];
7838
7937
  let linkedTests = 0;
7839
7938
  for (const item of filteredItems) {
@@ -7845,8 +7944,8 @@ async function collectTestAllItemTests(filteredItems, global, pmRoot) {
7845
7944
  itemTests.push({ item, tests: readResult.tests });
7846
7945
  }
7847
7946
  return { itemTests, linkedTests };
7848
- }
7849
- async function selectTestAllItems(params) {
7947
+ };
7948
+ var selectTestAllItems = async (params) => {
7850
7949
  const statusRegistry = resolveRuntimeStatusRegistry(params.settings.schema);
7851
7950
  const typeRegistry = resolveItemTypeRegistry(params.settings, getActiveExtensionRegistrations());
7852
7951
  const statusFilter = parseStatus(params.options.status, statusRegistry);
@@ -7856,8 +7955,8 @@ async function selectTestAllItems(params) {
7856
7955
  const statusFilteredItems = allItems.filter((item) => statusFilter ? item.status === statusFilter : true).sort((a, b) => a.id.localeCompare(b.id));
7857
7956
  const filteredItems = limitFilter === void 0 ? statusFilteredItems.slice(offsetFilter) : statusFilteredItems.slice(offsetFilter, offsetFilter + limitFilter);
7858
7957
  return { filteredItems, statusFilter, limitFilter, offsetFilter };
7859
- }
7860
- function buildEffectiveTimeoutByKey(itemTests) {
7958
+ };
7959
+ var buildEffectiveTimeoutByKey = (itemTests) => {
7861
7960
  const effectiveTimeoutByKey = /* @__PURE__ */ new Map();
7862
7961
  for (const { tests } of itemTests) {
7863
7962
  for (const test of tests) {
@@ -7870,8 +7969,8 @@ function buildEffectiveTimeoutByKey(itemTests) {
7870
7969
  }
7871
7970
  }
7872
7971
  return effectiveTimeoutByKey;
7873
- }
7874
- async function runTestAllItem(entry, context) {
7972
+ };
7973
+ var runTestAllItem = async (entry, context) => {
7875
7974
  const testsToRun = [];
7876
7975
  const keyedTests = entry.tests.map((test) => {
7877
7976
  const key = buildLinkedTestKey(test);
@@ -7932,12 +8031,18 @@ async function runTestAllItem(entry, context) {
7932
8031
  failure_categories: failureCategories
7933
8032
  }
7934
8033
  };
7935
- }
7936
- async function appendTestAllItemTracking(entry, summary, context) {
8034
+ };
8035
+ var trackedRunFailed = (summary, options) => [
8036
+ summary.failed > 0,
8037
+ options.failOnSkipped === true && summary.skipped > 0
8038
+ ].includes(true);
8039
+ var optionalTrue = (value) => value ? true : void 0;
8040
+ var appendTestAllItemTracking = async (entry, summary, context) => {
7937
8041
  if (!context.trackingEnabled) {
7938
8042
  return [];
7939
8043
  }
7940
8044
  try {
8045
+ const failed = trackedRunFailed(summary, context.options);
7941
8046
  await appendTrackedTestRunSummary({
7942
8047
  pmRoot: context.pmRoot,
7943
8048
  settings: context.settings,
@@ -7947,7 +8052,7 @@ async function appendTestAllItemTracking(entry, summary, context) {
7947
8052
  entry: {
7948
8053
  run_id: context.trackingRunId,
7949
8054
  kind: "test-all",
7950
- status: summary.failed > 0 || context.options.failOnSkipped === true && summary.skipped > 0 ? "failed" : "passed",
8055
+ status: failed ? "failed" : "passed",
7951
8056
  started_at: context.runStartedAt,
7952
8057
  finished_at: nowIso(),
7953
8058
  recorded_at: nowIso(),
@@ -7958,7 +8063,7 @@ async function appendTestAllItemTracking(entry, summary, context) {
7958
8063
  skipped: summary.skipped,
7959
8064
  items: 1,
7960
8065
  linked_tests: entry.tests.length,
7961
- fail_on_skipped_triggered: context.options.failOnSkipped === true && summary.skipped > 0 ? true : void 0
8066
+ fail_on_skipped_triggered: optionalTrue(context.options.failOnSkipped === true && summary.skipped > 0)
7962
8067
  }
7963
8068
  });
7964
8069
  } catch (error) {
@@ -7967,11 +8072,17 @@ async function appendTestAllItemTracking(entry, summary, context) {
7967
8072
  ];
7968
8073
  }
7969
8074
  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();
8075
+ };
8076
+ var resolveTrackingAttempt = () => {
8077
+ const raw = process.env.PM_BACKGROUND_TEST_RUN_ATTEMPT?.trim();
8078
+ const parsed = raw ? Number.parseInt(raw, 10) : Number.NaN;
8079
+ return Number.isFinite(parsed) && parsed >= 1 ? parsed : void 0;
8080
+ };
8081
+ var resolveOptionalEnvironmentValue = (value) => {
8082
+ const trimmed = value?.trim();
8083
+ return trimmed && trimmed.length > 0 ? trimmed : void 0;
8084
+ };
8085
+ var buildTestAllItemRunContext = (params) => {
7975
8086
  return {
7976
8087
  pmRoot: params.pmRoot,
7977
8088
  settings: params.settings,
@@ -7986,12 +8097,12 @@ function buildTestAllItemRunContext(params) {
7986
8097
  trackingEnabled: params.settings.testing.record_results_to_items === true,
7987
8098
  trackingAuthor: resolveAuthor(void 0, params.settings.author_default),
7988
8099
  trackingRunId: resolveTrackedRunId2(),
7989
- trackingAttempt: Number.isFinite(trackingParsedAttempt) && trackingParsedAttempt >= 1 ? trackingParsedAttempt : void 0,
7990
- trackingResumedFrom: trackingResumedFrom && trackingResumedFrom.length > 0 ? trackingResumedFrom : void 0,
8100
+ trackingAttempt: resolveTrackingAttempt(),
8101
+ trackingResumedFrom: resolveOptionalEnvironmentValue(process.env.PM_BACKGROUND_TEST_RUN_RESUMED_FROM),
7991
8102
  runStartedAt: params.runStartedAt
7992
8103
  };
7993
- }
7994
- function initializeTestAllAccumulation(options, linkedTests, filteredItems) {
8104
+ };
8105
+ var initializeTestAllAccumulation = (options, linkedTests, filteredItems) => {
7995
8106
  const accumulation = {
7996
8107
  results: [],
7997
8108
  passed: 0,
@@ -8007,8 +8118,8 @@ function initializeTestAllAccumulation(options, linkedTests, filteredItems) {
8007
8118
  accumulation.trackingWarnings.push(`empty_linked_test_selection:items=${filteredItems.length};linked_tests=0;fail_on_empty_test_run=true`);
8008
8119
  }
8009
8120
  return { accumulation, failOnEmptyTestRunTriggered };
8010
- }
8011
- async function runTestAllItems(itemTests, context, accumulation) {
8121
+ };
8122
+ var runTestAllItems = async (itemTests, context, accumulation) => {
8012
8123
  for (const [itemIndex, entry] of itemTests.entries()) {
8013
8124
  emitTestAllProgress(context.options, `item ${itemIndex + 1}/${itemTests.length} start id=${entry.item.id} linked_tests=${entry.tests.length}`);
8014
8125
  const execution = await runTestAllItem(entry, context);
@@ -8020,16 +8131,16 @@ async function runTestAllItems(itemTests, context, accumulation) {
8020
8131
  accumulation.results.push(execution.result);
8021
8132
  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
8133
  }
8023
- }
8024
- function appendContextPreflightWarning(options, accumulation) {
8134
+ };
8135
+ var appendContextPreflightWarning = (options, accumulation) => {
8025
8136
  if (options.checkContext !== true) {
8026
8137
  return;
8027
8138
  }
8028
8139
  const allRunResults = accumulation.results.flatMap((entry) => entry.run_results);
8029
8140
  const preflight = summarizeContextPreflight(allRunResults);
8030
8141
  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) {
8142
+ };
8143
+ var buildTestAllResult = (params) => {
8033
8144
  return {
8034
8145
  ok: params.ok,
8035
8146
  totals: {
@@ -8048,43 +8159,77 @@ function buildTestAllResult(params) {
8048
8159
  warnings: params.accumulation.trackingWarnings.length > 0 ? params.accumulation.trackingWarnings : void 0,
8049
8160
  results: params.accumulation.results
8050
8161
  };
8051
- }
8052
- async function runTestAll(options, global) {
8162
+ };
8163
+ var buildTestAllSelectionProgress = (params) => [
8164
+ `selection items=${params.filteredItems.length}`,
8165
+ `linked_tests=${params.linkedTests}`,
8166
+ params.statusFilter === void 0 ? "" : `status=${params.statusFilter}`,
8167
+ params.limitFilter === void 0 ? "" : `limit=${params.limitFilter}`,
8168
+ params.offsetFilter > 0 ? `offset=${params.offsetFilter}` : ""
8169
+ ].filter((entry) => entry.length > 0).join(" ");
8170
+ var prepareTestAllRun = async (options, global) => {
8053
8171
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
8054
8172
  if (!await pathExists(getSettingsPath(pmRoot))) {
8055
8173
  throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
8056
8174
  }
8057
8175
  const settings = await readSettings(pmRoot);
8058
- const { filteredItems, statusFilter, limitFilter, offsetFilter } = await selectTestAllItems({ pmRoot, settings, options });
8176
+ const selection = await selectTestAllItems({ pmRoot, settings, options });
8059
8177
  const defaultTimeoutSeconds = parseTimeout(options.timeout);
8060
8178
  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({
8179
+ const collected = await collectTestAllItemTests(selection.filteredItems, global, pmRoot);
8180
+ emitTestAllProgress(options, buildTestAllSelectionProgress({
8181
+ ...selection,
8182
+ linkedTests: collected.linkedTests
8183
+ }));
8184
+ return {
8065
8185
  pmRoot,
8066
8186
  settings,
8067
- options,
8068
- itemTests,
8187
+ filteredItems: selection.filteredItems,
8188
+ itemTests: collected.itemTests,
8189
+ linkedTests: collected.linkedTests,
8069
8190
  defaultTimeoutSeconds,
8070
8191
  runStartedAt
8192
+ };
8193
+ };
8194
+ var resolveTestAllOutcome = (params) => {
8195
+ const failOnSkippedTriggered = params.options.failOnSkipped === true && params.accumulation.skipped > 0;
8196
+ const ok = ![
8197
+ params.accumulation.failed > 0,
8198
+ failOnSkippedTriggered,
8199
+ params.failOnEmptyTestRunTriggered
8200
+ ].includes(true);
8201
+ return { failOnSkippedTriggered, ok };
8202
+ };
8203
+ var runTestAll = async (options, global) => {
8204
+ const prepared = await prepareTestAllRun(options, global);
8205
+ const { accumulation, failOnEmptyTestRunTriggered } = initializeTestAllAccumulation(options, prepared.linkedTests, prepared.filteredItems);
8206
+ const itemRunContext = buildTestAllItemRunContext({
8207
+ pmRoot: prepared.pmRoot,
8208
+ settings: prepared.settings,
8209
+ options,
8210
+ itemTests: prepared.itemTests,
8211
+ defaultTimeoutSeconds: prepared.defaultTimeoutSeconds,
8212
+ runStartedAt: prepared.runStartedAt
8071
8213
  });
8072
- await runTestAllItems(itemTests, itemRunContext, accumulation);
8073
- const failOnSkippedTriggered = options.failOnSkipped === true && accumulation.skipped > 0;
8214
+ await runTestAllItems(prepared.itemTests, itemRunContext, accumulation);
8074
8215
  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}`);
8216
+ const outcome = resolveTestAllOutcome({
8217
+ options,
8218
+ accumulation,
8219
+ failOnEmptyTestRunTriggered
8220
+ });
8221
+ 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
8222
  return buildTestAllResult({
8078
- ok,
8079
- filteredItems,
8080
- linkedTests,
8223
+ ok: outcome.ok,
8224
+ filteredItems: prepared.filteredItems,
8225
+ linkedTests: prepared.linkedTests,
8081
8226
  accumulation,
8082
- failOnSkippedTriggered,
8227
+ failOnSkippedTriggered: outcome.failOnSkippedTriggered,
8083
8228
  failOnEmptyTestRunTriggered
8084
8229
  });
8085
- }
8230
+ };
8086
8231
 
8087
- // dist/cli/commands/test-runs.js
8232
+ // dist/sdk/test/runs.js
8088
8233
  import os from "node:os";
8089
8234
 
8090
8235
  // dist/core/test/background-runs.js
@@ -8919,7 +9064,7 @@ async function readBackgroundTestRunLogs(pmRoot, runId, stream, tail) {
8919
9064
  };
8920
9065
  }
8921
9066
 
8922
- // dist/cli/commands/test-runs.js
9067
+ // dist/sdk/test/runs.js
8923
9068
  var BACKGROUND_STATUS_VALUES = [
8924
9069
  "queued",
8925
9070
  "running",
@@ -11269,7 +11414,14 @@ export {
11269
11414
  runEvent,
11270
11415
  runRemind,
11271
11416
  runStats,
11417
+ TELEMETRY_SUBCOMMANDS,
11272
11418
  runTelemetry,
11419
+ extractReferencedPmItemIdsFromCommand,
11420
+ summarizeContextPreflight,
11421
+ classifyLinkedTestFailure,
11422
+ countFailureCategories,
11423
+ resolveLinkedTestFailureExitCode,
11424
+ runLinkedTests,
11273
11425
  runTest,
11274
11426
  runTestAll,
11275
11427
  runStartBackgroundRun,
@@ -11283,6 +11435,6 @@ export {
11283
11435
  runValidate,
11284
11436
  runValidate2
11285
11437
  };
11286
- //# sourceMappingURL=chunk-5ZSLZLDN.js.map
11438
+ //# sourceMappingURL=chunk-6VHUGVNP.js.map
11287
11439
 
11288
- //# debugId=1a18538c-3ee2-5ab6-b7c2-b913c780563a
11440
+ //# debugId=85084307-fe97-5ecd-bfa8-3c803663a33c