@unbrained/pm-cli 2026.5.31 → 2026.6.6
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 +167 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +12 -4
- 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 +17 -3
- 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 +260 -32
- 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 +193 -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 +77 -114
- 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/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/gc.d.ts +8 -1
- package/dist/cli/commands/gc.js +26 -3
- package/dist/cli/commands/gc.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 +51 -3
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.d.ts +4 -1
- package/dist/cli/commands/history.js +12 -24
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -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 +163 -47
- 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 +1 -0
- package/dist/cli/commands/search.js +18 -4
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +8 -1
- package/dist/cli/commands/stats.js +18 -17
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +8 -0
- package/dist/cli/commands/telemetry.js +253 -0
- package/dist/cli/commands/telemetry.js.map +1 -0
- 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 +91 -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 +14 -5
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +200 -28
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +31 -6
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +4 -2
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +31 -4
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +16 -0
- package/dist/cli-bundle/chunks/activity-JM6DTDND.js +20 -0
- package/dist/cli-bundle/chunks/activity-JM6DTDND.js.map +1 -0
- package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js +206 -0
- package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js → aggregate-VNAHUNNF.js} +11 -11
- package/dist/cli-bundle/chunks/{append-JD2DETU7.js → append-7H5N64R2.js} +8 -9
- package/dist/cli-bundle/chunks/{append-JD2DETU7.js.map → append-7H5N64R2.js.map} +1 -1
- package/dist/cli-bundle/chunks/append-WMKRXKCE.js +69 -0
- package/dist/cli-bundle/chunks/append-WMKRXKCE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3M73P3G6.js → chunk-23YFZ3IG.js} +210 -132
- package/dist/cli-bundle/chunks/chunk-23YFZ3IG.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js +128 -0
- package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js +266 -0
- package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js +631 -0
- package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js +380 -0
- package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js +1664 -0
- package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6HT2F4TK.js → chunk-3FI4SEFT.js} +175 -54
- package/dist/cli-bundle/chunks/chunk-3FI4SEFT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JULRTHJQ.js → chunk-3LB74A67.js} +119 -6
- package/dist/cli-bundle/chunks/chunk-3LB74A67.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js +57 -0
- package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js +1832 -0
- package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js +422 -0
- package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js +412 -0
- package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js +5622 -0
- package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-U7FMKRXH.js → chunk-6ER6DXH5.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-6ER6DXH5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js +218 -0
- package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-77GFDHGF.js +80 -0
- package/dist/cli-bundle/chunks/chunk-77GFDHGF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MD7K4JYF.js → chunk-AO442XLN.js} +26 -15
- package/dist/cli-bundle/chunks/chunk-AO442XLN.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-AY43SBIN.js +751 -0
- package/dist/cli-bundle/chunks/chunk-AY43SBIN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js → chunk-BQHUILZS.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js +242 -0
- package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OGZEG5TT.js → chunk-ECCMVXGM.js} +164 -53
- package/dist/cli-bundle/chunks/chunk-ECCMVXGM.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js +182 -0
- package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GCOQW437.js +130 -0
- package/dist/cli-bundle/chunks/chunk-GCOQW437.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js +1340 -0
- package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js → chunk-GU2ZJ2VV.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js +231 -0
- package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-HZGUAH22.js +76 -0
- package/dist/cli-bundle/chunks/chunk-HZGUAH22.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js +346 -0
- package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js +140 -0
- package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JTWRXG4B.js → chunk-IJGCZSIQ.js} +251 -251
- package/dist/cli-bundle/chunks/chunk-IJGCZSIQ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js +1491 -0
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +1 -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-AKOOMO3T.js → chunk-KAG77BY3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js → chunk-KJ33AOCY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WDPXDQFG.js → chunk-KJE2FOS4.js} +6 -4
- package/dist/cli-bundle/chunks/chunk-KJE2FOS4.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js +3883 -0
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js +1325 -0
- package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5HSEP75M.js → chunk-LCM63IXU.js} +18 -6
- package/dist/cli-bundle/chunks/chunk-LCM63IXU.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-ME2YH6FN.js +182 -0
- package/dist/cli-bundle/chunks/chunk-ME2YH6FN.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-MITFDD35.js +1809 -0
- package/dist/cli-bundle/chunks/chunk-MITFDD35.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js → chunk-N7ACFE26.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js +332 -0
- package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7Y53ZJIQ.js → chunk-OVQCEJPG.js} +22 -3
- package/dist/cli-bundle/chunks/chunk-OVQCEJPG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PXUAZUUY.js → chunk-OZ7NSQHL.js} +12 -11
- package/dist/cli-bundle/chunks/chunk-OZ7NSQHL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-P53TN6IA.js → chunk-PDDFYW4X.js} +35 -8
- package/dist/cli-bundle/chunks/chunk-PDDFYW4X.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js → chunk-PIU6RSL3.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js.map → chunk-PIU6RSL3.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js +338 -0
- package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js → chunk-PRJCELV4.js} +108 -21
- package/dist/cli-bundle/chunks/chunk-PRJCELV4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GN7IJPCD.js → chunk-PROOHX4K.js} +332 -32
- package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FQE6XZDB.js → chunk-Q7SPNHLW.js} +54 -32
- package/dist/cli-bundle/chunks/chunk-Q7SPNHLW.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js → chunk-QO7EBBOM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js → chunk-R6UFP2GE.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js +154 -0
- package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-RZN6VURO.js +119 -0
- package/dist/cli-bundle/chunks/chunk-RZN6VURO.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js +1501 -0
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js → chunk-T3LC5LKB.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js +173 -0
- package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js +2988 -0
- package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LSXGH6NE.js → chunk-U5SXYXSY.js} +821 -200
- package/dist/cli-bundle/chunks/chunk-U5SXYXSY.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js +540 -0
- package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js → chunk-UM2GBHS4.js} +5 -4
- package/dist/cli-bundle/chunks/chunk-W7XABV4H.js +454 -0
- package/dist/cli-bundle/chunks/chunk-W7XABV4H.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js → chunk-WKY2IBOQ.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js +698 -0
- package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js +1704 -0
- package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js → chunk-XLTD2HN3.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-XSJCLN2R.js +131 -0
- package/dist/cli-bundle/chunks/chunk-XSJCLN2R.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-BUPWJ3IJ.js → chunk-XTGLRY2Y.js} +484 -49
- package/dist/cli-bundle/chunks/chunk-XTGLRY2Y.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js → chunk-YL2DJGYS.js} +7 -7
- package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js → claim-4DBF6RVG.js} +10 -11
- package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js.map → claim-4DBF6RVG.js.map} +1 -1
- package/dist/cli-bundle/chunks/claim-X2P4IB7J.js +129 -0
- package/dist/cli-bundle/chunks/claim-X2P4IB7J.js.map +1 -0
- package/dist/cli-bundle/chunks/close-3HDWDA3L.js +13 -0
- package/dist/cli-bundle/chunks/close-PTYFA45H.js +17 -0
- package/dist/cli-bundle/chunks/close-PTYFA45H.js.map +1 -0
- package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js +314 -0
- package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js.map +7 -0
- package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js +311 -0
- package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js.map +1 -0
- package/dist/cli-bundle/chunks/comments-OONGABK5.js +100 -0
- package/dist/cli-bundle/chunks/comments-OONGABK5.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js → comments-QKBYCWKD.js} +10 -11
- package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js.map → comments-QKBYCWKD.js.map} +1 -1
- package/dist/cli-bundle/chunks/config-6FXCQKIF.js +1671 -0
- package/dist/cli-bundle/chunks/config-6FXCQKIF.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-V3FZOKLI.js → config-U4RZ4CQB.js} +121 -10
- package/dist/cli-bundle/chunks/config-U4RZ4CQB.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js → context-FYYJGFWS.js} +32 -19
- package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js.map → context-FYYJGFWS.js.map} +2 -2
- package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js +1461 -0
- package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js.map +1 -0
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js +1278 -0
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-YLMH33VU.js → contracts-RFSPGVVJ.js} +198 -162
- package/dist/cli-bundle/chunks/contracts-RFSPGVVJ.js.map +7 -0
- package/dist/cli-bundle/chunks/create-I5L4EYYZ.js +31 -0
- package/dist/cli-bundle/chunks/create-I5L4EYYZ.js.map +1 -0
- package/dist/cli-bundle/chunks/create-JTZNCTQC.js +27 -0
- package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js +55 -0
- package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{delete-RHCTEORS.js → delete-VXUPH5RS.js} +7 -8
- package/dist/cli-bundle/chunks/{delete-RHCTEORS.js.map → delete-VXUPH5RS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js → deps-JSRRWC3Z.js} +7 -8
- package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js.map → deps-JSRRWC3Z.js.map} +1 -1
- package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js +225 -0
- package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js.map +1 -0
- package/dist/cli-bundle/chunks/docs-GJK6K4VP.js +31 -0
- package/dist/cli-bundle/chunks/docs-GJK6K4VP.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js → docs-WW4N3MBM.js} +9 -10
- package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js.map → docs-WW4N3MBM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js → extension-J7IBMFTD.js} +4 -5
- package/dist/cli-bundle/chunks/extension-VDY2U33M.js +28 -0
- package/dist/cli-bundle/chunks/extension-VDY2U33M.js.map +1 -0
- package/dist/cli-bundle/chunks/files-ISZJGILQ.js +282 -0
- package/dist/cli-bundle/chunks/files-ISZJGILQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-WVOX67PE.js → files-WKOD326U.js} +9 -10
- package/dist/cli-bundle/chunks/{files-WVOX67PE.js.map → files-WKOD326U.js.map} +1 -1
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js +362 -0
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +1 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js +372 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +7 -0
- package/dist/cli-bundle/chunks/get-RV37HT3G.js +194 -0
- package/dist/cli-bundle/chunks/get-RV37HT3G.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-LTK3HOCQ.js → get-WXU6WI5P.js} +16 -17
- package/dist/cli-bundle/chunks/get-WXU6WI5P.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-TCWL55KM.js → health-6L6EH4WR.js} +57 -16
- package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +7 -0
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js +1271 -0
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +1 -0
- package/dist/cli-bundle/chunks/history-2BA3T5AE.js +20 -0
- package/dist/cli-bundle/chunks/history-PKN67D5O.js +24 -0
- package/dist/cli-bundle/chunks/history-PKN67D5O.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +19 -0
- package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js +23 -0
- package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js → history-repair-HIBCBIKK.js} +12 -14
- package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js.map → history-repair-HIBCBIKK.js.map} +1 -1
- package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js +193 -0
- package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js.map +1 -0
- package/dist/cli-bundle/chunks/init-HIVSNX3O.js +16 -0
- package/dist/cli-bundle/chunks/init-P56QYWJF.js +20 -0
- package/dist/cli-bundle/chunks/init-P56QYWJF.js.map +1 -0
- package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js +44 -0
- package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js.map +1 -0
- package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js → learnings-MIXSESLK.js} +10 -11
- package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js.map → learnings-MIXSESLK.js.map} +1 -1
- package/dist/cli-bundle/chunks/list-FGOWQMSM.js +24 -0
- package/dist/cli-bundle/chunks/list-FGOWQMSM.js.map +1 -0
- package/dist/cli-bundle/chunks/list-MUSQNMTD.js +20 -0
- package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js → notes-4XVSH2AZ.js} +10 -11
- package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js.map → notes-4XVSH2AZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/notes-5UK3GEH2.js +44 -0
- package/dist/cli-bundle/chunks/notes-5UK3GEH2.js.map +1 -0
- package/dist/cli-bundle/chunks/plan-DUMBV3QB.js +1171 -0
- package/dist/cli-bundle/chunks/plan-DUMBV3QB.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-67AB2PLM.js → plan-SLMODHWX.js} +13 -14
- package/dist/cli-bundle/chunks/{plan-67AB2PLM.js.map → plan-SLMODHWX.js.map} +1 -1
- package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js +229 -0
- package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-UP3VRUFS.js → register-list-query-WST76HSQ.js} +26 -26
- package/dist/cli-bundle/chunks/register-list-query-WST76HSQ.js.map +7 -0
- package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js +813 -0
- package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-YWSBF545.js → register-mutation-OA675SOU.js} +154 -43
- package/dist/cli-bundle/chunks/register-mutation-OA675SOU.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js +383 -0
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-3BDTGSDH.js → register-operations-N3PMHXH5.js} +49 -37
- package/dist/cli-bundle/chunks/register-operations-N3PMHXH5.js.map +7 -0
- package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js +242 -0
- package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js → register-setup-ZHJI2DI3.js} +18 -19
- package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js.map → register-setup-ZHJI2DI3.js.map} +2 -2
- package/dist/cli-bundle/chunks/restore-D4RGNX33.js +17 -0
- package/dist/cli-bundle/chunks/restore-PBL6T5TW.js +21 -0
- package/dist/cli-bundle/chunks/restore-PBL6T5TW.js.map +1 -0
- package/dist/cli-bundle/chunks/schema-2NOO6NGB.js +780 -0
- package/dist/cli-bundle/chunks/schema-2NOO6NGB.js.map +7 -0
- package/dist/cli-bundle/chunks/schema-EBI4NLUO.js +770 -0
- package/dist/cli-bundle/chunks/schema-EBI4NLUO.js.map +1 -0
- package/dist/cli-bundle/chunks/search-JPUQTVCY.js +1127 -0
- package/dist/cli-bundle/chunks/search-JPUQTVCY.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-HENBL456.js → search-OA6JX27A.js} +25 -16
- package/dist/cli-bundle/chunks/search-OA6JX27A.js.map +7 -0
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js +202 -0
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js +212 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js +251 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js +248 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js.map +1 -0
- package/dist/cli-bundle/chunks/test-MXX3E5JL.js +31 -0
- package/dist/cli-bundle/chunks/test-WBROAJIE.js +35 -0
- package/dist/cli-bundle/chunks/test-WBROAJIE.js.map +1 -0
- package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js +328 -0
- package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js → test-all-NTOZ7C3M.js} +13 -14
- package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js.map → test-all-NTOZ7C3M.js.map} +1 -1
- package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js +929 -0
- package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js → test-runs-WMVTQU3Y.js} +5 -5
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js +25 -0
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js.map +1 -0
- package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +21 -0
- package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js +605 -0
- package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js.map +1 -0
- package/dist/cli-bundle/chunks/{update-many-46HRSP2Q.js → update-many-KGGEYABR.js} +78 -146
- package/dist/cli-bundle/chunks/update-many-KGGEYABR.js.map +7 -0
- package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js → upgrade-BLI7XBAJ.js} +5 -7
- package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js.map → upgrade-BLI7XBAJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js +266 -0
- package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-TMCVKIGZ.js → validate-AGOAUOVW.js} +61 -48
- package/dist/cli-bundle/chunks/validate-AGOAUOVW.js.map +7 -0
- package/dist/cli-bundle/chunks/validate-L5J6A7YO.js +1120 -0
- package/dist/cli-bundle/chunks/validate-L5J6A7YO.js.map +1 -0
- package/dist/cli-bundle/main.js +534 -1505
- 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/history/history-diff.d.ts +47 -0
- package/dist/core/history/history-diff.js +152 -0
- package/dist/core/history/history-diff.js.map +1 -0
- package/dist/core/history/history-storage-stats.d.ts +31 -0
- package/dist/core/history/history-storage-stats.js +101 -0
- package/dist/core/history/history-storage-stats.js.map +1 -0
- 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/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.js +4 -2
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/lock-gc.d.ts +46 -0
- package/dist/core/lock/lock-gc.js +194 -0
- package/dist/core/lock/lock-gc.js.map +1 -0
- 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/cache.d.ts +3 -1
- package/dist/core/search/cache.js +104 -28
- 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 +64 -14
- 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/serial-queue.d.ts +12 -0
- package/dist/core/shared/serial-queue.js +43 -0
- package/dist/core/shared/serial-queue.js.map +1 -0
- 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-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 +18 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.d.ts +19 -1
- package/dist/core/store/settings.js +130 -10
- 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 +5 -4
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +16 -4
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +372 -45
- 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 +6 -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 +42 -10
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +42 -1
- package/dist/sdk/cli-contracts.js +225 -19
- 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 +19 -0
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +22 -3
- package/docs/ARCHITECTURE.md +11 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +118 -7
- package/docs/CONFIGURATION.md +57 -2
- package/docs/EXTENSIONS.md +125 -6
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
- package/docs/ONBOARDING.md +165 -0
- package/docs/QUICKSTART.md +3 -1
- package/docs/README.md +12 -4
- package/docs/RELEASING.md +38 -3
- package/docs/SDK.md +273 -1
- package/docs/TESTING.md +36 -1
- 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 +16 -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/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +7 -4
- package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/scripts/bundle-cli.mjs +121 -17
- package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +0 -17
- package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +0 -189
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +0 -47
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +0 -56
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LRBOHPUE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +0 -141
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +0 -7
- package/dist/cli-bundle/chunks/close-XY4CSAYF.js +0 -14
- package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +0 -7
- package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +0 -28
- package/dist/cli-bundle/chunks/gc-JWNF66EC.js +0 -181
- package/dist/cli-bundle/chunks/gc-JWNF66EC.js.map +0 -7
- package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +0 -7
- package/dist/cli-bundle/chunks/history-A2JUDXUE.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +0 -20
- package/dist/cli-bundle/chunks/init-M2WUB4YH.js +0 -16
- package/dist/cli-bundle/chunks/list-OGWQPC26.js +0 -20
- package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-MB2ISME7.js +0 -18
- package/dist/cli-bundle/chunks/schema-Q622KC46.js +0 -119
- package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +0 -7
- package/dist/cli-bundle/chunks/search-HENBL456.js.map +0 -7
- package/dist/cli-bundle/chunks/stats-N6H3YP2F.js +0 -124
- package/dist/cli-bundle/chunks/stats-N6H3YP2F.js.map +0 -7
- package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +0 -32
- package/dist/cli-bundle/chunks/update-H6SCWNMA.js +0 -22
- package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-OWYSUZOY.js.map → activity-CVXTCHYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js.map → aggregate-VNAHUNNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js.map → chunk-BQHUILZS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js.map → chunk-GU2ZJ2VV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js.map → chunk-KAG77BY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js.map → chunk-KJ33AOCY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js.map → chunk-N7ACFE26.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js.map → chunk-QO7EBBOM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js.map → chunk-R6UFP2GE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js.map → chunk-T3LC5LKB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js.map → chunk-UM2GBHS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js.map → chunk-WKY2IBOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js.map → chunk-XLTD2HN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js.map → chunk-YL2DJGYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-XY4CSAYF.js.map → close-3HDWDA3L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-PZVHRIZQ.js.map → create-JTZNCTQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js.map → extension-J7IBMFTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-A2JUDXUE.js.map → history-2BA3T5AE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-ED6RFCPL.js.map → history-redact-JBZNXHGR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-M2WUB4YH.js.map → init-HIVSNX3O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-OGWQPC26.js.map → list-MUSQNMTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-MB2ISME7.js.map → restore-D4RGNX33.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-VNBDRJ4Z.js.map → test-MXX3E5JL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js.map → test-runs-WMVTQU3Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-H6SCWNMA.js.map → update-YRXSUGYQ.js.map} +0 -0
|
@@ -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-2RSPZI5H.js";
|
|
9
|
+
import {
|
|
10
|
+
EMPTY_REPLAY_DOCUMENT,
|
|
11
|
+
historyEntriesToRaw,
|
|
12
|
+
replayHash,
|
|
13
|
+
replayToItemDocument,
|
|
14
|
+
tryApplyReplayPatch,
|
|
15
|
+
verifyHistoryChain
|
|
16
|
+
} from "./chunk-GXSUPCBV.js";
|
|
17
|
+
import {
|
|
18
|
+
acquireLock,
|
|
19
|
+
createHistoryEntry,
|
|
20
|
+
locateItem,
|
|
21
|
+
readLocatedItem
|
|
22
|
+
} from "./chunk-GGYWB3Y2.js";
|
|
23
|
+
import {
|
|
24
|
+
normalizeItemId,
|
|
25
|
+
normalizeRawItemId
|
|
26
|
+
} from "./chunk-HZGUAH22.js";
|
|
27
|
+
import {
|
|
28
|
+
canonicalDocument,
|
|
29
|
+
serializeItemDocument
|
|
30
|
+
} from "./chunk-LB3RUL2N.js";
|
|
31
|
+
import {
|
|
32
|
+
resolveItemTypeRegistry
|
|
33
|
+
} from "./chunk-2VBQ6ZXS.js";
|
|
34
|
+
import {
|
|
35
|
+
nowIso
|
|
36
|
+
} from "./chunk-TCD3R2PF.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-5SFCOO6B.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-UBOPJT3S.js.map
|
|
539
|
+
|
|
540
|
+
//# debugId=50104455-b180-5239-87c7-308e9abf62a2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/history-redact.ts","../../../../../../../../core/history/history-rewrite.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { createHistoryEntry } from \"../../core/history/history.js\";\nimport {\n checkHistoryRewriteOwnership,\n verifyHistoryRewriteNoDrift,\n} from \"../../core/history/history-rewrite.js\";\nimport {\n EMPTY_REPLAY_DOCUMENT,\n historyEntriesToRaw,\n replayHash,\n replayToItemDocument,\n tryApplyReplayPatch,\n verifyHistoryChain,\n type ReplayDocument,\n} from \"../../core/history/replay.js\";\nimport { normalizeItemId, normalizeRawItemId } from \"../../core/item/id.js\";\nimport { canonicalDocument, serializeItemDocument } from \"../../core/item/item-format.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemDocument } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\n\nexport interface HistoryRedactCommandOptions {\n literal?: string[] | string;\n regex?: string[] | string;\n replacement?: string;\n dryRun?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\ninterface RegexRule {\n kind: \"regex\";\n source: string;\n flags: string;\n label: string;\n}\n\ninterface LiteralRule {\n kind: \"literal\";\n value: string;\n label: string;\n}\n\ntype RedactionRule = RegexRule | LiteralRule;\n\ninterface RedactionRewriteResult {\n entries: HistoryEntry[];\n finalDocument: ReplayDocument;\n entriesChanged: number;\n replacements: number;\n}\n\ninterface HistoryIntegritySnapshot {\n hashMismatchesBefore: number;\n hashMismatchesAfter: number;\n finalDocument: ReplayDocument;\n}\n\nexport interface HistorySubject {\n id: string;\n historyPath: string;\n located: Awaited<ReturnType<typeof locateItem>>;\n}\n\nexport interface HistoryRedactResult {\n id: string;\n dry_run: boolean;\n changed: boolean;\n patterns: {\n literals: string[];\n regex: string[];\n replacement: string;\n };\n history: {\n path: string;\n entries_scanned: number;\n entries_changed: number;\n replacements: number;\n hash_mismatches_before: number;\n hash_mismatches_after: number;\n preexisting_hash_mismatches: number;\n audit_entry_added: boolean;\n verify_ok: boolean;\n verify_errors: string[];\n };\n item: {\n existed_before: boolean;\n exists_after: boolean;\n path_before: string | null;\n path_after: string | null;\n changed: boolean;\n };\n warnings: string[];\n generated_at: string;\n}\n\nfunction normalizeStringArrayInput(value: string[] | string | undefined): string[] {\n if (Array.isArray(value)) {\n return value;\n }\n if (typeof value === \"string\") {\n return [value];\n }\n return [];\n}\n\nfunction normalizeRegexFlags(flags: string): string {\n const unique: string[] = [];\n for (const token of flags) {\n if (!unique.includes(token)) {\n unique.push(token);\n }\n }\n if (!unique.includes(\"g\")) {\n unique.push(\"g\");\n }\n return unique.join(\"\");\n}\n\nfunction parseRegexRule(spec: string): RegexRule {\n const trimmed = spec.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(\"history-redact --regex requires a non-empty pattern.\", EXIT_CODE.USAGE);\n }\n\n let source = trimmed;\n let flags = \"g\";\n if (trimmed.startsWith(\"/\") && trimmed.length > 1) {\n const slashIndex = trimmed.lastIndexOf(\"/\");\n if (slashIndex > 0) {\n source = trimmed.slice(1, slashIndex);\n flags = normalizeRegexFlags(trimmed.slice(slashIndex + 1));\n }\n }\n if (source.length === 0) {\n throw new PmCliError(\"history-redact --regex cannot use an empty pattern.\", EXIT_CODE.USAGE);\n }\n try {\n new RegExp(source, flags);\n } catch (error) {\n throw new PmCliError(\n `Invalid --regex value \"${spec}\": ${error instanceof Error ? error.message : String(error)}`,\n EXIT_CODE.USAGE,\n );\n }\n\n return {\n kind: \"regex\",\n source,\n flags,\n label: `/${source}/${flags}`,\n };\n}\n\nfunction buildRedactionRules(\n literalInput: string[] | string | undefined,\n regexInput: string[] | string | undefined,\n): RedactionRule[] {\n const literalRules = [...new Set(normalizeStringArrayInput(literalInput).map((entry) => entry.trim()))]\n .filter((entry) => entry.length > 0)\n .map<LiteralRule>((entry) => ({\n kind: \"literal\",\n value: entry,\n label: entry,\n }));\n const regexRules = [...new Set(normalizeStringArrayInput(regexInput).map((entry) => entry.trim()))]\n .filter((entry) => entry.length > 0)\n .map(parseRegexRule);\n\n const rules = [...literalRules, ...regexRules];\n if (rules.length === 0) {\n throw new PmCliError(\n \"history-redact requires at least one matcher via --literal or --regex.\",\n EXIT_CODE.USAGE,\n {\n code: \"missing_required_argument\",\n required: \"Provide --literal <value> and/or --regex <pattern>.\",\n examples: [\n 'pm history-redact pm-a1b2 --literal \"[redacted_path_prefix]/private\"',\n 'pm history-redact pm-a1b2 --regex \"/192\\\\\\\\.168\\\\\\\\.[0-9.]+/g\" --replacement \"[scrubbed_ip]\"',\n ],\n },\n );\n }\n return rules;\n}\n\nfunction applyLiteralRule(value: string, literal: string, replacement: string): { value: string; replacements: number } {\n if (literal.length === 0) {\n return { value, replacements: 0 };\n }\n let cursor = 0;\n let replacements = 0;\n while (cursor <= value.length) {\n const index = value.indexOf(literal, cursor);\n if (index === -1) {\n break;\n }\n replacements += 1;\n cursor = index + Math.max(1, literal.length);\n }\n if (replacements === 0) {\n return { value, replacements: 0 };\n }\n return {\n value: value.split(literal).join(replacement),\n replacements,\n };\n}\n\nfunction applyRegexRule(value: string, rule: RegexRule, replacement: string): { value: string; replacements: number } {\n const regex = new RegExp(rule.source, rule.flags);\n const matches = [...value.matchAll(regex)];\n if (matches.length === 0) {\n return { value, replacements: 0 };\n }\n return {\n value: value.replace(regex, replacement),\n replacements: matches.length,\n };\n}\n\nfunction redactStringValue(value: string, rules: RedactionRule[], replacement: string): { value: string; replacements: number } {\n let next = value;\n let replacements = 0;\n for (const rule of rules) {\n const result =\n rule.kind === \"literal\"\n ? applyLiteralRule(next, rule.value, replacement)\n : applyRegexRule(next, rule, replacement);\n next = result.value;\n replacements += result.replacements;\n }\n return {\n value: next,\n replacements,\n };\n}\n\nfunction redactUnknownValue(value: unknown, rules: RedactionRule[], replacement: string): { value: unknown; replacements: number } {\n if (typeof value === \"string\") {\n return redactStringValue(value, rules, replacement);\n }\n if (Array.isArray(value)) {\n let replacements = 0;\n const nextValues = value.map((entry) => {\n const redacted = redactUnknownValue(entry, rules, replacement);\n replacements += redacted.replacements;\n return redacted.value;\n });\n return {\n value: nextValues,\n replacements,\n };\n }\n if (typeof value === \"object\" && value !== null) {\n let replacements = 0;\n const nextRecord: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(value)) {\n const redacted = redactUnknownValue(entry, rules, replacement);\n replacements += redacted.replacements;\n nextRecord[key] = redacted.value;\n }\n return {\n value: nextRecord,\n replacements,\n };\n }\n return {\n value,\n replacements: 0,\n };\n}\n\nfunction applyHistoryPatch(current: ReplayDocument, patch: HistoryPatchOp[], entryNumber: number, op: string): ReplayDocument {\n const result = tryApplyReplayPatch(current, patch);\n if (!result.ok) {\n throw new PmCliError(\n `history-redact failed to apply patch at entry ${entryNumber} (op=${op}): ${\n result.error instanceof Error ? result.error.message : String(result.error)\n }`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return result.document;\n}\n\nfunction inspectHistoryIntegrity(entries: HistoryEntry[]): HistoryIntegritySnapshot {\n let replay = structuredClone(EMPTY_REPLAY_DOCUMENT);\n let hashMismatchesBefore = 0;\n let hashMismatchesAfter = 0;\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n if (replayHash(replay) !== entry.before_hash) {\n hashMismatchesBefore += 1;\n }\n replay = applyHistoryPatch(replay, entry.patch, index + 1, entry.op);\n if (replayHash(replay) !== entry.after_hash) {\n hashMismatchesAfter += 1;\n }\n }\n return {\n hashMismatchesBefore,\n hashMismatchesAfter,\n finalDocument: replay,\n };\n}\n\nfunction redactHistoryEntry(entry: HistoryEntry, rules: RedactionRule[], replacement: string): {\n entry: HistoryEntry;\n replacements: number;\n changed: boolean;\n} {\n let replacements = 0;\n let changed = false;\n let nextMessage = entry.message;\n\n if (typeof entry.message === \"string\") {\n const redactedMessage = redactStringValue(entry.message, rules, replacement);\n nextMessage = redactedMessage.value;\n replacements += redactedMessage.replacements;\n if (redactedMessage.replacements > 0) {\n changed = true;\n }\n }\n\n const nextPatch = entry.patch.map((operation) => {\n if (!Object.prototype.hasOwnProperty.call(operation, \"value\")) {\n return operation;\n }\n const redactedValue = redactUnknownValue(operation.value, rules, replacement);\n replacements += redactedValue.replacements;\n if (redactedValue.replacements > 0) {\n changed = true;\n return {\n ...operation,\n value: redactedValue.value,\n };\n }\n return operation;\n });\n\n return {\n entry: {\n ...entry,\n message: nextMessage,\n patch: nextPatch,\n },\n replacements,\n changed,\n };\n}\n\nfunction rewriteHistoryEntries(entries: HistoryEntry[], rules: RedactionRule[], replacement: string): RedactionRewriteResult {\n let replay = structuredClone(EMPTY_REPLAY_DOCUMENT);\n let entriesChanged = 0;\n let replacements = 0;\n const rewrittenEntries: HistoryEntry[] = [];\n\n for (let index = 0; index < entries.length; index += 1) {\n const redacted = redactHistoryEntry(entries[index], rules, replacement);\n replacements += redacted.replacements;\n if (redacted.changed) {\n entriesChanged += 1;\n }\n const beforeHash = replayHash(replay);\n replay = applyHistoryPatch(replay, redacted.entry.patch, index + 1, redacted.entry.op);\n const afterHash = replayHash(replay);\n rewrittenEntries.push({\n ...redacted.entry,\n before_hash: beforeHash,\n after_hash: afterHash,\n });\n }\n\n return {\n entries: rewrittenEntries,\n finalDocument: replay,\n entriesChanged,\n replacements,\n };\n}\n\nfunction hasItemMetadata(replay: ReplayDocument): boolean {\n return Object.keys(replay.metadata).length > 0;\n}\n\nexport async function resolveHistorySubject(\n pmRoot: string,\n id: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n typeToFolder: Record<string, string>,\n): Promise<HistorySubject> {\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeToFolder);\n if (located) {\n return {\n id: located.id,\n historyPath: getHistoryPath(pmRoot, located.id),\n located,\n };\n }\n\n const normalizedId = normalizeItemId(id, settings.id_prefix);\n const rawNormalizedId = normalizeRawItemId(id);\n const candidateIds = normalizedId === rawNormalizedId ? [normalizedId] : [normalizedId, rawNormalizedId];\n for (const candidateId of candidateIds) {\n const historyPath = getHistoryPath(pmRoot, candidateId);\n if (await pathExists(historyPath)) {\n return {\n id: candidateId,\n historyPath,\n located: null,\n };\n }\n }\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n}\n\nexport async function runHistoryRedact(\n id: string,\n options: HistoryRedactCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryRedactResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const replacement = typeof options.replacement === \"string\" && options.replacement.length > 0 ? options.replacement : \"[redacted]\";\n const rules = buildRedactionRules(options.literal, options.regex);\n const subject = await resolveHistorySubject(pmRoot, id, settings, typeRegistry.type_to_folder);\n\n if (!(await pathExists(subject.historyPath))) {\n throw new PmCliError(`No history stream exists for ${subject.id}.`, EXIT_CODE.NOT_FOUND);\n }\n const historyRawBeforeLock = await readFileIfExists(subject.historyPath);\n const historyEntries = await readHistoryEntries(subject.historyPath, subject.id);\n if (historyEntries.length === 0) {\n throw new PmCliError(`No history entries exist for ${subject.id}; nothing to redact.`, EXIT_CODE.USAGE);\n }\n\n const integritySnapshot = inspectHistoryIntegrity(historyEntries);\n const rewritten = rewriteHistoryEntries(historyEntries, rules, replacement);\n const preexistingHashMismatches = integritySnapshot.hashMismatchesBefore + integritySnapshot.hashMismatchesAfter;\n const dryRun = Boolean(options.dryRun);\n const changed = rewritten.replacements > 0;\n const warnings: string[] = [];\n if (preexistingHashMismatches > 0) {\n warnings.push(`history_redact_preexisting_hash_mismatches:${preexistingHashMismatches}`);\n }\n if (!changed) {\n warnings.push(\"history_redact_no_matches\");\n }\n\n let currentItemRaw: string | null = null;\n let currentItemPath: string | null = subject.located?.itemPath ?? null;\n let currentItemDocument: ItemDocument | null = null;\n if (subject.located) {\n const loaded = await readLocatedItem(subject.located, { schema: settings.schema });\n currentItemRaw = loaded.raw;\n currentItemDocument = loaded.document;\n }\n\n let nextItemPath: string | null = null;\n let nextItemRaw: string | null = null;\n let nextItemDocument: ItemDocument | null = null;\n if (hasItemMetadata(rewritten.finalDocument)) {\n const canonical = canonicalDocument(replayToItemDocument(rewritten.finalDocument), { schema: settings.schema });\n if (canonical.metadata.id !== subject.id) {\n throw new PmCliError(\n `history-redact would change item id from ${subject.id} to ${canonical.metadata.id}; narrow your patterns.`,\n EXIT_CODE.USAGE,\n );\n }\n nextItemDocument = canonical;\n nextItemPath = getItemPath(pmRoot, canonical.metadata.type, subject.id, \"toon\", typeRegistry.type_to_folder);\n nextItemRaw = serializeItemDocument(canonical, {\n format: \"toon\",\n schema: settings.schema,\n });\n }\n\n const itemChanged =\n (currentItemPath ?? null) !== (nextItemPath ?? null) ||\n (currentItemRaw ?? null) !== (nextItemRaw ?? null);\n\n const author = resolveAuthor(options.author, settings.author_default);\n const redactionMessage =\n typeof options.message === \"string\" && options.message.trim().length > 0\n ? options.message\n : `history-redact replaced ${rewritten.replacements} match(es) across ${rewritten.entriesChanged} entr${\n rewritten.entriesChanged === 1 ? \"y\" : \"ies\"\n }.`;\n\n const rewrittenEntries = [...rewritten.entries];\n let auditEntryAdded = false;\n if (!dryRun && changed) {\n const finalDocument = nextItemDocument ?? replayToItemDocument(rewritten.finalDocument);\n rewrittenEntries.push(\n createHistoryEntry({\n nowIso: nowIso(),\n author,\n op: \"history_redact\",\n before: finalDocument,\n after: finalDocument,\n message: redactionMessage,\n }),\n );\n auditEntryAdded = true;\n }\n const historyVerify = verifyHistoryChain(rewrittenEntries);\n if (!historyVerify.ok) {\n throw new PmCliError(\n `history-redact produced an invalid rewritten chain (${historyVerify.errors.join(\", \")}).`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n\n if (!dryRun && changed) {\n warnings.push(\n ...checkHistoryRewriteOwnership({\n itemDocument: currentItemDocument,\n subjectId: subject.id,\n author,\n force: options.force,\n settings,\n }),\n );\n\n const releaseLock = await acquireLock(\n pmRoot,\n subject.id,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n settings.governance.force_required_for_stale_lock,\n );\n try {\n const { historyRawUnderLock } = await verifyHistoryRewriteNoDrift({\n pmRoot,\n subject,\n settings,\n typeRegistry,\n historyRawBeforeLock,\n currentItemRawBeforeLock: currentItemRaw,\n operation: \"history-redact\",\n });\n const affectedItemPaths = new Set<string>();\n if (currentItemPath) {\n affectedItemPaths.add(currentItemPath);\n }\n if (nextItemPath) {\n affectedItemPaths.add(nextItemPath);\n }\n const itemSnapshots = new Map<string, string>();\n if (currentItemPath && currentItemRaw !== null) {\n itemSnapshots.set(currentItemPath, currentItemRaw);\n }\n\n try {\n if (nextItemPath && nextItemRaw !== null && nextItemRaw !== currentItemRaw) {\n await writeFileAtomic(nextItemPath, nextItemRaw);\n }\n if (currentItemPath && (!nextItemPath || nextItemPath !== currentItemPath)) {\n await fs.rm(currentItemPath, { force: true });\n }\n await writeFileAtomic(subject.historyPath, historyEntriesToRaw(rewrittenEntries));\n } catch (error) {\n if (historyRawUnderLock === null) {\n await fs.rm(subject.historyPath, { force: true });\n } else {\n await writeFileAtomic(subject.historyPath, historyRawUnderLock);\n }\n for (const itemPath of affectedItemPaths) {\n const snapshot = itemSnapshots.get(itemPath);\n if (snapshot === undefined) {\n await fs.rm(itemPath, { force: true });\n } else {\n await writeFileAtomic(itemPath, snapshot);\n }\n }\n throw error;\n }\n\n const itemHookPath = nextItemPath ?? currentItemPath;\n if (itemHookPath) {\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: itemHookPath,\n scope: \"project\",\n op: \"history_redact\",\n })),\n );\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: subject.historyPath,\n scope: \"project\",\n op: \"history_redact:history\",\n })),\n );\n } finally {\n await releaseLock();\n }\n }\n\n return {\n id: subject.id,\n dry_run: dryRun,\n changed,\n patterns: {\n literals: rules.filter((rule): rule is LiteralRule => rule.kind === \"literal\").map((rule) => rule.value),\n regex: rules.filter((rule): rule is RegexRule => rule.kind === \"regex\").map((rule) => `/${rule.source}/${rule.flags}`),\n replacement,\n },\n history: {\n path: subject.historyPath,\n entries_scanned: historyEntries.length,\n entries_changed: rewritten.entriesChanged,\n replacements: rewritten.replacements,\n hash_mismatches_before: integritySnapshot.hashMismatchesBefore,\n hash_mismatches_after: integritySnapshot.hashMismatchesAfter,\n preexisting_hash_mismatches: preexistingHashMismatches,\n audit_entry_added: auditEntryAdded,\n verify_ok: historyVerify.ok,\n verify_errors: historyVerify.errors,\n },\n item: {\n existed_before: currentItemPath !== null,\n exists_after: nextItemPath !== null,\n path_before: currentItemPath,\n path_after: nextItemPath,\n changed: itemChanged,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n","import { readFileIfExists } from \"../fs/fs-utils.js\";\nimport type { ItemTypeRegistry } from \"../item/type-registry.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { locateItem, readLocatedItem } from \"../store/item-store.js\";\nimport { resolveGovernanceKnobs } from \"../store/settings.js\";\nimport type { ItemDocument, PmSettings } from \"../../types/index.js\";\n\ntype LoadedItem = Awaited<ReturnType<typeof readLocatedItem>>;\n\nexport interface HistoryRewriteSubject {\n id: string;\n historyPath: string;\n}\n\nexport interface HistoryRewriteOwnershipParams {\n itemDocument: ItemDocument | null;\n subjectId: string;\n author: string;\n force: boolean | undefined;\n settings: PmSettings;\n}\n\n/**\n * Apply ownership_enforcement governance to a history-rewriting operation.\n * Returns the warning(s) the caller should append (empty when no conflict or strict-throws).\n * Throws PmCliError(CONFLICT) in strict mode when the assignee conflicts and --force is not set.\n */\nexport function checkHistoryRewriteOwnership(params: HistoryRewriteOwnershipParams): string[] {\n if (!params.itemDocument) return [];\n const assigned = params.itemDocument.metadata?.assignee?.trim();\n if (!assigned || assigned === params.author || params.force) return [];\n\n const governance = resolveGovernanceKnobs(params.settings);\n if (governance.ownership_enforcement === \"strict\") {\n throw new PmCliError(\n `Item ${params.subjectId} is assigned to ${assigned}. Use --force to override.`,\n EXIT_CODE.CONFLICT,\n );\n }\n if (governance.ownership_enforcement === \"warn\") {\n return [`ownership_warning:assignee_conflict:${params.subjectId}:${assigned}`];\n }\n return [];\n}\n\nexport interface VerifyHistoryRewriteDriftParams {\n pmRoot: string;\n subject: HistoryRewriteSubject;\n settings: PmSettings;\n typeRegistry: ItemTypeRegistry;\n historyRawBeforeLock: string | null;\n currentItemRawBeforeLock: string | null;\n /** Short operation name used in the conflict message (e.g. \"history-redact\"). */\n operation: string;\n}\n\nexport interface VerifiedHistoryRewriteState {\n historyRawUnderLock: string | null;\n locatedUnderLock: Awaited<ReturnType<typeof locateItem>>;\n loadedItemUnderLock: LoadedItem | null;\n}\n\n/**\n * Re-read the history stream and the located item document under the acquired lock and\n * compare both with the pre-lock raw snapshots. Throws PmCliError(CONFLICT) if either\n * diverged while waiting for the lock so the caller surfaces an actionable retry.\n */\nexport async function verifyHistoryRewriteNoDrift(\n params: VerifyHistoryRewriteDriftParams,\n): Promise<VerifiedHistoryRewriteState> {\n const historyRawUnderLock = await readFileIfExists(params.subject.historyPath);\n if (historyRawUnderLock !== params.historyRawBeforeLock) {\n throw new PmCliError(\n `History for ${params.subject.id} changed while waiting for lock; retry ${params.operation}.`,\n EXIT_CODE.CONFLICT,\n );\n }\n const locatedUnderLock = await locateItem(\n params.pmRoot,\n params.subject.id,\n params.settings.id_prefix,\n params.settings.item_format,\n params.typeRegistry.type_to_folder,\n );\n const loadedItemUnderLock = locatedUnderLock\n ? await readLocatedItem(locatedUnderLock, { schema: params.settings.schema })\n : null;\n if ((loadedItemUnderLock?.raw ?? null) !== (params.currentItemRawBeforeLock ?? null)) {\n throw new PmCliError(\n `Item ${params.subject.id} changed while waiting for lock; retry ${params.operation}.`,\n EXIT_CODE.CONFLICT,\n );\n }\n return { historyRawUnderLock, locatedUnderLock, loadedItemUnderLock };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;;;AC4BT,SAAU,6BAA6B,QAAqC;AAChF,MAAI,CAAC,OAAO;AAAc,WAAO,CAAA;AACjC,QAAM,WAAW,OAAO,aAAa,UAAU,UAAU,KAAI;AAC7D,MAAI,CAAC,YAAY,aAAa,OAAO,UAAU,OAAO;AAAO,WAAO,CAAA;AAEpE,QAAM,aAAa,uBAAuB,OAAO,QAAQ;AACzD,MAAI,WAAW,0BAA0B,UAAU;AACjD,UAAM,IAAI,WACR,QAAQ,OAAO,SAAS,mBAAmB,QAAQ,8BACnD,UAAU,QAAQ;EAEtB;AACA,MAAI,WAAW,0BAA0B,QAAQ;AAC/C,WAAO,CAAC,uCAAuC,OAAO,SAAS,IAAI,QAAQ,EAAE;EAC/E;AACA,SAAO,CAAA;AACT;AAwBA,eAAsB,4BACpB,QAAuC;AAEvC,QAAM,sBAAsB,MAAM,iBAAiB,OAAO,QAAQ,WAAW;AAC7E,MAAI,wBAAwB,OAAO,sBAAsB;AACvD,UAAM,IAAI,WACR,eAAe,OAAO,QAAQ,EAAE,0CAA0C,OAAO,SAAS,KAC1F,UAAU,QAAQ;EAEtB;AACA,QAAM,mBAAmB,MAAM,WAC7B,OAAO,QACP,OAAO,QAAQ,IACf,OAAO,SAAS,WAChB,OAAO,SAAS,aAChB,OAAO,aAAa,cAAc;AAEpC,QAAM,sBAAsB,mBACxB,MAAM,gBAAgB,kBAAkB,EAAE,QAAQ,OAAO,SAAS,OAAM,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,CAAC,GAAG,IAAI,IAAI,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;IAChF,cAAc,OAAM;;AAExB","debugId":"50104455-b180-5239-87c7-308e9abf62a2"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hashDocument,
|
|
3
3
|
toItemRecord
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XTGLRY2Y.js";
|
|
5
5
|
import {
|
|
6
6
|
canonicalDocument
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AO442XLN.js";
|
|
8
8
|
import {
|
|
9
9
|
FRONT_MATTER_KEY_ORDER,
|
|
10
10
|
orderObject,
|
|
11
11
|
sha256Hex,
|
|
12
12
|
stableStringify
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-U5SXYXSY.js";
|
|
14
14
|
|
|
15
15
|
// dist/core/history/replay.js
|
|
16
16
|
import jsonPatch from "fast-json-patch";
|
|
@@ -221,6 +221,7 @@ function historyEntriesToRaw(entries) {
|
|
|
221
221
|
|
|
222
222
|
export {
|
|
223
223
|
EMPTY_REPLAY_DOCUMENT,
|
|
224
|
+
cloneEmptyReplayDocument,
|
|
224
225
|
replayHash,
|
|
225
226
|
replayToItemDocument,
|
|
226
227
|
toReplayDocument,
|
|
@@ -230,4 +231,4 @@ export {
|
|
|
230
231
|
reanchorHistoryEntries,
|
|
231
232
|
historyEntriesToRaw
|
|
232
233
|
};
|
|
233
|
-
//# sourceMappingURL=chunk-
|
|
234
|
+
//# sourceMappingURL=chunk-UM2GBHS4.js.map
|