@unbrained/pm-cli 2026.7.1 → 2026.7.3
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 +25 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +1 -1
- package/dist/cli/commander-usage.d.ts +2 -0
- package/dist/cli/commander-usage.js +110 -86
- 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/aggregate.js +102 -79
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/calendar.js +278 -243
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +176 -114
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.js +157 -129
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +50 -42
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/config.d.ts +2 -0
- package/dist/cli/commands/config.js +443 -879
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.js +365 -287
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +352 -238
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +32 -17
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +46 -39
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/dedupe-merge.js +88 -69
- package/dist/cli/commands/dedupe-merge.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/shared.js +21 -15
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/get.js +114 -81
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +17 -0
- package/dist/cli/commands/health.js +545 -417
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.js +209 -140
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.js +162 -119
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +120 -85
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.js +32 -19
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.d.ts +8 -2
- package/dist/cli/commands/init.js +263 -162
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.js +152 -102
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/next.js +60 -40
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/plan.js +373 -298
- package/dist/cli/commands/plan.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/recurrence-parsers.js +43 -25
- package/dist/cli/commands/recurrence-parsers.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +21 -5
- package/dist/cli/commands/reindex.js +345 -205
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +8 -7
- package/dist/cli/commands/restore.js +105 -69
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.js +33 -30
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +10 -2
- package/dist/cli/commands/search.js +503 -470
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/telemetry.js +98 -87
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/test-all.js +237 -168
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +6 -5
- package/dist/cli/commands/test.js +424 -344
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +57 -42
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +1 -1
- package/dist/cli/commands/update.js +738 -671
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +20 -1
- package/dist/cli/commands/validate.js +478 -343
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +406 -361
- 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.d.ts +47 -0
- package/dist/cli/main.js +474 -371
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migration-gates.js +22 -45
- package/dist/cli/migration-gates.js.map +1 -1
- package/dist/cli/register-list-query.js +299 -310
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +763 -779
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +386 -362
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +120 -101
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +4 -0
- package/dist/cli/registration-helpers.js +45 -56
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js → activity-5YWLSPGE.js} +9 -9
- package/dist/cli-bundle/chunks/activity-BIML7K2D.js +16 -0
- package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js → aggregate-2V2M3JZU.js} +107 -83
- package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js.map → aggregate-2V2M3JZU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{aggregate-JTEF4BP7.js → aggregate-EK7DXML7.js} +108 -84
- package/dist/cli-bundle/chunks/aggregate-EK7DXML7.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-LOVPGVPT.js → append-EZESUVJT.js} +8 -8
- package/dist/cli-bundle/chunks/{append-QCFJSDFL.js → append-JFG4WQMG.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-TP5Q5ZD3.js → chunk-32IUNTG4.js} +158 -119
- package/dist/cli-bundle/chunks/chunk-32IUNTG4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js → chunk-3W2HJKJX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VARHOHYV.js → chunk-4EXFFP7T.js} +86 -52
- package/dist/cli-bundle/chunks/chunk-4EXFFP7T.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js → chunk-4PFVUUYV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JSU5P7VS.js → chunk-4WB6S4YX.js} +308 -184
- package/dist/cli-bundle/chunks/chunk-4WB6S4YX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HXTQJXWT.js → chunk-572FKBRL.js} +61 -102
- package/dist/cli-bundle/chunks/chunk-572FKBRL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js → chunk-5E7N4T2Z.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js → chunk-5IZUBZBR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js → chunk-5JIWFWOZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FFMQB7WR.js → chunk-67LARBDL.js} +493 -404
- package/dist/cli-bundle/chunks/chunk-67LARBDL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js → chunk-6CDCWKSX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3K2M5OYU.js → chunk-6KRFL33E.js} +308 -184
- package/dist/cli-bundle/chunks/chunk-6KRFL33E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js → chunk-6NYJGMTY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js → chunk-7CLLC75T.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2466X6E4.js → chunk-7LYO6S5A.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js → chunk-A3OQ7TFW.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-5CGRF3L5.js → chunk-AIKU3IIL.js} +153 -90
- package/dist/cli-bundle/chunks/chunk-AIKU3IIL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WYDHYJPO.js → chunk-AJHYQCBJ.js} +39 -5
- package/dist/cli-bundle/chunks/chunk-AJHYQCBJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
- package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OTUHB4HS.js → chunk-BE2SR6QL.js} +92 -77
- package/dist/cli-bundle/chunks/chunk-BE2SR6QL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JLM7BHI7.js → chunk-BI4R7HI2.js} +75 -53
- package/dist/cli-bundle/chunks/chunk-BI4R7HI2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AXIDKKAT.js → chunk-CXR3CMBQ.js} +33 -6
- package/dist/cli-bundle/chunks/chunk-CXR3CMBQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZETXE4SE.js → chunk-ECU6MMTQ.js} +713 -613
- package/dist/cli-bundle/chunks/chunk-ECU6MMTQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2D4HATP2.js → chunk-EJ2OCBHF.js} +54 -30
- package/dist/cli-bundle/chunks/chunk-EJ2OCBHF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BDTISOSD.js → chunk-EQURFOMH.js} +41 -26
- package/dist/cli-bundle/chunks/chunk-EQURFOMH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js → chunk-ER4ME5U2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js → chunk-ERG65A2L.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IZBR4NRW.js → chunk-F6WNBITZ.js} +157 -113
- package/dist/cli-bundle/chunks/chunk-F6WNBITZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js → chunk-FH2H3CBD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JPECA746.js → chunk-FUFFPIYA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CF7RL6FR.js → chunk-FZJM2TXF.js} +110 -73
- package/dist/cli-bundle/chunks/chunk-FZJM2TXF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js → chunk-GUYNUXQT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js → chunk-GVJE5T7Q.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3J6JRJ3I.js → chunk-HB4FAT3O.js} +42 -60
- package/dist/cli-bundle/chunks/chunk-HB4FAT3O.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-55SNVXRQ.js → chunk-HQAF23Q2.js} +626 -484
- package/dist/cli-bundle/chunks/chunk-HQAF23Q2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js → chunk-JBZ2NTKX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RMMQ74TG.js → chunk-JPATY4SE.js} +54 -30
- package/dist/cli-bundle/chunks/chunk-JPATY4SE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IPYBJWTE.js → chunk-K5DT2YKM.js} +109 -72
- package/dist/cli-bundle/chunks/chunk-K5DT2YKM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js → chunk-KEZOIPCR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RVUALSJF.js → chunk-KHVGM5CS.js} +466 -365
- package/dist/cli-bundle/chunks/chunk-KHVGM5CS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YITK2PJ6.js → chunk-KS6ATO47.js} +288 -175
- package/dist/cli-bundle/chunks/chunk-KS6ATO47.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7R4QEMZZ.js → chunk-L4SLHV6G.js} +463 -362
- package/dist/cli-bundle/chunks/chunk-L4SLHV6G.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RLDHZHQS.js → chunk-LBE5QFMZ.js} +158 -114
- package/dist/cli-bundle/chunks/chunk-LBE5QFMZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-22WKIL3H.js → chunk-LCWQP6NM.js} +76 -54
- package/dist/cli-bundle/chunks/chunk-LCWQP6NM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KNPEF7QG.js → chunk-LOWVNZBZ.js} +91 -76
- package/dist/cli-bundle/chunks/chunk-LOWVNZBZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js → chunk-MDHWWBNZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js → chunk-MEZZZBYX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-V3NOKJF2.js → chunk-MHRS5FUX.js} +288 -175
- package/dist/cli-bundle/chunks/chunk-MHRS5FUX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3XZCOZ5J.js → chunk-NOIEVOK5.js} +391 -313
- package/dist/cli-bundle/chunks/chunk-NOIEVOK5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js → chunk-NZ7QIUP5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js → chunk-OGLGI22K.js} +115 -67
- package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js.map → chunk-OGLGI22K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js → chunk-P5L7Z2O6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BZCEN4JA.js → chunk-PULUSQAV.js} +492 -403
- package/dist/cli-bundle/chunks/chunk-PULUSQAV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3VGN2UWE.js → chunk-QCDTQCMW.js} +22 -30
- package/dist/cli-bundle/chunks/chunk-QCDTQCMW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js → chunk-QNNQAAZ5.js} +24 -18
- package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js.map → chunk-QNNQAAZ5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MDPEOIGN.js → chunk-RAHINBVP.js} +60 -101
- package/dist/cli-bundle/chunks/chunk-RAHINBVP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CWFNTKQJ.js → chunk-RJH5VQHW.js} +43 -61
- package/dist/cli-bundle/chunks/chunk-RJH5VQHW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js → chunk-SU2E4AWU.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js → chunk-SU3TB4NS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JWXRETDF.js → chunk-SYE6WMV6.js} +626 -484
- package/dist/cli-bundle/chunks/chunk-SYE6WMV6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NWMZWYYB.js → chunk-T3P7PMZP.js} +42 -27
- package/dist/cli-bundle/chunks/chunk-T3P7PMZP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js → chunk-T4XBKJ3F.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js → chunk-T6AXEBOP.js} +23 -17
- package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js.map → chunk-T6AXEBOP.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js → chunk-TQ6AX5SQ.js} +58 -69
- package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js.map → chunk-TQ6AX5SQ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4XOIEKSD.js → chunk-U3S2B7TA.js} +86 -52
- package/dist/cli-bundle/chunks/chunk-U3S2B7TA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js → chunk-U5TR4N7J.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js → chunk-UMNQZS4H.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js → chunk-WJA3PXW7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-RGEMWD6Q.js → chunk-WRYERRZX.js} +157 -118
- package/dist/cli-bundle/chunks/chunk-WRYERRZX.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NUHHPVVS.js → chunk-WYOIIFSE.js} +712 -612
- package/dist/cli-bundle/chunks/chunk-WYOIIFSE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js → chunk-XRYSCRZR.js} +116 -68
- package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js.map → chunk-XRYSCRZR.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js → chunk-YF746GTH.js} +59 -70
- package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js.map → chunk-YF746GTH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js → chunk-YPWUSH72.js} +390 -312
- package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js.map → chunk-YPWUSH72.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js → chunk-YSDFIY7N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js → chunk-YSGTMDWC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NFDPYAIP.js → chunk-YVKZ3ANP.js} +21 -29
- package/dist/cli-bundle/chunks/chunk-YVKZ3ANP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
- package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js → chunk-Z5F6XZXE.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js → chunk-Z7RPDF2Y.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3S2KT7NG.js → chunk-ZFTKYWIF.js} +152 -89
- package/dist/cli-bundle/chunks/chunk-ZFTKYWIF.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js → claim-2BGBGSVI.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js → claim-5GU7OE67.js} +8 -8
- package/dist/cli-bundle/chunks/close-6YODBUIV.js +14 -0
- package/dist/cli-bundle/chunks/{close-TQYAAFJP.js → close-AFVKPR57.js} +7 -7
- package/dist/cli-bundle/chunks/{close-many-BG5QQIDQ.js → close-many-7KLOSYLP.js} +186 -122
- package/dist/cli-bundle/chunks/close-many-7KLOSYLP.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-many-LDRVEQY2.js → close-many-JKUJMHLG.js} +187 -123
- package/dist/cli-bundle/chunks/close-many-JKUJMHLG.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js → comments-DNWHEBOS.js} +9 -9
- package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js → comments-RW23R3VE.js} +9 -9
- package/dist/cli-bundle/chunks/config-AUM5WBYA.js +1072 -0
- package/dist/cli-bundle/chunks/config-AUM5WBYA.js.map +7 -0
- package/dist/cli-bundle/chunks/config-OZWSA2NP.js +1062 -0
- package/dist/cli-bundle/chunks/config-OZWSA2NP.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-B6275WPX.js → context-OYXRGY7S.js} +12 -12
- package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js → context-PKCEHQY3.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-HN7ABKLP.js → contracts-L6ODXNUM.js} +320 -199
- package/dist/cli-bundle/chunks/contracts-L6ODXNUM.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-W4FZVVD6.js → contracts-X74F2GSM.js} +321 -200
- package/dist/cli-bundle/chunks/contracts-X74F2GSM.js.map +1 -0
- package/dist/cli-bundle/chunks/{copy-DEM4DATS.js → copy-6XOR3HKN.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js → copy-I4NCLBR4.js} +5 -5
- package/dist/cli-bundle/chunks/{create-RLRJMRTM.js → create-PM45M6PE.js} +12 -12
- package/dist/cli-bundle/chunks/create-Z7YCH3BE.js +28 -0
- package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js → delete-7YXHYG67.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js → delete-LPISP43T.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js → deps-N2T26FME.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js → deps-WATKQDE3.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-GYZNVS26.js → docs-6LQ3GLM7.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-26S44RXU.js → docs-Z3X6JZLT.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js → eval-6DCLG52D.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js → eval-Y3ZCUTHK.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js → extension-BNINIMT7.js} +11 -11
- package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js → extension-QWE4YYK5.js} +11 -11
- package/dist/cli-bundle/chunks/{files-NQHEXUZD.js → files-6SGKHS6O.js} +7 -7
- package/dist/cli-bundle/chunks/{files-MBNICQFM.js → files-FUYPSOFJ.js} +7 -7
- package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js → focus-2Q3K76G2.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-XZW5423D.js → focus-ATLBWXXD.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js → gc-RUYEMNRF.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js → gc-TDWSDR66.js} +3 -3
- package/dist/cli-bundle/chunks/{get-A7MAOHCU.js → get-2WGLX74N.js} +120 -80
- package/dist/cli-bundle/chunks/get-2WGLX74N.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-DSDEKJ3L.js → get-LY6M2JIM.js} +121 -81
- package/dist/cli-bundle/chunks/get-LY6M2JIM.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-3IPFLKXB.js → health-4RKHYS3T.js} +535 -371
- package/dist/cli-bundle/chunks/health-4RKHYS3T.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-GZXGBZ36.js → health-TMFVNYRA.js} +534 -370
- package/dist/cli-bundle/chunks/health-TMFVNYRA.js.map +7 -0
- package/dist/cli-bundle/chunks/history-CGNQJXFE.js +18 -0
- package/dist/cli-bundle/chunks/{history-NERDJNUB.js → history-SGRRS72R.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-2WRZ2WK4.js → history-compact-LOED43R3.js} +213 -134
- package/dist/cli-bundle/chunks/history-compact-LOED43R3.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-HR7BB4LR.js → history-compact-V5DNAQHH.js} +214 -135
- package/dist/cli-bundle/chunks/history-compact-V5DNAQHH.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js → history-redact-IRL7WJ3E.js} +9 -9
- package/dist/cli-bundle/chunks/history-redact-N3JK7VBW.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-XA3LC4GA.js → history-repair-4WVBVHFR.js} +124 -84
- package/dist/cli-bundle/chunks/history-repair-4WVBVHFR.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-LCMOS45X.js → history-repair-PGYQJMGD.js} +123 -83
- package/dist/cli-bundle/chunks/history-repair-PGYQJMGD.js.map +7 -0
- package/dist/cli-bundle/chunks/{init-64XDLQJB.js → init-4GESW7RM.js} +12 -12
- package/dist/cli-bundle/chunks/init-XIDPABA4.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js → learnings-4BHWFFUV.js} +9 -9
- package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js → learnings-4FJY7WIW.js} +9 -9
- package/dist/cli-bundle/chunks/{list-G5Y65VF6.js → list-472TIOVK.js} +8 -8
- package/dist/cli-bundle/chunks/{list-DNBJVO3E.js → list-D7BF5CL2.js} +8 -8
- package/dist/cli-bundle/chunks/{next-FYTQF6HG.js → next-D5STGWI2.js} +71 -46
- package/dist/cli-bundle/chunks/next-D5STGWI2.js.map +1 -0
- package/dist/cli-bundle/chunks/{next-BCERKDUR.js → next-SFQZVX2B.js} +70 -45
- package/dist/cli-bundle/chunks/next-SFQZVX2B.js.map +7 -0
- package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js → notes-6KNOSLIT.js} +9 -9
- package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js → notes-W4UEICGF.js} +9 -9
- package/dist/cli-bundle/chunks/{plan-RKZHQVXR.js → plan-JO6V7BXO.js} +373 -279
- package/dist/cli-bundle/chunks/plan-JO6V7BXO.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-4WXEQCTN.js → plan-MJQW5XK3.js} +372 -278
- package/dist/cli-bundle/chunks/plan-MJQW5XK3.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-4OMM32CD.js → profile-3TOTMUR4.js} +27 -19
- package/dist/cli-bundle/chunks/profile-3TOTMUR4.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-QLER5ENE.js → profile-WIQY2KCV.js} +28 -20
- package/dist/cli-bundle/chunks/profile-WIQY2KCV.js.map +1 -0
- package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js +416 -0
- package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js.map +7 -0
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js +406 -0
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-KK7PHYYU.js → register-mutation-ROFE2YPC.js} +729 -702
- package/dist/cli-bundle/chunks/register-mutation-ROFE2YPC.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-ENNDUAZG.js → register-mutation-SJWMVIJ2.js} +730 -703
- package/dist/cli-bundle/chunks/register-mutation-SJWMVIJ2.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-HZ6XERQG.js → register-operations-IADFVH53.js} +389 -365
- package/dist/cli-bundle/chunks/register-operations-IADFVH53.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js +510 -0
- package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-ZKJ53RS7.js → register-setup-3QJY43CY.js} +128 -103
- package/dist/cli-bundle/chunks/register-setup-3QJY43CY.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-P67EMBDJ.js → register-setup-AJWUSSQX.js} +129 -104
- package/dist/cli-bundle/chunks/register-setup-AJWUSSQX.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js → restore-44IHMMZZ.js} +9 -9
- package/dist/cli-bundle/chunks/restore-EXHU34EU.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js → scheduling-shortcuts-OLHNLAZY.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js → scheduling-shortcuts-TSBK4AY5.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-73HR2OJW.js → schema-IB2NZZWD.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js → schema-VBCELP5G.js} +7 -7
- package/dist/cli-bundle/chunks/{search-AXPXKZER.js → search-7UBETML4.js} +10 -10
- package/dist/cli-bundle/chunks/{search-KILGT37L.js → search-R227JOL6.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js → stats-FAG7COEH.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js → stats-MCK7PLYS.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-GAHHQTOS.js → telemetry-DRPDZMAO.js} +84 -70
- package/dist/cli-bundle/chunks/telemetry-DRPDZMAO.js.map +7 -0
- package/dist/cli-bundle/chunks/{telemetry-BZUF6H7G.js → telemetry-GVVUQSJQ.js} +85 -71
- package/dist/cli-bundle/chunks/telemetry-GVVUQSJQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-PWDIZ255.js → test-QY44WAMR.js} +15 -15
- package/dist/cli-bundle/chunks/{test-ACD52Z3S.js → test-SY76DZTO.js} +15 -15
- package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js +430 -0
- package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js.map +7 -0
- package/dist/cli-bundle/chunks/test-all-USPJHXFR.js +427 -0
- package/dist/cli-bundle/chunks/test-all-USPJHXFR.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-UXIXPDKU.js → test-runs-MG5VIGSK.js} +185 -147
- package/dist/cli-bundle/chunks/test-runs-MG5VIGSK.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-PLRAZEFW.js → test-runs-QIR5MJPL.js} +184 -146
- package/dist/cli-bundle/chunks/test-runs-QIR5MJPL.js.map +7 -0
- package/dist/cli-bundle/chunks/update-A7EICML6.js +24 -0
- package/dist/cli-bundle/chunks/{update-KFX2SIAC.js → update-IKJZWLQC.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js → update-many-BEMTDA2X.js} +84 -69
- package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js.map → update-many-BEMTDA2X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js → update-many-RATAARHU.js} +83 -68
- package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js.map → update-many-RATAARHU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js → upgrade-NWMR3VQL.js} +11 -11
- package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js → upgrade-VU46BLJZ.js} +11 -11
- package/dist/cli-bundle/chunks/{validate-X5W76YJL.js → validate-GAJ6FUSI.js} +451 -321
- package/dist/cli-bundle/chunks/validate-GAJ6FUSI.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-MTUVL5VC.js → validate-NRY6MFXN.js} +450 -320
- package/dist/cli-bundle/chunks/validate-NRY6MFXN.js.map +7 -0
- package/dist/cli-bundle/main.js +1107 -916
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/config/nested-settings.js +89 -67
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/governance/metadata-coverage.js +20 -28
- package/dist/core/governance/metadata-coverage.js.map +1 -1
- package/dist/core/history/drift-scan.js +93 -81
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/item/item-type-definition.js +14 -14
- package/dist/core/item/item-type-definition.js.map +1 -1
- package/dist/core/item/type-registry.js +114 -99
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/output/mutation-projection.js +42 -26
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +97 -80
- 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/search/semantic-defaults.js +64 -37
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.js +32 -17
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.js +31 -28
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/sentry/instrument.js +54 -43
- package/dist/core/sentry/instrument.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 +316 -171
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.js +33 -26
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings.js +247 -203
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/test/background-runs.js +189 -160
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +71 -99
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/compose.js +51 -42
- package/dist/sdk/compose.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 +2 -2
- package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
- package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
- 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/dist/cli-bundle/chunks/activity-AW6XVFH6.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-22WKIL3H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VGN2UWE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AXIDKKAT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BDTISOSD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CF7RL6FR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IPYBJWTE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IZBR4NRW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JLM7BHI7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KNPEF7QG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NFDPYAIP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NWMZWYYB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OTUHB4HS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RLDHZHQS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-V3NOKJF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WYDHYJPO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YITK2PJ6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +0 -1
- package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +0 -14
- package/dist/cli-bundle/chunks/close-many-BG5QQIDQ.js.map +0 -7
- package/dist/cli-bundle/chunks/close-many-LDRVEQY2.js.map +0 -1
- package/dist/cli-bundle/chunks/config-DMSU64QO.js +0 -1541
- package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +0 -7
- package/dist/cli-bundle/chunks/config-QH2DICD6.js +0 -1531
- package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +0 -1
- package/dist/cli-bundle/chunks/create-OH3BDGBB.js +0 -28
- package/dist/cli-bundle/chunks/get-A7MAOHCU.js.map +0 -7
- package/dist/cli-bundle/chunks/get-DSDEKJ3L.js.map +0 -1
- package/dist/cli-bundle/chunks/health-3IPFLKXB.js.map +0 -1
- package/dist/cli-bundle/chunks/health-GZXGBZ36.js.map +0 -7
- package/dist/cli-bundle/chunks/history-WSZHY3PN.js +0 -18
- package/dist/cli-bundle/chunks/history-compact-2WRZ2WK4.js.map +0 -7
- package/dist/cli-bundle/chunks/history-compact-HR7BB4LR.js.map +0 -1
- package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-LCMOS45X.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-XA3LC4GA.js.map +0 -1
- package/dist/cli-bundle/chunks/init-PAX32BJA.js +0 -22
- package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +0 -7
- package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-4WXEQCTN.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-RKZHQVXR.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js +0 -400
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js +0 -410
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js +0 -486
- package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-HZ6XERQG.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-YALDGTQR.js +0 -17
- package/dist/cli-bundle/chunks/telemetry-BZUF6H7G.js.map +0 -1
- package/dist/cli-bundle/chunks/telemetry-GAHHQTOS.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js +0 -358
- package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js +0 -361
- package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +0 -1
- package/dist/cli-bundle/chunks/update-AMRSOIWP.js +0 -24
- package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js.map → activity-5YWLSPGE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-AW6XVFH6.js.map → activity-BIML7K2D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-LOVPGVPT.js.map → append-EZESUVJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-QCFJSDFL.js.map → append-JFG4WQMG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js.map → chunk-3W2HJKJX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js.map → chunk-4PFVUUYV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js.map → chunk-5E7N4T2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js.map → chunk-5IZUBZBR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js.map → chunk-5JIWFWOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js.map → chunk-6CDCWKSX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js.map → chunk-6NYJGMTY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js.map → chunk-7CLLC75T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2466X6E4.js.map → chunk-7LYO6S5A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js.map → chunk-A3OQ7TFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js.map → chunk-ER4ME5U2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js.map → chunk-ERG65A2L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js.map → chunk-FH2H3CBD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JPECA746.js.map → chunk-FUFFPIYA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js.map → chunk-GUYNUXQT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js.map → chunk-GVJE5T7Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js.map → chunk-JBZ2NTKX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js.map → chunk-KEZOIPCR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js.map → chunk-MDHWWBNZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js.map → chunk-MEZZZBYX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js.map → chunk-NZ7QIUP5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js.map → chunk-P5L7Z2O6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js.map → chunk-SU2E4AWU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js.map → chunk-SU3TB4NS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js.map → chunk-T4XBKJ3F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js.map → chunk-U5TR4N7J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js.map → chunk-UMNQZS4H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js.map → chunk-WJA3PXW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js.map → chunk-YSDFIY7N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js.map → chunk-YSGTMDWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js.map → chunk-Z5F6XZXE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js.map → chunk-Z7RPDF2Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js.map → claim-2BGBGSVI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js.map → claim-5GU7OE67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-E6ZZGCJY.js.map → close-6YODBUIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-TQYAAFJP.js.map → close-AFVKPR57.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js.map → comments-DNWHEBOS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js.map → comments-RW23R3VE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-B6275WPX.js.map → context-OYXRGY7S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js.map → context-PKCEHQY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-DEM4DATS.js.map → copy-6XOR3HKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js.map → copy-I4NCLBR4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-RLRJMRTM.js.map → create-PM45M6PE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-OH3BDGBB.js.map → create-Z7YCH3BE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js.map → delete-7YXHYG67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js.map → delete-LPISP43T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js.map → deps-N2T26FME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js.map → deps-WATKQDE3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-GYZNVS26.js.map → docs-6LQ3GLM7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-26S44RXU.js.map → docs-Z3X6JZLT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js.map → eval-6DCLG52D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js.map → eval-Y3ZCUTHK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js.map → extension-BNINIMT7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js.map → extension-QWE4YYK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-NQHEXUZD.js.map → files-6SGKHS6O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-MBNICQFM.js.map → files-FUYPSOFJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js.map → focus-2Q3K76G2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-XZW5423D.js.map → focus-ATLBWXXD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js.map → gc-RUYEMNRF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js.map → gc-TDWSDR66.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-WSZHY3PN.js.map → history-CGNQJXFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-NERDJNUB.js.map → history-SGRRS72R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js.map → history-redact-IRL7WJ3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-MP6CH7U5.js.map → history-redact-N3JK7VBW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-64XDLQJB.js.map → init-4GESW7RM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-PAX32BJA.js.map → init-XIDPABA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js.map → learnings-4BHWFFUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js.map → learnings-4FJY7WIW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-G5Y65VF6.js.map → list-472TIOVK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DNBJVO3E.js.map → list-D7BF5CL2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js.map → notes-6KNOSLIT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js.map → notes-W4UEICGF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js.map → restore-44IHMMZZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YALDGTQR.js.map → restore-EXHU34EU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js.map → scheduling-shortcuts-OLHNLAZY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js.map → scheduling-shortcuts-TSBK4AY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-73HR2OJW.js.map → schema-IB2NZZWD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js.map → schema-VBCELP5G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-AXPXKZER.js.map → search-7UBETML4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-KILGT37L.js.map → search-R227JOL6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js.map → stats-FAG7COEH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js.map → stats-MCK7PLYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-PWDIZ255.js.map → test-QY44WAMR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-ACD52Z3S.js.map → test-SY76DZTO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-AMRSOIWP.js.map → update-A7EICML6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-KFX2SIAC.js.map → update-IKJZWLQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js.map → upgrade-NWMR3VQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js.map → upgrade-VU46BLJZ.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
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]="6054c314-49cd-5a77-987e-b68fdbbbf981")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
resolveAuthor
|
|
5
5
|
} from "./chunk-T5RRNDA7.js";
|
|
6
6
|
import {
|
|
7
7
|
readHistoryEntries
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SU2E4AWU.js";
|
|
9
9
|
import {
|
|
10
10
|
EMPTY_REPLAY_DOCUMENT,
|
|
11
11
|
normalizeReplayPatchOps,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
replayToCanonicalItemDocument,
|
|
14
14
|
replayToItemDocument,
|
|
15
15
|
toReplayDocument
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7CLLC75T.js";
|
|
17
17
|
import {
|
|
18
18
|
acquireLock,
|
|
19
19
|
appendHistoryEntry,
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
normalizeItemId,
|
|
24
24
|
normalizeRawItemId,
|
|
25
25
|
readLocatedItem
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4WB6S4YX.js";
|
|
27
27
|
import {
|
|
28
28
|
canonicalDocument,
|
|
29
29
|
serializeItemDocument
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-YSDFIY7N.js";
|
|
31
31
|
import {
|
|
32
32
|
nowIso
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-CXR3CMBQ.js";
|
|
34
34
|
import {
|
|
35
35
|
EXIT_CODE,
|
|
36
36
|
PmCliError,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
resolvePmRoot,
|
|
48
48
|
runActiveOnWriteHooks,
|
|
49
49
|
writeFileAtomic
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-L4SLHV6G.js";
|
|
51
51
|
|
|
52
52
|
// dist/cli/commands/restore.js
|
|
53
53
|
import jsonPatch from "fast-json-patch";
|
|
@@ -104,6 +104,10 @@ function extractPatchFailureContext(patch, error) {
|
|
|
104
104
|
context.patchIndex = candidate.index;
|
|
105
105
|
}
|
|
106
106
|
const operationRecord = typeof candidate.operation === "object" && candidate.operation !== null ? candidate.operation : null;
|
|
107
|
+
enrichPatchFailureContext(context, operationRecord, patch);
|
|
108
|
+
return context;
|
|
109
|
+
}
|
|
110
|
+
function enrichPatchFailureContext(context, operationRecord, patch) {
|
|
107
111
|
if (operationRecord && typeof operationRecord.op === "string") {
|
|
108
112
|
context.op = operationRecord.op;
|
|
109
113
|
}
|
|
@@ -121,7 +125,6 @@ function extractPatchFailureContext(patch, error) {
|
|
|
121
125
|
context.from = context.from ?? fallback.from;
|
|
122
126
|
}
|
|
123
127
|
}
|
|
124
|
-
return context;
|
|
125
128
|
}
|
|
126
129
|
function applyHistoryPatch(current, patch, entryNumber, entryOp) {
|
|
127
130
|
try {
|
|
@@ -235,6 +238,71 @@ function changedFields(beforeDocument, afterDocument) {
|
|
|
235
238
|
}
|
|
236
239
|
return Array.from(fields).sort((a, b) => a.localeCompare(b));
|
|
237
240
|
}
|
|
241
|
+
async function loadRestoreStateUnderLock(params) {
|
|
242
|
+
const historyRawUnderLock = await readFileIfExists(params.subject.historyPath);
|
|
243
|
+
if (historyRawUnderLock !== params.historyRawBeforeLock) {
|
|
244
|
+
throw new PmCliError(`History for ${params.resolvedId} changed while waiting for lock; retry restore.`, EXIT_CODE.CONFLICT);
|
|
245
|
+
}
|
|
246
|
+
const locatedUnderLock = await locateItem(params.pmRoot, params.resolvedId, params.settings.id_prefix, params.settings.item_format, params.typeToFolder);
|
|
247
|
+
const loadedItemUnderLock = locatedUnderLock ? await readLocatedItem(locatedUnderLock, { schema: params.settings.schema }) : null;
|
|
248
|
+
if ((loadedItemUnderLock?.raw ?? null) !== params.currentItemRawBeforeLock) {
|
|
249
|
+
throw new PmCliError(`Item ${params.resolvedId} changed while waiting for lock; retry restore.`, EXIT_CODE.CONFLICT);
|
|
250
|
+
}
|
|
251
|
+
return { loadedItemUnderLock, existingItemPath: locatedUnderLock?.itemPath ?? null };
|
|
252
|
+
}
|
|
253
|
+
function resolveRestoreCurrentState(loadedItemUnderLock, history) {
|
|
254
|
+
if (loadedItemUnderLock) {
|
|
255
|
+
return { document: loadedItemUnderLock.document, originalRaw: loadedItemUnderLock.raw };
|
|
256
|
+
}
|
|
257
|
+
return { document: replayCurrentDocument(history), originalRaw: null };
|
|
258
|
+
}
|
|
259
|
+
function collectRestoreOwnershipWarnings(params) {
|
|
260
|
+
const assigned = params.document.metadata.assignee?.trim();
|
|
261
|
+
const hasOwnershipConflict = assigned && assigned !== params.author && !params.force;
|
|
262
|
+
if (!hasOwnershipConflict) {
|
|
263
|
+
return [];
|
|
264
|
+
}
|
|
265
|
+
if (params.enforcement === "strict") {
|
|
266
|
+
throw new PmCliError(`Item ${params.resolvedId} is assigned to ${assigned}. Use --force to override.`, EXIT_CODE.CONFLICT);
|
|
267
|
+
}
|
|
268
|
+
return params.enforcement === "warn" ? [`ownership_warning:assignee_conflict:${params.resolvedId}:${assigned}`] : [];
|
|
269
|
+
}
|
|
270
|
+
async function restorePreviousItemAfterHistoryFailure(params) {
|
|
271
|
+
if (params.existingItemPath && params.resolvedOriginalRaw !== null && params.restoredItemPath !== params.existingItemPath) {
|
|
272
|
+
await writeFileAtomic(params.existingItemPath, params.resolvedOriginalRaw);
|
|
273
|
+
await fs.rm(params.restoredItemPath, { force: true });
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (params.existingItemPath && params.resolvedOriginalRaw !== null) {
|
|
277
|
+
await writeFileAtomic(params.existingItemPath, params.resolvedOriginalRaw);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
await fs.rm(params.restoredItemPath, { force: true });
|
|
281
|
+
}
|
|
282
|
+
async function runRestoreWriteHooks(params) {
|
|
283
|
+
return [
|
|
284
|
+
...await runActiveOnWriteHooks({
|
|
285
|
+
path: params.restoredItemPath,
|
|
286
|
+
scope: "project",
|
|
287
|
+
op: "restore",
|
|
288
|
+
item_id: params.after.metadata.id,
|
|
289
|
+
item_type: params.after.metadata.type,
|
|
290
|
+
before: params.before,
|
|
291
|
+
after: params.after,
|
|
292
|
+
changed_fields: ["restored"]
|
|
293
|
+
}),
|
|
294
|
+
...await runActiveOnWriteHooks({
|
|
295
|
+
path: params.historyPath,
|
|
296
|
+
scope: "project",
|
|
297
|
+
op: "restore:history",
|
|
298
|
+
item_id: params.after.metadata.id,
|
|
299
|
+
item_type: params.after.metadata.type,
|
|
300
|
+
before: params.before,
|
|
301
|
+
after: params.after,
|
|
302
|
+
changed_fields: ["restored"]
|
|
303
|
+
})
|
|
304
|
+
];
|
|
305
|
+
}
|
|
238
306
|
async function runRestore(id, target, options, global) {
|
|
239
307
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
240
308
|
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
@@ -260,36 +328,24 @@ async function runRestore(id, target, options, global) {
|
|
|
260
328
|
const author = resolveAuthor(options.author, settings.author_default);
|
|
261
329
|
const releaseLock = await acquireLock(pmRoot, resolvedId, settings.locks.ttl_seconds, author, Boolean(options.force), settings.governance.force_required_for_stale_lock);
|
|
262
330
|
try {
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
const existingItemPath = locatedUnderLock?.itemPath ?? null;
|
|
331
|
+
const { loadedItemUnderLock, existingItemPath } = await loadRestoreStateUnderLock({
|
|
332
|
+
pmRoot,
|
|
333
|
+
resolvedId,
|
|
334
|
+
subject,
|
|
335
|
+
settings,
|
|
336
|
+
typeToFolder: typeRegistry.type_to_folder,
|
|
337
|
+
historyRawBeforeLock,
|
|
338
|
+
currentItemRawBeforeLock
|
|
339
|
+
});
|
|
273
340
|
const itemFormat = "toon";
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
const assigned = resolvedCurrentDocument.metadata.assignee?.trim();
|
|
283
|
-
const ownershipWarnings = [];
|
|
284
|
-
const hasOwnershipConflict = assigned && assigned !== author && !options.force;
|
|
285
|
-
if (hasOwnershipConflict) {
|
|
286
|
-
if (settings.governance.ownership_enforcement === "strict") {
|
|
287
|
-
throw new PmCliError(`Item ${resolvedId} is assigned to ${assigned}. Use --force to override.`, EXIT_CODE.CONFLICT);
|
|
288
|
-
}
|
|
289
|
-
if (settings.governance.ownership_enforcement === "warn") {
|
|
290
|
-
ownershipWarnings.push(`ownership_warning:assignee_conflict:${resolvedId}:${assigned}`);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
341
|
+
const currentState = resolveRestoreCurrentState(loadedItemUnderLock, history);
|
|
342
|
+
const ownershipWarnings = collectRestoreOwnershipWarnings({
|
|
343
|
+
document: currentState.document,
|
|
344
|
+
author,
|
|
345
|
+
force: options.force,
|
|
346
|
+
enforcement: settings.governance.ownership_enforcement,
|
|
347
|
+
resolvedId
|
|
348
|
+
});
|
|
293
349
|
const serializedRestore = serializeItemDocument(restoredDocument, { format: itemFormat, schema: settings.schema });
|
|
294
350
|
const restoredItemPath = getItemPath(pmRoot, restoredDocument.metadata.type, resolvedId, itemFormat, typeRegistry.type_to_folder);
|
|
295
351
|
await writeFileAtomic(restoredItemPath, serializedRestore);
|
|
@@ -300,53 +356,34 @@ async function runRestore(id, target, options, global) {
|
|
|
300
356
|
nowIso: nowIso(),
|
|
301
357
|
author,
|
|
302
358
|
op: "restore",
|
|
303
|
-
before:
|
|
359
|
+
before: currentState.document,
|
|
304
360
|
after: restoredDocument,
|
|
305
361
|
message: options.message
|
|
306
362
|
});
|
|
307
363
|
try {
|
|
308
364
|
await appendHistoryEntry(subject.historyPath, historyEntry);
|
|
309
365
|
} catch (error) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
} else {
|
|
316
|
-
await fs.rm(restoredItemPath, { force: true });
|
|
317
|
-
}
|
|
366
|
+
await restorePreviousItemAfterHistoryFailure({
|
|
367
|
+
existingItemPath,
|
|
368
|
+
resolvedOriginalRaw: currentState.originalRaw,
|
|
369
|
+
restoredItemPath
|
|
370
|
+
});
|
|
318
371
|
throw error;
|
|
319
372
|
}
|
|
320
|
-
const restoreChangedFields = changedFields(
|
|
321
|
-
const hookWarnings =
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
item_type: restoredDocument.metadata.type,
|
|
328
|
-
before: resolvedCurrentDocument,
|
|
329
|
-
after: restoredDocument,
|
|
330
|
-
changed_fields: ["restored"]
|
|
331
|
-
}),
|
|
332
|
-
...await runActiveOnWriteHooks({
|
|
333
|
-
path: subject.historyPath,
|
|
334
|
-
scope: "project",
|
|
335
|
-
op: "restore:history",
|
|
336
|
-
item_id: restoredDocument.metadata.id,
|
|
337
|
-
item_type: restoredDocument.metadata.type,
|
|
338
|
-
before: resolvedCurrentDocument,
|
|
339
|
-
after: restoredDocument,
|
|
340
|
-
changed_fields: ["restored"]
|
|
341
|
-
})
|
|
342
|
-
];
|
|
373
|
+
const restoreChangedFields = changedFields(currentState.document, restoredDocument);
|
|
374
|
+
const hookWarnings = await runRestoreWriteHooks({
|
|
375
|
+
restoredItemPath,
|
|
376
|
+
historyPath: subject.historyPath,
|
|
377
|
+
before: currentState.document,
|
|
378
|
+
after: restoredDocument
|
|
379
|
+
});
|
|
343
380
|
recordAfterCommandAffectedItem({
|
|
344
381
|
id: restoredDocument.metadata.id,
|
|
345
382
|
op: "restore",
|
|
346
383
|
item_type: restoredDocument.metadata.type,
|
|
347
|
-
previous_status:
|
|
384
|
+
previous_status: currentState.document.metadata.status,
|
|
348
385
|
status: restoredDocument.metadata.status,
|
|
349
|
-
previous: projectAfterCommandItemSnapshot(
|
|
386
|
+
previous: projectAfterCommandItemSnapshot(currentState.document.metadata, restoreChangedFields),
|
|
350
387
|
current: projectAfterCommandItemSnapshot(restoredDocument.metadata, restoreChangedFields),
|
|
351
388
|
changed_fields: restoreChangedFields
|
|
352
389
|
});
|
|
@@ -382,6 +419,6 @@ export {
|
|
|
382
419
|
runRestore,
|
|
383
420
|
_testOnlyRestoreCommand
|
|
384
421
|
};
|
|
385
|
-
//# sourceMappingURL=chunk-
|
|
422
|
+
//# sourceMappingURL=chunk-FZJM2TXF.js.map
|
|
386
423
|
|
|
387
|
-
//# debugId=
|
|
424
|
+
//# debugId=6054c314-49cd-5a77-987e-b68fdbbbf981
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/restore.ts"],"sourcesContent":["/**\n * @module cli/commands/restore\n *\n * Implements the pm restore command surface and its agent-facing runtime behavior.\n */\nimport jsonPatch from \"fast-json-patch\";\nimport fs from \"node:fs/promises\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { appendHistoryEntry, createHistoryEntry } from \"../../core/history/history.js\";\nimport {\n EMPTY_REPLAY_DOCUMENT,\n normalizeReplayPatchOps,\n replayHash,\n replayToCanonicalItemDocument,\n replayToItemDocument,\n toReplayDocument,\n type ReplayDocument as CanonicalReplayDocument,\n} from \"../../core/history/replay.js\";\nimport { enforceHistoryStreamPolicyForItem } from \"../../core/history/history-stream-policy.js\";\nimport { normalizeItemId, normalizeRawItemId } from \"../../core/item/id.js\";\nimport { canonicalDocument, serializeItemDocument } from \"../../core/item/item-format.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemDocument, ItemMetadata } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\n\ninterface ResolvedRestoreTarget {\n kind: \"version\" | \"timestamp\";\n raw: string;\n historyIndex: number;\n}\n\ninterface ResolvedRestoreSubject {\n id: string;\n historyPath: string;\n located: Awaited<ReturnType<typeof locateItem>>;\n historyPolicyWarnings: string[];\n}\n\ninterface RestoreCurrentState {\n document: ItemDocument;\n originalRaw: string | null;\n}\n\ninterface PatchFailureContext {\n patchIndex?: number;\n op?: string;\n path?: string;\n from?: string;\n reason?: string;\n}\n\n/**\n * Documents the restore command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface RestoreCommandOptions {\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the restore result payload exchanged by command, SDK, and package integrations.\n */\nexport interface RestoreResult {\n item: ItemMetadata;\n restored_from: {\n kind: \"version\" | \"timestamp\";\n target: string;\n history_index: number;\n entry_ts: string;\n entry_op: string;\n };\n changed_fields: string[];\n warnings: string[];\n}\n\nfunction ensureReplayTarget(target: string, history: HistoryEntry[]): ResolvedRestoreTarget {\n const trimmed = target.trim();\n if (!trimmed) {\n throw new PmCliError(\"Missing restore target. Use a timestamp or version number.\", EXIT_CODE.USAGE);\n }\n\n if (/^\\d+$/.test(trimmed)) {\n const version = Number(trimmed);\n if (!Number.isSafeInteger(version) || version < 1 || version > history.length) {\n throw new PmCliError(\n `Restore version must be between 1 and ${history.length} for this item.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n kind: \"version\",\n raw: trimmed,\n historyIndex: version - 1,\n };\n }\n\n const parsedTarget = Date.parse(trimmed);\n if (!Number.isFinite(parsedTarget)) {\n throw new PmCliError(\n `Invalid restore target \"${target}\". Use a positive version number or ISO timestamp.`,\n EXIT_CODE.USAGE,\n );\n }\n\n let index = -1;\n for (let i = 0; i < history.length; i += 1) {\n const entryTimestamp = Date.parse(history[i].ts);\n if (!Number.isFinite(entryTimestamp)) {\n throw new PmCliError(\n `History for this item contains invalid timestamp at entry ${i + 1}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (entryTimestamp <= parsedTarget) {\n index = i;\n }\n }\n\n if (index < 0) {\n throw new PmCliError(`No history entries exist at or before timestamp ${trimmed}.`, EXIT_CODE.USAGE);\n }\n\n return {\n kind: \"timestamp\",\n raw: trimmed,\n historyIndex: index,\n };\n}\n\nfunction extractPatchFailureContext(\n patch: HistoryPatchOp[],\n error: unknown,\n): PatchFailureContext {\n const context: PatchFailureContext = {};\n if (error instanceof Error && error.message.trim().length > 0) {\n context.reason = error.message.trim();\n }\n if (typeof error !== \"object\" || error === null) {\n return context;\n }\n const candidate = error as {\n index?: unknown;\n operation?: unknown;\n };\n /* c8 ignore start -- parser-generated patch errors may omit index metadata in current fixtures. */\n if (typeof candidate.index === \"number\" && Number.isInteger(candidate.index) && candidate.index >= 0) {\n context.patchIndex = candidate.index;\n }\n /* c8 ignore stop */\n /* c8 ignore start -- operation payload metadata is optional in upstream json-patch failures. */\n const operationRecord =\n typeof candidate.operation === \"object\" && candidate.operation !== null\n ? (candidate.operation as { op?: unknown; path?: unknown; from?: unknown })\n : null;\n /* c8 ignore stop */\n enrichPatchFailureContext(context, operationRecord, patch);\n return context;\n}\n\nfunction enrichPatchFailureContext(\n context: PatchFailureContext,\n operationRecord: { op?: unknown; path?: unknown; from?: unknown } | null,\n patch: HistoryPatchOp[],\n): void {\n /* v8 ignore start -- operation replay records always carry a string op when present; this preserves context for malformed future rows */\n if (operationRecord && typeof operationRecord.op === \"string\") {\n context.op = operationRecord.op;\n }\n /* v8 ignore stop */\n if (operationRecord && typeof operationRecord.path === \"string\") {\n context.path = operationRecord.path;\n }\n if (operationRecord && typeof operationRecord.from === \"string\") {\n context.from = operationRecord.from;\n }\n if ((context.op === undefined || context.path === undefined) && context.patchIndex !== undefined) {\n const fallback = patch[context.patchIndex];\n /* c8 ignore start -- fallback enrichment paths are only exercised by malformed patch telemetry payloads. */\n if (fallback) {\n context.op = context.op ?? fallback.op;\n context.path = context.path ?? fallback.path;\n context.from = context.from ?? fallback.from;\n }\n /* c8 ignore stop */\n }\n}\n\nfunction applyHistoryPatch(\n current: CanonicalReplayDocument,\n patch: HistoryPatchOp[],\n entryNumber: number,\n entryOp: string,\n): CanonicalReplayDocument {\n try {\n const normalizedPatch = normalizeReplayPatchOps(patch);\n const applied = jsonPatch.applyPatch(\n structuredClone(current),\n normalizedPatch as jsonPatch.Operation[],\n true,\n false,\n ).newDocument as unknown;\n if (\n typeof applied !== \"object\" ||\n applied === null ||\n !(\"metadata\" in applied) ||\n !(\"body\" in applied) ||\n typeof (applied as { body: unknown }).body !== \"string\" ||\n typeof (applied as { metadata: unknown }).metadata !== \"object\" ||\n (applied as { metadata: unknown }).metadata === null\n ) {\n throw new PmCliError(\n `History replay produced an invalid document shape at entry ${entryNumber}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const replay = applied as { metadata: Record<string, unknown>; body: string };\n return {\n metadata: replay.metadata,\n body: replay.body,\n };\n } catch (error: unknown) {\n if (error instanceof PmCliError) {\n throw error;\n }\n const failureContext = extractPatchFailureContext(patch, error);\n const contextTokens = [\n `history_op=${entryOp}`,\n /* c8 ignore next -- contextual fields are best-effort and may be absent depending on patch failure shape. */\n failureContext.patchIndex !== undefined ? `patch_index=${failureContext.patchIndex}` : null,\n /* c8 ignore next -- contextual fields are best-effort and may be absent depending on patch failure shape. */\n failureContext.op ? `op=${failureContext.op}` : null,\n /* c8 ignore next -- contextual fields are best-effort and may be absent depending on patch failure shape. */\n failureContext.path ? `path=${failureContext.path}` : null,\n /* c8 ignore next -- contextual fields are best-effort and may be absent depending on patch failure shape. */\n failureContext.from ? `from=${failureContext.from}` : null,\n ].filter((token): token is string => token !== null);\n /* c8 ignore start -- jsonPatch/structuredClone/normalizeReplayPatchOps always throw Error instances with non-empty messages here, so extractPatchFailureContext always sets reason; the empty-suffix fallback is unreachable through applyHistoryPatch. */\n const reasonSuffix = failureContext.reason ? ` ${failureContext.reason}` : \"\";\n /* c8 ignore stop */\n throw new PmCliError(\n `Failed to apply history patch at entry ${entryNumber} (${contextTokens.join(\", \")}).${reasonSuffix}`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n}\n\nfunction replayToTarget(history: HistoryEntry[], targetIndex: number): CanonicalReplayDocument {\n let document: CanonicalReplayDocument = structuredClone(EMPTY_REPLAY_DOCUMENT);\n\n for (let i = 0; i <= targetIndex; i += 1) {\n const entry = history[i];\n const beforeHash = replayHash(document);\n if (beforeHash !== entry.before_hash) {\n throw new PmCliError(\n `History hash mismatch before replay at entry ${i + 1}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n\n document = applyHistoryPatch(document, entry.patch, i + 1, entry.op);\n\n const afterHash = replayHash(document);\n if (afterHash !== entry.after_hash) {\n throw new PmCliError(\n `History hash mismatch after replay at entry ${i + 1}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n }\n\n return document;\n}\n\nfunction ensureMaterializedRestoreTarget(\n replayDocument: CanonicalReplayDocument,\n target: ResolvedRestoreTarget,\n): CanonicalReplayDocument {\n if (Object.keys(replayDocument.metadata).length > 0) {\n return replayDocument;\n }\n throw new PmCliError(\n `Restore target ${target.raw} resolves to a deleted state; choose a version or timestamp where the item exists.`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction replayCurrentDocument(history: HistoryEntry[]): ItemDocument {\n const currentReplay = replayToTarget(history, history.length - 1);\n if (Object.keys(currentReplay.metadata).length === 0) {\n return {\n metadata: {} as ItemMetadata,\n body: currentReplay.body,\n };\n }\n return canonicalDocument(replayToItemDocument(currentReplay));\n}\n\nasync function resolveRestoreSubject(\n pmRoot: string,\n id: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n typeToFolder: Record<string, string>,\n): Promise<ResolvedRestoreSubject> {\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeToFolder);\n if (located) {\n const historyPath = getHistoryPath(pmRoot, located.id);\n const historyPolicy = await enforceHistoryStreamPolicyForItem({\n pmRoot,\n settings,\n itemId: located.id,\n commandLabel: \"restore\",\n });\n return {\n id: located.id,\n historyPath,\n located,\n historyPolicyWarnings: historyPolicy.warnings,\n };\n }\n\n const normalizedId = normalizeItemId(id, settings.id_prefix);\n const rawNormalizedId = normalizeRawItemId(id);\n /* c8 ignore start -- raw-id fallback is covered by normalize-item-id utility tests. */\n const candidateIds = normalizedId === rawNormalizedId ? [normalizedId] : [normalizedId, rawNormalizedId];\n /* c8 ignore stop */\n for (const candidateId of candidateIds) {\n const historyPath = getHistoryPath(pmRoot, candidateId);\n if (await pathExists(historyPath)) {\n return {\n id: candidateId,\n historyPath,\n located: null,\n historyPolicyWarnings: [],\n };\n }\n }\n\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n}\n\nfunction changedFields(beforeDocument: ItemDocument, afterDocument: ItemDocument): string[] {\n const beforeReplay = toReplayDocument(beforeDocument);\n const afterReplay = toReplayDocument(afterDocument);\n const patch = jsonPatch.compare(beforeReplay, afterReplay) as HistoryPatchOp[];\n const fields = new Set<string>();\n\n for (const op of patch) {\n if (op.path === \"/body\" || op.path.startsWith(\"/body/\")) {\n fields.add(\"body\");\n continue;\n }\n const segment = op.path.replace(/^\\/(?:metadata|front_matter)\\/?/, \"\").split(\"/\")[0];\n fields.add(segment.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\"));\n }\n\n return Array.from(fields).sort((a, b) => a.localeCompare(b));\n}\n\nasync function loadRestoreStateUnderLock(params: {\n pmRoot: string;\n resolvedId: string;\n subject: ResolvedRestoreSubject;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeToFolder: Record<string, string>;\n historyRawBeforeLock: string | null;\n currentItemRawBeforeLock: string | null;\n}): Promise<{ loadedItemUnderLock: Awaited<ReturnType<typeof readLocatedItem>> | null; existingItemPath: string | null }> {\n const historyRawUnderLock = await readFileIfExists(params.subject.historyPath);\n if (historyRawUnderLock !== params.historyRawBeforeLock) {\n throw new PmCliError(`History for ${params.resolvedId} changed while waiting for lock; retry restore.`, EXIT_CODE.CONFLICT);\n }\n const locatedUnderLock = await locateItem(\n params.pmRoot,\n params.resolvedId,\n params.settings.id_prefix,\n params.settings.item_format,\n params.typeToFolder,\n );\n const loadedItemUnderLock = locatedUnderLock ? await readLocatedItem(locatedUnderLock, { schema: params.settings.schema }) : null;\n if ((loadedItemUnderLock?.raw ?? null) !== params.currentItemRawBeforeLock) {\n throw new PmCliError(`Item ${params.resolvedId} changed while waiting for lock; retry restore.`, EXIT_CODE.CONFLICT);\n }\n return { loadedItemUnderLock, existingItemPath: locatedUnderLock?.itemPath ?? null };\n}\n\nfunction resolveRestoreCurrentState(\n loadedItemUnderLock: Awaited<ReturnType<typeof readLocatedItem>> | null,\n history: HistoryEntry[],\n): RestoreCurrentState {\n if (loadedItemUnderLock) {\n return { document: loadedItemUnderLock.document, originalRaw: loadedItemUnderLock.raw };\n }\n return { document: replayCurrentDocument(history), originalRaw: null };\n}\n\nfunction collectRestoreOwnershipWarnings(params: {\n document: ItemDocument;\n author: string;\n force: boolean | undefined;\n enforcement: \"strict\" | \"warn\" | \"none\";\n resolvedId: string;\n}): string[] {\n const assigned = params.document.metadata.assignee?.trim();\n const hasOwnershipConflict = assigned && assigned !== params.author && !params.force;\n if (!hasOwnershipConflict) {\n return [];\n }\n if (params.enforcement === \"strict\") {\n throw new PmCliError(`Item ${params.resolvedId} is assigned to ${assigned}. Use --force to override.`, EXIT_CODE.CONFLICT);\n }\n return params.enforcement === \"warn\" ? [`ownership_warning:assignee_conflict:${params.resolvedId}:${assigned}`] : [];\n}\n\nasync function restorePreviousItemAfterHistoryFailure(params: {\n existingItemPath: string | null;\n resolvedOriginalRaw: string | null;\n restoredItemPath: string;\n}): Promise<void> {\n if (params.existingItemPath && params.resolvedOriginalRaw !== null && params.restoredItemPath !== params.existingItemPath) {\n await writeFileAtomic(params.existingItemPath, params.resolvedOriginalRaw);\n await fs.rm(params.restoredItemPath, { force: true });\n return;\n }\n if (params.existingItemPath && params.resolvedOriginalRaw !== null) {\n await writeFileAtomic(params.existingItemPath, params.resolvedOriginalRaw);\n return;\n }\n await fs.rm(params.restoredItemPath, { force: true });\n}\n\nasync function runRestoreWriteHooks(params: {\n restoredItemPath: string;\n historyPath: string;\n before: ItemDocument;\n after: ItemDocument;\n}): Promise<string[]> {\n return [\n ...(await runActiveOnWriteHooks({\n path: params.restoredItemPath,\n scope: \"project\",\n op: \"restore\",\n item_id: params.after.metadata.id,\n item_type: params.after.metadata.type,\n before: params.before,\n after: params.after,\n changed_fields: [\"restored\"],\n })),\n ...(await runActiveOnWriteHooks({\n path: params.historyPath,\n scope: \"project\",\n op: \"restore:history\",\n item_id: params.after.metadata.id,\n item_type: params.after.metadata.type,\n before: params.before,\n after: params.after,\n changed_fields: [\"restored\"],\n })),\n ];\n}\n\n/**\n * Implements run restore for the public runtime surface of this module.\n */\nexport async function runRestore(\n id: string,\n target: string,\n options: RestoreCommandOptions,\n global: GlobalOptions,\n): Promise<RestoreResult> {\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 resolveRestoreSubject(pmRoot, id, settings, typeRegistry.type_to_folder);\n const resolvedId = subject.id;\n const historyRawBeforeLock = await readFileIfExists(subject.historyPath);\n const history = await readHistoryEntries(subject.historyPath, resolvedId);\n if (history.length === 0) {\n throw new PmCliError(`No history exists for ${resolvedId}; restore is unavailable.`, EXIT_CODE.NOT_FOUND);\n }\n\n const resolvedTarget = ensureReplayTarget(target, history);\n const replayDocument = ensureMaterializedRestoreTarget(replayToTarget(history, resolvedTarget.historyIndex), resolvedTarget);\n const restoredDocument = replayToCanonicalItemDocument(replayDocument, { schema: settings.schema });\n\n if (restoredDocument.metadata.id !== resolvedId) {\n throw new PmCliError(\n `Restore target resolved to item ${restoredDocument.metadata.id}, expected ${resolvedId}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const loadedItemBeforeLock = subject.located ? await readLocatedItem(subject.located, { schema: settings.schema }) : null;\n const currentItemRawBeforeLock = loadedItemBeforeLock?.raw ?? null;\n\n const author = resolveAuthor(options.author, settings.author_default);\n const releaseLock = await acquireLock(\n pmRoot,\n resolvedId,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n settings.governance.force_required_for_stale_lock,\n );\n\n try {\n const { loadedItemUnderLock, existingItemPath } = await loadRestoreStateUnderLock({\n pmRoot,\n resolvedId,\n subject,\n settings,\n typeToFolder: typeRegistry.type_to_folder,\n historyRawBeforeLock,\n currentItemRawBeforeLock,\n });\n const itemFormat = \"toon\";\n const currentState = resolveRestoreCurrentState(loadedItemUnderLock, history);\n const ownershipWarnings = collectRestoreOwnershipWarnings({\n document: currentState.document,\n author,\n force: options.force,\n enforcement: settings.governance.ownership_enforcement,\n resolvedId,\n });\n\n const serializedRestore = serializeItemDocument(restoredDocument, { format: itemFormat, schema: settings.schema });\n /* c8 ignore next -- restored item path typing is exercised in restore integration workflows. */\n const restoredItemPath = getItemPath(\n pmRoot,\n restoredDocument.metadata.type,\n resolvedId,\n itemFormat,\n typeRegistry.type_to_folder,\n );\n await writeFileAtomic(restoredItemPath, serializedRestore);\n if (existingItemPath && restoredItemPath !== existingItemPath) {\n await fs.rm(existingItemPath);\n }\n\n const historyEntry = createHistoryEntry({\n nowIso: nowIso(),\n author,\n op: \"restore\",\n before: currentState.document,\n after: restoredDocument,\n message: options.message,\n });\n\n try {\n await appendHistoryEntry(subject.historyPath, historyEntry);\n } catch (error: unknown) {\n await restorePreviousItemAfterHistoryFailure({\n existingItemPath,\n resolvedOriginalRaw: currentState.originalRaw,\n restoredItemPath,\n });\n throw error;\n }\n const restoreChangedFields = changedFields(currentState.document, restoredDocument);\n const hookWarnings = await runRestoreWriteHooks({\n restoredItemPath,\n historyPath: subject.historyPath,\n before: currentState.document,\n after: restoredDocument,\n });\n recordAfterCommandAffectedItem({\n id: restoredDocument.metadata.id,\n op: \"restore\",\n item_type: restoredDocument.metadata.type,\n previous_status: currentState.document.metadata.status,\n status: restoredDocument.metadata.status,\n previous: projectAfterCommandItemSnapshot(currentState.document.metadata, restoreChangedFields),\n current: projectAfterCommandItemSnapshot(restoredDocument.metadata, restoreChangedFields),\n changed_fields: restoreChangedFields,\n });\n\n const targetEntry = history[resolvedTarget.historyIndex];\n return {\n item: restoredDocument.metadata,\n restored_from: {\n kind: resolvedTarget.kind,\n target: resolvedTarget.raw,\n history_index: resolvedTarget.historyIndex + 1,\n entry_ts: targetEntry.ts,\n entry_op: targetEntry.op,\n },\n changed_fields: restoreChangedFields,\n warnings: [...subject.historyPolicyWarnings, ...ownershipWarnings, ...hookWarnings],\n };\n } finally {\n await releaseLock();\n }\n}\n\nexport const _testOnlyRestoreCommand = {\n applyHistoryPatch,\n changedFields,\n ensureMaterializedRestoreTarget,\n ensureReplayTarget,\n extractPatchFailureContext,\n replayCurrentDocument,\n replayToTarget,\n resolveRestoreSubject,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,eAAe;AACtB,OAAO,QAAQ;AAqFf,SAAS,mBAAmB,QAAgB,SAAuB;AACjE,QAAM,UAAU,OAAO,KAAI;AAC3B,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,WAAW,8DAA8D,UAAU,KAAK;EACpG;AAEA,MAAI,QAAQ,KAAK,OAAO,GAAG;AACzB,UAAM,UAAU,OAAO,OAAO;AAC9B,QAAI,CAAC,OAAO,cAAc,OAAO,KAAK,UAAU,KAAK,UAAU,QAAQ,QAAQ;AAC7E,YAAM,IAAI,WACR,yCAAyC,QAAQ,MAAM,mBACvD,UAAU,KAAK;IAEnB;AACA,WAAO;MACL,MAAM;MACN,KAAK;MACL,cAAc,UAAU;;EAE5B;AAEA,QAAM,eAAe,KAAK,MAAM,OAAO;AACvC,MAAI,CAAC,OAAO,SAAS,YAAY,GAAG;AAClC,UAAM,IAAI,WACR,2BAA2B,MAAM,sDACjC,UAAU,KAAK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;AAClF,UAAM,eAAe,MAAM,qBAAqB;MAC9C;MACA,aAAa,QAAQ;MACrB,QAAQ,aAAa;MACrB,OAAO;KACR;AACD,mCAA+B;MAC7B,IAAI,iBAAiB,SAAS;MAC9B,IAAI;MACJ,WAAW,iBAAiB,SAAS;MACrC,iBAAiB,aAAa,SAAS,SAAS;MAChD,QAAQ,iBAAiB,SAAS;MAClC,UAAU,gCAAgC,aAAa,SAAS,UAAU,oBAAoB;MAC9F,SAAS,gCAAgC,iBAAiB,UAAU,oBAAoB;MACxF,gBAAgB;KACjB;AAED,UAAM,cAAc,QAAQ,eAAe,YAAY;AACvD,WAAO;MACL,MAAM,iBAAiB;MACvB,eAAe;QACb,MAAM,eAAe;QACrB,QAAQ,eAAe;QACvB,eAAe,eAAe,eAAe;QAC7C,UAAU,YAAY;QACtB,UAAU,YAAY;;MAExB,gBAAgB;MAChB,UAAU,CAAC,GAAG,QAAQ,uBAAuB,GAAG,mBAAmB,GAAG,YAAY;;EAEtF;AACE,UAAM,YAAW;EACnB;AACF;AAEO,IAAM,0BAA0B;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA","debugId":"6054c314-49cd-5a77-987e-b68fdbbbf981"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
nowIso
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AJHYQCBJ.js";
|
|
4
4
|
import {
|
|
5
5
|
EXIT_CODE,
|
|
6
6
|
PmCliError,
|
|
7
7
|
pathExists,
|
|
8
8
|
toErrorMessage,
|
|
9
9
|
writeFileAtomic
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KHVGM5CS.js";
|
|
11
11
|
|
|
12
12
|
// dist/core/checkpoint/mutation-checkpoint.js
|
|
13
13
|
import { mkdir, readFile } from "node:fs/promises";
|
|
@@ -128,4 +128,4 @@ export {
|
|
|
128
128
|
loadMutationCheckpoint,
|
|
129
129
|
restoreCheckpointItems
|
|
130
130
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-GUYNUXQT.js.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
BUILTIN_ITEM_TYPE_VALUES,
|
|
5
5
|
toDefaultFolder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-L4SLHV6G.js";
|
|
7
7
|
|
|
8
8
|
// dist/core/schema/item-types-file.js
|
|
9
9
|
var BUILTIN_NAME_LOOKUP = new Map(BUILTIN_ITEM_TYPE_VALUES.map((name) => [name.toLowerCase(), name]));
|
|
@@ -255,6 +255,6 @@ export {
|
|
|
255
255
|
buildInvalidTypeHint,
|
|
256
256
|
buildInvalidTypeError
|
|
257
257
|
};
|
|
258
|
-
//# sourceMappingURL=chunk-
|
|
258
|
+
//# sourceMappingURL=chunk-GVJE5T7Q.js.map
|
|
259
259
|
|
|
260
260
|
//# debugId=1b7c28c0-5af8-526d-a895-fe83ffb2841e
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
printError,
|
|
3
3
|
writeStdout
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EQURFOMH.js";
|
|
5
5
|
import {
|
|
6
6
|
refreshSearchArtifactsForMutation,
|
|
7
7
|
shouldRunSearchRefreshInForeground
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XRYSCRZR.js";
|
|
9
9
|
import {
|
|
10
10
|
ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,
|
|
11
11
|
CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
readFirstStringFromCommanderOptions,
|
|
20
20
|
readFirstValueFromCommanderOptions,
|
|
21
21
|
readStringArrayFromCommanderOptions
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-RAHINBVP.js";
|
|
23
23
|
import {
|
|
24
24
|
EXIT_CODE,
|
|
25
25
|
PmCliError,
|
|
@@ -28,13 +28,13 @@ import {
|
|
|
28
28
|
readSettings,
|
|
29
29
|
resolvePmRoot,
|
|
30
30
|
setActiveCommandResult
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KHVGM5CS.js";
|
|
32
32
|
|
|
33
33
|
// dist/cli/registration-helpers.js
|
|
34
34
|
!(function() {
|
|
35
35
|
try {
|
|
36
36
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
37
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
37
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5b561d4c-ab75-5ec8-97de-5f2d32370a4d");
|
|
38
38
|
} catch (e2) {
|
|
39
39
|
}
|
|
40
40
|
})();
|
|
@@ -134,6 +134,9 @@ function optionTrue(options, key) {
|
|
|
134
134
|
function optionFalse(options, key) {
|
|
135
135
|
return options[key] === false ? true : void 0;
|
|
136
136
|
}
|
|
137
|
+
function readOptionString(options, key) {
|
|
138
|
+
return typeof options[key] === "string" ? options[key] : void 0;
|
|
139
|
+
}
|
|
137
140
|
function anyOptionTrue(options, keys) {
|
|
138
141
|
return keys.some((key) => options[key] === true) ? true : void 0;
|
|
139
142
|
}
|
|
@@ -438,6 +441,33 @@ function readListOptionString(options, target) {
|
|
|
438
441
|
}
|
|
439
442
|
return void 0;
|
|
440
443
|
}
|
|
444
|
+
function readSelectionFilterOptionFields(options) {
|
|
445
|
+
return {
|
|
446
|
+
filterReviewerMissing: optionTrue(options, "filterReviewerMissing"),
|
|
447
|
+
filterRiskMissing: optionTrue(options, "filterRiskMissing"),
|
|
448
|
+
filterConfidenceMissing: optionTrue(options, "filterConfidenceMissing"),
|
|
449
|
+
filterSprintMissing: optionTrue(options, "filterSprintMissing"),
|
|
450
|
+
filterReleaseMissing: optionTrue(options, "filterReleaseMissing"),
|
|
451
|
+
hasNotes: optionTrue(options, "hasNotes"),
|
|
452
|
+
hasLearnings: optionTrue(options, "hasLearnings"),
|
|
453
|
+
hasFiles: optionTrue(options, "hasFiles"),
|
|
454
|
+
hasDocs: optionTrue(options, "hasDocs"),
|
|
455
|
+
hasTests: optionTrue(options, "hasTests"),
|
|
456
|
+
hasComments: optionTrue(options, "hasComments"),
|
|
457
|
+
hasDeps: optionTrue(options, "hasDeps"),
|
|
458
|
+
hasBody: optionTrue(options, "hasBody"),
|
|
459
|
+
hasLinkedCommand: optionTrue(options, "hasLinkedCommand"),
|
|
460
|
+
noNotes: optionFalse(options, "notes"),
|
|
461
|
+
noLearnings: optionFalse(options, "learnings"),
|
|
462
|
+
noFiles: optionFalse(options, "files"),
|
|
463
|
+
noDocs: optionFalse(options, "docs"),
|
|
464
|
+
noTests: optionFalse(options, "tests"),
|
|
465
|
+
noComments: optionFalse(options, "comments"),
|
|
466
|
+
noDeps: optionFalse(options, "deps"),
|
|
467
|
+
emptyBody: optionTrue(options, "emptyBody"),
|
|
468
|
+
noLinkedCommand: optionFalse(options, "linkedCommand")
|
|
469
|
+
};
|
|
470
|
+
}
|
|
441
471
|
function normalizeListOptions(options) {
|
|
442
472
|
const normalized = {
|
|
443
473
|
status: readListOptionString(options, "status"),
|
|
@@ -473,33 +503,8 @@ function normalizeListOptions(options) {
|
|
|
473
503
|
filterEstimatesMissing: anyOptionTrue(options, ["filterEstimatesMissing", "filterEstimateMissing"]),
|
|
474
504
|
filterResolutionMissing: optionTrue(options, "filterResolutionMissing"),
|
|
475
505
|
filterMetadataMissing: optionTrue(options, "filterMetadataMissing"),
|
|
476
|
-
// Governance-missing
|
|
477
|
-
|
|
478
|
-
filterRiskMissing: optionTrue(options, "filterRiskMissing"),
|
|
479
|
-
filterConfidenceMissing: optionTrue(options, "filterConfidenceMissing"),
|
|
480
|
-
filterSprintMissing: optionTrue(options, "filterSprintMissing"),
|
|
481
|
-
filterReleaseMissing: optionTrue(options, "filterReleaseMissing"),
|
|
482
|
-
// Content-field presence/absence selection filters (GH-242). Presence flags
|
|
483
|
-
// are plain booleans; absence uses commander negation (`--no-notes` stores
|
|
484
|
-
// notes=false) except --empty-body which is its own dest.
|
|
485
|
-
hasNotes: optionTrue(options, "hasNotes"),
|
|
486
|
-
hasLearnings: optionTrue(options, "hasLearnings"),
|
|
487
|
-
hasFiles: optionTrue(options, "hasFiles"),
|
|
488
|
-
hasDocs: optionTrue(options, "hasDocs"),
|
|
489
|
-
hasTests: optionTrue(options, "hasTests"),
|
|
490
|
-
hasComments: optionTrue(options, "hasComments"),
|
|
491
|
-
hasDeps: optionTrue(options, "hasDeps"),
|
|
492
|
-
hasBody: optionTrue(options, "hasBody"),
|
|
493
|
-
hasLinkedCommand: optionTrue(options, "hasLinkedCommand"),
|
|
494
|
-
noNotes: optionFalse(options, "notes"),
|
|
495
|
-
noLearnings: optionFalse(options, "learnings"),
|
|
496
|
-
noFiles: optionFalse(options, "files"),
|
|
497
|
-
noDocs: optionFalse(options, "docs"),
|
|
498
|
-
noTests: optionFalse(options, "tests"),
|
|
499
|
-
noComments: optionFalse(options, "comments"),
|
|
500
|
-
noDeps: optionFalse(options, "deps"),
|
|
501
|
-
emptyBody: optionTrue(options, "emptyBody"),
|
|
502
|
-
noLinkedCommand: optionFalse(options, "linkedCommand")
|
|
506
|
+
// Governance-missing (GH-236) + content presence/absence (GH-242) filters.
|
|
507
|
+
...readSelectionFilterOptionFields(options)
|
|
503
508
|
};
|
|
504
509
|
copyUnknownOptions(normalized, options);
|
|
505
510
|
return normalized;
|
|
@@ -631,33 +636,9 @@ function normalizeSearchOptions(options) {
|
|
|
631
636
|
fields,
|
|
632
637
|
compact: compactRequested || defaultCompact ? true : void 0,
|
|
633
638
|
full: optionTrue(options, "full"),
|
|
634
|
-
// Governance-missing
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
filterConfidenceMissing: optionTrue(options, "filterConfidenceMissing"),
|
|
638
|
-
filterSprintMissing: optionTrue(options, "filterSprintMissing"),
|
|
639
|
-
filterReleaseMissing: optionTrue(options, "filterReleaseMissing"),
|
|
640
|
-
// Content-field presence/absence selection filters (GH-242). Mirror
|
|
641
|
-
// normalizeListOptions: presence flags are booleans; absence uses commander
|
|
642
|
-
// negation (notes=false) except --empty-body which is its own dest.
|
|
643
|
-
hasNotes: optionTrue(options, "hasNotes"),
|
|
644
|
-
hasLearnings: optionTrue(options, "hasLearnings"),
|
|
645
|
-
hasFiles: optionTrue(options, "hasFiles"),
|
|
646
|
-
hasDocs: optionTrue(options, "hasDocs"),
|
|
647
|
-
hasTests: optionTrue(options, "hasTests"),
|
|
648
|
-
hasComments: optionTrue(options, "hasComments"),
|
|
649
|
-
hasDeps: optionTrue(options, "hasDeps"),
|
|
650
|
-
hasBody: optionTrue(options, "hasBody"),
|
|
651
|
-
hasLinkedCommand: optionTrue(options, "hasLinkedCommand"),
|
|
652
|
-
noNotes: optionFalse(options, "notes"),
|
|
653
|
-
noLearnings: optionFalse(options, "learnings"),
|
|
654
|
-
noFiles: optionFalse(options, "files"),
|
|
655
|
-
noDocs: optionFalse(options, "docs"),
|
|
656
|
-
noTests: optionFalse(options, "tests"),
|
|
657
|
-
noComments: optionFalse(options, "comments"),
|
|
658
|
-
noDeps: optionFalse(options, "deps"),
|
|
659
|
-
emptyBody: optionTrue(options, "emptyBody"),
|
|
660
|
-
noLinkedCommand: optionFalse(options, "linkedCommand")
|
|
639
|
+
// Governance-missing (GH-236) + content presence/absence (GH-242) filters,
|
|
640
|
+
// mirroring normalizeListOptions via the shared field slice.
|
|
641
|
+
...readSelectionFilterOptionFields(options)
|
|
661
642
|
};
|
|
662
643
|
copyUnknownOptions(normalized, options);
|
|
663
644
|
return normalized;
|
|
@@ -813,6 +794,7 @@ export {
|
|
|
813
794
|
getCommandPath,
|
|
814
795
|
applyDefaultOutputFormat,
|
|
815
796
|
collect,
|
|
797
|
+
readOptionString,
|
|
816
798
|
buildBackgroundTestCommandArgs,
|
|
817
799
|
buildBackgroundTestAllCommandArgs,
|
|
818
800
|
formatHookWarnings,
|
|
@@ -831,4 +813,4 @@ export {
|
|
|
831
813
|
normalizeNextOptions,
|
|
832
814
|
invalidateSearchCachesForMutation
|
|
833
815
|
};
|
|
834
|
-
//# sourceMappingURL=chunk-
|
|
816
|
+
//# sourceMappingURL=chunk-HB4FAT3O.js.map
|