@unbrained/pm-cli 2026.7.2 → 2026.7.4
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 +3 -3
- package/CHANGELOG.md +29 -0
- package/CONTRIBUTING.md +38 -9
- package/README.md +1 -5
- package/dist/cli/commander-usage.js +54 -41
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +79 -57
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/calendar.js +3 -3
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +106 -65
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/completion.js +231 -345
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/create.d.ts +2 -59
- package/dist/cli/commands/create.js +38 -39
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/doctor.js +56 -67
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +54 -133
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension/shared.js +21 -15
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/files.js +3 -3
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/health.js +101 -112
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.js +9 -18
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +9 -19
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.js +160 -111
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.js +3 -3
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/item-filter-options.d.ts +2 -0
- package/dist/cli/commands/item-filter-options.js +2 -2
- package/dist/cli/commands/item-filter-options.js.map +1 -1
- package/dist/cli/commands/mutation-command-options.d.ts +78 -0
- package/dist/cli/commands/mutation-command-options.js +10 -0
- package/dist/cli/commands/mutation-command-options.js.map +1 -0
- package/dist/cli/commands/next.js +13 -10
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/profile.js +23 -15
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/commands/reindex.js +3 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/shared-unset-fields.d.ts +19 -0
- package/dist/cli/commands/shared-unset-fields.js +31 -2
- package/dist/cli/commands/shared-unset-fields.js.map +1 -1
- package/dist/cli/commands/update.d.ts +2 -59
- package/dist/cli/commands/update.js +26 -97
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +2 -0
- package/dist/cli/commands/validate.js +16 -4
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +9 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.js +27 -19
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-json-payload.js +57 -49
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +48 -32
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +215 -213
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +368 -368
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +303 -299
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +4 -0
- package/dist/cli/registration-helpers.js +51 -56
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-IDS5GSYG.js +16 -0
- package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js → activity-OENQCYZD.js} +9 -9
- package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js → aggregate-EC4LWS3U.js} +8 -8
- package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js → aggregate-RCB3QJJE.js} +8 -8
- package/dist/cli-bundle/chunks/{append-H32VOR2Y.js → append-ADBOI3A6.js} +8 -8
- package/dist/cli-bundle/chunks/{append-UBM632FK.js → append-XLEKVVWB.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js → chunk-2LRMWMZ6.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-2227673O.js → chunk-2ONH3WG6.js} +32 -13
- package/dist/cli-bundle/chunks/{chunk-2227673O.js.map → chunk-2ONH3WG6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MNBPX5JS.js → chunk-2VK677OA.js} +72 -49
- package/dist/cli-bundle/chunks/chunk-2VK677OA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js → chunk-3C5T3ZEO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js → chunk-3MLQZI3H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js → chunk-4EVY7CQN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js → chunk-4IW7STMB.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-6YCYF2AI.js → chunk-4KPQQ42D.js} +166 -110
- package/dist/cli-bundle/chunks/chunk-4KPQQ42D.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js → chunk-4OXNQHKQ.js} +23 -17
- package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js.map → chunk-4OXNQHKQ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js → chunk-4PJYRA3V.js} +31 -12
- package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js.map → chunk-4PJYRA3V.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js → chunk-4SHME4VR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6ITZLD4T.js → chunk-5FYY76HR.js} +28 -99
- package/dist/cli-bundle/chunks/chunk-5FYY76HR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js → chunk-6QY2NA2M.js} +24 -18
- package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js.map → chunk-6QY2NA2M.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js → chunk-6YB7HG2J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js → chunk-724VLYDJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XCHUVHKU.js → chunk-75VMARGO.js} +11 -11
- package/dist/cli-bundle/chunks/chunk-75VMARGO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XWGEMNBR.js → chunk-7745CXNI.js} +119 -195
- package/dist/cli-bundle/chunks/chunk-7745CXNI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YPKFV2JR.js → chunk-7G5SUU6F.js} +76 -54
- package/dist/cli-bundle/chunks/chunk-7G5SUU6F.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js → chunk-7ITQSEBL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-W47SML5B.js → chunk-A222YWOQ.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js → chunk-A2W3XKAD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js → chunk-AOP2EMK3.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RM37OPYK.js → chunk-AZMPKLIA.js} +72 -49
- package/dist/cli-bundle/chunks/chunk-AZMPKLIA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7NSPKJUS.js → chunk-BDDYM4LH.js} +262 -252
- package/dist/cli-bundle/chunks/chunk-BDDYM4LH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JXAUVO6X.js → chunk-CN4OAA2G.js} +55 -20
- package/dist/cli-bundle/chunks/chunk-CN4OAA2G.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js → chunk-CQFZRLXQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js → chunk-CQISNF3Z.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-S62UANU7.js → chunk-D2LDM35X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GRRG3MCT.js → chunk-DEIDJQZK.js} +57 -136
- package/dist/cli-bundle/chunks/chunk-DEIDJQZK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js → chunk-DJ5S2LDY.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js → chunk-EB4BBEZD.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js → chunk-EH23N5FX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js → chunk-FDNJMYZB.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-K2VYLVX4.js → chunk-FMWQRMHS.js} +33 -6
- package/dist/cli-bundle/chunks/chunk-FMWQRMHS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js → chunk-HL742IBM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js → chunk-J4KNRDI3.js} +59 -70
- package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js.map → chunk-J4KNRDI3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-66Z3X7ZG.js → chunk-JYLFF7GJ.js} +166 -110
- package/dist/cli-bundle/chunks/chunk-JYLFF7GJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GFMSLORL.js → chunk-JZJJEJBR.js} +75 -53
- package/dist/cli-bundle/chunks/chunk-JZJJEJBR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7TH5NMVB.js → chunk-KKHIQOTN.js} +25 -19
- package/dist/cli-bundle/chunks/chunk-KKHIQOTN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5GVTFFTC.js → chunk-LLQLLAKU.js} +118 -194
- package/dist/cli-bundle/chunks/chunk-LLQLLAKU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KIYCOJ63.js → chunk-M34MVAOP.js} +58 -137
- package/dist/cli-bundle/chunks/chunk-M34MVAOP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js → chunk-M6PR5BC6.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-XEWQKDYZ.js → chunk-MTB4PRA3.js} +10 -10
- package/dist/cli-bundle/chunks/chunk-MTB4PRA3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js → chunk-MZ4NH46V.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AIAIXG7I.js → chunk-MZG6I2Q2.js} +39 -5
- package/dist/cli-bundle/chunks/chunk-MZG6I2Q2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js → chunk-N2LOJUBB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js → chunk-NGDK3KEZ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-SYNKD3ZG.js → chunk-NHDR3UCW.js} +46 -60
- package/dist/cli-bundle/chunks/chunk-NHDR3UCW.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js → chunk-NHKXOMZ5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js → chunk-OTSP6UEX.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js → chunk-PUVPC5DL.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js → chunk-PV5JS7MP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js → chunk-Q2266G4S.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js → chunk-Q3XVLRCJ.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-AJEBCRIY.js → chunk-QFXFKYNQ.js} +47 -61
- package/dist/cli-bundle/chunks/chunk-QFXFKYNQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js → chunk-R7EMP4JG.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-SPM2XLWI.js → chunk-SBNT6SLO.js} +22 -7
- package/dist/cli-bundle/chunks/chunk-SBNT6SLO.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-I66WE2HE.js → chunk-SL2ANJSV.js} +260 -250
- package/dist/cli-bundle/chunks/chunk-SL2ANJSV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js → chunk-T5RTYLZJ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js → chunk-TGYDJEJH.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js → chunk-TO4KCIOT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js → chunk-TUV7SIWZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js → chunk-UGDONITK.js} +58 -69
- package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js.map → chunk-UGDONITK.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NRZS637N.js → chunk-UYLA5ROU.js} +56 -21
- package/dist/cli-bundle/chunks/chunk-UYLA5ROU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js → chunk-V655JQ5J.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js → chunk-W5X3AHJN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js → chunk-WBWRQS32.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js → chunk-WOOB7PV7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js → chunk-WSDIALO4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js → chunk-WTXDLBSZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js → chunk-XBIYI23P.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-7W4H4K26.js → chunk-XFO2NJY6.js} +29 -100
- package/dist/cli-bundle/chunks/chunk-XFO2NJY6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TPOFWBMY.js → chunk-XQCWTSLO.js} +26 -20
- package/dist/cli-bundle/chunks/chunk-XQCWTSLO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js → chunk-Y2VSCQ77.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js → chunk-YZR7UMZ6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YLZZ6T54.js → chunk-YZWXMDNH.js} +23 -8
- package/dist/cli-bundle/chunks/chunk-YZWXMDNH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js → chunk-ZIEGTQCY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js → chunk-ZZWMJVW2.js} +4 -4
- package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js → claim-D6L33A5Y.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-SENTPZBN.js → claim-YAFUTPVK.js} +8 -8
- package/dist/cli-bundle/chunks/close-KLDLHAOP.js +14 -0
- package/dist/cli-bundle/chunks/{close-424MX4CU.js → close-TGYXG7TV.js} +7 -7
- package/dist/cli-bundle/chunks/{close-many-SWY34BII.js → close-many-4QSWKCRU.js} +119 -76
- package/dist/cli-bundle/chunks/close-many-4QSWKCRU.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-many-2IV4J2TR.js → close-many-SNA6LNZH.js} +120 -77
- package/dist/cli-bundle/chunks/close-many-SNA6LNZH.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js → comments-QC6ARR5X.js} +9 -9
- package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js → comments-ZHVYGUVC.js} +9 -9
- package/dist/cli-bundle/chunks/{config-G74GISC4.js → config-O6W2EU2G.js} +7 -7
- package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js → config-XQRFJXJP.js} +7 -7
- package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js → context-IHE3IXN5.js} +12 -12
- package/dist/cli-bundle/chunks/{context-ZQY54JNS.js → context-WSYWBEUL.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js → contracts-CVBINC7C.js} +3 -3
- package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js → contracts-NLCDIZAT.js} +3 -3
- package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js → copy-7MUQC44A.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js → copy-ANWXDJVC.js} +5 -5
- package/dist/cli-bundle/chunks/create-AJ6HUR5W.js +28 -0
- package/dist/cli-bundle/chunks/{create-VSKYSOCD.js → create-JIA2IFCO.js} +12 -12
- package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js → delete-5OLYWQIC.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js → delete-INHKCIRN.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js → deps-CCSWGZW7.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js → deps-IYEID3QX.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js → docs-3XZK22WF.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js → docs-PKO7OEIM.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js → eval-5XYP6NMY.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js → eval-O4WGQYDI.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js → extension-PVGRRZZG.js} +11 -11
- package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js → extension-T7JNTAAA.js} +11 -11
- package/dist/cli-bundle/chunks/{files-5D65CHGE.js → files-7IU56S6R.js} +10 -10
- package/dist/cli-bundle/chunks/files-7IU56S6R.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-GPIG77EN.js → files-W7HH5EOD.js} +9 -9
- package/dist/cli-bundle/chunks/{files-GPIG77EN.js.map → files-W7HH5EOD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js → focus-6FA5KYRY.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js → focus-CQ63JFDG.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js → gc-3BG67KTO.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-VZIXDL32.js → gc-PEZYGNVB.js} +3 -3
- package/dist/cli-bundle/chunks/{get-GIBRUUOP.js → get-J6CSJ4SX.js} +10 -10
- package/dist/cli-bundle/chunks/{get-IOVAN6RU.js → get-KJTKGNEQ.js} +10 -10
- package/dist/cli-bundle/chunks/{health-L2U3AFKV.js → health-32UQICEL.js} +115 -123
- package/dist/cli-bundle/chunks/health-32UQICEL.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-MM7AWXYF.js → health-ZUZG5ULV.js} +114 -122
- package/dist/cli-bundle/chunks/health-ZUZG5ULV.js.map +7 -0
- package/dist/cli-bundle/chunks/history-IOH6FKG7.js +18 -0
- package/dist/cli-bundle/chunks/{history-IL7XCEX2.js → history-W6QVR6FA.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-HALOTOU7.js → history-compact-F355EGL4.js} +20 -27
- package/dist/cli-bundle/chunks/history-compact-F355EGL4.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-compact-MV25P7DM.js → history-compact-JQ6ZGYSJ.js} +19 -26
- package/dist/cli-bundle/chunks/history-compact-JQ6ZGYSJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js → history-redact-TUWOUYX5.js} +9 -9
- package/dist/cli-bundle/chunks/history-redact-VVDOARNO.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-44MODPQF.js → history-repair-MPCAIKYE.js} +20 -28
- package/dist/cli-bundle/chunks/history-repair-MPCAIKYE.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-CPNAOCNF.js → history-repair-ZKS3LKPV.js} +19 -27
- package/dist/cli-bundle/chunks/history-repair-ZKS3LKPV.js.map +7 -0
- package/dist/cli-bundle/chunks/init-CZLEEE6Q.js +22 -0
- package/dist/cli-bundle/chunks/{init-F27NHENZ.js → init-MAA6UMNQ.js} +12 -12
- package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js → learnings-EYC3OKS2.js} +9 -9
- package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js → learnings-HKJJUVTA.js} +9 -9
- package/dist/cli-bundle/chunks/{list-VMPWTURB.js → list-HFD5737R.js} +8 -8
- package/dist/cli-bundle/chunks/{list-HPMEKCAA.js → list-KN3TL5Y5.js} +8 -8
- package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js → next-DQUMFAHG.js} +25 -22
- package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js.map → next-DQUMFAHG.js.map} +2 -2
- package/dist/cli-bundle/chunks/{next-QM6YJIIS.js → next-JUEYC5HE.js} +26 -23
- package/dist/cli-bundle/chunks/next-JUEYC5HE.js.map +1 -0
- package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js → notes-XATYT43P.js} +9 -9
- package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js → notes-ZG6RLZXB.js} +9 -9
- package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js → plan-5NWQL2DH.js} +12 -12
- package/dist/cli-bundle/chunks/{plan-C5IMM335.js → plan-DVVLX7LK.js} +12 -12
- package/dist/cli-bundle/chunks/{profile-CCOKZ2IQ.js → profile-54DZ4CLB.js} +27 -19
- package/dist/cli-bundle/chunks/profile-54DZ4CLB.js.map +1 -0
- package/dist/cli-bundle/chunks/{profile-HUCENIEQ.js → profile-PLIQVEOY.js} +26 -18
- package/dist/cli-bundle/chunks/profile-PLIQVEOY.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-ROSNIL52.js → register-list-query-PNRAHNIQ.js} +181 -172
- package/dist/cli-bundle/chunks/register-list-query-PNRAHNIQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-XN4ZRHSV.js → register-list-query-WRS6ACUW.js} +180 -171
- package/dist/cli-bundle/chunks/register-list-query-WRS6ACUW.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-KRLAHEL2.js → register-mutation-ET6E4VLE.js} +367 -361
- package/dist/cli-bundle/chunks/register-mutation-ET6E4VLE.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-CFSB2MS3.js → register-mutation-K2MNRWGI.js} +368 -362
- package/dist/cli-bundle/chunks/register-mutation-K2MNRWGI.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-MBN4KGUM.js → register-operations-6DQRUTIX.js} +310 -305
- package/dist/cli-bundle/chunks/register-operations-6DQRUTIX.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-4PASGJDB.js → register-operations-73UDWMVB.js} +309 -304
- package/dist/cli-bundle/chunks/register-operations-73UDWMVB.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js → register-setup-FXZJ2CEJ.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js → register-setup-LYYCMQFV.js} +15 -15
- package/dist/cli-bundle/chunks/restore-L27TMMCF.js +17 -0
- package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js → restore-R6YJHQK3.js} +9 -9
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js → scheduling-shortcuts-LE4S7OI7.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js → scheduling-shortcuts-OGODPUBL.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js → schema-ICCD3HOP.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js → schema-RHH23PQX.js} +7 -7
- package/dist/cli-bundle/chunks/{search-FP7MEU4S.js → search-HDDKOPFE.js} +10 -10
- package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js → search-Z2VGP2Q5.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js → stats-DHMRXHOB.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js → stats-ETFP37MB.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js → telemetry-NUZNKDCP.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js → telemetry-ZRBM22QD.js} +4 -4
- package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js → test-H36PM746.js} +15 -15
- package/dist/cli-bundle/chunks/{test-YCDAUBWF.js → test-XNKTIP4Y.js} +15 -15
- package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js → test-all-APCBSXQI.js} +17 -17
- package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js → test-all-KIK3OYBY.js} +17 -17
- package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js → test-runs-5SLLV3XU.js} +4 -4
- package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js → test-runs-L3WKLO67.js} +4 -4
- package/dist/cli-bundle/chunks/update-RQKI3AMW.js +24 -0
- package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js → update-ZM7NJWHY.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js → update-many-GFCQG6ZQ.js} +28 -28
- package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js → update-many-XGTJ7QIU.js} +28 -28
- package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js → upgrade-KJ3JGELR.js} +11 -11
- package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js → upgrade-RBRQ7PQU.js} +11 -11
- package/dist/cli-bundle/chunks/{validate-732RWS5W.js → validate-EW6TGC7R.js} +31 -21
- package/dist/cli-bundle/chunks/validate-EW6TGC7R.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-W7H5TEDC.js → validate-T6PR5WAL.js} +32 -22
- package/dist/cli-bundle/chunks/validate-T6PR5WAL.js.map +1 -0
- package/dist/cli-bundle/main.js +180 -122
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/extensions/extension-types.d.ts +1 -2
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/history/history-rewrite.d.ts +10 -0
- package/dist/core/history/history-rewrite.js +27 -3
- package/dist/core/history/history-rewrite.js.map +1 -1
- package/dist/core/item/type-registry.d.ts +1 -0
- package/dist/core/item/type-registry.js +180 -194
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +65 -54
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.js +26 -3
- package/dist/core/schema/status-defs-file.js.map +1 -1
- package/dist/core/search/corpus.js +25 -19
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/shared/memo.d.ts +12 -0
- package/dist/core/shared/memo.js +25 -0
- package/dist/core/shared/memo.js.map +1 -0
- package/dist/core/shared/serialization.js +24 -14
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/shared/time.js +26 -4
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +5 -0
- package/dist/core/store/front-matter-cache.js +79 -20
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +73 -99
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +55 -94
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/compose.js +51 -42
- package/dist/sdk/compose.js.map +1 -1
- package/dist/sdk/package-import-adapters.d.ts +90 -2
- package/dist/sdk/package-import-adapters.js +274 -2
- package/dist/sdk/package-import-adapters.js.map +1 -1
- package/dist/sdk/runtime.d.ts +1 -1
- package/dist/sdk/runtime.js +3 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/docs/AGENT_GUIDE.md +2 -2
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/COMMANDS.md +8 -4
- package/docs/CONFIGURATION.md +1 -1
- package/docs/EXTENSIONS.md +12 -12
- package/docs/ONBOARDING.md +4 -2
- package/docs/README.md +2 -0
- package/docs/examples/starter-extension/README.md +11 -10
- package/marketplace.json +3 -3
- package/package.json +4 -3
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +27 -40
- package/packages/pm-beads/extensions/beads/runtime.ts +106 -223
- package/packages/pm-calendar/extensions/calendar/runtime.ts +21 -18
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +9 -11
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +48 -76
- package/packages/pm-todos/extensions/todos/runtime.ts +61 -257
- package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
- package/plugins/pm-claude/README.md +6 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-claude/scripts/pm-mcp-server.mjs +73 -31
- package/plugins/pm-codex/scripts/pm-mcp-server.mjs +80 -34
- package/scripts/install.ps1 +7 -7
- package/dist/cli-bundle/chunks/activity-WEIEMM73.js +0 -16
- package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AIAIXG7I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GFMSLORL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JXAUVO6X.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-K2VYLVX4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YPKFV2JR.js.map +0 -1
- package/dist/cli-bundle/chunks/close-YCWQQPDS.js +0 -14
- package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +0 -1
- package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +0 -7
- package/dist/cli-bundle/chunks/create-XTMAPS7I.js +0 -28
- package/dist/cli-bundle/chunks/files-5D65CHGE.js.map +0 -1
- package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +0 -1
- package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +0 -7
- package/dist/cli-bundle/chunks/history-DD7L7BNL.js +0 -18
- package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +0 -7
- package/dist/cli-bundle/chunks/init-HHVQQP6C.js +0 -22
- package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-CCOKZ2IQ.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-HUCENIEQ.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +0 -17
- package/dist/cli-bundle/chunks/update-MTCFES6X.js +0 -24
- package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-WEIEMM73.js.map → activity-IDS5GSYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js.map → activity-OENQCYZD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js.map → aggregate-EC4LWS3U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js.map → aggregate-RCB3QJJE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-H32VOR2Y.js.map → append-ADBOI3A6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-UBM632FK.js.map → append-XLEKVVWB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js.map → chunk-2LRMWMZ6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js.map → chunk-3C5T3ZEO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js.map → chunk-3MLQZI3H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js.map → chunk-4EVY7CQN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js.map → chunk-4IW7STMB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js.map → chunk-4SHME4VR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js.map → chunk-6YB7HG2J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js.map → chunk-724VLYDJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js.map → chunk-7ITQSEBL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W47SML5B.js.map → chunk-A222YWOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js.map → chunk-A2W3XKAD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js.map → chunk-AOP2EMK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js.map → chunk-CQFZRLXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js.map → chunk-CQISNF3Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S62UANU7.js.map → chunk-D2LDM35X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js.map → chunk-DJ5S2LDY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js.map → chunk-EB4BBEZD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js.map → chunk-EH23N5FX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js.map → chunk-FDNJMYZB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js.map → chunk-HL742IBM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js.map → chunk-M6PR5BC6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js.map → chunk-MZ4NH46V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js.map → chunk-N2LOJUBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js.map → chunk-NGDK3KEZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js.map → chunk-NHKXOMZ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js.map → chunk-OTSP6UEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js.map → chunk-PUVPC5DL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js.map → chunk-PV5JS7MP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js.map → chunk-Q2266G4S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js.map → chunk-Q3XVLRCJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js.map → chunk-R7EMP4JG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js.map → chunk-T5RTYLZJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js.map → chunk-TGYDJEJH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js.map → chunk-TO4KCIOT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js.map → chunk-TUV7SIWZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js.map → chunk-V655JQ5J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js.map → chunk-W5X3AHJN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js.map → chunk-WBWRQS32.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js.map → chunk-WOOB7PV7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js.map → chunk-WSDIALO4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js.map → chunk-WTXDLBSZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js.map → chunk-XBIYI23P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js.map → chunk-Y2VSCQ77.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js.map → chunk-YZR7UMZ6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js.map → chunk-ZIEGTQCY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js.map → chunk-ZZWMJVW2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js.map → claim-D6L33A5Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-SENTPZBN.js.map → claim-YAFUTPVK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-YCWQQPDS.js.map → close-KLDLHAOP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-424MX4CU.js.map → close-TGYXG7TV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js.map → comments-QC6ARR5X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js.map → comments-ZHVYGUVC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-G74GISC4.js.map → config-O6W2EU2G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js.map → config-XQRFJXJP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js.map → context-IHE3IXN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-ZQY54JNS.js.map → context-WSYWBEUL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js.map → contracts-CVBINC7C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js.map → contracts-NLCDIZAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js.map → copy-7MUQC44A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js.map → copy-ANWXDJVC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-XTMAPS7I.js.map → create-AJ6HUR5W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-VSKYSOCD.js.map → create-JIA2IFCO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js.map → delete-5OLYWQIC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js.map → delete-INHKCIRN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js.map → deps-CCSWGZW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js.map → deps-IYEID3QX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js.map → docs-3XZK22WF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js.map → docs-PKO7OEIM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js.map → eval-5XYP6NMY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js.map → eval-O4WGQYDI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js.map → extension-PVGRRZZG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js.map → extension-T7JNTAAA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js.map → focus-6FA5KYRY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js.map → focus-CQ63JFDG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js.map → gc-3BG67KTO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-VZIXDL32.js.map → gc-PEZYGNVB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-GIBRUUOP.js.map → get-J6CSJ4SX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-IOVAN6RU.js.map → get-KJTKGNEQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-DD7L7BNL.js.map → history-IOH6FKG7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-IL7XCEX2.js.map → history-W6QVR6FA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js.map → history-redact-TUWOUYX5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IX4YEWMY.js.map → history-redact-VVDOARNO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-HHVQQP6C.js.map → init-CZLEEE6Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-F27NHENZ.js.map → init-MAA6UMNQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js.map → learnings-EYC3OKS2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js.map → learnings-HKJJUVTA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-VMPWTURB.js.map → list-HFD5737R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-HPMEKCAA.js.map → list-KN3TL5Y5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js.map → notes-XATYT43P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js.map → notes-ZG6RLZXB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js.map → plan-5NWQL2DH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-C5IMM335.js.map → plan-DVVLX7LK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js.map → register-setup-FXZJ2CEJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js.map → register-setup-LYYCMQFV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-5UEAGG3W.js.map → restore-L27TMMCF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js.map → restore-R6YJHQK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js.map → scheduling-shortcuts-LE4S7OI7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js.map → scheduling-shortcuts-OGODPUBL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js.map → schema-ICCD3HOP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js.map → schema-RHH23PQX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-FP7MEU4S.js.map → search-HDDKOPFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js.map → search-Z2VGP2Q5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js.map → stats-DHMRXHOB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js.map → stats-ETFP37MB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js.map → telemetry-NUZNKDCP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js.map → telemetry-ZRBM22QD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js.map → test-H36PM746.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-YCDAUBWF.js.map → test-XNKTIP4Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js.map → test-all-APCBSXQI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js.map → test-all-KIK3OYBY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js.map → test-runs-5SLLV3XU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js.map → test-runs-L3WKLO67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-MTCFES6X.js.map → update-RQKI3AMW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js.map → update-ZM7NJWHY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js.map → update-many-GFCQG6ZQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js.map → update-many-XGTJ7QIU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js.map → upgrade-KJ3JGELR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js.map → upgrade-RBRQ7PQU.js.map} +0 -0
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
import {
|
|
4
4
|
readHistoryEntries,
|
|
5
5
|
runHistory
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FDNJMYZB.js";
|
|
7
7
|
import {
|
|
8
8
|
verifyHistoryChain
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-Y2VSCQ77.js";
|
|
10
|
+
import "./chunk-NHKXOMZ5.js";
|
|
11
|
+
import "./chunk-UYLA5ROU.js";
|
|
12
|
+
import "./chunk-AOP2EMK3.js";
|
|
13
|
+
import "./chunk-FMWQRMHS.js";
|
|
14
|
+
import "./chunk-SL2ANJSV.js";
|
|
15
15
|
export {
|
|
16
16
|
readHistoryEntries,
|
|
17
17
|
runHistory,
|
|
18
18
|
verifyHistoryChain
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=history-
|
|
20
|
+
//# sourceMappingURL=history-W6QVR6FA.js.map
|
|
21
21
|
|
|
22
22
|
//# debugId=45eac7fa-f181-5cca-93b7-cfb58909dbb3
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9f49ebde-040b-5f53-9f82-5156914aa44c")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
executeHistoryRewrite,
|
|
5
|
-
resolveHistorySubject
|
|
6
|
-
|
|
5
|
+
resolveHistorySubject,
|
|
6
|
+
writeHistoryRawWithRollback
|
|
7
|
+
} from "./chunk-2ONH3WG6.js";
|
|
7
8
|
import {
|
|
8
9
|
resolveAuthor
|
|
9
10
|
} from "./chunk-T5RRNDA7.js";
|
|
10
11
|
import {
|
|
11
12
|
readHistoryEntries
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FDNJMYZB.js";
|
|
13
14
|
import {
|
|
14
15
|
cloneEmptyReplayDocument,
|
|
15
16
|
historyEntriesToRaw,
|
|
@@ -18,20 +19,20 @@ import {
|
|
|
18
19
|
toReplayDocument,
|
|
19
20
|
tryApplyReplayPatch,
|
|
20
21
|
verifyHistoryChain
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-Y2VSCQ77.js";
|
|
22
23
|
import {
|
|
23
24
|
lifecycleClassifierFromStatusRegistry
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-4SHME4VR.js";
|
|
26
|
+
import "./chunk-NHKXOMZ5.js";
|
|
26
27
|
import {
|
|
27
28
|
createHistoryEntry,
|
|
28
29
|
listAllFrontMatterLight,
|
|
29
30
|
readLocatedItem
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-UYLA5ROU.js";
|
|
32
|
+
import "./chunk-AOP2EMK3.js";
|
|
32
33
|
import {
|
|
33
34
|
nowIso
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-FMWQRMHS.js";
|
|
35
36
|
import {
|
|
36
37
|
EXIT_CODE,
|
|
37
38
|
PmCliError,
|
|
@@ -44,9 +45,8 @@ import {
|
|
|
44
45
|
resolvePmRoot,
|
|
45
46
|
resolveRuntimeStatusRegistry,
|
|
46
47
|
runActiveOnReadHooks,
|
|
47
|
-
runActiveOnWriteHooks
|
|
48
|
-
|
|
49
|
-
} from "./chunk-I66WE2HE.js";
|
|
48
|
+
runActiveOnWriteHooks
|
|
49
|
+
} from "./chunk-SL2ANJSV.js";
|
|
50
50
|
|
|
51
51
|
// dist/cli/commands/history-compact.js
|
|
52
52
|
import fs from "node:fs/promises";
|
|
@@ -263,18 +263,11 @@ async function applyHistoryCompactRewrite(params) {
|
|
|
263
263
|
author: params.author,
|
|
264
264
|
force: params.force,
|
|
265
265
|
itemDocument: params.loadedItem?.document ?? null,
|
|
266
|
-
applyRewrite: async ({ historyRawUnderLock }) => {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
await fs.rm(params.historyPath, { force: true });
|
|
272
|
-
} else {
|
|
273
|
-
await writeFileAtomic(params.historyPath, historyRawUnderLock);
|
|
274
|
-
}
|
|
275
|
-
throw error;
|
|
276
|
-
}
|
|
277
|
-
},
|
|
266
|
+
applyRewrite: async ({ historyRawUnderLock }) => writeHistoryRawWithRollback({
|
|
267
|
+
historyPath: params.historyPath,
|
|
268
|
+
nextHistoryRaw: historyEntriesToRaw(params.rewrittenEntries),
|
|
269
|
+
historyRawUnderLock
|
|
270
|
+
}),
|
|
278
271
|
applyPostRewrite: async () => runActiveOnWriteHooks({
|
|
279
272
|
path: params.historyPath,
|
|
280
273
|
scope: "project",
|
|
@@ -554,6 +547,6 @@ export {
|
|
|
554
547
|
runHistoryCompact,
|
|
555
548
|
runHistoryCompactBulk
|
|
556
549
|
};
|
|
557
|
-
//# sourceMappingURL=history-compact-
|
|
550
|
+
//# sourceMappingURL=history-compact-F355EGL4.js.map
|
|
558
551
|
|
|
559
|
-
//# debugId=
|
|
552
|
+
//# debugId=9f49ebde-040b-5f53-9f82-5156914aa44c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/history-compact.ts","../../../../../../../../core/history/history-compact-bulk.ts"],"sourcesContent":["/**\n * @module cli/commands/history-compact\n *\n * Implements the pm history compact command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { createHistoryEntry } from \"../../core/history/history.js\";\nimport {\n selectHistoryCompactBulkTargets,\n type HistoryCompactBulkCandidate,\n type HistoryCompactBulkSkipReason,\n type HistoryCompactScope,\n} from \"../../core/history/history-compact-bulk.js\";\nimport { executeHistoryRewrite, writeHistoryRawWithRollback } from \"../../core/history/history-rewrite.js\";\nimport {\n cloneEmptyReplayDocument,\n historyEntriesToRaw,\n replayHash,\n replayToItemDocument,\n toReplayDocument,\n tryApplyReplayPatch,\n verifyHistoryChain,\n type ReplayDocument,\n} from \"../../core/history/replay.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { lifecycleClassifierFromStatusRegistry } from \"../../core/governance/metadata-coverage.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { pathExists, readFileIfExists } from \"../../core/fs/fs-utils.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 runActiveOnReadHooks,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type { HistoryEntry } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\nimport { resolveHistorySubject } from \"./history-redact.js\";\n\n/**\n * Documents the history compact command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryCompactCommandOptions {\n before?: string;\n dryRun?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\ntype HistoryCompactBoundaryKind = \"default\" | \"version\" | \"timestamp\";\n\ninterface HistoryCompactBoundary {\n kind: HistoryCompactBoundaryKind;\n raw: string | null;\n compactCount: number;\n retainedCount: number;\n}\n\ninterface HistoryCompactCurrentItem {\n loadedItem: Awaited<ReturnType<typeof readLocatedItem>> | null;\n currentItemRawBeforeLock: string | null;\n matchedChainBefore: boolean | null;\n}\n\n/**\n * Documents the history compact result payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryCompactResult {\n id: string;\n dry_run: boolean;\n changed: boolean;\n compact_boundary: {\n kind: HistoryCompactBoundaryKind;\n before: string | null;\n entries_compacted: number;\n entries_retained: number;\n first_retained_entry: number | null;\n };\n history: {\n path: string;\n entries_scanned: number;\n entries_after: number;\n baseline_entry_added: boolean;\n audit_entry_added: boolean;\n verify_ok: boolean;\n verify_errors: string[];\n };\n item: {\n exists: boolean;\n path: string | null;\n matched_chain_before: boolean | null;\n };\n warnings: string[];\n generated_at: string;\n}\n\nfunction parseBeforeBoundary(before: string | undefined, entries: HistoryEntry[]): HistoryCompactBoundary {\n if (before === undefined) {\n return {\n kind: \"default\",\n raw: null,\n compactCount: entries.length,\n retainedCount: 0,\n };\n }\n\n const raw = before.trim();\n if (raw.length === 0) {\n throw new PmCliError(\"history-compact --before requires a non-empty value.\", EXIT_CODE.USAGE);\n }\n\n if (/^\\d+$/.test(raw)) {\n const version = Number.parseInt(raw, 10);\n if (!Number.isSafeInteger(version) || version < 1 || version > entries.length + 1) {\n throw new PmCliError(\n `history-compact --before version must be between 1 and ${entries.length + 1}.`,\n EXIT_CODE.USAGE,\n );\n }\n const compactCount = Math.max(0, Math.min(entries.length, version - 1));\n return {\n kind: \"version\",\n raw,\n compactCount,\n retainedCount: entries.length - compactCount,\n };\n }\n\n const beforeTs = Date.parse(raw);\n if (!Number.isFinite(beforeTs)) {\n throw new PmCliError(\n `Invalid history-compact --before value \"${before}\". Use a version number or ISO timestamp.`,\n EXIT_CODE.USAGE,\n );\n }\n\n let compactCount = 0;\n for (const [index, entry] of entries.entries()) {\n const entryTs = Date.parse(entry.ts);\n if (!Number.isFinite(entryTs)) {\n throw new PmCliError(\n `History for this item contains invalid timestamp at entry ${index + 1}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (entryTs >= beforeTs) {\n break;\n }\n compactCount += 1;\n }\n\n return {\n kind: \"timestamp\",\n raw,\n compactCount,\n retainedCount: entries.length - compactCount,\n };\n}\n\nfunction applyHistoryPatch(current: ReplayDocument, entry: HistoryEntry, entryNumber: number): ReplayDocument {\n const result = tryApplyReplayPatch(current, entry.patch);\n if (!result.ok) {\n throw new PmCliError(\n `history-compact failed to apply patch at entry ${entryNumber} (op=${entry.op}): ${\n result.error instanceof Error ? result.error.message : String(result.error)\n }`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return result.document;\n}\n\nfunction replayHistoryAndResolveCheckpoint(\n entries: HistoryEntry[],\n compactCount: number,\n): {\n checkpoint: ReplayDocument;\n finalReplay: ReplayDocument;\n} {\n let replay = cloneEmptyReplayDocument();\n let checkpoint = cloneEmptyReplayDocument();\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n if (replayHash(replay) !== entry.before_hash) {\n throw new PmCliError(\n `history-compact detected before-hash drift at entry ${index + 1}; run pm history-repair first.`,\n EXIT_CODE.CONFLICT,\n );\n }\n replay = applyHistoryPatch(replay, entry, index + 1);\n if (replayHash(replay) !== entry.after_hash) {\n throw new PmCliError(\n `history-compact detected after-hash drift at entry ${index + 1}; run pm history-repair first.`,\n EXIT_CODE.CONFLICT,\n );\n }\n if (index + 1 === compactCount) {\n checkpoint = structuredClone(replay);\n }\n }\n return {\n checkpoint,\n finalReplay: replay,\n };\n}\n\nfunction reanchorRetainedEntries(\n retainedEntries: HistoryEntry[],\n seed: ReplayDocument,\n retainedEntryOffset: number,\n): {\n entries: HistoryEntry[];\n finalReplay: ReplayDocument;\n} {\n let replay = structuredClone(seed);\n const rewritten: HistoryEntry[] = [];\n for (const [index, entry] of retainedEntries.entries()) {\n const beforeHash = replayHash(replay);\n replay = applyHistoryPatch(replay, entry, retainedEntryOffset + index + 1);\n rewritten.push({\n ...entry,\n before_hash: beforeHash,\n after_hash: replayHash(replay),\n });\n }\n return {\n entries: rewritten,\n finalReplay: replay,\n };\n}\n\nasync function loadHistoryCompactCurrentItem(\n subject: Awaited<ReturnType<typeof resolveHistorySubject>>,\n settings: Awaited<ReturnType<typeof readSettings>>,\n historyEntries: HistoryEntry[],\n): Promise<HistoryCompactCurrentItem> {\n const loadedItem = subject.located ? await readLocatedItem(subject.located, { schema: settings.schema }) : null;\n if (!loadedItem) {\n return { loadedItem: null, currentItemRawBeforeLock: null, matchedChainBefore: null };\n }\n return {\n loadedItem,\n currentItemRawBeforeLock: loadedItem.raw,\n matchedChainBefore: replayHash(toReplayDocument(loadedItem.document)) === historyEntries[historyEntries.length - 1]?.after_hash,\n };\n}\n\nfunction buildHistoryCompactMessage(options: HistoryCompactCommandOptions, boundary: HistoryCompactBoundary): string {\n if (typeof options.message === \"string\" && options.message.trim().length > 0) {\n return options.message;\n }\n if (boundary.raw === null) {\n return `history-compact compacted full stream (${boundary.compactCount} entr${\n boundary.compactCount === 1 ? \"y\" : \"ies\"\n }).`;\n }\n return `history-compact compacted ${boundary.compactCount} entr${\n boundary.compactCount === 1 ? \"y\" : \"ies\"\n } before ${boundary.raw}.`;\n}\n\nfunction buildHistoryCompactBaselineMessage(boundary: HistoryCompactBoundary): string {\n if (boundary.raw === null) {\n return `history-compact baseline snapshot after compacting ${boundary.compactCount} entr${\n boundary.compactCount === 1 ? \"y\" : \"ies\"\n }.`;\n }\n return `history-compact baseline snapshot before ${boundary.raw}.`;\n}\n\nfunction buildHistoryCompactEntries(params: {\n historyEntries: HistoryEntry[];\n boundary: HistoryCompactBoundary;\n changed: boolean;\n dryRun: boolean;\n author: string;\n options: HistoryCompactCommandOptions;\n}): { rewrittenEntries: HistoryEntry[]; baselineEntryAdded: boolean; auditEntryAdded: boolean } {\n if (!params.changed) {\n return { rewrittenEntries: params.historyEntries, baselineEntryAdded: false, auditEntryAdded: false };\n }\n const { checkpoint, finalReplay } = replayHistoryAndResolveCheckpoint(params.historyEntries, params.boundary.compactCount);\n const retained = params.historyEntries.slice(params.boundary.compactCount);\n const reanchored = reanchorRetainedEntries(retained, checkpoint, params.boundary.compactCount);\n const baselineEntry = createHistoryEntry({\n nowIso: nowIso(),\n author: params.author,\n op: \"history_compact_baseline\",\n before: replayToItemDocument(cloneEmptyReplayDocument()),\n after: replayToItemDocument(checkpoint),\n message: buildHistoryCompactBaselineMessage(params.boundary),\n });\n const rewrittenEntries = [baselineEntry, ...reanchored.entries];\n if (!params.dryRun) {\n rewrittenEntries.push(\n createHistoryEntry({\n nowIso: nowIso(),\n author: params.author,\n op: \"history_compact\",\n before: replayToItemDocument(finalReplay),\n after: replayToItemDocument(finalReplay),\n message: buildHistoryCompactMessage(params.options, params.boundary),\n }),\n );\n }\n return { rewrittenEntries, baselineEntryAdded: true, auditEntryAdded: !params.dryRun };\n}\n\nasync function applyHistoryCompactRewrite(params: {\n pmRoot: string;\n subject: Awaited<ReturnType<typeof resolveHistorySubject>>;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeRegistry: ReturnType<typeof resolveItemTypeRegistry>;\n historyRawBeforeLock: string;\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-compact\",\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_compact:history\",\n }),\n });\n}\n\n/**\n * Implements run history compact for the public runtime surface of this module.\n */\nexport async function runHistoryCompact(\n id: string,\n options: HistoryCompactCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryCompactResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const subject = await resolveHistorySubject(pmRoot, id, settings, typeRegistry.type_to_folder);\n const historyPath = subject.historyPath;\n const historyRawBeforeLock = await readFileIfExists(historyPath);\n if (historyRawBeforeLock === null) {\n throw new PmCliError(`No history stream exists for ${subject.id}.`, EXIT_CODE.NOT_FOUND);\n }\n const historyEntries = await readHistoryEntries(historyPath, subject.id);\n if (historyEntries.length === 0) {\n throw new PmCliError(`No history entries exist for ${subject.id}; nothing to compact.`, EXIT_CODE.USAGE);\n }\n\n const chainVerification = verifyHistoryChain(historyEntries);\n if (!chainVerification.ok) {\n throw new PmCliError(\n `history-compact requires a valid history chain (${chainVerification.errors.join(\", \")}). Run pm history-repair ${subject.id} first.`,\n EXIT_CODE.CONFLICT,\n );\n }\n\n const boundary = parseBeforeBoundary(options.before, historyEntries);\n const changed = boundary.compactCount > 0;\n const dryRun = Boolean(options.dryRun);\n const author = resolveAuthor(options.author, settings.author_default);\n const warnings: string[] = [];\n if (!changed) {\n warnings.push(\"history_compact_noop_before_boundary\");\n }\n\n const currentItem = await loadHistoryCompactCurrentItem(subject, settings, historyEntries);\n if (currentItem.matchedChainBefore === false) {\n warnings.push(\"history_compact_item_chain_mismatch\");\n }\n\n const { rewrittenEntries, baselineEntryAdded, auditEntryAdded } = buildHistoryCompactEntries({\n historyEntries,\n boundary,\n changed,\n dryRun,\n author,\n options,\n });\n\n const rewrittenVerify = verifyHistoryChain(rewrittenEntries);\n if (!rewrittenVerify.ok) {\n throw new PmCliError(\n `history-compact produced an invalid rewritten chain (${rewrittenVerify.errors.join(\", \")}).`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n\n if (changed && !dryRun) {\n warnings.push(\n ...(await applyHistoryCompactRewrite({\n pmRoot,\n subject,\n settings,\n typeRegistry,\n historyRawBeforeLock,\n currentItemRawBeforeLock: currentItem.currentItemRawBeforeLock,\n author,\n force: options.force,\n loadedItem: currentItem.loadedItem,\n historyPath,\n rewrittenEntries,\n })),\n );\n }\n\n const firstRetainedEntry = boundary.retainedCount > 0 ? boundary.compactCount + 1 : null;\n return {\n id: subject.id,\n dry_run: dryRun,\n changed,\n compact_boundary: {\n kind: boundary.kind,\n before: boundary.raw,\n entries_compacted: boundary.compactCount,\n entries_retained: boundary.retainedCount,\n first_retained_entry: firstRetainedEntry,\n },\n history: {\n path: historyPath,\n entries_scanned: historyEntries.length,\n entries_after: rewrittenEntries.length,\n baseline_entry_added: baselineEntryAdded,\n audit_entry_added: auditEntryAdded,\n verify_ok: rewrittenVerify.ok,\n verify_errors: rewrittenVerify.errors,\n },\n item: {\n exists: subject.located !== null,\n path: subject.located?.itemPath ?? null,\n matched_chain_before: currentItem.matchedChainBefore,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\n/** Default entry floor below which a stream is treated as already compact. */\nexport const HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES = 3;\n\n/**\n * Documents the bulk history compact command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryCompactBulkCommandOptions {\n ids?: string[];\n scope?: HistoryCompactScope;\n allOver?: number;\n minEntries?: number;\n dryRun?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/** Per-item outcome row in a bulk compaction pass. */\nexport interface HistoryCompactBulkItemResult {\n id: string;\n outcome: \"compacted\" | \"skipped\" | \"errored\";\n entries_before: number;\n entries_after: number | null;\n skip_reason: HistoryCompactBulkSkipReason | null;\n changed: boolean;\n error: string | null;\n}\n\n/**\n * Documents the bulk history compact result payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryCompactBulkResult {\n bulk: true;\n dry_run: boolean;\n mode: \"ids\" | \"scan\";\n scope: HistoryCompactScope | null;\n criteria: {\n min_entries: number;\n all_over: number | null;\n policy_threshold_applied: boolean;\n };\n totals: {\n streams_considered: number;\n selected: number;\n items_compacted: number;\n items_skipped: number;\n items_errored: number;\n };\n results: HistoryCompactBulkItemResult[];\n generated_at: string;\n}\n\n/**\n * Enforce the `pm history-compact` target contract shared by the CLI and MCP\n * surfaces: exactly one selection mode — a single item `<id>`, an explicit\n * `--ids` list, or a scan selector (`--all-over` / `--closed` / `--all-streams`).\n */\nexport function assertHistoryCompactTarget(\n id: string | undefined,\n bulk: { ids?: string[]; allOver?: number; scope?: HistoryCompactScope },\n): void {\n const hasIds = bulk.ids !== undefined && bulk.ids.length > 0;\n const hasScan = bulk.allOver !== undefined || bulk.scope !== undefined;\n const selectorCount = (id !== undefined ? 1 : 0) + (hasIds ? 1 : 0) + (hasScan ? 1 : 0);\n if (selectorCount === 0) {\n throw new PmCliError(\n \"history-compact: provide an item <id>, or a bulk selector (--ids, --all-over <N>, --closed, or --all-streams).\",\n EXIT_CODE.USAGE,\n );\n }\n if (id !== undefined && (hasIds || hasScan)) {\n throw new PmCliError(\n \"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.\",\n EXIT_CODE.USAGE,\n );\n }\n if (hasIds && hasScan) {\n throw new PmCliError(\n \"history-compact: --ids is mutually exclusive with --all-over/--closed/--all-streams; pass an explicit id list or a scan selector, not both.\",\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction countHistoryStreamEntries(raw: string): number {\n let count = 0;\n for (const line of raw.split(/\\r?\\n/)) {\n if (line.trim().length > 0) {\n count += 1;\n }\n }\n return count;\n}\n\nasync function collectHistoryCompactBulkCandidates(params: {\n pmRoot: string;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeToFolder: Record<string, string>;\n}): Promise<{ candidates: HistoryCompactBulkCandidate[]; preselectionErrors: HistoryCompactBulkItemResult[] }> {\n const statusRegistry = resolveRuntimeStatusRegistry(params.settings.schema);\n const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);\n const items = await listAllFrontMatterLight(\n params.pmRoot,\n params.settings.item_format,\n params.typeToFolder,\n undefined,\n params.settings.schema,\n );\n const bucketById = new Map(items.map((item) => [item.id, classifier.classify(item.status)] as const));\n const historyDir = path.join(params.pmRoot, \"history\");\n const candidates: HistoryCompactBulkCandidate[] = [];\n const preselectionErrors: HistoryCompactBulkItemResult[] = [];\n if (!(await pathExists(historyDir))) {\n return { candidates, preselectionErrors };\n }\n const historyFiles = (await fs.readdir(historyDir))\n .filter((entry) => entry.endsWith(\".jsonl\"))\n .sort((left, right) => left.localeCompare(right));\n for (const fileName of historyFiles) {\n const historyPath = path.join(historyDir, fileName);\n const id = fileName.slice(0, -\".jsonl\".length);\n try {\n const raw = await fs.readFile(historyPath, \"utf8\");\n await runActiveOnReadHooks({ path: historyPath, scope: \"project\" });\n candidates.push({ id, entries: countHistoryStreamEntries(raw), bucket: bucketById.get(id) ?? null });\n } catch (error) {\n preselectionErrors.push({\n id,\n outcome: \"errored\",\n entries_before: 0,\n entries_after: null,\n skip_reason: null,\n changed: false,\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 return { candidates, preselectionErrors };\n}\n\nasync function runHistoryCompactBulkRow(params: {\n row: ReturnType<typeof selectHistoryCompactBulkTargets>[number];\n options: HistoryCompactBulkCommandOptions;\n dryRun: boolean;\n global: GlobalOptions;\n}): Promise<{ result: HistoryCompactBulkItemResult; selected: boolean; compacted: boolean; errored: boolean }> {\n if (!params.row.selected) {\n return {\n selected: false,\n compacted: false,\n errored: false,\n result: {\n id: params.row.id,\n outcome: \"skipped\",\n entries_before: params.row.entries,\n entries_after: null,\n skip_reason: params.row.skip_reason,\n changed: false,\n error: null,\n },\n };\n }\n try {\n const result = await runHistoryCompact(\n params.row.id,\n {\n dryRun: params.dryRun,\n author: params.options.author,\n message: params.options.message,\n force: params.options.force,\n },\n params.global,\n );\n return {\n selected: true,\n compacted: true,\n errored: false,\n result: {\n id: params.row.id,\n outcome: \"compacted\",\n entries_before: params.row.entries,\n entries_after: result.history.entries_after,\n skip_reason: null,\n changed: result.changed,\n error: null,\n },\n };\n } catch (error) {\n return {\n selected: true,\n compacted: false,\n errored: true,\n result: {\n id: params.row.id,\n outcome: \"errored\",\n entries_before: params.row.entries,\n entries_after: null,\n skip_reason: null,\n changed: false,\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\n/**\n * Bulk history compaction: compact every history stream matching the requested\n * selection (explicit `--ids`, a `--scope` lifecycle filter, and/or an\n * `--all-over <N>` entry threshold) in one audited pass. Each selected stream is\n * compacted with the same single-item logic ({@link runHistoryCompact}); one\n * failing stream never aborts the rest, and the caller decides the exit code\n * from `totals.items_errored`.\n *\n * When `history.compact_policy` is enabled and no explicit `--all-over` is\n * given, the policy's `max_entries` is used as the scan threshold so the\n * configured policy drives the sweep.\n */\nexport async function runHistoryCompactBulk(\n options: HistoryCompactBulkCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryCompactBulkResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const { candidates, preselectionErrors } = await collectHistoryCompactBulkCandidates({\n pmRoot,\n settings,\n typeToFolder: typeRegistry.type_to_folder,\n });\n\n const mode: \"ids\" | \"scan\" = options.ids !== undefined && options.ids.length > 0 ? \"ids\" : \"scan\";\n const minEntries = options.minEntries ?? HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES;\n const policy = settings.history.compact_policy;\n const policyThresholdApplied = mode === \"scan\" && options.allOver === undefined && policy.enabled;\n const allOver = options.allOver ?? (policyThresholdApplied ? policy.max_entries : undefined);\n\n const selection = selectHistoryCompactBulkTargets(candidates, {\n ids: options.ids,\n scope: options.scope,\n minEntries,\n allOver,\n });\n\n const dryRun = Boolean(options.dryRun);\n const results: HistoryCompactBulkItemResult[] = [...preselectionErrors];\n const totals = {\n streams_considered: candidates.length + preselectionErrors.length,\n selected: 0,\n items_compacted: 0,\n items_skipped: 0,\n items_errored: preselectionErrors.length,\n };\n for (const row of selection) {\n const outcome = await runHistoryCompactBulkRow({ row, options, dryRun, global });\n results.push(outcome.result);\n if (!outcome.selected) {\n totals.items_skipped += 1;\n continue;\n }\n totals.selected += 1;\n if (outcome.compacted) {\n totals.items_compacted += 1;\n }\n if (outcome.errored) {\n totals.items_errored += 1;\n }\n }\n\n return {\n bulk: true,\n dry_run: dryRun,\n mode,\n scope: options.scope ?? null,\n criteria: {\n min_entries: minEntries,\n all_over: allOver ?? null,\n policy_threshold_applied: policyThresholdApplied,\n },\n totals,\n results,\n generated_at: nowIso(),\n };\n}\n","/**\n * @module core/history/history-compact-bulk\n *\n * Pure selection logic for bulk history-stream compaction. Given a set of\n * history-stream candidates (id, entry count, and lifecycle bucket of the\n * owning item) plus the requested selection criteria, this module decides which\n * streams should be compacted and which are skipped (and why).\n *\n * The module performs no filesystem access and imports no heavy runtime\n * dependencies — the command layer reads streams and item statuses, hands the\n * resolved candidates here, then executes per-item compaction on the selection\n * this module returns. Keeping selection pure makes the matrix of scope /\n * threshold / explicit-id rules trivially testable without touching disk.\n */\n\nimport type { LifecycleBucket } from \"../governance/metadata-coverage.js\";\n\n/** Bulk-compaction scope: only closed items, or every history stream. */\nexport type HistoryCompactScope = \"closed\" | \"all-streams\";\n\n/** Why a candidate stream was not selected for compaction. */\nexport type HistoryCompactBulkSkipReason = \"no_stream\" | \"already_compact\" | \"scope_mismatch\" | \"below_threshold\";\n\n/**\n * One history stream considered for bulk compaction.\n *\n * `bucket` is the lifecycle bucket of the owning item, or `null` when no item\n * matches the stream (an orphan history file). Orphan streams never satisfy a\n * `closed` scope filter but are eligible under `all-streams`.\n */\nexport interface HistoryCompactBulkCandidate {\n id: string;\n entries: number;\n bucket: LifecycleBucket | null;\n}\n\n/** Selection criteria resolved from the command flags + policy defaults. */\nexport interface HistoryCompactBulkCriteria {\n /**\n * Explicit, ordered list of item ids to compact. When non-empty the selection\n * runs in \"ids\" mode: scope/allOver are ignored and only the `minEntries`\n * floor applies. Duplicates are collapsed, preserving first-seen order.\n */\n ids?: string[];\n /** Lifecycle scope filter for scan mode (ignored in ids mode). */\n scope?: HistoryCompactScope;\n /**\n * Streams with at most this many entries are skipped as `already_compact`\n * (compaction collapses a stream to a 2-entry baseline+audit pair, so smaller\n * streams gain nothing). Applies in both modes.\n */\n minEntries: number;\n /**\n * Scan mode only: when set, only streams with strictly more entries than this\n * are selected. Streams above `minEntries` but at/below `allOver` are skipped\n * as `below_threshold`.\n */\n allOver?: number;\n}\n\n/** Per-candidate selection outcome. */\nexport interface HistoryCompactBulkSelectionRow {\n id: string;\n entries: number;\n selected: boolean;\n skip_reason: HistoryCompactBulkSkipReason | null;\n}\n\nfunction selectIdsMode(\n ids: string[],\n byId: ReadonlyMap<string, HistoryCompactBulkCandidate>,\n minEntries: number,\n): HistoryCompactBulkSelectionRow[] {\n const seen = new Set<string>();\n const rows: HistoryCompactBulkSelectionRow[] = [];\n for (const rawId of ids) {\n const id = rawId.trim();\n if (id.length === 0 || seen.has(id)) {\n continue;\n }\n seen.add(id);\n const candidate = byId.get(id);\n if (candidate === undefined) {\n rows.push({ id, entries: 0, selected: false, skip_reason: \"no_stream\" });\n continue;\n }\n if (candidate.entries <= minEntries) {\n rows.push({ id, entries: candidate.entries, selected: false, skip_reason: \"already_compact\" });\n continue;\n }\n rows.push({ id, entries: candidate.entries, selected: true, skip_reason: null });\n }\n return rows;\n}\n\nfunction selectScanMode(\n candidates: HistoryCompactBulkCandidate[],\n criteria: HistoryCompactBulkCriteria,\n): HistoryCompactBulkSelectionRow[] {\n const ordered = [...candidates].sort((a, b) => b.entries - a.entries || a.id.localeCompare(b.id));\n const rows: HistoryCompactBulkSelectionRow[] = [];\n for (const candidate of ordered) {\n if (criteria.scope === \"closed\" && candidate.bucket !== \"closed\") {\n rows.push({ id: candidate.id, entries: candidate.entries, selected: false, skip_reason: \"scope_mismatch\" });\n continue;\n }\n if (candidate.entries <= criteria.minEntries) {\n rows.push({ id: candidate.id, entries: candidate.entries, selected: false, skip_reason: \"already_compact\" });\n continue;\n }\n if (criteria.allOver !== undefined && candidate.entries <= criteria.allOver) {\n rows.push({ id: candidate.id, entries: candidate.entries, selected: false, skip_reason: \"below_threshold\" });\n continue;\n }\n rows.push({ id: candidate.id, entries: candidate.entries, selected: true, skip_reason: null });\n }\n return rows;\n}\n\n/**\n * Decide which history streams to compact.\n *\n * Runs in \"ids\" mode when `criteria.ids` is non-empty (exact, ordered set,\n * honouring only the `minEntries` floor) and \"scan\" mode otherwise (every\n * candidate, filtered by scope and entry thresholds, ordered deepest-first).\n */\nexport function selectHistoryCompactBulkTargets(\n candidates: HistoryCompactBulkCandidate[],\n criteria: HistoryCompactBulkCriteria,\n): HistoryCompactBulkSelectionRow[] {\n if (criteria.ids !== undefined && criteria.ids.length > 0) {\n const byId = new Map(candidates.map((candidate) => [candidate.id, candidate]));\n return selectIdsMode(criteria.ids, byId, criteria.minEntries);\n }\n return selectScanMode(candidates, criteria);\n}\n"],"names":["compactCount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;AACf,OAAO,UAAU;;;AC8DjB,SAAS,cACP,KACA,MACA,YAAkB;AAElB,QAAM,OAAO,oBAAI,IAAG;AACpB,QAAM,OAAyC,CAAA;AAC/C,aAAW,SAAS,KAAK;AACvB,UAAM,KAAK,MAAM,KAAI;AACrB,QAAI,GAAG,WAAW,KAAK,KAAK,IAAI,EAAE,GAAG;AACnC;IACF;AACA,SAAK,IAAI,EAAE;AACX,UAAM,YAAY,KAAK,IAAI,EAAE;AAC7B,QAAI,cAAc,QAA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|
+
} from "./chunk-4PJYRA3V.js";
|
|
5
6
|
import {
|
|
6
7
|
resolveAuthor
|
|
7
8
|
} from "./chunk-WW4E2DC3.js";
|
|
8
9
|
import {
|
|
9
10
|
readHistoryEntries
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EB4BBEZD.js";
|
|
11
12
|
import {
|
|
12
13
|
cloneEmptyReplayDocument,
|
|
13
14
|
historyEntriesToRaw,
|
|
@@ -16,20 +17,20 @@ import {
|
|
|
16
17
|
toReplayDocument,
|
|
17
18
|
tryApplyReplayPatch,
|
|
18
19
|
verifyHistoryChain
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HL742IBM.js";
|
|
20
21
|
import {
|
|
21
22
|
lifecycleClassifierFromStatusRegistry
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-724VLYDJ.js";
|
|
24
|
+
import "./chunk-3MLQZI3H.js";
|
|
24
25
|
import {
|
|
25
26
|
createHistoryEntry,
|
|
26
27
|
listAllFrontMatterLight,
|
|
27
28
|
readLocatedItem
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
29
|
+
} from "./chunk-CN4OAA2G.js";
|
|
30
|
+
import "./chunk-CQFZRLXQ.js";
|
|
30
31
|
import {
|
|
31
32
|
nowIso
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-MZG6I2Q2.js";
|
|
33
34
|
import {
|
|
34
35
|
EXIT_CODE,
|
|
35
36
|
PmCliError,
|
|
@@ -42,9 +43,8 @@ import {
|
|
|
42
43
|
resolvePmRoot,
|
|
43
44
|
resolveRuntimeStatusRegistry,
|
|
44
45
|
runActiveOnReadHooks,
|
|
45
|
-
runActiveOnWriteHooks
|
|
46
|
-
|
|
47
|
-
} from "./chunk-7NSPKJUS.js";
|
|
46
|
+
runActiveOnWriteHooks
|
|
47
|
+
} from "./chunk-BDDYM4LH.js";
|
|
48
48
|
|
|
49
49
|
// dist/cli/commands/history-compact.js
|
|
50
50
|
import fs from "node:fs/promises";
|
|
@@ -112,7 +112,7 @@ function selectHistoryCompactBulkTargets(candidates, criteria) {
|
|
|
112
112
|
!(function() {
|
|
113
113
|
try {
|
|
114
114
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
115
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
115
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "146d0012-1b32-50b1-a4d0-66eb7fe88f9f");
|
|
116
116
|
} catch (e2) {
|
|
117
117
|
}
|
|
118
118
|
})();
|
|
@@ -275,18 +275,11 @@ async function applyHistoryCompactRewrite(params) {
|
|
|
275
275
|
author: params.author,
|
|
276
276
|
force: params.force,
|
|
277
277
|
itemDocument: params.loadedItem?.document ?? null,
|
|
278
|
-
applyRewrite: async ({ historyRawUnderLock }) => {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
await fs.rm(params.historyPath, { force: true });
|
|
284
|
-
} else {
|
|
285
|
-
await writeFileAtomic(params.historyPath, historyRawUnderLock);
|
|
286
|
-
}
|
|
287
|
-
throw error;
|
|
288
|
-
}
|
|
289
|
-
},
|
|
278
|
+
applyRewrite: async ({ historyRawUnderLock }) => writeHistoryRawWithRollback({
|
|
279
|
+
historyPath: params.historyPath,
|
|
280
|
+
nextHistoryRaw: historyEntriesToRaw(params.rewrittenEntries),
|
|
281
|
+
historyRawUnderLock
|
|
282
|
+
}),
|
|
290
283
|
applyPostRewrite: async () => runActiveOnWriteHooks({
|
|
291
284
|
path: params.historyPath,
|
|
292
285
|
scope: "project",
|
|
@@ -566,4 +559,4 @@ export {
|
|
|
566
559
|
runHistoryCompact,
|
|
567
560
|
runHistoryCompactBulk
|
|
568
561
|
};
|
|
569
|
-
//# sourceMappingURL=history-compact-
|
|
562
|
+
//# sourceMappingURL=history-compact-JQ6ZGYSJ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../cli/commands/history-compact.ts", "../../../../../../../../core/history/history-compact-bulk.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @module cli/commands/history-compact\n *\n * Implements the pm history compact command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { createHistoryEntry } from \"../../core/history/history.js\";\nimport {\n selectHistoryCompactBulkTargets,\n type HistoryCompactBulkCandidate,\n type HistoryCompactBulkSkipReason,\n type HistoryCompactScope,\n} from \"../../core/history/history-compact-bulk.js\";\nimport { executeHistoryRewrite, writeHistoryRawWithRollback } from \"../../core/history/history-rewrite.js\";\nimport {\n cloneEmptyReplayDocument,\n historyEntriesToRaw,\n replayHash,\n replayToItemDocument,\n toReplayDocument,\n tryApplyReplayPatch,\n verifyHistoryChain,\n type ReplayDocument,\n} from \"../../core/history/replay.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { lifecycleClassifierFromStatusRegistry } from \"../../core/governance/metadata-coverage.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { pathExists, readFileIfExists } from \"../../core/fs/fs-utils.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 runActiveOnReadHooks,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type { HistoryEntry } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\nimport { resolveHistorySubject } from \"./history-redact.js\";\n\n/**\n * Documents the history compact command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryCompactCommandOptions {\n before?: string;\n dryRun?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\ntype HistoryCompactBoundaryKind = \"default\" | \"version\" | \"timestamp\";\n\ninterface HistoryCompactBoundary {\n kind: HistoryCompactBoundaryKind;\n raw: string | null;\n compactCount: number;\n retainedCount: number;\n}\n\ninterface HistoryCompactCurrentItem {\n loadedItem: Awaited<ReturnType<typeof readLocatedItem>> | null;\n currentItemRawBeforeLock: string | null;\n matchedChainBefore: boolean | null;\n}\n\n/**\n * Documents the history compact result payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryCompactResult {\n id: string;\n dry_run: boolean;\n changed: boolean;\n compact_boundary: {\n kind: HistoryCompactBoundaryKind;\n before: string | null;\n entries_compacted: number;\n entries_retained: number;\n first_retained_entry: number | null;\n };\n history: {\n path: string;\n entries_scanned: number;\n entries_after: number;\n baseline_entry_added: boolean;\n audit_entry_added: boolean;\n verify_ok: boolean;\n verify_errors: string[];\n };\n item: {\n exists: boolean;\n path: string | null;\n matched_chain_before: boolean | null;\n };\n warnings: string[];\n generated_at: string;\n}\n\nfunction parseBeforeBoundary(before: string | undefined, entries: HistoryEntry[]): HistoryCompactBoundary {\n if (before === undefined) {\n return {\n kind: \"default\",\n raw: null,\n compactCount: entries.length,\n retainedCount: 0,\n };\n }\n\n const raw = before.trim();\n if (raw.length === 0) {\n throw new PmCliError(\"history-compact --before requires a non-empty value.\", EXIT_CODE.USAGE);\n }\n\n if (/^\\d+$/.test(raw)) {\n const version = Number.parseInt(raw, 10);\n if (!Number.isSafeInteger(version) || version < 1 || version > entries.length + 1) {\n throw new PmCliError(\n `history-compact --before version must be between 1 and ${entries.length + 1}.`,\n EXIT_CODE.USAGE,\n );\n }\n const compactCount = Math.max(0, Math.min(entries.length, version - 1));\n return {\n kind: \"version\",\n raw,\n compactCount,\n retainedCount: entries.length - compactCount,\n };\n }\n\n const beforeTs = Date.parse(raw);\n if (!Number.isFinite(beforeTs)) {\n throw new PmCliError(\n `Invalid history-compact --before value \"${before}\". Use a version number or ISO timestamp.`,\n EXIT_CODE.USAGE,\n );\n }\n\n let compactCount = 0;\n for (const [index, entry] of entries.entries()) {\n const entryTs = Date.parse(entry.ts);\n if (!Number.isFinite(entryTs)) {\n throw new PmCliError(\n `History for this item contains invalid timestamp at entry ${index + 1}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (entryTs >= beforeTs) {\n break;\n }\n compactCount += 1;\n }\n\n return {\n kind: \"timestamp\",\n raw,\n compactCount,\n retainedCount: entries.length - compactCount,\n };\n}\n\nfunction applyHistoryPatch(current: ReplayDocument, entry: HistoryEntry, entryNumber: number): ReplayDocument {\n const result = tryApplyReplayPatch(current, entry.patch);\n if (!result.ok) {\n throw new PmCliError(\n `history-compact failed to apply patch at entry ${entryNumber} (op=${entry.op}): ${\n result.error instanceof Error ? result.error.message : String(result.error)\n }`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return result.document;\n}\n\nfunction replayHistoryAndResolveCheckpoint(\n entries: HistoryEntry[],\n compactCount: number,\n): {\n checkpoint: ReplayDocument;\n finalReplay: ReplayDocument;\n} {\n let replay = cloneEmptyReplayDocument();\n let checkpoint = cloneEmptyReplayDocument();\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n if (replayHash(replay) !== entry.before_hash) {\n throw new PmCliError(\n `history-compact detected before-hash drift at entry ${index + 1}; run pm history-repair first.`,\n EXIT_CODE.CONFLICT,\n );\n }\n replay = applyHistoryPatch(replay, entry, index + 1);\n if (replayHash(replay) !== entry.after_hash) {\n throw new PmCliError(\n `history-compact detected after-hash drift at entry ${index + 1}; run pm history-repair first.`,\n EXIT_CODE.CONFLICT,\n );\n }\n if (index + 1 === compactCount) {\n checkpoint = structuredClone(replay);\n }\n }\n return {\n checkpoint,\n finalReplay: replay,\n };\n}\n\nfunction reanchorRetainedEntries(\n retainedEntries: HistoryEntry[],\n seed: ReplayDocument,\n retainedEntryOffset: number,\n): {\n entries: HistoryEntry[];\n finalReplay: ReplayDocument;\n} {\n let replay = structuredClone(seed);\n const rewritten: HistoryEntry[] = [];\n for (const [index, entry] of retainedEntries.entries()) {\n const beforeHash = replayHash(replay);\n replay = applyHistoryPatch(replay, entry, retainedEntryOffset + index + 1);\n rewritten.push({\n ...entry,\n before_hash: beforeHash,\n after_hash: replayHash(replay),\n });\n }\n return {\n entries: rewritten,\n finalReplay: replay,\n };\n}\n\nasync function loadHistoryCompactCurrentItem(\n subject: Awaited<ReturnType<typeof resolveHistorySubject>>,\n settings: Awaited<ReturnType<typeof readSettings>>,\n historyEntries: HistoryEntry[],\n): Promise<HistoryCompactCurrentItem> {\n const loadedItem = subject.located ? await readLocatedItem(subject.located, { schema: settings.schema }) : null;\n if (!loadedItem) {\n return { loadedItem: null, currentItemRawBeforeLock: null, matchedChainBefore: null };\n }\n return {\n loadedItem,\n currentItemRawBeforeLock: loadedItem.raw,\n matchedChainBefore: replayHash(toReplayDocument(loadedItem.document)) === historyEntries[historyEntries.length - 1]?.after_hash,\n };\n}\n\nfunction buildHistoryCompactMessage(options: HistoryCompactCommandOptions, boundary: HistoryCompactBoundary): string {\n if (typeof options.message === \"string\" && options.message.trim().length > 0) {\n return options.message;\n }\n if (boundary.raw === null) {\n return `history-compact compacted full stream (${boundary.compactCount} entr${\n boundary.compactCount === 1 ? \"y\" : \"ies\"\n }).`;\n }\n return `history-compact compacted ${boundary.compactCount} entr${\n boundary.compactCount === 1 ? \"y\" : \"ies\"\n } before ${boundary.raw}.`;\n}\n\nfunction buildHistoryCompactBaselineMessage(boundary: HistoryCompactBoundary): string {\n if (boundary.raw === null) {\n return `history-compact baseline snapshot after compacting ${boundary.compactCount} entr${\n boundary.compactCount === 1 ? \"y\" : \"ies\"\n }.`;\n }\n return `history-compact baseline snapshot before ${boundary.raw}.`;\n}\n\nfunction buildHistoryCompactEntries(params: {\n historyEntries: HistoryEntry[];\n boundary: HistoryCompactBoundary;\n changed: boolean;\n dryRun: boolean;\n author: string;\n options: HistoryCompactCommandOptions;\n}): { rewrittenEntries: HistoryEntry[]; baselineEntryAdded: boolean; auditEntryAdded: boolean } {\n if (!params.changed) {\n return { rewrittenEntries: params.historyEntries, baselineEntryAdded: false, auditEntryAdded: false };\n }\n const { checkpoint, finalReplay } = replayHistoryAndResolveCheckpoint(params.historyEntries, params.boundary.compactCount);\n const retained = params.historyEntries.slice(params.boundary.compactCount);\n const reanchored = reanchorRetainedEntries(retained, checkpoint, params.boundary.compactCount);\n const baselineEntry = createHistoryEntry({\n nowIso: nowIso(),\n author: params.author,\n op: \"history_compact_baseline\",\n before: replayToItemDocument(cloneEmptyReplayDocument()),\n after: replayToItemDocument(checkpoint),\n message: buildHistoryCompactBaselineMessage(params.boundary),\n });\n const rewrittenEntries = [baselineEntry, ...reanchored.entries];\n if (!params.dryRun) {\n rewrittenEntries.push(\n createHistoryEntry({\n nowIso: nowIso(),\n author: params.author,\n op: \"history_compact\",\n before: replayToItemDocument(finalReplay),\n after: replayToItemDocument(finalReplay),\n message: buildHistoryCompactMessage(params.options, params.boundary),\n }),\n );\n }\n return { rewrittenEntries, baselineEntryAdded: true, auditEntryAdded: !params.dryRun };\n}\n\nasync function applyHistoryCompactRewrite(params: {\n pmRoot: string;\n subject: Awaited<ReturnType<typeof resolveHistorySubject>>;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeRegistry: ReturnType<typeof resolveItemTypeRegistry>;\n historyRawBeforeLock: string;\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-compact\",\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_compact:history\",\n }),\n });\n}\n\n/**\n * Implements run history compact for the public runtime surface of this module.\n */\nexport async function runHistoryCompact(\n id: string,\n options: HistoryCompactCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryCompactResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const subject = await resolveHistorySubject(pmRoot, id, settings, typeRegistry.type_to_folder);\n const historyPath = subject.historyPath;\n const historyRawBeforeLock = await readFileIfExists(historyPath);\n if (historyRawBeforeLock === null) {\n throw new PmCliError(`No history stream exists for ${subject.id}.`, EXIT_CODE.NOT_FOUND);\n }\n const historyEntries = await readHistoryEntries(historyPath, subject.id);\n if (historyEntries.length === 0) {\n throw new PmCliError(`No history entries exist for ${subject.id}; nothing to compact.`, EXIT_CODE.USAGE);\n }\n\n const chainVerification = verifyHistoryChain(historyEntries);\n if (!chainVerification.ok) {\n throw new PmCliError(\n `history-compact requires a valid history chain (${chainVerification.errors.join(\", \")}). Run pm history-repair ${subject.id} first.`,\n EXIT_CODE.CONFLICT,\n );\n }\n\n const boundary = parseBeforeBoundary(options.before, historyEntries);\n const changed = boundary.compactCount > 0;\n const dryRun = Boolean(options.dryRun);\n const author = resolveAuthor(options.author, settings.author_default);\n const warnings: string[] = [];\n if (!changed) {\n warnings.push(\"history_compact_noop_before_boundary\");\n }\n\n const currentItem = await loadHistoryCompactCurrentItem(subject, settings, historyEntries);\n if (currentItem.matchedChainBefore === false) {\n warnings.push(\"history_compact_item_chain_mismatch\");\n }\n\n const { rewrittenEntries, baselineEntryAdded, auditEntryAdded } = buildHistoryCompactEntries({\n historyEntries,\n boundary,\n changed,\n dryRun,\n author,\n options,\n });\n\n const rewrittenVerify = verifyHistoryChain(rewrittenEntries);\n if (!rewrittenVerify.ok) {\n throw new PmCliError(\n `history-compact produced an invalid rewritten chain (${rewrittenVerify.errors.join(\", \")}).`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n\n if (changed && !dryRun) {\n warnings.push(\n ...(await applyHistoryCompactRewrite({\n pmRoot,\n subject,\n settings,\n typeRegistry,\n historyRawBeforeLock,\n currentItemRawBeforeLock: currentItem.currentItemRawBeforeLock,\n author,\n force: options.force,\n loadedItem: currentItem.loadedItem,\n historyPath,\n rewrittenEntries,\n })),\n );\n }\n\n const firstRetainedEntry = boundary.retainedCount > 0 ? boundary.compactCount + 1 : null;\n return {\n id: subject.id,\n dry_run: dryRun,\n changed,\n compact_boundary: {\n kind: boundary.kind,\n before: boundary.raw,\n entries_compacted: boundary.compactCount,\n entries_retained: boundary.retainedCount,\n first_retained_entry: firstRetainedEntry,\n },\n history: {\n path: historyPath,\n entries_scanned: historyEntries.length,\n entries_after: rewrittenEntries.length,\n baseline_entry_added: baselineEntryAdded,\n audit_entry_added: auditEntryAdded,\n verify_ok: rewrittenVerify.ok,\n verify_errors: rewrittenVerify.errors,\n },\n item: {\n exists: subject.located !== null,\n path: subject.located?.itemPath ?? null,\n matched_chain_before: currentItem.matchedChainBefore,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\n/** Default entry floor below which a stream is treated as already compact. */\nexport const HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES = 3;\n\n/**\n * Documents the bulk history compact command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryCompactBulkCommandOptions {\n ids?: string[];\n scope?: HistoryCompactScope;\n allOver?: number;\n minEntries?: number;\n dryRun?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/** Per-item outcome row in a bulk compaction pass. */\nexport interface HistoryCompactBulkItemResult {\n id: string;\n outcome: \"compacted\" | \"skipped\" | \"errored\";\n entries_before: number;\n entries_after: number | null;\n skip_reason: HistoryCompactBulkSkipReason | null;\n changed: boolean;\n error: string | null;\n}\n\n/**\n * Documents the bulk history compact result payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryCompactBulkResult {\n bulk: true;\n dry_run: boolean;\n mode: \"ids\" | \"scan\";\n scope: HistoryCompactScope | null;\n criteria: {\n min_entries: number;\n all_over: number | null;\n policy_threshold_applied: boolean;\n };\n totals: {\n streams_considered: number;\n selected: number;\n items_compacted: number;\n items_skipped: number;\n items_errored: number;\n };\n results: HistoryCompactBulkItemResult[];\n generated_at: string;\n}\n\n/**\n * Enforce the `pm history-compact` target contract shared by the CLI and MCP\n * surfaces: exactly one selection mode — a single item `<id>`, an explicit\n * `--ids` list, or a scan selector (`--all-over` / `--closed` / `--all-streams`).\n */\nexport function assertHistoryCompactTarget(\n id: string | undefined,\n bulk: { ids?: string[]; allOver?: number; scope?: HistoryCompactScope },\n): void {\n const hasIds = bulk.ids !== undefined && bulk.ids.length > 0;\n const hasScan = bulk.allOver !== undefined || bulk.scope !== undefined;\n const selectorCount = (id !== undefined ? 1 : 0) + (hasIds ? 1 : 0) + (hasScan ? 1 : 0);\n if (selectorCount === 0) {\n throw new PmCliError(\n \"history-compact: provide an item <id>, or a bulk selector (--ids, --all-over <N>, --closed, or --all-streams).\",\n EXIT_CODE.USAGE,\n );\n }\n if (id !== undefined && (hasIds || hasScan)) {\n throw new PmCliError(\n \"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.\",\n EXIT_CODE.USAGE,\n );\n }\n if (hasIds && hasScan) {\n throw new PmCliError(\n \"history-compact: --ids is mutually exclusive with --all-over/--closed/--all-streams; pass an explicit id list or a scan selector, not both.\",\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction countHistoryStreamEntries(raw: string): number {\n let count = 0;\n for (const line of raw.split(/\\r?\\n/)) {\n if (line.trim().length > 0) {\n count += 1;\n }\n }\n return count;\n}\n\nasync function collectHistoryCompactBulkCandidates(params: {\n pmRoot: string;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeToFolder: Record<string, string>;\n}): Promise<{ candidates: HistoryCompactBulkCandidate[]; preselectionErrors: HistoryCompactBulkItemResult[] }> {\n const statusRegistry = resolveRuntimeStatusRegistry(params.settings.schema);\n const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);\n const items = await listAllFrontMatterLight(\n params.pmRoot,\n params.settings.item_format,\n params.typeToFolder,\n undefined,\n params.settings.schema,\n );\n const bucketById = new Map(items.map((item) => [item.id, classifier.classify(item.status)] as const));\n const historyDir = path.join(params.pmRoot, \"history\");\n const candidates: HistoryCompactBulkCandidate[] = [];\n const preselectionErrors: HistoryCompactBulkItemResult[] = [];\n if (!(await pathExists(historyDir))) {\n return { candidates, preselectionErrors };\n }\n const historyFiles = (await fs.readdir(historyDir))\n .filter((entry) => entry.endsWith(\".jsonl\"))\n .sort((left, right) => left.localeCompare(right));\n for (const fileName of historyFiles) {\n const historyPath = path.join(historyDir, fileName);\n const id = fileName.slice(0, -\".jsonl\".length);\n try {\n const raw = await fs.readFile(historyPath, \"utf8\");\n await runActiveOnReadHooks({ path: historyPath, scope: \"project\" });\n candidates.push({ id, entries: countHistoryStreamEntries(raw), bucket: bucketById.get(id) ?? null });\n } catch (error) {\n preselectionErrors.push({\n id,\n outcome: \"errored\",\n entries_before: 0,\n entries_after: null,\n skip_reason: null,\n changed: false,\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 return { candidates, preselectionErrors };\n}\n\nasync function runHistoryCompactBulkRow(params: {\n row: ReturnType<typeof selectHistoryCompactBulkTargets>[number];\n options: HistoryCompactBulkCommandOptions;\n dryRun: boolean;\n global: GlobalOptions;\n}): Promise<{ result: HistoryCompactBulkItemResult; selected: boolean; compacted: boolean; errored: boolean }> {\n if (!params.row.selected) {\n return {\n selected: false,\n compacted: false,\n errored: false,\n result: {\n id: params.row.id,\n outcome: \"skipped\",\n entries_before: params.row.entries,\n entries_after: null,\n skip_reason: params.row.skip_reason,\n changed: false,\n error: null,\n },\n };\n }\n try {\n const result = await runHistoryCompact(\n params.row.id,\n {\n dryRun: params.dryRun,\n author: params.options.author,\n message: params.options.message,\n force: params.options.force,\n },\n params.global,\n );\n return {\n selected: true,\n compacted: true,\n errored: false,\n result: {\n id: params.row.id,\n outcome: \"compacted\",\n entries_before: params.row.entries,\n entries_after: result.history.entries_after,\n skip_reason: null,\n changed: result.changed,\n error: null,\n },\n };\n } catch (error) {\n return {\n selected: true,\n compacted: false,\n errored: true,\n result: {\n id: params.row.id,\n outcome: \"errored\",\n entries_before: params.row.entries,\n entries_after: null,\n skip_reason: null,\n changed: false,\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\n/**\n * Bulk history compaction: compact every history stream matching the requested\n * selection (explicit `--ids`, a `--scope` lifecycle filter, and/or an\n * `--all-over <N>` entry threshold) in one audited pass. Each selected stream is\n * compacted with the same single-item logic ({@link runHistoryCompact}); one\n * failing stream never aborts the rest, and the caller decides the exit code\n * from `totals.items_errored`.\n *\n * When `history.compact_policy` is enabled and no explicit `--all-over` is\n * given, the policy's `max_entries` is used as the scan threshold so the\n * configured policy drives the sweep.\n */\nexport async function runHistoryCompactBulk(\n options: HistoryCompactBulkCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryCompactBulkResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const { candidates, preselectionErrors } = await collectHistoryCompactBulkCandidates({\n pmRoot,\n settings,\n typeToFolder: typeRegistry.type_to_folder,\n });\n\n const mode: \"ids\" | \"scan\" = options.ids !== undefined && options.ids.length > 0 ? \"ids\" : \"scan\";\n const minEntries = options.minEntries ?? HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES;\n const policy = settings.history.compact_policy;\n const policyThresholdApplied = mode === \"scan\" && options.allOver === undefined && policy.enabled;\n const allOver = options.allOver ?? (policyThresholdApplied ? policy.max_entries : undefined);\n\n const selection = selectHistoryCompactBulkTargets(candidates, {\n ids: options.ids,\n scope: options.scope,\n minEntries,\n allOver,\n });\n\n const dryRun = Boolean(options.dryRun);\n const results: HistoryCompactBulkItemResult[] = [...preselectionErrors];\n const totals = {\n streams_considered: candidates.length + preselectionErrors.length,\n selected: 0,\n items_compacted: 0,\n items_skipped: 0,\n items_errored: preselectionErrors.length,\n };\n for (const row of selection) {\n const outcome = await runHistoryCompactBulkRow({ row, options, dryRun, global });\n results.push(outcome.result);\n if (!outcome.selected) {\n totals.items_skipped += 1;\n continue;\n }\n totals.selected += 1;\n if (outcome.compacted) {\n totals.items_compacted += 1;\n }\n if (outcome.errored) {\n totals.items_errored += 1;\n }\n }\n\n return {\n bulk: true,\n dry_run: dryRun,\n mode,\n scope: options.scope ?? null,\n criteria: {\n min_entries: minEntries,\n all_over: allOver ?? null,\n policy_threshold_applied: policyThresholdApplied,\n },\n totals,\n results,\n generated_at: nowIso(),\n };\n}\n", "/**\n * @module core/history/history-compact-bulk\n *\n * Pure selection logic for bulk history-stream compaction. Given a set of\n * history-stream candidates (id, entry count, and lifecycle bucket of the\n * owning item) plus the requested selection criteria, this module decides which\n * streams should be compacted and which are skipped (and why).\n *\n * The module performs no filesystem access and imports no heavy runtime\n * dependencies — the command layer reads streams and item statuses, hands the\n * resolved candidates here, then executes per-item compaction on the selection\n * this module returns. Keeping selection pure makes the matrix of scope /\n * threshold / explicit-id rules trivially testable without touching disk.\n */\n\nimport type { LifecycleBucket } from \"../governance/metadata-coverage.js\";\n\n/** Bulk-compaction scope: only closed items, or every history stream. */\nexport type HistoryCompactScope = \"closed\" | \"all-streams\";\n\n/** Why a candidate stream was not selected for compaction. */\nexport type HistoryCompactBulkSkipReason = \"no_stream\" | \"already_compact\" | \"scope_mismatch\" | \"below_threshold\";\n\n/**\n * One history stream considered for bulk compaction.\n *\n * `bucket` is the lifecycle bucket of the owning item, or `null` when no item\n * matches the stream (an orphan history file). Orphan streams never satisfy a\n * `closed` scope filter but are eligible under `all-streams`.\n */\nexport interface HistoryCompactBulkCandidate {\n id: string;\n entries: number;\n bucket: LifecycleBucket | null;\n}\n\n/** Selection criteria resolved from the command flags + policy defaults. */\nexport interface HistoryCompactBulkCriteria {\n /**\n * Explicit, ordered list of item ids to compact. When non-empty the selection\n * runs in \"ids\" mode: scope/allOver are ignored and only the `minEntries`\n * floor applies. Duplicates are collapsed, preserving first-seen order.\n */\n ids?: string[];\n /** Lifecycle scope filter for scan mode (ignored in ids mode). */\n scope?: HistoryCompactScope;\n /**\n * Streams with at most this many entries are skipped as `already_compact`\n * (compaction collapses a stream to a 2-entry baseline+audit pair, so smaller\n * streams gain nothing). Applies in both modes.\n */\n minEntries: number;\n /**\n * Scan mode only: when set, only streams with strictly more entries than this\n * are selected. Streams above `minEntries` but at/below `allOver` are skipped\n * as `below_threshold`.\n */\n allOver?: number;\n}\n\n/** Per-candidate selection outcome. */\nexport interface HistoryCompactBulkSelectionRow {\n id: string;\n entries: number;\n selected: boolean;\n skip_reason: HistoryCompactBulkSkipReason | null;\n}\n\nfunction selectIdsMode(\n ids: string[],\n byId: ReadonlyMap<string, HistoryCompactBulkCandidate>,\n minEntries: number,\n): HistoryCompactBulkSelectionRow[] {\n const seen = new Set<string>();\n const rows: HistoryCompactBulkSelectionRow[] = [];\n for (const rawId of ids) {\n const id = rawId.trim();\n if (id.length === 0 || seen.has(id)) {\n continue;\n }\n seen.add(id);\n const candidate = byId.get(id);\n if (candidate === undefined) {\n rows.push({ id, entries: 0, selected: false, skip_reason: \"no_stream\" });\n continue;\n }\n if (candidate.entries <= minEntries) {\n rows.push({ id, entries: candidate.entries, selected: false, skip_reason: \"already_compact\" });\n continue;\n }\n rows.push({ id, entries: candidate.entries, selected: true, skip_reason: null });\n }\n return rows;\n}\n\nfunction selectScanMode(\n candidates: HistoryCompactBulkCandidate[],\n criteria: HistoryCompactBulkCriteria,\n): HistoryCompactBulkSelectionRow[] {\n const ordered = [...candidates].sort((a, b) => b.entries - a.entries || a.id.localeCompare(b.id));\n const rows: HistoryCompactBulkSelectionRow[] = [];\n for (const candidate of ordered) {\n if (criteria.scope === \"closed\" && candidate.bucket !== \"closed\") {\n rows.push({ id: candidate.id, entries: candidate.entries, selected: false, skip_reason: \"scope_mismatch\" });\n continue;\n }\n if (candidate.entries <= criteria.minEntries) {\n rows.push({ id: candidate.id, entries: candidate.entries, selected: false, skip_reason: \"already_compact\" });\n continue;\n }\n if (criteria.allOver !== undefined && candidate.entries <= criteria.allOver) {\n rows.push({ id: candidate.id, entries: candidate.entries, selected: false, skip_reason: \"below_threshold\" });\n continue;\n }\n rows.push({ id: candidate.id, entries: candidate.entries, selected: true, skip_reason: null });\n }\n return rows;\n}\n\n/**\n * Decide which history streams to compact.\n *\n * Runs in \"ids\" mode when `criteria.ids` is non-empty (exact, ordered set,\n * honouring only the `minEntries` floor) and \"scan\" mode otherwise (every\n * candidate, filtered by scope and entry thresholds, ordered deepest-first).\n */\nexport function selectHistoryCompactBulkTargets(\n candidates: HistoryCompactBulkCandidate[],\n criteria: HistoryCompactBulkCriteria,\n): HistoryCompactBulkSelectionRow[] {\n if (criteria.ids !== undefined && criteria.ids.length > 0) {\n const byId = new Map(candidates.map((candidate) => [candidate.id, candidate]));\n return selectIdsMode(criteria.ids, byId, criteria.minEntries);\n }\n return selectScanMode(candidates, criteria);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;AACf,OAAO,UAAU;;;;;;;;;;AC8DjB,SAAS,cACP,KACA,MACA,YAAkB;AAElB,QAAM,OAAO,oBAAI,IAAG;AACpB,QAAM,OAAyC,CAAA;AAC/C,aAAW,SAAS,KAAK;AACvB,UAAM,KAAK,MAAM,KAAI;AACrB,QAAI,GAAG,WAAW,KAAK,KAAK,IAAI,EAAE,GAAG;AACnC;IACF;AACA,SAAK,IAAI,EAAE;AACX,UAAM,YAAY,KAAK,IAAI,EAAE;AAC7B,QAAI,cAAc,QAAW;AAC3B,WAAK,KAAK,EAAE,IAAI,SAAS,GAAG,UAAU,OAAO,aAAa,YAAW,CAAE;AACvE;IACF;AACA,QAAI,UAAU,WAAW,YAAY;AACnC,WAAK,KAAK,EAAE,IAAI,SAAS,UAAU,SAAS,UAAU,OAAO,aAAa,kBAAiB,CAAE;AAC7F;IACF;AACA,SAAK,KAAK,EAAE,IAAI,SAAS,UAAU,SAAS,UAAU,MAAM,aAAa,KAAI,CAAE;EACjF;AACA,SAAO;AACT;AAEA,SAAS,eACP,YACA,UAAoC;AAEpC,QAAM,UAAU,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE,EAAE,CAAC;AAChG,QAAM,OAAyC,CAAA;AAC/C,aAAW,aAAa,SAAS;AAC/B,QAAI,SAAS,UAAU,YAAY,UAAU,WAAW,UAAU;AAChE,WAAK,KAAK,EAAE,IAAI,UAAU,IAAI,SAAS,UA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M,yBAAyB,EAAE,KAAK,SAAS,QAAQ,QAAAA,QAAM,CAAE;AAC/E,YAAQ,KAAK,QAAQ,MAAM;AAC3B,QAAI,CAAC,QAAQ,UAAU;AACrB,aAAO,iBAAiB;AACxB;IACF;AACA,WAAO,YAAY;AACnB,QAAI,QAAQ,WAAW;AACrB,aAAO,mBAAmB;IAC5B;AACA,QAAI,QAAQ,SAAS;AACnB,aAAO,iBAAiB;IAC1B;EACF;AAEA,SAAO;IACL,MAAM;IACN,SAAS;IACT;IACA,OAAO,QAAQ,SAAS;IACxB,UAAU;MACR,aAAa;MACb,UAAU,WAAW;MACrB,0BAA0B;;IAE5B;IACA;IACA,cAAc,OAAM;;AAExB;",
|
|
6
|
+
"names": ["compactCount", "global"]
|
|
7
|
+
}
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
_testOnly,
|
|
5
5
|
resolveHistorySubject,
|
|
6
6
|
runHistoryRedact
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2ONH3WG6.js";
|
|
8
8
|
import "./chunk-T5RRNDA7.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-FDNJMYZB.js";
|
|
10
|
+
import "./chunk-Y2VSCQ77.js";
|
|
11
|
+
import "./chunk-NHKXOMZ5.js";
|
|
12
|
+
import "./chunk-UYLA5ROU.js";
|
|
13
|
+
import "./chunk-AOP2EMK3.js";
|
|
14
|
+
import "./chunk-FMWQRMHS.js";
|
|
15
|
+
import "./chunk-SL2ANJSV.js";
|
|
16
16
|
export {
|
|
17
17
|
_testOnly,
|
|
18
18
|
resolveHistorySubject,
|
|
19
19
|
runHistoryRedact
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=history-redact-
|
|
21
|
+
//# sourceMappingURL=history-redact-TUWOUYX5.js.map
|
|
22
22
|
|
|
23
23
|
//# debugId=45eac7fa-f181-5cca-93b7-cfb58909dbb3
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
_testOnly,
|
|
3
|
+
resolveHistorySubject,
|
|
4
|
+
runHistoryRedact
|
|
5
|
+
} from "./chunk-4PJYRA3V.js";
|
|
6
|
+
import "./chunk-WW4E2DC3.js";
|
|
7
|
+
import "./chunk-EB4BBEZD.js";
|
|
8
|
+
import "./chunk-HL742IBM.js";
|
|
9
|
+
import "./chunk-3MLQZI3H.js";
|
|
10
|
+
import "./chunk-CN4OAA2G.js";
|
|
11
|
+
import "./chunk-CQFZRLXQ.js";
|
|
12
|
+
import "./chunk-MZG6I2Q2.js";
|
|
13
|
+
import "./chunk-BDDYM4LH.js";
|
|
14
|
+
export {
|
|
15
|
+
_testOnly,
|
|
16
|
+
resolveHistorySubject,
|
|
17
|
+
runHistoryRedact
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=history-redact-VVDOARNO.js.map
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b7e0c389-3e15-5ee6-a304-d0949ad80172")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
scanHistoryDrift
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZZWMJVW2.js";
|
|
6
6
|
import {
|
|
7
7
|
executeHistoryRewrite,
|
|
8
|
-
resolveHistorySubject
|
|
9
|
-
|
|
8
|
+
resolveHistorySubject,
|
|
9
|
+
writeHistoryRawWithRollback
|
|
10
|
+
} from "./chunk-2ONH3WG6.js";
|
|
10
11
|
import "./chunk-T5RRNDA7.js";
|
|
11
12
|
import {
|
|
12
13
|
readHistoryEntries
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FDNJMYZB.js";
|
|
14
15
|
import {
|
|
15
16
|
historyEntriesToRaw,
|
|
16
17
|
reanchorHistoryEntries,
|
|
17
18
|
replayHash,
|
|
18
19
|
toReplayDocument,
|
|
19
20
|
verifyHistoryChain
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-Y2VSCQ77.js";
|
|
22
|
+
import "./chunk-NHKXOMZ5.js";
|
|
22
23
|
import {
|
|
23
24
|
listAllFrontMatterWithBody,
|
|
24
25
|
readLocatedItem
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-UYLA5ROU.js";
|
|
27
|
+
import "./chunk-AOP2EMK3.js";
|
|
27
28
|
import {
|
|
28
29
|
nowIso
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-FMWQRMHS.js";
|
|
30
31
|
import {
|
|
31
32
|
EXIT_CODE,
|
|
32
33
|
PmCliError,
|
|
@@ -37,12 +38,10 @@ import {
|
|
|
37
38
|
readSettings,
|
|
38
39
|
resolveItemTypeRegistry,
|
|
39
40
|
resolvePmRoot,
|
|
40
|
-
runActiveOnWriteHooks
|
|
41
|
-
|
|
42
|
-
} from "./chunk-I66WE2HE.js";
|
|
41
|
+
runActiveOnWriteHooks
|
|
42
|
+
} from "./chunk-SL2ANJSV.js";
|
|
43
43
|
|
|
44
44
|
// dist/cli/commands/history-repair.js
|
|
45
|
-
import fs from "node:fs/promises";
|
|
46
45
|
import jsonPatch from "fast-json-patch";
|
|
47
46
|
function toAuthor(candidate, defaultAuthor) {
|
|
48
47
|
const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;
|
|
@@ -116,18 +115,11 @@ async function applyHistoryRepairRewrite(params) {
|
|
|
116
115
|
author: params.author,
|
|
117
116
|
force: params.force,
|
|
118
117
|
itemDocument: params.loadedItem?.document ?? null,
|
|
119
|
-
applyRewrite: async ({ historyRawUnderLock }) => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
await fs.rm(params.historyPath, { force: true });
|
|
125
|
-
} else {
|
|
126
|
-
await writeFileAtomic(params.historyPath, historyRawUnderLock);
|
|
127
|
-
}
|
|
128
|
-
throw error;
|
|
129
|
-
}
|
|
130
|
-
},
|
|
118
|
+
applyRewrite: async ({ historyRawUnderLock }) => writeHistoryRawWithRollback({
|
|
119
|
+
historyPath: params.historyPath,
|
|
120
|
+
nextHistoryRaw: historyEntriesToRaw(params.rewrittenEntries),
|
|
121
|
+
historyRawUnderLock
|
|
122
|
+
}),
|
|
131
123
|
applyPostRewrite: async () => runActiveOnWriteHooks({
|
|
132
124
|
path: params.historyPath,
|
|
133
125
|
scope: "project",
|
|
@@ -278,6 +270,6 @@ export {
|
|
|
278
270
|
runHistoryRepair,
|
|
279
271
|
runHistoryRepairAll
|
|
280
272
|
};
|
|
281
|
-
//# sourceMappingURL=history-repair-
|
|
273
|
+
//# sourceMappingURL=history-repair-MPCAIKYE.js.map
|
|
282
274
|
|
|
283
|
-
//# debugId=
|
|
275
|
+
//# debugId=b7e0c389-3e15-5ee6-a304-d0949ad80172
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/history-repair.ts"],"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 { executeHistoryRewrite, writeHistoryRawWithRollback } 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 { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { listAllFrontMatterWithBody, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemMetadata } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\nimport { resolveHistorySubject } from \"./history-redact.js\";\n\n/**\n * Documents the history repair command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryRepairCommandOptions {\n dryRun?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the history repair result payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryRepairResult {\n id: string;\n dry_run: boolean;\n changed: boolean;\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 item: {\n exists: boolean;\n path: string | null;\n matched_chain_before: boolean | null;\n };\n warnings: string[];\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(candidate: string | undefined, defaultAuthor: string): 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 ? await readLocatedItem(subject.located, { schema: settings.schema }) : 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 = 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 = params.reconcileNeeded && params.currentItemReplay ? params.currentItemReplay : params.finalReplay;\n rewrittenEntries.push({\n ts: nowIso(),\n author: params.author,\n op: \"history_repair\",\n patch: params.reconcileNeeded && params.currentItemReplay\n ? (jsonPatch.compare(params.finalReplay, params.currentItemReplay) 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(changed: boolean, skippedOps: number): 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/**\n * Implements run history repair for the public runtime surface of this module.\n */\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(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const subject = await resolveHistorySubject(pmRoot, id, settings, typeRegistry.type_to_folder);\n\n if (!(await pathExists(subject.historyPath))) {\n throw new PmCliError(`No history stream exists for ${subject.id}.`, EXIT_CODE.NOT_FOUND);\n }\n const historyRawBeforeLock = await readFileIfExists(subject.historyPath);\n const historyEntries = await readHistoryEntries(subject.historyPath, subject.id);\n if (historyEntries.length === 0) {\n throw new PmCliError(`No history entries exist for ${subject.id}; nothing to repair.`, EXIT_CODE.USAGE);\n }\n\n const chainBefore = verifyHistoryChain(historyEntries);\n const reanchor = reanchorHistoryEntries(historyEntries);\n\n const itemReplayContext = await loadHistoryRepairItemReplay(subject, settings, historyEntries);\n\n const finalReplay = reanchor.finalDocument;\n const reconcileNeeded =\n itemReplayContext.currentItemReplay !== null && replayHash(finalReplay) !== replayHash(itemReplayContext.currentItemReplay);\n\n const changed = reanchor.entriesRehashed > 0 || reanchor.entriesPatchRepaired > 0 || 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) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\n/**\n * Documents the history repair all stream result payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryRepairAllStreamResult {\n id: string;\n outcome: \"repaired\" | \"skipped_clean\" | \"failed\";\n entries_rehashed?: number;\n entries_patch_repaired?: number;\n reconciled_with_item?: boolean;\n error?: string;\n}\n\n/**\n * Documents the history repair all result payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryRepairAllResult {\n all: true;\n dry_run: boolean;\n scanned_streams: number;\n drifted_streams: number;\n /** One compact row per drifted stream (clean streams are summarized by the counts only). */\n streams: HistoryRepairAllStreamResult[];\n totals: { repaired: number; skipped_clean: number; failed: number };\n warnings: string[];\n generated_at: string;\n}\n\n/**\n * Enforce the `pm history-repair` target contract shared by the CLI and MCP\n * surfaces: exactly one of an item `<id>` or `--all` must be provided.\n */\nexport function assertHistoryRepairTarget(id: string | undefined, all: boolean): 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/**\n * Bulk drift repair: scan every item's history stream with the same drift scan\n * `pm health` uses, then run the audited single-stream repair (ownership check,\n * lock, no-drift verification, audit marker) for each drifted stream. One\n * failing stream never aborts the rest; failures are collected per row and the\n * caller decides the exit code from `totals.failed`.\n */\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(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const itemReadWarnings: string[] = [];\n const items = await listAllFrontMatterWithBody(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n itemReadWarnings,\n settings.schema,\n );\n const drift = await scanHistoryDrift(pmRoot, items as Array<ItemMetadata & { body: string }>);\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) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,eAAe;AAwEtB,SAAS,SAAS,WAA+B,eAAqB;AAEpE,QAAM,WAAW,aAAa,QAAQ,IAAI,aAAa;AACvD,QAAM,UAAU,SAAS,KAAI;AAC7B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAEA,eAAe,4BACb,SACA,UACA,gBAA8B;AAE9B,QAAM,kBAAkB,QAAQ,SAAS,YAAY;AACrD,QAAM,aAAa,QAAQ,UAAU,MAAM,gBAAgB,QAAQ,SAAS,EAAE,QAAQ,SAAS,OAAM,CAAE,IAAI;AAC3G,MAAI,CAAC,YAAY;AACf,WAAO;MACL,mBAAmB;MACnB;MACA,oBAAoB;MACpB,0BAA0B;MAC1B,YAAY;;EAEhB;AACA,QAAM,oBAAoB,iBAAiB,WAAW,QAAQ;AAC9D,QAAM,wBAAwB,eAAe,eAAe,SAAS,CAAC,GAAG;AACzE,SAAO;IACL;IACA;IACA,oBAAoB,WAAW,iBAAiB,MAAM;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