@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
@@ -1,32 +1,34 @@
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]="8a2f4c69-d55e-5208-9766-d2dcf2a19d73")}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]="1775008a-959d-5fa2-a867-2a4d24c3a190")}catch(e){}}();
3
3
  import {
4
4
  resolveAuthor
5
5
  } from "./chunk-T5RRNDA7.js";
6
6
  import {
7
7
  parseCsvKv
8
- } from "./chunk-3C5T3ZEO.js";
8
+ } from "./chunk-7WYXBPYQ.js";
9
9
  import {
10
10
  parseLimit
11
- } from "./chunk-NHKXOMZ5.js";
11
+ } from "./chunk-YFIE7YK6.js";
12
12
  import {
13
13
  locateItem,
14
14
  mutateItem,
15
15
  readLocatedItem
16
- } from "./chunk-UYLA5ROU.js";
16
+ } from "./chunk-57C2RLW5.js";
17
17
  import {
18
18
  nowIso
19
- } from "./chunk-FMWQRMHS.js";
19
+ } from "./chunk-FJRKQREY.js";
20
20
  import {
21
- EXIT_CODE,
22
21
  PmCliError,
23
22
  getActiveExtensionRegistrations,
23
+ readSettings
24
+ } from "./chunk-US3T3W5J.js";
25
+ import {
26
+ EXIT_CODE,
24
27
  getSettingsPath,
25
28
  pathExists,
26
- readSettings,
27
29
  resolveItemTypeRegistry,
28
30
  resolvePmRoot
29
- } from "./chunk-SL2ANJSV.js";
31
+ } from "./chunk-YD5FML7K.js";
30
32
 
31
33
  // dist/cli/commands/annotation-command.js
32
34
  function limitAnnotationEntries(values, limit) {
@@ -215,6 +217,6 @@ export {
215
217
  wrapOwnershipConflict,
216
218
  runAnnotationCommand
217
219
  };
218
- //# sourceMappingURL=chunk-V655JQ5J.js.map
220
+ //# sourceMappingURL=chunk-JLA7EVYV.js.map
219
221
 
220
- //# debugId=8a2f4c69-d55e-5208-9766-d2dcf2a19d73
222
+ //# debugId=1775008a-959d-5fa2-a867-2a4d24c3a190
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/annotation-command.ts"],"sourcesContent":["/**\n * @module cli/commands/annotation-command\n *\n * Implements the pm annotation command command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { parseCsvKv } from \"../../core/item/parse.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 { nowIso } from \"../../core/shared/time.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { locateItem, mutateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../shared-parsers.js\";\n\ninterface AnnotationEntry {\n created_at: string;\n author: string;\n text: string;\n edited_at?: string;\n}\n\ninterface AnnotationCommandOptions {\n limit?: string;\n author?: string;\n message?: string;\n force?: boolean;\n includeMeta?: boolean;\n}\n\ninterface AnnotationInput {\n mode: \"list\" | \"add\" | \"stdin\" | \"file\" | \"edit\" | \"delete\";\n value?: string;\n emptyFlag?: string;\n index?: number;\n}\n\ninterface OwnershipConflictGuidance {\n required: string;\n examples: string[];\n nextSteps: string[];\n}\n\ninterface AnnotationCommandConfig<TKey extends string> {\n input: AnnotationInput;\n collectionKey: TKey;\n op: Parameters<typeof mutateItem>[0][\"op\"];\n editOp?: Parameters<typeof mutateItem>[0][\"op\"];\n deleteOp?: Parameters<typeof mutateItem>[0][\"op\"];\n parseText: (raw: string) => string;\n allowAuditBypass: boolean;\n conflictGuidance: OwnershipConflictGuidance;\n}\n\ntype AnnotationCommandResult<TKey extends string, TEntry extends AnnotationEntry> = {\n id: string;\n count: number;\n} & Record<TKey, TEntry[]> & {\n total_count?: number;\n returned_count?: number;\n has_more?: boolean;\n limit?: number;\n };\n\n/**\n * Implements limit annotation entries for the public runtime surface of this module.\n */\nexport function limitAnnotationEntries<TEntry>(values: TEntry[], limit: number | undefined): TEntry[] {\n if (limit === undefined) return values;\n if (limit === 0) return [];\n return values.slice(Math.max(0, values.length - limit));\n}\n\n/**\n * Implements read annotation entries for the public runtime surface of this module.\n */\nexport function readAnnotationEntries<TEntry>(source: Record<string, unknown>, collectionKey: string): TEntry[] {\n const value = source[collectionKey];\n return Array.isArray(value) ? (value as TEntry[]) : [];\n}\n\n/**\n * Implements parse annotation text input for the public runtime surface of this module.\n */\nexport function parseAnnotationTextInput(raw: string, options: { stripPlainTextPrefix?: boolean } = {}): string {\n const trimmed = raw.trim();\n if (!trimmed) {\n return \"\";\n }\n const textPrefixMatch = /^(?:[-*+]\\s*)?text\\s*[:=]/i.exec(trimmed);\n if (options.stripPlainTextPrefix === true && textPrefixMatch && !trimmed.startsWith(\"```\")) {\n const text = trimmed.slice(textPrefixMatch[0].length).trim();\n return text || trimmed;\n }\n const looksStructured = /^(?:[-*+]\\s*)?text\\s*[:=]/im.test(trimmed) || trimmed.startsWith(\"```\");\n if (!looksStructured) {\n return trimmed;\n }\n try {\n const kv = parseCsvKv(trimmed, \"--add\");\n const keys = Object.keys(kv).map((key) => key.trim().toLowerCase());\n if (keys.some((key) => key !== \"text\")) {\n return trimmed;\n }\n const text = kv.text?.trim();\n return text || trimmed;\n } catch {\n return trimmed;\n }\n}\n\n/**\n * Implements wrap ownership conflict for the public runtime surface of this module.\n */\nexport function wrapOwnershipConflict(error: unknown, guidance: OwnershipConflictGuidance): never {\n if (\n error instanceof PmCliError &&\n error.exitCode === EXIT_CODE.CONFLICT &&\n error.message.includes(\"is assigned to\") &&\n error.message.includes(\"Use --force to override\")\n ) {\n throw new PmCliError(error.message, error.exitCode, {\n code: \"ownership_conflict\",\n required: guidance.required,\n examples: guidance.examples,\n nextSteps: guidance.nextSteps,\n });\n }\n throw error;\n}\n\n/**\n * Implements run annotation command for the public runtime surface of this module.\n */\nexport async function runAnnotationCommand<TKey extends string, TEntry extends AnnotationEntry>(\n id: string,\n options: AnnotationCommandOptions,\n global: GlobalOptions,\n config: AnnotationCommandConfig<TKey>,\n): Promise<AnnotationCommandResult<TKey, TEntry>> {\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 settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const limit = parseLimit(options.limit);\n\n if (config.input.mode === \"list\") {\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const allEntries = readAnnotationEntries<TEntry>(loaded.document.metadata, config.collectionKey);\n return renderAnnotationResult(located.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n\n if (config.input.mode === \"delete\") {\n const op = config.deleteOp ?? config.op;\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);\n entries.splice(arrayIndex, 1);\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n const text = config.parseText(config.input.value ?? \"\");\n if (!text.trim()) {\n throw new PmCliError(`${config.input.emptyFlag ?? \"--add\"} text cannot be empty`, EXIT_CODE.USAGE);\n }\n\n if (config.input.mode === \"edit\") {\n const op = config.editOp ?? config.op;\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);\n const existing = entries[arrayIndex];\n entries[arrayIndex] = {\n ...existing,\n text,\n edited_at: nowIso(),\n } as TEntry;\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: config.op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n entries.push({\n created_at: nowIso(),\n author,\n text,\n } as TEntry);\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n}\n\n/**\n * Implements resolve annotation index for the public runtime surface of this module.\n */\nexport function resolveAnnotationIndex(\n oneBasedIndex: number | undefined,\n count: number,\n collectionKey: string,\n): number {\n if (oneBasedIndex === undefined || !Number.isInteger(oneBasedIndex) || oneBasedIndex < 1 || oneBasedIndex > count) {\n const singular = collectionKey.replace(/s$/, \"\");\n const label = `${singular.charAt(0).toUpperCase()}${singular.slice(1)}`;\n const noun = count === 1 ? `1 ${singular}` : `${count} ${collectionKey}`;\n throw new PmCliError(\n `${label} index ${oneBasedIndex ?? \"(missing)\"} out of range (item has ${noun})`,\n EXIT_CODE.USAGE,\n );\n }\n return oneBasedIndex - 1;\n}\n\nfunction renderAnnotationResult<TKey extends string, TEntry extends AnnotationEntry>(\n id: string,\n collectionKey: TKey,\n allEntries: TEntry[],\n limit: number | undefined,\n includeMeta: boolean,\n): AnnotationCommandResult<TKey, TEntry> {\n const entries = limitAnnotationEntries(allEntries, limit);\n return {\n id,\n [collectionKey]: entries,\n count: entries.length,\n ...(includeMeta\n ? {\n total_count: allEntries.length,\n returned_count: entries.length,\n has_more: entries.length < allEntries.length,\n ...(limit !== undefined ? { limit } : {}),\n }\n : {}),\n } as AnnotationCommandResult<TKey, TEntry>;\n}\n"],"names":["allEntries","result"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEM,SAAU,uBAA+B,QAAkB,OAAyB;AACxF,MAAI,UAAU;AAA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ACtC,GAAI,UAAU,SAAY,EAAE,MAAK,IAAK,CAAA;QAExC,CAAA;;AAER","debugId":"8a2f4c69-d55e-5208-9766-d2dcf2a19d73"}
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/annotation-command.ts"],"sourcesContent":["/**\n * @module cli/commands/annotation-command\n *\n * Implements the pm annotation command command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { parseCsvKv } from \"../../core/item/parse.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 { nowIso } from \"../../core/shared/time.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { locateItem, mutateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../shared-parsers.js\";\n\ninterface AnnotationEntry {\n created_at: string;\n author: string;\n text: string;\n edited_at?: string;\n}\n\ninterface AnnotationCommandOptions {\n limit?: string;\n author?: string;\n message?: string;\n force?: boolean;\n includeMeta?: boolean;\n}\n\ninterface AnnotationInput {\n mode: \"list\" | \"add\" | \"stdin\" | \"file\" | \"edit\" | \"delete\";\n value?: string;\n emptyFlag?: string;\n index?: number;\n}\n\ninterface OwnershipConflictGuidance {\n required: string;\n examples: string[];\n nextSteps: string[];\n}\n\ninterface AnnotationCommandConfig<TKey extends string> {\n input: AnnotationInput;\n collectionKey: TKey;\n op: Parameters<typeof mutateItem>[0][\"op\"];\n editOp?: Parameters<typeof mutateItem>[0][\"op\"];\n deleteOp?: Parameters<typeof mutateItem>[0][\"op\"];\n parseText: (raw: string) => string;\n allowAuditBypass: boolean;\n conflictGuidance: OwnershipConflictGuidance;\n}\n\ntype AnnotationCommandResult<TKey extends string, TEntry extends AnnotationEntry> = {\n id: string;\n count: number;\n} & Record<TKey, TEntry[]> & {\n total_count?: number;\n returned_count?: number;\n has_more?: boolean;\n limit?: number;\n };\n\n/**\n * Implements limit annotation entries for the public runtime surface of this module.\n */\nexport function limitAnnotationEntries<TEntry>(values: TEntry[], limit: number | undefined): TEntry[] {\n if (limit === undefined) return values;\n if (limit === 0) return [];\n return values.slice(Math.max(0, values.length - limit));\n}\n\n/**\n * Implements read annotation entries for the public runtime surface of this module.\n */\nexport function readAnnotationEntries<TEntry>(source: Record<string, unknown>, collectionKey: string): TEntry[] {\n const value = source[collectionKey];\n return Array.isArray(value) ? (value as TEntry[]) : [];\n}\n\n/**\n * Implements parse annotation text input for the public runtime surface of this module.\n */\nexport function parseAnnotationTextInput(raw: string, options: { stripPlainTextPrefix?: boolean } = {}): string {\n const trimmed = raw.trim();\n if (!trimmed) {\n return \"\";\n }\n const textPrefixMatch = /^(?:[-*+]\\s*)?text\\s*[:=]/i.exec(trimmed);\n if (options.stripPlainTextPrefix === true && textPrefixMatch && !trimmed.startsWith(\"```\")) {\n const text = trimmed.slice(textPrefixMatch[0].length).trim();\n return text || trimmed;\n }\n const looksStructured = /^(?:[-*+]\\s*)?text\\s*[:=]/im.test(trimmed) || trimmed.startsWith(\"```\");\n if (!looksStructured) {\n return trimmed;\n }\n try {\n const kv = parseCsvKv(trimmed, \"--add\");\n const keys = Object.keys(kv).map((key) => key.trim().toLowerCase());\n if (keys.some((key) => key !== \"text\")) {\n return trimmed;\n }\n const text = kv.text?.trim();\n return text || trimmed;\n } catch {\n return trimmed;\n }\n}\n\n/**\n * Implements wrap ownership conflict for the public runtime surface of this module.\n */\nexport function wrapOwnershipConflict(error: unknown, guidance: OwnershipConflictGuidance): never {\n if (\n error instanceof PmCliError &&\n error.exitCode === EXIT_CODE.CONFLICT &&\n error.message.includes(\"is assigned to\") &&\n error.message.includes(\"Use --force to override\")\n ) {\n throw new PmCliError(error.message, error.exitCode, {\n code: \"ownership_conflict\",\n required: guidance.required,\n examples: guidance.examples,\n nextSteps: guidance.nextSteps,\n });\n }\n throw error;\n}\n\n/**\n * Implements run annotation command for the public runtime surface of this module.\n */\nexport async function runAnnotationCommand<TKey extends string, TEntry extends AnnotationEntry>(\n id: string,\n options: AnnotationCommandOptions,\n global: GlobalOptions,\n config: AnnotationCommandConfig<TKey>,\n): Promise<AnnotationCommandResult<TKey, TEntry>> {\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 settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const limit = parseLimit(options.limit);\n\n if (config.input.mode === \"list\") {\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const allEntries = readAnnotationEntries<TEntry>(loaded.document.metadata, config.collectionKey);\n return renderAnnotationResult(located.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n\n if (config.input.mode === \"delete\") {\n const op = config.deleteOp ?? config.op;\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);\n entries.splice(arrayIndex, 1);\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n const text = config.parseText(config.input.value ?? \"\");\n if (!text.trim()) {\n throw new PmCliError(`${config.input.emptyFlag ?? \"--add\"} text cannot be empty`, EXIT_CODE.USAGE);\n }\n\n if (config.input.mode === \"edit\") {\n const op = config.editOp ?? config.op;\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);\n const existing = entries[arrayIndex];\n entries[arrayIndex] = {\n ...existing,\n text,\n edited_at: nowIso(),\n } as TEntry;\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: config.op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n entries.push({\n created_at: nowIso(),\n author,\n text,\n } as TEntry);\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n}\n\n/**\n * Implements resolve annotation index for the public runtime surface of this module.\n */\nexport function resolveAnnotationIndex(\n oneBasedIndex: number | undefined,\n count: number,\n collectionKey: string,\n): number {\n if (oneBasedIndex === undefined || !Number.isInteger(oneBasedIndex) || oneBasedIndex < 1 || oneBasedIndex > count) {\n const singular = collectionKey.replace(/s$/, \"\");\n const label = `${singular.charAt(0).toUpperCase()}${singular.slice(1)}`;\n const noun = count === 1 ? `1 ${singular}` : `${count} ${collectionKey}`;\n throw new PmCliError(\n `${label} index ${oneBasedIndex ?? \"(missing)\"} out of range (item has ${noun})`,\n EXIT_CODE.USAGE,\n );\n }\n return oneBasedIndex - 1;\n}\n\nfunction renderAnnotationResult<TKey extends string, TEntry extends AnnotationEntry>(\n id: string,\n collectionKey: TKey,\n allEntries: TEntry[],\n limit: number | undefined,\n includeMeta: boolean,\n): AnnotationCommandResult<TKey, TEntry> {\n const entries = limitAnnotationEntries(allEntries, limit);\n return {\n id,\n [collectionKey]: entries,\n count: entries.length,\n ...(includeMeta\n ? {\n total_count: allEntries.length,\n returned_count: entries.length,\n has_more: entries.length < allEntries.length,\n ...(limit !== undefined ? { limit } : {}),\n }\n : {}),\n } as AnnotationCommandResult<TKey, TEntry>;\n}\n"],"names":["allEntries","result"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEM,SAAU,uBAA+B,QAAkB,OAAyB;AACxF,MAAI,UAAU;AAAW,WAAO;AAChC,MAAI,UAAU;AAAG,WAAO,CAAA;AACxB,SAAO,OAAO,MAAM,KAAK,IAAI,GAAG,OAAO,SAAS,KAAK,CAAC;AACxD;AAKM,SAAU,sBAA8B,QAAiC,eAAqB;AAClG,QAAM,QAAQ,OAAO,aAAa;AAClC,SAAO,MAAM,QAAQ,KAAK,IAAK,QAAqB,CAAA;AACtD;AAKM,SAAU,yBAAyB,KAAa,UAA8C,CAAA,GAAE;AACpG,QAAM,UAAU,IAAI,KAAI;AACxB,MAAI,CAAC,SAAS;A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MAChD;KACD;EACH,SAAS,OAAgB;AACvB,0BAAsB,OAAO,OAAO,gBAAgB;EACtD;AAEA,QAAM,aAAa,sBAA8B,OAAO,MAAM,OAAO,aAAa;AAClF,SAAO,uBAAuB,OAAO,KAAK,IAAI,OAAO,eAAe,YAAY,OAAO,QAAQ,gBAAgB,IAAI;AACrH;AAKM,SAAU,uBACd,eACA,OACA,eAAqB;AAErB,MAAI,kBAAkB,UAAa,CAAC,OAAO,UAAU,aAAa,KAAK,gBAAgB,KAAK,gBAAgB,OAAO;AACjH,UAAM,WAAW,cAAc,QAAQ,MAAM,EAAE;AAC/C,UAAM,QAAQ,GAAG,SAAS,OAAO,CAAC,EAAE,YAAW,CAAE,GAAG,SAAS,MAAM,CAAC,CAAC;AACrE,UAAM,OAAO,UAAU,IAAI,KAAK,QAAQ,KAAK,GAAG,KAAK,IAAI,aAAa;AACtE,UAAM,IAAI,WACR,GAAG,KAAK,UAAU,iBAAiB,WAAW,2BAA2B,IAAI,KAC7E,UAAU,KAAK;EAEnB;AACA,SAAO,gBAAgB;AACzB;AAEA,SAAS,uBACP,IACA,eACA,YACA,OACA,aAAoB;AAEpB,QAAM,UAAU,uBAAuB,YAAY,KAAK;AACxD,SAAO;IACL;IACA,CAAC,aAAa,GAAG;IACjB,OAAO,QAAQ;IACf,GAAI,cACA;MACE,aAAa,WAAW;MACxB,gBAAgB,QAAQ;MACxB,UAAU,QAAQ,SAAS,WAAW;MACtC,GAAI,UAAU,SAAY,EAAE,MAAK,IAAK,CAAA;QAExC,CAAA;;AAER","debugId":"1775008a-959d-5fa2-a867-2a4d24c3a190"}
@@ -0,0 +1,76 @@
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]="19198c42-e182-5131-a1e0-d6421ac4309c")}catch(e){}}();
3
+ import {
4
+ normalizeExtensionNameForMatch
5
+ } from "./chunk-FUM6UMY4.js";
6
+ import {
7
+ describeExtensionActivation,
8
+ renderExtensionSurfaceMarkdown
9
+ } from "./chunk-AAEQMOC6.js";
10
+
11
+ // dist/cli/commands/extension/describe.js
12
+ function layerNameKey(layer, name) {
13
+ return `${layer}:${normalizeExtensionNameForMatch(name)}`;
14
+ }
15
+ function buildExtensionDescribeResult(target, loadResult, activationResult) {
16
+ const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));
17
+ const candidates = [
18
+ ...loadResult.loaded.map((entry) => ({
19
+ name: entry.name,
20
+ layer: entry.layer,
21
+ version: entry.version,
22
+ activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name)) ? "failed" : "ok",
23
+ surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
24
+ })),
25
+ ...loadResult.failed.map((entry) => ({
26
+ name: entry.name,
27
+ layer: entry.layer,
28
+ version: "unknown",
29
+ activation_status: "not_loaded",
30
+ surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
31
+ }))
32
+ ].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));
33
+ const normalizedTarget = typeof target === "string" ? normalizeExtensionNameForMatch(target) : null;
34
+ const matchedNames = normalizedTarget === null ? null : new Set(loadResult.loaded.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizedTarget || typeof entry.source_package === "string" && normalizeExtensionNameForMatch(entry.source_package) === normalizedTarget).map((entry) => normalizeExtensionNameForMatch(entry.name)).concat(normalizedTarget));
35
+ const extensions = matchedNames === null ? candidates : candidates.filter((entry) => matchedNames.has(normalizeExtensionNameForMatch(entry.name)));
36
+ const unionOptions = matchedNames === null ? {} : { extensionNames: [...matchedNames] };
37
+ return {
38
+ target: typeof target === "string" ? target.trim() : null,
39
+ total: extensions.length,
40
+ extensions,
41
+ union: describeExtensionActivation(activationResult, unionOptions)
42
+ };
43
+ }
44
+ var ACTIVATION_STATUS_LABELS = {
45
+ ok: "loaded",
46
+ failed: "activation failed",
47
+ not_loaded: "not loaded"
48
+ };
49
+ function renderExtensionDescribeMarkdown(result, noun) {
50
+ const titleNoun = `${noun[0].toUpperCase()}${noun.slice(1)}`;
51
+ const lines = [`# ${titleNoun} surface reference`, ""];
52
+ lines.push(result.target === null ? `Scope: all loaded ${noun}s` : `Scope: \`${result.target}\``);
53
+ lines.push(`Described: ${result.total} ${noun}${result.total === 1 ? "" : "s"}`, "");
54
+ if (result.extensions.length === 0) {
55
+ lines.push(`_No ${noun}s are loaded._`, "");
56
+ return `${lines.join("\n").trimEnd()}
57
+ `;
58
+ }
59
+ for (const entry of result.extensions) {
60
+ const title = `${entry.name} (${entry.layer} v${entry.version}, ${ACTIVATION_STATUS_LABELS[entry.activation_status]})`;
61
+ lines.push(renderExtensionSurfaceMarkdown(entry.surfaces, { title, headingLevel: 2 }));
62
+ }
63
+ if (result.extensions.length > 1) {
64
+ lines.push(renderExtensionSurfaceMarkdown(result.union, { title: `Union across all described ${noun}s`, headingLevel: 2 }));
65
+ }
66
+ return `${lines.join("\n").trimEnd()}
67
+ `;
68
+ }
69
+
70
+ export {
71
+ buildExtensionDescribeResult,
72
+ renderExtensionDescribeMarkdown
73
+ };
74
+ //# sourceMappingURL=chunk-K32L7HZO.js.map
75
+
76
+ //# debugId=19198c42-e182-5131-a1e0-d6421ac4309c
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/extension/describe.ts"],"sourcesContent":["/**\n * @module cli/commands/extension/describe\n *\n * Builds the `pm extension describe` / `pm package describe` payload: a flat,\n * by-name map of every surface each loaded extension registered.\n *\n * The SDK already ships {@link describeExtensionActivation} -- the `describe`\n * (enumerate-all) verb that complements the `assert*` (verify-one) and `run*`\n * (invoke-one) testing helpers -- but until now it was reachable only from a test\n * that hand-built an {@link ExtensionActivationResult}. This module is the thin\n * orchestration that lets an agent at the CLI (or over MCP) ask \"what does this\n * installed extension add to my context?\" in one call, instead of stitching\n * together `doctor` (errors), `manage` (update metadata), and a manifest read.\n *\n * It is intentionally pure: the caller performs the load+activate cycle (exactly\n * as `explore`/`doctor` already do) and hands the results here, so the same\n * builder is trivially unit-testable against synthetic activations.\n */\nimport { describeExtensionActivation, type ExtensionActivationSummary } from \"../../../core/extensions/activation-summary.js\";\nimport { renderExtensionSurfaceMarkdown } from \"../../../core/extensions/activation-summary-markdown.js\";\nimport type { ExtensionActivationResult, ExtensionLayer, ExtensionLoadResult } from \"../../../core/extensions/loader.js\";\nimport { normalizeExtensionNameForMatch } from \"./shared.js\";\n\n/**\n * Runtime state of a described extension. `ok` loaded and activated cleanly,\n * `failed` loaded but threw during `activate`, and `not_loaded` failed to import\n * at all -- the latter two register nothing, so their `surfaces` are empty and\n * the status explains why (rather than implying the extension contributes\n * nothing).\n */\nexport type ExtensionDescribeActivationStatus = \"ok\" | \"failed\" | \"not_loaded\";\n\n/**\n * One extension's contribution to the workspace: its identity plus the\n * {@link ExtensionActivationSummary} of every surface it registered.\n *\n * `surfaces` is matched by extension *name* (mirroring\n * {@link describeExtensionActivation}'s name filter), so when the same name is\n * loaded in both the project and global layers each entry reflects that name's\n * combined surfaces -- the `layer`/`version` fields still distinguish the\n * physical entries.\n */\nexport interface ExtensionSurfaceDescription {\n name: string;\n layer: ExtensionLayer;\n version: string;\n activation_status: ExtensionDescribeActivationStatus;\n surfaces: ExtensionActivationSummary;\n}\n\n/**\n * Result of {@link buildExtensionDescribeResult}: the per-extension surface maps\n * plus a deduplicated `union` across the described set. `target` echoes the\n * requested name filter (or `null` for the whole workspace) and `total` counts\n * the described entries so callers need not re-measure `extensions`.\n */\nexport interface ExtensionDescribeResult {\n target: string | null;\n total: number;\n extensions: ExtensionSurfaceDescription[];\n union: ExtensionActivationSummary;\n}\n\n/**\n * Compose a collision-free identity key for an extension from its layer and\n * normalized name. The two parts are joined with a colon; the layer prefix is\n * always a colon-free enum value, so distinct (layer, name) pairs never collide\n * even when a name itself contains a colon.\n */\nfunction layerNameKey(layer: ExtensionLayer, name: string): string {\n return `${layer}:${normalizeExtensionNameForMatch(name)}`;\n}\n\n/**\n * Summarize, by name, every registration surface the loaded extensions exercised.\n *\n * Walks `loadResult.loaded` (annotating each with `failed` when its layer+name is\n * in `activationResult.failed`) and `loadResult.failed` (as `not_loaded`), sorts\n * the entries by name then layer for deterministic output, and attaches each\n * extension's {@link describeExtensionActivation} summary. When `target` is\n * provided only the case-insensitively matching extensions are described and the\n * `union` is scoped to that resolved name set; otherwise every loaded extension contributes.\n * A target may name either the extension itself or its source npm package\n * (`source_package`), so agents can reuse the `package_name` values surfaced by\n * `pm extension list` / install discovery without a second lookup. An unmatched\n * `target` yields an empty `extensions` array -- the caller decides whether that\n * is a not-found error.\n */\nexport function buildExtensionDescribeResult(\n target: string | undefined,\n loadResult: ExtensionLoadResult,\n activationResult: ExtensionActivationResult,\n): ExtensionDescribeResult {\n const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));\n const candidates: ExtensionSurfaceDescription[] = [\n ...loadResult.loaded.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: entry.version,\n activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name))\n ? (\"failed\" as const)\n : (\"ok\" as const),\n surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),\n })),\n ...loadResult.failed.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: \"unknown\",\n activation_status: \"not_loaded\" as const,\n surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),\n })),\n ].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));\n\n const normalizedTarget = typeof target === \"string\" ? normalizeExtensionNameForMatch(target) : null;\n const matchedNames =\n normalizedTarget === null\n ? null\n : new Set(\n loadResult.loaded\n .filter(\n (entry) =>\n normalizeExtensionNameForMatch(entry.name) === normalizedTarget ||\n (typeof entry.source_package === \"string\" &&\n normalizeExtensionNameForMatch(entry.source_package) === normalizedTarget),\n )\n .map((entry) => normalizeExtensionNameForMatch(entry.name))\n .concat(normalizedTarget),\n );\n const extensions =\n matchedNames === null ? candidates : candidates.filter((entry) => matchedNames.has(normalizeExtensionNameForMatch(entry.name)));\n const unionOptions =\n matchedNames === null\n ? {}\n : { extensionNames: [...matchedNames] };\n\n return {\n target: typeof target === \"string\" ? target.trim() : null,\n total: extensions.length,\n extensions,\n union: describeExtensionActivation(activationResult, unionOptions),\n };\n}\n\n/**\n * Human-readable label for each {@link ExtensionDescribeActivationStatus}, used\n * in the Markdown per-extension heading so a reader sees *why* an entry has no\n * surfaces (activation failed / never loaded) rather than assuming it\n * contributes nothing.\n */\nconst ACTIVATION_STATUS_LABELS: Record<ExtensionDescribeActivationStatus, string> = {\n ok: \"loaded\",\n failed: \"activation failed\",\n not_loaded: \"not loaded\",\n};\n\n/**\n * Render an {@link ExtensionDescribeResult} as a Markdown reference document: a\n * top-level title and scope line, one section per described extension (titled\n * with its identity and activation status), and — only when more than one\n * extension was described — a final union section spanning them all. Each\n * extension and the union are rendered with the shared\n * {@link renderExtensionSurfaceMarkdown} primitive at heading level 2, so the\n * document nests cleanly under the level-1 title.\n *\n * `noun` is the lifecycle vocabulary (`\"extension\"` or `\"package\"`) so the prose\n * matches the command the agent invoked. When no extensions match (an unmatched\n * target is already a not-found error upstream, so this is the \"nothing loaded\"\n * case) the document is the title plus a single explanatory note.\n */\nexport function renderExtensionDescribeMarkdown(result: ExtensionDescribeResult, noun: string): string {\n const titleNoun = `${noun[0]!.toUpperCase()}${noun.slice(1)}`;\n const lines = [`# ${titleNoun} surface reference`, \"\"];\n lines.push(result.target === null ? `Scope: all loaded ${noun}s` : `Scope: \\`${result.target}\\``);\n lines.push(`Described: ${result.total} ${noun}${result.total === 1 ? \"\" : \"s\"}`, \"\");\n\n if (result.extensions.length === 0) {\n lines.push(`_No ${noun}s are loaded._`, \"\");\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n }\n\n for (const entry of result.extensions) {\n const title = `${entry.name} (${entry.layer} v${entry.version}, ${ACTIVATION_STATUS_LABELS[entry.activation_status]})`;\n // renderExtensionSurfaceMarkdown already ends with a newline; the join adds a\n // single blank line between sections, so no extra \"\" separator is pushed.\n lines.push(renderExtensionSurfaceMarkdown(entry.surfaces, { title, headingLevel: 2 }));\n }\n\n if (result.extensions.length > 1) {\n lines.push(renderExtensionSurfaceMarkdown(result.union, { title: `Union across all described ${noun}s`, headingLevel: 2 }));\n }\n\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAqEA,SAAS,aAAa,OAAuB,MAAY;AACvD,SAAO,GAAG,KAAK,IAAI,+BAA+B,IAAI,CAAC;AACzD;AAiBM,SAAU,6BACd,QACA,YACA,kBAA2C;AAE3C,QAAM,uBAAuB,IAAI,IAAI,iBAAiB,OAAO,IAAI,CAAC,UAAU,aAAa,MAAM,OAAO,MAAM,IAAI,CAAC,CAAC;AAClH,QAAM,aAA4C;IAChD,GAAG,WAAW,OAAO,IAAI,CAAC,WAAW;MACnC,MAAM,MAAM;MACZ,OAAO,MAAM;MACb,SAAS,MAAM;MACf,mBAAmB,qBAAqB,IAAI,aAAa,MAAM,OAAO,MAAM,IAAI,CAAC,IAC5E,WACA;MACL,UAAU,4BAA4B,kBAAkB,EAAE,eAAe,MAAM,KAAI,CAAE;MACrF;IACF,GAAG,WAAW,OAAO,IAAI,CAAC,WAAW;MACnC,MAAM,MAAM;MACZ,OAAO,MAAM;MACb,SAAS;MACT,mBAAmB;MACnB,UAAU,4BAA4B,kBAAkB,EAAE,eAAe,MAAM,KAAI,CAAE;MACrF;IACF,KAAK,CAAC,MAAM,UAAU,KAAK,KAAK,cAAc,MAAM,IAAI,KAAK,KAAK,MAAM,cAAc,MAAM,KAAK,CAAC;AAEpG,QAAM,mBAAmB,OAAO,WAAW,WAAW,+BAA+B,MAAM,IAAI;AAC/F,QAAM,eACJ,qBAAqB,OACjB,OACA,IAAI,IACF,WAAW,OACR,OACC,CAAC,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OAAO,cAAc,EAAC,CAAE,CAAC;EACvF;AAEA,MAAI,OAAO,WAAW,SAAS,GAAG;AAChC,UAAM,KAAK,+BAA+B,OAAO,OAAO,EAAE,OAAO,8BAA8B,IAAI,KAAK,cAAc,EAAC,CAAE,CAAC;EAC5H;AAEA,SAAO,GAAG,MAAM,KAAK,IAAI,EAAE,QAAO,CAAE;;AACtC","debugId":"19198c42-e182-5131-a1e0-d6421ac4309c"}
@@ -1,8 +1,8 @@
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]="da264eca-4220-5d2e-913b-4b641a4ded5a")}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]="0c02a002-ef0a-50f4-9165-676c2dcfcb8a")}catch(e){}}();
3
3
  import {
4
4
  collectBlockedByIds
5
- } from "./chunk-4EVY7CQN.js";
5
+ } from "./chunk-N6DNM2FA.js";
6
6
  import {
7
7
  buildItemNotFoundError,
8
8
  listAllFrontMatterLight,
@@ -10,20 +10,22 @@ import {
10
10
  mutateItem,
11
11
  readLocatedItem,
12
12
  toItemRecord
13
- } from "./chunk-UYLA5ROU.js";
13
+ } from "./chunk-57C2RLW5.js";
14
14
  import {
15
15
  isTerminalStatus
16
- } from "./chunk-AOP2EMK3.js";
16
+ } from "./chunk-HK72NWAD.js";
17
17
  import {
18
- EXIT_CODE,
19
18
  PmCliError,
19
+ readSettings
20
+ } from "./chunk-US3T3W5J.js";
21
+ import {
22
+ EXIT_CODE,
20
23
  getSettingsPath,
21
24
  pathExists,
22
- readSettings,
23
25
  resolveItemTypeRegistry,
24
26
  resolvePmRoot,
25
27
  resolveRuntimeStatusRegistry
26
- } from "./chunk-SL2ANJSV.js";
28
+ } from "./chunk-YD5FML7K.js";
27
29
 
28
30
  // dist/cli/commands/close.js
29
31
  function toAuthor(candidate, defaultAuthor) {
@@ -39,11 +41,12 @@ function normalizeCloseReason(reasonText, required) {
39
41
  if (required) {
40
42
  throw new PmCliError("Close reason text is required because governance.require_close_reason is enabled", EXIT_CODE.USAGE, {
41
43
  code: "close_reason_required",
42
- required: "Provide a one-line closing summary as the positional text or via --reason.",
44
+ required: "Provide a one-line closing summary as the positional text, --reason, or --message.",
43
45
  why: "governance.require_close_reason is enabled, so every close must record why the item is done.",
44
46
  examples: [
45
47
  'pm close <id> "Done: <what changed and why>"',
46
48
  'pm close <id> --reason "<closing summary>"',
49
+ 'pm close <id> -m "<closing summary>"',
47
50
  "pm close <id> --duplicate-of <canonical-id>"
48
51
  ],
49
52
  nextSteps: [
@@ -55,6 +58,23 @@ function normalizeCloseReason(reasonText, required) {
55
58
  }
56
59
  return void 0;
57
60
  }
61
+ function resolveEffectiveCloseReasonText(input) {
62
+ if ((input.closeReasonText ?? "").trim().length > 0) {
63
+ return input.closeReasonText;
64
+ }
65
+ if (input.duplicateOf !== void 0) {
66
+ return `Duplicate of ${input.duplicateOf}`;
67
+ }
68
+ const trimmedResolution = typeof input.resolution === "string" ? input.resolution.trim() : "";
69
+ if (trimmedResolution.length > 0) {
70
+ return trimmedResolution;
71
+ }
72
+ const trimmedMessage = typeof input.message === "string" ? input.message.trim() : "";
73
+ if (input.requireCloseReason && trimmedMessage.length > 0) {
74
+ return trimmedMessage;
75
+ }
76
+ return input.closeReasonText;
77
+ }
58
78
  var CLOSE_VALIDATION_FIELDS = [
59
79
  { key: "resolution", label: "resolution" },
60
80
  { key: "expected_result", label: "expected_result" },
@@ -375,9 +395,13 @@ async function runClose(id, closeReasonText, options, global) {
375
395
  throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeToFolder);
376
396
  }
377
397
  const duplicateOf = await assertDuplicateTargetExists(pmRoot, settings, options.duplicateOf, id);
378
- const hasExplicitReason = (closeReasonText ?? "").trim().length > 0;
379
- const trimmedResolution = typeof options.resolution === "string" ? options.resolution.trim() : "";
380
- const effectiveCloseReasonText = hasExplicitReason ? closeReasonText : duplicateOf !== void 0 ? `Duplicate of ${duplicateOf}` : trimmedResolution.length > 0 ? trimmedResolution : closeReasonText;
398
+ const effectiveCloseReasonText = resolveEffectiveCloseReasonText({
399
+ closeReasonText,
400
+ duplicateOf,
401
+ resolution: options.resolution,
402
+ message: options.message,
403
+ requireCloseReason: settings.governance.require_close_reason
404
+ });
381
405
  const closeReason = normalizeCloseReason(effectiveCloseReasonText, settings.governance.require_close_reason);
382
406
  const validateCloseMode = parseValidateCloseMode(options.validateClose) ?? settings.governance.close_validation_default;
383
407
  const activeChildIds = await findActiveChildIds(pmRoot, settings, id, statusRegistry);
@@ -415,6 +439,6 @@ export {
415
439
  _testOnlyCloseCommand,
416
440
  runClose
417
441
  };
418
- //# sourceMappingURL=chunk-WBWRQS32.js.map
442
+ //# sourceMappingURL=chunk-K3AGVXSF.js.map
419
443
 
420
- //# debugId=da264eca-4220-5d2e-913b-4b641a4ded5a
444
+ //# debugId=0c02a002-ef0a-50f4-9165-676c2dcfcb8a
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/close.ts"],"sourcesContent":["/**\n * @module cli/commands/close\n *\n * Implements the pm close command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { collectBlockedByIds } from \"../../core/item/actionability.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport {\n buildItemNotFoundError,\n listAllFrontMatterLight,\n locateItem,\n mutateItem,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter } from \"../../types/index.js\";\n\n/**\n * Documents the close command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseCommandOptions {\n author?: string;\n message?: string;\n validateClose?: string;\n force?: boolean;\n // pm-fl0c #11 (2026-05-28): allow setting the three closure validation\n // fields inline on `pm close` so agents do not have to issue a prior\n // `pm update` just to satisfy --validate-close warn|strict. These map 1:1\n // to ItemFrontMatter.{resolution,expected_result,actual_result}.\n resolution?: string;\n expectedResult?: string;\n actualResult?: string;\n duplicateOf?: string;\n}\n\n/**\n * Documents the close result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseResult {\n item: Record<string, unknown>;\n changed_fields: string[];\n warnings: string[];\n}\n\ninterface AutoUnblockCandidate {\n id: string;\n blocker_ids: string[];\n}\n\ntype CloseInlineFieldKey = \"resolution\" | \"expected_result\" | \"actual_result\";\n\ninterface CloseMutationContext {\n statusRegistry: RuntimeStatusRegistry;\n force: boolean | undefined;\n options: CloseCommandOptions;\n duplicateOf: string | undefined;\n validateCloseMode: ValidateCloseMode;\n activeChildIds: string[];\n closeReason: string | undefined;\n}\n\nfunction toAuthor(candidate: string | undefined, defaultAuthor: string): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed || \"unknown\";\n}\n\nfunction normalizeCloseReason(reasonText: string | undefined, required: boolean): string | undefined {\n const reason = (reasonText ?? \"\").trim();\n if (reason.length > 0) {\n return reason;\n }\n if (required) {\n throw new PmCliError(\n \"Close reason text is required because governance.require_close_reason is enabled\",\n EXIT_CODE.USAGE,\n {\n code: \"close_reason_required\",\n required: \"Provide a one-line closing summary as the positional text, --reason, or --message.\",\n why: \"governance.require_close_reason is enabled, so every close must record why the item is done.\",\n examples: [\n 'pm close <id> \"Done: <what changed and why>\"',\n 'pm close <id> --reason \"<closing summary>\"',\n 'pm close <id> -m \"<closing summary>\"',\n \"pm close <id> --duplicate-of <canonical-id>\",\n ],\n nextSteps: [\n \"Re-run the close with a closing summary.\",\n 'When closing as a duplicate, --duplicate-of <id> auto-fills the close reason as \"Duplicate of <id>\".',\n \"To stop requiring reasons, run: pm config set governance-require-close-reason --policy disabled\",\n ],\n },\n );\n }\n return undefined;\n}\n\ntype ValidateCloseMode = \"off\" | \"warn\" | \"strict\";\n\ninterface CloseReasonFallbackInput {\n closeReasonText: string | undefined;\n duplicateOf: string | undefined;\n resolution: string | undefined;\n message: string | undefined;\n requireCloseReason: boolean;\n}\n\nfunction resolveEffectiveCloseReasonText(input: CloseReasonFallbackInput): string | undefined {\n if ((input.closeReasonText ?? \"\").trim().length > 0) {\n return input.closeReasonText;\n }\n if (input.duplicateOf !== undefined) {\n return `Duplicate of ${input.duplicateOf}`;\n }\n const trimmedResolution = typeof input.resolution === \"string\" ? input.resolution.trim() : \"\";\n if (trimmedResolution.length > 0) {\n return trimmedResolution;\n }\n const trimmedMessage = typeof input.message === \"string\" ? input.message.trim() : \"\";\n if (input.requireCloseReason && trimmedMessage.length > 0) {\n return trimmedMessage;\n }\n return input.closeReasonText;\n}\n\nconst CLOSE_VALIDATION_FIELDS: Array<{ key: keyof Pick<ItemFrontMatter, \"resolution\" | \"expected_result\" | \"actual_result\">; label: string }> = [\n { key: \"resolution\", label: \"resolution\" },\n { key: \"expected_result\", label: \"expected_result\" },\n { key: \"actual_result\", label: \"actual_result\" },\n];\n\nfunction parseValidateCloseMode(raw: string | undefined): ValidateCloseMode | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized.length === 0 || normalized === \"warn\") {\n return \"warn\";\n }\n if (normalized === \"off\" || normalized === \"none\" || normalized === \"disabled\") {\n return \"off\";\n }\n if (normalized === \"strict\") {\n return \"strict\";\n }\n throw new PmCliError(`Invalid --validate-close mode \"${raw}\" (expected \"off\", \"warn\", or \"strict\")`, EXIT_CODE.USAGE);\n}\n\nfunction findMissingCloseValidationFields(frontMatter: ItemFrontMatter): string[] {\n const missing: string[] = [];\n for (const field of CLOSE_VALIDATION_FIELDS) {\n const rawValue = frontMatter[field.key];\n if (typeof rawValue !== \"string\" || rawValue.trim().length === 0) {\n missing.push(field.label);\n }\n }\n return missing;\n}\n\nasync function duplicateChainReferencesClosingItem(\n loadItemById: (id: string) => Promise<ItemFrontMatter | null>,\n initialDuplicateOf: unknown,\n closingId: string,\n): Promise<boolean> {\n const visited = new Set<string>();\n let current = initialDuplicateOf;\n while (typeof current === \"string\" && current.trim().length > 0) {\n const currentId = current.trim();\n if (currentId === closingId) {\n return true;\n }\n if (visited.has(currentId)) {\n return false;\n }\n visited.add(currentId);\n current = (await loadItemById(currentId))?.duplicate_of;\n }\n return false;\n}\n\nfunction shouldApplyDuplicateFallback(value: unknown): boolean {\n return typeof value !== \"string\" || value.trim().length === 0;\n}\n\nasync function assertDuplicateTargetExists(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n duplicateOf: string | undefined,\n closingId: string,\n): Promise<string | undefined> {\n const rawTarget = duplicateOf?.trim();\n if (!rawTarget) {\n return undefined;\n }\n if (rawTarget === closingId) {\n throw new PmCliError(\"An item cannot be closed as a duplicate of itself.\", EXIT_CODE.USAGE, {\n code: \"duplicate_target_self\",\n why: \"--duplicate-of must identify the canonical item that should remain open or already represent the work.\",\n });\n }\n const typeRegistry = resolveItemTypeRegistry(settings);\n const itemCache = new Map<string, ItemFrontMatter | null>();\n const loadItemById = async (id: string): Promise<ItemFrontMatter | null> => {\n if (itemCache.has(id)) {\n return itemCache.get(id) ?? null;\n }\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n itemCache.set(id, null);\n return null;\n }\n const { document } = await readLocatedItem(located, { schema: settings.schema });\n itemCache.set(id, document.metadata);\n return document.metadata;\n };\n const target = await loadItemById(rawTarget);\n if (!target) {\n throw new PmCliError(`Duplicate target \"${rawTarget}\" was not found. Create or locate the canonical item first.`, EXIT_CODE.USAGE, {\n code: \"duplicate_target_missing\",\n why: \"Duplicate closure should point at a real canonical pm item so future dedupe and changelog tooling can trace the relationship.\",\n examples: [`pm close ${closingId} \"Duplicate of ${rawTarget}\" --duplicate-of ${rawTarget}`],\n nextSteps: [\"Run pm search/list to find the canonical item, then retry with --duplicate-of <id>.\"],\n });\n }\n if (await duplicateChainReferencesClosingItem(loadItemById, target.duplicate_of, closingId)) {\n throw new PmCliError(`Circular duplicate reference detected. Target \"${rawTarget}\" points back to \"${closingId}\".`, EXIT_CODE.USAGE, {\n code: \"duplicate_target_circular\",\n why: \"Circular duplicate relationships create loops for dedupe and status propagation tooling.\",\n nextSteps: [\"Choose the existing canonical item, or clear the target duplicate_of metadata before closing this item as a duplicate.\"],\n });\n }\n if (typeof target.duplicate_of === \"string\" && target.duplicate_of.trim().length > 0) {\n throw new PmCliError(`Duplicate target \"${rawTarget}\" is already marked as a duplicate of \"${target.duplicate_of.trim()}\".`, EXIT_CODE.USAGE, {\n code: \"duplicate_target_is_duplicate\",\n why: \"Duplicate closure should point directly at the canonical item, not another duplicate.\",\n examples: [`pm close ${closingId} \"Duplicate of ${target.duplicate_of.trim()}\" --duplicate-of ${target.duplicate_of.trim()}`],\n nextSteps: [\"Use the canonical item referenced by duplicate_of as the --duplicate-of target.\"],\n });\n }\n return target.id;\n}\n\nasync function findActiveChildIds(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n parentId: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<string[]> {\n const typeRegistry = resolveItemTypeRegistry(settings);\n const items = await listAllFrontMatterLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n return items\n .filter((item) => item.parent === parentId && !isTerminalStatus(item.status, statusRegistry))\n .map((item) => item.id)\n .sort((left, right) => left.localeCompare(right));\n}\n\nasync function findAutoUnblockCandidates(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n closedId: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<AutoUnblockCandidate[]> {\n const typeRegistry = resolveItemTypeRegistry(settings);\n const items = await listAllFrontMatterLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const itemsById = new Map(items.map((item) => [item.id, item]));\n const blockedStatuses = statusRegistry.blocked_statuses;\n return items\n .filter((item) => blockedStatuses.has(item.status))\n .map((item) => ({ item, blockerIds: collectBlockedByIds(item) }))\n .filter(({ blockerIds }) => blockerIds.includes(closedId))\n .filter(({ blockerIds }) =>\n blockerIds.every((blockerId) => {\n const blocker = itemsById.get(blockerId);\n return blocker !== undefined && isTerminalStatus(blocker.status, statusRegistry);\n }),\n )\n .map(({ item, blockerIds }) => ({ id: item.id, blocker_ids: blockerIds }))\n .sort((left, right) => left.id.localeCompare(right.id));\n}\n\nasync function autoUnblockResolvedDependents(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n closedId: string,\n author: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<string[]> {\n const candidates = await findAutoUnblockCandidates(pmRoot, settings, closedId, statusRegistry);\n const warnings: string[] = [];\n for (const candidate of candidates) {\n try {\n const unblocked = await mutateItem({\n pmRoot,\n settings,\n id: candidate.id,\n op: \"update\",\n author,\n message: `Auto-unblocked after blocker ${closedId} closed`,\n mutate(document) {\n /* c8 ignore start -- normal auto-unblock candidates carry dependency metadata; fallback preserves hand-edited scalar-only blockers. */\n const dependencies = document.metadata.dependencies ?? [];\n /* c8 ignore stop */\n const remainingDependencies = dependencies.filter((dependency) => {\n const dependencyId = dependency.id.trim();\n return dependency.kind !== \"blocked_by\" || !candidate.blocker_ids.includes(dependencyId);\n });\n document.metadata.status = statusRegistry.open_status;\n delete document.metadata.blocked_by;\n delete document.metadata.blocked_reason;\n document.metadata.unblock_note = `Auto-unblocked after blocker ${closedId} closed; all blockers resolved (${candidate.blocker_ids.join(\", \")}).`;\n if (remainingDependencies.length > 0) {\n document.metadata.dependencies = remainingDependencies;\n } else {\n delete document.metadata.dependencies;\n }\n const changedFields = [\"status\", \"blocked_by\", \"blocked_reason\", \"unblock_note\"];\n if (remainingDependencies.length !== dependencies.length) {\n changedFields.push(\"dependencies\");\n }\n return {\n changedFields,\n };\n },\n });\n warnings.push(`auto_unblocked:${unblocked.item.id}:resolved_blockers=${candidate.blocker_ids.join(\",\")}`);\n /* c8 ignore start -- defensive fan-out failure path; normal lock/claim state is auditable and still unblocks. */\n } catch (error) {\n const reason = error instanceof Error ? error.message.replace(/\\s+/g, \" \").trim() : \"unknown\";\n warnings.push(`auto_unblock_failed:${candidate.id}:${reason}`);\n }\n /* c8 ignore stop */\n }\n return warnings;\n}\n\nfunction applyInlineCloseFields(metadata: ItemFrontMatter, options: CloseCommandOptions): CloseInlineFieldKey[] {\n const changedFields: CloseInlineFieldKey[] = [];\n const inlineCloseFields: Array<{ option: string | undefined; key: CloseInlineFieldKey }> = [\n { option: options.resolution, key: \"resolution\" },\n { option: options.expectedResult, key: \"expected_result\" },\n { option: options.actualResult, key: \"actual_result\" },\n ];\n for (const { option, key } of inlineCloseFields) {\n if (typeof option !== \"string\") {\n continue;\n }\n const trimmed = option.trim();\n if (trimmed.length === 0) {\n continue;\n }\n metadata[key] = trimmed;\n changedFields.push(key);\n }\n return changedFields;\n}\n\nfunction applyDuplicateCloseMetadata(metadata: ItemFrontMatter, duplicateOf: string | undefined): CloseInlineFieldKey[] {\n if (duplicateOf === undefined) {\n return [];\n }\n metadata.duplicate_of = duplicateOf;\n const duplicateFallbackFields: CloseInlineFieldKey[] = [];\n const fallbackValues: Array<{ key: CloseInlineFieldKey; value: string }> = [\n { key: \"resolution\", value: `Duplicate of ${duplicateOf}` },\n { key: \"expected_result\", value: `Canonical item ${duplicateOf} tracks the work.` },\n { key: \"actual_result\", value: `Closed as duplicate of ${duplicateOf}.` },\n ];\n for (const { key, value } of fallbackValues) {\n if (shouldApplyDuplicateFallback(metadata[key])) {\n metadata[key] = value;\n duplicateFallbackFields.push(key);\n }\n }\n return duplicateFallbackFields;\n}\n\nfunction collectCloseValidationWarnings(\n metadata: ItemFrontMatter,\n validateCloseMode: ValidateCloseMode,\n activeChildIds: string[],\n): string[] {\n const warnings: string[] = [];\n if (validateCloseMode !== \"off\") {\n const missingFields = findMissingCloseValidationFields(metadata);\n if (missingFields.length > 0) {\n if (validateCloseMode === \"strict\") {\n throw new PmCliError(\n `Cannot close item ${metadata.id}: missing ${missingFields.join(\", \")}. Populate fields or use --validate-close warn.`,\n EXIT_CODE.USAGE,\n );\n }\n warnings.push(`close_validation_missing_fields:${metadata.id}:${missingFields.join(\",\")}`);\n }\n if (activeChildIds.length > 0) {\n if (validateCloseMode === \"strict\") {\n throw new PmCliError(\n `Cannot close item ${metadata.id}: active child items remain open (${activeChildIds.join(\", \")}). Close, cancel, or re-parent them first, or use --validate-close warn.`,\n EXIT_CODE.USAGE,\n );\n }\n warnings.push(`close_validation_active_children:${metadata.id}:${activeChildIds.join(\",\")}`);\n }\n return warnings;\n }\n if (activeChildIds.length > 0) {\n warnings.push(`closed_with_active_children:${metadata.id}:${activeChildIds.join(\",\")}`);\n }\n return warnings;\n}\n\nfunction applyCloseReason(metadata: ItemFrontMatter, closeReason: string | undefined): string[] {\n if (closeReason !== undefined) {\n metadata.close_reason = closeReason;\n return [\"close_reason\"];\n }\n if (metadata.close_reason !== undefined) {\n delete metadata.close_reason;\n return [\"close_reason\"];\n }\n return [];\n}\n\nfunction clearCloseAssignee(metadata: ItemFrontMatter): string[] {\n if (metadata.assignee === undefined) {\n return [];\n }\n delete metadata.assignee;\n return [\"assignee\"];\n}\n\nfunction clearClosedBlockerSignals(metadata: ItemFrontMatter): { changedFields: string[]; warnings: string[] } {\n const previousBlockedBy = typeof metadata.blocked_by === \"string\" ? metadata.blocked_by.trim() : \"\";\n const existingDeps = metadata.dependencies ?? [];\n const blockedByEdge = existingDeps.find((dep) => dep.kind === \"blocked_by\");\n const hadBlockedReason = metadata.blocked_reason !== undefined;\n if (previousBlockedBy.length === 0 && blockedByEdge === undefined && !hadBlockedReason) {\n return { changedFields: [], warnings: [] };\n }\n const changedFields: string[] = [];\n if (previousBlockedBy.length > 0) {\n delete metadata.blocked_by;\n changedFields.push(\"blocked_by\");\n }\n if (hadBlockedReason) {\n delete metadata.blocked_reason;\n changedFields.push(\"blocked_reason\");\n }\n if (blockedByEdge !== undefined) {\n const remainingDeps = existingDeps.filter((dep) => dep.kind !== \"blocked_by\");\n if (remainingDeps.length > 0) {\n metadata.dependencies = remainingDeps;\n } else {\n delete metadata.dependencies;\n }\n changedFields.push(\"dependencies\");\n }\n // A stale reason-only close has no blocker identity; omit the blocker-clear warning instead of inventing one.\n const reportedBlocker = previousBlockedBy || blockedByEdge?.id;\n return {\n changedFields,\n warnings: reportedBlocker ? [`closed_cleared_blocked_by:${metadata.id}:${reportedBlocker}`] : [],\n };\n}\n\nfunction mutateCloseMetadata(metadata: ItemFrontMatter, context: CloseMutationContext): { changedFields: string[]; warnings?: string[] } {\n if (isTerminalStatus(metadata.status, context.statusRegistry) && !context.force) {\n throw new PmCliError(`Item ${metadata.id} is already terminal; use --force to close again.`, EXIT_CODE.CONFLICT);\n }\n const inlineChangedFields = applyInlineCloseFields(metadata, context.options);\n const duplicateFallbackFields = applyDuplicateCloseMetadata(metadata, context.duplicateOf);\n const mutationWarnings = collectCloseValidationWarnings(metadata, context.validateCloseMode, context.activeChildIds);\n metadata.status = context.statusRegistry.close_status;\n const changedFields = [\n \"status\",\n ...applyCloseReason(metadata, context.closeReason),\n ...inlineChangedFields,\n ];\n if (context.duplicateOf !== undefined) {\n changedFields.push(\"duplicate_of\");\n for (const key of duplicateFallbackFields) {\n /* v8 ignore start -- duplicate fallback keys are already pre-deduped by applyDuplicateCloseMetadata in covered close paths */\n if (!changedFields.includes(key)) {\n changedFields.push(key);\n }\n /* v8 ignore stop */\n }\n }\n changedFields.push(...clearCloseAssignee(metadata));\n const blockerCleanup = clearClosedBlockerSignals(metadata);\n changedFields.push(...blockerCleanup.changedFields);\n mutationWarnings.push(...blockerCleanup.warnings);\n return {\n changedFields,\n ...(mutationWarnings.length > 0 ? { warnings: mutationWarnings } : {}),\n };\n}\n\nexport const _testOnlyCloseCommand = {\n blockedByIds: collectBlockedByIds,\n};\n\n/**\n * Implements run close for the public runtime surface of this module.\n */\nexport async function runClose(\n id: string,\n closeReasonText: string | undefined,\n options: CloseCommandOptions,\n global: GlobalOptions,\n): Promise<CloseResult> {\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\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const author = toAuthor(options.author, settings.author_default);\n // GH-250: verify the target item EXISTS before the governance close-reason\n // gate fires. Otherwise closing a typo'd id with no reason reports\n // \"Close reason text is required\" and hides the real cause (bad id) until a\n // reason is supplied. Existence is the more fundamental precondition, so it\n // is validated first regardless of whether a reason was provided.\n const typeToFolder = resolveItemTypeRegistry(settings).type_to_folder;\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeToFolder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeToFolder);\n }\n // GH-204: resolve the duplicate target BEFORE reason validation so\n // `pm close <id> --duplicate-of <canonical>` succeeds under\n // governance.require_close_reason without a manual reason — when no\n // positional/--reason text is provided the reason defaults to\n // \"Duplicate of <id>\" (mirroring the auto-filled closure metadata).\n // Explicit reason text still wins.\n const duplicateOf = await assertDuplicateTargetExists(pmRoot, settings, options.duplicateOf, id);\n // pm-7x8d / pm-9hry / GH-204: when no explicit positional/--reason text is given, derive\n // the close reason from the next-best closure signal instead of hard-blocking\n // under governance.require_close_reason. Precedence: explicit reason text >\n // --duplicate-of (\"Duplicate of <id>\") > --resolution summary > --message.\n // Resolution still writes metadata.resolution below; message still writes the\n // history entry through mutateItem. Reusing either as the close reason just lets\n // a single agent-authored close command succeed when it already supplied a\n // closure summary through another structured option.\n const effectiveCloseReasonText = resolveEffectiveCloseReasonText({\n closeReasonText,\n duplicateOf,\n resolution: options.resolution,\n message: options.message,\n requireCloseReason: settings.governance.require_close_reason,\n });\n const closeReason = normalizeCloseReason(effectiveCloseReasonText, settings.governance.require_close_reason);\n const validateCloseMode = parseValidateCloseMode(options.validateClose) ?? settings.governance.close_validation_default;\n // C3 (pm-fu5d): scan for active children even under minimal governance so\n // closing a parent is never silently orphaning — off mode emits an\n // informational note instead of the warn/strict validation warning.\n const activeChildIds = await findActiveChildIds(pmRoot, settings, id, statusRegistry);\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"close\",\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n return mutateCloseMetadata(document.metadata, {\n statusRegistry,\n force: options.force,\n options,\n duplicateOf,\n validateCloseMode,\n activeChildIds,\n closeReason,\n });\n },\n });\n\n return {\n item: toItemRecord(result.item),\n changed_fields: result.changedFields,\n warnings: [\n ...result.warnings,\n ...(await autoUnblockResolvedDependents(pmRoot, settings, located.id, author, statusRegistry)),\n ],\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,SAAS,SAAS,WAA+B,eAAqB;AACpE,QAAM,WAAW,aAAa,QAAQ,IAAI,aAAa;AACvD,QAAM,UAAU,SAAS,KAAI;AAC7B,SAAO,WAAW;AACpB;AAEA,SAAS,qBAAqB,YAAgC,UAAiB;AAC7E,QAAM,UAAU,cAAc,IAAI,KAAI;AACtC,MAAI,OAAO,SAAS,GAAG;AACrB,WAAO;EACT;AACA,MAAI,UAAU;AACZ,UAAM,IAAI,WACR,oFAC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uB,QAAQ,IAAI,SAAS,WAAW,YAAY;EACjF;AAOA,QAAM,cAAc,MAAM,4BAA4B,QAAQ,UAAU,QAAQ,aAAa,EAAE;AAS/F,QAAM,2BAA2B,gCAAgC;IAC/D;IACA;IACA,YAAY,QAAQ;IACpB,SAAS,QAAQ;IACjB,oBAAoB,SAAS,WAAW;GACzC;AACD,QAAM,cAAc,qBAAqB,0BAA0B,SAAS,WAAW,oBAAoB;AAC3G,QAAM,oBAAoB,uBAAuB,QAAQ,aAAa,KAAK,SAAS,WAAW;AAI/F,QAAM,iBAAiB,MAAM,mBAAmB,QAAQ,UAAU,IAAI,cAAc;AAEpF,QAAM,SAAS,MAAM,WAAW;IAC9B;IACA;IACA;IACA,IAAI;IACJ;IACA,SAAS,QAAQ;IACjB,OAAO,QAAQ;IACf,OAAO,UAAQ;AACb,aAAO,oBAAoB,SAAS,UAAU;QAC5C;QACA,OAAO,QAAQ;QACf;QACA;QACA;QACA;QACA;OACD;IACH;GACD;AAED,SAAO;IACL,MAAM,aAAa,OAAO,IAAI;IAC9B,gBAAgB,OAAO;IACvB,UAAU;MACR,GAAG,OAAO;MACV,GAAI,MAAM,8BAA8B,QAAQ,UAAU,QAAQ,IAAI,QAAQ,cAAc;;;AAGlG","debugId":"0c02a002-ef0a-50f4-9165-676c2dcfcb8a"}
@@ -0,0 +1,79 @@
1
+ import {
2
+ normalizeExtensionNameForMatch
3
+ } from "./chunk-R3ZBLGTC.js";
4
+ import {
5
+ describeExtensionActivation,
6
+ renderExtensionSurfaceMarkdown
7
+ } from "./chunk-C3PMDWGX.js";
8
+
9
+ // dist/cli/commands/extension/describe.js
10
+ !(function() {
11
+ try {
12
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
13
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a0c1f4a6-427b-5cd4-bf6e-9bf77f83bf3f");
14
+ } catch (e2) {
15
+ }
16
+ })();
17
+ function layerNameKey(layer, name) {
18
+ return `${layer}:${normalizeExtensionNameForMatch(name)}`;
19
+ }
20
+ function buildExtensionDescribeResult(target, loadResult, activationResult) {
21
+ const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));
22
+ const candidates = [
23
+ ...loadResult.loaded.map((entry) => ({
24
+ name: entry.name,
25
+ layer: entry.layer,
26
+ version: entry.version,
27
+ activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name)) ? "failed" : "ok",
28
+ surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
29
+ })),
30
+ ...loadResult.failed.map((entry) => ({
31
+ name: entry.name,
32
+ layer: entry.layer,
33
+ version: "unknown",
34
+ activation_status: "not_loaded",
35
+ surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
36
+ }))
37
+ ].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));
38
+ const normalizedTarget = typeof target === "string" ? normalizeExtensionNameForMatch(target) : null;
39
+ const matchedNames = normalizedTarget === null ? null : new Set(loadResult.loaded.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizedTarget || typeof entry.source_package === "string" && normalizeExtensionNameForMatch(entry.source_package) === normalizedTarget).map((entry) => normalizeExtensionNameForMatch(entry.name)).concat(normalizedTarget));
40
+ const extensions = matchedNames === null ? candidates : candidates.filter((entry) => matchedNames.has(normalizeExtensionNameForMatch(entry.name)));
41
+ const unionOptions = matchedNames === null ? {} : { extensionNames: [...matchedNames] };
42
+ return {
43
+ target: typeof target === "string" ? target.trim() : null,
44
+ total: extensions.length,
45
+ extensions,
46
+ union: describeExtensionActivation(activationResult, unionOptions)
47
+ };
48
+ }
49
+ var ACTIVATION_STATUS_LABELS = {
50
+ ok: "loaded",
51
+ failed: "activation failed",
52
+ not_loaded: "not loaded"
53
+ };
54
+ function renderExtensionDescribeMarkdown(result, noun) {
55
+ const titleNoun = `${noun[0].toUpperCase()}${noun.slice(1)}`;
56
+ const lines = [`# ${titleNoun} surface reference`, ""];
57
+ lines.push(result.target === null ? `Scope: all loaded ${noun}s` : `Scope: \`${result.target}\``);
58
+ lines.push(`Described: ${result.total} ${noun}${result.total === 1 ? "" : "s"}`, "");
59
+ if (result.extensions.length === 0) {
60
+ lines.push(`_No ${noun}s are loaded._`, "");
61
+ return `${lines.join("\n").trimEnd()}
62
+ `;
63
+ }
64
+ for (const entry of result.extensions) {
65
+ const title = `${entry.name} (${entry.layer} v${entry.version}, ${ACTIVATION_STATUS_LABELS[entry.activation_status]})`;
66
+ lines.push(renderExtensionSurfaceMarkdown(entry.surfaces, { title, headingLevel: 2 }));
67
+ }
68
+ if (result.extensions.length > 1) {
69
+ lines.push(renderExtensionSurfaceMarkdown(result.union, { title: `Union across all described ${noun}s`, headingLevel: 2 }));
70
+ }
71
+ return `${lines.join("\n").trimEnd()}
72
+ `;
73
+ }
74
+
75
+ export {
76
+ buildExtensionDescribeResult,
77
+ renderExtensionDescribeMarkdown
78
+ };
79
+ //# sourceMappingURL=chunk-KDZ6K25I.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../cli/commands/extension/describe.ts"],
4
+ "sourcesContent": ["/**\n * @module cli/commands/extension/describe\n *\n * Builds the `pm extension describe` / `pm package describe` payload: a flat,\n * by-name map of every surface each loaded extension registered.\n *\n * The SDK already ships {@link describeExtensionActivation} -- the `describe`\n * (enumerate-all) verb that complements the `assert*` (verify-one) and `run*`\n * (invoke-one) testing helpers -- but until now it was reachable only from a test\n * that hand-built an {@link ExtensionActivationResult}. This module is the thin\n * orchestration that lets an agent at the CLI (or over MCP) ask \"what does this\n * installed extension add to my context?\" in one call, instead of stitching\n * together `doctor` (errors), `manage` (update metadata), and a manifest read.\n *\n * It is intentionally pure: the caller performs the load+activate cycle (exactly\n * as `explore`/`doctor` already do) and hands the results here, so the same\n * builder is trivially unit-testable against synthetic activations.\n */\nimport { describeExtensionActivation, type ExtensionActivationSummary } from \"../../../core/extensions/activation-summary.js\";\nimport { renderExtensionSurfaceMarkdown } from \"../../../core/extensions/activation-summary-markdown.js\";\nimport type { ExtensionActivationResult, ExtensionLayer, ExtensionLoadResult } from \"../../../core/extensions/loader.js\";\nimport { normalizeExtensionNameForMatch } from \"./shared.js\";\n\n/**\n * Runtime state of a described extension. `ok` loaded and activated cleanly,\n * `failed` loaded but threw during `activate`, and `not_loaded` failed to import\n * at all -- the latter two register nothing, so their `surfaces` are empty and\n * the status explains why (rather than implying the extension contributes\n * nothing).\n */\nexport type ExtensionDescribeActivationStatus = \"ok\" | \"failed\" | \"not_loaded\";\n\n/**\n * One extension's contribution to the workspace: its identity plus the\n * {@link ExtensionActivationSummary} of every surface it registered.\n *\n * `surfaces` is matched by extension *name* (mirroring\n * {@link describeExtensionActivation}'s name filter), so when the same name is\n * loaded in both the project and global layers each entry reflects that name's\n * combined surfaces -- the `layer`/`version` fields still distinguish the\n * physical entries.\n */\nexport interface ExtensionSurfaceDescription {\n name: string;\n layer: ExtensionLayer;\n version: string;\n activation_status: ExtensionDescribeActivationStatus;\n surfaces: ExtensionActivationSummary;\n}\n\n/**\n * Result of {@link buildExtensionDescribeResult}: the per-extension surface maps\n * plus a deduplicated `union` across the described set. `target` echoes the\n * requested name filter (or `null` for the whole workspace) and `total` counts\n * the described entries so callers need not re-measure `extensions`.\n */\nexport interface ExtensionDescribeResult {\n target: string | null;\n total: number;\n extensions: ExtensionSurfaceDescription[];\n union: ExtensionActivationSummary;\n}\n\n/**\n * Compose a collision-free identity key for an extension from its layer and\n * normalized name. The two parts are joined with a colon; the layer prefix is\n * always a colon-free enum value, so distinct (layer, name) pairs never collide\n * even when a name itself contains a colon.\n */\nfunction layerNameKey(layer: ExtensionLayer, name: string): string {\n return `${layer}:${normalizeExtensionNameForMatch(name)}`;\n}\n\n/**\n * Summarize, by name, every registration surface the loaded extensions exercised.\n *\n * Walks `loadResult.loaded` (annotating each with `failed` when its layer+name is\n * in `activationResult.failed`) and `loadResult.failed` (as `not_loaded`), sorts\n * the entries by name then layer for deterministic output, and attaches each\n * extension's {@link describeExtensionActivation} summary. When `target` is\n * provided only the case-insensitively matching extensions are described and the\n * `union` is scoped to that resolved name set; otherwise every loaded extension contributes.\n * A target may name either the extension itself or its source npm package\n * (`source_package`), so agents can reuse the `package_name` values surfaced by\n * `pm extension list` / install discovery without a second lookup. An unmatched\n * `target` yields an empty `extensions` array -- the caller decides whether that\n * is a not-found error.\n */\nexport function buildExtensionDescribeResult(\n target: string | undefined,\n loadResult: ExtensionLoadResult,\n activationResult: ExtensionActivationResult,\n): ExtensionDescribeResult {\n const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));\n const candidates: ExtensionSurfaceDescription[] = [\n ...loadResult.loaded.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: entry.version,\n activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name))\n ? (\"failed\" as const)\n : (\"ok\" as const),\n surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),\n })),\n ...loadResult.failed.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: \"unknown\",\n activation_status: \"not_loaded\" as const,\n surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),\n })),\n ].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));\n\n const normalizedTarget = typeof target === \"string\" ? normalizeExtensionNameForMatch(target) : null;\n const matchedNames =\n normalizedTarget === null\n ? null\n : new Set(\n loadResult.loaded\n .filter(\n (entry) =>\n normalizeExtensionNameForMatch(entry.name) === normalizedTarget ||\n (typeof entry.source_package === \"string\" &&\n normalizeExtensionNameForMatch(entry.source_package) === normalizedTarget),\n )\n .map((entry) => normalizeExtensionNameForMatch(entry.name))\n .concat(normalizedTarget),\n );\n const extensions =\n matchedNames === null ? candidates : candidates.filter((entry) => matchedNames.has(normalizeExtensionNameForMatch(entry.name)));\n const unionOptions =\n matchedNames === null\n ? {}\n : { extensionNames: [...matchedNames] };\n\n return {\n target: typeof target === \"string\" ? target.trim() : null,\n total: extensions.length,\n extensions,\n union: describeExtensionActivation(activationResult, unionOptions),\n };\n}\n\n/**\n * Human-readable label for each {@link ExtensionDescribeActivationStatus}, used\n * in the Markdown per-extension heading so a reader sees *why* an entry has no\n * surfaces (activation failed / never loaded) rather than assuming it\n * contributes nothing.\n */\nconst ACTIVATION_STATUS_LABELS: Record<ExtensionDescribeActivationStatus, string> = {\n ok: \"loaded\",\n failed: \"activation failed\",\n not_loaded: \"not loaded\",\n};\n\n/**\n * Render an {@link ExtensionDescribeResult} as a Markdown reference document: a\n * top-level title and scope line, one section per described extension (titled\n * with its identity and activation status), and — only when more than one\n * extension was described — a final union section spanning them all. Each\n * extension and the union are rendered with the shared\n * {@link renderExtensionSurfaceMarkdown} primitive at heading level 2, so the\n * document nests cleanly under the level-1 title.\n *\n * `noun` is the lifecycle vocabulary (`\"extension\"` or `\"package\"`) so the prose\n * matches the command the agent invoked. When no extensions match (an unmatched\n * target is already a not-found error upstream, so this is the \"nothing loaded\"\n * case) the document is the title plus a single explanatory note.\n */\nexport function renderExtensionDescribeMarkdown(result: ExtensionDescribeResult, noun: string): string {\n const titleNoun = `${noun[0]!.toUpperCase()}${noun.slice(1)}`;\n const lines = [`# ${titleNoun} surface reference`, \"\"];\n lines.push(result.target === null ? `Scope: all loaded ${noun}s` : `Scope: \\`${result.target}\\``);\n lines.push(`Described: ${result.total} ${noun}${result.total === 1 ? \"\" : \"s\"}`, \"\");\n\n if (result.extensions.length === 0) {\n lines.push(`_No ${noun}s are loaded._`, \"\");\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n }\n\n for (const entry of result.extensions) {\n const title = `${entry.name} (${entry.layer} v${entry.version}, ${ACTIVATION_STATUS_LABELS[entry.activation_status]})`;\n // renderExtensionSurfaceMarkdown already ends with a newline; the join adds a\n // single blank line between sections, so no extra \"\" separator is pushed.\n lines.push(renderExtensionSurfaceMarkdown(entry.surfaces, { title, headingLevel: 2 }));\n }\n\n if (result.extensions.length > 1) {\n lines.push(renderExtensionSurfaceMarkdown(result.union, { title: `Union across all described ${noun}s`, headingLevel: 2 }));\n }\n\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAqEA,SAAS,aAAa,OAAuB,MAAY;AACvD,SAAO,GAAG,KAAK,IAAI,+BAA+B,IAAI,CAAC;AACzD;AAiBM,SAAU,6BACd,QACA,YACA,kBAA2C;AAE3C,QAAM,uBAAuB,IAAI,IAAI,iBAAiB,OAAO,IAAI,CAAC,UAAU,aAAa,MAAM,OAAO,MAAM,IAAI,CAAC,CAAC;AAClH,QAAM,aAA4C;IAChD,GAAG,WAAW,OAAO,IAAI,CAAC,WAAW;MACnC,MAAM,MAAM;MACZ,OAAO,MAAM;MACb,SAAS,MAAM;MACf,mBAAmB,qBAAqB,IAAI,aAAa,MAAM,OAAO,MAAM,IAAI,CAAC,IAC5E,WACA;MACL,UAAU,4BAA4B,kBAAkB,EAAE,eAAe,MAAM,KAAI,CAAE;MACrF;IACF,GAAG,WAAW,OAAO,IAAI,CAAC,WAAW;MACnC,MAAM,MAAM;MACZ,OAAO,MAAM;MACb,SAAS;MACT,mBAAmB;MACnB,UAAU,4BAA4B,kBAAkB,EAAE,eAAe,MAAM,KAAI,CAAE;MACrF;IACF,KAAK,CAAC,MAAM,UAAU,KAAK,KAAK,cAAc,MAAM,IAAI,KAAK,KAAK,MAAM,cAAc,MAAM,KAAK,CAAC;AAEpG,QAAM,mBAAmB,OAAO,WAAW,WAAW,+BAA+B,MAAM,IAAI;AAC/F,QAAM,eACJ,qBAAqB,OACjB,OACA,IAAI,IACF,WAAW,OACR,OACC,CAAC,UACC,+BAA+B,MAAM,IAAI,MAAM,oBAC9C,OAAO,MAAM,mBAAmB,YAC/B,+BAA+B,MAAM,cAAc,MAAM,gBAAiB,EAE/E,IAAI,CAAC,UAAU,+BAA+B,MAAM,IA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AAc,EAAC,CAAE,CAAC;EAC5H;AAEA,SAAO,GAAG,MAAM,KAAK,IAAI,EAAE,QAAO,CAAE;;AACtC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,44 @@
1
+ // dist/core/extensions/runtime-registrations.js
2
+
3
+ !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]="ef799d79-82d4-5c27-ae65-d0fbaf71951f")}catch(e){}}();
4
+ function normalizeRegistrationName(value) {
5
+ if (typeof value !== "string") {
6
+ return null;
7
+ }
8
+ const normalized = value.trim().toLowerCase();
9
+ return normalized.length > 0 ? normalized : null;
10
+ }
11
+ function resolveRegisteredSearchProvider(registrations, configuredProvider) {
12
+ const providerName = normalizeRegistrationName(configuredProvider);
13
+ if (!registrations || !providerName) {
14
+ return null;
15
+ }
16
+ const matched = [...registrations.search_providers].reverse().find((registration) => {
17
+ const definitionName = normalizeRegistrationName(registration.runtime_definition?.name) ?? normalizeRegistrationName(registration.definition?.name);
18
+ return definitionName === providerName;
19
+ });
20
+ return matched ?? null;
21
+ }
22
+ function resolveRegisteredVectorStoreAdapter(registrations, configuredAdapter) {
23
+ const adapterName = normalizeRegistrationName(configuredAdapter);
24
+ if (!registrations || !adapterName) {
25
+ return null;
26
+ }
27
+ const matched = [...registrations.vector_store_adapters].reverse().find((registration) => {
28
+ const definitionName = normalizeRegistrationName(registration.runtime_definition?.name) ?? normalizeRegistrationName(registration.definition?.name);
29
+ return definitionName === adapterName;
30
+ });
31
+ return matched ?? null;
32
+ }
33
+ function getMigrationRuntimeDefinition(migration) {
34
+ return migration.runtime_definition ?? migration.definition;
35
+ }
36
+
37
+ export {
38
+ resolveRegisteredSearchProvider,
39
+ resolveRegisteredVectorStoreAdapter,
40
+ getMigrationRuntimeDefinition
41
+ };
42
+ //# sourceMappingURL=chunk-KGHH652T.js.map
43
+
44
+ //# debugId=ef799d79-82d4-5c27-ae65-d0fbaf71951f
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../core/extensions/runtime-registrations.ts"],"sourcesContent":["/**\n * @module core/extensions/runtime-registrations\n *\n * Implements extension runtime contracts and governance for Runtime Registrations.\n */\nimport type {\n ExtensionRegistrationRegistry,\n RegisteredExtensionSchemaMigrationDefinition,\n RegisteredExtensionSearchProvider,\n RegisteredExtensionVectorStoreAdapter,\n} from \"./loader.js\";\n\nfunction normalizeRegistrationName(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const normalized = value.trim().toLowerCase();\n return normalized.length > 0 ? normalized : null;\n}\n\n/**\n * Implements collect registered item fields for the public runtime surface of this module.\n */\nexport function collectRegisteredItemFields(registrations: ExtensionRegistrationRegistry | null): Array<Record<string, unknown>> {\n if (!registrations) {\n return [];\n }\n const fields: Array<Record<string, unknown>> = [];\n for (const registration of registrations.item_fields) {\n for (const field of registration.fields) {\n fields.push(field);\n }\n }\n return fields;\n}\n\n/**\n * Implements resolve registered search provider for the public runtime surface of this module.\n */\nexport function resolveRegisteredSearchProvider(\n registrations: ExtensionRegistrationRegistry | null,\n configuredProvider: string | undefined,\n): RegisteredExtensionSearchProvider | null {\n const providerName = normalizeRegistrationName(configuredProvider);\n if (!registrations || !providerName) {\n return null;\n }\n const matched = [...registrations.search_providers]\n .reverse()\n .find((registration) => {\n const definitionName =\n normalizeRegistrationName(registration.runtime_definition?.name) ??\n normalizeRegistrationName(registration.definition?.name);\n return definitionName === providerName;\n });\n return matched ?? null;\n}\n\n/**\n * Implements resolve registered vector store adapter for the public runtime surface of this module.\n */\nexport function resolveRegisteredVectorStoreAdapter(\n registrations: ExtensionRegistrationRegistry | null,\n configuredAdapter: string | undefined,\n): RegisteredExtensionVectorStoreAdapter | null {\n const adapterName = normalizeRegistrationName(configuredAdapter);\n if (!registrations || !adapterName) {\n return null;\n }\n const matched = [...registrations.vector_store_adapters]\n .reverse()\n .find((registration) => {\n const definitionName =\n normalizeRegistrationName(registration.runtime_definition?.name) ??\n normalizeRegistrationName(registration.definition?.name);\n return definitionName === adapterName;\n });\n return matched ?? null;\n}\n\n/**\n * Implements get migration runtime definition for the public runtime surface of this module.\n */\nexport function getMigrationRuntimeDefinition(\n migration: RegisteredExtensionSchemaMigrationDefinition,\n): Record<string, unknown> {\n return migration.runtime_definition ?? migration.definition;\n}\n"],"names":[],"mappings":";;;AAYA,SAAS,0BAA0B,OAAc;AAC/C,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;EACT;AACA,QAAM,aAAa,MAAM,KAAI,EAAG,YAAW;AAC3C,SAAO,WAAW,SAAS,IAAI,aAAa;AAC9C;AAqBM,SAAU,gCACd,eACA,oBAAsC;AAEtC,QAAM,eAAe,0BAA0B,kBAAkB;AACjE,MAAI,CAAC,iBAAiB,CAAC,cAAc;AACnC,WAAO;EACT;AACA,QAAM,UAAU,CAAC,GAAG,cAAc,gBAAgB,EAC/C,QAAO,EACP,KAAK,CAAC,iBAAgB;AACrB,UAAM,iBACJ,0BAA0B,aAAa,oBAAoB,IAAI,KAC/D,0BAA0B,aAAa,YAAY,IAAI;AACzD,WAAO,mBAAmB;EAC5B,CAAC;AACH,SAAO,WAAW;AACpB;AAKM,SAAU,oCACd,eACA,mBAAqC;AAErC,QAAM,cAAc,0BAA0B,iBAAiB;AAC/D,MAAI,CAAC,iBAAiB,CAAC,aAAa;AAClC,WAAO;EACT;AACA,QAAM,UAAU,CAAC,GAAG,cAAc,qBAAqB,EACpD,QAAO,EACP,KAAK,CAAC,iBAAgB;AACrB,UAAM,iBACJ,0BAA0B,aAAa,oBAAoB,IAAI,KAC/D,0BAA0B,aAAa,YAAY,IAAI;AACzD,WAAO,mBAAmB;EAC5B,CAAC;AACH,SAAO,WAAW;AACpB;AAKM,SAAU,8BACd,WAAuD;AAEvD,SAAO,UAAU,sBAAsB,UAAU;AACnD","debugId":"ef799d79-82d4-5c27-ae65-d0fbaf71951f"}