@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
package/dist/cli/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="85d31f87-d392-5da2-9d53-1525fb938ff2")}catch(e){}}();
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { Command } from "commander";
|
|
7
|
-
import { activateExtensions, clearActiveExtensionHooks, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, runActiveCommandHandler, runActiveParserOverride, runActivePreflightOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandResult, setActiveCommandContext, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, } from "../core/extensions/index.js";
|
|
7
|
+
import { activateExtensions, clearActiveExtensionHooks, createEmptyExtensionRegistrationRegistry, discoverExtensions, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, consumeAfterCommandAffectedItems, runActiveCommandHandler, runActiveParserOverride, runActivePreflightOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandResult, setActiveCommandContext, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, } from "../core/extensions/index.js";
|
|
8
8
|
import { pathExists } from "../core/fs/fs-utils.js";
|
|
9
9
|
import { resolvePmPackageRootFromModule } from "../core/packages/root.js";
|
|
10
10
|
import { resolveItemTypeRegistry, } from "../core/item/type-registry.js";
|
|
@@ -19,7 +19,7 @@ import { deriveTelemetryCommandResolution, } from "../core/telemetry/observabili
|
|
|
19
19
|
import { sentryCaptureCliError, sentryFinishCommandSpan, sentryFlush, sentryLogCliUsageError, sentrySetCommandContext, sentryStartCommandSpan, } from "../core/sentry/helpers.js";
|
|
20
20
|
import { ensureSentryInit } from "../core/sentry/instrument.js";
|
|
21
21
|
import { getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
|
|
22
|
-
import { readSettings } from "../core/store/settings.js";
|
|
22
|
+
import { readSettings, readSettingsWithMetadata } from "../core/store/settings.js";
|
|
23
23
|
import { coerceLooseCommandOptionsWithFlagDefinitions, parseLooseCommandOptions, validateLooseCommandOptionsWithFlagDefinitions, } from "./extension-command-options.js";
|
|
24
24
|
import { attachRichHelpText } from "./help-content.js";
|
|
25
25
|
import { extractProvidedOptionFlags, normalizeLongOptionFlag, renderPmCommand, } from "./argv-utils.js";
|
|
@@ -27,7 +27,7 @@ import { classifyCommanderError, classifyPmCliError, classifyUnknownError, forma
|
|
|
27
27
|
import { applyDefaultOutputFormat, clearResolvedGlobalOptions, collect, formatHookWarnings, getCommandPath, getGlobalOptions, invalidateSearchCachesForMutation, setResolvedGlobalOptions, } from "./registration-helpers.js";
|
|
28
28
|
import { createLazyModule } from "../core/shared/lazy-module.js";
|
|
29
29
|
import { normalizeExtensionCommandPath, collectDynamicExtensionFlagHelpByCommand, collectExtensionCommandHelpDescriptors, applyDynamicExtensionArguments, buildDynamicExtensionCommandMetadataHelp, findCommandByPath, ensureCommandPath, } from "./extension-command-help.js";
|
|
30
|
-
import { parseBootstrapGlobalOptions, applyBootstrapPagerPolicy, parseBootstrapHelpRequest, parseBootstrapCommandName, normalizeBootstrapInvocation, } from "./bootstrap-args.js";
|
|
30
|
+
import { parseBootstrapGlobalOptions, applyBootstrapPagerPolicy, parseBootstrapHelpRequest, parseBootstrapCommandName, normalizeBootstrapInvocation, stripGlobalBootstrapTokens, } from "./bootstrap-args.js";
|
|
31
31
|
import { collectMandatoryMigrationBlockers, enforceMandatoryMigrationWriteGate, enforceItemFormatWriteGateAndPreflightMigration, resolveMigrationId, resolveNormalizedMigrationStatus, } from "./migration-gates.js";
|
|
32
32
|
import { isKnownHelpCommandPath, formatCommanderUsageMessage, formatCommanderUsageJson, resolveCommanderUsageContext, } from "./commander-usage.js";
|
|
33
33
|
import { maybeRenderBootstrapJsonHelp, attachCreateUpdatePolicyHelpText, } from "./help-json-payload.js";
|
|
@@ -57,6 +57,7 @@ const TELEMETRY_COMMAND_RESOLUTION_SET = new Set([
|
|
|
57
57
|
const TELEMETRY_RESOLUTION_STAGE_SET = new Set(["parse", "preflight", "execute", "unknown"]);
|
|
58
58
|
const TELEMETRY_ERROR_CATEGORY_SET = new Set(["usage", "validation", "conflict", "runtime", "unknown"]);
|
|
59
59
|
let runtimeExtensionSnapshotCache = null;
|
|
60
|
+
let runtimeExtensionDiscoverySnapshotCache = null;
|
|
60
61
|
let activeRuntimeExtensionCommandDescriptors = new Map();
|
|
61
62
|
const HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS = 250;
|
|
62
63
|
const EXPECTED_HANDLED_ERROR_EXIT_CODES = new Set([
|
|
@@ -137,7 +138,7 @@ function buildPmCliRecoveryContext(context, invocationArgv, rawMessage) {
|
|
|
137
138
|
if (!suggestedRetry) {
|
|
138
139
|
suggestedRetry = attemptedCommand;
|
|
139
140
|
}
|
|
140
|
-
if (suggestedRetry === attemptedCommand) {
|
|
141
|
+
if (!existingRecovery?.suggested_retry && suggestedRetry === attemptedCommand) {
|
|
141
142
|
suggestedRetry = undefined;
|
|
142
143
|
}
|
|
143
144
|
const recovery = {
|
|
@@ -321,17 +322,30 @@ async function runAndClearAfterCommandHooks(outcome) {
|
|
|
321
322
|
clearActiveExtensionHooks();
|
|
322
323
|
return;
|
|
323
324
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
325
|
+
let hookWarnings = [];
|
|
326
|
+
try {
|
|
327
|
+
hookWarnings = await runAfterCommandHooks(runtime.hooks, {
|
|
328
|
+
command: runtime.commandName,
|
|
329
|
+
args: runtime.commandArgs,
|
|
330
|
+
options: { ...runtime.commandOptions },
|
|
331
|
+
global: { ...runtime.globalOptions },
|
|
332
|
+
pm_root: runtime.pmRoot,
|
|
333
|
+
ok: outcome.ok,
|
|
334
|
+
error: outcome.error,
|
|
335
|
+
result: getActiveCommandResult(),
|
|
336
|
+
affected: consumeAfterCommandAffectedItems(),
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
341
|
+
hookWarnings = [`afterCommand hooks failed: ${message}`];
|
|
342
|
+
}
|
|
343
|
+
finally {
|
|
344
|
+
clearActiveExtensionHooks();
|
|
345
|
+
}
|
|
346
|
+
if (!runtime.globalOptions.json && hookWarnings.length > 0) {
|
|
347
|
+
printError(`[pm] warning: afterCommand hook_warnings=${formatHookWarnings(hookWarnings)}`);
|
|
348
|
+
}
|
|
335
349
|
if (runtime.profileEnabled && hookWarnings.length > 0) {
|
|
336
350
|
printError(`profile:extensions hook_warnings=${formatHookWarnings(hookWarnings)}`);
|
|
337
351
|
}
|
|
@@ -534,6 +548,20 @@ async function registerRuntimeSchemaFieldFlags(rootProgram, invocationArgv) {
|
|
|
534
548
|
}
|
|
535
549
|
}
|
|
536
550
|
}
|
|
551
|
+
async function maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, registrations, settings) {
|
|
552
|
+
const bootstrapCommand = parseBootstrapCommandName(invocationArgv);
|
|
553
|
+
if (bootstrapCommand !== "create" && bootstrapCommand !== "update") {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
try {
|
|
557
|
+
const resolvedSettings = settings ?? (await readSettings(pmRoot));
|
|
558
|
+
const typeRegistry = resolveItemTypeRegistry(resolvedSettings, registrations);
|
|
559
|
+
attachCreateUpdatePolicyHelpText(rootProgram, typeRegistry, invocationArgv);
|
|
560
|
+
}
|
|
561
|
+
catch {
|
|
562
|
+
// Help should remain available even when settings cannot be read.
|
|
563
|
+
}
|
|
564
|
+
}
|
|
537
565
|
function defaultPreflightDecision() {
|
|
538
566
|
return {
|
|
539
567
|
enforce_item_format_gate: true,
|
|
@@ -545,6 +573,194 @@ function defaultPreflightDecision() {
|
|
|
545
573
|
function buildRuntimeExtensionSnapshotCacheKey(pmRoot) {
|
|
546
574
|
return `pm-root:${pmRoot}`;
|
|
547
575
|
}
|
|
576
|
+
function bootstrapProfileEnabled(invocationArgv) {
|
|
577
|
+
return invocationArgv.some((token) => token === "--profile");
|
|
578
|
+
}
|
|
579
|
+
function buildRuntimeExtensionDiscoverySnapshotCacheKey(pmRoot) {
|
|
580
|
+
return `pm-root:${pmRoot}`;
|
|
581
|
+
}
|
|
582
|
+
function collectLeadingCommandArgs(commandArgs) {
|
|
583
|
+
const leading = [];
|
|
584
|
+
for (const arg of commandArgs ?? []) {
|
|
585
|
+
if (arg.startsWith("-")) {
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
const normalized = normalizeExtensionCommandPath(arg);
|
|
589
|
+
if (normalized.length === 0) {
|
|
590
|
+
continue;
|
|
591
|
+
}
|
|
592
|
+
leading.push(normalized);
|
|
593
|
+
}
|
|
594
|
+
return leading;
|
|
595
|
+
}
|
|
596
|
+
function collectActivationCommandCandidates(probe) {
|
|
597
|
+
const commandPath = normalizeExtensionCommandPath(probe.commandPath ?? "");
|
|
598
|
+
if (commandPath.length === 0) {
|
|
599
|
+
return [];
|
|
600
|
+
}
|
|
601
|
+
const candidates = [commandPath];
|
|
602
|
+
const parts = commandPath.split(" ").filter((part) => part.length > 0);
|
|
603
|
+
for (const arg of collectLeadingCommandArgs(probe.commandArgs)) {
|
|
604
|
+
parts.push(...arg.split(" ").filter((part) => part.length > 0));
|
|
605
|
+
candidates.push(parts.join(" "));
|
|
606
|
+
}
|
|
607
|
+
return [...new Set(candidates)];
|
|
608
|
+
}
|
|
609
|
+
function activationCommandMatchesProbe(command, probe) {
|
|
610
|
+
const normalized = normalizeExtensionCommandPath(command);
|
|
611
|
+
if (normalized.length === 0) {
|
|
612
|
+
return false;
|
|
613
|
+
}
|
|
614
|
+
const candidates = collectActivationCommandCandidates(probe);
|
|
615
|
+
for (const candidate of candidates) {
|
|
616
|
+
if (candidate === normalized || candidate.startsWith(`${normalized} `)) {
|
|
617
|
+
return true;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
if (probe.allowCommandPrefixMatch === true) {
|
|
621
|
+
return candidates.some((candidate) => normalized.startsWith(`${candidate} `));
|
|
622
|
+
}
|
|
623
|
+
return false;
|
|
624
|
+
}
|
|
625
|
+
function extensionActivationCommands(extension) {
|
|
626
|
+
return extension.activation?.commands ?? [];
|
|
627
|
+
}
|
|
628
|
+
function extensionCapabilities(extension) {
|
|
629
|
+
return new Set((extension.capabilities ?? []).map((capability) => capability.trim().toLowerCase()));
|
|
630
|
+
}
|
|
631
|
+
const GLOBAL_EXTENSION_ACTIVATION_CAPABILITIES = new Set(["hooks", "parser", "preflight", "renderers"]);
|
|
632
|
+
const CONSERVATIVE_EXTENSION_ACTIVATION_CAPABILITIES = new Set(["commands", "schema", "services"]);
|
|
633
|
+
const SEARCH_EXTENSION_ACTIVATION_COMMANDS = new Set(["reindex", "search", "search-advanced"]);
|
|
634
|
+
const CREATE_TEMPLATE_FLAGS = new Set(["--template"]);
|
|
635
|
+
function hasAnyCapability(capabilities, expected) {
|
|
636
|
+
for (const capability of expected) {
|
|
637
|
+
if (capabilities.has(capability)) {
|
|
638
|
+
return true;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return false;
|
|
642
|
+
}
|
|
643
|
+
function commandPathNeedsSearchExtensions(commandPath) {
|
|
644
|
+
const normalized = normalizeExtensionCommandPath(commandPath ?? "");
|
|
645
|
+
if (normalized.length === 0) {
|
|
646
|
+
return false;
|
|
647
|
+
}
|
|
648
|
+
const [topLevel] = normalized.split(" ");
|
|
649
|
+
return SEARCH_EXTENSION_ACTIVATION_COMMANDS.has(topLevel ?? normalized);
|
|
650
|
+
}
|
|
651
|
+
function probeUsesAnyFlag(probe, flags) {
|
|
652
|
+
for (const arg of probe.commandArgs ?? []) {
|
|
653
|
+
if (!arg.startsWith("--")) {
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
const [flagName] = arg.split("=", 1);
|
|
657
|
+
if (flags.has(flagName)) {
|
|
658
|
+
return true;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
663
|
+
function commandPathNeedsTemplateExtensions(probe) {
|
|
664
|
+
return normalizeExtensionCommandPath(probe.commandPath ?? "") === "create" && probeUsesAnyFlag(probe, CREATE_TEMPLATE_FLAGS);
|
|
665
|
+
}
|
|
666
|
+
function extensionProvidesTemplatesRuntime(commands) {
|
|
667
|
+
return commands.some((command) => {
|
|
668
|
+
const normalized = normalizeExtensionCommandPath(command);
|
|
669
|
+
return normalized === "templates" || normalized.startsWith("templates ");
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
function extensionNeedsActivationForProbe(extension, probe) {
|
|
673
|
+
const capabilities = extensionCapabilities(extension);
|
|
674
|
+
const commands = extensionActivationCommands(extension);
|
|
675
|
+
if (commands.length > 0 && commands.some((command) => activationCommandMatchesProbe(command, probe))) {
|
|
676
|
+
return true;
|
|
677
|
+
}
|
|
678
|
+
if (hasAnyCapability(capabilities, GLOBAL_EXTENSION_ACTIVATION_CAPABILITIES)) {
|
|
679
|
+
return true;
|
|
680
|
+
}
|
|
681
|
+
if (commandPathNeedsTemplateExtensions(probe) && extensionProvidesTemplatesRuntime(commands)) {
|
|
682
|
+
return true;
|
|
683
|
+
}
|
|
684
|
+
if (capabilities.has("search")) {
|
|
685
|
+
return commandPathNeedsSearchExtensions(probe.commandPath);
|
|
686
|
+
}
|
|
687
|
+
if (commands.length > 0) {
|
|
688
|
+
return false;
|
|
689
|
+
}
|
|
690
|
+
if (hasAnyCapability(capabilities, CONSERVATIVE_EXTENSION_ACTIVATION_CAPABILITIES)) {
|
|
691
|
+
return true;
|
|
692
|
+
}
|
|
693
|
+
if (capabilities.has("importers")) {
|
|
694
|
+
return probe.allowCommandPrefixMatch === true;
|
|
695
|
+
}
|
|
696
|
+
return false;
|
|
697
|
+
}
|
|
698
|
+
function discoveryNeedsActivationForProbe(discovery, probe) {
|
|
699
|
+
if (discovery.effective.length === 0) {
|
|
700
|
+
return false;
|
|
701
|
+
}
|
|
702
|
+
const hasCommandProbe = normalizeExtensionCommandPath(probe.commandPath ?? "").length > 0;
|
|
703
|
+
if (!hasCommandProbe) {
|
|
704
|
+
return discovery.effective.some((extension) => {
|
|
705
|
+
const capabilities = extensionCapabilities(extension);
|
|
706
|
+
return (extensionActivationCommands(extension).length > 0 ||
|
|
707
|
+
hasAnyCapability(capabilities, GLOBAL_EXTENSION_ACTIVATION_CAPABILITIES) ||
|
|
708
|
+
hasAnyCapability(capabilities, CONSERVATIVE_EXTENSION_ACTIVATION_CAPABILITIES) ||
|
|
709
|
+
capabilities.has("importers") ||
|
|
710
|
+
capabilities.has("search"));
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
return discovery.effective.some((extension) => extensionNeedsActivationForProbe(extension, probe));
|
|
714
|
+
}
|
|
715
|
+
function buildBootstrapActivationProbe(invocationArgv) {
|
|
716
|
+
const helpRequest = parseBootstrapHelpRequest(invocationArgv);
|
|
717
|
+
if (helpRequest.requested && helpRequest.commandPathTokens.length > 0) {
|
|
718
|
+
const [commandPath, ...commandArgs] = helpRequest.commandPathTokens;
|
|
719
|
+
return {
|
|
720
|
+
commandPath,
|
|
721
|
+
commandArgs,
|
|
722
|
+
allowCommandPrefixMatch: true,
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
const stripped = stripGlobalBootstrapTokens(invocationArgv);
|
|
726
|
+
const commandIndex = stripped.findIndex((token) => token.trim().length > 0 && !token.startsWith("-"));
|
|
727
|
+
if (commandIndex < 0) {
|
|
728
|
+
return {};
|
|
729
|
+
}
|
|
730
|
+
return {
|
|
731
|
+
commandPath: stripped[commandIndex],
|
|
732
|
+
commandArgs: stripped.slice(commandIndex + 1),
|
|
733
|
+
allowCommandPrefixMatch: helpRequest.requested,
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
function collectParsedActivationCommandArgs(command) {
|
|
737
|
+
const commandArgs = command.args.map(String);
|
|
738
|
+
const commandPath = normalizeExtensionCommandPath(getCommandPath(command));
|
|
739
|
+
if (commandPath === "create") {
|
|
740
|
+
const options = command.optsWithGlobals();
|
|
741
|
+
if (typeof options.template === "string" && options.template.trim().length > 0) {
|
|
742
|
+
commandArgs.push("--template");
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
return commandArgs;
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* Surface settings-read warnings once per command on stderr. readSettings()
|
|
749
|
+
* silently falls back to defaults when settings.json is invalid, so most
|
|
750
|
+
* commands (create/list/search/...) generate the warning but never show it — a
|
|
751
|
+
* typo would change behavior with no explanation. Only the `settings_read_*`
|
|
752
|
+
* codes are surfaced (the corrupt-settings fallbacks: invalid_json /
|
|
753
|
+
* invalid_schema / merge_failed); other informational settings warnings (schema
|
|
754
|
+
* bootstrap, legacy-format coercion) stay quiet. Mirrors the same finding in
|
|
755
|
+
* `pm health`, which also carries a remediation_map for it.
|
|
756
|
+
*/
|
|
757
|
+
function emitSettingsReadWarnings(warnings) {
|
|
758
|
+
for (const warning of warnings) {
|
|
759
|
+
if (warning.startsWith("settings_read_")) {
|
|
760
|
+
printError(`[pm] warning: ${warning} — settings.json could not be loaded and pm fell back to defaults; run pm health for remediation.`);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
548
764
|
function emitExtensionProfile(globalOptions, snapshot) {
|
|
549
765
|
if (!globalOptions.profile) {
|
|
550
766
|
return;
|
|
@@ -554,6 +770,56 @@ function emitExtensionProfile(globalOptions, snapshot) {
|
|
|
554
770
|
printError(`profile:extensions activation_warnings=${formatHookWarnings(snapshot.activationWarnings)}`);
|
|
555
771
|
}
|
|
556
772
|
}
|
|
773
|
+
function emitExtensionSkippedProfile(profileEnabled, snapshot, probe) {
|
|
774
|
+
if (!profileEnabled) {
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
const command = normalizeExtensionCommandPath(probe.commandPath ?? "") || "<none>";
|
|
778
|
+
printError(`profile:extensions activation=skipped command=${command} effective=${snapshot.discovery.effective.length} warnings=${snapshot.discovery.warnings.length} discovery_ms=${snapshot.discoveryMs}`);
|
|
779
|
+
}
|
|
780
|
+
async function loadRuntimeExtensionDiscoverySnapshot(pmRoot) {
|
|
781
|
+
const cacheKey = buildRuntimeExtensionDiscoverySnapshotCacheKey(pmRoot);
|
|
782
|
+
if (runtimeExtensionDiscoverySnapshotCache?.key === cacheKey) {
|
|
783
|
+
return runtimeExtensionDiscoverySnapshotCache.snapshot;
|
|
784
|
+
}
|
|
785
|
+
const settingsPath = getSettingsPath(pmRoot);
|
|
786
|
+
if (!(await pathExists(settingsPath))) {
|
|
787
|
+
runtimeExtensionDiscoverySnapshotCache = {
|
|
788
|
+
key: cacheKey,
|
|
789
|
+
snapshot: null,
|
|
790
|
+
};
|
|
791
|
+
return null;
|
|
792
|
+
}
|
|
793
|
+
try {
|
|
794
|
+
const startedAt = Date.now();
|
|
795
|
+
const { settings, warnings: settingsReadWarnings } = await readSettingsWithMetadata(pmRoot);
|
|
796
|
+
const discovery = await discoverExtensions({
|
|
797
|
+
pmRoot,
|
|
798
|
+
settings,
|
|
799
|
+
cwd: process.cwd(),
|
|
800
|
+
noExtensions: false,
|
|
801
|
+
});
|
|
802
|
+
const snapshot = {
|
|
803
|
+
pmRoot,
|
|
804
|
+
settings,
|
|
805
|
+
discovery,
|
|
806
|
+
discoveryMs: Date.now() - startedAt,
|
|
807
|
+
settingsReadWarnings: [...settingsReadWarnings],
|
|
808
|
+
};
|
|
809
|
+
runtimeExtensionDiscoverySnapshotCache = {
|
|
810
|
+
key: cacheKey,
|
|
811
|
+
snapshot,
|
|
812
|
+
};
|
|
813
|
+
return snapshot;
|
|
814
|
+
}
|
|
815
|
+
catch {
|
|
816
|
+
runtimeExtensionDiscoverySnapshotCache = {
|
|
817
|
+
key: cacheKey,
|
|
818
|
+
snapshot: null,
|
|
819
|
+
};
|
|
820
|
+
return null;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
557
823
|
async function loadRuntimeExtensionSnapshot(pmRoot) {
|
|
558
824
|
const cacheKey = buildRuntimeExtensionSnapshotCacheKey(pmRoot);
|
|
559
825
|
if (runtimeExtensionSnapshotCache?.key === cacheKey) {
|
|
@@ -620,9 +886,34 @@ async function loadRuntimeExtensionSnapshot(pmRoot) {
|
|
|
620
886
|
async function maybeLoadRuntimeExtensions(command) {
|
|
621
887
|
const globalOptions = getGlobalOptions(command);
|
|
622
888
|
if (globalOptions.noExtensions) {
|
|
889
|
+
// Extensions are disabled, so the discovery snapshot that normally carries
|
|
890
|
+
// the settings-read warnings is skipped. Surface them directly here (a single
|
|
891
|
+
// read on this uncommon path) so `pm --no-extensions <cmd>` — the common safe
|
|
892
|
+
// mode — still reports a corrupt settings.json instead of silently running on
|
|
893
|
+
// defaults.
|
|
894
|
+
const noExtPmRoot = resolvePmRoot(process.cwd(), globalOptions.path);
|
|
895
|
+
if (await pathExists(getSettingsPath(noExtPmRoot))) {
|
|
896
|
+
emitSettingsReadWarnings((await readSettingsWithMetadata(noExtPmRoot)).warnings);
|
|
897
|
+
}
|
|
623
898
|
return null;
|
|
624
899
|
}
|
|
625
900
|
const pmRoot = resolvePmRoot(process.cwd(), globalOptions.path);
|
|
901
|
+
const discoverySnapshot = await loadRuntimeExtensionDiscoverySnapshot(pmRoot);
|
|
902
|
+
if (!discoverySnapshot) {
|
|
903
|
+
return null;
|
|
904
|
+
}
|
|
905
|
+
// Surface actionable settings-read warnings once per command, before the
|
|
906
|
+
// activation-skipped fast path returns, so create/list/search/... all report a
|
|
907
|
+
// corrupt settings.json instead of silently running on defaults.
|
|
908
|
+
emitSettingsReadWarnings(discoverySnapshot.settingsReadWarnings);
|
|
909
|
+
const probe = {
|
|
910
|
+
commandPath: getCommandPath(command),
|
|
911
|
+
commandArgs: collectParsedActivationCommandArgs(command),
|
|
912
|
+
};
|
|
913
|
+
if (!discoveryNeedsActivationForProbe(discoverySnapshot.discovery, probe)) {
|
|
914
|
+
emitExtensionSkippedProfile(globalOptions.profile, discoverySnapshot, probe);
|
|
915
|
+
return null;
|
|
916
|
+
}
|
|
626
917
|
const snapshot = await loadRuntimeExtensionSnapshot(pmRoot);
|
|
627
918
|
if (!snapshot) {
|
|
628
919
|
return null;
|
|
@@ -817,24 +1108,39 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
|
|
|
817
1108
|
}
|
|
818
1109
|
async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv) {
|
|
819
1110
|
const bootstrapGlobalOptions = parseBootstrapGlobalOptions(invocationArgv);
|
|
1111
|
+
const pmRoot = resolvePmRoot(process.cwd(), bootstrapGlobalOptions.path);
|
|
820
1112
|
if (bootstrapGlobalOptions.noExtensions) {
|
|
821
1113
|
activeRuntimeExtensionCommandDescriptors = new Map();
|
|
822
1114
|
setActiveExtensionServices({ overrides: [] });
|
|
1115
|
+
await maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, createEmptyExtensionRegistrationRegistry());
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
const discoverySnapshot = await loadRuntimeExtensionDiscoverySnapshot(pmRoot);
|
|
1119
|
+
const probe = buildBootstrapActivationProbe(invocationArgv);
|
|
1120
|
+
if (!discoverySnapshot) {
|
|
1121
|
+
activeRuntimeExtensionCommandDescriptors = new Map();
|
|
1122
|
+
setActiveExtensionServices({ overrides: [] });
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
if (!discoveryNeedsActivationForProbe(discoverySnapshot.discovery, probe)) {
|
|
1126
|
+
activeRuntimeExtensionCommandDescriptors = new Map();
|
|
1127
|
+
setActiveExtensionServices({ overrides: [] });
|
|
1128
|
+
await maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, createEmptyExtensionRegistrationRegistry(), discoverySnapshot.settings);
|
|
1129
|
+
emitExtensionSkippedProfile(bootstrapProfileEnabled(invocationArgv), discoverySnapshot, probe);
|
|
823
1130
|
return;
|
|
824
1131
|
}
|
|
825
|
-
const pmRoot = resolvePmRoot(process.cwd(), bootstrapGlobalOptions.path);
|
|
826
1132
|
const snapshot = await loadRuntimeExtensionSnapshot(pmRoot);
|
|
827
1133
|
if (!snapshot) {
|
|
828
1134
|
activeRuntimeExtensionCommandDescriptors = new Map();
|
|
829
1135
|
setActiveExtensionServices({ overrides: [] });
|
|
1136
|
+
await maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, createEmptyExtensionRegistrationRegistry(), discoverySnapshot.settings);
|
|
830
1137
|
return;
|
|
831
1138
|
}
|
|
832
1139
|
// Ensure usage/help/error formatting overrides are available even when parse
|
|
833
1140
|
// errors occur before preAction hooks initialize full runtime extension state.
|
|
834
1141
|
setActiveExtensionServices(snapshot.services);
|
|
835
1142
|
activeRuntimeExtensionCommandDescriptors = new Map(snapshot.commandDescriptors);
|
|
836
|
-
|
|
837
|
-
attachCreateUpdatePolicyHelpText(rootProgram, typeRegistry, invocationArgv);
|
|
1143
|
+
await maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, snapshot.registrations, snapshot.settings);
|
|
838
1144
|
const commandPaths = [...new Set([...snapshot.commandHandlers, ...snapshot.commandDescriptors.keys()])].sort((left, right) => left.localeCompare(right));
|
|
839
1145
|
for (const commandPath of commandPaths) {
|
|
840
1146
|
const pathParts = commandPath.split(" ").filter((part) => part.length > 0);
|
|
@@ -1093,6 +1399,7 @@ const LIST_QUERY_COMMAND_NAMES = new Set([
|
|
|
1093
1399
|
const MUTATION_COMMAND_NAMES = new Set([
|
|
1094
1400
|
"append",
|
|
1095
1401
|
"close",
|
|
1402
|
+
"close-many",
|
|
1096
1403
|
"comments",
|
|
1097
1404
|
"delete",
|
|
1098
1405
|
"deps",
|
|
@@ -1123,6 +1430,14 @@ const OPERATION_COMMAND_NAMES = new Set([
|
|
|
1123
1430
|
"test-runs-worker",
|
|
1124
1431
|
"validate",
|
|
1125
1432
|
]);
|
|
1433
|
+
const MUTATING_OPERATION_COMMAND_NAMES = new Set([
|
|
1434
|
+
"claim",
|
|
1435
|
+
"close-task",
|
|
1436
|
+
"pause-task",
|
|
1437
|
+
"release",
|
|
1438
|
+
"start-task",
|
|
1439
|
+
"test",
|
|
1440
|
+
]);
|
|
1126
1441
|
const REGISTER_ALL_CORE_COMMAND_FAMILIES = {
|
|
1127
1442
|
setup: true,
|
|
1128
1443
|
listQuery: true,
|
|
@@ -1267,12 +1582,39 @@ function shouldRegisterRuntimeSchemaFlags(invocationArgv) {
|
|
|
1267
1582
|
}
|
|
1268
1583
|
return RUNTIME_SCHEMA_FLAG_BOOTSTRAP_COMMANDS.has(commandName);
|
|
1269
1584
|
}
|
|
1585
|
+
function enforceExplicitRetryForFlagTypos(bootstrapInvocation) {
|
|
1586
|
+
const commandName = bootstrapInvocation.commandName;
|
|
1587
|
+
if (!commandName) {
|
|
1588
|
+
return;
|
|
1589
|
+
}
|
|
1590
|
+
const typoEvent = bootstrapInvocation.trace.find((entry) => entry.reason === "flag_typo");
|
|
1591
|
+
if (!typoEvent) {
|
|
1592
|
+
return;
|
|
1593
|
+
}
|
|
1594
|
+
const normalizedTokens = Array.isArray(typoEvent.to)
|
|
1595
|
+
? typoEvent.to
|
|
1596
|
+
: [String(typoEvent.to ?? "")].filter((entry) => entry.length > 0);
|
|
1597
|
+
const normalizedDisplay = normalizedTokens.length > 0 ? normalizedTokens.join(" ") : "the canonical flag";
|
|
1598
|
+
const mutatingCommand = MUTATION_COMMAND_NAMES.has(commandName) || MUTATING_OPERATION_COMMAND_NAMES.has(commandName);
|
|
1599
|
+
const code = mutatingCommand ? "mutating_flag_typo_requires_retry" : "flag_typo_requires_retry";
|
|
1600
|
+
const commandScope = mutatingCommand ? "mutating option" : "option";
|
|
1601
|
+
throw new PmCliError(`Refusing to auto-correct ${commandScope} ${typoEvent.from} to ${normalizedDisplay}. Retry with the canonical flag so the command is explicit.`, EXIT_CODE.USAGE, {
|
|
1602
|
+
code,
|
|
1603
|
+
examples: [renderPmCommand(bootstrapInvocation.argv)],
|
|
1604
|
+
nextSteps: ["Retry the command with the canonical flag shown in examples."],
|
|
1605
|
+
recovery: {
|
|
1606
|
+
normalized_args: [...bootstrapInvocation.argv],
|
|
1607
|
+
suggested_retry: renderPmCommand(bootstrapInvocation.argv),
|
|
1608
|
+
},
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1270
1611
|
export async function runPmCli(rawArgv = process.argv.slice(2)) {
|
|
1271
1612
|
const bootstrapInvocation = normalizeBootstrapInvocation(rawArgv);
|
|
1272
1613
|
const invocationArgv = bootstrapInvocation.argv;
|
|
1273
1614
|
const invocationProcessArgv = [process.argv[0], process.argv[1], ...invocationArgv];
|
|
1274
1615
|
const isBareInvocation = invocationArgv.length === 0;
|
|
1275
1616
|
try {
|
|
1617
|
+
enforceExplicitRetryForFlagTypos(bootstrapInvocation);
|
|
1276
1618
|
applyBootstrapPagerPolicy(invocationArgv);
|
|
1277
1619
|
const registrationSelection = resolveCoreCommandRegistrationSelection(invocationArgv);
|
|
1278
1620
|
await registerCoreCommandFamilies(program, registrationSelection);
|
|
@@ -1333,8 +1675,18 @@ export async function runPmCli(rawArgv = process.argv.slice(2)) {
|
|
|
1333
1675
|
};
|
|
1334
1676
|
};
|
|
1335
1677
|
if (!bootstrapGlobal.noExtensions) {
|
|
1336
|
-
const
|
|
1337
|
-
|
|
1678
|
+
const bootstrapProbe = buildBootstrapActivationProbe(invocationArgv);
|
|
1679
|
+
const discoverySnapshot = await loadRuntimeExtensionDiscoverySnapshot(bootstrapPmRoot);
|
|
1680
|
+
if (discoverySnapshot && discoveryNeedsActivationForProbe(discoverySnapshot.discovery, bootstrapProbe)) {
|
|
1681
|
+
const bootstrapSnapshot = await loadRuntimeExtensionSnapshot(bootstrapPmRoot);
|
|
1682
|
+
setActiveExtensionServices(bootstrapSnapshot?.services ?? { overrides: [] });
|
|
1683
|
+
}
|
|
1684
|
+
else {
|
|
1685
|
+
if (discoverySnapshot) {
|
|
1686
|
+
emitExtensionSkippedProfile(bootstrapProfileEnabled(invocationArgv), discoverySnapshot, bootstrapProbe);
|
|
1687
|
+
}
|
|
1688
|
+
setActiveExtensionServices({ overrides: [] });
|
|
1689
|
+
}
|
|
1338
1690
|
}
|
|
1339
1691
|
const numericExitCode = readThrownExitCode(error);
|
|
1340
1692
|
if (error instanceof PmCliError ||
|
|
@@ -1380,7 +1732,9 @@ export async function runPmCli(rawArgv = process.argv.slice(2)) {
|
|
|
1380
1732
|
command_resolution: commandResolution,
|
|
1381
1733
|
resolution_stage: "execute",
|
|
1382
1734
|
});
|
|
1383
|
-
|
|
1735
|
+
if (loggedHandledErrorToSentry) {
|
|
1736
|
+
sentryCaptureCliError(wrapThrownErrorForSentry(error, errorMessage));
|
|
1737
|
+
}
|
|
1384
1738
|
if (jsonErrors) {
|
|
1385
1739
|
printError(JSON.stringify(formatPmCliErrorForJson(errorMessage, exitCode, enrichedContext), null, 2));
|
|
1386
1740
|
}
|
|
@@ -1605,4 +1959,4 @@ export const _testOnly = {
|
|
|
1605
1959
|
wrapThrownErrorForSentry,
|
|
1606
1960
|
};
|
|
1607
1961
|
//# sourceMappingURL=main.js.map
|
|
1608
|
-
//# debugId=
|
|
1962
|
+
//# debugId=85d31f87-d392-5da2-9d53-1525fb938ff2
|