@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.
- package/CHANGELOG.md +152 -0
- package/dist/cli/argv-utils.js +7 -3
- package/dist/cli/argv-utils.js.map +1 -1
- package/dist/cli/bootstrap-args.d.ts +1 -0
- package/dist/cli/bootstrap-args.js +23 -3
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/calendar.js +96 -10
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.d.ts +63 -0
- package/dist/cli/commands/close-many.js +302 -0
- package/dist/cli/commands/close-many.js.map +1 -0
- package/dist/cli/commands/completion.d.ts +1 -0
- package/dist/cli/commands/completion.js +241 -27
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +4 -4
- package/dist/cli/commands/config.js +115 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/contracts.js +191 -162
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -0
- package/dist/cli/commands/create.js +109 -116
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/doctor.d.ts +12 -0
- package/dist/cli/commands/extension/doctor.js +97 -2
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.d.ts +2 -0
- package/dist/cli/commands/extension/install-sources.js +11 -4
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +49 -48
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.js +51 -23
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/get.js +7 -7
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.js +38 -3
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/index.d.ts +2 -1
- package/dist/cli/commands/index.js +4 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +10 -0
- package/dist/cli/commands/init.js +107 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.d.ts +5 -0
- package/dist/cli/commands/list.js +58 -26
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/reindex.js +164 -48
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
- package/dist/cli/commands/restore.js +25 -4
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +122 -1
- package/dist/cli/commands/schema.js +536 -6
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +18 -0
- package/dist/cli/commands/search.js +56 -12
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.js +4 -3
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +69 -140
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +2 -0
- package/dist/cli/commands/update.js +138 -119
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +1 -0
- package/dist/cli/commands/validate.js +63 -33
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +26 -3
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/help-content.js +82 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +377 -23
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +16 -12
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +217 -47
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +34 -25
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +8 -8
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +35 -5
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli/search-refresh.d.ts +2 -0
- package/dist/cli/search-refresh.js +13 -0
- package/dist/cli/search-refresh.js.map +1 -0
- package/dist/cli-bundle/chunks/activity-3RWRRNOW.js +20 -0
- package/dist/cli-bundle/chunks/activity-3RWRRNOW.js.map +1 -0
- package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +16 -0
- package/dist/cli-bundle/chunks/activity-P5BUMWP3.js.map +7 -0
- package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js +206 -0
- package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +1 -0
- package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js +209 -0
- package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js.map +7 -0
- package/dist/cli-bundle/chunks/append-5JE3YGXU.js +72 -0
- package/dist/cli-bundle/chunks/append-5JE3YGXU.js.map +7 -0
- package/dist/cli-bundle/chunks/append-PNN6UIBZ.js +69 -0
- package/dist/cli-bundle/chunks/append-PNN6UIBZ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-26KTVXJW.js +218 -0
- package/dist/cli-bundle/chunks/chunk-26KTVXJW.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js +27 -0
- package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js +761 -0
- package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js +5553 -0
- package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js +634 -0
- package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js +1832 -0
- package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js +1891 -0
- package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js +412 -0
- package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js +182 -0
- package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-7K24QB23.js +698 -0
- package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js +380 -0
- package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js +230 -0
- package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js +185 -0
- package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js +332 -0
- package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js +1681 -0
- package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PB2YU2E3.js → chunk-BNL6S7QH.js} +28 -70
- package/dist/cli-bundle/chunks/chunk-BNL6S7QH.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js +154 -0
- package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-CJDQB2ED.js +341 -0
- package/dist/cli-bundle/chunks/chunk-CJDQB2ED.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-CWT53EYT.js +1340 -0
- package/dist/cli-bundle/chunks/chunk-CWT53EYT.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-D3WUNETC.js +349 -0
- package/dist/cli-bundle/chunks/chunk-D3WUNETC.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js +1714 -0
- package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-DFIZGAI5.js +550 -0
- package/dist/cli-bundle/chunks/chunk-DFIZGAI5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js +1704 -0
- package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-EAOG77HM.js +56 -0
- package/dist/cli-bundle/chunks/chunk-EAOG77HM.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js +2988 -0
- package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js +128 -0
- package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-G5BACLYH.js +454 -0
- package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js +383 -0
- package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js +57 -0
- package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js +3860 -0
- package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GPGAYASV.js +346 -0
- package/dist/cli-bundle/chunks/chunk-GPGAYASV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js +1356 -0
- package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js +342 -0
- package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
- package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
- package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-JB4RGL4V.js +185 -0
- package/dist/cli-bundle/chunks/chunk-JB4RGL4V.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-JQI2HE55.js +130 -0
- package/dist/cli-bundle/chunks/chunk-JQI2HE55.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-K47WAYQV.js +60 -0
- package/dist/cli-bundle/chunks/chunk-K47WAYQV.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-KA24HME7.js +79 -0
- package/dist/cli-bundle/chunks/chunk-KA24HME7.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js +1325 -0
- package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js +242 -0
- package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js +221 -0
- package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-LDJK7SHN.js +157 -0
- package/dist/cli-bundle/chunks/chunk-LDJK7SHN.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
- package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-MISYRLEP.js +80 -0
- package/dist/cli-bundle/chunks/chunk-MISYRLEP.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js +457 -0
- package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js +173 -0
- package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js +338 -0
- package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-O7IWB35H.js +18 -0
- package/dist/cli-bundle/chunks/chunk-O7IWB35H.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js +3040 -0
- package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js +751 -0
- package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js +1861 -0
- package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js +20 -0
- package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-RANZIID5.js +176 -0
- package/dist/cli-bundle/chunks/chunk-RANZIID5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js +140 -0
- package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-S3CV7JGJ.js +233 -0
- package/dist/cli-bundle/chunks/chunk-S3CV7JGJ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js +5705 -0
- package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js +76 -0
- package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-SZQCER6S.js +631 -0
- package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js +540 -0
- package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js +422 -0
- package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RJONRNXN.js → chunk-TK633IVD.js} +51 -32
- package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js +131 -0
- package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js +119 -0
- package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-UOVLWB47.js +1664 -0
- package/dist/cli-bundle/chunks/chunk-UOVLWB47.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js +186 -0
- package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js +182 -0
- package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js +189 -0
- package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js +1385 -0
- package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-XX5LRINW.js +90 -0
- package/dist/cli-bundle/chunks/chunk-XX5LRINW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-Y2AKE2HS.js +252 -0
- package/dist/cli-bundle/chunks/chunk-Y2AKE2HS.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js +3898 -0
- package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js +1809 -0
- package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js.map +1 -0
- package/dist/cli-bundle/chunks/claim-AZLP7YFO.js +132 -0
- package/dist/cli-bundle/chunks/claim-AZLP7YFO.js.map +7 -0
- package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js +129 -0
- package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js.map +1 -0
- package/dist/cli-bundle/chunks/close-65DFYAVS.js +17 -0
- package/dist/cli-bundle/chunks/close-65DFYAVS.js.map +1 -0
- package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +13 -0
- package/dist/cli-bundle/chunks/close-RMHQ3KWH.js.map +7 -0
- package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js +311 -0
- package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +1 -0
- package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js +314 -0
- package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +7 -0
- package/dist/cli-bundle/chunks/comments-AGBNSJJH.js +103 -0
- package/dist/cli-bundle/chunks/comments-AGBNSJJH.js.map +7 -0
- package/dist/cli-bundle/chunks/comments-CJWXQI7X.js +100 -0
- package/dist/cli-bundle/chunks/comments-CJWXQI7X.js.map +1 -0
- package/dist/cli-bundle/chunks/config-5ON3ADRH.js +1688 -0
- package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +7 -0
- package/dist/cli-bundle/chunks/config-DDPYIA6J.js +1671 -0
- package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +1 -0
- package/dist/cli-bundle/chunks/context-E6U3DWVM.js +1471 -0
- package/dist/cli-bundle/chunks/context-E6U3DWVM.js.map +7 -0
- package/dist/cli-bundle/chunks/context-ZOJEN5VT.js +1461 -0
- package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +1 -0
- package/dist/cli-bundle/chunks/contracts-CXSFM45B.js +1277 -0
- package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +7 -0
- package/dist/cli-bundle/chunks/contracts-LCSX5R53.js +1274 -0
- package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +1 -0
- package/dist/cli-bundle/chunks/create-ATONSAZW.js +27 -0
- package/dist/cli-bundle/chunks/create-ATONSAZW.js.map +7 -0
- package/dist/cli-bundle/chunks/create-WYFKN2U4.js +31 -0
- package/dist/cli-bundle/chunks/create-WYFKN2U4.js.map +1 -0
- package/dist/cli-bundle/chunks/delete-RONNH4F4.js +58 -0
- package/dist/cli-bundle/chunks/delete-RONNH4F4.js.map +7 -0
- package/dist/cli-bundle/chunks/delete-ZXWC56WO.js +55 -0
- package/dist/cli-bundle/chunks/delete-ZXWC56WO.js.map +1 -0
- package/dist/cli-bundle/chunks/deps-EHXIFOZR.js +225 -0
- package/dist/cli-bundle/chunks/deps-EHXIFOZR.js.map +1 -0
- package/dist/cli-bundle/chunks/deps-WII3O4HB.js +228 -0
- package/dist/cli-bundle/chunks/deps-WII3O4HB.js.map +7 -0
- package/dist/cli-bundle/chunks/docs-JMVCFNHH.js +34 -0
- package/dist/cli-bundle/chunks/docs-JMVCFNHH.js.map +7 -0
- package/dist/cli-bundle/chunks/docs-PDREIMLS.js +31 -0
- package/dist/cli-bundle/chunks/docs-PDREIMLS.js.map +1 -0
- package/dist/cli-bundle/chunks/extension-B4ROVWJD.js +28 -0
- package/dist/cli-bundle/chunks/extension-B4ROVWJD.js.map +1 -0
- package/dist/cli-bundle/chunks/extension-G6UXSM5S.js +24 -0
- package/dist/cli-bundle/chunks/extension-G6UXSM5S.js.map +7 -0
- package/dist/cli-bundle/chunks/files-2PN7UM2D.js +282 -0
- package/dist/cli-bundle/chunks/files-2PN7UM2D.js.map +1 -0
- package/dist/cli-bundle/chunks/files-MXYS5W4M.js +285 -0
- package/dist/cli-bundle/chunks/files-MXYS5W4M.js.map +7 -0
- package/dist/cli-bundle/chunks/gc-GT552UJH.js +178 -0
- package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +1 -0
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +181 -0
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +7 -0
- package/dist/cli-bundle/chunks/get-CINFEUIY.js +197 -0
- package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +7 -0
- package/dist/cli-bundle/chunks/get-WXMLRG7M.js +194 -0
- package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +1 -0
- package/dist/cli-bundle/chunks/health-5VPOJQ53.js +1258 -0
- package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +1 -0
- package/dist/cli-bundle/chunks/health-IT5DBPRJ.js +1261 -0
- package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +7 -0
- package/dist/cli-bundle/chunks/history-6FC4H6HI.js +20 -0
- package/dist/cli-bundle/chunks/history-6FC4H6HI.js.map +7 -0
- package/dist/cli-bundle/chunks/history-FLZIP7PM.js +24 -0
- package/dist/cli-bundle/chunks/history-FLZIP7PM.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js +23 -0
- package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +19 -0
- package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js.map +7 -0
- package/dist/cli-bundle/chunks/history-repair-KC5ZOJRZ.js +196 -0
- package/dist/cli-bundle/chunks/history-repair-KC5ZOJRZ.js.map +7 -0
- package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js +193 -0
- package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js.map +1 -0
- package/dist/cli-bundle/chunks/init-6MRFVOLH.js +20 -0
- package/dist/cli-bundle/chunks/init-6MRFVOLH.js.map +1 -0
- package/dist/cli-bundle/chunks/init-KHX3FEEM.js +16 -0
- package/dist/cli-bundle/chunks/init-KHX3FEEM.js.map +7 -0
- package/dist/cli-bundle/chunks/learnings-A3CLB5CO.js +47 -0
- package/dist/cli-bundle/chunks/learnings-A3CLB5CO.js.map +7 -0
- package/dist/cli-bundle/chunks/learnings-DCX55BNX.js +44 -0
- package/dist/cli-bundle/chunks/learnings-DCX55BNX.js.map +1 -0
- package/dist/cli-bundle/chunks/list-53LZ2AEO.js +20 -0
- package/dist/cli-bundle/chunks/list-53LZ2AEO.js.map +7 -0
- package/dist/cli-bundle/chunks/list-DBRECOG4.js +24 -0
- package/dist/cli-bundle/chunks/list-DBRECOG4.js.map +1 -0
- package/dist/cli-bundle/chunks/notes-42LIC3UE.js +47 -0
- package/dist/cli-bundle/chunks/notes-42LIC3UE.js.map +7 -0
- package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js +44 -0
- package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js.map +1 -0
- package/dist/cli-bundle/chunks/plan-HDQXEUKD.js +1174 -0
- package/dist/cli-bundle/chunks/plan-HDQXEUKD.js.map +7 -0
- package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js +1171 -0
- package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-EIVQ5FMR.js → register-list-query-AG3XKXWL.js} +25 -18
- package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +7 -0
- package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js +227 -0
- package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +1 -0
- package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js +813 -0
- package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-RSZNPSGI.js → register-mutation-RSMT6DPK.js} +160 -39
- package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js +370 -0
- package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-APUSYDMR.js → register-operations-Q54JQZUN.js} +50 -32
- package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +7 -0
- package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js +242 -0
- package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-OZOKSMPJ.js → register-setup-YJKIQRKA.js} +21 -13
- package/dist/cli-bundle/chunks/register-setup-YJKIQRKA.js.map +7 -0
- package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js +21 -0
- package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +17 -0
- package/dist/cli-bundle/chunks/restore-JL5QIH7H.js.map +7 -0
- package/dist/cli-bundle/chunks/schema-LVXZWFGY.js +770 -0
- package/dist/cli-bundle/chunks/schema-LVXZWFGY.js.map +1 -0
- package/dist/cli-bundle/chunks/schema-V6BX65Q2.js +780 -0
- package/dist/cli-bundle/chunks/schema-V6BX65Q2.js.map +7 -0
- package/dist/cli-bundle/chunks/search-5A3BMFA7.js +1144 -0
- package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +7 -0
- package/dist/cli-bundle/chunks/search-C7NPB7G7.js +1127 -0
- package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +120 -0
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +123 -0
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +7 -0
- package/dist/cli-bundle/chunks/test-OFYONO3C.js +35 -0
- package/dist/cli-bundle/chunks/test-OFYONO3C.js.map +1 -0
- package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +31 -0
- package/dist/cli-bundle/chunks/test-RJ4ZF35X.js.map +7 -0
- package/dist/cli-bundle/chunks/test-all-EEMKNTGU.js +331 -0
- package/dist/cli-bundle/chunks/test-all-EEMKNTGU.js.map +7 -0
- package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js +328 -0
- package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js.map +1 -0
- package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js +929 -0
- package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js.map +1 -0
- package/dist/cli-bundle/chunks/test-runs-L2M7WKH7.js +939 -0
- package/dist/cli-bundle/chunks/test-runs-L2M7WKH7.js.map +7 -0
- package/dist/cli-bundle/chunks/update-6YEHPVXH.js +25 -0
- package/dist/cli-bundle/chunks/update-6YEHPVXH.js.map +1 -0
- package/dist/cli-bundle/chunks/update-PYLVHMRD.js +21 -0
- package/dist/cli-bundle/chunks/update-PYLVHMRD.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-322CCH2L.js +608 -0
- package/dist/cli-bundle/chunks/update-many-322CCH2L.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-DYWGW57M.js +605 -0
- package/dist/cli-bundle/chunks/update-many-DYWGW57M.js.map +1 -0
- package/dist/cli-bundle/chunks/upgrade-2U727SAM.js +269 -0
- package/dist/cli-bundle/chunks/upgrade-2U727SAM.js.map +7 -0
- package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js +266 -0
- package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js.map +1 -0
- package/dist/cli-bundle/chunks/validate-GZ24NYHO.js +1120 -0
- package/dist/cli-bundle/chunks/validate-GZ24NYHO.js.map +1 -0
- package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js +1123 -0
- package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js.map +7 -0
- package/dist/cli-bundle/main.js +615 -121
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
- package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
- package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
- package/dist/core/config/positional-value.js +4 -2
- package/dist/core/config/positional-value.js.map +1 -1
- package/dist/core/diagnostics/remediation.d.ts +73 -0
- package/dist/core/diagnostics/remediation.js +328 -0
- package/dist/core/diagnostics/remediation.js.map +1 -0
- package/dist/core/extensions/extension-hook-runtime.js +9 -2
- package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +60 -4
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +5 -1
- package/dist/core/extensions/index.js +61 -2
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/item-fields.d.ts +5 -1
- package/dist/core/extensions/item-fields.js +126 -4
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.js +283 -8
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/item/item-format.d.ts +3 -2
- package/dist/core/item/item-format.js +15 -10
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/item-type-definition.js +6 -2
- package/dist/core/item/item-type-definition.js.map +1 -1
- package/dist/core/item/status-filter.d.ts +29 -0
- package/dist/core/item/status-filter.js +97 -0
- package/dist/core/item/status-filter.js.map +1 -0
- package/dist/core/item/type-registry.d.ts +4 -0
- package/dist/core/item/type-registry.js +12 -2
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/output/output.js +17 -5
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +15 -0
- package/dist/core/schema/item-types-file.js +27 -2
- package/dist/core/schema/item-types-file.js.map +1 -1
- package/dist/core/schema/runtime-field-filters.js +4 -3
- package/dist/core/schema/runtime-field-filters.js.map +1 -1
- package/dist/core/schema/runtime-field-values.d.ts +1 -1
- package/dist/core/schema/runtime-field-values.js +10 -4
- package/dist/core/schema/runtime-field-values.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +75 -2
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.d.ts +113 -0
- package/dist/core/schema/status-defs-file.js +260 -0
- package/dist/core/schema/status-defs-file.js.map +1 -0
- package/dist/core/schema/type-workflows.d.ts +64 -0
- package/dist/core/schema/type-workflows.js +98 -0
- package/dist/core/schema/type-workflows.js.map +1 -0
- package/dist/core/search/background-refresh.d.ts +53 -0
- package/dist/core/search/background-refresh.js +286 -0
- package/dist/core/search/background-refresh.js.map +1 -0
- package/dist/core/search/cache.d.ts +23 -2
- package/dist/core/search/cache.js +135 -30
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/http-client.d.ts +2 -2
- package/dist/core/search/http-client.js +2 -2
- package/dist/core/search/http-client.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -0
- package/dist/core/search/vector-stores.js +69 -15
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/search/vectorization-metadata.d.ts +13 -0
- package/dist/core/search/vectorization-metadata.js +65 -0
- package/dist/core/search/vectorization-metadata.js.map +1 -0
- package/dist/core/shared/constants.d.ts +2 -2
- package/dist/core/shared/constants.js +2 -3
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/serialization.d.ts +1 -0
- package/dist/core/shared/serialization.js +86 -2
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/store/front-matter-cache.js +14 -5
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-format-migration.js +25 -15
- package/dist/core/store/item-format-migration.js.map +1 -1
- package/dist/core/store/item-store.d.ts +2 -0
- package/dist/core/store/item-store.js +61 -6
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.js +22 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.js +40 -5
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/consent.js +3 -3
- package/dist/core/telemetry/consent.js.map +1 -1
- package/dist/core/telemetry/observability.js +4 -3
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +10 -0
- package/dist/core/telemetry/runtime.js +86 -2
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +221 -12
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +7 -2
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +37 -8
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +19 -1
- package/dist/sdk/cli-contracts.js +211 -18
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/errors.d.ts +22 -0
- package/dist/sdk/errors.js +46 -0
- package/dist/sdk/errors.js.map +1 -0
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sdk/index.js +3 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/package-import-adapters.js +14 -3
- package/dist/sdk/package-import-adapters.js.map +1 -1
- package/dist/sdk/runtime.d.ts +1 -0
- package/dist/sdk/runtime.js +3 -2
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/testing.d.ts +77 -0
- package/dist/sdk/testing.js +239 -0
- package/dist/sdk/testing.js.map +1 -0
- package/dist/types.d.ts +26 -1
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +21 -2
- package/docs/COMMANDS.md +85 -5
- package/docs/CONFIGURATION.md +49 -2
- package/docs/EXTENSIONS.md +118 -6
- package/docs/QUICKSTART.md +2 -0
- package/docs/RELEASING.md +3 -3
- package/docs/SDK.md +273 -1
- package/docs/TESTING.md +17 -0
- package/docs/examples/policy-restricted-extension/manifest.json +1 -0
- package/docs/examples/starter-extension/index.js +9 -1
- package/docs/examples/starter-extension/manifest.json +1 -0
- package/package.json +12 -7
- package/packages/pm-beads/extensions/beads/index.js +2 -4
- package/packages/pm-beads/extensions/beads/index.ts +43 -33
- package/packages/pm-beads/extensions/beads/manifest.json +12 -1
- package/packages/pm-calendar/README.md +6 -0
- package/packages/pm-calendar/extensions/calendar/index.js +6 -1
- package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
- package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
- package/packages/pm-guide-shell/README.md +4 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
- package/packages/pm-lifecycle-hooks/README.md +29 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
- package/packages/pm-lifecycle-hooks/package.json +52 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
- package/packages/pm-templates/extensions/templates/manifest.json +6 -1
- package/packages/pm-todos/extensions/todos/index.js +3 -7
- package/packages/pm-todos/extensions/todos/index.ts +55 -42
- package/packages/pm-todos/extensions/todos/manifest.json +13 -1
- package/scripts/bundle-cli.mjs +121 -17
- package/dist/cli-bundle/chunks/chunk-PB2YU2E3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RJONRNXN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js +0 -13864
- package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js.map +0 -7
- package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js +0 -24225
- package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-EIVQ5FMR.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-RSZNPSGI.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-APUSYDMR.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-OZOKSMPJ.js.map +0 -7
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
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]="3ffacab6-b0b2-5c73-a13b-cd559b219adf")}catch(e){}}();
|
|
3
3
|
import { pathExists, readFileIfExists, writeFileAtomic } from "../../core/fs/fs-utils.js";
|
|
4
4
|
import { acquireLock } from "../../core/lock/lock.js";
|
|
5
|
-
import { assertAliasesAvailable, buildInvalidTypeHint, escapeForDoubleQuotes, normalizeAddTypeInput, parseItemTypesFile, serializeItemTypesFile, upsertItemType, } from "../../core/schema/item-types-file.js";
|
|
6
|
-
import {
|
|
5
|
+
import { assertAliasesAvailable, buildInvalidTypeHint, escapeForDoubleQuotes, normalizeAddTypeInput, parseItemTypesFile, removeItemType, serializeItemTypesFile, upsertItemType, } from "../../core/schema/item-types-file.js";
|
|
6
|
+
import { assertStatusTokensAvailable, BUILTIN_STATUS_IDS, normalizeAddStatusInput, normalizeStatusToken, parseStatusDefsFile, removeStatusDef, serializeStatusDefsFile, upsertStatusDef, } from "../../core/schema/status-defs-file.js";
|
|
7
|
+
import { DEFAULT_RUNTIME_SCHEMA_FILE_PATHS, filePathForSchemaSection, normalizeRuntimeSchemaSettings, resolveRuntimeStatusRegistry, } from "../../core/schema/runtime-schema.js";
|
|
8
|
+
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
9
|
+
import { listAllFrontMatterLight } from "../../core/store/item-store.js";
|
|
7
10
|
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
8
11
|
import { PmCliError } from "../../core/shared/errors.js";
|
|
9
12
|
import { nowIso } from "../../core/shared/time.js";
|
|
10
|
-
import { runActiveOnWriteHooks } from "../../core/extensions/index.js";
|
|
13
|
+
import { getActiveExtensionRegistrations, runActiveOnWriteHooks } from "../../core/extensions/index.js";
|
|
11
14
|
import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
12
15
|
import { readSettings, resolveGovernanceKnobs } from "../../core/store/settings.js";
|
|
13
|
-
export const SCHEMA_SUBCOMMANDS = ["add-type"];
|
|
16
|
+
export const SCHEMA_SUBCOMMANDS = ["add-type", "remove-type", "add-status", "remove-status", "list", "show"];
|
|
14
17
|
const SCHEMA_TYPES_LOCK_ID = "schema-types";
|
|
18
|
+
const SCHEMA_STATUSES_LOCK_ID = "schema-statuses";
|
|
15
19
|
function toAuthor(candidate, defaultAuthor) {
|
|
16
20
|
const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;
|
|
17
21
|
const trimmed = resolved.trim();
|
|
@@ -84,15 +88,541 @@ export async function runSchemaAddType(name, options, global) {
|
|
|
84
88
|
generated_at: nowIso(),
|
|
85
89
|
};
|
|
86
90
|
}
|
|
91
|
+
async function ensureInitialized(pmRoot) {
|
|
92
|
+
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
93
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Counts items whose resolved type matches `typeName` (case-insensitive). Uses
|
|
98
|
+
* the lightest existing read path (listAllFrontMatterLight skips the heavy
|
|
99
|
+
* collections cache). All items are counted — not just open ones — so the
|
|
100
|
+
* advisory warning surfaces every item the removed definition would orphan;
|
|
101
|
+
* the count is non-blocking. The caller passes its already-loaded `settings`
|
|
102
|
+
* so we never re-read settings.json from disk here.
|
|
103
|
+
*/
|
|
104
|
+
async function countItemsUsingType(pmRoot, settings, schema, typeName) {
|
|
105
|
+
const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
106
|
+
const lowerName = typeName.trim().toLowerCase();
|
|
107
|
+
const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);
|
|
108
|
+
return items.filter((item) => typeof item.type === "string" && item.type.toLowerCase() === lowerName).length;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Counts items currently set to the status whose id/aliases resolve to
|
|
112
|
+
* `statusId`. Uses listAllFrontMatterLight (the lightest read path). All items
|
|
113
|
+
* are counted regardless of lifecycle phase; the count is advisory only. The
|
|
114
|
+
* caller passes its already-loaded `settings` so we never re-read from disk.
|
|
115
|
+
*/
|
|
116
|
+
async function countItemsUsingStatus(pmRoot, settings, schema, statusId) {
|
|
117
|
+
const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
118
|
+
const statusRegistry = resolveRuntimeStatusRegistry(schema);
|
|
119
|
+
const normalizedId = normalizeStatusToken(statusId);
|
|
120
|
+
const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);
|
|
121
|
+
return items.filter((item) => {
|
|
122
|
+
const itemStatus = typeof item.status === "string" ? item.status : "";
|
|
123
|
+
const resolved = statusRegistry.alias_to_id.get(normalizeStatusToken(itemStatus)) ?? normalizeStatusToken(itemStatus);
|
|
124
|
+
return resolved === normalizedId;
|
|
125
|
+
}).length;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Returns the workflow role-slot names (open_status, close_status, ...) that
|
|
129
|
+
* currently point at `statusId` (normalized). Used to warn before removing a
|
|
130
|
+
* status that a workflow default still references.
|
|
131
|
+
*/
|
|
132
|
+
function workflowSlotsReferencing(workflow, statusId) {
|
|
133
|
+
const slots = [
|
|
134
|
+
["draft_status", workflow.draft_status],
|
|
135
|
+
["open_status", workflow.open_status],
|
|
136
|
+
["in_progress_status", workflow.in_progress_status],
|
|
137
|
+
["blocked_status", workflow.blocked_status],
|
|
138
|
+
["close_status", workflow.close_status],
|
|
139
|
+
["canceled_status", workflow.canceled_status],
|
|
140
|
+
];
|
|
141
|
+
return slots
|
|
142
|
+
.filter(([, value]) => value !== undefined && normalizeStatusToken(value) === statusId)
|
|
143
|
+
.map(([slot]) => slot);
|
|
144
|
+
}
|
|
145
|
+
export async function runSchemaRemoveType(name, options, global) {
|
|
146
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
147
|
+
await ensureInitialized(pmRoot);
|
|
148
|
+
const settings = await readSettings(pmRoot);
|
|
149
|
+
const schema = normalizeRuntimeSchemaSettings(settings.schema);
|
|
150
|
+
const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
|
|
151
|
+
const warnings = [];
|
|
152
|
+
const author = toAuthor(options.author, settings.author_default);
|
|
153
|
+
const governance = resolveGovernanceKnobs(settings);
|
|
154
|
+
const releaseLock = await acquireLock(pmRoot, SCHEMA_TYPES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
|
|
155
|
+
let removal;
|
|
156
|
+
try {
|
|
157
|
+
const previousRaw = await readFileIfExists(typesPath);
|
|
158
|
+
let parsed;
|
|
159
|
+
try {
|
|
160
|
+
parsed = parseItemTypesFile(previousRaw);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
removal = removeItemType(parsed, name);
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
|
|
170
|
+
}
|
|
171
|
+
if (removal.removed) {
|
|
172
|
+
// Only emit the advisory orphan-count warning once a removable custom
|
|
173
|
+
// definition was actually removed; a no-op/unknown removal would otherwise
|
|
174
|
+
// surface a misleading items_using_type:* warning. The count is
|
|
175
|
+
// non-blocking and reuses the already-loaded settings (no disk re-read).
|
|
176
|
+
const removedName = (removal.definition?.name ?? name ?? "").trim();
|
|
177
|
+
if (removedName.length > 0) {
|
|
178
|
+
const usingType = await countItemsUsingType(pmRoot, settings, schema, removedName);
|
|
179
|
+
if (usingType > 0) {
|
|
180
|
+
warnings.push(`items_using_type:${usingType}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// writeFileAtomic writes to a temp file then renames, so a failure leaves
|
|
184
|
+
// the existing types.json untouched; no manual rollback is needed.
|
|
185
|
+
await writeFileAtomic(typesPath, serializeItemTypesFile(removal.file));
|
|
186
|
+
warnings.push(...(await runActiveOnWriteHooks({
|
|
187
|
+
path: typesPath,
|
|
188
|
+
scope: "project",
|
|
189
|
+
op: "schema:remove-type",
|
|
190
|
+
})));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
finally {
|
|
194
|
+
await releaseLock();
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
action: "remove-type",
|
|
198
|
+
removed: removal.removed,
|
|
199
|
+
...(removal.definition ? { type: removal.definition } : {}),
|
|
200
|
+
file: {
|
|
201
|
+
path: typesPath,
|
|
202
|
+
definitions: removal.file.definitions.length,
|
|
203
|
+
},
|
|
204
|
+
warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
|
|
205
|
+
generated_at: nowIso(),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function statusesPathFor(pmRoot, schema) {
|
|
209
|
+
return filePathForSchemaSection(pmRoot, schema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses);
|
|
210
|
+
}
|
|
211
|
+
export async function runSchemaAddStatus(id, options, global) {
|
|
212
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
213
|
+
await ensureInitialized(pmRoot);
|
|
214
|
+
let normalized;
|
|
215
|
+
try {
|
|
216
|
+
normalized = normalizeAddStatusInput({
|
|
217
|
+
id,
|
|
218
|
+
roles: options.role,
|
|
219
|
+
aliases: options.alias,
|
|
220
|
+
description: options.description,
|
|
221
|
+
order: options.order,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
|
|
226
|
+
}
|
|
227
|
+
const settings = await readSettings(pmRoot);
|
|
228
|
+
const schema = normalizeRuntimeSchemaSettings(settings.schema);
|
|
229
|
+
const statusesPath = statusesPathFor(pmRoot, schema);
|
|
230
|
+
const statusRegistry = resolveRuntimeStatusRegistry(schema);
|
|
231
|
+
// Reject id/alias collisions with a DIFFERENT existing status so a custom
|
|
232
|
+
// status can never shadow a built-in lifecycle token (e.g. --alias open).
|
|
233
|
+
try {
|
|
234
|
+
assertStatusTokensAvailable(normalized, statusRegistry.alias_to_id);
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
|
|
238
|
+
}
|
|
239
|
+
// Seed the upsert from the resolved (settings-or-file) definition so omitting
|
|
240
|
+
// --role/--alias preserves metadata defined in settings.schema.statuses, not
|
|
241
|
+
// only what is already in statuses.json.
|
|
242
|
+
const resolvedExisting = statusRegistry.by_id.get(normalized.id);
|
|
243
|
+
const baseDefinition = resolvedExisting
|
|
244
|
+
? {
|
|
245
|
+
id: resolvedExisting.id,
|
|
246
|
+
...(Array.isArray(resolvedExisting.roles) && resolvedExisting.roles.length > 0
|
|
247
|
+
? { roles: [...resolvedExisting.roles] }
|
|
248
|
+
: {}),
|
|
249
|
+
...(Array.isArray(resolvedExisting.aliases) && resolvedExisting.aliases.length > 0
|
|
250
|
+
? { aliases: [...resolvedExisting.aliases] }
|
|
251
|
+
: {}),
|
|
252
|
+
...(resolvedExisting.description ? { description: resolvedExisting.description } : {}),
|
|
253
|
+
...(typeof resolvedExisting.order === "number" ? { order: resolvedExisting.order } : {}),
|
|
254
|
+
}
|
|
255
|
+
: undefined;
|
|
256
|
+
const warnings = [];
|
|
257
|
+
const author = toAuthor(options.author, settings.author_default);
|
|
258
|
+
const governance = resolveGovernanceKnobs(settings);
|
|
259
|
+
const releaseLock = await acquireLock(pmRoot, SCHEMA_STATUSES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
|
|
260
|
+
let upsert;
|
|
261
|
+
try {
|
|
262
|
+
const previousRaw = await readFileIfExists(statusesPath);
|
|
263
|
+
let parsed;
|
|
264
|
+
try {
|
|
265
|
+
parsed = parseStatusDefsFile(previousRaw);
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
|
|
269
|
+
}
|
|
270
|
+
// Re-check collisions against the CURRENT file under the lock: the pre-lock
|
|
271
|
+
// check used the registry loaded before acquiring schema-statuses, so a
|
|
272
|
+
// concurrent add-status could have written a colliding id/alias in between.
|
|
273
|
+
// The lock serializes writes; this serializes the collision decision too.
|
|
274
|
+
const fileAliasToId = new Map();
|
|
275
|
+
for (const definition of parsed.statuses) {
|
|
276
|
+
const defId = normalizeStatusToken(definition.id);
|
|
277
|
+
if (defId.length === 0) {
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
fileAliasToId.set(defId, defId);
|
|
281
|
+
for (const alias of Array.isArray(definition.aliases) ? definition.aliases : []) {
|
|
282
|
+
const aliasToken = normalizeStatusToken(alias);
|
|
283
|
+
if (aliasToken.length > 0 && !fileAliasToId.has(aliasToken)) {
|
|
284
|
+
fileAliasToId.set(aliasToken, defId);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
try {
|
|
289
|
+
assertStatusTokensAvailable(normalized, fileAliasToId);
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
|
|
293
|
+
}
|
|
294
|
+
upsert = upsertStatusDef(parsed, normalized, baseDefinition);
|
|
295
|
+
// writeFileAtomic writes to a temp file then renames, so a failure leaves
|
|
296
|
+
// the existing statuses.json untouched; no manual rollback is needed.
|
|
297
|
+
await writeFileAtomic(statusesPath, serializeStatusDefsFile(upsert.file));
|
|
298
|
+
warnings.push(...(await runActiveOnWriteHooks({
|
|
299
|
+
path: statusesPath,
|
|
300
|
+
scope: "project",
|
|
301
|
+
op: "schema:add-status",
|
|
302
|
+
})));
|
|
303
|
+
}
|
|
304
|
+
finally {
|
|
305
|
+
await releaseLock();
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
action: "add-status",
|
|
309
|
+
registered: true,
|
|
310
|
+
replaced: upsert.replaced,
|
|
311
|
+
status: upsert.definition,
|
|
312
|
+
file: {
|
|
313
|
+
path: statusesPath,
|
|
314
|
+
statuses: upsert.file.statuses.length,
|
|
315
|
+
},
|
|
316
|
+
warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
|
|
317
|
+
generated_at: nowIso(),
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
export async function runSchemaRemoveStatus(id, options, global) {
|
|
321
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
322
|
+
await ensureInitialized(pmRoot);
|
|
323
|
+
const settings = await readSettings(pmRoot);
|
|
324
|
+
const schema = normalizeRuntimeSchemaSettings(settings.schema);
|
|
325
|
+
const statusesPath = statusesPathFor(pmRoot, schema);
|
|
326
|
+
const warnings = [];
|
|
327
|
+
const author = toAuthor(options.author, settings.author_default);
|
|
328
|
+
const governance = resolveGovernanceKnobs(settings);
|
|
329
|
+
const releaseLock = await acquireLock(pmRoot, SCHEMA_STATUSES_LOCK_ID, settings.locks.ttl_seconds, author, Boolean(options.force), governance.force_required_for_stale_lock);
|
|
330
|
+
let removal;
|
|
331
|
+
try {
|
|
332
|
+
const previousRaw = await readFileIfExists(statusesPath);
|
|
333
|
+
let parsed;
|
|
334
|
+
try {
|
|
335
|
+
parsed = parseStatusDefsFile(previousRaw);
|
|
336
|
+
}
|
|
337
|
+
catch (error) {
|
|
338
|
+
throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);
|
|
339
|
+
}
|
|
340
|
+
try {
|
|
341
|
+
removal = removeStatusDef(parsed, id);
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);
|
|
345
|
+
}
|
|
346
|
+
if (removal.removed) {
|
|
347
|
+
// Only emit the advisory orphan-count warning once a removable custom
|
|
348
|
+
// status was actually removed; a no-op/unknown removal would otherwise
|
|
349
|
+
// surface a misleading items_using_status:* warning. The count reuses the
|
|
350
|
+
// already-loaded settings (no disk re-read) and is non-blocking.
|
|
351
|
+
const removedId = normalizeStatusToken(removal.definition?.id ?? id);
|
|
352
|
+
if (removedId.length > 0 && !BUILTIN_STATUS_IDS.has(removedId)) {
|
|
353
|
+
const usingStatus = await countItemsUsingStatus(pmRoot, settings, schema, removedId);
|
|
354
|
+
if (usingStatus > 0) {
|
|
355
|
+
warnings.push(`items_using_status:${usingStatus}`);
|
|
356
|
+
}
|
|
357
|
+
// Removing a status that a workflow default still points at would leave
|
|
358
|
+
// pm close / default pm create resolving to an unregistered status. Warn
|
|
359
|
+
// (non-blocking, consistent with remove-type) so the operator re-points
|
|
360
|
+
// the workflow slot via schema/workflows.json or pm config.
|
|
361
|
+
const referencingSlots = workflowSlotsReferencing(schema.workflow, removedId);
|
|
362
|
+
if (referencingSlots.length > 0) {
|
|
363
|
+
warnings.push(`status_referenced_by_workflow:${referencingSlots.join(",")}`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
await writeFileAtomic(statusesPath, serializeStatusDefsFile(removal.file));
|
|
367
|
+
warnings.push(...(await runActiveOnWriteHooks({
|
|
368
|
+
path: statusesPath,
|
|
369
|
+
scope: "project",
|
|
370
|
+
op: "schema:remove-status",
|
|
371
|
+
})));
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
finally {
|
|
375
|
+
await releaseLock();
|
|
376
|
+
}
|
|
377
|
+
return {
|
|
378
|
+
action: "remove-status",
|
|
379
|
+
removed: removal.removed,
|
|
380
|
+
...(removal.definition ? { status: removal.definition } : {}),
|
|
381
|
+
file: {
|
|
382
|
+
path: statusesPath,
|
|
383
|
+
statuses: removal.file.statuses.length,
|
|
384
|
+
},
|
|
385
|
+
warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
|
|
386
|
+
generated_at: nowIso(),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function toSchemaTypeSummary(definition) {
|
|
390
|
+
return {
|
|
391
|
+
name: definition.name,
|
|
392
|
+
folder: definition.folder,
|
|
393
|
+
aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],
|
|
394
|
+
...(definition.default_status ? { default_status: definition.default_status } : {}),
|
|
395
|
+
...(definition.description ? { description: definition.description } : {}),
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
function toSchemaTypeDefinition(definition, source, extensionProvenance) {
|
|
399
|
+
return {
|
|
400
|
+
...toSchemaTypeSummary(definition),
|
|
401
|
+
source,
|
|
402
|
+
...(extensionProvenance ? { extension: extensionProvenance } : {}),
|
|
403
|
+
required_create_fields: [...definition.required_create_fields],
|
|
404
|
+
required_create_repeatables: [...definition.required_create_repeatables],
|
|
405
|
+
options: structuredClone(definition.options),
|
|
406
|
+
command_option_policies: structuredClone(definition.command_option_policies),
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
function classifyTypeSource(name, customNames, extensionNames) {
|
|
410
|
+
const lowerName = name.toLowerCase();
|
|
411
|
+
if (extensionNames.has(lowerName)) {
|
|
412
|
+
return "extension";
|
|
413
|
+
}
|
|
414
|
+
if (customNames.has(lowerName)) {
|
|
415
|
+
return "custom";
|
|
416
|
+
}
|
|
417
|
+
return "builtin";
|
|
418
|
+
}
|
|
419
|
+
function collectExtensionTypeProvenance() {
|
|
420
|
+
const provenance = new Map();
|
|
421
|
+
const registrations = getActiveExtensionRegistrations();
|
|
422
|
+
for (const registration of registrations?.item_types ?? []) {
|
|
423
|
+
const rawTypes = registration.types;
|
|
424
|
+
if (!Array.isArray(rawTypes)) {
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
for (const rawType of rawTypes) {
|
|
428
|
+
if (typeof rawType !== "object" || rawType === null || Array.isArray(rawType)) {
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
const name = rawType.name;
|
|
432
|
+
if (typeof name === "string" && name.trim().length > 0) {
|
|
433
|
+
provenance.set(name.trim().toLowerCase(), {
|
|
434
|
+
layer: registration.layer,
|
|
435
|
+
name: registration.name,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return provenance;
|
|
441
|
+
}
|
|
442
|
+
function buildSchemaStatusSummaries(schema) {
|
|
443
|
+
const registry = resolveRuntimeStatusRegistry(schema);
|
|
444
|
+
const builtin = [];
|
|
445
|
+
const custom = [];
|
|
446
|
+
for (const definition of registry.definitions) {
|
|
447
|
+
const source = BUILTIN_STATUS_IDS.has(definition.id) ? "builtin" : "custom";
|
|
448
|
+
const summary = {
|
|
449
|
+
id: definition.id,
|
|
450
|
+
source,
|
|
451
|
+
roles: Array.isArray(definition.roles) ? [...definition.roles] : [],
|
|
452
|
+
aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],
|
|
453
|
+
...(definition.description ? { description: definition.description } : {}),
|
|
454
|
+
};
|
|
455
|
+
if (source === "builtin") {
|
|
456
|
+
builtin.push(summary);
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
custom.push(summary);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return { builtin, custom };
|
|
463
|
+
}
|
|
464
|
+
async function loadSchemaInspectionContext(global) {
|
|
465
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
466
|
+
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
467
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
468
|
+
}
|
|
469
|
+
const settings = await readSettings(pmRoot);
|
|
470
|
+
const schema = normalizeRuntimeSchemaSettings(settings.schema);
|
|
471
|
+
const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
|
|
472
|
+
const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
473
|
+
const extensionProvenance = collectExtensionTypeProvenance();
|
|
474
|
+
const customNames = new Set((settings.item_types?.definitions ?? [])
|
|
475
|
+
.map((definition) => definition.name.trim().toLowerCase())
|
|
476
|
+
.filter((name) => name.length > 0 && !extensionProvenance.has(name)));
|
|
477
|
+
return {
|
|
478
|
+
typesPath,
|
|
479
|
+
byType: registry.by_type,
|
|
480
|
+
customNames,
|
|
481
|
+
extensionProvenance,
|
|
482
|
+
schema,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
export async function runSchemaList(global) {
|
|
486
|
+
const context = await loadSchemaInspectionContext(global);
|
|
487
|
+
const builtin = [];
|
|
488
|
+
const custom = [];
|
|
489
|
+
const extension = [];
|
|
490
|
+
for (const definition of Object.values(context.byType).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
491
|
+
const source = classifyTypeSource(definition.name, context.customNames, new Set(context.extensionProvenance.keys()));
|
|
492
|
+
const summary = toSchemaTypeSummary(definition);
|
|
493
|
+
if (source === "extension") {
|
|
494
|
+
extension.push(summary);
|
|
495
|
+
}
|
|
496
|
+
else if (source === "custom") {
|
|
497
|
+
custom.push(summary);
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
builtin.push(summary);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
const statusSummaries = buildSchemaStatusSummaries(context.schema);
|
|
504
|
+
return {
|
|
505
|
+
action: "list",
|
|
506
|
+
builtin,
|
|
507
|
+
custom,
|
|
508
|
+
extension,
|
|
509
|
+
counts: {
|
|
510
|
+
builtin: builtin.length,
|
|
511
|
+
custom: custom.length,
|
|
512
|
+
extension: extension.length,
|
|
513
|
+
total: builtin.length + custom.length + extension.length,
|
|
514
|
+
},
|
|
515
|
+
statuses: {
|
|
516
|
+
builtin: statusSummaries.builtin,
|
|
517
|
+
custom: statusSummaries.custom,
|
|
518
|
+
counts: {
|
|
519
|
+
builtin: statusSummaries.builtin.length,
|
|
520
|
+
custom: statusSummaries.custom.length,
|
|
521
|
+
total: statusSummaries.builtin.length + statusSummaries.custom.length,
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
file: {
|
|
525
|
+
path: context.typesPath,
|
|
526
|
+
},
|
|
527
|
+
generated_at: nowIso(),
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
export async function runSchemaShow(name, global) {
|
|
531
|
+
const typeName = (name ?? "").trim();
|
|
532
|
+
if (typeName.length === 0) {
|
|
533
|
+
throw new PmCliError("Type name must not be empty.", EXIT_CODE.USAGE);
|
|
534
|
+
}
|
|
535
|
+
const context = await loadSchemaInspectionContext(global);
|
|
536
|
+
const match = Object.values(context.byType).find((definition) => definition.name.toLowerCase() === typeName.toLowerCase() ||
|
|
537
|
+
definition.aliases.some((alias) => alias.toLowerCase() === typeName.toLowerCase()));
|
|
538
|
+
if (!match) {
|
|
539
|
+
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" });
|
|
540
|
+
}
|
|
541
|
+
return {
|
|
542
|
+
action: "show",
|
|
543
|
+
type: toSchemaTypeDefinition(match, classifyTypeSource(match.name, context.customNames, new Set(context.extensionProvenance.keys())), context.extensionProvenance.get(match.name.toLowerCase())),
|
|
544
|
+
file: {
|
|
545
|
+
path: context.typesPath,
|
|
546
|
+
},
|
|
547
|
+
generated_at: nowIso(),
|
|
548
|
+
};
|
|
549
|
+
}
|
|
87
550
|
export function formatSchemaAddTypeHuman(result) {
|
|
88
551
|
const verb = result.replaced ? "Updated" : "Registered";
|
|
89
552
|
const aliasSuffix = result.type.aliases && result.type.aliases.length > 0 ? ` (aliases: ${result.type.aliases.join(", ")})` : "";
|
|
90
553
|
return `${verb} custom item type "${result.type.name}"${aliasSuffix} in ${result.file.path}. Run: pm create "${escapeForDoubleQuotes(result.type.name)}" "<title>"`;
|
|
91
554
|
}
|
|
555
|
+
export function formatSchemaRemoveTypeHuman(result) {
|
|
556
|
+
if (!result.removed) {
|
|
557
|
+
return `No custom item type matched; nothing removed from ${result.file.path}.`;
|
|
558
|
+
}
|
|
559
|
+
const name = result.type?.name ?? "(unknown)";
|
|
560
|
+
return `Removed custom item type "${name}" from ${result.file.path}.`;
|
|
561
|
+
}
|
|
562
|
+
export function formatSchemaAddStatusHuman(result) {
|
|
563
|
+
const verb = result.replaced ? "Updated" : "Registered";
|
|
564
|
+
const roleSuffix = result.status.roles && result.status.roles.length > 0 ? ` (roles: ${result.status.roles.join(", ")})` : "";
|
|
565
|
+
const aliasSuffix = result.status.aliases && result.status.aliases.length > 0 ? ` (aliases: ${result.status.aliases.join(", ")})` : "";
|
|
566
|
+
return `${verb} status "${result.status.id}"${roleSuffix}${aliasSuffix} in ${result.file.path}.`;
|
|
567
|
+
}
|
|
568
|
+
export function formatSchemaRemoveStatusHuman(result) {
|
|
569
|
+
if (!result.removed) {
|
|
570
|
+
return `No custom status matched; nothing removed from ${result.file.path}.`;
|
|
571
|
+
}
|
|
572
|
+
const id = result.status?.id ?? "(unknown)";
|
|
573
|
+
return `Removed custom status "${id}" from ${result.file.path}.`;
|
|
574
|
+
}
|
|
575
|
+
export function formatSchemaListHuman(result) {
|
|
576
|
+
const lines = [
|
|
577
|
+
`Schema types: ${result.counts.total} total (${result.counts.builtin} builtin, ${result.counts.custom} custom, ${result.counts.extension} extension)`,
|
|
578
|
+
];
|
|
579
|
+
for (const [label, entries] of [
|
|
580
|
+
["builtin", result.builtin],
|
|
581
|
+
["custom", result.custom],
|
|
582
|
+
["extension", result.extension],
|
|
583
|
+
]) {
|
|
584
|
+
if (entries.length === 0) {
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
lines.push(`${label}: ${entries.map((entry) => entry.name).join(", ")}`);
|
|
588
|
+
}
|
|
589
|
+
lines.push(`statuses: ${result.statuses.counts.total} total (${result.statuses.counts.builtin} builtin, ${result.statuses.counts.custom} custom)`);
|
|
590
|
+
for (const [label, entries] of [
|
|
591
|
+
["builtin statuses", result.statuses.builtin],
|
|
592
|
+
["custom statuses", result.statuses.custom],
|
|
593
|
+
]) {
|
|
594
|
+
if (entries.length === 0) {
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
lines.push(`${label}: ${entries.map((entry) => entry.id).join(", ")}`);
|
|
598
|
+
}
|
|
599
|
+
lines.push(`Inspect one: pm schema show <Type>`);
|
|
600
|
+
return lines.join("\n");
|
|
601
|
+
}
|
|
602
|
+
export function formatSchemaShowHuman(result) {
|
|
603
|
+
const parts = [
|
|
604
|
+
`type: ${result.type.name}`,
|
|
605
|
+
`source: ${result.type.source}`,
|
|
606
|
+
`folder: ${result.type.folder}`,
|
|
607
|
+
];
|
|
608
|
+
if (result.type.default_status) {
|
|
609
|
+
parts.push(`default_status: ${result.type.default_status}`);
|
|
610
|
+
}
|
|
611
|
+
if (result.type.aliases.length > 0) {
|
|
612
|
+
parts.push(`aliases: ${result.type.aliases.join(", ")}`);
|
|
613
|
+
}
|
|
614
|
+
if (result.type.description) {
|
|
615
|
+
parts.push(`description: ${result.type.description}`);
|
|
616
|
+
}
|
|
617
|
+
if (result.type.options.length > 0) {
|
|
618
|
+
parts.push(`options: ${result.type.options.map((option) => option.key).join(", ")}`);
|
|
619
|
+
}
|
|
620
|
+
return parts.join("\n");
|
|
621
|
+
}
|
|
92
622
|
/**
|
|
93
623
|
* Re-export so register-mutation can surface the hint in usage examples
|
|
94
624
|
* without importing the core module directly.
|
|
95
625
|
*/
|
|
96
626
|
export { buildInvalidTypeHint };
|
|
97
627
|
//# sourceMappingURL=schema.js.map
|
|
98
|
-
//# debugId=
|
|
628
|
+
//# debugId=3ffacab6-b0b2-5c73-a13b-cd559b219adf
|