@unbrained/pm-cli 2026.7.14 → 2026.7.15
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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +48 -0
- package/README.md +14 -11
- package/dist/cli/argv-utils.d.ts +1 -4
- package/dist/cli/argv-utils.js +3 -13
- package/dist/cli/argv-utils.js.map +1 -1
- package/dist/cli/bootstrap-args.d.ts +6 -4
- package/dist/cli/bootstrap-args.js +51 -16
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/bundle-integrity.d.ts +49 -0
- package/dist/cli/bundle-integrity.js +111 -0
- package/dist/cli/bundle-integrity.js.map +1 -0
- package/dist/cli/commands/completion.js +7 -2
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +6 -163
- package/dist/cli/commands/config.js +4 -1133
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +2 -4
- package/dist/cli/commands/context.js +10 -85
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -0
- package/dist/cli/commands/create.js +3 -2
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/describe.d.ts +2 -91
- package/dist/cli/commands/extension/describe.js +4 -142
- package/dist/cli/commands/extension/describe.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.d.ts +2 -36
- package/dist/cli/commands/extension/scaffold.js +4 -2435
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension/shared.d.ts +2 -28
- package/dist/cli/commands/extension/shared.js +4 -130
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +3 -400
- package/dist/cli/commands/extension.js +4 -2183
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/gc.d.ts +6 -56
- package/dist/cli/commands/gc.js +4 -270
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +18 -5
- package/dist/cli/commands/get.js +117 -58
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +6 -184
- package/dist/cli/commands/health.js +4 -1747
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.d.ts +4 -139
- package/dist/cli/commands/history-compact.js +5 -510
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +8 -120
- package/dist/cli/commands/history-redact.js +6 -581
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +7 -89
- package/dist/cli/commands/history-repair.js +5 -257
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/history.d.ts +1 -2
- package/dist/cli/commands/history.js +6 -48
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +3 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.d.ts +6 -113
- package/dist/cli/commands/init-agent-guidance.js +4 -431
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.d.ts +6 -181
- package/dist/cli/commands/init.js +4 -690
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/next.js +3 -3
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/profile.d.ts +4 -174
- package/dist/cli/commands/profile.js +4 -425
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +4 -19
- package/dist/cli/commands/restore.js +9 -158
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +7 -507
- package/dist/cli/commands/schema.js +5 -1254
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/test.d.ts +2 -4
- package/dist/cli/commands/test.js +7 -97
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +9 -249
- package/dist/cli/commands/validate.js +9 -2150
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/extension-command-help.js +18 -4
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.js +3 -3
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.js +7 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +20 -30
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +4 -2
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +11 -3
- package/dist/cli/register-mutation.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 +3 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +782 -0
- package/dist/cli-bundle/chunks/{append-PVZJDM6J.js → append-OJQFUQ4T.js} +5 -5
- package/dist/cli-bundle/chunks/append-UZVHUO74.js +11 -0
- package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js → chunk-2IFFUZLC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js → chunk-2JKGO6QX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js → chunk-2NCIPMQP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js → chunk-2VPAVL7O.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js → chunk-2WSE6PO2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js → chunk-34L5OT3Y.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js → chunk-3AUGG2DP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js → chunk-3CLU2XZO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-N3CMP4NI.js → chunk-3S5QVM5H.js} +43 -7
- package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js +64 -0
- package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js → chunk-3WM75PWC.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-4223PVZT.js +121 -0
- package/dist/cli-bundle/chunks/chunk-4223PVZT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5URI7TPJ.js → chunk-4XQ3BDV4.js} +281 -164
- package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js → chunk-5JLUII3O.js} +13 -13
- package/dist/cli-bundle/chunks/{chunk-MKL4CP2I.js → chunk-5ZSLZLDN.js} +631 -246
- package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Q37E63AM.js → chunk-6CFNAVTF.js} +21 -141
- package/dist/cli-bundle/chunks/chunk-6CFNAVTF.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js → chunk-6N2VXVTQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js → chunk-6S3YSUYG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZUKSZVBW.js → chunk-7B67ZL4N.js} +8 -7
- package/dist/cli-bundle/chunks/chunk-7B67ZL4N.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IA3YFTXT.js → chunk-7PIWCHTW.js} +11 -13
- package/dist/cli-bundle/chunks/chunk-7PIWCHTW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BPD26E3P.js → chunk-7Z4LKRS4.js} +291 -81
- package/dist/cli-bundle/chunks/chunk-7Z4LKRS4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js → chunk-AHVTB5I5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js → chunk-APRVSW2O.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js → chunk-B7PE22W6.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js → chunk-BCOFWYW4.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js → chunk-BEP7WJA2.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js +1114 -0
- package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js → chunk-BSEQUTQP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js.map → chunk-BSEQUTQP.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js → chunk-CRVF2JDM.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js → chunk-DM4H7FP4.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-DUT67M43.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-44LNIULG.js → chunk-DYH63FX7.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LWTIRS3Y.js → chunk-E2OJMKML.js} +306 -82
- package/dist/cli-bundle/chunks/chunk-E2OJMKML.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js → chunk-EAB64KLB.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js → chunk-EACOH7AU.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js → chunk-EH2OPHBI.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js.map → chunk-EH2OPHBI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js → chunk-EJEXHTY5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js → chunk-EYLCSJAI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-655STMGA.js → chunk-FMBNM2EN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js → chunk-FNSPG7MU.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-5CT5BW6E.js → chunk-GM5QHQU6.js} +46 -40
- package/dist/cli-bundle/chunks/chunk-GM5QHQU6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FTQLW4JD.js → chunk-GOSLKLFE.js} +418 -24
- package/dist/cli-bundle/chunks/chunk-GOSLKLFE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KB726FMH.js → chunk-H2Z3FYXQ.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js +162 -0
- package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2QIQGYPW.js → chunk-H5APFTHZ.js} +53 -10
- package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js +118 -0
- package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZAYYDNB3.js → chunk-HO4KXD6I.js} +22 -142
- package/dist/cli-bundle/chunks/chunk-HO4KXD6I.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js → chunk-HYB5AZ63.js} +203 -62
- package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js.map → chunk-HYB5AZ63.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js → chunk-IA5FKNII.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JL7WZ4O2.js → chunk-IG3SWA4A.js} +33 -9
- package/dist/cli-bundle/chunks/chunk-IG3SWA4A.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js → chunk-IJIICKVW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IGED7NH2.js → chunk-ILX33QXL.js} +668 -251
- package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UGTVWL3E.js → chunk-INU6DKT5.js} +47 -41
- package/dist/cli-bundle/chunks/chunk-INU6DKT5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UB2QYSTO.js → chunk-J5AOEGDC.js} +26 -18
- package/dist/cli-bundle/chunks/chunk-J5AOEGDC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4DY4KPQI.js → chunk-J6364LFM.js} +1330 -937
- package/dist/cli-bundle/chunks/chunk-J6364LFM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DVOLZJ3C.js → chunk-J6EY5V4N.js} +1295 -939
- package/dist/cli-bundle/chunks/chunk-J6EY5V4N.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js +1097 -0
- package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js → chunk-JOUQZENX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-J4NZOP3I.js → chunk-JXQUXVMI.js} +9 -8
- package/dist/cli-bundle/chunks/chunk-JXQUXVMI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js → chunk-JYFOV7FC.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js → chunk-K2X6U4UA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6OTZMORS.js → chunk-K3WII2ME.js} +27 -27
- package/dist/cli-bundle/chunks/chunk-K3WII2ME.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js → chunk-KG44YSKD.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js → chunk-KPMKHGEA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QASRVKUQ.js → chunk-LPYWLWDS.js} +257 -163
- package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RGXD5JJR.js → chunk-LSG2U345.js} +19 -12
- package/dist/cli-bundle/chunks/chunk-LSG2U345.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-MIQDDLB5.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js → chunk-NLDFBC6J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js → chunk-NP22ERDF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js → chunk-NU3IMIEA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js → chunk-NVPZIJVR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js → chunk-ODALILG3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CDJYP7OQ.js → chunk-ONG5V5CI.js} +190 -63
- package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js → chunk-ONREO4ST.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js +61 -0
- package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js → chunk-P74IZQ7A.js} +12 -12
- package/dist/cli-bundle/chunks/chunk-PENXZX3U.js +172 -0
- package/dist/cli-bundle/chunks/chunk-PENXZX3U.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js → chunk-PGY23YTC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js → chunk-PMOSXADO.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-PNTULOGU.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js → chunk-Q7A43DS4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js → chunk-QEHQ2GVG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js → chunk-QIPLHNP7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js → chunk-QKECXBBG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js.map → chunk-QKECXBBG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js → chunk-QKJGPFAF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-F7PSHRNO.js → chunk-QKXHFPYM.js} +27 -10
- package/dist/cli-bundle/chunks/chunk-QKXHFPYM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js → chunk-RLCHOOHC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js → chunk-RMLWNPH2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js → chunk-RRM5JYJC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js → chunk-S6MQESFR.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js → chunk-SDQLJWBO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js → chunk-SELVXEZK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DYEX6NFH.js → chunk-TD3LVC7D.js} +438 -23
- package/dist/cli-bundle/chunks/chunk-TD3LVC7D.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js → chunk-TKOVBP6C.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js → chunk-TQSZFPIS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js → chunk-TSMHDIW4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js → chunk-UFXU44HV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js → chunk-ULTHRDBP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js → chunk-UMOPHQSU.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js.map → chunk-UMOPHQSU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js → chunk-UOHFKBUV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-PHKP3AGR.js → chunk-UWQHLMEB.js} +35 -18
- package/dist/cli-bundle/chunks/chunk-UWQHLMEB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6TTOHMTB.js → chunk-UXONS674.js} +45 -112
- package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js → chunk-UY2ACEMF.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-6PKA3SJQ.js → chunk-WQPUU7XD.js} +19 -28
- package/dist/cli-bundle/chunks/chunk-WQPUU7XD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7TQMR6LK.js → chunk-WT3ZEOGH.js} +70 -20
- package/dist/cli-bundle/chunks/chunk-WT3ZEOGH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js → chunk-WUJQK4YV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js → chunk-XSJUSQAE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6MHSBDGD.js → chunk-XXXF6PAQ.js} +50 -117
- package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js → chunk-YAQEBNY7.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7QDSYUMF.js → chunk-YAROI3PD.js} +44 -21
- package/dist/cli-bundle/chunks/chunk-YAROI3PD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js → chunk-YBLZ2VE7.js} +13 -13
- package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js → chunk-YCQET3OT.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-YUSOJDWM.js +9 -0
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +58 -0
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js → chunk-ZI6VQWQ7.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +68 -0
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-LZECOMHO.js → close-CWODTPKG.js} +5 -5
- package/dist/cli-bundle/chunks/close-W6LI2PKM.js +12 -0
- package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js → close-many-CQFUY7MR.js} +15 -13
- package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +23 -0
- package/dist/cli-bundle/chunks/comments-E3TNTK24.js +13 -0
- package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js → comments-WGLHR7LB.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js → copy-LXVDXH7B.js} +4 -4
- package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +9 -0
- package/dist/cli-bundle/chunks/{create-F53OBTOU.js → create-J5U6ND4K.js} +9 -9
- package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js → create-LBVCYMEG.js} +9 -9
- package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js → delete-PMJBNY5G.js} +4 -4
- package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +10 -0
- package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js → deps-JZ7TMVCB.js} +7 -4
- package/dist/cli-bundle/chunks/{deps-U57I7EAK.js → deps-OA26IS25.js} +7 -4
- package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js → docs-FEWB2DQB.js} +6 -6
- package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +14 -0
- package/dist/cli-bundle/chunks/{files-TBZD7V6H.js → files-6YFBJRBG.js} +6 -6
- package/dist/cli-bundle/chunks/{files-TTY6N2AV.js → files-EFIWKFTM.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js → focus-4QJR7FOQ.js} +5 -5
- package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +10 -0
- package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js → history-compact-CKRPDTJN.js} +6 -10
- package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +16 -0
- package/dist/cli-bundle/chunks/history-redact-BB3TGDAE.js +15 -0
- package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js → history-redact-D225BHOZ.js} +5 -6
- package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +16 -0
- package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js → history-repair-RQXKQHL4.js} +6 -8
- package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js → learnings-JLNLCOL5.js} +7 -7
- package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +13 -0
- package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +13 -0
- package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js → notes-GB47XXQQ.js} +7 -7
- package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +24 -0
- package/dist/cli-bundle/chunks/{plan-2NNEO46V.js → plan-VDCJ2PCN.js} +10 -10
- package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js → profile-FAU7NZML.js} +10 -10
- package/dist/cli-bundle/chunks/{profile-U725ATWZ.js → profile-IVXQEL3D.js} +10 -10
- package/dist/cli-bundle/chunks/{register-list-query-BUWCYHBT.js → register-list-query-DKA3EH5D.js} +22 -19
- package/dist/cli-bundle/chunks/register-list-query-DKA3EH5D.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-KTZ6AGE7.js → register-list-query-UL4UKBBN.js} +23 -20
- package/dist/cli-bundle/chunks/register-list-query-UL4UKBBN.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js → register-mutation-ARFHRW55.js} +36 -32
- package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js.map → register-mutation-ARFHRW55.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-4FMGJJF7.js → register-mutation-RBBJ52DK.js} +37 -33
- package/dist/cli-bundle/chunks/register-mutation-RBBJ52DK.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js → register-operations-ZIBBRSED.js} +41 -39
- package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js.map → register-operations-ZIBBRSED.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js → register-operations-ZUJ5JWPE.js} +39 -37
- package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js.map → register-operations-ZUJ5JWPE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js → register-setup-BCVLFEYS.js} +29 -17
- package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js.map → register-setup-BCVLFEYS.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js → register-setup-TDCGWIOS.js} +19 -18
- package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js.map → register-setup-TDCGWIOS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js → restore-25DLT2Q2.js} +6 -6
- package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +14 -0
- package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js → schema-FNU3WE4O.js} +7 -6
- package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js → schema-NBCM3RAD.js} +7 -6
- package/dist/cli-bundle/chunks/update-WWBYOPXO.js +21 -0
- package/dist/cli-bundle/chunks/update-WWBYOPXO.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-Q3UCILNR.js → update-XHSIAIXE.js} +12 -12
- package/dist/cli-bundle/chunks/update-XHSIAIXE.js.map +1 -0
- package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +32 -0
- package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +36 -0
- package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js.map +1 -0
- package/dist/cli-bundle/main.js +826 -43
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/cli-bundle/sdk-runtime.js +70 -57
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +876 -74
- package/dist/cli-bundle/sdk.js.map +4 -4
- package/dist/cli.js +5 -4
- package/dist/cli.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +12 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/history/projection.d.ts +39 -0
- package/dist/core/history/projection.js +164 -0
- package/dist/core/history/projection.js.map +1 -0
- package/dist/core/history/read.d.ts +3 -0
- package/dist/core/history/read.js +55 -0
- package/dist/core/history/read.js.map +1 -0
- package/dist/core/output/output-control.d.ts +18 -0
- package/dist/core/output/output-control.js +26 -0
- package/dist/core/output/output-control.js.map +1 -0
- package/dist/core/output/output.js +20 -8
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/sentry/helpers.js +10 -2
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/shared/command-types.d.ts +2 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/errors.d.ts +11 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/tool-definitions.js +5 -5
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/author-attribution.d.ts +35 -0
- package/dist/sdk/author-attribution.js +118 -0
- package/dist/sdk/author-attribution.js.map +1 -0
- package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -0
- package/dist/sdk/cli-contracts/command-aliases.js +17 -0
- package/dist/sdk/cli-contracts/command-aliases.js.map +1 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +6 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +21 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +3 -3
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -0
- package/dist/sdk/cli-contracts.js +3 -2
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/cli-program.d.ts +8 -0
- package/dist/sdk/cli-program.js +39 -0
- package/dist/sdk/cli-program.js.map +1 -0
- package/dist/sdk/command-line.d.ts +11 -0
- package/dist/sdk/command-line.js +40 -0
- package/dist/sdk/command-line.js.map +1 -0
- package/dist/sdk/config.d.ts +163 -0
- package/dist/sdk/config.js +1087 -0
- package/dist/sdk/config.js.map +1 -0
- package/dist/sdk/context-relevance.d.ts +21 -0
- package/dist/sdk/context-relevance.js +70 -2
- package/dist/sdk/context-relevance.js.map +1 -1
- package/dist/sdk/dependencies.d.ts +15 -2
- package/dist/sdk/dependencies.js +97 -8
- package/dist/sdk/dependencies.js.map +1 -1
- package/dist/{cli/commands → sdk}/extension/bundled-catalog.d.ts +1 -1
- package/dist/{cli/commands → sdk}/extension/bundled-catalog.js +12 -12
- package/dist/sdk/extension/bundled-catalog.js.map +1 -0
- package/dist/sdk/extension/concurrency.d.ts +7 -0
- package/dist/sdk/extension/concurrency.js +26 -0
- package/dist/sdk/extension/concurrency.js.map +1 -0
- package/dist/sdk/extension/describe.d.ts +91 -0
- package/dist/sdk/extension/describe.js +144 -0
- package/dist/sdk/extension/describe.js.map +1 -0
- package/dist/{cli/commands → sdk}/extension/doctor.d.ts +3 -3
- package/dist/{cli/commands → sdk}/extension/doctor.js +7 -7
- package/dist/sdk/extension/doctor.js.map +1 -0
- package/dist/sdk/extension/install-runtime.d.ts +26 -0
- package/dist/sdk/extension/install-runtime.js +269 -0
- package/dist/sdk/extension/install-runtime.js.map +1 -0
- package/dist/sdk/extension/install-snapshot.d.ts +23 -0
- package/dist/sdk/extension/install-snapshot.js +66 -0
- package/dist/sdk/extension/install-snapshot.js.map +1 -0
- package/dist/{cli/commands → sdk}/extension/install-sources.d.ts +3 -3
- package/dist/{cli/commands → sdk}/extension/install-sources.js +15 -12
- package/dist/sdk/extension/install-sources.js.map +1 -0
- package/dist/{cli/commands → sdk}/extension/managed-state.js +6 -6
- package/dist/sdk/extension/managed-state.js.map +1 -0
- package/dist/sdk/extension/scaffold.d.ts +36 -0
- package/dist/sdk/extension/scaffold.js +2436 -0
- package/dist/sdk/extension/scaffold.js.map +1 -0
- package/dist/sdk/extension/shared.d.ts +28 -0
- package/dist/sdk/extension/shared.js +140 -0
- package/dist/sdk/extension/shared.js.map +1 -0
- package/dist/sdk/extension/update-check.d.ts +15 -0
- package/dist/sdk/extension/update-check.js +68 -0
- package/dist/sdk/extension/update-check.js.map +1 -0
- package/dist/sdk/extension.d.ts +367 -0
- package/dist/sdk/extension.js +2174 -0
- package/dist/sdk/extension.js.map +1 -0
- package/dist/sdk/governance/gc.d.ts +56 -0
- package/dist/sdk/governance/gc.js +276 -0
- package/dist/sdk/governance/gc.js.map +1 -0
- package/dist/sdk/governance/health.d.ts +187 -0
- package/dist/sdk/governance/health.js +1796 -0
- package/dist/sdk/governance/health.js.map +1 -0
- package/dist/sdk/governance/validate.d.ts +255 -0
- package/dist/sdk/governance/validate.js +2175 -0
- package/dist/sdk/governance/validate.js.map +1 -0
- package/dist/sdk/history-compact.d.ts +142 -0
- package/dist/sdk/history-compact.js +508 -0
- package/dist/sdk/history-compact.js.map +1 -0
- package/dist/sdk/history-mcp.d.ts +17 -0
- package/dist/sdk/history-mcp.js +68 -0
- package/dist/sdk/history-mcp.js.map +1 -0
- package/dist/sdk/history-read.d.ts +31 -0
- package/dist/sdk/history-read.js +58 -0
- package/dist/sdk/history-read.js.map +1 -0
- package/dist/sdk/history-redact.d.ts +120 -0
- package/dist/sdk/history-redact.js +577 -0
- package/dist/sdk/history-redact.js.map +1 -0
- package/dist/sdk/history-repair.d.ts +89 -0
- package/dist/sdk/history-repair.js +263 -0
- package/dist/sdk/history-repair.js.map +1 -0
- package/dist/sdk/index.d.ts +25 -1
- package/dist/sdk/index.js +27 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/init-agent-guidance.d.ts +113 -0
- package/dist/sdk/init-agent-guidance.js +437 -0
- package/dist/sdk/init-agent-guidance.js.map +1 -0
- package/dist/sdk/init.d.ts +186 -0
- package/dist/sdk/init.js +733 -0
- package/dist/sdk/init.js.map +1 -0
- package/dist/sdk/invocation-author.d.ts +2 -0
- package/dist/sdk/invocation-author.js +39 -0
- package/dist/sdk/invocation-author.js.map +1 -0
- package/dist/sdk/item-children.d.ts +45 -0
- package/dist/sdk/item-children.js +75 -0
- package/dist/sdk/item-children.js.map +1 -0
- package/dist/sdk/item-schedule.d.ts +26 -0
- package/dist/sdk/item-schedule.js +28 -0
- package/dist/sdk/item-schedule.js.map +1 -0
- package/dist/sdk/output.d.ts +7 -0
- package/dist/sdk/output.js +11 -0
- package/dist/sdk/output.js.map +1 -0
- package/dist/sdk/pagination.d.ts +4 -1
- package/dist/sdk/pagination.js +13 -5
- package/dist/sdk/pagination.js.map +1 -1
- package/dist/sdk/profile.d.ts +176 -0
- package/dist/sdk/profile.js +431 -0
- package/dist/sdk/profile.js.map +1 -0
- package/dist/sdk/relationship-analytics.d.ts +108 -0
- package/dist/sdk/relationship-analytics.js +292 -0
- package/dist/sdk/relationship-analytics.js.map +1 -0
- package/dist/sdk/relationship-context.d.ts +67 -0
- package/dist/sdk/relationship-context.js +207 -0
- package/dist/sdk/relationship-context.js.map +1 -0
- package/dist/sdk/relationship-history.d.ts +109 -0
- package/dist/sdk/relationship-history.js +401 -0
- package/dist/sdk/relationship-history.js.map +1 -0
- package/dist/sdk/relationships.d.ts +145 -0
- package/dist/sdk/relationships.js +551 -0
- package/dist/sdk/relationships.js.map +1 -0
- package/dist/sdk/runtime-input.d.ts +10 -0
- package/dist/sdk/runtime-input.js +60 -0
- package/dist/sdk/runtime-input.js.map +1 -0
- package/dist/sdk/runtime.d.ts +31 -8
- package/dist/sdk/runtime.js +61 -57
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/schema.d.ts +507 -0
- package/dist/sdk/schema.js +1269 -0
- package/dist/sdk/schema.js.map +1 -0
- package/dist/{cli/commands → sdk}/templates.d.ts +1 -1
- package/dist/{cli/commands → sdk}/templates.js +9 -9
- package/dist/sdk/templates.js.map +1 -0
- package/dist/{cli/commands → sdk}/test/linked-command-detection.d.ts +10 -2
- package/dist/sdk/test/linked-command-detection.js +525 -0
- package/dist/sdk/test/linked-command-detection.js.map +1 -0
- package/docs/COMMANDS.md +58 -40
- package/docs/EXTENSIONS.md +10 -1
- package/docs/RELATIONSHIP_GRAPH.md +113 -0
- package/docs/RELEASING.md +2 -0
- package/docs/SDK.md +156 -9
- package/docs/SDK_CUSTOMIZATION_PRIMITIVES.md +79 -0
- package/marketplace.json +2 -2
- package/package.json +3 -2
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +76 -16
- package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +8 -0
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/scripts/bundle-cli.mjs +66 -23
- package/dist/cli/commands/extension/bundled-catalog.js.map +0 -1
- package/dist/cli/commands/extension/doctor.js.map +0 -1
- package/dist/cli/commands/extension/install-sources.js.map +0 -1
- package/dist/cli/commands/extension/managed-state.js.map +0 -1
- package/dist/cli/commands/templates.js.map +0 -1
- package/dist/cli/commands/test/linked-command-detection.js +0 -248
- package/dist/cli/commands/test/linked-command-detection.js.map +0 -1
- package/dist/cli-bundle/chunks/append-DYQWQK2J.js +0 -11
- package/dist/cli-bundle/chunks/chunk-2GA3NK35.js +0 -530
- package/dist/cli-bundle/chunks/chunk-2GA3NK35.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2QIQGYPW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4DY4KPQI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4WREH7RT.js +0 -554
- package/dist/cli-bundle/chunks/chunk-4WREH7RT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5CT5BW6E.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5URI7TPJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6MHSBDGD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6OTZMORS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6PKA3SJQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6TTOHMTB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7QDSYUMF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7TQMR6LK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js +0 -312
- package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BPD26E3P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CDJYP7OQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js +0 -858
- package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DVOLZJ3C.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DYEX6NFH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-F7PSHRNO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js +0 -875
- package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FTQLW4JD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IA3YFTXT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IGED7NH2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-J4NZOP3I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JL7WZ4O2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-L24HCJFC.js +0 -309
- package/dist/cli-bundle/chunks/chunk-L24HCJFC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LWTIRS3Y.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MKL4CP2I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N3CMP4NI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PHKP3AGR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Q37E63AM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QASRVKUQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RGXD5JJR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UB2QYSTO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UGTVWL3E.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZAYYDNB3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZUKSZVBW.js.map +0 -7
- package/dist/cli-bundle/chunks/close-RI4JQQHU.js +0 -12
- package/dist/cli-bundle/chunks/close-many-LY2XJ52M.js +0 -21
- package/dist/cli-bundle/chunks/comments-35M273DN.js +0 -13
- package/dist/cli-bundle/chunks/copy-NPYM7M7U.js +0 -9
- package/dist/cli-bundle/chunks/delete-ODRWJWAM.js +0 -10
- package/dist/cli-bundle/chunks/docs-G7N4E2JO.js +0 -14
- package/dist/cli-bundle/chunks/focus-U5TRVCRS.js +0 -10
- package/dist/cli-bundle/chunks/history-compact-M7GHYVFN.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-JIHZLHDP.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-NAFCHLH7.js +0 -18
- package/dist/cli-bundle/chunks/learnings-SONGPSHI.js +0 -13
- package/dist/cli-bundle/chunks/notes-BSD53H2W.js +0 -13
- package/dist/cli-bundle/chunks/plan-AWLYGBNV.js +0 -24
- package/dist/cli-bundle/chunks/register-list-query-BUWCYHBT.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-KTZ6AGE7.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-4FMGJJF7.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-66GLMHIX.js +0 -14
- package/dist/cli-bundle/chunks/update-2XGHIVQ2.js +0 -21
- package/dist/cli-bundle/chunks/update-many-75K57FS3.js +0 -34
- package/dist/cli-bundle/chunks/update-many-U42YA445.js +0 -30
- /package/dist/cli-bundle/chunks/{append-PVZJDM6J.js.map → append-OJQFUQ4T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-DYQWQK2J.js.map → append-UZVHUO74.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js.map → chunk-2IFFUZLC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js.map → chunk-2JKGO6QX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js.map → chunk-2NCIPMQP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js.map → chunk-2VPAVL7O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js.map → chunk-2WSE6PO2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js.map → chunk-34L5OT3Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js.map → chunk-3AUGG2DP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js.map → chunk-3CLU2XZO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js.map → chunk-3WM75PWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js.map → chunk-5JLUII3O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js.map → chunk-6N2VXVTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js.map → chunk-6S3YSUYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js.map → chunk-AHVTB5I5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js.map → chunk-APRVSW2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js.map → chunk-B7PE22W6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js.map → chunk-BCOFWYW4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js.map → chunk-BEP7WJA2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js.map → chunk-CRVF2JDM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js.map → chunk-DM4H7FP4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-LZECOMHO.js.map → chunk-DUT67M43.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-44LNIULG.js.map → chunk-DYH63FX7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js.map → chunk-EAB64KLB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js.map → chunk-EACOH7AU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js.map → chunk-EJEXHTY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js.map → chunk-EYLCSJAI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-655STMGA.js.map → chunk-FMBNM2EN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js.map → chunk-FNSPG7MU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KB726FMH.js.map → chunk-H2Z3FYXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js.map → chunk-IA5FKNII.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js.map → chunk-IJIICKVW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js.map → chunk-JOUQZENX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js.map → chunk-JYFOV7FC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js.map → chunk-K2X6U4UA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js.map → chunk-KG44YSKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js.map → chunk-KPMKHGEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js.map → chunk-MIQDDLB5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js.map → chunk-NLDFBC6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js.map → chunk-NP22ERDF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js.map → chunk-NU3IMIEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js.map → chunk-NVPZIJVR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js.map → chunk-ODALILG3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js.map → chunk-ONREO4ST.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js.map → chunk-P74IZQ7A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js.map → chunk-PGY23YTC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js.map → chunk-PMOSXADO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-RI4JQQHU.js.map → chunk-PNTULOGU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js.map → chunk-Q7A43DS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js.map → chunk-QEHQ2GVG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js.map → chunk-QIPLHNP7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js.map → chunk-QKJGPFAF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js.map → chunk-RLCHOOHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js.map → chunk-RMLWNPH2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js.map → chunk-RRM5JYJC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js.map → chunk-S6MQESFR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js.map → chunk-SDQLJWBO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js.map → chunk-SELVXEZK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js.map → chunk-TKOVBP6C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js.map → chunk-TQSZFPIS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js.map → chunk-TSMHDIW4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js.map → chunk-UFXU44HV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js.map → chunk-ULTHRDBP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js.map → chunk-UOHFKBUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js.map → chunk-UY2ACEMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js.map → chunk-WUJQK4YV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js.map → chunk-XSJUSQAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js.map → chunk-YAQEBNY7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js.map → chunk-YBLZ2VE7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js.map → chunk-YCQET3OT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-LY2XJ52M.js.map → chunk-YUSOJDWM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js.map → chunk-ZI6VQWQ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js.map → close-CWODTPKG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-35M273DN.js.map → close-W6LI2PKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js.map → close-many-CQFUY7MR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-NPYM7M7U.js.map → close-many-DLDDVSH5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-F53OBTOU.js.map → comments-E3TNTK24.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js.map → comments-WGLHR7LB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js.map → copy-LXVDXH7B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ODRWJWAM.js.map → copy-Q5ZJPUKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-U57I7EAK.js.map → create-J5U6ND4K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js.map → create-LBVCYMEG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js.map → delete-PMJBNY5G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-G7N4E2JO.js.map → delete-WNHB3LYW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-TTY6N2AV.js.map → deps-JZ7TMVCB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-TBZD7V6H.js.map → deps-OA26IS25.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js.map → docs-FEWB2DQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-U5TRVCRS.js.map → docs-HA2AIDBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-M7GHYVFN.js.map → files-6YFBJRBG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js.map → files-EFIWKFTM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js.map → focus-4QJR7FOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-JIHZLHDP.js.map → focus-POIW5LTJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js.map → history-compact-CKRPDTJN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-NAFCHLH7.js.map → history-compact-FWG2C7FZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-SONGPSHI.js.map → history-redact-BB3TGDAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js.map → history-redact-D225BHOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-BSD53H2W.js.map → history-repair-6GEAM7HE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js.map → history-repair-RQXKQHL4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-2NNEO46V.js.map → learnings-JLNLCOL5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-AWLYGBNV.js.map → learnings-RSNLSWDC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-U725ATWZ.js.map → notes-2WDH6DXU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js.map → notes-GB47XXQQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-66GLMHIX.js.map → plan-DOVI2VMW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js.map → plan-VDCJ2PCN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js.map → profile-FAU7NZML.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js.map → profile-IVXQEL3D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-Q3UCILNR.js.map → restore-25DLT2Q2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-2XGHIVQ2.js.map → restore-YPMVUUEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-75K57FS3.js.map → schema-FNU3WE4O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-U42YA445.js.map → schema-NBCM3RAD.js.map} +0 -0
- /package/dist/{cli/commands → sdk}/extension/managed-state.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-redact.js","sources":["cli/commands/history-redact.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/history-redact\n *\n * Implements the pm history redact command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport {\n pathExists,\n readFileIfExists,\n writeFileAtomic,\n} from \"../../core/fs/fs-utils.js\";\nimport { createHistoryEntry } from \"../../core/history/history.js\";\nimport { executeHistoryRewrite } 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 {\n canonicalDocument,\n serializeItemDocument,\n} from \"../../core/item/item-format.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.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 {\n getActiveExtensionRegistrations,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport {\n getHistoryPath,\n getItemPath,\n getSettingsPath,\n resolvePmRoot,\n} from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type {\n HistoryEntry,\n HistoryPatchOp,\n ItemDocument,\n} from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\n\n/** Documents the history redact command options payload exchanged by command, SDK, and package integrations. */\nexport interface HistoryRedactCommandOptions {\n /** Value that configures or reports literal for this contract. */\n literal?: string[] | string;\n /** Value that configures or reports regex for this contract. */\n regex?: string[] | string;\n /** Value that configures or reports replacement for this contract. */\n replacement?: string;\n /** Value that configures or reports dry run for this contract. */\n dryRun?: boolean;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports force for this contract. */\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\ninterface HistoryRedactCurrentItem {\n raw: string | null;\n path: string | null;\n document: ItemDocument | null;\n}\n\ninterface HistoryRedactNextItem {\n raw: string | null;\n path: string | null;\n document: ItemDocument | null;\n}\n\n/** Documents the history subject payload exchanged by command, SDK, and package integrations. */\nexport interface HistorySubject {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Filesystem path used for history resolution. */\n historyPath: string;\n /** Value that configures or reports located for this contract. */\n located: Awaited<ReturnType<typeof locateItem>>;\n}\n\n/** Documents the history redact result payload exchanged by command, SDK, and package integrations. */\nexport interface HistoryRedactResult {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports dry run for this contract. */\n dry_run: boolean;\n /** Value that configures or reports changed for this contract. */\n changed: boolean;\n /** Value that configures or reports patterns for this contract. */\n patterns: {\n literals: string[];\n regex: string[];\n replacement: string;\n };\n /** Value that configures or reports history for this contract. */\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 /** Value that configures or reports item for this contract. */\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 /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** ISO 8601 timestamp recording when generated occurred. */\n generated_at: string;\n}\n\nfunction normalizeStringArrayInput(\n value: string[] | string | undefined,\n): 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(\n \"history-redact --regex requires a non-empty pattern.\",\n EXIT_CODE.USAGE,\n );\n }\n\n let source = trimmed;\n let flags = \"g\";\n if (trimmed.startsWith(\"/\") && trimmed.length > 1) {\n /* c8 ignore start -- bare-slash regex literals are rejected earlier in argument validation. */\n const slashIndex = trimmed.lastIndexOf(\"/\");\n if (slashIndex > 0) {\n source = trimmed.slice(1, slashIndex);\n flags = normalizeRegexFlags(trimmed.slice(slashIndex + 1));\n }\n /* c8 ignore stop */\n }\n if (source.length === 0) {\n throw new PmCliError(\n \"history-redact --regex cannot use an empty pattern.\",\n EXIT_CODE.USAGE,\n );\n }\n try {\n new RegExp(source, flags);\n } catch (error) {\n /* c8 ignore start -- RegExp constructor failures are normalized in higher-level parser tests. */\n throw new PmCliError(\n `Invalid --regex value \"${spec}\": ${error instanceof Error ? error.message : String(error)}`,\n EXIT_CODE.USAGE,\n );\n /* c8 ignore stop */\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 = [\n ...new Set(\n normalizeStringArrayInput(literalInput).map((entry) => entry.trim()),\n ),\n ]\n .filter((entry) => entry.length > 0)\n .map<LiteralRule>((entry) => ({\n kind: \"literal\",\n value: entry,\n label: entry,\n }));\n const regexRules = [\n ...new Set(\n normalizeStringArrayInput(regexInput).map((entry) => entry.trim()),\n ),\n ]\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(\n value: string,\n literal: string,\n replacement: string,\n): { 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(\n value: string,\n rule: RegexRule,\n replacement: string,\n): { 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(\n value: string,\n rules: RedactionRule[],\n replacement: string,\n): { 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(\n value: unknown,\n rules: RedactionRule[],\n replacement: string,\n): { 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(\n current: ReplayDocument,\n patch: HistoryPatchOp[],\n entryNumber: number,\n op: string,\n): ReplayDocument {\n const result = tryApplyReplayPatch(current, patch);\n /* c8 ignore start -- invalid patch replay paths are covered by replay helper tests. */\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\n ? result.error.message\n : String(result.error)\n }`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n /* c8 ignore stop */\n return result.document;\n}\n\nfunction inspectHistoryIntegrity(\n entries: HistoryEntry[],\n): 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 /* c8 ignore start -- after-hash mismatch branch is exercised in dedicated history integrity tests. */\n if (replayHash(replay) !== entry.after_hash) {\n hashMismatchesAfter += 1;\n }\n /* c8 ignore stop */\n }\n return {\n hashMismatchesBefore,\n hashMismatchesAfter,\n finalDocument: replay,\n };\n}\n\nfunction redactHistoryEntry(\n entry: HistoryEntry,\n rules: RedactionRule[],\n replacement: string,\n): {\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(\n entry.message,\n rules,\n replacement,\n );\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 /* c8 ignore start -- patch operations without `value` are covered in lower-level patch adapters. */\n if (!Object.prototype.hasOwnProperty.call(operation, \"value\")) {\n return operation;\n }\n /* c8 ignore stop */\n const redactedValue = redactUnknownValue(\n operation.value,\n rules,\n replacement,\n );\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(\n entries: HistoryEntry[],\n rules: RedactionRule[],\n replacement: string,\n): 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(\n replay,\n redacted.entry.patch,\n index + 1,\n redacted.entry.op,\n );\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\nasync function loadHistoryRedactCurrentItem(\n subject: HistorySubject,\n settings: Awaited<ReturnType<typeof readSettings>>,\n): Promise<HistoryRedactCurrentItem> {\n const currentItemPath = subject.located?.itemPath ?? null;\n if (!subject.located) {\n return { raw: null, path: currentItemPath, document: null };\n }\n const loaded = await readLocatedItem(subject.located, {\n schema: settings.schema,\n });\n return { raw: loaded.raw, path: currentItemPath, document: loaded.document };\n}\n\nfunction resolveHistoryRedactNextItem(params: {\n pmRoot: string;\n subject: HistorySubject;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeToFolder: Record<string, string>;\n finalDocument: ReplayDocument;\n}): HistoryRedactNextItem {\n if (!hasItemMetadata(params.finalDocument)) {\n return { raw: null, path: null, document: null };\n }\n const canonical = canonicalDocument(\n replayToItemDocument(params.finalDocument),\n { schema: params.settings.schema },\n );\n if (canonical.metadata.id !== params.subject.id) {\n throw new PmCliError(\n `history-redact would change item id from ${params.subject.id} to ${canonical.metadata.id}; narrow your patterns.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n document: canonical,\n path: getItemPath(\n params.pmRoot,\n canonical.metadata.type,\n params.subject.id,\n \"toon\",\n params.typeToFolder,\n ),\n raw: serializeItemDocument(canonical, {\n format: \"toon\",\n schema: params.settings.schema,\n }),\n };\n}\n\n/* v8 ignore start -- message passthrough/plural formatting is deterministic around covered redaction outcomes */\nfunction buildHistoryRedactMessage(\n options: HistoryRedactCommandOptions,\n rewritten: RedactionRewriteResult,\n): string {\n if (\n typeof options.message === \"string\" &&\n options.message.trim().length > 0\n ) {\n return options.message;\n }\n return `history-redact replaced ${rewritten.replacements} match(es) across ${rewritten.entriesChanged} entr${\n rewritten.entriesChanged === 1 ? \"y\" : \"ies\"\n }.`;\n}\n/* v8 ignore stop */\n\nfunction buildHistoryRedactEntries(params: {\n rewritten: RedactionRewriteResult;\n dryRun: boolean;\n changed: boolean;\n nextItemDocument: ItemDocument | null;\n author: string;\n message: string;\n}): { rewrittenEntries: HistoryEntry[]; auditEntryAdded: boolean } {\n const rewrittenEntries = [...params.rewritten.entries];\n if (params.dryRun || !params.changed) {\n return { rewrittenEntries, auditEntryAdded: false };\n }\n /* c8 ignore next -- fallback replay-to-item conversion runs only when rewritten final metadata is absent. */\n const finalDocument =\n params.nextItemDocument ??\n replayToItemDocument(params.rewritten.finalDocument);\n rewrittenEntries.push(\n createHistoryEntry({\n nowIso: nowIso(),\n author: params.author,\n op: \"history_redact\",\n before: finalDocument,\n after: finalDocument,\n message: params.message,\n }),\n );\n return { rewrittenEntries, auditEntryAdded: true };\n}\n\nasync function applyHistoryRedactRewrite(params: {\n pmRoot: string;\n subject: HistorySubject;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeRegistry: ReturnType<typeof resolveItemTypeRegistry>;\n historyRawBeforeLock: string | null;\n currentItem: HistoryRedactCurrentItem;\n nextItem: HistoryRedactNextItem;\n author: string;\n force: boolean | undefined;\n rewrittenEntries: HistoryEntry[];\n}): Promise<string[]> {\n return executeHistoryRewrite({\n pmRoot: params.pmRoot,\n subject: params.subject,\n settings: params.settings,\n typeRegistry: params.typeRegistry,\n historyRawBeforeLock: params.historyRawBeforeLock,\n currentItemRawBeforeLock: params.currentItem.raw,\n operation: \"history-redact\",\n author: params.author,\n force: params.force,\n itemDocument: params.currentItem.document,\n applyRewrite: async ({ historyRawUnderLock }) => {\n const affectedItemPaths = new Set<string>();\n if (params.currentItem.path) {\n affectedItemPaths.add(params.currentItem.path);\n }\n if (params.nextItem.path) {\n affectedItemPaths.add(params.nextItem.path);\n }\n const itemSnapshots = new Map<string, string>();\n if (params.currentItem.path && params.currentItem.raw !== null) {\n itemSnapshots.set(params.currentItem.path, params.currentItem.raw);\n }\n try {\n /* c8 ignore next -- item-write diff branch requires path and content divergence under lock races. */\n if (\n params.nextItem.path &&\n params.nextItem.raw !== null &&\n params.nextItem.raw !== params.currentItem.raw\n ) {\n await writeFileAtomic(params.nextItem.path, params.nextItem.raw);\n }\n if (\n params.currentItem.path &&\n (!params.nextItem.path ||\n params.nextItem.path !== params.currentItem.path)\n ) {\n await fs.rm(params.currentItem.path, { force: true });\n }\n await writeFileAtomic(\n params.subject.historyPath,\n historyEntriesToRaw(params.rewrittenEntries),\n );\n } catch (error) {\n await rollbackHistoryRedactRewrite(\n params.subject.historyPath,\n historyRawUnderLock,\n affectedItemPaths,\n itemSnapshots,\n );\n throw error;\n }\n },\n applyPostRewrite: async () =>\n runHistoryRedactWriteHooks(params.subject.historyPath, [\n params.nextItem.path,\n params.currentItem.path,\n ]),\n });\n}\n\nasync function rollbackHistoryRedactRewrite(\n historyPath: string,\n historyRawUnderLock: string | null,\n affectedItemPaths: Set<string>,\n itemSnapshots: Map<string, string>,\n): Promise<void> {\n /* c8 ignore start -- no-history-under-lock rollback path is exercised in lock-race integration tests. */\n if (historyRawUnderLock === null) {\n await fs.rm(historyPath, { force: true });\n } else {\n await writeFileAtomic(historyPath, historyRawUnderLock);\n }\n /* c8 ignore stop */\n for (const itemPath of affectedItemPaths) {\n const snapshot = itemSnapshots.get(itemPath);\n /* c8 ignore start -- missing snapshot rollback occurs only for create/delete race permutations. */\n if (snapshot === undefined) {\n await fs.rm(itemPath, { force: true });\n } else {\n await writeFileAtomic(itemPath, snapshot);\n }\n /* c8 ignore stop */\n }\n}\n\nasync function runHistoryRedactWriteHooks(\n historyPath: string,\n itemHookPaths: Array<string | null>,\n): Promise<string[]> {\n const hookWarnings: string[] = [];\n const uniqueItemHookPaths = new Set(\n itemHookPaths.filter((itemPath): itemPath is string => itemPath !== null),\n );\n for (const itemHookPath of uniqueItemHookPaths) {\n hookWarnings.push(\n ...(await runActiveOnWriteHooks({\n path: itemHookPath,\n scope: \"project\",\n op: \"history_redact\",\n })),\n );\n }\n hookWarnings.push(\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"history_redact:history\",\n })),\n );\n return hookWarnings;\n}\n\n/** Implements resolve history subject for the public runtime surface of this module. */\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(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeToFolder,\n );\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 =\n normalizedId === rawNormalizedId\n ? [normalizedId]\n : [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\n/** Implements run history redact for the public runtime surface of this module. */\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(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const replacement =\n typeof options.replacement === \"string\" && options.replacement.length > 0\n ? options.replacement\n : \"[redacted]\";\n const rules = buildRedactionRules(options.literal, options.regex);\n const subject = await resolveHistorySubject(\n pmRoot,\n id,\n settings,\n typeRegistry.type_to_folder,\n );\n\n if (!(await pathExists(subject.historyPath))) {\n throw new PmCliError(\n `No history stream exists for ${subject.id}.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const historyRawBeforeLock = await readFileIfExists(subject.historyPath);\n const historyEntries = await readHistoryEntries(\n subject.historyPath,\n subject.id,\n );\n if (historyEntries.length === 0) {\n throw new PmCliError(\n `No history entries exist for ${subject.id}; nothing to redact.`,\n EXIT_CODE.USAGE,\n );\n }\n\n const integritySnapshot = inspectHistoryIntegrity(historyEntries);\n const rewritten = rewriteHistoryEntries(historyEntries, rules, replacement);\n const preexistingHashMismatches =\n integritySnapshot.hashMismatchesBefore +\n 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(\n `history_redact_preexisting_hash_mismatches:${preexistingHashMismatches}`,\n );\n }\n if (!changed) {\n warnings.push(\"history_redact_no_matches\");\n }\n\n const currentItem = await loadHistoryRedactCurrentItem(subject, settings);\n const nextItem = resolveHistoryRedactNextItem({\n pmRoot,\n subject,\n settings,\n typeToFolder: typeRegistry.type_to_folder,\n finalDocument: rewritten.finalDocument,\n });\n\n const itemChanged =\n /* c8 ignore next -- null-coalescing item-path comparison branch is exercised in broader command integration coverage. */\n (currentItem.path ?? null) !== (nextItem.path ?? null) ||\n /* c8 ignore next -- null-coalescing item-content comparison branch is exercised in broader command integration coverage. */\n (currentItem.raw ?? null) !== (nextItem.raw ?? null);\n\n const author = resolveAuthor(options.author, settings.author_default);\n const redactionMessage = buildHistoryRedactMessage(options, rewritten);\n const { rewrittenEntries, auditEntryAdded } = buildHistoryRedactEntries({\n rewritten,\n dryRun,\n changed,\n nextItemDocument: nextItem.document,\n author,\n message: redactionMessage,\n });\n const historyVerify = verifyHistoryChain(rewrittenEntries);\n /* c8 ignore start -- invalid rewritten chains are covered by history verification unit tests. */\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 /* c8 ignore stop */\n\n if (!dryRun && changed) {\n warnings.push(\n ...(await applyHistoryRedactRewrite({\n pmRoot,\n subject,\n settings,\n typeRegistry,\n historyRawBeforeLock,\n currentItem,\n nextItem,\n author,\n force: options.force,\n rewrittenEntries,\n })),\n );\n }\n\n return {\n id: subject.id,\n dry_run: dryRun,\n changed,\n patterns: {\n literals: rules\n .filter((rule): rule is LiteralRule => rule.kind === \"literal\")\n .map((rule) => rule.value),\n regex: rules\n .filter((rule): rule is RegexRule => rule.kind === \"regex\")\n .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: currentItem.path !== null,\n exists_after: nextItem.path !== null,\n path_before: currentItem.path,\n path_after: nextItem.path,\n changed: itemChanged,\n },\n /* c8 ignore next -- warning dedupe ordering is covered indirectly by command-level smoke tests. */\n warnings: [...new Set(warnings)].sort((left, right) =>\n left.localeCompare(right),\n ),\n generated_at: nowIso(),\n };\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n applyLiteralRule,\n applyRegexRule,\n buildRedactionRules,\n hasItemMetadata,\n normalizeRegexFlags,\n normalizeStringArrayInput,\n parseRegexRule,\n redactStringValue,\n redactUnknownValue,\n};\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GAEnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,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BAAqB,EAAE,iBAAiB,CAAC,mBAAmB;YAC5D,2BAA2B,EAAE,yBAAyB;YACtD,iBAAiB,EAAE,eAAe;YAClC,SAAS,EAAE,aAAa,CAAC,EAAE;YAC3B,aAAa,EAAE,aAAa,CAAC,MAAM;SACpC;QACD,IAAI,EAAE;YACJ,cAAc,EAAE,WAAW,CAAC,IAAI,KAAK,IAAI;YACzC,YAAY,EAAE,QAAQ,CAAC,IAAI,KAAK,IAAI;YACpC,WAAW,EAAE,WAAW,CAAC,IAAI;YAC7B,UAAU,EAAE,QAAQ,CAAC,IAAI;YACzB,OAAO,EAAE,WAAW;SACrB;QACD,mGAAmG;QACnG,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACpD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAC1B;QACD,YAAY,EAAE,MAAM,EAAE;KACvB,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,eAAe;IACf,mBAAmB;IACnB,yBAAyB;IACzB,cAAc;IACd,iBAAiB;IACjB,kBAAkB;CACnB,CAAC","debugId":"c10a0e85-a013-5cdc-8120-effe2c6b25f9"}
|
|
1
|
+
{"version":3,"file":"history-redact.js","sources":["cli/commands/history-redact.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/history-redact\n *\n * Presentation compatibility shim for the public SDK history-redaction\n * primitive. CLI registration imports this module so extensions and existing\n * integrations keep a stable command path while all domain logic is SDK-owned.\n */\nexport {\n _testOnly,\n resolveHistorySubject,\n runHistoryRedact,\n type HistoryRedactCommandOptions,\n type HistoryRedactResult,\n type HistorySubject,\n} from \"../../sdk/history-redact.js\";\n"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;AACH,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,gBAAgB,GAIjB,MAAM,6BAA6B,CAAC","debugId":"9c8bd422-4982-5eb8-97c4-34a48b2c5b78"}
|
|
@@ -1,89 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/** Human-readable explanation suitable for logs and agent-facing output. */
|
|
9
|
-
message?: string;
|
|
10
|
-
/** Value that configures or reports force for this contract. */
|
|
11
|
-
force?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/** Documents the history repair result payload exchanged by command, SDK, and package integrations. */
|
|
14
|
-
export interface HistoryRepairResult {
|
|
15
|
-
/** Stable identifier used to reference this record across commands and storage. */
|
|
16
|
-
id: string;
|
|
17
|
-
/** Value that configures or reports dry run for this contract. */
|
|
18
|
-
dry_run: boolean;
|
|
19
|
-
/** Value that configures or reports changed for this contract. */
|
|
20
|
-
changed: boolean;
|
|
21
|
-
/** Value that configures or reports history for this contract. */
|
|
22
|
-
history: {
|
|
23
|
-
path: string;
|
|
24
|
-
entries_scanned: number;
|
|
25
|
-
chain_drift_before: boolean;
|
|
26
|
-
entries_rehashed: number;
|
|
27
|
-
entries_patch_repaired: number;
|
|
28
|
-
converted_replace_to_add: number;
|
|
29
|
-
skipped_ops: number;
|
|
30
|
-
reconciled_with_item: boolean;
|
|
31
|
-
audit_entry_added: boolean;
|
|
32
|
-
verify_ok: boolean;
|
|
33
|
-
verify_errors: string[];
|
|
34
|
-
};
|
|
35
|
-
/** Value that configures or reports item for this contract. */
|
|
36
|
-
item: {
|
|
37
|
-
exists: boolean;
|
|
38
|
-
path: string | null;
|
|
39
|
-
matched_chain_before: boolean | null;
|
|
40
|
-
};
|
|
41
|
-
/** Value that configures or reports warnings for this contract. */
|
|
42
|
-
warnings: string[];
|
|
43
|
-
/** ISO 8601 timestamp recording when generated occurred. */
|
|
44
|
-
generated_at: string;
|
|
45
|
-
}
|
|
46
|
-
/** Implements run history repair for the public runtime surface of this module. */
|
|
47
|
-
export declare function runHistoryRepair(id: string, options: HistoryRepairCommandOptions, global: GlobalOptions): Promise<HistoryRepairResult>;
|
|
48
|
-
/** Documents the history repair all stream result payload exchanged by command, SDK, and package integrations. */
|
|
49
|
-
export interface HistoryRepairAllStreamResult {
|
|
50
|
-
/** Stable identifier used to reference this record across commands and storage. */
|
|
51
|
-
id: string;
|
|
52
|
-
/** Value that configures or reports outcome for this contract. */
|
|
53
|
-
outcome: "repaired" | "skipped_clean" | "failed";
|
|
54
|
-
/** Value that configures or reports entries rehashed for this contract. */
|
|
55
|
-
entries_rehashed?: number;
|
|
56
|
-
/** Value that configures or reports entries patch repaired for this contract. */
|
|
57
|
-
entries_patch_repaired?: number;
|
|
58
|
-
/** Value that configures or reports reconciled with item for this contract. */
|
|
59
|
-
reconciled_with_item?: boolean;
|
|
60
|
-
/** Value that configures or reports error for this contract. */
|
|
61
|
-
error?: string;
|
|
62
|
-
}
|
|
63
|
-
/** Documents the history repair all result payload exchanged by command, SDK, and package integrations. */
|
|
64
|
-
export interface HistoryRepairAllResult {
|
|
65
|
-
/** Value that configures or reports all for this contract. */
|
|
66
|
-
all: true;
|
|
67
|
-
/** Value that configures or reports dry run for this contract. */
|
|
68
|
-
dry_run: boolean;
|
|
69
|
-
/** Value that configures or reports scanned streams for this contract. */
|
|
70
|
-
scanned_streams: number;
|
|
71
|
-
/** Value that configures or reports drifted streams for this contract. */
|
|
72
|
-
drifted_streams: number;
|
|
73
|
-
/** One compact row per drifted stream (clean streams are summarized by the counts only). */
|
|
74
|
-
streams: HistoryRepairAllStreamResult[];
|
|
75
|
-
/** Value that configures or reports totals for this contract. */
|
|
76
|
-
totals: {
|
|
77
|
-
repaired: number;
|
|
78
|
-
skipped_clean: number;
|
|
79
|
-
failed: number;
|
|
80
|
-
};
|
|
81
|
-
/** Value that configures or reports warnings for this contract. */
|
|
82
|
-
warnings: string[];
|
|
83
|
-
/** ISO 8601 timestamp recording when generated occurred. */
|
|
84
|
-
generated_at: string;
|
|
85
|
-
}
|
|
86
|
-
/** Enforce the `pm history-repair` target contract shared by the CLI and MCP surfaces: exactly one of an item `<id>` or `--all` must be provided. */
|
|
87
|
-
export declare function assertHistoryRepairTarget(id: string | undefined, all: boolean): void;
|
|
88
|
-
/** Bulk drift repair: scan every item's history stream with the same drift scan `pm health` uses, then run the audited single-stream repair (ownership check, lock, no-drift verification, audit marker) for each drifted stream. One failing stream never aborts the rest; failures are collected per row and the caller decides the exit code from `totals.failed`. */
|
|
89
|
-
export declare function runHistoryRepairAll(options: HistoryRepairCommandOptions, global: GlobalOptions): Promise<HistoryRepairAllResult>;
|
|
1
|
+
/**
|
|
2
|
+
* @module cli/commands/history-repair
|
|
3
|
+
*
|
|
4
|
+
* Presentation compatibility shim for the public SDK history-repair
|
|
5
|
+
* primitives. The SDK owns replay, re-anchor, rollback, and bulk repair logic.
|
|
6
|
+
*/
|
|
7
|
+
export { assertHistoryRepairTarget, runHistoryRepair, runHistoryRepairAll, type HistoryRepairAllResult, type HistoryRepairAllStreamResult, type HistoryRepairCommandOptions, type HistoryRepairResult, } from "../../sdk/history-repair.js";
|
|
@@ -1,263 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module cli/commands/history-repair
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Presentation compatibility shim for the public SDK history-repair
|
|
5
|
+
* primitives. The SDK owns replay, re-anchor, rollback, and bulk repair logic.
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
!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]="
|
|
8
|
-
|
|
9
|
-
import { pathExists, readFileIfExists } from "../../core/fs/fs-utils.js";
|
|
10
|
-
import { executeHistoryRewrite, writeHistoryRawWithRollback, } from "../../core/history/history-rewrite.js";
|
|
11
|
-
import { historyEntriesToRaw, reanchorHistoryEntries, replayHash, toReplayDocument, verifyHistoryChain, } from "../../core/history/replay.js";
|
|
12
|
-
import { scanHistoryDrift } from "../../core/history/drift-scan.js";
|
|
13
|
-
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
14
|
-
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
15
|
-
import { PmCliError } from "../../core/shared/errors.js";
|
|
16
|
-
import { nowIso } from "../../core/shared/time.js";
|
|
17
|
-
import { getActiveExtensionRegistrations, runActiveOnWriteHooks, } from "../../core/extensions/index.js";
|
|
18
|
-
import { listAllItemMetadataWithBody, readLocatedItem, } from "../../core/store/item-store.js";
|
|
19
|
-
import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
20
|
-
import { readSettings } from "../../core/store/settings.js";
|
|
21
|
-
import { readHistoryEntries } from "./history.js";
|
|
22
|
-
import { resolveHistorySubject } from "./history-redact.js";
|
|
23
|
-
function toAuthor(candidate, defaultAuthor) {
|
|
24
|
-
/* c8 ignore next -- PM_AUTHOR fallback branch is environment-dependent in CI. */
|
|
25
|
-
const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;
|
|
26
|
-
const trimmed = resolved.trim();
|
|
27
|
-
return trimmed.length > 0 ? trimmed : "unknown";
|
|
28
|
-
}
|
|
29
|
-
async function loadHistoryRepairItemReplay(subject, settings, historyEntries) {
|
|
30
|
-
const currentItemPath = subject.located?.itemPath ?? null;
|
|
31
|
-
const loadedItem = subject.located
|
|
32
|
-
? await readLocatedItem(subject.located, { schema: settings.schema })
|
|
33
|
-
: null;
|
|
34
|
-
if (!loadedItem) {
|
|
35
|
-
return {
|
|
36
|
-
currentItemReplay: null,
|
|
37
|
-
currentItemPath,
|
|
38
|
-
matchedChainBefore: null,
|
|
39
|
-
currentItemRawBeforeLock: null,
|
|
40
|
-
loadedItem: null,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const currentItemReplay = toReplayDocument(loadedItem.document);
|
|
44
|
-
const lastOriginalAfterHash = historyEntries[historyEntries.length - 1]?.after_hash;
|
|
45
|
-
return {
|
|
46
|
-
currentItemReplay,
|
|
47
|
-
currentItemPath,
|
|
48
|
-
matchedChainBefore: replayHash(currentItemReplay) === lastOriginalAfterHash,
|
|
49
|
-
currentItemRawBeforeLock: loadedItem.raw,
|
|
50
|
-
loadedItem,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function buildHistoryRepairMessage(params) {
|
|
54
|
-
if (typeof params.message === "string" && params.message.trim().length > 0) {
|
|
55
|
-
return params.message;
|
|
56
|
-
}
|
|
57
|
-
/* v8 ignore start -- message suffix/plural variants are deterministic formatting fallbacks around the covered repair outcomes */
|
|
58
|
-
return `history-repair re-anchored ${params.entriesRehashed} entr${params.entriesRehashed === 1 ? "y" : "ies"}${params.entriesPatchRepaired > 0 ? `, repaired ${params.entriesPatchRepaired} patch(es)` : ""}${params.reconcileNeeded ? ", reconciled chain with on-disk item" : ""}.`;
|
|
59
|
-
/* v8 ignore stop */
|
|
60
|
-
}
|
|
61
|
-
function buildHistoryRepairEntries(params) {
|
|
62
|
-
const rewrittenEntries = [...params.reanchorEntries];
|
|
63
|
-
if (!params.changed) {
|
|
64
|
-
return { rewrittenEntries, auditEntryAdded: false };
|
|
65
|
-
}
|
|
66
|
-
const afterReplay = params.reconcileNeeded && params.currentItemReplay
|
|
67
|
-
? params.currentItemReplay
|
|
68
|
-
: params.finalReplay;
|
|
69
|
-
rewrittenEntries.push({
|
|
70
|
-
ts: nowIso(),
|
|
71
|
-
author: params.author,
|
|
72
|
-
op: "history_repair",
|
|
73
|
-
patch: params.reconcileNeeded && params.currentItemReplay
|
|
74
|
-
? jsonPatch.compare(params.finalReplay, params.currentItemReplay)
|
|
75
|
-
: [],
|
|
76
|
-
before_hash: replayHash(params.finalReplay),
|
|
77
|
-
after_hash: replayHash(afterReplay),
|
|
78
|
-
message: params.message,
|
|
79
|
-
});
|
|
80
|
-
return { rewrittenEntries, auditEntryAdded: true };
|
|
81
|
-
}
|
|
82
|
-
function collectHistoryRepairWarnings(changed, skippedOps) {
|
|
83
|
-
const warnings = [];
|
|
84
|
-
if (!changed) {
|
|
85
|
-
warnings.push("history_repair_no_changes");
|
|
86
|
-
}
|
|
87
|
-
if (skippedOps > 0) {
|
|
88
|
-
warnings.push(`history_repair_skipped_unresolvable_ops:${skippedOps}`);
|
|
89
|
-
}
|
|
90
|
-
return warnings;
|
|
91
|
-
}
|
|
92
|
-
async function applyHistoryRepairRewrite(params) {
|
|
93
|
-
return executeHistoryRewrite({
|
|
94
|
-
pmRoot: params.pmRoot,
|
|
95
|
-
subject: params.subject,
|
|
96
|
-
settings: params.settings,
|
|
97
|
-
typeRegistry: params.typeRegistry,
|
|
98
|
-
historyRawBeforeLock: params.historyRawBeforeLock,
|
|
99
|
-
currentItemRawBeforeLock: params.currentItemRawBeforeLock,
|
|
100
|
-
operation: "history-repair",
|
|
101
|
-
author: params.author,
|
|
102
|
-
force: params.force,
|
|
103
|
-
itemDocument: params.loadedItem?.document ?? null,
|
|
104
|
-
applyRewrite: async ({ historyRawUnderLock }) => writeHistoryRawWithRollback({
|
|
105
|
-
historyPath: params.historyPath,
|
|
106
|
-
nextHistoryRaw: historyEntriesToRaw(params.rewrittenEntries),
|
|
107
|
-
historyRawUnderLock,
|
|
108
|
-
}),
|
|
109
|
-
applyPostRewrite: async () => runActiveOnWriteHooks({
|
|
110
|
-
path: params.historyPath,
|
|
111
|
-
scope: "project",
|
|
112
|
-
op: "history_repair:history",
|
|
113
|
-
}),
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
/** Implements run history repair for the public runtime surface of this module. */
|
|
117
|
-
export async function runHistoryRepair(id, options, global) {
|
|
118
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
119
|
-
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
120
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
121
|
-
}
|
|
122
|
-
const settings = await readSettings(pmRoot);
|
|
123
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
124
|
-
const subject = await resolveHistorySubject(pmRoot, id, settings, typeRegistry.type_to_folder);
|
|
125
|
-
if (!(await pathExists(subject.historyPath))) {
|
|
126
|
-
throw new PmCliError(`No history stream exists for ${subject.id}.`, EXIT_CODE.NOT_FOUND);
|
|
127
|
-
}
|
|
128
|
-
const historyRawBeforeLock = await readFileIfExists(subject.historyPath);
|
|
129
|
-
const historyEntries = await readHistoryEntries(subject.historyPath, subject.id);
|
|
130
|
-
if (historyEntries.length === 0) {
|
|
131
|
-
throw new PmCliError(`No history entries exist for ${subject.id}; nothing to repair.`, EXIT_CODE.USAGE);
|
|
132
|
-
}
|
|
133
|
-
const chainBefore = verifyHistoryChain(historyEntries);
|
|
134
|
-
const reanchor = reanchorHistoryEntries(historyEntries);
|
|
135
|
-
const itemReplayContext = await loadHistoryRepairItemReplay(subject, settings, historyEntries);
|
|
136
|
-
const finalReplay = reanchor.finalDocument;
|
|
137
|
-
const reconcileNeeded = itemReplayContext.currentItemReplay !== null &&
|
|
138
|
-
replayHash(finalReplay) !== replayHash(itemReplayContext.currentItemReplay);
|
|
139
|
-
const changed = reanchor.entriesRehashed > 0 ||
|
|
140
|
-
reanchor.entriesPatchRepaired > 0 ||
|
|
141
|
-
reconcileNeeded;
|
|
142
|
-
const author = toAuthor(options.author, settings.author_default);
|
|
143
|
-
const dryRun = Boolean(options.dryRun);
|
|
144
|
-
const repairMessage = buildHistoryRepairMessage({
|
|
145
|
-
message: options.message,
|
|
146
|
-
entriesRehashed: reanchor.entriesRehashed,
|
|
147
|
-
entriesPatchRepaired: reanchor.entriesPatchRepaired,
|
|
148
|
-
reconcileNeeded,
|
|
149
|
-
});
|
|
150
|
-
const { rewrittenEntries, auditEntryAdded } = buildHistoryRepairEntries({
|
|
151
|
-
reanchorEntries: reanchor.entries,
|
|
152
|
-
changed,
|
|
153
|
-
reconcileNeeded,
|
|
154
|
-
currentItemReplay: itemReplayContext.currentItemReplay,
|
|
155
|
-
finalReplay,
|
|
156
|
-
author,
|
|
157
|
-
message: repairMessage,
|
|
158
|
-
});
|
|
159
|
-
const historyVerify = verifyHistoryChain(rewrittenEntries);
|
|
160
|
-
if (!historyVerify.ok) {
|
|
161
|
-
throw new PmCliError(`history-repair produced an invalid rewritten chain (${historyVerify.errors.join(", ")}).`, EXIT_CODE.GENERIC_FAILURE);
|
|
162
|
-
}
|
|
163
|
-
const warnings = collectHistoryRepairWarnings(changed, reanchor.skippedOps);
|
|
164
|
-
if (changed && !dryRun) {
|
|
165
|
-
warnings.push(...(await applyHistoryRepairRewrite({
|
|
166
|
-
pmRoot,
|
|
167
|
-
subject,
|
|
168
|
-
settings,
|
|
169
|
-
typeRegistry,
|
|
170
|
-
historyRawBeforeLock,
|
|
171
|
-
currentItemRawBeforeLock: itemReplayContext.currentItemRawBeforeLock,
|
|
172
|
-
author,
|
|
173
|
-
force: options.force,
|
|
174
|
-
loadedItem: itemReplayContext.loadedItem,
|
|
175
|
-
historyPath: subject.historyPath,
|
|
176
|
-
rewrittenEntries,
|
|
177
|
-
})));
|
|
178
|
-
}
|
|
179
|
-
return {
|
|
180
|
-
id: subject.id,
|
|
181
|
-
dry_run: dryRun,
|
|
182
|
-
changed,
|
|
183
|
-
history: {
|
|
184
|
-
path: subject.historyPath,
|
|
185
|
-
entries_scanned: historyEntries.length,
|
|
186
|
-
chain_drift_before: !chainBefore.ok,
|
|
187
|
-
entries_rehashed: reanchor.entriesRehashed,
|
|
188
|
-
entries_patch_repaired: reanchor.entriesPatchRepaired,
|
|
189
|
-
converted_replace_to_add: reanchor.convertedReplaceToAdd,
|
|
190
|
-
skipped_ops: reanchor.skippedOps,
|
|
191
|
-
reconciled_with_item: reconcileNeeded,
|
|
192
|
-
audit_entry_added: auditEntryAdded,
|
|
193
|
-
verify_ok: historyVerify.ok,
|
|
194
|
-
verify_errors: historyVerify.errors,
|
|
195
|
-
},
|
|
196
|
-
item: {
|
|
197
|
-
exists: itemReplayContext.currentItemPath !== null,
|
|
198
|
-
path: itemReplayContext.currentItemPath,
|
|
199
|
-
matched_chain_before: itemReplayContext.matchedChainBefore,
|
|
200
|
-
},
|
|
201
|
-
warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
|
|
202
|
-
generated_at: nowIso(),
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
/** Enforce the `pm history-repair` target contract shared by the CLI and MCP surfaces: exactly one of an item `<id>` or `--all` must be provided. */
|
|
206
|
-
export function assertHistoryRepairTarget(id, all) {
|
|
207
|
-
if (all && id !== undefined) {
|
|
208
|
-
throw new PmCliError("history-repair: <id> and --all are mutually exclusive; pass an item id to repair one stream or --all to repair every drifted stream.", EXIT_CODE.USAGE);
|
|
209
|
-
}
|
|
210
|
-
if (!all && id === undefined) {
|
|
211
|
-
throw new PmCliError("history-repair: provide an item <id> or pass --all to repair every drifted stream.", EXIT_CODE.USAGE);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
/** Bulk drift repair: scan every item's history stream with the same drift scan `pm health` uses, then run the audited single-stream repair (ownership check, lock, no-drift verification, audit marker) for each drifted stream. One failing stream never aborts the rest; failures are collected per row and the caller decides the exit code from `totals.failed`. */
|
|
215
|
-
export async function runHistoryRepairAll(options, global) {
|
|
216
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
217
|
-
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
218
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
219
|
-
}
|
|
220
|
-
const settings = await readSettings(pmRoot);
|
|
221
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
222
|
-
const itemReadWarnings = [];
|
|
223
|
-
const items = await listAllItemMetadataWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, itemReadWarnings, settings.schema);
|
|
224
|
-
const drift = await scanHistoryDrift(pmRoot, items);
|
|
225
|
-
const streams = [];
|
|
226
|
-
const totals = { repaired: 0, skipped_clean: 0, failed: 0 };
|
|
227
|
-
for (const driftedId of drift.driftedItems) {
|
|
228
|
-
try {
|
|
229
|
-
const result = await runHistoryRepair(driftedId, options, global);
|
|
230
|
-
/* c8 ignore next -- mixed repaired/clean outcomes depend on live drift composition. */
|
|
231
|
-
const outcome = result.changed ? "repaired" : "skipped_clean";
|
|
232
|
-
totals[outcome] += 1;
|
|
233
|
-
streams.push({
|
|
234
|
-
id: driftedId,
|
|
235
|
-
outcome,
|
|
236
|
-
entries_rehashed: result.history.entries_rehashed,
|
|
237
|
-
entries_patch_repaired: result.history.entries_patch_repaired,
|
|
238
|
-
reconciled_with_item: result.history.reconciled_with_item,
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
catch (error) {
|
|
242
|
-
totals.failed += 1;
|
|
243
|
-
streams.push({
|
|
244
|
-
id: driftedId,
|
|
245
|
-
outcome: "failed",
|
|
246
|
-
/* c8 ignore next -- non-Error throws are normalized in defensive fallback. */
|
|
247
|
-
error: error instanceof Error ? error.message : String(error),
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return {
|
|
252
|
-
all: true,
|
|
253
|
-
dry_run: Boolean(options.dryRun),
|
|
254
|
-
scanned_streams: items.length,
|
|
255
|
-
drifted_streams: drift.driftedItems.length,
|
|
256
|
-
streams,
|
|
257
|
-
totals,
|
|
258
|
-
warnings: [...new Set(itemReadWarnings)].sort((left, right) => left.localeCompare(right)),
|
|
259
|
-
generated_at: nowIso(),
|
|
260
|
-
};
|
|
261
|
-
}
|
|
8
|
+
!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]="0c797b34-1f8d-5218-b7ee-127688fab2a1")}catch(e){}}();
|
|
9
|
+
export { assertHistoryRepairTarget, runHistoryRepair, runHistoryRepairAll, } from "../../sdk/history-repair.js";
|
|
262
10
|
//# sourceMappingURL=history-repair.js.map
|
|
263
|
-
//# debugId=
|
|
11
|
+
//# debugId=0c797b34-1f8d-5218-b7ee-127688fab2a1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-repair.js","sources":["cli/commands/history-repair.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/history-repair\n *\n * Implements the pm history repair command surface and its agent-facing runtime behavior.\n */\nimport jsonPatch from \"fast-json-patch\";\nimport { pathExists, readFileIfExists } from \"../../core/fs/fs-utils.js\";\nimport {\n executeHistoryRewrite,\n writeHistoryRawWithRollback,\n} from \"../../core/history/history-rewrite.js\";\nimport {\n historyEntriesToRaw,\n reanchorHistoryEntries,\n replayHash,\n toReplayDocument,\n verifyHistoryChain,\n type ReplayDocument,\n} from \"../../core/history/replay.js\";\nimport { scanHistoryDrift } from \"../../core/history/drift-scan.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.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 {\n getActiveExtensionRegistrations,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport {\n listAllItemMetadataWithBody,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type {\n HistoryEntry,\n HistoryPatchOp,\n ItemMetadata,\n} from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\nimport { resolveHistorySubject } from \"./history-redact.js\";\n\n/** Documents the history repair command options payload exchanged by command, SDK, and package integrations. */\nexport interface HistoryRepairCommandOptions {\n /** Value that configures or reports dry run for this contract. */\n dryRun?: boolean;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports force for this contract. */\n force?: boolean;\n}\n\n/** Documents the history repair result payload exchanged by command, SDK, and package integrations. */\nexport interface HistoryRepairResult {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports dry run for this contract. */\n dry_run: boolean;\n /** Value that configures or reports changed for this contract. */\n changed: boolean;\n /** Value that configures or reports history for this contract. */\n history: {\n path: string;\n entries_scanned: number;\n chain_drift_before: boolean;\n entries_rehashed: number;\n entries_patch_repaired: number;\n converted_replace_to_add: number;\n skipped_ops: number;\n reconciled_with_item: boolean;\n audit_entry_added: boolean;\n verify_ok: boolean;\n verify_errors: string[];\n };\n /** Value that configures or reports item for this contract. */\n item: {\n exists: boolean;\n path: string | null;\n matched_chain_before: boolean | null;\n };\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** ISO 8601 timestamp recording when generated occurred. */\n generated_at: string;\n}\n\ninterface HistoryRepairItemReplayContext {\n currentItemReplay: ReplayDocument | null;\n currentItemPath: string | null;\n matchedChainBefore: boolean | null;\n currentItemRawBeforeLock: string | null;\n loadedItem: Awaited<ReturnType<typeof readLocatedItem>> | null;\n}\n\nfunction toAuthor(\n candidate: string | undefined,\n defaultAuthor: string,\n): string {\n /* c8 ignore next -- PM_AUTHOR fallback branch is environment-dependent in CI. */\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\nasync function loadHistoryRepairItemReplay(\n subject: Awaited<ReturnType<typeof resolveHistorySubject>>,\n settings: Awaited<ReturnType<typeof readSettings>>,\n historyEntries: HistoryEntry[],\n): Promise<HistoryRepairItemReplayContext> {\n const currentItemPath = subject.located?.itemPath ?? null;\n const loadedItem = subject.located\n ? await readLocatedItem(subject.located, { schema: settings.schema })\n : null;\n if (!loadedItem) {\n return {\n currentItemReplay: null,\n currentItemPath,\n matchedChainBefore: null,\n currentItemRawBeforeLock: null,\n loadedItem: null,\n };\n }\n const currentItemReplay = toReplayDocument(loadedItem.document);\n const lastOriginalAfterHash =\n historyEntries[historyEntries.length - 1]?.after_hash;\n return {\n currentItemReplay,\n currentItemPath,\n matchedChainBefore: replayHash(currentItemReplay) === lastOriginalAfterHash,\n currentItemRawBeforeLock: loadedItem.raw,\n loadedItem,\n };\n}\n\nfunction buildHistoryRepairMessage(params: {\n message: string | undefined;\n entriesRehashed: number;\n entriesPatchRepaired: number;\n reconcileNeeded: boolean;\n}): string {\n if (typeof params.message === \"string\" && params.message.trim().length > 0) {\n return params.message;\n }\n /* v8 ignore start -- message suffix/plural variants are deterministic formatting fallbacks around the covered repair outcomes */\n return `history-repair re-anchored ${params.entriesRehashed} entr${\n params.entriesRehashed === 1 ? \"y\" : \"ies\"\n }${params.entriesPatchRepaired > 0 ? `, repaired ${params.entriesPatchRepaired} patch(es)` : \"\"}${\n params.reconcileNeeded ? \", reconciled chain with on-disk item\" : \"\"\n }.`;\n /* v8 ignore stop */\n}\n\nfunction buildHistoryRepairEntries(params: {\n reanchorEntries: HistoryEntry[];\n changed: boolean;\n reconcileNeeded: boolean;\n currentItemReplay: ReplayDocument | null;\n finalReplay: ReplayDocument;\n author: string;\n message: string;\n}): { rewrittenEntries: HistoryEntry[]; auditEntryAdded: boolean } {\n const rewrittenEntries: HistoryEntry[] = [...params.reanchorEntries];\n if (!params.changed) {\n return { rewrittenEntries, auditEntryAdded: false };\n }\n const afterReplay =\n params.reconcileNeeded && params.currentItemReplay\n ? params.currentItemReplay\n : params.finalReplay;\n rewrittenEntries.push({\n ts: nowIso(),\n author: params.author,\n op: \"history_repair\",\n patch:\n params.reconcileNeeded && params.currentItemReplay\n ? (jsonPatch.compare(\n params.finalReplay,\n params.currentItemReplay,\n ) as HistoryPatchOp[])\n : [],\n before_hash: replayHash(params.finalReplay),\n after_hash: replayHash(afterReplay),\n message: params.message,\n });\n return { rewrittenEntries, auditEntryAdded: true };\n}\n\nfunction collectHistoryRepairWarnings(\n changed: boolean,\n skippedOps: number,\n): string[] {\n const warnings: string[] = [];\n if (!changed) {\n warnings.push(\"history_repair_no_changes\");\n }\n if (skippedOps > 0) {\n warnings.push(`history_repair_skipped_unresolvable_ops:${skippedOps}`);\n }\n return warnings;\n}\n\nasync function applyHistoryRepairRewrite(params: {\n pmRoot: string;\n subject: Awaited<ReturnType<typeof resolveHistorySubject>>;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeRegistry: ReturnType<typeof resolveItemTypeRegistry>;\n historyRawBeforeLock: string | null;\n currentItemRawBeforeLock: string | null;\n author: string;\n force: boolean | undefined;\n loadedItem: Awaited<ReturnType<typeof readLocatedItem>> | null;\n historyPath: string;\n rewrittenEntries: HistoryEntry[];\n}): Promise<string[]> {\n return executeHistoryRewrite({\n pmRoot: params.pmRoot,\n subject: params.subject,\n settings: params.settings,\n typeRegistry: params.typeRegistry,\n historyRawBeforeLock: params.historyRawBeforeLock,\n currentItemRawBeforeLock: params.currentItemRawBeforeLock,\n operation: \"history-repair\",\n author: params.author,\n force: params.force,\n itemDocument: params.loadedItem?.document ?? null,\n applyRewrite: async ({ historyRawUnderLock }) =>\n writeHistoryRawWithRollback({\n historyPath: params.historyPath,\n nextHistoryRaw: historyEntriesToRaw(params.rewrittenEntries),\n historyRawUnderLock,\n }),\n applyPostRewrite: async () =>\n runActiveOnWriteHooks({\n path: params.historyPath,\n scope: \"project\",\n op: \"history_repair:history\",\n }),\n });\n}\n\n/** Implements run history repair for the public runtime surface of this module. */\nexport async function runHistoryRepair(\n id: string,\n options: HistoryRepairCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryRepairResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const subject = await resolveHistorySubject(\n pmRoot,\n id,\n settings,\n typeRegistry.type_to_folder,\n );\n\n if (!(await pathExists(subject.historyPath))) {\n throw new PmCliError(\n `No history stream exists for ${subject.id}.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const historyRawBeforeLock = await readFileIfExists(subject.historyPath);\n const historyEntries = await readHistoryEntries(\n subject.historyPath,\n subject.id,\n );\n if (historyEntries.length === 0) {\n throw new PmCliError(\n `No history entries exist for ${subject.id}; nothing to repair.`,\n EXIT_CODE.USAGE,\n );\n }\n\n const chainBefore = verifyHistoryChain(historyEntries);\n const reanchor = reanchorHistoryEntries(historyEntries);\n\n const itemReplayContext = await loadHistoryRepairItemReplay(\n subject,\n settings,\n historyEntries,\n );\n\n const finalReplay = reanchor.finalDocument;\n const reconcileNeeded =\n itemReplayContext.currentItemReplay !== null &&\n replayHash(finalReplay) !== replayHash(itemReplayContext.currentItemReplay);\n\n const changed =\n reanchor.entriesRehashed > 0 ||\n reanchor.entriesPatchRepaired > 0 ||\n reconcileNeeded;\n const author = toAuthor(options.author, settings.author_default);\n const dryRun = Boolean(options.dryRun);\n\n const repairMessage = buildHistoryRepairMessage({\n message: options.message,\n entriesRehashed: reanchor.entriesRehashed,\n entriesPatchRepaired: reanchor.entriesPatchRepaired,\n reconcileNeeded,\n });\n const { rewrittenEntries, auditEntryAdded } = buildHistoryRepairEntries({\n reanchorEntries: reanchor.entries,\n changed,\n reconcileNeeded,\n currentItemReplay: itemReplayContext.currentItemReplay,\n finalReplay,\n author,\n message: repairMessage,\n });\n\n const historyVerify = verifyHistoryChain(rewrittenEntries);\n if (!historyVerify.ok) {\n throw new PmCliError(\n `history-repair produced an invalid rewritten chain (${historyVerify.errors.join(\", \")}).`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n\n const warnings = collectHistoryRepairWarnings(changed, reanchor.skippedOps);\n\n if (changed && !dryRun) {\n warnings.push(\n ...(await applyHistoryRepairRewrite({\n pmRoot,\n subject,\n settings,\n typeRegistry,\n historyRawBeforeLock,\n currentItemRawBeforeLock: itemReplayContext.currentItemRawBeforeLock,\n author,\n force: options.force,\n loadedItem: itemReplayContext.loadedItem,\n historyPath: subject.historyPath,\n rewrittenEntries,\n })),\n );\n }\n\n return {\n id: subject.id,\n dry_run: dryRun,\n changed,\n history: {\n path: subject.historyPath,\n entries_scanned: historyEntries.length,\n chain_drift_before: !chainBefore.ok,\n entries_rehashed: reanchor.entriesRehashed,\n entries_patch_repaired: reanchor.entriesPatchRepaired,\n converted_replace_to_add: reanchor.convertedReplaceToAdd,\n skipped_ops: reanchor.skippedOps,\n reconciled_with_item: reconcileNeeded,\n audit_entry_added: auditEntryAdded,\n verify_ok: historyVerify.ok,\n verify_errors: historyVerify.errors,\n },\n item: {\n exists: itemReplayContext.currentItemPath !== null,\n path: itemReplayContext.currentItemPath,\n matched_chain_before: itemReplayContext.matchedChainBefore,\n },\n warnings: [...new Set(warnings)].sort((left, right) =>\n left.localeCompare(right),\n ),\n generated_at: nowIso(),\n };\n}\n\n/** Documents the history repair all stream result payload exchanged by command, SDK, and package integrations. */\nexport interface HistoryRepairAllStreamResult {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports outcome for this contract. */\n outcome: \"repaired\" | \"skipped_clean\" | \"failed\";\n /** Value that configures or reports entries rehashed for this contract. */\n entries_rehashed?: number;\n /** Value that configures or reports entries patch repaired for this contract. */\n entries_patch_repaired?: number;\n /** Value that configures or reports reconciled with item for this contract. */\n reconciled_with_item?: boolean;\n /** Value that configures or reports error for this contract. */\n error?: string;\n}\n\n/** Documents the history repair all result payload exchanged by command, SDK, and package integrations. */\nexport interface HistoryRepairAllResult {\n /** Value that configures or reports all for this contract. */\n all: true;\n /** Value that configures or reports dry run for this contract. */\n dry_run: boolean;\n /** Value that configures or reports scanned streams for this contract. */\n scanned_streams: number;\n /** Value that configures or reports drifted streams for this contract. */\n drifted_streams: number;\n /** One compact row per drifted stream (clean streams are summarized by the counts only). */\n streams: HistoryRepairAllStreamResult[];\n /** Value that configures or reports totals for this contract. */\n totals: { repaired: number; skipped_clean: number; failed: number };\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** ISO 8601 timestamp recording when generated occurred. */\n generated_at: string;\n}\n\n/** Enforce the `pm history-repair` target contract shared by the CLI and MCP surfaces: exactly one of an item `<id>` or `--all` must be provided. */\nexport function assertHistoryRepairTarget(\n id: string | undefined,\n all: boolean,\n): void {\n if (all && id !== undefined) {\n throw new PmCliError(\n \"history-repair: <id> and --all are mutually exclusive; pass an item id to repair one stream or --all to repair every drifted stream.\",\n EXIT_CODE.USAGE,\n );\n }\n if (!all && id === undefined) {\n throw new PmCliError(\n \"history-repair: provide an item <id> or pass --all to repair every drifted stream.\",\n EXIT_CODE.USAGE,\n );\n }\n}\n\n/** Bulk drift repair: scan every item's history stream with the same drift scan `pm health` uses, then run the audited single-stream repair (ownership check, lock, no-drift verification, audit marker) for each drifted stream. One failing stream never aborts the rest; failures are collected per row and the caller decides the exit code from `totals.failed`. */\nexport async function runHistoryRepairAll(\n options: HistoryRepairCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryRepairAllResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const itemReadWarnings: string[] = [];\n const items = await listAllItemMetadataWithBody(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n itemReadWarnings,\n settings.schema,\n );\n const drift = await scanHistoryDrift(\n pmRoot,\n items as Array<ItemMetadata & { body: string }>,\n );\n\n const streams: HistoryRepairAllStreamResult[] = [];\n const totals = { repaired: 0, skipped_clean: 0, failed: 0 };\n for (const driftedId of drift.driftedItems) {\n try {\n const result = await runHistoryRepair(driftedId, options, global);\n /* c8 ignore next -- mixed repaired/clean outcomes depend on live drift composition. */\n const outcome = result.changed ? \"repaired\" : \"skipped_clean\";\n totals[outcome] += 1;\n streams.push({\n id: driftedId,\n outcome,\n entries_rehashed: result.history.entries_rehashed,\n entries_patch_repaired: result.history.entries_patch_repaired,\n reconciled_with_item: result.history.reconciled_with_item,\n });\n } catch (error) {\n totals.failed += 1;\n streams.push({\n id: driftedId,\n outcome: \"failed\",\n /* c8 ignore next -- non-Error throws are normalized in defensive fallback. */\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n return {\n all: true,\n dry_run: Boolean(options.dryRun),\n scanned_streams: items.length,\n drifted_streams: drift.driftedItems.length,\n streams,\n totals,\n warnings: [...new Set(itemReadWarnings)].sort((left, right) =>\n left.localeCompare(right),\n ),\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,GAEnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAC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C1D,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC;gBACX,EAAE,EAAE,SAAS;gBACb,OAAO,EAAE,QAAQ;gBACjB,8EAA8E;gBAC9E,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO;QACL,GAAG,EAAE,IAAI;QACT,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QAChC,eAAe,EAAE,KAAK,CAAC,MAAM;QAC7B,eAAe,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM;QAC1C,OAAO;QACP,MAAM;QACN,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC5D,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAC1B;QACD,YAAY,EAAE,MAAM,EAAE;KACvB,CAAC;AACJ,CAAC","debugId":"141c6ac4-734f-5395-8af1-b6233b8cc886"}
|
|
1
|
+
{"version":3,"file":"history-repair.js","sources":["cli/commands/history-repair.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/history-repair\n *\n * Presentation compatibility shim for the public SDK history-repair\n * primitives. The SDK owns replay, re-anchor, rollback, and bulk repair logic.\n */\nexport {\n assertHistoryRepairTarget,\n runHistoryRepair,\n runHistoryRepairAll,\n type HistoryRepairAllResult,\n type HistoryRepairAllStreamResult,\n type HistoryRepairCommandOptions,\n type HistoryRepairResult,\n} from \"../../sdk/history-repair.js\";\n"],"names":[],"mappings":"AAAA;;;;;GAKG;;;AACH,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,GAKpB,MAAM,6BAA6B,CAAC","debugId":"0c797b34-1f8d-5218-b7ee-127688fab2a1"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type HistoryDiffValueEntry } from "../../core/history/history-diff.js";
|
|
2
|
+
export { readHistoryEntries } from "../../sdk/history-read.js";
|
|
2
3
|
import type { GlobalOptions } from "../../core/shared/command-types.js";
|
|
3
4
|
import type { HistoryEntry } from "../../types/index.js";
|
|
4
5
|
export { verifyHistoryChain } from "../../core/history/replay.js";
|
|
@@ -64,7 +65,5 @@ export interface HistoryResult {
|
|
|
64
65
|
/** Value that configures or reports verification for this contract. */
|
|
65
66
|
verification?: HistoryVerificationResult;
|
|
66
67
|
}
|
|
67
|
-
/** Implements read history entries for the public runtime surface of this module. */
|
|
68
|
-
export declare function readHistoryEntries(historyPath: string, itemId: string): Promise<HistoryEntry[]>;
|
|
69
68
|
/** Implements run history for the public runtime surface of this module. */
|
|
70
69
|
export declare function runHistory(id: string, options: HistoryCommandOptions, global: GlobalOptions): Promise<HistoryResult>;
|