@unbrained/pm-cli 2026.7.2 → 2026.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/CHANGELOG.md +19 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +1 -1
- package/dist/cli/commander-usage.js +54 -41
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +79 -57
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/close-many.js +106 -65
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/create.js +32 -17
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/doctor.js +56 -67
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/shared.js +21 -15
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/health.js +101 -112
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.js +32 -19
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/next.js +13 -10
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/profile.js +23 -15
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +2 -0
- package/dist/cli/commands/validate.js +14 -2
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +9 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.js +27 -19
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-json-payload.js +57 -49
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +48 -32
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +213 -213
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +368 -368
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +303 -299
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +4 -0
- package/dist/cli/registration-helpers.js +45 -56
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js → activity-5YWLSPGE.js} +9 -9
- package/dist/cli-bundle/chunks/activity-BIML7K2D.js +16 -0
- package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js → aggregate-2V2M3JZU.js} +8 -8
- package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js → aggregate-EK7DXML7.js} +8 -8
- package/dist/cli-bundle/chunks/{append-UBM632FK.js → append-EZESUVJT.js} +8 -8
- package/dist/cli-bundle/chunks/{append-H32VOR2Y.js → append-JFG4WQMG.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js → chunk-32IUNTG4.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js → chunk-3W2HJKJX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-MNBPX5JS.js → chunk-4EXFFP7T.js} +42 -27
- package/dist/cli-bundle/chunks/{chunk-MNBPX5JS.js.map → chunk-4EXFFP7T.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js → chunk-4PFVUUYV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NRZS637N.js → chunk-4WB6S4YX.js} +56 -21
- package/dist/cli-bundle/chunks/chunk-4WB6S4YX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5GVTFFTC.js → chunk-572FKBRL.js} +61 -102
- package/dist/cli-bundle/chunks/chunk-572FKBRL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js → chunk-5E7N4T2Z.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-S62UANU7.js → chunk-5IZUBZBR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js → chunk-5JIWFWOZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js → chunk-67LARBDL.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-KIYCOJ63.js → chunk-6CDCWKSX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JXAUVO6X.js → chunk-6KRFL33E.js} +55 -20
- package/dist/cli-bundle/chunks/chunk-6KRFL33E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js → chunk-6NYJGMTY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js → chunk-7CLLC75T.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js → chunk-7LYO6S5A.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js → chunk-A3OQ7TFW.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js → chunk-AIKU3IIL.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-AIAIXG7I.js → chunk-AJHYQCBJ.js} +39 -5
- package/dist/cli-bundle/chunks/chunk-AJHYQCBJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js → chunk-BE2SR6QL.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-GFMSLORL.js → chunk-BI4R7HI2.js} +75 -53
- package/dist/cli-bundle/chunks/chunk-BI4R7HI2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-K2VYLVX4.js → chunk-CXR3CMBQ.js} +33 -6
- package/dist/cli-bundle/chunks/chunk-CXR3CMBQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7W4H4K26.js → chunk-ECU6MMTQ.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-YLZZ6T54.js → chunk-EJ2OCBHF.js} +23 -8
- package/dist/cli-bundle/chunks/chunk-EJ2OCBHF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js → chunk-EQURFOMH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js → chunk-ER4ME5U2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js → chunk-ERG65A2L.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js → chunk-F6WNBITZ.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js → chunk-FH2H3CBD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js → chunk-FUFFPIYA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js → chunk-FZJM2TXF.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js → chunk-GUYNUXQT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js → chunk-GVJE5T7Q.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SYNKD3ZG.js → chunk-HB4FAT3O.js} +42 -60
- package/dist/cli-bundle/chunks/chunk-HB4FAT3O.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XEWQKDYZ.js → chunk-HQAF23Q2.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js → chunk-JBZ2NTKX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SPM2XLWI.js → chunk-JPATY4SE.js} +22 -7
- package/dist/cli-bundle/chunks/chunk-JPATY4SE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js → chunk-K5DT2YKM.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js → chunk-KEZOIPCR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7NSPKJUS.js → chunk-KHVGM5CS.js} +113 -83
- package/dist/cli-bundle/chunks/chunk-KHVGM5CS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-66Z3X7ZG.js → chunk-KS6ATO47.js} +33 -20
- package/dist/cli-bundle/chunks/{chunk-66Z3X7ZG.js.map → chunk-KS6ATO47.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I66WE2HE.js → chunk-L4SLHV6G.js} +112 -82
- package/dist/cli-bundle/chunks/chunk-L4SLHV6G.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2227673O.js → chunk-LBE5QFMZ.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-YPKFV2JR.js → chunk-LCWQP6NM.js} +76 -54
- package/dist/cli-bundle/chunks/chunk-LCWQP6NM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js → chunk-LOWVNZBZ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js → chunk-MDHWWBNZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js → chunk-MEZZZBYX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6YCYF2AI.js → chunk-MHRS5FUX.js} +34 -21
- package/dist/cli-bundle/chunks/{chunk-6YCYF2AI.js.map → chunk-MHRS5FUX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js → chunk-NOIEVOK5.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-GRRG3MCT.js → chunk-NZ7QIUP5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-TPOFWBMY.js → chunk-OGLGI22K.js} +26 -20
- package/dist/cli-bundle/chunks/chunk-OGLGI22K.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js → chunk-P5L7Z2O6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js → chunk-PULUSQAV.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js → chunk-QCDTQCMW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js → chunk-QNNQAAZ5.js} +24 -18
- package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js.map → chunk-QNNQAAZ5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XWGEMNBR.js → chunk-RAHINBVP.js} +60 -101
- package/dist/cli-bundle/chunks/chunk-RAHINBVP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AJEBCRIY.js → chunk-RJH5VQHW.js} +43 -61
- package/dist/cli-bundle/chunks/chunk-RJH5VQHW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js → chunk-SU2E4AWU.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js → chunk-SU3TB4NS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XCHUVHKU.js → chunk-SYE6WMV6.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js → chunk-T3P7PMZP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js → chunk-T4XBKJ3F.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js → chunk-T6AXEBOP.js} +23 -17
- package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js.map → chunk-T6AXEBOP.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js → chunk-TQ6AX5SQ.js} +58 -69
- package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js.map → chunk-TQ6AX5SQ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RM37OPYK.js → chunk-U3S2B7TA.js} +43 -28
- package/dist/cli-bundle/chunks/{chunk-RM37OPYK.js.map → chunk-U3S2B7TA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js → chunk-U5TR4N7J.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js → chunk-UMNQZS4H.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js → chunk-WJA3PXW7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js → chunk-WRYERRZX.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-6ITZLD4T.js → chunk-WYOIIFSE.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-7TH5NMVB.js → chunk-XRYSCRZR.js} +25 -19
- package/dist/cli-bundle/chunks/chunk-XRYSCRZR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js → chunk-YF746GTH.js} +59 -70
- package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js.map → chunk-YF746GTH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js → chunk-YPWUSH72.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js → chunk-YSDFIY7N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js → chunk-YSGTMDWC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js → chunk-YVKZ3ANP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js → chunk-Z5F6XZXE.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js → chunk-Z7RPDF2Y.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-W47SML5B.js → chunk-ZFTKYWIF.js} +7 -7
- package/dist/cli-bundle/chunks/{claim-SENTPZBN.js → claim-2BGBGSVI.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js → claim-5GU7OE67.js} +8 -8
- package/dist/cli-bundle/chunks/close-6YODBUIV.js +14 -0
- package/dist/cli-bundle/chunks/{close-424MX4CU.js → close-AFVKPR57.js} +7 -7
- package/dist/cli-bundle/chunks/{close-many-SWY34BII.js → close-many-7KLOSYLP.js} +119 -76
- package/dist/cli-bundle/chunks/close-many-7KLOSYLP.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-many-2IV4J2TR.js → close-many-JKUJMHLG.js} +120 -77
- package/dist/cli-bundle/chunks/close-many-JKUJMHLG.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js → comments-DNWHEBOS.js} +9 -9
- package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js → comments-RW23R3VE.js} +9 -9
- package/dist/cli-bundle/chunks/{config-G74GISC4.js → config-AUM5WBYA.js} +7 -7
- package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js → config-OZWSA2NP.js} +7 -7
- package/dist/cli-bundle/chunks/{context-ZQY54JNS.js → context-OYXRGY7S.js} +12 -12
- package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js → context-PKCEHQY3.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js → contracts-L6ODXNUM.js} +3 -3
- package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js → contracts-X74F2GSM.js} +3 -3
- package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js → copy-6XOR3HKN.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js → copy-I4NCLBR4.js} +5 -5
- package/dist/cli-bundle/chunks/{create-VSKYSOCD.js → create-PM45M6PE.js} +12 -12
- package/dist/cli-bundle/chunks/create-Z7YCH3BE.js +28 -0
- package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js → delete-7YXHYG67.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js → delete-LPISP43T.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js → deps-N2T26FME.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js → deps-WATKQDE3.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js → docs-6LQ3GLM7.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js → docs-Z3X6JZLT.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js → eval-6DCLG52D.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js → eval-Y3ZCUTHK.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js → extension-BNINIMT7.js} +11 -11
- package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js → extension-QWE4YYK5.js} +11 -11
- package/dist/cli-bundle/chunks/{files-5D65CHGE.js → files-6SGKHS6O.js} +7 -7
- package/dist/cli-bundle/chunks/{files-GPIG77EN.js → files-FUYPSOFJ.js} +7 -7
- package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js → focus-2Q3K76G2.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js → focus-ATLBWXXD.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js → gc-RUYEMNRF.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-VZIXDL32.js → gc-TDWSDR66.js} +3 -3
- package/dist/cli-bundle/chunks/{get-IOVAN6RU.js → get-2WGLX74N.js} +10 -10
- package/dist/cli-bundle/chunks/{get-GIBRUUOP.js → get-LY6M2JIM.js} +10 -10
- package/dist/cli-bundle/chunks/{health-L2U3AFKV.js → health-4RKHYS3T.js} +115 -123
- package/dist/cli-bundle/chunks/health-4RKHYS3T.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-MM7AWXYF.js → health-TMFVNYRA.js} +114 -122
- package/dist/cli-bundle/chunks/health-TMFVNYRA.js.map +7 -0
- package/dist/cli-bundle/chunks/history-CGNQJXFE.js +18 -0
- package/dist/cli-bundle/chunks/{history-IL7XCEX2.js → history-SGRRS72R.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-MV25P7DM.js → history-compact-LOED43R3.js} +10 -10
- package/dist/cli-bundle/chunks/{history-compact-HALOTOU7.js → history-compact-V5DNAQHH.js} +10 -10
- package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js → history-redact-IRL7WJ3E.js} +9 -9
- package/dist/cli-bundle/chunks/history-redact-N3JK7VBW.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-44MODPQF.js → history-repair-4WVBVHFR.js} +10 -10
- package/dist/cli-bundle/chunks/{history-repair-CPNAOCNF.js → history-repair-PGYQJMGD.js} +10 -10
- package/dist/cli-bundle/chunks/{init-F27NHENZ.js → init-4GESW7RM.js} +12 -12
- package/dist/cli-bundle/chunks/init-XIDPABA4.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js → learnings-4BHWFFUV.js} +9 -9
- package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js → learnings-4FJY7WIW.js} +9 -9
- package/dist/cli-bundle/chunks/{list-HPMEKCAA.js → list-472TIOVK.js} +8 -8
- package/dist/cli-bundle/chunks/{list-VMPWTURB.js → list-D7BF5CL2.js} +8 -8
- package/dist/cli-bundle/chunks/{next-QM6YJIIS.js → next-D5STGWI2.js} +26 -23
- package/dist/cli-bundle/chunks/next-D5STGWI2.js.map +1 -0
- package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js → next-SFQZVX2B.js} +25 -22
- package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js.map → next-SFQZVX2B.js.map} +2 -2
- package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js → notes-6KNOSLIT.js} +9 -9
- package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js → notes-W4UEICGF.js} +9 -9
- package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js → plan-JO6V7BXO.js} +12 -12
- package/dist/cli-bundle/chunks/{plan-C5IMM335.js → plan-MJQW5XK3.js} +12 -12
- package/dist/cli-bundle/chunks/{profile-HUCENIEQ.js → profile-3TOTMUR4.js} +26 -18
- package/dist/cli-bundle/chunks/profile-3TOTMUR4.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-CCOKZ2IQ.js → profile-WIQY2KCV.js} +27 -19
- package/dist/cli-bundle/chunks/profile-WIQY2KCV.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-XN4ZRHSV.js → register-list-query-ELBHCCFI.js} +179 -170
- package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-ROSNIL52.js → register-list-query-GAPQ6DM3.js} +180 -171
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-KRLAHEL2.js → register-mutation-ROFE2YPC.js} +367 -361
- package/dist/cli-bundle/chunks/register-mutation-ROFE2YPC.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-CFSB2MS3.js → register-mutation-SJWMVIJ2.js} +368 -362
- package/dist/cli-bundle/chunks/register-mutation-SJWMVIJ2.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-4PASGJDB.js → register-operations-IADFVH53.js} +309 -304
- package/dist/cli-bundle/chunks/register-operations-IADFVH53.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-MBN4KGUM.js → register-operations-MEKU3AKC.js} +310 -305
- package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js → register-setup-3QJY43CY.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js → register-setup-AJWUSSQX.js} +15 -15
- package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js → restore-44IHMMZZ.js} +9 -9
- package/dist/cli-bundle/chunks/restore-EXHU34EU.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js → scheduling-shortcuts-OLHNLAZY.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js → scheduling-shortcuts-TSBK4AY5.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js → schema-IB2NZZWD.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js → schema-VBCELP5G.js} +7 -7
- package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js → search-7UBETML4.js} +10 -10
- package/dist/cli-bundle/chunks/{search-FP7MEU4S.js → search-R227JOL6.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js → stats-FAG7COEH.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js → stats-MCK7PLYS.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js → telemetry-DRPDZMAO.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js → telemetry-GVVUQSJQ.js} +4 -4
- package/dist/cli-bundle/chunks/{test-YCDAUBWF.js → test-QY44WAMR.js} +15 -15
- package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js → test-SY76DZTO.js} +15 -15
- package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js → test-all-QD6QAEG7.js} +17 -17
- package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js → test-all-USPJHXFR.js} +17 -17
- package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js → test-runs-MG5VIGSK.js} +4 -4
- package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js → test-runs-QIR5MJPL.js} +4 -4
- package/dist/cli-bundle/chunks/update-A7EICML6.js +24 -0
- package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js → update-IKJZWLQC.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js → update-many-BEMTDA2X.js} +28 -28
- package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js → update-many-RATAARHU.js} +28 -28
- package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js → upgrade-NWMR3VQL.js} +11 -11
- package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js → upgrade-VU46BLJZ.js} +11 -11
- package/dist/cli-bundle/chunks/{validate-W7H5TEDC.js → validate-GAJ6FUSI.js} +32 -22
- package/dist/cli-bundle/chunks/validate-GAJ6FUSI.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-732RWS5W.js → validate-NRY6MFXN.js} +31 -21
- package/dist/cli-bundle/chunks/validate-NRY6MFXN.js.map +7 -0
- package/dist/cli-bundle/main.js +180 -122
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/item/type-registry.js +29 -19
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +65 -54
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.js +26 -3
- package/dist/core/schema/status-defs-file.js.map +1 -1
- package/dist/core/search/corpus.js +25 -19
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/shared/memo.d.ts +12 -0
- package/dist/core/shared/memo.js +25 -0
- package/dist/core/shared/memo.js.map +1 -0
- package/dist/core/shared/serialization.js +24 -14
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/shared/time.js +26 -4
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +5 -0
- package/dist/core/store/front-matter-cache.js +79 -20
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +71 -99
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/compose.js +51 -42
- package/dist/sdk/compose.js.map +1 -1
- package/docs/AGENT_GUIDE.md +2 -2
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/COMMANDS.md +8 -4
- package/docs/CONFIGURATION.md +1 -1
- package/docs/EXTENSIONS.md +12 -12
- package/docs/ONBOARDING.md +4 -2
- package/docs/README.md +2 -0
- package/docs/examples/starter-extension/README.md +11 -10
- package/marketplace.json +3 -3
- package/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
- package/plugins/pm-claude/README.md +6 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/dist/cli-bundle/chunks/activity-WEIEMM73.js +0 -16
- package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AIAIXG7I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GFMSLORL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JXAUVO6X.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-K2VYLVX4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YPKFV2JR.js.map +0 -1
- package/dist/cli-bundle/chunks/close-YCWQQPDS.js +0 -14
- package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +0 -1
- package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +0 -7
- package/dist/cli-bundle/chunks/create-XTMAPS7I.js +0 -28
- package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +0 -1
- package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +0 -7
- package/dist/cli-bundle/chunks/history-DD7L7BNL.js +0 -18
- package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +0 -19
- package/dist/cli-bundle/chunks/init-HHVQQP6C.js +0 -22
- package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-CCOKZ2IQ.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-HUCENIEQ.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +0 -17
- package/dist/cli-bundle/chunks/update-MTCFES6X.js +0 -24
- package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js.map → activity-5YWLSPGE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-WEIEMM73.js.map → activity-BIML7K2D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js.map → aggregate-2V2M3JZU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js.map → aggregate-EK7DXML7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-UBM632FK.js.map → append-EZESUVJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-H32VOR2Y.js.map → append-JFG4WQMG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js.map → chunk-32IUNTG4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js.map → chunk-3W2HJKJX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js.map → chunk-4PFVUUYV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js.map → chunk-5E7N4T2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S62UANU7.js.map → chunk-5IZUBZBR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js.map → chunk-5JIWFWOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js.map → chunk-67LARBDL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KIYCOJ63.js.map → chunk-6CDCWKSX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js.map → chunk-6NYJGMTY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js.map → chunk-7CLLC75T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js.map → chunk-7LYO6S5A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js.map → chunk-A3OQ7TFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js.map → chunk-AIKU3IIL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js.map → chunk-BE2SR6QL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7W4H4K26.js.map → chunk-ECU6MMTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js.map → chunk-EQURFOMH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js.map → chunk-ER4ME5U2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js.map → chunk-ERG65A2L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js.map → chunk-F6WNBITZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js.map → chunk-FH2H3CBD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js.map → chunk-FUFFPIYA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js.map → chunk-FZJM2TXF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js.map → chunk-GUYNUXQT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js.map → chunk-GVJE5T7Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XEWQKDYZ.js.map → chunk-HQAF23Q2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js.map → chunk-JBZ2NTKX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js.map → chunk-K5DT2YKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js.map → chunk-KEZOIPCR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2227673O.js.map → chunk-LBE5QFMZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js.map → chunk-LOWVNZBZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js.map → chunk-MDHWWBNZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js.map → chunk-MEZZZBYX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js.map → chunk-NOIEVOK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GRRG3MCT.js.map → chunk-NZ7QIUP5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js.map → chunk-P5L7Z2O6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js.map → chunk-PULUSQAV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js.map → chunk-QCDTQCMW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js.map → chunk-SU2E4AWU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js.map → chunk-SU3TB4NS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XCHUVHKU.js.map → chunk-SYE6WMV6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js.map → chunk-T3P7PMZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js.map → chunk-T4XBKJ3F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js.map → chunk-U5TR4N7J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js.map → chunk-UMNQZS4H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js.map → chunk-WJA3PXW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js.map → chunk-WRYERRZX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6ITZLD4T.js.map → chunk-WYOIIFSE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js.map → chunk-YPWUSH72.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js.map → chunk-YSDFIY7N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js.map → chunk-YSGTMDWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js.map → chunk-YVKZ3ANP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js.map → chunk-Z5F6XZXE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js.map → chunk-Z7RPDF2Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W47SML5B.js.map → chunk-ZFTKYWIF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-SENTPZBN.js.map → claim-2BGBGSVI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js.map → claim-5GU7OE67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-YCWQQPDS.js.map → close-6YODBUIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-424MX4CU.js.map → close-AFVKPR57.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js.map → comments-DNWHEBOS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js.map → comments-RW23R3VE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-G74GISC4.js.map → config-AUM5WBYA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js.map → config-OZWSA2NP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-ZQY54JNS.js.map → context-OYXRGY7S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js.map → context-PKCEHQY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js.map → contracts-L6ODXNUM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js.map → contracts-X74F2GSM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js.map → copy-6XOR3HKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js.map → copy-I4NCLBR4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-VSKYSOCD.js.map → create-PM45M6PE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-XTMAPS7I.js.map → create-Z7YCH3BE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js.map → delete-7YXHYG67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js.map → delete-LPISP43T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js.map → deps-N2T26FME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js.map → deps-WATKQDE3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js.map → docs-6LQ3GLM7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js.map → docs-Z3X6JZLT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js.map → eval-6DCLG52D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js.map → eval-Y3ZCUTHK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js.map → extension-BNINIMT7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js.map → extension-QWE4YYK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-5D65CHGE.js.map → files-6SGKHS6O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-GPIG77EN.js.map → files-FUYPSOFJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js.map → focus-2Q3K76G2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js.map → focus-ATLBWXXD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js.map → gc-RUYEMNRF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-VZIXDL32.js.map → gc-TDWSDR66.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-IOVAN6RU.js.map → get-2WGLX74N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-GIBRUUOP.js.map → get-LY6M2JIM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-DD7L7BNL.js.map → history-CGNQJXFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-IL7XCEX2.js.map → history-SGRRS72R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-MV25P7DM.js.map → history-compact-LOED43R3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-HALOTOU7.js.map → history-compact-V5DNAQHH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js.map → history-redact-IRL7WJ3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IX4YEWMY.js.map → history-redact-N3JK7VBW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-44MODPQF.js.map → history-repair-4WVBVHFR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-CPNAOCNF.js.map → history-repair-PGYQJMGD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-F27NHENZ.js.map → init-4GESW7RM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-HHVQQP6C.js.map → init-XIDPABA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js.map → learnings-4BHWFFUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js.map → learnings-4FJY7WIW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-HPMEKCAA.js.map → list-472TIOVK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-VMPWTURB.js.map → list-D7BF5CL2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js.map → notes-6KNOSLIT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js.map → notes-W4UEICGF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js.map → plan-JO6V7BXO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-C5IMM335.js.map → plan-MJQW5XK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js.map → register-setup-3QJY43CY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js.map → register-setup-AJWUSSQX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js.map → restore-44IHMMZZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-5UEAGG3W.js.map → restore-EXHU34EU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js.map → scheduling-shortcuts-OLHNLAZY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js.map → scheduling-shortcuts-TSBK4AY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js.map → schema-IB2NZZWD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js.map → schema-VBCELP5G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js.map → search-7UBETML4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-FP7MEU4S.js.map → search-R227JOL6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js.map → stats-FAG7COEH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js.map → stats-MCK7PLYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js.map → telemetry-DRPDZMAO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js.map → telemetry-GVVUQSJQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-YCDAUBWF.js.map → test-QY44WAMR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js.map → test-SY76DZTO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js.map → test-all-QD6QAEG7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js.map → test-all-USPJHXFR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js.map → test-runs-MG5VIGSK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js.map → test-runs-QIR5MJPL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-MTCFES6X.js.map → update-A7EICML6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js.map → update-IKJZWLQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js.map → update-many-BEMTDA2X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js.map → update-many-RATAARHU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js.map → upgrade-NWMR3VQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js.map → upgrade-VU46BLJZ.js.map} +0 -0
package/dist/sdk/compose.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sources":["sdk/compose.ts"],"sourceRoot":"/","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\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((entry) => normalizeCommandName(`${entry.name} import`));\n const exporterPaths = exporters.map((entry) => normalizeCommandName(`${entry.name} export`));\n const importerCommandDefinitionPaths = importers\n .filter((entry) => entry.options !== undefined)\n .map((entry) => normalizeCommandName(`${entry.name} import`));\n const exporterCommandDefinitionPaths = exporters\n .filter((entry) => entry.options !== undefined)\n .map((entry) => normalizeCommandName(`${entry.name} export`));\n const commandPaths = [\n ...commands.map((command) => normalizeCommandName(command.name)),\n ...importerCommandDefinitionPaths,\n ...exporterCommandDefinitionPaths,\n ];\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 = [\n ...Object.keys(blueprint.flags ?? {}).map((command) => normalizeCommandName(command)),\n ...commands\n .filter((command) => command.flags !== undefined)\n .map((command) => normalizeCommandName(command.name)),\n ...importers\n .filter((entry) => entry.options?.flags !== undefined)\n .map((entry) => normalizeCommandName(`${entry.name} import`)),\n ...exporters\n .filter((entry) => entry.options?.flags !== undefined)\n .map((entry) => normalizeCommandName(`${entry.name} export`)),\n ];\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\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: BLUEPRINT_HOOK_FIELD_TO_KIND.filter(([field]) => (hooks[field]?.length ?? 0) > 0).map(([, kind]) => kind),\n flag_commands: sortUnique(flagCommands),\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 * 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"],"names":[],"mappings":";;AAyDA,OAAO,EACL,iCAAiC,EACjC,qCAAqC,GACtC,MAAM,oDAAoD,CAAC;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,eAAe,CAAC,IAAI;QAClC,SAAS,EAAE,eAAe;QAC1B,QAAQ;QACR,aAAa;QACb,QAAQ;KACT,CAAC;AACJ,CAAC","debugId":"ef101a7b-f751-5242-8a7b-099f2a969a46"}
|
|
1
|
+
{"version":3,"file":"compose.js","sources":["sdk/compose.ts"],"sourceRoot":"/","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"],"names":[],"mappings":";;AAyDA,OAAO,EACL,iCAAiC,EACjC,qCAAqC,GACtC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AACvF,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAG1B,MAAM,sCAAsC,CAAC;AA4B9C;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAkC,MAAe;IAC9E,OAAO,MAAM,CAAC;AAChB,CAAC;AAwGD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,wBAAwB,CAAwC,SAAqB;IACnG,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,SAAS,gCAAgC,CAAC,GAAiB,EAAE,SAA6B;IACxF,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,QAAQ,IAAI,EAAE,EAAE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dae1"}
|
package/docs/AGENT_GUIDE.md
CHANGED
|
@@ -120,7 +120,7 @@ pm release <item-id>
|
|
|
120
120
|
| Full machine payload | `pm get <id> --full --json` |
|
|
121
121
|
| Command flags | `pm <command> --help --json` |
|
|
122
122
|
| Low-noise machine contracts | `pm contracts --command <command> --flags-only --json` |
|
|
123
|
-
| Semantic index refresh | `pm reindex --mode semantic --progress` (stale-first by default; add `--full` to force full rebuild) |
|
|
123
|
+
| Semantic index refresh | `pm reindex --mode semantic --progress` (stale-first by default; add `--full` to force full rebuild; requires the `search-advanced` package) |
|
|
124
124
|
| Timeline | `pm activity --id <id> --limit 20` |
|
|
125
125
|
| Audited history redaction | `pm history-redact <id> --literal "<secret>" --replacement "[redacted]" --dry-run` |
|
|
126
126
|
| Audited history re-anchor | `pm history-repair <id> --dry-run` (clears drift flagged by `pm health`/`pm validate`) |
|
|
@@ -189,7 +189,7 @@ Use these defaults unless the task requires otherwise:
|
|
|
189
189
|
- `pm schema add-status <id> --role <role>` / `pm schema remove-status <id>` manage custom lifecycle statuses in `.agents/pm/schema/statuses.json`; roles come from the runtime status-role vocabulary, the upsert is idempotent, and built-in default statuses cannot be removed. `pm schema list` now reports statuses (builtin vs custom) alongside types.
|
|
190
190
|
- `pm init --type-preset agile|ops|research` for new projects that should start with domain item types instead of generic tasks only.
|
|
191
191
|
- After switching embedding provider/model, run `pm reindex --mode semantic --full` or `pm reindex --mode hybrid --full` to rebuild vectors completely; `pm reindex --mode keyword` ignores `--full` and now warns when ledger identity drift is detected.
|
|
192
|
-
- `pm normalize --dry-run --json` before lifecycle metadata cleanups.
|
|
192
|
+
- `pm normalize --dry-run --json` before lifecycle metadata cleanups (requires the `governance-audit` package).
|
|
193
193
|
- `pm health --check-only` when inspecting repository health without refresh side effects.
|
|
194
194
|
- Mistyped command names get a `Did you mean: <command>?` hint, including typos of the executable shortcut aliases — `pm shwo <id>` suggests `get` (the canonical of `show`/`view`), and `pm comemnt` suggests `comments`.
|
|
195
195
|
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -14,7 +14,7 @@ Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon).
|
|
|
14
14
|
|
|
15
15
|
## System Overview
|
|
16
16
|
|
|
17
|
-
`pm-cli` is a TypeScript ESM CLI for Node.js
|
|
17
|
+
`pm-cli` is a TypeScript ESM CLI for Node.js 22.18+. It is file-backed, git-native, deterministic, and designed for concurrent human plus agent workflows.
|
|
18
18
|
|
|
19
19
|
High-level flow:
|
|
20
20
|
|
|
@@ -304,7 +304,7 @@ Useful commands:
|
|
|
304
304
|
|
|
305
305
|
```bash
|
|
306
306
|
pm search "restore history" --mode keyword --limit 10
|
|
307
|
-
pm reindex --mode hybrid --progress
|
|
307
|
+
pm reindex --mode hybrid --progress # requires the search-advanced package
|
|
308
308
|
pm health --check-only
|
|
309
309
|
```
|
|
310
310
|
|
package/docs/COMMANDS.md
CHANGED
|
@@ -30,9 +30,9 @@ Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon).
|
|
|
30
30
|
| Bulk | `update-many`, `close-many` | apply one change across a matched, dry-run-previewed set with a rollback checkpoint |
|
|
31
31
|
| Scheduling | `meet`, `event`, `remind` | low-friction Meeting/Event/Reminder creation |
|
|
32
32
|
| Planning | `plan create`, `plan add-step`, `plan update-step`, `plan complete-step`, `plan link`, `plan approve`, `plan materialize` | agent-optimized living plans with ordered steps, evidence, decisions, validation, and materialization |
|
|
33
|
-
| Logs | `comments`, `notes`, `learnings`, `comments-audit
|
|
33
|
+
| Logs | `comments`, `notes`, `learnings`, `comments-audit`* | record progress and durable context |
|
|
34
34
|
| Links | `files`, `docs`, `test`, `deps` | connect items to artifacts, tests, and relationships |
|
|
35
|
-
| Verification | `test`, `test-all`, `test-runs
|
|
35
|
+
| Verification | `test`, `test-all`, `test-runs`†, `validate`, `gc` | run linked tests and repository checks |
|
|
36
36
|
| History | `history`, `history-compact`, `history-redact`, `history-repair`, `activity`, `restore`, `stats` | inspect, compact, redact, re-anchor, and recover item state |
|
|
37
37
|
| Schema | `schema add-type` / `remove-type` / `add-status` / `remove-status` / `add-field` / `remove-field` / `apply-preset` | manage config-driven custom item types (`.agents/pm/schema/types.json`), statuses (`.agents/pm/schema/statuses.json`), and custom metadata fields (`.agents/pm/schema/fields.json`); `apply-preset` adopts a domain type preset; `add-type --infer` derives types from title-prefix conventions |
|
|
38
38
|
| Profiles | `profile list` / `show` / `apply` / `lint` | compose item types, statuses, fields, workflows, config, templates, and recommended packages into archetype bundles (agile/ops/research); `apply` stages every dimension idempotently; `lint` reports author-time consistency findings without writing |
|
|
@@ -40,7 +40,9 @@ Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon).
|
|
|
40
40
|
| Packages | `install`, `upgrade`, `package`, `packages`, `extension`, package/extension command groups | install, upgrade, manage, and run package-backed extension commands |
|
|
41
41
|
| Machines | `contracts`, `help`, optional `guide`/`completion` | command contracts plus optional guide-shell docs routing and shell helpers |
|
|
42
42
|
|
|
43
|
-
`*` `dedupe-audit
|
|
43
|
+
`*` `dedupe-audit`, `dedupe-merge`, `comments-audit`, and `normalize` are provided by the optional `governance-audit` package (`pm install governance-audit --project`).
|
|
44
|
+
|
|
45
|
+
`†` `test-runs` subcommands are provided by the optional `linked-test-adapters` package (`pm install linked-test-adapters --project`).
|
|
44
46
|
|
|
45
47
|
## Bootstrap
|
|
46
48
|
|
|
@@ -746,7 +748,7 @@ pm create Spike "Investigate retry backoff"
|
|
|
746
748
|
- `add-type` is an idempotent UPSERT keyed on the type name (case-insensitive); re-running it merges aliases and overrides supplied fields while preserving everything else.
|
|
747
749
|
- `remove-type <Name>` removes a custom type definition (case-insensitive). Built-in types are refused. It WARNS (non-blocking) with `items_using_type:<N>` when items of that type still exist, then removes the definition.
|
|
748
750
|
- `add-status <id>` writes a custom lifecycle status (idempotent UPSERT keyed on the normalized id; re-adding sets `replaced: true`). Roles are validated against the runtime status roles: `draft`, `active`, `blocked`, `terminal`, `terminal_done`, `terminal_canceled`, `default_open`, `default_close`, `default_cancel`.
|
|
749
|
-
- `remove-status <id>` removes a custom status. The
|
|
751
|
+
- `remove-status <id>` removes a custom status. The six built-in statuses (`open`, `in_progress`, `blocked`, `closed`, `canceled`, `draft`) are refused. It WARNS (non-blocking) with `items_using_status:<N>` when items currently use that status.
|
|
750
752
|
- Built-in types (Chore, Decision, Epic, Event, Feature, Issue, Meeting, Milestone, Plan, Reminder, Task) are reserved and cannot be redefined or removed.
|
|
751
753
|
- `add-field <key>` registers a custom metadata field in `.agents/pm/schema/fields.json` (shape: `{ "fields": [RuntimeFieldDefinition...] }`). Each custom field dynamically registers a CLI flag on create/update (and any other commands you list) so projects can capture typed project-specific metadata without hand-editing JSON. It is an idempotent UPSERT keyed on the normalized key, and refuses keys that shadow a built-in field. `list-fields` / `show-field <key>` inspect registered fields; `remove-field <key>` drops one and WARNS (non-blocking) with `items_using_field:<N>` when items still carry a value. See [CONFIGURATION.md](CONFIGURATION.md) for the full `schema/fields.json` format.
|
|
752
754
|
- `apply-preset <agile|ops|research>` batch-registers a domain type preset into an already-initialized project (the same vocabulary `pm init --type-preset` seeds); it is idempotent (re-running reports `replaced` entries) and shares its definitions with init.
|
|
@@ -856,6 +858,8 @@ Agents should use runtime contracts instead of hard-coding flag lists. Contract
|
|
|
856
858
|
|
|
857
859
|
## Completion
|
|
858
860
|
|
|
861
|
+
`pm completion` is provided by the optional `guide-shell` package (`pm install guide-shell --project`).
|
|
862
|
+
|
|
859
863
|
```bash
|
|
860
864
|
pm completion bash
|
|
861
865
|
pm completion zsh
|
package/docs/CONFIGURATION.md
CHANGED
|
@@ -168,7 +168,7 @@ pm get <id> --full --json
|
|
|
168
168
|
pm contracts --json
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
`pm calendar` defaults to markdown because date-centric summaries are easier to scan in that format.
|
|
171
|
+
`pm calendar` (provided by the optional `calendar` package — `pm install calendar --project`) defaults to markdown because date-centric summaries are easier to scan in that format.
|
|
172
172
|
|
|
173
173
|
## Validation Policies
|
|
174
174
|
|