@unbrained/pm-cli 2026.6.30 → 2026.7.1
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/AGENTS.md +2 -0
- package/CHANGELOG.md +20 -0
- package/dist/cli/bootstrap-args.js +89 -79
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/calendar.js +63 -62
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/create.js +483 -434
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.js +59 -46
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/doctor.js +129 -78
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/managed-state.js +101 -57
- package/dist/cli/commands/extension/managed-state.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.d.ts +7 -0
- package/dist/cli/commands/extension/scaffold.js +214 -186
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +6 -1
- package/dist/cli/commands/extension.js +1034 -902
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/list-filter-shared.js +55 -48
- package/dist/cli/commands/list-filter-shared.js.map +1 -1
- package/dist/cli/commands/search.js +94 -68
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.js +108 -122
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update.js +27 -77
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/extension-command-options.js +48 -21
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/registration-helpers.js +117 -122
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +16 -0
- package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-DBLQVIP6.js} +9 -9
- package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-JTEF4BP7.js} +9 -9
- package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SDF7DUOD.js} +9 -9
- package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-LOVPGVPT.js} +6 -6
- package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-QCFJSDFL.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-22WKIL3H.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-2466X6E4.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-27BXPBAY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-2D4HATP2.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-3J6JRJ3I.js} +127 -125
- package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-3K2M5OYU.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-3S2KT7NG.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-3VGN2UWE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-3XZCOZ5J.js} +107 -117
- package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4A3BJ675.js +799 -0
- package/dist/cli-bundle/chunks/chunk-4A3BJ675.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-4DSGXSBL.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-4DUVCVLZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-4XOIEKSD.js} +351 -330
- package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-55SNVXRQ.js} +68 -69
- package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-5CGRF3L5.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-5QFDBI4F.js} +1105 -965
- package/dist/cli-bundle/chunks/chunk-5QFDBI4F.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-64HNBBFQ.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-6AQZPVHQ.js} +198 -189
- package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-7R4QEMZZ.js} +361 -322
- package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-A7FPBAQS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-AVEE5EHK.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-AXIDKKAT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-BDTISOSD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-BHO33VBQ.js} +509 -363
- package/dist/cli-bundle/chunks/chunk-BHO33VBQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-BZCEN4JA.js} +98 -74
- package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-CF7RL6FR.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-CWFNTKQJ.js} +128 -126
- package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-DDPTYJIM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-EJUDVUYZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-EVMTBV6V.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-FFMQB7WR.js} +99 -75
- package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-G7I7DEZA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-GJ326ZKX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-HPPFYYOV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-HXTQJXWT.js} +150 -224
- package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-HYTGA6GI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-HZZEHPRG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-IJYK2T43.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-IPYBJWTE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-IZBR4NRW.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-JLM7BHI7.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-JMP4E6D7.js} +106 -116
- package/dist/cli-bundle/chunks/chunk-JMP4E6D7.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-JPECA746.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-JSU5P7VS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-JWXRETDF.js} +69 -70
- package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-KNPEF7QG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-L5OEFZQG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-LB6TP6MC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-MAUKX7JC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-MDPEOIGN.js} +150 -224
- package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-N74UMG5H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-NFDPYAIP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-NKZAN7BD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-NOLPZMSV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-NU2UEROZ.js} +1103 -963
- package/dist/cli-bundle/chunks/chunk-NU2UEROZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-NUHHPVVS.js} +36 -86
- package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-NWMZWYYB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-OGXLACHC.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-OTUHB4HS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-QCWF6IYD.js} +510 -364
- package/dist/cli-bundle/chunks/chunk-QCWF6IYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-RGEMWD6Q.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js +809 -0
- package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-RLDHZHQS.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-RMMQ74TG.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-RVUALSJF.js} +361 -322
- package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-SDR5J34Q.js} +198 -189
- package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-SLMUGTK3.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-TP5Q5ZD3.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-UYUYDGIB.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-UZIWVBE6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-V3NOKJF2.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-VARHOHYV.js} +350 -329
- package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-VICZWYGZ.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-W4ULYO7Z.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-WYDHYJPO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-YITK2PJ6.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-ZETXE4SE.js} +37 -87
- package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-ZRP4VG5U.js} +2 -2
- package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-EMQLYPRW.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-T3GCKV7C.js} +8 -8
- package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +14 -0
- package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-TQYAAFJP.js} +7 -7
- package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-BG5QQIDQ.js} +15 -15
- package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-LDRVEQY2.js} +15 -15
- package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-QCKR2YY2.js} +8 -8
- package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-YUXJRZPQ.js} +8 -8
- package/dist/cli-bundle/chunks/{config-FIXJZEQK.js → config-DMSU64QO.js} +7 -7
- package/dist/cli-bundle/chunks/{config-X3ZVCUUG.js → config-QH2DICD6.js} +7 -7
- package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-B6275WPX.js} +12 -12
- package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-OCZ3FJ4Z.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-HN7ABKLP.js} +3 -3
- package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-W4FZVVD6.js} +3 -3
- package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-BTJOSKKT.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-DEM4DATS.js} +5 -5
- package/dist/cli-bundle/chunks/create-OH3BDGBB.js +28 -0
- package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-RLRJMRTM.js} +12 -12
- package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-BHK7VB2Z.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-LSVHAB4Y.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-4UDFJRUA.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-XHYXWEPT.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-26S44RXU.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-GYZNVS26.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-PGRVIJQU.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-UYF3ZPVO.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-CPSLJQVE.js} +11 -10
- package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-CXJ6RELI.js} +11 -10
- package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-MBNICQFM.js} +7 -7
- package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-NQHEXUZD.js} +7 -7
- package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-DWYIG7GU.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-XZW5423D.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-7GQYOS2G.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-LPVMKJQJ.js} +3 -3
- package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-A7MAOHCU.js} +9 -9
- package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-DSDEKJ3L.js} +9 -9
- package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-3IPFLKXB.js} +17 -16
- package/dist/cli-bundle/chunks/{health-Q66C43GN.js.map → health-3IPFLKXB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-GZXGBZ36.js} +15 -14
- package/dist/cli-bundle/chunks/{health-FBCVZGSX.js.map → health-GZXGBZ36.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-NERDJNUB.js} +8 -8
- package/dist/cli-bundle/chunks/history-WSZHY3PN.js +18 -0
- package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-2WRZ2WK4.js} +10 -10
- package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HR7BB4LR.js} +10 -10
- package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-O3NBCNWC.js} +9 -9
- package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-LCMOS45X.js} +10 -10
- package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-XA3LC4GA.js} +10 -10
- package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-64XDLQJB.js} +12 -11
- package/dist/cli-bundle/chunks/init-PAX32BJA.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-JR6MA5TI.js} +8 -8
- package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-LPKCSJX7.js} +8 -8
- package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-DNBJVO3E.js} +8 -8
- package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-G5Y65VF6.js} +8 -8
- package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-BCERKDUR.js} +13 -13
- package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-FYTQF6HG.js} +13 -13
- package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-2BMU3VVQ.js} +8 -8
- package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-6KTGO2OJ.js} +8 -8
- package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-4WXEQCTN.js} +12 -12
- package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-RKZHQVXR.js} +12 -12
- package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-4OMM32CD.js} +8 -8
- package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-QLER5ENE.js} +8 -8
- package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-7LV46VAU.js} +18 -18
- package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-SNG5PGA4.js} +18 -18
- package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-ENNDUAZG.js} +35 -35
- package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KK7PHYYU.js} +35 -35
- package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-C6OWLDSH.js} +30 -30
- package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-HZ6XERQG.js} +30 -30
- package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-P67EMBDJ.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZKJ53RS7.js} +15 -15
- package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4MHZFJ2E.js} +9 -9
- package/dist/cli-bundle/chunks/restore-YALDGTQR.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-LB6DOLRL.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-UTOYKLXQ.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-73HR2OJW.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-U6LJKSIR.js} +7 -7
- package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-AXPXKZER.js} +10 -10
- package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-KILGT37L.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-PSYVVTNZ.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-W5KNVJWQ.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-BZUF6H7G.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-GAHHQTOS.js} +4 -4
- package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-ACD52Z3S.js} +15 -14
- package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-PWDIZ255.js} +15 -14
- package/dist/cli-bundle/chunks/{test-all-XLPI4USF.js → test-all-L2MDDUCA.js} +17 -16
- package/dist/cli-bundle/chunks/{test-all-XLPI4USF.js.map → test-all-L2MDDUCA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-PZTBLLQ6.js → test-all-RBZ6DLU2.js} +15 -14
- package/dist/cli-bundle/chunks/{test-all-PZTBLLQ6.js.map → test-all-RBZ6DLU2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-PLRAZEFW.js} +4 -4
- package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-UXIXPDKU.js} +4 -4
- package/dist/cli-bundle/chunks/update-AMRSOIWP.js +24 -0
- package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-KFX2SIAC.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-RNSBX2TA.js} +23 -23
- package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-Z5GJS5LC.js} +23 -23
- package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-BRL6KCOJ.js} +13 -12
- package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-BRL6KCOJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-HAK6JG2O.js} +11 -10
- package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-HAK6JG2O.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-MTUVL5VC.js} +20 -19
- package/dist/cli-bundle/chunks/{validate-2G566PKQ.js.map → validate-MTUVL5VC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-X5W76YJL.js} +22 -21
- package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js.map → validate-X5W76YJL.js.map} +1 -1
- package/dist/cli-bundle/main.js +55 -702
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/extensions/activation-summary-markdown.js +23 -12
- package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
- package/dist/core/extensions/extension-policy.d.ts +18 -3
- package/dist/core/extensions/extension-policy.js +116 -106
- package/dist/core/extensions/extension-policy.js.map +1 -1
- package/dist/core/extensions/loader.js +310 -232
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/item/item-format.js +523 -410
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/mcp/server.js +387 -367
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +76 -45
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/compose.d.ts +4 -1
- package/dist/sdk/compose.js +181 -115
- package/dist/sdk/compose.js.map +1 -1
- package/docs/RELEASING.md +2 -3
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
- package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
- package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
- package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
- package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
- package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
- package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
- package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
- package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
- package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
- package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
- package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
- package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
- /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-AW6XVFH6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-DBLQVIP6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js.map → aggregate-JTEF4BP7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SDF7DUOD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-LOVPGVPT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-QCFJSDFL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-22WKIL3H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-2466X6E4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-27BXPBAY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js.map → chunk-2D4HATP2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-3K2M5OYU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js.map → chunk-3S2KT7NG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js.map → chunk-3VGN2UWE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js.map → chunk-4DSGXSBL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-4DUVCVLZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js.map → chunk-5CGRF3L5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-64HNBBFQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-A7FPBAQS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-AVEE5EHK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-AXIDKKAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js.map → chunk-BDTISOSD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js.map → chunk-CF7RL6FR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-DDPTYJIM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-EJUDVUYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-EVMTBV6V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-G7I7DEZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-GJ326ZKX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-HPPFYYOV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-HYTGA6GI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-HZZEHPRG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-IJYK2T43.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js.map → chunk-IPYBJWTE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js.map → chunk-IZBR4NRW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-JLM7BHI7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-JPECA746.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js.map → chunk-JSU5P7VS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js.map → chunk-KNPEF7QG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-L5OEFZQG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-LB6TP6MC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-MAUKX7JC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-N74UMG5H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js.map → chunk-NFDPYAIP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-NKZAN7BD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-NOLPZMSV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js.map → chunk-NWMZWYYB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-OGXLACHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js.map → chunk-OTUHB4HS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js.map → chunk-RGEMWD6Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js.map → chunk-RLDHZHQS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js.map → chunk-RMMQ74TG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-SLMUGTK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js.map → chunk-TP5Q5ZD3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js.map → chunk-UYUYDGIB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-UZIWVBE6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JTRKME24.js.map → chunk-V3NOKJF2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-VICZWYGZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-W4ULYO7Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-WYDHYJPO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js.map → chunk-YITK2PJ6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-ZRP4VG5U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-EMQLYPRW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-T3GCKV7C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-E6ZZGCJY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-TQYAAFJP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js.map → close-many-BG5QQIDQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js.map → close-many-LDRVEQY2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-QCKR2YY2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-YUXJRZPQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-FIXJZEQK.js.map → config-DMSU64QO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-X3ZVCUUG.js.map → config-QH2DICD6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-B6275WPX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-OCZ3FJ4Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js.map → contracts-HN7ABKLP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js.map → contracts-W4FZVVD6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-BTJOSKKT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-DEM4DATS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-OH3BDGBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-RLRJMRTM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-BHK7VB2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-LSVHAB4Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-4UDFJRUA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-XHYXWEPT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-26S44RXU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-GYZNVS26.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-PGRVIJQU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-UYF3ZPVO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-CPSLJQVE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-CXJ6RELI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-MBNICQFM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-NQHEXUZD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-DWYIG7GU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-XZW5423D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-7GQYOS2G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-LPVMKJQJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-AWK324RS.js.map → get-A7MAOHCU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-VYPIICPC.js.map → get-DSDEKJ3L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-NERDJNUB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-WSZHY3PN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js.map → history-compact-2WRZ2WK4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js.map → history-compact-HR7BB4LR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-MP6CH7U5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-O3NBCNWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js.map → history-repair-LCMOS45X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js.map → history-repair-XA3LC4GA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-64XDLQJB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-PAX32BJA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-JR6MA5TI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-LPKCSJX7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-DNBJVO3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-G5Y65VF6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{next-66BJB4N2.js.map → next-BCERKDUR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{next-N5MWJTBY.js.map → next-FYTQF6HG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-2BMU3VVQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-6KTGO2OJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js.map → plan-4WXEQCTN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js.map → plan-RKZHQVXR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-4OMM32CD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-QLER5ENE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js.map → register-list-query-7LV46VAU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js.map → register-list-query-SNG5PGA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js.map → register-mutation-ENNDUAZG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js.map → register-mutation-KK7PHYYU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js.map → register-operations-C6OWLDSH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js.map → register-operations-HZ6XERQG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js.map → register-setup-P67EMBDJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js.map → register-setup-ZKJ53RS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4MHZFJ2E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-YALDGTQR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-LB6DOLRL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-UTOYKLXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-73HR2OJW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-U6LJKSIR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-AXPXKZER.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-KILGT37L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-PSYVVTNZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-W5KNVJWQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js.map → telemetry-BZUF6H7G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js.map → telemetry-GAHHQTOS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-ACD52Z3S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-PWDIZ255.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js.map → test-runs-PLRAZEFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js.map → test-runs-UXIXPDKU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-AMRSOIWP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-KFX2SIAC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-RNSBX2TA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-Z5GJS5LC.js.map} +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bfb4fc80-65a7-5c83-b180-b171fcfa4f33")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
splitCommaList
|
|
5
5
|
} from "./chunk-P4SESZGT.js";
|
|
6
6
|
import {
|
|
7
7
|
ensureTypeFolderScaffold
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2D4HATP2.js";
|
|
9
9
|
import {
|
|
10
10
|
buildExtensionDescribeResult,
|
|
11
11
|
scaffoldExtensionProject
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6AQZPVHQ.js";
|
|
13
13
|
import {
|
|
14
14
|
normalizeExtensionNameForMatch,
|
|
15
15
|
normalizeManagedDirectoryName,
|
|
16
16
|
normalizeStringList,
|
|
17
17
|
parseExtensionManifest,
|
|
18
18
|
validateExtensionDirectory
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-4A3BJ675.js";
|
|
20
20
|
import {
|
|
21
21
|
nowIso
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-AXIDKKAT.js";
|
|
23
23
|
import {
|
|
24
24
|
EXIT_CODE,
|
|
25
25
|
EXTENSION_CAPABILITY_CONTRACT,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
resolvePmPackageRootFromModule,
|
|
41
41
|
resolvePmRoot,
|
|
42
42
|
writeSettings
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-7R4QEMZZ.js";
|
|
44
44
|
|
|
45
45
|
// dist/cli/commands/extension.js
|
|
46
46
|
import { execFile as execFile2 } from "node:child_process";
|
|
@@ -92,6 +92,63 @@ function managedExtensionSourcesEquivalent(left, right) {
|
|
|
92
92
|
}
|
|
93
93
|
return true;
|
|
94
94
|
}
|
|
95
|
+
function optionalString(value) {
|
|
96
|
+
return typeof value === "string" ? value : void 0;
|
|
97
|
+
}
|
|
98
|
+
function hasRequiredManagedRecordFields(entry) {
|
|
99
|
+
return typeof entry.name === "string" && entry.name.trim().length > 0 && typeof entry.directory === "string" && entry.directory.trim().length > 0 && (entry.scope === "project" || entry.scope === "global") && typeof entry.manifest_version === "string" && typeof entry.manifest_entry === "string" && Array.isArray(entry.capabilities) && entry.capabilities.every((value) => typeof value === "string") && typeof entry.installed_at === "string" && typeof entry.updated_at === "string";
|
|
100
|
+
}
|
|
101
|
+
function normalizeManagedSource(raw) {
|
|
102
|
+
if (typeof raw !== "object" || raw === null) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const source = raw;
|
|
106
|
+
if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
kind: source.kind,
|
|
111
|
+
input: source.input,
|
|
112
|
+
location: source.location,
|
|
113
|
+
name: optionalString(source.name),
|
|
114
|
+
package: optionalString(source.package),
|
|
115
|
+
version: optionalString(source.version),
|
|
116
|
+
repository: optionalString(source.repository),
|
|
117
|
+
owner: optionalString(source.owner),
|
|
118
|
+
repo: optionalString(source.repo),
|
|
119
|
+
ref: optionalString(source.ref),
|
|
120
|
+
subpath: optionalString(source.subpath),
|
|
121
|
+
commit: optionalString(source.commit)
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function normalizeManagedRecord(raw) {
|
|
125
|
+
if (typeof raw !== "object" || raw === null) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
const entry = raw;
|
|
129
|
+
if (!hasRequiredManagedRecordFields(entry)) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const source = normalizeManagedSource(entry.source);
|
|
133
|
+
if (!source) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
name: entry.name.trim(),
|
|
138
|
+
directory: entry.directory.trim(),
|
|
139
|
+
scope: entry.scope,
|
|
140
|
+
manifest_version: entry.manifest_version,
|
|
141
|
+
manifest_entry: entry.manifest_entry,
|
|
142
|
+
capabilities: normalizeStringList(entry.capabilities),
|
|
143
|
+
installed_at: entry.installed_at,
|
|
144
|
+
updated_at: entry.updated_at,
|
|
145
|
+
source,
|
|
146
|
+
last_update_check_at: optionalString(entry.last_update_check_at),
|
|
147
|
+
last_update_remote_commit: optionalString(entry.last_update_remote_commit),
|
|
148
|
+
update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
|
|
149
|
+
update_error: optionalString(entry.update_error)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
95
152
|
function normalizeManagedState(raw) {
|
|
96
153
|
if (typeof raw !== "object" || raw === null) {
|
|
97
154
|
return null;
|
|
@@ -102,49 +159,14 @@ function normalizeManagedState(raw) {
|
|
|
102
159
|
}
|
|
103
160
|
const entries = [];
|
|
104
161
|
for (const rawEntry of candidate.entries) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const entry = rawEntry;
|
|
109
|
-
if (typeof entry.name !== "string" || entry.name.trim().length === 0 || typeof entry.directory !== "string" || entry.directory.trim().length === 0 || entry.scope !== "project" && entry.scope !== "global" || typeof entry.manifest_version !== "string" || typeof entry.manifest_entry !== "string" || !Array.isArray(entry.capabilities) || entry.capabilities.some((value) => typeof value !== "string") || typeof entry.installed_at !== "string" || typeof entry.updated_at !== "string" || typeof entry.source !== "object" || entry.source === null) {
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
const source = entry.source;
|
|
113
|
-
if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
|
|
114
|
-
continue;
|
|
162
|
+
const record = normalizeManagedRecord(rawEntry);
|
|
163
|
+
if (record) {
|
|
164
|
+
entries.push(record);
|
|
115
165
|
}
|
|
116
|
-
entries.push({
|
|
117
|
-
name: entry.name.trim(),
|
|
118
|
-
directory: entry.directory.trim(),
|
|
119
|
-
scope: entry.scope,
|
|
120
|
-
manifest_version: entry.manifest_version,
|
|
121
|
-
manifest_entry: entry.manifest_entry,
|
|
122
|
-
capabilities: normalizeStringList(entry.capabilities),
|
|
123
|
-
installed_at: entry.installed_at,
|
|
124
|
-
updated_at: entry.updated_at,
|
|
125
|
-
source: {
|
|
126
|
-
kind: source.kind,
|
|
127
|
-
input: source.input,
|
|
128
|
-
location: source.location,
|
|
129
|
-
name: typeof source.name === "string" ? source.name : void 0,
|
|
130
|
-
package: typeof source.package === "string" ? source.package : void 0,
|
|
131
|
-
version: typeof source.version === "string" ? source.version : void 0,
|
|
132
|
-
repository: typeof source.repository === "string" ? source.repository : void 0,
|
|
133
|
-
owner: typeof source.owner === "string" ? source.owner : void 0,
|
|
134
|
-
repo: typeof source.repo === "string" ? source.repo : void 0,
|
|
135
|
-
ref: typeof source.ref === "string" ? source.ref : void 0,
|
|
136
|
-
subpath: typeof source.subpath === "string" ? source.subpath : void 0,
|
|
137
|
-
commit: typeof source.commit === "string" ? source.commit : void 0
|
|
138
|
-
},
|
|
139
|
-
last_update_check_at: typeof entry.last_update_check_at === "string" ? entry.last_update_check_at : void 0,
|
|
140
|
-
last_update_remote_commit: typeof entry.last_update_remote_commit === "string" ? entry.last_update_remote_commit : void 0,
|
|
141
|
-
update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
|
|
142
|
-
update_error: typeof entry.update_error === "string" ? entry.update_error : void 0
|
|
143
|
-
});
|
|
144
166
|
}
|
|
145
167
|
return {
|
|
146
168
|
version: MANAGED_EXTENSION_STATE_VERSION,
|
|
147
|
-
updated_at:
|
|
169
|
+
updated_at: optionalString(candidate.updated_at) ?? nowIso(),
|
|
148
170
|
entries: sortManagedEntries(entries)
|
|
149
171
|
};
|
|
150
172
|
}
|
|
@@ -1065,6 +1087,42 @@ async function resolveBundledAliasManifestName(input) {
|
|
|
1065
1087
|
return null;
|
|
1066
1088
|
}
|
|
1067
1089
|
}
|
|
1090
|
+
function buildBundledCatalogLinks(manifest) {
|
|
1091
|
+
return {
|
|
1092
|
+
docs: manifest.catalog?.links?.docs ?? manifest.package_homepage,
|
|
1093
|
+
npm: manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0),
|
|
1094
|
+
repository: manifest.catalog?.links?.repository ?? manifest.package_repository_url,
|
|
1095
|
+
report: manifest.catalog?.links?.report ?? manifest.package_bugs_url
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
function buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations) {
|
|
1099
|
+
const installScopeFlag = scope === "global" ? "--global" : "--project";
|
|
1100
|
+
const metadataOnlyResources = Object.fromEntries(PM_PACKAGE_RESOURCE_KINDS.filter((resourceKind) => resourceKind !== "extensions").map((resourceKind) => [resourceKind, manifest.resources[resourceKind] ?? []]).filter(([, entries]) => Array.isArray(entries) && entries.length > 0));
|
|
1101
|
+
return {
|
|
1102
|
+
alias: bundledEntry.alias,
|
|
1103
|
+
bundled: true,
|
|
1104
|
+
available: true,
|
|
1105
|
+
installed: installedBuiltinAliases.has(bundledEntry.alias) || installedLocations.has(path4.resolve(bundledEntry.package_root)),
|
|
1106
|
+
install_target: bundledEntry.alias,
|
|
1107
|
+
install_command: `pm install ${bundledEntry.alias} ${installScopeFlag}`,
|
|
1108
|
+
package_name: manifest.package_name,
|
|
1109
|
+
package_version: manifest.package_version,
|
|
1110
|
+
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
1111
|
+
keywords: manifest.package_keywords ?? [],
|
|
1112
|
+
resources: manifest.resources,
|
|
1113
|
+
installable_resources: {
|
|
1114
|
+
extensions: manifest.resources.extensions ?? []
|
|
1115
|
+
},
|
|
1116
|
+
metadata_only_resources: metadataOnlyResources,
|
|
1117
|
+
catalog: {
|
|
1118
|
+
display_name: manifest.catalog?.display_name,
|
|
1119
|
+
category: manifest.catalog?.category,
|
|
1120
|
+
tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
|
|
1121
|
+
links: buildBundledCatalogLinks(manifest),
|
|
1122
|
+
media: manifest.catalog?.media
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1068
1126
|
async function buildBundledPackageCatalog(scope, global, options = {}) {
|
|
1069
1127
|
const roots = resolveExtensionRoots(resolvePmRoot(process.cwd(), global.path), process.cwd());
|
|
1070
1128
|
const selectedRoot = scope === "global" ? roots.global : roots.project;
|
|
@@ -1073,44 +1131,8 @@ async function buildBundledPackageCatalog(scope, global, options = {}) {
|
|
|
1073
1131
|
const installedBuiltinAliases = new Set(managedStateRead.state.entries.filter((entry) => entry.scope === scope && entry.source.kind === "builtin").flatMap((entry) => [entry.source.name, entry.source.input, entry.source.location]).filter((value) => typeof value === "string" && value.trim().length > 0).map((value) => value.trim().toLowerCase()));
|
|
1074
1132
|
const packages = [];
|
|
1075
1133
|
for (const bundledEntry of await collectBundledPackageEntries()) {
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
const installScopeFlag = scope === "global" ? "--global" : "--project";
|
|
1079
|
-
const manifest = await readPmPackageManifest(packageRoot);
|
|
1080
|
-
const repository = manifest.catalog?.links?.repository ?? manifest.package_repository_url;
|
|
1081
|
-
const report = manifest.catalog?.links?.report ?? manifest.package_bugs_url;
|
|
1082
|
-
const docs = manifest.catalog?.links?.docs ?? manifest.package_homepage;
|
|
1083
|
-
const npm = manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0);
|
|
1084
|
-
const metadataOnlyResources = Object.fromEntries(PM_PACKAGE_RESOURCE_KINDS.filter((resourceKind) => resourceKind !== "extensions").map((resourceKind) => [resourceKind, manifest.resources[resourceKind] ?? []]).filter(([, entries]) => Array.isArray(entries) && entries.length > 0));
|
|
1085
|
-
packages.push({
|
|
1086
|
-
alias,
|
|
1087
|
-
bundled: true,
|
|
1088
|
-
available: true,
|
|
1089
|
-
installed: installedBuiltinAliases.has(alias) || installedLocations.has(path4.resolve(packageRoot)),
|
|
1090
|
-
install_target: alias,
|
|
1091
|
-
install_command: `pm install ${alias} ${installScopeFlag}`,
|
|
1092
|
-
package_name: manifest.package_name,
|
|
1093
|
-
package_version: manifest.package_version,
|
|
1094
|
-
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
1095
|
-
keywords: manifest.package_keywords ?? [],
|
|
1096
|
-
resources: manifest.resources,
|
|
1097
|
-
installable_resources: {
|
|
1098
|
-
extensions: manifest.resources.extensions ?? []
|
|
1099
|
-
},
|
|
1100
|
-
metadata_only_resources: metadataOnlyResources,
|
|
1101
|
-
catalog: {
|
|
1102
|
-
display_name: manifest.catalog?.display_name,
|
|
1103
|
-
category: manifest.catalog?.category,
|
|
1104
|
-
tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
|
|
1105
|
-
links: {
|
|
1106
|
-
docs,
|
|
1107
|
-
npm,
|
|
1108
|
-
repository,
|
|
1109
|
-
report
|
|
1110
|
-
},
|
|
1111
|
-
media: manifest.catalog?.media
|
|
1112
|
-
}
|
|
1113
|
-
});
|
|
1134
|
+
const manifest = await readPmPackageManifest(bundledEntry.package_root);
|
|
1135
|
+
packages.push(buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations));
|
|
1114
1136
|
}
|
|
1115
1137
|
const fields = parsePackageCatalogFields(options.fields);
|
|
1116
1138
|
const outputPackages = fields ? packages.map((entry) => projectPackageCatalogEntry(entry, fields)) : packages;
|
|
@@ -1426,6 +1448,98 @@ function classifyUnusedCapabilityWarnings(loadResult, activationResult) {
|
|
|
1426
1448
|
}
|
|
1427
1449
|
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1428
1450
|
}
|
|
1451
|
+
var TRIAGE_REMEDIATION_RULES = [
|
|
1452
|
+
{
|
|
1453
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manifest_")),
|
|
1454
|
+
build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "explore")} ${ctx.scopeFlag} to inspect discovered manifests and directories.`
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unknown:")),
|
|
1458
|
+
build: () => `Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:")),
|
|
1462
|
+
build: () => "Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema)."
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_missing:")),
|
|
1466
|
+
build: (ctx) => `Extension activation failed because code registered a surface missing from manifest capabilities. Run ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag} --detail deep --trace and add the reported missing_capability to manifest.json before publishing.`
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unused:")),
|
|
1470
|
+
build: (ctx) => `Extension manifests declare capabilities that are never registered against. Remove each reported unused capability from manifest.json to keep least privilege, or add the matching registration. Run ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag} --detail deep --trace for per-extension registration counts.`
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:")),
|
|
1474
|
+
build: () => "Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility."
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:")),
|
|
1478
|
+
build: () => "Global output service/renderer overrides are active. For output_format, return context.payload/null/undefined unless the extension owns the command. For renderers, return null for unrelated payloads so pm falls back to native rendering."
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_schema_narrow_activation:")),
|
|
1482
|
+
build: () => "A package registers custom item types/fields (a GLOBAL schema contribution) but also declares narrow activation.commands, so it never activates for built-in commands like pm create <type> and the custom type silently fails to register. Remove activation.commands from manifest.json so pm activates the package for every command, or \u2014 if the schema is intentionally command-scoped \u2014 knowingly ignore this advisory."
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:")),
|
|
1486
|
+
build: (ctx) => `Detected extension load failures caused by missing SDK dependency resolution. Ensure extension package dependencies include "@unbrained/pm-cli" and reinstall dependencies before running ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:")),
|
|
1490
|
+
build: (ctx) => `Detected extension module-mode mismatches. For ESM-based extension entries/imports, set package.json "type": "module" or use an explicit .mjs entry and rerun ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_")),
|
|
1494
|
+
build: (ctx) => `Extension pm version-bound warnings detected. Align each package manifest's pm_min_version/pm_max_version with the installed pm CLI version (see the warning's required/allowed=...:current=... details), or upgrade/downgrade the pm CLI to satisfy the declared bounds, then rerun ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
matches: (_warnings, ctx) => ctx.updateCheckFailedTotal > 0,
|
|
1498
|
+
build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "manage")} ${ctx.scopeFlag} after validating network and repository access.`
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manager_state_")),
|
|
1502
|
+
build: (ctx) => `Review and repair ${ctx.scope} managed extension state file if schema/read warnings persist.`
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
matches: (_warnings, ctx) => ctx.policyWarningCount > 0,
|
|
1506
|
+
build: () => "Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces."
|
|
1507
|
+
}
|
|
1508
|
+
];
|
|
1509
|
+
function buildExtensionTriageRemediation(params) {
|
|
1510
|
+
const { normalizedWarnings, options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount, updateHealthPartial, skippedUnmanagedTotal, skippedNonGithubTotal, updateAvailableTotal } = params;
|
|
1511
|
+
const remediation = [];
|
|
1512
|
+
const ctx = { options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount };
|
|
1513
|
+
if (normalizedWarnings.length > 0) {
|
|
1514
|
+
const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
|
|
1515
|
+
deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
|
|
1516
|
+
doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
|
|
1517
|
+
});
|
|
1518
|
+
if (registrationCollisionRemediation) {
|
|
1519
|
+
remediation.push(registrationCollisionRemediation);
|
|
1520
|
+
}
|
|
1521
|
+
for (const rule of TRIAGE_REMEDIATION_RULES) {
|
|
1522
|
+
if (rule.matches(normalizedWarnings, ctx)) {
|
|
1523
|
+
remediation.push(rule.build(ctx));
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
if (updateHealthPartial) {
|
|
1528
|
+
remediation.push(`Update-check coverage is partial because unmanaged extensions need adoption. Adopt existing installs via ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state (or ${lifecycleFlagCommand(options, "adopt-all")} ${scopeFlag}, ${lifecycleFlagCommand(options, "adopt")} <name> ${scopeFlag}, or reinstall via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>).`);
|
|
1529
|
+
} else if (skippedUnmanagedTotal > 0) {
|
|
1530
|
+
remediation.push(`Loaded unmanaged extensions are currently treated as informational. Use ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state to adopt them for update checks.`);
|
|
1531
|
+
}
|
|
1532
|
+
if (skippedNonGithubTotal > 0) {
|
|
1533
|
+
remediation.push(`Non-GitHub managed extensions are skipped by update checks. Use doctor output for non-update diagnostics.`);
|
|
1534
|
+
}
|
|
1535
|
+
if (updateAvailableTotal > 0) {
|
|
1536
|
+
remediation.push(`Update available managed extensions via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>.`);
|
|
1537
|
+
}
|
|
1538
|
+
if (remediation.length === 0) {
|
|
1539
|
+
remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
|
|
1540
|
+
}
|
|
1541
|
+
return remediation;
|
|
1542
|
+
}
|
|
1429
1543
|
function buildExtensionTriageSummary(scope, warnings, extensions, options = {}) {
|
|
1430
1544
|
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1431
1545
|
const managedTotal = extensions.filter((entry) => entry.managed).length;
|
|
@@ -1455,73 +1569,19 @@ function buildExtensionTriageSummary(scope, warnings, extensions, options = {})
|
|
|
1455
1569
|
const warningCodes = [...new Set(effectiveWarnings.map((value) => warningCode(value)))].sort((left, right) => left.localeCompare(right));
|
|
1456
1570
|
const policyWarnings = summarizePolicyWarnings(effectiveWarnings);
|
|
1457
1571
|
const scopeFlag = scope === "global" ? "--global" : "--project";
|
|
1458
|
-
const remediation = [];
|
|
1459
|
-
if (normalizedWarnings.length > 0) {
|
|
1460
|
-
const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
|
|
1461
|
-
deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
|
|
1462
|
-
doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
|
|
1463
|
-
});
|
|
1464
|
-
if (registrationCollisionRemediation) {
|
|
1465
|
-
remediation.push(registrationCollisionRemediation);
|
|
1466
|
-
}
|
|
1467
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_manifest_"))) {
|
|
1468
|
-
remediation.push(`Run ${lifecycleFlagCommand(options, "explore")} ${scopeFlag} to inspect discovered manifests and directories.`);
|
|
1469
|
-
}
|
|
1470
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unknown:"))) {
|
|
1471
|
-
remediation.push(`Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`);
|
|
1472
|
-
}
|
|
1473
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:"))) {
|
|
1474
|
-
remediation.push("Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema).");
|
|
1475
|
-
}
|
|
1476
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_missing:"))) {
|
|
1477
|
-
remediation.push(`Extension activation failed because code registered a surface missing from manifest capabilities. Run ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace and add the reported missing_capability to manifest.json before publishing.`);
|
|
1478
|
-
}
|
|
1479
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unused:"))) {
|
|
1480
|
-
remediation.push(`Extension manifests declare capabilities that are never registered against. Remove each reported unused capability from manifest.json to keep least privilege, or add the matching registration. Run ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace for per-extension registration counts.`);
|
|
1481
|
-
}
|
|
1482
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:"))) {
|
|
1483
|
-
remediation.push("Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility.");
|
|
1484
|
-
}
|
|
1485
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:"))) {
|
|
1486
|
-
remediation.push("Global output service/renderer overrides are active. For output_format, return context.payload/null/undefined unless the extension owns the command. For renderers, return null for unrelated payloads so pm falls back to native rendering.");
|
|
1487
|
-
}
|
|
1488
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_schema_narrow_activation:"))) {
|
|
1489
|
-
remediation.push("A package registers custom item types/fields (a GLOBAL schema contribution) but also declares narrow activation.commands, so it never activates for built-in commands like pm create <type> and the custom type silently fails to register. Remove activation.commands from manifest.json so pm activates the package for every command, or \u2014 if the schema is intentionally command-scoped \u2014 knowingly ignore this advisory.");
|
|
1490
|
-
}
|
|
1491
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:"))) {
|
|
1492
|
-
remediation.push(`Detected extension load failures caused by missing SDK dependency resolution. Ensure extension package dependencies include "@unbrained/pm-cli" and reinstall dependencies before running ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag}.`);
|
|
1493
|
-
}
|
|
1494
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:"))) {
|
|
1495
|
-
remediation.push(`Detected extension module-mode mismatches. For ESM-based extension entries/imports, set package.json "type": "module" or use an explicit .mjs entry and rerun ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag}.`);
|
|
1496
|
-
}
|
|
1497
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_"))) {
|
|
1498
|
-
remediation.push(`Extension pm version-bound warnings detected. Align each package manifest's pm_min_version/pm_max_version with the installed pm CLI version (see the warning's required/allowed=...:current=... details), or upgrade/downgrade the pm CLI to satisfy the declared bounds, then rerun ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag}.`);
|
|
1499
|
-
}
|
|
1500
|
-
if (updateCheckFailedTotal > 0) {
|
|
1501
|
-
remediation.push(`Run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after validating network and repository access.`);
|
|
1502
|
-
}
|
|
1503
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_manager_state_"))) {
|
|
1504
|
-
remediation.push(`Review and repair ${scope} managed extension state file if schema/read warnings persist.`);
|
|
1505
|
-
}
|
|
1506
|
-
if (policyWarnings.warning_count > 0) {
|
|
1507
|
-
remediation.push("Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces.");
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
1572
|
const collisionPlan = buildRegistrationCollisionPlan(scope, normalizedWarnings, extensions, options);
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
|
|
1524
|
-
}
|
|
1573
|
+
const remediation = buildExtensionTriageRemediation({
|
|
1574
|
+
normalizedWarnings,
|
|
1575
|
+
options,
|
|
1576
|
+
scope,
|
|
1577
|
+
scopeFlag,
|
|
1578
|
+
updateCheckFailedTotal,
|
|
1579
|
+
policyWarningCount: policyWarnings.warning_count,
|
|
1580
|
+
updateHealthPartial,
|
|
1581
|
+
skippedUnmanagedTotal,
|
|
1582
|
+
skippedNonGithubTotal,
|
|
1583
|
+
updateAvailableTotal
|
|
1584
|
+
});
|
|
1525
1585
|
return {
|
|
1526
1586
|
status: effectiveWarnings.length === 0 ? "ok" : "warn",
|
|
1527
1587
|
warning_count: effectiveWarnings.length,
|
|
@@ -1941,48 +2001,58 @@ function buildUnknownLifecycleActionError(target, options) {
|
|
|
1941
2001
|
}
|
|
1942
2002
|
});
|
|
1943
2003
|
}
|
|
2004
|
+
var EXTENSION_ACTION_FLAG_SELECTORS = [
|
|
2005
|
+
["install", "install"],
|
|
2006
|
+
["uninstall", "uninstall"],
|
|
2007
|
+
["explore", "explore"],
|
|
2008
|
+
["manage", "manage"],
|
|
2009
|
+
["describe", "describe"],
|
|
2010
|
+
["reload", "reload"],
|
|
2011
|
+
["doctor", "doctor"],
|
|
2012
|
+
["catalog", "catalog"],
|
|
2013
|
+
["init", "init"],
|
|
2014
|
+
["scaffold", "init"],
|
|
2015
|
+
["adopt", "adopt"],
|
|
2016
|
+
["adoptAll", "adopt-all"],
|
|
2017
|
+
["activate", "activate"],
|
|
2018
|
+
["deactivate", "deactivate"]
|
|
2019
|
+
];
|
|
2020
|
+
function resolveImplicitActionFromTarget(normalizedTarget) {
|
|
2021
|
+
if (normalizedTarget === "doctor") {
|
|
2022
|
+
return "doctor";
|
|
2023
|
+
}
|
|
2024
|
+
if (normalizedTarget === "reload") {
|
|
2025
|
+
return "reload";
|
|
2026
|
+
}
|
|
2027
|
+
if (normalizedTarget === "catalog") {
|
|
2028
|
+
return "catalog";
|
|
2029
|
+
}
|
|
2030
|
+
if (normalizedTarget === "init" || normalizedTarget === "scaffold") {
|
|
2031
|
+
return "init";
|
|
2032
|
+
}
|
|
2033
|
+
if (normalizedTarget === "explore") {
|
|
2034
|
+
return "explore";
|
|
2035
|
+
}
|
|
2036
|
+
if (normalizedTarget === "manage") {
|
|
2037
|
+
return "manage";
|
|
2038
|
+
}
|
|
2039
|
+
if (normalizedTarget === "list" || normalizedTarget === "") {
|
|
2040
|
+
return "explore";
|
|
2041
|
+
}
|
|
2042
|
+
return null;
|
|
2043
|
+
}
|
|
1944
2044
|
function resolveAction(target, options) {
|
|
1945
|
-
const selected = [
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
options.explore ? "explore" : null,
|
|
1949
|
-
options.manage ? "manage" : null,
|
|
1950
|
-
options.describe ? "describe" : null,
|
|
1951
|
-
options.reload ? "reload" : null,
|
|
1952
|
-
options.doctor ? "doctor" : null,
|
|
1953
|
-
options.catalog ? "catalog" : null,
|
|
1954
|
-
options.init ? "init" : null,
|
|
1955
|
-
options.scaffold ? "init" : null,
|
|
1956
|
-
options.adopt ? "adopt" : null,
|
|
1957
|
-
options.adoptAll ? "adopt-all" : null,
|
|
1958
|
-
options.activate ? "activate" : null,
|
|
1959
|
-
options.deactivate ? "deactivate" : null
|
|
1960
|
-
].filter((value) => value !== null))];
|
|
2045
|
+
const selected = [
|
|
2046
|
+
...new Set(EXTENSION_ACTION_FLAG_SELECTORS.filter(([flag]) => options[flag] === true).map(([, mappedAction]) => mappedAction))
|
|
2047
|
+
];
|
|
1961
2048
|
if (selected.length === 0) {
|
|
1962
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "doctor") {
|
|
1963
|
-
return "doctor";
|
|
1964
|
-
}
|
|
1965
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "reload") {
|
|
1966
|
-
return "reload";
|
|
1967
|
-
}
|
|
1968
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "catalog") {
|
|
1969
|
-
return "catalog";
|
|
1970
|
-
}
|
|
1971
|
-
if (typeof target === "string" && (target.trim().toLowerCase() === "init" || target.trim().toLowerCase() === "scaffold")) {
|
|
1972
|
-
return "init";
|
|
1973
|
-
}
|
|
1974
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "explore") {
|
|
1975
|
-
return "explore";
|
|
1976
|
-
}
|
|
1977
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "manage") {
|
|
1978
|
-
return "manage";
|
|
1979
|
-
}
|
|
1980
|
-
if (typeof target === "string" && (target.trim().toLowerCase() === "list" || target.trim() === "")) {
|
|
1981
|
-
return "explore";
|
|
1982
|
-
}
|
|
1983
2049
|
if (target === void 0) {
|
|
1984
2050
|
return "explore";
|
|
1985
2051
|
}
|
|
2052
|
+
const implicitAction = resolveImplicitActionFromTarget(target.trim().toLowerCase());
|
|
2053
|
+
if (implicitAction) {
|
|
2054
|
+
return implicitAction;
|
|
2055
|
+
}
|
|
1986
2056
|
throw buildUnknownLifecycleActionError(target, options);
|
|
1987
2057
|
}
|
|
1988
2058
|
if (selected.length > 1) {
|
|
@@ -2041,6 +2111,27 @@ function resolveUpdateCheckResolution(managedEntry) {
|
|
|
2041
2111
|
reason: "no_update_check_recorded"
|
|
2042
2112
|
};
|
|
2043
2113
|
}
|
|
2114
|
+
function buildInstalledExtensionSummary(identity, scope, managedEntry, updateCheck) {
|
|
2115
|
+
return {
|
|
2116
|
+
name: identity.name,
|
|
2117
|
+
directory: identity.directory,
|
|
2118
|
+
version: identity.version,
|
|
2119
|
+
entry: identity.entry,
|
|
2120
|
+
scope,
|
|
2121
|
+
active: identity.enabled,
|
|
2122
|
+
enabled: identity.enabled,
|
|
2123
|
+
runtime_active: null,
|
|
2124
|
+
activation_status: "unknown",
|
|
2125
|
+
managed: Boolean(managedEntry),
|
|
2126
|
+
source: managedEntry?.source,
|
|
2127
|
+
update_available: managedEntry?.update_available,
|
|
2128
|
+
last_update_check_at: managedEntry?.last_update_check_at,
|
|
2129
|
+
last_update_remote_commit: managedEntry?.last_update_remote_commit,
|
|
2130
|
+
update_error: managedEntry?.update_error,
|
|
2131
|
+
update_check_status: updateCheck.status,
|
|
2132
|
+
update_check_reason: updateCheck.reason
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2044
2135
|
async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
2045
2136
|
if (!await pathExists(extensionsRoot)) {
|
|
2046
2137
|
return {
|
|
@@ -2064,27 +2155,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
|
2064
2155
|
if (!await pathExists(manifestPath)) {
|
|
2065
2156
|
warnings.push(`extension_manifest_missing:${scope}:${directoryName}`);
|
|
2066
2157
|
const managedEntry2 = managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
|
|
2067
|
-
|
|
2068
|
-
const enabled2 = managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false;
|
|
2069
|
-
summaries.push({
|
|
2158
|
+
summaries.push(buildInstalledExtensionSummary({
|
|
2070
2159
|
name: managedEntry2?.name ?? directoryName,
|
|
2071
2160
|
directory: directoryName,
|
|
2072
2161
|
version: managedEntry2?.manifest_version ?? "unknown",
|
|
2073
2162
|
entry: managedEntry2?.manifest_entry ?? "unknown",
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
enabled: enabled2,
|
|
2077
|
-
runtime_active: null,
|
|
2078
|
-
activation_status: "unknown",
|
|
2079
|
-
managed: Boolean(managedEntry2),
|
|
2080
|
-
source: managedEntry2?.source,
|
|
2081
|
-
update_available: managedEntry2?.update_available,
|
|
2082
|
-
last_update_check_at: managedEntry2?.last_update_check_at,
|
|
2083
|
-
last_update_remote_commit: managedEntry2?.last_update_remote_commit,
|
|
2084
|
-
update_error: managedEntry2?.update_error,
|
|
2085
|
-
update_check_status: updateCheck2.status,
|
|
2086
|
-
update_check_reason: updateCheck2.reason
|
|
2087
|
-
});
|
|
2163
|
+
enabled: managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false
|
|
2164
|
+
}, scope, managedEntry2, resolveUpdateCheckResolution(managedEntry2)));
|
|
2088
2165
|
continue;
|
|
2089
2166
|
}
|
|
2090
2167
|
let rawManifest;
|
|
@@ -2100,27 +2177,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
|
2100
2177
|
continue;
|
|
2101
2178
|
}
|
|
2102
2179
|
const managedEntry = managedByName.get(normalizeExtensionNameForMatch(manifest.name)) ?? managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
|
|
2103
|
-
|
|
2104
|
-
const enabled = isExtensionEnabled(settings, manifest.name);
|
|
2105
|
-
summaries.push({
|
|
2180
|
+
summaries.push(buildInstalledExtensionSummary({
|
|
2106
2181
|
name: manifest.name,
|
|
2107
2182
|
directory: directoryName,
|
|
2108
2183
|
version: manifest.version,
|
|
2109
2184
|
entry: manifest.entry,
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
enabled,
|
|
2113
|
-
runtime_active: null,
|
|
2114
|
-
activation_status: "unknown",
|
|
2115
|
-
managed: Boolean(managedEntry),
|
|
2116
|
-
source: managedEntry?.source,
|
|
2117
|
-
update_available: managedEntry?.update_available,
|
|
2118
|
-
last_update_check_at: managedEntry?.last_update_check_at,
|
|
2119
|
-
last_update_remote_commit: managedEntry?.last_update_remote_commit,
|
|
2120
|
-
update_error: managedEntry?.update_error,
|
|
2121
|
-
update_check_status: updateCheck.status,
|
|
2122
|
-
update_check_reason: updateCheck.reason
|
|
2123
|
-
});
|
|
2185
|
+
enabled: isExtensionEnabled(settings, manifest.name)
|
|
2186
|
+
}, scope, managedEntry, resolveUpdateCheckResolution(managedEntry)));
|
|
2124
2187
|
}
|
|
2125
2188
|
return {
|
|
2126
2189
|
extensions: summaries.sort((left, right) => left.name.localeCompare(right.name)),
|
|
@@ -2399,46 +2462,63 @@ function collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResul
|
|
|
2399
2462
|
}
|
|
2400
2463
|
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
2401
2464
|
}
|
|
2402
|
-
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2465
|
+
function assertExtensionActionOptionScope(action, options) {
|
|
2466
|
+
const guards = [
|
|
2467
|
+
{
|
|
2468
|
+
triggered: options.strictExit === true || options.failOnWarn === true,
|
|
2469
|
+
allowed: action === "doctor",
|
|
2470
|
+
message: "--strict-exit and --fail-on-warn are only valid with --doctor."
|
|
2471
|
+
},
|
|
2472
|
+
{ triggered: options.trace === true, allowed: action === "doctor", message: "--trace is only valid with --doctor." },
|
|
2473
|
+
{ triggered: options.watch === true, allowed: action === "reload", message: "--watch is only valid with --reload." },
|
|
2474
|
+
{
|
|
2475
|
+
triggered: options.runtimeProbe === true,
|
|
2476
|
+
allowed: action === "manage",
|
|
2477
|
+
message: "--runtime-probe is only valid with --manage."
|
|
2478
|
+
},
|
|
2479
|
+
{
|
|
2480
|
+
triggered: options.fixManagedState === true,
|
|
2481
|
+
allowed: action === "manage" || action === "doctor",
|
|
2482
|
+
message: "--fix-managed-state is only valid with --manage or --doctor."
|
|
2483
|
+
},
|
|
2484
|
+
{
|
|
2485
|
+
triggered: options.capability !== void 0,
|
|
2486
|
+
allowed: action === "init",
|
|
2487
|
+
message: "--capability is only valid with --init/--scaffold."
|
|
2488
|
+
},
|
|
2489
|
+
{
|
|
2490
|
+
triggered: options.declarative === true,
|
|
2491
|
+
allowed: action === "init",
|
|
2492
|
+
message: "--declarative is only valid with --init/--scaffold."
|
|
2493
|
+
}
|
|
2494
|
+
];
|
|
2495
|
+
for (const guard of guards) {
|
|
2496
|
+
if (guard.triggered && !guard.allowed) {
|
|
2497
|
+
throw new PmCliError(guard.message, EXIT_CODE.USAGE);
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
function resolveNormalizedExtensionTarget(target, action, options) {
|
|
2502
|
+
const normalizedInput = target?.trim().toLowerCase();
|
|
2503
|
+
if (action === "doctor" && normalizedInput === "doctor") {
|
|
2504
|
+
return void 0;
|
|
2415
2505
|
}
|
|
2416
|
-
if (
|
|
2417
|
-
|
|
2506
|
+
if (action === "reload" && normalizedInput === "reload") {
|
|
2507
|
+
return void 0;
|
|
2418
2508
|
}
|
|
2419
|
-
if (
|
|
2420
|
-
|
|
2509
|
+
if (action === "catalog" && normalizedInput === "catalog") {
|
|
2510
|
+
return void 0;
|
|
2421
2511
|
}
|
|
2422
|
-
|
|
2423
|
-
|
|
2512
|
+
const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
|
|
2513
|
+
if (inferredInitAlias) {
|
|
2514
|
+
return void 0;
|
|
2424
2515
|
}
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
return void 0;
|
|
2432
|
-
}
|
|
2433
|
-
if (action === "catalog" && normalizedInput === "catalog") {
|
|
2434
|
-
return void 0;
|
|
2435
|
-
}
|
|
2436
|
-
const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
|
|
2437
|
-
if (inferredInitAlias) {
|
|
2438
|
-
return void 0;
|
|
2439
|
-
}
|
|
2440
|
-
return target;
|
|
2441
|
-
})();
|
|
2516
|
+
return target;
|
|
2517
|
+
}
|
|
2518
|
+
async function runExtension(target, options, global) {
|
|
2519
|
+
const action = resolveAction(target, options);
|
|
2520
|
+
assertExtensionActionOptionScope(action, options);
|
|
2521
|
+
const normalizedTarget = resolveNormalizedExtensionTarget(target, action, options);
|
|
2442
2522
|
const scope = resolveScope(options);
|
|
2443
2523
|
const resolvedRoots = resolveExtensionRootsForScope(scope, global);
|
|
2444
2524
|
const warnings = [];
|
|
@@ -2470,438 +2550,736 @@ async function runExtension(target, options, global) {
|
|
|
2470
2550
|
}
|
|
2471
2551
|
return result;
|
|
2472
2552
|
};
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2553
|
+
const ctx = {
|
|
2554
|
+
action,
|
|
2555
|
+
normalizedTarget,
|
|
2556
|
+
scope,
|
|
2557
|
+
resolvedRoots,
|
|
2558
|
+
warnings,
|
|
2559
|
+
options,
|
|
2560
|
+
global,
|
|
2561
|
+
withResult
|
|
2562
|
+
};
|
|
2563
|
+
return EXTENSION_ACTION_HANDLERS[action](ctx);
|
|
2564
|
+
}
|
|
2565
|
+
async function runExtensionInitAction(ctx) {
|
|
2566
|
+
const { action, normalizedTarget, options, withResult } = ctx;
|
|
2567
|
+
const githubOption = resolveGithubOption(options);
|
|
2568
|
+
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2569
|
+
throw new PmCliError('Action "init" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2570
|
+
}
|
|
2571
|
+
const scaffoldTarget = requireTarget(normalizedTarget, action, options);
|
|
2572
|
+
const scaffold = await scaffoldExtensionProject(scaffoldTarget, options.vocabulary ?? "extension", options.capability, options.declarative === true);
|
|
2573
|
+
const quotedTargetPath = JSON.stringify(scaffold.target_path);
|
|
2574
|
+
const quotedShellTargetPath = JSON.stringify(scaffold.target_path.replace(/\\/g, "/"));
|
|
2575
|
+
return withResult({
|
|
2576
|
+
scaffolded: scaffold.created_directory || scaffold.files.some((entry) => entry.status === "created"),
|
|
2577
|
+
extension: {
|
|
2578
|
+
name: scaffold.extension_name,
|
|
2579
|
+
command: scaffold.command_name
|
|
2580
|
+
},
|
|
2581
|
+
capability: scaffold.capability,
|
|
2582
|
+
style: scaffold.style,
|
|
2583
|
+
target_path: scaffold.target_path,
|
|
2584
|
+
created_directory: scaffold.created_directory,
|
|
2585
|
+
files: scaffold.files,
|
|
2586
|
+
next_steps: [
|
|
2587
|
+
// Extensions are authored AND loaded as TypeScript (ADR pm-2c28 / pm-m1uz):
|
|
2588
|
+
// the manifest entry is ./index.ts and pm strips types on load (Node
|
|
2589
|
+
// >=22.18), so there is no compile/build step — install dependencies, then
|
|
2590
|
+
// install the scaffold directly.
|
|
2591
|
+
...options.vocabulary === "package" ? [`Install dependencies: cd ${quotedShellTargetPath}, then run "npm install"`] : [
|
|
2592
|
+
`Install type-check dependencies: cd ${quotedShellTargetPath}, then run "npm install -D typescript @types/node @unbrained/pm-cli"`
|
|
2593
|
+
],
|
|
2594
|
+
`Install the scaffold: ${options.vocabulary === "package" ? "pm install --project" : "pm extension --install --project"} ${quotedTargetPath}`,
|
|
2595
|
+
`Smoke-test command path: pm ${scaffold.command_name}`,
|
|
2596
|
+
...options.vocabulary === "package" ? [`Validate the package: cd ${quotedShellTargetPath}, then run "npm run typecheck" and "npm test"`] : [`Type-check the source (optional): cd ${quotedShellTargetPath}, then run "npx tsc --noEmit"`],
|
|
2597
|
+
`Run diagnostics: ${options.vocabulary === "package" ? "pm package doctor" : "pm extension --doctor"} --project --detail summary`
|
|
2598
|
+
]
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
async function runExtensionReloadAction(ctx) {
|
|
2602
|
+
const { normalizedTarget, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
2603
|
+
if (normalizedTarget !== void 0) {
|
|
2604
|
+
throw new PmCliError('Action "reload" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2507
2605
|
}
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2606
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2607
|
+
const reloadToken = nextExtensionReloadToken();
|
|
2608
|
+
const reloaded = await loadExtensions({
|
|
2609
|
+
pmRoot: resolvedRoots.settings_root,
|
|
2610
|
+
settings,
|
|
2611
|
+
cwd: process.cwd(),
|
|
2612
|
+
noExtensions: global.noExtensions,
|
|
2613
|
+
reload_token: reloadToken,
|
|
2614
|
+
cache_bust: true
|
|
2615
|
+
});
|
|
2616
|
+
warnings.push(...reloaded.warnings);
|
|
2617
|
+
const activation = await activateExtensions(reloaded);
|
|
2618
|
+
warnings.push(...activation.warnings);
|
|
2619
|
+
const details = {
|
|
2620
|
+
reload: {
|
|
2621
|
+
token: reloadToken,
|
|
2622
|
+
cache_bust: true,
|
|
2623
|
+
watch: options.watch === true
|
|
2624
|
+
},
|
|
2625
|
+
loaded_count: reloaded.loaded.length,
|
|
2626
|
+
failed_count: reloaded.failed.length,
|
|
2627
|
+
activated_count: Math.max(0, reloaded.loaded.length - activation.failed.length),
|
|
2628
|
+
activation_failed_count: activation.failed.length,
|
|
2629
|
+
loaded_extensions: reloaded.loaded.map((entry) => ({
|
|
2630
|
+
name: entry.name,
|
|
2631
|
+
layer: entry.layer,
|
|
2632
|
+
version: entry.version
|
|
2633
|
+
})),
|
|
2634
|
+
failed_extensions: reloaded.failed.map((entry) => ({
|
|
2635
|
+
name: entry.name,
|
|
2636
|
+
layer: entry.layer,
|
|
2637
|
+
error: entry.error
|
|
2638
|
+
})),
|
|
2639
|
+
activation_failures: activation.failed.map((entry) => ({
|
|
2640
|
+
name: entry.name,
|
|
2641
|
+
layer: entry.layer,
|
|
2642
|
+
error: entry.error
|
|
2643
|
+
}))
|
|
2644
|
+
};
|
|
2645
|
+
if (options.watch === true) {
|
|
2646
|
+
warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
|
|
2647
|
+
}
|
|
2648
|
+
return withResult(details);
|
|
2649
|
+
}
|
|
2650
|
+
async function runExtensionCatalogAction(ctx) {
|
|
2651
|
+
const { normalizedTarget, scope, options, global, withResult } = ctx;
|
|
2652
|
+
if (typeof normalizedTarget === "string" && normalizedTarget.length > 0 && normalizedTarget !== "catalog") {
|
|
2653
|
+
throw new PmCliError('Action "catalog" does not accept a package target.', EXIT_CODE.USAGE);
|
|
2654
|
+
}
|
|
2655
|
+
return withResult(await buildBundledPackageCatalog(scope, global, options));
|
|
2656
|
+
}
|
|
2657
|
+
function buildInstallManagedSource(bundledAliasName, installSource, resolvedSource) {
|
|
2658
|
+
if (bundledAliasName) {
|
|
2659
|
+
return {
|
|
2660
|
+
kind: "builtin",
|
|
2661
|
+
input: bundledAliasName,
|
|
2662
|
+
location: bundledAliasName,
|
|
2663
|
+
name: bundledAliasName
|
|
2550
2664
|
};
|
|
2551
|
-
if (options.watch === true) {
|
|
2552
|
-
warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
|
|
2553
|
-
}
|
|
2554
|
-
return withResult(details);
|
|
2555
2665
|
}
|
|
2556
|
-
if (
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2666
|
+
if (installSource.kind === "local") {
|
|
2667
|
+
return {
|
|
2668
|
+
kind: "local",
|
|
2669
|
+
input: installSource.input,
|
|
2670
|
+
location: installSource.absolute_path
|
|
2671
|
+
};
|
|
2561
2672
|
}
|
|
2562
|
-
if (
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2673
|
+
if (installSource.kind === "npm") {
|
|
2674
|
+
return {
|
|
2675
|
+
kind: "npm",
|
|
2676
|
+
input: installSource.input,
|
|
2677
|
+
location: resolvedSource.resolved_subpath ?? ".",
|
|
2678
|
+
package: resolvedSource.npm_package,
|
|
2679
|
+
version: resolvedSource.npm_version
|
|
2680
|
+
};
|
|
2681
|
+
}
|
|
2682
|
+
return {
|
|
2683
|
+
kind: "github",
|
|
2684
|
+
input: installSource.input,
|
|
2685
|
+
location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
|
|
2686
|
+
repository: installSource.repository,
|
|
2687
|
+
owner: installSource.owner,
|
|
2688
|
+
repo: installSource.repo,
|
|
2689
|
+
ref: installSource.ref,
|
|
2690
|
+
subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
|
|
2691
|
+
commit: resolvedSource.commit
|
|
2692
|
+
};
|
|
2693
|
+
}
|
|
2694
|
+
async function performExtensionInstallUnderLock(ctx, input) {
|
|
2695
|
+
const { scope, resolvedRoots, warnings, global, withResult } = ctx;
|
|
2696
|
+
const { validated, destinationDirectoryName, bundledAliasName, installSource, resolvedSource } = input;
|
|
2697
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2698
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2699
|
+
warnings.push(...managedStateRead.warnings);
|
|
2700
|
+
const destinationDirectory = path5.join(resolvedRoots.selected_root, destinationDirectoryName);
|
|
2701
|
+
const destinationExists = await pathExists(destinationDirectory);
|
|
2702
|
+
const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
|
|
2703
|
+
await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
|
|
2704
|
+
if (!installInPlace) {
|
|
2705
|
+
await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
|
|
2706
|
+
}
|
|
2707
|
+
const sourceRecord = buildInstallManagedSource(bundledAliasName, installSource, resolvedSource);
|
|
2708
|
+
const now = nowIso();
|
|
2709
|
+
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2710
|
+
const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
2711
|
+
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2712
|
+
name: validated.manifest.name,
|
|
2713
|
+
directory: destinationDirectoryName,
|
|
2714
|
+
scope,
|
|
2715
|
+
manifest_version: validated.manifest.version,
|
|
2716
|
+
manifest_entry: validated.manifest.entry,
|
|
2717
|
+
capabilities: [...validated.manifest.capabilities],
|
|
2718
|
+
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
2719
|
+
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
2720
|
+
source: sourceRecord
|
|
2721
|
+
});
|
|
2722
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2723
|
+
const activationChanged = ensureActivated(settings, validated.manifest.name);
|
|
2724
|
+
if (activationChanged) {
|
|
2725
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2726
|
+
}
|
|
2727
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2728
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2729
|
+
const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global);
|
|
2730
|
+
warnings.push(...runtimeProbe.warnings);
|
|
2731
|
+
const installedItemTypeDefinitions = runtimeProbe.item_type_registrations.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)).flatMap((entry) => entry.types.map((type) => ({ name: type.name, folder: type.folder })));
|
|
2732
|
+
if (scope === "project" && installedItemTypeDefinitions.length > 0) {
|
|
2733
|
+
await ensureTypeFolderScaffold(resolvedRoots.pm_root, installedItemTypeDefinitions, warnings, "install:type-folder");
|
|
2734
|
+
}
|
|
2735
|
+
const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
|
|
2736
|
+
const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
|
|
2737
|
+
const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
|
|
2738
|
+
return withResult({
|
|
2739
|
+
extension: {
|
|
2740
|
+
name: validated.manifest.name,
|
|
2741
|
+
version: validated.manifest.version,
|
|
2742
|
+
entry: validated.manifest.entry,
|
|
2743
|
+
capabilities: validated.manifest.capabilities,
|
|
2744
|
+
directory: destinationDirectoryName
|
|
2745
|
+
},
|
|
2746
|
+
source: sourceRecord,
|
|
2747
|
+
destination_path: destinationDirectory,
|
|
2748
|
+
overwritten: destinationExists && !installInPlace,
|
|
2749
|
+
installed_in_place: installInPlace,
|
|
2750
|
+
activated: true,
|
|
2751
|
+
settings_changed: activationChanged,
|
|
2752
|
+
runtime_activation_status: runtimeActivationStatus,
|
|
2753
|
+
command_paths: commandSummary.command_paths,
|
|
2754
|
+
action_paths: commandSummary.action_paths,
|
|
2755
|
+
command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
|
|
2756
|
+
activation_diagnostics: {
|
|
2757
|
+
failed_count: runtimeProbe.activation_failures.length,
|
|
2758
|
+
failed: runtimeProbe.activation_failures,
|
|
2759
|
+
installed_extension_failed: installActivationFailure ?? null
|
|
2597
2760
|
}
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
const destinationExists = await pathExists(destinationDirectory);
|
|
2615
|
-
const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
|
|
2616
|
-
await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
|
|
2617
|
-
if (!installInPlace) {
|
|
2618
|
-
await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
|
|
2619
|
-
}
|
|
2620
|
-
const sourceRecord = bundledAliasName ? {
|
|
2621
|
-
kind: "builtin",
|
|
2622
|
-
input: bundledAliasName,
|
|
2623
|
-
location: bundledAliasName,
|
|
2624
|
-
name: bundledAliasName
|
|
2625
|
-
} : installSource.kind === "local" ? {
|
|
2626
|
-
kind: "local",
|
|
2627
|
-
input: installSource.input,
|
|
2628
|
-
location: installSource.absolute_path
|
|
2629
|
-
} : installSource.kind === "npm" ? {
|
|
2630
|
-
kind: "npm",
|
|
2631
|
-
input: installSource.input,
|
|
2632
|
-
location: resolvedSource.resolved_subpath ?? ".",
|
|
2633
|
-
package: resolvedSource.npm_package,
|
|
2634
|
-
version: resolvedSource.npm_version
|
|
2635
|
-
} : {
|
|
2636
|
-
kind: "github",
|
|
2637
|
-
input: installSource.input,
|
|
2638
|
-
location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
|
|
2639
|
-
repository: installSource.repository,
|
|
2640
|
-
owner: installSource.owner,
|
|
2641
|
-
repo: installSource.repo,
|
|
2642
|
-
ref: installSource.ref,
|
|
2643
|
-
subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
|
|
2644
|
-
commit: resolvedSource.commit
|
|
2645
|
-
};
|
|
2646
|
-
const now = nowIso();
|
|
2647
|
-
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2648
|
-
const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
2649
|
-
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2650
|
-
name: validated.manifest.name,
|
|
2651
|
-
directory: destinationDirectoryName,
|
|
2652
|
-
scope,
|
|
2653
|
-
manifest_version: validated.manifest.version,
|
|
2654
|
-
manifest_entry: validated.manifest.entry,
|
|
2655
|
-
capabilities: [...validated.manifest.capabilities],
|
|
2656
|
-
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
2657
|
-
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
2658
|
-
source: sourceRecord
|
|
2659
|
-
});
|
|
2660
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2661
|
-
const activationChanged = ensureActivated(settings, validated.manifest.name);
|
|
2662
|
-
if (activationChanged) {
|
|
2663
|
-
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2664
|
-
}
|
|
2665
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2666
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2667
|
-
const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global);
|
|
2668
|
-
warnings.push(...runtimeProbe.warnings);
|
|
2669
|
-
const installedItemTypeDefinitions = runtimeProbe.item_type_registrations.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)).flatMap((entry) => entry.types.map((type) => ({ name: type.name, folder: type.folder })));
|
|
2670
|
-
if (scope === "project" && installedItemTypeDefinitions.length > 0) {
|
|
2671
|
-
await ensureTypeFolderScaffold(resolvedRoots.pm_root, installedItemTypeDefinitions, warnings, "install:type-folder");
|
|
2672
|
-
}
|
|
2673
|
-
const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
|
|
2674
|
-
const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
|
|
2675
|
-
const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
|
|
2676
|
-
return withResult({
|
|
2677
|
-
extension: {
|
|
2678
|
-
name: validated.manifest.name,
|
|
2679
|
-
version: validated.manifest.version,
|
|
2680
|
-
entry: validated.manifest.entry,
|
|
2681
|
-
capabilities: validated.manifest.capabilities,
|
|
2682
|
-
directory: destinationDirectoryName
|
|
2683
|
-
},
|
|
2684
|
-
source: sourceRecord,
|
|
2685
|
-
destination_path: destinationDirectory,
|
|
2686
|
-
overwritten: destinationExists && !installInPlace,
|
|
2687
|
-
installed_in_place: installInPlace,
|
|
2688
|
-
activated: true,
|
|
2689
|
-
settings_changed: activationChanged,
|
|
2690
|
-
runtime_activation_status: runtimeActivationStatus,
|
|
2691
|
-
command_paths: commandSummary.command_paths,
|
|
2692
|
-
action_paths: commandSummary.action_paths,
|
|
2693
|
-
command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
|
|
2694
|
-
activation_diagnostics: {
|
|
2695
|
-
failed_count: runtimeProbe.activation_failures.length,
|
|
2696
|
-
failed: runtimeProbe.activation_failures,
|
|
2697
|
-
installed_extension_failed: installActivationFailure ?? null
|
|
2698
|
-
}
|
|
2699
|
-
});
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2763
|
+
async function runExtensionInstallAction(ctx) {
|
|
2764
|
+
const { action, normalizedTarget, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
2765
|
+
const githubOption = resolveGithubOption(options);
|
|
2766
|
+
const explicitSourceInput = githubOption ?? requireTarget(normalizedTarget, action, options);
|
|
2767
|
+
if (typeof githubOption !== "string" && isBundledPackageInstallAllTarget(explicitSourceInput)) {
|
|
2768
|
+
if (typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2769
|
+
throw new PmCliError('Action "install all" does not accept --ref.', EXIT_CODE.USAGE);
|
|
2770
|
+
}
|
|
2771
|
+
const aliases = await listBundledPackageAliases();
|
|
2772
|
+
const packages = [];
|
|
2773
|
+
for (const alias of aliases) {
|
|
2774
|
+
packages.push({
|
|
2775
|
+
alias,
|
|
2776
|
+
result: await runExtension(alias, { ...options, install: true }, global)
|
|
2700
2777
|
});
|
|
2701
|
-
} finally {
|
|
2702
|
-
if (resolvedSource.cleanup) {
|
|
2703
|
-
await resolvedSource.cleanup();
|
|
2704
|
-
}
|
|
2705
2778
|
}
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2710
|
-
}
|
|
2711
|
-
const githubOption = resolveGithubOption(options);
|
|
2712
|
-
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2713
|
-
throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2714
|
-
}
|
|
2715
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2716
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2717
|
-
warnings.push(...managedStateRead.warnings);
|
|
2718
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2719
|
-
warnings.push(...installed.warnings);
|
|
2720
|
-
const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
|
|
2721
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
|
|
2722
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2723
|
-
const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
|
|
2724
|
-
warnings.push(...triage.warnings);
|
|
2725
|
-
const adoptedDetails = adoption.adopted_entries.map((entry) => {
|
|
2726
|
-
const refreshedEntry = refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.name) === normalizeExtensionNameForMatch(entry.name) && normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory)) ?? /* c8 ignore next 3 -- fallback only matters if a manifest renames between adopt and refresh */
|
|
2727
|
-
refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
|
|
2728
|
-
return {
|
|
2729
|
-
...entry,
|
|
2730
|
-
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2731
|
-
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2732
|
-
};
|
|
2733
|
-
});
|
|
2779
|
+
for (const entry of packages) {
|
|
2780
|
+
warnings.push(...entry.result.warnings);
|
|
2781
|
+
}
|
|
2734
2782
|
return withResult({
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2783
|
+
installed_all: true,
|
|
2784
|
+
installed_count: packages.length,
|
|
2785
|
+
packages: packages.map((entry) => ({
|
|
2786
|
+
alias: entry.alias,
|
|
2787
|
+
ok: entry.result.ok,
|
|
2788
|
+
extension: entry.result.details.extension,
|
|
2789
|
+
source: entry.result.details.source,
|
|
2790
|
+
destination_path: entry.result.details.destination_path,
|
|
2791
|
+
activated: entry.result.details.activated,
|
|
2792
|
+
settings_changed: entry.result.details.settings_changed,
|
|
2793
|
+
command_paths: entry.result.details.command_paths,
|
|
2794
|
+
action_paths: entry.result.details.action_paths,
|
|
2795
|
+
command_discovery: entry.result.details.command_discovery,
|
|
2796
|
+
warnings: entry.result.warnings
|
|
2797
|
+
}))
|
|
2743
2798
|
});
|
|
2744
2799
|
}
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
}
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2794
|
-
name: validated.manifest.name,
|
|
2795
|
-
directory: candidate.directory,
|
|
2796
|
-
scope,
|
|
2797
|
-
manifest_version: validated.manifest.version,
|
|
2798
|
-
manifest_entry: validated.manifest.entry,
|
|
2799
|
-
capabilities: [...validated.manifest.capabilities],
|
|
2800
|
-
installed_at: now,
|
|
2801
|
-
updated_at: now,
|
|
2802
|
-
source: sourceRecord
|
|
2803
|
-
});
|
|
2804
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2805
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2806
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2807
|
-
const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
|
|
2808
|
-
return withResult({
|
|
2809
|
-
adopted: true,
|
|
2810
|
-
extension: {
|
|
2811
|
-
name: validated.manifest.name,
|
|
2812
|
-
directory: candidate.directory,
|
|
2813
|
-
version: validated.manifest.version,
|
|
2814
|
-
entry: validated.manifest.entry
|
|
2815
|
-
},
|
|
2816
|
-
source: sourceRecord,
|
|
2800
|
+
const bundledAliasSource = typeof githubOption === "string" ? null : await resolveBundledExtensionAliasSource(explicitSourceInput);
|
|
2801
|
+
const bundledAliasName = bundledAliasSource === null ? null : explicitSourceInput.trim().toLowerCase();
|
|
2802
|
+
const sourceInput = bundledAliasSource ?? explicitSourceInput;
|
|
2803
|
+
const installSource = parseExtensionInstallSource(sourceInput, {
|
|
2804
|
+
forceGithub: typeof githubOption === "string",
|
|
2805
|
+
ref: options.ref
|
|
2806
|
+
});
|
|
2807
|
+
const resolvedSource = await resolveInstallSource(installSource);
|
|
2808
|
+
try {
|
|
2809
|
+
const validated = await validateExtensionDirectory(resolvedSource.directory);
|
|
2810
|
+
const destinationDirectoryName = normalizeManagedDirectoryName(validated.manifest.name);
|
|
2811
|
+
return await withExtensionInstallLock(resolvedRoots.settings_root, destinationDirectoryName, () => performExtensionInstallUnderLock(ctx, {
|
|
2812
|
+
validated,
|
|
2813
|
+
destinationDirectoryName,
|
|
2814
|
+
bundledAliasName,
|
|
2815
|
+
installSource,
|
|
2816
|
+
resolvedSource
|
|
2817
|
+
}));
|
|
2818
|
+
} finally {
|
|
2819
|
+
if (resolvedSource.cleanup) {
|
|
2820
|
+
await resolvedSource.cleanup();
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
async function runExtensionAdoptAllAction(ctx) {
|
|
2825
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2826
|
+
if (normalizedTarget !== void 0) {
|
|
2827
|
+
throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2828
|
+
}
|
|
2829
|
+
const githubOption = resolveGithubOption(options);
|
|
2830
|
+
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2831
|
+
throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2832
|
+
}
|
|
2833
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2834
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2835
|
+
warnings.push(...managedStateRead.warnings);
|
|
2836
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2837
|
+
warnings.push(...installed.warnings);
|
|
2838
|
+
const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
|
|
2839
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
|
|
2840
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2841
|
+
const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
|
|
2842
|
+
warnings.push(...triage.warnings);
|
|
2843
|
+
const adoptedDetails = adoption.adopted_entries.map((entry) => {
|
|
2844
|
+
const refreshedEntry = refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.name) === normalizeExtensionNameForMatch(entry.name) && normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory)) ?? /* c8 ignore next 3 -- fallback only matters if a manifest renames between adopt and refresh */
|
|
2845
|
+
refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
|
|
2846
|
+
return {
|
|
2847
|
+
...entry,
|
|
2817
2848
|
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2818
2849
|
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2819
|
-
});
|
|
2820
|
-
}
|
|
2821
|
-
if (action === "uninstall") {
|
|
2822
|
-
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2823
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2824
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2825
|
-
warnings.push(...managedStateRead.warnings);
|
|
2826
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2827
|
-
warnings.push(...installed.warnings);
|
|
2828
|
-
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2829
|
-
if (!candidate) {
|
|
2830
|
-
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2831
|
-
}
|
|
2832
|
-
const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2833
|
-
await fs5.rm(destinationDirectory, { recursive: true, force: true });
|
|
2834
|
-
const updatedState = {
|
|
2835
|
-
...managedStateRead.state,
|
|
2836
|
-
updated_at: nowIso(),
|
|
2837
|
-
/* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
|
|
2838
|
-
entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
|
|
2839
|
-
/* c8 ignore stop */
|
|
2840
2850
|
};
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2851
|
+
});
|
|
2852
|
+
return withResult({
|
|
2853
|
+
adopted_all: adoptedDetails.length > 0,
|
|
2854
|
+
adopted_count: adoptedDetails.length,
|
|
2855
|
+
already_managed_count: adoption.already_managed_count,
|
|
2856
|
+
extensions: adoptedDetails,
|
|
2857
|
+
triage,
|
|
2858
|
+
warning_codes: triage.warning_codes,
|
|
2859
|
+
update_health_partial: triage.update_health_partial,
|
|
2860
|
+
update_health_coverage: triage.update_health_coverage
|
|
2861
|
+
});
|
|
2862
|
+
}
|
|
2863
|
+
async function runExtensionAdoptAction(ctx) {
|
|
2864
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2865
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2866
|
+
const githubOption = resolveGithubOption(options);
|
|
2867
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2868
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2869
|
+
warnings.push(...managedStateRead.warnings);
|
|
2870
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2871
|
+
warnings.push(...installed.warnings);
|
|
2872
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2873
|
+
if (!candidate) {
|
|
2874
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2875
|
+
}
|
|
2876
|
+
if (candidate.managed) {
|
|
2846
2877
|
return withResult({
|
|
2847
|
-
|
|
2878
|
+
adopted: false,
|
|
2879
|
+
already_managed: true,
|
|
2848
2880
|
extension: {
|
|
2849
2881
|
name: candidate.name,
|
|
2850
2882
|
directory: candidate.directory
|
|
2851
|
-
}
|
|
2852
|
-
destination_path: destinationDirectory,
|
|
2853
|
-
settings_changed: stateChanged
|
|
2883
|
+
}
|
|
2854
2884
|
});
|
|
2855
2885
|
}
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
if (
|
|
2869
|
-
|
|
2886
|
+
const extensionDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2887
|
+
const validated = await validateExtensionDirectory(extensionDirectory);
|
|
2888
|
+
const now = nowIso();
|
|
2889
|
+
const sourceRecord = githubOption === void 0 ? {
|
|
2890
|
+
kind: "local",
|
|
2891
|
+
input: extensionTarget,
|
|
2892
|
+
location: extensionDirectory
|
|
2893
|
+
} : (() => {
|
|
2894
|
+
const parsed = parseExtensionInstallSource(githubOption, {
|
|
2895
|
+
forceGithub: true,
|
|
2896
|
+
ref: options.ref
|
|
2897
|
+
});
|
|
2898
|
+
if (parsed.kind !== "github") {
|
|
2899
|
+
throw new PmCliError(`Invalid GitHub shorthand "${githubOption}".`, EXIT_CODE.USAGE);
|
|
2870
2900
|
}
|
|
2871
|
-
return
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2901
|
+
return {
|
|
2902
|
+
kind: "github",
|
|
2903
|
+
input: parsed.input,
|
|
2904
|
+
location: parsed.subpath ?? ".",
|
|
2905
|
+
repository: parsed.repository,
|
|
2906
|
+
owner: parsed.owner,
|
|
2907
|
+
repo: parsed.repo,
|
|
2908
|
+
ref: parsed.ref,
|
|
2909
|
+
subpath: parsed.subpath
|
|
2910
|
+
};
|
|
2911
|
+
})();
|
|
2912
|
+
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2913
|
+
name: validated.manifest.name,
|
|
2914
|
+
directory: candidate.directory,
|
|
2915
|
+
scope,
|
|
2916
|
+
manifest_version: validated.manifest.version,
|
|
2917
|
+
manifest_entry: validated.manifest.entry,
|
|
2918
|
+
capabilities: [...validated.manifest.capabilities],
|
|
2919
|
+
installed_at: now,
|
|
2920
|
+
updated_at: now,
|
|
2921
|
+
source: sourceRecord
|
|
2922
|
+
});
|
|
2923
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2924
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2925
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2926
|
+
const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
|
|
2927
|
+
return withResult({
|
|
2928
|
+
adopted: true,
|
|
2929
|
+
extension: {
|
|
2930
|
+
name: validated.manifest.name,
|
|
2931
|
+
directory: candidate.directory,
|
|
2932
|
+
version: validated.manifest.version,
|
|
2933
|
+
entry: validated.manifest.entry
|
|
2934
|
+
},
|
|
2935
|
+
source: sourceRecord,
|
|
2936
|
+
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2937
|
+
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2938
|
+
});
|
|
2939
|
+
}
|
|
2940
|
+
async function runExtensionUninstallAction(ctx) {
|
|
2941
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2942
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2943
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2944
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2945
|
+
warnings.push(...managedStateRead.warnings);
|
|
2946
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2947
|
+
warnings.push(...installed.warnings);
|
|
2948
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2949
|
+
if (!candidate) {
|
|
2950
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2951
|
+
}
|
|
2952
|
+
const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2953
|
+
await fs5.rm(destinationDirectory, { recursive: true, force: true });
|
|
2954
|
+
const updatedState = {
|
|
2955
|
+
...managedStateRead.state,
|
|
2956
|
+
updated_at: nowIso(),
|
|
2957
|
+
/* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
|
|
2958
|
+
entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
|
|
2959
|
+
/* c8 ignore stop */
|
|
2960
|
+
};
|
|
2961
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, updatedState);
|
|
2962
|
+
const stateChanged = clearExtensionState(settings, candidate.name);
|
|
2963
|
+
if (stateChanged) {
|
|
2964
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2965
|
+
}
|
|
2966
|
+
return withResult({
|
|
2967
|
+
removed: true,
|
|
2968
|
+
extension: {
|
|
2969
|
+
name: candidate.name,
|
|
2970
|
+
directory: candidate.directory
|
|
2971
|
+
},
|
|
2972
|
+
destination_path: destinationDirectory,
|
|
2973
|
+
settings_changed: stateChanged
|
|
2974
|
+
});
|
|
2975
|
+
}
|
|
2976
|
+
async function runExtensionActivateDeactivateAction(ctx) {
|
|
2977
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2978
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2979
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2980
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2981
|
+
warnings.push(...managedStateRead.warnings);
|
|
2982
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2983
|
+
warnings.push(...installed.warnings);
|
|
2984
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2985
|
+
if (!candidate) {
|
|
2986
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2987
|
+
}
|
|
2988
|
+
const settingsChanged = action === "activate" ? ensureActivated(settings, candidate.name) : ensureDeactivated(settings, candidate.name);
|
|
2989
|
+
if (settingsChanged) {
|
|
2990
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2991
|
+
}
|
|
2992
|
+
return withResult({
|
|
2993
|
+
extension: {
|
|
2994
|
+
name: candidate.name,
|
|
2995
|
+
directory: candidate.directory
|
|
2996
|
+
},
|
|
2997
|
+
active: action === "activate",
|
|
2998
|
+
settings_changed: settingsChanged,
|
|
2999
|
+
settings: {
|
|
3000
|
+
enabled: [...settings.extensions.enabled],
|
|
3001
|
+
disabled: [...settings.extensions.disabled]
|
|
3002
|
+
}
|
|
3003
|
+
});
|
|
3004
|
+
}
|
|
3005
|
+
function buildDoctorRemediation(baseRemediation, loadFailureCount, activationFailureCount, vocabulary, managedStateFix) {
|
|
3006
|
+
return [
|
|
3007
|
+
...new Set([
|
|
3008
|
+
...baseRemediation,
|
|
3009
|
+
/* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
|
|
3010
|
+
...loadFailureCount > 0 ? [
|
|
3011
|
+
vocabulary === "package" ? "Run pm package explore --project and pm package explore --global to inspect load failures." : "Run pm extension --explore --project and pm extension --explore --global to inspect load failures."
|
|
3012
|
+
] : [],
|
|
3013
|
+
...activationFailureCount > 0 ? [
|
|
3014
|
+
vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
|
|
3015
|
+
] : [],
|
|
3016
|
+
/* c8 ignore stop */
|
|
3017
|
+
...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
|
|
3018
|
+
].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
|
|
3019
|
+
];
|
|
3020
|
+
}
|
|
3021
|
+
async function runExtensionDoctorAction(ctx) {
|
|
3022
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
3023
|
+
if (normalizedTarget && normalizedTarget.trim().length > 0) {
|
|
3024
|
+
throw new PmCliError('Action "doctor" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
3025
|
+
}
|
|
3026
|
+
const detailMode = parseDoctorDetailMode(options.detail);
|
|
3027
|
+
const includeTrace = options.trace === true;
|
|
3028
|
+
if (includeTrace && detailMode !== "deep") {
|
|
3029
|
+
throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
|
|
3030
|
+
}
|
|
3031
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3032
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3033
|
+
warnings.push(...managedStateRead.warnings);
|
|
3034
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3035
|
+
warnings.push(...installed.warnings);
|
|
3036
|
+
let managedState = managedStateRead.state;
|
|
3037
|
+
const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3038
|
+
if (managedStateFix) {
|
|
3039
|
+
managedState = managedStateFix.state;
|
|
3040
|
+
}
|
|
3041
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3042
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
3043
|
+
const loadResult = await loadExtensions({
|
|
3044
|
+
pmRoot: resolvedRoots.pm_root,
|
|
3045
|
+
settings,
|
|
3046
|
+
cwd: process.cwd(),
|
|
3047
|
+
noExtensions: global.noExtensions === true
|
|
3048
|
+
});
|
|
3049
|
+
const activationResult = await activateExtensions({
|
|
3050
|
+
...loadResult,
|
|
3051
|
+
loaded: loadResult.loaded
|
|
3052
|
+
});
|
|
3053
|
+
warnings.push(...loadResult.warnings);
|
|
3054
|
+
warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
|
|
3055
|
+
warnings.push(...activationResult.warnings);
|
|
3056
|
+
warnings.push(...classifyDoctorActivationFailureWarnings(activationResult.failed));
|
|
3057
|
+
warnings.push(...classifyUnusedCapabilityWarnings(loadResult, activationResult));
|
|
3058
|
+
warnings.push(...collectGlobalOutputOverrideDoctorWarnings(activationResult));
|
|
3059
|
+
warnings.push(...collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResult));
|
|
3060
|
+
const runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3061
|
+
const doctorConsistency = buildDoctorConsistencySummary(scope, runtimeInstalledExtensions, loadResult.loaded.map((entry) => ({ layer: entry.layer, name: entry.name })), loadResult.failed.map((entry) => ({ name: entry.name })), loadResult.disabled_by_flag);
|
|
3062
|
+
warnings.push(...doctorConsistency.warnings);
|
|
3063
|
+
const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3064
|
+
warnings.push(...updateCheckWarnings);
|
|
3065
|
+
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3066
|
+
warnings.push(...triage.warnings);
|
|
3067
|
+
const normalizedWarnings = [...triage.warnings];
|
|
3068
|
+
const policySummary = {
|
|
3069
|
+
mode: loadResult.policy.mode,
|
|
3070
|
+
trust_mode: loadResult.policy.trust_mode,
|
|
3071
|
+
require_provenance: loadResult.policy.require_provenance,
|
|
3072
|
+
default_sandbox_profile: loadResult.policy.default_sandbox_profile,
|
|
3073
|
+
// Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
|
|
3074
|
+
sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
|
|
3075
|
+
trusted_extensions_count: loadResult.policy.trusted_extensions.length,
|
|
3076
|
+
allowed_extensions_count: loadResult.policy.allowed_extensions.length,
|
|
3077
|
+
blocked_extensions_count: loadResult.policy.blocked_extensions.length,
|
|
3078
|
+
allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
|
|
3079
|
+
blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
|
|
3080
|
+
allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
|
|
3081
|
+
blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
|
|
3082
|
+
allowed_commands_count: loadResult.policy.allowed_commands.length,
|
|
3083
|
+
blocked_commands_count: loadResult.policy.blocked_commands.length,
|
|
3084
|
+
allowed_actions_count: loadResult.policy.allowed_actions.length,
|
|
3085
|
+
blocked_actions_count: loadResult.policy.blocked_actions.length,
|
|
3086
|
+
allowed_services_count: loadResult.policy.allowed_services.length,
|
|
3087
|
+
blocked_services_count: loadResult.policy.blocked_services.length,
|
|
3088
|
+
extension_override_count: loadResult.policy.extension_overrides.length
|
|
3089
|
+
};
|
|
3090
|
+
const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
|
|
3091
|
+
const capabilityContract = buildCapabilityContractMetadata();
|
|
3092
|
+
const warningCodes = triage.warning_codes;
|
|
3093
|
+
const remediation = buildDoctorRemediation(triage.remediation, loadResult.failed.length, activationResult.failed.length, options.vocabulary, managedStateFix);
|
|
3094
|
+
const summary = {
|
|
3095
|
+
status: triage.status,
|
|
3096
|
+
scope,
|
|
3097
|
+
warning_count: triage.warning_count,
|
|
3098
|
+
warning_codes: warningCodes,
|
|
3099
|
+
total_extensions: runtimeInstalledExtensions.length,
|
|
3100
|
+
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3101
|
+
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3102
|
+
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3103
|
+
unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
|
|
3104
|
+
unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
|
|
3105
|
+
unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
|
|
3106
|
+
runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
|
|
3107
|
+
activation_status_totals: {
|
|
3108
|
+
ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
|
|
3109
|
+
failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
|
|
3110
|
+
not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
|
|
3111
|
+
unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
|
|
3112
|
+
},
|
|
3113
|
+
unknown_capability_count: capabilityGuidance.length,
|
|
3114
|
+
capability_contract_version: capabilityContract.version,
|
|
3115
|
+
update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
|
|
3116
|
+
update_health_coverage: triage.update_health_coverage,
|
|
3117
|
+
update_health_partial: triage.update_health_partial,
|
|
3118
|
+
update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
|
|
3119
|
+
load_failure_count: loadResult.failed.length,
|
|
3120
|
+
activation_failure_count: activationResult.failed.length,
|
|
3121
|
+
blocking_failure_count: loadResult.failed.length + activationResult.failed.length,
|
|
3122
|
+
has_blocking_failures: loadResult.failed.length + activationResult.failed.length > 0,
|
|
3123
|
+
consistency_warning_count: doctorConsistency.warnings.length,
|
|
3124
|
+
trace_enabled: includeTrace,
|
|
3125
|
+
policy: policySummary,
|
|
3126
|
+
remediation
|
|
3127
|
+
};
|
|
3128
|
+
const managedStateFixSummary = managedStateFix ? {
|
|
3129
|
+
requested: true,
|
|
3130
|
+
applied: managedStateFix.adopted_entries.length > 0,
|
|
3131
|
+
adopted_count: managedStateFix.adopted_entries.length,
|
|
3132
|
+
already_managed_count: managedStateFix.already_managed_count,
|
|
3133
|
+
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name)
|
|
3134
|
+
} : {
|
|
3135
|
+
requested: false,
|
|
3136
|
+
applied: false,
|
|
3137
|
+
adopted_count: 0,
|
|
3138
|
+
already_managed_count: refreshedInstalled.extensions.filter((entry) => entry.managed).length,
|
|
3139
|
+
adopted_extensions: []
|
|
3140
|
+
};
|
|
3141
|
+
const details = {
|
|
3142
|
+
mode: detailMode,
|
|
3143
|
+
summary,
|
|
3144
|
+
triage,
|
|
3145
|
+
trace_enabled: includeTrace,
|
|
3146
|
+
capability_contract: capabilityContract,
|
|
3147
|
+
capability_guidance: capabilityGuidance,
|
|
3148
|
+
managed_state_fix: managedStateFixSummary,
|
|
3149
|
+
policy: loadResult.policy
|
|
3150
|
+
};
|
|
3151
|
+
if (detailMode === "deep") {
|
|
3152
|
+
const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
|
|
3153
|
+
const { trace: _trace, ...rest } = entry;
|
|
3154
|
+
return rest;
|
|
3155
|
+
});
|
|
3156
|
+
details.deep = {
|
|
3157
|
+
warnings: normalizedWarnings,
|
|
3158
|
+
warning_codes: warningCodes,
|
|
3159
|
+
capability_contract: capabilityContract,
|
|
3160
|
+
capability_guidance: capabilityGuidance,
|
|
3161
|
+
trace_enabled: includeTrace,
|
|
3162
|
+
managed_state: {
|
|
3163
|
+
path: managedStateRead.path,
|
|
3164
|
+
count: managedState.entries.length,
|
|
3165
|
+
entries: managedState.entries
|
|
2875
3166
|
},
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
3167
|
+
installed_extensions: runtimeInstalledExtensions,
|
|
3168
|
+
load: {
|
|
3169
|
+
roots: loadResult.roots,
|
|
3170
|
+
policy: loadResult.policy,
|
|
3171
|
+
warnings: loadResult.warnings,
|
|
3172
|
+
failed: loadResult.failed,
|
|
3173
|
+
loaded: loadResult.loaded.map((entry) => ({
|
|
3174
|
+
layer: entry.layer,
|
|
3175
|
+
directory: entry.directory,
|
|
3176
|
+
name: entry.name,
|
|
3177
|
+
version: entry.version,
|
|
3178
|
+
entry: entry.entry,
|
|
3179
|
+
priority: entry.priority
|
|
3180
|
+
}))
|
|
3181
|
+
},
|
|
3182
|
+
activation: {
|
|
3183
|
+
failed: activationFailedDetails,
|
|
3184
|
+
warnings: activationResult.warnings,
|
|
3185
|
+
hook_counts: activationResult.hook_counts,
|
|
3186
|
+
registration_counts: activationResult.registration_counts,
|
|
3187
|
+
parser_override_count: activationResult.parser_override_count,
|
|
3188
|
+
preflight_override_count: activationResult.preflight_override_count,
|
|
3189
|
+
service_override_count: activationResult.service_override_count,
|
|
3190
|
+
renderer_override_count: activationResult.renderer_override_count
|
|
3191
|
+
},
|
|
3192
|
+
consistency: doctorConsistency.summary
|
|
3193
|
+
};
|
|
3194
|
+
if (includeTrace) {
|
|
3195
|
+
details.deep.trace = {
|
|
3196
|
+
activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
|
|
3197
|
+
layer: entry.layer,
|
|
3198
|
+
name: entry.name,
|
|
3199
|
+
entry_path: entry.entry_path,
|
|
3200
|
+
error: entry.error,
|
|
3201
|
+
method: entry.trace?.method,
|
|
3202
|
+
command: entry.trace?.command,
|
|
3203
|
+
capability: entry.trace?.capability,
|
|
3204
|
+
missing_capability: entry.trace?.missing_capability,
|
|
3205
|
+
registration_index: entry.trace?.registration_index,
|
|
3206
|
+
expected_schema: entry.trace?.expected_schema,
|
|
3207
|
+
hint: entry.trace?.hint,
|
|
3208
|
+
received: entry.trace?.received
|
|
3209
|
+
}))
|
|
3210
|
+
};
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
return withResult(details);
|
|
3214
|
+
}
|
|
3215
|
+
async function runExtensionDescribeAction(ctx) {
|
|
3216
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
3217
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3218
|
+
const loadResult = await loadExtensions({
|
|
3219
|
+
pmRoot: resolvedRoots.pm_root,
|
|
3220
|
+
settings,
|
|
3221
|
+
cwd: process.cwd(),
|
|
3222
|
+
noExtensions: global.noExtensions === true
|
|
3223
|
+
});
|
|
3224
|
+
const activationResult = await activateExtensions(loadResult);
|
|
3225
|
+
warnings.push(...loadResult.warnings);
|
|
3226
|
+
warnings.push(...activationResult.warnings);
|
|
3227
|
+
const describeResult = buildExtensionDescribeResult(normalizedTarget, loadResult, activationResult);
|
|
3228
|
+
if (normalizedTarget !== void 0 && describeResult.extensions.length === 0) {
|
|
3229
|
+
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
3230
|
+
throw new PmCliError(`No loaded ${noun} named "${normalizedTarget}" was found in ${scope} scope. Run pm ${noun} explore to list discovered ${noun}s.`, EXIT_CODE.NOT_FOUND);
|
|
3231
|
+
}
|
|
3232
|
+
return withResult({
|
|
3233
|
+
target: describeResult.target,
|
|
3234
|
+
total: describeResult.total,
|
|
3235
|
+
extensions: describeResult.extensions,
|
|
3236
|
+
union: describeResult.union
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
async function runExtensionExploreManageAction(ctx) {
|
|
3240
|
+
const { action, scope, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
3241
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3242
|
+
const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
|
|
3243
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3244
|
+
warnings.push(...managedStateRead.warnings);
|
|
3245
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3246
|
+
warnings.push(...installed.warnings);
|
|
3247
|
+
let managedState = managedStateRead.state;
|
|
3248
|
+
const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3249
|
+
if (managedStateFix) {
|
|
3250
|
+
managedState = managedStateFix.state;
|
|
3251
|
+
}
|
|
3252
|
+
if (action === "manage") {
|
|
3253
|
+
const updates = await Promise.all(managedState.entries.map(async (entry) => {
|
|
3254
|
+
if (entry.source.kind !== "github") {
|
|
3255
|
+
return entry;
|
|
2881
3256
|
}
|
|
2882
|
-
|
|
3257
|
+
const updateStatus = await checkGithubUpdate(entry.source);
|
|
3258
|
+
return {
|
|
3259
|
+
...entry,
|
|
3260
|
+
last_update_check_at: updateStatus.checked_at,
|
|
3261
|
+
last_update_remote_commit: updateStatus.remote_commit,
|
|
3262
|
+
update_available: updateStatus.available,
|
|
3263
|
+
update_error: updateStatus.error
|
|
3264
|
+
};
|
|
3265
|
+
}));
|
|
3266
|
+
managedState = {
|
|
3267
|
+
...managedState,
|
|
3268
|
+
updated_at: nowIso(),
|
|
3269
|
+
entries: sortManagedEntries(updates)
|
|
3270
|
+
};
|
|
3271
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
3272
|
+
}
|
|
3273
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3274
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
3275
|
+
if (action === "manage") {
|
|
3276
|
+
const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3277
|
+
warnings.push(...updateWarnings);
|
|
2883
3278
|
}
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
const detailMode = parseDoctorDetailMode(options.detail);
|
|
2889
|
-
const includeTrace = options.trace === true;
|
|
2890
|
-
if (includeTrace && detailMode !== "deep") {
|
|
2891
|
-
throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
|
|
2892
|
-
}
|
|
2893
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2894
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2895
|
-
warnings.push(...managedStateRead.warnings);
|
|
2896
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2897
|
-
warnings.push(...installed.warnings);
|
|
2898
|
-
let managedState = managedStateRead.state;
|
|
2899
|
-
const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
2900
|
-
if (managedStateFix) {
|
|
2901
|
-
managedState = managedStateFix.state;
|
|
2902
|
-
}
|
|
2903
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2904
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
3279
|
+
let runtimeProbeSummary;
|
|
3280
|
+
let runtimeInstalledExtensions = refreshedInstalled.extensions;
|
|
3281
|
+
let runtimeActivationFailures;
|
|
3282
|
+
if (action === "explore" || options.runtimeProbe === true) {
|
|
2905
3283
|
const loadResult = await loadExtensions({
|
|
2906
3284
|
pmRoot: resolvedRoots.pm_root,
|
|
2907
3285
|
settings,
|
|
@@ -2913,315 +3291,77 @@ async function runExtension(target, options, global) {
|
|
|
2913
3291
|
loaded: loadResult.loaded
|
|
2914
3292
|
});
|
|
2915
3293
|
warnings.push(...loadResult.warnings);
|
|
2916
|
-
warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
|
|
2917
3294
|
warnings.push(...activationResult.warnings);
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
warnings.push(...doctorConsistency.warnings);
|
|
2925
|
-
const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
2926
|
-
warnings.push(...updateCheckWarnings);
|
|
2927
|
-
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
2928
|
-
warnings.push(...triage.warnings);
|
|
2929
|
-
const normalizedWarnings = [...triage.warnings];
|
|
2930
|
-
const policySummary = {
|
|
2931
|
-
mode: loadResult.policy.mode,
|
|
2932
|
-
trust_mode: loadResult.policy.trust_mode,
|
|
2933
|
-
require_provenance: loadResult.policy.require_provenance,
|
|
2934
|
-
default_sandbox_profile: loadResult.policy.default_sandbox_profile,
|
|
2935
|
-
// Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
|
|
2936
|
-
sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
|
|
2937
|
-
trusted_extensions_count: loadResult.policy.trusted_extensions.length,
|
|
2938
|
-
allowed_extensions_count: loadResult.policy.allowed_extensions.length,
|
|
2939
|
-
blocked_extensions_count: loadResult.policy.blocked_extensions.length,
|
|
2940
|
-
allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
|
|
2941
|
-
blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
|
|
2942
|
-
allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
|
|
2943
|
-
blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
|
|
2944
|
-
allowed_commands_count: loadResult.policy.allowed_commands.length,
|
|
2945
|
-
blocked_commands_count: loadResult.policy.blocked_commands.length,
|
|
2946
|
-
allowed_actions_count: loadResult.policy.allowed_actions.length,
|
|
2947
|
-
blocked_actions_count: loadResult.policy.blocked_actions.length,
|
|
2948
|
-
allowed_services_count: loadResult.policy.allowed_services.length,
|
|
2949
|
-
blocked_services_count: loadResult.policy.blocked_services.length,
|
|
2950
|
-
extension_override_count: loadResult.policy.extension_overrides.length
|
|
2951
|
-
};
|
|
2952
|
-
const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
|
|
2953
|
-
const capabilityContract = buildCapabilityContractMetadata();
|
|
2954
|
-
const warningCodes = triage.warning_codes;
|
|
2955
|
-
const remediation = [
|
|
2956
|
-
...new Set([
|
|
2957
|
-
...triage.remediation,
|
|
2958
|
-
/* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
|
|
2959
|
-
...loadResult.failed.length > 0 ? [
|
|
2960
|
-
options.vocabulary === "package" ? "Run pm package explore --project and pm package explore --global to inspect load failures." : "Run pm extension --explore --project and pm extension --explore --global to inspect load failures."
|
|
2961
|
-
] : [],
|
|
2962
|
-
...activationResult.failed.length > 0 ? [
|
|
2963
|
-
options.vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
|
|
2964
|
-
] : [],
|
|
2965
|
-
/* c8 ignore stop */
|
|
2966
|
-
...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
|
|
2967
|
-
].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
|
|
2968
|
-
];
|
|
2969
|
-
const summary = {
|
|
2970
|
-
status: triage.status,
|
|
2971
|
-
scope,
|
|
2972
|
-
warning_count: triage.warning_count,
|
|
2973
|
-
warning_codes: warningCodes,
|
|
2974
|
-
total_extensions: runtimeInstalledExtensions.length,
|
|
2975
|
-
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
2976
|
-
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
2977
|
-
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
2978
|
-
unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
|
|
2979
|
-
unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
|
|
2980
|
-
unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
|
|
2981
|
-
runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
|
|
2982
|
-
activation_status_totals: {
|
|
2983
|
-
ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
|
|
2984
|
-
failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
|
|
2985
|
-
not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
|
|
2986
|
-
unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
|
|
2987
|
-
},
|
|
2988
|
-
unknown_capability_count: capabilityGuidance.length,
|
|
2989
|
-
capability_contract_version: capabilityContract.version,
|
|
2990
|
-
update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
|
|
2991
|
-
update_health_coverage: triage.update_health_coverage,
|
|
2992
|
-
update_health_partial: triage.update_health_partial,
|
|
2993
|
-
update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
|
|
3295
|
+
runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3296
|
+
runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
|
|
3297
|
+
runtimeProbeSummary = {
|
|
3298
|
+
requested: true,
|
|
3299
|
+
executed: true,
|
|
3300
|
+
reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
|
|
2994
3301
|
load_failure_count: loadResult.failed.length,
|
|
2995
3302
|
activation_failure_count: activationResult.failed.length,
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
consistency_warning_count: doctorConsistency.warnings.length,
|
|
2999
|
-
trace_enabled: includeTrace,
|
|
3000
|
-
policy: policySummary,
|
|
3001
|
-
remediation
|
|
3303
|
+
warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
|
|
3304
|
+
policy: loadResult.policy
|
|
3002
3305
|
};
|
|
3003
|
-
|
|
3306
|
+
} else if (action === "manage") {
|
|
3307
|
+
runtimeProbeSummary = {
|
|
3308
|
+
requested: false,
|
|
3309
|
+
executed: false
|
|
3310
|
+
};
|
|
3311
|
+
}
|
|
3312
|
+
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3313
|
+
warnings.push(...triage.warnings);
|
|
3314
|
+
const details = {
|
|
3315
|
+
total: runtimeInstalledExtensions.length,
|
|
3316
|
+
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3317
|
+
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3318
|
+
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3319
|
+
extensions: runtimeInstalledExtensions,
|
|
3320
|
+
triage,
|
|
3321
|
+
policy: configuredPolicy
|
|
3322
|
+
};
|
|
3323
|
+
if (runtimeActivationFailures !== void 0) {
|
|
3324
|
+
details.activation_diagnostics = {
|
|
3325
|
+
failed_count: runtimeActivationFailures.length,
|
|
3326
|
+
failed: runtimeActivationFailures
|
|
3327
|
+
};
|
|
3328
|
+
}
|
|
3329
|
+
if (action === "explore") {
|
|
3330
|
+
details.runtime_probe = runtimeProbeSummary;
|
|
3331
|
+
}
|
|
3332
|
+
if (action === "manage") {
|
|
3333
|
+
details.runtime_probe = runtimeProbeSummary;
|
|
3334
|
+
details.managed_state_fix = managedStateFix !== null ? {
|
|
3004
3335
|
requested: true,
|
|
3005
3336
|
applied: managedStateFix.adopted_entries.length > 0,
|
|
3006
3337
|
adopted_count: managedStateFix.adopted_entries.length,
|
|
3007
|
-
|
|
3008
|
-
|
|
3338
|
+
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
|
|
3339
|
+
already_managed_count: managedStateFix.already_managed_count
|
|
3009
3340
|
} : {
|
|
3010
3341
|
requested: false,
|
|
3011
3342
|
applied: false,
|
|
3012
3343
|
adopted_count: 0,
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
};
|
|
3016
|
-
const details = {
|
|
3017
|
-
mode: detailMode,
|
|
3018
|
-
summary,
|
|
3019
|
-
triage,
|
|
3020
|
-
trace_enabled: includeTrace,
|
|
3021
|
-
capability_contract: capabilityContract,
|
|
3022
|
-
capability_guidance: capabilityGuidance,
|
|
3023
|
-
managed_state_fix: managedStateFixSummary,
|
|
3024
|
-
policy: loadResult.policy
|
|
3025
|
-
};
|
|
3026
|
-
if (detailMode === "deep") {
|
|
3027
|
-
const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
|
|
3028
|
-
const { trace: _trace, ...rest } = entry;
|
|
3029
|
-
return rest;
|
|
3030
|
-
});
|
|
3031
|
-
details.deep = {
|
|
3032
|
-
warnings: normalizedWarnings,
|
|
3033
|
-
warning_codes: warningCodes,
|
|
3034
|
-
capability_contract: capabilityContract,
|
|
3035
|
-
capability_guidance: capabilityGuidance,
|
|
3036
|
-
trace_enabled: includeTrace,
|
|
3037
|
-
managed_state: {
|
|
3038
|
-
path: managedStateRead.path,
|
|
3039
|
-
count: managedState.entries.length,
|
|
3040
|
-
entries: managedState.entries
|
|
3041
|
-
},
|
|
3042
|
-
installed_extensions: runtimeInstalledExtensions,
|
|
3043
|
-
load: {
|
|
3044
|
-
roots: loadResult.roots,
|
|
3045
|
-
policy: loadResult.policy,
|
|
3046
|
-
warnings: loadResult.warnings,
|
|
3047
|
-
failed: loadResult.failed,
|
|
3048
|
-
loaded: loadResult.loaded.map((entry) => ({
|
|
3049
|
-
layer: entry.layer,
|
|
3050
|
-
directory: entry.directory,
|
|
3051
|
-
name: entry.name,
|
|
3052
|
-
version: entry.version,
|
|
3053
|
-
entry: entry.entry,
|
|
3054
|
-
priority: entry.priority
|
|
3055
|
-
}))
|
|
3056
|
-
},
|
|
3057
|
-
activation: {
|
|
3058
|
-
failed: activationFailedDetails,
|
|
3059
|
-
warnings: activationResult.warnings,
|
|
3060
|
-
hook_counts: activationResult.hook_counts,
|
|
3061
|
-
registration_counts: activationResult.registration_counts,
|
|
3062
|
-
parser_override_count: activationResult.parser_override_count,
|
|
3063
|
-
preflight_override_count: activationResult.preflight_override_count,
|
|
3064
|
-
service_override_count: activationResult.service_override_count,
|
|
3065
|
-
renderer_override_count: activationResult.renderer_override_count
|
|
3066
|
-
},
|
|
3067
|
-
consistency: doctorConsistency.summary
|
|
3068
|
-
};
|
|
3069
|
-
if (includeTrace) {
|
|
3070
|
-
details.deep.trace = {
|
|
3071
|
-
activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
|
|
3072
|
-
layer: entry.layer,
|
|
3073
|
-
name: entry.name,
|
|
3074
|
-
entry_path: entry.entry_path,
|
|
3075
|
-
error: entry.error,
|
|
3076
|
-
method: entry.trace?.method,
|
|
3077
|
-
command: entry.trace?.command,
|
|
3078
|
-
capability: entry.trace?.capability,
|
|
3079
|
-
missing_capability: entry.trace?.missing_capability,
|
|
3080
|
-
registration_index: entry.trace?.registration_index,
|
|
3081
|
-
expected_schema: entry.trace?.expected_schema,
|
|
3082
|
-
hint: entry.trace?.hint,
|
|
3083
|
-
received: entry.trace?.received
|
|
3084
|
-
}))
|
|
3085
|
-
};
|
|
3086
|
-
}
|
|
3087
|
-
}
|
|
3088
|
-
return withResult(details);
|
|
3089
|
-
}
|
|
3090
|
-
if (action === "describe") {
|
|
3091
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3092
|
-
const loadResult = await loadExtensions({
|
|
3093
|
-
pmRoot: resolvedRoots.pm_root,
|
|
3094
|
-
settings,
|
|
3095
|
-
cwd: process.cwd(),
|
|
3096
|
-
noExtensions: global.noExtensions === true
|
|
3097
|
-
});
|
|
3098
|
-
const activationResult = await activateExtensions(loadResult);
|
|
3099
|
-
warnings.push(...loadResult.warnings);
|
|
3100
|
-
warnings.push(...activationResult.warnings);
|
|
3101
|
-
const describeResult = buildExtensionDescribeResult(normalizedTarget, loadResult, activationResult);
|
|
3102
|
-
if (normalizedTarget !== void 0 && describeResult.extensions.length === 0) {
|
|
3103
|
-
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
3104
|
-
throw new PmCliError(`No loaded ${noun} named "${normalizedTarget}" was found in ${scope} scope. Run pm ${noun} explore to list discovered ${noun}s.`, EXIT_CODE.NOT_FOUND);
|
|
3105
|
-
}
|
|
3106
|
-
return withResult({
|
|
3107
|
-
target: describeResult.target,
|
|
3108
|
-
total: describeResult.total,
|
|
3109
|
-
extensions: describeResult.extensions,
|
|
3110
|
-
union: describeResult.union
|
|
3111
|
-
});
|
|
3112
|
-
}
|
|
3113
|
-
if (action === "explore" || action === "manage") {
|
|
3114
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3115
|
-
const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
|
|
3116
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3117
|
-
warnings.push(...managedStateRead.warnings);
|
|
3118
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3119
|
-
warnings.push(...installed.warnings);
|
|
3120
|
-
let managedState = managedStateRead.state;
|
|
3121
|
-
const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3122
|
-
if (managedStateFix) {
|
|
3123
|
-
managedState = managedStateFix.state;
|
|
3124
|
-
}
|
|
3125
|
-
if (action === "manage") {
|
|
3126
|
-
const updates = await Promise.all(managedState.entries.map(async (entry) => {
|
|
3127
|
-
if (entry.source.kind !== "github") {
|
|
3128
|
-
return entry;
|
|
3129
|
-
}
|
|
3130
|
-
const updateStatus = await checkGithubUpdate(entry.source);
|
|
3131
|
-
return {
|
|
3132
|
-
...entry,
|
|
3133
|
-
last_update_check_at: updateStatus.checked_at,
|
|
3134
|
-
last_update_remote_commit: updateStatus.remote_commit,
|
|
3135
|
-
update_available: updateStatus.available,
|
|
3136
|
-
update_error: updateStatus.error
|
|
3137
|
-
};
|
|
3138
|
-
}));
|
|
3139
|
-
managedState = {
|
|
3140
|
-
...managedState,
|
|
3141
|
-
updated_at: nowIso(),
|
|
3142
|
-
entries: sortManagedEntries(updates)
|
|
3143
|
-
};
|
|
3144
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
3145
|
-
}
|
|
3146
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3147
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
3148
|
-
if (action === "manage") {
|
|
3149
|
-
const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3150
|
-
warnings.push(...updateWarnings);
|
|
3151
|
-
}
|
|
3152
|
-
let runtimeProbeSummary;
|
|
3153
|
-
let runtimeInstalledExtensions = refreshedInstalled.extensions;
|
|
3154
|
-
let runtimeActivationFailures;
|
|
3155
|
-
if (action === "explore" || options.runtimeProbe === true) {
|
|
3156
|
-
const loadResult = await loadExtensions({
|
|
3157
|
-
pmRoot: resolvedRoots.pm_root,
|
|
3158
|
-
settings,
|
|
3159
|
-
cwd: process.cwd(),
|
|
3160
|
-
noExtensions: global.noExtensions === true
|
|
3161
|
-
});
|
|
3162
|
-
const activationResult = await activateExtensions({
|
|
3163
|
-
...loadResult,
|
|
3164
|
-
loaded: loadResult.loaded
|
|
3165
|
-
});
|
|
3166
|
-
warnings.push(...loadResult.warnings);
|
|
3167
|
-
warnings.push(...activationResult.warnings);
|
|
3168
|
-
runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3169
|
-
runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
|
|
3170
|
-
runtimeProbeSummary = {
|
|
3171
|
-
requested: true,
|
|
3172
|
-
executed: true,
|
|
3173
|
-
reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
|
|
3174
|
-
load_failure_count: loadResult.failed.length,
|
|
3175
|
-
activation_failure_count: activationResult.failed.length,
|
|
3176
|
-
warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
|
|
3177
|
-
policy: loadResult.policy
|
|
3178
|
-
};
|
|
3179
|
-
} else if (action === "manage") {
|
|
3180
|
-
runtimeProbeSummary = {
|
|
3181
|
-
requested: false,
|
|
3182
|
-
executed: false
|
|
3183
|
-
};
|
|
3184
|
-
}
|
|
3185
|
-
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3186
|
-
warnings.push(...triage.warnings);
|
|
3187
|
-
const details = {
|
|
3188
|
-
total: runtimeInstalledExtensions.length,
|
|
3189
|
-
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3190
|
-
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3191
|
-
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3192
|
-
extensions: runtimeInstalledExtensions,
|
|
3193
|
-
triage,
|
|
3194
|
-
policy: configuredPolicy
|
|
3344
|
+
adopted_extensions: [],
|
|
3345
|
+
already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
|
|
3195
3346
|
};
|
|
3196
|
-
if (runtimeActivationFailures !== void 0) {
|
|
3197
|
-
details.activation_diagnostics = {
|
|
3198
|
-
failed_count: runtimeActivationFailures.length,
|
|
3199
|
-
failed: runtimeActivationFailures
|
|
3200
|
-
};
|
|
3201
|
-
}
|
|
3202
|
-
if (action === "explore") {
|
|
3203
|
-
details.runtime_probe = runtimeProbeSummary;
|
|
3204
|
-
}
|
|
3205
|
-
if (action === "manage") {
|
|
3206
|
-
details.runtime_probe = runtimeProbeSummary;
|
|
3207
|
-
details.managed_state_fix = managedStateFix !== null ? {
|
|
3208
|
-
requested: true,
|
|
3209
|
-
applied: managedStateFix.adopted_entries.length > 0,
|
|
3210
|
-
adopted_count: managedStateFix.adopted_entries.length,
|
|
3211
|
-
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
|
|
3212
|
-
already_managed_count: managedStateFix.already_managed_count
|
|
3213
|
-
} : {
|
|
3214
|
-
requested: false,
|
|
3215
|
-
applied: false,
|
|
3216
|
-
adopted_count: 0,
|
|
3217
|
-
adopted_extensions: [],
|
|
3218
|
-
already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
|
|
3219
|
-
};
|
|
3220
|
-
}
|
|
3221
|
-
return withResult(details);
|
|
3222
3347
|
}
|
|
3223
|
-
|
|
3224
|
-
}
|
|
3348
|
+
return withResult(details);
|
|
3349
|
+
}
|
|
3350
|
+
var EXTENSION_ACTION_HANDLERS = {
|
|
3351
|
+
init: runExtensionInitAction,
|
|
3352
|
+
install: runExtensionInstallAction,
|
|
3353
|
+
uninstall: runExtensionUninstallAction,
|
|
3354
|
+
explore: runExtensionExploreManageAction,
|
|
3355
|
+
manage: runExtensionExploreManageAction,
|
|
3356
|
+
describe: runExtensionDescribeAction,
|
|
3357
|
+
reload: runExtensionReloadAction,
|
|
3358
|
+
doctor: runExtensionDoctorAction,
|
|
3359
|
+
catalog: runExtensionCatalogAction,
|
|
3360
|
+
adopt: runExtensionAdoptAction,
|
|
3361
|
+
"adopt-all": runExtensionAdoptAllAction,
|
|
3362
|
+
activate: runExtensionActivateDeactivateAction,
|
|
3363
|
+
deactivate: runExtensionActivateDeactivateAction
|
|
3364
|
+
};
|
|
3225
3365
|
var _testOnly = {
|
|
3226
3366
|
adoptUnmanagedExtensions,
|
|
3227
3367
|
buildExtensionPolicyDetails,
|
|
@@ -3259,6 +3399,6 @@ export {
|
|
|
3259
3399
|
runExtension,
|
|
3260
3400
|
_testOnly
|
|
3261
3401
|
};
|
|
3262
|
-
//# sourceMappingURL=chunk-
|
|
3402
|
+
//# sourceMappingURL=chunk-NU2UEROZ.js.map
|
|
3263
3403
|
|
|
3264
|
-
//# debugId=
|
|
3404
|
+
//# debugId=bfb4fc80-65a7-5c83-b180-b171fcfa4f33
|