@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,780 @@
1
+ import {
2
+ assertAliasesAvailable,
3
+ buildInvalidTypeHint,
4
+ escapeForDoubleQuotes,
5
+ normalizeAddTypeInput,
6
+ parseItemTypesFile,
7
+ removeItemType,
8
+ serializeItemTypesFile,
9
+ upsertItemType
10
+ } from "./chunk-KK6YPGH3.js";
11
+ import {
12
+ acquireLock,
13
+ listAllFrontMatterLight
14
+ } from "./chunk-XG7RJYHV.js";
15
+ import "./chunk-KA24HME7.js";
16
+ import "./chunk-HPH6X4ZZ.js";
17
+ import {
18
+ resolveItemTypeRegistry
19
+ } from "./chunk-4PJQSECJ.js";
20
+ import {
21
+ nowIso
22
+ } from "./chunk-RANZIID5.js";
23
+ import {
24
+ DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
25
+ DEFAULT_RUNTIME_STATUS_DEFINITIONS,
26
+ EXIT_CODE,
27
+ PmCliError,
28
+ RUNTIME_STATUS_ROLE_VALUES,
29
+ filePathForSchemaSection,
30
+ getActiveExtensionRegistrations,
31
+ getSettingsPath,
32
+ normalizeRuntimeSchemaSettings,
33
+ pathExists,
34
+ readFileIfExists,
35
+ readSettings,
36
+ resolveGovernanceKnobs,
37
+ resolvePmRoot,
38
+ resolveRuntimeStatusRegistry,
39
+ runActiveOnWriteHooks,
40
+ writeFileAtomic
41
+ } from "./chunk-SRVKTWPR.js";
42
+
43
+ // dist/core/schema/status-defs-file.js
44
+ !(function() {
45
+ try {
46
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
47
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d738db07-1d64-5ab0-9ebd-f9c9f6de5706");
48
+ } catch (e2) {
49
+ }
50
+ })();
51
+ var RUNTIME_STATUS_ROLE_SET = new Set(RUNTIME_STATUS_ROLE_VALUES);
52
+ var BUILTIN_STATUS_IDS = new Set(DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) => normalizeStatusToken(definition.id)).filter((id) => id.length > 0));
53
+ function normalizeStatusToken(value) {
54
+ return typeof value === "string" ? value.trim().toLowerCase().replaceAll(/[\s-]+/g, "_") : "";
55
+ }
56
+ function dedupeTokens(values) {
57
+ const seen = /* @__PURE__ */ new Set();
58
+ for (const value of values) {
59
+ const token = normalizeStatusToken(value);
60
+ if (token.length > 0) {
61
+ seen.add(token);
62
+ }
63
+ }
64
+ return [...seen].sort((left, right) => left.localeCompare(right));
65
+ }
66
+ function normalizeAddStatusInput(raw) {
67
+ const id = normalizeStatusToken(raw.id);
68
+ if (id.length === 0) {
69
+ throw new Error("Status id must not be empty.");
70
+ }
71
+ if (BUILTIN_STATUS_IDS.has(id)) {
72
+ throw new Error(`Cannot add-status the built-in status "${id}". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(", ")}.`);
73
+ }
74
+ let roles;
75
+ if (raw.roles !== void 0) {
76
+ roles = [];
77
+ const seenRoles = /* @__PURE__ */ new Set();
78
+ for (const rawRole of raw.roles) {
79
+ const role = typeof rawRole === "string" ? rawRole.trim().toLowerCase() : "";
80
+ if (role.length === 0) {
81
+ continue;
82
+ }
83
+ if (!RUNTIME_STATUS_ROLE_SET.has(role)) {
84
+ throw new Error(`Invalid status role "${rawRole}". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(", ")}.`);
85
+ }
86
+ if (!seenRoles.has(role)) {
87
+ seenRoles.add(role);
88
+ roles.push(role);
89
+ }
90
+ }
91
+ }
92
+ const aliases = raw.aliases === void 0 ? void 0 : dedupeTokens(raw.aliases).filter((alias) => alias !== id);
93
+ const description = raw.description?.trim();
94
+ const order = typeof raw.order === "number" && Number.isFinite(raw.order) ? Math.trunc(raw.order) : void 0;
95
+ return {
96
+ id,
97
+ roles,
98
+ aliases,
99
+ description: description && description.length > 0 ? description : void 0,
100
+ order
101
+ };
102
+ }
103
+ function selectStatusesArray(parsed) {
104
+ if (Array.isArray(parsed)) {
105
+ return parsed;
106
+ }
107
+ if (typeof parsed !== "object" || parsed === null) {
108
+ return void 0;
109
+ }
110
+ const record = parsed;
111
+ if (Array.isArray(record.statuses)) {
112
+ return record.statuses;
113
+ }
114
+ if (Array.isArray(record.definitions)) {
115
+ return record.definitions;
116
+ }
117
+ return void 0;
118
+ }
119
+ function extractStatusDefinitions(parsed) {
120
+ const candidate = selectStatusesArray(parsed);
121
+ if (!candidate) {
122
+ return [];
123
+ }
124
+ const definitions = [];
125
+ for (const entry of candidate) {
126
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
127
+ continue;
128
+ }
129
+ const record = entry;
130
+ if (typeof record.id !== "string" || record.id.trim().length === 0) {
131
+ continue;
132
+ }
133
+ definitions.push(record);
134
+ }
135
+ return definitions;
136
+ }
137
+ function parseStatusDefsFile(raw) {
138
+ if (raw === null || raw === void 0 || raw.trim().length === 0) {
139
+ return { statuses: [] };
140
+ }
141
+ let parsed;
142
+ try {
143
+ parsed = JSON.parse(raw);
144
+ } catch {
145
+ throw new Error("schema/statuses.json contains invalid JSON.");
146
+ }
147
+ return { statuses: extractStatusDefinitions(parsed) };
148
+ }
149
+ function serializeStatusDefsFile(file) {
150
+ return `${JSON.stringify({ statuses: file.statuses }, null, 2)}
151
+ `;
152
+ }
153
+ function upsertStatusDef(file, input, baseDefinition) {
154
+ const statuses = file.statuses.slice();
155
+ const existingIndex = statuses.findIndex((definition) => normalizeStatusToken(definition.id) === input.id);
156
+ const existing = existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;
157
+ const next = {
158
+ ...existing ?? {},
159
+ id: input.id
160
+ };
161
+ if (input.roles !== void 0) {
162
+ if (input.roles.length > 0) {
163
+ next.roles = [...input.roles];
164
+ } else if (next.roles !== void 0) {
165
+ delete next.roles;
166
+ }
167
+ }
168
+ if (input.aliases !== void 0) {
169
+ if (input.aliases.length > 0) {
170
+ next.aliases = [...input.aliases];
171
+ } else if (next.aliases !== void 0) {
172
+ delete next.aliases;
173
+ }
174
+ }
175
+ if (input.description !== void 0) {
176
+ next.description = input.description;
177
+ }
178
+ if (input.order !== void 0) {
179
+ next.order = input.order;
180
+ }
181
+ if (existingIndex >= 0) {
182
+ statuses[existingIndex] = next;
183
+ } else {
184
+ statuses.push(next);
185
+ }
186
+ return {
187
+ file: { statuses },
188
+ definition: next,
189
+ // "replaced" reflects whether the status already existed effectively (in the
190
+ // file OR in resolved settings), so the CLI reports "Updated" vs "Registered"
191
+ // correctly even when the prior definition lived only in settings.
192
+ replaced: existing !== void 0
193
+ };
194
+ }
195
+ function removeStatusDef(file, id) {
196
+ const normalizedId = normalizeStatusToken(id);
197
+ if (normalizedId.length === 0) {
198
+ throw new Error("Status id must not be empty.");
199
+ }
200
+ if (BUILTIN_STATUS_IDS.has(normalizedId)) {
201
+ throw new Error(`Cannot remove built-in status "${normalizedId}". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(", ")}.`);
202
+ }
203
+ const statuses = file.statuses.slice();
204
+ const existingIndex = statuses.findIndex((definition2) => normalizeStatusToken(definition2.id) === normalizedId);
205
+ if (existingIndex < 0) {
206
+ return { file: { statuses }, removed: false };
207
+ }
208
+ const [definition] = statuses.splice(existingIndex, 1);
209
+ return { file: { statuses }, removed: true, definition };
210
+ }
211
+ function assertStatusTokensAvailable(input, resolvedAliasToId) {
212
+ const candidates = [input.id, ...input.aliases ?? []];
213
+ for (const candidate of candidates) {
214
+ const token = normalizeStatusToken(candidate);
215
+ if (token.length === 0) {
216
+ continue;
217
+ }
218
+ const owner = resolvedAliasToId.get(token);
219
+ if (owner !== void 0 && owner !== input.id) {
220
+ throw new Error(`Status token "${token}" already belongs to status "${owner}". Choose a different id/alias to avoid shadowing it.`);
221
+ }
222
+ }
223
+ }
224
+
225
+ // dist/cli/commands/schema.js
226
+ !(function() {
227
+ try {
228
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
229
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "3ffacab6-b0b2-5c73-a13b-cd559b219adf");
230
+ } catch (e2) {
231
+ }
232
+ })();
233
+ var SCHEMA_SUBCOMMANDS = ["add-type", "remove-type", "add-status", "remove-status", "list", "show"];
234
+ var SCHEMA_TYPES_LOCK_ID = "schema-types";
235
+ var SCHEMA_STATUSES_LOCK_ID = "schema-statuses";
236
+ function toAuthor(candidate, defaultAuthor) {
237
+ const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;
238
+ const trimmed = resolved.trim();
239
+ return trimmed.length > 0 ? trimmed : "unknown";
240
+ }
241
+ async function runSchemaAddType(name, options, global2) {
242
+ const pmRoot = resolvePmRoot(process.cwd(), global2.path);
243
+ if (!await pathExists(getSettingsPath(pmRoot))) {
244
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
245
+ }
246
+ let normalized;
247
+ try {
248
+ normalized = normalizeAddTypeInput({
249
+ name,
250
+ description: options.description,
251
+ defaultStatus: options.defaultStatus,
252
+ folder: options.folder,
253
+ aliases: options.alias
254
+ });
255
+ } catch (error) {
256
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
257
+ }
258
+ const settings = await readSettings(pmRoot);
259
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
260
+ const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
261
+ const warnings = [];
262
+ const author = toAuthor(options.author, settings.author_default);
263
+ const governance = resolveGovernanceKnobs(settings);
264
+ const releaseLock = await acquireLock(pmRoot, SCHEMA_TYPES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
265
+ let upsert;
266
+ try {
267
+ const previousRaw = await readFileIfExists(typesPath);
268
+ let parsed;
269
+ try {
270
+ parsed = parseItemTypesFile(previousRaw);
271
+ } catch (error) {
272
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
273
+ }
274
+ try {
275
+ assertAliasesAvailable(normalized, parsed);
276
+ } catch (error) {
277
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
278
+ }
279
+ upsert = upsertItemType(parsed, normalized);
280
+ await writeFileAtomic(typesPath, serializeItemTypesFile(upsert.file));
281
+ warnings.push(...await runActiveOnWriteHooks({
282
+ path: typesPath,
283
+ scope: "project",
284
+ op: "schema:add-type"
285
+ }));
286
+ } finally {
287
+ await releaseLock();
288
+ }
289
+ return {
290
+ action: "add-type",
291
+ registered: true,
292
+ replaced: upsert.replaced,
293
+ type: upsert.definition,
294
+ file: {
295
+ path: typesPath,
296
+ definitions: upsert.file.definitions.length
297
+ },
298
+ warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
299
+ generated_at: nowIso()
300
+ };
301
+ }
302
+ async function ensureInitialized(pmRoot) {
303
+ if (!await pathExists(getSettingsPath(pmRoot))) {
304
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
305
+ }
306
+ }
307
+ async function countItemsUsingType(pmRoot, settings, schema, typeName) {
308
+ const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
309
+ const lowerName = typeName.trim().toLowerCase();
310
+ const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);
311
+ return items.filter((item) => typeof item.type === "string" && item.type.toLowerCase() === lowerName).length;
312
+ }
313
+ async function countItemsUsingStatus(pmRoot, settings, schema, statusId) {
314
+ const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
315
+ const statusRegistry = resolveRuntimeStatusRegistry(schema);
316
+ const normalizedId = normalizeStatusToken(statusId);
317
+ const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);
318
+ return items.filter((item) => {
319
+ const itemStatus = typeof item.status === "string" ? item.status : "";
320
+ const resolved = statusRegistry.alias_to_id.get(normalizeStatusToken(itemStatus)) ?? normalizeStatusToken(itemStatus);
321
+ return resolved === normalizedId;
322
+ }).length;
323
+ }
324
+ function workflowSlotsReferencing(workflow, statusId) {
325
+ const slots = [
326
+ ["draft_status", workflow.draft_status],
327
+ ["open_status", workflow.open_status],
328
+ ["in_progress_status", workflow.in_progress_status],
329
+ ["blocked_status", workflow.blocked_status],
330
+ ["close_status", workflow.close_status],
331
+ ["canceled_status", workflow.canceled_status]
332
+ ];
333
+ return slots.filter(([, value]) => value !== void 0 && normalizeStatusToken(value) === statusId).map(([slot]) => slot);
334
+ }
335
+ async function runSchemaRemoveType(name, options, global2) {
336
+ const pmRoot = resolvePmRoot(process.cwd(), global2.path);
337
+ await ensureInitialized(pmRoot);
338
+ const settings = await readSettings(pmRoot);
339
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
340
+ const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
341
+ const warnings = [];
342
+ const author = toAuthor(options.author, settings.author_default);
343
+ const governance = resolveGovernanceKnobs(settings);
344
+ const releaseLock = await acquireLock(pmRoot, SCHEMA_TYPES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
345
+ let removal;
346
+ try {
347
+ const previousRaw = await readFileIfExists(typesPath);
348
+ let parsed;
349
+ try {
350
+ parsed = parseItemTypesFile(previousRaw);
351
+ } catch (error) {
352
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
353
+ }
354
+ try {
355
+ removal = removeItemType(parsed, name);
356
+ } catch (error) {
357
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
358
+ }
359
+ if (removal.removed) {
360
+ const removedName = (removal.definition?.name ?? name ?? "").trim();
361
+ if (removedName.length > 0) {
362
+ const usingType = await countItemsUsingType(pmRoot, settings, schema, removedName);
363
+ if (usingType > 0) {
364
+ warnings.push(`items_using_type:${usingType}`);
365
+ }
366
+ }
367
+ await writeFileAtomic(typesPath, serializeItemTypesFile(removal.file));
368
+ warnings.push(...await runActiveOnWriteHooks({
369
+ path: typesPath,
370
+ scope: "project",
371
+ op: "schema:remove-type"
372
+ }));
373
+ }
374
+ } finally {
375
+ await releaseLock();
376
+ }
377
+ return {
378
+ action: "remove-type",
379
+ removed: removal.removed,
380
+ ...removal.definition ? { type: removal.definition } : {},
381
+ file: {
382
+ path: typesPath,
383
+ definitions: removal.file.definitions.length
384
+ },
385
+ warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
386
+ generated_at: nowIso()
387
+ };
388
+ }
389
+ function statusesPathFor(pmRoot, schema) {
390
+ return filePathForSchemaSection(pmRoot, schema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses);
391
+ }
392
+ async function runSchemaAddStatus(id, options, global2) {
393
+ const pmRoot = resolvePmRoot(process.cwd(), global2.path);
394
+ await ensureInitialized(pmRoot);
395
+ let normalized;
396
+ try {
397
+ normalized = normalizeAddStatusInput({
398
+ id,
399
+ roles: options.role,
400
+ aliases: options.alias,
401
+ description: options.description,
402
+ order: options.order
403
+ });
404
+ } catch (error) {
405
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
406
+ }
407
+ const settings = await readSettings(pmRoot);
408
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
409
+ const statusesPath = statusesPathFor(pmRoot, schema);
410
+ const statusRegistry = resolveRuntimeStatusRegistry(schema);
411
+ try {
412
+ assertStatusTokensAvailable(normalized, statusRegistry.alias_to_id);
413
+ } catch (error) {
414
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
415
+ }
416
+ const resolvedExisting = statusRegistry.by_id.get(normalized.id);
417
+ const baseDefinition = resolvedExisting ? {
418
+ id: resolvedExisting.id,
419
+ ...Array.isArray(resolvedExisting.roles) && resolvedExisting.roles.length > 0 ? { roles: [...resolvedExisting.roles] } : {},
420
+ ...Array.isArray(resolvedExisting.aliases) && resolvedExisting.aliases.length > 0 ? { aliases: [...resolvedExisting.aliases] } : {},
421
+ ...resolvedExisting.description ? { description: resolvedExisting.description } : {},
422
+ ...typeof resolvedExisting.order === "number" ? { order: resolvedExisting.order } : {}
423
+ } : void 0;
424
+ const warnings = [];
425
+ const author = toAuthor(options.author, settings.author_default);
426
+ const governance = resolveGovernanceKnobs(settings);
427
+ const releaseLock = await acquireLock(pmRoot, SCHEMA_STATUSES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
428
+ let upsert;
429
+ try {
430
+ const previousRaw = await readFileIfExists(statusesPath);
431
+ let parsed;
432
+ try {
433
+ parsed = parseStatusDefsFile(previousRaw);
434
+ } catch (error) {
435
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
436
+ }
437
+ const fileAliasToId = /* @__PURE__ */ new Map();
438
+ for (const definition of parsed.statuses) {
439
+ const defId = normalizeStatusToken(definition.id);
440
+ if (defId.length === 0) {
441
+ continue;
442
+ }
443
+ fileAliasToId.set(defId, defId);
444
+ for (const alias of Array.isArray(definition.aliases) ? definition.aliases : []) {
445
+ const aliasToken = normalizeStatusToken(alias);
446
+ if (aliasToken.length > 0 && !fileAliasToId.has(aliasToken)) {
447
+ fileAliasToId.set(aliasToken, defId);
448
+ }
449
+ }
450
+ }
451
+ try {
452
+ assertStatusTokensAvailable(normalized, fileAliasToId);
453
+ } catch (error) {
454
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
455
+ }
456
+ upsert = upsertStatusDef(parsed, normalized, baseDefinition);
457
+ await writeFileAtomic(statusesPath, serializeStatusDefsFile(upsert.file));
458
+ warnings.push(...await runActiveOnWriteHooks({
459
+ path: statusesPath,
460
+ scope: "project",
461
+ op: "schema:add-status"
462
+ }));
463
+ } finally {
464
+ await releaseLock();
465
+ }
466
+ return {
467
+ action: "add-status",
468
+ registered: true,
469
+ replaced: upsert.replaced,
470
+ status: upsert.definition,
471
+ file: {
472
+ path: statusesPath,
473
+ statuses: upsert.file.statuses.length
474
+ },
475
+ warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
476
+ generated_at: nowIso()
477
+ };
478
+ }
479
+ async function runSchemaRemoveStatus(id, options, global2) {
480
+ const pmRoot = resolvePmRoot(process.cwd(), global2.path);
481
+ await ensureInitialized(pmRoot);
482
+ const settings = await readSettings(pmRoot);
483
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
484
+ const statusesPath = statusesPathFor(pmRoot, schema);
485
+ const warnings = [];
486
+ const author = toAuthor(options.author, settings.author_default);
487
+ const governance = resolveGovernanceKnobs(settings);
488
+ const releaseLock = await acquireLock(pmRoot, SCHEMA_STATUSES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
489
+ let removal;
490
+ try {
491
+ const previousRaw = await readFileIfExists(statusesPath);
492
+ let parsed;
493
+ try {
494
+ parsed = parseStatusDefsFile(previousRaw);
495
+ } catch (error) {
496
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
497
+ }
498
+ try {
499
+ removal = removeStatusDef(parsed, id);
500
+ } catch (error) {
501
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
502
+ }
503
+ if (removal.removed) {
504
+ const removedId = normalizeStatusToken(removal.definition?.id ?? id);
505
+ if (removedId.length > 0 && !BUILTIN_STATUS_IDS.has(removedId)) {
506
+ const usingStatus = await countItemsUsingStatus(pmRoot, settings, schema, removedId);
507
+ if (usingStatus > 0) {
508
+ warnings.push(`items_using_status:${usingStatus}`);
509
+ }
510
+ const referencingSlots = workflowSlotsReferencing(schema.workflow, removedId);
511
+ if (referencingSlots.length > 0) {
512
+ warnings.push(`status_referenced_by_workflow:${referencingSlots.join(",")}`);
513
+ }
514
+ }
515
+ await writeFileAtomic(statusesPath, serializeStatusDefsFile(removal.file));
516
+ warnings.push(...await runActiveOnWriteHooks({
517
+ path: statusesPath,
518
+ scope: "project",
519
+ op: "schema:remove-status"
520
+ }));
521
+ }
522
+ } finally {
523
+ await releaseLock();
524
+ }
525
+ return {
526
+ action: "remove-status",
527
+ removed: removal.removed,
528
+ ...removal.definition ? { status: removal.definition } : {},
529
+ file: {
530
+ path: statusesPath,
531
+ statuses: removal.file.statuses.length
532
+ },
533
+ warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
534
+ generated_at: nowIso()
535
+ };
536
+ }
537
+ function toSchemaTypeSummary(definition) {
538
+ return {
539
+ name: definition.name,
540
+ folder: definition.folder,
541
+ aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],
542
+ ...definition.default_status ? { default_status: definition.default_status } : {},
543
+ ...definition.description ? { description: definition.description } : {}
544
+ };
545
+ }
546
+ function toSchemaTypeDefinition(definition, source, extensionProvenance) {
547
+ return {
548
+ ...toSchemaTypeSummary(definition),
549
+ source,
550
+ ...extensionProvenance ? { extension: extensionProvenance } : {},
551
+ required_create_fields: [...definition.required_create_fields],
552
+ required_create_repeatables: [...definition.required_create_repeatables],
553
+ options: structuredClone(definition.options),
554
+ command_option_policies: structuredClone(definition.command_option_policies)
555
+ };
556
+ }
557
+ function classifyTypeSource(name, customNames, extensionNames) {
558
+ const lowerName = name.toLowerCase();
559
+ if (extensionNames.has(lowerName)) {
560
+ return "extension";
561
+ }
562
+ if (customNames.has(lowerName)) {
563
+ return "custom";
564
+ }
565
+ return "builtin";
566
+ }
567
+ function collectExtensionTypeProvenance() {
568
+ const provenance = /* @__PURE__ */ new Map();
569
+ const registrations = getActiveExtensionRegistrations();
570
+ for (const registration of registrations?.item_types ?? []) {
571
+ const rawTypes = registration.types;
572
+ if (!Array.isArray(rawTypes)) {
573
+ continue;
574
+ }
575
+ for (const rawType of rawTypes) {
576
+ if (typeof rawType !== "object" || rawType === null || Array.isArray(rawType)) {
577
+ continue;
578
+ }
579
+ const name = rawType.name;
580
+ if (typeof name === "string" && name.trim().length > 0) {
581
+ provenance.set(name.trim().toLowerCase(), {
582
+ layer: registration.layer,
583
+ name: registration.name
584
+ });
585
+ }
586
+ }
587
+ }
588
+ return provenance;
589
+ }
590
+ function buildSchemaStatusSummaries(schema) {
591
+ const registry = resolveRuntimeStatusRegistry(schema);
592
+ const builtin = [];
593
+ const custom = [];
594
+ for (const definition of registry.definitions) {
595
+ const source = BUILTIN_STATUS_IDS.has(definition.id) ? "builtin" : "custom";
596
+ const summary = {
597
+ id: definition.id,
598
+ source,
599
+ roles: Array.isArray(definition.roles) ? [...definition.roles] : [],
600
+ aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],
601
+ ...definition.description ? { description: definition.description } : {}
602
+ };
603
+ if (source === "builtin") {
604
+ builtin.push(summary);
605
+ } else {
606
+ custom.push(summary);
607
+ }
608
+ }
609
+ return { builtin, custom };
610
+ }
611
+ async function loadSchemaInspectionContext(global2) {
612
+ const pmRoot = resolvePmRoot(process.cwd(), global2.path);
613
+ if (!await pathExists(getSettingsPath(pmRoot))) {
614
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
615
+ }
616
+ const settings = await readSettings(pmRoot);
617
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
618
+ const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
619
+ const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
620
+ const extensionProvenance = collectExtensionTypeProvenance();
621
+ const customNames = new Set((settings.item_types?.definitions ?? []).map((definition) => definition.name.trim().toLowerCase()).filter((name) => name.length > 0 && !extensionProvenance.has(name)));
622
+ return {
623
+ typesPath,
624
+ byType: registry.by_type,
625
+ customNames,
626
+ extensionProvenance,
627
+ schema
628
+ };
629
+ }
630
+ async function runSchemaList(global2) {
631
+ const context = await loadSchemaInspectionContext(global2);
632
+ const builtin = [];
633
+ const custom = [];
634
+ const extension = [];
635
+ for (const definition of Object.values(context.byType).sort((left, right) => left.name.localeCompare(right.name))) {
636
+ const source = classifyTypeSource(definition.name, context.customNames, new Set(context.extensionProvenance.keys()));
637
+ const summary = toSchemaTypeSummary(definition);
638
+ if (source === "extension") {
639
+ extension.push(summary);
640
+ } else if (source === "custom") {
641
+ custom.push(summary);
642
+ } else {
643
+ builtin.push(summary);
644
+ }
645
+ }
646
+ const statusSummaries = buildSchemaStatusSummaries(context.schema);
647
+ return {
648
+ action: "list",
649
+ builtin,
650
+ custom,
651
+ extension,
652
+ counts: {
653
+ builtin: builtin.length,
654
+ custom: custom.length,
655
+ extension: extension.length,
656
+ total: builtin.length + custom.length + extension.length
657
+ },
658
+ statuses: {
659
+ builtin: statusSummaries.builtin,
660
+ custom: statusSummaries.custom,
661
+ counts: {
662
+ builtin: statusSummaries.builtin.length,
663
+ custom: statusSummaries.custom.length,
664
+ total: statusSummaries.builtin.length + statusSummaries.custom.length
665
+ }
666
+ },
667
+ file: {
668
+ path: context.typesPath
669
+ },
670
+ generated_at: nowIso()
671
+ };
672
+ }
673
+ async function runSchemaShow(name, global2) {
674
+ const typeName = (name ?? "").trim();
675
+ if (typeName.length === 0) {
676
+ throw new PmCliError("Type name must not be empty.", EXIT_CODE.USAGE);
677
+ }
678
+ const context = await loadSchemaInspectionContext(global2);
679
+ const match = Object.values(context.byType).find((definition) => definition.name.toLowerCase() === typeName.toLowerCase() || definition.aliases.some((alias) => alias.toLowerCase() === typeName.toLowerCase()));
680
+ if (!match) {
681
+ throw new PmCliError(`Unknown item type "${typeName}". Run pm schema list to inspect registered types, or pm schema add-type "${escapeForDoubleQuotes(typeName)}" to register it.`, EXIT_CODE.NOT_FOUND, { code: "unknown_item_type" });
682
+ }
683
+ return {
684
+ action: "show",
685
+ type: toSchemaTypeDefinition(match, classifyTypeSource(match.name, context.customNames, new Set(context.extensionProvenance.keys())), context.extensionProvenance.get(match.name.toLowerCase())),
686
+ file: {
687
+ path: context.typesPath
688
+ },
689
+ generated_at: nowIso()
690
+ };
691
+ }
692
+ function formatSchemaAddTypeHuman(result) {
693
+ const verb = result.replaced ? "Updated" : "Registered";
694
+ const aliasSuffix = result.type.aliases && result.type.aliases.length > 0 ? ` (aliases: ${result.type.aliases.join(", ")})` : "";
695
+ return `${verb} custom item type "${result.type.name}"${aliasSuffix} in ${result.file.path}. Run: pm create "${escapeForDoubleQuotes(result.type.name)}" "<title>"`;
696
+ }
697
+ function formatSchemaRemoveTypeHuman(result) {
698
+ if (!result.removed) {
699
+ return `No custom item type matched; nothing removed from ${result.file.path}.`;
700
+ }
701
+ const name = result.type?.name ?? "(unknown)";
702
+ return `Removed custom item type "${name}" from ${result.file.path}.`;
703
+ }
704
+ function formatSchemaAddStatusHuman(result) {
705
+ const verb = result.replaced ? "Updated" : "Registered";
706
+ const roleSuffix = result.status.roles && result.status.roles.length > 0 ? ` (roles: ${result.status.roles.join(", ")})` : "";
707
+ const aliasSuffix = result.status.aliases && result.status.aliases.length > 0 ? ` (aliases: ${result.status.aliases.join(", ")})` : "";
708
+ return `${verb} status "${result.status.id}"${roleSuffix}${aliasSuffix} in ${result.file.path}.`;
709
+ }
710
+ function formatSchemaRemoveStatusHuman(result) {
711
+ if (!result.removed) {
712
+ return `No custom status matched; nothing removed from ${result.file.path}.`;
713
+ }
714
+ const id = result.status?.id ?? "(unknown)";
715
+ return `Removed custom status "${id}" from ${result.file.path}.`;
716
+ }
717
+ function formatSchemaListHuman(result) {
718
+ const lines = [
719
+ `Schema types: ${result.counts.total} total (${result.counts.builtin} builtin, ${result.counts.custom} custom, ${result.counts.extension} extension)`
720
+ ];
721
+ for (const [label, entries] of [
722
+ ["builtin", result.builtin],
723
+ ["custom", result.custom],
724
+ ["extension", result.extension]
725
+ ]) {
726
+ if (entries.length === 0) {
727
+ continue;
728
+ }
729
+ lines.push(`${label}: ${entries.map((entry) => entry.name).join(", ")}`);
730
+ }
731
+ lines.push(`statuses: ${result.statuses.counts.total} total (${result.statuses.counts.builtin} builtin, ${result.statuses.counts.custom} custom)`);
732
+ for (const [label, entries] of [
733
+ ["builtin statuses", result.statuses.builtin],
734
+ ["custom statuses", result.statuses.custom]
735
+ ]) {
736
+ if (entries.length === 0) {
737
+ continue;
738
+ }
739
+ lines.push(`${label}: ${entries.map((entry) => entry.id).join(", ")}`);
740
+ }
741
+ lines.push(`Inspect one: pm schema show <Type>`);
742
+ return lines.join("\n");
743
+ }
744
+ function formatSchemaShowHuman(result) {
745
+ const parts = [
746
+ `type: ${result.type.name}`,
747
+ `source: ${result.type.source}`,
748
+ `folder: ${result.type.folder}`
749
+ ];
750
+ if (result.type.default_status) {
751
+ parts.push(`default_status: ${result.type.default_status}`);
752
+ }
753
+ if (result.type.aliases.length > 0) {
754
+ parts.push(`aliases: ${result.type.aliases.join(", ")}`);
755
+ }
756
+ if (result.type.description) {
757
+ parts.push(`description: ${result.type.description}`);
758
+ }
759
+ if (result.type.options.length > 0) {
760
+ parts.push(`options: ${result.type.options.map((option) => option.key).join(", ")}`);
761
+ }
762
+ return parts.join("\n");
763
+ }
764
+ export {
765
+ SCHEMA_SUBCOMMANDS,
766
+ buildInvalidTypeHint,
767
+ formatSchemaAddStatusHuman,
768
+ formatSchemaAddTypeHuman,
769
+ formatSchemaListHuman,
770
+ formatSchemaRemoveStatusHuman,
771
+ formatSchemaRemoveTypeHuman,
772
+ formatSchemaShowHuman,
773
+ runSchemaAddStatus,
774
+ runSchemaAddType,
775
+ runSchemaList,
776
+ runSchemaRemoveStatus,
777
+ runSchemaRemoveType,
778
+ runSchemaShow
779
+ };
780
+ //# sourceMappingURL=schema-V6BX65Q2.js.map