@unbrained/pm-cli 2026.7.4 → 2026.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +1 -5
- package/dist/cli/commands/calendar.d.ts +3 -2
- package/dist/cli/commands/calendar.js +4 -4
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.js +17 -3
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +34 -16
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/copy.js +3 -3
- package/dist/cli/commands/copy.js.map +1 -1
- package/dist/cli/commands/create.d.ts +7 -0
- package/dist/cli/commands/create.js +156 -110
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +6 -0
- package/dist/cli/commands/extension/bundled-catalog.js +15 -2
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/describe.d.ts +6 -3
- package/dist/cli/commands/extension/describe.js +21 -9
- package/dist/cli/commands/extension/describe.js.map +1 -1
- package/dist/cli/commands/extension/doctor.d.ts +0 -4
- package/dist/cli/commands/extension/doctor.js +3 -3
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +7 -2
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension/shared.d.ts +2 -7
- package/dist/cli/commands/extension/shared.js +4 -10
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/extension.js +33 -8
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/profile.js +3 -3
- 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/restore.js +3 -3
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.js +10 -10
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/update.js +5 -3
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/error-guidance.js +107 -7
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/main.d.ts +6 -2
- package/dist/cli/main.js +33 -12
- package/dist/cli/main.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +18 -0
- package/dist/cli-bundle/chunks/{activity-OENQCYZD.js → activity-YKAKZTZ4.js} +11 -9
- package/dist/cli-bundle/chunks/{aggregate-EC4LWS3U.js → aggregate-EQX2RGB7.js} +16 -13
- package/dist/cli-bundle/chunks/{aggregate-EC4LWS3U.js.map → aggregate-EQX2RGB7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{aggregate-RCB3QJJE.js → aggregate-PEGZGJXD.js} +18 -15
- package/dist/cli-bundle/chunks/{aggregate-RCB3QJJE.js.map → aggregate-PEGZGJXD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-XLEKVVWB.js → append-CZGUZ45Q.js} +11 -8
- package/dist/cli-bundle/chunks/{append-XLEKVVWB.js.map → append-CZGUZ45Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-ADBOI3A6.js → append-NSQBCXZJ.js} +13 -10
- package/dist/cli-bundle/chunks/{append-ADBOI3A6.js.map → append-NSQBCXZJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-3JZNEQBA.js +1413 -0
- package/dist/cli-bundle/chunks/chunk-3JZNEQBA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2LRMWMZ6.js → chunk-3PL6LEKP.js} +16 -14
- package/dist/cli-bundle/chunks/{chunk-2LRMWMZ6.js.map → chunk-3PL6LEKP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CN4OAA2G.js → chunk-3U3VEWK6.js} +277 -119
- package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EB4BBEZD.js → chunk-3Y4OESPP.js} +14 -12
- package/dist/cli-bundle/chunks/{chunk-EB4BBEZD.js.map → chunk-3Y4OESPP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NHDR3UCW.js → chunk-4LRVSBO6.js} +14 -12
- package/dist/cli-bundle/chunks/{chunk-NHDR3UCW.js.map → chunk-4LRVSBO6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6YB7HG2J.js → chunk-4OFLJHX6.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-6YB7HG2J.js.map → chunk-4OFLJHX6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SBNT6SLO.js → chunk-4QQ6PM7M.js} +45 -557
- package/dist/cli-bundle/chunks/chunk-4QQ6PM7M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-M34MVAOP.js → chunk-53BTLLAF.js} +16 -200
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UYLA5ROU.js → chunk-57C2RLW5.js} +277 -112
- package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-R7EMP4JG.js → chunk-5B3X4Y22.js} +52 -63
- package/dist/cli-bundle/chunks/{chunk-R7EMP4JG.js.map → chunk-5B3X4Y22.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XBIYI23P.js → chunk-5J2XPTAD.js} +10 -8
- package/dist/cli-bundle/chunks/{chunk-XBIYI23P.js.map → chunk-5J2XPTAD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4SHME4VR.js → chunk-5JE6SMYS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4KPQQ42D.js → chunk-5JZ7APJU.js} +18 -16
- package/dist/cli-bundle/chunks/{chunk-4KPQQ42D.js.map → chunk-5JZ7APJU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-BDDYM4LH.js → chunk-5VVUKE3U.js} +424 -2228
- package/dist/cli-bundle/chunks/chunk-5VVUKE3U.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QFXFKYNQ.js → chunk-75U6M5ZD.js} +16 -14
- package/dist/cli-bundle/chunks/{chunk-QFXFKYNQ.js.map → chunk-75U6M5ZD.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +23 -0
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-A222YWOQ.js → chunk-7EQNAZX2.js} +14 -12
- package/dist/cli-bundle/chunks/{chunk-A222YWOQ.js.map → chunk-7EQNAZX2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-Z4DGFQDH.js → chunk-7LQKVMPA.js} +14 -4
- package/dist/cli-bundle/chunks/chunk-7LQKVMPA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EH23N5FX.js → chunk-7MDXZAZS.js} +29 -7
- package/dist/cli-bundle/chunks/chunk-7MDXZAZS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XQCWTSLO.js → chunk-7QH7DHUB.js} +74 -8
- package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3C5T3ZEO.js → chunk-7WYXBPYQ.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-3C5T3ZEO.js.map → chunk-7WYXBPYQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-AAEQMOC6.js +150 -0
- package/dist/cli-bundle/chunks/chunk-AAEQMOC6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CQISNF3Z.js → chunk-ABRA3BHY.js} +18 -16
- package/dist/cli-bundle/chunks/{chunk-CQISNF3Z.js.map → chunk-ABRA3BHY.js.map} +2 -2
- package/dist/cli-bundle/chunks/chunk-B5KXLBSJ.js +47 -0
- package/dist/cli-bundle/chunks/chunk-B5KXLBSJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Y2VSCQ77.js → chunk-BFVHCAOO.js} +9 -7
- package/dist/cli-bundle/chunks/{chunk-Y2VSCQ77.js.map → chunk-BFVHCAOO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7ITQSEBL.js → chunk-BVEUCSH2.js} +6 -4
- package/dist/cli-bundle/chunks/{chunk-7ITQSEBL.js.map → chunk-BVEUCSH2.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-C3PMDWGX.js +160 -0
- package/dist/cli-bundle/chunks/chunk-C3PMDWGX.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HL742IBM.js → chunk-D3UCE7RW.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-HL742IBM.js.map → chunk-D3UCE7RW.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +275 -0
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-DLQ4ZTCU.js +634 -0
- package/dist/cli-bundle/chunks/chunk-DLQ4ZTCU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-MZG6I2Q2.js → chunk-DRBV5UC2.js} +8 -23
- package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DEIDJQZK.js → chunk-E2FUG6GD.js} +15 -220
- package/dist/cli-bundle/chunks/{chunk-DEIDJQZK.js.map → chunk-E2FUG6GD.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3MLQZI3H.js → chunk-EEY54JMF.js} +5 -3
- package/dist/cli-bundle/chunks/{chunk-3MLQZI3H.js.map → chunk-EEY54JMF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CQFZRLXQ.js → chunk-EZFKWSC7.js} +94 -16
- package/dist/cli-bundle/chunks/{chunk-CQFZRLXQ.js.map → chunk-EZFKWSC7.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-4PJYRA3V.js → chunk-FDBARR33.js} +17 -15
- package/dist/cli-bundle/chunks/{chunk-4PJYRA3V.js.map → chunk-FDBARR33.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NGDK3KEZ.js → chunk-FGQKEDE4.js} +36 -12
- package/dist/cli-bundle/chunks/chunk-FGQKEDE4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FMWQRMHS.js → chunk-FJRKQREY.js} +10 -18
- package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6QY2NA2M.js → chunk-FUM6UMY4.js} +10 -11
- package/dist/cli-bundle/chunks/{chunk-6QY2NA2M.js.map → chunk-FUM6UMY4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UGDONITK.js → chunk-GIWXVMZ3.js} +140 -334
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OTSP6UEX.js → chunk-HBYZDSK5.js} +19 -17
- package/dist/cli-bundle/chunks/{chunk-OTSP6UEX.js.map → chunk-HBYZDSK5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-D2LDM35X.js → chunk-HJE4JTKQ.js} +6 -4
- package/dist/cli-bundle/chunks/{chunk-D2LDM35X.js.map → chunk-HJE4JTKQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-AOP2EMK3.js → chunk-HK72NWAD.js} +89 -18
- package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2ONH3WG6.js → chunk-IJ6CO3JV.js} +18 -16
- package/dist/cli-bundle/chunks/{chunk-2ONH3WG6.js.map → chunk-IJ6CO3JV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-J4KNRDI3.js → chunk-JFCVQXZX.js} +139 -326
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-V655JQ5J.js → chunk-JLA7EVYV.js} +12 -10
- package/dist/cli-bundle/chunks/{chunk-V655JQ5J.js.map → chunk-JLA7EVYV.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +76 -0
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WBWRQS32.js → chunk-K3AGVXSF.js} +37 -13
- package/dist/cli-bundle/chunks/chunk-K3AGVXSF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +79 -0
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-KGHH652T.js +44 -0
- package/dist/cli-bundle/chunks/chunk-KGHH652T.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +915 -0
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JZJJEJBR.js → chunk-KLG4ZULO.js} +12 -10
- package/dist/cli-bundle/chunks/{chunk-JZJJEJBR.js.map → chunk-KLG4ZULO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-KKHIQOTN.js → chunk-LEKT4K7I.js} +74 -8
- package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-CVBINC7C.js → chunk-MNZ7DRNC.js} +13 -10
- package/dist/cli-bundle/chunks/{contracts-CVBINC7C.js.map → chunk-MNZ7DRNC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-2VK677OA.js → chunk-MTTXDAK4.js} +176 -125
- package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Q2266G4S.js → chunk-MZ7VNEVY.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-Q2266G4S.js.map → chunk-MZ7VNEVY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4EVY7CQN.js → chunk-N6DNM2FA.js} +2 -2
- package/dist/cli-bundle/chunks/{test-runs-5SLLV3XU.js → chunk-N7X4WP6L.js} +11 -8
- package/dist/cli-bundle/chunks/{test-runs-5SLLV3XU.js.map → chunk-N7X4WP6L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-AZMPKLIA.js → chunk-NBFCNJ7Q.js} +177 -126
- package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YZR7UMZ6.js → chunk-NER3KUUS.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +20 -0
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +918 -0
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DJ5S2LDY.js → chunk-OESSOFJ4.js} +14 -12
- package/dist/cli-bundle/chunks/{chunk-DJ5S2LDY.js.map → chunk-OESSOFJ4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +238 -0
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TUV7SIWZ.js → chunk-OWTIRHX4.js} +28 -6
- package/dist/cli-bundle/chunks/chunk-OWTIRHX4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PV5JS7MP.js → chunk-P3VRG72Q.js} +10 -8
- package/dist/cli-bundle/chunks/{chunk-PV5JS7MP.js.map → chunk-P3VRG72Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-P5TFTLWW.js +1423 -0
- package/dist/cli-bundle/chunks/chunk-P5TFTLWW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +1977 -0
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WTXDLBSZ.js → chunk-PDXT6Q55.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YZWXMDNH.js → chunk-PJ3A56YF.js} +46 -537
- package/dist/cli-bundle/chunks/chunk-PJ3A56YF.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-L3WKLO67.js → chunk-PPAJG4GB.js} +13 -10
- package/dist/cli-bundle/chunks/{test-runs-L3WKLO67.js.map → chunk-PPAJG4GB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-LLQLLAKU.js → chunk-PPE4YUQM.js} +1670 -1573
- package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TO4KCIOT.js → chunk-QHZO65XW.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-TO4KCIOT.js.map → chunk-QHZO65XW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4OXNQHKQ.js → chunk-R3ZBLGTC.js} +9 -10
- package/dist/cli-bundle/chunks/{chunk-4OXNQHKQ.js.map → chunk-R3ZBLGTC.js.map} +2 -2
- package/dist/cli-bundle/chunks/chunk-RCT3YJOK.js +624 -0
- package/dist/cli-bundle/chunks/chunk-RCT3YJOK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-724VLYDJ.js → chunk-RX3HQSYG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PUVPC5DL.js → chunk-S4APD35C.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-T5RTYLZJ.js → chunk-S5AYOUT5.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-T5RTYLZJ.js.map → chunk-S5AYOUT5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-75VMARGO.js → chunk-STPSZ2XY.js} +19 -744
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-A2W3XKAD.js → chunk-T35XLYZF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N2LOJUBB.js → chunk-T3ABIMGW.js} +5 -3
- package/dist/cli-bundle/chunks/{chunk-N2LOJUBB.js.map → chunk-T3ABIMGW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-FDNJMYZB.js → chunk-T3F4DF23.js} +16 -14
- package/dist/cli-bundle/chunks/{chunk-FDNJMYZB.js.map → chunk-T3F4DF23.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +272 -0
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js +5354 -0
- package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XFO2NJY6.js → chunk-TSPKZRRW.js} +33 -28
- package/dist/cli-bundle/chunks/chunk-TSPKZRRW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZZWMJVW2.js → chunk-TT42JUMF.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +165 -0
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7745CXNI.js → chunk-UI5BJ6DO.js} +1231 -1134
- package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +1932 -0
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +175 -0
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-B4O5S7I3.js → chunk-VUHVWI4C.js} +13 -3
- package/dist/cli-bundle/chunks/chunk-VUHVWI4C.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-NLCDIZAT.js → chunk-VZIYHZDX.js} +11 -8
- package/dist/cli-bundle/chunks/{contracts-NLCDIZAT.js.map → chunk-VZIYHZDX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TGYDJEJH.js → chunk-WISPVC2E.js} +9 -7
- package/dist/cli-bundle/chunks/{chunk-TGYDJEJH.js.map → chunk-WISPVC2E.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-MTB4PRA3.js → chunk-XQCG2JGW.js} +17 -749
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-Y76TWC45.js +550 -0
- package/dist/cli-bundle/chunks/chunk-Y76TWC45.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SL2ANJSV.js → chunk-YD5FML7K.js} +418 -2173
- package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NHKXOMZ5.js → chunk-YFIE7YK6.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-NHKXOMZ5.js.map → chunk-YFIE7YK6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5FYY76HR.js → chunk-YMABYTNG.js} +32 -27
- package/dist/cli-bundle/chunks/chunk-YMABYTNG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-W5X3AHJN.js → chunk-YOF5VPKM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-M6PR5BC6.js → chunk-YPPVU5GX.js} +11 -9
- package/dist/cli-bundle/chunks/{chunk-M6PR5BC6.js.map → chunk-YPPVU5GX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZIEGTQCY.js → chunk-YQMMMONE.js} +6 -4
- package/dist/cli-bundle/chunks/{chunk-ZIEGTQCY.js.map → chunk-YQMMMONE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4IW7STMB.js → chunk-YSAH5FY5.js} +16 -14
- package/dist/cli-bundle/chunks/{chunk-4IW7STMB.js.map → chunk-YSAH5FY5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JYLFF7GJ.js → chunk-YZIR4R3U.js} +16 -14
- package/dist/cli-bundle/chunks/{chunk-JYLFF7GJ.js.map → chunk-YZIR4R3U.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7G5SUU6F.js → chunk-Z2CRRZYF.js} +14 -12
- package/dist/cli-bundle/chunks/{chunk-7G5SUU6F.js.map → chunk-Z2CRRZYF.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-ZAHXPXVY.js +533 -0
- package/dist/cli-bundle/chunks/chunk-ZAHXPXVY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WOOB7PV7.js → chunk-ZCJAA3JK.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-WOOB7PV7.js.map → chunk-ZCJAA3JK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WSDIALO4.js → chunk-ZD34OFFQ.js} +5 -3
- package/dist/cli-bundle/chunks/{chunk-WSDIALO4.js.map → chunk-ZD34OFFQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-Q3XVLRCJ.js → chunk-ZJB3UV5U.js} +54 -58
- package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MZ4NH46V.js → chunk-ZMD35NYG.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +241 -0
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-D6L33A5Y.js → claim-4DROPSIS.js} +30 -13
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +1 -0
- package/dist/cli-bundle/chunks/{claim-YAFUTPVK.js → claim-VX54TV5U.js} +29 -12
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-TGYXG7TV.js → close-3YRR3XY6.js} +9 -7
- package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +16 -0
- package/dist/cli-bundle/chunks/{close-many-SNA6LNZH.js → close-many-AP4MWU36.js} +21 -18
- package/dist/cli-bundle/chunks/{close-many-SNA6LNZH.js.map → close-many-AP4MWU36.js.map} +1 -1
- package/dist/cli-bundle/chunks/{close-many-4QSWKCRU.js → close-many-OMZIGZB4.js} +19 -16
- package/dist/cli-bundle/chunks/{close-many-4QSWKCRU.js.map → close-many-OMZIGZB4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{comments-QC6ARR5X.js → comments-MIW5MZOX.js} +12 -9
- package/dist/cli-bundle/chunks/{comments-QC6ARR5X.js.map → comments-MIW5MZOX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{comments-ZHVYGUVC.js → comments-SAG5LSKL.js} +14 -11
- package/dist/cli-bundle/chunks/{comments-ZHVYGUVC.js.map → comments-SAG5LSKL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{config-O6W2EU2G.js → config-DJJKZB5R.js} +20 -17
- package/dist/cli-bundle/chunks/{config-O6W2EU2G.js.map → config-DJJKZB5R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{config-XQRFJXJP.js → config-V57QD47V.js} +22 -19
- package/dist/cli-bundle/chunks/{config-XQRFJXJP.js.map → config-V57QD47V.js.map} +1 -1
- package/dist/cli-bundle/chunks/{context-IHE3IXN5.js → context-4OQGIPSO.js} +15 -12
- package/dist/cli-bundle/chunks/{context-WSYWBEUL.js → context-WLA6IAWE.js} +15 -12
- package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +12 -0
- package/dist/cli-bundle/chunks/contracts-OJEXMKVW.js +16 -0
- package/dist/cli-bundle/chunks/{copy-7MUQC44A.js → copy-LEE6P6EM.js} +17 -14
- package/dist/cli-bundle/chunks/{copy-7MUQC44A.js.map → copy-LEE6P6EM.js.map} +2 -2
- package/dist/cli-bundle/chunks/{copy-ANWXDJVC.js → copy-OTJOWFL6.js} +18 -15
- package/dist/cli-bundle/chunks/{copy-ANWXDJVC.js.map → copy-OTJOWFL6.js.map} +1 -1
- package/dist/cli-bundle/chunks/create-WKOZKPQR.js +30 -0
- package/dist/cli-bundle/chunks/{create-JIA2IFCO.js → create-XWWQFQ6S.js} +14 -12
- package/dist/cli-bundle/chunks/{delete-5OLYWQIC.js → delete-62JQTYT4.js} +10 -7
- package/dist/cli-bundle/chunks/{delete-5OLYWQIC.js.map → delete-62JQTYT4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{delete-INHKCIRN.js → delete-HQKGRNRZ.js} +12 -9
- package/dist/cli-bundle/chunks/{delete-INHKCIRN.js.map → delete-HQKGRNRZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-IYEID3QX.js → deps-55FTG6Z5.js} +12 -9
- package/dist/cli-bundle/chunks/{deps-IYEID3QX.js.map → deps-55FTG6Z5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-CCSWGZW7.js → deps-L2FPIAD3.js} +10 -7
- package/dist/cli-bundle/chunks/{deps-CCSWGZW7.js.map → deps-L2FPIAD3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-PKO7OEIM.js → docs-6CRCSVKK.js} +11 -9
- package/dist/cli-bundle/chunks/{docs-PKO7OEIM.js.map → docs-6CRCSVKK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-3XZK22WF.js → docs-S6UTOTO5.js} +9 -7
- package/dist/cli-bundle/chunks/{docs-3XZK22WF.js.map → docs-S6UTOTO5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{eval-5XYP6NMY.js → eval-N6UHFWVO.js} +15 -11
- package/dist/cli-bundle/chunks/{eval-5XYP6NMY.js.map → eval-N6UHFWVO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{eval-O4WGQYDI.js → eval-PHOTWYHI.js} +17 -13
- package/dist/cli-bundle/chunks/{eval-O4WGQYDI.js.map → eval-PHOTWYHI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{extension-T7JNTAAA.js → extension-NBAH62ML.js} +17 -11
- package/dist/cli-bundle/chunks/{extension-PVGRRZZG.js → extension-ZF6ZZPOU.js} +17 -11
- package/dist/cli-bundle/chunks/{files-W7HH5EOD.js → files-6P57MRKL.js} +12 -9
- package/dist/cli-bundle/chunks/{files-W7HH5EOD.js.map → files-6P57MRKL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{files-7IU56S6R.js → files-JPU3FNJ7.js} +14 -11
- package/dist/cli-bundle/chunks/{files-7IU56S6R.js.map → files-JPU3FNJ7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-6FA5KYRY.js → focus-LFZ6IDBR.js} +15 -11
- package/dist/cli-bundle/chunks/{focus-6FA5KYRY.js.map → focus-LFZ6IDBR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-CQ63JFDG.js → focus-WNMYCVYA.js} +13 -9
- package/dist/cli-bundle/chunks/{focus-CQ63JFDG.js.map → focus-WNMYCVYA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{gc-3BG67KTO.js → gc-AETFKZ44.js} +10 -7
- package/dist/cli-bundle/chunks/{gc-3BG67KTO.js.map → gc-AETFKZ44.js.map} +1 -1
- package/dist/cli-bundle/chunks/{gc-PEZYGNVB.js → gc-RLBP4QVN.js} +12 -9
- package/dist/cli-bundle/chunks/{gc-PEZYGNVB.js.map → gc-RLBP4QVN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{get-J6CSJ4SX.js → get-NH2MPBCI.js} +18 -15
- package/dist/cli-bundle/chunks/{get-J6CSJ4SX.js.map → get-NH2MPBCI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{get-KJTKGNEQ.js → get-P4ZQXCPZ.js} +16 -13
- package/dist/cli-bundle/chunks/{get-KJTKGNEQ.js.map → get-P4ZQXCPZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{health-32UQICEL.js → health-3GVPMQBL.js} +36 -29
- package/dist/cli-bundle/chunks/{health-32UQICEL.js.map → health-3GVPMQBL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{health-ZUZG5ULV.js → health-DNTM72GJ.js} +34 -27
- package/dist/cli-bundle/chunks/{health-ZUZG5ULV.js.map → health-DNTM72GJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/history-RYKLC72X.js +20 -0
- package/dist/cli-bundle/chunks/{history-W6QVR6FA.js → history-SGPYRAFT.js} +10 -8
- package/dist/cli-bundle/chunks/{history-compact-JQ6ZGYSJ.js → history-compact-3F6VELO7.js} +18 -15
- package/dist/cli-bundle/chunks/{history-compact-JQ6ZGYSJ.js.map → history-compact-3F6VELO7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-compact-F355EGL4.js → history-compact-656Y2TN4.js} +20 -17
- package/dist/cli-bundle/chunks/{history-compact-F355EGL4.js.map → history-compact-656Y2TN4.js.map} +1 -1
- package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +21 -0
- package/dist/cli-bundle/chunks/{history-redact-TUWOUYX5.js → history-redact-54ICFKXM.js} +11 -9
- package/dist/cli-bundle/chunks/{history-repair-ZKS3LKPV.js → history-repair-4N6SDVHK.js} +17 -14
- package/dist/cli-bundle/chunks/{history-repair-ZKS3LKPV.js.map → history-repair-4N6SDVHK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-repair-MPCAIKYE.js → history-repair-EVTO6LIH.js} +19 -16
- package/dist/cli-bundle/chunks/{history-repair-MPCAIKYE.js.map → history-repair-EVTO6LIH.js.map} +1 -1
- package/dist/cli-bundle/chunks/init-RPIPQUNV.js +32 -0
- package/dist/cli-bundle/chunks/init-SKQAESQS.js +28 -0
- package/dist/cli-bundle/chunks/{learnings-EYC3OKS2.js → learnings-2HTPZNGZ.js} +10 -8
- package/dist/cli-bundle/chunks/{learnings-EYC3OKS2.js.map → learnings-2HTPZNGZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-HKJJUVTA.js → learnings-YBIHY3D6.js} +12 -10
- package/dist/cli-bundle/chunks/{learnings-HKJJUVTA.js.map → learnings-YBIHY3D6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{list-KN3TL5Y5.js → list-64LHZ3HM.js} +10 -8
- package/dist/cli-bundle/chunks/{list-HFD5737R.js → list-7LXBTEKI.js} +10 -8
- package/dist/cli-bundle/chunks/{next-DQUMFAHG.js → next-7ODPAQ4U.js} +22 -18
- package/dist/cli-bundle/chunks/{next-DQUMFAHG.js.map → next-7ODPAQ4U.js.map} +1 -1
- package/dist/cli-bundle/chunks/{next-JUEYC5HE.js → next-ODJUM4ZM.js} +24 -20
- package/dist/cli-bundle/chunks/{next-JUEYC5HE.js.map → next-ODJUM4ZM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-ZG6RLZXB.js → notes-72YXN5JX.js} +10 -8
- package/dist/cli-bundle/chunks/{notes-ZG6RLZXB.js.map → notes-72YXN5JX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-XATYT43P.js → notes-NJ7IQJX4.js} +12 -10
- package/dist/cli-bundle/chunks/{notes-XATYT43P.js.map → notes-NJ7IQJX4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-DVVLX7LK.js → plan-R4NDQ27E.js} +18 -15
- package/dist/cli-bundle/chunks/{plan-DVVLX7LK.js.map → plan-R4NDQ27E.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-5NWQL2DH.js → plan-XWY5T67S.js} +20 -17
- package/dist/cli-bundle/chunks/{plan-5NWQL2DH.js.map → plan-XWY5T67S.js.map} +1 -1
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +397 -0
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +1 -0
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +400 -0
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-WRS6ACUW.js → register-list-query-5H66WFYF.js} +22 -19
- package/dist/cli-bundle/chunks/{register-list-query-WRS6ACUW.js.map → register-list-query-5H66WFYF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-list-query-PNRAHNIQ.js → register-list-query-FB3FNDLZ.js} +24 -21
- package/dist/cli-bundle/chunks/{register-list-query-PNRAHNIQ.js.map → register-list-query-FB3FNDLZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-K2MNRWGI.js → register-mutation-UJO23C7R.js} +42 -39
- package/dist/cli-bundle/chunks/{register-mutation-K2MNRWGI.js.map → register-mutation-UJO23C7R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-ET6E4VLE.js → register-mutation-Z2ETYHKS.js} +40 -37
- package/dist/cli-bundle/chunks/{register-mutation-ET6E4VLE.js.map → register-mutation-Z2ETYHKS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-6DQRUTIX.js → register-operations-A3XAM5J7.js} +39 -36
- package/dist/cli-bundle/chunks/{register-operations-6DQRUTIX.js.map → register-operations-A3XAM5J7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-73UDWMVB.js → register-operations-SG7HBSUP.js} +37 -34
- package/dist/cli-bundle/chunks/{register-operations-73UDWMVB.js.map → register-operations-SG7HBSUP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-LYYCMQFV.js → register-setup-I45OGJUV.js} +25 -19
- package/dist/cli-bundle/chunks/{register-setup-LYYCMQFV.js.map → register-setup-I45OGJUV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-FXZJ2CEJ.js → register-setup-K6U3NVY5.js} +23 -17
- package/dist/cli-bundle/chunks/{register-setup-FXZJ2CEJ.js.map → register-setup-K6U3NVY5.js.map} +1 -1
- package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +19 -0
- package/dist/cli-bundle/chunks/{restore-R6YJHQK3.js → restore-YJ2ET6AT.js} +11 -9
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-OGODPUBL.js → scheduling-shortcuts-SSC4MYWQ.js} +14 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-OGODPUBL.js.map → scheduling-shortcuts-SSC4MYWQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-LE4S7OI7.js → scheduling-shortcuts-ULRG7MNP.js} +16 -14
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-LE4S7OI7.js.map → scheduling-shortcuts-ULRG7MNP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{schema-ICCD3HOP.js → schema-2PUXCZ25.js} +10 -7
- package/dist/cli-bundle/chunks/{schema-RHH23PQX.js → schema-Y6DXXK2F.js} +10 -7
- package/dist/cli-bundle/chunks/{search-Z2VGP2Q5.js → search-3S72CTD6.js} +13 -10
- package/dist/cli-bundle/chunks/{search-HDDKOPFE.js → search-WNUNBQXO.js} +13 -10
- package/dist/cli-bundle/chunks/{stats-ETFP37MB.js → stats-IJYTRQGV.js} +13 -10
- package/dist/cli-bundle/chunks/{stats-ETFP37MB.js.map → stats-IJYTRQGV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{stats-DHMRXHOB.js → stats-L2D5Y2O5.js} +15 -12
- package/dist/cli-bundle/chunks/{stats-DHMRXHOB.js.map → stats-L2D5Y2O5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{telemetry-ZRBM22QD.js → telemetry-L2CVOKVN.js} +11 -8
- package/dist/cli-bundle/chunks/{telemetry-ZRBM22QD.js.map → telemetry-L2CVOKVN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{telemetry-NUZNKDCP.js → telemetry-QBYWQA76.js} +13 -10
- package/dist/cli-bundle/chunks/{telemetry-NUZNKDCP.js.map → telemetry-QBYWQA76.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-XNKTIP4Y.js → test-DQ2QFJ7W.js} +21 -15
- package/dist/cli-bundle/chunks/test-W7QBLVJS.js +41 -0
- package/dist/cli-bundle/chunks/{test-all-APCBSXQI.js → test-all-636NTRTT.js} +26 -19
- package/dist/cli-bundle/chunks/{test-all-APCBSXQI.js.map → test-all-636NTRTT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-KIK3OYBY.js → test-all-DWYK3RG6.js} +24 -17
- package/dist/cli-bundle/chunks/{test-all-KIK3OYBY.js.map → test-all-DWYK3RG6.js.map} +1 -1
- package/dist/cli-bundle/chunks/test-runs-245OINZR.js +28 -0
- package/dist/cli-bundle/chunks/test-runs-245OINZR.js.map +1 -0
- package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +24 -0
- package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js.map +7 -0
- package/dist/cli-bundle/chunks/update-SFLZPJXX.js +30 -0
- package/dist/cli-bundle/chunks/update-SFLZPJXX.js.map +1 -0
- package/dist/cli-bundle/chunks/update-SJZ6S77U.js +26 -0
- package/dist/cli-bundle/chunks/update-SJZ6S77U.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-many-XGTJ7QIU.js → update-many-DC7X3EWM.js} +32 -29
- package/dist/cli-bundle/chunks/{update-many-XGTJ7QIU.js.map → update-many-DC7X3EWM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-GFCQG6ZQ.js → update-many-SLLAMHT7.js} +34 -31
- package/dist/cli-bundle/chunks/{update-many-GFCQG6ZQ.js.map → update-many-SLLAMHT7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-KJ3JGELR.js → upgrade-HFFXLZJA.js} +19 -12
- package/dist/cli-bundle/chunks/{upgrade-KJ3JGELR.js.map → upgrade-HFFXLZJA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-RBRQ7PQU.js → upgrade-UYQKM7RF.js} +21 -14
- package/dist/cli-bundle/chunks/{upgrade-RBRQ7PQU.js.map → upgrade-UYQKM7RF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-EW6TGC7R.js → validate-PA4FDTOV.js} +34 -27
- package/dist/cli-bundle/chunks/{validate-EW6TGC7R.js.map → validate-PA4FDTOV.js.map} +2 -2
- package/dist/cli-bundle/chunks/{validate-T6PR5WAL.js → validate-Z7L75YEJ.js} +35 -28
- package/dist/cli-bundle/chunks/{validate-T6PR5WAL.js.map → validate-Z7L75YEJ.js.map} +1 -1
- package/dist/cli-bundle/main.js +173 -57
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +247 -0
- package/dist/cli-bundle/sdk-runtime.js.map +7 -0
- package/dist/cli-bundle/sdk-testing.js +101 -0
- package/dist/cli-bundle/sdk-testing.js.map +7 -0
- package/dist/cli-bundle/sdk.js +787 -0
- package/dist/cli-bundle/sdk.js.map +7 -0
- package/dist/core/config/nested-settings.d.ts +4 -3
- package/dist/core/config/nested-settings.js +17 -6
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/extensions/activation-summary.d.ts +6 -0
- package/dist/core/extensions/activation-summary.js +10 -4
- package/dist/core/extensions/activation-summary.js.map +1 -1
- package/dist/core/extensions/capability-usage.d.ts +6 -0
- package/dist/core/extensions/capability-usage.js +10 -4
- package/dist/core/extensions/capability-usage.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +5 -0
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +3 -0
- package/dist/core/extensions/loader.js +11 -19
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/history-rewrite.js +3 -3
- package/dist/core/history/history-rewrite.js.map +1 -1
- package/dist/core/item/parent-reference-policy.d.ts +9 -1
- package/dist/core/item/parent-reference-policy.js +28 -4
- package/dist/core/item/parent-reference-policy.js.map +1 -1
- package/dist/core/lock/lock.d.ts +28 -1
- package/dist/core/lock/lock.js +254 -20
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/search/background-refresh.js +7 -19
- package/dist/core/search/background-refresh.js.map +1 -1
- package/dist/core/search/http-client.d.ts +0 -1
- package/dist/core/search/http-client.js +3 -3
- package/dist/core/search/http-client.js.map +1 -1
- package/dist/core/shared/constants.js +3 -2
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.d.ts +1 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/primitives.d.ts +12 -0
- package/dist/core/shared/primitives.js +29 -2
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/store/item-store.js +3 -3
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +1 -0
- package/dist/core/store/settings-validator.js +6 -3
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.js +3 -3
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/validate/fix-planning.d.ts +0 -2
- package/dist/core/validate/fix-planning.js +3 -3
- package/dist/core/validate/fix-planning.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +3 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/errors.d.ts +21 -2
- package/dist/sdk/errors.js +8 -2
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/package-import-adapters.js +3 -3
- package/dist/sdk/package-import-adapters.js.map +1 -1
- package/dist/sdk/testing.js +41 -19
- package/dist/sdk/testing.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +27 -0
- package/docs/CONFIGURATION.md +3 -0
- package/docs/README.md +1 -0
- package/docs/SDK_PRIMITIVE_INVENTORY.md +55 -0
- package/docs/TESTING.md +5 -1
- package/docs/examples/ci/github-actions-pm-extension-gate.yml +5 -5
- package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +1 -1
- package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +1 -1
- package/package.json +11 -24
- package/packages/pm-beads/extensions/beads/package.json +3 -0
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +24 -2
- package/packages/pm-calendar/extensions/calendar/package.json +3 -0
- package/packages/pm-command-kit/extensions/command-kit/package.json +3 -0
- package/packages/pm-governance-audit/extensions/governance-audit/package.json +3 -0
- package/packages/pm-guide-shell/extensions/guide-shell/package.json +3 -0
- package/packages/pm-kanban/extensions/kanban/package.json +3 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/package.json +3 -0
- package/packages/pm-search-advanced/extensions/search-advanced/package.json +3 -0
- package/packages/pm-templates/extensions/templates/package.json +3 -0
- package/packages/pm-todos/extensions/todos/package.json +3 -0
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +21 -3
- package/scripts/bundle-cli.mjs +12 -2
- package/dist/cli-bundle/chunks/activity-IDS5GSYG.js +0 -16
- package/dist/cli-bundle/chunks/chunk-2VK677OA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5FYY76HR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-75VMARGO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7745CXNI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AOP2EMK3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AZMPKLIA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-B4O5S7I3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BDDYM4LH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CN4OAA2G.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EH23N5FX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FMWQRMHS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-J4KNRDI3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KKHIQOTN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LLQLLAKU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-M34MVAOP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MTB4PRA3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MZG6I2Q2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NGDK3KEZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Q3XVLRCJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SBNT6SLO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SL2ANJSV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TUV7SIWZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UGDONITK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UYLA5ROU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WBWRQS32.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XFO2NJY6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XQCWTSLO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YZWXMDNH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-Z4DGFQDH.js.map +0 -1
- package/dist/cli-bundle/chunks/claim-D6L33A5Y.js.map +0 -1
- package/dist/cli-bundle/chunks/claim-YAFUTPVK.js.map +0 -7
- package/dist/cli-bundle/chunks/close-KLDLHAOP.js +0 -14
- package/dist/cli-bundle/chunks/create-AJ6HUR5W.js +0 -28
- package/dist/cli-bundle/chunks/history-IOH6FKG7.js +0 -18
- package/dist/cli-bundle/chunks/history-redact-VVDOARNO.js +0 -19
- package/dist/cli-bundle/chunks/init-CZLEEE6Q.js +0 -22
- package/dist/cli-bundle/chunks/init-MAA6UMNQ.js +0 -26
- package/dist/cli-bundle/chunks/profile-54DZ4CLB.js +0 -1205
- package/dist/cli-bundle/chunks/profile-54DZ4CLB.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-PLIQVEOY.js +0 -1243
- package/dist/cli-bundle/chunks/profile-PLIQVEOY.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-L27TMMCF.js +0 -17
- package/dist/cli-bundle/chunks/test-H36PM746.js +0 -35
- package/dist/cli-bundle/chunks/update-RQKI3AMW.js +0 -24
- package/dist/cli-bundle/chunks/update-ZM7NJWHY.js +0 -28
- /package/dist/cli-bundle/chunks/{activity-IDS5GSYG.js.map → activity-4XQIDNM5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-OENQCYZD.js.map → activity-YKAKZTZ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4SHME4VR.js.map → chunk-5JE6SMYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4EVY7CQN.js.map → chunk-N6DNM2FA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YZR7UMZ6.js.map → chunk-NER3KUUS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WTXDLBSZ.js.map → chunk-PDXT6Q55.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-724VLYDJ.js.map → chunk-RX3HQSYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PUVPC5DL.js.map → chunk-S4APD35C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A2W3XKAD.js.map → chunk-T35XLYZF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZZWMJVW2.js.map → chunk-TT42JUMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W5X3AHJN.js.map → chunk-YOF5VPKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MZ4NH46V.js.map → chunk-ZMD35NYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-TGYXG7TV.js.map → close-3YRR3XY6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-KLDLHAOP.js.map → close-OB2Y4QP5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-IHE3IXN5.js.map → context-4OQGIPSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-WSYWBEUL.js.map → context-WLA6IAWE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-AJ6HUR5W.js.map → contracts-HXJLKCRI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-JIA2IFCO.js.map → contracts-OJEXMKVW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-T7JNTAAA.js.map → create-WKOZKPQR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-PVGRRZZG.js.map → create-XWWQFQ6S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-IOH6FKG7.js.map → extension-NBAH62ML.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-W6QVR6FA.js.map → extension-ZF6ZZPOU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-VVDOARNO.js.map → history-RYKLC72X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-TUWOUYX5.js.map → history-SGPYRAFT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-CZLEEE6Q.js.map → history-redact-4H3FCKF3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-MAA6UMNQ.js.map → history-redact-54ICFKXM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-HFD5737R.js.map → init-RPIPQUNV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-KN3TL5Y5.js.map → init-SKQAESQS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-L27TMMCF.js.map → list-64LHZ3HM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-R6YJHQK3.js.map → list-7LXBTEKI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-ICCD3HOP.js.map → restore-PXOFL6AM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-RHH23PQX.js.map → restore-YJ2ET6AT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-HDDKOPFE.js.map → schema-2PUXCZ25.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-Z2VGP2Q5.js.map → schema-Y6DXXK2F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-XNKTIP4Y.js.map → search-3S72CTD6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-H36PM746.js.map → search-WNUNBQXO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-ZM7NJWHY.js.map → test-DQ2QFJ7W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-RQKI3AMW.js.map → test-W7QBLVJS.js.map} +0 -0
|
@@ -4,42 +4,45 @@ import {
|
|
|
4
4
|
buildItemNotFoundError,
|
|
5
5
|
collectRegisteredItemFieldNames,
|
|
6
6
|
createHistoryEntry,
|
|
7
|
-
generateItemId,
|
|
8
7
|
locateItem,
|
|
9
8
|
readLocatedItem
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3U3VEWK6.js";
|
|
11
10
|
import {
|
|
12
11
|
canonicalDocument,
|
|
12
|
+
generateItemId,
|
|
13
13
|
serializeItemDocument
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EZFKWSC7.js";
|
|
15
15
|
import {
|
|
16
16
|
nowIso
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DRBV5UC2.js";
|
|
18
18
|
import {
|
|
19
|
-
EXIT_CODE,
|
|
20
|
-
FRONT_MATTER_KEY_ORDER,
|
|
21
19
|
PmCliError,
|
|
22
20
|
getActiveExtensionRegistrations,
|
|
21
|
+
projectAfterCommandItemSnapshot,
|
|
22
|
+
readSettings,
|
|
23
|
+
recordAfterCommandAffectedItem,
|
|
24
|
+
runActiveOnWriteHooks
|
|
25
|
+
} from "./chunk-P5YORJRH.js";
|
|
26
|
+
import "./chunk-7C2O74AE.js";
|
|
27
|
+
import {
|
|
28
|
+
EXIT_CODE,
|
|
29
|
+
FRONT_MATTER_KEY_ORDER,
|
|
23
30
|
getHistoryPath,
|
|
24
31
|
getItemPath,
|
|
25
32
|
getSettingsPath,
|
|
26
33
|
pathExists,
|
|
27
|
-
projectAfterCommandItemSnapshot,
|
|
28
|
-
readSettings,
|
|
29
|
-
recordAfterCommandAffectedItem,
|
|
30
34
|
removeFileIfExists,
|
|
31
35
|
resolveItemTypeRegistry,
|
|
32
36
|
resolvePmRoot,
|
|
33
37
|
resolveRuntimeStatusRegistry,
|
|
34
|
-
runActiveOnWriteHooks,
|
|
35
38
|
writeFileAtomic
|
|
36
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-5VVUKE3U.js";
|
|
37
40
|
|
|
38
41
|
// dist/cli/commands/copy.js
|
|
39
42
|
!(function() {
|
|
40
43
|
try {
|
|
41
44
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
42
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
45
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9f18adf2-5e40-5104-b7fa-5b5d77ffe54b");
|
|
43
46
|
} catch (e2) {
|
|
44
47
|
}
|
|
45
48
|
})();
|
|
@@ -109,7 +112,7 @@ async function runCopy(sourceId, options, global2) {
|
|
|
109
112
|
const changedFields = buildChangedFields(copiedDocument.metadata, copiedDocument.body);
|
|
110
113
|
const itemPath = getItemPath(pmRoot, copiedDocument.metadata.type, newId, settings.item_format, typeRegistry.type_to_folder);
|
|
111
114
|
const historyPath = getHistoryPath(pmRoot, newId);
|
|
112
|
-
const lockRelease = await acquireLock(pmRoot, newId, settings.locks.ttl_seconds, author, false, settings.governance.force_required_for_stale_lock);
|
|
115
|
+
const lockRelease = await acquireLock(pmRoot, newId, settings.locks.ttl_seconds, author, false, settings.governance.force_required_for_stale_lock, settings.locks.wait_ms);
|
|
113
116
|
const beforeDocument = {
|
|
114
117
|
metadata: {},
|
|
115
118
|
body: ""
|
|
@@ -178,4 +181,4 @@ async function runCopy(sourceId, options, global2) {
|
|
|
178
181
|
export {
|
|
179
182
|
runCopy
|
|
180
183
|
};
|
|
181
|
-
//# sourceMappingURL=copy-
|
|
184
|
+
//# sourceMappingURL=copy-LEE6P6EM.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../cli/commands/copy.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @module cli/commands/copy\n *\n * Implements the pm copy command surface and its agent-facing runtime behavior.\n */\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { appendHistoryEntry, createHistoryEntry } from \"../../core/history/history.js\";\nimport { generateItemId } from \"../../core/item/id.js\";\nimport { canonicalDocument, serializeItemDocument } from \"../../core/item/item-format.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { collectRegisteredItemFieldNames } from \"../../core/extensions/item-fields.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { buildItemNotFoundError, 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 type { ItemDocument, ItemMetadata } from \"../../types/index.js\";\n\n/**\n * Documents the copy options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CopyOptions {\n title?: string;\n author?: string;\n message?: string;\n}\n\n/**\n * Documents the copy result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CopyResult {\n source_id: string;\n item: ItemMetadata;\n changed_fields: string[];\n warnings: string[];\n}\n\nfunction selectAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const candidate = explicitAuthor ?? process.env.PM_AUTHOR ?? settingsAuthor;\n const trimmed = candidate.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\nfunction buildChangedFields(frontMatter: ItemMetadata, body: string): string[] {\n const changed = [\n ...new Set([\n ...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),\n ...Object.keys(frontMatter).filter((key) => frontMatter[key] !== undefined),\n ...(body.length > 0 ? [\"body\"] : []),\n ]),\n ];\n return changed.sort((left, right) => left.localeCompare(right));\n}\n\nfunction buildCopyMessage(sourceId: string, message: string | undefined): string {\n const suffix = `copied_from=${sourceId}`;\n if (!message) {\n return suffix;\n }\n const trimmed = message.trim();\n return trimmed.length > 0 ? `${trimmed} | ${suffix}` : suffix;\n}\n\n/**\n * Implements run copy for the public runtime surface of this module.\n */\nexport async function runCopy(sourceId: string, options: CopyOptions, global: GlobalOptions): Promise<CopyResult> {\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 located = await locateItem(pmRoot, sourceId, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, sourceId, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const sourceLoaded = await readLocatedItem(located, { schema: settings.schema });\n const sourceMetadata = sourceLoaded.document.metadata;\n const copiedAt = nowIso();\n const author = selectAuthor(options.author, settings.author_default);\n const newId = await generateItemId(pmRoot, settings.id_prefix);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const titleOverride = options.title?.trim();\n if (titleOverride !== undefined && titleOverride.length === 0) {\n throw new PmCliError(\"Copy --title must not be empty\", EXIT_CODE.USAGE);\n }\n\n const copiedMetadata: ItemMetadata = {\n ...(sourceMetadata as Record<string, unknown>),\n id: newId,\n title: titleOverride ?? sourceMetadata.title,\n status: statusRegistry.open_status,\n created_at: copiedAt,\n updated_at: copiedAt,\n } as ItemMetadata;\n delete copiedMetadata.closed_at;\n delete copiedMetadata.close_reason;\n delete copiedMetadata.test_runs;\n\n const extensionFieldNames = collectRegisteredItemFieldNames(getActiveExtensionRegistrations());\n const copiedDocument = canonicalDocument(\n {\n metadata: copiedMetadata,\n body: sourceLoaded.document.body,\n },\n {\n schema: settings.schema,\n extensionFieldNames,\n },\n );\n const changedFields = buildChangedFields(copiedDocument.metadata, copiedDocument.body);\n const itemPath = getItemPath(pmRoot, copiedDocument.metadata.type, newId, settings.item_format, typeRegistry.type_to_folder);\n const historyPath = getHistoryPath(pmRoot, newId);\n const lockRelease = await acquireLock(\n pmRoot,\n newId,\n settings.locks.ttl_seconds,\n author,\n false,\n settings.governance.force_required_for_stale_lock,\n );\n const beforeDocument: ItemDocument = {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n\n let hookWarnings: string[] = [];\n try {\n await writeFileAtomic(\n itemPath,\n serializeItemDocument(copiedDocument, {\n format: settings.item_format,\n schema: settings.schema,\n extensionFieldNames,\n }),\n );\n try {\n const historyEntry = createHistoryEntry({\n nowIso: copiedAt,\n author,\n op: \"create\",\n before: beforeDocument,\n after: copiedDocument,\n message: buildCopyMessage(located.id, options.message),\n });\n await appendHistoryEntry(historyPath, historyEntry);\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n\n hookWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"create\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"create:history\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ];\n recordAfterCommandAffectedItem({\n id: copiedDocument.metadata.id,\n op: \"create\",\n item_type: copiedDocument.metadata.type,\n status: copiedDocument.metadata.status,\n current: projectAfterCommandItemSnapshot(copiedDocument.metadata, changedFields),\n changed_fields: changedFields,\n });\n } finally {\n await lockRelease();\n }\n\n return {\n source_id: located.id,\n item: structuredClone(copiedDocument.metadata),\n changed_fields: changedFields,\n warnings: hookWarnings,\n };\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * @module cli/commands/copy\n *\n * Implements the pm copy command surface and its agent-facing runtime behavior.\n */\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { appendHistoryEntry, createHistoryEntry } from \"../../core/history/history.js\";\nimport { generateItemId } from \"../../core/item/id.js\";\nimport { canonicalDocument, serializeItemDocument } from \"../../core/item/item-format.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { collectRegisteredItemFieldNames } from \"../../core/extensions/item-fields.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { buildItemNotFoundError, 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 type { ItemDocument, ItemMetadata } from \"../../types/index.js\";\n\n/**\n * Documents the copy options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CopyOptions {\n title?: string;\n author?: string;\n message?: string;\n}\n\n/**\n * Documents the copy result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CopyResult {\n source_id: string;\n item: ItemMetadata;\n changed_fields: string[];\n warnings: string[];\n}\n\nfunction selectAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const candidate = explicitAuthor ?? process.env.PM_AUTHOR ?? settingsAuthor;\n const trimmed = candidate.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\nfunction buildChangedFields(frontMatter: ItemMetadata, body: string): string[] {\n const changed = [\n ...new Set([\n ...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),\n ...Object.keys(frontMatter).filter((key) => frontMatter[key] !== undefined),\n ...(body.length > 0 ? [\"body\"] : []),\n ]),\n ];\n return changed.sort((left, right) => left.localeCompare(right));\n}\n\nfunction buildCopyMessage(sourceId: string, message: string | undefined): string {\n const suffix = `copied_from=${sourceId}`;\n if (!message) {\n return suffix;\n }\n const trimmed = message.trim();\n return trimmed.length > 0 ? `${trimmed} | ${suffix}` : suffix;\n}\n\n/**\n * Implements run copy for the public runtime surface of this module.\n */\nexport async function runCopy(sourceId: string, options: CopyOptions, global: GlobalOptions): Promise<CopyResult> {\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 located = await locateItem(pmRoot, sourceId, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, sourceId, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const sourceLoaded = await readLocatedItem(located, { schema: settings.schema });\n const sourceMetadata = sourceLoaded.document.metadata;\n const copiedAt = nowIso();\n const author = selectAuthor(options.author, settings.author_default);\n const newId = await generateItemId(pmRoot, settings.id_prefix);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const titleOverride = options.title?.trim();\n if (titleOverride !== undefined && titleOverride.length === 0) {\n throw new PmCliError(\"Copy --title must not be empty\", EXIT_CODE.USAGE);\n }\n\n const copiedMetadata: ItemMetadata = {\n ...(sourceMetadata as Record<string, unknown>),\n id: newId,\n title: titleOverride ?? sourceMetadata.title,\n status: statusRegistry.open_status,\n created_at: copiedAt,\n updated_at: copiedAt,\n } as ItemMetadata;\n delete copiedMetadata.closed_at;\n delete copiedMetadata.close_reason;\n delete copiedMetadata.test_runs;\n\n const extensionFieldNames = collectRegisteredItemFieldNames(getActiveExtensionRegistrations());\n const copiedDocument = canonicalDocument(\n {\n metadata: copiedMetadata,\n body: sourceLoaded.document.body,\n },\n {\n schema: settings.schema,\n extensionFieldNames,\n },\n );\n const changedFields = buildChangedFields(copiedDocument.metadata, copiedDocument.body);\n const itemPath = getItemPath(pmRoot, copiedDocument.metadata.type, newId, settings.item_format, typeRegistry.type_to_folder);\n const historyPath = getHistoryPath(pmRoot, newId);\n const lockRelease = await acquireLock(\n pmRoot,\n newId,\n settings.locks.ttl_seconds,\n author,\n false,\n settings.governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n );\n const beforeDocument: ItemDocument = {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n\n let hookWarnings: string[] = [];\n try {\n await writeFileAtomic(\n itemPath,\n serializeItemDocument(copiedDocument, {\n format: settings.item_format,\n schema: settings.schema,\n extensionFieldNames,\n }),\n );\n try {\n const historyEntry = createHistoryEntry({\n nowIso: copiedAt,\n author,\n op: \"create\",\n before: beforeDocument,\n after: copiedDocument,\n message: buildCopyMessage(located.id, options.message),\n });\n await appendHistoryEntry(historyPath, historyEntry);\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n\n hookWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"create\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"create:history\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ];\n recordAfterCommandAffectedItem({\n id: copiedDocument.metadata.id,\n op: \"create\",\n item_type: copiedDocument.metadata.type,\n status: copiedDocument.metadata.status,\n current: projectAfterCommandItemSnapshot(copiedDocument.metadata, changedFields),\n changed_fields: changedFields,\n });\n } finally {\n await lockRelease();\n }\n\n return {\n source_id: located.id,\n item: structuredClone(copiedDocument.metadata),\n changed_fields: changedFields,\n warnings: hookWarnings,\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAS,aAAa,gBAAoC,gBAAsB;AAC9E,QAAM,YAAY,kBAAkB,QAAQ,IAAI,aAAa;AAC7D,QAAM,UAAU,UAAU,KAAI;AAC9B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAEA,SAAS,mBAAmB,aAA2B,MAAY;AACjE,QAAM,UAAU;IACd,GAAG,oBAAI,IAAI;MACT,GAAG,uBAAuB,OAAO,CAAC,QAAQ,YAAY,GAAG,MAAM,MAAS;MACxE,GAAG,OAAO,KAAK,WAAW,EAAE,OAAO,CAAC,QAAQ,YAAY,GAAG,MAAM,MAAS;MAC1E,GAAI,KAAK,SAAS,IAAI,CAAC,MAAM,IAAI,CAAA;KAClC;;AAEH,SAAO,QAAQ,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AAChE;AAEA,SAAS,iBAAiB,UAAkB,SAA2B;AACrE,QAAM,SAAS,eAAe,QAAQ;AACtC,MAAI,CAAC,SAAS;AACZ,WAAO;EACT;AACA,QAAM,UAAU,QAAQ,KAAI;AAC5B,SAAO,QAAQ,SAAS,IAAI,GAAG,OAAO,MAAM,MAAM,KAAK;AACzD;AAKA,eAAsB,QAAQ,UAA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UAAU;;AAEd;",
|
|
6
6
|
"names": ["global"]
|
|
7
7
|
}
|
|
@@ -1,41 +1,44 @@
|
|
|
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]="87535522-3134-55f3-a73d-9742db5c6296")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
acquireLock,
|
|
5
5
|
appendHistoryEntry,
|
|
6
6
|
buildItemNotFoundError,
|
|
7
7
|
collectRegisteredItemFieldNames,
|
|
8
8
|
createHistoryEntry,
|
|
9
|
-
generateItemId,
|
|
10
9
|
locateItem,
|
|
11
10
|
readLocatedItem
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-57C2RLW5.js";
|
|
13
12
|
import {
|
|
14
13
|
canonicalDocument,
|
|
14
|
+
generateItemId,
|
|
15
15
|
serializeItemDocument
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HK72NWAD.js";
|
|
17
17
|
import {
|
|
18
18
|
nowIso
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-FJRKQREY.js";
|
|
20
20
|
import {
|
|
21
|
-
EXIT_CODE,
|
|
22
|
-
FRONT_MATTER_KEY_ORDER,
|
|
23
21
|
PmCliError,
|
|
24
22
|
getActiveExtensionRegistrations,
|
|
23
|
+
projectAfterCommandItemSnapshot,
|
|
24
|
+
readSettings,
|
|
25
|
+
recordAfterCommandAffectedItem,
|
|
26
|
+
runActiveOnWriteHooks
|
|
27
|
+
} from "./chunk-US3T3W5J.js";
|
|
28
|
+
import "./chunk-NNHHXJB2.js";
|
|
29
|
+
import {
|
|
30
|
+
EXIT_CODE,
|
|
31
|
+
FRONT_MATTER_KEY_ORDER,
|
|
25
32
|
getHistoryPath,
|
|
26
33
|
getItemPath,
|
|
27
34
|
getSettingsPath,
|
|
28
35
|
pathExists,
|
|
29
|
-
projectAfterCommandItemSnapshot,
|
|
30
|
-
readSettings,
|
|
31
|
-
recordAfterCommandAffectedItem,
|
|
32
36
|
removeFileIfExists,
|
|
33
37
|
resolveItemTypeRegistry,
|
|
34
38
|
resolvePmRoot,
|
|
35
39
|
resolveRuntimeStatusRegistry,
|
|
36
|
-
runActiveOnWriteHooks,
|
|
37
40
|
writeFileAtomic
|
|
38
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-YD5FML7K.js";
|
|
39
42
|
|
|
40
43
|
// dist/cli/commands/copy.js
|
|
41
44
|
function selectAuthor(explicitAuthor, settingsAuthor) {
|
|
@@ -104,7 +107,7 @@ async function runCopy(sourceId, options, global) {
|
|
|
104
107
|
const changedFields = buildChangedFields(copiedDocument.metadata, copiedDocument.body);
|
|
105
108
|
const itemPath = getItemPath(pmRoot, copiedDocument.metadata.type, newId, settings.item_format, typeRegistry.type_to_folder);
|
|
106
109
|
const historyPath = getHistoryPath(pmRoot, newId);
|
|
107
|
-
const lockRelease = await acquireLock(pmRoot, newId, settings.locks.ttl_seconds, author, false, settings.governance.force_required_for_stale_lock);
|
|
110
|
+
const lockRelease = await acquireLock(pmRoot, newId, settings.locks.ttl_seconds, author, false, settings.governance.force_required_for_stale_lock, settings.locks.wait_ms);
|
|
108
111
|
const beforeDocument = {
|
|
109
112
|
metadata: {},
|
|
110
113
|
body: ""
|
|
@@ -173,6 +176,6 @@ async function runCopy(sourceId, options, global) {
|
|
|
173
176
|
export {
|
|
174
177
|
runCopy
|
|
175
178
|
};
|
|
176
|
-
//# sourceMappingURL=copy-
|
|
179
|
+
//# sourceMappingURL=copy-OTJOWFL6.js.map
|
|
177
180
|
|
|
178
|
-
//# debugId=
|
|
181
|
+
//# debugId=87535522-3134-55f3-a73d-9742db5c6296
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/copy.ts"],"sourcesContent":["/**\n * @module cli/commands/copy\n *\n * Implements the pm copy command surface and its agent-facing runtime behavior.\n */\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { appendHistoryEntry, createHistoryEntry } from \"../../core/history/history.js\";\nimport { generateItemId } from \"../../core/item/id.js\";\nimport { canonicalDocument, serializeItemDocument } from \"../../core/item/item-format.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { collectRegisteredItemFieldNames } from \"../../core/extensions/item-fields.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { buildItemNotFoundError, 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 type { ItemDocument, ItemMetadata } from \"../../types/index.js\";\n\n/**\n * Documents the copy options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CopyOptions {\n title?: string;\n author?: string;\n message?: string;\n}\n\n/**\n * Documents the copy result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CopyResult {\n source_id: string;\n item: ItemMetadata;\n changed_fields: string[];\n warnings: string[];\n}\n\nfunction selectAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const candidate = explicitAuthor ?? process.env.PM_AUTHOR ?? settingsAuthor;\n const trimmed = candidate.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\nfunction buildChangedFields(frontMatter: ItemMetadata, body: string): string[] {\n const changed = [\n ...new Set([\n ...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),\n ...Object.keys(frontMatter).filter((key) => frontMatter[key] !== undefined),\n ...(body.length > 0 ? [\"body\"] : []),\n ]),\n ];\n return changed.sort((left, right) => left.localeCompare(right));\n}\n\nfunction buildCopyMessage(sourceId: string, message: string | undefined): string {\n const suffix = `copied_from=${sourceId}`;\n if (!message) {\n return suffix;\n }\n const trimmed = message.trim();\n return trimmed.length > 0 ? `${trimmed} | ${suffix}` : suffix;\n}\n\n/**\n * Implements run copy for the public runtime surface of this module.\n */\nexport async function runCopy(sourceId: string, options: CopyOptions, global: GlobalOptions): Promise<CopyResult> {\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 located = await locateItem(pmRoot, sourceId, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, sourceId, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const sourceLoaded = await readLocatedItem(located, { schema: settings.schema });\n const sourceMetadata = sourceLoaded.document.metadata;\n const copiedAt = nowIso();\n const author = selectAuthor(options.author, settings.author_default);\n const newId = await generateItemId(pmRoot, settings.id_prefix);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const titleOverride = options.title?.trim();\n if (titleOverride !== undefined && titleOverride.length === 0) {\n throw new PmCliError(\"Copy --title must not be empty\", EXIT_CODE.USAGE);\n }\n\n const copiedMetadata: ItemMetadata = {\n ...(sourceMetadata as Record<string, unknown>),\n id: newId,\n title: titleOverride ?? sourceMetadata.title,\n status: statusRegistry.open_status,\n created_at: copiedAt,\n updated_at: copiedAt,\n } as ItemMetadata;\n delete copiedMetadata.closed_at;\n delete copiedMetadata.close_reason;\n delete copiedMetadata.test_runs;\n\n const extensionFieldNames = collectRegisteredItemFieldNames(getActiveExtensionRegistrations());\n const copiedDocument = canonicalDocument(\n {\n metadata: copiedMetadata,\n body: sourceLoaded.document.body,\n },\n {\n schema: settings.schema,\n extensionFieldNames,\n },\n );\n const changedFields = buildChangedFields(copiedDocument.metadata, copiedDocument.body);\n const itemPath = getItemPath(pmRoot, copiedDocument.metadata.type, newId, settings.item_format, typeRegistry.type_to_folder);\n const historyPath = getHistoryPath(pmRoot, newId);\n const lockRelease = await acquireLock(\n pmRoot,\n newId,\n settings.locks.ttl_seconds,\n author,\n false,\n settings.governance.force_required_for_stale_lock,\n );\n const beforeDocument: ItemDocument = {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n\n let hookWarnings: string[] = [];\n try {\n await writeFileAtomic(\n itemPath,\n serializeItemDocument(copiedDocument, {\n format: settings.item_format,\n schema: settings.schema,\n extensionFieldNames,\n }),\n );\n try {\n const historyEntry = createHistoryEntry({\n nowIso: copiedAt,\n author,\n op: \"create\",\n before: beforeDocument,\n after: copiedDocument,\n message: buildCopyMessage(located.id, options.message),\n });\n await appendHistoryEntry(historyPath, historyEntry);\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n\n hookWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"create\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"create:history\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ];\n recordAfterCommandAffectedItem({\n id: copiedDocument.metadata.id,\n op: \"create\",\n item_type: copiedDocument.metadata.type,\n status: copiedDocument.metadata.status,\n current: projectAfterCommandItemSnapshot(copiedDocument.metadata, changedFields),\n changed_fields: changedFields,\n });\n } finally {\n await lockRelease();\n }\n\n return {\n source_id: located.id,\n item: structuredClone(copiedDocument.metadata),\n changed_fields: changedFields,\n warnings: hookWarnings,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAS,aAAa,gBAAoC,gBAAsB;AAC9E,QAAM,YAAY,kBAAkB,QAAQ,IAAI,aAAa;AAC7D,QAAM,UAAU,UAAU,KAAI;AAC9B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAEA,SAAS,mBAAmB,aAA2B,MAAY;AACjE,QAAM,UAAU;IACd,GAAG,oBAAI,IAAI;MACT,GAAG,uBAAuB,OAAO,CAAC,QAAQ,YAAY,GAAG,MAAM,MAAS;MACxE,GAAG,OAAO,KAAK,WAAW,EAAE,OAAO,CAAC,QAAQ,YAAY,GAAG,MAAM,MAAS;MAC1E,GAAI,KAAK,SAAS,IAAI,CAAC,MAAM,IAAI,CAAA;KAClC;;AAEH,SAAO,QAAQ,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AAChE;AAEA,SAAS,iBAAiB,UAAkB,SAA2B;AACrE,QAAM,SAAS,eAAe,QAAQ;AACtC,MAAI,CAAC,SAAS;AACZ,WAAO;EACT;AACA,QAAM,UAAU,QAAQ,KAAI;AAC5B,SAAO,QAAQ,SAAS,IAAI,GAAG,OAAO,MAAM,MAAM,KAAK;AACzD;AAKA,eAAsB,QAAQ,UAAkB,SAAsB,QAAqB;AACzF,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW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,KAAK;AAChD,QAAM,cAAc,MAAM,YACxB,QACA,OACA,SAAS,MAAM,aACf,QACA,OACA,SAAS,WAAW,6BAA6B;AAEnD,QAAM,iBAA+B;IACnC,UAAU,CAAA;IACV,MAAM;;AAGR,MAAI,eAAyB,CAAA;AAC7B,MAAI;AACF,UAAM,gBACJ,UACA,sBAAsB,gBAAgB;MACpC,QAAQ,SAAS;MACjB,QAAQ,SAAS;MACjB;KACD,CAAC;AAEJ,QAAI;AACF,YAAM,eAAe,mBAAmB;QACtC,QAAQ;QACR;QACA,IAAI;QACJ,QAAQ;QACR,OAAO;QACP,SAAS,iBAAiB,QAAQ,IAAI,QAAQ,OAAO;OACtD;AACD,YAAM,mBAAmB,aAAa,YAAY;IACpD,SAAS,OAAgB;AACvB,YAAM,mBAAmB,QAAQ;AACjC,YAAM;IACR;AAEA,mBAAe;MACb,GAAI,MAAM,sBAAsB;QAC9B,MAAM;QACN,OAAO;QACP,IAAI;QACJ,SAAS,eAAe,SAAS;QACjC,WAAW,eAAe,SAAS;QACnC,QAAQ;QACR,OAAO;QACP,gBAAgB;OACjB;MACD,GAAI,MAAM,sBAAsB;QAC9B,MAAM;QACN,OAAO;QACP,IAAI;QACJ,SAAS,eAAe,SAAS;QACjC,WAAW,eAAe,SAAS;QACnC,QAAQ;QACR,OAAO;QACP,gBAAgB;OACjB;;AAEH,mCAA+B;MAC7B,IAAI,eAAe,SAAS;MAC5B,IAAI;MACJ,WAAW,eAAe,SAAS;MACnC,QAAQ,eAAe,SAAS;MAChC,SAAS,gCAAgC,eAAe,UAAU,aAAa;MAC/E,gBAAgB;KACjB;EACH;AACE,UAAM,YAAW;EACnB;AAEA,SAAO;IACL,WAAW,QAAQ;IACnB,MAAM,gBAAgB,eAAe,QAAQ;IAC7C,gBAAgB;IAChB,UAAU;;AAEd","debugId":"ef76891a-4665-5bfa-a21b-9853c596cacc"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/copy.ts"],"sourcesContent":["/**\n * @module cli/commands/copy\n *\n * Implements the pm copy command surface and its agent-facing runtime behavior.\n */\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { appendHistoryEntry, createHistoryEntry } from \"../../core/history/history.js\";\nimport { generateItemId } from \"../../core/item/id.js\";\nimport { canonicalDocument, serializeItemDocument } from \"../../core/item/item-format.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { collectRegisteredItemFieldNames } from \"../../core/extensions/item-fields.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { buildItemNotFoundError, 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 type { ItemDocument, ItemMetadata } from \"../../types/index.js\";\n\n/**\n * Documents the copy options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CopyOptions {\n title?: string;\n author?: string;\n message?: string;\n}\n\n/**\n * Documents the copy result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CopyResult {\n source_id: string;\n item: ItemMetadata;\n changed_fields: string[];\n warnings: string[];\n}\n\nfunction selectAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const candidate = explicitAuthor ?? process.env.PM_AUTHOR ?? settingsAuthor;\n const trimmed = candidate.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\nfunction buildChangedFields(frontMatter: ItemMetadata, body: string): string[] {\n const changed = [\n ...new Set([\n ...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),\n ...Object.keys(frontMatter).filter((key) => frontMatter[key] !== undefined),\n ...(body.length > 0 ? [\"body\"] : []),\n ]),\n ];\n return changed.sort((left, right) => left.localeCompare(right));\n}\n\nfunction buildCopyMessage(sourceId: string, message: string | undefined): string {\n const suffix = `copied_from=${sourceId}`;\n if (!message) {\n return suffix;\n }\n const trimmed = message.trim();\n return trimmed.length > 0 ? `${trimmed} | ${suffix}` : suffix;\n}\n\n/**\n * Implements run copy for the public runtime surface of this module.\n */\nexport async function runCopy(sourceId: string, options: CopyOptions, global: GlobalOptions): Promise<CopyResult> {\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 located = await locateItem(pmRoot, sourceId, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, sourceId, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const sourceLoaded = await readLocatedItem(located, { schema: settings.schema });\n const sourceMetadata = sourceLoaded.document.metadata;\n const copiedAt = nowIso();\n const author = selectAuthor(options.author, settings.author_default);\n const newId = await generateItemId(pmRoot, settings.id_prefix);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const titleOverride = options.title?.trim();\n if (titleOverride !== undefined && titleOverride.length === 0) {\n throw new PmCliError(\"Copy --title must not be empty\", EXIT_CODE.USAGE);\n }\n\n const copiedMetadata: ItemMetadata = {\n ...(sourceMetadata as Record<string, unknown>),\n id: newId,\n title: titleOverride ?? sourceMetadata.title,\n status: statusRegistry.open_status,\n created_at: copiedAt,\n updated_at: copiedAt,\n } as ItemMetadata;\n delete copiedMetadata.closed_at;\n delete copiedMetadata.close_reason;\n delete copiedMetadata.test_runs;\n\n const extensionFieldNames = collectRegisteredItemFieldNames(getActiveExtensionRegistrations());\n const copiedDocument = canonicalDocument(\n {\n metadata: copiedMetadata,\n body: sourceLoaded.document.body,\n },\n {\n schema: settings.schema,\n extensionFieldNames,\n },\n );\n const changedFields = buildChangedFields(copiedDocument.metadata, copiedDocument.body);\n const itemPath = getItemPath(pmRoot, copiedDocument.metadata.type, newId, settings.item_format, typeRegistry.type_to_folder);\n const historyPath = getHistoryPath(pmRoot, newId);\n const lockRelease = await acquireLock(\n pmRoot,\n newId,\n settings.locks.ttl_seconds,\n author,\n false,\n settings.governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n );\n const beforeDocument: ItemDocument = {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n\n let hookWarnings: string[] = [];\n try {\n await writeFileAtomic(\n itemPath,\n serializeItemDocument(copiedDocument, {\n format: settings.item_format,\n schema: settings.schema,\n extensionFieldNames,\n }),\n );\n try {\n const historyEntry = createHistoryEntry({\n nowIso: copiedAt,\n author,\n op: \"create\",\n before: beforeDocument,\n after: copiedDocument,\n message: buildCopyMessage(located.id, options.message),\n });\n await appendHistoryEntry(historyPath, historyEntry);\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n\n hookWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"create\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"create:history\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ];\n recordAfterCommandAffectedItem({\n id: copiedDocument.metadata.id,\n op: \"create\",\n item_type: copiedDocument.metadata.type,\n status: copiedDocument.metadata.status,\n current: projectAfterCommandItemSnapshot(copiedDocument.metadata, changedFields),\n changed_fields: changedFields,\n });\n } finally {\n await lockRelease();\n }\n\n return {\n source_id: located.id,\n item: structuredClone(copiedDocument.metadata),\n changed_fields: changedFields,\n warnings: hookWarnings,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAS,aAAa,gBAAoC,gBAAsB;AAC9E,QAAM,YAAY,kBAAkB,QAAQ,IAAI,aAAa;AAC7D,QAAM,UAAU,UAAU,KAAI;AAC9B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAEA,SAAS,mBAAmB,aAA2B,MAAY;AACjE,QAAM,UAAU;IACd,GAAG,oBAAI,IAAI;MACT,GAAG,uBAAuB,OAAO,CAAC,QAAQ,YAAY,GAAG,MAAM,MAAS;MACxE,GAAG,OAAO,KAAK,WAAW,EAAE,OAAO,CAAC,QAAQ,YAAY,GAAG,MAAM,MAAS;MAC1E,GAAI,KAAK,SAAS,IAAI,CAAC,MAAM,IAAI,CAAA;KAClC;;AAEH,SAAO,QAAQ,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AAChE;AAEA,SAAS,iBAAiB,UAAkB,SAA2B;AACrE,QAAM,SAAS,eAAe,QAAQ;AACtC,MAAI,CAAC,SAAS;AACZ,WAAO;EACT;AACA,QAAM,UAAU,QAAQ,KAAI;AAC5B,SAAO,QAAQ,SAAS,IAAI,GAAG,OAAO,MAAM,MAAM,KAAK;AACzD;AAKA,eAAsB,QAAQ,UAAkB,SAAsB,QAAqB;AACzF,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WAAW,iCAAiC,MAAM,wBAAwB,UAAU,SAAS;EACzG;AAEA,QAAM,WAAW,MAAM,aAAa,MAAM;AA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"./chunk-MTTXDAK4.js";
|
|
9
|
+
import "./chunk-BVEUCSH2.js";
|
|
10
|
+
import "./chunk-T3ABIMGW.js";
|
|
11
|
+
import "./chunk-ZMD35NYG.js";
|
|
12
|
+
import "./chunk-ZD34OFFQ.js";
|
|
13
|
+
import "./chunk-5HIZDR5A.js";
|
|
14
|
+
import "./chunk-3U3VEWK6.js";
|
|
15
|
+
import "./chunk-OWTIRHX4.js";
|
|
16
|
+
import "./chunk-EZFKWSC7.js";
|
|
17
|
+
import "./chunk-DRBV5UC2.js";
|
|
18
|
+
import "./chunk-P5YORJRH.js";
|
|
19
|
+
import "./chunk-T35XLYZF.js";
|
|
20
|
+
import "./chunk-7C2O74AE.js";
|
|
21
|
+
import "./chunk-5VVUKE3U.js";
|
|
22
|
+
export {
|
|
23
|
+
_testOnlyCreateCommand,
|
|
24
|
+
parseDocs,
|
|
25
|
+
parseFiles,
|
|
26
|
+
parseLogSeed,
|
|
27
|
+
parseTests,
|
|
28
|
+
runCreate
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=create-WKOZKPQR.js.map
|
|
@@ -7,18 +7,20 @@ import {
|
|
|
7
7
|
parseLogSeed,
|
|
8
8
|
parseTests,
|
|
9
9
|
runCreate
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-NBFCNJ7Q.js";
|
|
11
|
+
import "./chunk-MZ7VNEVY.js";
|
|
12
|
+
import "./chunk-7WYXBPYQ.js";
|
|
13
|
+
import "./chunk-PDXT6Q55.js";
|
|
14
|
+
import "./chunk-4OFLJHX6.js";
|
|
15
15
|
import "./chunk-P4SESZGT.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-57C2RLW5.js";
|
|
17
|
+
import "./chunk-7MDXZAZS.js";
|
|
18
|
+
import "./chunk-HK72NWAD.js";
|
|
19
|
+
import "./chunk-FJRKQREY.js";
|
|
20
|
+
import "./chunk-US3T3W5J.js";
|
|
21
|
+
import "./chunk-NER3KUUS.js";
|
|
22
|
+
import "./chunk-NNHHXJB2.js";
|
|
23
|
+
import "./chunk-YD5FML7K.js";
|
|
22
24
|
export {
|
|
23
25
|
_testOnlyCreateCommand,
|
|
24
26
|
parseDocs,
|
|
@@ -27,6 +29,6 @@ export {
|
|
|
27
29
|
parseTests,
|
|
28
30
|
runCreate
|
|
29
31
|
};
|
|
30
|
-
//# sourceMappingURL=create-
|
|
32
|
+
//# sourceMappingURL=create-XWWQFQ6S.js.map
|
|
31
33
|
|
|
32
34
|
//# debugId=45eac7fa-f181-5cca-93b7-cfb58909dbb3
|
|
@@ -4,17 +4,20 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
deleteItem,
|
|
6
6
|
toItemRecord
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-3U3VEWK6.js";
|
|
8
|
+
import "./chunk-EZFKWSC7.js";
|
|
9
|
+
import "./chunk-DRBV5UC2.js";
|
|
10
10
|
import {
|
|
11
|
-
EXIT_CODE,
|
|
12
11
|
PmCliError,
|
|
12
|
+
readSettings
|
|
13
|
+
} from "./chunk-P5YORJRH.js";
|
|
14
|
+
import "./chunk-7C2O74AE.js";
|
|
15
|
+
import {
|
|
16
|
+
EXIT_CODE,
|
|
13
17
|
getSettingsPath,
|
|
14
18
|
pathExists,
|
|
15
|
-
readSettings,
|
|
16
19
|
resolvePmRoot
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5VVUKE3U.js";
|
|
18
21
|
|
|
19
22
|
// dist/cli/commands/delete.js
|
|
20
23
|
import path from "node:path";
|
|
@@ -53,4 +56,4 @@ async function runDelete(id, options, global2) {
|
|
|
53
56
|
export {
|
|
54
57
|
runDelete
|
|
55
58
|
};
|
|
56
|
-
//# sourceMappingURL=delete-
|
|
59
|
+
//# sourceMappingURL=delete-62JQTYT4.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../cli/commands/delete.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * @module cli/commands/delete\n *\n * Implements the pm delete command surface and its agent-facing runtime behavior.\n */\nimport path from \"node:path\";\nimport { pathExists } 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 { toItemRecord } from \"../../core/item/item-record.js\";\nimport { deleteItem } 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\";\n\n/**\n * Documents the delete command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DeleteCommandOptions {\n author?: string;\n message?: string;\n force?: boolean;\n dryRun?: boolean;\n}\n\n/**\n * Documents the delete result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DeleteResult {\n item: Record<string, unknown>;\n changed_fields: string[];\n dry_run: boolean;\n target_path?: string;\n warnings: string[];\n}\n\n/**\n * Implements run delete for the public runtime surface of this module.\n */\nexport async function runDelete(id: string, options: DeleteCommandOptions, global: GlobalOptions): Promise<DeleteResult> {\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 author = resolveAuthor(options.author, settings.author_default);\n\n const result = await deleteItem({\n pmRoot,\n settings,\n id,\n author,\n message: options.message,\n force: options.force,\n dryRun: options.dryRun,\n });\n const targetPath = result.targetPath ? path.relative(pmRoot, result.targetPath).split(path.sep).join(\"/\") : undefined;\n\n return {\n item: toItemRecord(result.item),\n changed_fields: result.changedFields,\n dry_run: options.dryRun === true,\n ...(targetPath ? { target_path: targetPath } : {}),\n warnings: result.warnings,\n };\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,UAAU;;;;;;;;AAmCjB,eAAsB,UAAU,IAAY,SAA+BA,SAAqB;AAC9F,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAIA,QAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WAAW,iCAAiC,MAAM,wBAAwB,UAAU,SAAS;EACzG;AAEA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,SAAS,cAAc,QAAQ,QAAQ,SAAS,cAAc;AAEpE,QAAM,SAAS,MAAM,WAAW;IAC9B;IACA;IACA;IACA;IACA,SAAS,QAAQ;IACjB,OAAO,QAAQ;IACf,QAAQ,QAAQ;GACjB;AACD,QAAM,aAAa,OAAO,aAAa,KAAK,SAAS,QAAQ,OAAO,UAAU,EAAE,MAAM,KAAK,GAAG,EAAE,KAAK,GAAG,IAAI;AAE5G,SAAO;IACL,MAAM,aAAa,OAAO,IAAI;IAC9B,gBAAgB,OAAO;IACvB,SAAS,QAAQ,WAAW;IAC5B,GAAI,aAAa,EAAE,aAAa,WAAU,IAAK,CAAA;IAC/C,UAAU,OAAO;;AAErB;",
|
|
6
6
|
"names": ["global"]
|
|
7
7
|
}
|
|
@@ -1,22 +1,25 @@
|
|
|
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]="3bb8ab76-749c-5201-a2b1-dfa3f3019241")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
resolveAuthor
|
|
5
5
|
} from "./chunk-T5RRNDA7.js";
|
|
6
6
|
import {
|
|
7
7
|
deleteItem,
|
|
8
8
|
toItemRecord
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-57C2RLW5.js";
|
|
10
|
+
import "./chunk-HK72NWAD.js";
|
|
11
|
+
import "./chunk-FJRKQREY.js";
|
|
12
12
|
import {
|
|
13
|
-
EXIT_CODE,
|
|
14
13
|
PmCliError,
|
|
14
|
+
readSettings
|
|
15
|
+
} from "./chunk-US3T3W5J.js";
|
|
16
|
+
import "./chunk-NNHHXJB2.js";
|
|
17
|
+
import {
|
|
18
|
+
EXIT_CODE,
|
|
15
19
|
getSettingsPath,
|
|
16
20
|
pathExists,
|
|
17
|
-
readSettings,
|
|
18
21
|
resolvePmRoot
|
|
19
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YD5FML7K.js";
|
|
20
23
|
|
|
21
24
|
// dist/cli/commands/delete.js
|
|
22
25
|
import path from "node:path";
|
|
@@ -48,6 +51,6 @@ async function runDelete(id, options, global) {
|
|
|
48
51
|
export {
|
|
49
52
|
runDelete
|
|
50
53
|
};
|
|
51
|
-
//# sourceMappingURL=delete-
|
|
54
|
+
//# sourceMappingURL=delete-HQKGRNRZ.js.map
|
|
52
55
|
|
|
53
|
-
//# debugId=
|
|
56
|
+
//# debugId=3bb8ab76-749c-5201-a2b1-dfa3f3019241
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/delete.ts"],"sourcesContent":["/**\n * @module cli/commands/delete\n *\n * Implements the pm delete command surface and its agent-facing runtime behavior.\n */\nimport path from \"node:path\";\nimport { pathExists } 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 { toItemRecord } from \"../../core/item/item-record.js\";\nimport { deleteItem } 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\";\n\n/**\n * Documents the delete command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DeleteCommandOptions {\n author?: string;\n message?: string;\n force?: boolean;\n dryRun?: boolean;\n}\n\n/**\n * Documents the delete result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DeleteResult {\n item: Record<string, unknown>;\n changed_fields: string[];\n dry_run: boolean;\n target_path?: string;\n warnings: string[];\n}\n\n/**\n * Implements run delete for the public runtime surface of this module.\n */\nexport async function runDelete(id: string, options: DeleteCommandOptions, global: GlobalOptions): Promise<DeleteResult> {\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 author = resolveAuthor(options.author, settings.author_default);\n\n const result = await deleteItem({\n pmRoot,\n settings,\n id,\n author,\n message: options.message,\n force: options.force,\n dryRun: options.dryRun,\n });\n const targetPath = result.targetPath ? path.relative(pmRoot, result.targetPath).split(path.sep).join(\"/\") : undefined;\n\n return {\n item: toItemRecord(result.item),\n changed_fields: result.changedFields,\n dry_run: options.dryRun === true,\n ...(targetPath ? { target_path: targetPath } : {}),\n warnings: result.warnings,\n };\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/delete.ts"],"sourcesContent":["/**\n * @module cli/commands/delete\n *\n * Implements the pm delete command surface and its agent-facing runtime behavior.\n */\nimport path from \"node:path\";\nimport { pathExists } 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 { toItemRecord } from \"../../core/item/item-record.js\";\nimport { deleteItem } 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\";\n\n/**\n * Documents the delete command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DeleteCommandOptions {\n author?: string;\n message?: string;\n force?: boolean;\n dryRun?: boolean;\n}\n\n/**\n * Documents the delete result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DeleteResult {\n item: Record<string, unknown>;\n changed_fields: string[];\n dry_run: boolean;\n target_path?: string;\n warnings: string[];\n}\n\n/**\n * Implements run delete for the public runtime surface of this module.\n */\nexport async function runDelete(id: string, options: DeleteCommandOptions, global: GlobalOptions): Promise<DeleteResult> {\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 author = resolveAuthor(options.author, settings.author_default);\n\n const result = await deleteItem({\n pmRoot,\n settings,\n id,\n author,\n message: options.message,\n force: options.force,\n dryRun: options.dryRun,\n });\n const targetPath = result.targetPath ? path.relative(pmRoot, result.targetPath).split(path.sep).join(\"/\") : undefined;\n\n return {\n item: toItemRecord(result.item),\n changed_fields: result.changedFields,\n dry_run: options.dryRun === true,\n ...(targetPath ? { target_path: targetPath } : {}),\n warnings: result.warnings,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,UAAU;AAmCjB,eAAsB,UAAU,IAAY,SAA+B,QAAqB;AAC9F,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WAAW,iCAAiC,MAAM,wBAAwB,UAAU,SAAS;EACzG;AAEA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,SAAS,cAAc,QAAQ,QAAQ,SAAS,cAAc;AAEpE,QAAM,SAAS,MAAM,WAAW;IAC9B;IACA;IACA;IACA;IACA,SAAS,QAAQ;IACjB,OAAO,QAAQ;IACf,QAAQ,QAAQ;GACjB;AACD,QAAM,aAAa,OAAO,aAAa,KAAK,SAAS,QAAQ,OAAO,UAAU,EAAE,MAAM,KAAK,GAAG,EAAE,KAAK,GAAG,IAAI;AAE5G,SAAO;IACL,MAAM,aAAa,OAAO,IAAI;IAC9B,gBAAgB,OAAO;IACvB,SAAS,QAAQ,WAAW;IAC5B,GAAI,aAAa,EAAE,aAAa,WAAU,IAAK,CAAA;IAC/C,UAAU,OAAO;;AAErB","debugId":"3bb8ab76-749c-5201-a2b1-dfa3f3019241"}
|
|
@@ -1,20 +1,23 @@
|
|
|
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]="9f5bd1d8-0152-5389-9939-5bd3b047e020")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
listAllFrontMatterLight
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-57C2RLW5.js";
|
|
6
|
+
import "./chunk-HK72NWAD.js";
|
|
7
|
+
import "./chunk-FJRKQREY.js";
|
|
8
8
|
import {
|
|
9
|
-
EXIT_CODE,
|
|
10
9
|
PmCliError,
|
|
11
10
|
getActiveExtensionRegistrations,
|
|
11
|
+
readSettings
|
|
12
|
+
} from "./chunk-US3T3W5J.js";
|
|
13
|
+
import "./chunk-NNHHXJB2.js";
|
|
14
|
+
import {
|
|
15
|
+
EXIT_CODE,
|
|
12
16
|
getSettingsPath,
|
|
13
17
|
pathExists,
|
|
14
|
-
readSettings,
|
|
15
18
|
resolveItemTypeRegistry,
|
|
16
19
|
resolvePmRoot
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YD5FML7K.js";
|
|
18
21
|
|
|
19
22
|
// dist/cli/commands/deps.js
|
|
20
23
|
var DEPS_FORMAT_VALUES = ["tree", "graph"];
|
|
@@ -216,6 +219,6 @@ export {
|
|
|
216
219
|
DEPS_FORMAT_VALUES,
|
|
217
220
|
runDeps
|
|
218
221
|
};
|
|
219
|
-
//# sourceMappingURL=deps-
|
|
222
|
+
//# sourceMappingURL=deps-55FTG6Z5.js.map
|
|
220
223
|
|
|
221
|
-
//# debugId=
|
|
224
|
+
//# debugId=9f5bd1d8-0152-5389-9939-5bd3b047e020
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/deps.ts"],"sourcesContent":["/**\n * @module cli/commands/deps\n *\n * Implements the pm deps command surface and its agent-facing runtime behavior.\n */\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.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 { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { Dependency, ItemFrontMatter, ItemStatus, ItemType } from \"../../types/index.js\";\n\nexport const DEPS_FORMAT_VALUES = [\"tree\", \"graph\"] as const;\n/**\n * Restricts deps format values accepted by command, SDK, and storage contracts.\n */\nexport type DepsFormat = (typeof DEPS_FORMAT_VALUES)[number];\nexport const DEPS_COLLAPSE_VALUES = [\"none\", \"repeated\"] as const;\n/**\n * Restricts deps collapse mode values accepted by command, SDK, and storage contracts.\n */\nexport type DepsCollapseMode = (typeof DEPS_COLLAPSE_VALUES)[number];\n\n/**\n * Documents the deps command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsCommandOptions {\n format?: string;\n maxDepth?: string | number;\n collapse?: string;\n summary?: boolean;\n}\n\ninterface IndexedItem {\n id: string;\n title: string;\n type: ItemType;\n status: ItemStatus;\n dependencies: Dependency[];\n}\n\n/**\n * Documents the deps tree node payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsTreeNode {\n id: string;\n title?: string;\n type?: ItemType;\n status?: ItemStatus;\n via?: string;\n missing: boolean;\n cycle: boolean;\n truncated?: boolean;\n collapsed?: boolean;\n dependencies: DepsTreeNode[];\n}\n\n/**\n * Documents the deps graph node payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsGraphNode {\n id: string;\n title?: string;\n type?: ItemType;\n status?: ItemStatus;\n missing: boolean;\n}\n\n/**\n * Documents the deps graph edge payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsGraphEdge {\n from: string;\n to: string;\n kind: string;\n}\n\n/**\n * Documents the deps graph result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsGraphResult {\n root_id: string;\n nodes: DepsGraphNode[];\n edges: DepsGraphEdge[];\n missing_ids: string[];\n}\n\n/**\n * Documents the deps result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsResult {\n id: string;\n format: DepsFormat;\n node_count: number;\n edge_count: number;\n missing_count: number;\n tree?: DepsTreeNode;\n graph?: DepsGraphResult;\n}\n\nfunction parseFormat(raw: string | undefined): DepsFormat {\n const candidate = raw?.trim().toLowerCase() ?? \"tree\";\n if ((DEPS_FORMAT_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsFormat;\n }\n throw new PmCliError(`Invalid --format value \"${raw}\". Use \"tree\" or \"graph\".`, EXIT_CODE.USAGE);\n}\n\nfunction parseMaxDepth(raw: string | number | undefined): number | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = typeof raw === \"number\" ? raw : Number(raw.trim());\n if (!Number.isInteger(normalized) || normalized < 0) {\n throw new PmCliError(`Invalid --max-depth value \"${raw}\". Use a non-negative integer.`, EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction parseCollapse(raw: string | undefined): DepsCollapseMode {\n const candidate = raw?.trim().toLowerCase() ?? \"none\";\n if ((DEPS_COLLAPSE_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsCollapseMode;\n }\n throw new PmCliError(`Invalid --collapse value \"${raw}\". Use \"none\" or \"repeated\".`, EXIT_CODE.USAGE);\n}\n\nfunction normalizeDependencies(dependencies: Dependency[] | undefined): Dependency[] {\n if (!dependencies || dependencies.length === 0) {\n return [];\n }\n const sorted = [...dependencies].sort((left, right) => {\n const byKind = left.kind.localeCompare(right.kind);\n if (byKind !== 0) return byKind;\n const byId = left.id.localeCompare(right.id);\n if (byId !== 0) return byId;\n return left.created_at.localeCompare(right.created_at);\n });\n const deduped = new Map<string, Dependency>();\n for (const dependency of sorted) {\n const key = `${dependency.kind}::${dependency.id}`;\n if (!deduped.has(key)) {\n deduped.set(key, dependency);\n }\n }\n return [...deduped.values()];\n}\n\nfunction toIndexedItem(item: ItemFrontMatter): IndexedItem {\n return {\n id: item.id,\n title: item.title,\n type: item.type,\n status: item.status,\n dependencies: normalizeDependencies(item.dependencies),\n };\n}\n\nfunction toTreeNode(\n id: string,\n index: Map<string, IndexedItem>,\n lineage: Set<string>,\n maxDepth: number | undefined,\n collapse: DepsCollapseMode,\n expanded: Set<string>,\n depth = 0,\n via?: string,\n): DepsTreeNode {\n const item = index.get(id);\n const baseNode: DepsTreeNode = {\n id,\n title: item?.title,\n type: item?.type,\n status: item?.status,\n via,\n missing: !item,\n cycle: lineage.has(id),\n dependencies: [],\n };\n if (!item || baseNode.cycle) {\n return baseNode;\n }\n if (maxDepth !== undefined && depth >= maxDepth) {\n if (item.dependencies.length > 0) {\n baseNode.truncated = true;\n }\n return baseNode;\n }\n if (collapse === \"repeated\" && expanded.has(id)) {\n baseNode.collapsed = true;\n return baseNode;\n }\n if (collapse === \"repeated\") {\n expanded.add(id);\n }\n const nextLineage = new Set(lineage);\n nextLineage.add(id);\n baseNode.dependencies = item.dependencies.map((dependency) =>\n toTreeNode(dependency.id, index, nextLineage, maxDepth, collapse, expanded, depth + 1, dependency.kind),\n );\n return baseNode;\n}\n\nfunction mergeGraphNode(existing: DepsGraphNode | undefined, candidate: DepsGraphNode): DepsGraphNode {\n if (!existing) {\n return candidate;\n }\n /* c8 ignore start -- defensive: mixed missing/non-missing duplicates only occur in malformed synthetic trees. */\n if (existing.missing && !candidate.missing) return candidate;\n /* c8 ignore stop */\n return {\n ...existing,\n title: existing.title ?? candidate.title,\n type: existing.type ?? candidate.type,\n status: existing.status ?? candidate.status,\n };\n}\n\nfunction toGraph(root: DepsTreeNode): DepsGraphResult {\n const nodesById = new Map<string, DepsGraphNode>();\n const edgesByKey = new Map<string, DepsGraphEdge>();\n\n const visit = (node: DepsTreeNode): void => {\n nodesById.set(\n node.id,\n mergeGraphNode(nodesById.get(node.id), {\n id: node.id,\n title: node.title,\n type: node.type,\n status: node.status,\n missing: node.missing,\n }),\n );\n for (const child of node.dependencies) {\n nodesById.set(\n child.id,\n mergeGraphNode(nodesById.get(child.id), {\n id: child.id,\n title: child.title,\n type: child.type,\n status: child.status,\n missing: child.missing,\n }),\n );\n /* c8 ignore start -- legacy malformed dependency payloads may omit kind/via. */\n const relationKind = child.via ?? \"related\";\n const edgeKey = `${node.id}::${child.id}::${relationKind}`;\n if (!edgesByKey.has(edgeKey)) {\n edgesByKey.set(edgeKey, {\n from: node.id,\n to: child.id,\n kind: relationKind,\n });\n }\n /* c8 ignore stop */\n if (!child.cycle) {\n visit(child);\n }\n }\n };\n\n visit(root);\n\n const nodes = [...nodesById.values()].sort((left, right) => left.id.localeCompare(right.id));\n const edges = [...edgesByKey.values()].sort((left, right) => {\n const byFrom = left.from.localeCompare(right.from);\n if (byFrom !== 0) return byFrom;\n const byTo = left.to.localeCompare(right.to);\n if (byTo !== 0) return byTo;\n return left.kind.localeCompare(right.kind);\n });\n const missingIds = nodes.filter((node) => node.missing).map((node) => node.id);\n return {\n root_id: root.id,\n nodes,\n edges,\n missing_ids: missingIds,\n };\n}\n\n/**\n * Implements run deps for the public runtime surface of this module.\n */\nexport async function runDeps(id: string, options: DepsCommandOptions, global: GlobalOptions): Promise<DepsResult> {\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 const format = parseFormat(options.format);\n const maxDepth = parseMaxDepth(options.maxDepth);\n const collapse = parseCollapse(options.collapse);\n const summaryOnly = options.summary === true;\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);\n const index = new Map(items.map((item) => [item.id, toIndexedItem(item)]));\n if (!index.has(id)) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n\n const tree = toTreeNode(id, index, new Set<string>(), maxDepth, collapse, new Set<string>());\n const graph = toGraph(tree);\n const baseResult = {\n id,\n format,\n node_count: graph.nodes.length,\n edge_count: graph.edges.length,\n missing_count: graph.missing_ids.length,\n };\n if (summaryOnly) {\n return baseResult;\n }\n if (format === \"tree\") {\n return {\n ...baseResult,\n tree,\n };\n }\n return {\n ...baseResult,\n graph,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAgBO,IAAM,qBAAqB,CAAC,QAAQ,OAAO;AAK3C,IAAM,uBAAuB,CAAC,QAAQ,UAAU;AAmFvD,SAAS,YAAY,KAAuB;AAC1C,QAAM,YAAY,KAAK,KAAI,EAAG,YAAW,KAAM;AAC/C,MAAK,mBAAyC,SAAS,SAAS,GAAG;AACjE,WAAO;EACT;AACA,QAAM,IAAI,WAAW,2BAA2B,GAAG,6BAA6B,UAAU,KAAK;AACjG;AAEA,SAAS,cAAc,KAAgC;AACrD,MAAI,QAAQ,QAAW;AACrB,WAAO;EACT;AACA,QAAM,aAAa,OAAO,QAAQ,WAAW,MAAM,OAAO,IAAI,KAAI,CAAE;AACpE,MAAI,CAAC,OAAO,UAAU,UAAU,KAAK,aAAa,GAAG;AACnD,UAAM,IAAI,WAAW,8BAA8B,GAAG,kCAAkC,UAAU,KAAK;EACzG;AACA,SAAO;AACT;AAEA,SAAS,cAAc,KAAuB;AAC5C,QAAM,YAAY,KAAK,KAAI,EAAG,YAAW,KAAM;AAC/C,MAAK,qBAA2C,SAAS,SAAS,GAAG;AACnE,WAAO;EACT;AACA,QAAM,IAAI,WAAW,6BAA6B,GAAG,gCAAgC,UAAU,KAAK;AACtG;AAEA,SAAS,sBAAsB,cAAsC;AACnE,MAAI,CAAC,gBAAgB,aAAa,WAAW,GAAG;AAC9C,WAAO,CAAA;EACT;AACA,QAAM,SAAS,CAAC,GAAG,YAAY,EAAE,KAAK,CAAC,MAAM,UAAS;AACpD,UAAM,SAAS,KAAK,KAAK,cAAc,MAAM,IAAI;AACjD,QAAI,WAAW;AAAG,aAAO;AACzB,UAAM,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C3F,QAAM,QAAQ,QAAQ,IAAI;AAC1B,QAAM,aAAa;IACjB;IACA;IACA,YAAY,MAAM,MAAM;IACxB,YAAY,MAAM,MAAM;IACxB,eAAe,MAAM,YAAY;;AAEnC,MAAI,aAAa;AACf,WAAO;EACT;AACA,MAAI,WAAW,QAAQ;AACrB,WAAO;MACL,GAAG;MACH;;EAEJ;AACA,SAAO;IACL,GAAG;IACH;;AAEJ","debugId":"52da0313-fc3b-54f5-85c9-1b1de7406518"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/deps.ts"],"sourcesContent":["/**\n * @module cli/commands/deps\n *\n * Implements the pm deps command surface and its agent-facing runtime behavior.\n */\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.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 { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { Dependency, ItemFrontMatter, ItemStatus, ItemType } from \"../../types/index.js\";\n\nexport const DEPS_FORMAT_VALUES = [\"tree\", \"graph\"] as const;\n/**\n * Restricts deps format values accepted by command, SDK, and storage contracts.\n */\nexport type DepsFormat = (typeof DEPS_FORMAT_VALUES)[number];\nexport const DEPS_COLLAPSE_VALUES = [\"none\", \"repeated\"] as const;\n/**\n * Restricts deps collapse mode values accepted by command, SDK, and storage contracts.\n */\nexport type DepsCollapseMode = (typeof DEPS_COLLAPSE_VALUES)[number];\n\n/**\n * Documents the deps command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsCommandOptions {\n format?: string;\n maxDepth?: string | number;\n collapse?: string;\n summary?: boolean;\n}\n\ninterface IndexedItem {\n id: string;\n title: string;\n type: ItemType;\n status: ItemStatus;\n dependencies: Dependency[];\n}\n\n/**\n * Documents the deps tree node payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsTreeNode {\n id: string;\n title?: string;\n type?: ItemType;\n status?: ItemStatus;\n via?: string;\n missing: boolean;\n cycle: boolean;\n truncated?: boolean;\n collapsed?: boolean;\n dependencies: DepsTreeNode[];\n}\n\n/**\n * Documents the deps graph node payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsGraphNode {\n id: string;\n title?: string;\n type?: ItemType;\n status?: ItemStatus;\n missing: boolean;\n}\n\n/**\n * Documents the deps graph edge payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsGraphEdge {\n from: string;\n to: string;\n kind: string;\n}\n\n/**\n * Documents the deps graph result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsGraphResult {\n root_id: string;\n nodes: DepsGraphNode[];\n edges: DepsGraphEdge[];\n missing_ids: string[];\n}\n\n/**\n * Documents the deps result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DepsResult {\n id: string;\n format: DepsFormat;\n node_count: number;\n edge_count: number;\n missing_count: number;\n tree?: DepsTreeNode;\n graph?: DepsGraphResult;\n}\n\nfunction parseFormat(raw: string | undefined): DepsFormat {\n const candidate = raw?.trim().toLowerCase() ?? \"tree\";\n if ((DEPS_FORMAT_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsFormat;\n }\n throw new PmCliError(`Invalid --format value \"${raw}\". Use \"tree\" or \"graph\".`, EXIT_CODE.USAGE);\n}\n\nfunction parseMaxDepth(raw: string | number | undefined): number | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = typeof raw === \"number\" ? raw : Number(raw.trim());\n if (!Number.isInteger(normalized) || normalized < 0) {\n throw new PmCliError(`Invalid --max-depth value \"${raw}\". Use a non-negative integer.`, EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction parseCollapse(raw: string | undefined): DepsCollapseMode {\n const candidate = raw?.trim().toLowerCase() ?? \"none\";\n if ((DEPS_COLLAPSE_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsCollapseMode;\n }\n throw new PmCliError(`Invalid --collapse value \"${raw}\". Use \"none\" or \"repeated\".`, EXIT_CODE.USAGE);\n}\n\nfunction normalizeDependencies(dependencies: Dependency[] | undefined): Dependency[] {\n if (!dependencies || dependencies.length === 0) {\n return [];\n }\n const sorted = [...dependencies].sort((left, right) => {\n const byKind = left.kind.localeCompare(right.kind);\n if (byKind !== 0) return byKind;\n const byId = left.id.localeCompare(right.id);\n if (byId !== 0) return byId;\n return left.created_at.localeCompare(right.created_at);\n });\n const deduped = new Map<string, Dependency>();\n for (const dependency of sorted) {\n const key = `${dependency.kind}::${dependency.id}`;\n if (!deduped.has(key)) {\n deduped.set(key, dependency);\n }\n }\n return [...deduped.values()];\n}\n\nfunction toIndexedItem(item: ItemFrontMatter): IndexedItem {\n return {\n id: item.id,\n title: item.title,\n type: item.type,\n status: item.status,\n dependencies: normalizeDependencies(item.dependencies),\n };\n}\n\nfunction toTreeNode(\n id: string,\n index: Map<string, IndexedItem>,\n lineage: Set<string>,\n maxDepth: number | undefined,\n collapse: DepsCollapseMode,\n expanded: Set<string>,\n depth = 0,\n via?: string,\n): DepsTreeNode {\n const item = index.get(id);\n const baseNode: DepsTreeNode = {\n id,\n title: item?.title,\n type: item?.type,\n status: item?.status,\n via,\n missing: !item,\n cycle: lineage.has(id),\n dependencies: [],\n };\n if (!item || baseNode.cycle) {\n return baseNode;\n }\n if (maxDepth !== undefined && depth >= maxDepth) {\n if (item.dependencies.length > 0) {\n baseNode.truncated = true;\n }\n return baseNode;\n }\n if (collapse === \"repeated\" && expanded.has(id)) {\n baseNode.collapsed = true;\n return baseNode;\n }\n if (collapse === \"repeated\") {\n expanded.add(id);\n }\n const nextLineage = new Set(lineage);\n nextLineage.add(id);\n baseNode.dependencies = item.dependencies.map((dependency) =>\n toTreeNode(dependency.id, index, nextLineage, maxDepth, collapse, expanded, depth + 1, dependency.kind),\n );\n return baseNode;\n}\n\nfunction mergeGraphNode(existing: DepsGraphNode | undefined, candidate: DepsGraphNode): DepsGraphNode {\n if (!existing) {\n return candidate;\n }\n /* c8 ignore start -- defensive: mixed missing/non-missing duplicates only occur in malformed synthetic trees. */\n if (existing.missing && !candidate.missing) return candidate;\n /* c8 ignore stop */\n return {\n ...existing,\n title: existing.title ?? candidate.title,\n type: existing.type ?? candidate.type,\n status: existing.status ?? candidate.status,\n };\n}\n\nfunction toGraph(root: DepsTreeNode): DepsGraphResult {\n const nodesById = new Map<string, DepsGraphNode>();\n const edgesByKey = new Map<string, DepsGraphEdge>();\n\n const visit = (node: DepsTreeNode): void => {\n nodesById.set(\n node.id,\n mergeGraphNode(nodesById.get(node.id), {\n id: node.id,\n title: node.title,\n type: node.type,\n status: node.status,\n missing: node.missing,\n }),\n );\n for (const child of node.dependencies) {\n nodesById.set(\n child.id,\n mergeGraphNode(nodesById.get(child.id), {\n id: child.id,\n title: child.title,\n type: child.type,\n status: child.status,\n missing: child.missing,\n }),\n );\n /* c8 ignore start -- legacy malformed dependency payloads may omit kind/via. */\n const relationKind = child.via ?? \"related\";\n const edgeKey = `${node.id}::${child.id}::${relationKind}`;\n if (!edgesByKey.has(edgeKey)) {\n edgesByKey.set(edgeKey, {\n from: node.id,\n to: child.id,\n kind: relationKind,\n });\n }\n /* c8 ignore stop */\n if (!child.cycle) {\n visit(child);\n }\n }\n };\n\n visit(root);\n\n const nodes = [...nodesById.values()].sort((left, right) => left.id.localeCompare(right.id));\n const edges = [...edgesByKey.values()].sort((left, right) => {\n const byFrom = left.from.localeCompare(right.from);\n if (byFrom !== 0) return byFrom;\n const byTo = left.to.localeCompare(right.to);\n if (byTo !== 0) return byTo;\n return left.kind.localeCompare(right.kind);\n });\n const missingIds = nodes.filter((node) => node.missing).map((node) => node.id);\n return {\n root_id: root.id,\n nodes,\n edges,\n missing_ids: missingIds,\n };\n}\n\n/**\n * Implements run deps for the public runtime surface of this module.\n */\nexport async function runDeps(id: string, options: DepsCommandOptions, global: GlobalOptions): Promise<DepsResult> {\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 const format = parseFormat(options.format);\n const maxDepth = parseMaxDepth(options.maxDepth);\n const collapse = parseCollapse(options.collapse);\n const summaryOnly = options.summary === true;\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);\n const index = new Map(items.map((item) => [item.id, toIndexedItem(item)]));\n if (!index.has(id)) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n\n const tree = toTreeNode(id, index, new Set<string>(), maxDepth, collapse, new Set<string>());\n const graph = toGraph(tree);\n const baseResult = {\n id,\n format,\n node_count: graph.nodes.length,\n edge_count: graph.edges.length,\n missing_count: graph.missing_ids.length,\n };\n if (summaryOnly) {\n return baseResult;\n }\n if (format === \"tree\") {\n return {\n ...baseResult,\n tree,\n };\n }\n return {\n ...baseResult,\n graph,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBO,IAAM,qBAAqB,CAAC,QAAQ,OAAO;AAK3C,IAAM,uBAAuB,CAAC,QAAQ,UAAU;AAmFvD,SAAS,YAAY,KAAuB;AAC1C,QAAM,YAAY,KAAK,KAAI,EAAG,YAAW,KAAM;AAC/C,MAAK,mBAAyC,SAAS,SAAS,GAAG;AACjE,WAAO;EACT;AACA,QAAM,IAAI,WAAW,2BAA2B,GAAG,6BAA6B,UAAU,KAAK;AACjG;AAEA,SAAS,cAAc,KAAgC;AACrD,MAAI,QAAQ,QAAW;AACrB,WAAO;EACT;AACA,QAAM,aAAa,OAAO,QAAQ,WAAW,MAAM,OAAO,IAAI,KAAI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AAQ,MAAM;AACzC,QAAM,WAAW,cAAc,QAAQ,QAAQ;AAC/C,QAAM,WAAW,cAAc,QAAQ,QAAQ;AAC/C,QAAM,cAAc,QAAQ,YAAY;AACxC,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,eAAe,wBAAwB,UAAU,gCAA+B,CAAE;AACxF,QAAM,QAAQ,MAAM,wBAAwB,QAAQ,SAAS,aAAa,aAAa,gBAAgB,QAAW,SAAS,MAAM;AACjI,QAAM,QAAQ,IAAI,IAAI,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,cAAc,IAAI,CAAC,CAAC,CAAC;AACzE,MAAI,CAAC,MAAM,IAAI,EAAE,GAAG;AAClB,UAAM,IAAI,WAAW,QAAQ,EAAE,cAAc,UAAU,SAAS;EAClE;AAEA,QAAM,OAAO,WAAW,IAAI,OAAO,oBAAI,IAAG,GAAY,UAAU,UAAU,oBAAI,IAAG,CAAU;AAC3F,QAAM,QAAQ,QAAQ,IAAI;AAC1B,QAAM,aAAa;IACjB;IACA;IACA,YAAY,MAAM,MAAM;IACxB,YAAY,MAAM,MAAM;IACxB,eAAe,MAAM,YAAY;;AAEnC,MAAI,aAAa;AACf,WAAO;EACT;AACA,MAAI,WAAW,QAAQ;AACrB,WAAO;MACL,GAAG;MACH;;EAEJ;AACA,SAAO;IACL,GAAG;IACH;;AAEJ","debugId":"9f5bd1d8-0152-5389-9939-5bd3b047e020"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listAllFrontMatterLight
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-3U3VEWK6.js";
|
|
4
|
+
import "./chunk-EZFKWSC7.js";
|
|
5
|
+
import "./chunk-DRBV5UC2.js";
|
|
6
6
|
import {
|
|
7
|
-
EXIT_CODE,
|
|
8
7
|
PmCliError,
|
|
9
8
|
getActiveExtensionRegistrations,
|
|
9
|
+
readSettings
|
|
10
|
+
} from "./chunk-P5YORJRH.js";
|
|
11
|
+
import "./chunk-7C2O74AE.js";
|
|
12
|
+
import {
|
|
13
|
+
EXIT_CODE,
|
|
10
14
|
getSettingsPath,
|
|
11
15
|
pathExists,
|
|
12
|
-
readSettings,
|
|
13
16
|
resolveItemTypeRegistry,
|
|
14
17
|
resolvePmRoot
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5VVUKE3U.js";
|
|
16
19
|
|
|
17
20
|
// dist/cli/commands/deps.js
|
|
18
21
|
!(function() {
|
|
@@ -221,4 +224,4 @@ export {
|
|
|
221
224
|
DEPS_FORMAT_VALUES,
|
|
222
225
|
runDeps
|
|
223
226
|
};
|
|
224
|
-
//# sourceMappingURL=deps-
|
|
227
|
+
//# sourceMappingURL=deps-L2FPIAD3.js.map
|