@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers.js","sources":["sdk/test/parsers.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/test/parsers\n *\n * Implements the pm linked test parsers command surface and its agent-facing runtime behavior.\n */\nimport { parseOptionalNumber } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { splitCommaList } from \"../../core/shared/split-comma-list.js\";\nimport { STRUCTURED_LINKED_TEST_KEYS } from \"./entry.js\";\nimport { SCOPE_VALUES } from \"../../types/index.js\";\nimport type { LinkedTest, LinkScope } from \"../../types/index.js\";\n\n/**\n * Shared linked-test field parsers used by the `create` and `test` commands.\n *\n * Extracted verbatim from create.ts and test.ts (pm-why9). The two copies were\n * byte-identical apart from their empty-input guard: create called these with\n * raw (untrimmed) values and used `if (!normalized)`; test called them with\n * pre-`.trim()`-ed values and used `if (!raw || raw.trim().length === 0)`.\n *\n * Both reduce to the same observable behaviour when the guard is the plain\n * falsy check used here: create's call sites still pass untrimmed values\n * (behaviour preserved exactly), and test's call sites pre-trim so a\n * whitespace-only value collapses to \"\" and is rejected by `!raw` exactly as\n * before. Error strings and parsing semantics are identical to both originals.\n */\n\nexport const LINKED_TEST_PROTECTED_ENV_KEYS = new Set([\n \"PM_PATH\",\n \"PM_GLOBAL_PATH\",\n \"FORCE_COLOR\",\n]);\n/** Public contract for linked test env name pattern, shared by SDK and presentation-layer consumers. */\nexport const LINKED_TEST_ENV_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;\n/** Supported values accepted by the linked test pm context mode contract. */\nexport const LINKED_TEST_PM_CONTEXT_MODE_VALUES = [\n \"schema\",\n \"tracker\",\n \"auto\",\n] as const;\n/** Restricts linked test pm context mode values accepted by command, SDK, and storage contracts. */\nexport type LinkedTestPmContextMode =\n (typeof LINKED_TEST_PM_CONTEXT_MODE_VALUES)[number];\n\n/** Implements parse linked test env set for the public runtime surface of this module. */\nexport function parseLinkedTestEnvSet(\n raw: string | undefined,\n optionName: string,\n): Record<string, string> | undefined {\n if (!raw) {\n return undefined;\n }\n const assignments = raw\n .split(/[;\\n]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (assignments.length === 0) {\n throw new PmCliError(\n `${optionName} env_set must include at least one KEY=VALUE assignment`,\n EXIT_CODE.USAGE,\n );\n }\n const envSet: Record<string, string> = Object.create(null);\n for (const assignment of assignments) {\n const separatorIndex = assignment.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `${optionName} env_set entries must use KEY=VALUE and be separated by semicolons. Example: env_set=PORT=0;PLAYWRIGHT_BASE_URL=http://127.0.0.1:4173`,\n EXIT_CODE.USAGE,\n );\n }\n const key = assignment.slice(0, separatorIndex).trim();\n const value = assignment.slice(separatorIndex + 1);\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw new PmCliError(\n `${optionName} env_set key \"${key}\" is invalid`,\n EXIT_CODE.USAGE,\n );\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw new PmCliError(\n `${optionName} env_set key \"${key}\" is reserved for sandbox safety`,\n EXIT_CODE.USAGE,\n );\n }\n envSet[key] = value;\n }\n /* c8 ignore start -- envSet always has >=1 key here (assignments is non-empty and each adds one); the undefined branch is defensive. */\n return Object.keys(envSet).length > 0 ? envSet : undefined;\n /* c8 ignore stop */\n}\n\n/** Implements parse linked test env clear for the public runtime surface of this module. */\nexport function parseLinkedTestEnvClear(\n raw: string | undefined,\n optionName: string,\n): string[] | undefined {\n if (!raw) {\n return undefined;\n }\n const keys = splitCommaList(raw, { separators: /[;,\\n]/ });\n if (keys.length === 0) {\n throw new PmCliError(\n `${optionName} env_clear must include at least one environment variable name`,\n EXIT_CODE.USAGE,\n );\n }\n for (const key of keys) {\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw new PmCliError(\n `${optionName} env_clear key \"${key}\" is invalid`,\n EXIT_CODE.USAGE,\n );\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw new PmCliError(\n `${optionName} env_clear key \"${key}\" is reserved for sandbox safety`,\n EXIT_CODE.USAGE,\n );\n }\n }\n return keys;\n}\n\n/** Implements parse linked test boolean for the public runtime surface of this module. */\nexport function parseLinkedTestBoolean(\n raw: string | undefined,\n optionName: string,\n fieldLabel: string,\n): boolean | undefined {\n if (!raw) {\n return undefined;\n }\n const value = raw.trim().toLowerCase();\n if (value === \"true\" || value === \"1\" || value === \"yes\") {\n return true;\n }\n if (value === \"false\" || value === \"0\" || value === \"no\") {\n return false;\n }\n throw new PmCliError(\n `${optionName} ${fieldLabel} must be one of true|false|1|0|yes|no`,\n EXIT_CODE.USAGE,\n );\n}\n\n/** Implements parse linked test context mode for the public runtime surface of this module. */\nexport function parseLinkedTestContextMode(\n raw: string | undefined,\n optionName: string,\n): LinkedTest[\"pm_context_mode\"] | undefined {\n if (!raw) {\n return undefined;\n }\n const value = raw.trim().toLowerCase();\n if (\n (LINKED_TEST_PM_CONTEXT_MODE_VALUES as readonly string[]).includes(value)\n ) {\n return value as LinkedTest[\"pm_context_mode\"];\n }\n throw new PmCliError(\n `${optionName} pm_context_mode must be one of: ${LINKED_TEST_PM_CONTEXT_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\n/** Implements parse linked test string list for the public runtime surface of this module. */\nexport function parseLinkedTestStringList(\n raw: string | undefined,\n): string[] | undefined {\n if (!raw) {\n return undefined;\n }\n const values = splitCommaList(raw, { separators: /[;\\n]/ });\n return values.length > 0 ? values : undefined;\n}\n\n/** Implements parse linked test regex list for the public runtime surface of this module. */\nexport function parseLinkedTestRegexList(\n raw: string | undefined,\n optionName: string,\n fieldLabel: string,\n): string[] | undefined {\n const values = parseLinkedTestStringList(raw);\n if (!values || values.length === 0) {\n return undefined;\n }\n for (const pattern of values) {\n try {\n // Validate regex syntax early so malformed assertions fail at parse time.\n // User-provided, per-item patterns only run during local CLI validation.\n new RegExp(pattern, \"m\");\n } catch (error: unknown) {\n throw new PmCliError(\n /* c8 ignore next -- RegExp only throws SyntaxError (an Error); String(error) fallback is defensive. */\n `${optionName} ${fieldLabel} includes invalid regex \"${pattern}\": ${error instanceof Error ? error.message : String(error)}`,\n EXIT_CODE.USAGE,\n );\n }\n }\n return values;\n}\n\n/** Implements parse linked test min lines for the public runtime surface of this module. */\nexport function parseLinkedTestMinLines(\n raw: string | undefined,\n optionName: string,\n): number | undefined {\n if (!raw) {\n return undefined;\n }\n const parsed = parseOptionalNumber(raw, \"assert_stdout_min_lines\");\n if (!Number.isInteger(parsed) || parsed < 0) {\n throw new PmCliError(\n `${optionName} assert_stdout_min_lines must be an integer >= 0`,\n EXIT_CODE.USAGE,\n );\n }\n return parsed;\n}\n\n/** Implements parse linked test assertion equals map for the public runtime surface of this module. */\nexport function parseLinkedTestAssertionEqualsMap(\n raw: string | undefined,\n optionName: string,\n): Record<string, string> | undefined {\n if (!raw) {\n return undefined;\n }\n const assignments = raw\n .split(/[;\\n]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (assignments.length === 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_equals must include at least one path=value assignment`,\n EXIT_CODE.USAGE,\n );\n }\n const values: Record<string, string> = Object.create(null);\n for (const assignment of assignments) {\n const separatorIndex = assignment.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_equals entries must use path=value and be separated by semicolons`,\n EXIT_CODE.USAGE,\n );\n }\n const key = assignment.slice(0, separatorIndex).trim();\n const value = assignment.slice(separatorIndex + 1).trim();\n if (key.length === 0 || value.length === 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_equals entries must include non-empty path and value`,\n EXIT_CODE.USAGE,\n );\n }\n values[key] = value;\n }\n /* c8 ignore start -- values always has >=1 key here (assignments is non-empty and each adds one); the undefined branch is defensive. */\n return Object.keys(values).length > 0 ? values : undefined;\n /* c8 ignore stop */\n}\n\n/** Implements parse linked test assertion gte map for the public runtime surface of this module. */\nexport function parseLinkedTestAssertionGteMap(\n raw: string | undefined,\n optionName: string,\n): Record<string, number> | undefined {\n if (!raw) {\n return undefined;\n }\n const assignments = raw\n .split(/[;\\n]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (assignments.length === 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_gte must include at least one path=value assignment`,\n EXIT_CODE.USAGE,\n );\n }\n const values: Record<string, number> = Object.create(null);\n for (const assignment of assignments) {\n const separatorIndex = assignment.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_gte entries must use path=value and be separated by semicolons`,\n EXIT_CODE.USAGE,\n );\n }\n const key = assignment.slice(0, separatorIndex).trim();\n const valueRaw = assignment.slice(separatorIndex + 1).trim();\n if (key.length === 0 || valueRaw.length === 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_gte entries must include non-empty path and value`,\n EXIT_CODE.USAGE,\n );\n }\n const value = Number(valueRaw);\n if (!Number.isFinite(value)) {\n throw new PmCliError(\n `${optionName} assert_json_field_gte value for \"${key}\" must be numeric`,\n EXIT_CODE.USAGE,\n );\n }\n values[key] = value;\n }\n /* c8 ignore start -- values always has >=1 key here (assignments is non-empty and each adds one); the undefined branch is defensive. */\n return Object.keys(values).length > 0 ? values : undefined;\n /* c8 ignore stop */\n}\n\n/**\n * Strict JSON linked-test entry parsing for `pm test --add-json` (pm-vcr2).\n *\n * Accepts a JSON object or array of objects whose keys match the structured\n * linked-test fields. Unlike `--add` CSV parsing, command strings are stored\n * verbatim: commas, nested quotes, `--` separators, and shell variables like\n * `$tmp` survive byte-identically.\n */\n\nconst LINKED_TEST_JSON_KEY_SET = new Set<string>(STRUCTURED_LINKED_TEST_KEYS);\n\ntype JsonRecord = Record<string, unknown>;\n\nfunction isPlainObject(value: unknown): value is JsonRecord {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction normalizeJsonEntryKeys(\n entry: JsonRecord,\n fail: (message: string) => PmCliError,\n): JsonRecord {\n const normalized: JsonRecord = {};\n const unknownKeys: string[] = [];\n for (const [key, value] of Object.entries(entry)) {\n const normalizedKey = key.toLowerCase();\n if (!LINKED_TEST_JSON_KEY_SET.has(normalizedKey)) {\n unknownKeys.push(key);\n continue;\n }\n if (Object.hasOwn(normalized, normalizedKey)) {\n throw fail(\n `provides key \"${key}\" more than once after case normalization`,\n );\n }\n normalized[normalizedKey] = value;\n }\n if (unknownKeys.length > 0) {\n throw fail(\n `does not recognize key${unknownKeys.length > 1 ? \"s\" : \"\"} ${unknownKeys.map((key) => `\"${key}\"`).join(\", \")}. Allowed keys: ${STRUCTURED_LINKED_TEST_KEYS.join(\", \")}.`,\n );\n }\n return normalized;\n}\n\nfunction readJsonEntryString(\n entry: JsonRecord,\n key: string,\n fail: (message: string) => PmCliError,\n): string | undefined {\n if (!Object.hasOwn(entry, key)) {\n return undefined;\n }\n const value = entry[key];\n if (value === undefined) {\n return undefined;\n }\n if (typeof value !== \"string\") {\n throw fail(`field \"${key}\" must be a JSON string`);\n }\n return value;\n}\n\nfunction readJsonEntryStringList(\n entry: JsonRecord,\n key: string,\n fail: (message: string) => PmCliError,\n): string[] | undefined {\n if (!Object.hasOwn(entry, key)) {\n return undefined;\n }\n const value = entry[key];\n if (value === undefined) {\n return undefined;\n }\n const list = typeof value === \"string\" ? [value] : value;\n if (!Array.isArray(list) || list.some((item) => typeof item !== \"string\")) {\n throw fail(`field \"${key}\" must be a string or an array of strings`);\n }\n const values = (list as string[]).filter((item) => item.length > 0);\n return values.length > 0 ? values : undefined;\n}\n\nfunction readJsonEntryRegexList(\n entry: JsonRecord,\n key: string,\n fail: (message: string) => PmCliError,\n): string[] | undefined {\n const values = readJsonEntryStringList(entry, key, fail);\n if (!values) {\n return undefined;\n }\n for (const pattern of values) {\n try {\n new RegExp(pattern, \"m\");\n } catch (error: unknown) {\n throw fail(\n /* c8 ignore next -- RegExp only throws SyntaxError (an Error); String(error) fallback is defensive. */\n `field \"${key}\" includes invalid regex \"${pattern}\": ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n return values;\n}\n\nfunction readJsonEntryNumber(\n value: unknown,\n key: string,\n fail: (message: string) => PmCliError,\n): number {\n const parsed =\n typeof value === \"number\"\n ? value\n : typeof value === \"string\" && value.trim().length > 0\n ? Number(value.trim())\n : Number.NaN;\n if (typeof value === \"boolean\" || !Number.isFinite(parsed)) {\n throw fail(`field \"${key}\" must be a finite number (or numeric string)`);\n }\n return parsed;\n}\n\nfunction readJsonEntryTimeoutSeconds(\n entry: JsonRecord,\n fail: (message: string) => PmCliError,\n): number | undefined {\n const timeoutSecondsRaw = entry.timeout_seconds;\n const timeoutAliasRaw = entry.timeout;\n if (timeoutSecondsRaw === undefined && timeoutAliasRaw === undefined) {\n return undefined;\n }\n const timeoutSeconds =\n timeoutSecondsRaw === undefined\n ? undefined\n : readJsonEntryNumber(timeoutSecondsRaw, \"timeout_seconds\", fail);\n const timeoutAlias =\n timeoutAliasRaw === undefined\n ? undefined\n : readJsonEntryNumber(timeoutAliasRaw, \"timeout\", fail);\n if (\n timeoutSeconds !== undefined &&\n timeoutAlias !== undefined &&\n timeoutSeconds !== timeoutAlias\n ) {\n throw fail(\"timeout and timeout_seconds must match when both are provided\");\n }\n const timeout = timeoutSeconds ?? (timeoutAlias as number);\n if (!Number.isInteger(timeout) || timeout <= 0) {\n throw fail(\"timeout_seconds must be a positive integer\");\n }\n return timeout;\n}\n\nfunction readJsonEntryScope(\n entry: JsonRecord,\n fail: (message: string) => PmCliError,\n): LinkScope {\n const value = readJsonEntryString(entry, \"scope\", fail);\n if (value === undefined) {\n return \"project\";\n }\n if (!(SCOPE_VALUES as readonly string[]).includes(value)) {\n throw fail(`field \"scope\" must be one of: ${SCOPE_VALUES.join(\", \")}`);\n }\n return value as LinkScope;\n}\n\nfunction readJsonEntryEnvSet(\n entry: JsonRecord,\n fail: (message: string) => PmCliError,\n): Record<string, string> | undefined {\n if (!Object.hasOwn(entry, \"env_set\")) {\n return undefined;\n }\n const value = entry.env_set;\n if (value === undefined) {\n return undefined;\n }\n if (!isPlainObject(value)) {\n throw fail(\n 'field \"env_set\" must be a JSON object mapping environment names to string values',\n );\n }\n const envSet: Record<string, string> = Object.create(null);\n for (const [key, entryValue] of Object.entries(value)) {\n if (typeof entryValue !== \"string\") {\n throw fail(`field \"env_set\" value for \"${key}\" must be a string`);\n }\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw fail(`field \"env_set\" key \"${key}\" is invalid`);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw fail(`field \"env_set\" key \"${key}\" is reserved for sandbox safety`);\n }\n envSet[key] = entryValue;\n }\n return Object.keys(envSet).length > 0 ? envSet : undefined;\n}\n\nfunction readJsonEntryEnvClear(\n entry: JsonRecord,\n fail: (message: string) => PmCliError,\n): string[] | undefined {\n const keys = readJsonEntryStringList(entry, \"env_clear\", fail);\n if (!keys) {\n return undefined;\n }\n for (const key of keys) {\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw fail(`field \"env_clear\" key \"${key}\" is invalid`);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw fail(\n `field \"env_clear\" key \"${key}\" is reserved for sandbox safety`,\n );\n }\n }\n return keys;\n}\n\nfunction readJsonEntryBoolean(\n entry: JsonRecord,\n key: string,\n fail: (message: string) => PmCliError,\n): boolean | undefined {\n if (!Object.hasOwn(entry, key)) {\n return undefined;\n }\n const value = entry[key];\n if (value === undefined) {\n return undefined;\n }\n if (typeof value !== \"boolean\") {\n throw fail(`field \"${key}\" must be a JSON boolean (true or false)`);\n }\n return value;\n}\n\nfunction readJsonEntryMinLines(\n entry: JsonRecord,\n fail: (message: string) => PmCliError,\n): number | undefined {\n if (!Object.hasOwn(entry, \"assert_stdout_min_lines\")) {\n return undefined;\n }\n const value = entry.assert_stdout_min_lines;\n if (value === undefined) {\n return undefined;\n }\n const parsed = readJsonEntryNumber(value, \"assert_stdout_min_lines\", fail);\n if (!Number.isInteger(parsed) || parsed < 0) {\n throw fail('field \"assert_stdout_min_lines\" must be an integer >= 0');\n }\n return parsed;\n}\n\nfunction readJsonEntryEqualsMap(\n entry: JsonRecord,\n fail: (message: string) => PmCliError,\n): Record<string, string> | undefined {\n if (!Object.hasOwn(entry, \"assert_json_field_equals\")) {\n return undefined;\n }\n const value = entry.assert_json_field_equals;\n if (value === undefined) {\n return undefined;\n }\n if (!isPlainObject(value)) {\n throw fail(\n 'field \"assert_json_field_equals\" must be a JSON object mapping field paths to expected values',\n );\n }\n const values: Record<string, string> = Object.create(null);\n for (const [key, entryValue] of Object.entries(value)) {\n if (key.trim().length === 0) {\n throw fail(\n 'field \"assert_json_field_equals\" keys must be non-empty field paths',\n );\n }\n if (\n typeof entryValue !== \"string\" &&\n typeof entryValue !== \"number\" &&\n typeof entryValue !== \"boolean\"\n ) {\n throw fail(\n `field \"assert_json_field_equals\" value for \"${key}\" must be a string, number, or boolean`,\n );\n }\n values[key] = String(entryValue);\n }\n return Object.keys(values).length > 0 ? values : undefined;\n}\n\nfunction readJsonEntryGteMap(\n entry: JsonRecord,\n fail: (message: string) => PmCliError,\n): Record<string, number> | undefined {\n if (!Object.hasOwn(entry, \"assert_json_field_gte\")) {\n return undefined;\n }\n const value = entry.assert_json_field_gte;\n if (value === undefined) {\n return undefined;\n }\n if (!isPlainObject(value)) {\n throw fail(\n 'field \"assert_json_field_gte\" must be a JSON object mapping field paths to numeric minimums',\n );\n }\n const values: Record<string, number> = Object.create(null);\n for (const [key, entryValue] of Object.entries(value)) {\n if (key.trim().length === 0) {\n throw fail(\n 'field \"assert_json_field_gte\" keys must be non-empty field paths',\n );\n }\n values[key] = readJsonEntryNumber(\n entryValue,\n `assert_json_field_gte.${key}`,\n fail,\n );\n }\n return Object.keys(values).length > 0 ? values : undefined;\n}\n\nfunction parseLinkedTestJsonEntry(\n rawEntry: unknown,\n label: string,\n optionName: string,\n): LinkedTest {\n const fail = (message: string): PmCliError =>\n new PmCliError(`${optionName} ${label} ${message}`, EXIT_CODE.USAGE);\n if (!isPlainObject(rawEntry)) {\n throw fail(\n `must be a JSON object with linked-test fields. Allowed keys: ${STRUCTURED_LINKED_TEST_KEYS.join(\", \")}.`,\n );\n }\n const entry = normalizeJsonEntryKeys(rawEntry, fail);\n const commandValue = readJsonEntryString(entry, \"command\", fail);\n const cmdAlias = readJsonEntryString(entry, \"cmd\", fail);\n if (\n commandValue !== undefined &&\n cmdAlias !== undefined &&\n commandValue !== cmdAlias\n ) {\n throw fail(\"command and cmd must match when both are provided\");\n }\n const command = commandValue ?? cmdAlias;\n if (command === undefined || command.trim().length === 0) {\n throw fail('requires a non-empty \"command\" string');\n }\n const pathValue = readJsonEntryString(entry, \"path\", fail);\n const pmContextModeValue = readJsonEntryString(\n entry,\n \"pm_context_mode\",\n fail,\n );\n if (\n pmContextModeValue !== undefined &&\n !(LINKED_TEST_PM_CONTEXT_MODE_VALUES as readonly string[]).includes(\n pmContextModeValue,\n )\n ) {\n throw fail(\n `field \"pm_context_mode\" must be one of: ${LINKED_TEST_PM_CONTEXT_MODE_VALUES.join(\", \")}`,\n );\n }\n const noteValue = readJsonEntryString(entry, \"note\", fail);\n return {\n command,\n path:\n pathValue !== undefined && pathValue.length > 0 ? pathValue : undefined,\n scope: readJsonEntryScope(entry, fail),\n timeout_seconds: readJsonEntryTimeoutSeconds(entry, fail),\n pm_context_mode: pmContextModeValue as LinkedTest[\"pm_context_mode\"],\n env_set: readJsonEntryEnvSet(entry, fail),\n env_clear: readJsonEntryEnvClear(entry, fail),\n shared_host_safe: readJsonEntryBoolean(entry, \"shared_host_safe\", fail),\n assert_stdout_contains: readJsonEntryStringList(\n entry,\n \"assert_stdout_contains\",\n fail,\n ),\n assert_stdout_regex: readJsonEntryRegexList(\n entry,\n \"assert_stdout_regex\",\n fail,\n ),\n assert_stderr_contains: readJsonEntryStringList(\n entry,\n \"assert_stderr_contains\",\n fail,\n ),\n assert_stderr_regex: readJsonEntryRegexList(\n entry,\n \"assert_stderr_regex\",\n fail,\n ),\n assert_stdout_min_lines: readJsonEntryMinLines(entry, fail),\n assert_json_field_equals: readJsonEntryEqualsMap(entry, fail),\n assert_json_field_gte: readJsonEntryGteMap(entry, fail),\n note:\n noteValue !== undefined && noteValue.trim().length > 0\n ? noteValue.trim()\n : undefined,\n };\n}\n\n/** Implements parse linked test json entries for the public runtime surface of this module. */\nexport function parseLinkedTestJsonEntries(\n raw: string,\n optionName: string,\n): LinkedTest[] {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(\n `${optionName} requires a JSON object or array of objects describing linked-test entries`,\n EXIT_CODE.USAGE,\n );\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed) as unknown;\n } catch (error: unknown) {\n throw new PmCliError(\n /* c8 ignore next -- JSON.parse only throws SyntaxError (an Error); String(error) fallback is defensive. */\n `${optionName} value is not valid JSON: ${error instanceof Error ? error.message : String(error)}. Provide a JSON object or array of objects, e.g. '{\"command\":\"node scripts/check.js --flag value, with commas\",\"timeout_seconds\":120}'.`,\n EXIT_CODE.USAGE,\n );\n }\n const entries = Array.isArray(parsed) ? parsed : [parsed];\n if (entries.length === 0) {\n throw new PmCliError(\n `${optionName} array must include at least one linked-test entry object`,\n EXIT_CODE.USAGE,\n );\n }\n return entries.map((entry, index) =>\n parseLinkedTestJsonEntry(\n entry,\n entries.length > 1 ? `entry ${index + 1}` : \"entry\",\n optionName,\n ),\n );\n}\n\n/** Public contract for test only linked test parsers, shared by SDK and presentation-layer consumers. */\nexport const _testOnlyLinkedTestParsers = {\n parseLinkedTestJsonEntry,\n};\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD;;;;;;;;;;;;;GAaG;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,GAAG,CAAC;IACpD,SAAS;IACT,gBAAgB;IAChB,aAAa;CACd,CAAC,CAAC;AACH,wGAAwG;AACxG,MAAM,CAAC,MAAM,4BAA4B,GAAG,0BAA0B,CAAC;AACvE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,QAAQ;IACR,SAAS;IACT,MAAM;CACE,CAAC;AAKX,0FAA0F;AAC1F,MAAM,UAAU,qBAAqB,CACnC,GAAuB,EACvB,UAAkB;IAElB,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,WAAW,GAAG,GAAG;SACpB,KAAK,CAAC,OAAO,CAAC;SACd,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;SAC5B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvC,IAAI,WA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MAAM,IAAI,UAAU,CAClB,GAAG,UAAU,2DAA2D,EACxE,SAAS,CAAC,KAAK,CAChB,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAClC,wBAAwB,CACtB,KAAK,EACL,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EACnD,UAAU,CACX,CACF,CAAC;AACJ,CAAC;AAED,yGAAyG;AACzG,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,wBAAwB;CACzB,CAAC","debugId":"070a3dbc-d028-5ce9-a1ed-41010c72d9ab"}
@@ -0,0 +1,92 @@
1
+ import type { GlobalOptions } from "../../core/shared/command-types.js";
2
+ import { type BackgroundLogStream, type BackgroundTestRunKind, type BackgroundTestRunStatus } from "../../core/test/background-runs.js";
3
+ /** Documents the start background run command options payload exchanged by command, SDK, and package integrations. */
4
+ export interface StartBackgroundRunCommandOptions {
5
+ /** Value that configures or reports kind for this contract. */
6
+ kind: BackgroundTestRunKind;
7
+ /** Value that configures or reports command args for this contract. */
8
+ commandArgs: string[];
9
+ /** Value that configures or reports target id for this contract. */
10
+ targetId?: string;
11
+ /** Value that configures or reports status filter for this contract. */
12
+ statusFilter?: string;
13
+ /** Value that configures or reports author for this contract. */
14
+ author?: string;
15
+ /** Value that configures or reports no extensions for this contract. */
16
+ noExtensions?: boolean;
17
+ }
18
+ /** Documents the start background run result payload exchanged by command, SDK, and package integrations. */
19
+ export interface StartBackgroundRunResult {
20
+ /** Value that configures or reports started for this contract. */
21
+ started: boolean;
22
+ /** Value that configures or reports duplicate of for this contract. */
23
+ duplicate_of?: string;
24
+ /** Value that configures or reports run for this contract. */
25
+ run: unknown;
26
+ }
27
+ /** Implements run start background run for the public runtime surface of this module. */
28
+ export declare function runStartBackgroundRun(options: StartBackgroundRunCommandOptions, global: GlobalOptions): Promise<StartBackgroundRunResult>;
29
+ /** Documents the test runs list command options payload exchanged by command, SDK, and package integrations. */
30
+ export interface TestRunsListCommandOptions {
31
+ /** Lifecycle state reported for status. */
32
+ status?: string;
33
+ /** Value that configures or reports limit for this contract. */
34
+ limit?: string;
35
+ }
36
+ /** Implements run test runs list for the public runtime surface of this module. */
37
+ export declare function runTestRunsList(options: TestRunsListCommandOptions, global: GlobalOptions): Promise<{
38
+ runs: unknown[];
39
+ count: number;
40
+ filters: {
41
+ status?: BackgroundTestRunStatus;
42
+ limit?: number;
43
+ };
44
+ }>;
45
+ /** Implements run test runs status for the public runtime surface of this module. */
46
+ export declare function runTestRunsStatus(runId: string, global: GlobalOptions): Promise<{
47
+ run: unknown;
48
+ health: unknown;
49
+ }>;
50
+ /** Documents the test runs logs command options payload exchanged by command, SDK, and package integrations. */
51
+ export interface TestRunsLogsCommandOptions {
52
+ /** Value that configures or reports stream for this contract. */
53
+ stream?: string;
54
+ /** Value that configures or reports tail for this contract. */
55
+ tail?: string;
56
+ }
57
+ /** Implements run test runs logs for the public runtime surface of this module. */
58
+ export declare function runTestRunsLogs(runId: string, options: TestRunsLogsCommandOptions, global: GlobalOptions): Promise<{
59
+ run: unknown;
60
+ stream: BackgroundLogStream;
61
+ tail: number;
62
+ stdout: string[];
63
+ stderr: string[];
64
+ }>;
65
+ /** Documents the test runs stop command options payload exchanged by command, SDK, and package integrations. */
66
+ export interface TestRunsStopCommandOptions {
67
+ /** Value that configures or reports force for this contract. */
68
+ force?: boolean;
69
+ }
70
+ /** Implements run test runs stop for the public runtime surface of this module. */
71
+ export declare function runTestRunsStop(runId: string, options: TestRunsStopCommandOptions, global: GlobalOptions): Promise<{
72
+ run: unknown;
73
+ signal_sent: "SIGTERM" | "SIGKILL" | "none";
74
+ }>;
75
+ /** Documents the test runs resume command options payload exchanged by command, SDK, and package integrations. */
76
+ export interface TestRunsResumeCommandOptions {
77
+ /** Value that configures or reports author for this contract. */
78
+ author?: string;
79
+ /** Value that configures or reports no extensions for this contract. */
80
+ noExtensions?: boolean;
81
+ }
82
+ /** Implements run test runs resume for the public runtime surface of this module. */
83
+ export declare function runTestRunsResume(runId: string, options: TestRunsResumeCommandOptions, global: GlobalOptions): Promise<{
84
+ resumed_from: string;
85
+ run: unknown;
86
+ }>;
87
+ /** Implements run test runs worker for the public runtime surface of this module. */
88
+ export declare function runTestRunsWorker(runId: string, global: GlobalOptions): Promise<{
89
+ id: string;
90
+ status: BackgroundTestRunStatus;
91
+ exit_code?: number;
92
+ }>;
@@ -0,0 +1,195 @@
1
+ /**
2
+ * @module sdk/test/runs
3
+ *
4
+ * Implements the pm test runs command surface and its agent-facing runtime behavior.
5
+ */
6
+
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2c42bfb9-c598-5a6e-bfff-0c073bb44205")}catch(e){}}();
8
+ import os from "node:os";
9
+ import { pathExists } from "../../core/fs/fs-utils.js";
10
+ import { EXIT_CODE } from "../../core/shared/constants.js";
11
+ import { PmCliError } from "../../core/shared/errors.js";
12
+ import { getBackgroundTestRunStatus, listBackgroundTestRuns, readBackgroundTestRunLogs, resumeBackgroundTestRun, runBackgroundTestRunWorker, spawnBackgroundTestRunWorker, startBackgroundTestRun, stopBackgroundTestRun, } from "../../core/test/background-runs.js";
13
+ import { getSettingsPath, resolveGlobalPmRoot, resolvePmRoot, } from "../../core/store/paths.js";
14
+ import { readSettings } from "../../core/store/settings.js";
15
+ import { parseLimit } from "../../core/shared/numeric-parsers.js";
16
+ const BACKGROUND_STATUS_VALUES = [
17
+ "queued",
18
+ "running",
19
+ "passed",
20
+ "failed",
21
+ "stopped",
22
+ "canceled",
23
+ ];
24
+ const BACKGROUND_STREAM_VALUES = [
25
+ "stdout",
26
+ "stderr",
27
+ "both",
28
+ ];
29
+ function normalizeStatus(value) {
30
+ if (value === undefined) {
31
+ return undefined;
32
+ }
33
+ const normalized = value.trim().toLowerCase();
34
+ if (BACKGROUND_STATUS_VALUES.includes(normalized)) {
35
+ return normalized;
36
+ }
37
+ throw new PmCliError(`Invalid --status value "${value}"`, EXIT_CODE.USAGE);
38
+ }
39
+ function normalizeStream(value) {
40
+ if (value === undefined || value.trim().length === 0) {
41
+ return "stderr";
42
+ }
43
+ const normalized = value.trim().toLowerCase();
44
+ if (BACKGROUND_STREAM_VALUES.includes(normalized)) {
45
+ return normalized;
46
+ }
47
+ throw new PmCliError(`Invalid --stream value "${value}"`, EXIT_CODE.USAGE);
48
+ }
49
+ function resolveWhoamiFallback() {
50
+ try {
51
+ const username = os.userInfo().username.trim();
52
+ if (username.length > 0) {
53
+ return username;
54
+ }
55
+ }
56
+ catch {
57
+ // Fall back to environment-derived attribution.
58
+ }
59
+ return undefined;
60
+ }
61
+ function resolveRequestedBy(author, fallback) {
62
+ const candidates = [
63
+ author,
64
+ process.env.PM_AUTHOR,
65
+ fallback,
66
+ process.env.USER,
67
+ process.env.LOGNAME,
68
+ process.env.USERNAME,
69
+ resolveWhoamiFallback(),
70
+ ];
71
+ for (const candidate of candidates) {
72
+ if (typeof candidate !== "string") {
73
+ continue;
74
+ }
75
+ const trimmed = candidate.trim();
76
+ if (trimmed.length > 0) {
77
+ return trimmed;
78
+ }
79
+ }
80
+ return "unknown";
81
+ }
82
+ async function ensureInitialized(pmRoot) {
83
+ if (!(await pathExists(getSettingsPath(pmRoot)))) {
84
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
85
+ }
86
+ }
87
+ /** Implements run start background run for the public runtime surface of this module. */
88
+ export async function runStartBackgroundRun(options, global) {
89
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
90
+ const globalPmRoot = resolveGlobalPmRoot(process.cwd());
91
+ await ensureInitialized(pmRoot);
92
+ const settings = await readSettings(pmRoot);
93
+ const requestedBy = resolveRequestedBy(options.author, settings.author_default);
94
+ const started = await startBackgroundTestRun({
95
+ pmRoot,
96
+ globalPmRoot,
97
+ kind: options.kind,
98
+ commandArgs: options.commandArgs,
99
+ requestedBy,
100
+ targetId: options.targetId,
101
+ statusFilter: options.statusFilter,
102
+ });
103
+ if (!started.started) {
104
+ return {
105
+ started: false,
106
+ duplicate_of: started.duplicate_of,
107
+ run: started.run,
108
+ };
109
+ }
110
+ const spawned = await spawnBackgroundTestRunWorker({
111
+ pmRoot,
112
+ runId: started.run.id,
113
+ noExtensions: options.noExtensions === true,
114
+ });
115
+ return {
116
+ started: true,
117
+ run: spawned,
118
+ };
119
+ }
120
+ /** Implements run test runs list for the public runtime surface of this module. */
121
+ export async function runTestRunsList(options, global) {
122
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
123
+ await ensureInitialized(pmRoot);
124
+ const status = normalizeStatus(options.status);
125
+ const limit = parseLimit(options.limit, "limit");
126
+ const runs = await listBackgroundTestRuns(pmRoot, { status, limit });
127
+ return {
128
+ runs,
129
+ count: runs.length,
130
+ filters: {
131
+ status,
132
+ limit,
133
+ },
134
+ };
135
+ }
136
+ /** Implements run test runs status for the public runtime surface of this module. */
137
+ export async function runTestRunsStatus(runId, global) {
138
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
139
+ await ensureInitialized(pmRoot);
140
+ const status = await getBackgroundTestRunStatus(pmRoot, runId);
141
+ return {
142
+ run: status.run,
143
+ health: status.health,
144
+ };
145
+ }
146
+ /** Implements run test runs logs for the public runtime surface of this module. */
147
+ export async function runTestRunsLogs(runId, options, global) {
148
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
149
+ await ensureInitialized(pmRoot);
150
+ const stream = normalizeStream(options.stream);
151
+ const tail = parseLimit(options.tail, "tail");
152
+ const logs = await readBackgroundTestRunLogs(pmRoot, runId, stream, tail);
153
+ return {
154
+ run: logs.run,
155
+ stream: logs.stream,
156
+ tail: logs.tail,
157
+ stdout: logs.stdout,
158
+ stderr: logs.stderr,
159
+ };
160
+ }
161
+ /** Implements run test runs stop for the public runtime surface of this module. */
162
+ export async function runTestRunsStop(runId, options, global) {
163
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
164
+ await ensureInitialized(pmRoot);
165
+ const stopped = await stopBackgroundTestRun(pmRoot, runId, options.force === true);
166
+ return {
167
+ run: stopped.run,
168
+ signal_sent: stopped.signal_sent,
169
+ };
170
+ }
171
+ /** Implements run test runs resume for the public runtime surface of this module. */
172
+ export async function runTestRunsResume(runId, options, global) {
173
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
174
+ await ensureInitialized(pmRoot);
175
+ const settings = await readSettings(pmRoot);
176
+ const requestedBy = resolveRequestedBy(options.author, settings.author_default);
177
+ const resumed = await resumeBackgroundTestRun(pmRoot, runId, requestedBy, options.noExtensions === true);
178
+ return {
179
+ resumed_from: runId,
180
+ run: resumed,
181
+ };
182
+ }
183
+ /** Implements run test runs worker for the public runtime surface of this module. */
184
+ export async function runTestRunsWorker(runId, global) {
185
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
186
+ await ensureInitialized(pmRoot);
187
+ const finished = await runBackgroundTestRunWorker(pmRoot, runId, global.noExtensions === true);
188
+ return {
189
+ id: finished.id,
190
+ status: finished.status,
191
+ exit_code: finished.exit_code,
192
+ };
193
+ }
194
+ //# sourceMappingURL=runs.js.map
195
+ //# debugId=2c42bfb9-c598-5a6e-bfff-0c073bb44205
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.js","sources":["sdk/test/runs.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/test/runs\n *\n * Implements the pm test runs command surface and its agent-facing runtime behavior.\n */\nimport os from \"node:os\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport {\n type BackgroundLogStream,\n type BackgroundTestRunKind,\n type BackgroundTestRunStatus,\n getBackgroundTestRunStatus,\n listBackgroundTestRuns,\n readBackgroundTestRunLogs,\n resumeBackgroundTestRun,\n runBackgroundTestRunWorker,\n spawnBackgroundTestRunWorker,\n startBackgroundTestRun,\n stopBackgroundTestRun,\n} from \"../../core/test/background-runs.js\";\nimport {\n getSettingsPath,\n resolveGlobalPmRoot,\n resolvePmRoot,\n} from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../../core/shared/numeric-parsers.js\";\n\nconst BACKGROUND_STATUS_VALUES: readonly BackgroundTestRunStatus[] = [\n \"queued\",\n \"running\",\n \"passed\",\n \"failed\",\n \"stopped\",\n \"canceled\",\n];\nconst BACKGROUND_STREAM_VALUES: readonly BackgroundLogStream[] = [\n \"stdout\",\n \"stderr\",\n \"both\",\n];\n\nfunction normalizeStatus(\n value: string | undefined,\n): BackgroundTestRunStatus | undefined {\n if (value === undefined) {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if ((BACKGROUND_STATUS_VALUES as readonly string[]).includes(normalized)) {\n return normalized as BackgroundTestRunStatus;\n }\n throw new PmCliError(`Invalid --status value \"${value}\"`, EXIT_CODE.USAGE);\n}\n\nfunction normalizeStream(value: string | undefined): BackgroundLogStream {\n if (value === undefined || value.trim().length === 0) {\n return \"stderr\";\n }\n const normalized = value.trim().toLowerCase();\n if ((BACKGROUND_STREAM_VALUES as readonly string[]).includes(normalized)) {\n return normalized as BackgroundLogStream;\n }\n throw new PmCliError(`Invalid --stream value \"${value}\"`, EXIT_CODE.USAGE);\n}\n\nfunction resolveWhoamiFallback(): string | undefined {\n try {\n const username = os.userInfo().username.trim();\n if (username.length > 0) {\n return username;\n }\n } catch {\n // Fall back to environment-derived attribution.\n }\n return undefined;\n}\n\nfunction resolveRequestedBy(\n author: string | undefined,\n fallback: string,\n): string {\n const candidates = [\n author,\n process.env.PM_AUTHOR,\n fallback,\n process.env.USER,\n process.env.LOGNAME,\n process.env.USERNAME,\n resolveWhoamiFallback(),\n ];\n for (const candidate of candidates) {\n if (typeof candidate !== \"string\") {\n continue;\n }\n const trimmed = candidate.trim();\n if (trimmed.length > 0) {\n return trimmed;\n }\n }\n return \"unknown\";\n}\n\nasync function ensureInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n}\n\n/** Documents the start background run command options payload exchanged by command, SDK, and package integrations. */\nexport interface StartBackgroundRunCommandOptions {\n /** Value that configures or reports kind for this contract. */\n kind: BackgroundTestRunKind;\n /** Value that configures or reports command args for this contract. */\n commandArgs: string[];\n /** Value that configures or reports target id for this contract. */\n targetId?: string;\n /** Value that configures or reports status filter for this contract. */\n statusFilter?: string;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Value that configures or reports no extensions for this contract. */\n noExtensions?: boolean;\n}\n\n/** Documents the start background run result payload exchanged by command, SDK, and package integrations. */\nexport interface StartBackgroundRunResult {\n /** Value that configures or reports started for this contract. */\n started: boolean;\n /** Value that configures or reports duplicate of for this contract. */\n duplicate_of?: string;\n /** Value that configures or reports run for this contract. */\n run: unknown;\n}\n\n/** Implements run start background run for the public runtime surface of this module. */\nexport async function runStartBackgroundRun(\n options: StartBackgroundRunCommandOptions,\n global: GlobalOptions,\n): Promise<StartBackgroundRunResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const globalPmRoot = resolveGlobalPmRoot(process.cwd());\n await ensureInitialized(pmRoot);\n const settings = await readSettings(pmRoot);\n const requestedBy = resolveRequestedBy(\n options.author,\n settings.author_default,\n );\n const started = await startBackgroundTestRun({\n pmRoot,\n globalPmRoot,\n kind: options.kind,\n commandArgs: options.commandArgs,\n requestedBy,\n targetId: options.targetId,\n statusFilter: options.statusFilter,\n });\n if (!started.started) {\n return {\n started: false,\n duplicate_of: started.duplicate_of,\n run: started.run,\n };\n }\n const spawned = await spawnBackgroundTestRunWorker({\n pmRoot,\n runId: started.run.id,\n noExtensions: options.noExtensions === true,\n });\n return {\n started: true,\n run: spawned,\n };\n}\n\n/** Documents the test runs list command options payload exchanged by command, SDK, and package integrations. */\nexport interface TestRunsListCommandOptions {\n /** Lifecycle state reported for status. */\n status?: string;\n /** Value that configures or reports limit for this contract. */\n limit?: string;\n}\n\n/** Implements run test runs list for the public runtime surface of this module. */\nexport async function runTestRunsList(\n options: TestRunsListCommandOptions,\n global: GlobalOptions,\n): Promise<{\n runs: unknown[];\n count: number;\n filters: {\n status?: BackgroundTestRunStatus;\n limit?: number;\n };\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const status = normalizeStatus(options.status);\n const limit = parseLimit(options.limit, \"limit\");\n const runs = await listBackgroundTestRuns(pmRoot, { status, limit });\n return {\n runs,\n count: runs.length,\n filters: {\n status,\n limit,\n },\n };\n}\n\n/** Implements run test runs status for the public runtime surface of this module. */\nexport async function runTestRunsStatus(\n runId: string,\n global: GlobalOptions,\n): Promise<{\n run: unknown;\n health: unknown;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const status = await getBackgroundTestRunStatus(pmRoot, runId);\n return {\n run: status.run,\n health: status.health,\n };\n}\n\n/** Documents the test runs logs command options payload exchanged by command, SDK, and package integrations. */\nexport interface TestRunsLogsCommandOptions {\n /** Value that configures or reports stream for this contract. */\n stream?: string;\n /** Value that configures or reports tail for this contract. */\n tail?: string;\n}\n\n/** Implements run test runs logs for the public runtime surface of this module. */\nexport async function runTestRunsLogs(\n runId: string,\n options: TestRunsLogsCommandOptions,\n global: GlobalOptions,\n): Promise<{\n run: unknown;\n stream: BackgroundLogStream;\n tail: number;\n stdout: string[];\n stderr: string[];\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const stream = normalizeStream(options.stream);\n const tail = parseLimit(options.tail, \"tail\");\n const logs = await readBackgroundTestRunLogs(pmRoot, runId, stream, tail);\n return {\n run: logs.run,\n stream: logs.stream,\n tail: logs.tail,\n stdout: logs.stdout,\n stderr: logs.stderr,\n };\n}\n\n/** Documents the test runs stop command options payload exchanged by command, SDK, and package integrations. */\nexport interface TestRunsStopCommandOptions {\n /** Value that configures or reports force for this contract. */\n force?: boolean;\n}\n\n/** Implements run test runs stop for the public runtime surface of this module. */\nexport async function runTestRunsStop(\n runId: string,\n options: TestRunsStopCommandOptions,\n global: GlobalOptions,\n): Promise<{\n run: unknown;\n signal_sent: \"SIGTERM\" | \"SIGKILL\" | \"none\";\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const stopped = await stopBackgroundTestRun(\n pmRoot,\n runId,\n options.force === true,\n );\n return {\n run: stopped.run,\n signal_sent: stopped.signal_sent,\n };\n}\n\n/** Documents the test runs resume command options payload exchanged by command, SDK, and package integrations. */\nexport interface TestRunsResumeCommandOptions {\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Value that configures or reports no extensions for this contract. */\n noExtensions?: boolean;\n}\n\n/** Implements run test runs resume for the public runtime surface of this module. */\nexport async function runTestRunsResume(\n runId: string,\n options: TestRunsResumeCommandOptions,\n global: GlobalOptions,\n): Promise<{\n resumed_from: string;\n run: unknown;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const settings = await readSettings(pmRoot);\n const requestedBy = resolveRequestedBy(\n options.author,\n settings.author_default,\n );\n const resumed = await resumeBackgroundTestRun(\n pmRoot,\n runId,\n requestedBy,\n options.noExtensions === true,\n );\n return {\n resumed_from: runId,\n run: resumed,\n };\n}\n\n/** Implements run test runs worker for the public runtime surface of this module. */\nexport async function runTestRunsWorker(\n runId: string,\n global: GlobalOptions,\n): Promise<{\n id: string;\n status: BackgroundTestRunStatus;\n exit_code?: number;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const finished = await runBackgroundTestRunWorker(\n pmRoot,\n runId,\n global.noExtensions === true,\n );\n return {\n id: finished.id,\n status: finished.status,\n exit_code: finished.exit_code,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAIL,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAElE,MAAM,wBAAwB,GAAuC;IACnE,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,UAAU;CACX,CAAC;AACF,MAAM,wBAAwB,GAAmC;IAC/D,QAAQ;IACR,QAAQ;IACR,MAAM;CACP,CAAC;AAEF,SAAS,eAAe,CACtB,KAAyB;IAEzB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAK,wBAA8C,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACzE,OAAO,UAAqC,CAAC;IAC/C,CAAC;IACD,MAAM,IAAI,UAAU,CAAC,2BAA2B,KAAK,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;AAC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,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,kBAAkB,CACpC,OAAO,CAAC,MAAM,EACd,QAAQ,CAAC,cAAc,CACxB,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,uBAAuB,CAC3C,MAAM,EACN,KAAK,EACL,WAAW,EACX,OAAO,CAAC,YAAY,KAAK,IAAI,CAC9B,CAAC;IACF,OAAO;QACL,YAAY,EAAE,KAAK;QACnB,GAAG,EAAE,OAAO;KACb,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAa,EACb,MAAqB;IAMrB,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,MAAM,0BAA0B,CAC/C,MAAM,EACN,KAAK,EACL,MAAM,CAAC,YAAY,KAAK,IAAI,CAC7B,CAAC;IACF,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,EAAE;QACf,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,SAAS,EAAE,QAAQ,CAAC,SAAS;KAC9B,CAAC;AACJ,CAAC","debugId":"2c42bfb9-c598-5a6e-bfff-0c073bb44205"}
@@ -137,6 +137,7 @@ pm release <item-id>
137
137
  | Agent plan read | `pm plan show <plan-id> --depth brief` (or `--fields id,title,steps_summary`) |
138
138
  | Materialize plan steps | `pm plan materialize <plan-id> --steps plan-step-002 --materialize-type Task` |
139
139
  | Dependencies | `pm deps <id> --format tree` |
140
+ | Graph queries | `pm graph successors <id> --limit 20` (also `ancestors`, `paths`, `impact`, `analyze`, `audit`, `communities`, `redundancy`, `dominators`, `plan`) |
140
141
  | Bulk update by id allowlist | `pm update-many --ids pm-a,pm-b --priority 1 --dry-run` (preview, then drop `--dry-run`) |
141
142
  | Audited bulk close (sprint closeout) | `pm close-many --filter-sprint <s> --reason "<text>" --dry-run` (full `pm close` semantics per item; `--rollback <id>` to undo) |
142
143
  | Local docs routing | `pm install guide-shell --project`, then `pm guide <topic>` |
package/docs/COMMANDS.md CHANGED
@@ -548,12 +548,30 @@ pm files <id> --add-glob "src/cli/**/*.ts"
548
548
  pm docs <id> --add path=docs/COMMANDS.md,note="public command docs"
549
549
  pm docs <id> --add docs/COMMANDS.md --note "public command docs"
550
550
  pm deps <id> --format tree
551
+ pm deps <id> --format context --direction both --kind blocked_by,parent --token-budget 800
551
552
  ```
552
553
 
553
- Linked files and docs keep reviews reproducible. `deps` is read-only and projects item relationships. The standalone `--note <text>` flag annotates every link added by `--add`/`--add-glob` in the same invocation (a per-entry embedded `note=` wins); `--note` without an add is a usage error.
554
+ Linked files and docs keep reviews reproducible. `deps` is read-only and projects item relationships. `--format context` returns one bounded, explainable relationship packet: a counts-first summary, per-node `role`/`via`/`reasons`, root evidence pointers, enumerated `missing_references` with active-versus-legacy classification, `meta.completeness`, and cursor continuation; `--direction`, repeatable or comma-separated `--kind`, `--max-depth`, `--node-limit`, `--edge-limit`, `--token-budget`, and `--cursor` control the traversal (see [Relationship Graph](RELATIONSHIP_GRAPH.md)). `--edge-limit` caps both returned graph edges and enumerated `missing_references`; `missing_reference_count` retains the total when rows are omitted. The standalone `--note <text>` flag annotates every link added by `--add`/`--add-glob` in the same invocation (a per-entry embedded `note=` wins); `--note` without an add is a usage error.
554
555
 
555
556
  Structured key/value forms reject unrecognized keys with an `Allowed keys: …` error (matching `test --add`), so a typoed key (`lable=` instead of `label=`) fails fast instead of being silently dropped: `--add`/`--file`/`--doc` accept `path,scope,note`; `--add-glob` accepts `pattern,glob,path,scope,note`; `--remove` accepts `path`; `--migrate` accepts `from,to`; `--dep` accepts `id,kind,type,author,created_at` (plus `source_kind` on update); `--reminder` accepts `at,date,text,title`; `--event` accepts `start,date,end,duration,title,description,location,timezone,all_day` and the `recur_*` recurrence keys. Bare values (`--add src/cli/main.ts`) skip key validation.
556
557
 
558
+ ## Graph Queries
559
+
560
+ ```bash
561
+ pm graph ancestors <id> --max-depth 3
562
+ pm graph successors <id> --kind blocked_by --limit 20
563
+ pm graph paths <id> <target> --direction outgoing --max-paths 5
564
+ pm graph impact <id> --direction incoming --summary
565
+ pm graph analyze --limit 10
566
+ pm graph audit --sample 5 --exempt-isolate pm-root
567
+ pm graph communities --kind blocked_by --limit 5
568
+ pm graph redundancy --max-depth 6 --limit 20
569
+ pm graph dominators <id> --direction outgoing --limit 10
570
+ pm graph plan --sample 5 --limit 20
571
+ ```
572
+
573
+ `graph` is read-only and answers workspace-wide relationship questions through the public SDK graph toolkit. `ancestors`/`descendants` walk registered hierarchy kinds, `predecessors`/`successors` walk order-bearing kinds, `paths` enumerates bounded simple paths between two items with per-edge kinds, and `impact` reports the bounded blast radius with an explaining path per affected item. `analyze` returns workspace execution analytics (topological layers, prerequisite frontier, critical path, genuine ordering cycles) plus knowledge-graph structure (components, orphans, hubs), and `audit` runs the policy-aware governance audit with counts-first findings, severities, and bounded evidence samples. Audit severity gates on lifecycle: ordering cycles and duplicated edge spellings confined to closed/canceled items downgrade to informational `legacy_ordering_cycle`/`legacy_duplicate_edge` findings (history debt, never repaired ad hoc), while `ordering_cycle` errors and `duplicate_edge` findings are reserved for subjects touching at least one active item; `duplicate_edge` reports parallel same-family spellings — including reciprocal inverse pairs such as `A blocked_by B` plus `B blocks A` — that transitive-reduction redundancy deliberately cannot see. `communities` clusters the undirected structure with deterministic label propagation (reporting `iterations` and `converged`), `redundancy` finds stored edges implied by a longer path of the same semantic family (`blocked_by`/`blocks` and hierarchy spellings witness each other, each row carrying its witness path), and `dominators` reports the structural bottlenecks of one item's reachable subgraph — nodes every path from the root must pass through, ranked by how much work they gate (`dominated_count`). `plan` derives a dry-run remediation plan from the audit plus the redundancy scan: exact `remove`/`retype`/`supersede`/`waive`/`investigate` proposals with per-step policy code, evidence, rationale, and confidence — nothing is ever applied automatically and no proposal invents an edge. Every envelope is counts-first with explicit `truncated`, `cost` (visited nodes, inspected edges), and `cache` (workspace fingerprint plus assembly/result hit-or-miss) metadata; repeated identical queries in long-lived hosts such as the MCP server are answered from a fingerprint-keyed snapshot cache that invalidates on any relationship-relevant item change. `--summary` suppresses row collections entirely. `--kind` accepts registered relationship kinds (repeatable or comma-separated) and fails fast on unknown values (`redundancy` additionally requires directed ordering or hierarchy kinds); `--after` resumes hierarchy/ordering walks after a previously returned node id (see [Relationship Graph](RELATIONSHIP_GRAPH.md)).
574
+
557
575
  ## Linked Tests
558
576
 
559
577
  ```bash
@@ -67,15 +67,22 @@ Every analytics result identifies its algorithm and edge family. Exact algorithm
67
67
 
68
68
  ## Bounded agent context
69
69
 
70
- `buildRelationshipContext` joins caller-owned compact node details with the graph kernel in one request. The packet includes the root, shortest-distance related nodes, semantic selection reasons (`prerequisite`, `dependent`, `ancestor`, `descendant`, `provenance`, or bounded reachability), root evidence pointers, included edges, explicit work counts, token accounting, omitted counts, and an opaque continuation cursor.
70
+ `buildRelationshipContext` joins caller-owned compact node details with the graph kernel in one request. The packet opens with a counts-first `summary` (root identity and status, root-incident edge counts per semantic family, discovered/returned/omitted node and edge counts, evidence count, and a continuation marker) followed by the root, shortest-distance related nodes, included edges, root evidence pointers, and the cost envelope.
71
+
72
+ Every returned node is explainable: `role` names its semantic family (`prerequisite`, `dependent`, `ancestor`, `descendant`, `provenance`, or `related`), `via` names the node through which bounded traversal first discovered it, and `reasons` lists the direct classifications for depth-1 nodes or a `"<role> via <node> (depth N)"` chain explanation for deeper nodes. When a node matches several families, `role` picks the deterministic priority order `prerequisite > dependent > ancestor > descendant > provenance > related`.
73
+
74
+ `meta.completeness` reports result quality: the exact in-memory kernel emits `complete` or `truncated`, and the contract reserves `sampled`, `approximate`, `stale_index`, and `redacted` for index-backed or policy-filtered providers so consumers can branch on one field.
71
75
 
72
76
  Node, edge, depth, kind, direction, and token bounds are independent. The cursor fingerprint covers semantic filters and traversal shape, so it is rejected when reused for a different root or query. Output remains a plain object suitable for TOON, JSON, JSONL, MCP, or a custom UI; adapters own rendering and do not reimplement traversal.
73
77
 
74
- The native adapter is `pm deps <id> --format context`. It is also available through `PmClient.deps`, `runAction({ action: "deps" })`, and the MCP `pm_deps` tool. `--max-depth`, `--node-limit`, `--edge-limit`, `--token-budget`, and `--cursor` map directly to the public SDK context options; `--summary` keeps only counts. Tree and graph formats remain compatible.
78
+ The native adapter is `pm deps <id> --format context`. It is also available through `PmClient.deps`, `runAction({ action: "deps" })`, and the MCP `pm_deps` tool. `--max-depth`, `--node-limit`, `--edge-limit`, `--token-budget`, `--cursor`, `--direction`, and repeatable or comma-separated `--kind` map directly to the public SDK context options; `--summary` keeps only counts. Unknown `--kind` values fail fast with the registered-kind list instead of silently matching nothing. Tree and graph formats remain compatible.
79
+
80
+ The context result also enumerates broken references instead of reporting a bare count: `missing_count` counts missing nodes reachable within the same bounded traversal that produced the packet (so it agrees with tree/graph semantics for equal traversal parameters and is documented by `missing_scope: "traversal"`), and `missing_references` lists each dangling declaration inside the packet with its declaring holder, dangling target, kind, source surface, and `legacy_terminal` classification so agents can separate repairable typos on active items from ignorable historical debt. `--edge-limit` caps both returned graph edges and enumerated missing-reference rows; `missing_reference_count` preserves the untruncated declaration total. The root's linked files, tests, docs, and annotation counts are promoted into `evidence` as bounded pointers.
75
81
 
76
82
  ```bash
77
83
  pm deps pm-example --format context --max-depth 3 \
78
- --node-limit 20 --edge-limit 40 --token-budget 800
84
+ --node-limit 20 --edge-limit 40 --token-budget 800 \
85
+ --direction both --kind blocked_by,parent
79
86
  ```
80
87
 
81
88
  ```ts
@@ -102,6 +109,95 @@ const packet = buildRelationshipContext(
102
109
  );
103
110
  ```
104
111
 
112
+ ## Semantic traversal and governance
113
+
114
+ The `@unbrained/pm-cli/sdk` barrel exports registry-aware traversal primitives
115
+ for domain packages that need more than generic adjacency:
116
+
117
+ - `hierarchyAncestors` and `hierarchyDescendants` follow only hierarchy kinds
118
+ and honor each kind's declared parent endpoint.
119
+ - `orderingPredecessors` and `orderingSuccessors` follow only order-bearing
120
+ kinds and honor declared precedence, so inverse spellings agree.
121
+ - `enumerateRelationshipPaths` returns bounded simple paths with edge evidence,
122
+ cost metadata, cancellation, direction/kind filters, and explicit truncation.
123
+
124
+ All semantic walks are breadth-first and deterministic. `limit`, `maxDepth`,
125
+ and `after` provide bounded continuation for hierarchy and ordering walks;
126
+ path enumeration separately bounds returned paths and expanded partial paths.
127
+ Unknown kinds and cursors fail fast instead of silently degrading context.
128
+
129
+ `assembleWorkspaceRelationshipGraph` is the shared normalization seam for
130
+ dependency-shaped workspaces. It folds parent links, the legacy scalar
131
+ `blocked_by`, and structured dependency edges into one graph, materializes
132
+ missing endpoints as explainable placeholder nodes, and returns active versus
133
+ terminal dangling-reference partitions. Domain adapters pass their
134
+ `RelationshipKindRegistry` as the optional third argument so custom VCS,
135
+ company, or package-defined edges survive assembly with their registered
136
+ semantics. `auditWorkspaceRelationshipGraph`
137
+ consumes that assembly and emits counts-first findings for active/terminal
138
+ missing references, retired sentinels, ordering cycles, stale lifecycle blocks,
139
+ and sparse or isolated active nodes. Findings include stable codes, severity,
140
+ bounded deterministic samples, truncation, policy text, and safe remediation;
141
+ the audit never invents an edge. Explicit isolate exemptions suppress policy
142
+ findings without changing structural coverage metrics.
143
+
144
+ ```ts
145
+ import {
146
+ assembleWorkspaceRelationshipGraph,
147
+ auditWorkspaceRelationshipGraph,
148
+ orderingPredecessors,
149
+ } from "@unbrained/pm-cli/sdk";
150
+
151
+ const assembly = assembleWorkspaceRelationshipGraph(items, isTerminalStatus);
152
+ const prerequisites = orderingPredecessors(assembly.graph, "deploy", {
153
+ limit: 20,
154
+ maxDepth: 4,
155
+ });
156
+ const governance = auditWorkspaceRelationshipGraph(assembly, {
157
+ isTerminal: isTerminalStatus,
158
+ exemptIsolates: ["company-root"],
159
+ maxSampleSize: 25,
160
+ });
161
+ ```
162
+
163
+ The three layers are intentionally separate: assembly owns storage-shape
164
+ normalization, traversal owns semantic graph algorithms, and governance owns
165
+ policy findings. A VCS, company operating model, digital twin, or other
166
+ non-project domain can replace the assembly adapter while reusing the same
167
+ registry, traversal, event, context, and audit contracts.
168
+
169
+ The native workspace adapter is `pm graph <subcommand>`, also available as
170
+ `PmClient.graph`, `runAction({ action: "graph" })`, and the MCP `pm_graph`
171
+ tool. `ancestors`/`descendants`/`predecessors`/`successors` expose the
172
+ semantic walks, `paths` exposes bounded simple-path enumeration, `impact`
173
+ exposes reverse-reachability blast radius from `analyzeGraphImpact`,
174
+ `analyze` combines `analyzeRelationshipExecution` and `analyzeKnowledgeGraph`
175
+ into one counts-first workspace projection, and `audit` runs
176
+ `auditWorkspaceRelationshipGraph` with `--sample` and `--exempt-isolate`
177
+ policy controls. `communities` exposes `detectRelationshipCommunities`
178
+ (deterministic asynchronous label propagation with lexicographic
179
+ tie-breaking), `redundancy` exposes `findRedundantRelationshipEdges`
180
+ (transitive-reduction scan over ordering and hierarchy families in semantic
181
+ orientation, each finding carrying a bounded witness path), and `dominators`
182
+ exposes `computeRelationshipDominators` (Cooper–Harvey–Kennedy immediate
183
+ dominators over the root's reachable subgraph, ranking structural
184
+ bottlenecks by gated work), and `plan` exposes `planRelationshipRemediation`
185
+ (dry-run remediation proposals derived from audit findings and witnessed
186
+ redundancy rows, each carrying an exact operation, policy code, evidence,
187
+ rationale, and confidence — never auto-applied). The audit gates finding
188
+ severity on lifecycle: contradictions confined to terminal items report as
189
+ informational `legacy_ordering_cycle`/`legacy_duplicate_edge` history debt,
190
+ while `ordering_cycle` errors and `duplicate_edge` findings require at least
191
+ one active subject; `duplicate_edge` covers parallel same-family spellings,
192
+ reciprocal inverse pairs included, which transitive-reduction redundancy
193
+ deliberately skips. All subcommands resolve the workspace assembly through
194
+ the shared fingerprint-keyed graph cache (`WorkspaceGraphCache`): the
195
+ fingerprint digests every relationship-relevant item field, so unchanged
196
+ workspaces in long-lived hosts reuse the assembled graph and memoized query
197
+ results, and every envelope reports `cache` hit/miss observability next to
198
+ its explicit `truncated` and `cost` metadata. Ids resolve
199
+ case-insensitively; `--summary` returns envelopes without row collections.
200
+
105
201
  ## Compatibility and migration
106
202
 
107
203
  Aliases normalize at registry boundaries; stored values are not silently rewritten. Imports must carry or select a compatible registry version. Federation merges definitions before edges and rejects identifier or alias collisions. Rollback removes the custom definition and its derived index only after application-owned edges have been exported or superseded; immutable history is retained.