@unbrained/pm-cli 2026.7.14 → 2026.7.16
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 +54 -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
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { type HistoryCompactBulkSkipReason, type HistoryCompactScope } from "../core/history/history-compact-bulk.js";
|
|
2
|
+
import type { GlobalOptions } from "../core/shared/command-types.js";
|
|
3
|
+
/** Documents the history compact command options payload exchanged by command, SDK, and package integrations. */
|
|
4
|
+
export interface HistoryCompactCommandOptions {
|
|
5
|
+
/** Value that configures or reports before for this contract. */
|
|
6
|
+
before?: string;
|
|
7
|
+
/** Value that configures or reports dry run for this contract. */
|
|
8
|
+
dryRun?: boolean;
|
|
9
|
+
/** Value that configures or reports author for this contract. */
|
|
10
|
+
author?: string;
|
|
11
|
+
/** Human-readable explanation suitable for logs and agent-facing output. */
|
|
12
|
+
message?: string;
|
|
13
|
+
/** Value that configures or reports force for this contract. */
|
|
14
|
+
force?: boolean;
|
|
15
|
+
}
|
|
16
|
+
type HistoryCompactBoundaryKind = "default" | "version" | "timestamp";
|
|
17
|
+
/** Documents the history compact result payload exchanged by command, SDK, and package integrations. */
|
|
18
|
+
export interface HistoryCompactResult {
|
|
19
|
+
/** Stable identifier used to reference this record across commands and storage. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Value that configures or reports dry run for this contract. */
|
|
22
|
+
dry_run: boolean;
|
|
23
|
+
/** Value that configures or reports changed for this contract. */
|
|
24
|
+
changed: boolean;
|
|
25
|
+
/** Value that configures or reports compact boundary for this contract. */
|
|
26
|
+
compact_boundary: {
|
|
27
|
+
kind: HistoryCompactBoundaryKind;
|
|
28
|
+
before: string | null;
|
|
29
|
+
entries_compacted: number;
|
|
30
|
+
entries_retained: number;
|
|
31
|
+
first_retained_entry: number | null;
|
|
32
|
+
};
|
|
33
|
+
/** Value that configures or reports history for this contract. */
|
|
34
|
+
history: {
|
|
35
|
+
path: string;
|
|
36
|
+
entries_scanned: number;
|
|
37
|
+
entries_after: number;
|
|
38
|
+
baseline_entry_added: boolean;
|
|
39
|
+
audit_entry_added: boolean;
|
|
40
|
+
verify_ok: boolean;
|
|
41
|
+
verify_errors: string[];
|
|
42
|
+
};
|
|
43
|
+
/** Value that configures or reports item for this contract. */
|
|
44
|
+
item: {
|
|
45
|
+
exists: boolean;
|
|
46
|
+
path: string | null;
|
|
47
|
+
matched_chain_before: boolean | null;
|
|
48
|
+
};
|
|
49
|
+
/** Value that configures or reports warnings for this contract. */
|
|
50
|
+
warnings: string[];
|
|
51
|
+
/** ISO 8601 timestamp recording when generated occurred. */
|
|
52
|
+
generated_at: string;
|
|
53
|
+
}
|
|
54
|
+
/** Implements run history compact for the public runtime surface of this module. */
|
|
55
|
+
export declare function runHistoryCompact(id: string, options: HistoryCompactCommandOptions, global: GlobalOptions): Promise<HistoryCompactResult>;
|
|
56
|
+
/** Default entry floor below which a stream is treated as already compact. */
|
|
57
|
+
export declare const HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES = 3;
|
|
58
|
+
/** Documents the bulk history compact command options payload exchanged by command, SDK, and package integrations. */
|
|
59
|
+
export interface HistoryCompactBulkCommandOptions {
|
|
60
|
+
/** Value that configures or reports ids for this contract. */
|
|
61
|
+
ids?: string[];
|
|
62
|
+
/** Value that configures or reports scope for this contract. */
|
|
63
|
+
scope?: HistoryCompactScope;
|
|
64
|
+
/** Value that configures or reports all over for this contract. */
|
|
65
|
+
allOver?: number;
|
|
66
|
+
/** Value that configures or reports min entries for this contract. */
|
|
67
|
+
minEntries?: number;
|
|
68
|
+
/** Value that configures or reports dry run for this contract. */
|
|
69
|
+
dryRun?: boolean;
|
|
70
|
+
/** Value that configures or reports author for this contract. */
|
|
71
|
+
author?: string;
|
|
72
|
+
/** Human-readable explanation suitable for logs and agent-facing output. */
|
|
73
|
+
message?: string;
|
|
74
|
+
/** Value that configures or reports force for this contract. */
|
|
75
|
+
force?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** Per-item outcome row in a bulk compaction pass. */
|
|
78
|
+
export interface HistoryCompactBulkItemResult {
|
|
79
|
+
/** Stable identifier used to reference this record across commands and storage. */
|
|
80
|
+
id: string;
|
|
81
|
+
/** Value that configures or reports outcome for this contract. */
|
|
82
|
+
outcome: "compacted" | "skipped" | "errored";
|
|
83
|
+
/** Value that configures or reports entries before for this contract. */
|
|
84
|
+
entries_before: number;
|
|
85
|
+
/** Value that configures or reports entries after for this contract. */
|
|
86
|
+
entries_after: number | null;
|
|
87
|
+
/** Value that configures or reports skip reason for this contract. */
|
|
88
|
+
skip_reason: HistoryCompactBulkSkipReason | null;
|
|
89
|
+
/** Value that configures or reports changed for this contract. */
|
|
90
|
+
changed: boolean;
|
|
91
|
+
/** Value that configures or reports error for this contract. */
|
|
92
|
+
error: string | null;
|
|
93
|
+
}
|
|
94
|
+
/** Documents the bulk history compact result payload exchanged by command, SDK, and package integrations. */
|
|
95
|
+
export interface HistoryCompactBulkResult {
|
|
96
|
+
/** Value that configures or reports bulk for this contract. */
|
|
97
|
+
bulk: true;
|
|
98
|
+
/** Value that configures or reports dry run for this contract. */
|
|
99
|
+
dry_run: boolean;
|
|
100
|
+
/** Value that configures or reports mode for this contract. */
|
|
101
|
+
mode: "ids" | "scan";
|
|
102
|
+
/** Value that configures or reports scope for this contract. */
|
|
103
|
+
scope: HistoryCompactScope | null;
|
|
104
|
+
/** Value that configures or reports criteria for this contract. */
|
|
105
|
+
criteria: {
|
|
106
|
+
min_entries: number;
|
|
107
|
+
all_over: number | null;
|
|
108
|
+
policy_threshold_applied: boolean;
|
|
109
|
+
};
|
|
110
|
+
/** Value that configures or reports totals for this contract. */
|
|
111
|
+
totals: {
|
|
112
|
+
streams_considered: number;
|
|
113
|
+
selected: number;
|
|
114
|
+
items_compacted: number;
|
|
115
|
+
items_skipped: number;
|
|
116
|
+
items_errored: number;
|
|
117
|
+
};
|
|
118
|
+
/** Value that configures or reports results for this contract. */
|
|
119
|
+
results: HistoryCompactBulkItemResult[];
|
|
120
|
+
/** ISO 8601 timestamp recording when generated occurred. */
|
|
121
|
+
generated_at: string;
|
|
122
|
+
}
|
|
123
|
+
/** Enforce the `pm history-compact` target contract shared by the CLI and MCP surfaces: exactly one selection mode — a single item `<id>`, an explicit `--ids` list, or a scan selector (`--all-over` / `--closed` / `--all-streams`). */
|
|
124
|
+
export declare function assertHistoryCompactTarget(id: string | undefined, bulk: {
|
|
125
|
+
ids?: string[];
|
|
126
|
+
allOver?: number;
|
|
127
|
+
scope?: HistoryCompactScope;
|
|
128
|
+
}): void;
|
|
129
|
+
/**
|
|
130
|
+
* Bulk history compaction: compact every history stream matching the requested
|
|
131
|
+
* selection (explicit `--ids`, a `--scope` lifecycle filter, and/or an
|
|
132
|
+
* `--all-over <N>` entry threshold) in one audited pass. Each selected stream is
|
|
133
|
+
* compacted with the same single-item logic ({@link runHistoryCompact}); one
|
|
134
|
+
* failing stream never aborts the rest, and the caller decides the exit code
|
|
135
|
+
* from `totals.items_errored`.
|
|
136
|
+
*
|
|
137
|
+
* When `history.compact_policy` is enabled and no explicit `--all-over` is
|
|
138
|
+
* given, the policy's `max_entries` is used as the scan threshold so the
|
|
139
|
+
* configured policy drives the sweep.
|
|
140
|
+
*/
|
|
141
|
+
export declare function runHistoryCompactBulk(options: HistoryCompactBulkCommandOptions, global: GlobalOptions): Promise<HistoryCompactBulkResult>;
|
|
142
|
+
export {};
|
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/history-compact
|
|
3
|
+
*
|
|
4
|
+
* Implements the pm history compact command surface and its agent-facing runtime behavior.
|
|
5
|
+
*/
|
|
6
|
+
|
|
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]="a58bdcf8-a01b-55b7-ac6e-57432c9422bf")}catch(e){}}();
|
|
8
|
+
import fs from "node:fs/promises";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { createHistoryEntry } from "../core/history/history.js";
|
|
11
|
+
import { selectHistoryCompactBulkTargets, } from "../core/history/history-compact-bulk.js";
|
|
12
|
+
import { executeHistoryRewrite, writeHistoryRawWithRollback, } from "../core/history/history-rewrite.js";
|
|
13
|
+
import { cloneEmptyReplayDocument, historyEntriesToRaw, replayHash, replayToItemDocument, toReplayDocument, verifyHistoryChain, } from "../core/history/replay.js";
|
|
14
|
+
import { applyHistoryPatch } from "../core/history/projection.js";
|
|
15
|
+
import { readHistoryEntries } from "../core/history/read.js";
|
|
16
|
+
import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
|
|
17
|
+
import { lifecycleClassifierFromStatusRegistry } from "../core/governance/metadata-coverage.js";
|
|
18
|
+
import { resolveRuntimeStatusRegistry } from "../core/schema/runtime-schema.js";
|
|
19
|
+
import { listAllItemMetadataLight } from "../core/store/item-store.js";
|
|
20
|
+
import { pathExists, readFileIfExists } from "../core/fs/fs-utils.js";
|
|
21
|
+
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
22
|
+
import { PmCliError } from "../core/shared/errors.js";
|
|
23
|
+
import { nowIso } from "../core/shared/time.js";
|
|
24
|
+
import { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks, } from "../core/extensions/index.js";
|
|
25
|
+
import { readLocatedItem } from "../core/store/item-store.js";
|
|
26
|
+
import { getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
|
|
27
|
+
import { readSettings } from "../core/store/settings.js";
|
|
28
|
+
import { resolveAuthor } from "../core/shared/author.js";
|
|
29
|
+
import { resolveHistorySubject } from "./history-redact.js";
|
|
30
|
+
function parseBeforeBoundary(before, entries) {
|
|
31
|
+
if (before === undefined) {
|
|
32
|
+
return {
|
|
33
|
+
kind: "default",
|
|
34
|
+
raw: null,
|
|
35
|
+
compactCount: entries.length,
|
|
36
|
+
retainedCount: 0,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const raw = before.trim();
|
|
40
|
+
if (raw.length === 0) {
|
|
41
|
+
throw new PmCliError("history-compact --before requires a non-empty value.", EXIT_CODE.USAGE);
|
|
42
|
+
}
|
|
43
|
+
if (/^\d+$/.test(raw)) {
|
|
44
|
+
const version = Number.parseInt(raw, 10);
|
|
45
|
+
if (!Number.isSafeInteger(version) ||
|
|
46
|
+
version < 1 ||
|
|
47
|
+
version > entries.length + 1) {
|
|
48
|
+
throw new PmCliError(`history-compact --before version must be between 1 and ${entries.length + 1}.`, EXIT_CODE.USAGE);
|
|
49
|
+
}
|
|
50
|
+
const compactCount = Math.max(0, Math.min(entries.length, version - 1));
|
|
51
|
+
return {
|
|
52
|
+
kind: "version",
|
|
53
|
+
raw,
|
|
54
|
+
compactCount,
|
|
55
|
+
retainedCount: entries.length - compactCount,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const beforeTs = Date.parse(raw);
|
|
59
|
+
if (!Number.isFinite(beforeTs)) {
|
|
60
|
+
throw new PmCliError(`Invalid history-compact --before value "${before}". Use a version number or ISO timestamp.`, EXIT_CODE.USAGE);
|
|
61
|
+
}
|
|
62
|
+
let compactCount = 0;
|
|
63
|
+
for (const [index, entry] of entries.entries()) {
|
|
64
|
+
const entryTs = Date.parse(entry.ts);
|
|
65
|
+
if (!Number.isFinite(entryTs)) {
|
|
66
|
+
throw new PmCliError(`History for this item contains invalid timestamp at entry ${index + 1}.`, EXIT_CODE.GENERIC_FAILURE);
|
|
67
|
+
}
|
|
68
|
+
if (entryTs >= beforeTs) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
compactCount += 1;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
kind: "timestamp",
|
|
75
|
+
raw,
|
|
76
|
+
compactCount,
|
|
77
|
+
retainedCount: entries.length - compactCount,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function replayHistoryAndResolveCheckpoint(entries, compactCount) {
|
|
81
|
+
let replay = cloneEmptyReplayDocument();
|
|
82
|
+
let checkpoint = cloneEmptyReplayDocument();
|
|
83
|
+
for (let index = 0; index < entries.length; index += 1) {
|
|
84
|
+
const entry = entries[index];
|
|
85
|
+
if (replayHash(replay) !== entry.before_hash) {
|
|
86
|
+
throw new PmCliError(`history-compact detected before-hash drift at entry ${index + 1}; run pm history-repair first.`, EXIT_CODE.CONFLICT);
|
|
87
|
+
}
|
|
88
|
+
replay = applyHistoryPatch(replay, entry.patch, index + 1, entry.op);
|
|
89
|
+
if (replayHash(replay) !== entry.after_hash) {
|
|
90
|
+
throw new PmCliError(`history-compact detected after-hash drift at entry ${index + 1}; run pm history-repair first.`, EXIT_CODE.CONFLICT);
|
|
91
|
+
}
|
|
92
|
+
if (index + 1 === compactCount) {
|
|
93
|
+
checkpoint = structuredClone(replay);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
checkpoint,
|
|
98
|
+
finalReplay: replay,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function reanchorRetainedEntries(retainedEntries, seed, retainedEntryOffset) {
|
|
102
|
+
let replay = structuredClone(seed);
|
|
103
|
+
const rewritten = [];
|
|
104
|
+
for (const [index, entry] of retainedEntries.entries()) {
|
|
105
|
+
const beforeHash = replayHash(replay);
|
|
106
|
+
replay = applyHistoryPatch(replay, entry.patch, retainedEntryOffset + index + 1, entry.op);
|
|
107
|
+
rewritten.push({
|
|
108
|
+
...entry,
|
|
109
|
+
before_hash: beforeHash,
|
|
110
|
+
after_hash: replayHash(replay),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
entries: rewritten,
|
|
115
|
+
finalReplay: replay,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
async function loadHistoryCompactCurrentItem(subject, settings, historyEntries) {
|
|
119
|
+
const loadedItem = subject.located
|
|
120
|
+
? await readLocatedItem(subject.located, { schema: settings.schema })
|
|
121
|
+
: null;
|
|
122
|
+
if (!loadedItem) {
|
|
123
|
+
return {
|
|
124
|
+
loadedItem: null,
|
|
125
|
+
currentItemRawBeforeLock: null,
|
|
126
|
+
matchedChainBefore: null,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
loadedItem,
|
|
131
|
+
currentItemRawBeforeLock: loadedItem.raw,
|
|
132
|
+
matchedChainBefore: replayHash(toReplayDocument(loadedItem.document)) ===
|
|
133
|
+
historyEntries[historyEntries.length - 1]?.after_hash,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function buildHistoryCompactMessage(options, boundary) {
|
|
137
|
+
if (typeof options.message === "string" &&
|
|
138
|
+
options.message.trim().length > 0) {
|
|
139
|
+
return options.message;
|
|
140
|
+
}
|
|
141
|
+
if (boundary.raw === null) {
|
|
142
|
+
return `history-compact compacted full stream (${boundary.compactCount} entr${boundary.compactCount === 1 ? "y" : "ies"}).`;
|
|
143
|
+
}
|
|
144
|
+
return `history-compact compacted ${boundary.compactCount} entr${boundary.compactCount === 1 ? "y" : "ies"} before ${boundary.raw}.`;
|
|
145
|
+
}
|
|
146
|
+
function buildHistoryCompactBaselineMessage(boundary) {
|
|
147
|
+
if (boundary.raw === null) {
|
|
148
|
+
return `history-compact baseline snapshot after compacting ${boundary.compactCount} entr${boundary.compactCount === 1 ? "y" : "ies"}.`;
|
|
149
|
+
}
|
|
150
|
+
return `history-compact baseline snapshot before ${boundary.raw}.`;
|
|
151
|
+
}
|
|
152
|
+
function buildHistoryCompactEntries(params) {
|
|
153
|
+
if (!params.changed) {
|
|
154
|
+
return {
|
|
155
|
+
rewrittenEntries: params.historyEntries,
|
|
156
|
+
baselineEntryAdded: false,
|
|
157
|
+
auditEntryAdded: false,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const { checkpoint, finalReplay } = replayHistoryAndResolveCheckpoint(params.historyEntries, params.boundary.compactCount);
|
|
161
|
+
const retained = params.historyEntries.slice(params.boundary.compactCount);
|
|
162
|
+
const reanchored = reanchorRetainedEntries(retained, checkpoint, params.boundary.compactCount);
|
|
163
|
+
const baselineEntry = createHistoryEntry({
|
|
164
|
+
nowIso: nowIso(),
|
|
165
|
+
author: params.author,
|
|
166
|
+
op: "history_compact_baseline",
|
|
167
|
+
before: replayToItemDocument(cloneEmptyReplayDocument()),
|
|
168
|
+
after: replayToItemDocument(checkpoint),
|
|
169
|
+
message: buildHistoryCompactBaselineMessage(params.boundary),
|
|
170
|
+
});
|
|
171
|
+
const rewrittenEntries = [baselineEntry, ...reanchored.entries];
|
|
172
|
+
if (!params.dryRun) {
|
|
173
|
+
rewrittenEntries.push(createHistoryEntry({
|
|
174
|
+
nowIso: nowIso(),
|
|
175
|
+
author: params.author,
|
|
176
|
+
op: "history_compact",
|
|
177
|
+
before: replayToItemDocument(finalReplay),
|
|
178
|
+
after: replayToItemDocument(finalReplay),
|
|
179
|
+
message: buildHistoryCompactMessage(params.options, params.boundary),
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
rewrittenEntries,
|
|
184
|
+
baselineEntryAdded: true,
|
|
185
|
+
auditEntryAdded: !params.dryRun,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
async function applyHistoryCompactRewrite(params) {
|
|
189
|
+
return executeHistoryRewrite({
|
|
190
|
+
pmRoot: params.pmRoot,
|
|
191
|
+
subject: params.subject,
|
|
192
|
+
settings: params.settings,
|
|
193
|
+
typeRegistry: params.typeRegistry,
|
|
194
|
+
historyRawBeforeLock: params.historyRawBeforeLock,
|
|
195
|
+
currentItemRawBeforeLock: params.currentItemRawBeforeLock,
|
|
196
|
+
operation: "history-compact",
|
|
197
|
+
author: params.author,
|
|
198
|
+
force: params.force,
|
|
199
|
+
itemDocument: params.loadedItem?.document ?? null,
|
|
200
|
+
applyRewrite: async ({ historyRawUnderLock }) => writeHistoryRawWithRollback({
|
|
201
|
+
historyPath: params.historyPath,
|
|
202
|
+
nextHistoryRaw: historyEntriesToRaw(params.rewrittenEntries),
|
|
203
|
+
historyRawUnderLock,
|
|
204
|
+
}),
|
|
205
|
+
applyPostRewrite: async () => runActiveOnWriteHooks({
|
|
206
|
+
path: params.historyPath,
|
|
207
|
+
scope: "project",
|
|
208
|
+
op: "history_compact:history",
|
|
209
|
+
}),
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
/** Implements run history compact for the public runtime surface of this module. */
|
|
213
|
+
export async function runHistoryCompact(id, options, global) {
|
|
214
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
215
|
+
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
216
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
217
|
+
}
|
|
218
|
+
const settings = await readSettings(pmRoot);
|
|
219
|
+
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
220
|
+
const subject = await resolveHistorySubject(pmRoot, id, settings, typeRegistry.type_to_folder);
|
|
221
|
+
const historyPath = subject.historyPath;
|
|
222
|
+
const historyRawBeforeLock = await readFileIfExists(historyPath);
|
|
223
|
+
if (historyRawBeforeLock === null) {
|
|
224
|
+
throw new PmCliError(`No history stream exists for ${subject.id}.`, EXIT_CODE.NOT_FOUND);
|
|
225
|
+
}
|
|
226
|
+
const historyEntries = await readHistoryEntries(historyPath, subject.id);
|
|
227
|
+
if (historyEntries.length === 0) {
|
|
228
|
+
throw new PmCliError(`No history entries exist for ${subject.id}; nothing to compact.`, EXIT_CODE.USAGE);
|
|
229
|
+
}
|
|
230
|
+
const chainVerification = verifyHistoryChain(historyEntries);
|
|
231
|
+
if (!chainVerification.ok) {
|
|
232
|
+
throw new PmCliError(`history-compact requires a valid history chain (${chainVerification.errors.join(", ")}). Run pm history-repair ${subject.id} first.`, EXIT_CODE.CONFLICT);
|
|
233
|
+
}
|
|
234
|
+
const boundary = parseBeforeBoundary(options.before, historyEntries);
|
|
235
|
+
const changed = boundary.compactCount > 0;
|
|
236
|
+
const dryRun = Boolean(options.dryRun);
|
|
237
|
+
const author = resolveAuthor(options.author, settings.author_default);
|
|
238
|
+
const warnings = [];
|
|
239
|
+
if (!changed) {
|
|
240
|
+
warnings.push("history_compact_noop_before_boundary");
|
|
241
|
+
}
|
|
242
|
+
const currentItem = await loadHistoryCompactCurrentItem(subject, settings, historyEntries);
|
|
243
|
+
if (currentItem.matchedChainBefore === false) {
|
|
244
|
+
warnings.push("history_compact_item_chain_mismatch");
|
|
245
|
+
}
|
|
246
|
+
const { rewrittenEntries, baselineEntryAdded, auditEntryAdded } = buildHistoryCompactEntries({
|
|
247
|
+
historyEntries,
|
|
248
|
+
boundary,
|
|
249
|
+
changed,
|
|
250
|
+
dryRun,
|
|
251
|
+
author,
|
|
252
|
+
options,
|
|
253
|
+
});
|
|
254
|
+
const rewrittenVerify = verifyHistoryChain(rewrittenEntries);
|
|
255
|
+
if (!rewrittenVerify.ok) {
|
|
256
|
+
throw new PmCliError(`history-compact produced an invalid rewritten chain (${rewrittenVerify.errors.join(", ")}).`, EXIT_CODE.GENERIC_FAILURE);
|
|
257
|
+
}
|
|
258
|
+
if (changed && !dryRun) {
|
|
259
|
+
warnings.push(...(await applyHistoryCompactRewrite({
|
|
260
|
+
pmRoot,
|
|
261
|
+
subject,
|
|
262
|
+
settings,
|
|
263
|
+
typeRegistry,
|
|
264
|
+
historyRawBeforeLock,
|
|
265
|
+
currentItemRawBeforeLock: currentItem.currentItemRawBeforeLock,
|
|
266
|
+
author,
|
|
267
|
+
force: options.force,
|
|
268
|
+
loadedItem: currentItem.loadedItem,
|
|
269
|
+
historyPath,
|
|
270
|
+
rewrittenEntries,
|
|
271
|
+
})));
|
|
272
|
+
}
|
|
273
|
+
const firstRetainedEntry = boundary.retainedCount > 0 ? boundary.compactCount + 1 : null;
|
|
274
|
+
return {
|
|
275
|
+
id: subject.id,
|
|
276
|
+
dry_run: dryRun,
|
|
277
|
+
changed,
|
|
278
|
+
compact_boundary: {
|
|
279
|
+
kind: boundary.kind,
|
|
280
|
+
before: boundary.raw,
|
|
281
|
+
entries_compacted: boundary.compactCount,
|
|
282
|
+
entries_retained: boundary.retainedCount,
|
|
283
|
+
first_retained_entry: firstRetainedEntry,
|
|
284
|
+
},
|
|
285
|
+
history: {
|
|
286
|
+
path: historyPath,
|
|
287
|
+
entries_scanned: historyEntries.length,
|
|
288
|
+
entries_after: rewrittenEntries.length,
|
|
289
|
+
baseline_entry_added: baselineEntryAdded,
|
|
290
|
+
audit_entry_added: auditEntryAdded,
|
|
291
|
+
verify_ok: rewrittenVerify.ok,
|
|
292
|
+
verify_errors: rewrittenVerify.errors,
|
|
293
|
+
},
|
|
294
|
+
item: {
|
|
295
|
+
exists: subject.located !== null,
|
|
296
|
+
path: subject.located?.itemPath ?? null,
|
|
297
|
+
matched_chain_before: currentItem.matchedChainBefore,
|
|
298
|
+
},
|
|
299
|
+
warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
|
|
300
|
+
generated_at: nowIso(),
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
/** Default entry floor below which a stream is treated as already compact. */
|
|
304
|
+
export const HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES = 3;
|
|
305
|
+
/** Enforce the `pm history-compact` target contract shared by the CLI and MCP surfaces: exactly one selection mode — a single item `<id>`, an explicit `--ids` list, or a scan selector (`--all-over` / `--closed` / `--all-streams`). */
|
|
306
|
+
export function assertHistoryCompactTarget(id, bulk) {
|
|
307
|
+
const hasIds = bulk.ids !== undefined && bulk.ids.length > 0;
|
|
308
|
+
const hasScan = bulk.allOver !== undefined || bulk.scope !== undefined;
|
|
309
|
+
const selectorCount = (id !== undefined ? 1 : 0) + (hasIds ? 1 : 0) + (hasScan ? 1 : 0);
|
|
310
|
+
if (selectorCount === 0) {
|
|
311
|
+
throw new PmCliError("history-compact: provide an item <id>, or a bulk selector (--ids, --all-over <N>, --closed, or --all-streams).", EXIT_CODE.USAGE);
|
|
312
|
+
}
|
|
313
|
+
if (id !== undefined && (hasIds || hasScan)) {
|
|
314
|
+
throw new PmCliError("history-compact: <id> and bulk selectors (--ids/--all-over/--closed/--all-streams) are mutually exclusive; pass one item id, or use bulk mode without a positional id.", EXIT_CODE.USAGE);
|
|
315
|
+
}
|
|
316
|
+
if (hasIds && hasScan) {
|
|
317
|
+
throw new PmCliError("history-compact: --ids is mutually exclusive with --all-over/--closed/--all-streams; pass an explicit id list or a scan selector, not both.", EXIT_CODE.USAGE);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function countHistoryStreamEntries(raw) {
|
|
321
|
+
let count = 0;
|
|
322
|
+
for (const line of raw.split(/\r?\n/)) {
|
|
323
|
+
if (line.trim().length > 0) {
|
|
324
|
+
count += 1;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return count;
|
|
328
|
+
}
|
|
329
|
+
async function collectHistoryCompactBulkCandidates(params) {
|
|
330
|
+
const statusRegistry = resolveRuntimeStatusRegistry(params.settings.schema);
|
|
331
|
+
const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);
|
|
332
|
+
const items = await listAllItemMetadataLight(params.pmRoot, params.settings.item_format, params.typeToFolder, undefined, params.settings.schema);
|
|
333
|
+
const bucketById = new Map(items.map((item) => [item.id, classifier.classify(item.status)]));
|
|
334
|
+
const historyDir = path.join(params.pmRoot, "history");
|
|
335
|
+
const candidates = [];
|
|
336
|
+
const preselectionErrors = [];
|
|
337
|
+
if (!(await pathExists(historyDir))) {
|
|
338
|
+
return { candidates, preselectionErrors };
|
|
339
|
+
}
|
|
340
|
+
const historyFiles = (await fs.readdir(historyDir))
|
|
341
|
+
.filter((entry) => entry.endsWith(".jsonl"))
|
|
342
|
+
.sort((left, right) => left.localeCompare(right));
|
|
343
|
+
for (const fileName of historyFiles) {
|
|
344
|
+
const historyPath = path.join(historyDir, fileName);
|
|
345
|
+
const id = fileName.slice(0, -".jsonl".length);
|
|
346
|
+
try {
|
|
347
|
+
const raw = await fs.readFile(historyPath, "utf8");
|
|
348
|
+
await runActiveOnReadHooks({ path: historyPath, scope: "project" });
|
|
349
|
+
candidates.push({
|
|
350
|
+
id,
|
|
351
|
+
entries: countHistoryStreamEntries(raw),
|
|
352
|
+
bucket: bucketById.get(id) ?? null,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
preselectionErrors.push({
|
|
357
|
+
id,
|
|
358
|
+
outcome: "errored",
|
|
359
|
+
entries_before: 0,
|
|
360
|
+
entries_after: null,
|
|
361
|
+
skip_reason: null,
|
|
362
|
+
changed: false,
|
|
363
|
+
/* c8 ignore next -- non-Error throws are normalized in defensive fallback. */
|
|
364
|
+
error: error instanceof Error ? error.message : String(error),
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return { candidates, preselectionErrors };
|
|
369
|
+
}
|
|
370
|
+
async function runHistoryCompactBulkRow(params) {
|
|
371
|
+
if (!params.row.selected) {
|
|
372
|
+
return {
|
|
373
|
+
selected: false,
|
|
374
|
+
compacted: false,
|
|
375
|
+
errored: false,
|
|
376
|
+
result: {
|
|
377
|
+
id: params.row.id,
|
|
378
|
+
outcome: "skipped",
|
|
379
|
+
entries_before: params.row.entries,
|
|
380
|
+
entries_after: null,
|
|
381
|
+
skip_reason: params.row.skip_reason,
|
|
382
|
+
changed: false,
|
|
383
|
+
error: null,
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
try {
|
|
388
|
+
const result = await runHistoryCompact(params.row.id, {
|
|
389
|
+
dryRun: params.dryRun,
|
|
390
|
+
author: params.options.author,
|
|
391
|
+
message: params.options.message,
|
|
392
|
+
force: params.options.force,
|
|
393
|
+
}, params.global);
|
|
394
|
+
return {
|
|
395
|
+
selected: true,
|
|
396
|
+
compacted: true,
|
|
397
|
+
errored: false,
|
|
398
|
+
result: {
|
|
399
|
+
id: params.row.id,
|
|
400
|
+
outcome: "compacted",
|
|
401
|
+
entries_before: params.row.entries,
|
|
402
|
+
entries_after: result.history.entries_after,
|
|
403
|
+
skip_reason: null,
|
|
404
|
+
changed: result.changed,
|
|
405
|
+
error: null,
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
catch (error) {
|
|
410
|
+
return {
|
|
411
|
+
selected: true,
|
|
412
|
+
compacted: false,
|
|
413
|
+
errored: true,
|
|
414
|
+
result: {
|
|
415
|
+
id: params.row.id,
|
|
416
|
+
outcome: "errored",
|
|
417
|
+
entries_before: params.row.entries,
|
|
418
|
+
entries_after: null,
|
|
419
|
+
skip_reason: null,
|
|
420
|
+
changed: false,
|
|
421
|
+
/* c8 ignore next -- non-Error throws are normalized in defensive fallback. */
|
|
422
|
+
error: error instanceof Error ? error.message : String(error),
|
|
423
|
+
},
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Bulk history compaction: compact every history stream matching the requested
|
|
429
|
+
* selection (explicit `--ids`, a `--scope` lifecycle filter, and/or an
|
|
430
|
+
* `--all-over <N>` entry threshold) in one audited pass. Each selected stream is
|
|
431
|
+
* compacted with the same single-item logic ({@link runHistoryCompact}); one
|
|
432
|
+
* failing stream never aborts the rest, and the caller decides the exit code
|
|
433
|
+
* from `totals.items_errored`.
|
|
434
|
+
*
|
|
435
|
+
* When `history.compact_policy` is enabled and no explicit `--all-over` is
|
|
436
|
+
* given, the policy's `max_entries` is used as the scan threshold so the
|
|
437
|
+
* configured policy drives the sweep.
|
|
438
|
+
*/
|
|
439
|
+
export async function runHistoryCompactBulk(options, global) {
|
|
440
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
441
|
+
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
442
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
443
|
+
}
|
|
444
|
+
const settings = await readSettings(pmRoot);
|
|
445
|
+
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
446
|
+
const { candidates, preselectionErrors } = await collectHistoryCompactBulkCandidates({
|
|
447
|
+
pmRoot,
|
|
448
|
+
settings,
|
|
449
|
+
typeToFolder: typeRegistry.type_to_folder,
|
|
450
|
+
});
|
|
451
|
+
const mode = options.ids !== undefined && options.ids.length > 0 ? "ids" : "scan";
|
|
452
|
+
const minEntries = options.minEntries ?? HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES;
|
|
453
|
+
const policy = settings.history.compact_policy;
|
|
454
|
+
const policyThresholdApplied = mode === "scan" && options.allOver === undefined && policy.enabled;
|
|
455
|
+
const allOver = options.allOver ??
|
|
456
|
+
(policyThresholdApplied ? policy.max_entries : undefined);
|
|
457
|
+
const selection = selectHistoryCompactBulkTargets(candidates, {
|
|
458
|
+
ids: options.ids,
|
|
459
|
+
scope: options.scope,
|
|
460
|
+
minEntries,
|
|
461
|
+
allOver,
|
|
462
|
+
});
|
|
463
|
+
const dryRun = Boolean(options.dryRun);
|
|
464
|
+
const results = [...preselectionErrors];
|
|
465
|
+
const totals = {
|
|
466
|
+
streams_considered: candidates.length + preselectionErrors.length,
|
|
467
|
+
selected: 0,
|
|
468
|
+
items_compacted: 0,
|
|
469
|
+
items_skipped: 0,
|
|
470
|
+
items_errored: preselectionErrors.length,
|
|
471
|
+
};
|
|
472
|
+
for (const row of selection) {
|
|
473
|
+
const outcome = await runHistoryCompactBulkRow({
|
|
474
|
+
row,
|
|
475
|
+
options,
|
|
476
|
+
dryRun,
|
|
477
|
+
global,
|
|
478
|
+
});
|
|
479
|
+
results.push(outcome.result);
|
|
480
|
+
if (!outcome.selected) {
|
|
481
|
+
totals.items_skipped += 1;
|
|
482
|
+
continue;
|
|
483
|
+
}
|
|
484
|
+
totals.selected += 1;
|
|
485
|
+
if (outcome.compacted) {
|
|
486
|
+
totals.items_compacted += 1;
|
|
487
|
+
}
|
|
488
|
+
if (outcome.errored) {
|
|
489
|
+
totals.items_errored += 1;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return {
|
|
493
|
+
bulk: true,
|
|
494
|
+
dry_run: dryRun,
|
|
495
|
+
mode,
|
|
496
|
+
scope: options.scope ?? null,
|
|
497
|
+
criteria: {
|
|
498
|
+
min_entries: minEntries,
|
|
499
|
+
all_over: allOver ?? null,
|
|
500
|
+
policy_threshold_applied: policyThresholdApplied,
|
|
501
|
+
},
|
|
502
|
+
totals,
|
|
503
|
+
results,
|
|
504
|
+
generated_at: nowIso(),
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
//# sourceMappingURL=history-compact.js.map
|
|
508
|
+
//# debugId=a58bdcf8-a01b-55b7-ac6e-57432c9422bf
|