@unbrained/pm-cli 2026.7.13 → 2026.7.14

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 (487) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +28 -0
  3. package/dist/cli/commands/aggregate.d.ts +1 -1
  4. package/dist/cli/commands/aggregate.js +18 -6
  5. package/dist/cli/commands/aggregate.js.map +1 -1
  6. package/dist/cli/commands/context.d.ts +16 -1
  7. package/dist/cli/commands/context.js +98 -16
  8. package/dist/cli/commands/context.js.map +1 -1
  9. package/dist/cli/commands/create.d.ts +1 -1
  10. package/dist/cli/commands/create.js +11 -7
  11. package/dist/cli/commands/create.js.map +1 -1
  12. package/dist/cli/commands/deps.d.ts +6 -96
  13. package/dist/cli/commands/deps.js +4 -214
  14. package/dist/cli/commands/deps.js.map +1 -1
  15. package/dist/cli/commands/docs.d.ts +2 -44
  16. package/dist/cli/commands/docs.js +8 -13
  17. package/dist/cli/commands/docs.js.map +1 -1
  18. package/dist/cli/commands/files.d.ts +6 -134
  19. package/dist/cli/commands/files.js +4 -294
  20. package/dist/cli/commands/files.js.map +1 -1
  21. package/dist/cli/commands/get.js +15 -2
  22. package/dist/cli/commands/get.js.map +1 -1
  23. package/dist/cli/commands/list.js +5 -6
  24. package/dist/cli/commands/list.js.map +1 -1
  25. package/dist/cli/commands/next.d.ts +3 -1
  26. package/dist/cli/commands/next.js +77 -20
  27. package/dist/cli/commands/next.js.map +1 -1
  28. package/dist/cli/commands/update-many.js +6 -3
  29. package/dist/cli/commands/update-many.js.map +1 -1
  30. package/dist/cli/commands/update.js +14 -7
  31. package/dist/cli/commands/update.js.map +1 -1
  32. package/dist/cli/commands/validate.d.ts +1 -1
  33. package/dist/cli/commands/validate.js +32 -35
  34. package/dist/cli/commands/validate.js.map +1 -1
  35. package/dist/cli/main.d.ts +2 -14
  36. package/dist/cli/main.js +27 -8
  37. package/dist/cli/main.js.map +1 -1
  38. package/dist/cli-bundle/chunks/append-DYQWQK2J.js +11 -0
  39. package/dist/cli-bundle/chunks/{append-2FS6MVG7.js → append-PVZJDM6J.js} +5 -5
  40. package/dist/cli-bundle/chunks/{chunk-J2WAWP4U.js → chunk-2FNWQXZ2.js} +4 -4
  41. package/dist/cli-bundle/chunks/{chunk-YFGYDZRP.js → chunk-2GA3NK35.js} +4 -4
  42. package/dist/cli-bundle/chunks/{chunk-XFEIASAC.js → chunk-2QIQGYPW.js} +2 -2
  43. package/dist/cli-bundle/chunks/{chunk-3WCGYH5Q.js → chunk-3CMRNVTO.js} +7 -7
  44. package/dist/cli-bundle/chunks/chunk-3HKUXVKV.js +9 -0
  45. package/dist/cli-bundle/chunks/{chunk-VDAZPPRU.js → chunk-3I3LRT2G.js} +2 -2
  46. package/dist/cli-bundle/chunks/{chunk-3P3RFJIQ.js → chunk-3TL7WOEF.js} +2 -2
  47. package/dist/cli-bundle/chunks/{chunk-4SHJ5JS3.js → chunk-44LNIULG.js} +4 -4
  48. package/dist/cli-bundle/chunks/{chunk-QFOAWBOB.js → chunk-4DY4KPQI.js} +11 -10
  49. package/dist/cli-bundle/chunks/{chunk-QFOAWBOB.js.map → chunk-4DY4KPQI.js.map} +2 -2
  50. package/dist/cli-bundle/chunks/{chunk-BVCF4ULV.js → chunk-4RXTMU57.js} +5 -5
  51. package/dist/cli-bundle/chunks/{chunk-XMI2TRY5.js → chunk-4WREH7RT.js} +4 -4
  52. package/dist/cli-bundle/chunks/{chunk-JYUGUXFW.js → chunk-5CT5BW6E.js} +5 -5
  53. package/dist/cli-bundle/chunks/{chunk-NA5SBIB4.js → chunk-5URI7TPJ.js} +44 -44
  54. package/dist/cli-bundle/chunks/chunk-5URI7TPJ.js.map +7 -0
  55. package/dist/cli-bundle/chunks/{chunk-QGH6WL6L.js → chunk-655STMGA.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-DGKBWCMA.js → chunk-6IIVBC56.js} +4 -4
  57. package/dist/cli-bundle/chunks/{chunk-SRQLQUO6.js → chunk-6MHSBDGD.js} +7 -7
  58. package/dist/cli-bundle/chunks/{chunk-SRQLQUO6.js.map → chunk-6MHSBDGD.js.map} +2 -2
  59. package/dist/cli-bundle/chunks/{chunk-D4GPNYYP.js → chunk-6OTZMORS.js} +6 -6
  60. package/dist/cli-bundle/chunks/{chunk-JVRVXO6M.js → chunk-6PKA3SJQ.js} +6 -6
  61. package/dist/cli-bundle/chunks/{chunk-2PR4ZTRO.js → chunk-6TTOHMTB.js} +8 -8
  62. package/dist/cli-bundle/chunks/{chunk-2PR4ZTRO.js.map → chunk-6TTOHMTB.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/chunk-6X5MZ5R2.js +9 -0
  64. package/dist/cli-bundle/chunks/chunk-76UBY2EE.js +5 -0
  65. package/dist/cli-bundle/chunks/{chunk-ZS2KPCJN.js → chunk-7QDSYUMF.js} +7 -7
  66. package/dist/cli-bundle/chunks/{chunk-Z7TFPIJ6.js → chunk-7TQMR6LK.js} +7 -7
  67. package/dist/cli-bundle/chunks/{chunk-AHA4POA6.js → chunk-ABRCOSDC.js} +3 -3
  68. package/dist/cli-bundle/chunks/{chunk-XY3CC3EM.js → chunk-AFWZRL7M.js} +59 -53
  69. package/dist/cli-bundle/chunks/chunk-AFWZRL7M.js.map +7 -0
  70. package/dist/cli-bundle/chunks/{chunk-KQJVTQVK.js → chunk-ANSJHDOZ.js} +2 -2
  71. package/dist/cli-bundle/chunks/{chunk-OMT4NO7T.js → chunk-B5DZYTT3.js} +113 -24
  72. package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js.map +7 -0
  73. package/dist/cli-bundle/chunks/chunk-B7SWOIP6.js +5 -0
  74. package/dist/cli-bundle/chunks/{chunk-D2LXG7WX.js → chunk-BN62TO2S.js} +5 -5
  75. package/dist/cli-bundle/chunks/chunk-BN62TO2S.js.map +1 -0
  76. package/dist/cli-bundle/chunks/{chunk-ZTSV7P2T.js → chunk-BPD26E3P.js} +357 -42
  77. package/dist/cli-bundle/chunks/chunk-BPD26E3P.js.map +1 -0
  78. package/dist/cli-bundle/chunks/{chunk-RKGFUC4O.js → chunk-CDJYP7OQ.js} +36 -14
  79. package/dist/cli-bundle/chunks/chunk-CDJYP7OQ.js.map +1 -0
  80. package/dist/cli-bundle/chunks/{chunk-VLFLRFJP.js → chunk-CIOZ376P.js} +20 -13
  81. package/dist/cli-bundle/chunks/chunk-CIOZ376P.js.map +1 -0
  82. package/dist/cli-bundle/chunks/{chunk-HXTCZSAI.js → chunk-DBZVUJTK.js} +3 -3
  83. package/dist/cli-bundle/chunks/{chunk-2QNOWOIB.js → chunk-DO5RGJXT.js} +3 -3
  84. package/dist/cli-bundle/chunks/{chunk-MKONZ4UO.js → chunk-DRNJPEPQ.js} +4 -4
  85. package/dist/cli-bundle/chunks/{chunk-XDT2PSXA.js → chunk-DVOLZJ3C.js} +12 -11
  86. package/dist/cli-bundle/chunks/{chunk-XDT2PSXA.js.map → chunk-DVOLZJ3C.js.map} +1 -1
  87. package/dist/cli-bundle/chunks/{chunk-H36FXA7B.js → chunk-DYEX6NFH.js} +4 -4
  88. package/dist/cli-bundle/chunks/{chunk-G3IB5GTD.js → chunk-E2WC6S4P.js} +15 -11
  89. package/dist/cli-bundle/chunks/chunk-E2WC6S4P.js.map +7 -0
  90. package/dist/cli-bundle/chunks/{chunk-GAJ7U7B4.js → chunk-ERL2YFJ2.js} +3 -3
  91. package/dist/cli-bundle/chunks/{chunk-FPEYOFEF.js → chunk-F7PSHRNO.js} +3 -3
  92. package/dist/cli-bundle/chunks/{chunk-UH7OLT6F.js → chunk-FDSBDNYE.js} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-DGJF32JF.js → chunk-FIGXOCEQ.js} +66 -21
  94. package/dist/cli-bundle/chunks/chunk-FIGXOCEQ.js.map +7 -0
  95. package/dist/cli-bundle/chunks/{chunk-RQAY7C5T.js → chunk-FJZDA6MS.js} +3 -3
  96. package/dist/cli-bundle/chunks/{chunk-B4TVNGRX.js → chunk-FO7GMJKG.js} +3 -3
  97. package/dist/cli-bundle/chunks/chunk-FRQ63VPB.js +5 -0
  98. package/dist/cli-bundle/chunks/{chunk-UTYNQ2WH.js → chunk-FS6UM5WH.js} +48 -27
  99. package/dist/cli-bundle/chunks/chunk-FS6UM5WH.js.map +7 -0
  100. package/dist/cli-bundle/chunks/{chunk-U252II47.js → chunk-FTQLW4JD.js} +4 -4
  101. package/dist/cli-bundle/chunks/{chunk-TNGLCRKS.js → chunk-GSEADLRH.js} +1821 -1809
  102. package/dist/cli-bundle/chunks/chunk-GSEADLRH.js.map +1 -0
  103. package/dist/cli-bundle/chunks/{chunk-TGG7YGMC.js → chunk-GXXC7QSK.js} +53 -47
  104. package/dist/cli-bundle/chunks/chunk-GXXC7QSK.js.map +1 -0
  105. package/dist/cli-bundle/chunks/{chunk-AGD4VZXH.js → chunk-H2QBAKLQ.js} +3 -3
  106. package/dist/cli-bundle/chunks/{chunk-CJVQ4XIG.js → chunk-HAMLIWAF.js} +4 -4
  107. package/dist/cli-bundle/chunks/{chunk-56DX6QYG.js → chunk-HL7V2PHX.js} +19 -13
  108. package/dist/cli-bundle/chunks/chunk-HL7V2PHX.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-7QOIQTPB.js → chunk-HLHSQ5CA.js} +4 -4
  110. package/dist/cli-bundle/chunks/{chunk-AHC7J6XD.js → chunk-IA3YFTXT.js} +6 -6
  111. package/dist/cli-bundle/chunks/{chunk-5ZCVF4WF.js → chunk-IAPHYPRL.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-OCSQWIOW.js → chunk-IFZA4VB5.js} +4 -4
  113. package/dist/cli-bundle/chunks/{chunk-6O2HJENY.js → chunk-IGED7NH2.js} +61 -48
  114. package/dist/cli-bundle/chunks/chunk-IGED7NH2.js.map +7 -0
  115. package/dist/cli-bundle/chunks/{chunk-RPCCQDG2.js → chunk-ILLUE5DI.js} +36 -14
  116. package/dist/cli-bundle/chunks/chunk-ILLUE5DI.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-4WMFM77X.js → chunk-J4NZOP3I.js} +5 -5
  118. package/dist/cli-bundle/chunks/{chunk-57JVERX3.js → chunk-JAF4TUQ7.js} +4 -4
  119. package/dist/cli-bundle/chunks/chunk-JAF4TUQ7.js.map +7 -0
  120. package/dist/cli-bundle/chunks/{chunk-MTNKSSSO.js → chunk-JL7WZ4O2.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-AZ52LTCY.js → chunk-K7WNZ7KD.js} +3 -3
  122. package/dist/cli-bundle/chunks/{chunk-2OLSXXIV.js → chunk-KADLSPIU.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-RQKORMM4.js → chunk-KB726FMH.js} +4 -4
  124. package/dist/cli-bundle/chunks/{chunk-WKSFBBZT.js → chunk-L24HCJFC.js} +114 -25
  125. package/dist/cli-bundle/chunks/chunk-L24HCJFC.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-LDO24J5I.js → chunk-LWTIRS3Y.js} +365 -43
  127. package/dist/cli-bundle/chunks/chunk-LWTIRS3Y.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-TZTQ4TVV.js → chunk-M6ASXYCU.js} +4 -4
  129. package/dist/cli-bundle/chunks/{chunk-WDDOAU7Z.js → chunk-M7EWN4TF.js} +3 -3
  130. package/dist/cli-bundle/chunks/{chunk-327DSGW2.js → chunk-MD6ULIPJ.js} +3 -3
  131. package/dist/cli-bundle/chunks/{chunk-OKDBHOON.js → chunk-MKL4CP2I.js} +61 -48
  132. package/dist/cli-bundle/chunks/chunk-MKL4CP2I.js.map +1 -0
  133. package/dist/cli-bundle/chunks/{chunk-M52DG2QJ.js → chunk-MQZ3PLCF.js} +2 -2
  134. package/dist/cli-bundle/chunks/{chunk-GQ2CQNGI.js → chunk-N3CMP4NI.js} +2 -2
  135. package/dist/cli-bundle/chunks/{chunk-J7SBFUZC.js → chunk-NAQYVWSQ.js} +4 -4
  136. package/dist/cli-bundle/chunks/{chunk-U2GMYP3L.js → chunk-NKW36AMT.js} +4 -4
  137. package/dist/cli-bundle/chunks/{chunk-5WEYOVZ7.js → chunk-OBDLEQG5.js} +19 -12
  138. package/dist/cli-bundle/chunks/chunk-OBDLEQG5.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-VL4LYTJN.js → chunk-OI4S4KCI.js} +18 -12
  140. package/dist/cli-bundle/chunks/chunk-OI4S4KCI.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-FCVVMAEX.js → chunk-P6MYFH6K.js} +60 -22
  142. package/dist/cli-bundle/chunks/chunk-P6MYFH6K.js.map +1 -0
  143. package/dist/cli-bundle/chunks/{chunk-FTQQAPRX.js → chunk-PHKP3AGR.js} +8 -8
  144. package/dist/cli-bundle/chunks/{chunk-WVUXNIYO.js → chunk-Q37E63AM.js} +4 -4
  145. package/dist/cli-bundle/chunks/{chunk-JVXV7ANV.js → chunk-Q7E6OYZK.js} +2 -2
  146. package/dist/cli-bundle/chunks/{chunk-WVUYATII.js → chunk-QABYZYLU.js} +4 -4
  147. package/dist/cli-bundle/chunks/{chunk-QRRUGIJN.js → chunk-QASRVKUQ.js} +45 -45
  148. package/dist/cli-bundle/chunks/chunk-QASRVKUQ.js.map +1 -0
  149. package/dist/cli-bundle/chunks/{chunk-L4262MFB.js → chunk-QK2ZN6UL.js} +14 -5
  150. package/dist/cli-bundle/chunks/{chunk-L4262MFB.js.map → chunk-QK2ZN6UL.js.map} +1 -1
  151. package/dist/cli-bundle/chunks/{chunk-7TQPV7HR.js → chunk-QSPARJWF.js} +2 -2
  152. package/dist/cli-bundle/chunks/{chunk-GTKILM6F.js → chunk-QZ7LT3XE.js} +3 -3
  153. package/dist/cli-bundle/chunks/{chunk-L3VKY6R6.js → chunk-RA5AIAMP.js} +3 -3
  154. package/dist/cli-bundle/chunks/{chunk-BJS27ALI.js → chunk-RGXD5JJR.js} +6 -6
  155. package/dist/cli-bundle/chunks/{chunk-TSEPW2P6.js → chunk-RMF3IOYQ.js} +7 -7
  156. package/dist/cli-bundle/chunks/{chunk-QXYKH56X.js → chunk-T4BRCB6Z.js} +1894 -1875
  157. package/dist/cli-bundle/chunks/chunk-T4BRCB6Z.js.map +7 -0
  158. package/dist/cli-bundle/chunks/{chunk-TGGTXC52.js → chunk-TH7U4KLY.js} +3 -3
  159. package/dist/cli-bundle/chunks/{chunk-LP4UATP6.js → chunk-TWLDBKQU.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-OTZ3C2NE.js → chunk-TZ2PSLLT.js} +49 -28
  161. package/dist/cli-bundle/chunks/chunk-TZ2PSLLT.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-UK222BHQ.js → chunk-TZRTLMWM.js} +4 -4
  163. package/dist/cli-bundle/chunks/{chunk-6E6S2X6S.js → chunk-UB2QYSTO.js} +8 -8
  164. package/dist/cli-bundle/chunks/{chunk-S6CXUSYC.js → chunk-UGTVWL3E.js} +5 -5
  165. package/dist/cli-bundle/chunks/{chunk-BNS6QHTZ.js → chunk-UJ4HJYWL.js} +2 -2
  166. package/dist/cli-bundle/chunks/{chunk-BYVOEJPQ.js → chunk-UKUIIBDW.js} +4 -4
  167. package/dist/cli-bundle/chunks/{chunk-SGDBVR7X.js → chunk-UVBA6F5A.js} +2 -2
  168. package/dist/cli-bundle/chunks/{chunk-DZRZMBBF.js → chunk-VJTAEIPC.js} +5 -5
  169. package/dist/cli-bundle/chunks/{chunk-74PWVJON.js → chunk-W6HZ55JO.js} +2 -2
  170. package/dist/cli-bundle/chunks/{chunk-HR2MQAO5.js → chunk-WD6MSYMP.js} +13 -4
  171. package/dist/cli-bundle/chunks/{chunk-HR2MQAO5.js.map → chunk-WD6MSYMP.js.map} +2 -2
  172. package/dist/cli-bundle/chunks/{chunk-P7IFURWH.js → chunk-WPAWZW7S.js} +2 -2
  173. package/dist/cli-bundle/chunks/{chunk-36LEOWSX.js → chunk-WQUEHPZB.js} +2 -2
  174. package/dist/cli-bundle/chunks/{chunk-FCKJF7G2.js → chunk-WRKB56FC.js} +3 -3
  175. package/dist/cli-bundle/chunks/{chunk-KR5EHAN4.js → chunk-X3GYR4P2.js} +2 -2
  176. package/dist/cli-bundle/chunks/{chunk-J567OZJY.js → chunk-X6BVXQ52.js} +16 -12
  177. package/dist/cli-bundle/chunks/chunk-X6BVXQ52.js.map +1 -0
  178. package/dist/cli-bundle/chunks/chunk-Y72FV7RM.js +178 -0
  179. package/dist/cli-bundle/chunks/chunk-Y72FV7RM.js.map +7 -0
  180. package/dist/cli-bundle/chunks/{chunk-OWW2KXOV.js → chunk-YQYG2V23.js} +2 -2
  181. package/dist/cli-bundle/chunks/{chunk-G2SCT7BC.js → chunk-YVKE5ZDM.js} +4 -4
  182. package/dist/cli-bundle/chunks/{chunk-QHIN4UTF.js → chunk-ZAYYDNB3.js} +4 -4
  183. package/dist/cli-bundle/chunks/chunk-ZHBI2AP7.js +9 -0
  184. package/dist/cli-bundle/chunks/chunk-ZNP64HOW.js +175 -0
  185. package/dist/cli-bundle/chunks/chunk-ZNP64HOW.js.map +1 -0
  186. package/dist/cli-bundle/chunks/{chunk-GNVBUNJQ.js → chunk-ZTRBSABY.js} +3 -3
  187. package/dist/cli-bundle/chunks/{chunk-PY32KGQU.js → chunk-ZUKSZVBW.js} +5 -5
  188. package/dist/cli-bundle/chunks/{close-CU56F47E.js → close-LZECOMHO.js} +5 -5
  189. package/dist/cli-bundle/chunks/close-RI4JQQHU.js +12 -0
  190. package/dist/cli-bundle/chunks/close-many-LY2XJ52M.js +21 -0
  191. package/dist/cli-bundle/chunks/{close-many-ZQ2WP67J.js → close-many-ZHI6A5TN.js} +12 -12
  192. package/dist/cli-bundle/chunks/comments-35M273DN.js +13 -0
  193. package/dist/cli-bundle/chunks/{comments-UDUMKXL6.js → comments-AJWRTFZ5.js} +7 -7
  194. package/dist/cli-bundle/chunks/{copy-VFHECFBV.js → copy-GMXYKBXT.js} +4 -4
  195. package/dist/cli-bundle/chunks/copy-NPYM7M7U.js +9 -0
  196. package/dist/cli-bundle/chunks/create-F53OBTOU.js +27 -0
  197. package/dist/cli-bundle/chunks/{create-CE2X3SGF.js → create-HU4Q7RJX.js} +11 -9
  198. package/dist/cli-bundle/chunks/{delete-2JXQCHHT.js → delete-GSDZLTRC.js} +4 -4
  199. package/dist/cli-bundle/chunks/delete-ODRWJWAM.js +10 -0
  200. package/dist/cli-bundle/chunks/deps-U57I7EAK.js +16 -0
  201. package/dist/cli-bundle/chunks/{deps-FPXNLO6C.js → deps-WWB7P2GT.js} +7 -4
  202. package/dist/cli-bundle/chunks/docs-G7N4E2JO.js +14 -0
  203. package/dist/cli-bundle/chunks/{docs-AMAR4OHU.js → docs-MQIY2ZQS.js} +7 -7
  204. package/dist/cli-bundle/chunks/files-TBZD7V6H.js +18 -0
  205. package/dist/cli-bundle/chunks/{files-JFHN7DYM.js → files-TTY6N2AV.js} +7 -7
  206. package/dist/cli-bundle/chunks/focus-U5TRVCRS.js +10 -0
  207. package/dist/cli-bundle/chunks/{focus-QFN2RRZ7.js → focus-XT6YVFFX.js} +5 -5
  208. package/dist/cli-bundle/chunks/{history-compact-G34XMABV.js → history-compact-KKVUWB4V.js} +8 -8
  209. package/dist/cli-bundle/chunks/{history-compact-SAHT5D46.js → history-compact-M7GHYVFN.js} +8 -8
  210. package/dist/cli-bundle/chunks/{history-redact-IFJDNKLZ.js → history-redact-3DVZOILD.js} +6 -6
  211. package/dist/cli-bundle/chunks/history-redact-JIHZLHDP.js +16 -0
  212. package/dist/cli-bundle/chunks/{history-repair-NXLQTCVN.js → history-repair-ITDUMK4N.js} +8 -8
  213. package/dist/cli-bundle/chunks/history-repair-NAFCHLH7.js +18 -0
  214. package/dist/cli-bundle/chunks/{learnings-5CZKAMBS.js → learnings-FGO3NSFW.js} +7 -7
  215. package/dist/cli-bundle/chunks/learnings-SONGPSHI.js +13 -0
  216. package/dist/cli-bundle/chunks/notes-BSD53H2W.js +13 -0
  217. package/dist/cli-bundle/chunks/{notes-POMK37UI.js → notes-NQ6RXVW6.js} +7 -7
  218. package/dist/cli-bundle/chunks/{plan-YBNYNT3A.js → plan-2NNEO46V.js} +10 -10
  219. package/dist/cli-bundle/chunks/plan-AWLYGBNV.js +24 -0
  220. package/dist/cli-bundle/chunks/{profile-JNKSU6EQ.js → profile-AAQUU6T3.js} +9 -9
  221. package/dist/cli-bundle/chunks/{profile-A2WPVG6I.js → profile-U725ATWZ.js} +9 -9
  222. package/dist/cli-bundle/chunks/{register-list-query-UG4ZA5AU.js → register-list-query-BUWCYHBT.js} +14 -13
  223. package/dist/cli-bundle/chunks/{register-list-query-UG4ZA5AU.js.map → register-list-query-BUWCYHBT.js.map} +1 -1
  224. package/dist/cli-bundle/chunks/{register-list-query-KJULL4W3.js → register-list-query-KTZ6AGE7.js} +16 -15
  225. package/dist/cli-bundle/chunks/{register-list-query-KJULL4W3.js.map → register-list-query-KTZ6AGE7.js.map} +1 -1
  226. package/dist/cli-bundle/chunks/{register-mutation-3OXYXBKH.js → register-mutation-4FMGJJF7.js} +29 -29
  227. package/dist/cli-bundle/chunks/{register-mutation-WK265BM7.js → register-mutation-UELYYOR7.js} +29 -29
  228. package/dist/cli-bundle/chunks/{register-operations-C5SQH3FJ.js → register-operations-ISUX6LY5.js} +33 -29
  229. package/dist/cli-bundle/chunks/{register-operations-C5SQH3FJ.js.map → register-operations-ISUX6LY5.js.map} +1 -1
  230. package/dist/cli-bundle/chunks/{register-operations-FH3PBHYN.js → register-operations-JVW24J2Y.js} +35 -31
  231. package/dist/cli-bundle/chunks/{register-operations-FH3PBHYN.js.map → register-operations-JVW24J2Y.js.map} +1 -1
  232. package/dist/cli-bundle/chunks/{register-setup-CCK7CJVR.js → register-setup-5XNGKJ22.js} +15 -15
  233. package/dist/cli-bundle/chunks/{register-setup-CPZBGSOJ.js → register-setup-ZTNY6S7R.js} +15 -15
  234. package/dist/cli-bundle/chunks/restore-66GLMHIX.js +14 -0
  235. package/dist/cli-bundle/chunks/{restore-IVS5XGYR.js → restore-B3BAB6X2.js} +6 -6
  236. package/dist/cli-bundle/chunks/{schema-P2MF23JO.js → schema-LZNUYHDB.js} +6 -6
  237. package/dist/cli-bundle/chunks/schema-LZNUYHDB.js.map +7 -0
  238. package/dist/cli-bundle/chunks/{schema-R3U2REY4.js → schema-U7IM2DXV.js} +6 -6
  239. package/dist/cli-bundle/chunks/schema-U7IM2DXV.js.map +1 -0
  240. package/dist/cli-bundle/chunks/update-2XGHIVQ2.js +21 -0
  241. package/dist/cli-bundle/chunks/update-2XGHIVQ2.js.map +7 -0
  242. package/dist/cli-bundle/chunks/{update-YBIQESMH.js → update-Q3UCILNR.js} +12 -12
  243. package/dist/cli-bundle/chunks/update-Q3UCILNR.js.map +1 -0
  244. package/dist/cli-bundle/chunks/{update-many-F3CIV5SQ.js → update-many-75K57FS3.js} +19 -19
  245. package/dist/cli-bundle/chunks/update-many-75K57FS3.js.map +1 -0
  246. package/dist/cli-bundle/chunks/update-many-U42YA445.js +30 -0
  247. package/dist/cli-bundle/chunks/update-many-U42YA445.js.map +7 -0
  248. package/dist/cli-bundle/main.js +39 -16
  249. package/dist/cli-bundle/main.js.map +2 -2
  250. package/dist/cli-bundle/sdk-runtime.js +56 -53
  251. package/dist/cli-bundle/sdk-testing.js +6 -6
  252. package/dist/cli-bundle/sdk.js +115 -55
  253. package/dist/cli-bundle/sdk.js.map +2 -2
  254. package/dist/core/extensions/command-hook-context.d.ts +40 -0
  255. package/dist/core/extensions/command-hook-context.js +14 -0
  256. package/dist/core/extensions/command-hook-context.js.map +1 -0
  257. package/dist/core/extensions/index.d.ts +1 -0
  258. package/dist/core/extensions/index.js +4 -3
  259. package/dist/core/extensions/index.js.map +1 -1
  260. package/dist/core/item/parse.d.ts +2 -0
  261. package/dist/core/item/parse.js +11 -2
  262. package/dist/core/item/parse.js.map +1 -1
  263. package/dist/core/store/paths.d.ts +2 -0
  264. package/dist/core/store/paths.js +10 -2
  265. package/dist/core/store/paths.js.map +1 -1
  266. package/dist/mcp/tool-definitions.js +12 -2
  267. package/dist/mcp/tool-definitions.js.map +1 -1
  268. package/dist/sdk/context-packing.d.ts +114 -0
  269. package/dist/sdk/context-packing.js +219 -0
  270. package/dist/sdk/context-packing.js.map +1 -0
  271. package/dist/sdk/context-relevance.d.ts +1 -1
  272. package/dist/sdk/context-relevance.js +4 -2
  273. package/dist/sdk/context-relevance.js.map +1 -1
  274. package/dist/sdk/context-usage.d.ts +79 -0
  275. package/dist/sdk/context-usage.js +193 -0
  276. package/dist/sdk/context-usage.js.map +1 -0
  277. package/dist/sdk/dependencies.d.ts +145 -0
  278. package/dist/sdk/dependencies.js +327 -0
  279. package/dist/sdk/dependencies.js.map +1 -0
  280. package/dist/sdk/docs.d.ts +48 -0
  281. package/dist/sdk/docs.js +15 -0
  282. package/dist/sdk/docs.js.map +1 -0
  283. package/dist/sdk/files.d.ts +135 -0
  284. package/dist/sdk/files.js +320 -0
  285. package/dist/sdk/files.js.map +1 -0
  286. package/dist/sdk/index.d.ts +6 -0
  287. package/dist/sdk/index.js +8 -2
  288. package/dist/sdk/index.js.map +1 -1
  289. package/dist/{cli/commands → sdk}/linked-artifacts.d.ts +11 -5
  290. package/dist/{cli/commands → sdk}/linked-artifacts.js +49 -25
  291. package/dist/sdk/linked-artifacts.js.map +1 -0
  292. package/dist/sdk/runtime.d.ts +4 -4
  293. package/dist/sdk/runtime.js +7 -4
  294. package/dist/sdk/runtime.js.map +1 -1
  295. package/dist/sdk/workspace.js +3 -2
  296. package/dist/sdk/workspace.js.map +1 -1
  297. package/docs/AGENT_GUIDE.md +1 -1
  298. package/docs/CONFIGURATION.md +1 -0
  299. package/docs/PR_REVIEW_LOOP.md +21 -11
  300. package/docs/SDK.md +94 -0
  301. package/marketplace.json +2 -2
  302. package/package.json +1 -1
  303. package/packages/pm-beads/package.json +1 -1
  304. package/packages/pm-calendar/package.json +1 -1
  305. package/packages/pm-command-kit/package.json +1 -1
  306. package/packages/pm-governance-audit/package.json +1 -1
  307. package/packages/pm-guide-shell/package.json +1 -1
  308. package/packages/pm-kanban/package.json +1 -1
  309. package/packages/pm-lifecycle-hooks/package.json +1 -1
  310. package/packages/pm-linked-test-adapters/package.json +1 -1
  311. package/packages/pm-search-advanced/package.json +1 -1
  312. package/packages/pm-templates/package.json +1 -1
  313. package/packages/pm-todos/package.json +1 -1
  314. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  315. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  316. package/dist/cli/commands/linked-artifacts.js.map +0 -1
  317. package/dist/cli-bundle/chunks/append-CTKFDEAX.js +0 -11
  318. package/dist/cli-bundle/chunks/chunk-56DX6QYG.js.map +0 -1
  319. package/dist/cli-bundle/chunks/chunk-57JVERX3.js.map +0 -7
  320. package/dist/cli-bundle/chunks/chunk-5WEYOVZ7.js.map +0 -7
  321. package/dist/cli-bundle/chunks/chunk-6O2HJENY.js.map +0 -7
  322. package/dist/cli-bundle/chunks/chunk-CCAGZCZK.js +0 -17
  323. package/dist/cli-bundle/chunks/chunk-CCAGZCZK.js.map +0 -7
  324. package/dist/cli-bundle/chunks/chunk-D2LXG7WX.js.map +0 -1
  325. package/dist/cli-bundle/chunks/chunk-DGJF32JF.js.map +0 -7
  326. package/dist/cli-bundle/chunks/chunk-FCVVMAEX.js.map +0 -1
  327. package/dist/cli-bundle/chunks/chunk-FUOK7JZ6.js +0 -14
  328. package/dist/cli-bundle/chunks/chunk-FUOK7JZ6.js.map +0 -1
  329. package/dist/cli-bundle/chunks/chunk-G3IB5GTD.js.map +0 -7
  330. package/dist/cli-bundle/chunks/chunk-J567OZJY.js.map +0 -1
  331. package/dist/cli-bundle/chunks/chunk-LDO24J5I.js.map +0 -7
  332. package/dist/cli-bundle/chunks/chunk-NA5SBIB4.js.map +0 -7
  333. package/dist/cli-bundle/chunks/chunk-OKDBHOON.js.map +0 -1
  334. package/dist/cli-bundle/chunks/chunk-OMT4NO7T.js.map +0 -7
  335. package/dist/cli-bundle/chunks/chunk-OTZ3C2NE.js.map +0 -1
  336. package/dist/cli-bundle/chunks/chunk-QRRUGIJN.js.map +0 -1
  337. package/dist/cli-bundle/chunks/chunk-QXYKH56X.js.map +0 -7
  338. package/dist/cli-bundle/chunks/chunk-RKGFUC4O.js.map +0 -1
  339. package/dist/cli-bundle/chunks/chunk-RPCCQDG2.js.map +0 -7
  340. package/dist/cli-bundle/chunks/chunk-TGG7YGMC.js.map +0 -1
  341. package/dist/cli-bundle/chunks/chunk-TNGLCRKS.js.map +0 -1
  342. package/dist/cli-bundle/chunks/chunk-UTYNQ2WH.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-VL4LYTJN.js.map +0 -7
  344. package/dist/cli-bundle/chunks/chunk-VLFLRFJP.js.map +0 -1
  345. package/dist/cli-bundle/chunks/chunk-WKSFBBZT.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-XY3CC3EM.js.map +0 -7
  347. package/dist/cli-bundle/chunks/chunk-ZTSV7P2T.js.map +0 -1
  348. package/dist/cli-bundle/chunks/close-BWM7FTF4.js +0 -12
  349. package/dist/cli-bundle/chunks/close-many-AUHTVFUQ.js +0 -21
  350. package/dist/cli-bundle/chunks/comments-7D5VPBZI.js +0 -13
  351. package/dist/cli-bundle/chunks/copy-QJ6ZVWZV.js +0 -9
  352. package/dist/cli-bundle/chunks/create-FGMTTYOI.js +0 -25
  353. package/dist/cli-bundle/chunks/delete-L2GMMMPR.js +0 -10
  354. package/dist/cli-bundle/chunks/deps-KTFI4RWD.js +0 -13
  355. package/dist/cli-bundle/chunks/docs-VNURA275.js +0 -14
  356. package/dist/cli-bundle/chunks/files-UNFPZLTG.js +0 -18
  357. package/dist/cli-bundle/chunks/focus-MI2UHBP4.js +0 -10
  358. package/dist/cli-bundle/chunks/history-redact-VAHGBUHI.js +0 -16
  359. package/dist/cli-bundle/chunks/history-repair-DDYQXR43.js +0 -18
  360. package/dist/cli-bundle/chunks/learnings-VWJEKHEO.js +0 -13
  361. package/dist/cli-bundle/chunks/notes-NGVJJJQO.js +0 -13
  362. package/dist/cli-bundle/chunks/plan-U6SQJUFI.js +0 -24
  363. package/dist/cli-bundle/chunks/restore-AX6ZMGHZ.js +0 -14
  364. package/dist/cli-bundle/chunks/update-XYHF3YZF.js +0 -21
  365. package/dist/cli-bundle/chunks/update-many-5HKVHFUL.js +0 -30
  366. /package/dist/cli-bundle/chunks/{append-CTKFDEAX.js.map → append-DYQWQK2J.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{append-2FS6MVG7.js.map → append-PVZJDM6J.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-J2WAWP4U.js.map → chunk-2FNWQXZ2.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-YFGYDZRP.js.map → chunk-2GA3NK35.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-XFEIASAC.js.map → chunk-2QIQGYPW.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-3WCGYH5Q.js.map → chunk-3CMRNVTO.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{close-BWM7FTF4.js.map → chunk-3HKUXVKV.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-VDAZPPRU.js.map → chunk-3I3LRT2G.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-3P3RFJIQ.js.map → chunk-3TL7WOEF.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-4SHJ5JS3.js.map → chunk-44LNIULG.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-BVCF4ULV.js.map → chunk-4RXTMU57.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-XMI2TRY5.js.map → chunk-4WREH7RT.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-JYUGUXFW.js.map → chunk-5CT5BW6E.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-QGH6WL6L.js.map → chunk-655STMGA.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-DGKBWCMA.js.map → chunk-6IIVBC56.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-D4GPNYYP.js.map → chunk-6OTZMORS.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-JVRVXO6M.js.map → chunk-6PKA3SJQ.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{close-many-AUHTVFUQ.js.map → chunk-6X5MZ5R2.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{close-CU56F47E.js.map → chunk-76UBY2EE.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-ZS2KPCJN.js.map → chunk-7QDSYUMF.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-Z7TFPIJ6.js.map → chunk-7TQMR6LK.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-AHA4POA6.js.map → chunk-ABRCOSDC.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-KQJVTQVK.js.map → chunk-ANSJHDOZ.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{close-many-ZQ2WP67J.js.map → chunk-B7SWOIP6.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-HXTCZSAI.js.map → chunk-DBZVUJTK.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-2QNOWOIB.js.map → chunk-DO5RGJXT.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-MKONZ4UO.js.map → chunk-DRNJPEPQ.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-H36FXA7B.js.map → chunk-DYEX6NFH.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-GAJ7U7B4.js.map → chunk-ERL2YFJ2.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-FPEYOFEF.js.map → chunk-F7PSHRNO.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-UH7OLT6F.js.map → chunk-FDSBDNYE.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-RQAY7C5T.js.map → chunk-FJZDA6MS.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-B4TVNGRX.js.map → chunk-FO7GMJKG.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{comments-UDUMKXL6.js.map → chunk-FRQ63VPB.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-U252II47.js.map → chunk-FTQLW4JD.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-AGD4VZXH.js.map → chunk-H2QBAKLQ.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-CJVQ4XIG.js.map → chunk-HAMLIWAF.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{chunk-7QOIQTPB.js.map → chunk-HLHSQ5CA.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{chunk-AHC7J6XD.js.map → chunk-IA3YFTXT.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{chunk-5ZCVF4WF.js.map → chunk-IAPHYPRL.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{chunk-OCSQWIOW.js.map → chunk-IFZA4VB5.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{chunk-4WMFM77X.js.map → chunk-J4NZOP3I.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{chunk-MTNKSSSO.js.map → chunk-JL7WZ4O2.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{chunk-AZ52LTCY.js.map → chunk-K7WNZ7KD.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{chunk-2OLSXXIV.js.map → chunk-KADLSPIU.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{chunk-RQKORMM4.js.map → chunk-KB726FMH.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{chunk-TZTQ4TVV.js.map → chunk-M6ASXYCU.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{chunk-WDDOAU7Z.js.map → chunk-M7EWN4TF.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{chunk-327DSGW2.js.map → chunk-MD6ULIPJ.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{chunk-M52DG2QJ.js.map → chunk-MQZ3PLCF.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{chunk-GQ2CQNGI.js.map → chunk-N3CMP4NI.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{chunk-J7SBFUZC.js.map → chunk-NAQYVWSQ.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{chunk-U2GMYP3L.js.map → chunk-NKW36AMT.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{chunk-FTQQAPRX.js.map → chunk-PHKP3AGR.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{chunk-WVUXNIYO.js.map → chunk-Q37E63AM.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{chunk-JVXV7ANV.js.map → chunk-Q7E6OYZK.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{chunk-WVUYATII.js.map → chunk-QABYZYLU.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{chunk-7TQPV7HR.js.map → chunk-QSPARJWF.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{chunk-GTKILM6F.js.map → chunk-QZ7LT3XE.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{chunk-L3VKY6R6.js.map → chunk-RA5AIAMP.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-BJS27ALI.js.map → chunk-RGXD5JJR.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-TSEPW2P6.js.map → chunk-RMF3IOYQ.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-TGGTXC52.js.map → chunk-TH7U4KLY.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-LP4UATP6.js.map → chunk-TWLDBKQU.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-UK222BHQ.js.map → chunk-TZRTLMWM.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-6E6S2X6S.js.map → chunk-UB2QYSTO.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-S6CXUSYC.js.map → chunk-UGTVWL3E.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-BNS6QHTZ.js.map → chunk-UJ4HJYWL.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-BYVOEJPQ.js.map → chunk-UKUIIBDW.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-SGDBVR7X.js.map → chunk-UVBA6F5A.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-DZRZMBBF.js.map → chunk-VJTAEIPC.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-74PWVJON.js.map → chunk-W6HZ55JO.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-P7IFURWH.js.map → chunk-WPAWZW7S.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-36LEOWSX.js.map → chunk-WQUEHPZB.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-FCKJF7G2.js.map → chunk-WRKB56FC.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-KR5EHAN4.js.map → chunk-X3GYR4P2.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-OWW2KXOV.js.map → chunk-YQYG2V23.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-G2SCT7BC.js.map → chunk-YVKE5ZDM.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-QHIN4UTF.js.map → chunk-ZAYYDNB3.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{comments-7D5VPBZI.js.map → chunk-ZHBI2AP7.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-GNVBUNJQ.js.map → chunk-ZTRBSABY.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-PY32KGQU.js.map → chunk-ZUKSZVBW.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{copy-VFHECFBV.js.map → close-LZECOMHO.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{copy-QJ6ZVWZV.js.map → close-RI4JQQHU.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{create-FGMTTYOI.js.map → close-many-LY2XJ52M.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{create-CE2X3SGF.js.map → close-many-ZHI6A5TN.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{delete-L2GMMMPR.js.map → comments-35M273DN.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{delete-2JXQCHHT.js.map → comments-AJWRTFZ5.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{deps-FPXNLO6C.js.map → copy-GMXYKBXT.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{deps-KTFI4RWD.js.map → copy-NPYM7M7U.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{docs-VNURA275.js.map → create-F53OBTOU.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{docs-AMAR4OHU.js.map → create-HU4Q7RJX.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{files-JFHN7DYM.js.map → delete-GSDZLTRC.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{files-UNFPZLTG.js.map → delete-ODRWJWAM.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{focus-MI2UHBP4.js.map → deps-U57I7EAK.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{focus-QFN2RRZ7.js.map → deps-WWB7P2GT.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{history-compact-SAHT5D46.js.map → docs-G7N4E2JO.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{history-compact-G34XMABV.js.map → docs-MQIY2ZQS.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{history-redact-VAHGBUHI.js.map → files-TBZD7V6H.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{history-redact-IFJDNKLZ.js.map → files-TTY6N2AV.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{history-repair-DDYQXR43.js.map → focus-U5TRVCRS.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{history-repair-NXLQTCVN.js.map → focus-XT6YVFFX.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{learnings-5CZKAMBS.js.map → history-compact-KKVUWB4V.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{learnings-VWJEKHEO.js.map → history-compact-M7GHYVFN.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{notes-POMK37UI.js.map → history-redact-3DVZOILD.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{notes-NGVJJJQO.js.map → history-redact-JIHZLHDP.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{plan-YBNYNT3A.js.map → history-repair-ITDUMK4N.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{plan-U6SQJUFI.js.map → history-repair-NAFCHLH7.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{profile-JNKSU6EQ.js.map → learnings-FGO3NSFW.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{profile-A2WPVG6I.js.map → learnings-SONGPSHI.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{restore-AX6ZMGHZ.js.map → notes-BSD53H2W.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{restore-IVS5XGYR.js.map → notes-NQ6RXVW6.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{schema-R3U2REY4.js.map → plan-2NNEO46V.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{schema-P2MF23JO.js.map → plan-AWLYGBNV.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{update-YBIQESMH.js.map → profile-AAQUU6T3.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{update-XYHF3YZF.js.map → profile-U725ATWZ.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{register-mutation-3OXYXBKH.js.map → register-mutation-4FMGJJF7.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{register-mutation-WK265BM7.js.map → register-mutation-UELYYOR7.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{register-setup-CCK7CJVR.js.map → register-setup-5XNGKJ22.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{register-setup-CPZBGSOJ.js.map → register-setup-ZTNY6S7R.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{update-many-5HKVHFUL.js.map → restore-66GLMHIX.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{update-many-F3CIV5SQ.js.map → restore-B3BAB6X2.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"parse.js","sources":["core/item/parse.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/item/parse\n *\n * Defines item parsing, formatting, and lifecycle helpers for Parse.\n */\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\n\nconst STDIN_TOKEN = \"-\";\nconst CONTINUABLE_VALUE_KEYS = new Set([\n \"actual_result\",\n \"body\",\n \"cmd\",\n \"command\",\n \"customer_impact\",\n \"description\",\n \"environment\",\n \"expected_result\",\n \"impact\",\n \"location\",\n \"message\",\n \"note\",\n \"outcome\",\n \"repro_steps\",\n \"resolution\",\n \"text\",\n \"title\",\n \"unblock_note\",\n \"value\",\n \"why_now\",\n]);\n\n/** Implements parse tags for the public runtime surface of this module. */\nexport function parseTags(raw: string): string[] {\n const trimmed = raw.trim();\n if (trimmed === \"\") {\n return [];\n }\n const source = coerceJsonTagArray(trimmed) ?? trimmed;\n const tags = source\n .split(\",\")\n .map((tag) => tag.trim())\n .filter(Boolean)\n .map((tag) => tag.toLowerCase());\n return Array.from(new Set(tags)).sort((a, b) => a.localeCompare(b));\n}\n\n/** Merge repeated `--add-tags` / `--remove-tags` values into a single normalized tag list. Each entry can itself be CSV or a JSON array, mirroring the format accepted by `--tags`. Returns a deterministically sorted, deduped list. */\nexport function collectTagFlagValues(\n values: readonly string[] | undefined,\n): string[] {\n if (!Array.isArray(values) || values.length === 0) {\n return [];\n }\n const collected: string[] = [];\n for (const raw of values) {\n if (typeof raw !== \"string\") {\n continue;\n }\n for (const tag of parseTags(raw)) {\n collected.push(tag);\n }\n }\n return Array.from(new Set(collected)).sort((a, b) => a.localeCompare(b));\n}\n\n/** Normalize a base tag list to the canonical form pm stores: trimmed, lowercased, non-empty. Existing item-metadata tags are almost always already canonical (parseTags lowercases on write), but legacy or hand-edited `.toon` files can carry mixed-case entries — normalizing here keeps additive and subtractive mutations case-insensitive (so `--add-tags beta` dedupes against an existing `Beta`, and `--remove-tags alpha` removes an existing `Alpha`). */\nfunction normalizeBaseTags(baseTags: readonly string[]): string[] {\n // Defensive: item-metadata parsed from corrupted/hand-edited `.toon` (or an\n // external SDK caller) could pass a non-array or non-string entries despite\n // the `string[]` type — guard the array and skip non-strings rather than\n // throwing on `.filter`/`.trim()`.\n if (!Array.isArray(baseTags)) {\n return [];\n }\n return baseTags\n .filter((tag): tag is string => typeof tag === \"string\")\n .map((tag) => tag.trim().toLowerCase())\n .filter(Boolean);\n}\n\n/** Apply an additive tag mutation to a base tag list. Used by `pm create` and `pm update` so `--add-tags` extends `--tags` (or the existing tags) without replacing them. Output is sorted + deduped lowercase, matching `parseTags`. */\nexport function mergeAdditiveTags(\n baseTags: readonly string[],\n add: readonly string[] | undefined,\n): string[] {\n const normalizedBase = normalizeBaseTags(baseTags);\n if (!add || add.length === 0) {\n return Array.from(new Set(normalizedBase)).sort((a, b) =>\n a.localeCompare(b),\n );\n }\n const merged = new Set<string>(normalizedBase);\n for (const tag of collectTagFlagValues(add)) {\n merged.add(tag);\n }\n return Array.from(merged).sort((a, b) => a.localeCompare(b));\n}\n\n/** Apply a subtractive tag mutation to a base tag list. Used by `pm update` so `--remove-tags x,y` prunes those entries without rewriting the full set. Removal is case-insensitive: both the base list and the removal selectors are normalized to canonical lowercase before matching. */\nexport function applyTagRemovals(\n baseTags: readonly string[],\n remove: readonly string[] | undefined,\n): string[] {\n const normalizedBase = Array.from(new Set(normalizeBaseTags(baseTags))).sort(\n (a, b) => a.localeCompare(b),\n );\n if (!remove || remove.length === 0) {\n return normalizedBase;\n }\n const removeSet = new Set(collectTagFlagValues(remove));\n if (removeSet.size === 0) {\n return normalizedBase;\n }\n return normalizedBase.filter((tag) => !removeSet.has(tag));\n}\n\n// Agents and MCP callers frequently pass --tags as a JSON array (e.g.\n// `--tags '[\"a\",\"b\"]'`). The MCP server normalizes that upstream, but direct\n// CLI invocations used to write the raw bracket string into item metadata,\n// silently corrupting tags. Accept JSON arrays of primitives transparently.\nfunction coerceJsonTagArray(trimmed: string): string | null {\n if (!trimmed.startsWith(\"[\")) {\n return null;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n return null;\n }\n const parsedArray = parsed as unknown[];\n return parsedArray\n .map((entry) =>\n typeof entry === \"string\" ||\n typeof entry === \"number\" ||\n typeof entry === \"boolean\"\n ? String(entry).replace(/,/g, \" \")\n : \"\",\n )\n .filter((entry) => entry.length > 0)\n .join(\",\");\n}\n\nfunction normalizeLineEndings(value: string): string {\n return value.replace(/\\r\\n/g, \"\\n\");\n}\n\nfunction stripCodeFenceEnvelope(value: string): string {\n const normalized = normalizeLineEndings(value).trim();\n if (!normalized.startsWith(\"```\")) {\n return value;\n }\n const lines = normalized.split(\"\\n\");\n if (lines.length < 2) {\n return value;\n }\n if (lines.at(-1)?.trim() !== \"```\") {\n return value;\n }\n return lines.slice(1, -1).join(\"\\n\");\n}\n\nfunction splitCsvSegments(raw: string): string[] {\n const segments: string[] = [];\n let current = \"\";\n let inQuotes = false;\n let escaped = false;\n\n for (const char of raw) {\n if (escaped) {\n current += char;\n escaped = false;\n continue;\n }\n if (char === \"\\\\\") {\n current += char;\n escaped = true;\n continue;\n }\n if (char === '\"') {\n inQuotes = !inQuotes;\n current += char;\n continue;\n }\n if (char === \",\" && !inQuotes) {\n segments.push(current.trim());\n current = \"\";\n continue;\n }\n current += char;\n }\n if (current.trim()) {\n segments.push(current.trim());\n }\n return segments;\n}\n\nfunction unquoteValue(value: string): string {\n const trimmed = value.trim();\n if (trimmed.startsWith('\"') && trimmed.endsWith('\"')) {\n return trimmed.slice(1, -1).replace(/\\\\\"/g, '\"');\n }\n return value;\n}\n\nfunction findKeyValueDelimiter(segment: string): number {\n const equalsIndex = segment.indexOf(\"=\");\n const colonIndex = segment.indexOf(\":\");\n const hasEquals = equalsIndex > 0;\n const hasColon = colonIndex > 0;\n if (hasEquals && hasColon) {\n return Math.min(equalsIndex, colonIndex);\n }\n if (hasEquals) {\n return equalsIndex;\n }\n if (hasColon) {\n return colonIndex;\n }\n return -1;\n}\n\nfunction buildOptionSpecificKvGuidance(\n raw: string,\n optionName: string,\n): string {\n if (optionName === \"--add\" || optionName === \"--add-glob\") {\n const looksLikePath =\n /[./\\\\]/.test(raw) || /\\.[a-z]{1,6}$/i.test(raw.trim());\n if (looksLikePath) {\n return \"For file/doc paths use: path=<file-path>[,scope=project|global]. The scope field is optional and defaults to project (example: path=src/api.ts or path=README.md,scope=project). \";\n }\n }\n if (optionName !== \"--event\") {\n return \"\";\n }\n const lowered = raw.toLowerCase();\n const recurrenceHint =\n lowered.includes(\"recur_\") || lowered.includes(\"recurrence\")\n ? ' Recurrence list values must stay in one field and use \"|\" delimiters (for example recur_by_weekday=mon|wed or recur_by_month_day=1|15).'\n : \"\";\n const weekdayAliasHint = lowered.includes(\"recur_byweekday\")\n ? \" Use recur_by_weekday (with underscores) for weekday recurrence filters.\"\n : \"\";\n return `${recurrenceHint}${weekdayAliasHint}`;\n}\n\nfunction buildInvalidKvMessage(raw: string, optionName: string): string {\n const condensed = raw.replaceAll(/\\s+/g, \" \").trim();\n const preview =\n condensed.length > 160 ? `${condensed.slice(0, 157)}...` : condensed;\n const optionSpecificGuidance = buildOptionSpecificKvGuidance(raw, optionName);\n return (\n `Invalid ${optionName} value \"${preview}\". Expected key=value entries separated by commas. ` +\n optionSpecificGuidance +\n 'Also accepts markdown-style key/value lines (for example \"- path: README.md\"). ' +\n `Use ${optionName} ${STDIN_TOKEN} to read piped stdin input.`\n );\n}\n\nfunction parseMarkdownKeyValueLines(\n raw: string,\n): Record<string, string> | null {\n const normalized = stripCodeFenceEnvelope(raw).trim();\n if (normalized.length === 0) {\n return null;\n }\n if (\n !normalized.includes(\"\\n\") &&\n !normalized.startsWith(\"-\") &&\n !normalized.startsWith(\"*\") &&\n !normalized.startsWith(\"+\")\n ) {\n return null;\n }\n\n const result: Record<string, string> = {};\n let activeKey: string | undefined;\n const lines = normalizeLineEndings(normalized)\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n\n for (const line of lines) {\n const match = line.match(/^(?:[-*+]\\s+)?([a-zA-Z0-9_.-]+)\\s*(=|:)\\s*(.*)$/);\n if (match) {\n const key = match[1].trim();\n result[key] = unquoteValue(match[3].trim());\n activeKey = key;\n continue;\n }\n if (activeKey && CONTINUABLE_VALUE_KEYS.has(activeKey.toLowerCase())) {\n result[activeKey] = `${result[activeKey]}\\n${line}`;\n continue;\n }\n return null;\n }\n\n return result;\n}\n\n/** Implements parse csv kv for the public runtime surface of this module. */\nexport function parseCsvKv(\n raw: string,\n optionName: string,\n): Record<string, string> {\n const trimmed = stripCodeFenceEnvelope(raw).trim();\n if (!trimmed) {\n throw new PmCliError(`${optionName} cannot be empty`, EXIT_CODE.USAGE);\n }\n\n const markdownStyle = parseMarkdownKeyValueLines(trimmed);\n if (markdownStyle) {\n return markdownStyle;\n }\n\n const result: Record<string, string> = {};\n let activeKey: string | undefined;\n const segments = splitCsvSegments(trimmed);\n\n for (const segment of segments) {\n const delimiterIndex = findKeyValueDelimiter(segment);\n if (delimiterIndex > 0) {\n const key = segment.slice(0, delimiterIndex).trim();\n const value = unquoteValue(segment.slice(delimiterIndex + 1).trim());\n result[key] = value;\n activeKey = key;\n continue;\n }\n if (activeKey && CONTINUABLE_VALUE_KEYS.has(activeKey.toLowerCase())) {\n result[activeKey] = `${result[activeKey]},${segment.trim()}`;\n continue;\n }\n throw new PmCliError(\n buildInvalidKvMessage(raw, optionName),\n EXIT_CODE.USAGE,\n );\n }\n\n return result;\n}\n\nconst WINDOWS_ABSOLUTE_PATH_PATTERN = /^[A-Za-z]:[\\\\/]/;\nconst GENERIC_LEADING_KV_KEY_PATTERN =\n /^(?:[-*+]\\s+)?[A-Za-z_][A-Za-z0-9_.-]*\\s*=/;\n\n/**\n * Detect a CSV/markdown entry that opens with a generic `key=` token even when\n * that key is unknown (e.g. a typo like `lable=main,path=README.md`). Callers\n * combine this with their known-key prefix check so a first-key typo is routed\n * through structured parsing and rejected by {@link assertNoUnknownCsvKeys}\n * (GH-258) instead of being silently swallowed as a bare path/value.\n *\n * Windows absolute paths (`C:\\…`) are excluded so a drive-lettered bare path is\n * never misread as a `C=…` key/value entry.\n */\nexport function looksLikeGenericKeyValueEntry(raw: string): boolean {\n const trimmed = raw.trim();\n if (WINDOWS_ABSOLUTE_PATH_PATTERN.test(trimmed)) {\n return false;\n }\n return GENERIC_LEADING_KV_KEY_PATTERN.test(trimmed);\n}\n\n/**\n * Reject any key in a parsed CSV/markdown key/value map that is not part of the\n * caller's allowed-key contract, mirroring the strict `test --add` behavior\n * (see linked-test-parsers). This closes the cross-command consistency defect\n * (GH-258) where structured link/metadata parsers silently DROPPED typoed keys\n * (e.g. `lable=` instead of `label=`), storing data the author never intended.\n *\n * Comparison is case-insensitive so a key the downstream reader would accept\n * (e.g. `Path`) is never falsely rejected; the emitted \"Allowed keys\" list\n * preserves the canonical casing the caller passes in. Recognized keys are then\n * normalized in-place to their lowercase canonical form so downstream readers\n * (`kv.path`, `kv.id`, `kv.at`, …) see the value even when the input used mixed\n * casing — otherwise `Path=README.md` would pass validation yet read back as an\n * undefined `path` and surface a confusing \"requires path\" error. A key that\n * collides with another after normalization (e.g. `path=a,Path=b`) is rejected.\n *\n * Parsers with an intentional plaintext fallback (`--comment`/`--note`/\n * `--learning`, annotation `--add`) deliberately do NOT call this — there an\n * unrecognized key means \"treat the whole entry as plaintext\", not an error.\n */\nexport function assertNoUnknownCsvKeys(\n kv: Record<string, string>,\n optionName: string,\n allowedKeys: readonly string[],\n): void {\n const allowed = new Set(allowedKeys.map((key) => key.toLowerCase()));\n const unknownKeys = Object.keys(kv).filter(\n (key) => !allowed.has(key.toLowerCase()),\n );\n if (unknownKeys.length > 0) {\n throw new PmCliError(\n `${optionName} does not recognize key${unknownKeys.length > 1 ? \"s\" : \"\"} ${unknownKeys\n .map((key) => `\"${key}\"`)\n .join(\", \")}. Allowed keys: ${allowedKeys.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n for (const key of Object.keys(kv)) {\n const normalizedKey = key.toLowerCase();\n if (normalizedKey === key) {\n continue;\n }\n if (Object.hasOwn(kv, normalizedKey)) {\n throw new PmCliError(\n `${optionName} provides key \"${key}\" more than once after case normalization.`,\n EXIT_CODE.USAGE,\n );\n }\n kv[normalizedKey] = kv[key];\n delete kv[key];\n }\n}\n\nasync function readStdinText(optionName: string): Promise<string> {\n if (process.stdin.isTTY === true) {\n throw new PmCliError(\n `${optionName} value \"${STDIN_TOKEN}\" requires piped stdin input. Pipe content into the command, or end manual stdin with Ctrl+D (Unix/macOS) or Ctrl+Z then Enter (Windows).`,\n EXIT_CODE.USAGE,\n );\n }\n process.stdin.setEncoding(\"utf8\");\n return await new Promise<string>((resolve, reject) => {\n let input = \"\";\n process.stdin.on(\"data\", (chunk: string) => {\n input += chunk;\n });\n process.stdin.on(\"end\", () => {\n resolve(normalizeLineEndings(input));\n });\n process.stdin.on(\"error\", (error) => {\n reject(error);\n });\n });\n}\n\n/** Documents the stdin token resolver payload exchanged by command, SDK, and package integrations. */\nexport interface StdinTokenResolver {\n /** Value that configures or reports resolve value for this contract. */\n resolveValue(\n value: string | undefined,\n optionName: string,\n ): Promise<string | undefined>;\n /** Value that configures or reports resolve list for this contract. */\n resolveList(\n values: string[] | undefined,\n optionName: string,\n ): Promise<string[] | undefined>;\n}\n\n/** Implements create stdin token resolver for the public runtime surface of this module. */\nexport function createStdinTokenResolver(): StdinTokenResolver {\n let stdinValuePromise: Promise<string> | undefined;\n let stdinConsumerOption: string | undefined;\n\n const consumeStdin = async (optionName: string): Promise<string> => {\n if (stdinConsumerOption && stdinConsumerOption !== optionName) {\n throw new PmCliError(\n `Only one option may use \"${STDIN_TOKEN}\" stdin token per command invocation. Already used by ${stdinConsumerOption}.`,\n EXIT_CODE.USAGE,\n );\n }\n stdinConsumerOption = optionName;\n if (!stdinValuePromise) {\n stdinValuePromise = readStdinText(optionName);\n }\n return await stdinValuePromise;\n };\n\n const resolveValue = async (\n value: string | undefined,\n optionName: string,\n ): Promise<string | undefined> => {\n if (value === undefined) {\n return undefined;\n }\n if (value.trim() !== STDIN_TOKEN) {\n return value;\n }\n return await consumeStdin(optionName);\n };\n\n const resolveList = async (\n values: string[] | undefined,\n optionName: string,\n ): Promise<string[] | undefined> => {\n if (!values) {\n return undefined;\n }\n const tokenIndexes = values\n .map((entry, index) => (entry.trim() === STDIN_TOKEN ? index : -1))\n .filter((index) => index >= 0);\n if (tokenIndexes.length === 0) {\n return values;\n }\n if (tokenIndexes.length > 1) {\n throw new PmCliError(\n `${optionName} accepts \"${STDIN_TOKEN}\" stdin token at most once per command invocation`,\n EXIT_CODE.USAGE,\n );\n }\n const stdinValue = await consumeStdin(optionName);\n const next = [...values];\n next[tokenIndexes[0]] = stdinValue;\n return next;\n };\n\n return {\n resolveValue,\n resolveList,\n };\n}\n\n/** Implements parse optional number for the public runtime surface of this module. */\nexport function parseOptionalNumber(raw: string, optionName: string): number {\n const value = Number(raw);\n if (!Number.isFinite(value)) {\n throw new PmCliError(\n `Invalid ${optionName} value \"${raw}\"`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n coerceJsonTagArray,\n stripCodeFenceEnvel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js","sources":["core/item/parse.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/item/parse\n *\n * Defines item parsing, formatting, and lifecycle helpers for Parse.\n */\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\n\nconst STDIN_TOKEN = \"-\";\nconst CONTINUABLE_VALUE_KEYS = new Set([\n \"actual_result\",\n \"body\",\n \"cmd\",\n \"command\",\n \"customer_impact\",\n \"description\",\n \"environment\",\n \"expected_result\",\n \"impact\",\n \"location\",\n \"message\",\n \"note\",\n \"outcome\",\n \"repro_steps\",\n \"resolution\",\n \"text\",\n \"title\",\n \"unblock_note\",\n \"value\",\n \"why_now\",\n]);\n\n/** Implements parse tags for the public runtime surface of this module. */\nexport function parseTags(raw: string): string[] {\n const trimmed = raw.trim();\n if (trimmed === \"\") {\n return [];\n }\n const source = coerceJsonTagArray(trimmed) ?? trimmed;\n const tags = source\n .split(\",\")\n .map((tag) => tag.trim())\n .filter(Boolean)\n .map((tag) => tag.toLowerCase());\n return Array.from(new Set(tags)).sort((a, b) => a.localeCompare(b));\n}\n\n/** Merge repeated `--add-tags` / `--remove-tags` values into a single normalized tag list. Each entry can itself be CSV or a JSON array, mirroring the format accepted by `--tags`. Returns a deterministically sorted, deduped list. */\nexport function collectTagFlagValues(\n values: readonly string[] | undefined,\n): string[] {\n if (!Array.isArray(values) || values.length === 0) {\n return [];\n }\n const collected: string[] = [];\n for (const raw of values) {\n if (typeof raw !== \"string\") {\n continue;\n }\n for (const tag of parseTags(raw)) {\n collected.push(tag);\n }\n }\n return Array.from(new Set(collected)).sort((a, b) => a.localeCompare(b));\n}\n\n/** Normalize a base tag list to the canonical form pm stores: trimmed, lowercased, non-empty. Existing item-metadata tags are almost always already canonical (parseTags lowercases on write), but legacy or hand-edited `.toon` files can carry mixed-case entries — normalizing here keeps additive and subtractive mutations case-insensitive (so `--add-tags beta` dedupes against an existing `Beta`, and `--remove-tags alpha` removes an existing `Alpha`). */\nfunction normalizeBaseTags(baseTags: readonly string[]): string[] {\n // Defensive: item-metadata parsed from corrupted/hand-edited `.toon` (or an\n // external SDK caller) could pass a non-array or non-string entries despite\n // the `string[]` type — guard the array and skip non-strings rather than\n // throwing on `.filter`/`.trim()`.\n if (!Array.isArray(baseTags)) {\n return [];\n }\n return baseTags\n .filter((tag): tag is string => typeof tag === \"string\")\n .map((tag) => tag.trim().toLowerCase())\n .filter(Boolean);\n}\n\n/** Apply an additive tag mutation to a base tag list. Used by `pm create` and `pm update` so `--add-tags` extends `--tags` (or the existing tags) without replacing them. Output is sorted + deduped lowercase, matching `parseTags`. */\nexport function mergeAdditiveTags(\n baseTags: readonly string[],\n add: readonly string[] | undefined,\n): string[] {\n const normalizedBase = normalizeBaseTags(baseTags);\n if (!add || add.length === 0) {\n return Array.from(new Set(normalizedBase)).sort((a, b) =>\n a.localeCompare(b),\n );\n }\n const merged = new Set<string>(normalizedBase);\n for (const tag of collectTagFlagValues(add)) {\n merged.add(tag);\n }\n return Array.from(merged).sort((a, b) => a.localeCompare(b));\n}\n\n/** Apply a subtractive tag mutation to a base tag list. Used by `pm update` so `--remove-tags x,y` prunes those entries without rewriting the full set. Removal is case-insensitive: both the base list and the removal selectors are normalized to canonical lowercase before matching. */\nexport function applyTagRemovals(\n baseTags: readonly string[],\n remove: readonly string[] | undefined,\n): string[] {\n const normalizedBase = Array.from(new Set(normalizeBaseTags(baseTags))).sort(\n (a, b) => a.localeCompare(b),\n );\n if (!remove || remove.length === 0) {\n return normalizedBase;\n }\n const removeSet = new Set(collectTagFlagValues(remove));\n if (removeSet.size === 0) {\n return normalizedBase;\n }\n return normalizedBase.filter((tag) => !removeSet.has(tag));\n}\n\n// Agents and MCP callers frequently pass --tags as a JSON array (e.g.\n// `--tags '[\"a\",\"b\"]'`). The MCP server normalizes that upstream, but direct\n// CLI invocations used to write the raw bracket string into item metadata,\n// silently corrupting tags. Accept JSON arrays of primitives transparently.\nfunction coerceJsonTagArray(trimmed: string): string | null {\n if (!trimmed.startsWith(\"[\")) {\n return null;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n return null;\n }\n const parsedArray = parsed as unknown[];\n return parsedArray\n .map((entry) =>\n typeof entry === \"string\" ||\n typeof entry === \"number\" ||\n typeof entry === \"boolean\"\n ? String(entry).replace(/,/g, \" \")\n : \"\",\n )\n .filter((entry) => entry.length > 0)\n .join(\",\");\n}\n\nfunction normalizeLineEndings(value: string): string {\n return value.replace(/\\r\\n/g, \"\\n\");\n}\n\nfunction stripCodeFenceEnvelope(value: string): string {\n const normalized = normalizeLineEndings(value).trim();\n if (!normalized.startsWith(\"```\")) {\n return value;\n }\n const lines = normalized.split(\"\\n\");\n if (lines.length < 2) {\n return value;\n }\n if (lines.at(-1)?.trim() !== \"```\") {\n return value;\n }\n return lines.slice(1, -1).join(\"\\n\");\n}\n\nfunction splitCsvSegments(raw: string): string[] {\n const segments: string[] = [];\n let current = \"\";\n let inQuotes = false;\n let escaped = false;\n\n for (const char of raw) {\n if (escaped) {\n current += char;\n escaped = false;\n continue;\n }\n if (char === \"\\\\\") {\n current += char;\n escaped = true;\n continue;\n }\n if (char === '\"') {\n inQuotes = !inQuotes;\n current += char;\n continue;\n }\n if (char === \",\" && !inQuotes) {\n segments.push(current.trim());\n current = \"\";\n continue;\n }\n current += char;\n }\n if (current.trim()) {\n segments.push(current.trim());\n }\n return segments;\n}\n\nfunction unquoteValue(value: string): string {\n const trimmed = value.trim();\n if (trimmed.startsWith('\"') && trimmed.endsWith('\"')) {\n return trimmed.slice(1, -1).replace(/\\\\\"/g, '\"');\n }\n return value;\n}\n\nfunction findKeyValueDelimiter(segment: string): number {\n const equalsIndex = segment.indexOf(\"=\");\n const colonIndex = segment.indexOf(\":\");\n const hasEquals = equalsIndex > 0;\n const hasColon = colonIndex > 0;\n if (hasEquals && hasColon) {\n return Math.min(equalsIndex, colonIndex);\n }\n if (hasEquals) {\n return equalsIndex;\n }\n if (hasColon) {\n return colonIndex;\n }\n return -1;\n}\n\nfunction buildOptionSpecificKvGuidance(\n raw: string,\n optionName: string,\n): string {\n if (optionName === \"--add\" || optionName === \"--add-glob\") {\n const looksLikePath =\n /[./\\\\]/.test(raw) || /\\.[a-z]{1,6}$/i.test(raw.trim());\n if (looksLikePath) {\n return \"For file/doc paths use: path=<file-path>[,scope=project|global]. The scope field is optional and defaults to project (example: path=src/api.ts or path=README.md,scope=project). \";\n }\n }\n if (optionName !== \"--event\") {\n return \"\";\n }\n const lowered = raw.toLowerCase();\n const recurrenceHint =\n lowered.includes(\"recur_\") || lowered.includes(\"recurrence\")\n ? ' Recurrence list values must stay in one field and use \"|\" delimiters (for example recur_by_weekday=mon|wed or recur_by_month_day=1|15).'\n : \"\";\n const weekdayAliasHint = lowered.includes(\"recur_byweekday\")\n ? \" Use recur_by_weekday (with underscores) for weekday recurrence filters.\"\n : \"\";\n return `${recurrenceHint}${weekdayAliasHint}`;\n}\n\nfunction buildInvalidKvMessage(raw: string, optionName: string): string {\n const condensed = raw.replaceAll(/\\s+/g, \" \").trim();\n const preview =\n condensed.length > 160 ? `${condensed.slice(0, 157)}...` : condensed;\n const optionSpecificGuidance = buildOptionSpecificKvGuidance(raw, optionName);\n return (\n `Invalid ${optionName} value \"${preview}\". Expected key=value entries separated by commas. ` +\n optionSpecificGuidance +\n 'Also accepts markdown-style key/value lines (for example \"- path: README.md\"). ' +\n `Use ${optionName} ${STDIN_TOKEN} to read piped stdin input.`\n );\n}\n\nfunction parseMarkdownKeyValueLines(\n raw: string,\n): Record<string, string> | null {\n const normalized = stripCodeFenceEnvelope(raw).trim();\n if (normalized.length === 0) {\n return null;\n }\n if (\n !normalized.includes(\"\\n\") &&\n !normalized.startsWith(\"-\") &&\n !normalized.startsWith(\"*\") &&\n !normalized.startsWith(\"+\")\n ) {\n return null;\n }\n\n const result: Record<string, string> = {};\n let activeKey: string | undefined;\n const lines = normalizeLineEndings(normalized)\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n\n for (const line of lines) {\n const match = line.match(/^(?:[-*+]\\s+)?([a-zA-Z0-9_.-]+)\\s*(=|:)\\s*(.*)$/);\n if (match) {\n const key = match[1].trim();\n result[key] = unquoteValue(match[3].trim());\n activeKey = key;\n continue;\n }\n if (activeKey && CONTINUABLE_VALUE_KEYS.has(activeKey.toLowerCase())) {\n result[activeKey] = `${result[activeKey]}\\n${line}`;\n continue;\n }\n return null;\n }\n\n return result;\n}\n\n/** Implements parse csv kv for the public runtime surface of this module. */\nexport function parseCsvKv(\n raw: string,\n optionName: string,\n): Record<string, string> {\n const trimmed = stripCodeFenceEnvelope(raw).trim();\n if (!trimmed) {\n throw new PmCliError(`${optionName} cannot be empty`, EXIT_CODE.USAGE);\n }\n\n const markdownStyle = parseMarkdownKeyValueLines(trimmed);\n if (markdownStyle) {\n return markdownStyle;\n }\n\n const result: Record<string, string> = {};\n let activeKey: string | undefined;\n const segments = splitCsvSegments(trimmed);\n\n for (const segment of segments) {\n const delimiterIndex = findKeyValueDelimiter(segment);\n if (delimiterIndex > 0) {\n const key = segment.slice(0, delimiterIndex).trim();\n const value = unquoteValue(segment.slice(delimiterIndex + 1).trim());\n result[key] = value;\n activeKey = key;\n continue;\n }\n if (activeKey && CONTINUABLE_VALUE_KEYS.has(activeKey.toLowerCase())) {\n result[activeKey] = `${result[activeKey]},${segment.trim()}`;\n continue;\n }\n throw new PmCliError(\n buildInvalidKvMessage(raw, optionName),\n EXIT_CODE.USAGE,\n );\n }\n\n return result;\n}\n\nconst WINDOWS_ABSOLUTE_PATH_PATTERN = /^[A-Za-z]:[\\\\/]/;\nconst GENERIC_LEADING_KV_KEY_PATTERN =\n /^(?:[-*+]\\s+)?[A-Za-z_][A-Za-z0-9_.-]*\\s*=/;\n\n/**\n * Detect a CSV/markdown entry that opens with a generic `key=` token even when\n * that key is unknown (e.g. a typo like `lable=main,path=README.md`). Callers\n * combine this with their known-key prefix check so a first-key typo is routed\n * through structured parsing and rejected by {@link assertNoUnknownCsvKeys}\n * (GH-258) instead of being silently swallowed as a bare path/value.\n *\n * Windows absolute paths (`C:\\…`) are excluded so a drive-lettered bare path is\n * never misread as a `C=…` key/value entry.\n */\nexport function looksLikeGenericKeyValueEntry(raw: string): boolean {\n const trimmed = raw.trim();\n if (WINDOWS_ABSOLUTE_PATH_PATTERN.test(trimmed)) {\n return false;\n }\n return GENERIC_LEADING_KV_KEY_PATTERN.test(trimmed);\n}\n\n/**\n * Reject any key in a parsed CSV/markdown key/value map that is not part of the\n * caller's allowed-key contract, mirroring the strict `test --add` behavior\n * (see linked-test-parsers). This closes the cross-command consistency defect\n * (GH-258) where structured link/metadata parsers silently DROPPED typoed keys\n * (e.g. `lable=` instead of `label=`), storing data the author never intended.\n *\n * Comparison is case-insensitive so a key the downstream reader would accept\n * (e.g. `Path`) is never falsely rejected; the emitted \"Allowed keys\" list\n * preserves the canonical casing the caller passes in. Recognized keys are then\n * normalized in-place to their lowercase canonical form so downstream readers\n * (`kv.path`, `kv.id`, `kv.at`, …) see the value even when the input used mixed\n * casing — otherwise `Path=README.md` would pass validation yet read back as an\n * undefined `path` and surface a confusing \"requires path\" error. A key that\n * collides with another after normalization (e.g. `path=a,Path=b`) is rejected.\n *\n * Parsers with an intentional plaintext fallback (`--comment`/`--note`/\n * `--learning`, annotation `--add`) deliberately do NOT call this — there an\n * unrecognized key means \"treat the whole entry as plaintext\", not an error.\n */\nexport function assertNoUnknownCsvKeys(\n kv: Record<string, string>,\n optionName: string,\n allowedKeys: readonly string[],\n): void {\n const allowed = new Set(allowedKeys.map((key) => key.toLowerCase()));\n const unknownKeys = Object.keys(kv).filter(\n (key) => !allowed.has(key.toLowerCase()),\n );\n if (unknownKeys.length > 0) {\n throw new PmCliError(\n `${optionName} does not recognize key${unknownKeys.length > 1 ? \"s\" : \"\"} ${unknownKeys\n .map((key) => `\"${key}\"`)\n .join(\", \")}. Allowed keys: ${allowedKeys.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n for (const key of Object.keys(kv)) {\n const normalizedKey = key.toLowerCase();\n if (normalizedKey === key) {\n continue;\n }\n if (Object.hasOwn(kv, normalizedKey)) {\n throw new PmCliError(\n `${optionName} provides key \"${key}\" more than once after case normalization.`,\n EXIT_CODE.USAGE,\n );\n }\n kv[normalizedKey] = kv[key];\n delete kv[key];\n }\n}\n\nasync function readStdinText(optionName: string): Promise<string> {\n if (process.stdin.isTTY === true) {\n throw new PmCliError(\n `${optionName} value \"${STDIN_TOKEN}\" requires piped stdin input. Pipe content into the command, or end manual stdin with Ctrl+D (Unix/macOS) or Ctrl+Z then Enter (Windows).`,\n EXIT_CODE.USAGE,\n );\n }\n process.stdin.setEncoding(\"utf8\");\n return await new Promise<string>((resolve, reject) => {\n let input = \"\";\n process.stdin.on(\"data\", (chunk: string) => {\n input += chunk;\n });\n process.stdin.on(\"end\", () => {\n resolve(normalizeLineEndings(input));\n });\n process.stdin.on(\"error\", (error) => {\n reject(error);\n });\n });\n}\n\n/** Documents the stdin token resolver payload exchanged by command, SDK, and package integrations. */\nexport interface StdinTokenResolver {\n /** Value that configures or reports resolve value for this contract. */\n resolveValue(\n value: string | undefined,\n optionName: string,\n ): Promise<string | undefined>;\n /** Value that configures or reports resolve list for this contract. */\n resolveList(\n values: string[] | undefined,\n optionName: string,\n ): Promise<string[] | undefined>;\n}\n\n/** Implements create stdin token resolver for the public runtime surface of this module. */\nexport function createStdinTokenResolver(): StdinTokenResolver {\n let stdinValuePromise: Promise<string> | undefined;\n let stdinConsumerOption: string | undefined;\n\n const consumeStdin = async (optionName: string): Promise<string> => {\n if (stdinConsumerOption && stdinConsumerOption !== optionName) {\n throw new PmCliError(\n `Only one option may use \"${STDIN_TOKEN}\" stdin token per command invocation. Already used by ${stdinConsumerOption}.`,\n EXIT_CODE.USAGE,\n );\n }\n stdinConsumerOption = optionName;\n if (!stdinValuePromise) {\n stdinValuePromise = readStdinText(optionName);\n }\n return await stdinValuePromise;\n };\n\n const resolveValue = async (\n value: string | undefined,\n optionName: string,\n ): Promise<string | undefined> => {\n if (value === undefined) {\n return undefined;\n }\n if (value.trim() !== STDIN_TOKEN) {\n return value;\n }\n return await consumeStdin(optionName);\n };\n\n const resolveList = async (\n values: string[] | undefined,\n optionName: string,\n ): Promise<string[] | undefined> => {\n if (!values) {\n return undefined;\n }\n const tokenIndexes = values\n .map((entry, index) => (entry.trim() === STDIN_TOKEN ? index : -1))\n .filter((index) => index >= 0);\n if (tokenIndexes.length === 0) {\n return values;\n }\n if (tokenIndexes.length > 1) {\n throw new PmCliError(\n `${optionName} accepts \"${STDIN_TOKEN}\" stdin token at most once per command invocation`,\n EXIT_CODE.USAGE,\n );\n }\n const stdinValue = await consumeStdin(optionName);\n const next = [...values];\n next[tokenIndexes[0]] = stdinValue;\n return next;\n };\n\n return {\n resolveValue,\n resolveList,\n };\n}\n\n/** Implements parse optional number for the public runtime surface of this module. */\nexport function parseOptionalNumber(raw: string, optionName: string): number {\n const value = Number(raw);\n if (!Number.isFinite(value)) {\n throw new PmCliError(\n `Invalid ${optionName} value \"${raw}\"`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\n/** Parse a non-negative integer option such as an item duration estimate. */\nexport function parseOptionalNonNegativeInteger(\n raw: string,\n optionName: string,\n): number {\n const trimmed = raw.trim();\n const value = Number(trimmed);\n if (trimmed === \"\" || !Number.isInteger(value) || value < 0) {\n throw new PmCliError(\n `Invalid ${optionName} value \"${raw}\". Expected a non-negative integer.`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n coerceJsonTagArray,\n stripCodeFenceEnvelope,\n parseMarkdownKeyValueLines,\n};\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,sBAAsB,GAAG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ACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,kBAAkB;IAClB,sBAAsB;IACtB,0BAA0B;CAC3B,CAAC","debugId":"fb39edac-1965-5a52-9c0c-c4330fe3a8c7"}
@@ -9,6 +9,8 @@ declare const ITEM_FORMAT_BY_EXTENSION: {
9
9
  export declare const ITEM_FILE_EXTENSIONS: Array<keyof typeof ITEM_FORMAT_BY_EXTENSION>;
10
10
  /** Implements resolve pm root for the public runtime surface of this module. */
11
11
  export declare function resolvePmRoot(cwd: string, cliPath?: string): string;
12
+ /** Resolve the project workspace that owns a tracker root. */
13
+ export declare function resolveWorkspaceRoot(pmRoot: string): string;
12
14
  /** Implements resolve global pm root for the public runtime surface of this module. */
13
15
  export declare function resolveGlobalPmRoot(cwd: string): string;
14
16
  /** Implements get settings path for the public runtime surface of this module. */
@@ -4,7 +4,7 @@
4
4
  * Reads and writes tracker storage with format-aware helpers for Paths.
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]="15dc4b5d-4bb7-5e3b-bc99-2d7e3a334189")}catch(e){}}();
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]="c608ecfa-22ff-57f1-ba73-5c9d9dcda559")}catch(e){}}();
8
8
  import { readFileSync, statSync } from "node:fs";
9
9
  import os from "node:os";
10
10
  import path from "node:path";
@@ -101,6 +101,14 @@ export function resolvePmRoot(cwd, cliPath) {
101
101
  const selected = PM_DIRNAME;
102
102
  return path.resolve(cwd, selected);
103
103
  }
104
+ /** Resolve the project workspace that owns a tracker root. */
105
+ export function resolveWorkspaceRoot(pmRoot) {
106
+ const normalizedRoot = path.resolve(pmRoot);
107
+ const parent = path.dirname(normalizedRoot);
108
+ return path.basename(normalizedRoot) === "pm" && path.basename(parent) === ".agents"
109
+ ? path.dirname(parent)
110
+ : normalizedRoot;
111
+ }
104
112
  /** Implements resolve global pm root for the public runtime surface of this module. */
105
113
  export function resolveGlobalPmRoot(cwd) {
106
114
  const envPath = process.env.PM_GLOBAL_PATH?.trim();
@@ -179,4 +187,4 @@ export function getTestRunResultPath(pmRoot, runId) {
179
187
  return path.join(getTestRunsResultsPath(pmRoot), `${runId}.json`);
180
188
  }
181
189
  //# sourceMappingURL=paths.js.map
182
- //# debugId=15dc4b5d-4bb7-5e3b-bc99-2d7e3a334189
190
+ //# debugId=c608ecfa-22ff-57f1-ba73-5c9d9dcda559
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sources":["core/store/paths.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/store/paths\n *\n * Reads and writes tracker storage with format-aware helpers for Paths.\n */\nimport { readFileSync, statSync } from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport {\n PM_DIRNAME,\n SETTINGS_FILENAME,\n TYPE_TO_FOLDER,\n} from \"../shared/constants.js\";\nimport { toDefaultFolder } from \"../item/type-registry.js\";\nimport type { ItemFormat, ItemType } from \"../../types/index.js\";\n\n/** Public contract for item file extension by format, shared by SDK and presentation-layer consumers. */\nexport const ITEM_FILE_EXTENSION_BY_FORMAT: Record<\n ItemFormat,\n \".md\" | \".toon\"\n> = {\n json_markdown: \".md\",\n toon: \".toon\",\n};\n\nconst ITEM_FORMAT_BY_EXTENSION = {\n \".md\": \"json_markdown\",\n \".toon\": \"toon\",\n} as const satisfies Record<string, ItemFormat>;\n\n/** Public contract for item file extensions, shared by SDK and presentation-layer consumers. */\nexport const ITEM_FILE_EXTENSIONS: Array<\n keyof typeof ITEM_FORMAT_BY_EXTENSION\n> = [\".md\", \".toon\"];\n\nfunction pathExists(pathValue: string): boolean {\n try {\n statSync(pathValue);\n return true;\n } catch {\n return false;\n }\n}\n\n// Adopting a bare <dir>/settings.json during implicit ancestor discovery must\n// not let an unrelated tool's settings.json hijack tracker resolution (and\n// receive pm writes), so root-layout candidates need a pm-specific marker.\n// `pm init` always writes both markers; explicit --path/PM_PATH targets skip\n// this check because they carry user intent.\nfunction isPmSettingsFile(settingsPath: string): boolean {\n try {\n const parsed: unknown = JSON.parse(readFileSync(settingsPath, \"utf8\"));\n if (\n typeof parsed !== \"object\" ||\n parsed === null ||\n Array.isArray(parsed)\n ) {\n return false;\n }\n return \"id_prefix\" in parsed || \"item_format\" in parsed;\n } catch {\n return false;\n }\n}\n\nfunction discoverPmRootFromAncestors(cwd: string): string | undefined {\n let current = path.resolve(cwd);\n while (true) {\n const candidateRoot = path.join(current, PM_DIRNAME);\n const candidateSettingsPath = path.join(candidateRoot, SETTINGS_FILENAME);\n if (pathExists(candidateSettingsPath)) {\n return candidateRoot;\n }\n // Root-layout trackers (`pm init <dir>` writes settings.json directly into\n // <dir>) must be discoverable too; otherwise implicit invocations — and the\n // pm_root handed to extensions — fall back to a non-existent\n // <cwd>/.agents/pm (GH-495).\n const rootLayoutSettingsPath = path.join(current, SETTINGS_FILENAME);\n if (\n pathExists(rootLayoutSettingsPath) &&\n isPmSettingsFile(rootLayoutSettingsPath)\n ) {\n return current;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n return undefined;\n }\n current = parent;\n }\n}\n\n/** Implements resolve pm root for the public runtime surface of this module. */\nexport function resolvePmRoot(cwd: string, cliPath?: string): string {\n const envPath = process.env.PM_PATH;\n const explicitPath = cliPath?.trim() || envPath?.trim();\n if (explicitPath) {\n const resolved = path.resolve(cwd, explicitPath);\n // When an explicit --path/PM_PATH points at a project root that contains an\n // initialized `.agents/pm`, resolve into it. Without this, an agent passing\n // the directory where it ran `pm init` (which creates `<dir>/.agents/pm`)\n // hits a hard \"tracker not initialized\" dead-end, while cwd discovery walks\n // up to find the same `.agents/pm`. We only redirect when the path itself is\n // not already a tracker root, so `pm init --path <dir>` (which writes\n // `<dir>/settings.json` directly) and existing tracker roots keep working.\n if (!pathExists(getSettingsPath(resolved))) {\n const nestedRoot = path.join(resolved, PM_DIRNAME);\n if (pathExists(getSettingsPath(nestedRoot))) {\n return nestedRoot;\n }\n }\n return resolved;\n }\n const discoveredRoot = discoverPmRootFromAncestors(cwd);\n if (discoveredRoot) {\n return discoveredRoot;\n }\n const selected = PM_DIRNAME;\n return path.resolve(cwd, selected);\n}\n\n/** Implements resolve global pm root for the public runtime surface of this module. */\nexport function resolveGlobalPmRoot(cwd: string): string {\n const envPath = process.env.PM_GLOBAL_PATH?.trim();\n const selected =\n envPath && envPath.length > 0\n ? envPath\n : path.join(os.homedir(), \".pm-cli\");\n return path.resolve(cwd, selected);\n}\n\n/** Implements get settings path for the public runtime surface of this module. */\nexport function getSettingsPath(pmRoot: string): string {\n return path.join(pmRoot, SETTINGS_FILENAME);\n}\n\n/** Implements get type dir path for the public runtime surface of this module. */\nexport function getTypeDirPath(\n pmRoot: string,\n type: ItemType,\n typeToFolder: Record<string, string> = TYPE_TO_FOLDER,\n): string {\n const folder = typeToFolder[type] ?? toDefaultFolder(type);\n return path.join(pmRoot, folder);\n}\n\n/** Implements get item path for the public runtime surface of this module. */\nexport function getItemPath(\n pmRoot: string,\n type: ItemType,\n id: string,\n itemFormat: ItemFormat = \"toon\",\n typeToFolder: Record<string, string> = TYPE_TO_FOLDER,\n): string {\n return path.join(\n getTypeDirPath(pmRoot, type, typeToFolder),\n `${id}${ITEM_FILE_EXTENSION_BY_FORMAT[itemFormat]}`,\n );\n}\n\n/** Implements get item format from path for the public runtime surface of this module. */\nexport function getItemFormatFromPath(itemPath: string): ItemFormat | null {\n const normalizedItemPath = itemPath.replaceAll(\"\\\\\", \"/\");\n const extension = path.posix\n .extname(normalizedItemPath)\n .toLowerCase() as keyof typeof ITEM_FORMAT_BY_EXTENSION;\n return ITEM_FORMAT_BY_EXTENSION[extension] ?? null;\n}\n\n/** Implements get history path for the public runtime surface of this module. */\nexport function getHistoryPath(pmRoot: string, id: string): string {\n return path.join(pmRoot, \"history\", `${id}.jsonl`);\n}\n\n/** Implements get lock path for the public runtime surface of this module. */\nexport function getLockPath(pmRoot: string, id: string): string {\n return path.join(pmRoot, \"locks\", `${id}.lock`);\n}\n\n/** Implements get runtime path for the public runtime surface of this module. */\nexport function getRuntimePath(pmRoot: string): string {\n return path.join(pmRoot, \"runtime\");\n}\n\n/** Implements get test runs path for the public runtime surface of this module. */\nexport function getTestRunsPath(pmRoot: string): string {\n return path.join(getRuntimePath(pmRoot), \"test-runs\");\n}\n\n/** Implements get test runs records path for the public runtime surface of this module. */\nexport function getTestRunsRecordsPath(pmRoot: string): string {\n return path.join(getTestRunsPath(pmRoot), \"runs\");\n}\n\n/** Implements get test run record path for the public runtime surface of this module. */\nexport function getTestRunRecordPath(pmRoot: string, runId: string): string {\n return path.join(getTestRunsRecordsPath(pmRoot), `${runId}.json`);\n}\n\n/** Implements get test runs stdout path for the public runtime surface of this module. */\nexport function getTestRunsStdoutPath(pmRoot: string): string {\n return path.join(getTestRunsPath(pmRoot), \"stdout\");\n}\n\n/** Implements get test runs stderr path for the public runtime surface of this module. */\nexport function getTestRunsStderrPath(pmRoot: string): string {\n return path.join(getTestRunsPath(pmRoot), \"stderr\");\n}\n\n/** Implements get test run stdout path for the public runtime surface of this module. */\nexport function getTestRunStdoutPath(pmRoot: string, runId: string): string {\n return path.join(getTestRunsStdoutPath(pmRoot), `${runId}.log`);\n}\n\n/** Implements get test run stderr path for the public runtime surface of this module. */\nexport function getTestRunStderrPath(pmRoot: string, runId: string): string {\n return path.join(getTestRunsStderrPath(pmRoot), `${runId}.log`);\n}\n\n/** Implements get test runs results path for the public runtime surface of this module. */\nexport function getTestRunsResultsPath(pmRoot: string): string {\n return path.join(getTestRunsPath(pmRoot), \"results\");\n}\n\n/** Implements get test run result path for the public runtime surface of this module. */\nexport function getTestRunResultPath(pmRoot: string, runId: string): string {\n return path.join(getTestRunsResultsPath(pmRoot), `${runId}.json`);\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,cAAc,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,yGAAyG;AACzG,MAAM,CAAC,MAAM,6BAA6B,GAGtC;IACF,aAAa,EAAE,KAAK;IACpB,IAAI,EAAE,OAAO;CACd,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,MAAM;CAC8B,CAAC;AAEhD,gGAAgG;AAChG,MAAM,CAAC,MAAM,oBAAoB,GAE7B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAErB,SAAS,UAAU,CAAC,SAAiB;IACnC,IAAI,CAAC;QACH,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,6CAA6C;AAC7C,SAAS,gBAAgB,CAAC,YAAoB;IAC5C,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;QACvE,IACE,OAAO,MAAM,KAAK,QAAQ;YAC1B,MAAM,KAAK,IAAI;YACf,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EACrB,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,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,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACvD,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,KAAa;IAChE,OAAO,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC;AACpE,CAAC","debugId":"15dc4b5d-4bb7-5e3b-bc99-2d7e3a334189"}
1
+ {"version":3,"file":"paths.js","sources":["core/store/paths.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/store/paths\n *\n * Reads and writes tracker storage with format-aware helpers for Paths.\n */\nimport { readFileSync, statSync } from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport {\n PM_DIRNAME,\n SETTINGS_FILENAME,\n TYPE_TO_FOLDER,\n} from \"../shared/constants.js\";\nimport { toDefaultFolder } from \"../item/type-registry.js\";\nimport type { ItemFormat, ItemType } from \"../../types/index.js\";\n\n/** Public contract for item file extension by format, shared by SDK and presentation-layer consumers. */\nexport const ITEM_FILE_EXTENSION_BY_FORMAT: Record<\n ItemFormat,\n \".md\" | \".toon\"\n> = {\n json_markdown: \".md\",\n toon: \".toon\",\n};\n\nconst ITEM_FORMAT_BY_EXTENSION = {\n \".md\": \"json_markdown\",\n \".toon\": \"toon\",\n} as const satisfies Record<string, ItemFormat>;\n\n/** Public contract for item file extensions, shared by SDK and presentation-layer consumers. */\nexport const ITEM_FILE_EXTENSIONS: Array<\n keyof typeof ITEM_FORMAT_BY_EXTENSION\n> = [\".md\", \".toon\"];\n\nfunction pathExists(pathValue: string): boolean {\n try {\n statSync(pathValue);\n return true;\n } catch {\n return false;\n }\n}\n\n// Adopting a bare <dir>/settings.json during implicit ancestor discovery must\n// not let an unrelated tool's settings.json hijack tracker resolution (and\n// receive pm writes), so root-layout candidates need a pm-specific marker.\n// `pm init` always writes both markers; explicit --path/PM_PATH targets skip\n// this check because they carry user intent.\nfunction isPmSettingsFile(settingsPath: string): boolean {\n try {\n const parsed: unknown = JSON.parse(readFileSync(settingsPath, \"utf8\"));\n if (\n typeof parsed !== \"object\" ||\n parsed === null ||\n Array.isArray(parsed)\n ) {\n return false;\n }\n return \"id_prefix\" in parsed || \"item_format\" in parsed;\n } catch {\n return false;\n }\n}\n\nfunction discoverPmRootFromAncestors(cwd: string): string | undefined {\n let current = path.resolve(cwd);\n while (true) {\n const candidateRoot = path.join(current, PM_DIRNAME);\n const candidateSettingsPath = path.join(candidateRoot, SETTINGS_FILENAME);\n if (pathExists(candidateSettingsPath)) {\n return candidateRoot;\n }\n // Root-layout trackers (`pm init <dir>` writes settings.json directly into\n // <dir>) must be discoverable too; otherwise implicit invocations — and the\n // pm_root handed to extensions — fall back to a non-existent\n // <cwd>/.agents/pm (GH-495).\n const rootLayoutSettingsPath = path.join(current, SETTINGS_FILENAME);\n if (\n pathExists(rootLayoutSettingsPath) &&\n isPmSettingsFile(rootLayoutSettingsPath)\n ) {\n return current;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n return undefined;\n }\n current = parent;\n }\n}\n\n/** Implements resolve pm root for the public runtime surface of this module. */\nexport function resolvePmRoot(cwd: string, cliPath?: string): string {\n const envPath = process.env.PM_PATH;\n const explicitPath = cliPath?.trim() || envPath?.trim();\n if (explicitPath) {\n const resolved = path.resolve(cwd, explicitPath);\n // When an explicit --path/PM_PATH points at a project root that contains an\n // initialized `.agents/pm`, resolve into it. Without this, an agent passing\n // the directory where it ran `pm init` (which creates `<dir>/.agents/pm`)\n // hits a hard \"tracker not initialized\" dead-end, while cwd discovery walks\n // up to find the same `.agents/pm`. We only redirect when the path itself is\n // not already a tracker root, so `pm init --path <dir>` (which writes\n // `<dir>/settings.json` directly) and existing tracker roots keep working.\n if (!pathExists(getSettingsPath(resolved))) {\n const nestedRoot = path.join(resolved, PM_DIRNAME);\n if (pathExists(getSettingsPath(nestedRoot))) {\n return nestedRoot;\n }\n }\n return resolved;\n }\n const discoveredRoot = discoverPmRootFromAncestors(cwd);\n if (discoveredRoot) {\n return discoveredRoot;\n }\n const selected = PM_DIRNAME;\n return path.resolve(cwd, selected);\n}\n\n/** Resolve the project workspace that owns a tracker root. */\nexport function resolveWorkspaceRoot(pmRoot: string): string {\n const normalizedRoot = path.resolve(pmRoot);\n const parent = path.dirname(normalizedRoot);\n return path.basename(normalizedRoot) === \"pm\" && path.basename(parent) === \".agents\"\n ? path.dirname(parent)\n : normalizedRoot;\n}\n\n/** Implements resolve global pm root for the public runtime surface of this module. */\nexport function resolveGlobalPmRoot(cwd: string): string {\n const envPath = process.env.PM_GLOBAL_PATH?.trim();\n const selected =\n envPath && envPath.length > 0\n ? envPath\n : path.join(os.homedir(), \".pm-cli\");\n return path.resolve(cwd, selected);\n}\n\n/** Implements get settings path for the public runtime surface of this module. */\nexport function getSettingsPath(pmRoot: string): string {\n return path.join(pmRoot, SETTINGS_FILENAME);\n}\n\n/** Implements get type dir path for the public runtime surface of this module. */\nexport function getTypeDirPath(\n pmRoot: string,\n type: ItemType,\n typeToFolder: Record<string, string> = TYPE_TO_FOLDER,\n): string {\n const folder = typeToFolder[type] ?? toDefaultFolder(type);\n return path.join(pmRoot, folder);\n}\n\n/** Implements get item path for the public runtime surface of this module. */\nexport function getItemPath(\n pmRoot: string,\n type: ItemType,\n id: string,\n itemFormat: ItemFormat = \"toon\",\n typeToFolder: Record<string, string> = TYPE_TO_FOLDER,\n): string {\n return path.join(\n getTypeDirPath(pmRoot, type, typeToFolder),\n `${id}${ITEM_FILE_EXTENSION_BY_FORMAT[itemFormat]}`,\n );\n}\n\n/** Implements get item format from path for the public runtime surface of this module. */\nexport function getItemFormatFromPath(itemPath: string): ItemFormat | null {\n const normalizedItemPath = itemPath.replaceAll(\"\\\\\", \"/\");\n const extension = path.posix\n .extname(normalizedItemPath)\n .toLowerCase() as keyof typeof ITEM_FORMAT_BY_EXTENSION;\n return ITEM_FORMAT_BY_EXTENSION[extension] ?? null;\n}\n\n/** Implements get history path for the public runtime surface of this module. */\nexport function getHistoryPath(pmRoot: string, id: string): string {\n return path.join(pmRoot, \"history\", `${id}.jsonl`);\n}\n\n/** Implements get lock path for the public runtime surface of this module. */\nexport function getLockPath(pmRoot: string, id: string): string {\n return path.join(pmRoot, \"locks\", `${id}.lock`);\n}\n\n/** Implements get runtime path for the public runtime surface of this module. */\nexport function getRuntimePath(pmRoot: string): string {\n return path.join(pmRoot, \"runtime\");\n}\n\n/** Implements get test runs path for the public runtime surface of this module. */\nexport function getTestRunsPath(pmRoot: string): string {\n return path.join(getRuntimePath(pmRoot), \"test-runs\");\n}\n\n/** Implements get test runs records path for the public runtime surface of this module. */\nexport function getTestRunsRecordsPath(pmRoot: string): string {\n return path.join(getTestRunsPath(pmRoot), \"runs\");\n}\n\n/** Implements get test run record path for the public runtime surface of this module. */\nexport function getTestRunRecordPath(pmRoot: string, runId: string): string {\n return path.join(getTestRunsRecordsPath(pmRoot), `${runId}.json`);\n}\n\n/** Implements get test runs stdout path for the public runtime surface of this module. */\nexport function getTestRunsStdoutPath(pmRoot: string): string {\n return path.join(getTestRunsPath(pmRoot), \"stdout\");\n}\n\n/** Implements get test runs stderr path for the public runtime surface of this module. */\nexport function getTestRunsStderrPath(pmRoot: string): string {\n return path.join(getTestRunsPath(pmRoot), \"stderr\");\n}\n\n/** Implements get test run stdout path for the public runtime surface of this module. */\nexport function getTestRunStdoutPath(pmRoot: string, runId: string): string {\n return path.join(getTestRunsStdoutPath(pmRoot), `${runId}.log`);\n}\n\n/** Implements get test run stderr path for the public runtime surface of this module. */\nexport function getTestRunStderrPath(pmRoot: string, runId: string): string {\n return path.join(getTestRunsStderrPath(pmRoot), `${runId}.log`);\n}\n\n/** Implements get test runs results path for the public runtime surface of this module. */\nexport function getTestRunsResultsPath(pmRoot: string): string {\n return path.join(getTestRunsPath(pmRoot), \"results\");\n}\n\n/** Implements get test run result path for the public runtime surface of this module. */\nexport function getTestRunResultPath(pmRoot: string, runId: string): string {\n return path.join(getTestRuns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E,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;AAClE,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,KAAa;IAChE,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;AAClE,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACvD,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,KAAa;IAChE,OAAO,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC;AACpE,CAAC","debugId":"c608ecfa-22ff-57f1-ba73-5c9d9dcda559"}
@@ -4,8 +4,9 @@
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]="64516692-4bc3-5896-a3cb-eef22361f252")}catch(e){}}();
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]="7365c8ff-f8c3-535e-ac57-f580b9d0e159")}catch(e){}}();
8
8
  import { PM_TOOL_ACTIONS } from "../sdk/cli-contracts/enum-contracts.js";
9
+ import { COPY_FLAG_CONTRACTS } from "../sdk/cli-contracts/flag-contracts.js";
9
10
  import { RUNTIME_STATUS_ROLE_VALUES } from "../types.js";
10
11
  const TOOL_SCHEMA_BASE = {
11
12
  type: "object",
@@ -59,6 +60,10 @@ const SEARCH_TOP_LEVEL_OPTION_PROPERTIES = {
59
60
  description: "Alias for options.limit.",
60
61
  },
61
62
  };
63
+ const COPY_TOP_LEVEL_OPTION_PROPERTIES = Object.fromEntries(COPY_FLAG_CONTRACTS.filter(({ flag }) => flag !== "--author").map(({ flag }) => [
64
+ flag.slice(2),
65
+ { type: "string", description: `Alias for options.${flag.slice(2).replaceAll("-", "_")}.` },
66
+ ]));
62
67
  function objectSchema(properties, required = []) {
63
68
  return {
64
69
  ...TOOL_SCHEMA_BASE,
@@ -196,10 +201,15 @@ export const TOOLS = [
196
201
  "Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.",
197
202
  inputSchema: objectSchema({
198
203
  id: idSchema,
204
+ ...COPY_TOP_LEVEL_OPTION_PROPERTIES,
199
205
  fullChangedFields: {
200
206
  type: "boolean",
201
207
  description: "Return full changed_fields instead of changed_field_count.",
202
208
  },
209
+ idOnly: {
210
+ type: "boolean",
211
+ description: "Return only id and status.",
212
+ },
203
213
  options: {
204
214
  type: "object",
205
215
  description: "Copy options such as title override, author, and message.",
@@ -561,4 +571,4 @@ export function buildMcpToolContracts() {
561
571
  }).sort((left, right) => left.name.localeCompare(right.name));
562
572
  }
563
573
  //# sourceMappingURL=tool-definitions.js.map
564
- //# debugId=64516692-4bc3-5896-a3cb-eef22361f252
574
+ //# debugId=7365c8ff-f8c3-535e-ac57-f580b9d0e159
@@ -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 { 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\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. Pass options.depth='brief' or options.fields='id,title,status' for low-token inspection.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n options: {\n type: \"object\",\n description:\n \"Get options such as depth=brief|standard|deep|full or fields=id,title,status.\",\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 fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\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 \"List, add, or remove dependencies for a pm item. Use options.add to declare a dependency and options.remove to drop one; omit both to list current dependencies.\",\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,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;IACf,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,kCAAkC;CAChD,CAAC;AAEF,mEAAmE;AACnE,2EAA2E;AAC3E,4EAA4E;AAC5E,MAAM,yBAAyB,GAC7B,4BAA4B,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;IAC1D,2FAA2F,CAAC;AAE9F,MAAM,gCAAgC,GAA4B;IAChE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;IACpE,IAAI,E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;YACf,WAAW,EAAE,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":"64516692-4bc3-5896-a3cb-eef22361f252"}
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. Pass options.depth='brief' or options.fields='id,title,status' for low-token inspection.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n options: {\n type: \"object\",\n description:\n \"Get options such as depth=brief|standard|deep|full or fields=id,title,status.\",\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 \"List, add, or remove dependencies for a pm item. Use options.add to declare a dependency and options.remove to drop one; omit both to list current dependencies.\",\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,\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