@unbrained/pm-cli 2026.5.31 → 2026.6.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 (586) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/dist/cli/argv-utils.js +7 -3
  3. package/dist/cli/argv-utils.js.map +1 -1
  4. package/dist/cli/bootstrap-args.d.ts +1 -0
  5. package/dist/cli/bootstrap-args.js +23 -3
  6. package/dist/cli/bootstrap-args.js.map +1 -1
  7. package/dist/cli/commands/calendar.js +17 -3
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/close-many.d.ts +63 -0
  10. package/dist/cli/commands/close-many.js +302 -0
  11. package/dist/cli/commands/close-many.js.map +1 -0
  12. package/dist/cli/commands/completion.d.ts +1 -0
  13. package/dist/cli/commands/completion.js +241 -27
  14. package/dist/cli/commands/completion.js.map +1 -1
  15. package/dist/cli/commands/config.d.ts +4 -4
  16. package/dist/cli/commands/config.js +115 -3
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/contracts.js +191 -162
  19. package/dist/cli/commands/contracts.js.map +1 -1
  20. package/dist/cli/commands/create.d.ts +1 -0
  21. package/dist/cli/commands/create.js +77 -114
  22. package/dist/cli/commands/create.js.map +1 -1
  23. package/dist/cli/commands/extension/doctor.d.ts +12 -0
  24. package/dist/cli/commands/extension/doctor.js +97 -2
  25. package/dist/cli/commands/extension/doctor.js.map +1 -1
  26. package/dist/cli/commands/extension/scaffold.js +49 -48
  27. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  28. package/dist/cli/commands/extension.js +51 -23
  29. package/dist/cli/commands/extension.js.map +1 -1
  30. package/dist/cli/commands/get.js +7 -7
  31. package/dist/cli/commands/get.js.map +1 -1
  32. package/dist/cli/commands/health.js +38 -3
  33. package/dist/cli/commands/health.js.map +1 -1
  34. package/dist/cli/commands/index.d.ts +2 -1
  35. package/dist/cli/commands/index.js +4 -3
  36. package/dist/cli/commands/index.js.map +1 -1
  37. package/dist/cli/commands/init.d.ts +10 -0
  38. package/dist/cli/commands/init.js +107 -4
  39. package/dist/cli/commands/init.js.map +1 -1
  40. package/dist/cli/commands/list.d.ts +5 -0
  41. package/dist/cli/commands/list.js +58 -26
  42. package/dist/cli/commands/list.js.map +1 -1
  43. package/dist/cli/commands/reindex.js +163 -47
  44. package/dist/cli/commands/reindex.js.map +1 -1
  45. package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
  46. package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
  47. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
  48. package/dist/cli/commands/restore.js +25 -4
  49. package/dist/cli/commands/restore.js.map +1 -1
  50. package/dist/cli/commands/schema.d.ts +122 -1
  51. package/dist/cli/commands/schema.js +536 -6
  52. package/dist/cli/commands/schema.js.map +1 -1
  53. package/dist/cli/commands/search.d.ts +1 -0
  54. package/dist/cli/commands/search.js +18 -4
  55. package/dist/cli/commands/search.js.map +1 -1
  56. package/dist/cli/commands/test.js +4 -3
  57. package/dist/cli/commands/test.js.map +1 -1
  58. package/dist/cli/commands/update-many.js +69 -140
  59. package/dist/cli/commands/update-many.js.map +1 -1
  60. package/dist/cli/commands/update.d.ts +2 -0
  61. package/dist/cli/commands/update.js +138 -119
  62. package/dist/cli/commands/update.js.map +1 -1
  63. package/dist/cli/commands/validate.d.ts +1 -0
  64. package/dist/cli/commands/validate.js +63 -33
  65. package/dist/cli/commands/validate.js.map +1 -1
  66. package/dist/cli/error-guidance.js +26 -3
  67. package/dist/cli/error-guidance.js.map +1 -1
  68. package/dist/cli/help-content.js +82 -3
  69. package/dist/cli/help-content.js.map +1 -1
  70. package/dist/cli/main.js +377 -23
  71. package/dist/cli/main.js.map +1 -1
  72. package/dist/cli/register-list-query.js +9 -3
  73. package/dist/cli/register-list-query.js.map +1 -1
  74. package/dist/cli/register-mutation.js +200 -28
  75. package/dist/cli/register-mutation.js.map +1 -1
  76. package/dist/cli/register-operations.js +4 -2
  77. package/dist/cli/register-operations.js.map +1 -1
  78. package/dist/cli/register-setup.js +4 -2
  79. package/dist/cli/register-setup.js.map +1 -1
  80. package/dist/cli/registration-helpers.js +31 -4
  81. package/dist/cli/registration-helpers.js.map +1 -1
  82. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js +20 -0
  83. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js.map +1 -0
  84. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +16 -0
  85. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js +206 -0
  86. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +1 -0
  87. package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js → aggregate-OOAGKWRG.js} +11 -11
  88. package/dist/cli-bundle/chunks/{append-JD2DETU7.js → append-5JE3YGXU.js} +8 -9
  89. package/dist/cli-bundle/chunks/{append-JD2DETU7.js.map → append-5JE3YGXU.js.map} +1 -1
  90. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js +69 -0
  91. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js.map +1 -0
  92. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js +218 -0
  93. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js.map +1 -0
  94. package/dist/cli-bundle/chunks/{chunk-JULRTHJQ.js → chunk-3OH4DAEB.js} +119 -6
  95. package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js.map +7 -0
  96. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js +5553 -0
  97. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +1 -0
  98. package/dist/cli-bundle/chunks/{chunk-WDPXDQFG.js → chunk-4PJQSECJ.js} +6 -4
  99. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +7 -0
  100. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js +1832 -0
  101. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +1 -0
  102. package/dist/cli-bundle/chunks/{chunk-6HT2F4TK.js → chunk-5IRA6IYD.js} +175 -54
  103. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +7 -0
  104. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js +412 -0
  105. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +1 -0
  106. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js +182 -0
  107. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +1 -0
  108. package/dist/cli-bundle/chunks/chunk-7K24QB23.js +698 -0
  109. package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +1 -0
  110. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js +380 -0
  111. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js +230 -0
  113. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js.map +1 -0
  114. package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js → chunk-ATBVS6WW.js} +5 -5
  115. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js +332 -0
  116. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{chunk-PXUAZUUY.js → chunk-B3N4TKNL.js} +12 -11
  118. package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js → chunk-BNL6S7QH.js} +3 -3
  120. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js +154 -0
  121. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js → chunk-CJDQB2ED.js} +2 -2
  123. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js +1340 -0
  124. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js.map +1 -0
  125. package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js → chunk-D3WUNETC.js} +5 -5
  126. package/dist/cli-bundle/chunks/{chunk-3M73P3G6.js → chunk-D5X7N6FI.js} +210 -132
  127. package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js → chunk-DFIZGAI5.js} +10 -12
  129. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js.map → chunk-DFIZGAI5.js.map} +1 -1
  130. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js +1704 -0
  131. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js.map +1 -0
  132. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js +2988 -0
  133. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +1 -0
  134. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js +128 -0
  135. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js.map +1 -0
  136. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js +454 -0
  137. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-U7FMKRXH.js → chunk-GCAVRLGE.js} +37 -16
  139. package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js.map +7 -0
  140. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js +57 -0
  141. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js.map +1 -0
  142. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js +3860 -0
  143. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +1 -0
  144. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js +346 -0
  145. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js.map +1 -0
  146. package/dist/cli-bundle/chunks/{chunk-MD7K4JYF.js → chunk-HPH6X4ZZ.js} +26 -15
  147. package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js.map +7 -0
  148. package/dist/cli-bundle/chunks/{chunk-5HSEP75M.js → chunk-HZOS2UG5.js} +18 -6
  149. package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js.map +7 -0
  150. package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
  151. package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
  152. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
  153. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
  154. package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js → chunk-JB4RGL4V.js} +7 -7
  155. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js +130 -0
  156. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js → chunk-K47WAYQV.js} +3 -3
  158. package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js → chunk-KA24HME7.js} +2 -2
  159. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js +1325 -0
  160. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js +242 -0
  162. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js.map +1 -0
  163. package/dist/cli-bundle/chunks/{chunk-7Y53ZJIQ.js → chunk-KK6YPGH3.js} +22 -3
  164. package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js.map +7 -0
  165. package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js → chunk-LDJK7SHN.js} +7 -7
  166. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
  167. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
  168. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js +80 -0
  169. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-FQE6XZDB.js → chunk-N5YF3VFN.js} +54 -32
  171. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +7 -0
  172. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js +173 -0
  173. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +1 -0
  174. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js +338 -0
  175. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js.map +1 -0
  176. package/dist/cli-bundle/chunks/{chunk-OGZEG5TT.js → chunk-OIQIXTNB.js} +164 -53
  177. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +7 -0
  178. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js +751 -0
  179. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js.map +1 -0
  180. package/dist/cli-bundle/chunks/{chunk-JTWRXG4B.js → chunk-OUF3ARDX.js} +251 -251
  181. package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js → chunk-RANZIID5.js} +2 -2
  183. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js +140 -0
  184. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js.map +7 -0
  185. package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js → chunk-S3CV7JGJ.js} +4 -4
  186. package/dist/cli-bundle/chunks/{chunk-LSXGH6NE.js → chunk-SRVKTWPR.js} +748 -196
  187. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +7 -0
  188. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js +76 -0
  189. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +1 -0
  190. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js +631 -0
  191. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +1 -0
  192. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js +540 -0
  193. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js.map +1 -0
  194. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js +422 -0
  195. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +7 -0
  196. package/dist/cli-bundle/chunks/{chunk-P53TN6IA.js → chunk-TK633IVD.js} +35 -8
  197. package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +7 -0
  198. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js +131 -0
  199. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js.map +7 -0
  200. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js +119 -0
  201. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js.map +1 -0
  202. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js +1664 -0
  203. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js.map +1 -0
  204. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js +186 -0
  205. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +1 -0
  206. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js +182 -0
  207. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js.map +1 -0
  208. package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js → chunk-WIKR7KFL.js} +8 -8
  209. package/dist/cli-bundle/chunks/{chunk-BUPWJ3IJ.js → chunk-XG7RJYHV.js} +484 -49
  210. package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js.map +7 -0
  211. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
  212. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
  213. package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js → chunk-XX5LRINW.js} +2 -2
  214. package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js → chunk-Y2AKE2HS.js} +3 -3
  215. package/dist/cli-bundle/chunks/{chunk-GN7IJPCD.js → chunk-ZQ4F6EC4.js} +301 -24
  216. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +7 -0
  217. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js +1809 -0
  218. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js → claim-AZLP7YFO.js} +10 -11
  220. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js.map → claim-AZLP7YFO.js.map} +1 -1
  221. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js +129 -0
  222. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js.map +1 -0
  223. package/dist/cli-bundle/chunks/close-65DFYAVS.js +17 -0
  224. package/dist/cli-bundle/chunks/close-65DFYAVS.js.map +1 -0
  225. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +13 -0
  226. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js +311 -0
  227. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +1 -0
  228. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js +314 -0
  229. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +7 -0
  230. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js → comments-AGBNSJJH.js} +10 -11
  231. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js.map → comments-AGBNSJJH.js.map} +1 -1
  232. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js +100 -0
  233. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js.map +1 -0
  234. package/dist/cli-bundle/chunks/{config-V3FZOKLI.js → config-5ON3ADRH.js} +121 -10
  235. package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +7 -0
  236. package/dist/cli-bundle/chunks/config-DDPYIA6J.js +1671 -0
  237. package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js → context-E6U3DWVM.js} +32 -19
  239. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js.map → context-E6U3DWVM.js.map} +2 -2
  240. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js +1461 -0
  241. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{contracts-YLMH33VU.js → contracts-CXSFM45B.js} +194 -162
  243. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +7 -0
  244. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js +1274 -0
  245. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +1 -0
  246. package/dist/cli-bundle/chunks/create-ATONSAZW.js +27 -0
  247. package/dist/cli-bundle/chunks/create-WYFKN2U4.js +31 -0
  248. package/dist/cli-bundle/chunks/create-WYFKN2U4.js.map +1 -0
  249. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js → delete-RONNH4F4.js} +7 -8
  250. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js.map → delete-RONNH4F4.js.map} +1 -1
  251. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js +55 -0
  252. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js.map +1 -0
  253. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js +225 -0
  254. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js → deps-WII3O4HB.js} +7 -8
  256. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js.map → deps-WII3O4HB.js.map} +1 -1
  257. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js → docs-JMVCFNHH.js} +9 -10
  258. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js.map → docs-JMVCFNHH.js.map} +1 -1
  259. package/dist/cli-bundle/chunks/docs-PDREIMLS.js +31 -0
  260. package/dist/cli-bundle/chunks/docs-PDREIMLS.js.map +1 -0
  261. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js +28 -0
  262. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js → extension-G6UXSM5S.js} +4 -5
  264. package/dist/cli-bundle/chunks/files-2PN7UM2D.js +282 -0
  265. package/dist/cli-bundle/chunks/files-2PN7UM2D.js.map +1 -0
  266. package/dist/cli-bundle/chunks/{files-WVOX67PE.js → files-MXYS5W4M.js} +9 -10
  267. package/dist/cli-bundle/chunks/{files-WVOX67PE.js.map → files-MXYS5W4M.js.map} +1 -1
  268. package/dist/cli-bundle/chunks/gc-GT552UJH.js +178 -0
  269. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +1 -0
  270. package/dist/cli-bundle/chunks/{gc-JWNF66EC.js → gc-QNBRJG6H.js} +3 -3
  271. package/dist/cli-bundle/chunks/{get-LTK3HOCQ.js → get-CINFEUIY.js} +16 -17
  272. package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +7 -0
  273. package/dist/cli-bundle/chunks/get-WXMLRG7M.js +194 -0
  274. package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +1 -0
  275. package/dist/cli-bundle/chunks/health-5VPOJQ53.js +1258 -0
  276. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +1 -0
  277. package/dist/cli-bundle/chunks/{health-TCWL55KM.js → health-IT5DBPRJ.js} +43 -15
  278. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +7 -0
  279. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +20 -0
  280. package/dist/cli-bundle/chunks/history-FLZIP7PM.js +24 -0
  281. package/dist/cli-bundle/chunks/history-FLZIP7PM.js.map +1 -0
  282. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js +23 -0
  283. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js.map +1 -0
  284. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +19 -0
  285. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js → history-repair-KC5ZOJRZ.js} +12 -14
  286. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js.map → history-repair-KC5ZOJRZ.js.map} +1 -1
  287. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js +193 -0
  288. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js.map +1 -0
  289. package/dist/cli-bundle/chunks/init-6MRFVOLH.js +20 -0
  290. package/dist/cli-bundle/chunks/init-6MRFVOLH.js.map +1 -0
  291. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +16 -0
  292. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js → learnings-A3CLB5CO.js} +10 -11
  293. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js.map → learnings-A3CLB5CO.js.map} +1 -1
  294. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js +44 -0
  295. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js.map +1 -0
  296. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +20 -0
  297. package/dist/cli-bundle/chunks/list-DBRECOG4.js +24 -0
  298. package/dist/cli-bundle/chunks/list-DBRECOG4.js.map +1 -0
  299. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js → notes-42LIC3UE.js} +10 -11
  300. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js.map → notes-42LIC3UE.js.map} +1 -1
  301. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js +44 -0
  302. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js.map +1 -0
  303. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js → plan-HDQXEUKD.js} +13 -14
  304. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js.map → plan-HDQXEUKD.js.map} +1 -1
  305. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js +1171 -0
  306. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js.map +1 -0
  307. package/dist/cli-bundle/chunks/{register-list-query-UP3VRUFS.js → register-list-query-AG3XKXWL.js} +22 -24
  308. package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +7 -0
  309. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js +227 -0
  310. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +1 -0
  311. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js +813 -0
  312. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +1 -0
  313. package/dist/cli-bundle/chunks/{register-mutation-YWSBF545.js → register-mutation-RSMT6DPK.js} +154 -43
  314. package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +7 -0
  315. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js +370 -0
  316. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +1 -0
  317. package/dist/cli-bundle/chunks/{register-operations-3BDTGSDH.js → register-operations-Q54JQZUN.js} +33 -34
  318. package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +7 -0
  319. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js +242 -0
  320. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js.map +1 -0
  321. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js → register-setup-YJKIQRKA.js} +18 -19
  322. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js.map → register-setup-YJKIQRKA.js.map} +2 -2
  323. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js +21 -0
  324. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js.map +1 -0
  325. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +17 -0
  326. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js +770 -0
  327. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js.map +1 -0
  328. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js +780 -0
  329. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js.map +7 -0
  330. package/dist/cli-bundle/chunks/{search-HENBL456.js → search-5A3BMFA7.js} +25 -16
  331. package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +7 -0
  332. package/dist/cli-bundle/chunks/search-C7NPB7G7.js +1127 -0
  333. package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +1 -0
  334. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +120 -0
  335. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{stats-N6H3YP2F.js → stats-Y2CBTZSL.js} +7 -8
  337. package/dist/cli-bundle/chunks/{stats-N6H3YP2F.js.map → stats-Y2CBTZSL.js.map} +1 -1
  338. package/dist/cli-bundle/chunks/test-OFYONO3C.js +35 -0
  339. package/dist/cli-bundle/chunks/test-OFYONO3C.js.map +1 -0
  340. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +31 -0
  341. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js → test-all-EEMKNTGU.js} +13 -14
  342. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js.map → test-all-EEMKNTGU.js.map} +1 -1
  343. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js +328 -0
  344. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js.map +1 -0
  345. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js +929 -0
  346. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js.map +1 -0
  347. package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js → test-runs-L2M7WKH7.js} +5 -5
  348. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +25 -0
  349. package/dist/cli-bundle/chunks/update-6YEHPVXH.js.map +1 -0
  350. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +21 -0
  351. package/dist/cli-bundle/chunks/{update-many-46HRSP2Q.js → update-many-322CCH2L.js} +78 -146
  352. package/dist/cli-bundle/chunks/update-many-322CCH2L.js.map +7 -0
  353. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js +605 -0
  354. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js.map +1 -0
  355. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js → upgrade-2U727SAM.js} +5 -7
  356. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js.map → upgrade-2U727SAM.js.map} +1 -1
  357. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js +266 -0
  358. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js.map +1 -0
  359. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js +1120 -0
  360. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js.map +1 -0
  361. package/dist/cli-bundle/chunks/{validate-TMCVKIGZ.js → validate-ZFVWPEEN.js} +61 -48
  362. package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js.map +7 -0
  363. package/dist/cli-bundle/main.js +490 -52
  364. package/dist/cli-bundle/main.js.map +2 -2
  365. package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
  366. package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
  367. package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
  368. package/dist/core/config/positional-value.js +4 -2
  369. package/dist/core/config/positional-value.js.map +1 -1
  370. package/dist/core/diagnostics/remediation.d.ts +73 -0
  371. package/dist/core/diagnostics/remediation.js +328 -0
  372. package/dist/core/diagnostics/remediation.js.map +1 -0
  373. package/dist/core/extensions/extension-hook-runtime.js +9 -2
  374. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  375. package/dist/core/extensions/extension-types.d.ts +60 -4
  376. package/dist/core/extensions/extension-types.js +2 -2
  377. package/dist/core/extensions/extension-types.js.map +1 -1
  378. package/dist/core/extensions/index.d.ts +5 -1
  379. package/dist/core/extensions/index.js +61 -2
  380. package/dist/core/extensions/index.js.map +1 -1
  381. package/dist/core/extensions/item-fields.d.ts +5 -1
  382. package/dist/core/extensions/item-fields.js +126 -4
  383. package/dist/core/extensions/item-fields.js.map +1 -1
  384. package/dist/core/extensions/loader.js +283 -8
  385. package/dist/core/extensions/loader.js.map +1 -1
  386. package/dist/core/item/item-format.d.ts +3 -2
  387. package/dist/core/item/item-format.js +15 -10
  388. package/dist/core/item/item-format.js.map +1 -1
  389. package/dist/core/item/status-filter.d.ts +29 -0
  390. package/dist/core/item/status-filter.js +97 -0
  391. package/dist/core/item/status-filter.js.map +1 -0
  392. package/dist/core/item/type-registry.js +4 -2
  393. package/dist/core/item/type-registry.js.map +1 -1
  394. package/dist/core/output/output.js +17 -5
  395. package/dist/core/output/output.js.map +1 -1
  396. package/dist/core/schema/item-types-file.d.ts +15 -0
  397. package/dist/core/schema/item-types-file.js +27 -2
  398. package/dist/core/schema/item-types-file.js.map +1 -1
  399. package/dist/core/schema/runtime-field-filters.js +4 -3
  400. package/dist/core/schema/runtime-field-filters.js.map +1 -1
  401. package/dist/core/schema/runtime-field-values.d.ts +1 -1
  402. package/dist/core/schema/runtime-field-values.js +10 -4
  403. package/dist/core/schema/runtime-field-values.js.map +1 -1
  404. package/dist/core/schema/runtime-schema.js +75 -2
  405. package/dist/core/schema/runtime-schema.js.map +1 -1
  406. package/dist/core/schema/status-defs-file.d.ts +113 -0
  407. package/dist/core/schema/status-defs-file.js +260 -0
  408. package/dist/core/schema/status-defs-file.js.map +1 -0
  409. package/dist/core/schema/type-workflows.d.ts +64 -0
  410. package/dist/core/schema/type-workflows.js +98 -0
  411. package/dist/core/schema/type-workflows.js.map +1 -0
  412. package/dist/core/search/cache.d.ts +3 -1
  413. package/dist/core/search/cache.js +104 -28
  414. package/dist/core/search/cache.js.map +1 -1
  415. package/dist/core/search/http-client.d.ts +2 -2
  416. package/dist/core/search/http-client.js +2 -2
  417. package/dist/core/search/http-client.js.map +1 -1
  418. package/dist/core/search/vector-stores.d.ts +1 -0
  419. package/dist/core/search/vector-stores.js +64 -14
  420. package/dist/core/search/vector-stores.js.map +1 -1
  421. package/dist/core/search/vectorization-metadata.d.ts +13 -0
  422. package/dist/core/search/vectorization-metadata.js +65 -0
  423. package/dist/core/search/vectorization-metadata.js.map +1 -0
  424. package/dist/core/shared/serialization.d.ts +1 -0
  425. package/dist/core/shared/serialization.js +86 -2
  426. package/dist/core/shared/serialization.js.map +1 -1
  427. package/dist/core/store/front-matter-cache.js +14 -5
  428. package/dist/core/store/front-matter-cache.js.map +1 -1
  429. package/dist/core/store/item-store.d.ts +2 -0
  430. package/dist/core/store/item-store.js +61 -6
  431. package/dist/core/store/item-store.js.map +1 -1
  432. package/dist/core/store/settings-validator.js +18 -2
  433. package/dist/core/store/settings-validator.js.map +1 -1
  434. package/dist/core/store/settings.js +40 -5
  435. package/dist/core/store/settings.js.map +1 -1
  436. package/dist/core/telemetry/consent.js +3 -3
  437. package/dist/core/telemetry/consent.js.map +1 -1
  438. package/dist/core/telemetry/observability.js +4 -3
  439. package/dist/core/telemetry/observability.js.map +1 -1
  440. package/dist/mcp/server.js +221 -12
  441. package/dist/mcp/server.js.map +1 -1
  442. package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
  443. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  444. package/dist/sdk/cli-contracts/commander-types.js +7 -2
  445. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  446. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  447. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  448. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  449. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
  450. package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
  451. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  452. package/dist/sdk/cli-contracts/tool-parameter-tables.js +35 -6
  453. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  454. package/dist/sdk/cli-contracts.d.ts +19 -1
  455. package/dist/sdk/cli-contracts.js +187 -15
  456. package/dist/sdk/cli-contracts.js.map +1 -1
  457. package/dist/sdk/errors.d.ts +22 -0
  458. package/dist/sdk/errors.js +46 -0
  459. package/dist/sdk/errors.js.map +1 -0
  460. package/dist/sdk/index.d.ts +2 -1
  461. package/dist/sdk/index.js +3 -2
  462. package/dist/sdk/index.js.map +1 -1
  463. package/dist/sdk/package-import-adapters.js +14 -3
  464. package/dist/sdk/package-import-adapters.js.map +1 -1
  465. package/dist/sdk/runtime.d.ts +1 -0
  466. package/dist/sdk/runtime.js +3 -2
  467. package/dist/sdk/runtime.js.map +1 -1
  468. package/dist/sdk/testing.d.ts +77 -0
  469. package/dist/sdk/testing.js +239 -0
  470. package/dist/sdk/testing.js.map +1 -0
  471. package/dist/types.d.ts +19 -0
  472. package/dist/types.js +3 -2
  473. package/dist/types.js.map +1 -1
  474. package/docs/AGENT_GUIDE.md +21 -2
  475. package/docs/COMMANDS.md +85 -5
  476. package/docs/CONFIGURATION.md +49 -2
  477. package/docs/EXTENSIONS.md +118 -6
  478. package/docs/QUICKSTART.md +2 -0
  479. package/docs/RELEASING.md +2 -2
  480. package/docs/SDK.md +273 -1
  481. package/docs/TESTING.md +17 -0
  482. package/docs/examples/policy-restricted-extension/manifest.json +1 -0
  483. package/docs/examples/starter-extension/index.js +9 -1
  484. package/docs/examples/starter-extension/manifest.json +1 -0
  485. package/package.json +12 -6
  486. package/packages/pm-beads/extensions/beads/index.js +2 -4
  487. package/packages/pm-beads/extensions/beads/index.ts +43 -33
  488. package/packages/pm-beads/extensions/beads/manifest.json +12 -1
  489. package/packages/pm-calendar/README.md +6 -0
  490. package/packages/pm-calendar/extensions/calendar/index.js +6 -1
  491. package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
  492. package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
  493. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
  494. package/packages/pm-guide-shell/README.md +4 -0
  495. package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
  496. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
  497. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
  498. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
  499. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
  500. package/packages/pm-lifecycle-hooks/README.md +29 -0
  501. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
  502. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
  503. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
  504. package/packages/pm-lifecycle-hooks/package.json +52 -0
  505. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
  506. package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
  507. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
  508. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
  509. package/packages/pm-templates/extensions/templates/manifest.json +6 -1
  510. package/packages/pm-todos/extensions/todos/index.js +3 -7
  511. package/packages/pm-todos/extensions/todos/index.ts +55 -42
  512. package/packages/pm-todos/extensions/todos/manifest.json +13 -1
  513. package/scripts/bundle-cli.mjs +121 -17
  514. package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +0 -17
  515. package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +0 -7
  516. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +0 -189
  517. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +0 -7
  518. package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +0 -7
  519. package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +0 -7
  520. package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +0 -7
  521. package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +0 -7
  522. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +0 -47
  523. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +0 -7
  524. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +0 -56
  525. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +0 -7
  526. package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +0 -7
  527. package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +0 -7
  528. package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +0 -7
  529. package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +0 -7
  530. package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +0 -7
  531. package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +0 -7
  532. package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +0 -7
  533. package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +0 -7
  534. package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +0 -7
  535. package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +0 -7
  536. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +0 -141
  537. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +0 -7
  538. package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +0 -7
  539. package/dist/cli-bundle/chunks/close-XY4CSAYF.js +0 -14
  540. package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +0 -7
  541. package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +0 -7
  542. package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +0 -28
  543. package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +0 -7
  544. package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +0 -7
  545. package/dist/cli-bundle/chunks/history-A2JUDXUE.js +0 -21
  546. package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +0 -20
  547. package/dist/cli-bundle/chunks/init-M2WUB4YH.js +0 -16
  548. package/dist/cli-bundle/chunks/list-OGWQPC26.js +0 -20
  549. package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +0 -7
  550. package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +0 -7
  551. package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +0 -7
  552. package/dist/cli-bundle/chunks/restore-MB2ISME7.js +0 -18
  553. package/dist/cli-bundle/chunks/schema-Q622KC46.js +0 -119
  554. package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +0 -7
  555. package/dist/cli-bundle/chunks/search-HENBL456.js.map +0 -7
  556. package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +0 -32
  557. package/dist/cli-bundle/chunks/update-H6SCWNMA.js +0 -22
  558. package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +0 -7
  559. package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +0 -7
  560. /package/dist/cli-bundle/chunks/{activity-OWYSUZOY.js.map → activity-P5BUMWP3.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js.map → aggregate-OOAGKWRG.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js.map → chunk-ATBVS6WW.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js.map → chunk-BNL6S7QH.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js.map → chunk-CJDQB2ED.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js.map → chunk-D3WUNETC.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js.map → chunk-JB4RGL4V.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js.map → chunk-K47WAYQV.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js.map → chunk-KA24HME7.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js.map → chunk-LDJK7SHN.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js.map → chunk-RANZIID5.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js.map → chunk-S3CV7JGJ.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js.map → chunk-WIKR7KFL.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js.map → chunk-XX5LRINW.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js.map → chunk-Y2AKE2HS.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-XY4CSAYF.js.map → close-RMHQ3KWH.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{create-PZVHRIZQ.js.map → create-ATONSAZW.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js.map → extension-G6UXSM5S.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{gc-JWNF66EC.js.map → gc-QNBRJG6H.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{history-A2JUDXUE.js.map → history-6FC4H6HI.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{history-redact-ED6RFCPL.js.map → history-redact-XKYEZDBL.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{init-M2WUB4YH.js.map → init-KHX3FEEM.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{list-OGWQPC26.js.map → list-53LZ2AEO.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{restore-MB2ISME7.js.map → restore-JL5QIH7H.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{test-VNBDRJ4Z.js.map → test-RJ4ZF35X.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js.map → test-runs-L2M7WKH7.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{update-H6SCWNMA.js.map → update-PYLVHMRD.js.map} +0 -0
@@ -0,0 +1,1274 @@
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]="6f013070-45a6-59da-9a3f-d7582c1bc681")}catch(e){}}();
3
+ import {
4
+ ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,
5
+ ACTIVITY_FLAG_CONTRACTS,
6
+ AGGREGATE_FLAG_CONTRACTS,
7
+ APPEND_FLAG_CONTRACTS,
8
+ CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,
9
+ CALENDAR_FLAG_CONTRACTS,
10
+ CLAIM_FLAG_CONTRACTS,
11
+ CLOSE_FLAG_CONTRACTS,
12
+ CLOSE_MANY_FLAG_CONTRACTS,
13
+ CLOSE_TASK_FLAG_CONTRACTS,
14
+ COMMENTS_AUDIT_FLAG_CONTRACTS,
15
+ COMMENTS_FLAG_CONTRACTS,
16
+ COMPLETION_FLAG_CONTRACTS,
17
+ CONFIG_FLAG_CONTRACTS,
18
+ CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,
19
+ CONTEXT_FLAG_CONTRACTS,
20
+ CONTRACTS_FLAG_CONTRACTS,
21
+ CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,
22
+ CREATE_COMMANDER_STRING_OPTION_CONTRACTS,
23
+ CREATE_FLAG_CONTRACTS,
24
+ DEDUPE_AUDIT_FLAG_CONTRACTS,
25
+ DELETE_FLAG_CONTRACTS,
26
+ DEPS_FLAG_CONTRACTS,
27
+ DOCS_FLAG_CONTRACTS,
28
+ EXTENSION_ACTIVATE_FLAG_CONTRACTS,
29
+ EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,
30
+ EXTENSION_ADOPT_FLAG_CONTRACTS,
31
+ EXTENSION_CATALOG_FLAG_CONTRACTS,
32
+ EXTENSION_DEACTIVATE_FLAG_CONTRACTS,
33
+ EXTENSION_DOCTOR_FLAG_CONTRACTS,
34
+ EXTENSION_EXPLORE_FLAG_CONTRACTS,
35
+ EXTENSION_FLAG_CONTRACTS,
36
+ EXTENSION_INIT_FLAG_CONTRACTS,
37
+ EXTENSION_INSTALL_FLAG_CONTRACTS,
38
+ EXTENSION_MANAGE_FLAG_CONTRACTS,
39
+ EXTENSION_RELOAD_FLAG_CONTRACTS,
40
+ EXTENSION_UNINSTALL_FLAG_CONTRACTS,
41
+ FILES_FLAG_CONTRACTS,
42
+ GC_FLAG_CONTRACTS,
43
+ GET_FLAG_CONTRACTS,
44
+ GLOBAL_FLAG_CONTRACTS,
45
+ GUIDE_FLAG_CONTRACTS,
46
+ HEALTH_FLAG_CONTRACTS,
47
+ HISTORY_FLAG_CONTRACTS,
48
+ HISTORY_REDACT_FLAG_CONTRACTS,
49
+ HISTORY_REPAIR_FLAG_CONTRACTS,
50
+ INIT_FLAG_CONTRACTS,
51
+ INSTALL_FLAG_CONTRACTS,
52
+ LEARNINGS_FLAG_CONTRACTS,
53
+ LIST_COMMANDER_STRING_OPTION_CONTRACTS,
54
+ LIST_FILTER_FLAG_CONTRACTS,
55
+ NORMALIZE_FLAG_CONTRACTS,
56
+ NOTES_FLAG_CONTRACTS,
57
+ PAUSE_TASK_FLAG_CONTRACTS,
58
+ PLAN_FLAG_CONTRACTS,
59
+ PM_CORE_COMMAND_NAMES,
60
+ PM_EXTENSION_CAPABILITY_CONTRACTS,
61
+ PM_EXTENSION_POLICY_MODE_CONTRACTS,
62
+ PM_EXTENSION_POLICY_SURFACE_CONTRACTS,
63
+ PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,
64
+ PM_EXTENSION_SERVICE_NAME_CONTRACTS,
65
+ PM_EXTENSION_TRUST_MODE_CONTRACTS,
66
+ PM_TOOL_ACTIONS,
67
+ PM_TOOL_PARAMETERS_SCHEMA,
68
+ REINDEX_FLAG_CONTRACTS,
69
+ RELEASE_FLAG_CONTRACTS,
70
+ RESTORE_FLAG_CONTRACTS,
71
+ SCHEMA_FLAG_CONTRACTS,
72
+ SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,
73
+ SEARCH_FLAG_CONTRACTS,
74
+ START_TASK_FLAG_CONTRACTS,
75
+ TEST_ALL_FLAG_CONTRACTS,
76
+ TEST_FLAG_CONTRACTS,
77
+ TEST_RUNS_FLAG_CONTRACTS,
78
+ UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,
79
+ UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,
80
+ UPDATE_FLAG_CONTRACTS,
81
+ UPDATE_MANY_FLAG_CONTRACTS,
82
+ UPGRADE_FLAG_CONTRACTS,
83
+ VALIDATE_FLAG_CONTRACTS,
84
+ compactFlagAliasContracts
85
+ } from "./chunk-GNHVV4SY.js";
86
+ import {
87
+ commandOptionFlagLabel,
88
+ resolveCommandOptionPolicyState,
89
+ resolveItemTypeRegistry
90
+ } from "./chunk-SZQCER6S.js";
91
+ import {
92
+ EXIT_CODE,
93
+ PmCliError,
94
+ SETTINGS_DEFAULTS,
95
+ activateExtensions,
96
+ getActiveExtensionRegistrations,
97
+ getSettingsPath,
98
+ loadExtensions,
99
+ pathExists,
100
+ readSettings,
101
+ resolvePmRoot,
102
+ resolveRuntimeFieldRegistry,
103
+ resolveRuntimeStatusRegistry
104
+ } from "./chunk-4LTBNUYT.js";
105
+
106
+ // dist/cli/commands/contracts.js
107
+ var LIST_COMMAND_NAMES = /* @__PURE__ */ new Set([
108
+ "list",
109
+ "list-all",
110
+ "list-draft",
111
+ "list-open",
112
+ "list-in-progress",
113
+ "list-blocked",
114
+ "list-closed",
115
+ "list-canceled"
116
+ ]);
117
+ var PACKAGE_OWNED_ACTIONS = /* @__PURE__ */ new Set([
118
+ "calendar",
119
+ "dedupe-audit",
120
+ "guide",
121
+ "reindex",
122
+ "normalize",
123
+ "comments-audit",
124
+ "completion",
125
+ "test-runs-list",
126
+ "test-runs-status",
127
+ "test-runs-logs",
128
+ "test-runs-stop",
129
+ "test-runs-resume",
130
+ "templates-list",
131
+ "templates-save",
132
+ "templates-show"
133
+ ]);
134
+ var PACKAGE_OWNED_COMMANDS = /* @__PURE__ */ new Set([
135
+ "cal",
136
+ "calendar",
137
+ "comments-audit",
138
+ "completion",
139
+ "completion-statuses",
140
+ "completion-tags",
141
+ "completion-types",
142
+ "dedupe-audit",
143
+ "guide",
144
+ "normalize",
145
+ "reindex",
146
+ "templates",
147
+ "templates list",
148
+ "templates save",
149
+ "templates show",
150
+ "test-runs",
151
+ "test-runs list",
152
+ "test-runs status",
153
+ "test-runs logs",
154
+ "test-runs stop",
155
+ "test-runs resume"
156
+ ]);
157
+ var PACKAGE_OWNED_COMMAND_INSTALL_HINTS = /* @__PURE__ */ new Map([
158
+ ["cal", "calendar"],
159
+ ["calendar", "calendar"],
160
+ ["comments-audit", "governance-audit"],
161
+ ["completion", "guide-shell"],
162
+ ["completion-statuses", "guide-shell"],
163
+ ["completion-tags", "guide-shell"],
164
+ ["completion-types", "guide-shell"],
165
+ ["dedupe-audit", "governance-audit"],
166
+ ["guide", "guide-shell"],
167
+ ["normalize", "governance-audit"],
168
+ ["reindex", "search-advanced"],
169
+ ["templates", "templates"],
170
+ ["templates list", "templates"],
171
+ ["templates save", "templates"],
172
+ ["templates show", "templates"],
173
+ ["test-runs", "linked-test-adapters"],
174
+ ["test-runs list", "linked-test-adapters"],
175
+ ["test-runs status", "linked-test-adapters"],
176
+ ["test-runs logs", "linked-test-adapters"],
177
+ ["test-runs stop", "linked-test-adapters"],
178
+ ["test-runs resume", "linked-test-adapters"]
179
+ ]);
180
+ var PACKAGE_OWNED_ACTION_COMMAND_PATHS = /* @__PURE__ */ new Map([
181
+ ["calendar", "calendar|cal"],
182
+ ["dedupe-audit", "dedupe-audit"],
183
+ ["guide", "guide"],
184
+ ["reindex", "reindex"],
185
+ ["normalize", "normalize"],
186
+ ["comments-audit", "comments-audit"],
187
+ ["completion", "completion"],
188
+ ["test-runs-list", "test-runs|test-runs list"],
189
+ ["test-runs-status", "test-runs status"],
190
+ ["test-runs-logs", "test-runs logs"],
191
+ ["test-runs-stop", "test-runs stop"],
192
+ ["test-runs-resume", "test-runs resume"],
193
+ ["templates-list", "templates|templates list"],
194
+ ["templates-save", "templates save"],
195
+ ["templates-show", "templates show"]
196
+ ]);
197
+ var PACKAGE_OWNED_COMMAND_ACTIONS = new Map([...PACKAGE_OWNED_ACTION_COMMAND_PATHS.entries()].flatMap(([action, commandPaths]) => splitCommandPathAliases(commandPaths).map((commandPath) => [commandPath, action])));
198
+ var CANONICAL_COMMAND_ALIASES = [
199
+ {
200
+ canonical: "context",
201
+ aliases: ["ctx"]
202
+ },
203
+ {
204
+ canonical: "package",
205
+ aliases: ["extension", "packages", "install"]
206
+ }
207
+ ];
208
+ var COMMAND_ALIAS_TO_CANONICAL = new Map(CANONICAL_COMMAND_ALIASES.flatMap((entry) => entry.aliases.map((alias) => [alias, entry.canonical])));
209
+ var EXTENSION_PACKAGE_LIFECYCLE_FLAG_CONTRACTS = [
210
+ ["init", EXTENSION_INIT_FLAG_CONTRACTS],
211
+ ["install", EXTENSION_INSTALL_FLAG_CONTRACTS],
212
+ ["uninstall", EXTENSION_UNINSTALL_FLAG_CONTRACTS],
213
+ ["explore", EXTENSION_EXPLORE_FLAG_CONTRACTS],
214
+ ["manage", EXTENSION_MANAGE_FLAG_CONTRACTS],
215
+ ["reload", EXTENSION_RELOAD_FLAG_CONTRACTS],
216
+ ["doctor", EXTENSION_DOCTOR_FLAG_CONTRACTS],
217
+ ["catalog", EXTENSION_CATALOG_FLAG_CONTRACTS],
218
+ ["adopt", EXTENSION_ADOPT_FLAG_CONTRACTS],
219
+ ["adopt-all", EXTENSION_ADOPT_ALL_FLAG_CONTRACTS],
220
+ ["activate", EXTENSION_ACTIVATE_FLAG_CONTRACTS],
221
+ ["deactivate", EXTENSION_DEACTIVATE_FLAG_CONTRACTS]
222
+ ];
223
+ var CORE_COMMAND_FLAG_CONTRACT_ENTRIES = [
224
+ ...EXTENSION_PACKAGE_LIFECYCLE_FLAG_CONTRACTS.flatMap(([subcommand, flags]) => [
225
+ [`extension ${subcommand}`, flags],
226
+ [`package ${subcommand}`, flags],
227
+ [`packages ${subcommand}`, flags]
228
+ ]),
229
+ ["init", INIT_FLAG_CONTRACTS],
230
+ ["config", CONFIG_FLAG_CONTRACTS],
231
+ ["extension", EXTENSION_FLAG_CONTRACTS],
232
+ ["package", EXTENSION_FLAG_CONTRACTS],
233
+ ["packages", EXTENSION_FLAG_CONTRACTS],
234
+ ["install", INSTALL_FLAG_CONTRACTS],
235
+ ["create", CREATE_FLAG_CONTRACTS],
236
+ ["update", UPDATE_FLAG_CONTRACTS],
237
+ ["update-many", UPDATE_MANY_FLAG_CONTRACTS],
238
+ ["upgrade", UPGRADE_FLAG_CONTRACTS],
239
+ ["normalize", NORMALIZE_FLAG_CONTRACTS],
240
+ ["calendar", CALENDAR_FLAG_CONTRACTS],
241
+ ["cal", CALENDAR_FLAG_CONTRACTS],
242
+ ["context", CONTEXT_FLAG_CONTRACTS],
243
+ ["ctx", CONTEXT_FLAG_CONTRACTS],
244
+ ["get", GET_FLAG_CONTRACTS],
245
+ ["search", SEARCH_FLAG_CONTRACTS],
246
+ ["aggregate", AGGREGATE_FLAG_CONTRACTS],
247
+ ["dedupe-audit", DEDUPE_AUDIT_FLAG_CONTRACTS],
248
+ ["deps", DEPS_FLAG_CONTRACTS],
249
+ ["guide", GUIDE_FLAG_CONTRACTS],
250
+ ["reindex", REINDEX_FLAG_CONTRACTS],
251
+ ["history", HISTORY_FLAG_CONTRACTS],
252
+ ["history-redact", HISTORY_REDACT_FLAG_CONTRACTS],
253
+ ["history-repair", HISTORY_REPAIR_FLAG_CONTRACTS],
254
+ ["schema", SCHEMA_FLAG_CONTRACTS],
255
+ ["plan", PLAN_FLAG_CONTRACTS],
256
+ ["restore", RESTORE_FLAG_CONTRACTS],
257
+ ["delete", DELETE_FLAG_CONTRACTS],
258
+ ["close", CLOSE_FLAG_CONTRACTS],
259
+ ["close-many", CLOSE_MANY_FLAG_CONTRACTS],
260
+ ["append", APPEND_FLAG_CONTRACTS],
261
+ ["claim", CLAIM_FLAG_CONTRACTS],
262
+ ["release", RELEASE_FLAG_CONTRACTS],
263
+ ["start-task", START_TASK_FLAG_CONTRACTS],
264
+ ["pause-task", PAUSE_TASK_FLAG_CONTRACTS],
265
+ ["close-task", CLOSE_TASK_FLAG_CONTRACTS],
266
+ ["comments", COMMENTS_FLAG_CONTRACTS],
267
+ ["notes", NOTES_FLAG_CONTRACTS],
268
+ ["learnings", LEARNINGS_FLAG_CONTRACTS],
269
+ ["files", FILES_FLAG_CONTRACTS],
270
+ ["docs", DOCS_FLAG_CONTRACTS],
271
+ ["test", TEST_FLAG_CONTRACTS],
272
+ ["test-all", TEST_ALL_FLAG_CONTRACTS],
273
+ ["test-runs", TEST_RUNS_FLAG_CONTRACTS],
274
+ ["gc", GC_FLAG_CONTRACTS],
275
+ ["validate", VALIDATE_FLAG_CONTRACTS],
276
+ ["comments-audit", COMMENTS_AUDIT_FLAG_CONTRACTS],
277
+ ["health", HEALTH_FLAG_CONTRACTS],
278
+ ["contracts", CONTRACTS_FLAG_CONTRACTS],
279
+ ["completion", COMPLETION_FLAG_CONTRACTS],
280
+ ["activity", ACTIVITY_FLAG_CONTRACTS],
281
+ ...[...LIST_COMMAND_NAMES].map((command) => [command, LIST_FILTER_FLAG_CONTRACTS])
282
+ ];
283
+ var CORE_COMMAND_FLAG_CONTRACTS_BY_COMMAND = new Map(CORE_COMMAND_FLAG_CONTRACT_ENTRIES);
284
+ function packageOwnedActionForCommand(command) {
285
+ const exactAction = PACKAGE_OWNED_COMMAND_ACTIONS.get(command);
286
+ if (exactAction) {
287
+ return exactAction;
288
+ }
289
+ if (command.startsWith("test-runs ")) {
290
+ return `test-runs-${command.slice("test-runs ".length)}`;
291
+ }
292
+ if (command.startsWith("templates ")) {
293
+ return `templates-${command.slice("templates ".length)}`;
294
+ }
295
+ return command;
296
+ }
297
+ function resolveActionCommandPath(action) {
298
+ if (PM_CORE_COMMAND_NAMES.includes(action)) {
299
+ return normalizeCommandPath(action);
300
+ }
301
+ if (action.startsWith("extension-")) {
302
+ return normalizeCommandPath(`extension ${action.slice("extension-".length)}`);
303
+ }
304
+ if (action.startsWith("package-")) {
305
+ return normalizeCommandPath(`package ${action.slice("package-".length)}`);
306
+ }
307
+ if (action.startsWith("test-runs-")) {
308
+ return normalizeCommandPath(`test-runs ${action.slice("test-runs-".length)}`);
309
+ }
310
+ if (action.startsWith("templates-")) {
311
+ return normalizeCommandPath(`templates ${action.slice("templates-".length)}`);
312
+ }
313
+ if (PACKAGE_OWNED_ACTIONS.has(action)) {
314
+ return PACKAGE_OWNED_ACTION_COMMAND_PATHS.get(action) ?? normalizeCommandPath(action);
315
+ }
316
+ return null;
317
+ }
318
+ function actionDescriptorMatchesSelectedCommand(descriptor, selectedCommand) {
319
+ if (descriptor.command_path === null) {
320
+ return false;
321
+ }
322
+ return splitCommandPathAliases(descriptor.command_path).some((commandPath) => {
323
+ if (commandPath === selectedCommand) {
324
+ return true;
325
+ }
326
+ return commandPath.startsWith(`${selectedCommand} `);
327
+ });
328
+ }
329
+ function splitCommandPathAliases(commandPath) {
330
+ return commandPath.split("|").map((entry) => normalizeCommandPath(entry)).filter((entry) => entry.length > 0);
331
+ }
332
+ function resolveScopedCommandsFromActionDescriptors(descriptors, commandCatalog) {
333
+ const commandSet = new Set(commandCatalog);
334
+ const scoped = /* @__PURE__ */ new Set();
335
+ for (const descriptor of descriptors) {
336
+ if (!descriptor.command_path) {
337
+ continue;
338
+ }
339
+ for (const commandPath of splitCommandPathAliases(descriptor.command_path)) {
340
+ const tokens = commandPath.split(" ").filter((entry) => entry.length > 0);
341
+ if (tokens.length === 0) {
342
+ continue;
343
+ }
344
+ for (let end = tokens.length; end > 0; end -= 1) {
345
+ const candidate = tokens.slice(0, end).join(" ");
346
+ if (!commandSet.has(candidate)) {
347
+ continue;
348
+ }
349
+ scoped.add(candidate);
350
+ break;
351
+ }
352
+ }
353
+ }
354
+ return [...scoped].sort((left, right) => left.localeCompare(right));
355
+ }
356
+ function normalizeToken(value) {
357
+ if (typeof value !== "string") {
358
+ return void 0;
359
+ }
360
+ const trimmed = value.trim().toLowerCase();
361
+ return trimmed.length > 0 ? trimmed : void 0;
362
+ }
363
+ function extractActionBranches(schema) {
364
+ const oneOf = schema.oneOf;
365
+ if (!Array.isArray(oneOf)) {
366
+ return [];
367
+ }
368
+ return oneOf.filter((entry) => typeof entry === "object" && entry !== null);
369
+ }
370
+ function filterSchemaByAction(schema, action) {
371
+ if (!action) {
372
+ return { ...schema };
373
+ }
374
+ const branches = extractActionBranches(schema);
375
+ const filtered = branches.filter((entry) => {
376
+ const properties = entry.properties;
377
+ if (typeof properties !== "object" || properties === null) {
378
+ return false;
379
+ }
380
+ const actionProperty = properties.action;
381
+ if (typeof actionProperty !== "object" || actionProperty === null) {
382
+ return false;
383
+ }
384
+ return actionProperty.const === action;
385
+ });
386
+ return {
387
+ ...schema,
388
+ oneOf: filtered
389
+ };
390
+ }
391
+ function filterSchemaByActions(schema, actions) {
392
+ const branches = extractActionBranches(schema);
393
+ const filtered = branches.filter((entry) => {
394
+ const properties = entry.properties;
395
+ if (typeof properties !== "object" || properties === null) {
396
+ return false;
397
+ }
398
+ const actionProperty = properties.action;
399
+ if (typeof actionProperty !== "object" || actionProperty === null) {
400
+ return false;
401
+ }
402
+ const actionConst = actionProperty.const;
403
+ return typeof actionConst === "string" && actions.has(actionConst);
404
+ });
405
+ return {
406
+ ...schema,
407
+ oneOf: filtered
408
+ };
409
+ }
410
+ function normalizeCommandPath(value) {
411
+ return value.trim().toLowerCase().split(/\s+/).filter((entry) => entry.length > 0).join(" ");
412
+ }
413
+ function normalizeActionNameFromCommand(commandPath) {
414
+ return commandPath.replace(/\s+/g, "-");
415
+ }
416
+ function toOptionalTrimmedString(value) {
417
+ if (typeof value !== "string") {
418
+ return null;
419
+ }
420
+ const trimmed = value.trim();
421
+ return trimmed.length > 0 ? trimmed : null;
422
+ }
423
+ function normalizeStringList(values) {
424
+ if (!Array.isArray(values)) {
425
+ return [];
426
+ }
427
+ const normalized = [];
428
+ const seen = /* @__PURE__ */ new Set();
429
+ for (const value of values) {
430
+ const trimmed = toOptionalTrimmedString(value);
431
+ if (!trimmed || seen.has(trimmed)) {
432
+ continue;
433
+ }
434
+ seen.add(trimmed);
435
+ normalized.push(trimmed);
436
+ }
437
+ return normalized;
438
+ }
439
+ function toExtensionFlagContract(definition) {
440
+ const longName = toOptionalTrimmedString(definition.long);
441
+ const shortName = toOptionalTrimmedString(definition.short);
442
+ const normalizedLong = longName && longName.startsWith("--") && longName.length > 2 ? longName : null;
443
+ const normalizedShort = shortName && shortName.startsWith("-") && !shortName.startsWith("--") ? shortName : null;
444
+ const flag = normalizedLong ?? normalizedShort;
445
+ if (!flag) {
446
+ return null;
447
+ }
448
+ const contract = { flag };
449
+ if (normalizedShort && normalizedLong) {
450
+ contract.short = normalizedShort;
451
+ }
452
+ const description = toOptionalTrimmedString(definition.description);
453
+ if (description) {
454
+ contract.description = description;
455
+ }
456
+ if (definition.required === true) {
457
+ contract.required = true;
458
+ }
459
+ if (definition.repeatable === true) {
460
+ contract.repeatable = true;
461
+ }
462
+ const valueName = toOptionalTrimmedString(definition.value_name);
463
+ if (valueName) {
464
+ contract.value_name = valueName;
465
+ }
466
+ const rawValueType = [
467
+ toOptionalTrimmedString(definition.value_type),
468
+ toOptionalTrimmedString(definition.type),
469
+ valueName ? "string" : null
470
+ ].find((candidate) => candidate === "string" || candidate === "number" || candidate === "boolean");
471
+ if (rawValueType) {
472
+ contract.value_type = rawValueType;
473
+ }
474
+ return contract;
475
+ }
476
+ function collectExtensionFlagContractsByCommand(registrations) {
477
+ const grouped = /* @__PURE__ */ new Map();
478
+ for (const registration of registrations) {
479
+ const commandPath = normalizeCommandPath(registration.target_command);
480
+ if (commandPath.length === 0) {
481
+ continue;
482
+ }
483
+ const bucket = grouped.get(commandPath) ?? {
484
+ flags: [],
485
+ sources: [],
486
+ dedupe: /* @__PURE__ */ new Set(),
487
+ sourceDedupe: /* @__PURE__ */ new Set()
488
+ };
489
+ const sourceKey = `${registration.layer}:${registration.name}`;
490
+ if (!bucket.sourceDedupe.has(sourceKey)) {
491
+ bucket.sourceDedupe.add(sourceKey);
492
+ bucket.sources.push({
493
+ layer: registration.layer,
494
+ name: registration.name
495
+ });
496
+ }
497
+ for (const definition of registration.flags) {
498
+ const contract = toExtensionFlagContract(definition);
499
+ if (!contract) {
500
+ continue;
501
+ }
502
+ const key = `${contract.flag}|${contract.short ?? ""}`;
503
+ if (bucket.dedupe.has(key)) {
504
+ continue;
505
+ }
506
+ bucket.dedupe.add(key);
507
+ bucket.flags.push(contract);
508
+ }
509
+ grouped.set(commandPath, bucket);
510
+ }
511
+ const normalized = /* @__PURE__ */ new Map();
512
+ for (const [commandPath, bucket] of grouped.entries()) {
513
+ normalized.set(commandPath, {
514
+ flags: bucket.flags,
515
+ sources: bucket.sources.sort((left, right) => {
516
+ const layerOrder = left.layer.localeCompare(right.layer);
517
+ if (layerOrder !== 0) {
518
+ return layerOrder;
519
+ }
520
+ return (left.name ?? "").localeCompare(right.name ?? "");
521
+ })
522
+ });
523
+ }
524
+ return normalized;
525
+ }
526
+ function collectExtensionCommandContracts(runtimeProbe) {
527
+ const flagsByCommand = collectExtensionFlagContractsByCommand(runtimeProbe.flagRegistrations);
528
+ const definitionsByCommand = /* @__PURE__ */ new Map();
529
+ for (const definition of runtimeProbe.commandDefinitions) {
530
+ const command = normalizeCommandPath(definition.command);
531
+ if (command.length === 0) {
532
+ continue;
533
+ }
534
+ const action = toOptionalTrimmedString(definition.action) ?? normalizeActionNameFromCommand(command);
535
+ const args = Array.isArray(definition.arguments) ? definition.arguments.map((argument) => {
536
+ const name = toOptionalTrimmedString(argument.name);
537
+ if (!name) {
538
+ return null;
539
+ }
540
+ return {
541
+ name,
542
+ required: argument.required === true,
543
+ variadic: argument.variadic === true,
544
+ description: toOptionalTrimmedString(argument.description)
545
+ };
546
+ }).filter((argument) => argument !== null) : [];
547
+ definitionsByCommand.set(command, {
548
+ command,
549
+ action,
550
+ source: {
551
+ layer: definition.layer,
552
+ name: definition.name
553
+ },
554
+ description: toOptionalTrimmedString(definition.description),
555
+ intent: toOptionalTrimmedString(definition.intent),
556
+ arguments: args,
557
+ flags: flagsByCommand.get(command)?.flags ?? [],
558
+ examples: normalizeStringList(definition.examples),
559
+ failure_hints: normalizeStringList(definition.failure_hints)
560
+ });
561
+ }
562
+ const extensionCommands = /* @__PURE__ */ new Set();
563
+ for (const command of runtimeProbe.handlers) {
564
+ extensionCommands.add(normalizeCommandPath(command));
565
+ }
566
+ for (const command of definitionsByCommand.keys()) {
567
+ extensionCommands.add(command);
568
+ }
569
+ for (const command of flagsByCommand.keys()) {
570
+ extensionCommands.add(command);
571
+ }
572
+ const contracts = [];
573
+ for (const command of [...extensionCommands].sort((left, right) => left.localeCompare(right))) {
574
+ const definition = definitionsByCommand.get(command);
575
+ if (definition) {
576
+ contracts.push({
577
+ ...definition,
578
+ flags: definition.flags.length > 0 ? definition.flags : flagsByCommand.get(command)?.flags ?? []
579
+ });
580
+ continue;
581
+ }
582
+ contracts.push({
583
+ command,
584
+ action: normalizeActionNameFromCommand(command),
585
+ source: null,
586
+ description: null,
587
+ intent: null,
588
+ arguments: [],
589
+ flags: flagsByCommand.get(command)?.flags ?? [],
590
+ examples: [],
591
+ failure_hints: []
592
+ });
593
+ }
594
+ return contracts;
595
+ }
596
+ function extensionSchemaPropertyNameFromFlag(flag) {
597
+ const normalized = flag.flag.replace(/^-+/, "").trim();
598
+ if (normalized.length === 0) {
599
+ return null;
600
+ }
601
+ const camelCased = normalized.replace(/-([a-z0-9])/g, (_match, char) => char.toUpperCase());
602
+ const cleaned = camelCased.replace(/[^a-zA-Z0-9]/g, "");
603
+ return cleaned.length > 0 ? cleaned : null;
604
+ }
605
+ function buildExtensionActionSchemaBranch(contract) {
606
+ const commands = contract.command.split("|").map((command) => command.trim()).filter((command) => command.length > 0);
607
+ const properties = {
608
+ action: {
609
+ type: "string",
610
+ const: contract.action,
611
+ description: contract.intent ?? contract.description ?? `Invoke extension command '${contract.command}'.`
612
+ }
613
+ };
614
+ const required = ["action"];
615
+ for (const argument of contract.arguments) {
616
+ if (argument.variadic) {
617
+ properties[argument.name] = {
618
+ type: "array",
619
+ items: { type: "string" },
620
+ description: argument.description ?? `Variadic argument '${argument.name}' for extension action '${contract.action}'.`
621
+ };
622
+ } else {
623
+ properties[argument.name] = {
624
+ type: "string",
625
+ description: argument.description ?? `Argument '${argument.name}' for extension action '${contract.action}'.`
626
+ };
627
+ }
628
+ if (argument.required) {
629
+ required.push(argument.name);
630
+ }
631
+ }
632
+ for (const flag of contract.flags) {
633
+ const propertyName = extensionSchemaPropertyNameFromFlag(flag);
634
+ if (!propertyName || properties[propertyName] !== void 0) {
635
+ continue;
636
+ }
637
+ const valueType = flag.value_type ?? "boolean";
638
+ const schemaType = valueType === "boolean" ? "boolean" : valueType === "number" ? ["number", "string"] : "string";
639
+ properties[propertyName] = {
640
+ type: flag.repeatable ? "array" : schemaType,
641
+ ...flag.repeatable ? { items: { type: schemaType } } : {},
642
+ description: flag.description ?? `Extension option '${flag.flag}' for action '${contract.action}'.`
643
+ };
644
+ if (flag.required === true) {
645
+ required.push(propertyName);
646
+ }
647
+ }
648
+ return {
649
+ type: "object",
650
+ properties,
651
+ required,
652
+ additionalProperties: true,
653
+ "x-extension-source": contract.source,
654
+ "x-extension-command": commands[0] ?? contract.command,
655
+ "x-extension-commands": commands
656
+ };
657
+ }
658
+ function mergeExtensionFlagContract(existing, incoming) {
659
+ existing.description ??= incoming.description;
660
+ existing.value_name ??= incoming.value_name;
661
+ existing.value_type ??= incoming.value_type;
662
+ if (incoming.required === true) {
663
+ existing.required = true;
664
+ }
665
+ if (incoming.repeatable === true) {
666
+ existing.repeatable = true;
667
+ }
668
+ }
669
+ function mergeExtensionContractsByAction(contracts) {
670
+ const byAction = /* @__PURE__ */ new Map();
671
+ for (const contract of contracts) {
672
+ const existing = byAction.get(contract.action);
673
+ if (!existing) {
674
+ byAction.set(contract.action, {
675
+ ...contract,
676
+ flags: [...contract.flags],
677
+ examples: [...contract.examples],
678
+ failure_hints: [...contract.failure_hints]
679
+ });
680
+ continue;
681
+ }
682
+ existing.command = [.../* @__PURE__ */ new Set([existing.command, contract.command])].sort((left, right) => left.localeCompare(right)).join("|");
683
+ existing.arguments = existing.arguments.length >= contract.arguments.length ? existing.arguments : contract.arguments;
684
+ const flagKeys = new Set(existing.flags.map((flag) => `${flag.flag}|${flag.short ?? ""}`));
685
+ for (const flag of contract.flags) {
686
+ const key = `${flag.flag}|${flag.short ?? ""}`;
687
+ if (!flagKeys.has(key)) {
688
+ flagKeys.add(key);
689
+ existing.flags.push(flag);
690
+ } else {
691
+ const existingFlag = existing.flags.find((candidate) => `${candidate.flag}|${candidate.short ?? ""}` === key);
692
+ if (existingFlag) {
693
+ mergeExtensionFlagContract(existingFlag, flag);
694
+ }
695
+ }
696
+ }
697
+ existing.examples = [.../* @__PURE__ */ new Set([...existing.examples, ...contract.examples])];
698
+ existing.failure_hints = [.../* @__PURE__ */ new Set([...existing.failure_hints, ...contract.failure_hints])];
699
+ }
700
+ return [...byAction.values()].sort((left, right) => left.action.localeCompare(right.action));
701
+ }
702
+ async function resolveRuntimeExtensionActionProbe(global) {
703
+ const defaultPolicyState = {
704
+ mode: SETTINGS_DEFAULTS.extensions.policy.mode,
705
+ trust_mode: SETTINGS_DEFAULTS.extensions.policy.trust_mode,
706
+ default_sandbox_profile: SETTINGS_DEFAULTS.extensions.policy.default_sandbox_profile
707
+ };
708
+ if (global.noExtensions) {
709
+ return {
710
+ handlers: /* @__PURE__ */ new Set(),
711
+ disabledReason: "extensions_disabled",
712
+ commandDefinitions: [],
713
+ flagRegistrations: [],
714
+ registrations: null,
715
+ policyState: defaultPolicyState
716
+ };
717
+ }
718
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
719
+ if (!await pathExists(getSettingsPath(pmRoot))) {
720
+ return {
721
+ handlers: /* @__PURE__ */ new Set(),
722
+ disabledReason: null,
723
+ commandDefinitions: [],
724
+ flagRegistrations: [],
725
+ registrations: null,
726
+ policyState: defaultPolicyState
727
+ };
728
+ }
729
+ try {
730
+ const settings = await readSettings(pmRoot);
731
+ const loadResult = await loadExtensions({
732
+ pmRoot,
733
+ settings,
734
+ cwd: process.cwd(),
735
+ noExtensions: false
736
+ });
737
+ const activationResult = await activateExtensions({
738
+ ...loadResult,
739
+ loaded: loadResult.loaded
740
+ });
741
+ const handlers = new Set(activationResult.commands.handlers.map((entry) => normalizeCommandPath(entry.command)));
742
+ return {
743
+ handlers,
744
+ disabledReason: null,
745
+ commandDefinitions: activationResult.registrations.commands,
746
+ flagRegistrations: activationResult.registrations.flags,
747
+ registrations: activationResult.registrations,
748
+ policyState: {
749
+ mode: loadResult.policy.mode,
750
+ trust_mode: loadResult.policy.trust_mode,
751
+ default_sandbox_profile: loadResult.policy.default_sandbox_profile
752
+ }
753
+ };
754
+ } catch {
755
+ return {
756
+ handlers: /* @__PURE__ */ new Set(),
757
+ disabledReason: "extension_runtime_probe_failed",
758
+ commandDefinitions: [],
759
+ flagRegistrations: [],
760
+ registrations: null,
761
+ policyState: defaultPolicyState
762
+ };
763
+ }
764
+ }
765
+ function collectActionContractDescriptors(extensionContracts, options = {}) {
766
+ const descriptors = /* @__PURE__ */ new Map();
767
+ for (const action of PM_TOOL_ACTIONS) {
768
+ const packageOwned = PACKAGE_OWNED_ACTIONS.has(action);
769
+ if (packageOwned && !options.includePackageOwnedActions) {
770
+ continue;
771
+ }
772
+ const commandPath = resolveActionCommandPath(action);
773
+ descriptors.set(action, {
774
+ action,
775
+ provider: packageOwned ? "extension" : "core",
776
+ requires_extension: packageOwned,
777
+ command_path: commandPath
778
+ });
779
+ }
780
+ if (options.includePackageOwnedActions) {
781
+ for (const action of PACKAGE_OWNED_ACTIONS) {
782
+ if (descriptors.has(action)) {
783
+ continue;
784
+ }
785
+ descriptors.set(action, {
786
+ action,
787
+ provider: "extension",
788
+ requires_extension: true,
789
+ command_path: resolveActionCommandPath(action)
790
+ });
791
+ }
792
+ }
793
+ for (const contract of extensionContracts) {
794
+ if (descriptors.has(contract.action)) {
795
+ continue;
796
+ }
797
+ descriptors.set(contract.action, {
798
+ action: contract.action,
799
+ provider: "extension",
800
+ requires_extension: true,
801
+ command_path: normalizeCommandPath(contract.command)
802
+ });
803
+ }
804
+ return [...descriptors.values()].sort((left, right) => (left.action ?? "").localeCompare(right.action ?? ""));
805
+ }
806
+ function resolveActionAvailability(descriptor, runtimeProbe) {
807
+ if (descriptor.provider === "core" && !descriptor.requires_extension) {
808
+ return {
809
+ action: descriptor.action,
810
+ invocable: true,
811
+ available: true,
812
+ requires_extension: false,
813
+ provider: "core",
814
+ disabled_reason: null,
815
+ command_path: descriptor.command_path,
816
+ cli_exposed: descriptor.command_path !== null
817
+ };
818
+ }
819
+ const commandPaths = descriptor.command_path ? splitCommandPathAliases(descriptor.command_path) : [];
820
+ const extensionCommandAvailable = commandPaths.some((commandPath) => runtimeProbe.handlers.has(commandPath));
821
+ const optionalPackageHint = commandPaths.map((commandPath) => PACKAGE_OWNED_COMMAND_INSTALL_HINTS.get(commandPath)).find((hint) => typeof hint === "string");
822
+ const invocable = runtimeProbe.disabledReason === null && extensionCommandAvailable;
823
+ return {
824
+ action: descriptor.action,
825
+ invocable,
826
+ available: invocable,
827
+ requires_extension: true,
828
+ provider: "extension",
829
+ disabled_reason: invocable ? null : runtimeProbe.disabledReason ?? (optionalPackageHint ? `optional_package_not_installed:${optionalPackageHint}` : "extension_command_not_registered"),
830
+ command_path: descriptor.command_path,
831
+ cli_exposed: extensionCommandAvailable,
832
+ policy_state: {
833
+ mode: runtimeProbe.policyState.mode,
834
+ trust_mode: runtimeProbe.policyState.trust_mode,
835
+ default_sandbox_profile: runtimeProbe.policyState.default_sandbox_profile
836
+ }
837
+ };
838
+ }
839
+ function resolveCoreCommandFlags(command) {
840
+ return CORE_COMMAND_FLAG_CONTRACTS_BY_COMMAND.get(command) ?? GLOBAL_FLAG_CONTRACTS;
841
+ }
842
+ function isCoreCommandPath(command) {
843
+ if (PACKAGE_OWNED_COMMANDS.has(command)) {
844
+ return false;
845
+ }
846
+ return CORE_COMMAND_FLAG_CONTRACTS_BY_COMMAND.has(command);
847
+ }
848
+ function normalizeCommandForRuntimeFieldFlags(command) {
849
+ if (LIST_COMMAND_NAMES.has(command)) {
850
+ return "list";
851
+ }
852
+ if (command === "cal") {
853
+ return "calendar";
854
+ }
855
+ if (command === "ctx") {
856
+ return "context";
857
+ }
858
+ if (command === "update-many") {
859
+ return "update_many";
860
+ }
861
+ return command;
862
+ }
863
+ function toRuntimeLongFlagToken(token) {
864
+ const trimmed = token.trim();
865
+ if (!trimmed) {
866
+ return null;
867
+ }
868
+ if (trimmed.startsWith("--")) {
869
+ return trimmed;
870
+ }
871
+ if (trimmed.startsWith("-")) {
872
+ return null;
873
+ }
874
+ return `--${trimmed}`;
875
+ }
876
+ function toRuntimeShortFlagToken(token) {
877
+ const trimmed = token.trim();
878
+ if (!trimmed) {
879
+ return null;
880
+ }
881
+ if (trimmed.startsWith("--")) {
882
+ return null;
883
+ }
884
+ if (trimmed.startsWith("-")) {
885
+ return trimmed;
886
+ }
887
+ return null;
888
+ }
889
+ function buildRuntimeFieldFlagContracts(fieldRegistry) {
890
+ const buckets = /* @__PURE__ */ new Map();
891
+ for (const definition of fieldRegistry.definitions) {
892
+ const primaryFlag = toRuntimeLongFlagToken(definition.cli_flag);
893
+ if (!primaryFlag) {
894
+ continue;
895
+ }
896
+ const shortAlias = definition.cli_aliases.map((alias) => toRuntimeShortFlagToken(alias)).find((alias) => alias !== null);
897
+ const longAliases = definition.cli_aliases.map((alias) => toRuntimeLongFlagToken(alias)).filter((alias) => alias !== null && alias !== primaryFlag);
898
+ for (const command of definition.commands) {
899
+ const bucket = buckets.get(command) ?? {
900
+ flags: [],
901
+ seen: /* @__PURE__ */ new Set()
902
+ };
903
+ const primaryContract = shortAlias ? { flag: primaryFlag, short: shortAlias } : { flag: primaryFlag };
904
+ const primaryKey = `${primaryContract.flag}|${primaryContract.short ?? ""}`;
905
+ if (!bucket.seen.has(primaryKey)) {
906
+ bucket.seen.add(primaryKey);
907
+ bucket.flags.push(primaryContract);
908
+ }
909
+ for (const alias of longAliases) {
910
+ const key = `${alias}|`;
911
+ if (bucket.seen.has(key)) {
912
+ continue;
913
+ }
914
+ bucket.seen.add(key);
915
+ bucket.flags.push({ flag: alias });
916
+ }
917
+ buckets.set(command, bucket);
918
+ }
919
+ }
920
+ const result = /* @__PURE__ */ new Map();
921
+ for (const [command, bucket] of buckets.entries()) {
922
+ result.set(command, compactFlagAliasContracts(bucket.flags));
923
+ }
924
+ return result;
925
+ }
926
+ function mergeFlagContracts(primary, secondary) {
927
+ const merged = [];
928
+ const seen = /* @__PURE__ */ new Set();
929
+ for (const contract of [...primary, ...secondary]) {
930
+ const key = `${contract.flag}|${contract.short ?? ""}`;
931
+ if (seen.has(key)) {
932
+ continue;
933
+ }
934
+ seen.add(key);
935
+ merged.push(contract);
936
+ }
937
+ return compactFlagAliasContracts(merged);
938
+ }
939
+ function buildCommandFlagSurface(commands, extensionFlagMap, runtimeFieldFlagMap) {
940
+ return commands.map((command) => {
941
+ const isCoreCommand = isCoreCommandPath(command);
942
+ const coreFlags = isCoreCommand ? resolveCoreCommandFlags(command) : [];
943
+ const runtimeFlags = runtimeFieldFlagMap.get(normalizeCommandForRuntimeFieldFlags(command)) ?? [];
944
+ const extensionFlags = extensionFlagMap.get(command);
945
+ const coreWithRuntime = mergeFlagContracts(coreFlags, runtimeFlags);
946
+ const flags = mergeFlagContracts(coreWithRuntime, extensionFlags?.flags ?? []);
947
+ const provider = coreFlags.length > 0 && (extensionFlags?.flags.length ?? 0) > 0 ? "mixed" : isCoreCommand ? "core" : "extension";
948
+ return {
949
+ command,
950
+ flags,
951
+ provider,
952
+ extension_sources: extensionFlags?.sources
953
+ };
954
+ }).sort((left, right) => left.command.localeCompare(right.command));
955
+ }
956
+ function compactCommandAliasSurface(commands) {
957
+ const commandSet = new Set(commands);
958
+ const result = [];
959
+ for (const command of commands) {
960
+ const canonical = COMMAND_ALIAS_TO_CANONICAL.get(command);
961
+ if (canonical && commandSet.has(canonical)) {
962
+ continue;
963
+ }
964
+ result.push(command);
965
+ }
966
+ return result;
967
+ }
968
+ function buildCommandAliasSurface(commands) {
969
+ const commandSet = new Set(commands);
970
+ return CANONICAL_COMMAND_ALIASES.map((entry) => ({
971
+ canonical: entry.canonical,
972
+ aliases: entry.aliases.filter((alias) => commandSet.has(alias))
973
+ })).filter((entry) => commandSet.has(entry.canonical) && entry.aliases.length > 0);
974
+ }
975
+ function buildCommanderAliasSurface() {
976
+ return {
977
+ create_string_options: CREATE_COMMANDER_STRING_OPTION_CONTRACTS,
978
+ create_repeatable_options: CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,
979
+ update_string_options: UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,
980
+ update_repeatable_options: UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,
981
+ list_string_options: LIST_COMMANDER_STRING_OPTION_CONTRACTS,
982
+ search_string_options: SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,
983
+ calendar_string_options: CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,
984
+ context_string_options: CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,
985
+ activity_string_options: ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS
986
+ };
987
+ }
988
+ function resolveCreateRequiredOptionContract(typeDefinition, createMode) {
989
+ const baseRequiredOptions = /* @__PURE__ */ new Set(["title", "type"]);
990
+ if (createMode === "strict") {
991
+ for (const field of typeDefinition.required_create_fields) {
992
+ baseRequiredOptions.add(field);
993
+ }
994
+ for (const field of typeDefinition.required_create_repeatables) {
995
+ baseRequiredOptions.add(field);
996
+ }
997
+ }
998
+ const policyState = resolveCommandOptionPolicyState(typeDefinition, "create", baseRequiredOptions);
999
+ const requiredOptionKeys = [...new Set(policyState.required)].sort((left, right) => left.localeCompare(right));
1000
+ const requiredFlags = [
1001
+ ...new Set(requiredOptionKeys.map((option) => commandOptionFlagLabel("create", option)))
1002
+ ].sort((left, right) => left.localeCompare(right));
1003
+ const requiredTypeOptions = [
1004
+ ...new Set(typeDefinition.options.filter((option) => option.required === true).map((option) => option.key))
1005
+ ].sort((left, right) => left.localeCompare(right));
1006
+ return {
1007
+ required_option_keys: requiredOptionKeys,
1008
+ required_flags: requiredFlags,
1009
+ required_type_options: requiredTypeOptions,
1010
+ policy_errors: [...new Set(policyState.errors)].sort((left, right) => left.localeCompare(right))
1011
+ };
1012
+ }
1013
+ function buildCreateRequiredOptionContracts(typeRegistry) {
1014
+ const byTypeStrict = {};
1015
+ const byTypeProgressive = {};
1016
+ for (const typeName of [...typeRegistry.types].sort((left, right) => left.localeCompare(right))) {
1017
+ const typeDefinition = typeRegistry.by_type[typeName];
1018
+ byTypeStrict[typeName] = resolveCreateRequiredOptionContract(typeDefinition, "strict");
1019
+ byTypeProgressive[typeName] = resolveCreateRequiredOptionContract(typeDefinition, "progressive");
1020
+ }
1021
+ return {
1022
+ default_create_mode: "strict",
1023
+ by_create_mode: {
1024
+ strict: {
1025
+ by_type: byTypeStrict
1026
+ },
1027
+ progressive: {
1028
+ by_type: byTypeProgressive
1029
+ }
1030
+ }
1031
+ };
1032
+ }
1033
+ function attachCreateRequiredOptionContracts(schema, metadata) {
1034
+ const branches = extractActionBranches(schema);
1035
+ if (branches.length === 0) {
1036
+ return schema;
1037
+ }
1038
+ let touched = false;
1039
+ const enrichedBranches = branches.map((branch) => {
1040
+ const properties = branch.properties;
1041
+ if (typeof properties !== "object" || properties === null) {
1042
+ return branch;
1043
+ }
1044
+ const actionProperty = properties.action;
1045
+ if (typeof actionProperty !== "object" || actionProperty === null) {
1046
+ return branch;
1047
+ }
1048
+ if (actionProperty.const !== "create") {
1049
+ return branch;
1050
+ }
1051
+ touched = true;
1052
+ return {
1053
+ ...branch,
1054
+ "x-create-required-options": metadata
1055
+ };
1056
+ });
1057
+ if (!touched) {
1058
+ return schema;
1059
+ }
1060
+ return {
1061
+ ...schema,
1062
+ oneOf: enrichedBranches
1063
+ };
1064
+ }
1065
+ async function runContracts(options, global) {
1066
+ const selectedAction = normalizeToken(options.action);
1067
+ const selectedCommand = normalizeToken(options.command);
1068
+ const schemaOnly = options.schemaOnly === true;
1069
+ const flagsOnly = options.flagsOnly === true;
1070
+ const availabilityOnly = options.availabilityOnly === true;
1071
+ const runtimeOnly = options.runtimeOnly === true;
1072
+ const fullOutput = options.full === true;
1073
+ const unfilteredDefaultBriefMode = !fullOutput && !schemaOnly && !flagsOnly && !availabilityOnly && !selectedAction && !selectedCommand;
1074
+ const omitUnfilteredSchema = unfilteredDefaultBriefMode;
1075
+ const omitUnfilteredCommandFlags = unfilteredDefaultBriefMode;
1076
+ const omitUnfilteredCommanderAliases = unfilteredDefaultBriefMode;
1077
+ const projectionFlagsEnabled = [
1078
+ schemaOnly,
1079
+ flagsOnly,
1080
+ availabilityOnly
1081
+ ].filter((value) => value).length;
1082
+ if (projectionFlagsEnabled > 1) {
1083
+ throw new PmCliError("Choose only one projection flag: --schema-only, --flags-only, or --availability-only.", EXIT_CODE.USAGE);
1084
+ }
1085
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
1086
+ let settings = structuredClone(SETTINGS_DEFAULTS);
1087
+ try {
1088
+ settings = await readSettings(pmRoot);
1089
+ } catch {
1090
+ settings = structuredClone(SETTINGS_DEFAULTS);
1091
+ }
1092
+ const runtimeProbe = await resolveRuntimeExtensionActionProbe(global);
1093
+ const typeRegistry = resolveItemTypeRegistry(settings, runtimeProbe.registrations ?? getActiveExtensionRegistrations());
1094
+ const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
1095
+ const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
1096
+ const runtimeFieldFlagMap = buildRuntimeFieldFlagContracts(runtimeFieldRegistry);
1097
+ const createRequiredOptionContracts = buildCreateRequiredOptionContracts(typeRegistry);
1098
+ const extensionContracts = collectExtensionCommandContracts(runtimeProbe);
1099
+ const mergedExtensionContracts = mergeExtensionContractsByAction(extensionContracts);
1100
+ const extensionFlagMap = collectExtensionFlagContractsByCommand(runtimeProbe.flagRegistrations);
1101
+ const includePackageOwnedActions = selectedAction !== void 0 && PACKAGE_OWNED_ACTIONS.has(selectedAction) && availabilityOnly || selectedCommand !== void 0 && PACKAGE_OWNED_COMMANDS.has(selectedCommand) && availabilityOnly;
1102
+ const actionDescriptors = collectActionContractDescriptors(mergedExtensionContracts, { includePackageOwnedActions });
1103
+ if (includePackageOwnedActions && selectedCommand !== void 0 && PACKAGE_OWNED_COMMANDS.has(selectedCommand) && !actionDescriptors.some((entry) => entry.command_path === selectedCommand)) {
1104
+ actionDescriptors.push({
1105
+ action: packageOwnedActionForCommand(selectedCommand),
1106
+ provider: "extension",
1107
+ requires_extension: true,
1108
+ command_path: selectedCommand
1109
+ });
1110
+ }
1111
+ const actionNames = new Set(actionDescriptors.map((entry) => entry.action));
1112
+ if (selectedAction && !actionNames.has(selectedAction)) {
1113
+ throw new PmCliError(`Unknown action: "${options.action}".`, EXIT_CODE.USAGE);
1114
+ }
1115
+ const commandCatalog = [
1116
+ .../* @__PURE__ */ new Set([
1117
+ ...PM_CORE_COMMAND_NAMES.filter((entry) => !PACKAGE_OWNED_COMMANDS.has(entry)),
1118
+ ...[...CORE_COMMAND_FLAG_CONTRACTS_BY_COMMAND.keys()].filter((entry) => !PACKAGE_OWNED_COMMANDS.has(entry)),
1119
+ ...actionDescriptors.flatMap((entry) => entry.command_path ? splitCommandPathAliases(entry.command_path) : []),
1120
+ ...mergedExtensionContracts.flatMap((entry) => entry.command.split("|"))
1121
+ ])
1122
+ ].map((entry) => normalizeCommandPath(entry)).filter((entry) => entry.length > 0).sort((left, right) => left.localeCompare(right));
1123
+ const commandNames = new Set(commandCatalog);
1124
+ if (selectedCommand && !commandNames.has(selectedCommand)) {
1125
+ const packageHint = PACKAGE_OWNED_COMMAND_INSTALL_HINTS.get(selectedCommand);
1126
+ if (packageHint) {
1127
+ throw new PmCliError(`Unknown command: "${options.command}". Command "${selectedCommand}" is provided by the optional "${packageHint}" package. Run "pm install ${packageHint} --project" and retry.`, EXIT_CODE.USAGE, {
1128
+ code: "unknown_command",
1129
+ required: `Install the optional "${packageHint}" package, or choose a command from pm contracts --flags-only --json.`,
1130
+ why: "Command contracts include core commands plus commands registered by active packages and extensions.",
1131
+ examples: [`pm install ${packageHint} --project`, `pm contracts --command ${selectedCommand} --flags-only --json`],
1132
+ nextSteps: [`Install the optional package first: pm install ${packageHint} --project`],
1133
+ recovery: {
1134
+ suggested_retry: `pm install ${packageHint} --project`
1135
+ }
1136
+ });
1137
+ }
1138
+ throw new PmCliError(`Unknown command: "${options.command}".`, EXIT_CODE.USAGE, {
1139
+ code: "unknown_command",
1140
+ required: "Use a command path listed by pm contracts --flags-only --json.",
1141
+ why: "Command contracts are generated from the active core, package, and extension command registry.",
1142
+ examples: ["pm contracts --flags-only --json", "pm --help"],
1143
+ nextSteps: ["Verify spelling and active packages/extensions, then rerun with a known command path."],
1144
+ recovery: {
1145
+ suggested_retry: "pm contracts --flags-only --json"
1146
+ }
1147
+ });
1148
+ }
1149
+ const selectedPackageOwnedAction = selectedCommand ? PACKAGE_OWNED_COMMAND_ACTIONS.get(selectedCommand) : void 0;
1150
+ const commandScopedDescriptors = selectedCommand ? actionDescriptors.filter((descriptor) => selectedPackageOwnedAction ? descriptor.action === selectedPackageOwnedAction : actionDescriptorMatchesSelectedCommand(descriptor, selectedCommand)) : actionDescriptors;
1151
+ if (selectedCommand && selectedAction && !commandScopedDescriptors.some((descriptor) => descriptor.action === selectedAction)) {
1152
+ throw new PmCliError(`Action "${options.action}" is not mapped to command "${options.command}" in contracts output.`, EXIT_CODE.USAGE);
1153
+ }
1154
+ const schema = PM_TOOL_PARAMETERS_SCHEMA;
1155
+ const schemaBranches = extractActionBranches(schema);
1156
+ const schemaActionSet = new Set(schemaBranches.map((entry) => {
1157
+ const properties = entry.properties;
1158
+ if (typeof properties !== "object" || properties === null) {
1159
+ return null;
1160
+ }
1161
+ const actionProperty = properties.action;
1162
+ if (typeof actionProperty !== "object" || actionProperty === null) {
1163
+ return null;
1164
+ }
1165
+ const actionConst = actionProperty.const;
1166
+ return typeof actionConst === "string" ? actionConst : null;
1167
+ }).filter((entry) => entry !== null));
1168
+ const extensionBranches = mergedExtensionContracts.filter((contract) => !schemaActionSet.has(contract.action)).map((contract) => buildExtensionActionSchemaBranch(contract));
1169
+ const mergedSchema = extensionBranches.length > 0 ? {
1170
+ ...schema,
1171
+ oneOf: [...schemaBranches, ...extensionBranches]
1172
+ } : schema;
1173
+ const scopedActionDescriptors = selectedAction ? commandScopedDescriptors.filter((descriptor) => descriptor.action === selectedAction) : commandScopedDescriptors;
1174
+ const allActionAvailability = [
1175
+ ...new Map(scopedActionDescriptors.map((descriptor) => resolveActionAvailability(descriptor, runtimeProbe)).map((entry) => [
1176
+ selectedPackageOwnedAction ? entry.action : `${entry.action}|${entry.command_path ?? ""}`,
1177
+ entry
1178
+ ])).values()
1179
+ ];
1180
+ const actionAvailability = runtimeOnly && !selectedAction && !availabilityOnly ? allActionAvailability.filter((entry) => entry.invocable) : allActionAvailability;
1181
+ const actions = [...new Set(actionAvailability.map((entry) => entry.action))];
1182
+ const descriptorActionSet = new Set(actionDescriptors.map((descriptor) => descriptor.action));
1183
+ let filteredSchema = selectedAction ? filterSchemaByAction(mergedSchema, selectedAction) : selectedCommand ? filterSchemaByActions(mergedSchema, new Set(scopedActionDescriptors.map((descriptor) => descriptor.action))) : filterSchemaByActions(mergedSchema, descriptorActionSet);
1184
+ if (runtimeOnly && !selectedAction) {
1185
+ filteredSchema = filterSchemaByActions(filteredSchema, new Set(actions));
1186
+ }
1187
+ const includeSchemaSurface = !flagsOnly && !availabilityOnly;
1188
+ if (includeSchemaSurface) {
1189
+ filteredSchema = attachCreateRequiredOptionContracts(filteredSchema, createRequiredOptionContracts);
1190
+ }
1191
+ const commands = selectedCommand !== void 0 ? [selectedCommand] : selectedAction ? resolveScopedCommandsFromActionDescriptors(scopedActionDescriptors, commandCatalog) : commandCatalog;
1192
+ const outputCommands = flagsOnly && selectedCommand === void 0 && selectedAction === void 0 ? compactCommandAliasSurface(commands) : commands;
1193
+ const commandAliases = buildCommandAliasSurface(commands);
1194
+ const extensionCommandContracts = selectedCommand ? extensionContracts.filter((entry) => entry.command === selectedCommand) : selectedAction ? extensionContracts.filter((entry) => outputCommands.includes(normalizeCommandPath(entry.command))) : extensionContracts;
1195
+ const includeRuntimeContractSections = !(flagsOnly && !fullOutput);
1196
+ const result = {
1197
+ schema_version: typeof mergedSchema["x-schema-version"] === "string" ? mergedSchema["x-schema-version"] : null,
1198
+ schema_id: typeof mergedSchema.$id === "string" ? mergedSchema.$id : null,
1199
+ selected: {
1200
+ action: selectedAction ?? null,
1201
+ command: selectedCommand ?? null,
1202
+ schema_only: schemaOnly,
1203
+ flags_only: flagsOnly,
1204
+ availability_only: availabilityOnly,
1205
+ runtime_only: runtimeOnly,
1206
+ command_scoped: selectedCommand !== void 0
1207
+ },
1208
+ commands: outputCommands
1209
+ };
1210
+ if (includeRuntimeContractSections) {
1211
+ result.runtime_schema = {
1212
+ statuses: statusRegistry.definitions.map((definition) => definition.id),
1213
+ open_status: statusRegistry.open_status,
1214
+ close_status: statusRegistry.close_status,
1215
+ canceled_status: statusRegistry.canceled_status,
1216
+ types: [...typeRegistry.types],
1217
+ fields_by_command: Object.fromEntries([...runtimeFieldRegistry.command_to_fields.entries()].map(([command, definitions]) => [
1218
+ command,
1219
+ [
1220
+ ...new Set(definitions.map((definition) => `--${definition.cli_flag}`))
1221
+ ].sort((left, right) => left.localeCompare(right))
1222
+ ]))
1223
+ };
1224
+ result.extension_contracts = {
1225
+ capabilities: [...PM_EXTENSION_CAPABILITY_CONTRACTS],
1226
+ services: [...PM_EXTENSION_SERVICE_NAME_CONTRACTS],
1227
+ policy_modes: [...PM_EXTENSION_POLICY_MODE_CONTRACTS],
1228
+ policy_surfaces: [...PM_EXTENSION_POLICY_SURFACE_CONTRACTS],
1229
+ trust_modes: [...PM_EXTENSION_TRUST_MODE_CONTRACTS],
1230
+ sandbox_profiles: [...PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS],
1231
+ manifest_versions: [1, 2],
1232
+ compatibility: {
1233
+ current: "v2",
1234
+ previous: ["v1"],
1235
+ breaking_strategy: "versioned_breaking"
1236
+ }
1237
+ };
1238
+ }
1239
+ if (!flagsOnly) {
1240
+ result.actions = actions;
1241
+ result.action_availability = actionAvailability;
1242
+ }
1243
+ if (includeSchemaSurface && !omitUnfilteredSchema) {
1244
+ result.schema = filteredSchema;
1245
+ result.extension_commands = extensionCommandContracts;
1246
+ } else if (includeSchemaSurface && omitUnfilteredSchema) {
1247
+ result.schema_omitted_reason = "unfiltered_default_brief";
1248
+ result.extension_commands = extensionCommandContracts;
1249
+ }
1250
+ if (!schemaOnly && !availabilityOnly) {
1251
+ if (!omitUnfilteredCommandFlags) {
1252
+ result.command_flags = buildCommandFlagSurface(outputCommands, extensionFlagMap, runtimeFieldFlagMap);
1253
+ } else {
1254
+ result.command_flags_omitted_reason = "unfiltered_default_brief";
1255
+ }
1256
+ if (commandAliases.length > 0) {
1257
+ result.command_aliases = commandAliases;
1258
+ }
1259
+ }
1260
+ if (!schemaOnly && !flagsOnly && !availabilityOnly) {
1261
+ if (!omitUnfilteredCommanderAliases) {
1262
+ result.commander_aliases = buildCommanderAliasSurface();
1263
+ } else {
1264
+ result.commander_aliases_omitted_reason = "unfiltered_default_brief";
1265
+ }
1266
+ }
1267
+ return result;
1268
+ }
1269
+ export {
1270
+ runContracts
1271
+ };
1272
+ //# sourceMappingURL=contracts-LCSX5R53.js.map
1273
+
1274
+ //# debugId=6f013070-45a6-59da-9a3f-d7582c1bc681