@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../sdk/compose.ts","../../../../../../../../sdk/testing.ts"],"sourcesContent":["/**\n * @module sdk/compose\n *\n * Declarative extension authoring — the capstone of the SDK authoring tripod\n * (`author → register → test`).\n *\n * The {@link ./define.js | `define*`} builders type each registration where it\n * is written, and the `assert*`/`run*` testing helpers verify and invoke it. But\n * the author still has to hand-wire every definition into an imperative\n * `activate(api)` body — calling the right `api.register*` method, in the right\n * order, without forgetting one — and then hand-sync `manifest.capabilities` to\n * match. Those are the two most common package-authoring footguns.\n *\n * {@link composeExtension} closes the loop: an author (or an agent) describes\n * *what* to register as a plain {@link ExtensionBlueprint} object, and the SDK\n * generates the `activate` that wires every surface for them.\n * {@link deriveExtensionCapabilities} computes the exact least-privilege\n * capability set that blueprint exercises, so `manifest.json` can be authored\n * with zero declared-but-unused / used-but-undeclared drift (the author-time\n * inverse of the runtime `reconcileExtensionCapabilityUsage` reconciliation).\n *\n * This module also owns {@link ExtensionModule} and {@link defineExtension} —\n * the in-module export shape every extension entry file produces and its\n * zero-cost identity helper — so both the imperative (`defineExtension`) and\n * declarative (`composeExtension`) authoring styles live together. Both are\n * re-exported from the SDK barrel, so the public API is unchanged.\n */\nimport type {\n AfterCommandHook,\n BeforeCommandHook,\n CommandDefinition,\n CommandOverride,\n ExtensionApi,\n ExtensionCapability,\n ExtensionManifest,\n ExtensionServiceName,\n Exporter,\n FlagDefinition,\n ImportExportRegistrationOptions,\n Importer,\n OnIndexHook,\n OnReadHook,\n OnWriteHook,\n OutputRendererFormat,\n ParserOverride,\n PreflightOverride,\n RendererOverride,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SearchProviderDefinition,\n ServiceOverride,\n VectorStoreAdapterDefinition,\n} from \"../core/extensions/loader.js\";\nimport type { ExtensionActivationSummary } from \"../core/extensions/activation-summary.js\";\nimport type { ProjectProfileRegistrationInput } from \"../core/profile/profile-presets.js\";\nimport type { PmMaxVersionExceededMode } from \"../core/extensions/extension-types.js\";\nimport {\n normalizeKnownExtensionCapability,\n resolveLegacyExtensionCapabilityAlias,\n} from \"../core/extensions/extension-capability-aliases.js\";\nimport { normalizeCommandName } from \"../core/extensions/extension-runtime-helpers.js\";\nimport {\n evaluatePmMaxVersionBound,\n evaluatePmMinVersionBound,\n type PmVersionBoundEvaluation,\n type PmVersionBoundKind,\n} from \"../core/extensions/version-compat.js\";\n\n/**\n * Documents the extension module payload exchanged by command, SDK, and package integrations.\n *\n * This is the shape an extension entry file exports (as its default export and,\n * conventionally, as named `manifest`/`activate` exports). Produce it directly,\n * via {@link defineExtension} for the imperative style, or via\n * {@link composeExtension} for the declarative style.\n */\nexport interface ExtensionModule {\n /**\n * Optional in-module metadata mirror.\n *\n * The authoritative manifest remains on-disk `manifest.json`; this field is\n * useful when authors want colocated metadata for tooling/tests. Type it with\n * {@link defineExtensionManifest} for full contract checking at the definition\n * site.\n */\n manifest?: ExtensionManifest;\n activate(api: ExtensionApi): void | Promise<void>;\n /**\n * Optional teardown lifecycle hook (VS Code-style `deactivate`). Invoked by\n * the host on shutdown/reload to release resources opened during `activate`.\n */\n deactivate?(): void | Promise<void>;\n}\n\n/**\n * Typed identity helper for extension module exports.\n *\n * Use as:\n * `export default defineExtension({ activate(api) { ... } })`\n *\n * Reach for {@link composeExtension} instead when you would rather declare the\n * registrations as data than wire them imperatively in `activate`.\n */\nexport function defineExtension<TModule extends ExtensionModule>(module: TModule): TModule {\n return module;\n}\n\n/**\n * A single importer registration entry for an {@link ExtensionBlueprint}, mirroring\n * the positional arguments of `api.registerImporter(name, importer, options?)`.\n */\nexport interface ExtensionBlueprintImporter {\n /** Registered importer name; the `<name> import` command path is derived from it. */\n name: string;\n /** The importer handler that bridges an external system into the pm context graph. */\n importer: Importer;\n /** Optional command metadata (description/flags/intent/examples) for the derived command. */\n options?: ImportExportRegistrationOptions;\n}\n\n/**\n * A single exporter registration entry for an {@link ExtensionBlueprint}, mirroring\n * the positional arguments of `api.registerExporter(name, exporter, options?)`.\n */\nexport interface ExtensionBlueprintExporter {\n /** Registered exporter name; the `<name> export` command path is derived from it. */\n name: string;\n /** The exporter handler that bridges the pm context graph out to an external system. */\n exporter: Exporter;\n /** Optional command metadata (description/flags/intent/examples) for the derived command. */\n options?: ImportExportRegistrationOptions;\n}\n\n/**\n * The lifecycle hooks an {@link ExtensionBlueprint} can register, one array per\n * kind. Each entry is registered through the matching `api.hooks.*` method in\n * the canonical order `before_command → after_command → on_write → on_read →\n * on_index`.\n */\nexport interface ExtensionBlueprintHooks {\n /** Hooks fired before a command runs (`api.hooks.beforeCommand`). */\n beforeCommand?: BeforeCommandHook[];\n /** Hooks fired after a command runs (`api.hooks.afterCommand`). */\n afterCommand?: AfterCommandHook[];\n /** Hooks fired when an item is persisted (`api.hooks.onWrite`). */\n onWrite?: OnWriteHook[];\n /** Hooks fired when an item is read (`api.hooks.onRead`). */\n onRead?: OnReadHook[];\n /** Hooks fired during index/search refresh (`api.hooks.onIndex`). */\n onIndex?: OnIndexHook[];\n}\n\n/**\n * A declarative description of everything an extension registers at activation.\n *\n * Every field is optional: populate the surfaces your extension uses (ideally\n * with {@link ./define.js | `define*`}-authored definitions) and leave the rest\n * out. {@link composeExtension} turns the blueprint into an\n * {@link ExtensionModule} whose generated `activate` calls the matching\n * `api.register*` method for each surface, and {@link deriveExtensionCapabilities}\n * computes the capability set the blueprint requires.\n *\n * Record-keyed fields map a routing key (command name, output format, or service\n * name) to its handler, mirroring the two-argument `api.register*` overloads.\n */\nexport interface ExtensionBlueprint {\n /** Optional in-module manifest mirror, copied onto the produced module verbatim. */\n manifest?: ExtensionManifest;\n /** Full command definitions registered via `api.registerCommand(definition)`. */\n commands?: CommandDefinition[];\n /** Command overrides keyed by command name, registered via `api.registerCommand(command, override)`. */\n commandOverrides?: Record<string, CommandOverride>;\n /** Additional flags keyed by target command name, registered via `api.registerFlags(command, flags)`. */\n flags?: Record<string, FlagDefinition[]>;\n /** Parser overrides keyed by command name, registered via `api.registerParser(command, override)`. */\n parsers?: Record<string, ParserOverride>;\n /** Output renderer overrides keyed by format, registered via `api.registerRenderer(format, renderer)`. */\n renderers?: Partial<Record<OutputRendererFormat, RendererOverride>>;\n /** Service overrides keyed by service name, registered via `api.registerService(service, override)`. */\n services?: Partial<Record<ExtensionServiceName, ServiceOverride>>;\n /** Preflight overrides registered via `api.registerPreflight(override)`. */\n preflights?: PreflightOverride[];\n /** Custom item types registered in a single `api.registerItemTypes(types)` call. */\n itemTypes?: SchemaItemTypeDefinition[];\n /** Custom front-matter fields registered in a single `api.registerItemFields(fields)` call. */\n itemFields?: SchemaFieldDefinition[];\n /** Schema migrations registered one at a time via `api.registerMigration(definition)`. */\n migrations?: SchemaMigrationDefinition[];\n /** Project profiles registered one at a time via `api.registerProfile(profile)`. */\n profiles?: ProjectProfileRegistrationInput[];\n /** Search providers registered via `api.registerSearchProvider(provider)`. */\n searchProviders?: SearchProviderDefinition[];\n /** Vector store adapters registered via `api.registerVectorStoreAdapter(adapter)`. */\n vectorStoreAdapters?: VectorStoreAdapterDefinition[];\n /** Importers registered via `api.registerImporter(name, importer, options?)`. */\n importers?: ExtensionBlueprintImporter[];\n /** Exporters registered via `api.registerExporter(name, exporter, options?)`. */\n exporters?: ExtensionBlueprintExporter[];\n /** Lifecycle hooks registered through `api.hooks.*`. */\n hooks?: ExtensionBlueprintHooks;\n /**\n * Optional imperative escape hatch run *after* every declarative registration,\n * for the rare wiring the blueprint cannot express. Receives the same `api`.\n */\n activate?: (api: ExtensionApi) => void | Promise<void>;\n /** Optional teardown hook copied onto the produced module verbatim. */\n deactivate?: () => void | Promise<void>;\n}\n\n/**\n * Typed identity helper for a (partial) {@link ExtensionBlueprint} authored as its\n * own module — the typed entry point of the modular declarative-authoring loop.\n *\n * It is the natural companion to {@link mergeExtensionBlueprints}: when an\n * extension's surface is split across files — a commands module, a search module,\n * a hooks module — wrap each fragment so it is contract-checked *at its definition\n * site* (with editor completion), exactly as {@link defineExtension} types a whole\n * module and {@link defineExtensionManifest} types a manifest. It returns its\n * argument unchanged, preserving the literal type\n * so the fragment composes into {@link mergeExtensionBlueprints},\n * {@link composeExtension}, or {@link composeExtensionPackage} with no loss of\n * inference.\n *\n * Use as:\n * `export const commandsModule = defineExtensionBlueprint({ commands: [...] })`\n */\nexport function defineExtensionBlueprint<TBlueprint extends ExtensionBlueprint>(blueprint: TBlueprint): TBlueprint {\n return blueprint;\n}\n\n/**\n * Register a blueprint's command-layer surfaces — fresh command definitions,\n * command overrides, flag tables, and parser/renderer/service overrides — in the\n * deterministic order {@link composeExtension} documents.\n */\nfunction registerBlueprintCommandSurfaces(api: ExtensionApi, blueprint: ExtensionBlueprint): void {\n for (const command of blueprint.commands ?? []) {\n api.registerCommand(command);\n }\n for (const [command, override] of Object.entries(blueprint.commandOverrides ?? {})) {\n api.registerCommand(command, override);\n }\n for (const [targetCommand, flags] of Object.entries(blueprint.flags ?? {})) {\n api.registerFlags(targetCommand, flags);\n }\n for (const [command, override] of Object.entries(blueprint.parsers ?? {})) {\n api.registerParser(command, override);\n }\n for (const [format, renderer] of Object.entries(blueprint.renderers ?? {}) as Array<\n [OutputRendererFormat, RendererOverride]\n >) {\n api.registerRenderer(format, renderer);\n }\n for (const [service, override] of Object.entries(blueprint.services ?? {}) as Array<\n [ExtensionServiceName, ServiceOverride]\n >) {\n api.registerService(service, override);\n }\n}\n\n/**\n * Register a blueprint's schema-layer surfaces — preflight overrides, item types,\n * item fields, schema migrations, and project profiles — preserving the\n * batch-registration semantics of `registerItemTypes`/`registerItemFields`\n * (only invoked when at least one entry is present).\n */\nfunction registerBlueprintSchemaSurfaces(api: ExtensionApi, blueprint: ExtensionBlueprint): void {\n for (const override of blueprint.preflights ?? []) {\n api.registerPreflight(override);\n }\n const itemTypes = blueprint.itemTypes ?? [];\n if (itemTypes.length > 0) {\n api.registerItemTypes(itemTypes);\n }\n const itemFields = blueprint.itemFields ?? [];\n if (itemFields.length > 0) {\n api.registerItemFields(itemFields);\n }\n for (const migration of blueprint.migrations ?? []) {\n api.registerMigration(migration);\n }\n for (const profile of blueprint.profiles ?? []) {\n api.registerProfile(profile);\n }\n}\n\n/**\n * Register a blueprint's retrieval and interchange surfaces — search providers,\n * vector store adapters, importers, and exporters — passing each importer's and\n * exporter's optional registration options through verbatim.\n */\nfunction registerBlueprintRetrievalSurfaces(api: ExtensionApi, blueprint: ExtensionBlueprint): void {\n for (const provider of blueprint.searchProviders ?? []) {\n api.registerSearchProvider(provider);\n }\n for (const adapter of blueprint.vectorStoreAdapters ?? []) {\n api.registerVectorStoreAdapter(adapter);\n }\n for (const entry of blueprint.importers ?? []) {\n api.registerImporter(entry.name, entry.importer, entry.options);\n }\n for (const entry of blueprint.exporters ?? []) {\n api.registerExporter(entry.name, entry.exporter, entry.options);\n }\n}\n\n/**\n * Register a blueprint's lifecycle hooks in canonical order\n * (beforeCommand → afterCommand → onWrite → onRead → onIndex).\n */\nfunction registerBlueprintHooks(api: ExtensionApi, hooks: ExtensionBlueprintHooks): void {\n for (const hook of hooks.beforeCommand ?? []) {\n api.hooks.beforeCommand(hook);\n }\n for (const hook of hooks.afterCommand ?? []) {\n api.hooks.afterCommand(hook);\n }\n for (const hook of hooks.onWrite ?? []) {\n api.hooks.onWrite(hook);\n }\n for (const hook of hooks.onRead ?? []) {\n api.hooks.onRead(hook);\n }\n for (const hook of hooks.onIndex ?? []) {\n api.hooks.onIndex(hook);\n }\n}\n\n/**\n * Assemble an {@link ExtensionModule} from a declarative {@link ExtensionBlueprint}.\n *\n * The returned module's `activate` registers every populated surface through the\n * matching `api.register*` method in a deterministic order (commands → overrides\n * → flags → parsers → renderers → services → preflights → item types → item\n * fields → migrations → profiles → search providers → vector store adapters →\n * importers → exporters → hooks), then awaits the blueprint's optional imperative `activate`\n * so it can layer on anything the declarative form cannot express. `manifest`\n * and `deactivate` are copied onto the module verbatim.\n *\n * This is a pure assembler: it does not validate the definitions. Per-surface\n * contract enforcement stays in `api.register*` (and the loader), exactly as it\n * does for hand-written `activate` bodies, so a malformed definition surfaces\n * the same activation diagnostic either way.\n */\nexport function composeExtension(blueprint: ExtensionBlueprint): ExtensionModule {\n const activate = async (api: ExtensionApi): Promise<void> => {\n registerBlueprintCommandSurfaces(api, blueprint);\n registerBlueprintSchemaSurfaces(api, blueprint);\n registerBlueprintRetrievalSurfaces(api, blueprint);\n // `?? {}` (rather than a `!== undefined` guard) so an explicit `hooks: null`\n // crossing an untyped boundary (e.g. a blueprint hydrated from JSON) is\n // treated the same as omitting it, instead of throwing on the first\n // `hooks.beforeCommand` access.\n registerBlueprintHooks(api, blueprint.hooks ?? {});\n await blueprint.activate?.(api);\n };\n\n // Truthy checks (rather than `!== undefined`) so an explicit `null` mirror or\n // teardown is treated as absent instead of copied onto the module.\n const module: ExtensionModule = { activate };\n if (blueprint.manifest) {\n module.manifest = blueprint.manifest;\n }\n if (blueprint.deactivate) {\n module.deactivate = blueprint.deactivate;\n }\n return module;\n}\n\n/**\n * Concatenate the populated entries of an array surface across blueprints,\n * preserving argument order. Returns `undefined` when no blueprint contributes\n * any entry, so {@link mergeExtensionBlueprints} omits the field instead of\n * emitting an empty array. `?? []` tolerates an explicit `null` field (e.g. from a\n * blueprint hydrated across an untyped boundary) exactly as {@link composeExtension} does.\n */\nfunction mergeArraySurface<TValue>(\n surfaces: ReadonlyArray<readonly TValue[] | null | undefined>,\n): TValue[] | undefined {\n const merged = surfaces.flatMap((surface) => surface ?? []);\n return merged.length > 0 ? merged : undefined;\n}\n\n/**\n * Shallow-merge single-handler record surfaces (`commandOverrides`, `parsers`,\n * `renderers`, `services`) with last-defined-wins precedence on a key collision,\n * exactly like spreading the records in argument order. Returns `undefined` when\n * no blueprint contributes any key.\n */\nfunction mergeHandlerRecord<TRecord extends object>(\n surfaces: ReadonlyArray<TRecord | null | undefined>,\n): TRecord | undefined {\n const merged = Object.assign({}, ...surfaces.map((surface) => surface ?? {})) as TRecord;\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\n/**\n * Merge `flags` records by concatenating every blueprint's flag array for a shared\n * target command, mirroring the additive `api.registerFlags` semantics so each\n * module's flags reach the command. Returns `undefined` when no blueprint declares\n * any flags.\n */\nfunction mergeFlagRecord(\n surfaces: ReadonlyArray<Record<string, FlagDefinition[]> | null | undefined>,\n): Record<string, FlagDefinition[]> | undefined {\n const merged: Record<string, FlagDefinition[]> = {};\n for (const surface of surfaces) {\n for (const [command, flags] of Object.entries(surface ?? {})) {\n // `flags` is the record's array value, never nullish in-type — `composeExtension`\n // likewise passes it to `registerFlags` unguarded — so it is spread directly.\n merged[command] = [...(merged[command] ?? []), ...flags];\n }\n }\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\nconst EXTENSION_BLUEPRINT_HOOK_KEYS = [\n \"beforeCommand\",\n \"afterCommand\",\n \"onWrite\",\n \"onRead\",\n \"onIndex\",\n] as const satisfies ReadonlyArray<keyof ExtensionBlueprintHooks>;\n\ntype ExtensionBlueprintHookKey = (typeof EXTENSION_BLUEPRINT_HOOK_KEYS)[number];\ntype MissingExtensionBlueprintHookKeys = Exclude<keyof ExtensionBlueprintHooks, ExtensionBlueprintHookKey>;\ntype ExtraExtensionBlueprintHookKeys = Exclude<ExtensionBlueprintHookKey, keyof ExtensionBlueprintHooks>;\n\n// Compile-time exhaustiveness guard: adding a hook field must update the canonical\n// merge order above, and stale keys cannot remain in that list.\nconst EXTENSION_BLUEPRINT_HOOK_KEY_COVERAGE: Record<\n MissingExtensionBlueprintHookKeys | ExtraExtensionBlueprintHookKeys,\n never\n> = {};\nvoid EXTENSION_BLUEPRINT_HOOK_KEY_COVERAGE;\n\ntype ExtensionBlueprintHookArray<TKey extends keyof ExtensionBlueprintHooks> = NonNullable<ExtensionBlueprintHooks[TKey]>;\ntype ExtensionBlueprintHookValue<TKey extends keyof ExtensionBlueprintHooks> = ExtensionBlueprintHookArray<TKey>[number];\n\nfunction assignMergedHookSurface<TKey extends keyof ExtensionBlueprintHooks>(\n merged: ExtensionBlueprintHooks,\n surfaces: ReadonlyArray<ExtensionBlueprintHooks | null | undefined>,\n key: TKey,\n): void {\n const hookArrays = surfaces.map((hooks) => hooks?.[key]) as ReadonlyArray<\n ExtensionBlueprintHookArray<TKey> | null | undefined\n >;\n const value = mergeArraySurface<ExtensionBlueprintHookValue<TKey>>(hookArrays);\n if (value !== undefined) {\n const typedMerged = merged as { [K in TKey]?: ExtensionBlueprintHookArray<K> };\n typedMerged[key] = value as ExtensionBlueprintHookArray<TKey>;\n }\n}\n\n/**\n * Merge the nested `hooks` surface by concatenating each lifecycle kind's array in\n * canonical order. Returns `undefined` when no blueprint registers any hook.\n */\nfunction mergeHookSurfaces(\n surfaces: ReadonlyArray<ExtensionBlueprintHooks | null | undefined>,\n): ExtensionBlueprintHooks | undefined {\n const merged: ExtensionBlueprintHooks = {};\n for (const key of EXTENSION_BLUEPRINT_HOOK_KEYS) {\n assignMergedHookSurface(merged, surfaces, key);\n }\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\n/**\n * Merge several partial {@link ExtensionBlueprint}s into one, so an extension's\n * surface can be authored *modularly* — a commands module, a search module, a\n * hooks module — and combined into a single blueprint to feed\n * {@link composeExtension}, {@link composeExtensionPackage},\n * {@link synthesizeExtensionManifest}, {@link describeExtensionBlueprint}, or\n * {@link preflightExtension}.\n *\n * The merge is pure and deterministic and never mutates an input. Each surface\n * combines the way its underlying `api.register*` call composes:\n *\n * - **Array surfaces** — `commands`, `preflights`, `itemTypes`, `itemFields`,\n * `migrations`, `profiles`, `searchProviders`, `vectorStoreAdapters`,\n * `importers`, `exporters` — concatenate in argument order.\n * - **`flags`** concatenates the flag arrays of any shared target command,\n * mirroring additive `api.registerFlags`: every module's flags reach the command.\n * - **Single-handler records** — `commandOverrides`, `parsers`, `renderers`,\n * `services` — follow last-defined-wins precedence on a key collision, exactly\n * like spreading the records in argument order; a later module deliberately\n * overrides an earlier one's handler for that key.\n * - **`hooks`** concatenates each lifecycle kind's array in canonical order.\n * - The imperative **`activate`** escape hatches chain in argument order (each\n * awaited), so every module's escape-hatch wiring still runs.\n * - The **`deactivate`** teardown hooks chain in *reverse* argument order (LIFO),\n * releasing resources in the inverse of acquisition. Teardown is best-effort:\n * a throwing hook does not strand later modules' cleanup — every hook runs and\n * teardown failures are re-thrown afterwards (as the original error for one\n * failure, or an `AggregateError` for several).\n * - The **`manifest`** mirror is last-defined-wins.\n *\n * Because `composeExtension` and the derive/lint/describe helpers are pure readers\n * of this data, a merged blueprint behaves exactly as a hand-written one: a command\n * two modules both define survives as a duplicate in the merged `commands` array\n * and {@link lintExtensionBlueprint} flags it, just as it would in one file. An\n * empty field is omitted rather than emitted empty, so merging zero blueprints\n * returns an empty blueprint (`{}`).\n */\nexport function mergeExtensionBlueprints(...blueprints: ExtensionBlueprint[]): ExtensionBlueprint {\n const merged: ExtensionBlueprint = {};\n const assign = <TKey extends keyof ExtensionBlueprint>(key: TKey, value: ExtensionBlueprint[TKey]): void => {\n if (value !== undefined) {\n merged[key] = value;\n }\n };\n assign(\"commands\", mergeArraySurface(blueprints.map((blueprint) => blueprint.commands)));\n assign(\"commandOverrides\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.commandOverrides)));\n assign(\"flags\", mergeFlagRecord(blueprints.map((blueprint) => blueprint.flags)));\n assign(\"parsers\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.parsers)));\n assign(\"renderers\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.renderers)));\n assign(\"services\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.services)));\n assign(\"preflights\", mergeArraySurface(blueprints.map((blueprint) => blueprint.preflights)));\n assign(\"itemTypes\", mergeArraySurface(blueprints.map((blueprint) => blueprint.itemTypes)));\n assign(\"itemFields\", mergeArraySurface(blueprints.map((blueprint) => blueprint.itemFields)));\n assign(\"migrations\", mergeArraySurface(blueprints.map((blueprint) => blueprint.migrations)));\n assign(\"profiles\", mergeArraySurface(blueprints.map((blueprint) => blueprint.profiles)));\n assign(\"searchProviders\", mergeArraySurface(blueprints.map((blueprint) => blueprint.searchProviders)));\n assign(\"vectorStoreAdapters\", mergeArraySurface(blueprints.map((blueprint) => blueprint.vectorStoreAdapters)));\n assign(\"importers\", mergeArraySurface(blueprints.map((blueprint) => blueprint.importers)));\n assign(\"exporters\", mergeArraySurface(blueprints.map((blueprint) => blueprint.exporters)));\n assign(\"hooks\", mergeHookSurfaces(blueprints.map((blueprint) => blueprint.hooks)));\n // Last-defined-wins for the in-module manifest mirror: a later module's identity\n // supersedes an earlier one's, matching the single-handler record precedence.\n let manifest: ExtensionManifest | undefined;\n for (const blueprint of blueprints) {\n if (blueprint.manifest) {\n manifest = blueprint.manifest;\n }\n }\n assign(\"manifest\", manifest);\n // Imperative escape hatches chain forward (acquisition order); teardown chains\n // in reverse (LIFO), so resources release in the inverse of acquisition.\n const hasActivates = blueprints.some((blueprint) => blueprint.activate);\n assign(\n \"activate\",\n hasActivates\n ? async (api: ExtensionApi): Promise<void> => {\n for (const blueprint of blueprints) {\n if (blueprint.activate) {\n await blueprint.activate(api);\n }\n }\n }\n : undefined,\n );\n const hasDeactivates = blueprints.some((blueprint) => blueprint.deactivate);\n assign(\n \"deactivate\",\n hasDeactivates\n ? async (): Promise<void> => {\n // Teardown is best-effort across modules: a throwing `deactivate` must\n // not strand a later module's cleanup, so every hook runs (in reverse,\n // LIFO) and failures are surfaced after cleanup completes.\n const errors: unknown[] = [];\n for (const blueprint of [...blueprints].reverse()) {\n if (!blueprint.deactivate) {\n continue;\n }\n try {\n await blueprint.deactivate();\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length > 0) {\n if (errors.length > 1) {\n throw new AggregateError(errors, \"Multiple extension blueprint deactivate hooks failed.\");\n }\n throw errors[0];\n }\n }\n : undefined,\n );\n return merged;\n}\n\n/**\n * Blueprint registration fields whose presence implies a capability, paired with\n * the capability each grants. Mirrors `EXTENSION_CAPABILITY_REGISTRATION_SURFACES`\n * so a blueprint's derived capabilities exactly match what the loader enforces\n * when {@link composeExtension}'s generated `activate` calls `api.register*`.\n *\n * `hooks` is handled separately (it is a nested object, not an array/record of\n * registrations) and so is intentionally absent from this table.\n */\nconst BLUEPRINT_FIELD_CAPABILITIES: ReadonlyArray<readonly [BlueprintRegistrationField, ExtensionCapability]> = [\n [\"commands\", \"commands\"],\n [\"commandOverrides\", \"commands\"],\n [\"flags\", \"schema\"],\n [\"itemTypes\", \"schema\"],\n [\"itemFields\", \"schema\"],\n [\"migrations\", \"schema\"],\n [\"profiles\", \"schema\"],\n [\"parsers\", \"parser\"],\n [\"renderers\", \"renderers\"],\n [\"services\", \"services\"],\n [\"preflights\", \"preflight\"],\n [\"searchProviders\", \"search\"],\n [\"vectorStoreAdapters\", \"search\"],\n [\"importers\", \"importers\"],\n [\"exporters\", \"importers\"],\n];\n\ntype BlueprintRegistrationField =\n | \"commands\"\n | \"commandOverrides\"\n | \"flags\"\n | \"parsers\"\n | \"renderers\"\n | \"services\"\n | \"preflights\"\n | \"itemTypes\"\n | \"itemFields\"\n | \"migrations\"\n | \"profiles\"\n | \"searchProviders\"\n | \"vectorStoreAdapters\"\n | \"importers\"\n | \"exporters\";\n\nfunction hasEntries(value: readonly unknown[] | Record<string, unknown> | null | undefined): boolean {\n // `!value` treats both `null` and `undefined` as \"no entries\", so an untyped\n // JavaScript author cannot crash capability derivation with an explicit null\n // field — `Object.keys(null)` would otherwise throw.\n if (!value) {\n return false;\n }\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n return Object.keys(value).length > 0;\n}\n\n/**\n * Compute the minimal least-privilege capability set a {@link ExtensionBlueprint}\n * exercises, sorted and de-duplicated.\n *\n * Use it to author `manifest.json` `capabilities` exactly — declaring nothing the\n * extension does not use and nothing it does. It is the author-time inverse of\n * the runtime `reconcileExtensionCapabilityUsage` reconciliation: derive the set\n * here before activation rather than detecting drift after it. A blueprint with\n * no registration surfaces returns an empty array.\n */\nexport function deriveExtensionCapabilities(blueprint: ExtensionBlueprint): ExtensionCapability[] {\n const capabilities = new Set<ExtensionCapability>();\n for (const [field, capability] of BLUEPRINT_FIELD_CAPABILITIES) {\n if (hasEntries(blueprint[field])) {\n capabilities.add(capability);\n }\n }\n // A command definition carrying its own inline `flags` registers them through\n // `registerCommand`, which asserts the `schema` capability independently of the\n // top-level `flags` record. Mirror that here so the derived set still matches\n // what activation enforces when a command declares flags inline and the\n // blueprint has no separate `flags` field. `!== undefined` (not a truthiness or\n // length check) matches the loader's exact guard, including an empty inline array.\n if ((blueprint.commands ?? []).filter(isPresent).some((command) => command.flags !== undefined)) {\n capabilities.add(\"schema\");\n }\n // `registerImporter`/`registerExporter` with `options.flags` register flag\n // metadata through the same surface as `registerFlags`, asserting the `schema`\n // capability on top of `importers` (loader `applyImportExportCommandMetadata`).\n // Mirror that guard so a flag-bearing importer/exporter derives `schema` too —\n // otherwise a least-privilege manifest synthesized from the blueprint would\n // under-grant `schema` and fail activation. `!== undefined` matches the loader's\n // exact `options.flags` guard, including an empty flag array. `entry?.` keeps a\n // malformed null array entry (from an untyped `.js`/JSON boundary) from crashing\n // derivation, consistent with the null-field robustness above.\n const importExportEntries = [...(blueprint.importers ?? []), ...(blueprint.exporters ?? [])].filter(isPresent);\n if (importExportEntries.some((entry) => entry?.options?.flags !== undefined)) {\n capabilities.add(\"schema\");\n }\n // Importers/exporters always synthesize command handlers (`<name> import` /\n // `<name> export`), so runtime capability summaries attribute them to the\n // commands surface as well as the importers surface. Keep the author-time\n // capability preview aligned with describeExtensionActivation.\n if (importExportEntries.some((entry) => typeof entry === \"object\")) {\n capabilities.add(\"commands\");\n }\n // `?? {}` keeps an explicit `hooks: null` from throwing, mirroring composeExtension.\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n if ([hooks.beforeCommand, hooks.afterCommand, hooks.onWrite, hooks.onRead, hooks.onIndex].some(hasEntries)) {\n capabilities.add(\"hooks\");\n }\n return [...capabilities].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Blueprint hook fields paired with the lifecycle kind each registers, ordered to\n * match `ExtensionActivationResult.hook_counts` (and the runtime\n * {@link ../core/extensions/activation-summary.js#describeExtensionActivation}'s\n * `hooks` ordering) so a blueprint summary's `hooks` list reads in the same\n * canonical order, not alphabetically.\n */\nconst BLUEPRINT_HOOK_FIELD_TO_KIND = [\n [\"beforeCommand\", \"before_command\"],\n [\"afterCommand\", \"after_command\"],\n [\"onWrite\", \"on_write\"],\n [\"onRead\", \"on_read\"],\n [\"onIndex\", \"on_index\"],\n] as const satisfies ReadonlyArray<readonly [keyof ExtensionBlueprintHooks, string]>;\n\n/** De-duplicate and locale-sort a list of identifiers, mirroring the runtime summary. */\nfunction sortUnique<TValue extends string>(values: readonly TValue[]): TValue[] {\n return [...new Set(values)].sort((left, right) => left.localeCompare(right));\n}\n\nfunction isPresent<TValue>(value: TValue | null | undefined): value is TValue {\n return value !== null && value !== undefined;\n}\n\nfunction importerCommandPath(entry: ExtensionBlueprintImporter): string {\n return normalizeCommandName(`${entry.name} import`);\n}\n\nfunction exporterCommandPath(entry: ExtensionBlueprintExporter): string {\n return normalizeCommandName(`${entry.name} export`);\n}\n\nfunction collectBlueprintCommandPaths(\n commands: CommandDefinition[],\n importers: ExtensionBlueprintImporter[],\n exporters: ExtensionBlueprintExporter[],\n): string[] {\n return [\n ...commands.map((command) => normalizeCommandName(command.name)),\n ...importers.filter((entry) => entry.options !== undefined).map(importerCommandPath),\n ...exporters.filter((entry) => entry.options !== undefined).map(exporterCommandPath),\n ];\n}\n\nfunction collectBlueprintFlagCommands(\n blueprint: ExtensionBlueprint,\n commands: CommandDefinition[],\n importers: ExtensionBlueprintImporter[],\n exporters: ExtensionBlueprintExporter[],\n): string[] {\n return [\n ...Object.keys(blueprint.flags ?? {}).map((command) => normalizeCommandName(command)),\n ...commands.filter((command) => command.flags !== undefined).map((command) => normalizeCommandName(command.name)),\n ...importers.filter((entry) => entry.options?.flags !== undefined).map(importerCommandPath),\n ...exporters.filter((entry) => entry.options?.flags !== undefined).map(exporterCommandPath),\n ];\n}\n\nfunction collectBlueprintHookKinds(hooks: ExtensionBlueprintHooks): string[] {\n return BLUEPRINT_HOOK_FIELD_TO_KIND.filter(([field]) => (hooks[field]?.length ?? 0) > 0).map(([, kind]) => kind);\n}\n\nfunction collectBlueprintSurfaceSummary(\n blueprint: ExtensionBlueprint,\n importers: ExtensionBlueprintImporter[],\n exporters: ExtensionBlueprintExporter[],\n): Pick<\n ExtensionActivationSummary,\n | \"item_types\"\n | \"item_fields\"\n | \"migrations\"\n | \"profiles\"\n | \"importers\"\n | \"exporters\"\n | \"search_providers\"\n | \"vector_store_adapters\"\n | \"parser_overrides\"\n | \"service_overrides\"\n | \"renderer_overrides\"\n | \"preflight_overrides\"\n> {\n return {\n item_types: sortUnique((blueprint.itemTypes ?? []).map((type) => type.name)),\n item_fields: sortUnique((blueprint.itemFields ?? []).map((field) => field.name)),\n // id-less migrations register but carry no identifier, so they are omitted —\n // exactly as describeExtensionActivation drops them from its `migrations` list.\n migrations: sortUnique(\n (blueprint.migrations ?? []).flatMap((migration) => (typeof migration.id === \"string\" ? [migration.id] : [])),\n ),\n profiles: sortUnique((blueprint.profiles ?? []).map((profile) => profile.name)),\n importers: sortUnique(importers.map((entry) => normalizeCommandName(entry.name))),\n exporters: sortUnique(exporters.map((entry) => normalizeCommandName(entry.name))),\n search_providers: sortUnique((blueprint.searchProviders ?? []).map((provider) => provider.name)),\n vector_store_adapters: sortUnique((blueprint.vectorStoreAdapters ?? []).map((adapter) => adapter.name)),\n parser_overrides: sortUnique(Object.keys(blueprint.parsers ?? {}).map((command) => normalizeCommandName(command))),\n service_overrides: sortUnique(\n Object.keys(blueprint.services ?? {}).map((service) => String(service).trim().toLowerCase() as ExtensionServiceName),\n ),\n renderer_overrides: sortUnique(\n Object.keys(blueprint.renderers ?? {}).map((format) => String(format).trim().toLowerCase() as OutputRendererFormat),\n ),\n preflight_overrides: (blueprint.preflights ?? []).length,\n };\n}\n\n/**\n * Compute, without activating, the exact {@link ExtensionActivationSummary} that\n * {@link composeExtension}'s generated `activate` would produce for a blueprint.\n *\n * This is the author-time inverse of the runtime\n * {@link ../core/extensions/activation-summary.js#describeExtensionActivation}:\n * the runtime verb walks an *activated* registry, while this one reads the\n * declarative {@link ExtensionBlueprint} data directly, so an author or agent can\n * preview the full named surface map (commands, overrides, handlers, hooks, item\n * types/fields, importers/exporters, search/vector adapters, parser/service/\n * renderer overrides, flag-target commands, and the preflight count) with no\n * loading, activation, or side effects. It is to the named surfaces what\n * {@link deriveExtensionCapabilities} is to the capability set.\n *\n * Fidelity is by construction: command paths are normalized with the same\n * `normalizeCommandName` the loader applies, and importer/exporter handler paths\n * are synthesized as `normalizeCommandName(\"<name> import|export\")`, exactly as\n * `registerImporter`/`registerExporter` do. A parity test pins this output equal\n * to `describeExtensionActivation` over the same composed-and-activated blueprint.\n *\n * The one surface it cannot reflect is the blueprint's optional imperative\n * `activate` escape hatch — arbitrary code a static reader cannot inspect. A\n * blueprint that registers everything through that hatch summarizes as empty.\n */\nexport function describeExtensionBlueprint(blueprint: ExtensionBlueprint): ExtensionActivationSummary {\n const commands = (blueprint.commands ?? []).filter(isPresent);\n const importers = (blueprint.importers ?? []).filter(isPresent);\n const exporters = (blueprint.exporters ?? []).filter(isPresent);\n const importerPaths = importers.map(importerCommandPath);\n const exporterPaths = exporters.map(exporterCommandPath);\n const commandPaths = collectBlueprintCommandPaths(commands, importers, exporters);\n // A command definition with inline `flags` registers a flag target under its own\n // path in addition to any top-level `flags` record. Import/export options with\n // `flags` register through the same runtime metadata path, so union all sources.\n const flagCommands = collectBlueprintFlagCommands(blueprint, commands, importers, exporters);\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n const surfaces = collectBlueprintSurfaceSummary(blueprint, importers, exporters);\n\n return {\n capabilities: deriveExtensionCapabilities(blueprint),\n commands: sortUnique(commandPaths),\n command_overrides: sortUnique(Object.keys(blueprint.commandOverrides ?? {}).map((command) => normalizeCommandName(command))),\n // command_handlers is a superset of commands that also carries the synthesized\n // importer/exporter command paths, but never the override-only paths.\n command_handlers: sortUnique([...commandPaths, ...importerPaths, ...exporterPaths]),\n hooks: collectBlueprintHookKinds(hooks),\n flag_commands: sortUnique(flagCommands),\n ...surfaces,\n };\n}\n\n/**\n * The blueprint registration fields a lint flags as a dead \"empty surface\" when\n * present but empty. Mirrors {@link BlueprintRegistrationField} so adding a new\n * registration surface forces a decision here too; `hooks` is handled separately\n * because it is a nested object rather than an array/record of registrations.\n */\nconst BLUEPRINT_LINTABLE_SURFACE_FIELDS = [\n \"commands\",\n \"commandOverrides\",\n \"flags\",\n \"parsers\",\n \"renderers\",\n \"services\",\n \"preflights\",\n \"itemTypes\",\n \"itemFields\",\n \"migrations\",\n \"profiles\",\n \"searchProviders\",\n \"vectorStoreAdapters\",\n \"importers\",\n \"exporters\",\n] as const satisfies ReadonlyArray<BlueprintRegistrationField>;\n\n/** Severity of an {@link ExtensionBlueprintLintFinding}: a hard `error` (activation will fail) or an advisory `warning`. */\nexport type ExtensionBlueprintLintSeverity = \"error\" | \"warning\";\n\n/**\n * Machine-readable kind of an {@link ExtensionBlueprintLintFinding}.\n *\n * - `capability_undeclared` (error): a surface exercises a capability the declared\n * set omits; the loader throws `extension_capability_missing` at activation.\n * - `capability_unused` (warning): a declared capability no surface exercises; the\n * runtime equivalent is the `pm package doctor` `extension_capability_unused` note.\n * - `duplicate_command` (warning): the same normalized command path is declared\n * more than once in `commands`; the later registration shadows the earlier.\n * - `command_override_conflict` (warning): a path is declared as both a fresh\n * command definition and a command override.\n * - `empty_surface` (warning): a registration field is present but contributes\n * nothing — a dead declaration.\n * - `manifest_capabilities_absent` (warning): the blueprint exercises capabilities\n * but offers no declared set to reconcile against.\n */\nexport type ExtensionBlueprintLintCode =\n | \"capability_undeclared\"\n | \"capability_unused\"\n | \"duplicate_command\"\n | \"command_override_conflict\"\n | \"empty_surface\"\n | \"manifest_capabilities_absent\";\n\n/**\n * A single author-time issue {@link lintExtensionBlueprint} found in a blueprint.\n */\nexport interface ExtensionBlueprintLintFinding {\n /** The machine-readable {@link ExtensionBlueprintLintCode} for programmatic handling. */\n code: ExtensionBlueprintLintCode;\n /** Whether the finding blocks activation (`error`) or is advisory (`warning`). */\n severity: ExtensionBlueprintLintSeverity;\n /** Human-readable explanation, including the suggested fix. */\n message: string;\n /** The capability involved, for capability-drift findings. */\n capability?: ExtensionCapability;\n /** The normalized command path involved, for command findings. */\n command?: string;\n /** The blueprint field involved, for `empty_surface` findings. */\n field?: string;\n}\n\n/**\n * Options for {@link lintExtensionBlueprint} and {@link ../sdk/testing.js#assertExtensionBlueprint}.\n */\nexport interface LintExtensionBlueprintOptions {\n /**\n * The capabilities the package's `manifest.json` declares (or will), used to\n * reconcile against the surfaces the blueprint exercises. Overrides\n * `blueprint.manifest.capabilities` when both are present. Omit both to lint\n * without a capability reconciliation (only the structural checks run).\n */\n declaredCapabilities?: readonly string[];\n}\n\n/**\n * The structured result of {@link lintExtensionBlueprint}.\n */\nexport interface ExtensionBlueprintLintResult {\n /** `true` when no `error`-severity finding is present (warnings still allow activation). */\n ok: boolean;\n /** Every finding, in detection order (capability drift, duplicates, conflicts, empty surfaces). */\n findings: ExtensionBlueprintLintFinding[];\n /** The least-privilege capability set the blueprint exercises (from {@link deriveExtensionCapabilities}). */\n used: ExtensionCapability[];\n /** The normalized declared capability set reconciled against, or `null` when none was provided. */\n declared: ExtensionCapability[] | null;\n}\n\n/** Normalize a raw declared-capability list to known capabilities only (legacy-alias aware, sorted, de-duplicated). */\nfunction normalizeDeclaredCapabilities(capabilities: readonly string[]): ExtensionCapability[] {\n const known = new Set<ExtensionCapability>();\n for (const capability of capabilities) {\n // Resolve a legacy alias (e.g. migration/validation → schema) exactly as the\n // loader does before reconciliation — the author's raw manifest input has not\n // been loader-normalized yet, so failing to resolve it here would misreport an\n // alias-satisfied capability as undeclared. Fall back to a canonical known\n // name; unknown capabilities are a separate diagnostic and are dropped so a\n // typo is not misreported as \"unused\".\n const normalized = resolveLegacyExtensionCapabilityAlias(capability) ?? normalizeKnownExtensionCapability(capability);\n if (normalized !== null) {\n known.add(normalized);\n }\n }\n return [...known].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Reconcile a blueprint's exercised capabilities against its declared set: a\n * used-but-undeclared capability is an `error` (activation throws\n * `extension_capability_missing`), a declared-but-unused one a `warning`, and a\n * wholly absent declared set (`declared === null`) yields the single\n * `manifest_capabilities_absent` adoption hint.\n */\nfunction collectBlueprintCapabilityFindings(\n used: ExtensionCapability[],\n declared: ExtensionCapability[] | null,\n): ExtensionBlueprintLintFinding[] {\n const findings: ExtensionBlueprintLintFinding[] = [];\n if (declared === null) {\n if (used.length > 0) {\n findings.push({\n code: \"manifest_capabilities_absent\",\n severity: \"warning\",\n message: `Blueprint exercises ${used.length === 1 ? \"capability\" : \"capabilities\"} [${used.join(\", \")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`,\n });\n }\n return findings;\n }\n const declaredSet = new Set(declared);\n const usedSet = new Set(used);\n for (const capability of used) {\n if (!declaredSet.has(capability)) {\n findings.push({\n code: \"capability_undeclared\",\n severity: \"error\",\n message: `Blueprint exercises capability \"${capability}\" but it is absent from the declared capabilities; activation throws extension_capability_missing — add \"${capability}\" to the manifest capabilities.`,\n capability,\n });\n }\n }\n for (const capability of declared) {\n if (!usedSet.has(capability)) {\n findings.push({\n code: \"capability_unused\",\n severity: \"warning\",\n message: `Capability \"${capability}\" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,\n capability,\n });\n }\n }\n return findings;\n}\n\n/**\n * Detect structural command footguns in a blueprint: a command path declared\n * more than once (`duplicate_command`, the later registration shadowing the\n * earlier at dispatch) and a path declared both as a fresh command definition\n * and as an override (`command_override_conflict`).\n */\nfunction collectBlueprintCommandFindings(blueprint: ExtensionBlueprint): ExtensionBlueprintLintFinding[] {\n const findings: ExtensionBlueprintLintFinding[] = [];\n const commandPathCounts = new Map<string, number>();\n for (const command of blueprint.commands ?? []) {\n const path = normalizeCommandName(command.name);\n commandPathCounts.set(path, (commandPathCounts.get(path) ?? 0) + 1);\n }\n for (const [path, count] of commandPathCounts) {\n if (count > 1) {\n findings.push({\n code: \"duplicate_command\",\n severity: \"warning\",\n message: `Command \"${path}\" is declared ${count} times in commands; the later registration shadows the earlier one at dispatch.`,\n command: path,\n });\n }\n }\n const overridePaths = new Set(\n Object.keys(blueprint.commandOverrides ?? {}).map((command) => normalizeCommandName(command)),\n );\n for (const path of commandPathCounts.keys()) {\n if (overridePaths.has(path)) {\n findings.push({\n code: \"command_override_conflict\",\n severity: \"warning\",\n message: `Command \"${path}\" is declared both as a new command definition and as a command override; register one or the other.`,\n command: path,\n });\n }\n }\n return findings;\n}\n\n/**\n * Flag blueprint registration fields that are present but contribute nothing —\n * an empty array/record surface, or a `hooks` object registering no lifecycle\n * hook — each reported as an `empty_surface` warning (fields first, then hooks).\n */\nfunction collectBlueprintEmptySurfaceFindings(blueprint: ExtensionBlueprint): ExtensionBlueprintLintFinding[] {\n const findings: ExtensionBlueprintLintFinding[] = [];\n for (const field of BLUEPRINT_LINTABLE_SURFACE_FIELDS) {\n if (field in blueprint && !hasEntries(blueprint[field])) {\n findings.push({\n code: \"empty_surface\",\n severity: \"warning\",\n message: `Blueprint field \"${field}\" is present but empty; remove it or populate it.`,\n field,\n });\n }\n }\n if (\"hooks\" in blueprint) {\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n const registersHook = [hooks.beforeCommand, hooks.afterCommand, hooks.onWrite, hooks.onRead, hooks.onIndex].some(\n hasEntries,\n );\n if (!registersHook) {\n findings.push({\n code: \"empty_surface\",\n severity: \"warning\",\n message: `Blueprint field \"hooks\" is present but registers no lifecycle hooks; remove it or populate it.`,\n field: \"hooks\",\n });\n }\n }\n return findings;\n}\n\n/**\n * Preflight a declarative {@link ExtensionBlueprint} at author time, returning the\n * structured issues that would otherwise only surface at activation.\n *\n * It is the author-time inverse of the runtime extension guardrails — pure data\n * analysis with no loading, activation, or side effects:\n *\n * - capability drift in both directions: a capability a surface exercises but the\n * declared set omits is an `error` (the loader throws `extension_capability_missing`\n * at activation); a declared capability no surface exercises is a `warning` (the\n * author-time form of the `pm package doctor` `extension_capability_unused` note,\n * making this the static inverse of `reconcileExtensionCapabilityUsage`).\n * - structural footguns: a command path declared twice (`duplicate_command`), a\n * path declared as both a command and an override (`command_override_conflict`),\n * and a registration field present but empty (`empty_surface`).\n *\n * The declared set is taken from `options.declaredCapabilities` or, failing that,\n * `blueprint.manifest.capabilities`; with neither, capability reconciliation is\n * skipped and a single `manifest_capabilities_absent` warning suggests adopting\n * {@link deriveExtensionCapabilities}. Like {@link describeExtensionBlueprint},\n * the imperative `activate` escape hatch is invisible to this static check. The\n * findings are assembled from the per-dimension collectors\n * ({@link collectBlueprintCapabilityFindings}, {@link collectBlueprintCommandFindings},\n * {@link collectBlueprintEmptySurfaceFindings}) in that detection order.\n */\nexport function lintExtensionBlueprint(\n blueprint: ExtensionBlueprint,\n options: LintExtensionBlueprintOptions = {},\n): ExtensionBlueprintLintResult {\n const used = deriveExtensionCapabilities(blueprint);\n\n // A non-array declared source (an untyped `.js` author's malformed manifest, or\n // a missing field) is treated as \"no declared set\" rather than \"declares nothing\".\n const declaredSource = options.declaredCapabilities ?? blueprint.manifest?.capabilities;\n const declared = Array.isArray(declaredSource) ? normalizeDeclaredCapabilities(declaredSource) : null;\n\n // Findings accumulate in detection order: capability drift, then command\n // duplicates/conflicts, then empty surfaces.\n const findings: ExtensionBlueprintLintFinding[] = [\n ...collectBlueprintCapabilityFindings(used, declared),\n ...collectBlueprintCommandFindings(blueprint),\n ...collectBlueprintEmptySurfaceFindings(blueprint),\n ];\n\n return {\n ok: findings.every((finding) => finding.severity !== \"error\"),\n findings,\n used,\n declared,\n };\n}\n\n/**\n * The author-supplied identity fields {@link synthesizeExtensionManifest} cannot\n * derive from a blueprint: every {@link ExtensionManifest} field except the\n * generated `capabilities`.\n *\n * The blueprint determines `capabilities` (the surfaces it registers) and nothing\n * else, so `name`/`version`/`entry`/`priority` and any optional metadata\n * (engines, permissions, provenance, version floors/ceilings, sandbox profile,\n * manifest version, activation, legacy aliases) are the author's to supply here.\n */\nexport interface SynthesizeExtensionManifestIdentity extends Omit<ExtensionManifest, \"capabilities\"> {\n /**\n * Extra capabilities to grant beyond the blueprint's derived set, for surfaces\n * registered through the blueprint's imperative `activate` escape hatch that\n * static derivation cannot see (e.g. a renderer wired in `activate`). Each is\n * legacy-alias resolved and normalized like a declared manifest capability;\n * unknown names are dropped (the synthesized manifest is validated at load).\n */\n additionalCapabilities?: readonly string[];\n}\n\n/**\n * Generate a complete, least-privilege {@link ExtensionManifest} from a\n * declarative {@link ExtensionBlueprint} and the author's identity fields.\n *\n * This is the *generate* verb that completes the declarative authoring loop\n * (`compose → derive → describe/lint → synthesize`). Where\n * {@link defineExtensionManifest} only *types* a hand-written manifest and\n * {@link deriveExtensionCapabilities} computes only the capability set, this\n * function assembles the whole manifest: it copies every author-supplied identity\n * field verbatim and fills `capabilities` with `deriveExtensionCapabilities`\n * unioned with any {@link SynthesizeExtensionManifestIdentity.additionalCapabilities | additionalCapabilities},\n * sorted and de-duplicated. The author writes the blueprint once and never\n * hand-syncs `manifest.capabilities` — declaring nothing the extension does not\n * use and nothing it does.\n *\n * It is a pure assembler: it neither validates the blueprint definitions (that\n * stays in `api.register*` at activation) nor the identity fields (the loader\n * validates the on-disk manifest). Pair it with\n * {@link ../sdk/testing.js#assertExtensionManifestMatchesBlueprint} to guard a\n * hand-maintained `manifest.json` against drift in CI.\n */\nexport function synthesizeExtensionManifest(\n blueprint: ExtensionBlueprint,\n identity: SynthesizeExtensionManifestIdentity,\n): ExtensionManifest {\n const { additionalCapabilities, ...manifestIdentity } = identity;\n // `Array.isArray` keeps a non-array value (or an omitted field) crossing an\n // untyped boundary from crashing the spread, mirroring the rest of the SDK.\n const extra = Array.isArray(additionalCapabilities) ? normalizeDeclaredCapabilities(additionalCapabilities) : [];\n const capabilities = [...new Set<ExtensionCapability>([...deriveExtensionCapabilities(blueprint), ...extra])].sort(\n (left, right) => left.localeCompare(right),\n );\n return { ...manifestIdentity, capabilities };\n}\n\n/**\n * The two generated halves of a shippable extension package, returned by\n * {@link composeExtensionPackage}.\n */\nexport interface ExtensionPackage {\n /**\n * The runtime {@link ExtensionModule} to export as the package entry's default\n * export. Its `manifest` mirror is set to the same {@link ExtensionPackage.manifest}\n * object, so the in-module metadata and the on-disk manifest never diverge.\n */\n module: ExtensionModule;\n /**\n * The complete least-privilege {@link ExtensionManifest} to write as the\n * package's `manifest.json`, with `capabilities` derived from the blueprint.\n */\n manifest: ExtensionManifest;\n}\n\n/**\n * Assemble both halves of a shippable extension package from one declarative\n * {@link ExtensionBlueprint} and the author's identity fields — the author-once\n * capstone of the declarative loop.\n *\n * Where {@link composeExtension} produces only the runtime module and\n * {@link synthesizeExtensionManifest} produces only the manifest, this unifies\n * them: it synthesizes the complete least-privilege manifest from the blueprint\n * and identity, then composes the module with that synthesized manifest set as its\n * authoritative in-module `manifest` mirror. Both halves are therefore generated\n * from a single source and cannot drift — the module's `manifest` is the very\n * object returned as `manifest`. Export `module` as the package entry's default\n * export and write `manifest` as `manifest.json`.\n *\n * It is a pure assembler with no validation, loading, or filesystem access,\n * exactly like the two functions it composes; pair it with\n * {@link preflightExtension} (or {@link ../sdk/testing.js#assertExtensionPreflight})\n * for the author-time verify step. Use {@link mergeExtensionBlueprints} first to\n * assemble the blueprint modularly, then this to ship it.\n */\nexport function composeExtensionPackage(\n blueprint: ExtensionBlueprint,\n identity: SynthesizeExtensionManifestIdentity,\n): ExtensionPackage {\n const manifest = synthesizeExtensionManifest(blueprint, identity);\n const module = composeExtension({ ...blueprint, manifest });\n return { module, manifest };\n}\n\n/**\n * The target a {@link checkExtensionManifestCompatibility} call evaluates a\n * manifest's version bounds against.\n */\nexport interface ExtensionManifestCompatibilityTarget {\n /**\n * The pm CLI version to check the manifest against, e.g. the running CLI's\n * `version` or a version floor a package commits to supporting. Plain\n * dotted-numeric (`2026.6.23`) or `v`-prefixed values are compared; anything\n * uninterpretable yields an `unchecked` finding rather than a false verdict.\n */\n pmVersion: string;\n /**\n * How a `pm_max_version` overrun is treated, mirroring the runtime\n * `extensions.policy.pm_max_version_exceeded_mode`. `\"block\"` (the default)\n * reports an exceeded upper bound as a blocking incompatibility; `\"warn\"`\n * reports it as a non-blocking advisory, matching an operator who relaxed the\n * gate during a CLI upgrade window.\n */\n pmMaxVersionExceededMode?: PmMaxVersionExceededMode;\n}\n\n/**\n * The manifest fields {@link checkExtensionManifestCompatibility} evaluates.\n *\n * Values are intentionally `unknown` rather than `string` so an author can\n * preflight the same malformed blank/non-string bounds (e.g. read from a JSON\n * manifest) the loader's manifest parser rejects as `extension_manifest_invalid`.\n */\nexport interface ExtensionManifestCompatibilityManifest {\n /** Inclusive lower pm CLI version bound from `manifest.json`. */\n pm_min_version?: unknown;\n /** Inclusive upper pm CLI version bound from `manifest.json`. */\n pm_max_version?: unknown;\n}\n\n/**\n * The machine-readable kind of an {@link ExtensionManifestCompatibilityFinding},\n * one per `<bound>_<outcome>` the loader can reach. Each mirrors a loader\n * `extension_pm_*_version_*` warning: `*_invalid`/`*_unmet`/`*_exceeded` block the\n * load, while `*_unchecked`/`*_exceeded_warn` are advisory (the extension still\n * loads).\n */\nexport type ExtensionManifestCompatibilityCode =\n | \"pm_min_version_invalid\"\n | \"pm_min_version_unchecked\"\n | \"pm_min_version_unmet\"\n | \"pm_max_version_invalid\"\n | \"pm_max_version_unchecked\"\n | \"pm_max_version_exceeded\"\n | \"pm_max_version_exceeded_warn\";\n\n/**\n * A single version-bound issue {@link checkExtensionManifestCompatibility} found\n * when evaluating a manifest against a target pm version.\n */\nexport interface ExtensionManifestCompatibilityFinding {\n /** The machine-readable {@link ExtensionManifestCompatibilityCode} for programmatic handling. */\n code: ExtensionManifestCompatibilityCode;\n /** `error` when the bound blocks the load against the target version, `warning` when it is advisory. */\n severity: \"error\" | \"warning\";\n /** Which manifest bound produced the finding. */\n constraint: PmVersionBoundKind;\n /** The declared bound value, verbatim. */\n required: string;\n /** The target pm version the bound was evaluated against. */\n current: string;\n /** Human-readable explanation of the outcome and its effect on loading. */\n message: string;\n}\n\n/**\n * The structured result of {@link checkExtensionManifestCompatibility}.\n */\nexport interface ExtensionManifestCompatibilityResult {\n /** `true` when no `error`-severity finding blocks the load against the target version. */\n compatible: boolean;\n /** Every bound finding, lower bound before upper bound; empty when both bounds are absent or satisfied. */\n findings: ExtensionManifestCompatibilityFinding[];\n /** The target pm version the manifest was checked against, echoed back for messaging. */\n pmVersion: string;\n}\n\n/** Map a non-trivial bound evaluation to a compatibility finding, or `null` when the bound is absent or satisfied. */\nfunction toCompatibilityFinding(\n evaluation: PmVersionBoundEvaluation,\n pmVersion: string,\n): ExtensionManifestCompatibilityFinding | null {\n if (evaluation.status === \"absent\" || evaluation.status === \"ok\") {\n return null;\n }\n const code = `${evaluation.kind}_${evaluation.status}` as ExtensionManifestCompatibilityCode;\n let message: string;\n switch (code) {\n case \"pm_min_version_invalid\":\n message = `pm_min_version \"${evaluation.required}\" is not a valid version; the extension is treated as incompatible and the loader skips it.`;\n break;\n case \"pm_min_version_unchecked\":\n message = `pm_min_version \"${evaluation.required}\" could not be compared against pm ${pmVersion}; compatibility is unverified.`;\n break;\n case \"pm_min_version_unmet\":\n message = `Requires pm >= ${evaluation.required} but the target is pm ${pmVersion}; the loader skips the extension.`;\n break;\n case \"pm_max_version_invalid\":\n message = `pm_max_version \"${evaluation.required}\" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;\n break;\n case \"pm_max_version_unchecked\":\n message = `pm_max_version \"${evaluation.required}\" could not be compared against pm ${pmVersion}; compatibility is unverified.`;\n break;\n case \"pm_max_version_exceeded\":\n message = `Allows pm <= ${evaluation.required} but the target is pm ${pmVersion}; the loader skips the extension.`;\n break;\n case \"pm_max_version_exceeded_warn\":\n message = `Target pm ${pmVersion} is newer than pm_max_version ${evaluation.required}, but the \"warn\" exceeded mode lets it load with a warning.`;\n break;\n }\n return {\n code,\n severity: evaluation.allowed ? \"warning\" : \"error\",\n constraint: evaluation.kind,\n required: evaluation.required,\n current: pmVersion,\n message,\n };\n}\n\n/**\n * Check, without loading anything, whether an extension manifest's declared\n * version bounds permit it to load on a given pm CLI version.\n *\n * This is the author-time inverse of the loader's runtime version gate: where the\n * loader resolves the *installed* CLI version (asynchronously, from `package.json`)\n * and emits `extension_pm_*_version_*` warnings, this pure synchronous function\n * takes the {@link ExtensionManifestCompatibilityTarget.pmVersion | target version}\n * the author supplies and returns structured findings. Both share the\n * {@link ../core/extensions/version-compat.js | version-compat core}, so the\n * author-time verdict and the runtime decision agree by construction — a package\n * author can pin a CI test to the pm version they support and catch a too-tight\n * `pm_min_version`, a malformed `pm_max_version`, or an upper bound a newer CLI\n * would exceed, long before publishing.\n *\n * `compatible` is `true` only when no bound blocks the load (`*_invalid`,\n * `*_unmet`, and a `block`-mode `*_exceeded`); `*_unchecked` (an uninterpretable\n * bound or target) and a `warn`-mode `*_exceeded_warn` are advisory `warning`\n * findings that still load. Pair it with\n * {@link ../sdk/testing.js#assertExtensionManifestCompatible} to fail CI on a\n * blocking incompatibility.\n */\nexport function checkExtensionManifestCompatibility(\n manifest: ExtensionManifestCompatibilityManifest,\n target: ExtensionManifestCompatibilityTarget,\n): ExtensionManifestCompatibilityResult {\n const minEvaluation = evaluatePmMinVersionBound(manifest.pm_min_version, target.pmVersion);\n const maxEvaluation = evaluatePmMaxVersionBound(\n manifest.pm_max_version,\n target.pmVersion,\n target.pmMaxVersionExceededMode ?? \"block\",\n );\n const findings: ExtensionManifestCompatibilityFinding[] = [];\n const minFinding = toCompatibilityFinding(minEvaluation, target.pmVersion);\n if (minFinding !== null) {\n findings.push(minFinding);\n }\n const maxFinding = toCompatibilityFinding(maxEvaluation, target.pmVersion);\n if (maxFinding !== null) {\n findings.push(maxFinding);\n }\n return {\n compatible: minEvaluation.allowed && maxEvaluation.allowed,\n findings,\n pmVersion: target.pmVersion,\n };\n}\n\n/**\n * The lint codes whose verdict depends on the *declared* capability set rather\n * than the blueprint's structure. {@link preflightExtension} drops these from its\n * consolidated view when it synthesizes the manifest from an `identity` without an\n * explicit declared set, because the synthesized manifest — not the blueprint's\n * stale in-module `manifest` mirror — is what the package ships, so a drift against\n * the mirror is a false positive. Structural codes (`duplicate_command`,\n * `command_override_conflict`, `empty_surface`) are never suppressed.\n */\nconst CAPABILITY_DRIFT_LINT_CODES = new Set<ExtensionBlueprintLintCode>([\n \"capability_undeclared\",\n \"capability_unused\",\n \"manifest_capabilities_absent\",\n]);\n\n/**\n * Options for {@link preflightExtension} and\n * {@link ../sdk/testing.js#assertExtensionPreflight}. Every field is optional:\n * each one a check enables, so an author opts into exactly the stages whose\n * inputs they can supply.\n */\nexport interface PreflightExtensionOptions {\n /**\n * The author-supplied identity fields the blueprint cannot determine\n * (`name`/`version`/`entry`/`priority`, version bounds, etc.). Provide them to\n * have preflight {@link synthesizeExtensionManifest | synthesize} the complete\n * least-privilege manifest and include it in the report; the synthesized\n * version bounds then feed the {@link PreflightExtensionOptions.target | target}\n * compatibility check. Omit to skip manifest synthesis.\n */\n identity?: SynthesizeExtensionManifestIdentity;\n /**\n * The pm CLI version (and optional max-version overrun mode) to evaluate the\n * manifest's `pm_min_version`/`pm_max_version` bounds against. Provide it to run\n * {@link checkExtensionManifestCompatibility} against the synthesized manifest\n * (or, absent an `identity`, the blueprint's in-module `manifest` mirror). Omit\n * to skip the version-compatibility check.\n */\n target?: ExtensionManifestCompatibilityTarget;\n /**\n * The capabilities the package's `manifest.json` declares, reconciled against\n * the surfaces the blueprint exercises. Passed straight to\n * {@link lintExtensionBlueprint}; when omitted it falls back to\n * `blueprint.manifest.capabilities`, so the blueprint's in-module mirror is\n * linted by default.\n */\n declaredCapabilities?: readonly string[];\n}\n\n/** Which preflight stage produced an {@link ExtensionPreflightFinding}. */\nexport type ExtensionPreflightFindingSource = \"blueprint\" | \"compatibility\";\n\n/**\n * A single finding in an {@link ExtensionPreflightReport}, flattened from one of\n * the underlying stages and tagged with its {@link ExtensionPreflightFindingSource}\n * so a consolidated report stays traceable to the check that raised it.\n */\nexport interface ExtensionPreflightFinding {\n /** The stage that produced the finding: blueprint lint or version compatibility. */\n source: ExtensionPreflightFindingSource;\n /** Whether the finding blocks publish/activation (`error`) or is advisory (`warning`). */\n severity: ExtensionBlueprintLintSeverity;\n /** The underlying stage's machine-readable code, for programmatic handling. */\n code: ExtensionBlueprintLintCode | ExtensionManifestCompatibilityCode;\n /** The underlying stage's human-readable explanation, verbatim. */\n message: string;\n}\n\n/**\n * The consolidated result of {@link preflightExtension}: every author-time stage's\n * structured output plus a flattened, source-tagged finding list.\n */\nexport interface ExtensionPreflightReport {\n /** `true` when no `error`-severity finding appears across any stage (warnings still pass). */\n ok: boolean;\n /** The least-privilege capability set the blueprint exercises (from {@link deriveExtensionCapabilities}). */\n capabilities: ExtensionCapability[];\n /** The full {@link lintExtensionBlueprint} result (structural + capability-drift findings). */\n blueprint: ExtensionBlueprintLintResult;\n /** The manifest synthesized from `options.identity`, or `null` when no identity was supplied. */\n manifest: ExtensionManifest | null;\n /** The {@link checkExtensionManifestCompatibility} result, or `null` when no `options.target` was supplied. */\n compatibility: ExtensionManifestCompatibilityResult | null;\n /**\n * Every finding from all stages, blueprint-lint findings before compatibility\n * findings, each tagged by `source`. This is the consolidated, curated view: when\n * `options.identity` synthesizes the manifest without an explicit\n * `declaredCapabilities` set, capability-drift findings the lint raised against the\n * blueprint's now-superseded in-module `manifest` mirror are omitted here (the raw\n * `blueprint` result still carries them).\n */\n findings: ExtensionPreflightFinding[];\n}\n\n/**\n * Preflight a declarative {@link ExtensionBlueprint} through every author-time\n * check in one call, returning a single consolidated {@link ExtensionPreflightReport}.\n *\n * This is the author-time capstone — the static analog of\n * {@link ../sdk/testing.js#createExtensionTestHarness}, which unified the\n * runtime-test helpers. Instead of chaining {@link lintExtensionBlueprint},\n * {@link synthesizeExtensionManifest}, and {@link checkExtensionManifestCompatibility}\n * (and reconciling their separate results) before publishing a package, an author\n * runs `preflightExtension(blueprint, { identity, target })` and reads one report:\n *\n * - the blueprint is always linted (structural footguns + capability drift);\n * - when `options.identity` is given, the complete least-privilege manifest is\n * synthesized and returned, so the author never hand-syncs `capabilities`;\n * - when `options.target` is given, the synthesized manifest's version bounds\n * (or, absent an identity, the blueprint's in-module `manifest` mirror) are\n * checked against that pm version.\n *\n * It is pure and side-effect-free — no loading, activation, or filesystem access,\n * exactly like the stages it composes — so it is safe in any author-time or CI\n * context. The per-stage structured results are exposed unmodified\n * (`report.blueprint`/`manifest`/`compatibility`) alongside the flattened,\n * source-tagged `report.findings`; `report.ok` is `false` if any stage produced an\n * `error`-severity finding. The flattened `findings` are curated for the author-once\n * flow: once an `identity` synthesizes the manifest (and no explicit\n * `declaredCapabilities` was pinned), the synthesized manifest — not the blueprint's\n * in-module `manifest` mirror — is what ships, so capability-drift findings the lint\n * raised against that mirror are false positives and are omitted from\n * `report.findings` (the raw `report.blueprint` result still reports them). Pair it\n * with {@link ../sdk/testing.js#assertExtensionPreflight} to fail CI in one line.\n */\nexport function preflightExtension(\n blueprint: ExtensionBlueprint,\n options: PreflightExtensionOptions = {},\n): ExtensionPreflightReport {\n const blueprintResult = lintExtensionBlueprint(blueprint, { declaredCapabilities: options.declaredCapabilities });\n const manifest = options.identity ? synthesizeExtensionManifest(blueprint, options.identity) : null;\n // Compatibility evaluates the bounds the package will ship: the synthesized\n // manifest when an identity drives generation, else the blueprint's in-module\n // manifest mirror, else an empty manifest (no bounds → trivially compatible).\n const compatibility = options.target\n ? checkExtensionManifestCompatibility(manifest ?? blueprint.manifest ?? {}, options.target)\n : null;\n // When preflight synthesizes the manifest from an identity (and the caller did not\n // pin an explicit declaredCapabilities set), the blueprint lint reconciled against\n // the blueprint's in-module `manifest` mirror — which the synthesized manifest\n // supersedes. Capability-drift findings against that stale mirror are false\n // positives in the consolidated view (a missing capability would even flip `ok` to\n // false though the synthesized manifest declares it), so drop them; structural\n // findings are unaffected and the raw lint result on `report.blueprint` keeps all of\n // them. An explicit declaredCapabilities set is a deliberate \"check exactly this\"\n // request, so it is never suppressed.\n const suppressCapabilityDrift = manifest !== null && options.declaredCapabilities === undefined;\n const blueprintFindings = suppressCapabilityDrift\n ? blueprintResult.findings.filter((finding) => !CAPABILITY_DRIFT_LINT_CODES.has(finding.code))\n : blueprintResult.findings;\n const findings: ExtensionPreflightFinding[] = [\n ...blueprintFindings.map(\n (finding): ExtensionPreflightFinding => ({\n source: \"blueprint\",\n severity: finding.severity,\n code: finding.code,\n message: finding.message,\n }),\n ),\n ...(compatibility?.findings ?? []).map(\n (finding): ExtensionPreflightFinding => ({\n source: \"compatibility\",\n severity: finding.severity,\n code: finding.code,\n message: finding.message,\n }),\n ),\n ];\n return {\n ok: findings.every((finding) => finding.severity !== \"error\"),\n capabilities: blueprintResult.used,\n blueprint: blueprintResult,\n manifest,\n compatibility,\n findings,\n };\n}\n","/**\n * @module sdk/testing\n *\n * Defines public SDK APIs and package-author helpers for Testing.\n */\nimport type {\n AfterCommandHookContext,\n BeforeCommandHookContext,\n CommandHandlerResult,\n CommandOverrideContext,\n CommandOverrideResult,\n ExtensionActivationResult,\n ExtensionCapability,\n ExtensionCommandRegistry,\n ExtensionDeactivationResult,\n ExtensionGovernancePolicy,\n ExtensionHookRegistry,\n ExtensionLayer,\n ExtensionLoadResult,\n ExtensionManifest,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionRegistrationRegistry,\n ExtensionRendererRegistry,\n ExtensionServiceName,\n ExtensionServiceRegistry,\n FlagDefinition,\n OnIndexHookContext,\n OnReadHookContext,\n OnWriteHookContext,\n OutputRendererFormat,\n ParserOverrideContext,\n ParserOverrideResult,\n PreflightOverrideContext,\n PreflightOverrideResult,\n RegisteredExtensionCommandDefinition,\n RegisteredExtensionCommandOverride,\n RegisteredExtensionExporter,\n RegisteredExtensionFlagDefinitions,\n RegisteredExtensionHook,\n RegisteredExtensionImporter,\n RegisteredExtensionParserOverride,\n RegisteredExtensionPreflightOverride,\n RegisteredExtensionProjectProfile,\n RegisteredExtensionRendererOverride,\n RegisteredExtensionSchemaFieldDefinitions,\n RegisteredExtensionSchemaItemTypeDefinitions,\n RegisteredExtensionSchemaMigrationDefinition,\n RegisteredExtensionSearchProvider,\n RegisteredExtensionServiceOverride,\n RegisteredExtensionVectorStoreAdapter,\n RendererOverrideContext,\n RendererOverrideResult,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationRunContext,\n SearchProviderEmbedBatchContext,\n SearchProviderEmbedContext,\n SearchProviderQueryContext,\n SearchProviderQueryExpansionContext,\n SearchProviderQueryExpansionResult,\n SearchProviderQueryResult,\n SearchProviderRerankContext,\n SearchProviderRerankResult,\n ServiceOverrideContext,\n ServiceOverrideResult,\n VectorStoreDeleteContext,\n VectorStoreQueryContext,\n VectorStoreQueryHit,\n VectorStoreUpsertContext,\n} from \"../core/extensions/loader.js\";\nimport {\n activateExtensions,\n deactivateExtensions,\n runAfterCommandHooks,\n runBeforeCommandHooks,\n runCommandHandler,\n runCommandOverride,\n runOnIndexHooks,\n runOnReadHooks,\n runOnWriteHooks,\n runParserOverride,\n runPreflightOverride,\n runRendererOverride,\n runServiceOverride,\n} from \"../core/extensions/loader.js\";\nimport { createDefaultExtensionGovernancePolicy } from \"../core/extensions/extension-types.js\";\nimport {\n getMigrationRuntimeDefinition,\n resolveRegisteredSearchProvider,\n resolveRegisteredVectorStoreAdapter,\n} from \"../core/extensions/runtime-registrations.js\";\nimport { collectUsedExtensionCapabilities } from \"../core/extensions/capability-usage.js\";\nimport { normalizeKnownExtensionCapability } from \"../core/extensions/extension-capability-aliases.js\";\nimport {\n checkExtensionManifestCompatibility,\n describeExtensionBlueprint,\n lintExtensionBlueprint,\n preflightExtension,\n} from \"./compose.js\";\nimport { describeExtensionActivation } from \"../core/extensions/activation-summary.js\";\nimport type {\n DescribeExtensionActivationOptions,\n ExtensionActivationSummary,\n} from \"../core/extensions/activation-summary.js\";\nimport type { ProjectProfileDefinition } from \"../core/profile/profile-presets.js\";\nimport { lintProjectProfile, type ProjectProfileLintReport } from \"../core/profile/profile-lint.js\";\nimport { renderExtensionSurfaceMarkdown } from \"../core/extensions/activation-summary-markdown.js\";\nimport type { ExtensionSurfaceMarkdownOptions } from \"../core/extensions/activation-summary-markdown.js\";\nimport type {\n ExtensionBlueprint,\n ExtensionBlueprintLintCode,\n ExtensionBlueprintLintFinding,\n ExtensionBlueprintLintResult,\n ExtensionBlueprintLintSeverity,\n ExtensionManifestCompatibilityManifest,\n ExtensionManifestCompatibilityResult,\n ExtensionManifestCompatibilityTarget,\n ExtensionPreflightReport,\n LintExtensionBlueprintOptions,\n PreflightExtensionOptions,\n} from \"./compose.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport type { PmPackageManifest, PmPackageResourceKind } from \"../core/packages/manifest.js\";\nimport { asPropertyRecord, resolveActivatablePropertyRecord } from \"../core/shared/primitives.js\";\n\n// `describeExtensionActivation` is the `describe` (enumerate-all) verb that\n// pairs with the `assert*` (verify-one) and `run*` (invoke-one) helpers below.\n// It lives in core (it walks the same registries the loader populates) and is\n// surfaced here so package authors get the whole testing surface from the\n// `@unbrained/pm-cli/sdk/testing` subpath.\nexport {\n describeExtensionActivation,\n renderExtensionSurfaceMarkdown,\n};\nexport type {\n DescribeExtensionActivationOptions,\n ExtensionActivationSummary,\n} from \"../core/extensions/activation-summary.js\";\nexport type { ExtensionSurfaceMarkdownOptions } from \"../core/extensions/activation-summary-markdown.js\";\n\n// `composeExtension`'s author-time companions: describe a blueprint's surface map\n// and preflight it for capability drift / duplicate / empty-surface footguns\n// without activating. Surfaced through the `@unbrained/pm-cli/sdk/testing` subpath\n// so a package author gets the full author → describe → preflight → test loop here,\n// alongside the assert*/run* helpers; `assertExtensionBlueprint` below is the\n// throwing assertion that pairs with the non-throwing `lintExtensionBlueprint`.\nexport { describeExtensionBlueprint, lintExtensionBlueprint };\nexport type {\n ExtensionBlueprint,\n ExtensionBlueprintLintCode,\n ExtensionBlueprintLintFinding,\n ExtensionBlueprintLintResult,\n ExtensionBlueprintLintSeverity,\n LintExtensionBlueprintOptions,\n};\n\n/**\n * Documents the activate extension for test options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ActivateExtensionForTestOptions {\n name?: string;\n layer?: ExtensionLayer;\n capabilities?: readonly ExtensionCapability[];\n policy?: ExtensionGovernancePolicy;\n}\n\n/**\n * Documents the deactivate extension for test options payload exchanged by command, SDK, and package integrations.\n */\nexport interface DeactivateExtensionForTestOptions {\n /** Overrides the in-memory extension name (defaults to `manifest.name` or `\"test-extension\"`). */\n name?: string;\n /** Overrides the layer recorded for the in-memory extension (defaults to `\"project\"`). */\n layer?: ExtensionLayer;\n /**\n * Activation result returned by `activateExtensionForTest`. When provided, an\n * extension whose `activate` failed is skipped — mirroring the host teardown\n * contract that never deactivates a never-initialized extension. Pass the same\n * `name`/`layer` to both helpers so the skip key matches.\n */\n activation?: Pick<ExtensionActivationResult, \"failed\">;\n /**\n * Per-hook teardown bound, forwarded as `deactivate_timeout_ms`. Use `0` (or\n * `Infinity`) to wait indefinitely; omit to keep the host default.\n */\n deactivateTimeoutMs?: number;\n}\n\n/**\n * Options for {@link runRegisteredCommandForTest} — the inputs forwarded to a\n * registered extension command handler when exercising its behavior in a test.\n */\nexport interface RunRegisteredCommandForTestOptions {\n /**\n * Full registered command path to invoke, e.g. `\"hello\"` or `\"todos import\"`.\n * Matched against `commands.handlers[].command` after normalization (trimmed,\n * lower-cased, internal whitespace collapsed), mirroring runtime dispatch.\n */\n command: string;\n /** Positional arguments forwarded as `context.args` (default: none). */\n args?: readonly string[];\n /** Parsed flags/options forwarded as `context.options` (default: none). */\n options?: Record<string, unknown>;\n /**\n * Global option overrides merged onto the agent-safe test defaults\n * (`{ json: true, quiet: true, noPager: true }`), forwarded as `context.global`.\n */\n global?: Partial<GlobalOptions>;\n /**\n * Resolved pm workspace root forwarded as `context.pm_root` (default: `\"\"`).\n * Most pure handlers ignore it; set it when the handler reads workspace files.\n */\n pmRoot?: string;\n}\n\n/**\n * Options for {@link runRegisteredHookForTest} — the lifecycle `kind` to fire and\n * the synthetic context handed to every registered hook of that kind.\n *\n * The union keeps `context` type-safe per kind: `kind: \"on_write\"` requires an\n * {@link OnWriteHookContext}, `kind: \"after_command\"` an\n * {@link AfterCommandHookContext}, and so on — so authors cannot accidentally\n * pass an index context to a read hook.\n */\nexport type RunRegisteredHookForTestOptions =\n | { kind: \"before_command\"; context: BeforeCommandHookContext }\n | { kind: \"after_command\"; context: AfterCommandHookContext }\n | { kind: \"on_read\"; context: OnReadHookContext }\n | { kind: \"on_write\"; context: OnWriteHookContext }\n | { kind: \"on_index\"; context: OnIndexHookContext };\n\n/**\n * Maps each invokable search-provider operation to the context type its function\n * receives, keeping {@link runRegisteredSearchProviderForTest} type-safe per\n * operation. Mirrors the operations the host dispatches to a registered provider:\n * semantic `query`, single/batch embedding (`embed`/`embedBatch`),\n * `queryExpansion`, and `rerank`.\n */\nexport interface SearchProviderOperationContexts {\n query: SearchProviderQueryContext;\n embed: SearchProviderEmbedContext;\n embedBatch: SearchProviderEmbedBatchContext;\n queryExpansion: SearchProviderQueryExpansionContext;\n rerank: SearchProviderRerankContext;\n}\n\n/**\n * Maps each invokable search-provider operation to the result type its function\n * returns, so {@link runRegisteredSearchProviderForTest} resolves a precise return\n * type from the chosen `operation` instead of a union the caller must narrow.\n */\nexport interface SearchProviderOperationResults {\n query: SearchProviderQueryResult;\n embed: number[];\n embedBatch: number[][];\n queryExpansion: SearchProviderQueryExpansionResult;\n rerank: SearchProviderRerankResult;\n}\n\n/**\n * Options for {@link runRegisteredSearchProviderForTest}: the registered\n * `provider` name to resolve, the `operation` to invoke, and the synthetic\n * `context` handed to that operation. The discriminated union keeps `context`\n * type-safe per operation — `operation: \"embed\"` requires a\n * {@link SearchProviderEmbedContext}, `operation: \"rerank\"` a\n * {@link SearchProviderRerankContext}, and so on.\n */\nexport type RunRegisteredSearchProviderForTestOptions = {\n [Operation in keyof SearchProviderOperationContexts]: {\n /** Registered provider name to resolve, matched case-insensitively as the host does. */\n provider: string;\n /** Provider operation to invoke. */\n operation: Operation;\n /** Synthetic context handed to the resolved operation function. */\n context: SearchProviderOperationContexts[Operation];\n };\n}[keyof SearchProviderOperationContexts];\n\n/**\n * Maps each invokable vector-store-adapter operation to the context type its\n * function receives, keeping {@link runRegisteredVectorStoreAdapterForTest}\n * type-safe per operation. Mirrors the operations the host dispatches to a\n * registered adapter: nearest-neighbour `query`, `upsert`, and `delete`.\n */\nexport interface VectorStoreAdapterOperationContexts {\n query: VectorStoreQueryContext;\n upsert: VectorStoreUpsertContext;\n delete: VectorStoreDeleteContext;\n}\n\n/**\n * Maps each invokable vector-store-adapter operation to the result type its\n * function returns. Only `query` has a structured result\n * ({@link VectorStoreQueryHit}[]); `upsert`/`delete` report success by not\n * throwing, so their result is `unknown` and typically ignored.\n */\nexport interface VectorStoreAdapterOperationResults {\n query: VectorStoreQueryHit[];\n upsert: unknown;\n delete: unknown;\n}\n\n/**\n * Options for {@link runRegisteredVectorStoreAdapterForTest}: the registered\n * `adapter` name to resolve, the `operation` to invoke, and the synthetic\n * `context` handed to that operation. The discriminated union keeps `context`\n * type-safe per operation — `operation: \"upsert\"` requires a\n * {@link VectorStoreUpsertContext}, `operation: \"delete\"` a\n * {@link VectorStoreDeleteContext}, and so on.\n */\nexport type RunRegisteredVectorStoreAdapterForTestOptions = {\n [Operation in keyof VectorStoreAdapterOperationContexts]: {\n /** Registered adapter name to resolve, matched case-insensitively as the host does. */\n adapter: string;\n /** Adapter operation to invoke. */\n operation: Operation;\n /** Synthetic context handed to the resolved operation function. */\n context: VectorStoreAdapterOperationContexts[Operation];\n };\n}[keyof VectorStoreAdapterOperationContexts];\n\n/**\n * Options for {@link runRegisteredMigrationForTest}: which registered migration\n * to invoke and the workspace root its run context reports.\n */\nexport interface RunRegisteredMigrationForTestOptions {\n /** Registered migration id to resolve, matched case-insensitively against `definition.id`. */\n migration: string;\n /** Optional extension name to disambiguate when several extensions register the same id. */\n extensionName?: string;\n /** Resolved pm workspace root forwarded as `context.pm_root` (default `\"\"`). */\n pmRoot?: string;\n}\n\n/**\n * Options for {@link runRegisteredImporterForTest} — the registered importer name\n * to invoke plus the synthetic invocation context forwarded to its handler.\n *\n * The `importer` name is the value passed to `api.registerImporter(name, ...)`,\n * resolved case-insensitively (and whitespace-collapsed) against\n * `registrations.importers`; the helper derives the `\"<name> import\"` command\n * path internally, so authors never hand-build it.\n */\nexport interface RunRegisteredImporterForTestOptions {\n /** Registered importer name to resolve, e.g. `\"csv\"` for a `\"csv import\"` handler. */\n importer: string;\n /** Optional extension name to disambiguate when several extensions register the same importer. */\n extensionName?: string;\n /** Positional arguments forwarded as `context.args` (default: none). */\n args?: readonly string[];\n /** Parsed flags/options forwarded as `context.options` (default: none). */\n options?: Record<string, unknown>;\n /**\n * Global option overrides merged onto the agent-safe test defaults\n * (`{ json: true, quiet: true, noPager: true }`), forwarded as `context.global`.\n */\n global?: Partial<GlobalOptions>;\n /** Resolved pm workspace root forwarded as `context.pm_root` (default: `\"\"`). */\n pmRoot?: string;\n}\n\n/**\n * Options for {@link runRegisteredExporterForTest} — the registered exporter name\n * to invoke plus the synthetic invocation context forwarded to its handler.\n *\n * The `exporter` name is the value passed to `api.registerExporter(name, ...)`,\n * resolved case-insensitively (and whitespace-collapsed) against\n * `registrations.exporters`; the helper derives the `\"<name> export\"` command\n * path internally, so authors never hand-build it.\n */\nexport interface RunRegisteredExporterForTestOptions {\n /** Registered exporter name to resolve, e.g. `\"csv\"` for a `\"csv export\"` handler. */\n exporter: string;\n /** Optional extension name to disambiguate when several extensions register the same exporter. */\n extensionName?: string;\n /** Positional arguments forwarded as `context.args` (default: none). */\n args?: readonly string[];\n /** Parsed flags/options forwarded as `context.options` (default: none). */\n options?: Record<string, unknown>;\n /**\n * Global option overrides merged onto the agent-safe test defaults\n * (`{ json: true, quiet: true, noPager: true }`), forwarded as `context.global`.\n */\n global?: Partial<GlobalOptions>;\n /** Resolved pm workspace root forwarded as `context.pm_root` (default: `\"\"`). */\n pmRoot?: string;\n}\n\n/**\n * Documents the extension deactivation expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface ExtensionDeactivationExpectation {\n /** Expected count of extensions whose `deactivate` ran without throwing (default `1`). */\n deactivated?: number;\n /** Expected count of teardown failures (default `0`). */\n failed?: number;\n}\n\n/**\n * Documents the registered command contract expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredCommandContractExpectation {\n command: string;\n action?: string;\n extensionName?: string;\n arguments?: string[];\n flags?: string[];\n}\n\n/**\n * Documents the registered command contract assertion payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredCommandContractAssertion {\n command: RegisteredExtensionCommandDefinition;\n flags: FlagDefinition[];\n}\n\n/**\n * Documents the registered flags expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredFlagsExpectation {\n targetCommand: string;\n extensionName?: string;\n flags?: string[];\n}\n\n/**\n * Public hook lifecycle kinds an extension can register through `api.hooks.*`.\n */\nexport type RegisteredHookKind = \"before_command\" | \"after_command\" | \"on_read\" | \"on_write\" | \"on_index\";\n\nconst HOOK_KIND_TO_REGISTRY_FIELD: Record<RegisteredHookKind, keyof ExtensionHookRegistry> = {\n before_command: \"beforeCommand\",\n after_command: \"afterCommand\",\n on_read: \"onRead\",\n on_write: \"onWrite\",\n on_index: \"onIndex\",\n};\n\n/**\n * Documents the registered hook expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredHookExpectation {\n kind: RegisteredHookKind;\n extensionName?: string;\n}\n\n/**\n * Documents the registered search provider expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredSearchProviderExpectation {\n provider: string;\n extensionName?: string;\n}\n\n/**\n * Documents the registered vector store adapter expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredVectorStoreAdapterExpectation {\n adapter: string;\n extensionName?: string;\n}\n\n/**\n * Documents the registered importer expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredImporterExpectation {\n importer: string;\n extensionName?: string;\n}\n\n/**\n * Documents the registered exporter expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredExporterExpectation {\n exporter: string;\n extensionName?: string;\n}\n\n/**\n * Documents the registered item field expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredItemFieldExpectation {\n field: string;\n extensionName?: string;\n type?: SchemaFieldDefinition[\"type\"];\n}\n\n/**\n * Documents the registered item field assertion payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredItemFieldAssertion {\n registration: RegisteredExtensionSchemaFieldDefinitions;\n field: SchemaFieldDefinition;\n}\n\n/**\n * Documents the registered item type expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredItemTypeExpectation {\n itemType: string;\n extensionName?: string;\n folder?: string;\n}\n\n/**\n * Documents the registered item type assertion payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredItemTypeAssertion {\n registration: RegisteredExtensionSchemaItemTypeDefinitions;\n itemType: SchemaItemTypeDefinition;\n}\n\n/**\n * Documents the registered command override expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredCommandOverrideExpectation {\n command: string;\n extensionName?: string;\n}\n\n/**\n * Documents the registered parser override expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredParserOverrideExpectation {\n command: string;\n extensionName?: string;\n}\n\n/**\n * Documents the registered preflight override expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredPreflightOverrideExpectation {\n extensionName?: string;\n}\n\n/**\n * Documents the registered renderer override expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredRendererOverrideExpectation {\n format: OutputRendererFormat;\n extensionName?: string;\n}\n\n/**\n * Documents the registered service override expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredServiceOverrideExpectation {\n service: ExtensionServiceName;\n extensionName?: string;\n}\n\n/**\n * Documents the registered migration expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredMigrationExpectation {\n migration: string;\n extensionName?: string;\n mandatory?: boolean;\n}\n\n/**\n * Documents the registered project-profile expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredProfileExpectation {\n /** Profile name to assert is registered (case-insensitive). */\n profile: string;\n /** Restrict the match to a single extension when several are active. */\n extensionName?: string;\n}\n\n/**\n * Documents the registered project-profile assertion payload exchanged by command, SDK, and package integrations.\n */\nexport interface RegisteredProfileAssertion {\n /** The matching registration entry. */\n registration: RegisteredExtensionProjectProfile;\n /** The registered profile definition. */\n profile: ProjectProfileDefinition;\n}\n\n/**\n * Documents the extension capability usage expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface ExtensionCapabilityUsageExpectation {\n /**\n * Capabilities the manifest declares. Mirror `manifest.capabilities` here so\n * the assertion fails when the manifest grants more than the code uses.\n */\n declared: readonly ExtensionCapability[];\n /** Restrict reconciliation to a single extension when the activation has several. */\n extensionName?: string;\n /**\n * Capabilities allowed to be declared without being exercised (e.g. ones a\n * runtime registers only behind a config flag). These are excluded from the\n * least-privilege failure.\n */\n allowUnused?: readonly ExtensionCapability[];\n}\n\n/**\n * Documents the extension capability usage assertion payload exchanged by command, SDK, and package integrations.\n */\nexport interface ExtensionCapabilityUsageAssertion {\n /** Declared capabilities considered, sorted and de-duplicated. */\n declared: ExtensionCapability[];\n /** Capabilities the extension actually registered against, sorted. */\n used: ExtensionCapability[];\n /** Declared capabilities with no matching registration after the allowlist. */\n unused: ExtensionCapability[];\n}\n\n/**\n * Restricts package manifest resource expectation values accepted by command, SDK, and storage contracts.\n */\nexport type PackageManifestResourceExpectation = Partial<Record<PmPackageResourceKind, readonly string[]>>;\n\n/**\n * Documents the package manifest expectation payload exchanged by command, SDK, and package integrations.\n */\nexport interface PackageManifestExpectation {\n packageName?: string;\n aliases?: readonly string[];\n resources?: PackageManifestResourceExpectation;\n}\n\n/**\n * Options for {@link ExtensionTestHarness.renderMarkdown}.\n */\nexport interface RenderExtensionHarnessMarkdownOptions extends ExtensionSurfaceMarkdownOptions {\n /**\n * Restrict the rendered summary to one activated extension by name. Defaults\n * to the full activation union, matching {@link ExtensionTestHarness.activationSummary}.\n */\n extensionName?: string;\n}\n\nfunction normalizeSdkIdentifier(value: string): string {\n return value.trim().toLowerCase();\n}\n\n/**\n * Match key for profile-name assertions. Extends {@link normalizeSdkIdentifier}\n * with hyphen→underscore folding so the assertion mirrors the runtime profile\n * resolution (`pm profile`), which treats `my-flow` and `my_flow` as the same\n * archetype. Profiles are the one registration surface that resolves\n * hyphen-insensitively (item types resolve by alias, migrations by exact id), so\n * — unlike the other `assertRegistered*` helpers — this one folds the separator\n * to stay in lockstep with how a profile is actually looked up by name.\n */\nfunction normalizeSdkProfileMatchKey(value: string): string {\n return normalizeSdkIdentifier(value).replaceAll(\"-\", \"_\");\n}\n\nfunction extensionNameSuffix(extensionName: string | undefined): string {\n return extensionName ? ` from extension \"${extensionName}\"` : \"\";\n}\n\nfunction sortedUnique(values: readonly string[]): string[] {\n return [...new Set(values)].sort((left, right) => left.localeCompare(right));\n}\n\nfunction normalizeSdkCommandName(command: string): string {\n if (typeof command !== \"string\") {\n // Positional misuse like runRegisteredCommandForTest(activation, \"name\", opts)\n // reaches here with `undefined` at runtime; guide instead of crashing on .trim().\n throw new Error(\n 'A command name string is required. Pass it via the options object, e.g. runRegisteredCommandForTest(activation, { command: \"my command\" }) — positional command arguments are not supported.',\n );\n }\n return command\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nfunction formatAvailable(values: readonly string[]): string {\n return values.length > 0 ? values.join(\", \") : \"(none)\";\n}\n\nfunction assertStringSetIncludes(\n actual: readonly string[] | undefined,\n expected: readonly string[],\n label: string,\n): void {\n const actualValues = new Set(actual ?? []);\n const missing = sortedUnique(expected.filter((value) => !actualValues.has(value)));\n if (missing.length > 0) {\n throw new Error(\n `Expected package manifest ${label} to include ${missing.join(\", \")}; available: ${formatAvailable(\n sortedUnique(actual ?? []),\n )}`,\n );\n }\n}\n\nfunction collectFlagLabels(flags: readonly FlagDefinition[]): Set<string> {\n const labels = new Set<string>();\n for (const flag of flags) {\n if (typeof flag.long === \"string\" && flag.long.trim().length > 0) {\n labels.add(flag.long.trim());\n }\n if (typeof flag.short === \"string\" && flag.short.trim().length > 0) {\n labels.add(flag.short.trim());\n }\n }\n return labels;\n}\n\nfunction readTestExtensionManifest(module: unknown): Partial<ExtensionManifest> {\n const moduleRecord = asPropertyRecord(module);\n if (!moduleRecord) {\n return {};\n }\n const manifest = asPropertyRecord(moduleRecord.manifest);\n if (manifest) {\n return manifest as Partial<ExtensionManifest>;\n }\n const defaultExport = asPropertyRecord(moduleRecord.default);\n const defaultManifest = asPropertyRecord(defaultExport?.manifest);\n if (defaultManifest) {\n return defaultManifest as Partial<ExtensionManifest>;\n }\n if (\n defaultExport &&\n typeof moduleRecord.default !== \"function\" &&\n (\"name\" in defaultExport || \"capabilities\" in defaultExport)\n ) {\n return defaultExport as Partial<ExtensionManifest>;\n }\n if (typeof module !== \"function\" && (\"name\" in moduleRecord || \"capabilities\" in moduleRecord)) {\n return moduleRecord as Partial<ExtensionManifest>;\n }\n return {};\n}\n\nfunction resolveTestExtensionName(manifest: Partial<ExtensionManifest>, explicitName: string | undefined): string {\n return (\n explicitName ??\n (typeof manifest.name === \"string\" && manifest.name.trim().length > 0 ? manifest.name.trim() : \"test-extension\")\n );\n}\n\nfunction readTestExtensionCapabilities(\n manifest: Partial<ExtensionManifest>,\n options: ActivateExtensionForTestOptions,\n): ExtensionCapability[] {\n if (Array.isArray(options.capabilities)) {\n return [...options.capabilities];\n }\n if (Array.isArray(manifest.capabilities)) {\n return manifest.capabilities.filter((capability): capability is ExtensionCapability => typeof capability === \"string\");\n }\n return [];\n}\n\n/**\n * Build the synthetic single-extension {@link ExtensionLoadResult} shared by the\n * activate/deactivate test helpers, so both stay aligned with the loader's load\n * contract as it evolves. The `loaded` entry mirrors the real on-disk shape\n * (including `capabilities` and the compatibility fields) while leaving\n * filesystem paths empty, since the module is supplied in memory.\n */\nfunction buildSingleExtensionLoadResult(\n module: unknown,\n manifest: Partial<ExtensionManifest>,\n identity: { name: string; layer: ExtensionLayer; capabilities: ExtensionCapability[]; policy: ExtensionGovernancePolicy },\n): ExtensionLoadResult {\n return {\n disabled_by_flag: false,\n roots: { global: \"\", project: \"\" },\n configured_enabled: [],\n configured_disabled: [],\n discovered: [],\n effective: [],\n warnings: [],\n policy: identity.policy,\n failed: [],\n loaded: [\n {\n layer: identity.layer,\n directory: \"\",\n manifest_path: \"\",\n name: identity.name,\n version: typeof manifest.version === \"string\" ? manifest.version : \"0.0.0\",\n entry: typeof manifest.entry === \"string\" ? manifest.entry : \"./index.js\",\n priority: typeof manifest.priority === \"number\" ? manifest.priority : 0,\n entry_path: \"\",\n capabilities: identity.capabilities,\n manifest_version: typeof manifest.manifest_version === \"number\" ? manifest.manifest_version : undefined,\n pm_min_version: typeof manifest.pm_min_version === \"string\" ? manifest.pm_min_version : undefined,\n pm_max_version: typeof manifest.pm_max_version === \"string\" ? manifest.pm_max_version : undefined,\n engines: manifest.engines,\n trusted: manifest.trusted,\n provenance: manifest.provenance,\n sandbox_profile: manifest.sandbox_profile,\n permissions: manifest.permissions,\n activation: manifest.activation,\n module,\n },\n ],\n };\n}\n\n/**\n * Activate one in-memory extension module for package tests.\n *\n * This uses pm's real registration validation and activation engine while\n * avoiding private loader imports, filesystem manifests, or workspace setup.\n */\nexport async function activateExtensionForTest(\n module: unknown,\n options: ActivateExtensionForTestOptions = {},\n): Promise<ExtensionActivationResult> {\n const manifest = readTestExtensionManifest(module);\n return activateExtensions(\n buildSingleExtensionLoadResult(module, manifest, {\n name: resolveTestExtensionName(manifest, options.name),\n layer: options.layer ?? \"project\",\n capabilities: readTestExtensionCapabilities(manifest, options),\n policy: options.policy ?? createDefaultExtensionGovernancePolicy(),\n }),\n );\n}\n\n/**\n * Deactivate one in-memory extension module for package tests — the teardown\n * counterpart to {@link activateExtensionForTest}.\n *\n * Runs pm's real `deactivateExtensions` engine (including its bounded per-hook\n * timeout and best-effort failure capture) over a single synthetic load entry,\n * so authors can prove an extension's `deactivate` releases the resources its\n * `activate` opened — without importing private loader internals or staging a\n * workspace. Resolve `name`/`layer` the same way {@link activateExtensionForTest}\n * does so a forwarded `activation` result skips a failed extension correctly.\n */\nexport async function deactivateExtensionForTest(\n module: unknown,\n options: DeactivateExtensionForTestOptions = {},\n): Promise<ExtensionDeactivationResult> {\n const manifest = readTestExtensionManifest(module);\n return deactivateExtensions(\n buildSingleExtensionLoadResult(module, manifest, {\n name: resolveTestExtensionName(manifest, options.name),\n layer: options.layer ?? \"project\",\n capabilities: readTestExtensionCapabilities(manifest, {}),\n policy: createDefaultExtensionGovernancePolicy(),\n }),\n options.activation,\n options.deactivateTimeoutMs === undefined ? {} : { deactivate_timeout_ms: options.deactivateTimeoutMs },\n );\n}\n\n/**\n * Invoke a registered extension command handler and return its real\n * {@link CommandHandlerResult} so package tests can assert on behavior — not\n * just that the command was registered.\n *\n * This is the \"invoke\" verb that completes the package-author testing loop:\n * `activateExtensionForTest` → `assertRegisteredCommandContract` → **run** →\n * `deactivateExtensionForTest`. It runs pm's real handler-dispatch engine\n * (`runCommandHandler`) over `activation.commands`, building the\n * `CommandHandlerContext` with agent-safe global defaults\n * (`{ json: true, quiet: true, noPager: true }`) that callers may override.\n *\n * Because `registerImporter`/`registerExporter` register their handlers under\n * the `\"<name> import\"` / `\"<name> export\"` command paths, this same helper\n * exercises importer and exporter handlers too.\n *\n * Throws a descriptive error (listing the available handler command paths) when\n * no handler is registered for `command`, since that is a wiring/typo bug in the\n * test rather than a behavior under test. When a handler is found, the result is\n * returned verbatim: a clean run yields `{ handled: true, result, warnings: [] }`,\n * while a handler that throws a non-exit error yields\n * `{ handled: false, warnings: [code], errorMessage }` so the failure can be\n * asserted. A handler that throws an error carrying a numeric `exitCode`\n * propagates the throw, matching runtime semantics.\n */\nexport async function runRegisteredCommandForTest(\n commands: ExtensionCommandRegistry,\n options: RunRegisteredCommandForTestOptions,\n): Promise<CommandHandlerResult> {\n const command = normalizeSdkCommandName(options.command);\n if (command.length === 0) {\n throw new Error(\"Expected command name must be a non-empty string\");\n }\n const hasHandler = commands.handlers.some((entry) => entry.command === command);\n if (!hasHandler) {\n const available = sortedUnique(commands.handlers.map((entry) => entry.command));\n throw new Error(\n `Expected a registered command handler for \"${command}\" to invoke. Available command handlers: ${formatAvailable(\n available,\n )}`,\n );\n }\n return runCommandHandler(commands, {\n command,\n args: options.args ? [...options.args] : [],\n options: options.options ? { ...options.options } : {},\n global: { json: true, quiet: true, noPager: true, ...options.global },\n pm_root: options.pmRoot ?? \"\",\n });\n}\n\n/**\n * Fire every registered lifecycle hook of a given `kind` through pm's real hook\n * runner and return the warnings array so package tests can assert on behavior —\n * not just that a hook was registered.\n *\n * This is the hook counterpart to {@link runRegisteredCommandForTest}, extending\n * the package-author \"invoke\" verb to the `api.hooks.*` surface. Pass the\n * `ExtensionHookRegistry` from `activateExtensionForTest(...).hooks` together with\n * the lifecycle `kind` and a synthetic context. Hooks observe their inputs via a\n * cloned context snapshot (mutations never leak back to the caller), so the\n * observable signal is twofold: any side effects the hook performs, and the\n * returned warnings. A clean run returns `[]`; a hook that throws contributes one\n * `extension_hook_failed:<layer>:<name>:<hookName>` warning, mirroring runtime\n * dispatch which isolates a failing hook without aborting the others.\n *\n * Throws a descriptive error (listing the hook kinds that do have registrations)\n * when no hook of `kind` is registered, since firing a hook the extension never\n * registered is a wiring/typo bug in the test rather than a behavior under test.\n */\nexport async function runRegisteredHookForTest(\n hooks: ExtensionHookRegistry,\n options: RunRegisteredHookForTestOptions,\n): Promise<string[]> {\n if (hooks[HOOK_KIND_TO_REGISTRY_FIELD[options.kind]].length === 0) {\n const populatedKinds = sortedUnique(\n (Object.keys(HOOK_KIND_TO_REGISTRY_FIELD) as RegisteredHookKind[]).filter(\n (kind) => hooks[HOOK_KIND_TO_REGISTRY_FIELD[kind]].length > 0,\n ),\n );\n throw new Error(\n `Expected a registered \"${options.kind}\" hook to invoke. Hook kinds with registrations: ${formatAvailable(\n populatedKinds,\n )}`,\n );\n }\n switch (options.kind) {\n case \"before_command\":\n return runBeforeCommandHooks(hooks, options.context);\n case \"after_command\":\n return runAfterCommandHooks(hooks, options.context);\n case \"on_read\":\n return runOnReadHooks(hooks, options.context);\n case \"on_write\":\n return runOnWriteHooks(hooks, options.context);\n case \"on_index\":\n return runOnIndexHooks(hooks, options.context);\n }\n}\n\n/**\n * Invoke a registered parser override through pm's real runner and return the\n * resolved {@link ParserOverrideResult}, so package tests can assert the rewritten\n * args/options/global an override produces for a command before dispatch.\n *\n * Guards that a parser override is registered for the (normalized) target command\n * before delegating: without a match `runParserOverride` would silently return\n * `overridden: false`, hiding a typo'd command name in the test. When a match\n * exists the result is returned verbatim — `overridden: true` with the rewritten\n * context on success, or `overridden: false` with an\n * `extension_parser_override_failed:*` warning when the override throws.\n */\nexport async function runRegisteredParserOverrideForTest(\n parsers: ExtensionParserRegistry,\n context: ParserOverrideContext,\n): Promise<ParserOverrideResult> {\n const command = normalizeSdkCommandName(context.command);\n if (!parsers.overrides.some((entry) => entry.command === command)) {\n throw new Error(\n `Expected a registered parser override for command \"${command}\" to invoke. Available parser override commands: ${formatAvailable(\n sortedUnique(parsers.overrides.map((entry) => entry.command)),\n )}`,\n );\n }\n return runParserOverride(parsers, context);\n}\n\n/**\n * Invoke the active preflight override through pm's real runner and return the\n * resolved {@link PreflightOverrideResult}, so package tests can assert the\n * migration/format gate decision an override yields.\n *\n * Unlike command-scoped overrides, the runtime applies the **last** registered\n * preflight override regardless of command, so this helper guards only that at\n * least one preflight override is registered before delegating. The result is\n * returned verbatim — `overridden: true` with the adjusted decision on success,\n * or `overridden: false` with an `extension_preflight_override_failed:*` warning\n * when the override throws.\n */\nexport async function runRegisteredPreflightOverrideForTest(\n preflight: ExtensionPreflightRegistry,\n context: PreflightOverrideContext,\n): Promise<PreflightOverrideResult> {\n if (preflight.overrides.length === 0) {\n throw new Error(\n \"Expected a registered preflight override to invoke, but none are registered.\",\n );\n }\n return runPreflightOverride(preflight, context);\n}\n\n/**\n * Invoke a registered command-result override through pm's real runner and return\n * the resolved {@link CommandOverrideResult}, so package tests can assert how an\n * override transforms a command's result payload.\n *\n * Accepts the same `ExtensionCommandRegistry` exposed as\n * `activateExtensionForTest(...).commands` (it carries both handlers and\n * overrides). Guards that an override is registered for the (normalized) target\n * command before delegating, so a typo'd command name surfaces as a clear error\n * rather than a silent `overridden: false`. The result is returned verbatim —\n * including the `extension_command_override_async_unsupported:*` warning the\n * runtime emits when an override returns a Promise (command overrides are\n * synchronous), or an `extension_command_override_failed:*` warning on throw.\n */\nexport async function runRegisteredCommandOverrideForTest(\n commands: ExtensionCommandRegistry,\n context: CommandOverrideContext,\n): Promise<CommandOverrideResult> {\n const command = normalizeSdkCommandName(context.command);\n if (!commands.overrides.some((entry) => entry.command === command)) {\n throw new Error(\n `Expected a registered command override for command \"${command}\" to invoke. Available command override commands: ${formatAvailable(\n sortedUnique(commands.overrides.map((entry) => entry.command)),\n )}`,\n );\n }\n return runCommandOverride(commands, context);\n}\n\n/**\n * Invoke a registered renderer override through pm's real runner and return the\n * resolved {@link RendererOverrideResult}, so package tests can assert the custom\n * string an override renders for a given output `format`.\n *\n * Guards that a renderer override is registered for `context.format` before\n * delegating, so a wrong format surfaces as a clear error rather than a silent\n * `overridden: false`. The result is returned verbatim — `overridden: true` with\n * the rendered string on success, or `overridden: false` (with an\n * `extension_renderer_invalid_result:*` / `extension_renderer_failed:*` warning\n * where applicable) when the override returns a non-string or throws.\n */\nexport async function runRegisteredRendererOverrideForTest(\n renderers: ExtensionRendererRegistry,\n context: RendererOverrideContext,\n): Promise<RendererOverrideResult> {\n if (!renderers.overrides.some((entry) => entry.format === context.format)) {\n throw new Error(\n `Expected a registered renderer override for format \"${context.format}\" to invoke. Available renderer override formats: ${formatAvailable(\n sortedUnique(renderers.overrides.map((entry) => entry.format)),\n )}`,\n );\n }\n return runRendererOverride(renderers, context);\n}\n\n/**\n * Invoke a registered service override through pm's real runner and return the\n * resolved {@link ServiceOverrideResult}, so package tests can assert how an\n * override handles an internal service payload (e.g. `output_format`).\n *\n * Guards that a service override is registered for `context.service` before\n * delegating, so a wrong service name surfaces as a clear error rather than a\n * silent `handled: false`. The result is returned verbatim — `handled: true` with\n * the override's result when it claims the payload, or `handled: false` with the\n * original payload (and any `extension_service_override_*` warnings) otherwise.\n */\nexport async function runRegisteredServiceOverrideForTest(\n services: ExtensionServiceRegistry,\n context: ServiceOverrideContext,\n): Promise<ServiceOverrideResult> {\n if (!services.overrides.some((entry) => entry.service === context.service)) {\n throw new Error(\n `Expected a registered service override for service \"${context.service}\" to invoke. Available service override services: ${formatAvailable(\n sortedUnique(services.overrides.map((entry) => entry.service)),\n )}`,\n );\n }\n return runServiceOverride(services, context);\n}\n\n/**\n * Maps each search-provider operation to the runtime-definition keys that may\n * hold its function, in priority order. The host accepts both camelCase and\n * snake_case spellings for the multi-word operations, so this helper mirrors that\n * by trying `embedBatch` before `embed_batch` and `queryExpansion` before\n * `query_expansion`.\n */\nconst SEARCH_PROVIDER_OPERATION_DEFINITION_KEYS: Record<keyof SearchProviderOperationContexts, readonly string[]> = {\n query: [\"query\"],\n embed: [\"embed\"],\n embedBatch: [\"embedBatch\", \"embed_batch\"],\n queryExpansion: [\"queryExpansion\", \"query_expansion\"],\n rerank: [\"rerank\"],\n};\n\n/**\n * Invoke an operation of a registered search provider through the same name\n * resolution the host uses and return the operation's result, so package tests\n * can assert a custom provider's runtime behavior — not just that it registered.\n *\n * This is the search-provider counterpart to {@link runRegisteredCommandForTest},\n * extending the package-author \"invoke\" verb to the `api.registerSearchProvider`\n * surface. Pass the `ExtensionRegistrationRegistry` from\n * `activateExtensionForTest(...).registrations`, the registered provider name, the\n * `operation` to exercise (`query`, `embed`, `embedBatch`, `queryExpansion`, or\n * `rerank`), and a synthetic context. The provider is resolved via\n * {@link resolveRegisteredSearchProvider} (case-insensitive, last registration\n * wins) and the operation is invoked on its `runtime_definition` — the clone that\n * preserves live functions, matching what the runtime dispatches.\n *\n * Throws a descriptive error listing the available providers when the name is not\n * registered, and a separate error when the resolved provider does not implement\n * the requested operation, since invoking an absent provider/operation is a\n * wiring bug in the test rather than a behavior under test.\n */\nexport async function runRegisteredSearchProviderForTest<Operation extends keyof SearchProviderOperationContexts>(\n registrations: ExtensionRegistrationRegistry,\n options: {\n provider: string;\n operation: Operation;\n context: SearchProviderOperationContexts[Operation];\n },\n): Promise<SearchProviderOperationResults[Operation]> {\n const registration = resolveRegisteredSearchProvider(registrations, options.provider);\n if (!registration) {\n const available = sortedUnique(registrations.search_providers.map((entry) => entry.definition.name));\n throw new Error(\n `Expected a registered search provider \"${options.provider}\" to invoke. Available search providers: ${formatAvailable(\n available,\n )}`,\n );\n }\n const runtimeDefinition = registration.runtime_definition;\n const operationFn = SEARCH_PROVIDER_OPERATION_DEFINITION_KEYS[options.operation]\n .map((key) => runtimeDefinition[key])\n .find((value) => typeof value === \"function\");\n if (typeof operationFn !== \"function\") {\n throw new Error(\n `Registered search provider \"${options.provider}\" does not implement the \"${options.operation}\" operation.`,\n );\n }\n return (await (operationFn as (context: SearchProviderOperationContexts[Operation]) => unknown)(\n options.context,\n )) as SearchProviderOperationResults[Operation];\n}\n\n/**\n * Invoke an operation of a registered vector store adapter through the same name\n * resolution the host uses and return the operation's result, so package tests\n * can assert a custom adapter's runtime behavior — not just that it registered.\n *\n * This is the vector-store counterpart to {@link runRegisteredSearchProviderForTest}.\n * Pass the `ExtensionRegistrationRegistry` from\n * `activateExtensionForTest(...).registrations`, the registered adapter name, the\n * `operation` to exercise (`query`, `upsert`, or `delete`), and a synthetic\n * context. The adapter is resolved via {@link resolveRegisteredVectorStoreAdapter}\n * (case-insensitive, last registration wins) and the operation is invoked on its\n * `runtime_definition` — the clone that preserves live functions, matching what\n * the runtime dispatches.\n *\n * Throws a descriptive error listing the available adapters when the name is not\n * registered, and a separate error when the resolved adapter does not implement\n * the requested operation.\n */\nexport async function runRegisteredVectorStoreAdapterForTest<\n Operation extends keyof VectorStoreAdapterOperationContexts,\n>(\n registrations: ExtensionRegistrationRegistry,\n options: {\n adapter: string;\n operation: Operation;\n context: VectorStoreAdapterOperationContexts[Operation];\n },\n): Promise<VectorStoreAdapterOperationResults[Operation]> {\n const registration = resolveRegisteredVectorStoreAdapter(registrations, options.adapter);\n if (!registration) {\n const available = sortedUnique(registrations.vector_store_adapters.map((entry) => entry.definition.name));\n throw new Error(\n `Expected a registered vector store adapter \"${options.adapter}\" to invoke. Available vector store adapters: ${formatAvailable(\n available,\n )}`,\n );\n }\n const operationFn = registration.runtime_definition[options.operation];\n if (typeof operationFn !== \"function\") {\n throw new Error(\n `Registered vector store adapter \"${options.adapter}\" does not implement the \"${options.operation}\" operation.`,\n );\n }\n return (await (operationFn as (context: VectorStoreAdapterOperationContexts[Operation]) => unknown)(\n options.context,\n )) as VectorStoreAdapterOperationResults[Operation];\n}\n\n/**\n * Invoke a registered schema migration's `run` function through the same runtime\n * definition the host executes and return its result, so package tests can assert\n * a migration's behavior — not just that it registered.\n *\n * This completes the package-author \"invoke\" verb across every executable\n * registration surface. The migration is resolved by id via\n * {@link assertRegisteredMigration} (which throws a descriptive \"available\n * migrations\" error when absent), then `run` is invoked on its\n * `runtime_definition` with a context mirroring the one\n * `executeRegisteredRuntimeMigrations` builds at runtime: the resolved id,\n * `command: \"migration\"`, the registering extension's layer/name, the supplied\n * `pmRoot`, and the migration's normalized status. Unlike the runtime — which\n * skips already-applied migrations and folds a throw into a warning — this helper\n * always invokes `run` and lets a throw propagate, so authors can assert both the\n * success result and failure via rejection.\n *\n * Throws when the resolved migration declares no `run` function, since invoking a\n * runless migration is a wiring bug in the test rather than a behavior under test.\n */\nexport async function runRegisteredMigrationForTest(\n registrations: ExtensionRegistrationRegistry,\n options: RunRegisteredMigrationForTestOptions,\n): Promise<unknown> {\n const migration = assertRegisteredMigration(registrations, {\n migration: options.migration,\n extensionName: options.extensionName,\n });\n const run = getMigrationRuntimeDefinition(migration).run;\n if (typeof run !== \"function\") {\n throw new Error(`Registered migration \"${options.migration}\" does not implement a run function to invoke.`);\n }\n const declaredStatus = migration.definition.status;\n const context: SchemaMigrationRunContext = {\n id: migration.definition.id as string,\n command: \"migration\",\n layer: migration.layer,\n extension: migration.name,\n pm_root: options.pmRoot ?? \"\",\n status: (typeof declaredStatus === \"string\" ? declaredStatus.trim().toLowerCase() : \"\") || \"pending\",\n };\n return await (run as (context: SchemaMigrationRunContext) => unknown)(context);\n}\n\n/**\n * Invoke a registered extension importer through pm's real handler-dispatch\n * engine and return its {@link CommandHandlerResult}, so package tests can assert\n * an importer's behavior — not just that it registered.\n *\n * This is the importer counterpart to {@link runRegisteredCommandForTest},\n * extending the package-author \"invoke\" verb to the `api.registerImporter`\n * surface. Because `registerImporter(name, fn)` wraps `fn` into a command handler\n * at the `\"<name> import\"` path, invoking it through `runRegisteredCommandForTest`\n * requires the author to know that naming convention and to remember that an\n * importer is reachable as a command at all. This helper closes both gaps: it\n * accepts the registered importer name directly, validates via\n * {@link assertRegisteredImporter} that it is genuinely a registered importer\n * (not merely some command parked at that path), derives the command path, and\n * dispatches through the same engine.\n *\n * The full activation result is required because importer execution spans two\n * sub-registries: `registrations.importers` proves the importer exists, while\n * `commands` holds the wrapped handler. The result is returned verbatim from the\n * command engine: a clean run yields `{ handled: true, result, warnings: [] }`\n * (where `result` is the importer's return value), a non-exit throw yields\n * `{ handled: false, warnings: [code], errorMessage }`, and an error carrying a\n * numeric `exitCode` propagates — matching runtime import semantics.\n *\n * Throws a descriptive \"available importers\" error (via `assertRegisteredImporter`)\n * when no importer matches, since that is a wiring/typo bug in the test rather\n * than a behavior under test.\n */\nexport async function runRegisteredImporterForTest(\n activation: ExtensionActivationResult,\n options: RunRegisteredImporterForTestOptions,\n): Promise<CommandHandlerResult> {\n const importer = assertRegisteredImporter(activation.registrations, {\n importer: options.importer,\n extensionName: options.extensionName,\n });\n return runRegisteredCommandForTest(activation.commands, {\n command: `${importer.importer} import`,\n args: options.args,\n options: options.options,\n global: options.global,\n pmRoot: options.pmRoot,\n });\n}\n\n/**\n * Invoke a registered extension exporter through pm's real handler-dispatch\n * engine and return its {@link CommandHandlerResult}, so package tests can assert\n * an exporter's behavior — not just that it registered.\n *\n * This is the exporter counterpart to {@link runRegisteredImporterForTest} and\n * the final surface in the package-author \"invoke\" verb. Because\n * `registerExporter(name, fn)` wraps `fn` into a command handler at the\n * `\"<name> export\"` path, this helper accepts the registered exporter name\n * directly, validates via {@link assertRegisteredExporter} that it is genuinely a\n * registered exporter, derives the command path, and dispatches through the same\n * engine. See {@link runRegisteredImporterForTest} for the full activation\n * rationale and return semantics (which apply identically here).\n *\n * Throws a descriptive \"available exporters\" error (via `assertRegisteredExporter`)\n * when no exporter matches, since that is a wiring/typo bug in the test rather\n * than a behavior under test.\n */\nexport async function runRegisteredExporterForTest(\n activation: ExtensionActivationResult,\n options: RunRegisteredExporterForTestOptions,\n): Promise<CommandHandlerResult> {\n const exporter = assertRegisteredExporter(activation.registrations, {\n exporter: options.exporter,\n extensionName: options.extensionName,\n });\n return runRegisteredCommandForTest(activation.commands, {\n command: `${exporter.exporter} export`,\n args: options.args,\n options: options.options,\n global: options.global,\n pmRoot: options.pmRoot,\n });\n}\n\n/**\n * Assert that an {@link ExtensionDeactivationResult} reports the expected clean\n * teardown counts, throwing a descriptive error otherwise. Defaults assert the\n * single-extension happy path — exactly one extension deactivated and none\n * failed. Returns the result so assertions can chain.\n */\nexport function assertExtensionDeactivated(\n result: ExtensionDeactivationResult,\n expectation: ExtensionDeactivationExpectation = {},\n): ExtensionDeactivationResult {\n const expectedDeactivated = expectation.deactivated ?? 1;\n if (result.deactivated !== expectedDeactivated) {\n throw new Error(\n `Expected ${expectedDeactivated} extension${expectedDeactivated === 1 ? \"\" : \"s\"} to deactivate cleanly, ` +\n `but ${result.deactivated} did.`,\n );\n }\n const expectedFailed = expectation.failed ?? 0;\n if (result.failed.length !== expectedFailed) {\n const detail = result.failed.map((failure) => `${failure.layer}:${failure.name} (${failure.error})`).join(\", \");\n throw new Error(\n `Expected ${expectedFailed} teardown failure${expectedFailed === 1 ? \"\" : \"s\"}, ` +\n `but observed ${result.failed.length}${detail.length > 0 ? `: ${detail}` : \"\"}.`,\n );\n }\n return result;\n}\n\n/**\n * Assert that a normalized package manifest advertises expected package\n * resources. Pair with `readPmPackageManifest(packageRoot)` in package tests.\n */\nexport function assertPackageManifest(\n manifest: PmPackageManifest,\n expectation: PackageManifestExpectation,\n): PmPackageManifest {\n if (expectation.packageName !== undefined && manifest.package_name !== expectation.packageName) {\n throw new Error(\n `Expected package manifest package_name to be \"${expectation.packageName}\"; received \"${\n manifest.package_name ?? \"(none)\"\n }\"`,\n );\n }\n if (expectation.aliases !== undefined) {\n assertStringSetIncludes(manifest.aliases, expectation.aliases, \"aliases\");\n }\n if (expectation.resources !== undefined) {\n for (const [kind, expectedPaths] of Object.entries(expectation.resources) as Array<\n [PmPackageResourceKind, readonly string[]]\n >) {\n assertStringSetIncludes(manifest.resources[kind], expectedPaths, `pm.${kind}`);\n }\n }\n return manifest;\n}\n\n/**\n * Assert that an activated extension registration registry contains a command\n * contract with the expected public metadata.\n */\nexport function assertRegisteredCommandContract(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredCommandContractExpectation,\n): RegisteredCommandContractAssertion {\n const expectedCommand = normalizeSdkCommandName(expectation.command);\n if (expectedCommand.length === 0) {\n throw new Error(\"Expected command name must be a non-empty string\");\n }\n\n const commandCandidates = registrations.commands.filter((entry) => entry.command === expectedCommand);\n const command = expectation.extensionName\n ? commandCandidates.find((entry) => entry.name === expectation.extensionName)\n : commandCandidates[0];\n if (!command) {\n const available = registrations.commands.map((entry) => entry.command).sort((left, right) => left.localeCompare(right));\n const extensionSuffix = expectation.extensionName ? ` from extension \"${expectation.extensionName}\"` : \"\";\n throw new Error(\n `Expected extension command \"${expectedCommand}\"${extensionSuffix} to be registered. Available commands: ${formatAvailable(\n available,\n )}`,\n );\n }\n\n if (expectation.action !== undefined && command.action !== expectation.action) {\n throw new Error(\n `Expected extension command \"${expectedCommand}\" action \"${expectation.action}\", received \"${command.action}\"`,\n );\n }\n\n if (expectation.arguments !== undefined) {\n const actualArguments = (command.arguments ?? []).map((argument) => argument.name);\n const missingArguments = expectation.arguments.filter((argument) => !actualArguments.includes(argument));\n if (missingArguments.length > 0) {\n throw new Error(\n `Expected extension command \"${expectedCommand}\" arguments ${formatAvailable(\n expectation.arguments,\n )}; missing ${formatAvailable(missingArguments)}; available ${formatAvailable(actualArguments)}`,\n );\n }\n }\n\n const flags = registrations.flags\n .filter(\n (entry) =>\n entry.target_command === expectedCommand &&\n (expectation.extensionName === undefined || entry.name === expectation.extensionName),\n )\n .flatMap((entry) => entry.flags);\n\n if (expectation.flags !== undefined) {\n const actualFlagLabels = collectFlagLabels(flags);\n const missingFlags = expectation.flags.filter((flag) => !actualFlagLabels.has(flag));\n if (missingFlags.length > 0) {\n throw new Error(\n `Expected extension command \"${expectedCommand}\" flags ${formatAvailable(expectation.flags)}; missing ${formatAvailable(\n missingFlags,\n )}; available ${formatAvailable([...actualFlagLabels].sort((left, right) => left.localeCompare(right)))}`,\n );\n }\n }\n\n return { command, flags };\n}\n\n/**\n * Assert that an activated extension registration registry contains flags\n * injected into an existing command through `api.registerFlags(...)`.\n */\nexport function assertRegisteredFlags(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredFlagsExpectation,\n): RegisteredExtensionFlagDefinitions {\n const expectedCommand = normalizeSdkCommandName(expectation.targetCommand);\n if (expectedCommand.length === 0) {\n throw new Error(\"Expected target command name must be a non-empty string\");\n }\n\n const candidates = registrations.flags.filter((entry) => entry.target_command === expectedCommand);\n let registration: RegisteredExtensionFlagDefinitions | undefined;\n if (expectation.extensionName) {\n registration = candidates.find((entry) => entry.name === expectation.extensionName);\n } else if (candidates.length === 1) {\n registration = candidates[0];\n } else if (candidates.length > 1) {\n const availableExtensions = sortedUnique(candidates.map((entry) => entry.name));\n throw new Error(\n `Expected flags for target command \"${expectedCommand}\" matched multiple extensions: ${formatAvailable(\n availableExtensions,\n )}. Specify extensionName to choose one registration.`,\n );\n }\n if (!registration) {\n const available = sortedUnique(registrations.flags.map((entry) => entry.target_command));\n const availableExtensions = sortedUnique(candidates.map((entry) => entry.name));\n throw new Error(\n `Expected flags for target command \"${expectedCommand}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available flag target commands: ${formatAvailable(available)}; matching extensions: ${formatAvailable(\n availableExtensions,\n )}`,\n );\n }\n\n if (expectation.flags !== undefined) {\n const actualFlagLabels = collectFlagLabels(registration.flags);\n const missingFlags = expectation.flags.filter((flag) => !actualFlagLabels.has(flag));\n if (missingFlags.length > 0) {\n throw new Error(\n `Expected flags for target command \"${expectedCommand}\" to include ${formatAvailable(\n expectation.flags,\n )}; missing ${formatAvailable(missingFlags)}; available ${formatAvailable(\n [...actualFlagLabels].sort((left, right) => left.localeCompare(right)),\n )}`,\n );\n }\n }\n\n return registration;\n}\n\n/**\n * Assert that an activated extension hook registry contains a hook of the\n * expected lifecycle kind (optionally scoped to a specific extension).\n *\n * Hooks are surfaced via `ExtensionActivationResult.hooks`, not the command\n * registration registry, so this helper accepts an `ExtensionHookRegistry`.\n */\nexport function assertRegisteredHook<TKind extends RegisteredHookKind>(\n hooks: ExtensionHookRegistry,\n expectation: RegisteredHookExpectation & { kind: TKind },\n): ExtensionHookRegistry[(typeof HOOK_KIND_TO_REGISTRY_FIELD)[TKind]][number] {\n const field = HOOK_KIND_TO_REGISTRY_FIELD[expectation.kind];\n const candidates = hooks[field] as ReadonlyArray<RegisteredExtensionHook<unknown>>;\n const hook = expectation.extensionName\n ? candidates.find((entry) => entry.name === expectation.extensionName)\n : candidates[0];\n if (!hook) {\n const available = sortedUnique(candidates.map((entry) => entry.name));\n throw new Error(\n `Expected a \"${expectation.kind}\" hook${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available \"${expectation.kind}\" hooks: ${formatAvailable(available)}`,\n );\n }\n\n return hook as ExtensionHookRegistry[(typeof HOOK_KIND_TO_REGISTRY_FIELD)[TKind]][number];\n}\n\n/**\n * Assert that an activated extension registration registry contains a search\n * provider with the expected name (optionally scoped to a specific extension).\n */\nexport function assertRegisteredSearchProvider(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredSearchProviderExpectation,\n): RegisteredExtensionSearchProvider {\n const expectedProvider = normalizeSdkIdentifier(expectation.provider);\n if (expectedProvider.length === 0) {\n throw new Error(\"Expected search provider name must be a non-empty string\");\n }\n\n const candidates = registrations.search_providers.filter(\n (entry) => normalizeSdkIdentifier(entry.definition.name) === expectedProvider,\n );\n const provider = expectation.extensionName\n ? candidates.find((entry) => entry.name === expectation.extensionName)\n : candidates[0];\n if (!provider) {\n const available = sortedUnique(registrations.search_providers.map((entry) => entry.definition.name));\n throw new Error(\n `Expected search provider \"${expectedProvider}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available search providers: ${formatAvailable(available)}`,\n );\n }\n\n return provider;\n}\n\n/**\n * Assert that an activated extension registration registry contains a vector\n * store adapter with the expected name (optionally scoped to a specific\n * extension).\n */\nexport function assertRegisteredVectorStoreAdapter(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredVectorStoreAdapterExpectation,\n): RegisteredExtensionVectorStoreAdapter {\n const expectedAdapter = normalizeSdkIdentifier(expectation.adapter);\n if (expectedAdapter.length === 0) {\n throw new Error(\"Expected vector store adapter name must be a non-empty string\");\n }\n\n const candidates = registrations.vector_store_adapters.filter(\n (entry) => normalizeSdkIdentifier(entry.definition.name) === expectedAdapter,\n );\n const adapter = expectation.extensionName\n ? candidates.find((entry) => entry.name === expectation.extensionName)\n : candidates[0];\n if (!adapter) {\n const available = sortedUnique(registrations.vector_store_adapters.map((entry) => entry.definition.name));\n throw new Error(\n `Expected vector store adapter \"${expectedAdapter}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available vector store adapters: ${formatAvailable(available)}`,\n );\n }\n\n return adapter;\n}\n\n/**\n * Assert that an activated extension registration registry contains an importer\n * for the expected format/name (optionally scoped to a specific extension).\n */\nexport function assertRegisteredImporter(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredImporterExpectation,\n): RegisteredExtensionImporter {\n const expectedImporter = normalizeSdkIdentifier(expectation.importer);\n if (expectedImporter.length === 0) {\n throw new Error(\"Expected importer name must be a non-empty string\");\n }\n\n const candidates = registrations.importers.filter(\n (entry) => normalizeSdkIdentifier(entry.importer) === expectedImporter,\n );\n const importer = expectation.extensionName\n ? candidates.find((entry) => entry.name === expectation.extensionName)\n : candidates[0];\n if (!importer) {\n const available = sortedUnique(registrations.importers.map((entry) => entry.importer));\n throw new Error(\n `Expected importer \"${expectedImporter}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available importers: ${formatAvailable(available)}`,\n );\n }\n\n return importer;\n}\n\n/**\n * Assert that an activated extension registration registry contains an exporter\n * for the expected format/name (optionally scoped to a specific extension).\n */\nexport function assertRegisteredExporter(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredExporterExpectation,\n): RegisteredExtensionExporter {\n const expectedExporter = normalizeSdkIdentifier(expectation.exporter);\n if (expectedExporter.length === 0) {\n throw new Error(\"Expected exporter name must be a non-empty string\");\n }\n\n const candidates = registrations.exporters.filter(\n (entry) => normalizeSdkIdentifier(entry.exporter) === expectedExporter,\n );\n const exporter = expectation.extensionName\n ? candidates.find((entry) => entry.name === expectation.extensionName)\n : candidates[0];\n if (!exporter) {\n const available = sortedUnique(registrations.exporters.map((entry) => entry.exporter));\n throw new Error(\n `Expected exporter \"${expectedExporter}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available exporters: ${formatAvailable(available)}`,\n );\n }\n\n return exporter;\n}\n\n/**\n * Assert that an activated extension registration registry contains a custom\n * item field definition (optionally scoped to a specific extension).\n */\nexport function assertRegisteredItemField(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredItemFieldExpectation,\n): RegisteredItemFieldAssertion {\n const expectedField = normalizeSdkIdentifier(expectation.field);\n if (expectedField.length === 0) {\n throw new Error(\"Expected item field name must be a non-empty string\");\n }\n\n const candidates = registrations.item_fields\n .filter((entry) => expectation.extensionName === undefined || entry.name === expectation.extensionName)\n .map((registration) => ({\n registration,\n field: registration.fields.find((field) => normalizeSdkIdentifier(field.name) === expectedField),\n }))\n .filter((entry): entry is RegisteredItemFieldAssertion => entry.field !== undefined);\n\n const match = candidates.find((entry) => expectation.type === undefined || entry.field.type === expectation.type);\n if (!match) {\n const available = sortedUnique(\n registrations.item_fields.flatMap((entry) => entry.fields.map((field) => `${field.name}:${field.type}`)),\n );\n throw new Error(\n `Expected item field \"${expectedField}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available item fields: ${formatAvailable(available)}`,\n );\n }\n\n return match;\n}\n\n/**\n * Assert that an activated extension registration registry contains a custom\n * item type definition (optionally scoped to a specific extension).\n */\nexport function assertRegisteredItemType(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredItemTypeExpectation,\n): RegisteredItemTypeAssertion {\n const expectedType = normalizeSdkIdentifier(expectation.itemType);\n if (expectedType.length === 0) {\n throw new Error(\"Expected item type name must be a non-empty string\");\n }\n\n const candidates = registrations.item_types\n .filter((entry) => expectation.extensionName === undefined || entry.name === expectation.extensionName)\n .map((registration) => ({\n registration,\n itemType: registration.types.find((itemType) => normalizeSdkIdentifier(itemType.name) === expectedType),\n }))\n .filter((entry): entry is RegisteredItemTypeAssertion => entry.itemType !== undefined);\n\n const match = candidates.find((entry) => expectation.folder === undefined || entry.itemType.folder === expectation.folder);\n if (!match) {\n const available = sortedUnique(\n registrations.item_types.flatMap((entry) => entry.types.map((itemType) => `${itemType.name}:${itemType.folder}`)),\n );\n throw new Error(\n `Expected item type \"${expectedType}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available item types: ${formatAvailable(available)}`,\n );\n }\n\n return match;\n}\n\n/**\n * Assert that an activated extension registration registry contains a project\n * profile registered via `api.registerProfile(profile)` (optionally scoped to a\n * specific extension).\n *\n * This is the test-time counterpart to the declarative `defineProjectProfile`\n * authoring helper and the `pm profile list/show/apply` runtime surface: it\n * proves a package's archetype reached the registry so a downstream consumer can\n * resolve and apply it by name. Like the other declarative-surface assertions\n * (item types, item fields), a profile is verified by presence — it is staged,\n * not executed — so there is no `runRegisteredProfileForTest` counterpart.\n */\nexport function assertRegisteredProfile(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredProfileExpectation,\n): RegisteredProfileAssertion {\n const expectedProfile = normalizeSdkProfileMatchKey(expectation.profile);\n if (expectedProfile.length === 0) {\n throw new Error(\"Expected profile name must be a non-empty string\");\n }\n\n const match = registrations.profiles\n .filter((entry) => expectation.extensionName === undefined || entry.name === expectation.extensionName)\n .find((entry) => normalizeSdkProfileMatchKey(entry.profile.name) === expectedProfile);\n if (!match) {\n const available = sortedUnique(registrations.profiles.map((entry) => entry.profile.name));\n throw new Error(\n `Expected profile \"${expectedProfile}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available profiles: ${formatAvailable(available)}`,\n );\n }\n\n return { registration: match, profile: match.profile };\n}\n\n/**\n * Assert that an activated extension command registry contains a command\n * override registered via `api.registerCommand(command, override)` (optionally\n * scoped to a specific extension).\n *\n * Command overrides are surfaced via `ExtensionActivationResult.commands`, not\n * the command registration registry, so this helper accepts an\n * `ExtensionCommandRegistry`.\n */\nexport function assertRegisteredCommandOverride(\n commands: ExtensionCommandRegistry,\n expectation: RegisteredCommandOverrideExpectation,\n): RegisteredExtensionCommandOverride {\n const expectedCommand = normalizeSdkCommandName(expectation.command);\n if (expectedCommand.length === 0) {\n throw new Error(\"Expected command name must be a non-empty string\");\n }\n\n const candidates = commands.overrides.filter((entry) => entry.command === expectedCommand);\n const override = expectation.extensionName\n ? candidates.find((entry) => entry.name === expectation.extensionName)\n : candidates[0];\n if (!override) {\n const available = sortedUnique(commands.overrides.map((entry) => entry.command));\n throw new Error(\n `Expected command override \"${expectedCommand}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available command overrides: ${formatAvailable(available)}`,\n );\n }\n\n return override;\n}\n\n/**\n * Assert that an activated extension parser registry contains a parser override\n * registered via `api.registerParser(command, override)` (optionally scoped to\n * a specific extension).\n *\n * Parser overrides are surfaced via `ExtensionActivationResult.parsers`, not the\n * command registration registry, so this helper accepts an\n * `ExtensionParserRegistry`.\n */\nexport function assertRegisteredParserOverride(\n parsers: ExtensionParserRegistry,\n expectation: RegisteredParserOverrideExpectation,\n): RegisteredExtensionParserOverride {\n const expectedCommand = normalizeSdkCommandName(expectation.command);\n if (expectedCommand.length === 0) {\n throw new Error(\"Expected command name must be a non-empty string\");\n }\n\n const candidates = parsers.overrides.filter((entry) => entry.command === expectedCommand);\n const override = expectation.extensionName\n ? candidates.find((entry) => entry.name === expectation.extensionName)\n : candidates[0];\n if (!override) {\n const available = sortedUnique(parsers.overrides.map((entry) => entry.command));\n throw new Error(\n `Expected parser override \"${expectedCommand}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available parser overrides: ${formatAvailable(available)}`,\n );\n }\n\n return override;\n}\n\n/**\n * Assert that an activated extension preflight registry contains a preflight\n * override registered via `api.registerPreflight(override)` (optionally scoped\n * to a specific extension).\n *\n * Preflight overrides are global (they run for every command and carry no\n * `command` field), so the expectation only accepts an optional\n * `extensionName`. Preflight overrides are surfaced via\n * `ExtensionActivationResult.preflight`.\n */\nexport function assertRegisteredPreflightOverride(\n preflight: ExtensionPreflightRegistry,\n expectation: RegisteredPreflightOverrideExpectation = {},\n): RegisteredExtensionPreflightOverride {\n const override = expectation.extensionName\n ? preflight.overrides.find((entry) => entry.name === expectation.extensionName)\n : preflight.overrides[0];\n if (!override) {\n const available = sortedUnique(preflight.overrides.map((entry) => entry.name));\n throw new Error(\n `Expected a preflight override${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available preflight overrides: ${formatAvailable(available)}`,\n );\n }\n\n return override;\n}\n\n/**\n * Assert that an activated extension renderer registry contains a renderer\n * override registered via `api.registerRenderer(format, renderer)` for the\n * expected output format (optionally scoped to a specific extension).\n *\n * Renderer overrides are surfaced via `ExtensionActivationResult.renderers`.\n */\nexport function assertRegisteredRendererOverride(\n renderers: ExtensionRendererRegistry,\n expectation: RegisteredRendererOverrideExpectation,\n): RegisteredExtensionRendererOverride {\n const expectedFormat = normalizeSdkIdentifier(expectation.format);\n if (expectedFormat.length === 0) {\n throw new Error(\"Expected renderer format must be a non-empty string\");\n }\n\n const candidates = renderers.overrides.filter((entry) => entry.format === expectedFormat);\n const override = expectation.extensionName\n ? candidates.find((entry) => entry.name === expectation.extensionName)\n : candidates[0];\n if (!override) {\n const available = sortedUnique(renderers.overrides.map((entry) => entry.format));\n throw new Error(\n `Expected renderer override \"${expectedFormat}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available renderer overrides: ${formatAvailable(available)}`,\n );\n }\n\n return override;\n}\n\n/**\n * Assert that an activated extension service registry contains a service override\n * registered via `api.registerService(service, override)` for the expected\n * service name (optionally scoped to a specific extension).\n *\n * Service overrides are surfaced via `ExtensionActivationResult.services`, not the\n * command registration registry, so this helper accepts an\n * `ExtensionServiceRegistry`.\n */\nexport function assertRegisteredServiceOverride(\n services: ExtensionServiceRegistry,\n expectation: RegisteredServiceOverrideExpectation,\n): RegisteredExtensionServiceOverride {\n const expectedService = normalizeSdkIdentifier(expectation.service);\n if (expectedService.length === 0) {\n throw new Error(\"Expected service name must be a non-empty string\");\n }\n\n const candidates = services.overrides.filter((entry) => normalizeSdkIdentifier(entry.service) === expectedService);\n const override = expectation.extensionName\n ? candidates.find((entry) => entry.name === expectation.extensionName)\n : candidates[0];\n if (!override) {\n const available = sortedUnique(services.overrides.map((entry) => entry.service));\n throw new Error(\n `Expected service override \"${expectedService}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available service overrides: ${formatAvailable(available)}`,\n );\n }\n\n return override;\n}\n\n/**\n * Assert that an activated extension registration registry contains a schema\n * migration registered via `api.registerMigration(definition)` with the expected\n * id (optionally scoped to a specific extension and asserting the `mandatory`\n * governance flag, where an unset flag is treated as non-mandatory).\n *\n * Migrations are surfaced via `ExtensionActivationResult.registrations.migrations`.\n */\nexport function assertRegisteredMigration(\n registrations: ExtensionRegistrationRegistry,\n expectation: RegisteredMigrationExpectation,\n): RegisteredExtensionSchemaMigrationDefinition {\n const expectedMigration = normalizeSdkIdentifier(expectation.migration);\n if (expectedMigration.length === 0) {\n throw new Error(\"Expected migration id must be a non-empty string\");\n }\n\n const candidates = registrations.migrations.filter(\n (entry) =>\n (expectation.extensionName === undefined || entry.name === expectation.extensionName) &&\n typeof entry.definition.id === \"string\" &&\n normalizeSdkIdentifier(entry.definition.id) === expectedMigration,\n );\n const match = candidates.find(\n (entry) => expectation.mandatory === undefined || (entry.definition.mandatory ?? false) === expectation.mandatory,\n );\n if (match) {\n return match;\n }\n\n // The id (and any extension scope) matched but the `mandatory` flag did not:\n // report the mismatch directly rather than the misleading \"not registered\"\n // listing. Reaching here with a candidate implies `expectation.mandatory` was\n // set, since an unset flag matches any candidate above.\n const idMatch = candidates[0];\n if (idMatch !== undefined) {\n throw new Error(\n `Expected migration \"${expectedMigration}\"${extensionNameSuffix(expectation.extensionName)} to have ` +\n `mandatory=${expectation.mandatory}, but it is mandatory=${idMatch.definition.mandatory ?? false}.`,\n );\n }\n\n const available = sortedUnique(\n registrations.migrations.map((entry) => {\n const id =\n typeof entry.definition.id === \"string\" && entry.definition.id.trim().length > 0\n ? entry.definition.id.trim()\n : \"(unnamed)\";\n return `${id}:${entry.definition.mandatory === true}`;\n }),\n );\n throw new Error(\n `Expected migration \"${expectedMigration}\"${extensionNameSuffix(\n expectation.extensionName,\n )} to be registered. Available migrations: ${formatAvailable(available)}`,\n );\n}\n\n/**\n * Assert that an activated extension declares no capability it never uses\n * (least privilege). Pass the same capabilities as `manifest.capabilities` via\n * `expectation.declared`; the helper computes what the extension actually\n * registered against and throws when any declared capability is unused.\n *\n * This is the package-test counterpart of the advisory\n * `extension_capability_unused` warning `pm package doctor` emits, letting an\n * author catch an over-broad manifest at `npm test` time. Returns the\n * declared/used/unused breakdown for further assertions.\n */\nexport function assertExtensionCapabilityUsage(\n activation: ExtensionActivationResult,\n expectation: ExtensionCapabilityUsageExpectation,\n): ExtensionCapabilityUsageAssertion {\n const toKnownCapabilitySet = (capabilities: readonly string[], field: string): Set<ExtensionCapability> => {\n const known = new Set<ExtensionCapability>();\n for (const capability of capabilities) {\n const normalized = normalizeKnownExtensionCapability(capability);\n if (normalized === null) {\n throw new Error(\n `Expected ${field} capability \"${capability}\" to be a known extension capability. ` +\n \"Use canonical capability names (see manifest.capabilities).\",\n );\n }\n known.add(normalized);\n }\n return known;\n };\n const declared = [...toKnownCapabilitySet(expectation.declared, \"declared\")].sort((left, right) =>\n left.localeCompare(right),\n );\n const allowUnused = toKnownCapabilitySet(expectation.allowUnused ?? [], \"allowUnused\");\n const used = collectUsedExtensionCapabilities(activation, { extensionName: expectation.extensionName });\n const usedSet = new Set(used);\n const unused = declared.filter((capability) => !usedSet.has(capability) && !allowUnused.has(capability));\n if (unused.length > 0) {\n const scopeSuffix = extensionNameSuffix(expectation.extensionName);\n throw new Error(\n `Expected every declared capability${scopeSuffix} to be exercised, but [${unused.join(\n \", \",\n )}] ${unused.length === 1 ? \"is\" : \"are\"} declared yet never registered against. ` +\n `Remove ${unused.length === 1 ? \"it\" : \"them\"} from manifest.capabilities for least privilege, ` +\n \"or pass allowUnused for capabilities registered only behind a runtime flag.\",\n );\n }\n return { declared, used, unused };\n}\n\n/**\n * Preflight a declarative {@link ExtensionBlueprint} in a test, throwing if it has\n * any `error`-severity issue (today: capability the blueprint exercises but the\n * declared set omits, which would fail activation with `extension_capability_missing`).\n *\n * The throwing counterpart to {@link lintExtensionBlueprint} and the `assert*`\n * family member for declarative authoring: drop `assertExtensionBlueprint(blueprint)`\n * into a package's `node:test`/Vitest suite to fail CI before the blueprint is\n * ever activated. The full {@link ExtensionBlueprintLintResult} is returned on\n * success so a test can still inspect advisory warnings (unused capability,\n * duplicate command, empty surface) without failing on them.\n */\nexport function assertExtensionBlueprint(\n blueprint: ExtensionBlueprint,\n options: LintExtensionBlueprintOptions = {},\n): ExtensionBlueprintLintResult {\n const result = lintExtensionBlueprint(blueprint, options);\n if (!result.ok) {\n const errors = result.findings.filter((finding) => finding.severity === \"error\");\n throw new Error(\n `Extension blueprint failed preflight with ${errors.length} ${errors.length === 1 ? \"error\" : \"errors\"}:\\n` +\n errors.map((finding) => ` - [${finding.code}] ${finding.message}`).join(\"\\n\"),\n );\n }\n return result;\n}\n\n/** Options for {@link assertProjectProfile}. */\nexport interface AssertProjectProfileOptions {\n /**\n * Also throw when the profile produces `warning`-severity findings (e.g. a\n * workflow transition referencing a status no profile or built-in defines).\n * Off by default so warnings stay advisory; turn on for strict CI gates.\n */\n strict?: boolean;\n}\n\n/**\n * Assert a {@link ProjectProfileDefinition} is internally consistent in a test,\n * throwing on any `error`-severity finding (and on `warning`-severity findings\n * too when `strict` is set). The author-time counterpart to `defineProjectProfile`\n * and the project-profile analogue of {@link assertExtensionBlueprint}: drop\n * `assertProjectProfile(myProfile)` into a package's `node:test`/Vitest suite to\n * fail CI before the profile is ever registered via `api.registerProfile` or\n * applied via `pm profile apply`. The full {@link ProjectProfileLintReport} is\n * returned on success so a test can still inspect advisory warnings without\n * failing on them.\n */\nexport function assertProjectProfile(\n profile: ProjectProfileDefinition,\n options: AssertProjectProfileOptions = {},\n): ProjectProfileLintReport {\n const report = lintProjectProfile(profile);\n const blocking = report.findings.filter(\n (finding) => finding.severity === \"error\" || (options.strict === true && finding.severity === \"warning\"),\n );\n if (blocking.length > 0) {\n throw new Error(\n `Project profile \"${report.profile}\" failed lint with ${blocking.length} ${blocking.length === 1 ? \"issue\" : \"issues\"}:\\n` +\n blocking.map((finding) => ` - ${finding.severity} [${finding.code}] ${finding.message}`).join(\"\\n\"),\n );\n }\n return report;\n}\n\n/**\n * The structured result of {@link assertExtensionManifestMatchesBlueprint}: the\n * reconciliation between a manifest's declared capabilities and the set the\n * blueprint actually exercises. Returned only when they match exactly (the\n * assertion throws otherwise).\n */\nexport interface ExtensionManifestBlueprintMatch {\n /** The least-privilege capability set the blueprint exercises (from `deriveExtensionCapabilities`). */\n used: ExtensionCapability[];\n /** The manifest's declared capabilities, legacy-alias resolved and normalized. */\n declared: ExtensionCapability[];\n /** Capabilities the blueprint uses but the manifest omits — would crash activation. Empty on success. */\n missing: ExtensionCapability[];\n /** Capabilities the manifest declares but no surface exercises — violates least privilege. Empty on success. */\n unused: ExtensionCapability[];\n /** Every lint finding for the blueprint, so callers can inspect advisory warnings. */\n findings: ExtensionBlueprintLintFinding[];\n}\n\n/**\n * Strictly assert a manifest's `capabilities` equal the least-privilege set a\n * declarative {@link ExtensionBlueprint} exercises, throwing on any drift in\n * either direction.\n *\n * This is the strict bookend to the lenient {@link assertExtensionBlueprint}:\n * where that helper fails only on an *undeclared* capability (the `error`-severity\n * `extension_capability_missing` activation crash) and merely *warns* on an unused\n * one, this assertion fails on **both** — an undeclared capability (`missing`) and\n * a declared-but-unused one (`unused`) — so a hand-maintained `manifest.json` stays\n * exactly the set the blueprint requires. Drop it into a package's\n * `node:test`/Vitest suite to guard against capability drift in CI, the natural\n * companion to {@link ../sdk/compose.js#synthesizeExtensionManifest} (assert what\n * you would otherwise generate). Only `capabilities` are reconciled because that is\n * the one manifest field a blueprint determines.\n *\n * The reconciliation is returned on success so a test can still inspect advisory\n * warnings (duplicate command, empty surface) without failing on them.\n */\nexport function assertExtensionManifestMatchesBlueprint(\n manifest: Pick<ExtensionManifest, \"capabilities\">,\n blueprint: ExtensionBlueprint,\n): ExtensionManifestBlueprintMatch {\n // Coerce a malformed/absent capabilities field to an explicit empty declared set\n // so an untyped `.js` caller gets a deterministic `missing` list rather than the\n // lint silently falling back to the blueprint's in-module manifest mirror.\n const declaredCapabilities = Array.isArray(manifest.capabilities) ? manifest.capabilities : [];\n const result = lintExtensionBlueprint(blueprint, { declaredCapabilities });\n // `declared` is guaranteed non-null here: we always hand lint an array, so it\n // never takes its \"no declared set\" branch. The cast drops the unreachable null.\n const declared = result.declared as ExtensionCapability[];\n const declaredSet = new Set(declared);\n const usedSet = new Set(result.used);\n const missing = result.used.filter((capability) => !declaredSet.has(capability));\n const unused = declared.filter((capability) => !usedSet.has(capability));\n if (missing.length > 0 || unused.length > 0) {\n const parts: string[] = [];\n if (missing.length > 0) {\n parts.push(`missing [${missing.join(\", \")}] (the blueprint registers ${missing.length === 1 ? \"a surface\" : \"surfaces\"} requiring ${missing.length === 1 ? \"it\" : \"them\"}; activation throws extension_capability_missing)`);\n }\n if (unused.length > 0) {\n parts.push(`unused [${unused.join(\", \")}] (declared but no surface exercises ${unused.length === 1 ? \"it\" : \"them\"}; drop for least privilege)`);\n }\n throw new Error(\n `Manifest capabilities do not match the blueprint: ${parts.join(\"; \")}. ` +\n \"Set capabilities to synthesizeExtensionManifest(blueprint, identity).capabilities to stay in sync.\",\n );\n }\n return { used: result.used, declared, missing, unused, findings: result.findings };\n}\n\n/**\n * Assert an extension manifest's declared version bounds permit it to load on a\n * target pm CLI version, throwing when a bound blocks the load.\n *\n * This is the throwing CI/test counterpart to\n * {@link ../sdk/compose.js#checkExtensionManifestCompatibility}: it runs the same\n * author-time version-bound analysis and fails on any blocking incompatibility — a\n * malformed bound (`*_invalid`), a `pm_min_version` the target is below\n * (`pm_min_version_unmet`), or a `block`-mode `pm_max_version` the target exceeds\n * (`pm_max_version_exceeded`). Advisory `warning` findings (`*_unchecked`, or a\n * `warn`-mode `pm_max_version_exceeded_warn`) never throw, because the loader\n * would still load the extension. Pin it to the pm version a package commits to\n * supporting so a too-tight or malformed bound fails the package's own suite, not\n * a user's install. The full compatibility result is returned on success so a test\n * can still inspect advisory warnings.\n */\nexport function assertExtensionManifestCompatible(\n manifest: ExtensionManifestCompatibilityManifest,\n target: ExtensionManifestCompatibilityTarget,\n): ExtensionManifestCompatibilityResult {\n const result = checkExtensionManifestCompatibility(manifest, target);\n const blocking = result.findings.filter((finding) => finding.severity === \"error\");\n if (blocking.length > 0) {\n throw new Error(\n `Extension manifest is not compatible with pm ${result.pmVersion}: ${blocking\n .map((finding) => finding.message)\n .join(\"; \")}`,\n );\n }\n return result;\n}\n\n/**\n * Preflight a declarative {@link ExtensionBlueprint} through every author-time\n * check in one test, throwing if any stage produced an `error`-severity finding.\n *\n * This is the throwing CI/test bookend over\n * {@link ../sdk/compose.js#preflightExtension} — the single guard that replaces\n * chaining {@link assertExtensionBlueprint}, {@link assertExtensionManifestMatchesBlueprint},\n * and {@link assertExtensionManifestCompatible} in a package's\n * `node:test`/Vitest suite. It runs the same consolidated analysis (always lints\n * the blueprint; synthesizes the manifest when `options.identity` is given; checks\n * version bounds when `options.target` is given) and throws one error listing every\n * blocking finding tagged by its `source:code`. Advisory `warning` findings (an\n * unused capability, a duplicate command, an `*_unchecked` bound) never throw,\n * matching the underlying stages. The full {@link ExtensionPreflightReport} is\n * returned on success so a test can still inspect those warnings, the synthesized\n * manifest, and the derived capability set without failing on them.\n */\nexport function assertExtensionPreflight(\n blueprint: ExtensionBlueprint,\n options: PreflightExtensionOptions = {},\n): ExtensionPreflightReport {\n const report = preflightExtension(blueprint, options);\n if (!report.ok) {\n const errors = report.findings.filter((finding) => finding.severity === \"error\");\n throw new Error(\n `Extension failed preflight with ${errors.length} ${errors.length === 1 ? \"error\" : \"errors\"}:\\n` +\n errors.map((finding) => ` - [${finding.source}:${finding.code}] ${finding.message}`).join(\"\\n\"),\n );\n }\n return report;\n}\n\n/**\n * A fluent, single-extension test fixture returned by\n * {@link createExtensionTestHarness}.\n *\n * Every method binds one of the standalone SDK testing helpers to the correct\n * sub-registry of a single {@link ExtensionActivationResult}, so a package author\n * never threads `activation.registrations` vs `activation.commands` vs\n * `activation.hooks` (etc.) by hand — picking the wrong sub-registry is a common\n * footgun that surfaces as a confusing `available: (none)` error. Methods do not\n * use `this`; they close over the activation, so they remain safe to destructure\n * (`const { runCommand, assertCommandContract } = harness;`).\n *\n * The `assert*` methods verify registration wiring (returning the matched\n * registration); the `run*` methods invoke a registered surface through pm's real\n * dispatch engine (returning its runtime result); {@link deactivate} runs the real\n * teardown engine. The raw {@link activation} stays public as an escape hatch to\n * the standalone helpers for any surface not covered by a convenience method.\n */\nexport interface ExtensionTestHarness {\n /** The in-memory extension module supplied to {@link createExtensionTestHarness}. */\n readonly module: unknown;\n /** Resolved extension name (manifest name, explicit override, or `\"test-extension\"`). */\n readonly name: string;\n /** Layer recorded for the in-memory extension (defaults to `\"project\"`). */\n readonly layer: ExtensionLayer;\n /** The underlying activation result; use it to reach standalone helpers directly. */\n readonly activation: ExtensionActivationResult;\n\n /** Bound {@link describeExtensionActivation} over the whole `activation`. */\n activationSummary(options?: DescribeExtensionActivationOptions): ExtensionActivationSummary;\n /**\n * Bound {@link renderExtensionSurfaceMarkdown} over {@link activationSummary},\n * so tests and README generators can produce deterministic surface docs from\n * the same harness they use for assert/run coverage.\n */\n renderMarkdown(options?: RenderExtensionHarnessMarkdownOptions): string;\n\n /** Bound {@link assertRegisteredCommandContract} over `activation.registrations`. */\n assertCommandContract(expectation: RegisteredCommandContractExpectation): RegisteredCommandContractAssertion;\n /** Bound {@link assertRegisteredFlags} over `activation.registrations`. */\n assertFlags(expectation: RegisteredFlagsExpectation): RegisteredExtensionFlagDefinitions;\n /** Bound {@link assertRegisteredItemField} over `activation.registrations`. */\n assertItemField(expectation: RegisteredItemFieldExpectation): RegisteredItemFieldAssertion;\n /** Bound {@link assertRegisteredItemType} over `activation.registrations`. */\n assertItemType(expectation: RegisteredItemTypeExpectation): RegisteredItemTypeAssertion;\n /** Bound {@link assertRegisteredProfile} over `activation.registrations`. */\n assertProfile(expectation: RegisteredProfileExpectation): RegisteredProfileAssertion;\n /** Bound {@link assertRegisteredHook} over `activation.hooks`. */\n assertHook<TKind extends RegisteredHookKind>(\n expectation: RegisteredHookExpectation & { kind: TKind },\n ): ExtensionHookRegistry[(typeof HOOK_KIND_TO_REGISTRY_FIELD)[TKind]][number];\n /** Bound {@link assertRegisteredCommandOverride} over `activation.commands`. */\n assertCommandOverride(expectation: RegisteredCommandOverrideExpectation): RegisteredExtensionCommandOverride;\n /** Bound {@link assertRegisteredParserOverride} over `activation.parsers`. */\n assertParserOverride(expectation: RegisteredParserOverrideExpectation): RegisteredExtensionParserOverride;\n /** Bound {@link assertRegisteredPreflightOverride} over `activation.preflight`. */\n assertPreflightOverride(expectation?: RegisteredPreflightOverrideExpectation): RegisteredExtensionPreflightOverride;\n /** Bound {@link assertRegisteredRendererOverride} over `activation.renderers`. */\n assertRendererOverride(expectation: RegisteredRendererOverrideExpectation): RegisteredExtensionRendererOverride;\n /** Bound {@link assertRegisteredServiceOverride} over `activation.services`. */\n assertServiceOverride(expectation: RegisteredServiceOverrideExpectation): RegisteredExtensionServiceOverride;\n /** Bound {@link assertRegisteredSearchProvider} over `activation.registrations`. */\n assertSearchProvider(expectation: RegisteredSearchProviderExpectation): RegisteredExtensionSearchProvider;\n /** Bound {@link assertRegisteredVectorStoreAdapter} over `activation.registrations`. */\n assertVectorStoreAdapter(expectation: RegisteredVectorStoreAdapterExpectation): RegisteredExtensionVectorStoreAdapter;\n /** Bound {@link assertRegisteredImporter} over `activation.registrations`. */\n assertImporter(expectation: RegisteredImporterExpectation): RegisteredExtensionImporter;\n /** Bound {@link assertRegisteredExporter} over `activation.registrations`. */\n assertExporter(expectation: RegisteredExporterExpectation): RegisteredExtensionExporter;\n /** Bound {@link assertRegisteredMigration} over `activation.registrations`. */\n assertMigration(expectation: RegisteredMigrationExpectation): RegisteredExtensionSchemaMigrationDefinition;\n /** Bound {@link assertExtensionCapabilityUsage} over the whole `activation`. */\n assertCapabilityUsage(expectation: ExtensionCapabilityUsageExpectation): ExtensionCapabilityUsageAssertion;\n\n /** Bound {@link runRegisteredCommandForTest} over `activation.commands`. */\n runCommand(options: RunRegisteredCommandForTestOptions): Promise<CommandHandlerResult>;\n /** Bound {@link runRegisteredHookForTest} over `activation.hooks`. */\n runHook(options: RunRegisteredHookForTestOptions): Promise<string[]>;\n /** Bound {@link runRegisteredCommandOverrideForTest} over `activation.commands`. */\n runCommandOverride(context: CommandOverrideContext): Promise<CommandOverrideResult>;\n /** Bound {@link runRegisteredParserOverrideForTest} over `activation.parsers`. */\n runParserOverride(context: ParserOverrideContext): Promise<ParserOverrideResult>;\n /** Bound {@link runRegisteredPreflightOverrideForTest} over `activation.preflight`. */\n runPreflightOverride(context: PreflightOverrideContext): Promise<PreflightOverrideResult>;\n /** Bound {@link runRegisteredRendererOverrideForTest} over `activation.renderers`. */\n runRendererOverride(context: RendererOverrideContext): Promise<RendererOverrideResult>;\n /** Bound {@link runRegisteredServiceOverrideForTest} over `activation.services`. */\n runServiceOverride(context: ServiceOverrideContext): Promise<ServiceOverrideResult>;\n /** Bound {@link runRegisteredSearchProviderForTest} over `activation.registrations`. */\n runSearchProvider<Operation extends keyof SearchProviderOperationContexts>(options: {\n provider: string;\n operation: Operation;\n context: SearchProviderOperationContexts[Operation];\n }): Promise<SearchProviderOperationResults[Operation]>;\n /** Bound {@link runRegisteredVectorStoreAdapterForTest} over `activation.registrations`. */\n runVectorStoreAdapter<Operation extends keyof VectorStoreAdapterOperationContexts>(options: {\n adapter: string;\n operation: Operation;\n context: VectorStoreAdapterOperationContexts[Operation];\n }): Promise<VectorStoreAdapterOperationResults[Operation]>;\n /** Bound {@link runRegisteredMigrationForTest} over `activation.registrations`. */\n runMigration(options: RunRegisteredMigrationForTestOptions): Promise<unknown>;\n /** Bound {@link runRegisteredImporterForTest} over the whole `activation`. */\n runImporter(options: RunRegisteredImporterForTestOptions): Promise<CommandHandlerResult>;\n /** Bound {@link runRegisteredExporterForTest} over the whole `activation`. */\n runExporter(options: RunRegisteredExporterForTestOptions): Promise<CommandHandlerResult>;\n\n /**\n * Bound {@link deactivateExtensionForTest} — runs the real teardown engine for\n * this harness's module, forwarding its resolved `name`/`layer`/`activation` so\n * the skip-key matches and a never-initialized extension is not deactivated.\n */\n deactivate(options?: { deactivateTimeoutMs?: number }): Promise<ExtensionDeactivationResult>;\n}\n\n/**\n * Reject obviously wrong harness input (e.g. an options object passed as the\n * module) instead of silently producing an empty activation. Mirrors the\n * loader's activatable-extension shapes: an `activate` function on the module\n * or on its default export.\n */\nfunction assertTestModuleHasActivateExport(module: unknown): void {\n if (resolveActivatablePropertyRecord(module)) {\n return;\n }\n throw new Error(\n \"createExtensionTestHarness received a module with no activate export. Pass the extension module (with an activate(api) function on the module or its default export) as the first argument, and options second.\",\n );\n}\n\n/**\n * Activate one in-memory extension module and return a fluent\n * {@link ExtensionTestHarness} that binds every SDK testing helper to the right\n * sub-registry of the resulting activation.\n *\n * This is the ergonomic capstone over the standalone helpers: instead of\n * `activateExtensionForTest(module)` followed by repeatedly threading\n * `activation.registrations` / `activation.commands` / `activation.hooks` into\n * each `assertRegistered*` / `runRegistered*` call, an author writes\n * `const ext = await createExtensionTestHarness(module, { capabilities });` and\n * then `ext.assertCommandContract(...)`, `await ext.runCommand(...)`,\n * `await ext.deactivate()` — never needing to know pm's internal registry layout.\n *\n * `name` and `layer` are resolved exactly as {@link activateExtensionForTest}\n * resolves them, and captured so {@link ExtensionTestHarness.deactivate} forwards\n * a matching skip-key. Activation runs pm's real validation/activation engine, so\n * every bound helper exercises real wiring and dispatch — not mocks.\n *\n * Fails fast: if the module does not activate cleanly (e.g. a registration is\n * dropped because the manifest omits the required capability), this throws a\n * descriptive error listing each failure instead of returning a harness whose\n * registries are empty — which would otherwise surface later as the confusing\n * `available: (none)` assertion error this helper exists to prevent. Tests that\n * deliberately exercise a *failed* activation should call\n * {@link activateExtensionForTest} directly and inspect `activation.failed`.\n */\nexport async function createExtensionTestHarness(\n module: unknown,\n options: ActivateExtensionForTestOptions = {},\n): Promise<ExtensionTestHarness> {\n assertTestModuleHasActivateExport(module);\n const manifest = readTestExtensionManifest(module);\n const name = resolveTestExtensionName(manifest, options.name);\n const layer: ExtensionLayer = options.layer ?? \"project\";\n const activation = await activateExtensionForTest(module, options);\n if (activation.failed.length > 0) {\n const detail = activation.failed\n .map((failure) => {\n const missingCapability = failure.trace?.missing_capability;\n const reason = missingCapability ? `${failure.error}; missing capability \"${missingCapability}\"` : failure.error;\n return `${failure.layer}:${failure.name} (${reason})`;\n })\n .join(\", \");\n throw new Error(\n `createExtensionTestHarness could not activate the extension cleanly: ${detail}. ` +\n \"Declare the required capability in the manifest (or pass it via options.capabilities), \" +\n \"or use activateExtensionForTest directly to inspect a failed activation.\",\n );\n }\n return {\n module,\n name,\n layer,\n activation,\n activationSummary(describeOptions) {\n return describeExtensionActivation(activation, describeOptions);\n },\n renderMarkdown(markdownOptions = {}) {\n const { extensionName, ...renderOptions } = markdownOptions ?? {};\n return renderExtensionSurfaceMarkdown(describeExtensionActivation(activation, { extensionName }), renderOptions);\n },\n assertCommandContract(expectation) {\n return assertRegisteredCommandContract(activation.registrations, expectation);\n },\n assertFlags(expectation) {\n return assertRegisteredFlags(activation.registrations, expectation);\n },\n assertItemField(expectation) {\n return assertRegisteredItemField(activation.registrations, expectation);\n },\n assertItemType(expectation) {\n return assertRegisteredItemType(activation.registrations, expectation);\n },\n assertProfile(expectation) {\n return assertRegisteredProfile(activation.registrations, expectation);\n },\n assertHook(expectation) {\n return assertRegisteredHook(activation.hooks, expectation);\n },\n assertCommandOverride(expectation) {\n return assertRegisteredCommandOverride(activation.commands, expectation);\n },\n assertParserOverride(expectation) {\n return assertRegisteredParserOverride(activation.parsers, expectation);\n },\n assertPreflightOverride(expectation) {\n return assertRegisteredPreflightOverride(activation.preflight, expectation);\n },\n assertRendererOverride(expectation) {\n return assertRegisteredRendererOverride(activation.renderers, expectation);\n },\n assertServiceOverride(expectation) {\n return assertRegisteredServiceOverride(activation.services, expectation);\n },\n assertSearchProvider(expectation) {\n return assertRegisteredSearchProvider(activation.registrations, expectation);\n },\n assertVectorStoreAdapter(expectation) {\n return assertRegisteredVectorStoreAdapter(activation.registrations, expectation);\n },\n assertImporter(expectation) {\n return assertRegisteredImporter(activation.registrations, expectation);\n },\n assertExporter(expectation) {\n return assertRegisteredExporter(activation.registrations, expectation);\n },\n assertMigration(expectation) {\n return assertRegisteredMigration(activation.registrations, expectation);\n },\n assertCapabilityUsage(expectation) {\n return assertExtensionCapabilityUsage(activation, expectation);\n },\n runCommand(runOptions) {\n return runRegisteredCommandForTest(activation.commands, runOptions);\n },\n runHook(runOptions) {\n return runRegisteredHookForTest(activation.hooks, runOptions);\n },\n runCommandOverride(context) {\n return runRegisteredCommandOverrideForTest(activation.commands, context);\n },\n runParserOverride(context) {\n return runRegisteredParserOverrideForTest(activation.parsers, context);\n },\n runPreflightOverride(context) {\n return runRegisteredPreflightOverrideForTest(activation.preflight, context);\n },\n runRendererOverride(context) {\n return runRegisteredRendererOverrideForTest(activation.renderers, context);\n },\n runServiceOverride(context) {\n return runRegisteredServiceOverrideForTest(activation.services, context);\n },\n runSearchProvider(runOptions) {\n return runRegisteredSearchProviderForTest(activation.registrations, runOptions);\n },\n runVectorStoreAdapter(runOptions) {\n return runRegisteredVectorStoreAdapterForTest(activation.registrations, runOptions);\n },\n runMigration(runOptions) {\n return runRegisteredMigrationForTest(activation.registrations, runOptions);\n },\n runImporter(runOptions) {\n return runRegisteredImporterForTest(activation, runOptions);\n },\n runExporter(runOptions) {\n return runRegisteredExporterForTest(activation, runOptions);\n },\n deactivate(deactivateOptions = {}) {\n return deactivateExtensionForTest(module, {\n name,\n layer,\n activation,\n deactivateTimeoutMs: deactivateOptions.deactivateTimeoutMs,\n });\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGM,SAAU,gBAAiD,QAAe;AAC9E,SAAO;AACT;AAyHM,SAAU,yBAAgE,WAAqB;AACnG,SAAO;AACT;AAOA,SAAS,iCAAiC,KAAmB,WAA6B;AACxF,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