@unbrained/pm-cli 2026.7.16 → 2026.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (620) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +30 -2
  3. package/CONTRIBUTING.md +2 -2
  4. package/dist/cli/bootstrap-args.d.ts +2 -115
  5. package/dist/cli/bootstrap-args.js +4 -831
  6. package/dist/cli/bootstrap-args.js.map +1 -1
  7. package/dist/cli/commands/close.d.ts +1 -1
  8. package/dist/cli/commands/close.js +3 -3
  9. package/dist/cli/commands/close.js.map +1 -1
  10. package/dist/cli/commands/completion.js +47 -5
  11. package/dist/cli/commands/completion.js.map +1 -1
  12. package/dist/cli/commands/context.d.ts +2 -2
  13. package/dist/cli/commands/context.js +42 -28
  14. package/dist/cli/commands/context.js.map +1 -1
  15. package/dist/cli/commands/contracts.js +5 -3
  16. package/dist/cli/commands/contracts.js.map +1 -1
  17. package/dist/cli/commands/eval.d.ts +4 -64
  18. package/dist/cli/commands/eval.js +4 -153
  19. package/dist/cli/commands/eval.js.map +1 -1
  20. package/dist/cli/commands/graph.d.ts +7 -0
  21. package/dist/cli/commands/graph.js +11 -0
  22. package/dist/cli/commands/graph.js.map +1 -0
  23. package/dist/cli/commands/index.d.ts +1 -0
  24. package/dist/cli/commands/index.js +3 -2
  25. package/dist/cli/commands/index.js.map +1 -1
  26. package/dist/cli/commands/linked-test-entry.d.ts +6 -6
  27. package/dist/cli/commands/linked-test-entry.js +4 -65
  28. package/dist/cli/commands/linked-test-entry.js.map +1 -1
  29. package/dist/cli/commands/linked-test-parsers.d.ts +3 -45
  30. package/dist/cli/commands/linked-test-parsers.js +4 -516
  31. package/dist/cli/commands/linked-test-parsers.js.map +1 -1
  32. package/dist/cli/commands/list.d.ts +3 -210
  33. package/dist/cli/commands/list.js +4 -1068
  34. package/dist/cli/commands/list.js.map +1 -1
  35. package/dist/cli/commands/next.d.ts +1 -1
  36. package/dist/cli/commands/next.js +3 -3
  37. package/dist/cli/commands/next.js.map +1 -1
  38. package/dist/cli/commands/search.d.ts +3 -464
  39. package/dist/cli/commands/search.js +4 -2236
  40. package/dist/cli/commands/search.js.map +1 -1
  41. package/dist/cli/commands/stats.d.ts +6 -66
  42. package/dist/cli/commands/stats.js +4 -157
  43. package/dist/cli/commands/stats.js.map +1 -1
  44. package/dist/cli/commands/telemetry.d.ts +6 -14
  45. package/dist/cli/commands/telemetry.js +4 -349
  46. package/dist/cli/commands/telemetry.js.map +1 -1
  47. package/dist/cli/commands/test-all.d.ts +6 -95
  48. package/dist/cli/commands/test-all.js +4 -439
  49. package/dist/cli/commands/test-all.js.map +1 -1
  50. package/dist/cli/commands/test-runs.d.ts +6 -92
  51. package/dist/cli/commands/test-runs.js +4 -189
  52. package/dist/cli/commands/test-runs.js.map +1 -1
  53. package/dist/cli/commands/test.d.ts +6 -244
  54. package/dist/cli/commands/test.js +4 -1780
  55. package/dist/cli/commands/test.js.map +1 -1
  56. package/dist/cli/commands/update-many.d.ts +15 -29
  57. package/dist/cli/commands/update-many.js +355 -259
  58. package/dist/cli/commands/update-many.js.map +1 -1
  59. package/dist/cli/main.js +141 -133
  60. package/dist/cli/main.js.map +1 -1
  61. package/dist/cli/register-list-query.js +49 -7
  62. package/dist/cli/register-list-query.js.map +1 -1
  63. package/dist/cli/register-mutation.js +7 -3
  64. package/dist/cli/register-mutation.js.map +1 -1
  65. package/dist/cli/search-refresh.js +4 -9
  66. package/dist/cli/search-refresh.js.map +1 -1
  67. package/dist/cli/shared-parsers.d.ts +6 -9
  68. package/dist/cli/shared-parsers.js +4 -37
  69. package/dist/cli/shared-parsers.js.map +1 -1
  70. package/dist/cli/telemetry-flush.js +4 -4
  71. package/dist/cli/telemetry-flush.js.map +1 -1
  72. package/dist/cli-bundle/bundle-manifest.json +334 -326
  73. package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js → append-5YF3TO7I.js} +5 -5
  74. package/dist/cli-bundle/chunks/append-JHO5K6RP.js +11 -0
  75. package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js → chunk-2BX74BAS.js} +3 -3
  76. package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js → chunk-2CXL335K.js} +3 -3
  77. package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js → chunk-2FUOXSRN.js} +4 -4
  78. package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js → chunk-2IPNL3DR.js} +3 -3
  79. package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js → chunk-2XOSFSTH.js} +5 -5
  80. package/dist/cli-bundle/chunks/{chunk-UFXU44HV.js → chunk-35FHWD4C.js} +6 -6
  81. package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js.map → chunk-35FHWD4C.js.map} +1 -7
  82. package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js → chunk-37DRDP2B.js} +5 -5
  83. package/dist/cli-bundle/chunks/{chunk-BKVG6XOA.js → chunk-3CUQZNQ6.js} +67 -509
  84. package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js.map +7 -0
  85. package/dist/cli-bundle/chunks/chunk-3QDR6ZLU.js +800 -0
  86. package/dist/cli-bundle/chunks/chunk-3QDR6ZLU.js.map +7 -0
  87. package/dist/cli-bundle/chunks/{chunk-5JLUII3O.js → chunk-43UMFKCK.js} +321 -240
  88. package/dist/cli-bundle/chunks/chunk-43UMFKCK.js.map +1 -0
  89. package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js → chunk-47HXN6RX.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js → chunk-5HGZKQUL.js} +4 -4
  91. package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js → chunk-5UKQLQM2.js} +2 -2
  92. package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js → chunk-633PKXLT.js} +3 -3
  93. package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js → chunk-646MQXFW.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js → chunk-66MKH7SZ.js} +4 -4
  95. package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js → chunk-67RO3H4N.js} +4 -4
  96. package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js → chunk-6DYOZS6C.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js → chunk-6O44IN44.js} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-5ZSLZLDN.js → chunk-6VHUGVNP.js} +608 -456
  99. package/dist/cli-bundle/chunks/chunk-6VHUGVNP.js.map +1 -0
  100. package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js → chunk-74FKFFXO.js} +2 -2
  101. package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js → chunk-7H5NNCJ5.js} +4 -4
  102. package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js → chunk-7R6UIHYY.js} +75 -5
  103. package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js.map → chunk-7R6UIHYY.js.map} +1 -1
  104. package/dist/cli-bundle/chunks/{chunk-3S5QVM5H.js → chunk-7UCY6DR5.js} +193 -22
  105. package/dist/cli-bundle/chunks/chunk-7UCY6DR5.js.map +1 -0
  106. package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js → chunk-ADXDCAKP.js} +16 -7
  107. package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js.map → chunk-ADXDCAKP.js.map} +1 -1
  108. package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js → chunk-AFGKSHAM.js} +4 -4
  109. package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js → chunk-ARGDWQ4J.js} +2 -2
  110. package/dist/cli-bundle/chunks/{chunk-XXXF6PAQ.js → chunk-AXRT7K5V.js} +83 -62
  111. package/dist/cli-bundle/chunks/chunk-AXRT7K5V.js.map +7 -0
  112. package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js → chunk-B57RJHBZ.js} +4 -4
  113. package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js → chunk-BAP7G3N2.js} +2 -2
  114. package/dist/cli-bundle/chunks/{chunk-NLDFBC6J.js → chunk-BDA35QG5.js} +35 -5
  115. package/dist/cli-bundle/chunks/chunk-BDA35QG5.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js → chunk-BIRYX32V.js} +3 -3
  117. package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js → chunk-BVLOMU6O.js} +2 -2
  118. package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js → chunk-CKX4WOPC.js} +2 -2
  119. package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js → chunk-D52ZN3BF.js} +2 -2
  120. package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js → chunk-D53RTYVI.js} +4 -4
  121. package/dist/cli-bundle/chunks/{chunk-ODALILG3.js → chunk-D5XHO4Q7.js} +2 -2
  122. package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js → chunk-DDFGYUCQ.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js → chunk-DG2EQRIH.js} +4 -4
  124. package/dist/cli-bundle/chunks/{chunk-J6364LFM.js → chunk-DHNG452T.js} +9 -18
  125. package/dist/cli-bundle/chunks/{chunk-J6364LFM.js.map → chunk-DHNG452T.js.map} +1 -1
  126. package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js → chunk-E4FXM2XB.js} +77 -7
  127. package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js.map → chunk-E4FXM2XB.js.map} +1 -1
  128. package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js → chunk-EHJFUOXL.js} +3 -3
  129. package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js → chunk-EWIT5WIC.js} +7 -7
  130. package/dist/cli-bundle/chunks/chunk-EX7OQT3Y.js +783 -0
  131. package/dist/cli-bundle/chunks/chunk-EX7OQT3Y.js.map +1 -0
  132. package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js → chunk-EY7ZE3TG.js} +3 -3
  133. package/dist/cli-bundle/chunks/{chunk-ILX33QXL.js → chunk-F3VC3GOV.js} +669 -472
  134. package/dist/cli-bundle/chunks/chunk-F3VC3GOV.js.map +7 -0
  135. package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js → chunk-FHOBCGQO.js} +2 -2
  136. package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js → chunk-FL4D53ND.js} +2 -2
  137. package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js → chunk-FVNWHUME.js} +4 -4
  138. package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js → chunk-FXFCFL73.js} +5 -5
  139. package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js → chunk-FY4RLHSC.js} +2 -2
  140. package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js → chunk-G6MYGULG.js} +4 -4
  141. package/dist/cli-bundle/chunks/{chunk-HYB5AZ63.js → chunk-GKPCTQYG.js} +1822 -72
  142. package/dist/cli-bundle/chunks/chunk-GKPCTQYG.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js → chunk-GLZKZON6.js} +2 -2
  144. package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js → chunk-H5IOT54C.js} +4 -4
  145. package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js → chunk-HO4DLBNK.js} +2 -2
  146. package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js → chunk-HPAYDSR2.js} +8 -8
  147. package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js → chunk-HSYV4ZYT.js} +4 -4
  148. package/dist/cli-bundle/chunks/{chunk-EH2OPHBI.js → chunk-HTXXXF45.js} +23 -19
  149. package/dist/cli-bundle/chunks/chunk-HTXXXF45.js.map +1 -0
  150. package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js → chunk-HYTOJW2Q.js} +8 -8
  151. package/dist/cli-bundle/chunks/{chunk-4XQ3BDV4.js → chunk-I3INI567.js} +536 -449
  152. package/dist/cli-bundle/chunks/chunk-I3INI567.js.map +7 -0
  153. package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js → chunk-I7DIDUSP.js} +2 -2
  154. package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js → chunk-IE5KRAKN.js} +4 -4
  155. package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js → chunk-IL5SPRMH.js} +7 -7
  156. package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js → chunk-ILVOOAT4.js} +5 -5
  157. package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js → chunk-KH6QAHME.js} +3 -3
  158. package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js → chunk-KX62NMZC.js} +3 -3
  159. package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js.map → chunk-KX62NMZC.js.map} +1 -1
  160. package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js → chunk-L337QKWJ.js} +5 -5
  161. package/dist/cli-bundle/chunks/{chunk-JFTKLTEF.js → chunk-L5BTTDU5.js} +68 -503
  162. package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js.map +1 -0
  163. package/dist/cli-bundle/chunks/{chunk-LSG2U345.js → chunk-L6FVNR7X.js} +5 -5
  164. package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js → chunk-LSOWTLEM.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-4223PVZT.js → chunk-M7MVOKVV.js} +3 -3
  166. package/dist/cli-bundle/chunks/{chunk-UMOPHQSU.js → chunk-MR4SHYR4.js} +41 -19
  167. package/dist/cli-bundle/chunks/chunk-MR4SHYR4.js.map +7 -0
  168. package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js → chunk-N33FD2UI.js} +3 -3
  169. package/dist/cli-bundle/chunks/{chunk-UXONS674.js → chunk-NCVT6XEL.js} +68 -56
  170. package/dist/cli-bundle/chunks/chunk-NCVT6XEL.js.map +1 -0
  171. package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js → chunk-NNANAWFH.js} +3 -3
  172. package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js → chunk-NTRQLE2R.js} +2 -2
  173. package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js → chunk-NVZ6NVHJ.js} +4 -4
  174. package/dist/cli-bundle/chunks/{chunk-E2OJMKML.js → chunk-OGVTB5VO.js} +47 -37
  175. package/dist/cli-bundle/chunks/chunk-OGVTB5VO.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js → chunk-OWP6QFBV.js} +4 -4
  177. package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js → chunk-P22HGFFI.js} +2 -2
  178. package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js → chunk-PT7MCCGD.js} +2 -2
  179. package/dist/cli-bundle/chunks/{chunk-ONG5V5CI.js → chunk-QPGQNLPI.js} +1751 -70
  180. package/dist/cli-bundle/chunks/chunk-QPGQNLPI.js.map +1 -0
  181. package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js → chunk-QRZNCRNA.js} +9 -9
  182. package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js → chunk-QWBKN3QC.js} +5 -5
  183. package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js → chunk-R5XTTZSJ.js} +5 -5
  184. package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js → chunk-RC4UOUXA.js} +3 -3
  185. package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js → chunk-RGMWJLXF.js} +4 -4
  186. package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js → chunk-RTBX3C4C.js} +3 -3
  187. package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js → chunk-RXPQ5Q23.js} +7 -7
  188. package/dist/cli-bundle/chunks/{chunk-LPYWLWDS.js → chunk-SIPOACV5.js} +534 -447
  189. package/dist/cli-bundle/chunks/chunk-SIPOACV5.js.map +1 -0
  190. package/dist/cli-bundle/chunks/chunk-TGBTLGPX.js +851 -0
  191. package/dist/cli-bundle/chunks/chunk-TGBTLGPX.js.map +7 -0
  192. package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js → chunk-TLWJP5BF.js} +5 -5
  193. package/dist/cli-bundle/chunks/chunk-TLWJP5BF.js.map +7 -0
  194. package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js → chunk-TM5CIO3F.js} +3 -3
  195. package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js → chunk-TZAE66GQ.js} +8 -8
  196. package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js → chunk-VAHZIPWS.js} +4 -4
  197. package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js → chunk-VE6ZSTQW.js} +4 -4
  198. package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js → chunk-W5E2UUSH.js} +3 -3
  199. package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js → chunk-WACRQ26A.js} +2 -2
  200. package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js.map → chunk-WACRQ26A.js.map} +1 -1
  201. package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js → chunk-WL3SS45P.js} +3 -3
  202. package/dist/cli-bundle/chunks/{chunk-H5APFTHZ.js → chunk-WQXRZMFN.js} +204 -33
  203. package/dist/cli-bundle/chunks/chunk-WQXRZMFN.js.map +7 -0
  204. package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js → chunk-WU3KAN6A.js} +3 -3
  205. package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js → chunk-X2MGQMZO.js} +2 -2
  206. package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js → chunk-X5YCTFKT.js} +3 -3
  207. package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js → chunk-XC2HEEOV.js} +4 -4
  208. package/dist/cli-bundle/chunks/{chunk-7Z4LKRS4.js → chunk-XPUTSGJU.js} +38 -37
  209. package/dist/cli-bundle/chunks/chunk-XPUTSGJU.js.map +1 -0
  210. package/dist/cli-bundle/chunks/{chunk-YBLZ2VE7.js → chunk-XWBD6DSR.js} +320 -239
  211. package/dist/cli-bundle/chunks/chunk-XWBD6DSR.js.map +7 -0
  212. package/dist/cli-bundle/chunks/chunk-XWYQ2LT4.js +834 -0
  213. package/dist/cli-bundle/chunks/chunk-XWYQ2LT4.js.map +1 -0
  214. package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js → chunk-XXLXJL7V.js} +4 -4
  215. package/dist/cli-bundle/chunks/{chunk-2NCIPMQP.js → chunk-YFE7JHX3.js} +27 -6
  216. package/dist/cli-bundle/chunks/chunk-YFE7JHX3.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js → chunk-YIIIAKCE.js} +8 -8
  218. package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js → chunk-YJSURTBB.js} +2 -2
  219. package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js → chunk-YKFHF37B.js} +3 -3
  220. package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js → chunk-YQEZWI3R.js} +2 -2
  221. package/dist/cli-bundle/chunks/close-GPD7DTJV.js +12 -0
  222. package/dist/cli-bundle/chunks/{close-CWODTPKG.js → close-X3CF6FQP.js} +5 -5
  223. package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js → close-many-J7A5EHOQ.js} +14 -14
  224. package/dist/cli-bundle/chunks/close-many-NQLYGPYW.js +23 -0
  225. package/dist/cli-bundle/chunks/comments-2AOZQ5D2.js +13 -0
  226. package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js → comments-TMHMALA5.js} +7 -7
  227. package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js → copy-FWQA5OU4.js} +4 -4
  228. package/dist/cli-bundle/chunks/copy-N3LCQBMC.js +9 -0
  229. package/dist/cli-bundle/chunks/{create-LBVCYMEG.js → create-AQ5SIGZC.js} +9 -9
  230. package/dist/cli-bundle/chunks/{create-J5U6ND4K.js → create-KOGQ3JKD.js} +9 -9
  231. package/dist/cli-bundle/chunks/delete-6G3MBZ6S.js +10 -0
  232. package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js → delete-YYYFOSEA.js} +4 -4
  233. package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js → deps-MQ4ZIGZB.js} +16 -7
  234. package/dist/cli-bundle/chunks/deps-NIIKXLPB.js +28 -0
  235. package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js → docs-53NUGMIQ.js} +6 -6
  236. package/dist/cli-bundle/chunks/docs-OWRGDMNY.js +14 -0
  237. package/dist/cli-bundle/chunks/{files-EFIWKFTM.js → files-3PXGXYDB.js} +6 -6
  238. package/dist/cli-bundle/chunks/{files-6YFBJRBG.js → files-EGLKHD7O.js} +6 -6
  239. package/dist/cli-bundle/chunks/focus-KZLIA6WS.js +10 -0
  240. package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js → focus-SRPASFTN.js} +5 -5
  241. package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js → history-compact-G4DULDCX.js} +6 -6
  242. package/dist/cli-bundle/chunks/history-compact-HHIUOMZ7.js +16 -0
  243. package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js → history-redact-IUSJ6X3E.js} +4 -4
  244. package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js → history-redact-THHGRQXV.js} +4 -4
  245. package/dist/cli-bundle/chunks/history-repair-KG7SWXI6.js +16 -0
  246. package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js → history-repair-LUQWRS7X.js} +6 -6
  247. package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js → learnings-2MRNBFJF.js} +7 -7
  248. package/dist/cli-bundle/chunks/learnings-ZVHSALJY.js +13 -0
  249. package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js → notes-73JWKWUD.js} +7 -7
  250. package/dist/cli-bundle/chunks/notes-BAKUL5DJ.js +13 -0
  251. package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js → plan-AZPMCG37.js} +10 -10
  252. package/dist/cli-bundle/chunks/plan-LEAGLPGP.js +24 -0
  253. package/dist/cli-bundle/chunks/{profile-FAU7NZML.js → profile-AVCIIZID.js} +9 -9
  254. package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js → profile-LFYO3HHX.js} +9 -9
  255. package/dist/cli-bundle/chunks/{register-list-query-UL4UKBBN.js → register-list-query-MZUF2EEC.js} +50 -22
  256. package/dist/cli-bundle/chunks/register-list-query-MZUF2EEC.js.map +1 -0
  257. package/dist/cli-bundle/chunks/{register-list-query-DKA3EH5D.js → register-list-query-UKMF55FT.js} +49 -21
  258. package/dist/cli-bundle/chunks/register-list-query-UKMF55FT.js.map +7 -0
  259. package/dist/cli-bundle/chunks/{register-mutation-RBBJ52DK.js → register-mutation-2PBW2GEX.js} +35 -33
  260. package/dist/cli-bundle/chunks/register-mutation-2PBW2GEX.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js → register-mutation-T6RVNJC4.js} +34 -32
  262. package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js.map → register-mutation-T6RVNJC4.js.map} +2 -2
  263. package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js → register-operations-KHZYR6MG.js} +35 -35
  264. package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js → register-operations-WPQ2LWZJ.js} +35 -35
  265. package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js → register-setup-PGDNOXDQ.js} +15 -15
  266. package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js → register-setup-TDN7WAO6.js} +15 -15
  267. package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js → restore-E3PRGDN3.js} +6 -6
  268. package/dist/cli-bundle/chunks/restore-KIUYTAEJ.js +14 -0
  269. package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js → schema-5JNFQFUW.js} +6 -6
  270. package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js → schema-TMIW4XZC.js} +6 -6
  271. package/dist/cli-bundle/chunks/{update-XHSIAIXE.js → update-SQYZA3ZW.js} +12 -12
  272. package/dist/cli-bundle/chunks/update-XZJYS5X7.js +21 -0
  273. package/dist/cli-bundle/chunks/update-many-R24B3GBK.js +36 -0
  274. package/dist/cli-bundle/chunks/update-many-WQ3R3J6N.js +32 -0
  275. package/dist/cli-bundle/main.js +170 -856
  276. package/dist/cli-bundle/main.js.map +4 -4
  277. package/dist/cli-bundle/sdk-runtime.js +57 -54
  278. package/dist/cli-bundle/sdk-testing.js +6 -6
  279. package/dist/cli-bundle/sdk.js +266 -340
  280. package/dist/cli-bundle/sdk.js.map +4 -4
  281. package/dist/core/extensions/item-fields.js +2 -2
  282. package/dist/core/extensions/item-fields.js.map +1 -1
  283. package/dist/core/item/actionability.d.ts +12 -0
  284. package/dist/core/item/actionability.js +39 -4
  285. package/dist/core/item/actionability.js.map +1 -1
  286. package/dist/core/sentry/instrument.d.ts +11 -0
  287. package/dist/core/sentry/instrument.js +21 -2
  288. package/dist/core/sentry/instrument.js.map +1 -1
  289. package/dist/mcp/server.d.ts +16 -18
  290. package/dist/mcp/server.js +84 -31
  291. package/dist/mcp/server.js.map +1 -1
  292. package/dist/mcp/tool-definitions.js +17 -4
  293. package/dist/mcp/tool-definitions.js.map +1 -1
  294. package/dist/sdk/actionability.d.ts +10 -0
  295. package/dist/sdk/actionability.js +14 -0
  296. package/dist/sdk/actionability.js.map +1 -0
  297. package/dist/sdk/cli-bootstrap.d.ts +122 -0
  298. package/dist/sdk/cli-bootstrap.js +879 -0
  299. package/dist/sdk/cli-bootstrap.js.map +1 -0
  300. package/dist/sdk/cli-contracts/enum-contracts.d.ts +6 -2
  301. package/dist/sdk/cli-contracts/enum-contracts.js +19 -2
  302. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  303. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  304. package/dist/sdk/cli-contracts/flag-contracts.js +21 -2
  305. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  306. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +2 -0
  307. package/dist/sdk/cli-contracts/tool-option-contracts.js +16 -2
  308. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  309. package/dist/sdk/cli-contracts/tool-parameter-tables.js +80 -3
  310. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  311. package/dist/sdk/cli-contracts/tool-schema.d.ts +20 -0
  312. package/dist/sdk/cli-contracts/tool-schema.js +97 -9
  313. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  314. package/dist/sdk/cli-contracts.d.ts +2 -2
  315. package/dist/sdk/cli-contracts.js +4 -4
  316. package/dist/sdk/cli-contracts.js.map +1 -1
  317. package/dist/sdk/dependencies.d.ts +42 -53
  318. package/dist/sdk/dependencies.js +177 -125
  319. package/dist/sdk/dependencies.js.map +1 -1
  320. package/dist/sdk/eval.d.ts +66 -0
  321. package/dist/sdk/eval.js +186 -0
  322. package/dist/sdk/eval.js.map +1 -0
  323. package/dist/sdk/governance/validate.js +3 -3
  324. package/dist/sdk/governance/validate.js.map +1 -1
  325. package/dist/sdk/graph/analytics.d.ts +124 -0
  326. package/dist/sdk/graph/analytics.js +464 -0
  327. package/dist/sdk/graph/analytics.js.map +1 -0
  328. package/dist/sdk/graph/assembly.d.ts +97 -0
  329. package/dist/sdk/graph/assembly.js +146 -0
  330. package/dist/sdk/graph/assembly.js.map +1 -0
  331. package/dist/sdk/graph/cache.d.ts +66 -0
  332. package/dist/sdk/graph/cache.js +148 -0
  333. package/dist/sdk/graph/cache.js.map +1 -0
  334. package/dist/sdk/graph/governance.d.ts +108 -0
  335. package/dist/sdk/graph/governance.js +360 -0
  336. package/dist/sdk/graph/governance.js.map +1 -0
  337. package/dist/sdk/graph/index.d.ts +16 -0
  338. package/dist/sdk/graph/index.js +20 -0
  339. package/dist/sdk/graph/index.js.map +1 -0
  340. package/dist/sdk/graph/remediation.d.ts +52 -0
  341. package/dist/sdk/graph/remediation.js +148 -0
  342. package/dist/sdk/graph/remediation.js.map +1 -0
  343. package/dist/sdk/graph/run.d.ts +295 -0
  344. package/dist/sdk/graph/run.js +468 -0
  345. package/dist/sdk/graph/run.js.map +1 -0
  346. package/dist/sdk/graph/traversal.d.ts +77 -0
  347. package/dist/sdk/graph/traversal.js +262 -0
  348. package/dist/sdk/graph/traversal.js.map +1 -0
  349. package/dist/sdk/index.d.ts +19 -5
  350. package/dist/sdk/index.js +21 -7
  351. package/dist/sdk/index.js.map +1 -1
  352. package/dist/{cli/commands → sdk/query}/item-filter-options.d.ts +1 -1
  353. package/dist/{cli/commands → sdk/query}/item-filter-options.js +3 -3
  354. package/dist/sdk/query/item-filter-options.js.map +1 -0
  355. package/dist/sdk/query/list.d.ts +262 -0
  356. package/dist/sdk/query/list.js +1089 -0
  357. package/dist/sdk/query/list.js.map +1 -0
  358. package/dist/sdk/query/parsers.d.ts +9 -0
  359. package/dist/sdk/query/parsers.js +45 -0
  360. package/dist/sdk/query/parsers.js.map +1 -0
  361. package/dist/{cli/commands → sdk/query}/search-pagination.js +4 -4
  362. package/dist/sdk/query/search-pagination.js.map +1 -0
  363. package/dist/{cli/commands → sdk/query}/search-rendering.js +3 -3
  364. package/dist/sdk/query/search-rendering.js.map +1 -0
  365. package/dist/sdk/query/search.d.ts +469 -0
  366. package/dist/sdk/query/search.js +2247 -0
  367. package/dist/sdk/query/search.js.map +1 -0
  368. package/dist/sdk/relationship-context.d.ts +42 -0
  369. package/dist/sdk/relationship-context.js +99 -20
  370. package/dist/sdk/relationship-context.js.map +1 -1
  371. package/dist/sdk/relationships.d.ts +13 -0
  372. package/dist/sdk/relationships.js +30 -2
  373. package/dist/sdk/relationships.js.map +1 -1
  374. package/dist/sdk/runtime-input.d.ts +41 -0
  375. package/dist/sdk/runtime-input.js +422 -2
  376. package/dist/sdk/runtime-input.js.map +1 -1
  377. package/dist/sdk/runtime.d.ts +19 -30
  378. package/dist/sdk/runtime.js +30 -376
  379. package/dist/sdk/runtime.js.map +1 -1
  380. package/dist/sdk/search-refresh-worker.d.ts +2 -0
  381. package/dist/sdk/search-refresh-worker.js +19 -0
  382. package/dist/sdk/search-refresh-worker.js.map +1 -0
  383. package/dist/sdk/stats.d.ts +66 -0
  384. package/dist/sdk/stats.js +151 -0
  385. package/dist/sdk/stats.js.map +1 -0
  386. package/dist/sdk/telemetry-flush.d.ts +2 -0
  387. package/dist/sdk/telemetry-flush.js +14 -0
  388. package/dist/sdk/telemetry-flush.js.map +1 -0
  389. package/dist/sdk/telemetry.d.ts +14 -0
  390. package/dist/sdk/telemetry.js +398 -0
  391. package/dist/sdk/telemetry.js.map +1 -0
  392. package/dist/sdk/test/batch.d.ts +94 -0
  393. package/dist/sdk/test/batch.js +492 -0
  394. package/dist/sdk/test/batch.js.map +1 -0
  395. package/dist/sdk/test/entry.d.ts +6 -0
  396. package/dist/sdk/test/entry.js +74 -0
  397. package/dist/sdk/test/entry.js.map +1 -0
  398. package/dist/sdk/test/execution.d.ts +282 -0
  399. package/dist/sdk/test/execution.js +1817 -0
  400. package/dist/sdk/test/execution.js.map +1 -0
  401. package/dist/sdk/test/linked-command-detection.js +12 -3
  402. package/dist/sdk/test/linked-command-detection.js.map +1 -1
  403. package/dist/sdk/test/parsers.d.ts +48 -0
  404. package/dist/sdk/test/parsers.js +522 -0
  405. package/dist/sdk/test/parsers.js.map +1 -0
  406. package/dist/sdk/test/runs.d.ts +92 -0
  407. package/dist/sdk/test/runs.js +195 -0
  408. package/dist/sdk/test/runs.js.map +1 -0
  409. package/docs/AGENT_GUIDE.md +1 -0
  410. package/docs/COMMANDS.md +19 -1
  411. package/docs/RELATIONSHIP_GRAPH.md +99 -3
  412. package/docs/SDK.md +139 -3
  413. package/docs/SDK_PRIMITIVE_INVENTORY.md +5 -3
  414. package/docs/examples/sdk-custom-tool/README.md +27 -0
  415. package/docs/examples/sdk-custom-tool/package.json +13 -0
  416. package/docs/examples/sdk-custom-tool/src/cli.ts +36 -0
  417. package/docs/examples/sdk-custom-tool/src/entry.ts +15 -0
  418. package/docs/examples/sdk-custom-tool/src/index.ts +223 -0
  419. package/marketplace.json +2 -2
  420. package/package.json +4 -4
  421. package/packages/pm-beads/package.json +1 -1
  422. package/packages/pm-calendar/package.json +1 -1
  423. package/packages/pm-command-kit/package.json +1 -1
  424. package/packages/pm-governance-audit/extensions/governance-audit/comments-audit.ts +77 -57
  425. package/packages/pm-governance-audit/extensions/governance-audit/dedupe-audit.ts +202 -194
  426. package/packages/pm-governance-audit/extensions/governance-audit/dedupe-merge.ts +227 -153
  427. package/packages/pm-governance-audit/extensions/governance-audit/normalize.ts +169 -125
  428. package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +130 -81
  429. package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +53 -4
  430. package/packages/pm-governance-audit/package.json +1 -1
  431. package/packages/pm-guide-shell/package.json +1 -1
  432. package/packages/pm-kanban/package.json +1 -1
  433. package/packages/pm-lifecycle-hooks/package.json +1 -1
  434. package/packages/pm-linked-test-adapters/package.json +1 -1
  435. package/packages/pm-search-advanced/package.json +1 -1
  436. package/packages/pm-templates/package.json +1 -1
  437. package/packages/pm-todos/package.json +1 -1
  438. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  439. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  440. package/dist/cli/commands/item-filter-options.js.map +0 -1
  441. package/dist/cli/commands/search-pagination.js.map +0 -1
  442. package/dist/cli/commands/search-rendering.js.map +0 -1
  443. package/dist/cli-bundle/chunks/append-UZVHUO74.js +0 -11
  444. package/dist/cli-bundle/chunks/chunk-2NCIPMQP.js.map +0 -1
  445. package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-5JLUII3O.js.map +0 -1
  448. package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +0 -1
  449. package/dist/cli-bundle/chunks/chunk-7Z4LKRS4.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js.map +0 -7
  451. package/dist/cli-bundle/chunks/chunk-E2OJMKML.js.map +0 -7
  452. package/dist/cli-bundle/chunks/chunk-EH2OPHBI.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +0 -7
  454. package/dist/cli-bundle/chunks/chunk-HYB5AZ63.js.map +0 -7
  455. package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +0 -7
  456. package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-NLDFBC6J.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-UFXU44HV.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-UMOPHQSU.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +0 -7
  464. package/dist/cli-bundle/chunks/chunk-YBLZ2VE7.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +0 -58
  466. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +0 -1
  467. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +0 -68
  468. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +0 -7
  469. package/dist/cli-bundle/chunks/close-W6LI2PKM.js +0 -12
  470. package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +0 -23
  471. package/dist/cli-bundle/chunks/comments-E3TNTK24.js +0 -13
  472. package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +0 -9
  473. package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +0 -10
  474. package/dist/cli-bundle/chunks/deps-OA26IS25.js +0 -19
  475. package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +0 -14
  476. package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +0 -10
  477. package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +0 -16
  478. package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +0 -16
  479. package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +0 -13
  480. package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +0 -13
  481. package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +0 -24
  482. package/dist/cli-bundle/chunks/register-list-query-DKA3EH5D.js.map +0 -7
  483. package/dist/cli-bundle/chunks/register-list-query-UL4UKBBN.js.map +0 -1
  484. package/dist/cli-bundle/chunks/register-mutation-RBBJ52DK.js.map +0 -1
  485. package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +0 -14
  486. package/dist/cli-bundle/chunks/update-WWBYOPXO.js +0 -21
  487. package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +0 -32
  488. package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +0 -36
  489. /package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js.map → append-5YF3TO7I.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{append-UZVHUO74.js.map → append-JHO5K6RP.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js.map → chunk-2BX74BAS.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js.map → chunk-2CXL335K.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js.map → chunk-2FUOXSRN.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js.map → chunk-2IPNL3DR.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js.map → chunk-2XOSFSTH.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js.map → chunk-37DRDP2B.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js.map → chunk-47HXN6RX.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js.map → chunk-5HGZKQUL.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js.map → chunk-5UKQLQM2.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js.map → chunk-633PKXLT.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js.map → chunk-646MQXFW.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js.map → chunk-66MKH7SZ.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js.map → chunk-67RO3H4N.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js.map → chunk-6DYOZS6C.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js.map → chunk-6O44IN44.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js.map → chunk-74FKFFXO.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js.map → chunk-7H5NNCJ5.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js.map → chunk-AFGKSHAM.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js.map → chunk-ARGDWQ4J.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js.map → chunk-B57RJHBZ.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js.map → chunk-BAP7G3N2.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js.map → chunk-BIRYX32V.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js.map → chunk-BVLOMU6O.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js.map → chunk-CKX4WOPC.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js.map → chunk-D52ZN3BF.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js.map → chunk-D53RTYVI.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{chunk-ODALILG3.js.map → chunk-D5XHO4Q7.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js.map → chunk-DDFGYUCQ.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js.map → chunk-DG2EQRIH.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js.map → chunk-EHJFUOXL.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js.map → chunk-EWIT5WIC.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js.map → chunk-EY7ZE3TG.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js.map → chunk-FHOBCGQO.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js.map → chunk-FL4D53ND.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js.map → chunk-FVNWHUME.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js.map → chunk-FXFCFL73.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js.map → chunk-FY4RLHSC.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js.map → chunk-G6MYGULG.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js.map → chunk-GLZKZON6.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js.map → chunk-H5IOT54C.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js.map → chunk-HO4DLBNK.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js.map → chunk-HPAYDSR2.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js.map → chunk-HSYV4ZYT.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js.map → chunk-HYTOJW2Q.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js.map → chunk-I7DIDUSP.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js.map → chunk-IE5KRAKN.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js.map → chunk-IL5SPRMH.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js.map → chunk-ILVOOAT4.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js.map → chunk-KH6QAHME.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js.map → chunk-L337QKWJ.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-LSG2U345.js.map → chunk-L6FVNR7X.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js.map → chunk-LSOWTLEM.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-4223PVZT.js.map → chunk-M7MVOKVV.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js.map → chunk-N33FD2UI.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js.map → chunk-NNANAWFH.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js.map → chunk-NTRQLE2R.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js.map → chunk-NVZ6NVHJ.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js.map → chunk-OWP6QFBV.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js.map → chunk-P22HGFFI.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js.map → chunk-PT7MCCGD.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js.map → chunk-QRZNCRNA.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js.map → chunk-QWBKN3QC.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js.map → chunk-R5XTTZSJ.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js.map → chunk-RC4UOUXA.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js.map → chunk-RGMWJLXF.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js.map → chunk-RTBX3C4C.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js.map → chunk-RXPQ5Q23.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js.map → chunk-TM5CIO3F.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js.map → chunk-TZAE66GQ.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js.map → chunk-VAHZIPWS.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js.map → chunk-VE6ZSTQW.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js.map → chunk-W5E2UUSH.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js.map → chunk-WL3SS45P.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js.map → chunk-WU3KAN6A.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js.map → chunk-X2MGQMZO.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js.map → chunk-X5YCTFKT.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js.map → chunk-XC2HEEOV.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js.map → chunk-XXLXJL7V.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js.map → chunk-YIIIAKCE.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js.map → chunk-YJSURTBB.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js.map → chunk-YKFHF37B.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js.map → chunk-YQEZWI3R.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{close-W6LI2PKM.js.map → close-GPD7DTJV.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{close-CWODTPKG.js.map → close-X3CF6FQP.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js.map → close-many-J7A5EHOQ.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-many-DLDDVSH5.js.map → close-many-NQLYGPYW.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{comments-E3TNTK24.js.map → comments-2AOZQ5D2.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js.map → comments-TMHMALA5.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js.map → copy-FWQA5OU4.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{copy-Q5ZJPUKR.js.map → copy-N3LCQBMC.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{create-LBVCYMEG.js.map → create-AQ5SIGZC.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{create-J5U6ND4K.js.map → create-KOGQ3JKD.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{delete-WNHB3LYW.js.map → delete-6G3MBZ6S.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js.map → delete-YYYFOSEA.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js.map → deps-MQ4ZIGZB.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{deps-OA26IS25.js.map → deps-NIIKXLPB.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js.map → docs-53NUGMIQ.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{docs-HA2AIDBB.js.map → docs-OWRGDMNY.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{files-EFIWKFTM.js.map → files-3PXGXYDB.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{files-6YFBJRBG.js.map → files-EGLKHD7O.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{focus-POIW5LTJ.js.map → focus-KZLIA6WS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js.map → focus-SRPASFTN.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js.map → history-compact-G4DULDCX.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{history-compact-FWG2C7FZ.js.map → history-compact-HHIUOMZ7.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js.map → history-redact-IUSJ6X3E.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js.map → history-redact-THHGRQXV.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{history-repair-6GEAM7HE.js.map → history-repair-KG7SWXI6.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js.map → history-repair-LUQWRS7X.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js.map → learnings-2MRNBFJF.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{learnings-RSNLSWDC.js.map → learnings-ZVHSALJY.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js.map → notes-73JWKWUD.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{notes-2WDH6DXU.js.map → notes-BAKUL5DJ.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js.map → plan-AZPMCG37.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{plan-DOVI2VMW.js.map → plan-LEAGLPGP.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{profile-FAU7NZML.js.map → profile-AVCIIZID.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js.map → profile-LFYO3HHX.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js.map → register-operations-KHZYR6MG.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js.map → register-operations-WPQ2LWZJ.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js.map → register-setup-PGDNOXDQ.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js.map → register-setup-TDN7WAO6.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js.map → restore-E3PRGDN3.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{restore-YPMVUUEX.js.map → restore-KIUYTAEJ.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js.map → schema-5JNFQFUW.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js.map → schema-TMIW4XZC.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{update-XHSIAIXE.js.map → update-SQYZA3ZW.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{update-WWBYOPXO.js.map → update-XZJYS5X7.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{update-many-TA7NGQBO.js.map → update-many-R24B3GBK.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{update-many-OUGIU5SF.js.map → update-many-WQ3R3J6N.js.map} +0 -0
  619. /package/dist/{cli/commands → sdk/query}/search-pagination.d.ts +0 -0
  620. /package/dist/{cli/commands → sdk/query}/search-rendering.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sources":["mcp/server.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n/**\n * @module mcp/server\n *\n * Runs the MCP server adapter that exposes pm actions and contracts to external agents.\n */\nimport { realpathSync } from \"node:fs\";\nimport readline from \"node:readline\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolvePmCliVersion } from \"../core/packages/root.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { decodeHtmlEntitiesInOptions } from \"../core/shared/html-entity-decode.js\";\nimport { levenshteinDistanceWithinLimit } from \"../core/shared/levenshtein.js\";\nimport { asRecordClone } from \"../core/shared/primitives.js\";\nimport { createSerialQueue } from \"../core/shared/serial-queue.js\";\nimport {\n readRequiredString,\n runAction,\n type PmActionInput,\n} from \"../sdk/runtime.js\";\nimport { TOOLS } from \"./tool-definitions.js\";\n\ninterface JsonRpcRequest {\n jsonrpc?: string;\n id?: string | number | null;\n method?: string;\n params?: Record<string, unknown>;\n}\n\ntype ToolHandler = (args: Record<string, unknown>) => Promise<unknown>;\n\nconst PM_PACKAGE_ROOT_ENV = \"PM_CLI_PACKAGE_ROOT\";\n\nfunction resolvePmPackageRoot(): string {\n return fileURLToPath(new URL(\"../..\", import.meta.url));\n}\n\nif (\n typeof process.env[PM_PACKAGE_ROOT_ENV] !== \"string\" ||\n process.env[PM_PACKAGE_ROOT_ENV]?.trim().length === 0\n) {\n process.env[PM_PACKAGE_ROOT_ENV] = resolvePmPackageRoot();\n}\n\n// Reflect the real package.json version so agents/telemetry can identify the\n// build serving requests (was hard-coded \"1.0.0\"; see pm-2nvw).\nconst PM_MCP_SERVER_VERSION =\n resolvePmCliVersion(import.meta.url, [\"../..\"]) ?? \"0.0.0\";\n\n// Tool definitions (TOOLS) live in ./tool-definitions.ts so the `pm contracts`\n// golden-file snapshot can import the surface without loading the server\n// runtime (pm-4os2). This file owns dispatch, normalization, and transport.\n\n// pm-qxwu: TOOL_SCHEMA_BASE keeps additionalProperties:true so legitimate\n// passthrough keeps working, which means a typo'd top-level arg (e.g.\n// \"fullChangedField\" missing the trailing \"s\") is silently swallowed and the\n// agent gets default behavior with no signal. We precompute the declared\n// top-level property keys for each tool and, on every tools/call, warn (without\n// rejecting) when an unexpected top-level key appears. The warning is surfaced\n// to stderr and additively in structuredContent.warnings.\nconst TOOL_DECLARED_KEYS: Map<string, string[]> = new Map(\n TOOLS.map((tool) => {\n const schema = tool.inputSchema as { properties?: Record<string, unknown> };\n const properties = schema.properties ?? {};\n return [tool.name, Object.keys(properties)] as const;\n }),\n);\n\nfunction nearestDeclaredKey(\n unexpected: string,\n declared: string[],\n): string | undefined {\n // Cheap did-you-mean: budget grows with key length but stays small so we only\n // suggest genuine near-misses (a single typo / transposition for short keys).\n const limit = Math.max(1, Math.min(3, Math.floor(unexpected.length / 4) + 1));\n let best: { key: string; distance: number } | undefined;\n for (const candidate of declared) {\n const distance = levenshteinDistanceWithinLimit(\n unexpected,\n candidate,\n limit,\n );\n if (distance === null) {\n continue;\n }\n if (best === undefined || distance < best.distance) {\n best = { key: candidate, distance };\n }\n }\n return best?.key;\n}\n\n// pm_run is the explicit catch-all passthrough tool: extension/package actions\n// accept arbitrary top-level keys (see extensionOptionsFromArgs), so unexpected\n// keys there are by-design rather than typos and must not be flagged.\nconst UNEXPECTED_KEY_WARNING_EXEMPT_TOOLS = new Set([\"pm_run\"]);\n\nfunction detectUnexpectedTopLevelKeys(\n toolName: string,\n args: Record<string, unknown>,\n): string[] {\n if (typeof args !== \"object\" || args === null || Array.isArray(args)) {\n return [];\n }\n if (UNEXPECTED_KEY_WARNING_EXEMPT_TOOLS.has(toolName)) {\n return [];\n }\n const declared = TOOL_DECLARED_KEYS.get(toolName);\n if (declared === undefined) {\n return [];\n }\n const declaredSet = new Set(declared);\n const warnings: string[] = [];\n for (const key of Object.keys(args)) {\n if (declaredSet.has(key)) {\n continue;\n }\n const suggestion = nearestDeclaredKey(key, declared);\n warnings.push(\n suggestion !== undefined\n ? `Unexpected top-level argument \"${key}\" for ${toolName} (did you mean \"${suggestion}\"?). It was passed through unchanged; declared arguments are: ${declared.join(\", \")}.`\n : `Unexpected top-level argument \"${key}\" for ${toolName}. It was passed through unchanged; declared arguments are: ${declared.join(\", \")}.`,\n );\n }\n return warnings;\n}\n\nconst HANDLERS: Record<string, ToolHandler> = {\n pm_run: (args) => runAction(args as PmActionInput),\n pm_context: (args) => runAction({ ...args, action: \"context\" }),\n pm_next: (args) => runAction({ ...args, action: \"next\" }),\n pm_search: (args) => runAction({ ...args, action: \"search\" }),\n pm_list: (args) => runAction({ ...args, action: \"list\" }),\n pm_get: (args) => runAction({ ...args, action: \"get\" }),\n pm_create: (args) => runAction({ ...args, action: \"create\" }),\n pm_copy: (args) => runAction({ ...args, action: \"copy\" }),\n pm_focus: (args) => runAction({ ...args, action: \"focus\" }),\n pm_update: (args) => runAction({ ...args, action: \"update\" }),\n pm_append: (args) => runAction({ ...args, action: \"append\" }),\n pm_claim: (args) => runAction({ ...args, action: \"claim\" }),\n pm_release: (args) => runAction({ ...args, action: \"release\" }),\n pm_close: (args) => runAction({ ...args, action: \"close\" }),\n pm_comments: (args) => runAction({ ...args, action: \"comments\" }),\n pm_files: (args) => runAction({ ...args, action: \"files\" }),\n pm_docs: (args) => runAction({ ...args, action: \"docs\" }),\n pm_notes: (args) => runAction({ ...args, action: \"notes\" }),\n pm_learnings: (args) => runAction({ ...args, action: \"learnings\" }),\n pm_deps: (args) => runAction({ ...args, action: \"deps\" }),\n pm_test: (args) => runAction({ ...args, action: \"test\" }),\n pm_validate: (args) => runAction({ ...args, action: \"validate\" }),\n pm_health: (args) => runAction({ ...args, action: \"health\" }),\n pm_contracts: (args) => runAction({ ...args, action: \"contracts\" }),\n pm_schema: (args) => runAction({ ...args, action: \"schema\" }),\n pm_profile: (args) => runAction({ ...args, action: \"profile\" }),\n pm_config: (args) => runAction({ ...args, action: \"config\" }),\n pm_plan: (args) => runAction({ ...args, action: \"plan\" }),\n};\n\nfunction resultContent(\n result: unknown,\n warnings?: string[],\n): Record<string, unknown> {\n // pm-qxwu: warnings is additive — existing fields (content, structuredContent.result)\n // are never removed or renamed. The warnings array only appears when non-empty.\n const structuredContent: Record<string, unknown> =\n warnings !== undefined && warnings.length > 0\n ? { result, warnings }\n : { result };\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(result, null, 2),\n },\n ],\n structuredContent,\n };\n}\n\nfunction errorContent(error: unknown): Record<string, unknown> {\n const code = error instanceof PmCliError ? error.exitCode : 1;\n const message = error instanceof Error ? error.message : String(error);\n return {\n isError: true,\n content: [\n {\n type: \"text\",\n text: JSON.stringify({ error: message, code }, null, 2),\n },\n ],\n // Keep `result` present on the error envelope so consumers can read\n // `structuredContent.result` uniformly across success and failure (pm-l40h).\n structuredContent: { result: null, error: message, code },\n };\n}\n\n/** Implements handle request for the public runtime surface of this module. */\nexport async function handleRequest(\n request: JsonRpcRequest,\n): Promise<Record<string, unknown> | undefined> {\n if (!request.id && request.method?.startsWith(\"notifications/\")) {\n return undefined;\n }\n if (request.method === \"ping\") {\n return {};\n }\n if (request.method === \"initialize\") {\n return {\n protocolVersion: \"2025-06-18\",\n capabilities: { tools: {} },\n serverInfo: { name: \"pm-mcp\", version: PM_MCP_SERVER_VERSION },\n instructions:\n \"You have access to native pm CLI tools for git-based project management. \" +\n \"Use pm_next to pick the next actionable item, or pm_context or pm_search before creating new work. \" +\n \"Prefer narrow tools (pm_next, pm_context, pm_list, pm_get, pm_search, pm_create, pm_copy, pm_focus, pm_update, pm_append, pm_claim, pm_release, pm_close, pm_comments, pm_files, pm_docs, pm_notes, pm_learnings, pm_deps, pm_test, pm_validate, pm_health, pm_contracts, pm_schema, pm_profile, pm_config, pm_plan) over pm_run when they cover the operation. \" +\n \"Use pm_plan for agent harness Plan workflows: it provides Codex/Claude/Cursor-style planning with durable steps, dependencies, decisions, discoveries, validation, and materialization. \" +\n \"Use pm_schema and pm_config for workspace configuration: pm_schema manages custom item types/statuses and pm_config reads or writes settings keys. \" +\n \"Use pm_run with an explicit action for active package-owned operations, plus activity, aggregate, history, stats, test-all, and gc. \" +\n \"Use history-redact for audited history-stream redaction workflows, history-repair to re-anchor a drifted history chain, and history-compact to checkpoint/prune long history streams while preserving replay integrity. \" +\n \"Set author to 'claude-code-agent' on all mutations. \" +\n \"Do not pass path during real repository tracking — only pass path for sandbox or test runs.\",\n };\n }\n if (request.method === \"tools/list\") {\n return { tools: TOOLS };\n }\n if (request.method === \"tools/call\") {\n const params = asRecordClone(request.params);\n const name = readRequiredString(params, \"name\");\n const handler = Object.prototype.hasOwnProperty.call(HANDLERS, name)\n ? HANDLERS[name]\n : undefined;\n if (!handler) {\n throw new PmCliError(`Unknown pm MCP tool: ${name}`, 64);\n }\n // pm-ydkl: defensive HTML-entity decode for free-text fields. Claude / the\n // Anthropic MCP SDK HTML-encodes `<` / `>` (and friends) in tool arguments\n // before they reach pm-cli, which would otherwise leak `&lt;type&gt;` into\n // stored pm comments / notes / item bodies. Direct CLI calls are not\n // affected; decoding at the MCP boundary normalizes the agent path while\n // leaving normal text untouched.\n const args = decodeHtmlEntitiesInOptions(asRecordClone(params.arguments));\n // pm-qxwu: non-breaking detection of typo'd / unexpected top-level keys.\n // additionalProperties stays true so passthrough still works; we only warn.\n const warnings = detectUnexpectedTopLevelKeys(name, args);\n for (const warning of warnings) {\n console.error(`[pm-mcp] ${warning}`);\n }\n // cwd is applied inside the serialized activation cycle (see withActiveExtensions),\n // so the chdir/restore is exclusive per request and cannot race a concurrent caller.\n const result = await handler(args);\n return resultContent(result, warnings);\n }\n throw new PmCliError(\n `Unsupported MCP method: ${request.method ?? \"(missing)\"}`,\n 64,\n );\n}\n\nfunction writeResponse(\n id: JsonRpcRequest[\"id\"],\n payload: Record<string, unknown>,\n): void {\n process.stdout.write(\n `${JSON.stringify({ jsonrpc: \"2.0\", id, result: payload })}\\n`,\n );\n}\n\nfunction writeError(id: JsonRpcRequest[\"id\"], error: unknown): void {\n const code = error instanceof PmCliError ? error.exitCode : -32603;\n const message = error instanceof Error ? error.message : String(error);\n process.stdout.write(\n `${JSON.stringify({ jsonrpc: \"2.0\", id, error: { code, message } })}\\n`,\n );\n}\n\n// pm-3puw: parse one JSON-RPC line, dispatch it, and write the response. Kept\n// as a standalone async unit so the stdio loop can enqueue it onto a serial\n// queue (process lines in arrival order) and tests can drive it directly.\n/** Implements process rpc line for the public runtime surface of this module. */\nexport async function processRpcLine(line: string): Promise<void> {\n if (line.trim().length === 0) {\n return;\n }\n let request: JsonRpcRequest;\n try {\n request = JSON.parse(line) as JsonRpcRequest;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n writeError(null, new PmCliError(`Parse error: ${message}`, -32700));\n return;\n }\n if (\n typeof request !== \"object\" ||\n request === null ||\n Array.isArray(request)\n ) {\n writeError(\n null,\n new PmCliError(\"Invalid JSON-RPC request: expected an object\", -32600),\n );\n return;\n }\n const shouldRespond = Object.prototype.hasOwnProperty.call(request, \"id\");\n try {\n const result = await handleRequest(request);\n if (shouldRespond && result !== undefined) {\n writeResponse(request.id, result);\n }\n } catch (error) {\n if (!shouldRespond) {\n return;\n }\n if (request.method === \"tools/call\") {\n writeResponse(request.id, errorContent(error));\n } else {\n writeError(request.id, error);\n }\n }\n}\n\n/** Implements start mcp server for the public runtime surface of this module. */\nexport function startMcpServer(): void {\n const rl = readline.createInterface({\n input: process.stdin,\n crlfDelay: Infinity,\n });\n // pm-3puw: serialize line handling so pipelined requests are processed in\n // arrival order. The previous fire-and-forget handler ran requests\n // concurrently, so a client that pipelined two mutations on the same item\n // (without awaiting the first response) hit a lock conflict on the second.\n const queue = createSerialQueue();\n rl.on(\"line\", (line) => {\n void queue.enqueue(() => processRpcLine(line));\n });\n}\n\n// npm bin entries are symlinks (node_modules/.bin/pm-mcp -> dist/mcp/server.js),\n// so argv[1] must be realpath-resolved before comparing against this module's\n// path — a plain equality check made the published `pm-mcp` bin exit 0 without\n// ever starting the server (pm-qtbc).\n/** Implements check whether invoked as mcp main module for the public runtime surface of this module. */\nexport function isInvokedAsMcpMainModule(\n argvPath: string | undefined,\n moduleUrl: string,\n): boolean {\n if (!argvPath) {\n return false;\n }\n const selfPath = fileURLToPath(moduleUrl);\n if (argvPath === selfPath) {\n return true;\n }\n try {\n return realpathSync(argvPath) === realpathSync(selfPath);\n } catch {\n return false;\n }\n}\n\ntype RuntimeTestHooks = NonNullable<\n typeof globalThis.__pmCliActionRunnerTestHooks\n>;\ntype RuntimeTestHookKey = keyof RuntimeTestHooks;\n\nfunction readRuntimeTestHook<Key extends RuntimeTestHookKey>(\n key: Key,\n): RuntimeTestHooks[Key] {\n const runtimeTestHooks = globalThis.__pmCliActionRunnerTestHooks;\n if (runtimeTestHooks === undefined) {\n throw new PmCliError(\n `MCP runtime test hook \"${String(key)}\" is only available in test environments.`,\n 64,\n );\n }\n return runtimeTestHooks[key];\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n get closeManyOptionsFromFlat() {\n return readRuntimeTestHook(\"closeManyOptionsFromFlat\");\n },\n detectUnexpectedTopLevelKeys,\n errorContent,\n get extensionOptionsFromArgs() {\n return readRuntimeTestHook(\"extensionOptionsFromArgs\");\n },\n get globalOptions() {\n return readRuntimeTestHook(\"globalOptions\");\n },\n get mutationListOptions() {\n return readRuntimeTestHook(\"mutationListOptions\");\n },\n nearestDeclaredKey,\n get normalizeActionName() {\n return readRuntimeTestHook(\"normalizeActionName\");\n },\n get normalizeCommandPath() {\n return readRuntimeTestHook(\"normalizeCommandPath\");\n },\n get normalizeMcpOptionsArrays() {\n return readRuntimeTestHook(\"normalizeMcpOptionsArrays\");\n },\n get normalizeMcpUpdateOptions() {\n return readRuntimeTestHook(\"normalizeMcpUpdateOptions\");\n },\n get optionsWithAuthor() {\n return readRuntimeTestHook(\"optionsWithAuthor\");\n },\n get readRequiredString() {\n return readRuntimeTestHook(\"readRequiredString\");\n },\n get readScalarString() {\n return readRuntimeTestHook(\"readScalarString\");\n },\n get readScalarStringAllowBlank() {\n return readRuntimeTestHook(\"readScalarStringAllowBlank\");\n },\n get readStringArray() {\n return readRuntimeTestHook(\"readStringArray\");\n },\n runAction,\n get updateManyOptionsFromFlat() {\n return readRuntimeTestHook(\"updateManyOptionsFromFlat\");\n },\n get withAddNoteOption() {\n return readRuntimeTestHook(\"withAddNoteOption\");\n },\n get withFilesDiscoveryOptions() {\n return readRuntimeTestHook(\"withFilesDiscoveryOptions\");\n },\n get withMutationCompaction() {\n return readRuntimeTestHook(\"withMutationCompaction\");\n },\n writeError,\n};\n\n/* c8 ignore start */\nif (isInvokedAsMcpMainModule(process.argv[1], import.meta.url)) {\n startMcpServer();\n}\n/* c8 ignore stop */\n"],"names":[],"mappings":";AACA;;;;GAIG;;;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCA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,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,kBAAkB;QACpB,OAAO,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,gBAAgB;QAClB,OAAO,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,0BAA0B;QAC5B,OAAO,mBAAmB,CAAC,4BAA4B,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,eAAe;QACjB,OAAO,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IAChD,CAAC;IACD,SAAS;IACT,IAAI,yBAAyB;QAC3B,OAAO,mBAAmB,CAAC,2BAA2B,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,iBAAiB;QACnB,OAAO,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,yBAAyB;QAC3B,OAAO,mBAAmB,CAAC,2BAA2B,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,sBAAsB;QACxB,OAAO,mBAAmB,CAAC,wBAAwB,CAAC,CAAC;IACvD,CAAC;IACD,UAAU;CACX,CAAC;AAEF,qBAAqB;AACrB,IAAI,wBAAwB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC/D,cAAc,EAAE,CAAC;AACnB,CAAC;AACD,oBAAoB","debugId":"29c83e65-32f6-5773-ad8b-bc5fcbe29fc1"}
1
+ {"version":3,"file":"server.js","sources":["mcp/server.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n/**\n * @module mcp/server\n *\n * Runs the MCP server adapter that exposes pm actions and contracts to external agents.\n */\nimport { realpathSync } from \"node:fs\";\nimport readline from \"node:readline\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolvePmCliVersion } from \"../core/packages/root.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { decodeHtmlEntitiesInOptions } from \"../core/shared/html-entity-decode.js\";\nimport { levenshteinDistanceWithinLimit } from \"../core/shared/levenshtein.js\";\nimport { asRecordClone } from \"../core/shared/primitives.js\";\nimport { createSerialQueue } from \"../core/shared/serial-queue.js\";\nimport { pmToolActionNestedOptionKeys } from \"../sdk/cli-contracts/tool-schema.js\";\nimport {\n readRequiredString,\n runAction,\n type PmActionInput,\n} from \"../sdk/runtime.js\";\nimport { TOOLS } from \"./tool-definitions.js\";\n\ninterface JsonRpcRequest {\n jsonrpc?: string;\n id?: string | number | null;\n method?: string;\n params?: Record<string, unknown>;\n}\n\ntype ToolHandler = (args: Record<string, unknown>) => Promise<unknown>;\n\nconst PM_PACKAGE_ROOT_ENV = \"PM_CLI_PACKAGE_ROOT\";\n\nfunction resolvePmPackageRoot(): string {\n return fileURLToPath(new URL(\"../..\", import.meta.url));\n}\n\nif (\n typeof process.env[PM_PACKAGE_ROOT_ENV] !== \"string\" ||\n process.env[PM_PACKAGE_ROOT_ENV]?.trim().length === 0\n) {\n process.env[PM_PACKAGE_ROOT_ENV] = resolvePmPackageRoot();\n}\n\n// Reflect the real package.json version so agents/telemetry can identify the\n// build serving requests (was hard-coded \"1.0.0\"; see pm-2nvw).\nconst PM_MCP_SERVER_VERSION =\n resolvePmCliVersion(import.meta.url, [\"../..\"]) ?? \"0.0.0\";\n\n// Tool definitions (TOOLS) live in ./tool-definitions.ts so the `pm contracts`\n// golden-file snapshot can import the surface without loading the server\n// runtime (pm-4os2). This file owns dispatch, normalization, and transport.\n\n// pm-qxwu: TOOL_SCHEMA_BASE keeps additionalProperties:true so legitimate\n// passthrough keeps working, which means a typo'd top-level arg (e.g.\n// \"fullChangedField\" missing the trailing \"s\") is silently swallowed and the\n// agent gets default behavior with no signal. We precompute the declared\n// top-level property keys for each tool and, on every tools/call, warn (without\n// rejecting) when an unexpected top-level key appears. The warning is surfaced\n// to stderr and additively in structuredContent.warnings.\nconst TOOL_DECLARED_KEYS: Map<string, string[]> = new Map(\n TOOLS.map((tool) => {\n const schema = tool.inputSchema as { properties?: Record<string, unknown> };\n const properties = schema.properties ?? {};\n return [tool.name, Object.keys(properties)] as const;\n }),\n);\n\nfunction nearestDeclaredKey(\n unexpected: string,\n declared: string[],\n): string | undefined {\n // Cheap did-you-mean: budget grows with key length but stays small so we only\n // suggest genuine near-misses (a single typo / transposition for short keys).\n const limit = Math.max(1, Math.min(3, Math.floor(unexpected.length / 4) + 1));\n let best: { key: string; distance: number } | undefined;\n for (const candidate of declared) {\n const distance = levenshteinDistanceWithinLimit(\n unexpected,\n candidate,\n limit,\n );\n if (distance === null) {\n continue;\n }\n if (best === undefined || distance < best.distance) {\n best = { key: candidate, distance };\n }\n }\n return best?.key;\n}\n\n// pm_run is the explicit catch-all passthrough tool: extension/package actions\n// accept arbitrary top-level keys (see extensionOptionsFromArgs), so unexpected\n// keys there are by-design rather than typos and must not be flagged.\nconst UNEXPECTED_KEY_WARNING_EXEMPT_TOOLS = new Set([\"pm_run\"]);\n\nfunction detectUnexpectedTopLevelKeys(\n toolName: string,\n args: Record<string, unknown>,\n): string[] {\n if (typeof args !== \"object\" || args === null || Array.isArray(args)) {\n return [];\n }\n if (UNEXPECTED_KEY_WARNING_EXEMPT_TOOLS.has(toolName)) {\n return [];\n }\n const declared = TOOL_DECLARED_KEYS.get(toolName);\n if (declared === undefined) {\n return [];\n }\n const declaredSet = new Set(declared);\n const warnings: string[] = [];\n for (const key of Object.keys(args)) {\n if (declaredSet.has(key)) {\n continue;\n }\n const suggestion = nearestDeclaredKey(key, declared);\n warnings.push(\n suggestion !== undefined\n ? `Unexpected top-level argument \"${key}\" for ${toolName} (did you mean \"${suggestion}\"?). It was passed through unchanged; declared arguments are: ${declared.join(\", \")}.`\n : `Unexpected top-level argument \"${key}\" for ${toolName}. It was passed through unchanged; declared arguments are: ${declared.join(\", \")}.`,\n );\n }\n return warnings;\n}\n\n// Fixed pm action behind each narrow tool. Also consulted by nested-option\n// validation (pm-upi0) to resolve the invoked action's contract keys.\nconst NARROW_TOOL_ACTIONS: Record<string, string> = {\n pm_context: \"context\",\n pm_next: \"next\",\n pm_search: \"search\",\n pm_list: \"list\",\n pm_get: \"get\",\n pm_create: \"create\",\n pm_copy: \"copy\",\n pm_focus: \"focus\",\n pm_update: \"update\",\n pm_append: \"append\",\n pm_claim: \"claim\",\n pm_release: \"release\",\n pm_close: \"close\",\n pm_comments: \"comments\",\n pm_files: \"files\",\n pm_docs: \"docs\",\n pm_notes: \"notes\",\n pm_learnings: \"learnings\",\n pm_deps: \"deps\",\n pm_graph: \"graph\",\n pm_test: \"test\",\n pm_validate: \"validate\",\n pm_health: \"health\",\n pm_contracts: \"contracts\",\n pm_schema: \"schema\",\n pm_profile: \"profile\",\n pm_config: \"config\",\n pm_plan: \"plan\",\n};\n\nconst HANDLERS: Record<string, ToolHandler> = {\n pm_run: (args) => runAction(args as PmActionInput),\n ...Object.fromEntries(\n Object.entries(NARROW_TOOL_ACTIONS).map(([tool, action]) => [\n tool,\n (args: Record<string, unknown>) => runAction({ ...args, action }),\n ]),\n ),\n};\n\n/** Resolve the pm action a tools/call invocation will dispatch, when knowable. */\nfunction resolveInvokedAction(\n toolName: string,\n args: Record<string, unknown>,\n): string | undefined {\n if (toolName === \"pm_run\") {\n return typeof args.action === \"string\" ? args.action : undefined;\n }\n return NARROW_TOOL_ACTIONS[toolName];\n}\n\n// pm-upi0: the pm-qxwu top-level detection cannot see inside the `options`\n// object, so a mutation-shaped key on a read tool (pm_deps options.dep) is\n// silently dropped before dispatch and the agent builds on state it never\n// created. Warn (without rejecting) on every options key absent from the\n// invoked action's contract; extension- and package-owned actions have no\n// contract table and keep arbitrary passthrough options.\nfunction detectUnexpectedOptionKeys(\n toolName: string,\n action: string | undefined,\n args: Record<string, unknown>,\n): string[] {\n const options = args.options;\n if (\n action === undefined ||\n typeof options !== \"object\" ||\n options === null ||\n Array.isArray(options)\n ) {\n return [];\n }\n const declared = pmToolActionNestedOptionKeys(action);\n if (declared === undefined) {\n return [];\n }\n const declaredSet = new Set(declared);\n const warnings: string[] = [];\n for (const key of Object.keys(options)) {\n if (declaredSet.has(key)) {\n continue;\n }\n const suggestion = nearestDeclaredKey(key, declared);\n warnings.push(\n suggestion !== undefined\n ? `Unknown option \"${key}\" for ${toolName} action \"${action}\" (did you mean \"${suggestion}\"?). The ${action} contract does not read it, so it has no effect; declared keys are: ${declared.join(\", \")}.`\n : `Unknown option \"${key}\" for ${toolName} action \"${action}\". The ${action} contract does not read it, so it has no effect; declared keys are: ${declared.join(\", \")}.`,\n );\n }\n return warnings;\n}\n\nfunction resultContent(\n result: unknown,\n warnings?: string[],\n): Record<string, unknown> {\n // pm-qxwu: warnings is additive — existing fields (content, structuredContent.result)\n // are never removed or renamed. The warnings array only appears when non-empty.\n const structuredContent: Record<string, unknown> =\n warnings !== undefined && warnings.length > 0\n ? { result, warnings }\n : { result };\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(result, null, 2),\n },\n ],\n structuredContent,\n };\n}\n\nfunction errorContent(error: unknown): Record<string, unknown> {\n const code = error instanceof PmCliError ? error.exitCode : 1;\n const message = error instanceof Error ? error.message : String(error);\n return {\n isError: true,\n content: [\n {\n type: \"text\",\n text: JSON.stringify({ error: message, code }, null, 2),\n },\n ],\n // Keep `result` present on the error envelope so consumers can read\n // `structuredContent.result` uniformly across success and failure (pm-l40h).\n structuredContent: { result: null, error: message, code },\n };\n}\n\n/** Implements handle request for the public runtime surface of this module. */\nexport async function handleRequest(\n request: JsonRpcRequest,\n): Promise<Record<string, unknown> | undefined> {\n if (!request.id && request.method?.startsWith(\"notifications/\")) {\n return undefined;\n }\n if (request.method === \"ping\") {\n return {};\n }\n if (request.method === \"initialize\") {\n return {\n protocolVersion: \"2025-06-18\",\n capabilities: { tools: {} },\n serverInfo: { name: \"pm-mcp\", version: PM_MCP_SERVER_VERSION },\n instructions:\n \"You have access to native pm CLI tools for git-based project management. \" +\n \"Use pm_next to pick the next actionable item, or pm_context or pm_search before creating new work. \" +\n \"Prefer narrow tools (pm_next, pm_context, pm_list, pm_get, pm_search, pm_create, pm_copy, pm_focus, pm_update, pm_append, pm_claim, pm_release, pm_close, pm_comments, pm_files, pm_docs, pm_notes, pm_learnings, pm_deps, pm_graph, pm_test, pm_validate, pm_health, pm_contracts, pm_schema, pm_profile, pm_config, pm_plan) over pm_run when they cover the operation. \" +\n \"Use pm_plan for agent harness Plan workflows: it provides Codex/Claude/Cursor-style planning with durable steps, dependencies, decisions, discoveries, validation, and materialization. \" +\n \"Use pm_schema and pm_config for workspace configuration: pm_schema manages custom item types/statuses and pm_config reads or writes settings keys. \" +\n \"Use pm_run with an explicit action for active package-owned operations, plus activity, aggregate, history, stats, test-all, and gc. \" +\n \"Use history-redact for audited history-stream redaction workflows, history-repair to re-anchor a drifted history chain, and history-compact to checkpoint/prune long history streams while preserving replay integrity. \" +\n \"Set author to 'claude-code-agent' on all mutations. \" +\n \"Do not pass path during real repository tracking — only pass path for sandbox or test runs.\",\n };\n }\n if (request.method === \"tools/list\") {\n return { tools: TOOLS };\n }\n if (request.method === \"tools/call\") {\n const params = asRecordClone(request.params);\n const name = readRequiredString(params, \"name\");\n const handler = Object.prototype.hasOwnProperty.call(HANDLERS, name)\n ? HANDLERS[name]\n : undefined;\n if (!handler) {\n throw new PmCliError(`Unknown pm MCP tool: ${name}`, 64);\n }\n // pm-ydkl: defensive HTML-entity decode for free-text fields. Claude / the\n // Anthropic MCP SDK HTML-encodes `<` / `>` (and friends) in tool arguments\n // before they reach pm-cli, which would otherwise leak `&lt;type&gt;` into\n // stored pm comments / notes / item bodies. Direct CLI calls are not\n // affected; decoding at the MCP boundary normalizes the agent path while\n // leaving normal text untouched.\n const args = decodeHtmlEntitiesInOptions(asRecordClone(params.arguments));\n // pm-qxwu: non-breaking detection of typo'd / unexpected top-level keys.\n // additionalProperties stays true so passthrough still works; we only warn.\n // pm-upi0 extends the same mechanism into the nested options object.\n const warnings = [\n ...detectUnexpectedTopLevelKeys(name, args),\n ...detectUnexpectedOptionKeys(\n name,\n resolveInvokedAction(name, args),\n args,\n ),\n ];\n for (const warning of warnings) {\n console.error(`[pm-mcp] ${warning}`);\n }\n // cwd is applied inside the serialized activation cycle (see withActiveExtensions),\n // so the chdir/restore is exclusive per request and cannot race a concurrent caller.\n const result = await handler(args);\n return resultContent(result, warnings);\n }\n throw new PmCliError(\n `Unsupported MCP method: ${request.method ?? \"(missing)\"}`,\n 64,\n );\n}\n\nfunction writeResponse(\n id: JsonRpcRequest[\"id\"],\n payload: Record<string, unknown>,\n): void {\n process.stdout.write(\n `${JSON.stringify({ jsonrpc: \"2.0\", id, result: payload })}\\n`,\n );\n}\n\nfunction writeError(id: JsonRpcRequest[\"id\"], error: unknown): void {\n const code = error instanceof PmCliError ? error.exitCode : -32603;\n const message = error instanceof Error ? error.message : String(error);\n process.stdout.write(\n `${JSON.stringify({ jsonrpc: \"2.0\", id, error: { code, message } })}\\n`,\n );\n}\n\n// pm-3puw: parse one JSON-RPC line, dispatch it, and write the response. Kept\n// as a standalone async unit so the stdio loop can enqueue it onto a serial\n// queue (process lines in arrival order) and tests can drive it directly.\n/** Implements process rpc line for the public runtime surface of this module. */\nexport async function processRpcLine(line: string): Promise<void> {\n if (line.trim().length === 0) {\n return;\n }\n let request: JsonRpcRequest;\n try {\n request = JSON.parse(line) as JsonRpcRequest;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n writeError(null, new PmCliError(`Parse error: ${message}`, -32700));\n return;\n }\n if (\n typeof request !== \"object\" ||\n request === null ||\n Array.isArray(request)\n ) {\n writeError(\n null,\n new PmCliError(\"Invalid JSON-RPC request: expected an object\", -32600),\n );\n return;\n }\n const shouldRespond = Object.prototype.hasOwnProperty.call(request, \"id\");\n try {\n const result = await handleRequest(request);\n if (shouldRespond && result !== undefined) {\n writeResponse(request.id, result);\n }\n } catch (error) {\n if (!shouldRespond) {\n return;\n }\n if (request.method === \"tools/call\") {\n writeResponse(request.id, errorContent(error));\n } else {\n writeError(request.id, error);\n }\n }\n}\n\n/** Implements start mcp server for the public runtime surface of this module. */\nexport function startMcpServer(): void {\n const rl = readline.createInterface({\n input: process.stdin,\n crlfDelay: Infinity,\n });\n // pm-3puw: serialize line handling so pipelined requests are processed in\n // arrival order. The previous fire-and-forget handler ran requests\n // concurrently, so a client that pipelined two mutations on the same item\n // (without awaiting the first response) hit a lock conflict on the second.\n const queue = createSerialQueue();\n rl.on(\"line\", (line) => {\n void queue.enqueue(() => processRpcLine(line));\n });\n}\n\n// npm bin entries are symlinks (node_modules/.bin/pm-mcp -> dist/mcp/server.js),\n// so argv[1] must be realpath-resolved before comparing against this module's\n// path — a plain equality check made the published `pm-mcp` bin exit 0 without\n// ever starting the server (pm-qtbc).\n/** Implements check whether invoked as mcp main module for the public runtime surface of this module. */\nexport function isInvokedAsMcpMainModule(\n argvPath: string | undefined,\n moduleUrl: string,\n): boolean {\n if (!argvPath) {\n return false;\n }\n const selfPath = fileURLToPath(moduleUrl);\n if (argvPath === selfPath) {\n return true;\n }\n try {\n return realpathSync(argvPath) === realpathSync(selfPath);\n } catch {\n return false;\n }\n}\n\ntype RuntimeTestHooks = NonNullable<\n typeof globalThis.__pmCliActionRunnerTestHooks\n>;\ntype RuntimeTestHookKey = keyof RuntimeTestHooks;\n\nfunction readRuntimeTestHook<Key extends RuntimeTestHookKey>(\n key: Key,\n): RuntimeTestHooks[Key] {\n const runtimeTestHooks = globalThis.__pmCliActionRunnerTestHooks;\n if (runtimeTestHooks === undefined) {\n throw new PmCliError(\n `MCP runtime test hook \"${String(key)}\" is only available in test environments.`,\n 64,\n );\n }\n return runtimeTestHooks[key];\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n get closeManyOptionsFromFlat() {\n return readRuntimeTestHook(\"closeManyOptionsFromFlat\");\n },\n detectUnexpectedOptionKeys,\n detectUnexpectedTopLevelKeys,\n errorContent,\n get extensionOptionsFromArgs() {\n return readRuntimeTestHook(\"extensionOptionsFromArgs\");\n },\n get globalOptions() {\n return readRuntimeTestHook(\"globalOptions\");\n },\n get mutationListOptions() {\n return readRuntimeTestHook(\"mutationListOptions\");\n },\n nearestDeclaredKey,\n get normalizeActionName() {\n return readRuntimeTestHook(\"normalizeActionName\");\n },\n get normalizeCommandPath() {\n return readRuntimeTestHook(\"normalizeCommandPath\");\n },\n get normalizeMcpOptionsArrays() {\n return readRuntimeTestHook(\"normalizeMcpOptionsArrays\");\n },\n get normalizeMcpUpdateOptions() {\n return readRuntimeTestHook(\"normalizeMcpUpdateOptions\");\n },\n get optionsWithAuthor() {\n return readRuntimeTestHook(\"optionsWithAuthor\");\n },\n get readRequiredString() {\n return readRuntimeTestHook(\"readRequiredString\");\n },\n get readScalarString() {\n return readRuntimeTestHook(\"readScalarString\");\n },\n get readScalarStringAllowBlank() {\n return readRuntimeTestHook(\"readScalarStringAllowBlank\");\n },\n get readStringArray() {\n return readRuntimeTestHook(\"readStringArray\");\n },\n runAction,\n get updateManyOptionsFromFlat() {\n return readRuntimeTestHook(\"updateManyOptionsFromFlat\");\n },\n get withAddNoteOption() {\n return readRuntimeTestHook(\"withAddNoteOption\");\n },\n get withFilesDiscoveryOptions() {\n return readRuntimeTestHook(\"withFilesDiscoveryOptions\");\n },\n get withMutationCompaction() {\n return readRuntimeTestHook(\"withMutationCompaction\");\n },\n writeError,\n};\n\n/* c8 ignore start */\nif (isInvokedAsMcpMainModule(process.argv[1], import.meta.url)) {\n startMcpServer();\n}\n/* c8 ignore stop */\n"],"names":[],"mappings":";AACA;;;;GAIG;;;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAA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O,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IAChD,CAAC;IACD,SAAS;IACT,IAAI,yBAAyB;QAC3B,OAAO,mBAAmB,CAAC,2BAA2B,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,iBAAiB;QACnB,OAAO,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,yBAAyB;QAC3B,OAAO,mBAAmB,CAAC,2BAA2B,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,sBAAsB;QACxB,OAAO,mBAAmB,CAAC,wBAAwB,CAAC,CAAC;IACvD,CAAC;IACD,UAAU;CACX,CAAC;AAEF,qBAAqB;AACrB,IAAI,wBAAwB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC/D,cAAc,EAAE,CAAC;AACnB,CAAC;AACD,oBAAoB","debugId":"1783660a-269d-5a07-bea8-66359c895c7c"}
@@ -4,8 +4,8 @@
4
4
  * Defines the Tool Definitions module for pm CLI source.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="478bf194-a9d0-5c6a-b70e-d15164927fda")}catch(e){}}();
8
- import { PM_TOOL_ACTIONS } from "../sdk/cli-contracts/enum-contracts.js";
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]="3cdd51a1-c5ae-500e-b228-b3f2cf101aae")}catch(e){}}();
8
+ import { GRAPH_SUBCOMMAND_VALUES, PM_TOOL_ACTIONS, } from "../sdk/cli-contracts/enum-contracts.js";
9
9
  import { COPY_FLAG_CONTRACTS } from "../sdk/cli-contracts/flag-contracts.js";
10
10
  import { RUNTIME_STATUS_ROLE_VALUES } from "../types.js";
11
11
  const TOOL_SCHEMA_BASE = {
@@ -336,11 +336,24 @@ export const TOOLS = [
336
336
  },
337
337
  {
338
338
  name: "pm_deps",
339
- description: "Read dependency trees/graphs or one bounded explainable relationship context packet. Use options.format=context with depth, node, edge, token, and cursor bounds.",
339
+ description: "Read dependency trees/graphs or one bounded explainable relationship context packet. Use options.format=context with direction, kind, depth, node, edge, token, and cursor bounds; context returns a counts-first summary, per-node roles/reasons, root evidence pointers, and enumerated missing references.",
340
340
  inputSchema: objectSchema({ id: idSchema, options: { type: "object" } }, [
341
341
  "id",
342
342
  ]),
343
343
  },
344
+ {
345
+ name: "pm_graph",
346
+ description: "Run bounded workspace relationship-graph queries: ancestors/descendants (hierarchy), predecessors/successors (ordering), paths, impact (blast radius), analyze (execution + knowledge analytics), audit (governance findings), communities (label-propagation clusters), redundancy (transitively implied edges), dominators (structural bottlenecks), and plan (dry-run remediation proposals derived from the audit). Traversals, paths, impact, and dominators require id; paths also requires target. Options support kind, maxDepth, limit, after, direction, maxPaths, sample, exemptIsolate, and counts-first summary.",
347
+ inputSchema: objectSchema({
348
+ subcommand: {
349
+ type: "string",
350
+ enum: [...GRAPH_SUBCOMMAND_VALUES],
351
+ },
352
+ id: idSchema,
353
+ target: idSchema,
354
+ options: { type: "object" },
355
+ }, ["subcommand"]),
356
+ },
344
357
  {
345
358
  name: "pm_test",
346
359
  description: "List, add, remove, or run linked tests for a pm item.",
@@ -571,4 +584,4 @@ export function buildMcpToolContracts() {
571
584
  }).sort((left, right) => left.name.localeCompare(right.name));
572
585
  }
573
586
  //# sourceMappingURL=tool-definitions.js.map
574
- //# debugId=478bf194-a9d0-5c6a-b70e-d15164927fda
587
+ //# debugId=3cdd51a1-c5ae-500e-b228-b3f2cf101aae
@@ -1 +1 @@
1
- {"version":3,"file":"tool-definitions.js","sources":["mcp/tool-definitions.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module mcp/tool-definitions\n *\n * Defines the Tool Definitions module for pm CLI source.\n */\nimport { PM_TOOL_ACTIONS } from \"../sdk/cli-contracts/enum-contracts.js\";\nimport { COPY_FLAG_CONTRACTS } from \"../sdk/cli-contracts/flag-contracts.js\";\nimport { RUNTIME_STATUS_ROLE_VALUES } from \"../types.js\";\n\n/**\n * Static MCP tool surface for the pm MCP server.\n *\n * Kept as a dependency-light data module (only the enum contract import) so the\n * `pm contracts` command can snapshot the tool surface into the contract\n * golden file (pm-4os2) without importing the full MCP server runtime, and so\n * the server itself stays the single consumer of the dispatch handlers.\n */\nexport interface ToolDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports description for this contract. */\n description: string;\n /** Value that configures or reports input schema for this contract. */\n inputSchema: Record<string, unknown>;\n}\n\nconst TOOL_SCHEMA_BASE = {\n type: \"object\",\n properties: {\n cwd: {\n type: \"string\",\n description:\n \"Workspace directory to run the native pm operation in. Defaults to the MCP server process cwd.\",\n },\n path: {\n type: \"string\",\n description:\n \"Optional pm data root, equivalent to PM_PATH/global --path. Leave unset for real repository tracking.\",\n },\n author: {\n type: \"string\",\n description:\n \"Mutation author. Defaults to PM_AUTHOR or pm settings when supported by the underlying operation.\",\n },\n },\n additionalProperties: true,\n} as const;\n\nconst idSchema = {\n type: \"string\",\n description: \"pm item id, for example pm-abc1.\",\n};\n\n// pm-fd8n: derive the pm_run action enumeration from the canonical\n// PM_TOOL_ACTIONS contract instead of a hand-maintained prose list, so the\n// MCP-facing description can never drift from the actual supported actions.\nconst PM_RUN_ACTION_DESCRIPTION =\n `Operation name (one of): ${PM_TOOL_ACTIONS.join(\", \")}. ` +\n \"Package-owned actions are available dynamically when their provider package is installed.\";\n\nconst LIST_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = {\n status: { type: \"string\", description: \"Alias for options.status.\" },\n type: { type: \"string\", description: \"Alias for options.type.\" },\n tag: { type: \"string\", description: \"Alias for options.tag.\" },\n priority: { type: \"string\", description: \"Alias for options.priority.\" },\n limit: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.limit.\",\n },\n offset: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.offset.\",\n },\n};\n\nconst SEARCH_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = {\n mode: { type: \"string\", description: \"Alias for options.mode.\" },\n status: { type: \"string\", description: \"Alias for options.status.\" },\n type: { type: \"string\", description: \"Alias for options.type.\" },\n tag: { type: \"string\", description: \"Alias for options.tag.\" },\n priority: { type: \"string\", description: \"Alias for options.priority.\" },\n limit: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.limit.\",\n },\n};\n\nconst COPY_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = Object.fromEntries(\n COPY_FLAG_CONTRACTS.filter(({ flag }) => flag !== \"--author\").map(({ flag }) => [\n flag.slice(2),\n { type: \"string\", description: `Alias for options.${flag.slice(2).replaceAll(\"-\", \"_\")}.` },\n ]),\n);\n\nfunction objectSchema(\n properties: Record<string, unknown>,\n required: string[] = [],\n): Record<string, unknown> {\n return {\n ...TOOL_SCHEMA_BASE,\n properties: {\n ...TOOL_SCHEMA_BASE.properties,\n ...properties,\n },\n required,\n };\n}\n\n/** Public contract for tools, shared by SDK and presentation-layer consumers. */\nexport const TOOLS: ToolDefinition[] = [\n {\n name: \"pm_run\",\n description:\n \"Run any supported pm operation natively through the pm library. Use this for commands not covered by narrower pm_* tools.\",\n inputSchema: objectSchema(\n {\n action: {\n type: \"string\",\n description: PM_RUN_ACTION_DESCRIPTION,\n },\n id: idSchema,\n query: {\n type: \"string\",\n description: \"Search query for action=search.\",\n },\n reason: {\n type: \"string\",\n description: \"Close reason for action=close.\",\n },\n force: {\n type: \"boolean\",\n description:\n \"Force ownership/terminal-state override when supported.\",\n },\n // pm-v68d: the schema-specific subcommand enum and add-type/add-status\n // properties migrated to the dedicated pm_schema tool. action=schema\n // still accepts them as passthrough, but agents should prefer pm_schema.\n subcommand: {\n type: \"string\",\n description:\n \"Subcommand selector for actions that take one (for example telemetry, or schema — prefer the dedicated pm_schema tool for schema operations).\",\n },\n options: {\n type: \"object\",\n description: \"Underlying pm command options using camelCase keys.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"For mutation actions, return the full changed_fields array instead of the default changed_field_count.\",\n },\n idOnly: {\n type: \"boolean\",\n description:\n \"For single-item mutation actions, return only id and status.\",\n },\n },\n [\"action\"],\n ),\n },\n {\n name: \"pm_context\",\n description:\n \"Return the agent-oriented project context snapshot. \" +\n \"Pass options.depth=brief|standard|deep|full (full = every section with no per-section row cap), \" +\n \"options.parent='<id>' to scope the snapshot to one item's subtree (the item plus all descendants), \" +\n \"options.fields='id,title,priority' to project focus rows to a field subset for low-token reads, \" +\n \"or options.section=['hierarchy','progress',...] to pick sections.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_next\",\n description:\n \"Recommend the next actionable work item: the single highest-priority READY item \" +\n \"(active status, no open blockers, no open children; completed containers surface only when no concrete leaf work is ready) plus the ranked ready and blocked queues. \" +\n \"The recommended item carries a rationale and each blocked item lists the open blockers gating it. \" +\n \"Pass options.parent='<id>' to scope to one subtree, options.limit=N to cap ready rows, \" +\n \"options.readyOnly=true to omit the blocked list, or filters (options.type/tag/priority/assignee/sprint/release). \" +\n \"The most token-efficient 'what should I do now?' read for agents.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_search\",\n description:\n \"Search pm items with keyword, semantic, or hybrid search. \" +\n \"Defaults to a compact projection for token efficiency. \" +\n \"Pass options.mode=keyword|semantic|hybrid, options.limit=N to cap hits, \" +\n \"options.status='all' for no lifecycle restriction, \" +\n \"options.fields='id,title,score' for a custom projection, or options.full=true for full item bodies (can be large). \" +\n \"The result echoes the applied filters and projection mode in query_summary.\",\n inputSchema: objectSchema(\n {\n query: { type: \"string\" },\n options: { type: \"object\" },\n ...SEARCH_TOP_LEVEL_OPTION_PROPERTIES,\n },\n [\"query\"],\n ),\n },\n {\n name: \"pm_list\",\n description:\n \"List pm items with status/type/tag/priority filters. Defaults to compact projection for token efficiency. \" +\n \"options.status accepts CSV (all,open,in_progress). \" +\n \"Pass options.compact=false or options.includeBody=true for full bodies/comments. \" +\n \"Pass options.brief=true for ultra-terse (id/status/type/title only). \" +\n \"Pass options.fields='id,title,priority' for custom projection. \" +\n \"Pass options.limit=N to cap row count. \" +\n \"The result echoes the applied filters and projection mode in query_summary.\",\n inputSchema: objectSchema({\n options: { type: \"object\" },\n ...LIST_TOP_LEVEL_OPTION_PROPERTIES,\n }),\n },\n {\n name: \"pm_get\",\n description:\n \"Read one pm item with shared SDK projections. Pass options.depth='brief' or options.fields='id,title,status' for low-token inspection, options.fields='id,schedule.start_at' for schedule context, or options.at='7' / an ISO timestamp for a verified mutation-free historical read. Parent results include bounded child counts, samples, and continuation metadata.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n options: {\n type: \"object\",\n description:\n \"Get options such as depth=brief|standard|deep|full, fields=id,title,status, or at=<version|ISO timestamp>.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_create\",\n description:\n \"Create a pm item natively and write pm history. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count for token efficiency); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n allowMissingParent: {\n type: \"boolean\",\n description:\n \"Allow unresolved parent references and emit a validation warning.\",\n },\n options: {\n type: \"object\",\n description: \"Create options. title and description are required.\",\n },\n },\n [\"options\"],\n ),\n },\n {\n name: \"pm_copy\",\n description:\n \"Copy an existing pm item into a new id while resetting lifecycle fields. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n ...COPY_TOP_LEVEL_OPTION_PROPERTIES,\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n idOnly: {\n type: \"boolean\",\n description: \"Return only id and status.\",\n },\n options: {\n type: \"object\",\n description:\n \"Copy options such as title override, author, and message.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_focus\",\n description:\n \"Set, clear, or show the session focused item. When focused, pm_create defaults its parent to the focused item \" +\n \"(an explicit parent still overrides). Pass id to focus an item, options.clear=true to clear, or neither to show current focus.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n clear: {\n type: \"boolean\",\n description: \"Clear the focused item (cannot be combined with id).\",\n },\n options: {\n type: \"object\",\n description: \"Focus options such as clear (boolean).\",\n },\n },\n [],\n ),\n },\n {\n name: \"pm_update\",\n description:\n \"Update pm item metadata/body/dependencies/log seeds natively. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields delta.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n options: { type: \"object\" },\n },\n [\"id\", \"options\"],\n ),\n },\n {\n name: \"pm_append\",\n description:\n \"Append markdown text to a pm item body and write pm history. Useful for seeding evidence/log entries before close. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n body: {\n type: \"string\",\n description:\n \"Markdown text to append to the item body. Required here or as options.body.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n options: {\n type: \"object\",\n description: \"Append options such as body, author, and message.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_claim\",\n description: \"Claim a pm item.\",\n inputSchema: objectSchema(\n { id: idSchema, force: { type: \"boolean\" }, options: { type: \"object\" } },\n [\"id\"],\n ),\n },\n {\n name: \"pm_release\",\n description: \"Release a pm item claim.\",\n inputSchema: objectSchema(\n { id: idSchema, force: { type: \"boolean\" }, options: { type: \"object\" } },\n [\"id\"],\n ),\n },\n {\n name: \"pm_close\",\n description:\n \"Close a pm item with optional close reason and optional close validation (reason requirement follows governance settings). \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n reason: {\n type: \"string\",\n description:\n \"Close reason text when provided or required by governance settings.\",\n },\n duplicateOf: {\n type: \"string\",\n description:\n \"Canonical item id when closing this item as a duplicate.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n idOnly: { type: \"boolean\", description: \"Return only id and status.\" },\n options: { type: \"object\" },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_comments\",\n description:\n \"List, add, edit, or delete comments on a pm item. Use options.add to append, options.edit=<1-based index> with replacement text to fix a comment, or options.delete=<1-based index> to remove one. \" +\n \"List calls default to the most recent 20 comments with total_count/has_more metadata for token efficiency. \" +\n \"Pass options.limit=N to choose a page size, options.limit=0 for summary-only metadata, or options.full=true for full history.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_files\",\n description:\n \"List, add, remove, or validate linked files for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_docs\",\n description: \"List, add, or remove linked docs for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_notes\",\n description:\n \"List or add structured notes on a pm item. Use options.add to append a note; omit it to list existing notes.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_learnings\",\n description:\n \"List or add learnings on a pm item. Use options.add to capture a learning/insight; omit it to list existing learnings.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_deps\",\n description:\n \"Read dependency trees/graphs or one bounded explainable relationship context packet. Use options.format=context with depth, node, edge, token, and cursor bounds.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_test\",\n description: \"List, add, remove, or run linked tests for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_validate\",\n description: \"Run pm validation checks.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_health\",\n description:\n \"Run pm health diagnostics. Pass options.brief=true for compact low-token details, options.skipIntegrity=true, options.skipDrift=true, options.skipVectors=true for a fast status-only check, or options.full=true for the complete deep check.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_contracts\",\n description:\n \"Inspect pm command, flag, schema, and availability contracts.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_schema\",\n description:\n \"Inspect or modify the workspace item-type/status/field schema (pm schema). \" +\n \"subcommand selects the operation; name carries the item type name (show/add-type/remove-type), status id (show-status/add-status/remove-status), or field key (show-field/add-field/remove-field). \" +\n \"apply-preset adopts a domain type preset; add-type with infer=true derives types from title-prefix conventions. \" +\n \"Schema mutations write workspace config files, not item history.\",\n inputSchema: objectSchema(\n {\n subcommand: {\n type: \"string\",\n enum: [\n \"list\",\n \"show\",\n \"show-status\",\n \"add-type\",\n \"remove-type\",\n \"add-status\",\n \"remove-status\",\n \"add-field\",\n \"remove-field\",\n \"list-fields\",\n \"show-field\",\n \"apply-preset\",\n ],\n description: \"Schema subcommand to run.\",\n },\n name: {\n type: \"string\",\n description:\n \"Item type name (show/add-type/remove-type), status id (show-status/add-status/remove-status), or custom field key (show-field/add-field/remove-field). Required for those subcommands.\",\n },\n description: {\n type: \"string\",\n description:\n \"Custom item type, status, or field description for add-type/add-status/add-field.\",\n },\n defaultStatus: {\n type: \"string\",\n description: \"Default status for add-type.\",\n },\n folder: { type: \"string\", description: \"Storage folder for add-type.\" },\n alias: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Aliases for add-type/add-status, or extra CLI flag aliases for add-field.\",\n },\n role: {\n type: \"array\",\n items: { type: \"string\", enum: [...RUNTIME_STATUS_ROLE_VALUES] },\n description: `Lifecycle roles for add-status: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n },\n order: {\n type: \"number\",\n description: \"Display/sort order for add-status.\",\n },\n fieldType: {\n type: \"string\",\n enum: [\"string\", \"number\", \"boolean\", \"string_array\"],\n description: \"Value type for a custom field (add-field).\",\n },\n commands: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Commands a custom field is wired onto (add-field): create, update, update_many, list, search, calendar, context.\",\n },\n cliFlag: {\n type: \"string\",\n description:\n \"Override the auto-derived CLI flag for a custom field (add-field).\",\n },\n required: {\n type: \"boolean\",\n description: \"Mark a custom field as always required (add-field).\",\n },\n requiredOnCreate: {\n type: \"boolean\",\n description:\n \"Mark a custom field as required at create time (add-field).\",\n },\n allowUnset: {\n type: \"boolean\",\n description:\n \"Whether a custom field may be cleared via --unset (add-field); defaults to true.\",\n },\n requiredTypes: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Restrict a custom field's requirement to specific item types (add-field).\",\n },\n typePreset: {\n type: \"string\",\n enum: [\"agile\", \"ops\", \"research\"],\n description: \"Domain type preset to adopt (apply-preset).\",\n },\n infer: {\n type: \"boolean\",\n description:\n \"Infer item types from title-prefix conventions (add-type); previews unless apply is true.\",\n },\n minCount: {\n type: \"number\",\n description:\n \"Minimum items sharing a prefix for add-type inference (default 10).\",\n },\n apply: {\n type: \"boolean\",\n description:\n \"Register inferred types (add-type infer); without it the call previews only.\",\n },\n force: {\n type: \"boolean\",\n description:\n \"Override removal guardrails for destructive schema changes when supported.\",\n },\n options: {\n type: \"object\",\n description: \"Additional schema options using camelCase keys.\",\n },\n },\n [\"subcommand\"],\n ),\n },\n {\n name: \"pm_profile\",\n description:\n \"List, show, apply, or lint project profiles (pm profile) — archetype bundles that stage item types, statuses, fields, per-type workflows, config knobs, create templates, and recommended packages. \" +\n \"subcommand selects the operation; name carries the profile name (agile, ops, research) for show/apply/lint. \" +\n \"apply stages every dimension idempotently; dryRun previews the diff without writing; lint reports author-time consistency findings (graded error/warning) without touching the tracker. Profile staging writes workspace config/schema files, not item history.\",\n inputSchema: objectSchema(\n {\n subcommand: {\n type: \"string\",\n enum: [\"list\", \"show\", \"apply\", \"lint\"],\n description: \"Profile subcommand to run.\",\n },\n name: {\n type: \"string\",\n description:\n \"Profile name for show/apply/lint. Required for those subcommands. Built-ins are agile, ops, and research; an active extension can contribute additional archetype names that resolve here too.\",\n },\n dryRun: {\n type: \"boolean\",\n description:\n \"Preview the apply diff without writing any files (apply).\",\n },\n author: { type: \"string\", description: \"Mutation author for apply.\" },\n force: {\n type: \"boolean\",\n description: \"Force ownership/lock override for apply.\",\n },\n options: {\n type: \"object\",\n description: \"Additional profile options using camelCase keys.\",\n },\n },\n [\"subcommand\"],\n ),\n },\n {\n name: \"pm_config\",\n description:\n \"Read or write pm workspace configuration (pm config). \" +\n \"configAction selects get/set/list/export; key/value address a single setting for get/set. \" +\n \"scope chooses the project (default) or global settings file.\",\n inputSchema: objectSchema(\n {\n configAction: {\n type: \"string\",\n enum: [\"get\", \"set\", \"list\", \"export\"],\n description:\n \"Config operation to perform. get/set require key; list/export dump the resolved settings surface.\",\n },\n key: {\n type: \"string\",\n description:\n \"Settings key for get/set, for example governance-require-close-reason, telemetry-tracking, or a nested leaf such as search_provider (dash and underscore variants accepted; configAction=get without a key lists supported keys in the error).\",\n },\n value: {\n type: \"string\",\n description: \"New value for configAction=set.\",\n },\n scope: {\n type: \"string\",\n enum: [\"project\", \"global\"],\n description: \"Settings scope to read or write. Defaults to project.\",\n },\n options: {\n type: \"object\",\n description:\n \"Additional config options such as criterion, clearCriteria, format, or policy.\",\n },\n },\n [\"configAction\"],\n ),\n },\n {\n name: \"pm_plan\",\n description:\n \"Run agent-optimized Plan workflows. options.subcommand selects: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize. Provide id for all non-create subcommands; provide stepRef for step lifecycle subcommands. Plans store agent-readable steps with dependencies, decisions, discoveries, validation, and resume context.\",\n inputSchema: objectSchema({\n id: {\n type: \"string\",\n description: \"Plan id (required for all subcommands except create).\",\n },\n stepRef: {\n type: \"string\",\n description: \"Step id or order for step lifecycle subcommands.\",\n },\n reorderTo: { type: \"number\", description: \"New order for reorder-step.\" },\n options: {\n type: \"object\",\n description:\n \"Plan options including subcommand, stepRef, stepStatus, link, depth, etc.\",\n },\n }),\n },\n];\n\n/** Stable projection of one MCP tool definition for the contract golden file (pm-4os2): tool name, description, required top-level fields, and the full inputSchema shape. Any drift (typo'd property, dropped required field, changed TOOL_SCHEMA_BASE) shows up in `pnpm contracts:check`. */\nexport interface McpToolContract {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports description for this contract. */\n description: string;\n /** Value that configures or reports required for this contract. */\n required: string[];\n /** Value that configures or reports input schema for this contract. */\n input_schema: Record<string, unknown>;\n}\n\n/** Implements build mcp tool contracts for the public runtime surface of this module. */\nexport function buildMcpToolContracts(): McpToolContract[] {\n return TOOLS.map((tool) => {\n const schemaRequired = tool.inputSchema[\"required\"];\n const required = Array.isArray(schemaRequired)\n ? schemaRequired\n .map((entry) => String(entry))\n .sort((left, right) => left.localeCompare(right))\n : [];\n return {\n name: tool.name,\n description: tool.description,\n required,\n input_schema: tool.inputSchema,\n };\n }).sort((left, right) => left.name.localeCompare(right.name));\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,0BAA0B,E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E,IAAI,CAAC,WAAW;YAC7B,QAAQ;YACR,YAAY,EAAE,IAAI,CAAC,WAAW;SAC/B,CAAC;IACJ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC","debugId":"478bf194-a9d0-5c6a-b70e-d15164927fda"}
1
+ {"version":3,"file":"tool-definitions.js","sources":["mcp/tool-definitions.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module mcp/tool-definitions\n *\n * Defines the Tool Definitions module for pm CLI source.\n */\nimport {\n GRAPH_SUBCOMMAND_VALUES,\n PM_TOOL_ACTIONS,\n} from \"../sdk/cli-contracts/enum-contracts.js\";\nimport { COPY_FLAG_CONTRACTS } from \"../sdk/cli-contracts/flag-contracts.js\";\nimport { RUNTIME_STATUS_ROLE_VALUES } from \"../types.js\";\n\n/**\n * Static MCP tool surface for the pm MCP server.\n *\n * Kept as a dependency-light data module (only the enum contract import) so the\n * `pm contracts` command can snapshot the tool surface into the contract\n * golden file (pm-4os2) without importing the full MCP server runtime, and so\n * the server itself stays the single consumer of the dispatch handlers.\n */\nexport interface ToolDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports description for this contract. */\n description: string;\n /** Value that configures or reports input schema for this contract. */\n inputSchema: Record<string, unknown>;\n}\n\nconst TOOL_SCHEMA_BASE = {\n type: \"object\",\n properties: {\n cwd: {\n type: \"string\",\n description:\n \"Workspace directory to run the native pm operation in. Defaults to the MCP server process cwd.\",\n },\n path: {\n type: \"string\",\n description:\n \"Optional pm data root, equivalent to PM_PATH/global --path. Leave unset for real repository tracking.\",\n },\n author: {\n type: \"string\",\n description:\n \"Mutation author. Defaults to PM_AUTHOR or pm settings when supported by the underlying operation.\",\n },\n },\n additionalProperties: true,\n} as const;\n\nconst idSchema = {\n type: \"string\",\n description: \"pm item id, for example pm-abc1.\",\n};\n\n// pm-fd8n: derive the pm_run action enumeration from the canonical\n// PM_TOOL_ACTIONS contract instead of a hand-maintained prose list, so the\n// MCP-facing description can never drift from the actual supported actions.\nconst PM_RUN_ACTION_DESCRIPTION =\n `Operation name (one of): ${PM_TOOL_ACTIONS.join(\", \")}. ` +\n \"Package-owned actions are available dynamically when their provider package is installed.\";\n\nconst LIST_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = {\n status: { type: \"string\", description: \"Alias for options.status.\" },\n type: { type: \"string\", description: \"Alias for options.type.\" },\n tag: { type: \"string\", description: \"Alias for options.tag.\" },\n priority: { type: \"string\", description: \"Alias for options.priority.\" },\n limit: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.limit.\",\n },\n offset: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.offset.\",\n },\n};\n\nconst SEARCH_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = {\n mode: { type: \"string\", description: \"Alias for options.mode.\" },\n status: { type: \"string\", description: \"Alias for options.status.\" },\n type: { type: \"string\", description: \"Alias for options.type.\" },\n tag: { type: \"string\", description: \"Alias for options.tag.\" },\n priority: { type: \"string\", description: \"Alias for options.priority.\" },\n limit: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.limit.\",\n },\n};\n\nconst COPY_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = Object.fromEntries(\n COPY_FLAG_CONTRACTS.filter(({ flag }) => flag !== \"--author\").map(({ flag }) => [\n flag.slice(2),\n { type: \"string\", description: `Alias for options.${flag.slice(2).replaceAll(\"-\", \"_\")}.` },\n ]),\n);\n\nfunction objectSchema(\n properties: Record<string, unknown>,\n required: string[] = [],\n): Record<string, unknown> {\n return {\n ...TOOL_SCHEMA_BASE,\n properties: {\n ...TOOL_SCHEMA_BASE.properties,\n ...properties,\n },\n required,\n };\n}\n\n/** Public contract for tools, shared by SDK and presentation-layer consumers. */\nexport const TOOLS: ToolDefinition[] = [\n {\n name: \"pm_run\",\n description:\n \"Run any supported pm operation natively through the pm library. Use this for commands not covered by narrower pm_* tools.\",\n inputSchema: objectSchema(\n {\n action: {\n type: \"string\",\n description: PM_RUN_ACTION_DESCRIPTION,\n },\n id: idSchema,\n query: {\n type: \"string\",\n description: \"Search query for action=search.\",\n },\n reason: {\n type: \"string\",\n description: \"Close reason for action=close.\",\n },\n force: {\n type: \"boolean\",\n description:\n \"Force ownership/terminal-state override when supported.\",\n },\n // pm-v68d: the schema-specific subcommand enum and add-type/add-status\n // properties migrated to the dedicated pm_schema tool. action=schema\n // still accepts them as passthrough, but agents should prefer pm_schema.\n subcommand: {\n type: \"string\",\n description:\n \"Subcommand selector for actions that take one (for example telemetry, or schema — prefer the dedicated pm_schema tool for schema operations).\",\n },\n options: {\n type: \"object\",\n description: \"Underlying pm command options using camelCase keys.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"For mutation actions, return the full changed_fields array instead of the default changed_field_count.\",\n },\n idOnly: {\n type: \"boolean\",\n description:\n \"For single-item mutation actions, return only id and status.\",\n },\n },\n [\"action\"],\n ),\n },\n {\n name: \"pm_context\",\n description:\n \"Return the agent-oriented project context snapshot. \" +\n \"Pass options.depth=brief|standard|deep|full (full = every section with no per-section row cap), \" +\n \"options.parent='<id>' to scope the snapshot to one item's subtree (the item plus all descendants), \" +\n \"options.fields='id,title,priority' to project focus rows to a field subset for low-token reads, \" +\n \"or options.section=['hierarchy','progress',...] to pick sections.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_next\",\n description:\n \"Recommend the next actionable work item: the single highest-priority READY item \" +\n \"(active status, no open blockers, no open children; completed containers surface only when no concrete leaf work is ready) plus the ranked ready and blocked queues. \" +\n \"The recommended item carries a rationale and each blocked item lists the open blockers gating it. \" +\n \"Pass options.parent='<id>' to scope to one subtree, options.limit=N to cap ready rows, \" +\n \"options.readyOnly=true to omit the blocked list, or filters (options.type/tag/priority/assignee/sprint/release). \" +\n \"The most token-efficient 'what should I do now?' read for agents.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_search\",\n description:\n \"Search pm items with keyword, semantic, or hybrid search. \" +\n \"Defaults to a compact projection for token efficiency. \" +\n \"Pass options.mode=keyword|semantic|hybrid, options.limit=N to cap hits, \" +\n \"options.status='all' for no lifecycle restriction, \" +\n \"options.fields='id,title,score' for a custom projection, or options.full=true for full item bodies (can be large). \" +\n \"The result echoes the applied filters and projection mode in query_summary.\",\n inputSchema: objectSchema(\n {\n query: { type: \"string\" },\n options: { type: \"object\" },\n ...SEARCH_TOP_LEVEL_OPTION_PROPERTIES,\n },\n [\"query\"],\n ),\n },\n {\n name: \"pm_list\",\n description:\n \"List pm items with status/type/tag/priority filters. Defaults to compact projection for token efficiency. \" +\n \"options.status accepts CSV (all,open,in_progress). \" +\n \"Pass options.compact=false or options.includeBody=true for full bodies/comments. \" +\n \"Pass options.brief=true for ultra-terse (id/status/type/title only). \" +\n \"Pass options.fields='id,title,priority' for custom projection. \" +\n \"Pass options.limit=N to cap row count. \" +\n \"The result echoes the applied filters and projection mode in query_summary.\",\n inputSchema: objectSchema({\n options: { type: \"object\" },\n ...LIST_TOP_LEVEL_OPTION_PROPERTIES,\n }),\n },\n {\n name: \"pm_get\",\n description:\n \"Read one pm item with shared SDK projections. Pass options.depth='brief' or options.fields='id,title,status' for low-token inspection, options.fields='id,schedule.start_at' for schedule context, or options.at='7' / an ISO timestamp for a verified mutation-free historical read. Parent results include bounded child counts, samples, and continuation metadata.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n options: {\n type: \"object\",\n description:\n \"Get options such as depth=brief|standard|deep|full, fields=id,title,status, or at=<version|ISO timestamp>.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_create\",\n description:\n \"Create a pm item natively and write pm history. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count for token efficiency); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n allowMissingParent: {\n type: \"boolean\",\n description:\n \"Allow unresolved parent references and emit a validation warning.\",\n },\n options: {\n type: \"object\",\n description: \"Create options. title and description are required.\",\n },\n },\n [\"options\"],\n ),\n },\n {\n name: \"pm_copy\",\n description:\n \"Copy an existing pm item into a new id while resetting lifecycle fields. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n ...COPY_TOP_LEVEL_OPTION_PROPERTIES,\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n idOnly: {\n type: \"boolean\",\n description: \"Return only id and status.\",\n },\n options: {\n type: \"object\",\n description:\n \"Copy options such as title override, author, and message.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_focus\",\n description:\n \"Set, clear, or show the session focused item. When focused, pm_create defaults its parent to the focused item \" +\n \"(an explicit parent still overrides). Pass id to focus an item, options.clear=true to clear, or neither to show current focus.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n clear: {\n type: \"boolean\",\n description: \"Clear the focused item (cannot be combined with id).\",\n },\n options: {\n type: \"object\",\n description: \"Focus options such as clear (boolean).\",\n },\n },\n [],\n ),\n },\n {\n name: \"pm_update\",\n description:\n \"Update pm item metadata/body/dependencies/log seeds natively. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields delta.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n options: { type: \"object\" },\n },\n [\"id\", \"options\"],\n ),\n },\n {\n name: \"pm_append\",\n description:\n \"Append markdown text to a pm item body and write pm history. Useful for seeding evidence/log entries before close. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n body: {\n type: \"string\",\n description:\n \"Markdown text to append to the item body. Required here or as options.body.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n options: {\n type: \"object\",\n description: \"Append options such as body, author, and message.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_claim\",\n description: \"Claim a pm item.\",\n inputSchema: objectSchema(\n { id: idSchema, force: { type: \"boolean\" }, options: { type: \"object\" } },\n [\"id\"],\n ),\n },\n {\n name: \"pm_release\",\n description: \"Release a pm item claim.\",\n inputSchema: objectSchema(\n { id: idSchema, force: { type: \"boolean\" }, options: { type: \"object\" } },\n [\"id\"],\n ),\n },\n {\n name: \"pm_close\",\n description:\n \"Close a pm item with optional close reason and optional close validation (reason requirement follows governance settings). \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n reason: {\n type: \"string\",\n description:\n \"Close reason text when provided or required by governance settings.\",\n },\n duplicateOf: {\n type: \"string\",\n description:\n \"Canonical item id when closing this item as a duplicate.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n idOnly: { type: \"boolean\", description: \"Return only id and status.\" },\n options: { type: \"object\" },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_comments\",\n description:\n \"List, add, edit, or delete comments on a pm item. Use options.add to append, options.edit=<1-based index> with replacement text to fix a comment, or options.delete=<1-based index> to remove one. \" +\n \"List calls default to the most recent 20 comments with total_count/has_more metadata for token efficiency. \" +\n \"Pass options.limit=N to choose a page size, options.limit=0 for summary-only metadata, or options.full=true for full history.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_files\",\n description:\n \"List, add, remove, or validate linked files for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_docs\",\n description: \"List, add, or remove linked docs for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_notes\",\n description:\n \"List or add structured notes on a pm item. Use options.add to append a note; omit it to list existing notes.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_learnings\",\n description:\n \"List or add learnings on a pm item. Use options.add to capture a learning/insight; omit it to list existing learnings.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_deps\",\n description:\n \"Read dependency trees/graphs or one bounded explainable relationship context packet. Use options.format=context with direction, kind, depth, node, edge, token, and cursor bounds; context returns a counts-first summary, per-node roles/reasons, root evidence pointers, and enumerated missing references.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_graph\",\n description:\n \"Run bounded workspace relationship-graph queries: ancestors/descendants (hierarchy), predecessors/successors (ordering), paths, impact (blast radius), analyze (execution + knowledge analytics), audit (governance findings), communities (label-propagation clusters), redundancy (transitively implied edges), dominators (structural bottlenecks), and plan (dry-run remediation proposals derived from the audit). Traversals, paths, impact, and dominators require id; paths also requires target. Options support kind, maxDepth, limit, after, direction, maxPaths, sample, exemptIsolate, and counts-first summary.\",\n inputSchema: objectSchema(\n {\n subcommand: {\n type: \"string\",\n enum: [...GRAPH_SUBCOMMAND_VALUES],\n },\n id: idSchema,\n target: idSchema,\n options: { type: \"object\" },\n },\n [\"subcommand\"],\n ),\n },\n {\n name: \"pm_test\",\n description: \"List, add, remove, or run linked tests for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_validate\",\n description: \"Run pm validation checks.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_health\",\n description:\n \"Run pm health diagnostics. Pass options.brief=true for compact low-token details, options.skipIntegrity=true, options.skipDrift=true, options.skipVectors=true for a fast status-only check, or options.full=true for the complete deep check.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_contracts\",\n description:\n \"Inspect pm command, flag, schema, and availability contracts.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_schema\",\n description:\n \"Inspect or modify the workspace item-type/status/field schema (pm schema). \" +\n \"subcommand selects the operation; name carries the item type name (show/add-type/remove-type), status id (show-status/add-status/remove-status), or field key (show-field/add-field/remove-field). \" +\n \"apply-preset adopts a domain type preset; add-type with infer=true derives types from title-prefix conventions. \" +\n \"Schema mutations write workspace config files, not item history.\",\n inputSchema: objectSchema(\n {\n subcommand: {\n type: \"string\",\n enum: [\n \"list\",\n \"show\",\n \"show-status\",\n \"add-type\",\n \"remove-type\",\n \"add-status\",\n \"remove-status\",\n \"add-field\",\n \"remove-field\",\n \"list-fields\",\n \"show-field\",\n \"apply-preset\",\n ],\n description: \"Schema subcommand to run.\",\n },\n name: {\n type: \"string\",\n description:\n \"Item type name (show/add-type/remove-type), status id (show-status/add-status/remove-status), or custom field key (show-field/add-field/remove-field). Required for those subcommands.\",\n },\n description: {\n type: \"string\",\n description:\n \"Custom item type, status, or field description for add-type/add-status/add-field.\",\n },\n defaultStatus: {\n type: \"string\",\n description: \"Default status for add-type.\",\n },\n folder: { type: \"string\", description: \"Storage folder for add-type.\" },\n alias: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Aliases for add-type/add-status, or extra CLI flag aliases for add-field.\",\n },\n role: {\n type: \"array\",\n items: { type: \"string\", enum: [...RUNTIME_STATUS_ROLE_VALUES] },\n description: `Lifecycle roles for add-status: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n },\n order: {\n type: \"number\",\n description: \"Display/sort order for add-status.\",\n },\n fieldType: {\n type: \"string\",\n enum: [\"string\", \"number\", \"boolean\", \"string_array\"],\n description: \"Value type for a custom field (add-field).\",\n },\n commands: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Commands a custom field is wired onto (add-field): create, update, update_many, list, search, calendar, context.\",\n },\n cliFlag: {\n type: \"string\",\n description:\n \"Override the auto-derived CLI flag for a custom field (add-field).\",\n },\n required: {\n type: \"boolean\",\n description: \"Mark a custom field as always required (add-field).\",\n },\n requiredOnCreate: {\n type: \"boolean\",\n description:\n \"Mark a custom field as required at create time (add-field).\",\n },\n allowUnset: {\n type: \"boolean\",\n description:\n \"Whether a custom field may be cleared via --unset (add-field); defaults to true.\",\n },\n requiredTypes: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Restrict a custom field's requirement to specific item types (add-field).\",\n },\n typePreset: {\n type: \"string\",\n enum: [\"agile\", \"ops\", \"research\"],\n description: \"Domain type preset to adopt (apply-preset).\",\n },\n infer: {\n type: \"boolean\",\n description:\n \"Infer item types from title-prefix conventions (add-type); previews unless apply is true.\",\n },\n minCount: {\n type: \"number\",\n description:\n \"Minimum items sharing a prefix for add-type inference (default 10).\",\n },\n apply: {\n type: \"boolean\",\n description:\n \"Register inferred types (add-type infer); without it the call previews only.\",\n },\n force: {\n type: \"boolean\",\n description:\n \"Override removal guardrails for destructive schema changes when supported.\",\n },\n options: {\n type: \"object\",\n description: \"Additional schema options using camelCase keys.\",\n },\n },\n [\"subcommand\"],\n ),\n },\n {\n name: \"pm_profile\",\n description:\n \"List, show, apply, or lint project profiles (pm profile) — archetype bundles that stage item types, statuses, fields, per-type workflows, config knobs, create templates, and recommended packages. \" +\n \"subcommand selects the operation; name carries the profile name (agile, ops, research) for show/apply/lint. \" +\n \"apply stages every dimension idempotently; dryRun previews the diff without writing; lint reports author-time consistency findings (graded error/warning) without touching the tracker. Profile staging writes workspace config/schema files, not item history.\",\n inputSchema: objectSchema(\n {\n subcommand: {\n type: \"string\",\n enum: [\"list\", \"show\", \"apply\", \"lint\"],\n description: \"Profile subcommand to run.\",\n },\n name: {\n type: \"string\",\n description:\n \"Profile name for show/apply/lint. Required for those subcommands. Built-ins are agile, ops, and research; an active extension can contribute additional archetype names that resolve here too.\",\n },\n dryRun: {\n type: \"boolean\",\n description:\n \"Preview the apply diff without writing any files (apply).\",\n },\n author: { type: \"string\", description: \"Mutation author for apply.\" },\n force: {\n type: \"boolean\",\n description: \"Force ownership/lock override for apply.\",\n },\n options: {\n type: \"object\",\n description: \"Additional profile options using camelCase keys.\",\n },\n },\n [\"subcommand\"],\n ),\n },\n {\n name: \"pm_config\",\n description:\n \"Read or write pm workspace configuration (pm config). \" +\n \"configAction selects get/set/list/export; key/value address a single setting for get/set. \" +\n \"scope chooses the project (default) or global settings file.\",\n inputSchema: objectSchema(\n {\n configAction: {\n type: \"string\",\n enum: [\"get\", \"set\", \"list\", \"export\"],\n description:\n \"Config operation to perform. get/set require key; list/export dump the resolved settings surface.\",\n },\n key: {\n type: \"string\",\n description:\n \"Settings key for get/set, for example governance-require-close-reason, telemetry-tracking, or a nested leaf such as search_provider (dash and underscore variants accepted; configAction=get without a key lists supported keys in the error).\",\n },\n value: {\n type: \"string\",\n description: \"New value for configAction=set.\",\n },\n scope: {\n type: \"string\",\n enum: [\"project\", \"global\"],\n description: \"Settings scope to read or write. Defaults to project.\",\n },\n options: {\n type: \"object\",\n description:\n \"Additional config options such as criterion, clearCriteria, format, or policy.\",\n },\n },\n [\"configAction\"],\n ),\n },\n {\n name: \"pm_plan\",\n description:\n \"Run agent-optimized Plan workflows. options.subcommand selects: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize. Provide id for all non-create subcommands; provide stepRef for step lifecycle subcommands. Plans store agent-readable steps with dependencies, decisions, discoveries, validation, and resume context.\",\n inputSchema: objectSchema({\n id: {\n type: \"string\",\n description: \"Plan id (required for all subcommands except create).\",\n },\n stepRef: {\n type: \"string\",\n description: \"Step id or order for step lifecycle subcommands.\",\n },\n reorderTo: { type: \"number\", description: \"New order for reorder-step.\" },\n options: {\n type: \"object\",\n description:\n \"Plan options including subcommand, stepRef, stepStatus, link, depth, etc.\",\n },\n }),\n },\n];\n\n/** Stable projection of one MCP tool definition for the contract golden file (pm-4os2): tool name, description, required top-level fields, and the full inputSchema shape. Any drift (typo'd property, dropped required field, changed TOOL_SCHEMA_BASE) shows up in `pnpm contracts:check`. */\nexport interface McpToolContract {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports description for this contract. */\n description: string;\n /** Value that configures or reports required for this contract. */\n required: string[];\n /** Value that configures or reports input schema for this contract. */\n input_schema: Record<string, unknown>;\n}\n\n/** Implements build mcp tool contracts for the public runtime surface of this module. */\nexport function buildMcpToolContracts(): McpToolContract[] {\n return TOOLS.map((tool) => {\n const schemaRequired = tool.inputSchema[\"required\"];\n const required = Array.isArray(schemaRequired)\n ? schemaRequired\n .map((entry) => String(entry))\n .sort((left, right) => left.localeCompare(right))\n : [];\n return {\n name: tool.name,\n description: tool.description,\n required,\n input_schema: tool.inputSchema,\n };\n }).sort((left, right) => left.name.localeCompare(right.name));\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EACL,uBAAuB,EACvB,eAAe,GAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAmBzD,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,gGAAgG;SACnG;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,uGAAuG;SAC1G;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,mGAAmG;SACtG;KACF;IACD,oBAAoB,EAAE,IAAI;CAClB,CAAC;AAEX,MAAM,QAAQ,GAAG;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AAC,WAAW;SAC/B,CAAC;IACJ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC","debugId":"3cdd51a1-c5ae-500e-b228-b3f2cf101aae"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @module sdk/actionability
3
+ *
4
+ * Public dependency-aware scheduling primitives shared by CLI adapters,
5
+ * embedded tools, and automation. The implementation remains pure: callers
6
+ * provide item metadata plus the runtime status registry and receive stable
7
+ * blocker or ready-work classifications without storage or rendering side
8
+ * effects.
9
+ */
10
+ export { collectBlockedByIds, collectDependencyBlockedIds, computeActionabilityReport, resolveItemBlockers, type ActionabilityReport, type ActionableEntry, type ResolvedBlocker, } from "../core/item/actionability.js";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module sdk/actionability
3
+ *
4
+ * Public dependency-aware scheduling primitives shared by CLI adapters,
5
+ * embedded tools, and automation. The implementation remains pure: callers
6
+ * provide item metadata plus the runtime status registry and receive stable
7
+ * blocker or ready-work classifications without storage or rendering side
8
+ * effects.
9
+ */
10
+
11
+ !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]="53b0b70e-5894-56e2-9a06-47fe4c292767")}catch(e){}}();
12
+ export { collectBlockedByIds, collectDependencyBlockedIds, computeActionabilityReport, resolveItemBlockers, } from "../core/item/actionability.js";
13
+ //# sourceMappingURL=actionability.js.map
14
+ //# debugId=53b0b70e-5894-56e2-9a06-47fe4c292767
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actionability.js","sources":["sdk/actionability.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/actionability\n *\n * Public dependency-aware scheduling primitives shared by CLI adapters,\n * embedded tools, and automation. The implementation remains pure: callers\n * provide item metadata plus the runtime status registry and receive stable\n * blocker or ready-work classifications without storage or rendering side\n * effects.\n */\nexport {\n collectBlockedByIds,\n collectDependencyBlockedIds,\n computeActionabilityReport,\n resolveItemBlockers,\n type ActionabilityReport,\n type ActionableEntry,\n type ResolvedBlocker,\n} from \"../core/item/actionability.js\";\n"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;AACH,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,GAIpB,MAAM,+BAA+B,CAAC","debugId":"53b0b70e-5894-56e2-9a06-47fe4c292767"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @module sdk/cli-bootstrap
3
+ *
4
+ * Provides public bootstrap argument normalization for embedded CLI hosts.
5
+ */
6
+ import { EXECUTABLE_COMMAND_ALIASES, type CliFlagContract } from "./cli-contracts.js";
7
+ export { EXECUTABLE_COMMAND_ALIASES };
8
+ /** Documents the bootstrap global options payload exchanged by command, SDK, and package integrations. */
9
+ export interface BootstrapGlobalOptions {
10
+ /** Filesystem path used for path resolution. */
11
+ path?: string;
12
+ /** Value that configures or reports no extensions for this contract. */
13
+ noExtensions: boolean;
14
+ /** Value that configures or reports no pager for this contract. */
15
+ noPager: boolean;
16
+ /** Value that configures or reports json for this contract. */
17
+ json: boolean;
18
+ /** Value that configures or reports quiet for this contract. */
19
+ quiet: boolean;
20
+ /** Invocation-wide mutation author override. */
21
+ author?: string;
22
+ /** Whether `--author` was present without its required value. */
23
+ authorMissingValue?: true;
24
+ }
25
+ /** Implements parse bootstrap global options for the public runtime surface of this module. */
26
+ export declare function parseBootstrapGlobalOptions(argv: string[]): BootstrapGlobalOptions;
27
+ /** Implements strip global bootstrap tokens for the public runtime surface of this module. */
28
+ export declare function stripGlobalBootstrapTokens(argv: string[]): string[];
29
+ /** Documents the bootstrap help request payload exchanged by command, SDK, and package integrations. */
30
+ export interface BootstrapHelpRequest {
31
+ /** Value that configures or reports requested for this contract. */
32
+ requested: boolean;
33
+ /** Value that configures or reports command path tokens for this contract. */
34
+ commandPathTokens: string[];
35
+ }
36
+ /** Implements parse bootstrap help request for the public runtime surface of this module. */
37
+ export declare function parseBootstrapHelpRequest(argv: string[]): BootstrapHelpRequest;
38
+ /** Implements parse bootstrap command name for the public runtime surface of this module. */
39
+ export declare function parseBootstrapCommandName(argv: string[]): string | undefined;
40
+ /** Implements apply bootstrap pager policy for the public runtime surface of this module. */
41
+ export declare function applyBootstrapPagerPolicy(argv: string[]): () => void;
42
+ /** Implements normalize legacy extension action syntax for the public runtime surface of this module. */
43
+ export declare function normalizeLegacyExtensionActionSyntax(argv: string[]): string[];
44
+ type BootstrapNormalizationReason = "legacy_extension_action" | "command_alias" | "flag_alias" | "flag_typo" | "bare_key_value" | "list_merge";
45
+ type BootstrapNormalizationConfidence = "high" | "medium";
46
+ /** Documents the bootstrap normalization event payload exchanged by command, SDK, and package integrations. */
47
+ export interface BootstrapNormalizationEvent {
48
+ /** Value that configures or reports from for this contract. */
49
+ from: string;
50
+ /** Value that configures or reports to for this contract. */
51
+ to: string[];
52
+ /** Value that configures or reports reason for this contract. */
53
+ reason: BootstrapNormalizationReason;
54
+ /** Value that configures or reports confidence for this contract. */
55
+ confidence: BootstrapNormalizationConfidence;
56
+ }
57
+ /** Documents the bootstrap invocation normalization result payload exchanged by command, SDK, and package integrations. */
58
+ export interface BootstrapInvocationNormalizationResult {
59
+ /** Value that configures or reports argv for this contract. */
60
+ argv: string[];
61
+ /** Value that configures or reports command name for this contract. */
62
+ commandName: string | undefined;
63
+ /** Value that configures or reports trace for this contract. */
64
+ trace: BootstrapNormalizationEvent[];
65
+ }
66
+ interface FlagLookup {
67
+ canonicalByNormalized: Map<string, string | null>;
68
+ canonicalByCompact: Map<string, string | null>;
69
+ canonicalComparables: Array<{
70
+ canonicalFlag: string;
71
+ comparable: string;
72
+ }>;
73
+ listCanonicalFlags: Set<string>;
74
+ }
75
+ declare function markUnambiguousFlag(map: Map<string, string | null>, key: string, canonicalFlag: string): void;
76
+ declare function collectLongFlagCandidates(contract: CliFlagContract): string[];
77
+ declare function buildFlagLookup(commandName: string | undefined, contractsOverride?: CliFlagContract[]): FlagLookup;
78
+ declare function resolveCanonicalFlag(rawKey: string, lookup: FlagLookup): {
79
+ flag: string;
80
+ reason: "flag_alias" | "flag_typo";
81
+ confidence: BootstrapNormalizationConfidence;
82
+ } | null;
83
+ /** Implements list alias plural keys for the public runtime surface of this module. */
84
+ export declare function listAliasPluralKeys(normalizedKey: string): string[];
85
+ declare function normalizeLongOptionToken(token: string, lookup: FlagLookup, preserve?: boolean): {
86
+ tokens: string[];
87
+ event?: BootstrapNormalizationEvent;
88
+ };
89
+ /** Locate global path-value tokens that normalization must preserve literally. */
90
+ declare function collectBootstrapPathValueIndices(argv: string[]): Set<number>;
91
+ /**
92
+ * Coalesce repeated occurrences of comma-separated list flags into a single
93
+ * `--flag=v1,v2,v3` token anchored at the FIRST occurrence. Without this,
94
+ * Commander treats these flags as scalars and silently keeps only the last
95
+ * value (data loss). Both `--flag value` and `--flag=value` forms are merged;
96
+ * a value-less occurrence is preserved untouched, and a `--` terminator stops
97
+ * coalescing (remainder is passed through verbatim).
98
+ *
99
+ * `valueConsumingFlags` lists option flags (e.g. global `--path`) whose value
100
+ * may itself begin with `--`. Their value token is emitted verbatim so a
101
+ * list-flag-looking value (`--path --tags`) is never reinterpreted as a flag
102
+ * nor allowed to swallow the following command/positional token.
103
+ */
104
+ export declare function coalesceRepeatedListFlags(argv: string[], listFlags: Set<string>, valueConsumingFlags?: Set<string>, multiValueListFlags?: Set<string>): {
105
+ argv: string[];
106
+ events: BootstrapNormalizationEvent[];
107
+ };
108
+ /** Accept the two-token linked-test form `pm test <id> --add command "npm test -- parser"` by merging the bare key token and its single quoted value into the documented `--add command=...` shape. Without this merge Commander binds the bare key as the option value and treats the quoted command as an excess positional, failing with "too many arguments" (GH-191). The merge only fires when EXACTLY ONE non-flag token follows the bare key, i.e. the value was quoted into one shell token — an unquoted multi-token value stays ambiguous (it may swallow the item id), still fails fast, and is routed to targeted quoting guidance by the commander error classifier instead. */
109
+ export declare function mergeLinkedTestTwoTokenEntries(argv: string[], commandName: string | undefined, trace: BootstrapNormalizationEvent[]): string[];
110
+ /** Implements normalize bootstrap invocation for the public runtime surface of this module. */
111
+ export declare function normalizeBootstrapInvocation(argv: string[]): BootstrapInvocationNormalizationResult;
112
+ /** Implements parse bootstrap type value for the public runtime surface of this module. */
113
+ export declare function parseBootstrapTypeValue(argv: string[]): string | undefined;
114
+ /** Public contract for test only, shared by SDK and presentation-layer consumers. */
115
+ export declare const _testOnly: {
116
+ buildFlagLookup: typeof buildFlagLookup;
117
+ collectBootstrapPathValueIndices: typeof collectBootstrapPathValueIndices;
118
+ collectLongFlagCandidates: typeof collectLongFlagCandidates;
119
+ markUnambiguousFlag: typeof markUnambiguousFlag;
120
+ normalizeLongOptionToken: typeof normalizeLongOptionToken;
121
+ resolveCanonicalFlag: typeof resolveCanonicalFlag;
122
+ };