@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../core/item/type-registry.ts"],"sourcesContent":["import { TYPE_TO_FOLDER } from \"../shared/constants.js\";\nimport type { ExtensionRegistrationRegistry } from \"../extensions/loader.js\";\nimport type {\n ItemTypeCommandOptionPolicy,\n ItemTypeDefinition,\n ItemTypeOptionDefinition,\n PmSettings,\n} from \"../../types/index.js\";\nimport { ITEM_TYPE_VALUES } from \"../../types/index.js\";\nimport {\n normalizeItemTypeDefinition as normalizeSharedItemTypeDefinition,\n normalizeItemTypeStringList,\n strictPolicyCommand,\n} from \"./item-type-definition.js\";\n\nexport const DEFAULT_REQUIRED_CREATE_FIELDS = [\n \"title\",\n \"description\",\n \"status\",\n \"priority\",\n \"tags\",\n \"body\",\n \"deadline\",\n \"estimatedMinutes\",\n \"acceptanceCriteria\",\n \"author\",\n \"message\",\n \"assignee\",\n] as const;\n\nexport const DEFAULT_REQUIRED_CREATE_REPEATABLES = [\"dep\", \"comment\", \"note\", \"learning\", \"file\", \"test\", \"doc\"] as const;\n\nexport type CommandOptionPolicyCommand = \"create\" | \"update\";\n\nconst CREATE_COMMAND_OPTION_KEYS = [\n \"title\",\n \"description\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"body\",\n \"deadline\",\n \"estimatedMinutes\",\n \"acceptanceCriteria\",\n \"definitionOfReady\",\n \"order\",\n \"goal\",\n \"objective\",\n \"value\",\n \"impact\",\n \"outcome\",\n \"whyNow\",\n \"author\",\n \"message\",\n \"assignee\",\n \"parent\",\n \"reviewer\",\n \"risk\",\n \"confidence\",\n \"sprint\",\n \"release\",\n \"blockedBy\",\n \"blockedReason\",\n \"unblockNote\",\n \"reporter\",\n \"severity\",\n \"environment\",\n \"reproSteps\",\n \"resolution\",\n \"expectedResult\",\n \"actualResult\",\n \"affectedVersion\",\n \"fixedVersion\",\n \"component\",\n \"regression\",\n \"customerImpact\",\n \"dep\",\n \"comment\",\n \"note\",\n \"learning\",\n \"file\",\n \"test\",\n \"doc\",\n \"reminder\",\n \"event\",\n \"typeOption\",\n \"field\",\n] as const;\n\nconst UPDATE_COMMAND_OPTION_KEYS = [\n \"title\",\n \"description\",\n \"body\",\n \"status\",\n \"closeReason\",\n \"priority\",\n \"type\",\n \"tags\",\n \"deadline\",\n \"estimatedMinutes\",\n \"acceptanceCriteria\",\n \"definitionOfReady\",\n \"order\",\n \"goal\",\n \"objective\",\n \"value\",\n \"impact\",\n \"outcome\",\n \"whyNow\",\n \"author\",\n \"message\",\n \"assignee\",\n \"parent\",\n \"reviewer\",\n \"risk\",\n \"confidence\",\n \"sprint\",\n \"release\",\n \"blockedBy\",\n \"blockedReason\",\n \"unblockNote\",\n \"reporter\",\n \"severity\",\n \"environment\",\n \"reproSteps\",\n \"resolution\",\n \"expectedResult\",\n \"actualResult\",\n \"affectedVersion\",\n \"fixedVersion\",\n \"component\",\n \"regression\",\n \"customerImpact\",\n \"comment\",\n \"note\",\n \"learning\",\n \"file\",\n \"test\",\n \"doc\",\n \"reminder\",\n \"event\",\n \"typeOption\",\n \"field\",\n \"allowAuditUpdate\",\n \"force\",\n] as const;\n\nconst SHARED_COMMAND_OPTION_ALIASES: Record<string, string> = {\n \"close-reason\": \"closeReason\",\n close_reason: \"closeReason\",\n \"estimated-minutes\": \"estimatedMinutes\",\n estimated_minutes: \"estimatedMinutes\",\n estimate: \"estimatedMinutes\",\n \"acceptance-criteria\": \"acceptanceCriteria\",\n acceptance_criteria: \"acceptanceCriteria\",\n ac: \"acceptanceCriteria\",\n \"definition-of-ready\": \"definitionOfReady\",\n definition_of_ready: \"definitionOfReady\",\n rank: \"order\",\n \"why-now\": \"whyNow\",\n why_now: \"whyNow\",\n \"blocked-by\": \"blockedBy\",\n blocked_by: \"blockedBy\",\n \"blocked-reason\": \"blockedReason\",\n blocked_reason: \"blockedReason\",\n \"unblock-note\": \"unblockNote\",\n unblock_note: \"unblockNote\",\n \"repro-steps\": \"reproSteps\",\n repro_steps: \"reproSteps\",\n \"expected-result\": \"expectedResult\",\n expected_result: \"expectedResult\",\n \"actual-result\": \"actualResult\",\n actual_result: \"actualResult\",\n \"affected-version\": \"affectedVersion\",\n affected_version: \"affectedVersion\",\n \"fixed-version\": \"fixedVersion\",\n fixed_version: \"fixedVersion\",\n \"customer-impact\": \"customerImpact\",\n customer_impact: \"customerImpact\",\n \"type-option\": \"typeOption\",\n type_option: \"typeOption\",\n type_options: \"typeOption\",\n};\n\nconst CREATE_COMMAND_OPTION_ALIASES: Record<string, string> = {\n ...SHARED_COMMAND_OPTION_ALIASES,\n};\n\nconst UPDATE_COMMAND_OPTION_ALIASES: Record<string, string> = {\n ...SHARED_COMMAND_OPTION_ALIASES,\n \"allow-audit-update\": \"allowAuditUpdate\",\n allow_audit_update: \"allowAuditUpdate\",\n};\n\nconst CREATE_COMMAND_OPTION_FLAG_LABELS: Record<string, string> = {\n title: \"--title\",\n description: \"--description\",\n type: \"--type\",\n status: \"--status\",\n priority: \"--priority\",\n tags: \"--tags\",\n body: \"--body\",\n deadline: \"--deadline\",\n estimatedMinutes: \"--estimate/--estimated-minutes\",\n acceptanceCriteria: \"--acceptance-criteria/--ac\",\n definitionOfReady: \"--definition-of-ready\",\n order: \"--order/--rank\",\n goal: \"--goal\",\n objective: \"--objective\",\n value: \"--value\",\n impact: \"--impact\",\n outcome: \"--outcome\",\n whyNow: \"--why-now\",\n author: \"--author\",\n message: \"--message\",\n assignee: \"--assignee\",\n parent: \"--parent\",\n reviewer: \"--reviewer\",\n risk: \"--risk\",\n confidence: \"--confidence\",\n sprint: \"--sprint\",\n release: \"--release\",\n blockedBy: \"--blocked-by\",\n blockedReason: \"--blocked-reason\",\n unblockNote: \"--unblock-note\",\n reporter: \"--reporter\",\n severity: \"--severity\",\n environment: \"--environment\",\n reproSteps: \"--repro-steps\",\n resolution: \"--resolution\",\n expectedResult: \"--expected-result\",\n actualResult: \"--actual-result\",\n affectedVersion: \"--affected-version\",\n fixedVersion: \"--fixed-version\",\n component: \"--component\",\n regression: \"--regression\",\n customerImpact: \"--customer-impact\",\n dep: \"--dep\",\n comment: \"--comment\",\n note: \"--note\",\n learning: \"--learning\",\n file: \"--file\",\n test: \"--test\",\n doc: \"--doc\",\n reminder: \"--reminder\",\n event: \"--event\",\n typeOption: \"--type-option\",\n};\n\nconst UPDATE_COMMAND_OPTION_FLAG_LABELS: Record<string, string> = {\n title: \"--title\",\n description: \"--description\",\n body: \"--body\",\n status: \"--status\",\n closeReason: \"--close-reason\",\n priority: \"--priority\",\n type: \"--type\",\n tags: \"--tags\",\n deadline: \"--deadline\",\n estimatedMinutes: \"--estimate/--estimated-minutes\",\n acceptanceCriteria: \"--acceptance-criteria/--ac\",\n definitionOfReady: \"--definition-of-ready\",\n order: \"--order/--rank\",\n goal: \"--goal\",\n objective: \"--objective\",\n value: \"--value\",\n impact: \"--impact\",\n outcome: \"--outcome\",\n whyNow: \"--why-now\",\n assignee: \"--assignee\",\n parent: \"--parent\",\n reviewer: \"--reviewer\",\n risk: \"--risk\",\n confidence: \"--confidence\",\n sprint: \"--sprint\",\n release: \"--release\",\n blockedBy: \"--blocked-by\",\n blockedReason: \"--blocked-reason\",\n unblockNote: \"--unblock-note\",\n reporter: \"--reporter\",\n severity: \"--severity\",\n environment: \"--environment\",\n reproSteps: \"--repro-steps\",\n resolution: \"--resolution\",\n expectedResult: \"--expected-result\",\n actualResult: \"--actual-result\",\n affectedVersion: \"--affected-version\",\n fixedVersion: \"--fixed-version\",\n component: \"--component\",\n regression: \"--regression\",\n customerImpact: \"--customer-impact\",\n comment: \"--comment\",\n note: \"--note\",\n learning: \"--learning\",\n file: \"--file\",\n test: \"--test\",\n doc: \"--doc\",\n reminder: \"--reminder\",\n event: \"--event\",\n typeOption: \"--type-option\",\n allowAuditUpdate: \"--allow-audit-update\",\n author: \"--author\",\n message: \"--message\",\n force: \"--force\",\n};\n\nexport interface CommandOptionPolicyState {\n required: string[];\n hidden: string[];\n disabled: string[];\n errors: string[];\n}\n\nexport interface ResolvedItemTypeDefinition {\n name: string;\n /** Optional human description carried from the type definition. */\n description?: string;\n folder: string;\n aliases: string[];\n /** Optional per-type status applied at create time when `--status` is omitted. */\n default_status?: string;\n required_create_fields: string[];\n required_create_repeatables: string[];\n options: ItemTypeOptionDefinition[];\n command_option_policies: ItemTypeCommandOptionPolicy[];\n}\n\nexport interface ItemTypeRegistry {\n types: string[];\n folders: string[];\n type_to_folder: Record<string, string>;\n by_type: Record<string, ResolvedItemTypeDefinition>;\n alias_to_type: Record<string, string>;\n}\n\nfunction normalizeCommandOptionToken(value: string): string {\n return value.trim().replace(/^--+/, \"\").toLowerCase();\n}\n\nfunction commandOptionKeys(command: CommandOptionPolicyCommand): readonly string[] {\n return command === \"create\" ? CREATE_COMMAND_OPTION_KEYS : UPDATE_COMMAND_OPTION_KEYS;\n}\n\nfunction commandOptionAliases(command: CommandOptionPolicyCommand): Record<string, string> {\n return command === \"create\" ? CREATE_COMMAND_OPTION_ALIASES : UPDATE_COMMAND_OPTION_ALIASES;\n}\n\nexport function canonicalizeCommandOptionKey(\n command: CommandOptionPolicyCommand,\n rawOption: string,\n): string | undefined {\n const normalizedToken = normalizeCommandOptionToken(rawOption);\n if (normalizedToken.length === 0) {\n return undefined;\n }\n const aliased = commandOptionAliases(command)[normalizedToken];\n if (aliased) {\n return aliased;\n }\n return commandOptionKeys(command).find((candidate) => candidate.toLowerCase() === normalizedToken);\n}\n\nexport function commandOptionFlagLabel(command: CommandOptionPolicyCommand, optionKey: string): string {\n const labels = command === \"create\" ? CREATE_COMMAND_OPTION_FLAG_LABELS : UPDATE_COMMAND_OPTION_FLAG_LABELS;\n return labels[optionKey] ?? `--${optionKey.replace(/([A-Z])/g, \"-$1\").toLowerCase()}`;\n}\n\nfunction toDefaultFolder(name: string): string {\n const normalized = name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n if (normalized.length === 0) {\n return \"items\";\n }\n return normalized.endsWith(\"s\") ? normalized : `${normalized}s`;\n}\n\n// Runtime registry consumes untrusted extension/file definitions, so it uses the\n// strict policy-command resolver (trim + lowercase, reject non-create/update). All\n// other normalization is single-sourced from ./item-type-definition.ts (pm-v798).\nfunction normalizeTypeDefinition(definition: ItemTypeDefinition): ItemTypeDefinition | null {\n return normalizeSharedItemTypeDefinition(definition, { resolvePolicyCommand: strictPolicyCommand });\n}\n\nfunction coerceTypeDefinitionFromUnknown(raw: unknown): ItemTypeDefinition | null {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n return null;\n }\n const record = raw as Record<string, unknown>;\n const name = typeof record.name === \"string\" ? record.name : \"\";\n if (name.trim().length === 0) {\n return null;\n }\n const folder = typeof record.folder === \"string\" ? record.folder : undefined;\n const description = typeof record.description === \"string\" ? record.description : undefined;\n const defaultStatus = typeof record.default_status === \"string\" ? record.default_status : undefined;\n const aliases = Array.isArray(record.aliases) ? record.aliases.filter((value): value is string => typeof value === \"string\") : undefined;\n const requiredCreateFields = Array.isArray(record.required_create_fields)\n ? record.required_create_fields.filter((value): value is string => typeof value === \"string\")\n : undefined;\n const requiredCreateRepeatables = Array.isArray(record.required_create_repeatables)\n ? record.required_create_repeatables.filter((value): value is string => typeof value === \"string\")\n : undefined;\n let options: ItemTypeOptionDefinition[] | undefined;\n if (Array.isArray(record.options)) {\n options = [];\n for (const entry of record.options) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const optionRecord = entry as Record<string, unknown>;\n if (typeof optionRecord.key !== \"string\") {\n continue;\n }\n options.push({\n key: optionRecord.key,\n values: Array.isArray(optionRecord.values)\n ? optionRecord.values.filter((value): value is string => typeof value === \"string\")\n : [],\n required: optionRecord.required === undefined ? undefined : Boolean(optionRecord.required),\n aliases: Array.isArray(optionRecord.aliases)\n ? optionRecord.aliases.filter((value): value is string => typeof value === \"string\")\n : undefined,\n description: typeof optionRecord.description === \"string\" ? optionRecord.description : undefined,\n });\n }\n }\n let commandOptionPolicies: ItemTypeCommandOptionPolicy[] | undefined;\n if (Array.isArray(record.command_option_policies)) {\n commandOptionPolicies = [];\n for (const entry of record.command_option_policies) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const policyRecord = entry as Record<string, unknown>;\n if (typeof policyRecord.command !== \"string\" || typeof policyRecord.option !== \"string\") {\n continue;\n }\n const normalizedCommand = policyRecord.command.trim().toLowerCase();\n if (normalizedCommand !== \"create\" && normalizedCommand !== \"update\") {\n continue;\n }\n commandOptionPolicies.push({\n command: normalizedCommand,\n option: policyRecord.option,\n required: policyRecord.required === undefined ? undefined : Boolean(policyRecord.required),\n visible: policyRecord.visible === undefined ? undefined : Boolean(policyRecord.visible),\n enabled: policyRecord.enabled === undefined ? undefined : Boolean(policyRecord.enabled),\n });\n }\n }\n return {\n name,\n description,\n default_status: defaultStatus,\n folder,\n aliases,\n required_create_fields: requiredCreateFields,\n required_create_repeatables: requiredCreateRepeatables,\n options,\n command_option_policies: commandOptionPolicies,\n };\n}\n\nfunction applyTypeDefinitions(\n source: ItemTypeDefinition[],\n target: Map<string, ResolvedItemTypeDefinition>,\n preserveBuiltinDefaults: boolean,\n): void {\n for (const rawDefinition of source) {\n const normalizedDefinition = normalizeTypeDefinition(rawDefinition);\n if (!normalizedDefinition) {\n continue;\n }\n const lowerName = normalizedDefinition.name.toLowerCase();\n const existing = target.get(lowerName);\n const keepName = existing?.name ?? normalizedDefinition.name;\n const folder = normalizedDefinition.folder ?? existing?.folder ?? toDefaultFolder(keepName);\n const aliases = normalizeItemTypeStringList([\n ...(existing?.aliases ?? []),\n ...(normalizedDefinition.aliases ?? []),\n ]);\n const requiredCreateFields = normalizedDefinition.required_create_fields\n ? normalizeItemTypeStringList(normalizedDefinition.required_create_fields)\n : existing?.required_create_fields ??\n (preserveBuiltinDefaults ? [...DEFAULT_REQUIRED_CREATE_FIELDS] : []);\n const requiredCreateRepeatables = normalizedDefinition.required_create_repeatables\n ? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables)\n : existing?.required_create_repeatables ??\n (preserveBuiltinDefaults ? [...DEFAULT_REQUIRED_CREATE_REPEATABLES] : []);\n const options = normalizedDefinition.options\n ? normalizedDefinition.options\n : existing?.options\n ? [...existing.options]\n : [];\n const commandOptionPolicies = normalizedDefinition.command_option_policies\n ? normalizedDefinition.command_option_policies\n : existing?.command_option_policies\n ? [...existing.command_option_policies]\n : [];\n const defaultStatus = normalizedDefinition.default_status ?? existing?.default_status;\n const description = normalizedDefinition.description ?? existing?.description;\n target.set(lowerName, {\n name: keepName,\n ...(description ? { description } : {}),\n ...(defaultStatus ? { default_status: defaultStatus } : {}),\n folder,\n aliases,\n required_create_fields: requiredCreateFields,\n required_create_repeatables: requiredCreateRepeatables,\n options,\n command_option_policies: commandOptionPolicies,\n });\n }\n}\n\nfunction collectExtensionTypeDefinitions(registrations: ExtensionRegistrationRegistry | null | undefined): ItemTypeDefinition[] {\n if (!registrations) {\n return [];\n }\n const definitions: ItemTypeDefinition[] = [];\n for (const registration of registrations.item_types ?? []) {\n const typeDefinitionsRaw = (registration as { types?: unknown[] }).types;\n if (!Array.isArray(typeDefinitionsRaw)) {\n continue;\n }\n for (const rawDefinition of typeDefinitionsRaw) {\n const normalized = coerceTypeDefinitionFromUnknown(rawDefinition);\n if (normalized) {\n definitions.push(normalized);\n }\n }\n }\n return definitions;\n}\n\nexport function resolveItemTypeRegistry(\n settings: PmSettings,\n extensionRegistrations: ExtensionRegistrationRegistry | null | undefined = null,\n): ItemTypeRegistry {\n const byLowerName = new Map<string, ResolvedItemTypeDefinition>();\n for (const builtin of ITEM_TYPE_VALUES) {\n byLowerName.set(builtin.toLowerCase(), {\n name: builtin,\n folder: TYPE_TO_FOLDER[builtin],\n aliases: [],\n required_create_fields: [...DEFAULT_REQUIRED_CREATE_FIELDS],\n required_create_repeatables: [...DEFAULT_REQUIRED_CREATE_REPEATABLES],\n options: [],\n command_option_policies: [],\n });\n }\n\n applyTypeDefinitions(settings.item_types?.definitions ?? [], byLowerName, false);\n applyTypeDefinitions(collectExtensionTypeDefinitions(extensionRegistrations), byLowerName, false);\n\n const definitions = [...byLowerName.values()].sort((left, right) => left.name.localeCompare(right.name));\n const byType: Record<string, ResolvedItemTypeDefinition> = {};\n const aliasToType: Record<string, string> = {};\n const typeToFolder: Record<string, string> = {};\n for (const definition of definitions) {\n byType[definition.name] = definition;\n typeToFolder[definition.name] = definition.folder;\n aliasToType[definition.name.toLowerCase()] = definition.name;\n for (const alias of definition.aliases) {\n aliasToType[alias.toLowerCase()] = definition.name;\n }\n }\n const folders = [...new Set(definitions.map((definition) => definition.folder))].sort((left, right) => left.localeCompare(right));\n return {\n types: definitions.map((definition) => definition.name),\n folders,\n type_to_folder: typeToFolder,\n by_type: byType,\n alias_to_type: aliasToType,\n };\n}\n\nexport function resolveTypeName(rawType: string | undefined, registry: ItemTypeRegistry): string | undefined {\n if (rawType === undefined) {\n return undefined;\n }\n return registry.alias_to_type[rawType.trim().toLowerCase()];\n}\n\nexport function resolveTypeDefinition(\n typeName: string | undefined,\n registry: ItemTypeRegistry,\n): ResolvedItemTypeDefinition | undefined {\n const resolvedName = resolveTypeName(typeName, registry);\n if (!resolvedName) {\n return undefined;\n }\n return registry.by_type[resolvedName];\n}\n\nexport function resolveCommandOptionPolicyState(\n typeDefinition: ResolvedItemTypeDefinition,\n command: CommandOptionPolicyCommand,\n baseRequiredOptions: Iterable<string>,\n): CommandOptionPolicyState {\n const errors: string[] = [];\n const required = new Set<string>();\n const hidden = new Set<string>();\n const disabled = new Set<string>();\n\n for (const rawBase of baseRequiredOptions) {\n const canonical = canonicalizeCommandOptionKey(command, rawBase);\n if (!canonical) {\n errors.push(\n `Unsupported base required option \"${rawBase}\" for command \"${command}\" on type \"${typeDefinition.name}\"`,\n );\n continue;\n }\n required.add(canonical);\n }\n\n for (const policy of typeDefinition.command_option_policies) {\n if (policy.command !== command) {\n continue;\n }\n const canonical = canonicalizeCommandOptionKey(command, policy.option);\n if (!canonical) {\n errors.push(\n `Unsupported command_option_policies option \"${policy.option}\" for command \"${command}\" on type \"${typeDefinition.name}\"`,\n );\n continue;\n }\n if (policy.required !== undefined) {\n if (policy.required) {\n required.add(canonical);\n } else {\n required.delete(canonical);\n }\n }\n if (policy.visible !== undefined) {\n if (policy.visible) {\n hidden.delete(canonical);\n } else {\n hidden.add(canonical);\n }\n }\n if (policy.enabled !== undefined) {\n if (policy.enabled) {\n disabled.delete(canonical);\n } else {\n disabled.add(canonical);\n }\n }\n }\n\n for (const option of required) {\n if (disabled.has(option)) {\n errors.push(\n `Option \"${option}\" cannot be both required and disabled for command \"${command}\" on type \"${typeDefinition.name}\"`,\n );\n }\n }\n\n return {\n required: [...required],\n hidden: [...hidden].sort((left, right) => left.localeCompare(right)),\n disabled: [...disabled].sort((left, right) => left.localeCompare(right)),\n errors,\n };\n}\n\nexport function validateTypeOptions(\n typeName: string,\n rawTypeOptions: Record<string, string> | undefined,\n registry: ItemTypeRegistry,\n): { normalized: Record<string, string> | undefined; errors: string[] } {\n const typeDefinition = resolveTypeDefinition(typeName, registry);\n if (!typeDefinition) {\n return {\n normalized: undefined,\n errors: [`Unknown type \"${typeName}\"`],\n };\n }\n const errors: string[] = [];\n const optionByAlias = new Map<string, ItemTypeOptionDefinition>();\n for (const option of typeDefinition.options) {\n optionByAlias.set(option.key.toLowerCase(), option);\n for (const alias of option.aliases ?? []) {\n optionByAlias.set(alias.toLowerCase(), option);\n }\n }\n\n const normalized: Record<string, string> = {};\n for (const [rawKey, rawValue] of Object.entries(rawTypeOptions ?? {})) {\n const trimmedKey = rawKey.trim();\n const trimmedValue = rawValue.trim();\n if (trimmedKey.length === 0) {\n errors.push(\"type option keys must not be empty\");\n continue;\n }\n if (trimmedValue.length === 0) {\n errors.push(`type option \"${trimmedKey}\" must not be empty`);\n continue;\n }\n const optionDefinition = optionByAlias.get(trimmedKey.toLowerCase());\n if (!optionDefinition) {\n const allowed = typeDefinition.options.map((option) => option.key).join(\", \");\n errors.push(\n typeDefinition.options.length > 0\n ? `Unknown type option \"${trimmedKey}\" for type \"${typeDefinition.name}\". Allowed: ${allowed}`\n : `Type \"${typeDefinition.name}\" does not define any configurable type options`,\n );\n continue;\n }\n const allowedValues = optionDefinition.values;\n let resolvedValue = trimmedValue;\n if (allowedValues.length > 0) {\n const valueLookup = new Map(allowedValues.map((value) => [value.toLowerCase(), value]));\n const canonical = valueLookup.get(trimmedValue.toLowerCase());\n if (!canonical) {\n errors.push(\n `Invalid value \"${trimmedValue}\" for type option \"${optionDefinition.key}\". Allowed: ${allowedValues.join(\", \")}`,\n );\n continue;\n }\n resolvedValue = canonical;\n }\n normalized[optionDefinition.key] = resolvedValue;\n }\n\n for (const option of typeDefinition.options) {\n if (option.required && !(option.key in normalized)) {\n errors.push(`Missing required type option \"${option.key}\" for type \"${typeDefinition.name}\"`);\n }\n }\n\n const sortedKeys = Object.keys(normalized).sort((left, right) => left.localeCompare(right));\n if (sortedKeys.length === 0) {\n return {\n normalized: undefined,\n errors,\n };\n }\n return {\n normalized: Object.fromEntries(sortedKeys.map((key) => [key, normalized[key]])),\n errors,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAeO,IAAM,iCAAiC;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGK,IAAM,sCAAsC,CAAC,OAAO,WAAW,QAAQ,YAAY,QAAQ,QAAQ,KAAK;AAI/G,IAAM,6BAA6B;EACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,IAAM,6BAA6B;EACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,IAAM,gCAAwD;EAC5D,gBAAgB;EAChB,cAAc;EACd,qBAAqB;EACrB,mBAAmB;EACnB,UAAU;EACV,uBAAuB;EACvB,qBAAqB;EACrB,IAAI;EACJ,uBAAuB;EACvB,qBAAqB;EACrB,MAAM;EACN,WAAW;EACX,SAAS;EACT,cAAc;EACd,YAAY;EACZ,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,cAAc;EACd,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,iBAAiB;EACjB,iBAAiB;EACjB,eAAe;EACf,oBAAoB;EACpB,kBAAkB;EAClB,iBAAiB;EACjB,eAAe;EACf,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,aAAa;EACb,cAAc;;AAGhB,IAAM,gCAAwD;EAC5D,GAAG;;AAGL,IAAM,gCAAwD;EAC5D,GAA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,KACL,kBAAkB,YAAY,sBAAsB,iBAAiB,GAAG,eAAe,cAAc,KAAK,IAAI,CAAC,EAAE;AAEnH;MACF;AACA,sBAAgB;IAClB;AACA,eAAW,iBAAiB,GAAG,IAAI;EACrC;AAEA,aAAW,UAAU,eAAe,SAAS;AAC3C,QAAI,OAAO,YAAY,EAAE,OAAO,OAAO,aAAa;AAClD,aAAO,KAAK,iCAAiC,OAAO,GAAG,eAAe,eAAe,IAAI,GAAG;IAC9F;EACF;AAEA,QAAM,aAAa,OAAO,KAAK,UAAU,EAAE,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AAC1F,MAAI,WAAW,WAAW,GAAG;AAC3B,WAAO;MACL,YAAY;MACZ;;EAEJ;AACA,SAAO;IACL,YAAY,OAAO,YAAY,WAAW,IAAI,CAAC,QAAQ,CAAC,KAAK,WAAW,GAAG,CAAC,CAAC,CAAC;IAC9E;;AAEJ","debugId":"504f2618-801b-5331-a3a6-ff97713cf336"}
|
|
@@ -0,0 +1,540 @@
|
|
|
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]="50104455-b180-5239-87c7-308e9abf62a2")}catch(e){}}();
|
|
3
|
+
import {
|
|
4
|
+
resolveAuthor
|
|
5
|
+
} from "./chunk-J27KIHTG.js";
|
|
6
|
+
import {
|
|
7
|
+
readHistoryEntries
|
|
8
|
+
} from "./chunk-V3JQ4IPL.js";
|
|
9
|
+
import {
|
|
10
|
+
EMPTY_REPLAY_DOCUMENT,
|
|
11
|
+
historyEntriesToRaw,
|
|
12
|
+
replayHash,
|
|
13
|
+
replayToItemDocument,
|
|
14
|
+
tryApplyReplayPatch,
|
|
15
|
+
verifyHistoryChain
|
|
16
|
+
} from "./chunk-ASQM3IF5.js";
|
|
17
|
+
import {
|
|
18
|
+
acquireLock,
|
|
19
|
+
createHistoryEntry,
|
|
20
|
+
locateItem,
|
|
21
|
+
readLocatedItem
|
|
22
|
+
} from "./chunk-CWT53EYT.js";
|
|
23
|
+
import {
|
|
24
|
+
normalizeItemId,
|
|
25
|
+
normalizeRawItemId
|
|
26
|
+
} from "./chunk-SSFMJCPF.js";
|
|
27
|
+
import {
|
|
28
|
+
canonicalDocument,
|
|
29
|
+
serializeItemDocument
|
|
30
|
+
} from "./chunk-KBG47ZOY.js";
|
|
31
|
+
import {
|
|
32
|
+
resolveItemTypeRegistry
|
|
33
|
+
} from "./chunk-SZQCER6S.js";
|
|
34
|
+
import {
|
|
35
|
+
nowIso
|
|
36
|
+
} from "./chunk-NQP3ECKF.js";
|
|
37
|
+
import {
|
|
38
|
+
EXIT_CODE,
|
|
39
|
+
PmCliError,
|
|
40
|
+
getActiveExtensionRegistrations,
|
|
41
|
+
getHistoryPath,
|
|
42
|
+
getItemPath,
|
|
43
|
+
getSettingsPath,
|
|
44
|
+
pathExists,
|
|
45
|
+
readFileIfExists,
|
|
46
|
+
readSettings,
|
|
47
|
+
resolveGovernanceKnobs,
|
|
48
|
+
resolvePmRoot,
|
|
49
|
+
runActiveOnWriteHooks,
|
|
50
|
+
writeFileAtomic
|
|
51
|
+
} from "./chunk-4LTBNUYT.js";
|
|
52
|
+
|
|
53
|
+
// dist/cli/commands/history-redact.js
|
|
54
|
+
import fs from "node:fs/promises";
|
|
55
|
+
|
|
56
|
+
// dist/core/history/history-rewrite.js
|
|
57
|
+
function checkHistoryRewriteOwnership(params) {
|
|
58
|
+
if (!params.itemDocument)
|
|
59
|
+
return [];
|
|
60
|
+
const assigned = params.itemDocument.metadata?.assignee?.trim();
|
|
61
|
+
if (!assigned || assigned === params.author || params.force)
|
|
62
|
+
return [];
|
|
63
|
+
const governance = resolveGovernanceKnobs(params.settings);
|
|
64
|
+
if (governance.ownership_enforcement === "strict") {
|
|
65
|
+
throw new PmCliError(`Item ${params.subjectId} is assigned to ${assigned}. Use --force to override.`, EXIT_CODE.CONFLICT);
|
|
66
|
+
}
|
|
67
|
+
if (governance.ownership_enforcement === "warn") {
|
|
68
|
+
return [`ownership_warning:assignee_conflict:${params.subjectId}:${assigned}`];
|
|
69
|
+
}
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
async function verifyHistoryRewriteNoDrift(params) {
|
|
73
|
+
const historyRawUnderLock = await readFileIfExists(params.subject.historyPath);
|
|
74
|
+
if (historyRawUnderLock !== params.historyRawBeforeLock) {
|
|
75
|
+
throw new PmCliError(`History for ${params.subject.id} changed while waiting for lock; retry ${params.operation}.`, EXIT_CODE.CONFLICT);
|
|
76
|
+
}
|
|
77
|
+
const locatedUnderLock = await locateItem(params.pmRoot, params.subject.id, params.settings.id_prefix, params.settings.item_format, params.typeRegistry.type_to_folder);
|
|
78
|
+
const loadedItemUnderLock = locatedUnderLock ? await readLocatedItem(locatedUnderLock, { schema: params.settings.schema }) : null;
|
|
79
|
+
if ((loadedItemUnderLock?.raw ?? null) !== (params.currentItemRawBeforeLock ?? null)) {
|
|
80
|
+
throw new PmCliError(`Item ${params.subject.id} changed while waiting for lock; retry ${params.operation}.`, EXIT_CODE.CONFLICT);
|
|
81
|
+
}
|
|
82
|
+
return { historyRawUnderLock, locatedUnderLock, loadedItemUnderLock };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// dist/cli/commands/history-redact.js
|
|
86
|
+
function normalizeStringArrayInput(value) {
|
|
87
|
+
if (Array.isArray(value)) {
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
if (typeof value === "string") {
|
|
91
|
+
return [value];
|
|
92
|
+
}
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
function normalizeRegexFlags(flags) {
|
|
96
|
+
const unique = [];
|
|
97
|
+
for (const token of flags) {
|
|
98
|
+
if (!unique.includes(token)) {
|
|
99
|
+
unique.push(token);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (!unique.includes("g")) {
|
|
103
|
+
unique.push("g");
|
|
104
|
+
}
|
|
105
|
+
return unique.join("");
|
|
106
|
+
}
|
|
107
|
+
function parseRegexRule(spec) {
|
|
108
|
+
const trimmed = spec.trim();
|
|
109
|
+
if (trimmed.length === 0) {
|
|
110
|
+
throw new PmCliError("history-redact --regex requires a non-empty pattern.", EXIT_CODE.USAGE);
|
|
111
|
+
}
|
|
112
|
+
let source = trimmed;
|
|
113
|
+
let flags = "g";
|
|
114
|
+
if (trimmed.startsWith("/") && trimmed.length > 1) {
|
|
115
|
+
const slashIndex = trimmed.lastIndexOf("/");
|
|
116
|
+
if (slashIndex > 0) {
|
|
117
|
+
source = trimmed.slice(1, slashIndex);
|
|
118
|
+
flags = normalizeRegexFlags(trimmed.slice(slashIndex + 1));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (source.length === 0) {
|
|
122
|
+
throw new PmCliError("history-redact --regex cannot use an empty pattern.", EXIT_CODE.USAGE);
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
new RegExp(source, flags);
|
|
126
|
+
} catch (error) {
|
|
127
|
+
throw new PmCliError(`Invalid --regex value "${spec}": ${error instanceof Error ? error.message : String(error)}`, EXIT_CODE.USAGE);
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
kind: "regex",
|
|
131
|
+
source,
|
|
132
|
+
flags,
|
|
133
|
+
label: `/${source}/${flags}`
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function buildRedactionRules(literalInput, regexInput) {
|
|
137
|
+
const literalRules = [...new Set(normalizeStringArrayInput(literalInput).map((entry) => entry.trim()))].filter((entry) => entry.length > 0).map((entry) => ({
|
|
138
|
+
kind: "literal",
|
|
139
|
+
value: entry,
|
|
140
|
+
label: entry
|
|
141
|
+
}));
|
|
142
|
+
const regexRules = [...new Set(normalizeStringArrayInput(regexInput).map((entry) => entry.trim()))].filter((entry) => entry.length > 0).map(parseRegexRule);
|
|
143
|
+
const rules = [...literalRules, ...regexRules];
|
|
144
|
+
if (rules.length === 0) {
|
|
145
|
+
throw new PmCliError("history-redact requires at least one matcher via --literal or --regex.", EXIT_CODE.USAGE, {
|
|
146
|
+
code: "missing_required_argument",
|
|
147
|
+
required: "Provide --literal <value> and/or --regex <pattern>.",
|
|
148
|
+
examples: [
|
|
149
|
+
'pm history-redact pm-a1b2 --literal "[redacted_path_prefix]/private"',
|
|
150
|
+
'pm history-redact pm-a1b2 --regex "/192\\\\.168\\\\.[0-9.]+/g" --replacement "[scrubbed_ip]"'
|
|
151
|
+
]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return rules;
|
|
155
|
+
}
|
|
156
|
+
function applyLiteralRule(value, literal, replacement) {
|
|
157
|
+
if (literal.length === 0) {
|
|
158
|
+
return { value, replacements: 0 };
|
|
159
|
+
}
|
|
160
|
+
let cursor = 0;
|
|
161
|
+
let replacements = 0;
|
|
162
|
+
while (cursor <= value.length) {
|
|
163
|
+
const index = value.indexOf(literal, cursor);
|
|
164
|
+
if (index === -1) {
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
replacements += 1;
|
|
168
|
+
cursor = index + Math.max(1, literal.length);
|
|
169
|
+
}
|
|
170
|
+
if (replacements === 0) {
|
|
171
|
+
return { value, replacements: 0 };
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
value: value.split(literal).join(replacement),
|
|
175
|
+
replacements
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function applyRegexRule(value, rule, replacement) {
|
|
179
|
+
const regex = new RegExp(rule.source, rule.flags);
|
|
180
|
+
const matches = [...value.matchAll(regex)];
|
|
181
|
+
if (matches.length === 0) {
|
|
182
|
+
return { value, replacements: 0 };
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
value: value.replace(regex, replacement),
|
|
186
|
+
replacements: matches.length
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function redactStringValue(value, rules, replacement) {
|
|
190
|
+
let next = value;
|
|
191
|
+
let replacements = 0;
|
|
192
|
+
for (const rule of rules) {
|
|
193
|
+
const result = rule.kind === "literal" ? applyLiteralRule(next, rule.value, replacement) : applyRegexRule(next, rule, replacement);
|
|
194
|
+
next = result.value;
|
|
195
|
+
replacements += result.replacements;
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
value: next,
|
|
199
|
+
replacements
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function redactUnknownValue(value, rules, replacement) {
|
|
203
|
+
if (typeof value === "string") {
|
|
204
|
+
return redactStringValue(value, rules, replacement);
|
|
205
|
+
}
|
|
206
|
+
if (Array.isArray(value)) {
|
|
207
|
+
let replacements = 0;
|
|
208
|
+
const nextValues = value.map((entry) => {
|
|
209
|
+
const redacted = redactUnknownValue(entry, rules, replacement);
|
|
210
|
+
replacements += redacted.replacements;
|
|
211
|
+
return redacted.value;
|
|
212
|
+
});
|
|
213
|
+
return {
|
|
214
|
+
value: nextValues,
|
|
215
|
+
replacements
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
if (typeof value === "object" && value !== null) {
|
|
219
|
+
let replacements = 0;
|
|
220
|
+
const nextRecord = {};
|
|
221
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
222
|
+
const redacted = redactUnknownValue(entry, rules, replacement);
|
|
223
|
+
replacements += redacted.replacements;
|
|
224
|
+
nextRecord[key] = redacted.value;
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
value: nextRecord,
|
|
228
|
+
replacements
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
value,
|
|
233
|
+
replacements: 0
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function applyHistoryPatch(current, patch, entryNumber, op) {
|
|
237
|
+
const result = tryApplyReplayPatch(current, patch);
|
|
238
|
+
if (!result.ok) {
|
|
239
|
+
throw new PmCliError(`history-redact failed to apply patch at entry ${entryNumber} (op=${op}): ${result.error instanceof Error ? result.error.message : String(result.error)}`, EXIT_CODE.GENERIC_FAILURE);
|
|
240
|
+
}
|
|
241
|
+
return result.document;
|
|
242
|
+
}
|
|
243
|
+
function inspectHistoryIntegrity(entries) {
|
|
244
|
+
let replay = structuredClone(EMPTY_REPLAY_DOCUMENT);
|
|
245
|
+
let hashMismatchesBefore = 0;
|
|
246
|
+
let hashMismatchesAfter = 0;
|
|
247
|
+
for (let index = 0; index < entries.length; index += 1) {
|
|
248
|
+
const entry = entries[index];
|
|
249
|
+
if (replayHash(replay) !== entry.before_hash) {
|
|
250
|
+
hashMismatchesBefore += 1;
|
|
251
|
+
}
|
|
252
|
+
replay = applyHistoryPatch(replay, entry.patch, index + 1, entry.op);
|
|
253
|
+
if (replayHash(replay) !== entry.after_hash) {
|
|
254
|
+
hashMismatchesAfter += 1;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return {
|
|
258
|
+
hashMismatchesBefore,
|
|
259
|
+
hashMismatchesAfter,
|
|
260
|
+
finalDocument: replay
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function redactHistoryEntry(entry, rules, replacement) {
|
|
264
|
+
let replacements = 0;
|
|
265
|
+
let changed = false;
|
|
266
|
+
let nextMessage = entry.message;
|
|
267
|
+
if (typeof entry.message === "string") {
|
|
268
|
+
const redactedMessage = redactStringValue(entry.message, rules, replacement);
|
|
269
|
+
nextMessage = redactedMessage.value;
|
|
270
|
+
replacements += redactedMessage.replacements;
|
|
271
|
+
if (redactedMessage.replacements > 0) {
|
|
272
|
+
changed = true;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
const nextPatch = entry.patch.map((operation) => {
|
|
276
|
+
if (!Object.prototype.hasOwnProperty.call(operation, "value")) {
|
|
277
|
+
return operation;
|
|
278
|
+
}
|
|
279
|
+
const redactedValue = redactUnknownValue(operation.value, rules, replacement);
|
|
280
|
+
replacements += redactedValue.replacements;
|
|
281
|
+
if (redactedValue.replacements > 0) {
|
|
282
|
+
changed = true;
|
|
283
|
+
return {
|
|
284
|
+
...operation,
|
|
285
|
+
value: redactedValue.value
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
return operation;
|
|
289
|
+
});
|
|
290
|
+
return {
|
|
291
|
+
entry: {
|
|
292
|
+
...entry,
|
|
293
|
+
message: nextMessage,
|
|
294
|
+
patch: nextPatch
|
|
295
|
+
},
|
|
296
|
+
replacements,
|
|
297
|
+
changed
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
function rewriteHistoryEntries(entries, rules, replacement) {
|
|
301
|
+
let replay = structuredClone(EMPTY_REPLAY_DOCUMENT);
|
|
302
|
+
let entriesChanged = 0;
|
|
303
|
+
let replacements = 0;
|
|
304
|
+
const rewrittenEntries = [];
|
|
305
|
+
for (let index = 0; index < entries.length; index += 1) {
|
|
306
|
+
const redacted = redactHistoryEntry(entries[index], rules, replacement);
|
|
307
|
+
replacements += redacted.replacements;
|
|
308
|
+
if (redacted.changed) {
|
|
309
|
+
entriesChanged += 1;
|
|
310
|
+
}
|
|
311
|
+
const beforeHash = replayHash(replay);
|
|
312
|
+
replay = applyHistoryPatch(replay, redacted.entry.patch, index + 1, redacted.entry.op);
|
|
313
|
+
const afterHash = replayHash(replay);
|
|
314
|
+
rewrittenEntries.push({
|
|
315
|
+
...redacted.entry,
|
|
316
|
+
before_hash: beforeHash,
|
|
317
|
+
after_hash: afterHash
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
return {
|
|
321
|
+
entries: rewrittenEntries,
|
|
322
|
+
finalDocument: replay,
|
|
323
|
+
entriesChanged,
|
|
324
|
+
replacements
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function hasItemMetadata(replay) {
|
|
328
|
+
return Object.keys(replay.metadata).length > 0;
|
|
329
|
+
}
|
|
330
|
+
async function resolveHistorySubject(pmRoot, id, settings, typeToFolder) {
|
|
331
|
+
const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeToFolder);
|
|
332
|
+
if (located) {
|
|
333
|
+
return {
|
|
334
|
+
id: located.id,
|
|
335
|
+
historyPath: getHistoryPath(pmRoot, located.id),
|
|
336
|
+
located
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
const normalizedId = normalizeItemId(id, settings.id_prefix);
|
|
340
|
+
const rawNormalizedId = normalizeRawItemId(id);
|
|
341
|
+
const candidateIds = normalizedId === rawNormalizedId ? [normalizedId] : [normalizedId, rawNormalizedId];
|
|
342
|
+
for (const candidateId of candidateIds) {
|
|
343
|
+
const historyPath = getHistoryPath(pmRoot, candidateId);
|
|
344
|
+
if (await pathExists(historyPath)) {
|
|
345
|
+
return {
|
|
346
|
+
id: candidateId,
|
|
347
|
+
historyPath,
|
|
348
|
+
located: null
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);
|
|
353
|
+
}
|
|
354
|
+
async function runHistoryRedact(id, options, global) {
|
|
355
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
356
|
+
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
357
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
358
|
+
}
|
|
359
|
+
const settings = await readSettings(pmRoot);
|
|
360
|
+
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
361
|
+
const replacement = typeof options.replacement === "string" && options.replacement.length > 0 ? options.replacement : "[redacted]";
|
|
362
|
+
const rules = buildRedactionRules(options.literal, options.regex);
|
|
363
|
+
const subject = await resolveHistorySubject(pmRoot, id, settings, typeRegistry.type_to_folder);
|
|
364
|
+
if (!await pathExists(subject.historyPath)) {
|
|
365
|
+
throw new PmCliError(`No history stream exists for ${subject.id}.`, EXIT_CODE.NOT_FOUND);
|
|
366
|
+
}
|
|
367
|
+
const historyRawBeforeLock = await readFileIfExists(subject.historyPath);
|
|
368
|
+
const historyEntries = await readHistoryEntries(subject.historyPath, subject.id);
|
|
369
|
+
if (historyEntries.length === 0) {
|
|
370
|
+
throw new PmCliError(`No history entries exist for ${subject.id}; nothing to redact.`, EXIT_CODE.USAGE);
|
|
371
|
+
}
|
|
372
|
+
const integritySnapshot = inspectHistoryIntegrity(historyEntries);
|
|
373
|
+
const rewritten = rewriteHistoryEntries(historyEntries, rules, replacement);
|
|
374
|
+
const preexistingHashMismatches = integritySnapshot.hashMismatchesBefore + integritySnapshot.hashMismatchesAfter;
|
|
375
|
+
const dryRun = Boolean(options.dryRun);
|
|
376
|
+
const changed = rewritten.replacements > 0;
|
|
377
|
+
const warnings = [];
|
|
378
|
+
if (preexistingHashMismatches > 0) {
|
|
379
|
+
warnings.push(`history_redact_preexisting_hash_mismatches:${preexistingHashMismatches}`);
|
|
380
|
+
}
|
|
381
|
+
if (!changed) {
|
|
382
|
+
warnings.push("history_redact_no_matches");
|
|
383
|
+
}
|
|
384
|
+
let currentItemRaw = null;
|
|
385
|
+
let currentItemPath = subject.located?.itemPath ?? null;
|
|
386
|
+
let currentItemDocument = null;
|
|
387
|
+
if (subject.located) {
|
|
388
|
+
const loaded = await readLocatedItem(subject.located, { schema: settings.schema });
|
|
389
|
+
currentItemRaw = loaded.raw;
|
|
390
|
+
currentItemDocument = loaded.document;
|
|
391
|
+
}
|
|
392
|
+
let nextItemPath = null;
|
|
393
|
+
let nextItemRaw = null;
|
|
394
|
+
let nextItemDocument = null;
|
|
395
|
+
if (hasItemMetadata(rewritten.finalDocument)) {
|
|
396
|
+
const canonical = canonicalDocument(replayToItemDocument(rewritten.finalDocument), { schema: settings.schema });
|
|
397
|
+
if (canonical.metadata.id !== subject.id) {
|
|
398
|
+
throw new PmCliError(`history-redact would change item id from ${subject.id} to ${canonical.metadata.id}; narrow your patterns.`, EXIT_CODE.USAGE);
|
|
399
|
+
}
|
|
400
|
+
nextItemDocument = canonical;
|
|
401
|
+
nextItemPath = getItemPath(pmRoot, canonical.metadata.type, subject.id, "toon", typeRegistry.type_to_folder);
|
|
402
|
+
nextItemRaw = serializeItemDocument(canonical, {
|
|
403
|
+
format: "toon",
|
|
404
|
+
schema: settings.schema
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
const itemChanged = (currentItemPath ?? null) !== (nextItemPath ?? null) || (currentItemRaw ?? null) !== (nextItemRaw ?? null);
|
|
408
|
+
const author = resolveAuthor(options.author, settings.author_default);
|
|
409
|
+
const redactionMessage = typeof options.message === "string" && options.message.trim().length > 0 ? options.message : `history-redact replaced ${rewritten.replacements} match(es) across ${rewritten.entriesChanged} entr${rewritten.entriesChanged === 1 ? "y" : "ies"}.`;
|
|
410
|
+
const rewrittenEntries = [...rewritten.entries];
|
|
411
|
+
let auditEntryAdded = false;
|
|
412
|
+
if (!dryRun && changed) {
|
|
413
|
+
const finalDocument = nextItemDocument ?? replayToItemDocument(rewritten.finalDocument);
|
|
414
|
+
rewrittenEntries.push(createHistoryEntry({
|
|
415
|
+
nowIso: nowIso(),
|
|
416
|
+
author,
|
|
417
|
+
op: "history_redact",
|
|
418
|
+
before: finalDocument,
|
|
419
|
+
after: finalDocument,
|
|
420
|
+
message: redactionMessage
|
|
421
|
+
}));
|
|
422
|
+
auditEntryAdded = true;
|
|
423
|
+
}
|
|
424
|
+
const historyVerify = verifyHistoryChain(rewrittenEntries);
|
|
425
|
+
if (!historyVerify.ok) {
|
|
426
|
+
throw new PmCliError(`history-redact produced an invalid rewritten chain (${historyVerify.errors.join(", ")}).`, EXIT_CODE.GENERIC_FAILURE);
|
|
427
|
+
}
|
|
428
|
+
if (!dryRun && changed) {
|
|
429
|
+
warnings.push(...checkHistoryRewriteOwnership({
|
|
430
|
+
itemDocument: currentItemDocument,
|
|
431
|
+
subjectId: subject.id,
|
|
432
|
+
author,
|
|
433
|
+
force: options.force,
|
|
434
|
+
settings
|
|
435
|
+
}));
|
|
436
|
+
const releaseLock = await acquireLock(pmRoot, subject.id, settings.locks.ttl_seconds, author, Boolean(options.force), settings.governance.force_required_for_stale_lock);
|
|
437
|
+
try {
|
|
438
|
+
const { historyRawUnderLock } = await verifyHistoryRewriteNoDrift({
|
|
439
|
+
pmRoot,
|
|
440
|
+
subject,
|
|
441
|
+
settings,
|
|
442
|
+
typeRegistry,
|
|
443
|
+
historyRawBeforeLock,
|
|
444
|
+
currentItemRawBeforeLock: currentItemRaw,
|
|
445
|
+
operation: "history-redact"
|
|
446
|
+
});
|
|
447
|
+
const affectedItemPaths = /* @__PURE__ */ new Set();
|
|
448
|
+
if (currentItemPath) {
|
|
449
|
+
affectedItemPaths.add(currentItemPath);
|
|
450
|
+
}
|
|
451
|
+
if (nextItemPath) {
|
|
452
|
+
affectedItemPaths.add(nextItemPath);
|
|
453
|
+
}
|
|
454
|
+
const itemSnapshots = /* @__PURE__ */ new Map();
|
|
455
|
+
if (currentItemPath && currentItemRaw !== null) {
|
|
456
|
+
itemSnapshots.set(currentItemPath, currentItemRaw);
|
|
457
|
+
}
|
|
458
|
+
try {
|
|
459
|
+
if (nextItemPath && nextItemRaw !== null && nextItemRaw !== currentItemRaw) {
|
|
460
|
+
await writeFileAtomic(nextItemPath, nextItemRaw);
|
|
461
|
+
}
|
|
462
|
+
if (currentItemPath && (!nextItemPath || nextItemPath !== currentItemPath)) {
|
|
463
|
+
await fs.rm(currentItemPath, { force: true });
|
|
464
|
+
}
|
|
465
|
+
await writeFileAtomic(subject.historyPath, historyEntriesToRaw(rewrittenEntries));
|
|
466
|
+
} catch (error) {
|
|
467
|
+
if (historyRawUnderLock === null) {
|
|
468
|
+
await fs.rm(subject.historyPath, { force: true });
|
|
469
|
+
} else {
|
|
470
|
+
await writeFileAtomic(subject.historyPath, historyRawUnderLock);
|
|
471
|
+
}
|
|
472
|
+
for (const itemPath of affectedItemPaths) {
|
|
473
|
+
const snapshot = itemSnapshots.get(itemPath);
|
|
474
|
+
if (snapshot === void 0) {
|
|
475
|
+
await fs.rm(itemPath, { force: true });
|
|
476
|
+
} else {
|
|
477
|
+
await writeFileAtomic(itemPath, snapshot);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
throw error;
|
|
481
|
+
}
|
|
482
|
+
const itemHookPath = nextItemPath ?? currentItemPath;
|
|
483
|
+
if (itemHookPath) {
|
|
484
|
+
warnings.push(...await runActiveOnWriteHooks({
|
|
485
|
+
path: itemHookPath,
|
|
486
|
+
scope: "project",
|
|
487
|
+
op: "history_redact"
|
|
488
|
+
}));
|
|
489
|
+
}
|
|
490
|
+
warnings.push(...await runActiveOnWriteHooks({
|
|
491
|
+
path: subject.historyPath,
|
|
492
|
+
scope: "project",
|
|
493
|
+
op: "history_redact:history"
|
|
494
|
+
}));
|
|
495
|
+
} finally {
|
|
496
|
+
await releaseLock();
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return {
|
|
500
|
+
id: subject.id,
|
|
501
|
+
dry_run: dryRun,
|
|
502
|
+
changed,
|
|
503
|
+
patterns: {
|
|
504
|
+
literals: rules.filter((rule) => rule.kind === "literal").map((rule) => rule.value),
|
|
505
|
+
regex: rules.filter((rule) => rule.kind === "regex").map((rule) => `/${rule.source}/${rule.flags}`),
|
|
506
|
+
replacement
|
|
507
|
+
},
|
|
508
|
+
history: {
|
|
509
|
+
path: subject.historyPath,
|
|
510
|
+
entries_scanned: historyEntries.length,
|
|
511
|
+
entries_changed: rewritten.entriesChanged,
|
|
512
|
+
replacements: rewritten.replacements,
|
|
513
|
+
hash_mismatches_before: integritySnapshot.hashMismatchesBefore,
|
|
514
|
+
hash_mismatches_after: integritySnapshot.hashMismatchesAfter,
|
|
515
|
+
preexisting_hash_mismatches: preexistingHashMismatches,
|
|
516
|
+
audit_entry_added: auditEntryAdded,
|
|
517
|
+
verify_ok: historyVerify.ok,
|
|
518
|
+
verify_errors: historyVerify.errors
|
|
519
|
+
},
|
|
520
|
+
item: {
|
|
521
|
+
existed_before: currentItemPath !== null,
|
|
522
|
+
exists_after: nextItemPath !== null,
|
|
523
|
+
path_before: currentItemPath,
|
|
524
|
+
path_after: nextItemPath,
|
|
525
|
+
changed: itemChanged
|
|
526
|
+
},
|
|
527
|
+
warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
|
|
528
|
+
generated_at: nowIso()
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
export {
|
|
533
|
+
checkHistoryRewriteOwnership,
|
|
534
|
+
verifyHistoryRewriteNoDrift,
|
|
535
|
+
resolveHistorySubject,
|
|
536
|
+
runHistoryRedact
|
|
537
|
+
};
|
|
538
|
+
//# sourceMappingURL=chunk-T2ORWB6D.js.map
|
|
539
|
+
|
|
540
|
+
//# debugId=50104455-b180-5239-87c7-308e9abf62a2
|