@unbrained/pm-cli 2026.5.30 → 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 (578) hide show
  1. package/CHANGELOG.md +152 -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 +96 -10
  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 +109 -116
  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/install-sources.d.ts +2 -0
  27. package/dist/cli/commands/extension/install-sources.js +11 -4
  28. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  29. package/dist/cli/commands/extension/scaffold.js +49 -48
  30. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  31. package/dist/cli/commands/extension.js +51 -23
  32. package/dist/cli/commands/extension.js.map +1 -1
  33. package/dist/cli/commands/get.js +7 -7
  34. package/dist/cli/commands/get.js.map +1 -1
  35. package/dist/cli/commands/health.js +38 -3
  36. package/dist/cli/commands/health.js.map +1 -1
  37. package/dist/cli/commands/index.d.ts +2 -1
  38. package/dist/cli/commands/index.js +4 -3
  39. package/dist/cli/commands/index.js.map +1 -1
  40. package/dist/cli/commands/init.d.ts +10 -0
  41. package/dist/cli/commands/init.js +107 -4
  42. package/dist/cli/commands/init.js.map +1 -1
  43. package/dist/cli/commands/list.d.ts +5 -0
  44. package/dist/cli/commands/list.js +58 -26
  45. package/dist/cli/commands/list.js.map +1 -1
  46. package/dist/cli/commands/reindex.js +164 -48
  47. package/dist/cli/commands/reindex.js.map +1 -1
  48. package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
  49. package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
  50. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
  51. package/dist/cli/commands/restore.js +25 -4
  52. package/dist/cli/commands/restore.js.map +1 -1
  53. package/dist/cli/commands/schema.d.ts +122 -1
  54. package/dist/cli/commands/schema.js +536 -6
  55. package/dist/cli/commands/schema.js.map +1 -1
  56. package/dist/cli/commands/search.d.ts +18 -0
  57. package/dist/cli/commands/search.js +56 -12
  58. package/dist/cli/commands/search.js.map +1 -1
  59. package/dist/cli/commands/test.js +4 -3
  60. package/dist/cli/commands/test.js.map +1 -1
  61. package/dist/cli/commands/update-many.js +69 -140
  62. package/dist/cli/commands/update-many.js.map +1 -1
  63. package/dist/cli/commands/update.d.ts +2 -0
  64. package/dist/cli/commands/update.js +138 -119
  65. package/dist/cli/commands/update.js.map +1 -1
  66. package/dist/cli/commands/validate.d.ts +1 -0
  67. package/dist/cli/commands/validate.js +63 -33
  68. package/dist/cli/commands/validate.js.map +1 -1
  69. package/dist/cli/error-guidance.js +26 -3
  70. package/dist/cli/error-guidance.js.map +1 -1
  71. package/dist/cli/help-content.js +82 -3
  72. package/dist/cli/help-content.js.map +1 -1
  73. package/dist/cli/main.js +377 -23
  74. package/dist/cli/main.js.map +1 -1
  75. package/dist/cli/register-list-query.js +16 -12
  76. package/dist/cli/register-list-query.js.map +1 -1
  77. package/dist/cli/register-mutation.js +217 -47
  78. package/dist/cli/register-mutation.js.map +1 -1
  79. package/dist/cli/register-operations.js +34 -25
  80. package/dist/cli/register-operations.js.map +1 -1
  81. package/dist/cli/register-setup.js +8 -8
  82. package/dist/cli/register-setup.js.map +1 -1
  83. package/dist/cli/registration-helpers.js +35 -5
  84. package/dist/cli/registration-helpers.js.map +1 -1
  85. package/dist/cli/search-refresh.d.ts +2 -0
  86. package/dist/cli/search-refresh.js +13 -0
  87. package/dist/cli/search-refresh.js.map +1 -0
  88. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js +20 -0
  89. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js.map +1 -0
  90. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +16 -0
  91. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js.map +7 -0
  92. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js +206 -0
  93. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +1 -0
  94. package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js +209 -0
  95. package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js.map +7 -0
  96. package/dist/cli-bundle/chunks/append-5JE3YGXU.js +72 -0
  97. package/dist/cli-bundle/chunks/append-5JE3YGXU.js.map +7 -0
  98. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js +69 -0
  99. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js.map +1 -0
  100. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js +218 -0
  101. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js.map +1 -0
  102. package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js +27 -0
  103. package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js.map +7 -0
  104. package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js +761 -0
  105. package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js.map +7 -0
  106. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js +5553 -0
  107. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +1 -0
  108. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js +634 -0
  109. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +7 -0
  110. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js +1832 -0
  111. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js +1891 -0
  113. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +7 -0
  114. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js +412 -0
  115. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +1 -0
  116. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js +182 -0
  117. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +1 -0
  118. package/dist/cli-bundle/chunks/chunk-7K24QB23.js +698 -0
  119. package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +1 -0
  120. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js +380 -0
  121. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js.map +1 -0
  122. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js +230 -0
  123. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js.map +1 -0
  124. package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js +185 -0
  125. package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js.map +7 -0
  126. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js +332 -0
  127. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js.map +1 -0
  128. package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js +1681 -0
  129. package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js.map +7 -0
  130. package/dist/cli-bundle/chunks/{chunk-PB2YU2E3.js → chunk-BNL6S7QH.js} +28 -70
  131. package/dist/cli-bundle/chunks/chunk-BNL6S7QH.js.map +7 -0
  132. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js +154 -0
  133. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js.map +1 -0
  134. package/dist/cli-bundle/chunks/chunk-CJDQB2ED.js +341 -0
  135. package/dist/cli-bundle/chunks/chunk-CJDQB2ED.js.map +7 -0
  136. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js +1340 -0
  137. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js.map +1 -0
  138. package/dist/cli-bundle/chunks/chunk-D3WUNETC.js +349 -0
  139. package/dist/cli-bundle/chunks/chunk-D3WUNETC.js.map +7 -0
  140. package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js +1714 -0
  141. package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js.map +7 -0
  142. package/dist/cli-bundle/chunks/chunk-DFIZGAI5.js +550 -0
  143. package/dist/cli-bundle/chunks/chunk-DFIZGAI5.js.map +7 -0
  144. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js +1704 -0
  145. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js.map +1 -0
  146. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js +56 -0
  147. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js.map +7 -0
  148. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js +2988 -0
  149. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +1 -0
  150. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js +128 -0
  151. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js.map +1 -0
  152. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js +454 -0
  153. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +1 -0
  154. package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js +383 -0
  155. package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js.map +7 -0
  156. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js +57 -0
  157. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js.map +1 -0
  158. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js +3860 -0
  159. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +1 -0
  160. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js +346 -0
  161. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js.map +1 -0
  162. package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js +1356 -0
  163. package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js +342 -0
  165. package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js.map +7 -0
  166. package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
  167. package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
  168. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
  169. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
  170. package/dist/cli-bundle/chunks/chunk-JB4RGL4V.js +185 -0
  171. package/dist/cli-bundle/chunks/chunk-JB4RGL4V.js.map +7 -0
  172. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js +130 -0
  173. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js.map +1 -0
  174. package/dist/cli-bundle/chunks/chunk-K47WAYQV.js +60 -0
  175. package/dist/cli-bundle/chunks/chunk-K47WAYQV.js.map +7 -0
  176. package/dist/cli-bundle/chunks/chunk-KA24HME7.js +79 -0
  177. package/dist/cli-bundle/chunks/chunk-KA24HME7.js.map +7 -0
  178. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js +1325 -0
  179. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +1 -0
  180. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js +242 -0
  181. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js.map +1 -0
  182. package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js +221 -0
  183. package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js.map +7 -0
  184. package/dist/cli-bundle/chunks/chunk-LDJK7SHN.js +157 -0
  185. package/dist/cli-bundle/chunks/chunk-LDJK7SHN.js.map +7 -0
  186. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
  187. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
  188. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js +80 -0
  189. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js.map +1 -0
  190. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js +457 -0
  191. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +7 -0
  192. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js +173 -0
  193. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +1 -0
  194. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js +338 -0
  195. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js.map +1 -0
  196. package/dist/cli-bundle/chunks/chunk-O7IWB35H.js +18 -0
  197. package/dist/cli-bundle/chunks/chunk-O7IWB35H.js.map +7 -0
  198. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js +3040 -0
  199. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +7 -0
  200. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js +751 -0
  201. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js.map +1 -0
  202. package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js +1861 -0
  203. package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js.map +7 -0
  204. package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js +20 -0
  205. package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js.map +7 -0
  206. package/dist/cli-bundle/chunks/chunk-RANZIID5.js +176 -0
  207. package/dist/cli-bundle/chunks/chunk-RANZIID5.js.map +7 -0
  208. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js +140 -0
  209. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js.map +7 -0
  210. package/dist/cli-bundle/chunks/chunk-S3CV7JGJ.js +233 -0
  211. package/dist/cli-bundle/chunks/chunk-S3CV7JGJ.js.map +7 -0
  212. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js +5705 -0
  213. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +7 -0
  214. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js +76 -0
  215. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +1 -0
  216. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js +631 -0
  217. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +1 -0
  218. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js +540 -0
  219. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js.map +1 -0
  220. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js +422 -0
  221. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +7 -0
  222. package/dist/cli-bundle/chunks/{chunk-RJONRNXN.js → chunk-TK633IVD.js} +51 -32
  223. package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +7 -0
  224. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js +131 -0
  225. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js.map +7 -0
  226. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js +119 -0
  227. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js.map +1 -0
  228. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js +1664 -0
  229. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js.map +1 -0
  230. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js +186 -0
  231. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +1 -0
  232. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js +182 -0
  233. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js.map +1 -0
  234. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js +189 -0
  235. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +7 -0
  236. package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js +1385 -0
  237. package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js.map +7 -0
  238. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
  239. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
  240. package/dist/cli-bundle/chunks/chunk-XX5LRINW.js +90 -0
  241. package/dist/cli-bundle/chunks/chunk-XX5LRINW.js.map +7 -0
  242. package/dist/cli-bundle/chunks/chunk-Y2AKE2HS.js +252 -0
  243. package/dist/cli-bundle/chunks/chunk-Y2AKE2HS.js.map +7 -0
  244. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js +3898 -0
  245. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +7 -0
  246. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js +1809 -0
  247. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js.map +1 -0
  248. package/dist/cli-bundle/chunks/claim-AZLP7YFO.js +132 -0
  249. package/dist/cli-bundle/chunks/claim-AZLP7YFO.js.map +7 -0
  250. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js +129 -0
  251. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js.map +1 -0
  252. package/dist/cli-bundle/chunks/close-65DFYAVS.js +17 -0
  253. package/dist/cli-bundle/chunks/close-65DFYAVS.js.map +1 -0
  254. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +13 -0
  255. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js.map +7 -0
  256. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js +311 -0
  257. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +1 -0
  258. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js +314 -0
  259. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +7 -0
  260. package/dist/cli-bundle/chunks/comments-AGBNSJJH.js +103 -0
  261. package/dist/cli-bundle/chunks/comments-AGBNSJJH.js.map +7 -0
  262. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js +100 -0
  263. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-5ON3ADRH.js +1688 -0
  265. package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +7 -0
  266. package/dist/cli-bundle/chunks/config-DDPYIA6J.js +1671 -0
  267. package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +1 -0
  268. package/dist/cli-bundle/chunks/context-E6U3DWVM.js +1471 -0
  269. package/dist/cli-bundle/chunks/context-E6U3DWVM.js.map +7 -0
  270. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js +1461 -0
  271. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +1 -0
  272. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js +1277 -0
  273. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +7 -0
  274. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js +1274 -0
  275. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +1 -0
  276. package/dist/cli-bundle/chunks/create-ATONSAZW.js +27 -0
  277. package/dist/cli-bundle/chunks/create-ATONSAZW.js.map +7 -0
  278. package/dist/cli-bundle/chunks/create-WYFKN2U4.js +31 -0
  279. package/dist/cli-bundle/chunks/create-WYFKN2U4.js.map +1 -0
  280. package/dist/cli-bundle/chunks/delete-RONNH4F4.js +58 -0
  281. package/dist/cli-bundle/chunks/delete-RONNH4F4.js.map +7 -0
  282. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js +55 -0
  283. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js.map +1 -0
  284. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js +225 -0
  285. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js.map +1 -0
  286. package/dist/cli-bundle/chunks/deps-WII3O4HB.js +228 -0
  287. package/dist/cli-bundle/chunks/deps-WII3O4HB.js.map +7 -0
  288. package/dist/cli-bundle/chunks/docs-JMVCFNHH.js +34 -0
  289. package/dist/cli-bundle/chunks/docs-JMVCFNHH.js.map +7 -0
  290. package/dist/cli-bundle/chunks/docs-PDREIMLS.js +31 -0
  291. package/dist/cli-bundle/chunks/docs-PDREIMLS.js.map +1 -0
  292. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js +28 -0
  293. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js.map +1 -0
  294. package/dist/cli-bundle/chunks/extension-G6UXSM5S.js +24 -0
  295. package/dist/cli-bundle/chunks/extension-G6UXSM5S.js.map +7 -0
  296. package/dist/cli-bundle/chunks/files-2PN7UM2D.js +282 -0
  297. package/dist/cli-bundle/chunks/files-2PN7UM2D.js.map +1 -0
  298. package/dist/cli-bundle/chunks/files-MXYS5W4M.js +285 -0
  299. package/dist/cli-bundle/chunks/files-MXYS5W4M.js.map +7 -0
  300. package/dist/cli-bundle/chunks/gc-GT552UJH.js +178 -0
  301. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +1 -0
  302. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +181 -0
  303. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +7 -0
  304. package/dist/cli-bundle/chunks/get-CINFEUIY.js +197 -0
  305. package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +7 -0
  306. package/dist/cli-bundle/chunks/get-WXMLRG7M.js +194 -0
  307. package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +1 -0
  308. package/dist/cli-bundle/chunks/health-5VPOJQ53.js +1258 -0
  309. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +1 -0
  310. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js +1261 -0
  311. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +7 -0
  312. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +20 -0
  313. package/dist/cli-bundle/chunks/history-6FC4H6HI.js.map +7 -0
  314. package/dist/cli-bundle/chunks/history-FLZIP7PM.js +24 -0
  315. package/dist/cli-bundle/chunks/history-FLZIP7PM.js.map +1 -0
  316. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js +23 -0
  317. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js.map +1 -0
  318. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +19 -0
  319. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js.map +7 -0
  320. package/dist/cli-bundle/chunks/history-repair-KC5ZOJRZ.js +196 -0
  321. package/dist/cli-bundle/chunks/history-repair-KC5ZOJRZ.js.map +7 -0
  322. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js +193 -0
  323. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js.map +1 -0
  324. package/dist/cli-bundle/chunks/init-6MRFVOLH.js +20 -0
  325. package/dist/cli-bundle/chunks/init-6MRFVOLH.js.map +1 -0
  326. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +16 -0
  327. package/dist/cli-bundle/chunks/init-KHX3FEEM.js.map +7 -0
  328. package/dist/cli-bundle/chunks/learnings-A3CLB5CO.js +47 -0
  329. package/dist/cli-bundle/chunks/learnings-A3CLB5CO.js.map +7 -0
  330. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js +44 -0
  331. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js.map +1 -0
  332. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +20 -0
  333. package/dist/cli-bundle/chunks/list-53LZ2AEO.js.map +7 -0
  334. package/dist/cli-bundle/chunks/list-DBRECOG4.js +24 -0
  335. package/dist/cli-bundle/chunks/list-DBRECOG4.js.map +1 -0
  336. package/dist/cli-bundle/chunks/notes-42LIC3UE.js +47 -0
  337. package/dist/cli-bundle/chunks/notes-42LIC3UE.js.map +7 -0
  338. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js +44 -0
  339. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js.map +1 -0
  340. package/dist/cli-bundle/chunks/plan-HDQXEUKD.js +1174 -0
  341. package/dist/cli-bundle/chunks/plan-HDQXEUKD.js.map +7 -0
  342. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js +1171 -0
  343. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-list-query-EIVQ5FMR.js → register-list-query-AG3XKXWL.js} +25 -18
  345. package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js +227 -0
  347. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +1 -0
  348. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js +813 -0
  349. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +1 -0
  350. package/dist/cli-bundle/chunks/{register-mutation-RSZNPSGI.js → register-mutation-RSMT6DPK.js} +160 -39
  351. package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +7 -0
  352. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js +370 -0
  353. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +1 -0
  354. package/dist/cli-bundle/chunks/{register-operations-APUSYDMR.js → register-operations-Q54JQZUN.js} +50 -32
  355. package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +7 -0
  356. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js +242 -0
  357. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js.map +1 -0
  358. package/dist/cli-bundle/chunks/{register-setup-OZOKSMPJ.js → register-setup-YJKIQRKA.js} +21 -13
  359. package/dist/cli-bundle/chunks/register-setup-YJKIQRKA.js.map +7 -0
  360. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js +21 -0
  361. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js.map +1 -0
  362. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +17 -0
  363. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js.map +7 -0
  364. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js +770 -0
  365. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js.map +1 -0
  366. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js +780 -0
  367. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js.map +7 -0
  368. package/dist/cli-bundle/chunks/search-5A3BMFA7.js +1144 -0
  369. package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +7 -0
  370. package/dist/cli-bundle/chunks/search-C7NPB7G7.js +1127 -0
  371. package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +1 -0
  372. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +120 -0
  373. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +1 -0
  374. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +123 -0
  375. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +7 -0
  376. package/dist/cli-bundle/chunks/test-OFYONO3C.js +35 -0
  377. package/dist/cli-bundle/chunks/test-OFYONO3C.js.map +1 -0
  378. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +31 -0
  379. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js.map +7 -0
  380. package/dist/cli-bundle/chunks/test-all-EEMKNTGU.js +331 -0
  381. package/dist/cli-bundle/chunks/test-all-EEMKNTGU.js.map +7 -0
  382. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js +328 -0
  383. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js.map +1 -0
  384. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js +929 -0
  385. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js.map +1 -0
  386. package/dist/cli-bundle/chunks/test-runs-L2M7WKH7.js +939 -0
  387. package/dist/cli-bundle/chunks/test-runs-L2M7WKH7.js.map +7 -0
  388. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +25 -0
  389. package/dist/cli-bundle/chunks/update-6YEHPVXH.js.map +1 -0
  390. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +21 -0
  391. package/dist/cli-bundle/chunks/update-PYLVHMRD.js.map +7 -0
  392. package/dist/cli-bundle/chunks/update-many-322CCH2L.js +608 -0
  393. package/dist/cli-bundle/chunks/update-many-322CCH2L.js.map +7 -0
  394. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js +605 -0
  395. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js.map +1 -0
  396. package/dist/cli-bundle/chunks/upgrade-2U727SAM.js +269 -0
  397. package/dist/cli-bundle/chunks/upgrade-2U727SAM.js.map +7 -0
  398. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js +266 -0
  399. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js.map +1 -0
  400. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js +1120 -0
  401. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js.map +1 -0
  402. package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js +1123 -0
  403. package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js.map +7 -0
  404. package/dist/cli-bundle/main.js +615 -121
  405. package/dist/cli-bundle/main.js.map +4 -4
  406. package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
  407. package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
  408. package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
  409. package/dist/core/config/positional-value.js +4 -2
  410. package/dist/core/config/positional-value.js.map +1 -1
  411. package/dist/core/diagnostics/remediation.d.ts +73 -0
  412. package/dist/core/diagnostics/remediation.js +328 -0
  413. package/dist/core/diagnostics/remediation.js.map +1 -0
  414. package/dist/core/extensions/extension-hook-runtime.js +9 -2
  415. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  416. package/dist/core/extensions/extension-types.d.ts +60 -4
  417. package/dist/core/extensions/extension-types.js +2 -2
  418. package/dist/core/extensions/extension-types.js.map +1 -1
  419. package/dist/core/extensions/index.d.ts +5 -1
  420. package/dist/core/extensions/index.js +61 -2
  421. package/dist/core/extensions/index.js.map +1 -1
  422. package/dist/core/extensions/item-fields.d.ts +5 -1
  423. package/dist/core/extensions/item-fields.js +126 -4
  424. package/dist/core/extensions/item-fields.js.map +1 -1
  425. package/dist/core/extensions/loader.js +283 -8
  426. package/dist/core/extensions/loader.js.map +1 -1
  427. package/dist/core/item/item-format.d.ts +3 -2
  428. package/dist/core/item/item-format.js +15 -10
  429. package/dist/core/item/item-format.js.map +1 -1
  430. package/dist/core/item/item-type-definition.js +6 -2
  431. package/dist/core/item/item-type-definition.js.map +1 -1
  432. package/dist/core/item/status-filter.d.ts +29 -0
  433. package/dist/core/item/status-filter.js +97 -0
  434. package/dist/core/item/status-filter.js.map +1 -0
  435. package/dist/core/item/type-registry.d.ts +4 -0
  436. package/dist/core/item/type-registry.js +12 -2
  437. package/dist/core/item/type-registry.js.map +1 -1
  438. package/dist/core/output/output.js +17 -5
  439. package/dist/core/output/output.js.map +1 -1
  440. package/dist/core/schema/item-types-file.d.ts +15 -0
  441. package/dist/core/schema/item-types-file.js +27 -2
  442. package/dist/core/schema/item-types-file.js.map +1 -1
  443. package/dist/core/schema/runtime-field-filters.js +4 -3
  444. package/dist/core/schema/runtime-field-filters.js.map +1 -1
  445. package/dist/core/schema/runtime-field-values.d.ts +1 -1
  446. package/dist/core/schema/runtime-field-values.js +10 -4
  447. package/dist/core/schema/runtime-field-values.js.map +1 -1
  448. package/dist/core/schema/runtime-schema.js +75 -2
  449. package/dist/core/schema/runtime-schema.js.map +1 -1
  450. package/dist/core/schema/status-defs-file.d.ts +113 -0
  451. package/dist/core/schema/status-defs-file.js +260 -0
  452. package/dist/core/schema/status-defs-file.js.map +1 -0
  453. package/dist/core/schema/type-workflows.d.ts +64 -0
  454. package/dist/core/schema/type-workflows.js +98 -0
  455. package/dist/core/schema/type-workflows.js.map +1 -0
  456. package/dist/core/search/background-refresh.d.ts +53 -0
  457. package/dist/core/search/background-refresh.js +286 -0
  458. package/dist/core/search/background-refresh.js.map +1 -0
  459. package/dist/core/search/cache.d.ts +23 -2
  460. package/dist/core/search/cache.js +135 -30
  461. package/dist/core/search/cache.js.map +1 -1
  462. package/dist/core/search/http-client.d.ts +2 -2
  463. package/dist/core/search/http-client.js +2 -2
  464. package/dist/core/search/http-client.js.map +1 -1
  465. package/dist/core/search/vector-stores.d.ts +1 -0
  466. package/dist/core/search/vector-stores.js +69 -15
  467. package/dist/core/search/vector-stores.js.map +1 -1
  468. package/dist/core/search/vectorization-metadata.d.ts +13 -0
  469. package/dist/core/search/vectorization-metadata.js +65 -0
  470. package/dist/core/search/vectorization-metadata.js.map +1 -0
  471. package/dist/core/shared/constants.d.ts +2 -2
  472. package/dist/core/shared/constants.js +2 -3
  473. package/dist/core/shared/constants.js.map +1 -1
  474. package/dist/core/shared/serialization.d.ts +1 -0
  475. package/dist/core/shared/serialization.js +86 -2
  476. package/dist/core/shared/serialization.js.map +1 -1
  477. package/dist/core/store/front-matter-cache.js +14 -5
  478. package/dist/core/store/front-matter-cache.js.map +1 -1
  479. package/dist/core/store/item-format-migration.js +25 -15
  480. package/dist/core/store/item-format-migration.js.map +1 -1
  481. package/dist/core/store/item-store.d.ts +2 -0
  482. package/dist/core/store/item-store.js +61 -6
  483. package/dist/core/store/item-store.js.map +1 -1
  484. package/dist/core/store/settings-validator.js +22 -2
  485. package/dist/core/store/settings-validator.js.map +1 -1
  486. package/dist/core/store/settings.js +40 -5
  487. package/dist/core/store/settings.js.map +1 -1
  488. package/dist/core/telemetry/consent.js +3 -3
  489. package/dist/core/telemetry/consent.js.map +1 -1
  490. package/dist/core/telemetry/observability.js +4 -3
  491. package/dist/core/telemetry/observability.js.map +1 -1
  492. package/dist/core/telemetry/runtime.d.ts +10 -0
  493. package/dist/core/telemetry/runtime.js +86 -2
  494. package/dist/core/telemetry/runtime.js.map +1 -1
  495. package/dist/mcp/server.js +221 -12
  496. package/dist/mcp/server.js.map +1 -1
  497. package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
  498. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  499. package/dist/sdk/cli-contracts/commander-types.js +7 -2
  500. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  501. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  502. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  503. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  504. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
  505. package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
  506. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  507. package/dist/sdk/cli-contracts/tool-parameter-tables.js +37 -8
  508. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  509. package/dist/sdk/cli-contracts.d.ts +19 -1
  510. package/dist/sdk/cli-contracts.js +211 -18
  511. package/dist/sdk/cli-contracts.js.map +1 -1
  512. package/dist/sdk/errors.d.ts +22 -0
  513. package/dist/sdk/errors.js +46 -0
  514. package/dist/sdk/errors.js.map +1 -0
  515. package/dist/sdk/index.d.ts +2 -1
  516. package/dist/sdk/index.js +3 -2
  517. package/dist/sdk/index.js.map +1 -1
  518. package/dist/sdk/package-import-adapters.js +14 -3
  519. package/dist/sdk/package-import-adapters.js.map +1 -1
  520. package/dist/sdk/runtime.d.ts +1 -0
  521. package/dist/sdk/runtime.js +3 -2
  522. package/dist/sdk/runtime.js.map +1 -1
  523. package/dist/sdk/testing.d.ts +77 -0
  524. package/dist/sdk/testing.js +239 -0
  525. package/dist/sdk/testing.js.map +1 -0
  526. package/dist/types.d.ts +26 -1
  527. package/dist/types.js +3 -2
  528. package/dist/types.js.map +1 -1
  529. package/docs/AGENT_GUIDE.md +21 -2
  530. package/docs/COMMANDS.md +85 -5
  531. package/docs/CONFIGURATION.md +49 -2
  532. package/docs/EXTENSIONS.md +118 -6
  533. package/docs/QUICKSTART.md +2 -0
  534. package/docs/RELEASING.md +3 -3
  535. package/docs/SDK.md +273 -1
  536. package/docs/TESTING.md +17 -0
  537. package/docs/examples/policy-restricted-extension/manifest.json +1 -0
  538. package/docs/examples/starter-extension/index.js +9 -1
  539. package/docs/examples/starter-extension/manifest.json +1 -0
  540. package/package.json +12 -7
  541. package/packages/pm-beads/extensions/beads/index.js +2 -4
  542. package/packages/pm-beads/extensions/beads/index.ts +43 -33
  543. package/packages/pm-beads/extensions/beads/manifest.json +12 -1
  544. package/packages/pm-calendar/README.md +6 -0
  545. package/packages/pm-calendar/extensions/calendar/index.js +6 -1
  546. package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
  547. package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
  548. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
  549. package/packages/pm-guide-shell/README.md +4 -0
  550. package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
  551. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
  552. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
  553. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
  554. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
  555. package/packages/pm-lifecycle-hooks/README.md +29 -0
  556. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
  557. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
  558. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
  559. package/packages/pm-lifecycle-hooks/package.json +52 -0
  560. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
  561. package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
  562. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
  563. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
  564. package/packages/pm-templates/extensions/templates/manifest.json +6 -1
  565. package/packages/pm-todos/extensions/todos/index.js +3 -7
  566. package/packages/pm-todos/extensions/todos/index.ts +55 -42
  567. package/packages/pm-todos/extensions/todos/manifest.json +13 -1
  568. package/scripts/bundle-cli.mjs +121 -17
  569. package/dist/cli-bundle/chunks/chunk-PB2YU2E3.js.map +0 -7
  570. package/dist/cli-bundle/chunks/chunk-RJONRNXN.js.map +0 -7
  571. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js +0 -13864
  572. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js.map +0 -7
  573. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js +0 -24225
  574. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js.map +0 -7
  575. package/dist/cli-bundle/chunks/register-list-query-EIVQ5FMR.js.map +0 -7
  576. package/dist/cli-bundle/chunks/register-mutation-RSZNPSGI.js.map +0 -7
  577. package/dist/cli-bundle/chunks/register-operations-APUSYDMR.js.map +0 -7
  578. package/dist/cli-bundle/chunks/register-setup-OZOKSMPJ.js.map +0 -7
@@ -0,0 +1,770 @@
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]="f2ffb908-84bd-5d5d-85a9-27eb226d4d5d")}catch(e){}}();
3
+ import {
4
+ assertAliasesAvailable,
5
+ buildInvalidTypeHint,
6
+ escapeForDoubleQuotes,
7
+ normalizeAddTypeInput,
8
+ parseItemTypesFile,
9
+ removeItemType,
10
+ serializeItemTypesFile,
11
+ upsertItemType
12
+ } from "./chunk-26KTVXJW.js";
13
+ import {
14
+ acquireLock,
15
+ listAllFrontMatterLight
16
+ } from "./chunk-CWT53EYT.js";
17
+ import "./chunk-SSFMJCPF.js";
18
+ import "./chunk-KBG47ZOY.js";
19
+ import {
20
+ resolveItemTypeRegistry
21
+ } from "./chunk-SZQCER6S.js";
22
+ import {
23
+ nowIso
24
+ } from "./chunk-NQP3ECKF.js";
25
+ import {
26
+ DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
27
+ DEFAULT_RUNTIME_STATUS_DEFINITIONS,
28
+ EXIT_CODE,
29
+ PmCliError,
30
+ RUNTIME_STATUS_ROLE_VALUES,
31
+ filePathForSchemaSection,
32
+ getActiveExtensionRegistrations,
33
+ getSettingsPath,
34
+ normalizeRuntimeSchemaSettings,
35
+ pathExists,
36
+ readFileIfExists,
37
+ readSettings,
38
+ resolveGovernanceKnobs,
39
+ resolvePmRoot,
40
+ resolveRuntimeStatusRegistry,
41
+ runActiveOnWriteHooks,
42
+ writeFileAtomic
43
+ } from "./chunk-4LTBNUYT.js";
44
+
45
+ // dist/core/schema/status-defs-file.js
46
+ var RUNTIME_STATUS_ROLE_SET = new Set(RUNTIME_STATUS_ROLE_VALUES);
47
+ var BUILTIN_STATUS_IDS = new Set(DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) => normalizeStatusToken(definition.id)).filter((id) => id.length > 0));
48
+ function normalizeStatusToken(value) {
49
+ return typeof value === "string" ? value.trim().toLowerCase().replaceAll(/[\s-]+/g, "_") : "";
50
+ }
51
+ function dedupeTokens(values) {
52
+ const seen = /* @__PURE__ */ new Set();
53
+ for (const value of values) {
54
+ const token = normalizeStatusToken(value);
55
+ if (token.length > 0) {
56
+ seen.add(token);
57
+ }
58
+ }
59
+ return [...seen].sort((left, right) => left.localeCompare(right));
60
+ }
61
+ function normalizeAddStatusInput(raw) {
62
+ const id = normalizeStatusToken(raw.id);
63
+ if (id.length === 0) {
64
+ throw new Error("Status id must not be empty.");
65
+ }
66
+ if (BUILTIN_STATUS_IDS.has(id)) {
67
+ throw new Error(`Cannot add-status the built-in status "${id}". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(", ")}.`);
68
+ }
69
+ let roles;
70
+ if (raw.roles !== void 0) {
71
+ roles = [];
72
+ const seenRoles = /* @__PURE__ */ new Set();
73
+ for (const rawRole of raw.roles) {
74
+ const role = typeof rawRole === "string" ? rawRole.trim().toLowerCase() : "";
75
+ if (role.length === 0) {
76
+ continue;
77
+ }
78
+ if (!RUNTIME_STATUS_ROLE_SET.has(role)) {
79
+ throw new Error(`Invalid status role "${rawRole}". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(", ")}.`);
80
+ }
81
+ if (!seenRoles.has(role)) {
82
+ seenRoles.add(role);
83
+ roles.push(role);
84
+ }
85
+ }
86
+ }
87
+ const aliases = raw.aliases === void 0 ? void 0 : dedupeTokens(raw.aliases).filter((alias) => alias !== id);
88
+ const description = raw.description?.trim();
89
+ const order = typeof raw.order === "number" && Number.isFinite(raw.order) ? Math.trunc(raw.order) : void 0;
90
+ return {
91
+ id,
92
+ roles,
93
+ aliases,
94
+ description: description && description.length > 0 ? description : void 0,
95
+ order
96
+ };
97
+ }
98
+ function selectStatusesArray(parsed) {
99
+ if (Array.isArray(parsed)) {
100
+ return parsed;
101
+ }
102
+ if (typeof parsed !== "object" || parsed === null) {
103
+ return void 0;
104
+ }
105
+ const record = parsed;
106
+ if (Array.isArray(record.statuses)) {
107
+ return record.statuses;
108
+ }
109
+ if (Array.isArray(record.definitions)) {
110
+ return record.definitions;
111
+ }
112
+ return void 0;
113
+ }
114
+ function extractStatusDefinitions(parsed) {
115
+ const candidate = selectStatusesArray(parsed);
116
+ if (!candidate) {
117
+ return [];
118
+ }
119
+ const definitions = [];
120
+ for (const entry of candidate) {
121
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
122
+ continue;
123
+ }
124
+ const record = entry;
125
+ if (typeof record.id !== "string" || record.id.trim().length === 0) {
126
+ continue;
127
+ }
128
+ definitions.push(record);
129
+ }
130
+ return definitions;
131
+ }
132
+ function parseStatusDefsFile(raw) {
133
+ if (raw === null || raw === void 0 || raw.trim().length === 0) {
134
+ return { statuses: [] };
135
+ }
136
+ let parsed;
137
+ try {
138
+ parsed = JSON.parse(raw);
139
+ } catch {
140
+ throw new Error("schema/statuses.json contains invalid JSON.");
141
+ }
142
+ return { statuses: extractStatusDefinitions(parsed) };
143
+ }
144
+ function serializeStatusDefsFile(file) {
145
+ return `${JSON.stringify({ statuses: file.statuses }, null, 2)}
146
+ `;
147
+ }
148
+ function upsertStatusDef(file, input, baseDefinition) {
149
+ const statuses = file.statuses.slice();
150
+ const existingIndex = statuses.findIndex((definition) => normalizeStatusToken(definition.id) === input.id);
151
+ const existing = existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;
152
+ const next = {
153
+ ...existing ?? {},
154
+ id: input.id
155
+ };
156
+ if (input.roles !== void 0) {
157
+ if (input.roles.length > 0) {
158
+ next.roles = [...input.roles];
159
+ } else if (next.roles !== void 0) {
160
+ delete next.roles;
161
+ }
162
+ }
163
+ if (input.aliases !== void 0) {
164
+ if (input.aliases.length > 0) {
165
+ next.aliases = [...input.aliases];
166
+ } else if (next.aliases !== void 0) {
167
+ delete next.aliases;
168
+ }
169
+ }
170
+ if (input.description !== void 0) {
171
+ next.description = input.description;
172
+ }
173
+ if (input.order !== void 0) {
174
+ next.order = input.order;
175
+ }
176
+ if (existingIndex >= 0) {
177
+ statuses[existingIndex] = next;
178
+ } else {
179
+ statuses.push(next);
180
+ }
181
+ return {
182
+ file: { statuses },
183
+ definition: next,
184
+ // "replaced" reflects whether the status already existed effectively (in the
185
+ // file OR in resolved settings), so the CLI reports "Updated" vs "Registered"
186
+ // correctly even when the prior definition lived only in settings.
187
+ replaced: existing !== void 0
188
+ };
189
+ }
190
+ function removeStatusDef(file, id) {
191
+ const normalizedId = normalizeStatusToken(id);
192
+ if (normalizedId.length === 0) {
193
+ throw new Error("Status id must not be empty.");
194
+ }
195
+ if (BUILTIN_STATUS_IDS.has(normalizedId)) {
196
+ throw new Error(`Cannot remove built-in status "${normalizedId}". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(", ")}.`);
197
+ }
198
+ const statuses = file.statuses.slice();
199
+ const existingIndex = statuses.findIndex((definition2) => normalizeStatusToken(definition2.id) === normalizedId);
200
+ if (existingIndex < 0) {
201
+ return { file: { statuses }, removed: false };
202
+ }
203
+ const [definition] = statuses.splice(existingIndex, 1);
204
+ return { file: { statuses }, removed: true, definition };
205
+ }
206
+ function assertStatusTokensAvailable(input, resolvedAliasToId) {
207
+ const candidates = [input.id, ...input.aliases ?? []];
208
+ for (const candidate of candidates) {
209
+ const token = normalizeStatusToken(candidate);
210
+ if (token.length === 0) {
211
+ continue;
212
+ }
213
+ const owner = resolvedAliasToId.get(token);
214
+ if (owner !== void 0 && owner !== input.id) {
215
+ throw new Error(`Status token "${token}" already belongs to status "${owner}". Choose a different id/alias to avoid shadowing it.`);
216
+ }
217
+ }
218
+ }
219
+
220
+ // dist/cli/commands/schema.js
221
+ var SCHEMA_SUBCOMMANDS = ["add-type", "remove-type", "add-status", "remove-status", "list", "show"];
222
+ var SCHEMA_TYPES_LOCK_ID = "schema-types";
223
+ var SCHEMA_STATUSES_LOCK_ID = "schema-statuses";
224
+ function toAuthor(candidate, defaultAuthor) {
225
+ const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;
226
+ const trimmed = resolved.trim();
227
+ return trimmed.length > 0 ? trimmed : "unknown";
228
+ }
229
+ async function runSchemaAddType(name, options, global) {
230
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
231
+ if (!await pathExists(getSettingsPath(pmRoot))) {
232
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
233
+ }
234
+ let normalized;
235
+ try {
236
+ normalized = normalizeAddTypeInput({
237
+ name,
238
+ description: options.description,
239
+ defaultStatus: options.defaultStatus,
240
+ folder: options.folder,
241
+ aliases: options.alias
242
+ });
243
+ } catch (error) {
244
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
245
+ }
246
+ const settings = await readSettings(pmRoot);
247
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
248
+ const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
249
+ const warnings = [];
250
+ const author = toAuthor(options.author, settings.author_default);
251
+ const governance = resolveGovernanceKnobs(settings);
252
+ const releaseLock = await acquireLock(pmRoot, SCHEMA_TYPES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
253
+ let upsert;
254
+ try {
255
+ const previousRaw = await readFileIfExists(typesPath);
256
+ let parsed;
257
+ try {
258
+ parsed = parseItemTypesFile(previousRaw);
259
+ } catch (error) {
260
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
261
+ }
262
+ try {
263
+ assertAliasesAvailable(normalized, parsed);
264
+ } catch (error) {
265
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
266
+ }
267
+ upsert = upsertItemType(parsed, normalized);
268
+ await writeFileAtomic(typesPath, serializeItemTypesFile(upsert.file));
269
+ warnings.push(...await runActiveOnWriteHooks({
270
+ path: typesPath,
271
+ scope: "project",
272
+ op: "schema:add-type"
273
+ }));
274
+ } finally {
275
+ await releaseLock();
276
+ }
277
+ return {
278
+ action: "add-type",
279
+ registered: true,
280
+ replaced: upsert.replaced,
281
+ type: upsert.definition,
282
+ file: {
283
+ path: typesPath,
284
+ definitions: upsert.file.definitions.length
285
+ },
286
+ warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
287
+ generated_at: nowIso()
288
+ };
289
+ }
290
+ async function ensureInitialized(pmRoot) {
291
+ if (!await pathExists(getSettingsPath(pmRoot))) {
292
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
293
+ }
294
+ }
295
+ async function countItemsUsingType(pmRoot, settings, schema, typeName) {
296
+ const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
297
+ const lowerName = typeName.trim().toLowerCase();
298
+ const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);
299
+ return items.filter((item) => typeof item.type === "string" && item.type.toLowerCase() === lowerName).length;
300
+ }
301
+ async function countItemsUsingStatus(pmRoot, settings, schema, statusId) {
302
+ const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
303
+ const statusRegistry = resolveRuntimeStatusRegistry(schema);
304
+ const normalizedId = normalizeStatusToken(statusId);
305
+ const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);
306
+ return items.filter((item) => {
307
+ const itemStatus = typeof item.status === "string" ? item.status : "";
308
+ const resolved = statusRegistry.alias_to_id.get(normalizeStatusToken(itemStatus)) ?? normalizeStatusToken(itemStatus);
309
+ return resolved === normalizedId;
310
+ }).length;
311
+ }
312
+ function workflowSlotsReferencing(workflow, statusId) {
313
+ const slots = [
314
+ ["draft_status", workflow.draft_status],
315
+ ["open_status", workflow.open_status],
316
+ ["in_progress_status", workflow.in_progress_status],
317
+ ["blocked_status", workflow.blocked_status],
318
+ ["close_status", workflow.close_status],
319
+ ["canceled_status", workflow.canceled_status]
320
+ ];
321
+ return slots.filter(([, value]) => value !== void 0 && normalizeStatusToken(value) === statusId).map(([slot]) => slot);
322
+ }
323
+ async function runSchemaRemoveType(name, options, global) {
324
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
325
+ await ensureInitialized(pmRoot);
326
+ const settings = await readSettings(pmRoot);
327
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
328
+ const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
329
+ const warnings = [];
330
+ const author = toAuthor(options.author, settings.author_default);
331
+ const governance = resolveGovernanceKnobs(settings);
332
+ const releaseLock = await acquireLock(pmRoot, SCHEMA_TYPES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
333
+ let removal;
334
+ try {
335
+ const previousRaw = await readFileIfExists(typesPath);
336
+ let parsed;
337
+ try {
338
+ parsed = parseItemTypesFile(previousRaw);
339
+ } catch (error) {
340
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
341
+ }
342
+ try {
343
+ removal = removeItemType(parsed, name);
344
+ } catch (error) {
345
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
346
+ }
347
+ if (removal.removed) {
348
+ const removedName = (removal.definition?.name ?? name ?? "").trim();
349
+ if (removedName.length > 0) {
350
+ const usingType = await countItemsUsingType(pmRoot, settings, schema, removedName);
351
+ if (usingType > 0) {
352
+ warnings.push(`items_using_type:${usingType}`);
353
+ }
354
+ }
355
+ await writeFileAtomic(typesPath, serializeItemTypesFile(removal.file));
356
+ warnings.push(...await runActiveOnWriteHooks({
357
+ path: typesPath,
358
+ scope: "project",
359
+ op: "schema:remove-type"
360
+ }));
361
+ }
362
+ } finally {
363
+ await releaseLock();
364
+ }
365
+ return {
366
+ action: "remove-type",
367
+ removed: removal.removed,
368
+ ...removal.definition ? { type: removal.definition } : {},
369
+ file: {
370
+ path: typesPath,
371
+ definitions: removal.file.definitions.length
372
+ },
373
+ warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
374
+ generated_at: nowIso()
375
+ };
376
+ }
377
+ function statusesPathFor(pmRoot, schema) {
378
+ return filePathForSchemaSection(pmRoot, schema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses);
379
+ }
380
+ async function runSchemaAddStatus(id, options, global) {
381
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
382
+ await ensureInitialized(pmRoot);
383
+ let normalized;
384
+ try {
385
+ normalized = normalizeAddStatusInput({
386
+ id,
387
+ roles: options.role,
388
+ aliases: options.alias,
389
+ description: options.description,
390
+ order: options.order
391
+ });
392
+ } catch (error) {
393
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
394
+ }
395
+ const settings = await readSettings(pmRoot);
396
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
397
+ const statusesPath = statusesPathFor(pmRoot, schema);
398
+ const statusRegistry = resolveRuntimeStatusRegistry(schema);
399
+ try {
400
+ assertStatusTokensAvailable(normalized, statusRegistry.alias_to_id);
401
+ } catch (error) {
402
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
403
+ }
404
+ const resolvedExisting = statusRegistry.by_id.get(normalized.id);
405
+ const baseDefinition = resolvedExisting ? {
406
+ id: resolvedExisting.id,
407
+ ...Array.isArray(resolvedExisting.roles) && resolvedExisting.roles.length > 0 ? { roles: [...resolvedExisting.roles] } : {},
408
+ ...Array.isArray(resolvedExisting.aliases) && resolvedExisting.aliases.length > 0 ? { aliases: [...resolvedExisting.aliases] } : {},
409
+ ...resolvedExisting.description ? { description: resolvedExisting.description } : {},
410
+ ...typeof resolvedExisting.order === "number" ? { order: resolvedExisting.order } : {}
411
+ } : void 0;
412
+ const warnings = [];
413
+ const author = toAuthor(options.author, settings.author_default);
414
+ const governance = resolveGovernanceKnobs(settings);
415
+ const releaseLock = await acquireLock(pmRoot, SCHEMA_STATUSES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
416
+ let upsert;
417
+ try {
418
+ const previousRaw = await readFileIfExists(statusesPath);
419
+ let parsed;
420
+ try {
421
+ parsed = parseStatusDefsFile(previousRaw);
422
+ } catch (error) {
423
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
424
+ }
425
+ const fileAliasToId = /* @__PURE__ */ new Map();
426
+ for (const definition of parsed.statuses) {
427
+ const defId = normalizeStatusToken(definition.id);
428
+ if (defId.length === 0) {
429
+ continue;
430
+ }
431
+ fileAliasToId.set(defId, defId);
432
+ for (const alias of Array.isArray(definition.aliases) ? definition.aliases : []) {
433
+ const aliasToken = normalizeStatusToken(alias);
434
+ if (aliasToken.length > 0 && !fileAliasToId.has(aliasToken)) {
435
+ fileAliasToId.set(aliasToken, defId);
436
+ }
437
+ }
438
+ }
439
+ try {
440
+ assertStatusTokensAvailable(normalized, fileAliasToId);
441
+ } catch (error) {
442
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
443
+ }
444
+ upsert = upsertStatusDef(parsed, normalized, baseDefinition);
445
+ await writeFileAtomic(statusesPath, serializeStatusDefsFile(upsert.file));
446
+ warnings.push(...await runActiveOnWriteHooks({
447
+ path: statusesPath,
448
+ scope: "project",
449
+ op: "schema:add-status"
450
+ }));
451
+ } finally {
452
+ await releaseLock();
453
+ }
454
+ return {
455
+ action: "add-status",
456
+ registered: true,
457
+ replaced: upsert.replaced,
458
+ status: upsert.definition,
459
+ file: {
460
+ path: statusesPath,
461
+ statuses: upsert.file.statuses.length
462
+ },
463
+ warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
464
+ generated_at: nowIso()
465
+ };
466
+ }
467
+ async function runSchemaRemoveStatus(id, options, global) {
468
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
469
+ await ensureInitialized(pmRoot);
470
+ const settings = await readSettings(pmRoot);
471
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
472
+ const statusesPath = statusesPathFor(pmRoot, schema);
473
+ const warnings = [];
474
+ const author = toAuthor(options.author, settings.author_default);
475
+ const governance = resolveGovernanceKnobs(settings);
476
+ const releaseLock = await acquireLock(pmRoot, SCHEMA_STATUSES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
477
+ let removal;
478
+ try {
479
+ const previousRaw = await readFileIfExists(statusesPath);
480
+ let parsed;
481
+ try {
482
+ parsed = parseStatusDefsFile(previousRaw);
483
+ } catch (error) {
484
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
485
+ }
486
+ try {
487
+ removal = removeStatusDef(parsed, id);
488
+ } catch (error) {
489
+ throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
490
+ }
491
+ if (removal.removed) {
492
+ const removedId = normalizeStatusToken(removal.definition?.id ?? id);
493
+ if (removedId.length > 0 && !BUILTIN_STATUS_IDS.has(removedId)) {
494
+ const usingStatus = await countItemsUsingStatus(pmRoot, settings, schema, removedId);
495
+ if (usingStatus > 0) {
496
+ warnings.push(`items_using_status:${usingStatus}`);
497
+ }
498
+ const referencingSlots = workflowSlotsReferencing(schema.workflow, removedId);
499
+ if (referencingSlots.length > 0) {
500
+ warnings.push(`status_referenced_by_workflow:${referencingSlots.join(",")}`);
501
+ }
502
+ }
503
+ await writeFileAtomic(statusesPath, serializeStatusDefsFile(removal.file));
504
+ warnings.push(...await runActiveOnWriteHooks({
505
+ path: statusesPath,
506
+ scope: "project",
507
+ op: "schema:remove-status"
508
+ }));
509
+ }
510
+ } finally {
511
+ await releaseLock();
512
+ }
513
+ return {
514
+ action: "remove-status",
515
+ removed: removal.removed,
516
+ ...removal.definition ? { status: removal.definition } : {},
517
+ file: {
518
+ path: statusesPath,
519
+ statuses: removal.file.statuses.length
520
+ },
521
+ warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
522
+ generated_at: nowIso()
523
+ };
524
+ }
525
+ function toSchemaTypeSummary(definition) {
526
+ return {
527
+ name: definition.name,
528
+ folder: definition.folder,
529
+ aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],
530
+ ...definition.default_status ? { default_status: definition.default_status } : {},
531
+ ...definition.description ? { description: definition.description } : {}
532
+ };
533
+ }
534
+ function toSchemaTypeDefinition(definition, source, extensionProvenance) {
535
+ return {
536
+ ...toSchemaTypeSummary(definition),
537
+ source,
538
+ ...extensionProvenance ? { extension: extensionProvenance } : {},
539
+ required_create_fields: [...definition.required_create_fields],
540
+ required_create_repeatables: [...definition.required_create_repeatables],
541
+ options: structuredClone(definition.options),
542
+ command_option_policies: structuredClone(definition.command_option_policies)
543
+ };
544
+ }
545
+ function classifyTypeSource(name, customNames, extensionNames) {
546
+ const lowerName = name.toLowerCase();
547
+ if (extensionNames.has(lowerName)) {
548
+ return "extension";
549
+ }
550
+ if (customNames.has(lowerName)) {
551
+ return "custom";
552
+ }
553
+ return "builtin";
554
+ }
555
+ function collectExtensionTypeProvenance() {
556
+ const provenance = /* @__PURE__ */ new Map();
557
+ const registrations = getActiveExtensionRegistrations();
558
+ for (const registration of registrations?.item_types ?? []) {
559
+ const rawTypes = registration.types;
560
+ if (!Array.isArray(rawTypes)) {
561
+ continue;
562
+ }
563
+ for (const rawType of rawTypes) {
564
+ if (typeof rawType !== "object" || rawType === null || Array.isArray(rawType)) {
565
+ continue;
566
+ }
567
+ const name = rawType.name;
568
+ if (typeof name === "string" && name.trim().length > 0) {
569
+ provenance.set(name.trim().toLowerCase(), {
570
+ layer: registration.layer,
571
+ name: registration.name
572
+ });
573
+ }
574
+ }
575
+ }
576
+ return provenance;
577
+ }
578
+ function buildSchemaStatusSummaries(schema) {
579
+ const registry = resolveRuntimeStatusRegistry(schema);
580
+ const builtin = [];
581
+ const custom = [];
582
+ for (const definition of registry.definitions) {
583
+ const source = BUILTIN_STATUS_IDS.has(definition.id) ? "builtin" : "custom";
584
+ const summary = {
585
+ id: definition.id,
586
+ source,
587
+ roles: Array.isArray(definition.roles) ? [...definition.roles] : [],
588
+ aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],
589
+ ...definition.description ? { description: definition.description } : {}
590
+ };
591
+ if (source === "builtin") {
592
+ builtin.push(summary);
593
+ } else {
594
+ custom.push(summary);
595
+ }
596
+ }
597
+ return { builtin, custom };
598
+ }
599
+ async function loadSchemaInspectionContext(global) {
600
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
601
+ if (!await pathExists(getSettingsPath(pmRoot))) {
602
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
603
+ }
604
+ const settings = await readSettings(pmRoot);
605
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
606
+ const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
607
+ const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
608
+ const extensionProvenance = collectExtensionTypeProvenance();
609
+ const customNames = new Set((settings.item_types?.definitions ?? []).map((definition) => definition.name.trim().toLowerCase()).filter((name) => name.length > 0 && !extensionProvenance.has(name)));
610
+ return {
611
+ typesPath,
612
+ byType: registry.by_type,
613
+ customNames,
614
+ extensionProvenance,
615
+ schema
616
+ };
617
+ }
618
+ async function runSchemaList(global) {
619
+ const context = await loadSchemaInspectionContext(global);
620
+ const builtin = [];
621
+ const custom = [];
622
+ const extension = [];
623
+ for (const definition of Object.values(context.byType).sort((left, right) => left.name.localeCompare(right.name))) {
624
+ const source = classifyTypeSource(definition.name, context.customNames, new Set(context.extensionProvenance.keys()));
625
+ const summary = toSchemaTypeSummary(definition);
626
+ if (source === "extension") {
627
+ extension.push(summary);
628
+ } else if (source === "custom") {
629
+ custom.push(summary);
630
+ } else {
631
+ builtin.push(summary);
632
+ }
633
+ }
634
+ const statusSummaries = buildSchemaStatusSummaries(context.schema);
635
+ return {
636
+ action: "list",
637
+ builtin,
638
+ custom,
639
+ extension,
640
+ counts: {
641
+ builtin: builtin.length,
642
+ custom: custom.length,
643
+ extension: extension.length,
644
+ total: builtin.length + custom.length + extension.length
645
+ },
646
+ statuses: {
647
+ builtin: statusSummaries.builtin,
648
+ custom: statusSummaries.custom,
649
+ counts: {
650
+ builtin: statusSummaries.builtin.length,
651
+ custom: statusSummaries.custom.length,
652
+ total: statusSummaries.builtin.length + statusSummaries.custom.length
653
+ }
654
+ },
655
+ file: {
656
+ path: context.typesPath
657
+ },
658
+ generated_at: nowIso()
659
+ };
660
+ }
661
+ async function runSchemaShow(name, global) {
662
+ const typeName = (name ?? "").trim();
663
+ if (typeName.length === 0) {
664
+ throw new PmCliError("Type name must not be empty.", EXIT_CODE.USAGE);
665
+ }
666
+ const context = await loadSchemaInspectionContext(global);
667
+ const match = Object.values(context.byType).find((definition) => definition.name.toLowerCase() === typeName.toLowerCase() || definition.aliases.some((alias) => alias.toLowerCase() === typeName.toLowerCase()));
668
+ if (!match) {
669
+ 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" });
670
+ }
671
+ return {
672
+ action: "show",
673
+ type: toSchemaTypeDefinition(match, classifyTypeSource(match.name, context.customNames, new Set(context.extensionProvenance.keys())), context.extensionProvenance.get(match.name.toLowerCase())),
674
+ file: {
675
+ path: context.typesPath
676
+ },
677
+ generated_at: nowIso()
678
+ };
679
+ }
680
+ function formatSchemaAddTypeHuman(result) {
681
+ const verb = result.replaced ? "Updated" : "Registered";
682
+ const aliasSuffix = result.type.aliases && result.type.aliases.length > 0 ? ` (aliases: ${result.type.aliases.join(", ")})` : "";
683
+ return `${verb} custom item type "${result.type.name}"${aliasSuffix} in ${result.file.path}. Run: pm create "${escapeForDoubleQuotes(result.type.name)}" "<title>"`;
684
+ }
685
+ function formatSchemaRemoveTypeHuman(result) {
686
+ if (!result.removed) {
687
+ return `No custom item type matched; nothing removed from ${result.file.path}.`;
688
+ }
689
+ const name = result.type?.name ?? "(unknown)";
690
+ return `Removed custom item type "${name}" from ${result.file.path}.`;
691
+ }
692
+ function formatSchemaAddStatusHuman(result) {
693
+ const verb = result.replaced ? "Updated" : "Registered";
694
+ const roleSuffix = result.status.roles && result.status.roles.length > 0 ? ` (roles: ${result.status.roles.join(", ")})` : "";
695
+ const aliasSuffix = result.status.aliases && result.status.aliases.length > 0 ? ` (aliases: ${result.status.aliases.join(", ")})` : "";
696
+ return `${verb} status "${result.status.id}"${roleSuffix}${aliasSuffix} in ${result.file.path}.`;
697
+ }
698
+ function formatSchemaRemoveStatusHuman(result) {
699
+ if (!result.removed) {
700
+ return `No custom status matched; nothing removed from ${result.file.path}.`;
701
+ }
702
+ const id = result.status?.id ?? "(unknown)";
703
+ return `Removed custom status "${id}" from ${result.file.path}.`;
704
+ }
705
+ function formatSchemaListHuman(result) {
706
+ const lines = [
707
+ `Schema types: ${result.counts.total} total (${result.counts.builtin} builtin, ${result.counts.custom} custom, ${result.counts.extension} extension)`
708
+ ];
709
+ for (const [label, entries] of [
710
+ ["builtin", result.builtin],
711
+ ["custom", result.custom],
712
+ ["extension", result.extension]
713
+ ]) {
714
+ if (entries.length === 0) {
715
+ continue;
716
+ }
717
+ lines.push(`${label}: ${entries.map((entry) => entry.name).join(", ")}`);
718
+ }
719
+ lines.push(`statuses: ${result.statuses.counts.total} total (${result.statuses.counts.builtin} builtin, ${result.statuses.counts.custom} custom)`);
720
+ for (const [label, entries] of [
721
+ ["builtin statuses", result.statuses.builtin],
722
+ ["custom statuses", result.statuses.custom]
723
+ ]) {
724
+ if (entries.length === 0) {
725
+ continue;
726
+ }
727
+ lines.push(`${label}: ${entries.map((entry) => entry.id).join(", ")}`);
728
+ }
729
+ lines.push(`Inspect one: pm schema show <Type>`);
730
+ return lines.join("\n");
731
+ }
732
+ function formatSchemaShowHuman(result) {
733
+ const parts = [
734
+ `type: ${result.type.name}`,
735
+ `source: ${result.type.source}`,
736
+ `folder: ${result.type.folder}`
737
+ ];
738
+ if (result.type.default_status) {
739
+ parts.push(`default_status: ${result.type.default_status}`);
740
+ }
741
+ if (result.type.aliases.length > 0) {
742
+ parts.push(`aliases: ${result.type.aliases.join(", ")}`);
743
+ }
744
+ if (result.type.description) {
745
+ parts.push(`description: ${result.type.description}`);
746
+ }
747
+ if (result.type.options.length > 0) {
748
+ parts.push(`options: ${result.type.options.map((option) => option.key).join(", ")}`);
749
+ }
750
+ return parts.join("\n");
751
+ }
752
+ export {
753
+ SCHEMA_SUBCOMMANDS,
754
+ buildInvalidTypeHint,
755
+ formatSchemaAddStatusHuman,
756
+ formatSchemaAddTypeHuman,
757
+ formatSchemaListHuman,
758
+ formatSchemaRemoveStatusHuman,
759
+ formatSchemaRemoveTypeHuman,
760
+ formatSchemaShowHuman,
761
+ runSchemaAddStatus,
762
+ runSchemaAddType,
763
+ runSchemaList,
764
+ runSchemaRemoveStatus,
765
+ runSchemaRemoveType,
766
+ runSchemaShow
767
+ };
768
+ //# sourceMappingURL=schema-LVXZWFGY.js.map
769
+
770
+ //# debugId=f2ffb908-84bd-5d5d-85a9-27eb226d4d5d