@unbrained/pm-cli 2026.7.4 → 2026.7.5

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 (601) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +1 -5
  3. package/dist/cli/commands/calendar.d.ts +3 -2
  4. package/dist/cli/commands/calendar.js +4 -4
  5. package/dist/cli/commands/calendar.js.map +1 -1
  6. package/dist/cli/commands/claim.js +17 -3
  7. package/dist/cli/commands/claim.js.map +1 -1
  8. package/dist/cli/commands/close.js +34 -16
  9. package/dist/cli/commands/close.js.map +1 -1
  10. package/dist/cli/commands/copy.js +3 -3
  11. package/dist/cli/commands/copy.js.map +1 -1
  12. package/dist/cli/commands/create.d.ts +7 -0
  13. package/dist/cli/commands/create.js +156 -110
  14. package/dist/cli/commands/create.js.map +1 -1
  15. package/dist/cli/commands/extension/bundled-catalog.d.ts +6 -0
  16. package/dist/cli/commands/extension/bundled-catalog.js +15 -2
  17. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  18. package/dist/cli/commands/extension/describe.d.ts +6 -3
  19. package/dist/cli/commands/extension/describe.js +21 -9
  20. package/dist/cli/commands/extension/describe.js.map +1 -1
  21. package/dist/cli/commands/extension/doctor.d.ts +0 -4
  22. package/dist/cli/commands/extension/doctor.js +3 -3
  23. package/dist/cli/commands/extension/doctor.js.map +1 -1
  24. package/dist/cli/commands/extension/scaffold.js +7 -2
  25. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  26. package/dist/cli/commands/extension/shared.d.ts +2 -7
  27. package/dist/cli/commands/extension/shared.js +4 -10
  28. package/dist/cli/commands/extension/shared.js.map +1 -1
  29. package/dist/cli/commands/extension.js +33 -8
  30. package/dist/cli/commands/extension.js.map +1 -1
  31. package/dist/cli/commands/profile.js +3 -3
  32. package/dist/cli/commands/profile.js.map +1 -1
  33. package/dist/cli/commands/reindex.js +3 -3
  34. package/dist/cli/commands/reindex.js.map +1 -1
  35. package/dist/cli/commands/restore.js +3 -3
  36. package/dist/cli/commands/restore.js.map +1 -1
  37. package/dist/cli/commands/schema.js +10 -10
  38. package/dist/cli/commands/schema.js.map +1 -1
  39. package/dist/cli/commands/update.js +5 -3
  40. package/dist/cli/commands/update.js.map +1 -1
  41. package/dist/cli/error-guidance.js +107 -7
  42. package/dist/cli/error-guidance.js.map +1 -1
  43. package/dist/cli/main.d.ts +6 -2
  44. package/dist/cli/main.js +33 -12
  45. package/dist/cli/main.js.map +1 -1
  46. package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +18 -0
  47. package/dist/cli-bundle/chunks/{activity-OENQCYZD.js → activity-YKAKZTZ4.js} +11 -9
  48. package/dist/cli-bundle/chunks/{aggregate-EC4LWS3U.js → aggregate-EQX2RGB7.js} +16 -13
  49. package/dist/cli-bundle/chunks/{aggregate-EC4LWS3U.js.map → aggregate-EQX2RGB7.js.map} +1 -1
  50. package/dist/cli-bundle/chunks/{aggregate-RCB3QJJE.js → aggregate-PEGZGJXD.js} +18 -15
  51. package/dist/cli-bundle/chunks/{aggregate-RCB3QJJE.js.map → aggregate-PEGZGJXD.js.map} +1 -1
  52. package/dist/cli-bundle/chunks/{append-XLEKVVWB.js → append-CZGUZ45Q.js} +11 -8
  53. package/dist/cli-bundle/chunks/{append-XLEKVVWB.js.map → append-CZGUZ45Q.js.map} +1 -1
  54. package/dist/cli-bundle/chunks/{append-ADBOI3A6.js → append-NSQBCXZJ.js} +13 -10
  55. package/dist/cli-bundle/chunks/{append-ADBOI3A6.js.map → append-NSQBCXZJ.js.map} +1 -1
  56. package/dist/cli-bundle/chunks/chunk-3JZNEQBA.js +1413 -0
  57. package/dist/cli-bundle/chunks/chunk-3JZNEQBA.js.map +1 -0
  58. package/dist/cli-bundle/chunks/{chunk-2LRMWMZ6.js → chunk-3PL6LEKP.js} +16 -14
  59. package/dist/cli-bundle/chunks/{chunk-2LRMWMZ6.js.map → chunk-3PL6LEKP.js.map} +1 -1
  60. package/dist/cli-bundle/chunks/{chunk-CN4OAA2G.js → chunk-3U3VEWK6.js} +277 -119
  61. package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +7 -0
  62. package/dist/cli-bundle/chunks/{chunk-EB4BBEZD.js → chunk-3Y4OESPP.js} +14 -12
  63. package/dist/cli-bundle/chunks/{chunk-EB4BBEZD.js.map → chunk-3Y4OESPP.js.map} +1 -1
  64. package/dist/cli-bundle/chunks/{chunk-NHDR3UCW.js → chunk-4LRVSBO6.js} +14 -12
  65. package/dist/cli-bundle/chunks/{chunk-NHDR3UCW.js.map → chunk-4LRVSBO6.js.map} +1 -1
  66. package/dist/cli-bundle/chunks/{chunk-6YB7HG2J.js → chunk-4OFLJHX6.js} +7 -5
  67. package/dist/cli-bundle/chunks/{chunk-6YB7HG2J.js.map → chunk-4OFLJHX6.js.map} +1 -1
  68. package/dist/cli-bundle/chunks/{chunk-SBNT6SLO.js → chunk-4QQ6PM7M.js} +45 -557
  69. package/dist/cli-bundle/chunks/chunk-4QQ6PM7M.js.map +7 -0
  70. package/dist/cli-bundle/chunks/{chunk-M34MVAOP.js → chunk-53BTLLAF.js} +16 -200
  71. package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +1 -0
  72. package/dist/cli-bundle/chunks/{chunk-UYLA5ROU.js → chunk-57C2RLW5.js} +277 -112
  73. package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +1 -0
  74. package/dist/cli-bundle/chunks/{chunk-R7EMP4JG.js → chunk-5B3X4Y22.js} +52 -63
  75. package/dist/cli-bundle/chunks/{chunk-R7EMP4JG.js.map → chunk-5B3X4Y22.js.map} +3 -3
  76. package/dist/cli-bundle/chunks/{chunk-XBIYI23P.js → chunk-5J2XPTAD.js} +10 -8
  77. package/dist/cli-bundle/chunks/{chunk-XBIYI23P.js.map → chunk-5J2XPTAD.js.map} +1 -1
  78. package/dist/cli-bundle/chunks/{chunk-4SHME4VR.js → chunk-5JE6SMYS.js} +2 -2
  79. package/dist/cli-bundle/chunks/{chunk-4KPQQ42D.js → chunk-5JZ7APJU.js} +18 -16
  80. package/dist/cli-bundle/chunks/{chunk-4KPQQ42D.js.map → chunk-5JZ7APJU.js.map} +1 -1
  81. package/dist/cli-bundle/chunks/{chunk-BDDYM4LH.js → chunk-5VVUKE3U.js} +424 -2228
  82. package/dist/cli-bundle/chunks/chunk-5VVUKE3U.js.map +7 -0
  83. package/dist/cli-bundle/chunks/{chunk-QFXFKYNQ.js → chunk-75U6M5ZD.js} +16 -14
  84. package/dist/cli-bundle/chunks/{chunk-QFXFKYNQ.js.map → chunk-75U6M5ZD.js.map} +1 -1
  85. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +23 -0
  86. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +7 -0
  87. package/dist/cli-bundle/chunks/{chunk-A222YWOQ.js → chunk-7EQNAZX2.js} +14 -12
  88. package/dist/cli-bundle/chunks/{chunk-A222YWOQ.js.map → chunk-7EQNAZX2.js.map} +1 -1
  89. package/dist/cli-bundle/chunks/{chunk-Z4DGFQDH.js → chunk-7LQKVMPA.js} +14 -4
  90. package/dist/cli-bundle/chunks/chunk-7LQKVMPA.js.map +1 -0
  91. package/dist/cli-bundle/chunks/{chunk-EH23N5FX.js → chunk-7MDXZAZS.js} +29 -7
  92. package/dist/cli-bundle/chunks/chunk-7MDXZAZS.js.map +1 -0
  93. package/dist/cli-bundle/chunks/{chunk-XQCWTSLO.js → chunk-7QH7DHUB.js} +74 -8
  94. package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +1 -0
  95. package/dist/cli-bundle/chunks/{chunk-3C5T3ZEO.js → chunk-7WYXBPYQ.js} +7 -5
  96. package/dist/cli-bundle/chunks/{chunk-3C5T3ZEO.js.map → chunk-7WYXBPYQ.js.map} +1 -1
  97. package/dist/cli-bundle/chunks/chunk-AAEQMOC6.js +150 -0
  98. package/dist/cli-bundle/chunks/chunk-AAEQMOC6.js.map +1 -0
  99. package/dist/cli-bundle/chunks/{chunk-CQISNF3Z.js → chunk-ABRA3BHY.js} +18 -16
  100. package/dist/cli-bundle/chunks/{chunk-CQISNF3Z.js.map → chunk-ABRA3BHY.js.map} +2 -2
  101. package/dist/cli-bundle/chunks/chunk-B5KXLBSJ.js +47 -0
  102. package/dist/cli-bundle/chunks/chunk-B5KXLBSJ.js.map +7 -0
  103. package/dist/cli-bundle/chunks/{chunk-Y2VSCQ77.js → chunk-BFVHCAOO.js} +9 -7
  104. package/dist/cli-bundle/chunks/{chunk-Y2VSCQ77.js.map → chunk-BFVHCAOO.js.map} +1 -1
  105. package/dist/cli-bundle/chunks/{chunk-7ITQSEBL.js → chunk-BVEUCSH2.js} +6 -4
  106. package/dist/cli-bundle/chunks/{chunk-7ITQSEBL.js.map → chunk-BVEUCSH2.js.map} +1 -1
  107. package/dist/cli-bundle/chunks/chunk-C3PMDWGX.js +160 -0
  108. package/dist/cli-bundle/chunks/chunk-C3PMDWGX.js.map +7 -0
  109. package/dist/cli-bundle/chunks/{chunk-HL742IBM.js → chunk-D3UCE7RW.js} +7 -5
  110. package/dist/cli-bundle/chunks/{chunk-HL742IBM.js.map → chunk-D3UCE7RW.js.map} +1 -1
  111. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +275 -0
  112. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +7 -0
  113. package/dist/cli-bundle/chunks/chunk-DLQ4ZTCU.js +634 -0
  114. package/dist/cli-bundle/chunks/chunk-DLQ4ZTCU.js.map +7 -0
  115. package/dist/cli-bundle/chunks/{chunk-MZG6I2Q2.js → chunk-DRBV5UC2.js} +8 -23
  116. package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-DEIDJQZK.js → chunk-E2FUG6GD.js} +15 -220
  118. package/dist/cli-bundle/chunks/{chunk-DEIDJQZK.js.map → chunk-E2FUG6GD.js.map} +3 -3
  119. package/dist/cli-bundle/chunks/{chunk-3MLQZI3H.js → chunk-EEY54JMF.js} +5 -3
  120. package/dist/cli-bundle/chunks/{chunk-3MLQZI3H.js.map → chunk-EEY54JMF.js.map} +1 -1
  121. package/dist/cli-bundle/chunks/{chunk-CQFZRLXQ.js → chunk-EZFKWSC7.js} +94 -16
  122. package/dist/cli-bundle/chunks/{chunk-CQFZRLXQ.js.map → chunk-EZFKWSC7.js.map} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-4PJYRA3V.js → chunk-FDBARR33.js} +17 -15
  124. package/dist/cli-bundle/chunks/{chunk-4PJYRA3V.js.map → chunk-FDBARR33.js.map} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-NGDK3KEZ.js → chunk-FGQKEDE4.js} +36 -12
  126. package/dist/cli-bundle/chunks/chunk-FGQKEDE4.js.map +7 -0
  127. package/dist/cli-bundle/chunks/{chunk-FMWQRMHS.js → chunk-FJRKQREY.js} +10 -18
  128. package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +1 -0
  129. package/dist/cli-bundle/chunks/{chunk-6QY2NA2M.js → chunk-FUM6UMY4.js} +10 -11
  130. package/dist/cli-bundle/chunks/{chunk-6QY2NA2M.js.map → chunk-FUM6UMY4.js.map} +1 -1
  131. package/dist/cli-bundle/chunks/{chunk-UGDONITK.js → chunk-GIWXVMZ3.js} +140 -334
  132. package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +7 -0
  133. package/dist/cli-bundle/chunks/{chunk-OTSP6UEX.js → chunk-HBYZDSK5.js} +19 -17
  134. package/dist/cli-bundle/chunks/{chunk-OTSP6UEX.js.map → chunk-HBYZDSK5.js.map} +1 -1
  135. package/dist/cli-bundle/chunks/{chunk-D2LDM35X.js → chunk-HJE4JTKQ.js} +6 -4
  136. package/dist/cli-bundle/chunks/{chunk-D2LDM35X.js.map → chunk-HJE4JTKQ.js.map} +1 -1
  137. package/dist/cli-bundle/chunks/{chunk-AOP2EMK3.js → chunk-HK72NWAD.js} +89 -18
  138. package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-2ONH3WG6.js → chunk-IJ6CO3JV.js} +18 -16
  140. package/dist/cli-bundle/chunks/{chunk-2ONH3WG6.js.map → chunk-IJ6CO3JV.js.map} +1 -1
  141. package/dist/cli-bundle/chunks/{chunk-J4KNRDI3.js → chunk-JFCVQXZX.js} +139 -326
  142. package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +1 -0
  143. package/dist/cli-bundle/chunks/{chunk-V655JQ5J.js → chunk-JLA7EVYV.js} +12 -10
  144. package/dist/cli-bundle/chunks/{chunk-V655JQ5J.js.map → chunk-JLA7EVYV.js.map} +1 -1
  145. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +76 -0
  146. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-WBWRQS32.js → chunk-K3AGVXSF.js} +37 -13
  148. package/dist/cli-bundle/chunks/chunk-K3AGVXSF.js.map +1 -0
  149. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +79 -0
  150. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +7 -0
  151. package/dist/cli-bundle/chunks/chunk-KGHH652T.js +44 -0
  152. package/dist/cli-bundle/chunks/chunk-KGHH652T.js.map +1 -0
  153. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +915 -0
  154. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +1 -0
  155. package/dist/cli-bundle/chunks/{chunk-JZJJEJBR.js → chunk-KLG4ZULO.js} +12 -10
  156. package/dist/cli-bundle/chunks/{chunk-JZJJEJBR.js.map → chunk-KLG4ZULO.js.map} +1 -1
  157. package/dist/cli-bundle/chunks/{chunk-KKHIQOTN.js → chunk-LEKT4K7I.js} +74 -8
  158. package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +7 -0
  159. package/dist/cli-bundle/chunks/{contracts-CVBINC7C.js → chunk-MNZ7DRNC.js} +13 -10
  160. package/dist/cli-bundle/chunks/{contracts-CVBINC7C.js.map → chunk-MNZ7DRNC.js.map} +1 -1
  161. package/dist/cli-bundle/chunks/{chunk-2VK677OA.js → chunk-MTTXDAK4.js} +176 -125
  162. package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{chunk-Q2266G4S.js → chunk-MZ7VNEVY.js} +8 -6
  164. package/dist/cli-bundle/chunks/{chunk-Q2266G4S.js.map → chunk-MZ7VNEVY.js.map} +1 -1
  165. package/dist/cli-bundle/chunks/{chunk-4EVY7CQN.js → chunk-N6DNM2FA.js} +2 -2
  166. package/dist/cli-bundle/chunks/{test-runs-5SLLV3XU.js → chunk-N7X4WP6L.js} +11 -8
  167. package/dist/cli-bundle/chunks/{test-runs-5SLLV3XU.js.map → chunk-N7X4WP6L.js.map} +1 -1
  168. package/dist/cli-bundle/chunks/{chunk-AZMPKLIA.js → chunk-NBFCNJ7Q.js} +177 -126
  169. package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-YZR7UMZ6.js → chunk-NER3KUUS.js} +2 -2
  171. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +20 -0
  172. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +1 -0
  173. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +918 -0
  174. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{chunk-DJ5S2LDY.js → chunk-OESSOFJ4.js} +14 -12
  176. package/dist/cli-bundle/chunks/{chunk-DJ5S2LDY.js.map → chunk-OESSOFJ4.js.map} +1 -1
  177. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +238 -0
  178. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-TUV7SIWZ.js → chunk-OWTIRHX4.js} +28 -6
  180. package/dist/cli-bundle/chunks/chunk-OWTIRHX4.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-PV5JS7MP.js → chunk-P3VRG72Q.js} +10 -8
  182. package/dist/cli-bundle/chunks/{chunk-PV5JS7MP.js.map → chunk-P3VRG72Q.js.map} +1 -1
  183. package/dist/cli-bundle/chunks/chunk-P5TFTLWW.js +1423 -0
  184. package/dist/cli-bundle/chunks/chunk-P5TFTLWW.js.map +7 -0
  185. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +1977 -0
  186. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +7 -0
  187. package/dist/cli-bundle/chunks/{chunk-WTXDLBSZ.js → chunk-PDXT6Q55.js} +2 -2
  188. package/dist/cli-bundle/chunks/{chunk-YZWXMDNH.js → chunk-PJ3A56YF.js} +46 -537
  189. package/dist/cli-bundle/chunks/chunk-PJ3A56YF.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{test-runs-L3WKLO67.js → chunk-PPAJG4GB.js} +13 -10
  191. package/dist/cli-bundle/chunks/{test-runs-L3WKLO67.js.map → chunk-PPAJG4GB.js.map} +1 -1
  192. package/dist/cli-bundle/chunks/{chunk-LLQLLAKU.js → chunk-PPE4YUQM.js} +1670 -1573
  193. package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +1 -0
  194. package/dist/cli-bundle/chunks/{chunk-TO4KCIOT.js → chunk-QHZO65XW.js} +8 -6
  195. package/dist/cli-bundle/chunks/{chunk-TO4KCIOT.js.map → chunk-QHZO65XW.js.map} +1 -1
  196. package/dist/cli-bundle/chunks/{chunk-4OXNQHKQ.js → chunk-R3ZBLGTC.js} +9 -10
  197. package/dist/cli-bundle/chunks/{chunk-4OXNQHKQ.js.map → chunk-R3ZBLGTC.js.map} +2 -2
  198. package/dist/cli-bundle/chunks/chunk-RCT3YJOK.js +624 -0
  199. package/dist/cli-bundle/chunks/chunk-RCT3YJOK.js.map +1 -0
  200. package/dist/cli-bundle/chunks/{chunk-724VLYDJ.js → chunk-RX3HQSYG.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-PUVPC5DL.js → chunk-S4APD35C.js} +4 -4
  202. package/dist/cli-bundle/chunks/{chunk-T5RTYLZJ.js → chunk-S5AYOUT5.js} +8 -6
  203. package/dist/cli-bundle/chunks/{chunk-T5RTYLZJ.js.map → chunk-S5AYOUT5.js.map} +1 -1
  204. package/dist/cli-bundle/chunks/{chunk-75VMARGO.js → chunk-STPSZ2XY.js} +19 -744
  205. package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +1 -0
  206. package/dist/cli-bundle/chunks/{chunk-A2W3XKAD.js → chunk-T35XLYZF.js} +2 -2
  207. package/dist/cli-bundle/chunks/{chunk-N2LOJUBB.js → chunk-T3ABIMGW.js} +5 -3
  208. package/dist/cli-bundle/chunks/{chunk-N2LOJUBB.js.map → chunk-T3ABIMGW.js.map} +1 -1
  209. package/dist/cli-bundle/chunks/{chunk-FDNJMYZB.js → chunk-T3F4DF23.js} +16 -14
  210. package/dist/cli-bundle/chunks/{chunk-FDNJMYZB.js.map → chunk-T3F4DF23.js.map} +1 -1
  211. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +272 -0
  212. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +1 -0
  213. package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js +5354 -0
  214. package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-XFO2NJY6.js → chunk-TSPKZRRW.js} +33 -28
  216. package/dist/cli-bundle/chunks/chunk-TSPKZRRW.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-ZZWMJVW2.js → chunk-TT42JUMF.js} +4 -4
  218. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +165 -0
  219. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +1 -0
  220. package/dist/cli-bundle/chunks/{chunk-7745CXNI.js → chunk-UI5BJ6DO.js} +1231 -1134
  221. package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +7 -0
  222. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +1932 -0
  223. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +1 -0
  224. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +175 -0
  225. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-B4O5S7I3.js → chunk-VUHVWI4C.js} +13 -3
  227. package/dist/cli-bundle/chunks/chunk-VUHVWI4C.js.map +7 -0
  228. package/dist/cli-bundle/chunks/{contracts-NLCDIZAT.js → chunk-VZIYHZDX.js} +11 -8
  229. package/dist/cli-bundle/chunks/{contracts-NLCDIZAT.js.map → chunk-VZIYHZDX.js.map} +1 -1
  230. package/dist/cli-bundle/chunks/{chunk-TGYDJEJH.js → chunk-WISPVC2E.js} +9 -7
  231. package/dist/cli-bundle/chunks/{chunk-TGYDJEJH.js.map → chunk-WISPVC2E.js.map} +1 -1
  232. package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js +5434 -0
  233. package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +7 -0
  234. package/dist/cli-bundle/chunks/{chunk-MTB4PRA3.js → chunk-XQCG2JGW.js} +17 -749
  235. package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +7 -0
  236. package/dist/cli-bundle/chunks/chunk-Y76TWC45.js +550 -0
  237. package/dist/cli-bundle/chunks/chunk-Y76TWC45.js.map +7 -0
  238. package/dist/cli-bundle/chunks/{chunk-SL2ANJSV.js → chunk-YD5FML7K.js} +418 -2173
  239. package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +1 -0
  240. package/dist/cli-bundle/chunks/{chunk-NHKXOMZ5.js → chunk-YFIE7YK6.js} +7 -5
  241. package/dist/cli-bundle/chunks/{chunk-NHKXOMZ5.js.map → chunk-YFIE7YK6.js.map} +1 -1
  242. package/dist/cli-bundle/chunks/{chunk-5FYY76HR.js → chunk-YMABYTNG.js} +32 -27
  243. package/dist/cli-bundle/chunks/chunk-YMABYTNG.js.map +7 -0
  244. package/dist/cli-bundle/chunks/{chunk-W5X3AHJN.js → chunk-YOF5VPKM.js} +2 -2
  245. package/dist/cli-bundle/chunks/{chunk-M6PR5BC6.js → chunk-YPPVU5GX.js} +11 -9
  246. package/dist/cli-bundle/chunks/{chunk-M6PR5BC6.js.map → chunk-YPPVU5GX.js.map} +1 -1
  247. package/dist/cli-bundle/chunks/{chunk-ZIEGTQCY.js → chunk-YQMMMONE.js} +6 -4
  248. package/dist/cli-bundle/chunks/{chunk-ZIEGTQCY.js.map → chunk-YQMMMONE.js.map} +1 -1
  249. package/dist/cli-bundle/chunks/{chunk-4IW7STMB.js → chunk-YSAH5FY5.js} +16 -14
  250. package/dist/cli-bundle/chunks/{chunk-4IW7STMB.js.map → chunk-YSAH5FY5.js.map} +1 -1
  251. package/dist/cli-bundle/chunks/{chunk-JYLFF7GJ.js → chunk-YZIR4R3U.js} +16 -14
  252. package/dist/cli-bundle/chunks/{chunk-JYLFF7GJ.js.map → chunk-YZIR4R3U.js.map} +1 -1
  253. package/dist/cli-bundle/chunks/{chunk-7G5SUU6F.js → chunk-Z2CRRZYF.js} +14 -12
  254. package/dist/cli-bundle/chunks/{chunk-7G5SUU6F.js.map → chunk-Z2CRRZYF.js.map} +1 -1
  255. package/dist/cli-bundle/chunks/chunk-ZAHXPXVY.js +533 -0
  256. package/dist/cli-bundle/chunks/chunk-ZAHXPXVY.js.map +1 -0
  257. package/dist/cli-bundle/chunks/{chunk-WOOB7PV7.js → chunk-ZCJAA3JK.js} +8 -6
  258. package/dist/cli-bundle/chunks/{chunk-WOOB7PV7.js.map → chunk-ZCJAA3JK.js.map} +1 -1
  259. package/dist/cli-bundle/chunks/{chunk-WSDIALO4.js → chunk-ZD34OFFQ.js} +5 -3
  260. package/dist/cli-bundle/chunks/{chunk-WSDIALO4.js.map → chunk-ZD34OFFQ.js.map} +1 -1
  261. package/dist/cli-bundle/chunks/{chunk-Q3XVLRCJ.js → chunk-ZJB3UV5U.js} +54 -58
  262. package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{chunk-MZ4NH46V.js → chunk-ZMD35NYG.js} +2 -2
  264. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +241 -0
  265. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{claim-D6L33A5Y.js → claim-4DROPSIS.js} +30 -13
  267. package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +1 -0
  268. package/dist/cli-bundle/chunks/{claim-YAFUTPVK.js → claim-VX54TV5U.js} +29 -12
  269. package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{close-TGYXG7TV.js → close-3YRR3XY6.js} +9 -7
  271. package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +16 -0
  272. package/dist/cli-bundle/chunks/{close-many-SNA6LNZH.js → close-many-AP4MWU36.js} +21 -18
  273. package/dist/cli-bundle/chunks/{close-many-SNA6LNZH.js.map → close-many-AP4MWU36.js.map} +1 -1
  274. package/dist/cli-bundle/chunks/{close-many-4QSWKCRU.js → close-many-OMZIGZB4.js} +19 -16
  275. package/dist/cli-bundle/chunks/{close-many-4QSWKCRU.js.map → close-many-OMZIGZB4.js.map} +1 -1
  276. package/dist/cli-bundle/chunks/{comments-QC6ARR5X.js → comments-MIW5MZOX.js} +12 -9
  277. package/dist/cli-bundle/chunks/{comments-QC6ARR5X.js.map → comments-MIW5MZOX.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{comments-ZHVYGUVC.js → comments-SAG5LSKL.js} +14 -11
  279. package/dist/cli-bundle/chunks/{comments-ZHVYGUVC.js.map → comments-SAG5LSKL.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/{config-O6W2EU2G.js → config-DJJKZB5R.js} +20 -17
  281. package/dist/cli-bundle/chunks/{config-O6W2EU2G.js.map → config-DJJKZB5R.js.map} +1 -1
  282. package/dist/cli-bundle/chunks/{config-XQRFJXJP.js → config-V57QD47V.js} +22 -19
  283. package/dist/cli-bundle/chunks/{config-XQRFJXJP.js.map → config-V57QD47V.js.map} +1 -1
  284. package/dist/cli-bundle/chunks/{context-IHE3IXN5.js → context-4OQGIPSO.js} +15 -12
  285. package/dist/cli-bundle/chunks/{context-WSYWBEUL.js → context-WLA6IAWE.js} +15 -12
  286. package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +12 -0
  287. package/dist/cli-bundle/chunks/contracts-OJEXMKVW.js +16 -0
  288. package/dist/cli-bundle/chunks/{copy-7MUQC44A.js → copy-LEE6P6EM.js} +17 -14
  289. package/dist/cli-bundle/chunks/{copy-7MUQC44A.js.map → copy-LEE6P6EM.js.map} +2 -2
  290. package/dist/cli-bundle/chunks/{copy-ANWXDJVC.js → copy-OTJOWFL6.js} +18 -15
  291. package/dist/cli-bundle/chunks/{copy-ANWXDJVC.js.map → copy-OTJOWFL6.js.map} +1 -1
  292. package/dist/cli-bundle/chunks/create-WKOZKPQR.js +30 -0
  293. package/dist/cli-bundle/chunks/{create-JIA2IFCO.js → create-XWWQFQ6S.js} +14 -12
  294. package/dist/cli-bundle/chunks/{delete-5OLYWQIC.js → delete-62JQTYT4.js} +10 -7
  295. package/dist/cli-bundle/chunks/{delete-5OLYWQIC.js.map → delete-62JQTYT4.js.map} +1 -1
  296. package/dist/cli-bundle/chunks/{delete-INHKCIRN.js → delete-HQKGRNRZ.js} +12 -9
  297. package/dist/cli-bundle/chunks/{delete-INHKCIRN.js.map → delete-HQKGRNRZ.js.map} +1 -1
  298. package/dist/cli-bundle/chunks/{deps-IYEID3QX.js → deps-55FTG6Z5.js} +12 -9
  299. package/dist/cli-bundle/chunks/{deps-IYEID3QX.js.map → deps-55FTG6Z5.js.map} +1 -1
  300. package/dist/cli-bundle/chunks/{deps-CCSWGZW7.js → deps-L2FPIAD3.js} +10 -7
  301. package/dist/cli-bundle/chunks/{deps-CCSWGZW7.js.map → deps-L2FPIAD3.js.map} +1 -1
  302. package/dist/cli-bundle/chunks/{docs-PKO7OEIM.js → docs-6CRCSVKK.js} +11 -9
  303. package/dist/cli-bundle/chunks/{docs-PKO7OEIM.js.map → docs-6CRCSVKK.js.map} +1 -1
  304. package/dist/cli-bundle/chunks/{docs-3XZK22WF.js → docs-S6UTOTO5.js} +9 -7
  305. package/dist/cli-bundle/chunks/{docs-3XZK22WF.js.map → docs-S6UTOTO5.js.map} +1 -1
  306. package/dist/cli-bundle/chunks/{eval-5XYP6NMY.js → eval-N6UHFWVO.js} +15 -11
  307. package/dist/cli-bundle/chunks/{eval-5XYP6NMY.js.map → eval-N6UHFWVO.js.map} +1 -1
  308. package/dist/cli-bundle/chunks/{eval-O4WGQYDI.js → eval-PHOTWYHI.js} +17 -13
  309. package/dist/cli-bundle/chunks/{eval-O4WGQYDI.js.map → eval-PHOTWYHI.js.map} +1 -1
  310. package/dist/cli-bundle/chunks/{extension-T7JNTAAA.js → extension-NBAH62ML.js} +17 -11
  311. package/dist/cli-bundle/chunks/{extension-PVGRRZZG.js → extension-ZF6ZZPOU.js} +17 -11
  312. package/dist/cli-bundle/chunks/{files-W7HH5EOD.js → files-6P57MRKL.js} +12 -9
  313. package/dist/cli-bundle/chunks/{files-W7HH5EOD.js.map → files-6P57MRKL.js.map} +1 -1
  314. package/dist/cli-bundle/chunks/{files-7IU56S6R.js → files-JPU3FNJ7.js} +14 -11
  315. package/dist/cli-bundle/chunks/{files-7IU56S6R.js.map → files-JPU3FNJ7.js.map} +1 -1
  316. package/dist/cli-bundle/chunks/{focus-6FA5KYRY.js → focus-LFZ6IDBR.js} +15 -11
  317. package/dist/cli-bundle/chunks/{focus-6FA5KYRY.js.map → focus-LFZ6IDBR.js.map} +1 -1
  318. package/dist/cli-bundle/chunks/{focus-CQ63JFDG.js → focus-WNMYCVYA.js} +13 -9
  319. package/dist/cli-bundle/chunks/{focus-CQ63JFDG.js.map → focus-WNMYCVYA.js.map} +1 -1
  320. package/dist/cli-bundle/chunks/{gc-3BG67KTO.js → gc-AETFKZ44.js} +10 -7
  321. package/dist/cli-bundle/chunks/{gc-3BG67KTO.js.map → gc-AETFKZ44.js.map} +1 -1
  322. package/dist/cli-bundle/chunks/{gc-PEZYGNVB.js → gc-RLBP4QVN.js} +12 -9
  323. package/dist/cli-bundle/chunks/{gc-PEZYGNVB.js.map → gc-RLBP4QVN.js.map} +1 -1
  324. package/dist/cli-bundle/chunks/{get-J6CSJ4SX.js → get-NH2MPBCI.js} +18 -15
  325. package/dist/cli-bundle/chunks/{get-J6CSJ4SX.js.map → get-NH2MPBCI.js.map} +1 -1
  326. package/dist/cli-bundle/chunks/{get-KJTKGNEQ.js → get-P4ZQXCPZ.js} +16 -13
  327. package/dist/cli-bundle/chunks/{get-KJTKGNEQ.js.map → get-P4ZQXCPZ.js.map} +1 -1
  328. package/dist/cli-bundle/chunks/{health-32UQICEL.js → health-3GVPMQBL.js} +36 -29
  329. package/dist/cli-bundle/chunks/{health-32UQICEL.js.map → health-3GVPMQBL.js.map} +1 -1
  330. package/dist/cli-bundle/chunks/{health-ZUZG5ULV.js → health-DNTM72GJ.js} +34 -27
  331. package/dist/cli-bundle/chunks/{health-ZUZG5ULV.js.map → health-DNTM72GJ.js.map} +1 -1
  332. package/dist/cli-bundle/chunks/history-RYKLC72X.js +20 -0
  333. package/dist/cli-bundle/chunks/{history-W6QVR6FA.js → history-SGPYRAFT.js} +10 -8
  334. package/dist/cli-bundle/chunks/{history-compact-JQ6ZGYSJ.js → history-compact-3F6VELO7.js} +18 -15
  335. package/dist/cli-bundle/chunks/{history-compact-JQ6ZGYSJ.js.map → history-compact-3F6VELO7.js.map} +1 -1
  336. package/dist/cli-bundle/chunks/{history-compact-F355EGL4.js → history-compact-656Y2TN4.js} +20 -17
  337. package/dist/cli-bundle/chunks/{history-compact-F355EGL4.js.map → history-compact-656Y2TN4.js.map} +1 -1
  338. package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +21 -0
  339. package/dist/cli-bundle/chunks/{history-redact-TUWOUYX5.js → history-redact-54ICFKXM.js} +11 -9
  340. package/dist/cli-bundle/chunks/{history-repair-ZKS3LKPV.js → history-repair-4N6SDVHK.js} +17 -14
  341. package/dist/cli-bundle/chunks/{history-repair-ZKS3LKPV.js.map → history-repair-4N6SDVHK.js.map} +1 -1
  342. package/dist/cli-bundle/chunks/{history-repair-MPCAIKYE.js → history-repair-EVTO6LIH.js} +19 -16
  343. package/dist/cli-bundle/chunks/{history-repair-MPCAIKYE.js.map → history-repair-EVTO6LIH.js.map} +1 -1
  344. package/dist/cli-bundle/chunks/init-RPIPQUNV.js +32 -0
  345. package/dist/cli-bundle/chunks/init-SKQAESQS.js +28 -0
  346. package/dist/cli-bundle/chunks/{learnings-EYC3OKS2.js → learnings-2HTPZNGZ.js} +10 -8
  347. package/dist/cli-bundle/chunks/{learnings-EYC3OKS2.js.map → learnings-2HTPZNGZ.js.map} +1 -1
  348. package/dist/cli-bundle/chunks/{learnings-HKJJUVTA.js → learnings-YBIHY3D6.js} +12 -10
  349. package/dist/cli-bundle/chunks/{learnings-HKJJUVTA.js.map → learnings-YBIHY3D6.js.map} +1 -1
  350. package/dist/cli-bundle/chunks/{list-KN3TL5Y5.js → list-64LHZ3HM.js} +10 -8
  351. package/dist/cli-bundle/chunks/{list-HFD5737R.js → list-7LXBTEKI.js} +10 -8
  352. package/dist/cli-bundle/chunks/{next-DQUMFAHG.js → next-7ODPAQ4U.js} +22 -18
  353. package/dist/cli-bundle/chunks/{next-DQUMFAHG.js.map → next-7ODPAQ4U.js.map} +1 -1
  354. package/dist/cli-bundle/chunks/{next-JUEYC5HE.js → next-ODJUM4ZM.js} +24 -20
  355. package/dist/cli-bundle/chunks/{next-JUEYC5HE.js.map → next-ODJUM4ZM.js.map} +1 -1
  356. package/dist/cli-bundle/chunks/{notes-ZG6RLZXB.js → notes-72YXN5JX.js} +10 -8
  357. package/dist/cli-bundle/chunks/{notes-ZG6RLZXB.js.map → notes-72YXN5JX.js.map} +1 -1
  358. package/dist/cli-bundle/chunks/{notes-XATYT43P.js → notes-NJ7IQJX4.js} +12 -10
  359. package/dist/cli-bundle/chunks/{notes-XATYT43P.js.map → notes-NJ7IQJX4.js.map} +1 -1
  360. package/dist/cli-bundle/chunks/{plan-DVVLX7LK.js → plan-R4NDQ27E.js} +18 -15
  361. package/dist/cli-bundle/chunks/{plan-DVVLX7LK.js.map → plan-R4NDQ27E.js.map} +1 -1
  362. package/dist/cli-bundle/chunks/{plan-5NWQL2DH.js → plan-XWY5T67S.js} +20 -17
  363. package/dist/cli-bundle/chunks/{plan-5NWQL2DH.js.map → plan-XWY5T67S.js.map} +1 -1
  364. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +397 -0
  365. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +1 -0
  366. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +400 -0
  367. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +7 -0
  368. package/dist/cli-bundle/chunks/{register-list-query-WRS6ACUW.js → register-list-query-5H66WFYF.js} +22 -19
  369. package/dist/cli-bundle/chunks/{register-list-query-WRS6ACUW.js.map → register-list-query-5H66WFYF.js.map} +1 -1
  370. package/dist/cli-bundle/chunks/{register-list-query-PNRAHNIQ.js → register-list-query-FB3FNDLZ.js} +24 -21
  371. package/dist/cli-bundle/chunks/{register-list-query-PNRAHNIQ.js.map → register-list-query-FB3FNDLZ.js.map} +1 -1
  372. package/dist/cli-bundle/chunks/{register-mutation-K2MNRWGI.js → register-mutation-UJO23C7R.js} +42 -39
  373. package/dist/cli-bundle/chunks/{register-mutation-K2MNRWGI.js.map → register-mutation-UJO23C7R.js.map} +1 -1
  374. package/dist/cli-bundle/chunks/{register-mutation-ET6E4VLE.js → register-mutation-Z2ETYHKS.js} +40 -37
  375. package/dist/cli-bundle/chunks/{register-mutation-ET6E4VLE.js.map → register-mutation-Z2ETYHKS.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{register-operations-6DQRUTIX.js → register-operations-A3XAM5J7.js} +39 -36
  377. package/dist/cli-bundle/chunks/{register-operations-6DQRUTIX.js.map → register-operations-A3XAM5J7.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{register-operations-73UDWMVB.js → register-operations-SG7HBSUP.js} +37 -34
  379. package/dist/cli-bundle/chunks/{register-operations-73UDWMVB.js.map → register-operations-SG7HBSUP.js.map} +1 -1
  380. package/dist/cli-bundle/chunks/{register-setup-LYYCMQFV.js → register-setup-I45OGJUV.js} +25 -19
  381. package/dist/cli-bundle/chunks/{register-setup-LYYCMQFV.js.map → register-setup-I45OGJUV.js.map} +1 -1
  382. package/dist/cli-bundle/chunks/{register-setup-FXZJ2CEJ.js → register-setup-K6U3NVY5.js} +23 -17
  383. package/dist/cli-bundle/chunks/{register-setup-FXZJ2CEJ.js.map → register-setup-K6U3NVY5.js.map} +1 -1
  384. package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +19 -0
  385. package/dist/cli-bundle/chunks/{restore-R6YJHQK3.js → restore-YJ2ET6AT.js} +11 -9
  386. package/dist/cli-bundle/chunks/{scheduling-shortcuts-OGODPUBL.js → scheduling-shortcuts-SSC4MYWQ.js} +14 -12
  387. package/dist/cli-bundle/chunks/{scheduling-shortcuts-OGODPUBL.js.map → scheduling-shortcuts-SSC4MYWQ.js.map} +1 -1
  388. package/dist/cli-bundle/chunks/{scheduling-shortcuts-LE4S7OI7.js → scheduling-shortcuts-ULRG7MNP.js} +16 -14
  389. package/dist/cli-bundle/chunks/{scheduling-shortcuts-LE4S7OI7.js.map → scheduling-shortcuts-ULRG7MNP.js.map} +1 -1
  390. package/dist/cli-bundle/chunks/{schema-ICCD3HOP.js → schema-2PUXCZ25.js} +10 -7
  391. package/dist/cli-bundle/chunks/{schema-RHH23PQX.js → schema-Y6DXXK2F.js} +10 -7
  392. package/dist/cli-bundle/chunks/{search-Z2VGP2Q5.js → search-3S72CTD6.js} +13 -10
  393. package/dist/cli-bundle/chunks/{search-HDDKOPFE.js → search-WNUNBQXO.js} +13 -10
  394. package/dist/cli-bundle/chunks/{stats-ETFP37MB.js → stats-IJYTRQGV.js} +13 -10
  395. package/dist/cli-bundle/chunks/{stats-ETFP37MB.js.map → stats-IJYTRQGV.js.map} +1 -1
  396. package/dist/cli-bundle/chunks/{stats-DHMRXHOB.js → stats-L2D5Y2O5.js} +15 -12
  397. package/dist/cli-bundle/chunks/{stats-DHMRXHOB.js.map → stats-L2D5Y2O5.js.map} +1 -1
  398. package/dist/cli-bundle/chunks/{telemetry-ZRBM22QD.js → telemetry-L2CVOKVN.js} +11 -8
  399. package/dist/cli-bundle/chunks/{telemetry-ZRBM22QD.js.map → telemetry-L2CVOKVN.js.map} +1 -1
  400. package/dist/cli-bundle/chunks/{telemetry-NUZNKDCP.js → telemetry-QBYWQA76.js} +13 -10
  401. package/dist/cli-bundle/chunks/{telemetry-NUZNKDCP.js.map → telemetry-QBYWQA76.js.map} +1 -1
  402. package/dist/cli-bundle/chunks/{test-XNKTIP4Y.js → test-DQ2QFJ7W.js} +21 -15
  403. package/dist/cli-bundle/chunks/test-W7QBLVJS.js +41 -0
  404. package/dist/cli-bundle/chunks/{test-all-APCBSXQI.js → test-all-636NTRTT.js} +26 -19
  405. package/dist/cli-bundle/chunks/{test-all-APCBSXQI.js.map → test-all-636NTRTT.js.map} +1 -1
  406. package/dist/cli-bundle/chunks/{test-all-KIK3OYBY.js → test-all-DWYK3RG6.js} +24 -17
  407. package/dist/cli-bundle/chunks/{test-all-KIK3OYBY.js.map → test-all-DWYK3RG6.js.map} +1 -1
  408. package/dist/cli-bundle/chunks/test-runs-245OINZR.js +28 -0
  409. package/dist/cli-bundle/chunks/test-runs-245OINZR.js.map +1 -0
  410. package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +24 -0
  411. package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js.map +7 -0
  412. package/dist/cli-bundle/chunks/update-SFLZPJXX.js +30 -0
  413. package/dist/cli-bundle/chunks/update-SFLZPJXX.js.map +1 -0
  414. package/dist/cli-bundle/chunks/update-SJZ6S77U.js +26 -0
  415. package/dist/cli-bundle/chunks/update-SJZ6S77U.js.map +7 -0
  416. package/dist/cli-bundle/chunks/{update-many-XGTJ7QIU.js → update-many-DC7X3EWM.js} +32 -29
  417. package/dist/cli-bundle/chunks/{update-many-XGTJ7QIU.js.map → update-many-DC7X3EWM.js.map} +1 -1
  418. package/dist/cli-bundle/chunks/{update-many-GFCQG6ZQ.js → update-many-SLLAMHT7.js} +34 -31
  419. package/dist/cli-bundle/chunks/{update-many-GFCQG6ZQ.js.map → update-many-SLLAMHT7.js.map} +1 -1
  420. package/dist/cli-bundle/chunks/{upgrade-KJ3JGELR.js → upgrade-HFFXLZJA.js} +19 -12
  421. package/dist/cli-bundle/chunks/{upgrade-KJ3JGELR.js.map → upgrade-HFFXLZJA.js.map} +1 -1
  422. package/dist/cli-bundle/chunks/{upgrade-RBRQ7PQU.js → upgrade-UYQKM7RF.js} +21 -14
  423. package/dist/cli-bundle/chunks/{upgrade-RBRQ7PQU.js.map → upgrade-UYQKM7RF.js.map} +1 -1
  424. package/dist/cli-bundle/chunks/{validate-EW6TGC7R.js → validate-PA4FDTOV.js} +34 -27
  425. package/dist/cli-bundle/chunks/{validate-EW6TGC7R.js.map → validate-PA4FDTOV.js.map} +2 -2
  426. package/dist/cli-bundle/chunks/{validate-T6PR5WAL.js → validate-Z7L75YEJ.js} +35 -28
  427. package/dist/cli-bundle/chunks/{validate-T6PR5WAL.js.map → validate-Z7L75YEJ.js.map} +1 -1
  428. package/dist/cli-bundle/main.js +173 -57
  429. package/dist/cli-bundle/main.js.map +2 -2
  430. package/dist/cli-bundle/sdk-runtime.js +247 -0
  431. package/dist/cli-bundle/sdk-runtime.js.map +7 -0
  432. package/dist/cli-bundle/sdk-testing.js +101 -0
  433. package/dist/cli-bundle/sdk-testing.js.map +7 -0
  434. package/dist/cli-bundle/sdk.js +787 -0
  435. package/dist/cli-bundle/sdk.js.map +7 -0
  436. package/dist/core/config/nested-settings.d.ts +4 -3
  437. package/dist/core/config/nested-settings.js +17 -6
  438. package/dist/core/config/nested-settings.js.map +1 -1
  439. package/dist/core/extensions/activation-summary.d.ts +6 -0
  440. package/dist/core/extensions/activation-summary.js +10 -4
  441. package/dist/core/extensions/activation-summary.js.map +1 -1
  442. package/dist/core/extensions/capability-usage.d.ts +6 -0
  443. package/dist/core/extensions/capability-usage.js +10 -4
  444. package/dist/core/extensions/capability-usage.js.map +1 -1
  445. package/dist/core/extensions/extension-types.d.ts +5 -0
  446. package/dist/core/extensions/extension-types.js +2 -2
  447. package/dist/core/extensions/extension-types.js.map +1 -1
  448. package/dist/core/extensions/loader.d.ts +3 -0
  449. package/dist/core/extensions/loader.js +11 -19
  450. package/dist/core/extensions/loader.js.map +1 -1
  451. package/dist/core/history/history-rewrite.js +3 -3
  452. package/dist/core/history/history-rewrite.js.map +1 -1
  453. package/dist/core/item/parent-reference-policy.d.ts +9 -1
  454. package/dist/core/item/parent-reference-policy.js +28 -4
  455. package/dist/core/item/parent-reference-policy.js.map +1 -1
  456. package/dist/core/lock/lock.d.ts +28 -1
  457. package/dist/core/lock/lock.js +254 -20
  458. package/dist/core/lock/lock.js.map +1 -1
  459. package/dist/core/search/background-refresh.js +7 -19
  460. package/dist/core/search/background-refresh.js.map +1 -1
  461. package/dist/core/search/http-client.d.ts +0 -1
  462. package/dist/core/search/http-client.js +3 -3
  463. package/dist/core/search/http-client.js.map +1 -1
  464. package/dist/core/shared/constants.js +3 -2
  465. package/dist/core/shared/constants.js.map +1 -1
  466. package/dist/core/shared/errors.d.ts +1 -0
  467. package/dist/core/shared/errors.js +2 -2
  468. package/dist/core/shared/errors.js.map +1 -1
  469. package/dist/core/shared/primitives.d.ts +12 -0
  470. package/dist/core/shared/primitives.js +29 -2
  471. package/dist/core/shared/primitives.js.map +1 -1
  472. package/dist/core/store/item-store.js +3 -3
  473. package/dist/core/store/item-store.js.map +1 -1
  474. package/dist/core/store/settings-validator.d.ts +1 -0
  475. package/dist/core/store/settings-validator.js +6 -3
  476. package/dist/core/store/settings-validator.js.map +1 -1
  477. package/dist/core/store/settings.js +3 -3
  478. package/dist/core/store/settings.js.map +1 -1
  479. package/dist/core/validate/fix-planning.d.ts +0 -2
  480. package/dist/core/validate/fix-planning.js +3 -3
  481. package/dist/core/validate/fix-planning.js.map +1 -1
  482. package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -2
  483. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  484. package/dist/sdk/cli-contracts/flag-contracts.js +3 -2
  485. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  486. package/dist/sdk/errors.d.ts +21 -2
  487. package/dist/sdk/errors.js +8 -2
  488. package/dist/sdk/errors.js.map +1 -1
  489. package/dist/sdk/package-import-adapters.js +3 -3
  490. package/dist/sdk/package-import-adapters.js.map +1 -1
  491. package/dist/sdk/testing.js +41 -19
  492. package/dist/sdk/testing.js.map +1 -1
  493. package/dist/types.d.ts +6 -0
  494. package/dist/types.js +2 -2
  495. package/dist/types.js.map +1 -1
  496. package/docs/ARCHITECTURE.md +27 -0
  497. package/docs/CONFIGURATION.md +3 -0
  498. package/docs/README.md +1 -0
  499. package/docs/SDK_PRIMITIVE_INVENTORY.md +55 -0
  500. package/docs/TESTING.md +5 -1
  501. package/docs/examples/ci/github-actions-pm-extension-gate.yml +5 -5
  502. package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +1 -1
  503. package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +1 -1
  504. package/package.json +11 -24
  505. package/packages/pm-beads/extensions/beads/package.json +3 -0
  506. package/packages/pm-beads/extensions/beads/runtime-loader.ts +24 -2
  507. package/packages/pm-calendar/extensions/calendar/package.json +3 -0
  508. package/packages/pm-command-kit/extensions/command-kit/package.json +3 -0
  509. package/packages/pm-governance-audit/extensions/governance-audit/package.json +3 -0
  510. package/packages/pm-guide-shell/extensions/guide-shell/package.json +3 -0
  511. package/packages/pm-kanban/extensions/kanban/package.json +3 -0
  512. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/package.json +3 -0
  513. package/packages/pm-search-advanced/extensions/search-advanced/package.json +3 -0
  514. package/packages/pm-templates/extensions/templates/package.json +3 -0
  515. package/packages/pm-todos/extensions/todos/package.json +3 -0
  516. package/packages/pm-todos/extensions/todos/runtime-loader.ts +21 -3
  517. package/scripts/bundle-cli.mjs +12 -2
  518. package/dist/cli-bundle/chunks/activity-IDS5GSYG.js +0 -16
  519. package/dist/cli-bundle/chunks/chunk-2VK677OA.js.map +0 -7
  520. package/dist/cli-bundle/chunks/chunk-5FYY76HR.js.map +0 -7
  521. package/dist/cli-bundle/chunks/chunk-75VMARGO.js.map +0 -1
  522. package/dist/cli-bundle/chunks/chunk-7745CXNI.js.map +0 -7
  523. package/dist/cli-bundle/chunks/chunk-AOP2EMK3.js.map +0 -1
  524. package/dist/cli-bundle/chunks/chunk-AZMPKLIA.js.map +0 -1
  525. package/dist/cli-bundle/chunks/chunk-B4O5S7I3.js.map +0 -7
  526. package/dist/cli-bundle/chunks/chunk-BDDYM4LH.js.map +0 -7
  527. package/dist/cli-bundle/chunks/chunk-CN4OAA2G.js.map +0 -7
  528. package/dist/cli-bundle/chunks/chunk-EH23N5FX.js.map +0 -1
  529. package/dist/cli-bundle/chunks/chunk-FMWQRMHS.js.map +0 -1
  530. package/dist/cli-bundle/chunks/chunk-J4KNRDI3.js.map +0 -1
  531. package/dist/cli-bundle/chunks/chunk-KKHIQOTN.js.map +0 -7
  532. package/dist/cli-bundle/chunks/chunk-LLQLLAKU.js.map +0 -1
  533. package/dist/cli-bundle/chunks/chunk-M34MVAOP.js.map +0 -1
  534. package/dist/cli-bundle/chunks/chunk-MTB4PRA3.js.map +0 -7
  535. package/dist/cli-bundle/chunks/chunk-MZG6I2Q2.js.map +0 -7
  536. package/dist/cli-bundle/chunks/chunk-NGDK3KEZ.js.map +0 -7
  537. package/dist/cli-bundle/chunks/chunk-Q3XVLRCJ.js.map +0 -1
  538. package/dist/cli-bundle/chunks/chunk-SBNT6SLO.js.map +0 -7
  539. package/dist/cli-bundle/chunks/chunk-SL2ANJSV.js.map +0 -1
  540. package/dist/cli-bundle/chunks/chunk-TUV7SIWZ.js.map +0 -7
  541. package/dist/cli-bundle/chunks/chunk-UGDONITK.js.map +0 -7
  542. package/dist/cli-bundle/chunks/chunk-UYLA5ROU.js.map +0 -1
  543. package/dist/cli-bundle/chunks/chunk-WBWRQS32.js.map +0 -1
  544. package/dist/cli-bundle/chunks/chunk-XFO2NJY6.js.map +0 -1
  545. package/dist/cli-bundle/chunks/chunk-XQCWTSLO.js.map +0 -1
  546. package/dist/cli-bundle/chunks/chunk-YZWXMDNH.js.map +0 -1
  547. package/dist/cli-bundle/chunks/chunk-Z4DGFQDH.js.map +0 -1
  548. package/dist/cli-bundle/chunks/claim-D6L33A5Y.js.map +0 -1
  549. package/dist/cli-bundle/chunks/claim-YAFUTPVK.js.map +0 -7
  550. package/dist/cli-bundle/chunks/close-KLDLHAOP.js +0 -14
  551. package/dist/cli-bundle/chunks/create-AJ6HUR5W.js +0 -28
  552. package/dist/cli-bundle/chunks/history-IOH6FKG7.js +0 -18
  553. package/dist/cli-bundle/chunks/history-redact-VVDOARNO.js +0 -19
  554. package/dist/cli-bundle/chunks/init-CZLEEE6Q.js +0 -22
  555. package/dist/cli-bundle/chunks/init-MAA6UMNQ.js +0 -26
  556. package/dist/cli-bundle/chunks/profile-54DZ4CLB.js +0 -1205
  557. package/dist/cli-bundle/chunks/profile-54DZ4CLB.js.map +0 -1
  558. package/dist/cli-bundle/chunks/profile-PLIQVEOY.js +0 -1243
  559. package/dist/cli-bundle/chunks/profile-PLIQVEOY.js.map +0 -7
  560. package/dist/cli-bundle/chunks/restore-L27TMMCF.js +0 -17
  561. package/dist/cli-bundle/chunks/test-H36PM746.js +0 -35
  562. package/dist/cli-bundle/chunks/update-RQKI3AMW.js +0 -24
  563. package/dist/cli-bundle/chunks/update-ZM7NJWHY.js +0 -28
  564. /package/dist/cli-bundle/chunks/{activity-IDS5GSYG.js.map → activity-4XQIDNM5.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{activity-OENQCYZD.js.map → activity-YKAKZTZ4.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-4SHME4VR.js.map → chunk-5JE6SMYS.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-4EVY7CQN.js.map → chunk-N6DNM2FA.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-YZR7UMZ6.js.map → chunk-NER3KUUS.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-WTXDLBSZ.js.map → chunk-PDXT6Q55.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-724VLYDJ.js.map → chunk-RX3HQSYG.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-PUVPC5DL.js.map → chunk-S4APD35C.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-A2W3XKAD.js.map → chunk-T35XLYZF.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{chunk-ZZWMJVW2.js.map → chunk-TT42JUMF.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{chunk-W5X3AHJN.js.map → chunk-YOF5VPKM.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{chunk-MZ4NH46V.js.map → chunk-ZMD35NYG.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-TGYXG7TV.js.map → close-3YRR3XY6.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{close-KLDLHAOP.js.map → close-OB2Y4QP5.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{context-IHE3IXN5.js.map → context-4OQGIPSO.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{context-WSYWBEUL.js.map → context-WLA6IAWE.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{create-AJ6HUR5W.js.map → contracts-HXJLKCRI.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{create-JIA2IFCO.js.map → contracts-OJEXMKVW.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{extension-T7JNTAAA.js.map → create-WKOZKPQR.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{extension-PVGRRZZG.js.map → create-XWWQFQ6S.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{history-IOH6FKG7.js.map → extension-NBAH62ML.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{history-W6QVR6FA.js.map → extension-ZF6ZZPOU.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{history-redact-VVDOARNO.js.map → history-RYKLC72X.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{history-redact-TUWOUYX5.js.map → history-SGPYRAFT.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{init-CZLEEE6Q.js.map → history-redact-4H3FCKF3.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{init-MAA6UMNQ.js.map → history-redact-54ICFKXM.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{list-HFD5737R.js.map → init-RPIPQUNV.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{list-KN3TL5Y5.js.map → init-SKQAESQS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{restore-L27TMMCF.js.map → list-64LHZ3HM.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{restore-R6YJHQK3.js.map → list-7LXBTEKI.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{schema-ICCD3HOP.js.map → restore-PXOFL6AM.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{schema-RHH23PQX.js.map → restore-YJ2ET6AT.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{search-HDDKOPFE.js.map → schema-2PUXCZ25.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{search-Z2VGP2Q5.js.map → schema-Y6DXXK2F.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{test-XNKTIP4Y.js.map → search-3S72CTD6.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{test-H36PM746.js.map → search-WNUNBQXO.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{update-ZM7NJWHY.js.map → test-DQ2QFJ7W.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{update-RQKI3AMW.js.map → test-W7QBLVJS.js.map} +0 -0
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../cli/commands/deps.ts"],
4
4
  "sourcesContent": ["/**\n * @module cli/commands/deps\n *\n * Implements the pm deps command surface and its agent-facing runtime behavior.\n */\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { Dependency, ItemFrontMatter, ItemStatus, ItemType } from \"../../types/index.js\";\n\nexport const DEPS_FORMAT_VALUES = [\"tree\", \"graph\"] as const;\n/**\n * Restricts deps format values accepted by command, SDK, and storage contracts.\n */\nexport type DepsFormat = (typeof DEPS_FORMAT_VALUES)[number];\nexport const DEPS_COLLAPSE_VALUES = [\"none\", \"repeated\"] as const;\n/**\n * Restricts deps collapse mode values accepted by command, SDK, and storage contracts.\n */\nexport type DepsCollapseMode = (typeof DEPS_COLLAPSE_VALUES)[number];\n\n/**\n * Documents the deps command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsCommandOptions {\n format?: string;\n maxDepth?: string | number;\n collapse?: string;\n summary?: boolean;\n}\n\ninterface IndexedItem {\n id: string;\n title: string;\n type: ItemType;\n status: ItemStatus;\n dependencies: Dependency[];\n}\n\n/**\n * Documents the deps tree node payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsTreeNode {\n id: string;\n title?: string;\n type?: ItemType;\n status?: ItemStatus;\n via?: string;\n missing: boolean;\n cycle: boolean;\n truncated?: boolean;\n collapsed?: boolean;\n dependencies: DepsTreeNode[];\n}\n\n/**\n * Documents the deps graph node payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsGraphNode {\n id: string;\n title?: string;\n type?: ItemType;\n status?: ItemStatus;\n missing: boolean;\n}\n\n/**\n * Documents the deps graph edge payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsGraphEdge {\n from: string;\n to: string;\n kind: string;\n}\n\n/**\n * Documents the deps graph result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsGraphResult {\n root_id: string;\n nodes: DepsGraphNode[];\n edges: DepsGraphEdge[];\n missing_ids: string[];\n}\n\n/**\n * Documents the deps result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsResult {\n id: string;\n format: DepsFormat;\n node_count: number;\n edge_count: number;\n missing_count: number;\n tree?: DepsTreeNode;\n graph?: DepsGraphResult;\n}\n\nfunction parseFormat(raw: string | undefined): DepsFormat {\n const candidate = raw?.trim().toLowerCase() ?? \"tree\";\n if ((DEPS_FORMAT_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsFormat;\n }\n throw new PmCliError(`Invalid --format value \"${raw}\". Use \"tree\" or \"graph\".`, EXIT_CODE.USAGE);\n}\n\nfunction parseMaxDepth(raw: string | number | undefined): number | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = typeof raw === \"number\" ? raw : Number(raw.trim());\n if (!Number.isInteger(normalized) || normalized < 0) {\n throw new PmCliError(`Invalid --max-depth value \"${raw}\". Use a non-negative integer.`, EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction parseCollapse(raw: string | undefined): DepsCollapseMode {\n const candidate = raw?.trim().toLowerCase() ?? \"none\";\n if ((DEPS_COLLAPSE_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsCollapseMode;\n }\n throw new PmCliError(`Invalid --collapse value \"${raw}\". Use \"none\" or \"repeated\".`, EXIT_CODE.USAGE);\n}\n\nfunction normalizeDependencies(dependencies: Dependency[] | undefined): Dependency[] {\n if (!dependencies || dependencies.length === 0) {\n return [];\n }\n const sorted = [...dependencies].sort((left, right) => {\n const byKind = left.kind.localeCompare(right.kind);\n if (byKind !== 0) return byKind;\n const byId = left.id.localeCompare(right.id);\n if (byId !== 0) return byId;\n return left.created_at.localeCompare(right.created_at);\n });\n const deduped = new Map<string, Dependency>();\n for (const dependency of sorted) {\n const key = `${dependency.kind}::${dependency.id}`;\n if (!deduped.has(key)) {\n deduped.set(key, dependency);\n }\n }\n return [...deduped.values()];\n}\n\nfunction toIndexedItem(item: ItemFrontMatter): IndexedItem {\n return {\n id: item.id,\n title: item.title,\n type: item.type,\n status: item.status,\n dependencies: normalizeDependencies(item.dependencies),\n };\n}\n\nfunction toTreeNode(\n id: string,\n index: Map<string, IndexedItem>,\n lineage: Set<string>,\n maxDepth: number | undefined,\n collapse: DepsCollapseMode,\n expanded: Set<string>,\n depth = 0,\n via?: string,\n): DepsTreeNode {\n const item = index.get(id);\n const baseNode: DepsTreeNode = {\n id,\n title: item?.title,\n type: item?.type,\n status: item?.status,\n via,\n missing: !item,\n cycle: lineage.has(id),\n dependencies: [],\n };\n if (!item || baseNode.cycle) {\n return baseNode;\n }\n if (maxDepth !== undefined && depth >= maxDepth) {\n if (item.dependencies.length > 0) {\n baseNode.truncated = true;\n }\n return baseNode;\n }\n if (collapse === \"repeated\" && expanded.has(id)) {\n baseNode.collapsed = true;\n return baseNode;\n }\n if (collapse === \"repeated\") {\n expanded.add(id);\n }\n const nextLineage = new Set(lineage);\n nextLineage.add(id);\n baseNode.dependencies = item.dependencies.map((dependency) =>\n toTreeNode(dependency.id, index, nextLineage, maxDepth, collapse, expanded, depth + 1, dependency.kind),\n );\n return baseNode;\n}\n\nfunction mergeGraphNode(existing: DepsGraphNode | undefined, candidate: DepsGraphNode): DepsGraphNode {\n if (!existing) {\n return candidate;\n }\n /* c8 ignore start -- defensive: mixed missing/non-missing duplicates only occur in malformed synthetic trees. */\n if (existing.missing && !candidate.missing) return candidate;\n /* c8 ignore stop */\n return {\n ...existing,\n title: existing.title ?? candidate.title,\n type: existing.type ?? candidate.type,\n status: existing.status ?? candidate.status,\n };\n}\n\nfunction toGraph(root: DepsTreeNode): DepsGraphResult {\n const nodesById = new Map<string, DepsGraphNode>();\n const edgesByKey = new Map<string, DepsGraphEdge>();\n\n const visit = (node: DepsTreeNode): void => {\n nodesById.set(\n node.id,\n mergeGraphNode(nodesById.get(node.id), {\n id: node.id,\n title: node.title,\n type: node.type,\n status: node.status,\n missing: node.missing,\n }),\n );\n for (const child of node.dependencies) {\n nodesById.set(\n child.id,\n mergeGraphNode(nodesById.get(child.id), {\n id: child.id,\n title: child.title,\n type: child.type,\n status: child.status,\n missing: child.missing,\n }),\n );\n /* c8 ignore start -- legacy malformed dependency payloads may omit kind/via. */\n const relationKind = child.via ?? \"related\";\n const edgeKey = `${node.id}::${child.id}::${relationKind}`;\n if (!edgesByKey.has(edgeKey)) {\n edgesByKey.set(edgeKey, {\n from: node.id,\n to: child.id,\n kind: relationKind,\n });\n }\n /* c8 ignore stop */\n if (!child.cycle) {\n visit(child);\n }\n }\n };\n\n visit(root);\n\n const nodes = [...nodesById.values()].sort((left, right) => left.id.localeCompare(right.id));\n const edges = [...edgesByKey.values()].sort((left, right) => {\n const byFrom = left.from.localeCompare(right.from);\n if (byFrom !== 0) return byFrom;\n const byTo = left.to.localeCompare(right.to);\n if (byTo !== 0) return byTo;\n return left.kind.localeCompare(right.kind);\n });\n const missingIds = nodes.filter((node) => node.missing).map((node) => node.id);\n return {\n root_id: root.id,\n nodes,\n edges,\n missing_ids: missingIds,\n };\n}\n\n/**\n * Implements run deps for the public runtime surface of this module.\n */\nexport async function runDeps(id: string, options: DepsCommandOptions, global: GlobalOptions): Promise<DepsResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const format = parseFormat(options.format);\n const maxDepth = parseMaxDepth(options.maxDepth);\n const collapse = parseCollapse(options.collapse);\n const summaryOnly = options.summary === true;\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);\n const index = new Map(items.map((item) => [item.id, toIndexedItem(item)]));\n if (!index.has(id)) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n\n const tree = toTreeNode(id, index, new Set<string>(), maxDepth, collapse, new Set<string>());\n const graph = toGraph(tree);\n const baseResult = {\n id,\n format,\n node_count: graph.nodes.length,\n edge_count: graph.edges.length,\n missing_count: graph.missing_ids.length,\n };\n if (summaryOnly) {\n return baseResult;\n }\n if (format === \"tree\") {\n return {\n ...baseResult,\n tree,\n };\n }\n return {\n ...baseResult,\n graph,\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAgBO,IAAM,qBAAqB,CAAC,QAAQ,OAAO;AAK3C,IAAM,uBAAuB,CAAC,QAAQ,UAAU;AAmFvD,SAAS,YAAY,KAAuB;AAC1C,QAAM,YAAY,KAAK,KAAI,EAAG,YAAW,KAAM;AAC/C,MAAK,mBAAyC,SAAS,SAAS,GAAG;AACjE,WAAO;EACT;AACA,QAAM,IAAI,WAAW,2BAA2B,GAAG,6BAA6B,UAAU,KAAK;AACjG;AAEA,SAAS,cAAc,KAAgC;AACrD,MAAI,QAAQ,QAAW;AACrB,WAAO;EACT;AACA,QAAM,aAAa,OAAO,QAAQ,WAAW,MAAM,OAAO,IAAI,KAAI,CA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I,WAAW,iCAAiC,MAAM,wBAAwB,UAAU,SAAS;EACzG;AACA,QAAM,SAAS,YAAY,QAAQ,MAAM;AACzC,QAAM,WAAW,cAAc,QAAQ,QAAQ;AAC/C,QAAM,WAAW,cAAc,QAAQ,QAAQ;AAC/C,QAAM,cAAc,QAAQ,YAAY;AACxC,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,eAAe,wBAAwB,UAAU,gCAA+B,CAAE;AACxF,QAAM,QAAQ,MAAM,wBAAwB,QAAQ,SAAS,aAAa,aAAa,gBAAgB,QAAW,SAAS,MAAM;AACjI,QAAM,QAAQ,IAAI,IAAI,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,cAAc,IAAI,CAAC,CAAC,CAAC;AACzE,MAAI,CAAC,MAAM,IAAI,EAAE,GAAG;AAClB,UAAM,IAAI,WAAW,QAAQ,EAAE,cAAc,UAAU,SAAS;EAClE;AAEA,QAAM,OAAO,WAAW,IAAI,OAAO,oBAAI,IAAG,GAAY,UAAU,UAAU,oBAAI,IAAG,CAAU;AAC3F,QAAM,QAAQ,QAAQ,IAAI;AAC1B,QAAM,aAAa;IACjB;IACA;IACA,YAAY,MAAM,MAAM;IACxB,YAAY,MAAM,MAAM;IACxB,eAAe,MAAM,YAAY;;AAEnC,MAAI,aAAa;AACf,WAAO;EACT;AACA,MAAI,WAAW,QAAQ;AACrB,WAAO;MACL,GAAG;MACH;;EAEJ;AACA,SAAO;IACL,GAAG;IACH;;AAEJ;",
6
6
  "names": ["global"]
7
7
  }
@@ -1,17 +1,19 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ec10d149-1811-568d-b782-80e85f30d473")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d2fd9ecd-74cf-57cf-93ca-7a3198814768")}catch(e){}}();
3
3
  import {
4
4
  renameArtifactsResultKey,
5
5
  runLinkedArtifacts
6
- } from "./chunk-M6PR5BC6.js";
6
+ } from "./chunk-YPPVU5GX.js";
7
7
  import "./chunk-IBMFIKVS.js";
8
8
  import "./chunk-T5RRNDA7.js";
9
- import "./chunk-3C5T3ZEO.js";
9
+ import "./chunk-7WYXBPYQ.js";
10
10
  import "./chunk-P4SESZGT.js";
11
- import "./chunk-UYLA5ROU.js";
12
- import "./chunk-AOP2EMK3.js";
13
- import "./chunk-FMWQRMHS.js";
14
- import "./chunk-SL2ANJSV.js";
11
+ import "./chunk-57C2RLW5.js";
12
+ import "./chunk-HK72NWAD.js";
13
+ import "./chunk-FJRKQREY.js";
14
+ import "./chunk-US3T3W5J.js";
15
+ import "./chunk-NNHHXJB2.js";
16
+ import "./chunk-YD5FML7K.js";
15
17
 
16
18
  // dist/cli/commands/docs.js
17
19
  async function runDocs(id, options, global) {
@@ -26,6 +28,6 @@ async function runDocs(id, options, global) {
26
28
  export {
27
29
  runDocs
28
30
  };
29
- //# sourceMappingURL=docs-PKO7OEIM.js.map
31
+ //# sourceMappingURL=docs-6CRCSVKK.js.map
30
32
 
31
- //# debugId=ec10d149-1811-568d-b782-80e85f30d473
33
+ //# debugId=d2fd9ecd-74cf-57cf-93ca-7a3198814768
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/docs.ts"],"sourcesContent":["/**\n * @module cli/commands/docs\n *\n * Implements the pm docs command surface and its agent-facing runtime behavior.\n */\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport type { LinkedDoc } from \"../../types/index.js\";\nimport {\n renameArtifactsResultKey,\n runLinkedArtifacts,\n type LinkedArtifactResult,\n type LinkedPathAuditEntry,\n type LinkedPathValidation,\n} from \"./linked-artifacts.js\";\n\n/**\n * Documents the docs command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DocsCommandOptions {\n add?: string[];\n addGlob?: string[];\n remove?: string[];\n migrate?: string[];\n /** GH-170 (pm-pfnx): standalone note applied to every --add/--add-glob link in this invocation. */\n note?: string;\n list?: boolean;\n validatePaths?: boolean;\n audit?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the docs result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DocsResult {\n id: string;\n docs: LinkedDoc[];\n changed: boolean;\n count: number;\n migrations_applied?: number;\n validation?: LinkedPathValidation;\n audit?: LinkedPathAuditEntry[];\n}\n\n/**\n * Implements run docs for the public runtime surface of this module.\n */\nexport async function runDocs(id: string, options: DocsCommandOptions, global: GlobalOptions): Promise<DocsResult> {\n const result: LinkedArtifactResult = await runLinkedArtifacts(id, options, global, {\n metadataKey: \"docs\",\n op: \"docs_add\",\n bareNoun: \"doc\",\n supportsAppendStable: false,\n });\n return renameArtifactsResultKey(result, \"docs\") as unknown as DocsResult;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAiDA,eAAsB,QAAQ,IAAY,SAA6B,QAAqB;AAC1F,QAAM,SAA+B,MAAM,mBAAmB,IAAI,SAAS,QAAQ;IACjF,aAAa;IACb,IAAI;IACJ,UAAU;IACV,sBAAsB;GACvB;AACD,SAAO,yBAAyB,QAAQ,MAAM;AAChD","debugId":"ec10d149-1811-568d-b782-80e85f30d473"}
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/docs.ts"],"sourcesContent":["/**\n * @module cli/commands/docs\n *\n * Implements the pm docs command surface and its agent-facing runtime behavior.\n */\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport type { LinkedDoc } from \"../../types/index.js\";\nimport {\n renameArtifactsResultKey,\n runLinkedArtifacts,\n type LinkedArtifactResult,\n type LinkedPathAuditEntry,\n type LinkedPathValidation,\n} from \"./linked-artifacts.js\";\n\n/**\n * Documents the docs command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DocsCommandOptions {\n add?: string[];\n addGlob?: string[];\n remove?: string[];\n migrate?: string[];\n /** GH-170 (pm-pfnx): standalone note applied to every --add/--add-glob link in this invocation. */\n note?: string;\n list?: boolean;\n validatePaths?: boolean;\n audit?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the docs result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DocsResult {\n id: string;\n docs: LinkedDoc[];\n changed: boolean;\n count: number;\n migrations_applied?: number;\n validation?: LinkedPathValidation;\n audit?: LinkedPathAuditEntry[];\n}\n\n/**\n * Implements run docs for the public runtime surface of this module.\n */\nexport async function runDocs(id: string, options: DocsCommandOptions, global: GlobalOptions): Promise<DocsResult> {\n const result: LinkedArtifactResult = await runLinkedArtifacts(id, options, global, {\n metadataKey: \"docs\",\n op: \"docs_add\",\n bareNoun: \"doc\",\n supportsAppendStable: false,\n });\n return renameArtifactsResultKey(result, \"docs\") as unknown as DocsResult;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAiDA,eAAsB,QAAQ,IAAY,SAA6B,QAAqB;AAC1F,QAAM,SAA+B,MAAM,mBAAmB,IAAI,SAAS,QAAQ;IACjF,aAAa;IACb,IAAI;IACJ,UAAU;IACV,sBAAsB;GACvB;AACD,SAAO,yBAAyB,QAAQ,MAAM;AAChD","debugId":"d2fd9ecd-74cf-57cf-93ca-7a3198814768"}
@@ -1,15 +1,17 @@
1
1
  import {
2
2
  renameArtifactsResultKey,
3
3
  runLinkedArtifacts
4
- } from "./chunk-TGYDJEJH.js";
4
+ } from "./chunk-WISPVC2E.js";
5
5
  import "./chunk-7M2HAZEB.js";
6
6
  import "./chunk-WW4E2DC3.js";
7
- import "./chunk-N2LOJUBB.js";
7
+ import "./chunk-T3ABIMGW.js";
8
8
  import "./chunk-5HIZDR5A.js";
9
- import "./chunk-CN4OAA2G.js";
10
- import "./chunk-CQFZRLXQ.js";
11
- import "./chunk-MZG6I2Q2.js";
12
- import "./chunk-BDDYM4LH.js";
9
+ import "./chunk-3U3VEWK6.js";
10
+ import "./chunk-EZFKWSC7.js";
11
+ import "./chunk-DRBV5UC2.js";
12
+ import "./chunk-P5YORJRH.js";
13
+ import "./chunk-7C2O74AE.js";
14
+ import "./chunk-5VVUKE3U.js";
13
15
 
14
16
  // dist/cli/commands/docs.js
15
17
  !(function() {
@@ -31,4 +33,4 @@ async function runDocs(id, options, global2) {
31
33
  export {
32
34
  runDocs
33
35
  };
34
- //# sourceMappingURL=docs-3XZK22WF.js.map
36
+ //# sourceMappingURL=docs-S6UTOTO5.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../cli/commands/docs.ts"],
4
4
  "sourcesContent": ["/**\n * @module cli/commands/docs\n *\n * Implements the pm docs command surface and its agent-facing runtime behavior.\n */\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport type { LinkedDoc } from \"../../types/index.js\";\nimport {\n renameArtifactsResultKey,\n runLinkedArtifacts,\n type LinkedArtifactResult,\n type LinkedPathAuditEntry,\n type LinkedPathValidation,\n} from \"./linked-artifacts.js\";\n\n/**\n * Documents the docs command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DocsCommandOptions {\n add?: string[];\n addGlob?: string[];\n remove?: string[];\n migrate?: string[];\n /** GH-170 (pm-pfnx): standalone note applied to every --add/--add-glob link in this invocation. */\n note?: string;\n list?: boolean;\n validatePaths?: boolean;\n audit?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the docs result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DocsResult {\n id: string;\n docs: LinkedDoc[];\n changed: boolean;\n count: number;\n migrations_applied?: number;\n validation?: LinkedPathValidation;\n audit?: LinkedPathAuditEntry[];\n}\n\n/**\n * Implements run docs for the public runtime surface of this module.\n */\nexport async function runDocs(id: string, options: DocsCommandOptions, global: GlobalOptions): Promise<DocsResult> {\n const result: LinkedArtifactResult = await runLinkedArtifacts(id, options, global, {\n metadataKey: \"docs\",\n op: \"docs_add\",\n bareNoun: \"doc\",\n supportsAppendStable: false,\n });\n return renameArtifactsResultKey(result, \"docs\") as unknown as DocsResult;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAiDA,eAAsB,QAAQ,IAAY,SAA6BA,SAAqB;AAC1F,QAAM,SAA+B,MAAM,mBAAmB,IAAI,SAASA,SAAQ;IACjF,aAAa;IACb,IAAI;IACJ,UAAU;IACV,sBAAsB;GACvB;AACD,SAAO,yBAAyB,QAAQ,MAAM;AAChD;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAiDA,eAAsB,QAAQ,IAAY,SAA6BA,SAAqB;AAC1F,QAAM,SAA+B,MAAM,mBAAmB,IAAI,SAASA,SAAQ;IACjF,aAAa;IACb,IAAI;IACJ,UAAU;IACV,sBAAsB;GACvB;AACD,SAAO,yBAAyB,QAAQ,MAAM;AAChD;",
6
6
  "names": ["global"]
7
7
  }
@@ -1,23 +1,27 @@
1
1
  import {
2
2
  runSearch
3
- } from "./chunk-R7EMP4JG.js";
3
+ } from "./chunk-5B3X4Y22.js";
4
4
  import "./chunk-VPLDQMW2.js";
5
- import "./chunk-KKHIQOTN.js";
6
- import "./chunk-A222YWOQ.js";
5
+ import "./chunk-7EQNAZX2.js";
7
6
  import "./chunk-R23CSHGI.js";
8
- import "./chunk-724VLYDJ.js";
9
- import "./chunk-3MLQZI3H.js";
10
- import "./chunk-CN4OAA2G.js";
11
- import "./chunk-CQFZRLXQ.js";
12
- import "./chunk-MZG6I2Q2.js";
7
+ import "./chunk-RX3HQSYG.js";
8
+ import "./chunk-EEY54JMF.js";
9
+ import "./chunk-LEKT4K7I.js";
10
+ import "./chunk-B5KXLBSJ.js";
11
+ import "./chunk-3U3VEWK6.js";
12
+ import "./chunk-EZFKWSC7.js";
13
+ import "./chunk-DRBV5UC2.js";
14
+ import {
15
+ PmCliError
16
+ } from "./chunk-P5YORJRH.js";
17
+ import "./chunk-7C2O74AE.js";
13
18
  import {
14
19
  EXIT_CODE,
15
- PmCliError,
16
20
  coercePositiveInteger,
17
21
  getSettingsPath,
18
22
  pathExists,
19
23
  resolvePmRoot
20
- } from "./chunk-BDDYM4LH.js";
24
+ } from "./chunk-5VVUKE3U.js";
21
25
 
22
26
  // dist/cli/commands/eval.js
23
27
  import fs from "node:fs/promises";
@@ -281,4 +285,4 @@ export {
281
285
  DEFAULT_EVAL_QUERIES_RELATIVE_PATH,
282
286
  runEval
283
287
  };
284
- //# sourceMappingURL=eval-5XYP6NMY.js.map
288
+ //# sourceMappingURL=eval-N6UHFWVO.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../cli/commands/eval.ts", "../../../../../../../../core/search/eval.ts"],
4
4
  "sourcesContent": ["/**\n * @module cli/commands/eval\n *\n * Implements the `pm eval` command surface (pm-u8n5): a search-relevance\n * evaluation runner that scores a human-curated golden-query set against the\n * live retrieval path and reports nDCG@k, MRR@k, precision@k, and recall@k per\n * query plus the macro average. With `--fail-under` it doubles as a CI gate so\n * relevance regressions — from corpus changes, hybrid-weight changes, or\n * provider swaps (including the offline BM25 provider, pm-75k9) — fail the build\n * instead of silently degrading retrieval quality.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n aggregateEvalMetrics,\n DEFAULT_EVAL_K,\n evaluateRanking,\n parseEvalQuerySet,\n type EvalSearchMode,\n type QueryEvalMetrics,\n} from \"../../core/search/eval.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { coercePositiveInteger } from \"../../core/shared/primitives.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { runSearch } from \"./search.js\";\n\n/**\n * Relative location (under the pm root) of the default golden-query set. A\n * git-tracked, human-curated file so relevance ground truth lives alongside the\n * tracker it evaluates.\n */\nexport const DEFAULT_EVAL_QUERIES_RELATIVE_PATH = path.join(\"search\", \"eval-queries.json\");\n\n/**\n * Documents the eval command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface EvalOptions {\n /** Default retrieval mode for queries that do not set their own (keyword|semantic|hybrid). */\n mode?: string;\n /** Metric cutoff (`@k`); positive integer, defaults to {@link DEFAULT_EVAL_K}. */\n k?: string | number;\n /** Gate threshold: exit non-zero when the aggregate nDCG@k falls below this `[0,1]` value. */\n failUnder?: string | number;\n /** Override path to the golden-query JSON file (defaults to `<pmRoot>/search/eval-queries.json`). */\n queries?: string;\n /** Output format override: json|toon. */\n format?: string;\n}\n\n/** Per-query relevance report row emitted by {@link runEval}. */\nexport interface EvalQueryReport {\n query: string;\n mode: EvalSearchMode;\n relevant_total: number;\n retrieved_relevant: number;\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n}\n\n/**\n * Documents the eval result payload exchanged by command, SDK, and package integrations.\n */\nexport interface EvalResult {\n k: number;\n query_count: number;\n aggregate: {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n };\n queries: EvalQueryReport[];\n /** Present only when `--fail-under` was supplied. */\n fail_under?: number;\n /** Whether the aggregate nDCG met the gate (always true when no gate is set). */\n passed: boolean;\n}\n\nconst VALID_EVAL_MODES: ReadonlySet<string> = new Set<EvalSearchMode>([\"keyword\", \"semantic\", \"hybrid\"]);\n\nfunction parseEvalMode(raw: string | undefined): EvalSearchMode {\n if (raw === undefined) {\n return \"keyword\";\n }\n const normalized = raw.trim().toLowerCase();\n if (!VALID_EVAL_MODES.has(normalized)) {\n throw new PmCliError(\"Eval --mode must be one of keyword|semantic|hybrid\", EXIT_CODE.USAGE);\n }\n return normalized as EvalSearchMode;\n}\n\nfunction parseEvalK(raw: string | number | undefined): number {\n if (raw === undefined || raw === \"\") {\n return DEFAULT_EVAL_K;\n }\n const parsed = coercePositiveInteger(raw);\n if (parsed === null) {\n throw new PmCliError(\"Eval --k must be a positive integer\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\nfunction parseFailUnder(raw: string | number | undefined): number | undefined {\n if (raw === undefined || raw === \"\") {\n return undefined;\n }\n const parsed = typeof raw === \"number\" ? raw : Number(String(raw).trim());\n if (!Number.isFinite(parsed) || parsed < 0 || parsed > 1) {\n throw new PmCliError(\"Eval --fail-under must be a number in the range [0, 1]\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/** Round a metric to four decimals to keep the JSON output compact and stable. */\nfunction roundMetric(value: number): number {\n return Math.round(value * 10_000) / 10_000;\n}\n\nasync function loadEvalQuerySet(queriesPath: string): Promise<ReturnType<typeof parseEvalQuerySet>> {\n let raw: string;\n try {\n raw = await fs.readFile(queriesPath, \"utf8\");\n } catch {\n throw new PmCliError(`Eval query set not found at ${queriesPath}`, EXIT_CODE.NOT_FOUND, {\n examples: [\n 'echo \\'[{\"query\":\"offline search\",\"relevant_ids\":[\"pm-75k9\"]}]\\' > ' + queriesPath,\n \"pm eval --queries ./my-eval.json\",\n ],\n nextSteps: [\n \"Create a git-tracked golden-query JSON file (an array of {query, relevant_ids, mode?} objects), then re-run pm eval.\",\n ],\n });\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (error: unknown) {\n // JSON.parse only ever throws a SyntaxError (an Error subclass).\n throw new PmCliError(\n `Eval query set at ${queriesPath} is not valid JSON: ${(error as Error).message}`,\n EXIT_CODE.USAGE,\n );\n }\n try {\n return parseEvalQuerySet(parsed);\n } catch (error: unknown) {\n // parseEvalQuerySet only ever throws EvalQuerySetError (an Error subclass\n // with a precise, author-actionable message) — surface it as a usage error.\n throw new PmCliError((error as Error).message, EXIT_CODE.USAGE);\n }\n}\n\n/**\n * Run the search-relevance evaluation (pm-u8n5). Loads the golden-query set\n * (default `<pmRoot>/search/eval-queries.json`, overridable via `--queries`),\n * runs each query through {@link runSearch} at the resolved mode, scores the\n * returned ranking with the nDCG/MRR/precision/recall metrics, and macro-averages\n * across queries. When `--fail-under` is supplied, `passed` reflects whether the\n * aggregate nDCG@k cleared the threshold; the CLI layer maps a failed gate to a\n * non-zero exit code.\n */\nexport async function runEval(options: EvalOptions, global: GlobalOptions): Promise<EvalResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const k = parseEvalK(options.k);\n const defaultMode = parseEvalMode(options.mode);\n const failUnder = parseFailUnder(options.failUnder);\n const queriesPath = options.queries\n ? path.resolve(process.cwd(), options.queries)\n : path.join(pmRoot, DEFAULT_EVAL_QUERIES_RELATIVE_PATH);\n const querySet = await loadEvalQuerySet(queriesPath);\n\n const reports: EvalQueryReport[] = [];\n // Aggregate and gate on the UNROUNDED metrics; rounding is applied only to the\n // emitted report values so display precision never flips a --fail-under decision.\n const rawMetrics: QueryEvalMetrics[] = [];\n for (const evalQuery of querySet.queries) {\n const mode = evalQuery.mode ?? defaultMode;\n const searchResult = await runSearch(\n evalQuery.query,\n { mode, limit: String(k), fields: \"id\" },\n global,\n );\n const rankedIds = searchResult.items\n .map((item) => (item as { id?: unknown }).id)\n .filter((id): id is string => typeof id === \"string\");\n const metrics = evaluateRanking(rankedIds, new Set(evalQuery.relevant_ids), k);\n rawMetrics.push(metrics);\n reports.push({\n query: evalQuery.query,\n mode,\n relevant_total: metrics.relevant_total,\n retrieved_relevant: metrics.retrieved_relevant,\n ndcg: roundMetric(metrics.ndcg),\n mrr: roundMetric(metrics.mrr),\n precision: roundMetric(metrics.precision),\n recall: roundMetric(metrics.recall),\n });\n }\n\n const aggregate = aggregateEvalMetrics(rawMetrics);\n const passed = failUnder === undefined || aggregate.ndcg >= failUnder;\n return {\n k,\n query_count: querySet.queries.length,\n aggregate: {\n ndcg: roundMetric(aggregate.ndcg),\n mrr: roundMetric(aggregate.mrr),\n precision: roundMetric(aggregate.precision),\n recall: roundMetric(aggregate.recall),\n },\n queries: reports,\n ...(failUnder !== undefined ? { fail_under: failUnder } : {}),\n passed,\n };\n}\n", "/**\n * @module core/search/eval\n *\n * Search relevance evaluation primitives (pm-u8n5). Implements the standard\n * offline ranking metrics — nDCG@k, MRR@k, precision@k, recall@k — over a\n * human-curated golden-query set, plus the loader/validator for that set. The\n * `pm eval` command (src/cli/commands/eval.ts) runs each golden query through\n * the live retrieval path and feeds the ranked ids here, so relevance\n * regressions from corpus changes, hybrid-weight changes, or provider swaps are\n * measurable and gateable in CI.\n *\n * Relevance is binary: an id is either in a query's `relevant_ids` set or it is\n * not. This keeps the golden set cheap to curate while still supporting the\n * graded-discount behavior of DCG (earlier hits are worth more).\n */\n\n/**\n * Retrieval mode a golden query is evaluated under. Mirrors the `pm search`\n * mode surface; omitting it on a query defers to the eval run's default mode.\n */\nexport type EvalSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\n/** Default cutoff (`@k`) used for every metric when the caller does not override it. */\nexport const DEFAULT_EVAL_K = 10;\n\n/**\n * One curated golden query: the query text, the set of item ids considered\n * relevant, an optional per-query retrieval mode override, and an optional\n * human-readable description of the relevance intent.\n */\nexport interface EvalQuery {\n query: string;\n relevant_ids: string[];\n mode?: EvalSearchMode;\n description?: string;\n}\n\n/** A parsed, validated golden-query set. */\nexport interface EvalQuerySet {\n queries: EvalQuery[];\n}\n\n/**\n * Thrown by {@link parseEvalQuerySet} when the raw golden-query payload is\n * structurally invalid. Carries a precise, human-actionable message naming the\n * offending query index/field so an author can fix the JSON directly.\n */\nexport class EvalQuerySetError extends Error {\n /** Construct an error describing why a golden-query set failed validation. */\n constructor(message: string) {\n super(message);\n this.name = \"EvalQuerySetError\";\n }\n}\n\nconst VALID_EVAL_MODES: ReadonlySet<string> = new Set<EvalSearchMode>([\"keyword\", \"semantic\", \"hybrid\"]);\n\n/**\n * Compute Discounted Cumulative Gain at cutoff `k` for an ordered list of binary\n * relevance gains (`1` relevant, `0` not). Position `i` (1-based) contributes\n * `gain / log2(i + 1)`, so a relevant hit ranked first is worth `1` and later\n * hits are progressively discounted. Gains beyond `k` are ignored.\n */\nexport function dcgAtK(relevanceGains: number[], k: number): number {\n let dcg = 0;\n const limit = Math.min(k, relevanceGains.length);\n for (let index = 0; index < limit; index += 1) {\n dcg += relevanceGains[index] / Math.log2(index + 2);\n }\n return dcg;\n}\n\n/**\n * Normalized DCG at cutoff `k`: the ranking's DCG divided by the DCG of the\n * ideal ranking (all relevant ids first). Returns `0` when the query has no\n * relevant ids (the ideal DCG is `0` and the score is undefined), giving a\n * stable lower bound for aggregation. Result is in `[0, 1]`.\n */\nexport function ndcgAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (relevantIds.size === 0) {\n return 0;\n }\n const gains = rankedIds.map((id) => (relevantIds.has(id) ? 1 : 0));\n const dcg = dcgAtK(gains, k);\n const idealGains = Array.from({ length: relevantIds.size }, () => 1);\n const idealDcg = dcgAtK(idealGains, k);\n return idealDcg === 0 ? 0 : dcg / idealDcg;\n}\n\n/**\n * Reciprocal rank of the first relevant id within the top `k` results: `1/rank`\n * (rank is 1-based), or `0` when no relevant id appears in the cutoff. Averaged\n * across queries this is Mean Reciprocal Rank (MRR@k).\n */\nexport function reciprocalRankAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n const limit = Math.min(k, rankedIds.length);\n for (let index = 0; index < limit; index += 1) {\n if (relevantIds.has(rankedIds[index])) {\n return 1 / (index + 1);\n }\n }\n return 0;\n}\n\n/**\n * Count relevant ids within the top `k` results (shared by precision and\n * recall).\n */\nfunction countRelevantInTopK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n const limit = Math.min(k, rankedIds.length);\n let hits = 0;\n for (let index = 0; index < limit; index += 1) {\n if (relevantIds.has(rankedIds[index])) {\n hits += 1;\n }\n }\n return hits;\n}\n\n/**\n * Precision at cutoff `k`: relevant ids retrieved in the top `k` divided by `k`.\n * Returns `0` for a non-positive `k`.\n */\nexport function precisionAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (k <= 0) {\n return 0;\n }\n return countRelevantInTopK(rankedIds, relevantIds, k) / k;\n}\n\n/**\n * Recall at cutoff `k`: relevant ids retrieved in the top `k` divided by the\n * total number of relevant ids. Returns `0` when the query has no relevant ids.\n */\nexport function recallAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (relevantIds.size === 0) {\n return 0;\n }\n return countRelevantInTopK(rankedIds, relevantIds, k) / relevantIds.size;\n}\n\n/** The four ranking metrics computed for a single query, plus match counts. */\nexport interface QueryEvalMetrics {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n relevant_total: number;\n retrieved_relevant: number;\n}\n\n/**\n * Evaluate one ranking against its relevant-id set at cutoff `k`, returning all\n * four metrics together so callers compute the document ranking once and read\n * every score off the result.\n */\nexport function evaluateRanking(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): QueryEvalMetrics {\n return {\n ndcg: ndcgAtK(rankedIds, relevantIds, k),\n mrr: reciprocalRankAtK(rankedIds, relevantIds, k),\n precision: precisionAtK(rankedIds, relevantIds, k),\n recall: recallAtK(rankedIds, relevantIds, k),\n relevant_total: relevantIds.size,\n retrieved_relevant: countRelevantInTopK(rankedIds, relevantIds, k),\n };\n}\n\n/** Macro-averaged metrics across all evaluated queries. */\nexport interface AggregateEvalMetrics {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n query_count: number;\n}\n\n/**\n * Macro-average per-query metrics (each query weighted equally). Returns all\n * zeros with `query_count: 0` for an empty input so the gate path has a stable\n * shape to compare against.\n */\nexport function aggregateEvalMetrics(perQuery: QueryEvalMetrics[]): AggregateEvalMetrics {\n const queryCount = perQuery.length;\n if (queryCount === 0) {\n return { ndcg: 0, mrr: 0, precision: 0, recall: 0, query_count: 0 };\n }\n const sum = perQuery.reduce(\n (accumulator, metrics) => ({\n ndcg: accumulator.ndcg + metrics.ndcg,\n mrr: accumulator.mrr + metrics.mrr,\n precision: accumulator.precision + metrics.precision,\n recall: accumulator.recall + metrics.recall,\n }),\n { ndcg: 0, mrr: 0, precision: 0, recall: 0 },\n );\n return {\n ndcg: sum.ndcg / queryCount,\n mrr: sum.mrr / queryCount,\n precision: sum.precision / queryCount,\n recall: sum.recall / queryCount,\n query_count: queryCount,\n };\n}\n\n/**\n * Validate one raw golden-query entry, returning a typed {@link EvalQuery}.\n * Throws {@link EvalQuerySetError} (with the entry index) for a missing/empty\n * `query`, a `relevant_ids` that is not a non-empty string array, or an invalid\n * `mode`. `relevant_ids` are trimmed and de-duplicated; `description` is kept\n * only when it is a non-empty string.\n */\nfunction parseEvalQueryEntry(raw: unknown, index: number): EvalQuery {\n if (typeof raw !== \"object\" || raw === null) {\n throw new EvalQuerySetError(`Eval query at index ${index} must be an object`);\n }\n const entry = raw as { query?: unknown; relevant_ids?: unknown; mode?: unknown; description?: unknown };\n const query = typeof entry.query === \"string\" ? entry.query.trim() : \"\";\n if (query.length === 0) {\n throw new EvalQuerySetError(`Eval query at index ${index} must have a non-empty \"query\" string`);\n }\n if (!Array.isArray(entry.relevant_ids)) {\n throw new EvalQuerySetError(`Eval query at index ${index} must have a \"relevant_ids\" array`);\n }\n if (entry.relevant_ids.some((value) => typeof value !== \"string\")) {\n // Reject (rather than silently drop) non-string members: malformed golden\n // data must fail loudly so it can never quietly change relevance judgments.\n throw new EvalQuerySetError(`Eval query at index ${index} must have a \"relevant_ids\" array of strings`);\n }\n const relevantIds = [\n ...new Set((entry.relevant_ids as string[]).map((value) => value.trim()).filter((value) => value.length > 0)),\n ];\n if (relevantIds.length === 0) {\n throw new EvalQuerySetError(`Eval query at index ${index} must list at least one relevant id`);\n }\n if (entry.mode !== undefined && (typeof entry.mode !== \"string\" || !VALID_EVAL_MODES.has(entry.mode))) {\n throw new EvalQuerySetError(`Eval query at index ${index} has an invalid mode (expected keyword|semantic|hybrid)`);\n }\n return {\n query,\n relevant_ids: relevantIds,\n ...(entry.mode !== undefined ? { mode: entry.mode as EvalSearchMode } : {}),\n ...(typeof entry.description === \"string\" && entry.description.trim().length > 0\n ? { description: entry.description.trim() }\n : {}),\n };\n}\n\n/**\n * Parse and validate a raw golden-query payload (typically `JSON.parse` of\n * `.agents/pm/search/eval-queries.json`). Accepts either a bare array of query\n * entries or an object with a `queries` array. Throws {@link EvalQuerySetError}\n * with a precise message when the payload is not an array/object, when\n * `queries` is missing/not an array, when the set is empty, or when any entry\n * fails {@link parseEvalQueryEntry}.\n */\nexport function parseEvalQuerySet(raw: unknown): EvalQuerySet {\n const rawQueries = Array.isArray(raw)\n ? raw\n : typeof raw === \"object\" && raw !== null\n ? (raw as { queries?: unknown }).queries\n : undefined;\n if (!Array.isArray(rawQueries)) {\n throw new EvalQuerySetError('Eval query set must be an array of queries or an object with a \"queries\" array');\n }\n if (rawQueries.length === 0) {\n throw new EvalQuerySetError(\"Eval query set must contain at least one query\");\n }\n return {\n queries: rawQueries.map((entry, index) => parseEvalQueryEntry(entry, index)),\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAWA,OAAO,QAAQ;AACf,OAAO,UAAU;;;;;;;;;;ACWV,IAAM,iBAAiB;AAwBxB,IAAO,oBAAP,cAAiC,MAAK;;EAE1C,YAAY,SAAe;AACzB,UAAM,OAAO;AACb,SAAK,OAAO;EACd;;AAGF,IAAM,mBAAwC,oBAAI,IAAoB,CAAC,WAAW,YAAY,QAAQ,CAAC;AAQjG,SAAU,OAAO,gBAA0B,GAAS;AACxD,MAAI,MAAM;AACV,QAAM,QAAQ,KAAK,IAAI,GAAG,eAAe,MAAM;AAC/C,WAAS,QAAQ,GAAG,QAAQ,OAAO,SAAS,GAAG;AAC7C,WAAO,eAAe,KAAK,IAAI,KAAK,KAAK,QAAQ,CAAC;EACpD;AACA,SAAO;AACT;AAQM,SAAU,QAAQ,WAAqB,aAAkC,GAAS;AACtF,MAAI,YAAY,SAA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IAAI,CAAC,SAAU,KAA0B,EAAE,EAC3C,OAAO,CAAC,OAAqB,OAAO,OAAO,QAAQ;AACtD,UAAM,UAAU,gBAAgB,WAAW,IAAI,IAAI,UAAU,YAAY,GAAG,CAAC;AAC7E,eAAW,KAAK,OAAO;AACvB,YAAQ,KAAK;MACX,OAAO,UAAU;MACjB;MACA,gBAAgB,QAAQ;MACxB,oBAAoB,QAAQ;MAC5B,MAAM,YAAY,QAAQ,IAAI;MAC9B,KAAK,YAAY,QAAQ,GAAG;MAC5B,WAAW,YAAY,QAAQ,SAAS;MACxC,QAAQ,YAAY,QAAQ,MAAM;KACnC;EACH;AAEA,QAAM,YAAY,qBAAqB,UAAU;AACjD,QAAM,SAAS,cAAc,UAAa,UAAU,QAAQ;AAC5D,SAAO;IACL;IACA,aAAa,SAAS,QAAQ;IAC9B,WAAW;MACT,MAAM,YAAY,UAAU,IAAI;MAChC,KAAK,YAAY,UAAU,GAAG;MAC9B,WAAW,YAAY,UAAU,SAAS;MAC1C,QAAQ,YAAY,UAAU,MAAM;;IAEtC,SAAS;IACT,GAAI,cAAc,SAAY,EAAE,YAAY,UAAS,IAAK,CAAA;IAC1D;;AAEJ;",
6
6
  "names": ["VALID_EVAL_MODES", "global"]
7
7
  }
@@ -1,25 +1,29 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1bf1a409-5b60-5bd6-b175-193e4e6ffb19")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2c8d5c7c-cb86-5093-b2d7-5ea51af4a122")}catch(e){}}();
3
3
  import {
4
4
  runSearch
5
- } from "./chunk-Q3XVLRCJ.js";
5
+ } from "./chunk-ZJB3UV5U.js";
6
6
  import "./chunk-ROGZTCCB.js";
7
- import "./chunk-XQCWTSLO.js";
8
- import "./chunk-4IW7STMB.js";
7
+ import "./chunk-YSAH5FY5.js";
9
8
  import "./chunk-QB7XMHJW.js";
10
- import "./chunk-4SHME4VR.js";
11
- import "./chunk-NHKXOMZ5.js";
12
- import "./chunk-UYLA5ROU.js";
13
- import "./chunk-AOP2EMK3.js";
14
- import "./chunk-FMWQRMHS.js";
9
+ import "./chunk-5JE6SMYS.js";
10
+ import "./chunk-YFIE7YK6.js";
11
+ import "./chunk-7QH7DHUB.js";
12
+ import "./chunk-KGHH652T.js";
13
+ import "./chunk-57C2RLW5.js";
14
+ import "./chunk-HK72NWAD.js";
15
+ import "./chunk-FJRKQREY.js";
16
+ import {
17
+ PmCliError
18
+ } from "./chunk-US3T3W5J.js";
19
+ import "./chunk-NNHHXJB2.js";
15
20
  import {
16
21
  EXIT_CODE,
17
- PmCliError,
18
22
  coercePositiveInteger,
19
23
  getSettingsPath,
20
24
  pathExists,
21
25
  resolvePmRoot
22
- } from "./chunk-SL2ANJSV.js";
26
+ } from "./chunk-YD5FML7K.js";
23
27
 
24
28
  // dist/cli/commands/eval.js
25
29
  import fs from "node:fs/promises";
@@ -269,6 +273,6 @@ export {
269
273
  DEFAULT_EVAL_QUERIES_RELATIVE_PATH,
270
274
  runEval
271
275
  };
272
- //# sourceMappingURL=eval-O4WGQYDI.js.map
276
+ //# sourceMappingURL=eval-PHOTWYHI.js.map
273
277
 
274
- //# debugId=1bf1a409-5b60-5bd6-b175-193e4e6ffb19
278
+ //# debugId=2c8d5c7c-cb86-5093-b2d7-5ea51af4a122
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/eval.ts","../../../../../../../../core/search/eval.ts"],"sourcesContent":["/**\n * @module cli/commands/eval\n *\n * Implements the `pm eval` command surface (pm-u8n5): a search-relevance\n * evaluation runner that scores a human-curated golden-query set against the\n * live retrieval path and reports nDCG@k, MRR@k, precision@k, and recall@k per\n * query plus the macro average. With `--fail-under` it doubles as a CI gate so\n * relevance regressions — from corpus changes, hybrid-weight changes, or\n * provider swaps (including the offline BM25 provider, pm-75k9) — fail the build\n * instead of silently degrading retrieval quality.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n aggregateEvalMetrics,\n DEFAULT_EVAL_K,\n evaluateRanking,\n parseEvalQuerySet,\n type EvalSearchMode,\n type QueryEvalMetrics,\n} from \"../../core/search/eval.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { coercePositiveInteger } from \"../../core/shared/primitives.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { runSearch } from \"./search.js\";\n\n/**\n * Relative location (under the pm root) of the default golden-query set. A\n * git-tracked, human-curated file so relevance ground truth lives alongside the\n * tracker it evaluates.\n */\nexport const DEFAULT_EVAL_QUERIES_RELATIVE_PATH = path.join(\"search\", \"eval-queries.json\");\n\n/**\n * Documents the eval command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface EvalOptions {\n /** Default retrieval mode for queries that do not set their own (keyword|semantic|hybrid). */\n mode?: string;\n /** Metric cutoff (`@k`); positive integer, defaults to {@link DEFAULT_EVAL_K}. */\n k?: string | number;\n /** Gate threshold: exit non-zero when the aggregate nDCG@k falls below this `[0,1]` value. */\n failUnder?: string | number;\n /** Override path to the golden-query JSON file (defaults to `<pmRoot>/search/eval-queries.json`). */\n queries?: string;\n /** Output format override: json|toon. */\n format?: string;\n}\n\n/** Per-query relevance report row emitted by {@link runEval}. */\nexport interface EvalQueryReport {\n query: string;\n mode: EvalSearchMode;\n relevant_total: number;\n retrieved_relevant: number;\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n}\n\n/**\n * Documents the eval result payload exchanged by command, SDK, and package integrations.\n */\nexport interface EvalResult {\n k: number;\n query_count: number;\n aggregate: {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n };\n queries: EvalQueryReport[];\n /** Present only when `--fail-under` was supplied. */\n fail_under?: number;\n /** Whether the aggregate nDCG met the gate (always true when no gate is set). */\n passed: boolean;\n}\n\nconst VALID_EVAL_MODES: ReadonlySet<string> = new Set<EvalSearchMode>([\"keyword\", \"semantic\", \"hybrid\"]);\n\nfunction parseEvalMode(raw: string | undefined): EvalSearchMode {\n if (raw === undefined) {\n return \"keyword\";\n }\n const normalized = raw.trim().toLowerCase();\n if (!VALID_EVAL_MODES.has(normalized)) {\n throw new PmCliError(\"Eval --mode must be one of keyword|semantic|hybrid\", EXIT_CODE.USAGE);\n }\n return normalized as EvalSearchMode;\n}\n\nfunction parseEvalK(raw: string | number | undefined): number {\n if (raw === undefined || raw === \"\") {\n return DEFAULT_EVAL_K;\n }\n const parsed = coercePositiveInteger(raw);\n if (parsed === null) {\n throw new PmCliError(\"Eval --k must be a positive integer\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\nfunction parseFailUnder(raw: string | number | undefined): number | undefined {\n if (raw === undefined || raw === \"\") {\n return undefined;\n }\n const parsed = typeof raw === \"number\" ? raw : Number(String(raw).trim());\n if (!Number.isFinite(parsed) || parsed < 0 || parsed > 1) {\n throw new PmCliError(\"Eval --fail-under must be a number in the range [0, 1]\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/** Round a metric to four decimals to keep the JSON output compact and stable. */\nfunction roundMetric(value: number): number {\n return Math.round(value * 10_000) / 10_000;\n}\n\nasync function loadEvalQuerySet(queriesPath: string): Promise<ReturnType<typeof parseEvalQuerySet>> {\n let raw: string;\n try {\n raw = await fs.readFile(queriesPath, \"utf8\");\n } catch {\n throw new PmCliError(`Eval query set not found at ${queriesPath}`, EXIT_CODE.NOT_FOUND, {\n examples: [\n 'echo \\'[{\"query\":\"offline search\",\"relevant_ids\":[\"pm-75k9\"]}]\\' > ' + queriesPath,\n \"pm eval --queries ./my-eval.json\",\n ],\n nextSteps: [\n \"Create a git-tracked golden-query JSON file (an array of {query, relevant_ids, mode?} objects), then re-run pm eval.\",\n ],\n });\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (error: unknown) {\n // JSON.parse only ever throws a SyntaxError (an Error subclass).\n throw new PmCliError(\n `Eval query set at ${queriesPath} is not valid JSON: ${(error as Error).message}`,\n EXIT_CODE.USAGE,\n );\n }\n try {\n return parseEvalQuerySet(parsed);\n } catch (error: unknown) {\n // parseEvalQuerySet only ever throws EvalQuerySetError (an Error subclass\n // with a precise, author-actionable message) — surface it as a usage error.\n throw new PmCliError((error as Error).message, EXIT_CODE.USAGE);\n }\n}\n\n/**\n * Run the search-relevance evaluation (pm-u8n5). Loads the golden-query set\n * (default `<pmRoot>/search/eval-queries.json`, overridable via `--queries`),\n * runs each query through {@link runSearch} at the resolved mode, scores the\n * returned ranking with the nDCG/MRR/precision/recall metrics, and macro-averages\n * across queries. When `--fail-under` is supplied, `passed` reflects whether the\n * aggregate nDCG@k cleared the threshold; the CLI layer maps a failed gate to a\n * non-zero exit code.\n */\nexport async function runEval(options: EvalOptions, global: GlobalOptions): Promise<EvalResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const k = parseEvalK(options.k);\n const defaultMode = parseEvalMode(options.mode);\n const failUnder = parseFailUnder(options.failUnder);\n const queriesPath = options.queries\n ? path.resolve(process.cwd(), options.queries)\n : path.join(pmRoot, DEFAULT_EVAL_QUERIES_RELATIVE_PATH);\n const querySet = await loadEvalQuerySet(queriesPath);\n\n const reports: EvalQueryReport[] = [];\n // Aggregate and gate on the UNROUNDED metrics; rounding is applied only to the\n // emitted report values so display precision never flips a --fail-under decision.\n const rawMetrics: QueryEvalMetrics[] = [];\n for (const evalQuery of querySet.queries) {\n const mode = evalQuery.mode ?? defaultMode;\n const searchResult = await runSearch(\n evalQuery.query,\n { mode, limit: String(k), fields: \"id\" },\n global,\n );\n const rankedIds = searchResult.items\n .map((item) => (item as { id?: unknown }).id)\n .filter((id): id is string => typeof id === \"string\");\n const metrics = evaluateRanking(rankedIds, new Set(evalQuery.relevant_ids), k);\n rawMetrics.push(metrics);\n reports.push({\n query: evalQuery.query,\n mode,\n relevant_total: metrics.relevant_total,\n retrieved_relevant: metrics.retrieved_relevant,\n ndcg: roundMetric(metrics.ndcg),\n mrr: roundMetric(metrics.mrr),\n precision: roundMetric(metrics.precision),\n recall: roundMetric(metrics.recall),\n });\n }\n\n const aggregate = aggregateEvalMetrics(rawMetrics);\n const passed = failUnder === undefined || aggregate.ndcg >= failUnder;\n return {\n k,\n query_count: querySet.queries.length,\n aggregate: {\n ndcg: roundMetric(aggregate.ndcg),\n mrr: roundMetric(aggregate.mrr),\n precision: roundMetric(aggregate.precision),\n recall: roundMetric(aggregate.recall),\n },\n queries: reports,\n ...(failUnder !== undefined ? { fail_under: failUnder } : {}),\n passed,\n };\n}\n","/**\n * @module core/search/eval\n *\n * Search relevance evaluation primitives (pm-u8n5). Implements the standard\n * offline ranking metrics — nDCG@k, MRR@k, precision@k, recall@k — over a\n * human-curated golden-query set, plus the loader/validator for that set. The\n * `pm eval` command (src/cli/commands/eval.ts) runs each golden query through\n * the live retrieval path and feeds the ranked ids here, so relevance\n * regressions from corpus changes, hybrid-weight changes, or provider swaps are\n * measurable and gateable in CI.\n *\n * Relevance is binary: an id is either in a query's `relevant_ids` set or it is\n * not. This keeps the golden set cheap to curate while still supporting the\n * graded-discount behavior of DCG (earlier hits are worth more).\n */\n\n/**\n * Retrieval mode a golden query is evaluated under. Mirrors the `pm search`\n * mode surface; omitting it on a query defers to the eval run's default mode.\n */\nexport type EvalSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\n/** Default cutoff (`@k`) used for every metric when the caller does not override it. */\nexport const DEFAULT_EVAL_K = 10;\n\n/**\n * One curated golden query: the query text, the set of item ids considered\n * relevant, an optional per-query retrieval mode override, and an optional\n * human-readable description of the relevance intent.\n */\nexport interface EvalQuery {\n query: string;\n relevant_ids: string[];\n mode?: EvalSearchMode;\n description?: string;\n}\n\n/** A parsed, validated golden-query set. */\nexport interface EvalQuerySet {\n queries: EvalQuery[];\n}\n\n/**\n * Thrown by {@link parseEvalQuerySet} when the raw golden-query payload is\n * structurally invalid. Carries a precise, human-actionable message naming the\n * offending query index/field so an author can fix the JSON directly.\n */\nexport class EvalQuerySetError extends Error {\n /** Construct an error describing why a golden-query set failed validation. */\n constructor(message: string) {\n super(message);\n this.name = \"EvalQuerySetError\";\n }\n}\n\nconst VALID_EVAL_MODES: ReadonlySet<string> = new Set<EvalSearchMode>([\"keyword\", \"semantic\", \"hybrid\"]);\n\n/**\n * Compute Discounted Cumulative Gain at cutoff `k` for an ordered list of binary\n * relevance gains (`1` relevant, `0` not). Position `i` (1-based) contributes\n * `gain / log2(i + 1)`, so a relevant hit ranked first is worth `1` and later\n * hits are progressively discounted. Gains beyond `k` are ignored.\n */\nexport function dcgAtK(relevanceGains: number[], k: number): number {\n let dcg = 0;\n const limit = Math.min(k, relevanceGains.length);\n for (let index = 0; index < limit; index += 1) {\n dcg += relevanceGains[index] / Math.log2(index + 2);\n }\n return dcg;\n}\n\n/**\n * Normalized DCG at cutoff `k`: the ranking's DCG divided by the DCG of the\n * ideal ranking (all relevant ids first). Returns `0` when the query has no\n * relevant ids (the ideal DCG is `0` and the score is undefined), giving a\n * stable lower bound for aggregation. Result is in `[0, 1]`.\n */\nexport function ndcgAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (relevantIds.size === 0) {\n return 0;\n }\n const gains = rankedIds.map((id) => (relevantIds.has(id) ? 1 : 0));\n const dcg = dcgAtK(gains, k);\n const idealGains = Array.from({ length: relevantIds.size }, () => 1);\n const idealDcg = dcgAtK(idealGains, k);\n return idealDcg === 0 ? 0 : dcg / idealDcg;\n}\n\n/**\n * Reciprocal rank of the first relevant id within the top `k` results: `1/rank`\n * (rank is 1-based), or `0` when no relevant id appears in the cutoff. Averaged\n * across queries this is Mean Reciprocal Rank (MRR@k).\n */\nexport function reciprocalRankAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n const limit = Math.min(k, rankedIds.length);\n for (let index = 0; index < limit; index += 1) {\n if (relevantIds.has(rankedIds[index])) {\n return 1 / (index + 1);\n }\n }\n return 0;\n}\n\n/**\n * Count relevant ids within the top `k` results (shared by precision and\n * recall).\n */\nfunction countRelevantInTopK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n const limit = Math.min(k, rankedIds.length);\n let hits = 0;\n for (let index = 0; index < limit; index += 1) {\n if (relevantIds.has(rankedIds[index])) {\n hits += 1;\n }\n }\n return hits;\n}\n\n/**\n * Precision at cutoff `k`: relevant ids retrieved in the top `k` divided by `k`.\n * Returns `0` for a non-positive `k`.\n */\nexport function precisionAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (k <= 0) {\n return 0;\n }\n return countRelevantInTopK(rankedIds, relevantIds, k) / k;\n}\n\n/**\n * Recall at cutoff `k`: relevant ids retrieved in the top `k` divided by the\n * total number of relevant ids. Returns `0` when the query has no relevant ids.\n */\nexport function recallAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (relevantIds.size === 0) {\n return 0;\n }\n return countRelevantInTopK(rankedIds, relevantIds, k) / relevantIds.size;\n}\n\n/** The four ranking metrics computed for a single query, plus match counts. */\nexport interface QueryEvalMetrics {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n relevant_total: number;\n retrieved_relevant: number;\n}\n\n/**\n * Evaluate one ranking against its relevant-id set at cutoff `k`, returning all\n * four metrics together so callers compute the document ranking once and read\n * every score off the result.\n */\nexport function evaluateRanking(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): QueryEvalMetrics {\n return {\n ndcg: ndcgAtK(rankedIds, relevantIds, k),\n mrr: reciprocalRankAtK(rankedIds, relevantIds, k),\n precision: precisionAtK(rankedIds, relevantIds, k),\n recall: recallAtK(rankedIds, relevantIds, k),\n relevant_total: relevantIds.size,\n retrieved_relevant: countRelevantInTopK(rankedIds, relevantIds, k),\n };\n}\n\n/** Macro-averaged metrics across all evaluated queries. */\nexport interface AggregateEvalMetrics {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n query_count: number;\n}\n\n/**\n * Macro-average per-query metrics (each query weighted equally). Returns all\n * zeros with `query_count: 0` for an empty input so the gate path has a stable\n * shape to compare against.\n */\nexport function aggregateEvalMetrics(perQuery: QueryEvalMetrics[]): AggregateEvalMetrics {\n const queryCount = perQuery.length;\n if (queryCount === 0) {\n return { ndcg: 0, mrr: 0, precision: 0, recall: 0, query_count: 0 };\n }\n const sum = perQuery.reduce(\n (accumulator, metrics) => ({\n ndcg: accumulator.ndcg + metrics.ndcg,\n mrr: accumulator.mrr + metrics.mrr,\n precision: accumulator.precision + metrics.precision,\n recall: accumulator.recall + metrics.recall,\n }),\n { ndcg: 0, mrr: 0, precision: 0, recall: 0 },\n );\n return {\n ndcg: sum.ndcg / queryCount,\n mrr: sum.mrr / queryCount,\n precision: sum.precision / queryCount,\n recall: sum.recall / queryCount,\n query_count: queryCount,\n };\n}\n\n/**\n * Validate one raw golden-query entry, returning a typed {@link EvalQuery}.\n * Throws {@link EvalQuerySetError} (with the entry index) for a missing/empty\n * `query`, a `relevant_ids` that is not a non-empty string array, or an invalid\n * `mode`. `relevant_ids` are trimmed and de-duplicated; `description` is kept\n * only when it is a non-empty string.\n */\nfunction parseEvalQueryEntry(raw: unknown, index: number): EvalQuery {\n if (typeof raw !== \"object\" || raw === null) {\n throw new EvalQuerySetError(`Eval query at index ${index} must be an object`);\n }\n const entry = raw as { query?: unknown; relevant_ids?: unknown; mode?: unknown; description?: unknown };\n const query = typeof entry.query === \"string\" ? entry.query.trim() : \"\";\n if (query.length === 0) {\n throw new EvalQuerySetError(`Eval query at index ${index} must have a non-empty \"query\" string`);\n }\n if (!Array.isArray(entry.relevant_ids)) {\n throw new EvalQuerySetError(`Eval query at index ${index} must have a \"relevant_ids\" array`);\n }\n if (entry.relevant_ids.some((value) => typeof value !== \"string\")) {\n // Reject (rather than silently drop) non-string members: malformed golden\n // data must fail loudly so it can never quietly change relevance judgments.\n throw new EvalQuerySetError(`Eval query at index ${index} must have a \"relevant_ids\" array of strings`);\n }\n const relevantIds = [\n ...new Set((entry.relevant_ids as string[]).map((value) => value.trim()).filter((value) => value.length > 0)),\n ];\n if (relevantIds.length === 0) {\n throw new EvalQuerySetError(`Eval query at index ${index} must list at least one relevant id`);\n }\n if (entry.mode !== undefined && (typeof entry.mode !== \"string\" || !VALID_EVAL_MODES.has(entry.mode))) {\n throw new EvalQuerySetError(`Eval query at index ${index} has an invalid mode (expected keyword|semantic|hybrid)`);\n }\n return {\n query,\n relevant_ids: relevantIds,\n ...(entry.mode !== undefined ? { mode: entry.mode as EvalSearchMode } : {}),\n ...(typeof entry.description === \"string\" && entry.description.trim().length > 0\n ? { description: entry.description.trim() }\n : {}),\n };\n}\n\n/**\n * Parse and validate a raw golden-query payload (typically `JSON.parse` of\n * `.agents/pm/search/eval-queries.json`). Accepts either a bare array of query\n * entries or an object with a `queries` array. Throws {@link EvalQuerySetError}\n * with a precise message when the payload is not an array/object, when\n * `queries` is missing/not an array, when the set is empty, or when any entry\n * fails {@link parseEvalQueryEntry}.\n */\nexport function parseEvalQuerySet(raw: unknown): EvalQuerySet {\n const rawQueries = Array.isArray(raw)\n ? raw\n : typeof raw === \"object\" && raw !== null\n ? (raw as { queries?: unknown }).queries\n : undefined;\n if (!Array.isArray(rawQueries)) {\n throw new EvalQuerySetError('Eval query set must be an array of queries or an object with a \"queries\" array');\n }\n if (rawQueries.length === 0) {\n throw new EvalQuerySetError(\"Eval query set must contain at least one query\");\n }\n return {\n queries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AO,CAAC,OAAqB,OAAO,OAAO,QAAQ;AACtD,UAAM,UAAU,gBAAgB,WAAW,IAAI,IAAI,UAAU,YAAY,GAAG,CAAC;AAC7E,eAAW,KAAK,OAAO;AACvB,YAAQ,KAAK;MACX,OAAO,UAAU;MACjB;MACA,gBAAgB,QAAQ;MACxB,oBAAoB,QAAQ;MAC5B,MAAM,YAAY,QAAQ,IAAI;MAC9B,KAAK,YAAY,QAAQ,GAAG;MAC5B,WAAW,YAAY,QAAQ,SAAS;MACxC,QAAQ,YAAY,QAAQ,MAAM;KACnC;EACH;AAEA,QAAM,YAAY,qBAAqB,UAAU;AACjD,QAAM,SAAS,cAAc,UAAa,UAAU,QAAQ;AAC5D,SAAO;IACL;IACA,aAAa,SAAS,QAAQ;IAC9B,WAAW;MACT,MAAM,YAAY,UAAU,IAAI;MAChC,KAAK,YAAY,UAAU,GAAG;MAC9B,WAAW,YAAY,UAAU,SAAS;MAC1C,QAAQ,YAAY,UAAU,MAAM;;IAEtC,SAAS;IACT,GAAI,cAAc,SAAY,EAAE,YAAY,UAAS,IAAK,CAAA;IAC1D;;AAEJ","debugId":"1bf1a409-5b60-5bd6-b175-193e4e6ffb19"}
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/eval.ts","../../../../../../../../core/search/eval.ts"],"sourcesContent":["/**\n * @module cli/commands/eval\n *\n * Implements the `pm eval` command surface (pm-u8n5): a search-relevance\n * evaluation runner that scores a human-curated golden-query set against the\n * live retrieval path and reports nDCG@k, MRR@k, precision@k, and recall@k per\n * query plus the macro average. With `--fail-under` it doubles as a CI gate so\n * relevance regressions — from corpus changes, hybrid-weight changes, or\n * provider swaps (including the offline BM25 provider, pm-75k9) — fail the build\n * instead of silently degrading retrieval quality.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n aggregateEvalMetrics,\n DEFAULT_EVAL_K,\n evaluateRanking,\n parseEvalQuerySet,\n type EvalSearchMode,\n type QueryEvalMetrics,\n} from \"../../core/search/eval.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { coercePositiveInteger } from \"../../core/shared/primitives.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { runSearch } from \"./search.js\";\n\n/**\n * Relative location (under the pm root) of the default golden-query set. A\n * git-tracked, human-curated file so relevance ground truth lives alongside the\n * tracker it evaluates.\n */\nexport const DEFAULT_EVAL_QUERIES_RELATIVE_PATH = path.join(\"search\", \"eval-queries.json\");\n\n/**\n * Documents the eval command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface EvalOptions {\n /** Default retrieval mode for queries that do not set their own (keyword|semantic|hybrid). */\n mode?: string;\n /** Metric cutoff (`@k`); positive integer, defaults to {@link DEFAULT_EVAL_K}. */\n k?: string | number;\n /** Gate threshold: exit non-zero when the aggregate nDCG@k falls below this `[0,1]` value. */\n failUnder?: string | number;\n /** Override path to the golden-query JSON file (defaults to `<pmRoot>/search/eval-queries.json`). */\n queries?: string;\n /** Output format override: json|toon. */\n format?: string;\n}\n\n/** Per-query relevance report row emitted by {@link runEval}. */\nexport interface EvalQueryReport {\n query: string;\n mode: EvalSearchMode;\n relevant_total: number;\n retrieved_relevant: number;\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n}\n\n/**\n * Documents the eval result payload exchanged by command, SDK, and package integrations.\n */\nexport interface EvalResult {\n k: number;\n query_count: number;\n aggregate: {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n };\n queries: EvalQueryReport[];\n /** Present only when `--fail-under` was supplied. */\n fail_under?: number;\n /** Whether the aggregate nDCG met the gate (always true when no gate is set). */\n passed: boolean;\n}\n\nconst VALID_EVAL_MODES: ReadonlySet<string> = new Set<EvalSearchMode>([\"keyword\", \"semantic\", \"hybrid\"]);\n\nfunction parseEvalMode(raw: string | undefined): EvalSearchMode {\n if (raw === undefined) {\n return \"keyword\";\n }\n const normalized = raw.trim().toLowerCase();\n if (!VALID_EVAL_MODES.has(normalized)) {\n throw new PmCliError(\"Eval --mode must be one of keyword|semantic|hybrid\", EXIT_CODE.USAGE);\n }\n return normalized as EvalSearchMode;\n}\n\nfunction parseEvalK(raw: string | number | undefined): number {\n if (raw === undefined || raw === \"\") {\n return DEFAULT_EVAL_K;\n }\n const parsed = coercePositiveInteger(raw);\n if (parsed === null) {\n throw new PmCliError(\"Eval --k must be a positive integer\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\nfunction parseFailUnder(raw: string | number | undefined): number | undefined {\n if (raw === undefined || raw === \"\") {\n return undefined;\n }\n const parsed = typeof raw === \"number\" ? raw : Number(String(raw).trim());\n if (!Number.isFinite(parsed) || parsed < 0 || parsed > 1) {\n throw new PmCliError(\"Eval --fail-under must be a number in the range [0, 1]\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/** Round a metric to four decimals to keep the JSON output compact and stable. */\nfunction roundMetric(value: number): number {\n return Math.round(value * 10_000) / 10_000;\n}\n\nasync function loadEvalQuerySet(queriesPath: string): Promise<ReturnType<typeof parseEvalQuerySet>> {\n let raw: string;\n try {\n raw = await fs.readFile(queriesPath, \"utf8\");\n } catch {\n throw new PmCliError(`Eval query set not found at ${queriesPath}`, EXIT_CODE.NOT_FOUND, {\n examples: [\n 'echo \\'[{\"query\":\"offline search\",\"relevant_ids\":[\"pm-75k9\"]}]\\' > ' + queriesPath,\n \"pm eval --queries ./my-eval.json\",\n ],\n nextSteps: [\n \"Create a git-tracked golden-query JSON file (an array of {query, relevant_ids, mode?} objects), then re-run pm eval.\",\n ],\n });\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (error: unknown) {\n // JSON.parse only ever throws a SyntaxError (an Error subclass).\n throw new PmCliError(\n `Eval query set at ${queriesPath} is not valid JSON: ${(error as Error).message}`,\n EXIT_CODE.USAGE,\n );\n }\n try {\n return parseEvalQuerySet(parsed);\n } catch (error: unknown) {\n // parseEvalQuerySet only ever throws EvalQuerySetError (an Error subclass\n // with a precise, author-actionable message) — surface it as a usage error.\n throw new PmCliError((error as Error).message, EXIT_CODE.USAGE);\n }\n}\n\n/**\n * Run the search-relevance evaluation (pm-u8n5). Loads the golden-query set\n * (default `<pmRoot>/search/eval-queries.json`, overridable via `--queries`),\n * runs each query through {@link runSearch} at the resolved mode, scores the\n * returned ranking with the nDCG/MRR/precision/recall metrics, and macro-averages\n * across queries. When `--fail-under` is supplied, `passed` reflects whether the\n * aggregate nDCG@k cleared the threshold; the CLI layer maps a failed gate to a\n * non-zero exit code.\n */\nexport async function runEval(options: EvalOptions, global: GlobalOptions): Promise<EvalResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const k = parseEvalK(options.k);\n const defaultMode = parseEvalMode(options.mode);\n const failUnder = parseFailUnder(options.failUnder);\n const queriesPath = options.queries\n ? path.resolve(process.cwd(), options.queries)\n : path.join(pmRoot, DEFAULT_EVAL_QUERIES_RELATIVE_PATH);\n const querySet = await loadEvalQuerySet(queriesPath);\n\n const reports: EvalQueryReport[] = [];\n // Aggregate and gate on the UNROUNDED metrics; rounding is applied only to the\n // emitted report values so display precision never flips a --fail-under decision.\n const rawMetrics: QueryEvalMetrics[] = [];\n for (const evalQuery of querySet.queries) {\n const mode = evalQuery.mode ?? defaultMode;\n const searchResult = await runSearch(\n evalQuery.query,\n { mode, limit: String(k), fields: \"id\" },\n global,\n );\n const rankedIds = searchResult.items\n .map((item) => (item as { id?: unknown }).id)\n .filter((id): id is string => typeof id === \"string\");\n const metrics = evaluateRanking(rankedIds, new Set(evalQuery.relevant_ids), k);\n rawMetrics.push(metrics);\n reports.push({\n query: evalQuery.query,\n mode,\n relevant_total: metrics.relevant_total,\n retrieved_relevant: metrics.retrieved_relevant,\n ndcg: roundMetric(metrics.ndcg),\n mrr: roundMetric(metrics.mrr),\n precision: roundMetric(metrics.precision),\n recall: roundMetric(metrics.recall),\n });\n }\n\n const aggregate = aggregateEvalMetrics(rawMetrics);\n const passed = failUnder === undefined || aggregate.ndcg >= failUnder;\n return {\n k,\n query_count: querySet.queries.length,\n aggregate: {\n ndcg: roundMetric(aggregate.ndcg),\n mrr: roundMetric(aggregate.mrr),\n precision: roundMetric(aggregate.precision),\n recall: roundMetric(aggregate.recall),\n },\n queries: reports,\n ...(failUnder !== undefined ? { fail_under: failUnder } : {}),\n passed,\n };\n}\n","/**\n * @module core/search/eval\n *\n * Search relevance evaluation primitives (pm-u8n5). Implements the standard\n * offline ranking metrics — nDCG@k, MRR@k, precision@k, recall@k — over a\n * human-curated golden-query set, plus the loader/validator for that set. The\n * `pm eval` command (src/cli/commands/eval.ts) runs each golden query through\n * the live retrieval path and feeds the ranked ids here, so relevance\n * regressions from corpus changes, hybrid-weight changes, or provider swaps are\n * measurable and gateable in CI.\n *\n * Relevance is binary: an id is either in a query's `relevant_ids` set or it is\n * not. This keeps the golden set cheap to curate while still supporting the\n * graded-discount behavior of DCG (earlier hits are worth more).\n */\n\n/**\n * Retrieval mode a golden query is evaluated under. Mirrors the `pm search`\n * mode surface; omitting it on a query defers to the eval run's default mode.\n */\nexport type EvalSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\n/** Default cutoff (`@k`) used for every metric when the caller does not override it. */\nexport const DEFAULT_EVAL_K = 10;\n\n/**\n * One curated golden query: the query text, the set of item ids considered\n * relevant, an optional per-query retrieval mode override, and an optional\n * human-readable description of the relevance intent.\n */\nexport interface EvalQuery {\n query: string;\n relevant_ids: string[];\n mode?: EvalSearchMode;\n description?: string;\n}\n\n/** A parsed, validated golden-query set. */\nexport interface EvalQuerySet {\n queries: EvalQuery[];\n}\n\n/**\n * Thrown by {@link parseEvalQuerySet} when the raw golden-query payload is\n * structurally invalid. Carries a precise, human-actionable message naming the\n * offending query index/field so an author can fix the JSON directly.\n */\nexport class EvalQuerySetError extends Error {\n /** Construct an error describing why a golden-query set failed validation. */\n constructor(message: string) {\n super(message);\n this.name = \"EvalQuerySetError\";\n }\n}\n\nconst VALID_EVAL_MODES: ReadonlySet<string> = new Set<EvalSearchMode>([\"keyword\", \"semantic\", \"hybrid\"]);\n\n/**\n * Compute Discounted Cumulative Gain at cutoff `k` for an ordered list of binary\n * relevance gains (`1` relevant, `0` not). Position `i` (1-based) contributes\n * `gain / log2(i + 1)`, so a relevant hit ranked first is worth `1` and later\n * hits are progressively discounted. Gains beyond `k` are ignored.\n */\nexport function dcgAtK(relevanceGains: number[], k: number): number {\n let dcg = 0;\n const limit = Math.min(k, relevanceGains.length);\n for (let index = 0; index < limit; index += 1) {\n dcg += relevanceGains[index] / Math.log2(index + 2);\n }\n return dcg;\n}\n\n/**\n * Normalized DCG at cutoff `k`: the ranking's DCG divided by the DCG of the\n * ideal ranking (all relevant ids first). Returns `0` when the query has no\n * relevant ids (the ideal DCG is `0` and the score is undefined), giving a\n * stable lower bound for aggregation. Result is in `[0, 1]`.\n */\nexport function ndcgAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (relevantIds.size === 0) {\n return 0;\n }\n const gains = rankedIds.map((id) => (relevantIds.has(id) ? 1 : 0));\n const dcg = dcgAtK(gains, k);\n const idealGains = Array.from({ length: relevantIds.size }, () => 1);\n const idealDcg = dcgAtK(idealGains, k);\n return idealDcg === 0 ? 0 : dcg / idealDcg;\n}\n\n/**\n * Reciprocal rank of the first relevant id within the top `k` results: `1/rank`\n * (rank is 1-based), or `0` when no relevant id appears in the cutoff. Averaged\n * across queries this is Mean Reciprocal Rank (MRR@k).\n */\nexport function reciprocalRankAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n const limit = Math.min(k, rankedIds.length);\n for (let index = 0; index < limit; index += 1) {\n if (relevantIds.has(rankedIds[index])) {\n return 1 / (index + 1);\n }\n }\n return 0;\n}\n\n/**\n * Count relevant ids within the top `k` results (shared by precision and\n * recall).\n */\nfunction countRelevantInTopK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n const limit = Math.min(k, rankedIds.length);\n let hits = 0;\n for (let index = 0; index < limit; index += 1) {\n if (relevantIds.has(rankedIds[index])) {\n hits += 1;\n }\n }\n return hits;\n}\n\n/**\n * Precision at cutoff `k`: relevant ids retrieved in the top `k` divided by `k`.\n * Returns `0` for a non-positive `k`.\n */\nexport function precisionAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (k <= 0) {\n return 0;\n }\n return countRelevantInTopK(rankedIds, relevantIds, k) / k;\n}\n\n/**\n * Recall at cutoff `k`: relevant ids retrieved in the top `k` divided by the\n * total number of relevant ids. Returns `0` when the query has no relevant ids.\n */\nexport function recallAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (relevantIds.size === 0) {\n return 0;\n }\n return countRelevantInTopK(rankedIds, relevantIds, k) / relevantIds.size;\n}\n\n/** The four ranking metrics computed for a single query, plus match counts. */\nexport interface QueryEvalMetrics {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n relevant_total: number;\n retrieved_relevant: number;\n}\n\n/**\n * Evaluate one ranking against its relevant-id set at cutoff `k`, returning all\n * four metrics together so callers compute the document ranking once and read\n * every score off the result.\n */\nexport function evaluateRanking(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): QueryEvalMetrics {\n return {\n ndcg: ndcgAtK(rankedIds, relevantIds, k),\n mrr: reciprocalRankAtK(rankedIds, relevantIds, k),\n precision: precisionAtK(rankedIds, relevantIds, k),\n recall: recallAtK(rankedIds, relevantIds, k),\n relevant_total: relevantIds.size,\n retrieved_relevant: countRelevantInTopK(rankedIds, relevantIds, k),\n };\n}\n\n/** Macro-averaged metrics across all evaluated queries. */\nexport interface AggregateEvalMetrics {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n query_count: number;\n}\n\n/**\n * Macro-average per-query metrics (each query weighted equally). Returns all\n * zeros with `query_count: 0` for an empty input so the gate path has a stable\n * shape to compare against.\n */\nexport function aggregateEvalMetrics(perQuery: QueryEvalMetrics[]): AggregateEvalMetrics {\n const queryCount = perQuery.length;\n if (queryCount === 0) {\n return { ndcg: 0, mrr: 0, precision: 0, recall: 0, query_count: 0 };\n }\n const sum = perQuery.reduce(\n (accumulator, metrics) => ({\n ndcg: accumulator.ndcg + metrics.ndcg,\n mrr: accumulator.mrr + metrics.mrr,\n precision: accumulator.precision + metrics.precision,\n recall: accumulator.recall + metrics.recall,\n }),\n { ndcg: 0, mrr: 0, precision: 0, recall: 0 },\n );\n return {\n ndcg: sum.ndcg / queryCount,\n mrr: sum.mrr / queryCount,\n precision: sum.precision / queryCount,\n recall: sum.recall / queryCount,\n query_count: queryCount,\n };\n}\n\n/**\n * Validate one raw golden-query entry, returning a typed {@link EvalQuery}.\n * Throws {@link EvalQuerySetError} (with the entry index) for a missing/empty\n * `query`, a `relevant_ids` that is not a non-empty string array, or an invalid\n * `mode`. `relevant_ids` are trimmed and de-duplicated; `description` is kept\n * only when it is a non-empty string.\n */\nfunction parseEvalQueryEntry(raw: unknown, index: number): EvalQuery {\n if (typeof raw !== \"object\" || raw === null) {\n throw new EvalQuerySetError(`Eval query at index ${index} must be an object`);\n }\n const entry = raw as { query?: unknown; relevant_ids?: unknown; mode?: unknown; description?: unknown };\n const query = typeof entry.query === \"string\" ? entry.query.trim() : \"\";\n if (query.length === 0) {\n throw new EvalQuerySetError(`Eval query at index ${index} must have a non-empty \"query\" string`);\n }\n if (!Array.isArray(entry.relevant_ids)) {\n throw new EvalQuerySetError(`Eval query at index ${index} must have a \"relevant_ids\" array`);\n }\n if (entry.relevant_ids.some((value) => typeof value !== \"string\")) {\n // Reject (rather than silently drop) non-string members: malformed golden\n // data must fail loudly so it can never quietly change relevance judgments.\n throw new EvalQuerySetError(`Eval query at index ${index} must have a \"relevant_ids\" array of strings`);\n }\n const relevantIds = [\n ...new Set((entry.relevant_ids as string[]).map((value) => value.trim()).filter((value) => value.length > 0)),\n ];\n if (relevantIds.length === 0) {\n throw new EvalQuerySetError(`Eval query at index ${index} must list at least one relevant id`);\n }\n if (entry.mode !== undefined && (typeof entry.mode !== \"string\" || !VALID_EVAL_MODES.has(entry.mode))) {\n throw new EvalQuerySetError(`Eval query at index ${index} has an invalid mode (expected keyword|semantic|hybrid)`);\n }\n return {\n query,\n relevant_ids: relevantIds,\n ...(entry.mode !== undefined ? { mode: entry.mode as EvalSearchMode } : {}),\n ...(typeof entry.description === \"string\" && entry.description.trim().length > 0\n ? { description: entry.description.trim() }\n : {}),\n };\n}\n\n/**\n * Parse and validate a raw golden-query payload (typically `JSON.parse` of\n * `.agents/pm/search/eval-queries.json`). Accepts either a bare array of query\n * entries or an object with a `queries` array. Throws {@link EvalQuerySetError}\n * with a precise message when the payload is not an array/object, when\n * `queries` is missing/not an array, when the set is empty, or when any entry\n * fails {@link parseEvalQueryEntry}.\n */\nexport function parseEvalQuerySet(raw: unknown): EvalQuerySet {\n const rawQueries = Array.isArray(raw)\n ? raw\n : typeof raw === \"object\" && raw !== null\n ? (raw as { queries?: unknown }).queries\n : undefined;\n if (!Array.isArray(rawQueries)) {\n throw new EvalQuerySetError('Eval query set must be an array of queries or an object with a \"queries\" array');\n }\n if (rawQueries.length === 0) {\n throw new EvalQuerySetError(\"Eval query set must contain at least one query\");\n }\n return {\n queries: rawQueries.map((entry, index) => parseEvalQueryEntry(entry, index)),\n };\n}\n"],"names":["VALID_EVAL_MODES"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,OAAO,QAAQ;AACf,OAAO,UAAU;;;ACWV,IAAM,iBAAiB;AAwBxB,IAAO,oBAAP,cAAiC,MAAK;;EAE1C,YAAY,SAAe;AACzB,UAAM,OAAO;AACb,SAAK,OAAO;EACd;;AAGF,IAAM,mBAAwC,oBAAI,IAAoB,CAAC,WAAW,YAAY,QAAQ,CAAC;AAQjG,SAA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AM;KACnC;EACH;AAEA,QAAM,YAAY,qBAAqB,UAAU;AACjD,QAAM,SAAS,cAAc,UAAa,UAAU,QAAQ;AAC5D,SAAO;IACL;IACA,aAAa,SAAS,QAAQ;IAC9B,WAAW;MACT,MAAM,YAAY,UAAU,IAAI;MAChC,KAAK,YAAY,UAAU,GAAG;MAC9B,WAAW,YAAY,UAAU,SAAS;MAC1C,QAAQ,YAAY,UAAU,MAAM;;IAEtC,SAAS;IACT,GAAI,cAAc,SAAY,EAAE,YAAY,UAAS,IAAK,CAAA;IAC1D;;AAEJ","debugId":"2c8d5c7c-cb86-5093-b2d7-5ea51af4a122"}
@@ -6,20 +6,26 @@ import {
6
6
  resolveManagedExtensionStatePath,
7
7
  runExtension,
8
8
  writeManagedExtensionState
9
- } from "./chunk-UGDONITK.js";
9
+ } from "./chunk-GIWXVMZ3.js";
10
+ import "./chunk-KDZ6K25I.js";
11
+ import "./chunk-ZVDL32GJ.js";
12
+ import "./chunk-E2FUG6GD.js";
10
13
  import "./chunk-5HIZDR5A.js";
11
- import "./chunk-SBNT6SLO.js";
12
- import "./chunk-A2W3XKAD.js";
13
- import "./chunk-DEIDJQZK.js";
14
14
  import {
15
15
  parseExtensionManifest,
16
16
  validateExtensionDirectory
17
- } from "./chunk-4OXNQHKQ.js";
18
- import "./chunk-7745CXNI.js";
19
- import "./chunk-CN4OAA2G.js";
20
- import "./chunk-CQFZRLXQ.js";
21
- import "./chunk-MZG6I2Q2.js";
22
- import "./chunk-BDDYM4LH.js";
17
+ } from "./chunk-R3ZBLGTC.js";
18
+ import "./chunk-UI5BJ6DO.js";
19
+ import "./chunk-C3PMDWGX.js";
20
+ import "./chunk-4QQ6PM7M.js";
21
+ import "./chunk-3U3VEWK6.js";
22
+ import "./chunk-Y76TWC45.js";
23
+ import "./chunk-EZFKWSC7.js";
24
+ import "./chunk-DRBV5UC2.js";
25
+ import "./chunk-P5YORJRH.js";
26
+ import "./chunk-T35XLYZF.js";
27
+ import "./chunk-7C2O74AE.js";
28
+ import "./chunk-5VVUKE3U.js";
23
29
  export {
24
30
  _testOnly,
25
31
  copyExtensionDirectoryForInstall,
@@ -31,4 +37,4 @@ export {
31
37
  validateExtensionDirectory,
32
38
  writeManagedExtensionState
33
39
  };
34
- //# sourceMappingURL=extension-T7JNTAAA.js.map
40
+ //# sourceMappingURL=extension-NBAH62ML.js.map
@@ -8,20 +8,26 @@ import {
8
8
  resolveManagedExtensionStatePath,
9
9
  runExtension,
10
10
  writeManagedExtensionState
11
- } from "./chunk-J4KNRDI3.js";
11
+ } from "./chunk-JFCVQXZX.js";
12
+ import "./chunk-K32L7HZO.js";
13
+ import "./chunk-OK5NXCZB.js";
14
+ import "./chunk-53BTLLAF.js";
12
15
  import "./chunk-P4SESZGT.js";
13
- import "./chunk-YZWXMDNH.js";
14
- import "./chunk-YZR7UMZ6.js";
15
- import "./chunk-M34MVAOP.js";
16
16
  import {
17
17
  parseExtensionManifest,
18
18
  validateExtensionDirectory
19
- } from "./chunk-6QY2NA2M.js";
20
- import "./chunk-LLQLLAKU.js";
21
- import "./chunk-UYLA5ROU.js";
22
- import "./chunk-AOP2EMK3.js";
23
- import "./chunk-FMWQRMHS.js";
24
- import "./chunk-SL2ANJSV.js";
19
+ } from "./chunk-FUM6UMY4.js";
20
+ import "./chunk-PPE4YUQM.js";
21
+ import "./chunk-AAEQMOC6.js";
22
+ import "./chunk-PJ3A56YF.js";
23
+ import "./chunk-57C2RLW5.js";
24
+ import "./chunk-ZAHXPXVY.js";
25
+ import "./chunk-HK72NWAD.js";
26
+ import "./chunk-FJRKQREY.js";
27
+ import "./chunk-US3T3W5J.js";
28
+ import "./chunk-NER3KUUS.js";
29
+ import "./chunk-NNHHXJB2.js";
30
+ import "./chunk-YD5FML7K.js";
25
31
  export {
26
32
  _testOnly,
27
33
  copyExtensionDirectoryForInstall,
@@ -33,6 +39,6 @@ export {
33
39
  validateExtensionDirectory,
34
40
  writeManagedExtensionState
35
41
  };
36
- //# sourceMappingURL=extension-PVGRRZZG.js.map
42
+ //# sourceMappingURL=extension-ZF6ZZPOU.js.map
37
43
 
38
44
  //# debugId=45eac7fa-f181-5cca-93b7-cfb58909dbb3
@@ -4,31 +4,34 @@ import {
4
4
  renameArtifactsResultKey,
5
5
  runLinkedArtifacts,
6
6
  sortLinkedArtifacts
7
- } from "./chunk-TGYDJEJH.js";
7
+ } from "./chunk-WISPVC2E.js";
8
8
  import "./chunk-7M2HAZEB.js";
9
9
  import {
10
10
  resolveAuthor
11
11
  } from "./chunk-WW4E2DC3.js";
12
- import "./chunk-N2LOJUBB.js";
12
+ import "./chunk-T3ABIMGW.js";
13
13
  import "./chunk-5HIZDR5A.js";
14
14
  import {
15
15
  locateItem,
16
16
  mutateItem,
17
17
  readLocatedItem
18
- } from "./chunk-CN4OAA2G.js";
19
- import "./chunk-CQFZRLXQ.js";
20
- import "./chunk-MZG6I2Q2.js";
18
+ } from "./chunk-3U3VEWK6.js";
19
+ import "./chunk-EZFKWSC7.js";
20
+ import "./chunk-DRBV5UC2.js";
21
21
  import {
22
- EXIT_CODE,
23
22
  PmCliError,
24
23
  getActiveExtensionRegistrations,
24
+ readSettings
25
+ } from "./chunk-P5YORJRH.js";
26
+ import "./chunk-7C2O74AE.js";
27
+ import {
28
+ EXIT_CODE,
25
29
  getSettingsPath,
26
30
  isPathWithinDirectory,
27
31
  pathExists,
28
- readSettings,
29
32
  resolveItemTypeRegistry,
30
33
  resolvePmRoot
31
- } from "./chunk-BDDYM4LH.js";
34
+ } from "./chunk-5VVUKE3U.js";
32
35
 
33
36
  // dist/cli/commands/files.js
34
37
  import fs from "node:fs/promises";
@@ -295,4 +298,4 @@ export {
295
298
  runFiles,
296
299
  runFilesDiscover
297
300
  };
298
- //# sourceMappingURL=files-W7HH5EOD.js.map
301
+ //# sourceMappingURL=files-6P57MRKL.js.map