@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
|
@@ -3,21 +3,21 @@ import {
|
|
|
3
3
|
} from "./chunk-5HIZDR5A.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureTypeFolderScaffold
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RMMQ74TG.js";
|
|
7
7
|
import {
|
|
8
8
|
buildExtensionDescribeResult,
|
|
9
9
|
scaffoldExtensionProject
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SDR5J34Q.js";
|
|
11
11
|
import {
|
|
12
12
|
normalizeExtensionNameForMatch,
|
|
13
13
|
normalizeManagedDirectoryName,
|
|
14
14
|
normalizeStringList,
|
|
15
15
|
parseExtensionManifest,
|
|
16
16
|
validateExtensionDirectory
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RH5ZBYFD.js";
|
|
18
18
|
import {
|
|
19
19
|
nowIso
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WYDHYJPO.js";
|
|
21
21
|
import {
|
|
22
22
|
EXIT_CODE,
|
|
23
23
|
EXTENSION_CAPABILITY_CONTRACT,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
resolvePmPackageRootFromModule,
|
|
39
39
|
resolvePmRoot,
|
|
40
40
|
writeSettings
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-RVUALSJF.js";
|
|
42
42
|
|
|
43
43
|
// dist/cli/commands/extension.js
|
|
44
44
|
import { execFile as execFile2 } from "node:child_process";
|
|
@@ -53,7 +53,7 @@ import path from "node:path";
|
|
|
53
53
|
!(function() {
|
|
54
54
|
try {
|
|
55
55
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
56
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
56
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0874e784-e274-5edd-8fbf-26d94a6c4a32");
|
|
57
57
|
} catch (e2) {
|
|
58
58
|
}
|
|
59
59
|
})();
|
|
@@ -97,6 +97,63 @@ function managedExtensionSourcesEquivalent(left, right) {
|
|
|
97
97
|
}
|
|
98
98
|
return true;
|
|
99
99
|
}
|
|
100
|
+
function optionalString(value) {
|
|
101
|
+
return typeof value === "string" ? value : void 0;
|
|
102
|
+
}
|
|
103
|
+
function hasRequiredManagedRecordFields(entry) {
|
|
104
|
+
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";
|
|
105
|
+
}
|
|
106
|
+
function normalizeManagedSource(raw) {
|
|
107
|
+
if (typeof raw !== "object" || raw === null) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const source = raw;
|
|
111
|
+
if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
kind: source.kind,
|
|
116
|
+
input: source.input,
|
|
117
|
+
location: source.location,
|
|
118
|
+
name: optionalString(source.name),
|
|
119
|
+
package: optionalString(source.package),
|
|
120
|
+
version: optionalString(source.version),
|
|
121
|
+
repository: optionalString(source.repository),
|
|
122
|
+
owner: optionalString(source.owner),
|
|
123
|
+
repo: optionalString(source.repo),
|
|
124
|
+
ref: optionalString(source.ref),
|
|
125
|
+
subpath: optionalString(source.subpath),
|
|
126
|
+
commit: optionalString(source.commit)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function normalizeManagedRecord(raw) {
|
|
130
|
+
if (typeof raw !== "object" || raw === null) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const entry = raw;
|
|
134
|
+
if (!hasRequiredManagedRecordFields(entry)) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
const source = normalizeManagedSource(entry.source);
|
|
138
|
+
if (!source) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
name: entry.name.trim(),
|
|
143
|
+
directory: entry.directory.trim(),
|
|
144
|
+
scope: entry.scope,
|
|
145
|
+
manifest_version: entry.manifest_version,
|
|
146
|
+
manifest_entry: entry.manifest_entry,
|
|
147
|
+
capabilities: normalizeStringList(entry.capabilities),
|
|
148
|
+
installed_at: entry.installed_at,
|
|
149
|
+
updated_at: entry.updated_at,
|
|
150
|
+
source,
|
|
151
|
+
last_update_check_at: optionalString(entry.last_update_check_at),
|
|
152
|
+
last_update_remote_commit: optionalString(entry.last_update_remote_commit),
|
|
153
|
+
update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
|
|
154
|
+
update_error: optionalString(entry.update_error)
|
|
155
|
+
};
|
|
156
|
+
}
|
|
100
157
|
function normalizeManagedState(raw) {
|
|
101
158
|
if (typeof raw !== "object" || raw === null) {
|
|
102
159
|
return null;
|
|
@@ -107,49 +164,14 @@ function normalizeManagedState(raw) {
|
|
|
107
164
|
}
|
|
108
165
|
const entries = [];
|
|
109
166
|
for (const rawEntry of candidate.entries) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const entry = rawEntry;
|
|
114
|
-
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) {
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
const source = entry.source;
|
|
118
|
-
if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
|
|
119
|
-
continue;
|
|
167
|
+
const record = normalizeManagedRecord(rawEntry);
|
|
168
|
+
if (record) {
|
|
169
|
+
entries.push(record);
|
|
120
170
|
}
|
|
121
|
-
entries.push({
|
|
122
|
-
name: entry.name.trim(),
|
|
123
|
-
directory: entry.directory.trim(),
|
|
124
|
-
scope: entry.scope,
|
|
125
|
-
manifest_version: entry.manifest_version,
|
|
126
|
-
manifest_entry: entry.manifest_entry,
|
|
127
|
-
capabilities: normalizeStringList(entry.capabilities),
|
|
128
|
-
installed_at: entry.installed_at,
|
|
129
|
-
updated_at: entry.updated_at,
|
|
130
|
-
source: {
|
|
131
|
-
kind: source.kind,
|
|
132
|
-
input: source.input,
|
|
133
|
-
location: source.location,
|
|
134
|
-
name: typeof source.name === "string" ? source.name : void 0,
|
|
135
|
-
package: typeof source.package === "string" ? source.package : void 0,
|
|
136
|
-
version: typeof source.version === "string" ? source.version : void 0,
|
|
137
|
-
repository: typeof source.repository === "string" ? source.repository : void 0,
|
|
138
|
-
owner: typeof source.owner === "string" ? source.owner : void 0,
|
|
139
|
-
repo: typeof source.repo === "string" ? source.repo : void 0,
|
|
140
|
-
ref: typeof source.ref === "string" ? source.ref : void 0,
|
|
141
|
-
subpath: typeof source.subpath === "string" ? source.subpath : void 0,
|
|
142
|
-
commit: typeof source.commit === "string" ? source.commit : void 0
|
|
143
|
-
},
|
|
144
|
-
last_update_check_at: typeof entry.last_update_check_at === "string" ? entry.last_update_check_at : void 0,
|
|
145
|
-
last_update_remote_commit: typeof entry.last_update_remote_commit === "string" ? entry.last_update_remote_commit : void 0,
|
|
146
|
-
update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
|
|
147
|
-
update_error: typeof entry.update_error === "string" ? entry.update_error : void 0
|
|
148
|
-
});
|
|
149
171
|
}
|
|
150
172
|
return {
|
|
151
173
|
version: MANAGED_EXTENSION_STATE_VERSION,
|
|
152
|
-
updated_at:
|
|
174
|
+
updated_at: optionalString(candidate.updated_at) ?? nowIso(),
|
|
153
175
|
entries: sortManagedEntries(entries)
|
|
154
176
|
};
|
|
155
177
|
}
|
|
@@ -969,7 +991,7 @@ import path4 from "node:path";
|
|
|
969
991
|
!(function() {
|
|
970
992
|
try {
|
|
971
993
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
972
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
994
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0baef9c6-cdf9-5aea-89f0-088600d538e6");
|
|
973
995
|
} catch (e2) {
|
|
974
996
|
}
|
|
975
997
|
})();
|
|
@@ -1091,6 +1113,42 @@ async function resolveBundledAliasManifestName(input) {
|
|
|
1091
1113
|
return null;
|
|
1092
1114
|
}
|
|
1093
1115
|
}
|
|
1116
|
+
function buildBundledCatalogLinks(manifest) {
|
|
1117
|
+
return {
|
|
1118
|
+
docs: manifest.catalog?.links?.docs ?? manifest.package_homepage,
|
|
1119
|
+
npm: manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0),
|
|
1120
|
+
repository: manifest.catalog?.links?.repository ?? manifest.package_repository_url,
|
|
1121
|
+
report: manifest.catalog?.links?.report ?? manifest.package_bugs_url
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
function buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations) {
|
|
1125
|
+
const installScopeFlag = scope === "global" ? "--global" : "--project";
|
|
1126
|
+
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));
|
|
1127
|
+
return {
|
|
1128
|
+
alias: bundledEntry.alias,
|
|
1129
|
+
bundled: true,
|
|
1130
|
+
available: true,
|
|
1131
|
+
installed: installedBuiltinAliases.has(bundledEntry.alias) || installedLocations.has(path4.resolve(bundledEntry.package_root)),
|
|
1132
|
+
install_target: bundledEntry.alias,
|
|
1133
|
+
install_command: `pm install ${bundledEntry.alias} ${installScopeFlag}`,
|
|
1134
|
+
package_name: manifest.package_name,
|
|
1135
|
+
package_version: manifest.package_version,
|
|
1136
|
+
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
1137
|
+
keywords: manifest.package_keywords ?? [],
|
|
1138
|
+
resources: manifest.resources,
|
|
1139
|
+
installable_resources: {
|
|
1140
|
+
extensions: manifest.resources.extensions ?? []
|
|
1141
|
+
},
|
|
1142
|
+
metadata_only_resources: metadataOnlyResources,
|
|
1143
|
+
catalog: {
|
|
1144
|
+
display_name: manifest.catalog?.display_name,
|
|
1145
|
+
category: manifest.catalog?.category,
|
|
1146
|
+
tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
|
|
1147
|
+
links: buildBundledCatalogLinks(manifest),
|
|
1148
|
+
media: manifest.catalog?.media
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1094
1152
|
async function buildBundledPackageCatalog(scope, global2, options = {}) {
|
|
1095
1153
|
const roots = resolveExtensionRoots(resolvePmRoot(process.cwd(), global2.path), process.cwd());
|
|
1096
1154
|
const selectedRoot = scope === "global" ? roots.global : roots.project;
|
|
@@ -1099,44 +1157,8 @@ async function buildBundledPackageCatalog(scope, global2, options = {}) {
|
|
|
1099
1157
|
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()));
|
|
1100
1158
|
const packages = [];
|
|
1101
1159
|
for (const bundledEntry of await collectBundledPackageEntries()) {
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1104
|
-
const installScopeFlag = scope === "global" ? "--global" : "--project";
|
|
1105
|
-
const manifest = await readPmPackageManifest(packageRoot);
|
|
1106
|
-
const repository = manifest.catalog?.links?.repository ?? manifest.package_repository_url;
|
|
1107
|
-
const report = manifest.catalog?.links?.report ?? manifest.package_bugs_url;
|
|
1108
|
-
const docs = manifest.catalog?.links?.docs ?? manifest.package_homepage;
|
|
1109
|
-
const npm = manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0);
|
|
1110
|
-
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));
|
|
1111
|
-
packages.push({
|
|
1112
|
-
alias,
|
|
1113
|
-
bundled: true,
|
|
1114
|
-
available: true,
|
|
1115
|
-
installed: installedBuiltinAliases.has(alias) || installedLocations.has(path4.resolve(packageRoot)),
|
|
1116
|
-
install_target: alias,
|
|
1117
|
-
install_command: `pm install ${alias} ${installScopeFlag}`,
|
|
1118
|
-
package_name: manifest.package_name,
|
|
1119
|
-
package_version: manifest.package_version,
|
|
1120
|
-
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
1121
|
-
keywords: manifest.package_keywords ?? [],
|
|
1122
|
-
resources: manifest.resources,
|
|
1123
|
-
installable_resources: {
|
|
1124
|
-
extensions: manifest.resources.extensions ?? []
|
|
1125
|
-
},
|
|
1126
|
-
metadata_only_resources: metadataOnlyResources,
|
|
1127
|
-
catalog: {
|
|
1128
|
-
display_name: manifest.catalog?.display_name,
|
|
1129
|
-
category: manifest.catalog?.category,
|
|
1130
|
-
tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
|
|
1131
|
-
links: {
|
|
1132
|
-
docs,
|
|
1133
|
-
npm,
|
|
1134
|
-
repository,
|
|
1135
|
-
report
|
|
1136
|
-
},
|
|
1137
|
-
media: manifest.catalog?.media
|
|
1138
|
-
}
|
|
1139
|
-
});
|
|
1160
|
+
const manifest = await readPmPackageManifest(bundledEntry.package_root);
|
|
1161
|
+
packages.push(buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations));
|
|
1140
1162
|
}
|
|
1141
1163
|
const fields = parsePackageCatalogFields(options.fields);
|
|
1142
1164
|
const outputPackages = fields ? packages.map((entry) => projectPackageCatalogEntry(entry, fields)) : packages;
|
|
@@ -1203,7 +1225,7 @@ function projectPackageCatalogEntry(entry, fields) {
|
|
|
1203
1225
|
!(function() {
|
|
1204
1226
|
try {
|
|
1205
1227
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
1206
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
1228
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "391a9e4b-f4b7-5176-970b-6de9523822e7");
|
|
1207
1229
|
} catch (e2) {
|
|
1208
1230
|
}
|
|
1209
1231
|
})();
|
|
@@ -1459,6 +1481,98 @@ function classifyUnusedCapabilityWarnings(loadResult, activationResult) {
|
|
|
1459
1481
|
}
|
|
1460
1482
|
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1461
1483
|
}
|
|
1484
|
+
var TRIAGE_REMEDIATION_RULES = [
|
|
1485
|
+
{
|
|
1486
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manifest_")),
|
|
1487
|
+
build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "explore")} ${ctx.scopeFlag} to inspect discovered manifests and directories.`
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unknown:")),
|
|
1491
|
+
build: () => `Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:")),
|
|
1495
|
+
build: () => "Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema)."
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_missing:")),
|
|
1499
|
+
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.`
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unused:")),
|
|
1503
|
+
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.`
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:")),
|
|
1507
|
+
build: () => "Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility."
|
|
1508
|
+
},
|
|
1509
|
+
{
|
|
1510
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:")),
|
|
1511
|
+
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."
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_schema_narrow_activation:")),
|
|
1515
|
+
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."
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:")),
|
|
1519
|
+
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}.`
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:")),
|
|
1523
|
+
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}.`
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_")),
|
|
1527
|
+
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}.`
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
matches: (_warnings, ctx) => ctx.updateCheckFailedTotal > 0,
|
|
1531
|
+
build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "manage")} ${ctx.scopeFlag} after validating network and repository access.`
|
|
1532
|
+
},
|
|
1533
|
+
{
|
|
1534
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manager_state_")),
|
|
1535
|
+
build: (ctx) => `Review and repair ${ctx.scope} managed extension state file if schema/read warnings persist.`
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
matches: (_warnings, ctx) => ctx.policyWarningCount > 0,
|
|
1539
|
+
build: () => "Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces."
|
|
1540
|
+
}
|
|
1541
|
+
];
|
|
1542
|
+
function buildExtensionTriageRemediation(params) {
|
|
1543
|
+
const { normalizedWarnings, options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount, updateHealthPartial, skippedUnmanagedTotal, skippedNonGithubTotal, updateAvailableTotal } = params;
|
|
1544
|
+
const remediation = [];
|
|
1545
|
+
const ctx = { options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount };
|
|
1546
|
+
if (normalizedWarnings.length > 0) {
|
|
1547
|
+
const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
|
|
1548
|
+
deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
|
|
1549
|
+
doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
|
|
1550
|
+
});
|
|
1551
|
+
if (registrationCollisionRemediation) {
|
|
1552
|
+
remediation.push(registrationCollisionRemediation);
|
|
1553
|
+
}
|
|
1554
|
+
for (const rule of TRIAGE_REMEDIATION_RULES) {
|
|
1555
|
+
if (rule.matches(normalizedWarnings, ctx)) {
|
|
1556
|
+
remediation.push(rule.build(ctx));
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
if (updateHealthPartial) {
|
|
1561
|
+
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>).`);
|
|
1562
|
+
} else if (skippedUnmanagedTotal > 0) {
|
|
1563
|
+
remediation.push(`Loaded unmanaged extensions are currently treated as informational. Use ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state to adopt them for update checks.`);
|
|
1564
|
+
}
|
|
1565
|
+
if (skippedNonGithubTotal > 0) {
|
|
1566
|
+
remediation.push(`Non-GitHub managed extensions are skipped by update checks. Use doctor output for non-update diagnostics.`);
|
|
1567
|
+
}
|
|
1568
|
+
if (updateAvailableTotal > 0) {
|
|
1569
|
+
remediation.push(`Update available managed extensions via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>.`);
|
|
1570
|
+
}
|
|
1571
|
+
if (remediation.length === 0) {
|
|
1572
|
+
remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
|
|
1573
|
+
}
|
|
1574
|
+
return remediation;
|
|
1575
|
+
}
|
|
1462
1576
|
function buildExtensionTriageSummary(scope, warnings, extensions, options = {}) {
|
|
1463
1577
|
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1464
1578
|
const managedTotal = extensions.filter((entry) => entry.managed).length;
|
|
@@ -1488,73 +1602,19 @@ function buildExtensionTriageSummary(scope, warnings, extensions, options = {})
|
|
|
1488
1602
|
const warningCodes = [...new Set(effectiveWarnings.map((value) => warningCode(value)))].sort((left, right) => left.localeCompare(right));
|
|
1489
1603
|
const policyWarnings = summarizePolicyWarnings(effectiveWarnings);
|
|
1490
1604
|
const scopeFlag = scope === "global" ? "--global" : "--project";
|
|
1491
|
-
const remediation = [];
|
|
1492
|
-
if (normalizedWarnings.length > 0) {
|
|
1493
|
-
const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
|
|
1494
|
-
deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
|
|
1495
|
-
doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
|
|
1496
|
-
});
|
|
1497
|
-
if (registrationCollisionRemediation) {
|
|
1498
|
-
remediation.push(registrationCollisionRemediation);
|
|
1499
|
-
}
|
|
1500
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_manifest_"))) {
|
|
1501
|
-
remediation.push(`Run ${lifecycleFlagCommand(options, "explore")} ${scopeFlag} to inspect discovered manifests and directories.`);
|
|
1502
|
-
}
|
|
1503
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unknown:"))) {
|
|
1504
|
-
remediation.push(`Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`);
|
|
1505
|
-
}
|
|
1506
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:"))) {
|
|
1507
|
-
remediation.push("Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema).");
|
|
1508
|
-
}
|
|
1509
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_missing:"))) {
|
|
1510
|
-
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.`);
|
|
1511
|
-
}
|
|
1512
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unused:"))) {
|
|
1513
|
-
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.`);
|
|
1514
|
-
}
|
|
1515
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:"))) {
|
|
1516
|
-
remediation.push("Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility.");
|
|
1517
|
-
}
|
|
1518
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:"))) {
|
|
1519
|
-
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.");
|
|
1520
|
-
}
|
|
1521
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_schema_narrow_activation:"))) {
|
|
1522
|
-
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.");
|
|
1523
|
-
}
|
|
1524
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:"))) {
|
|
1525
|
-
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}.`);
|
|
1526
|
-
}
|
|
1527
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:"))) {
|
|
1528
|
-
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}.`);
|
|
1529
|
-
}
|
|
1530
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_"))) {
|
|
1531
|
-
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}.`);
|
|
1532
|
-
}
|
|
1533
|
-
if (updateCheckFailedTotal > 0) {
|
|
1534
|
-
remediation.push(`Run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after validating network and repository access.`);
|
|
1535
|
-
}
|
|
1536
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_manager_state_"))) {
|
|
1537
|
-
remediation.push(`Review and repair ${scope} managed extension state file if schema/read warnings persist.`);
|
|
1538
|
-
}
|
|
1539
|
-
if (policyWarnings.warning_count > 0) {
|
|
1540
|
-
remediation.push("Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces.");
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
1605
|
const collisionPlan = buildRegistrationCollisionPlan(scope, normalizedWarnings, extensions, options);
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
|
|
1557
|
-
}
|
|
1606
|
+
const remediation = buildExtensionTriageRemediation({
|
|
1607
|
+
normalizedWarnings,
|
|
1608
|
+
options,
|
|
1609
|
+
scope,
|
|
1610
|
+
scopeFlag,
|
|
1611
|
+
updateCheckFailedTotal,
|
|
1612
|
+
policyWarningCount: policyWarnings.warning_count,
|
|
1613
|
+
updateHealthPartial,
|
|
1614
|
+
skippedUnmanagedTotal,
|
|
1615
|
+
skippedNonGithubTotal,
|
|
1616
|
+
updateAvailableTotal
|
|
1617
|
+
});
|
|
1558
1618
|
return {
|
|
1559
1619
|
status: effectiveWarnings.length === 0 ? "ok" : "warn",
|
|
1560
1620
|
warning_count: effectiveWarnings.length,
|
|
@@ -1676,7 +1736,7 @@ function buildDoctorConsistencySummary(scope, installedExtensions, loadedExtensi
|
|
|
1676
1736
|
!(function() {
|
|
1677
1737
|
try {
|
|
1678
1738
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
1679
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
1739
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0e9a5528-9595-5a89-89b7-5a5acce477a8");
|
|
1680
1740
|
} catch (e2) {
|
|
1681
1741
|
}
|
|
1682
1742
|
})();
|
|
@@ -1981,48 +2041,58 @@ function buildUnknownLifecycleActionError(target, options) {
|
|
|
1981
2041
|
}
|
|
1982
2042
|
});
|
|
1983
2043
|
}
|
|
2044
|
+
var EXTENSION_ACTION_FLAG_SELECTORS = [
|
|
2045
|
+
["install", "install"],
|
|
2046
|
+
["uninstall", "uninstall"],
|
|
2047
|
+
["explore", "explore"],
|
|
2048
|
+
["manage", "manage"],
|
|
2049
|
+
["describe", "describe"],
|
|
2050
|
+
["reload", "reload"],
|
|
2051
|
+
["doctor", "doctor"],
|
|
2052
|
+
["catalog", "catalog"],
|
|
2053
|
+
["init", "init"],
|
|
2054
|
+
["scaffold", "init"],
|
|
2055
|
+
["adopt", "adopt"],
|
|
2056
|
+
["adoptAll", "adopt-all"],
|
|
2057
|
+
["activate", "activate"],
|
|
2058
|
+
["deactivate", "deactivate"]
|
|
2059
|
+
];
|
|
2060
|
+
function resolveImplicitActionFromTarget(normalizedTarget) {
|
|
2061
|
+
if (normalizedTarget === "doctor") {
|
|
2062
|
+
return "doctor";
|
|
2063
|
+
}
|
|
2064
|
+
if (normalizedTarget === "reload") {
|
|
2065
|
+
return "reload";
|
|
2066
|
+
}
|
|
2067
|
+
if (normalizedTarget === "catalog") {
|
|
2068
|
+
return "catalog";
|
|
2069
|
+
}
|
|
2070
|
+
if (normalizedTarget === "init" || normalizedTarget === "scaffold") {
|
|
2071
|
+
return "init";
|
|
2072
|
+
}
|
|
2073
|
+
if (normalizedTarget === "explore") {
|
|
2074
|
+
return "explore";
|
|
2075
|
+
}
|
|
2076
|
+
if (normalizedTarget === "manage") {
|
|
2077
|
+
return "manage";
|
|
2078
|
+
}
|
|
2079
|
+
if (normalizedTarget === "list" || normalizedTarget === "") {
|
|
2080
|
+
return "explore";
|
|
2081
|
+
}
|
|
2082
|
+
return null;
|
|
2083
|
+
}
|
|
1984
2084
|
function resolveAction(target, options) {
|
|
1985
|
-
const selected = [
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
options.explore ? "explore" : null,
|
|
1989
|
-
options.manage ? "manage" : null,
|
|
1990
|
-
options.describe ? "describe" : null,
|
|
1991
|
-
options.reload ? "reload" : null,
|
|
1992
|
-
options.doctor ? "doctor" : null,
|
|
1993
|
-
options.catalog ? "catalog" : null,
|
|
1994
|
-
options.init ? "init" : null,
|
|
1995
|
-
options.scaffold ? "init" : null,
|
|
1996
|
-
options.adopt ? "adopt" : null,
|
|
1997
|
-
options.adoptAll ? "adopt-all" : null,
|
|
1998
|
-
options.activate ? "activate" : null,
|
|
1999
|
-
options.deactivate ? "deactivate" : null
|
|
2000
|
-
].filter((value) => value !== null))];
|
|
2085
|
+
const selected = [
|
|
2086
|
+
...new Set(EXTENSION_ACTION_FLAG_SELECTORS.filter(([flag]) => options[flag] === true).map(([, mappedAction]) => mappedAction))
|
|
2087
|
+
];
|
|
2001
2088
|
if (selected.length === 0) {
|
|
2002
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "doctor") {
|
|
2003
|
-
return "doctor";
|
|
2004
|
-
}
|
|
2005
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "reload") {
|
|
2006
|
-
return "reload";
|
|
2007
|
-
}
|
|
2008
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "catalog") {
|
|
2009
|
-
return "catalog";
|
|
2010
|
-
}
|
|
2011
|
-
if (typeof target === "string" && (target.trim().toLowerCase() === "init" || target.trim().toLowerCase() === "scaffold")) {
|
|
2012
|
-
return "init";
|
|
2013
|
-
}
|
|
2014
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "explore") {
|
|
2015
|
-
return "explore";
|
|
2016
|
-
}
|
|
2017
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "manage") {
|
|
2018
|
-
return "manage";
|
|
2019
|
-
}
|
|
2020
|
-
if (typeof target === "string" && (target.trim().toLowerCase() === "list" || target.trim() === "")) {
|
|
2021
|
-
return "explore";
|
|
2022
|
-
}
|
|
2023
2089
|
if (target === void 0) {
|
|
2024
2090
|
return "explore";
|
|
2025
2091
|
}
|
|
2092
|
+
const implicitAction = resolveImplicitActionFromTarget(target.trim().toLowerCase());
|
|
2093
|
+
if (implicitAction) {
|
|
2094
|
+
return implicitAction;
|
|
2095
|
+
}
|
|
2026
2096
|
throw buildUnknownLifecycleActionError(target, options);
|
|
2027
2097
|
}
|
|
2028
2098
|
if (selected.length > 1) {
|
|
@@ -2081,6 +2151,27 @@ function resolveUpdateCheckResolution(managedEntry) {
|
|
|
2081
2151
|
reason: "no_update_check_recorded"
|
|
2082
2152
|
};
|
|
2083
2153
|
}
|
|
2154
|
+
function buildInstalledExtensionSummary(identity, scope, managedEntry, updateCheck) {
|
|
2155
|
+
return {
|
|
2156
|
+
name: identity.name,
|
|
2157
|
+
directory: identity.directory,
|
|
2158
|
+
version: identity.version,
|
|
2159
|
+
entry: identity.entry,
|
|
2160
|
+
scope,
|
|
2161
|
+
active: identity.enabled,
|
|
2162
|
+
enabled: identity.enabled,
|
|
2163
|
+
runtime_active: null,
|
|
2164
|
+
activation_status: "unknown",
|
|
2165
|
+
managed: Boolean(managedEntry),
|
|
2166
|
+
source: managedEntry?.source,
|
|
2167
|
+
update_available: managedEntry?.update_available,
|
|
2168
|
+
last_update_check_at: managedEntry?.last_update_check_at,
|
|
2169
|
+
last_update_remote_commit: managedEntry?.last_update_remote_commit,
|
|
2170
|
+
update_error: managedEntry?.update_error,
|
|
2171
|
+
update_check_status: updateCheck.status,
|
|
2172
|
+
update_check_reason: updateCheck.reason
|
|
2173
|
+
};
|
|
2174
|
+
}
|
|
2084
2175
|
async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
2085
2176
|
if (!await pathExists(extensionsRoot)) {
|
|
2086
2177
|
return {
|
|
@@ -2104,27 +2195,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
|
2104
2195
|
if (!await pathExists(manifestPath)) {
|
|
2105
2196
|
warnings.push(`extension_manifest_missing:${scope}:${directoryName}`);
|
|
2106
2197
|
const managedEntry2 = managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
|
|
2107
|
-
|
|
2108
|
-
const enabled2 = managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false;
|
|
2109
|
-
summaries.push({
|
|
2198
|
+
summaries.push(buildInstalledExtensionSummary({
|
|
2110
2199
|
name: managedEntry2?.name ?? directoryName,
|
|
2111
2200
|
directory: directoryName,
|
|
2112
2201
|
version: managedEntry2?.manifest_version ?? "unknown",
|
|
2113
2202
|
entry: managedEntry2?.manifest_entry ?? "unknown",
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
enabled: enabled2,
|
|
2117
|
-
runtime_active: null,
|
|
2118
|
-
activation_status: "unknown",
|
|
2119
|
-
managed: Boolean(managedEntry2),
|
|
2120
|
-
source: managedEntry2?.source,
|
|
2121
|
-
update_available: managedEntry2?.update_available,
|
|
2122
|
-
last_update_check_at: managedEntry2?.last_update_check_at,
|
|
2123
|
-
last_update_remote_commit: managedEntry2?.last_update_remote_commit,
|
|
2124
|
-
update_error: managedEntry2?.update_error,
|
|
2125
|
-
update_check_status: updateCheck2.status,
|
|
2126
|
-
update_check_reason: updateCheck2.reason
|
|
2127
|
-
});
|
|
2203
|
+
enabled: managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false
|
|
2204
|
+
}, scope, managedEntry2, resolveUpdateCheckResolution(managedEntry2)));
|
|
2128
2205
|
continue;
|
|
2129
2206
|
}
|
|
2130
2207
|
let rawManifest;
|
|
@@ -2140,27 +2217,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
|
2140
2217
|
continue;
|
|
2141
2218
|
}
|
|
2142
2219
|
const managedEntry = managedByName.get(normalizeExtensionNameForMatch(manifest.name)) ?? managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
|
|
2143
|
-
|
|
2144
|
-
const enabled = isExtensionEnabled(settings, manifest.name);
|
|
2145
|
-
summaries.push({
|
|
2220
|
+
summaries.push(buildInstalledExtensionSummary({
|
|
2146
2221
|
name: manifest.name,
|
|
2147
2222
|
directory: directoryName,
|
|
2148
2223
|
version: manifest.version,
|
|
2149
2224
|
entry: manifest.entry,
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
enabled,
|
|
2153
|
-
runtime_active: null,
|
|
2154
|
-
activation_status: "unknown",
|
|
2155
|
-
managed: Boolean(managedEntry),
|
|
2156
|
-
source: managedEntry?.source,
|
|
2157
|
-
update_available: managedEntry?.update_available,
|
|
2158
|
-
last_update_check_at: managedEntry?.last_update_check_at,
|
|
2159
|
-
last_update_remote_commit: managedEntry?.last_update_remote_commit,
|
|
2160
|
-
update_error: managedEntry?.update_error,
|
|
2161
|
-
update_check_status: updateCheck.status,
|
|
2162
|
-
update_check_reason: updateCheck.reason
|
|
2163
|
-
});
|
|
2225
|
+
enabled: isExtensionEnabled(settings, manifest.name)
|
|
2226
|
+
}, scope, managedEntry, resolveUpdateCheckResolution(managedEntry)));
|
|
2164
2227
|
}
|
|
2165
2228
|
return {
|
|
2166
2229
|
extensions: summaries.sort((left, right) => left.name.localeCompare(right.name)),
|
|
@@ -2439,46 +2502,63 @@ function collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResul
|
|
|
2439
2502
|
}
|
|
2440
2503
|
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
2441
2504
|
}
|
|
2442
|
-
|
|
2443
|
-
const
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2505
|
+
function assertExtensionActionOptionScope(action, options) {
|
|
2506
|
+
const guards = [
|
|
2507
|
+
{
|
|
2508
|
+
triggered: options.strictExit === true || options.failOnWarn === true,
|
|
2509
|
+
allowed: action === "doctor",
|
|
2510
|
+
message: "--strict-exit and --fail-on-warn are only valid with --doctor."
|
|
2511
|
+
},
|
|
2512
|
+
{ triggered: options.trace === true, allowed: action === "doctor", message: "--trace is only valid with --doctor." },
|
|
2513
|
+
{ triggered: options.watch === true, allowed: action === "reload", message: "--watch is only valid with --reload." },
|
|
2514
|
+
{
|
|
2515
|
+
triggered: options.runtimeProbe === true,
|
|
2516
|
+
allowed: action === "manage",
|
|
2517
|
+
message: "--runtime-probe is only valid with --manage."
|
|
2518
|
+
},
|
|
2519
|
+
{
|
|
2520
|
+
triggered: options.fixManagedState === true,
|
|
2521
|
+
allowed: action === "manage" || action === "doctor",
|
|
2522
|
+
message: "--fix-managed-state is only valid with --manage or --doctor."
|
|
2523
|
+
},
|
|
2524
|
+
{
|
|
2525
|
+
triggered: options.capability !== void 0,
|
|
2526
|
+
allowed: action === "init",
|
|
2527
|
+
message: "--capability is only valid with --init/--scaffold."
|
|
2528
|
+
},
|
|
2529
|
+
{
|
|
2530
|
+
triggered: options.declarative === true,
|
|
2531
|
+
allowed: action === "init",
|
|
2532
|
+
message: "--declarative is only valid with --init/--scaffold."
|
|
2533
|
+
}
|
|
2534
|
+
];
|
|
2535
|
+
for (const guard of guards) {
|
|
2536
|
+
if (guard.triggered && !guard.allowed) {
|
|
2537
|
+
throw new PmCliError(guard.message, EXIT_CODE.USAGE);
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
function resolveNormalizedExtensionTarget(target, action, options) {
|
|
2542
|
+
const normalizedInput = target?.trim().toLowerCase();
|
|
2543
|
+
if (action === "doctor" && normalizedInput === "doctor") {
|
|
2544
|
+
return void 0;
|
|
2455
2545
|
}
|
|
2456
|
-
if (
|
|
2457
|
-
|
|
2546
|
+
if (action === "reload" && normalizedInput === "reload") {
|
|
2547
|
+
return void 0;
|
|
2458
2548
|
}
|
|
2459
|
-
if (
|
|
2460
|
-
|
|
2549
|
+
if (action === "catalog" && normalizedInput === "catalog") {
|
|
2550
|
+
return void 0;
|
|
2461
2551
|
}
|
|
2462
|
-
|
|
2463
|
-
|
|
2552
|
+
const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
|
|
2553
|
+
if (inferredInitAlias) {
|
|
2554
|
+
return void 0;
|
|
2464
2555
|
}
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
return void 0;
|
|
2472
|
-
}
|
|
2473
|
-
if (action === "catalog" && normalizedInput === "catalog") {
|
|
2474
|
-
return void 0;
|
|
2475
|
-
}
|
|
2476
|
-
const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
|
|
2477
|
-
if (inferredInitAlias) {
|
|
2478
|
-
return void 0;
|
|
2479
|
-
}
|
|
2480
|
-
return target;
|
|
2481
|
-
})();
|
|
2556
|
+
return target;
|
|
2557
|
+
}
|
|
2558
|
+
async function runExtension(target, options, global2) {
|
|
2559
|
+
const action = resolveAction(target, options);
|
|
2560
|
+
assertExtensionActionOptionScope(action, options);
|
|
2561
|
+
const normalizedTarget = resolveNormalizedExtensionTarget(target, action, options);
|
|
2482
2562
|
const scope = resolveScope(options);
|
|
2483
2563
|
const resolvedRoots = resolveExtensionRootsForScope(scope, global2);
|
|
2484
2564
|
const warnings = [];
|
|
@@ -2510,438 +2590,736 @@ async function runExtension(target, options, global2) {
|
|
|
2510
2590
|
}
|
|
2511
2591
|
return result;
|
|
2512
2592
|
};
|
|
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
|
-
|
|
2593
|
+
const ctx = {
|
|
2594
|
+
action,
|
|
2595
|
+
normalizedTarget,
|
|
2596
|
+
scope,
|
|
2597
|
+
resolvedRoots,
|
|
2598
|
+
warnings,
|
|
2599
|
+
options,
|
|
2600
|
+
global: global2,
|
|
2601
|
+
withResult
|
|
2602
|
+
};
|
|
2603
|
+
return EXTENSION_ACTION_HANDLERS[action](ctx);
|
|
2604
|
+
}
|
|
2605
|
+
async function runExtensionInitAction(ctx) {
|
|
2606
|
+
const { action, normalizedTarget, options, withResult } = ctx;
|
|
2607
|
+
const githubOption = resolveGithubOption(options);
|
|
2608
|
+
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2609
|
+
throw new PmCliError('Action "init" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2610
|
+
}
|
|
2611
|
+
const scaffoldTarget = requireTarget(normalizedTarget, action, options);
|
|
2612
|
+
const scaffold = await scaffoldExtensionProject(scaffoldTarget, options.vocabulary ?? "extension", options.capability, options.declarative === true);
|
|
2613
|
+
const quotedTargetPath = JSON.stringify(scaffold.target_path);
|
|
2614
|
+
const quotedShellTargetPath = JSON.stringify(scaffold.target_path.replace(/\\/g, "/"));
|
|
2615
|
+
return withResult({
|
|
2616
|
+
scaffolded: scaffold.created_directory || scaffold.files.some((entry) => entry.status === "created"),
|
|
2617
|
+
extension: {
|
|
2618
|
+
name: scaffold.extension_name,
|
|
2619
|
+
command: scaffold.command_name
|
|
2620
|
+
},
|
|
2621
|
+
capability: scaffold.capability,
|
|
2622
|
+
style: scaffold.style,
|
|
2623
|
+
target_path: scaffold.target_path,
|
|
2624
|
+
created_directory: scaffold.created_directory,
|
|
2625
|
+
files: scaffold.files,
|
|
2626
|
+
next_steps: [
|
|
2627
|
+
// Extensions are authored AND loaded as TypeScript (ADR pm-2c28 / pm-m1uz):
|
|
2628
|
+
// the manifest entry is ./index.ts and pm strips types on load (Node
|
|
2629
|
+
// >=22.18), so there is no compile/build step — install dependencies, then
|
|
2630
|
+
// install the scaffold directly.
|
|
2631
|
+
...options.vocabulary === "package" ? [`Install dependencies: cd ${quotedShellTargetPath}, then run "npm install"`] : [
|
|
2632
|
+
`Install type-check dependencies: cd ${quotedShellTargetPath}, then run "npm install -D typescript @types/node @unbrained/pm-cli"`
|
|
2633
|
+
],
|
|
2634
|
+
`Install the scaffold: ${options.vocabulary === "package" ? "pm install --project" : "pm extension --install --project"} ${quotedTargetPath}`,
|
|
2635
|
+
`Smoke-test command path: pm ${scaffold.command_name}`,
|
|
2636
|
+
...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"`],
|
|
2637
|
+
`Run diagnostics: ${options.vocabulary === "package" ? "pm package doctor" : "pm extension --doctor"} --project --detail summary`
|
|
2638
|
+
]
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
async function runExtensionReloadAction(ctx) {
|
|
2642
|
+
const { normalizedTarget, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
2643
|
+
if (normalizedTarget !== void 0) {
|
|
2644
|
+
throw new PmCliError('Action "reload" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2547
2645
|
}
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
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
|
-
|
|
2646
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2647
|
+
const reloadToken = nextExtensionReloadToken();
|
|
2648
|
+
const reloaded = await loadExtensions({
|
|
2649
|
+
pmRoot: resolvedRoots.settings_root,
|
|
2650
|
+
settings,
|
|
2651
|
+
cwd: process.cwd(),
|
|
2652
|
+
noExtensions: global2.noExtensions,
|
|
2653
|
+
reload_token: reloadToken,
|
|
2654
|
+
cache_bust: true
|
|
2655
|
+
});
|
|
2656
|
+
warnings.push(...reloaded.warnings);
|
|
2657
|
+
const activation = await activateExtensions(reloaded);
|
|
2658
|
+
warnings.push(...activation.warnings);
|
|
2659
|
+
const details = {
|
|
2660
|
+
reload: {
|
|
2661
|
+
token: reloadToken,
|
|
2662
|
+
cache_bust: true,
|
|
2663
|
+
watch: options.watch === true
|
|
2664
|
+
},
|
|
2665
|
+
loaded_count: reloaded.loaded.length,
|
|
2666
|
+
failed_count: reloaded.failed.length,
|
|
2667
|
+
activated_count: Math.max(0, reloaded.loaded.length - activation.failed.length),
|
|
2668
|
+
activation_failed_count: activation.failed.length,
|
|
2669
|
+
loaded_extensions: reloaded.loaded.map((entry) => ({
|
|
2670
|
+
name: entry.name,
|
|
2671
|
+
layer: entry.layer,
|
|
2672
|
+
version: entry.version
|
|
2673
|
+
})),
|
|
2674
|
+
failed_extensions: reloaded.failed.map((entry) => ({
|
|
2675
|
+
name: entry.name,
|
|
2676
|
+
layer: entry.layer,
|
|
2677
|
+
error: entry.error
|
|
2678
|
+
})),
|
|
2679
|
+
activation_failures: activation.failed.map((entry) => ({
|
|
2680
|
+
name: entry.name,
|
|
2681
|
+
layer: entry.layer,
|
|
2682
|
+
error: entry.error
|
|
2683
|
+
}))
|
|
2684
|
+
};
|
|
2685
|
+
if (options.watch === true) {
|
|
2686
|
+
warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
|
|
2687
|
+
}
|
|
2688
|
+
return withResult(details);
|
|
2689
|
+
}
|
|
2690
|
+
async function runExtensionCatalogAction(ctx) {
|
|
2691
|
+
const { normalizedTarget, scope, options, global: global2, withResult } = ctx;
|
|
2692
|
+
if (typeof normalizedTarget === "string" && normalizedTarget.length > 0 && normalizedTarget !== "catalog") {
|
|
2693
|
+
throw new PmCliError('Action "catalog" does not accept a package target.', EXIT_CODE.USAGE);
|
|
2694
|
+
}
|
|
2695
|
+
return withResult(await buildBundledPackageCatalog(scope, global2, options));
|
|
2696
|
+
}
|
|
2697
|
+
function buildInstallManagedSource(bundledAliasName, installSource, resolvedSource) {
|
|
2698
|
+
if (bundledAliasName) {
|
|
2699
|
+
return {
|
|
2700
|
+
kind: "builtin",
|
|
2701
|
+
input: bundledAliasName,
|
|
2702
|
+
location: bundledAliasName,
|
|
2703
|
+
name: bundledAliasName
|
|
2590
2704
|
};
|
|
2591
|
-
if (options.watch === true) {
|
|
2592
|
-
warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
|
|
2593
|
-
}
|
|
2594
|
-
return withResult(details);
|
|
2595
2705
|
}
|
|
2596
|
-
if (
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2706
|
+
if (installSource.kind === "local") {
|
|
2707
|
+
return {
|
|
2708
|
+
kind: "local",
|
|
2709
|
+
input: installSource.input,
|
|
2710
|
+
location: installSource.absolute_path
|
|
2711
|
+
};
|
|
2601
2712
|
}
|
|
2602
|
-
if (
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2713
|
+
if (installSource.kind === "npm") {
|
|
2714
|
+
return {
|
|
2715
|
+
kind: "npm",
|
|
2716
|
+
input: installSource.input,
|
|
2717
|
+
location: resolvedSource.resolved_subpath ?? ".",
|
|
2718
|
+
package: resolvedSource.npm_package,
|
|
2719
|
+
version: resolvedSource.npm_version
|
|
2720
|
+
};
|
|
2721
|
+
}
|
|
2722
|
+
return {
|
|
2723
|
+
kind: "github",
|
|
2724
|
+
input: installSource.input,
|
|
2725
|
+
location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
|
|
2726
|
+
repository: installSource.repository,
|
|
2727
|
+
owner: installSource.owner,
|
|
2728
|
+
repo: installSource.repo,
|
|
2729
|
+
ref: installSource.ref,
|
|
2730
|
+
subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
|
|
2731
|
+
commit: resolvedSource.commit
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
async function performExtensionInstallUnderLock(ctx, input) {
|
|
2735
|
+
const { scope, resolvedRoots, warnings, global: global2, withResult } = ctx;
|
|
2736
|
+
const { validated, destinationDirectoryName, bundledAliasName, installSource, resolvedSource } = input;
|
|
2737
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2738
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2739
|
+
warnings.push(...managedStateRead.warnings);
|
|
2740
|
+
const destinationDirectory = path5.join(resolvedRoots.selected_root, destinationDirectoryName);
|
|
2741
|
+
const destinationExists = await pathExists(destinationDirectory);
|
|
2742
|
+
const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
|
|
2743
|
+
await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
|
|
2744
|
+
if (!installInPlace) {
|
|
2745
|
+
await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
|
|
2746
|
+
}
|
|
2747
|
+
const sourceRecord = buildInstallManagedSource(bundledAliasName, installSource, resolvedSource);
|
|
2748
|
+
const now = nowIso();
|
|
2749
|
+
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2750
|
+
const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
2751
|
+
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2752
|
+
name: validated.manifest.name,
|
|
2753
|
+
directory: destinationDirectoryName,
|
|
2754
|
+
scope,
|
|
2755
|
+
manifest_version: validated.manifest.version,
|
|
2756
|
+
manifest_entry: validated.manifest.entry,
|
|
2757
|
+
capabilities: [...validated.manifest.capabilities],
|
|
2758
|
+
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
2759
|
+
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
2760
|
+
source: sourceRecord
|
|
2761
|
+
});
|
|
2762
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2763
|
+
const activationChanged = ensureActivated(settings, validated.manifest.name);
|
|
2764
|
+
if (activationChanged) {
|
|
2765
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2766
|
+
}
|
|
2767
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2768
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2769
|
+
const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global2);
|
|
2770
|
+
warnings.push(...runtimeProbe.warnings);
|
|
2771
|
+
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 })));
|
|
2772
|
+
if (scope === "project" && installedItemTypeDefinitions.length > 0) {
|
|
2773
|
+
await ensureTypeFolderScaffold(resolvedRoots.pm_root, installedItemTypeDefinitions, warnings, "install:type-folder");
|
|
2774
|
+
}
|
|
2775
|
+
const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
|
|
2776
|
+
const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
|
|
2777
|
+
const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
|
|
2778
|
+
return withResult({
|
|
2779
|
+
extension: {
|
|
2780
|
+
name: validated.manifest.name,
|
|
2781
|
+
version: validated.manifest.version,
|
|
2782
|
+
entry: validated.manifest.entry,
|
|
2783
|
+
capabilities: validated.manifest.capabilities,
|
|
2784
|
+
directory: destinationDirectoryName
|
|
2785
|
+
},
|
|
2786
|
+
source: sourceRecord,
|
|
2787
|
+
destination_path: destinationDirectory,
|
|
2788
|
+
overwritten: destinationExists && !installInPlace,
|
|
2789
|
+
installed_in_place: installInPlace,
|
|
2790
|
+
activated: true,
|
|
2791
|
+
settings_changed: activationChanged,
|
|
2792
|
+
runtime_activation_status: runtimeActivationStatus,
|
|
2793
|
+
command_paths: commandSummary.command_paths,
|
|
2794
|
+
action_paths: commandSummary.action_paths,
|
|
2795
|
+
command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
|
|
2796
|
+
activation_diagnostics: {
|
|
2797
|
+
failed_count: runtimeProbe.activation_failures.length,
|
|
2798
|
+
failed: runtimeProbe.activation_failures,
|
|
2799
|
+
installed_extension_failed: installActivationFailure ?? null
|
|
2637
2800
|
}
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
const destinationExists = await pathExists(destinationDirectory);
|
|
2655
|
-
const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
|
|
2656
|
-
await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
|
|
2657
|
-
if (!installInPlace) {
|
|
2658
|
-
await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
|
|
2659
|
-
}
|
|
2660
|
-
const sourceRecord = bundledAliasName ? {
|
|
2661
|
-
kind: "builtin",
|
|
2662
|
-
input: bundledAliasName,
|
|
2663
|
-
location: bundledAliasName,
|
|
2664
|
-
name: bundledAliasName
|
|
2665
|
-
} : installSource.kind === "local" ? {
|
|
2666
|
-
kind: "local",
|
|
2667
|
-
input: installSource.input,
|
|
2668
|
-
location: installSource.absolute_path
|
|
2669
|
-
} : installSource.kind === "npm" ? {
|
|
2670
|
-
kind: "npm",
|
|
2671
|
-
input: installSource.input,
|
|
2672
|
-
location: resolvedSource.resolved_subpath ?? ".",
|
|
2673
|
-
package: resolvedSource.npm_package,
|
|
2674
|
-
version: resolvedSource.npm_version
|
|
2675
|
-
} : {
|
|
2676
|
-
kind: "github",
|
|
2677
|
-
input: installSource.input,
|
|
2678
|
-
location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
|
|
2679
|
-
repository: installSource.repository,
|
|
2680
|
-
owner: installSource.owner,
|
|
2681
|
-
repo: installSource.repo,
|
|
2682
|
-
ref: installSource.ref,
|
|
2683
|
-
subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
|
|
2684
|
-
commit: resolvedSource.commit
|
|
2685
|
-
};
|
|
2686
|
-
const now = nowIso();
|
|
2687
|
-
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2688
|
-
const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
2689
|
-
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2690
|
-
name: validated.manifest.name,
|
|
2691
|
-
directory: destinationDirectoryName,
|
|
2692
|
-
scope,
|
|
2693
|
-
manifest_version: validated.manifest.version,
|
|
2694
|
-
manifest_entry: validated.manifest.entry,
|
|
2695
|
-
capabilities: [...validated.manifest.capabilities],
|
|
2696
|
-
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
2697
|
-
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
2698
|
-
source: sourceRecord
|
|
2699
|
-
});
|
|
2700
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2701
|
-
const activationChanged = ensureActivated(settings, validated.manifest.name);
|
|
2702
|
-
if (activationChanged) {
|
|
2703
|
-
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2704
|
-
}
|
|
2705
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2706
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2707
|
-
const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global2);
|
|
2708
|
-
warnings.push(...runtimeProbe.warnings);
|
|
2709
|
-
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 })));
|
|
2710
|
-
if (scope === "project" && installedItemTypeDefinitions.length > 0) {
|
|
2711
|
-
await ensureTypeFolderScaffold(resolvedRoots.pm_root, installedItemTypeDefinitions, warnings, "install:type-folder");
|
|
2712
|
-
}
|
|
2713
|
-
const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
|
|
2714
|
-
const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
|
|
2715
|
-
const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
|
|
2716
|
-
return withResult({
|
|
2717
|
-
extension: {
|
|
2718
|
-
name: validated.manifest.name,
|
|
2719
|
-
version: validated.manifest.version,
|
|
2720
|
-
entry: validated.manifest.entry,
|
|
2721
|
-
capabilities: validated.manifest.capabilities,
|
|
2722
|
-
directory: destinationDirectoryName
|
|
2723
|
-
},
|
|
2724
|
-
source: sourceRecord,
|
|
2725
|
-
destination_path: destinationDirectory,
|
|
2726
|
-
overwritten: destinationExists && !installInPlace,
|
|
2727
|
-
installed_in_place: installInPlace,
|
|
2728
|
-
activated: true,
|
|
2729
|
-
settings_changed: activationChanged,
|
|
2730
|
-
runtime_activation_status: runtimeActivationStatus,
|
|
2731
|
-
command_paths: commandSummary.command_paths,
|
|
2732
|
-
action_paths: commandSummary.action_paths,
|
|
2733
|
-
command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
|
|
2734
|
-
activation_diagnostics: {
|
|
2735
|
-
failed_count: runtimeProbe.activation_failures.length,
|
|
2736
|
-
failed: runtimeProbe.activation_failures,
|
|
2737
|
-
installed_extension_failed: installActivationFailure ?? null
|
|
2738
|
-
}
|
|
2739
|
-
});
|
|
2801
|
+
});
|
|
2802
|
+
}
|
|
2803
|
+
async function runExtensionInstallAction(ctx) {
|
|
2804
|
+
const { action, normalizedTarget, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
2805
|
+
const githubOption = resolveGithubOption(options);
|
|
2806
|
+
const explicitSourceInput = githubOption ?? requireTarget(normalizedTarget, action, options);
|
|
2807
|
+
if (typeof githubOption !== "string" && isBundledPackageInstallAllTarget(explicitSourceInput)) {
|
|
2808
|
+
if (typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2809
|
+
throw new PmCliError('Action "install all" does not accept --ref.', EXIT_CODE.USAGE);
|
|
2810
|
+
}
|
|
2811
|
+
const aliases = await listBundledPackageAliases();
|
|
2812
|
+
const packages = [];
|
|
2813
|
+
for (const alias of aliases) {
|
|
2814
|
+
packages.push({
|
|
2815
|
+
alias,
|
|
2816
|
+
result: await runExtension(alias, { ...options, install: true }, global2)
|
|
2740
2817
|
});
|
|
2741
|
-
} finally {
|
|
2742
|
-
if (resolvedSource.cleanup) {
|
|
2743
|
-
await resolvedSource.cleanup();
|
|
2744
|
-
}
|
|
2745
2818
|
}
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2750
|
-
}
|
|
2751
|
-
const githubOption = resolveGithubOption(options);
|
|
2752
|
-
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2753
|
-
throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2754
|
-
}
|
|
2755
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2756
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2757
|
-
warnings.push(...managedStateRead.warnings);
|
|
2758
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2759
|
-
warnings.push(...installed.warnings);
|
|
2760
|
-
const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
|
|
2761
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
|
|
2762
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2763
|
-
const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
|
|
2764
|
-
warnings.push(...triage.warnings);
|
|
2765
|
-
const adoptedDetails = adoption.adopted_entries.map((entry) => {
|
|
2766
|
-
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 */
|
|
2767
|
-
refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
|
|
2768
|
-
return {
|
|
2769
|
-
...entry,
|
|
2770
|
-
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2771
|
-
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2772
|
-
};
|
|
2773
|
-
});
|
|
2819
|
+
for (const entry of packages) {
|
|
2820
|
+
warnings.push(...entry.result.warnings);
|
|
2821
|
+
}
|
|
2774
2822
|
return withResult({
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2823
|
+
installed_all: true,
|
|
2824
|
+
installed_count: packages.length,
|
|
2825
|
+
packages: packages.map((entry) => ({
|
|
2826
|
+
alias: entry.alias,
|
|
2827
|
+
ok: entry.result.ok,
|
|
2828
|
+
extension: entry.result.details.extension,
|
|
2829
|
+
source: entry.result.details.source,
|
|
2830
|
+
destination_path: entry.result.details.destination_path,
|
|
2831
|
+
activated: entry.result.details.activated,
|
|
2832
|
+
settings_changed: entry.result.details.settings_changed,
|
|
2833
|
+
command_paths: entry.result.details.command_paths,
|
|
2834
|
+
action_paths: entry.result.details.action_paths,
|
|
2835
|
+
command_discovery: entry.result.details.command_discovery,
|
|
2836
|
+
warnings: entry.result.warnings
|
|
2837
|
+
}))
|
|
2783
2838
|
});
|
|
2784
2839
|
}
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
}
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2834
|
-
name: validated.manifest.name,
|
|
2835
|
-
directory: candidate.directory,
|
|
2836
|
-
scope,
|
|
2837
|
-
manifest_version: validated.manifest.version,
|
|
2838
|
-
manifest_entry: validated.manifest.entry,
|
|
2839
|
-
capabilities: [...validated.manifest.capabilities],
|
|
2840
|
-
installed_at: now,
|
|
2841
|
-
updated_at: now,
|
|
2842
|
-
source: sourceRecord
|
|
2843
|
-
});
|
|
2844
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2845
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2846
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2847
|
-
const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
|
|
2848
|
-
return withResult({
|
|
2849
|
-
adopted: true,
|
|
2850
|
-
extension: {
|
|
2851
|
-
name: validated.manifest.name,
|
|
2852
|
-
directory: candidate.directory,
|
|
2853
|
-
version: validated.manifest.version,
|
|
2854
|
-
entry: validated.manifest.entry
|
|
2855
|
-
},
|
|
2856
|
-
source: sourceRecord,
|
|
2840
|
+
const bundledAliasSource = typeof githubOption === "string" ? null : await resolveBundledExtensionAliasSource(explicitSourceInput);
|
|
2841
|
+
const bundledAliasName = bundledAliasSource === null ? null : explicitSourceInput.trim().toLowerCase();
|
|
2842
|
+
const sourceInput = bundledAliasSource ?? explicitSourceInput;
|
|
2843
|
+
const installSource = parseExtensionInstallSource(sourceInput, {
|
|
2844
|
+
forceGithub: typeof githubOption === "string",
|
|
2845
|
+
ref: options.ref
|
|
2846
|
+
});
|
|
2847
|
+
const resolvedSource = await resolveInstallSource(installSource);
|
|
2848
|
+
try {
|
|
2849
|
+
const validated = await validateExtensionDirectory(resolvedSource.directory);
|
|
2850
|
+
const destinationDirectoryName = normalizeManagedDirectoryName(validated.manifest.name);
|
|
2851
|
+
return await withExtensionInstallLock(resolvedRoots.settings_root, destinationDirectoryName, () => performExtensionInstallUnderLock(ctx, {
|
|
2852
|
+
validated,
|
|
2853
|
+
destinationDirectoryName,
|
|
2854
|
+
bundledAliasName,
|
|
2855
|
+
installSource,
|
|
2856
|
+
resolvedSource
|
|
2857
|
+
}));
|
|
2858
|
+
} finally {
|
|
2859
|
+
if (resolvedSource.cleanup) {
|
|
2860
|
+
await resolvedSource.cleanup();
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
async function runExtensionAdoptAllAction(ctx) {
|
|
2865
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2866
|
+
if (normalizedTarget !== void 0) {
|
|
2867
|
+
throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2868
|
+
}
|
|
2869
|
+
const githubOption = resolveGithubOption(options);
|
|
2870
|
+
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2871
|
+
throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2872
|
+
}
|
|
2873
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2874
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2875
|
+
warnings.push(...managedStateRead.warnings);
|
|
2876
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2877
|
+
warnings.push(...installed.warnings);
|
|
2878
|
+
const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
|
|
2879
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
|
|
2880
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2881
|
+
const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
|
|
2882
|
+
warnings.push(...triage.warnings);
|
|
2883
|
+
const adoptedDetails = adoption.adopted_entries.map((entry) => {
|
|
2884
|
+
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 */
|
|
2885
|
+
refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
|
|
2886
|
+
return {
|
|
2887
|
+
...entry,
|
|
2857
2888
|
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2858
2889
|
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2859
|
-
});
|
|
2860
|
-
}
|
|
2861
|
-
if (action === "uninstall") {
|
|
2862
|
-
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2863
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2864
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2865
|
-
warnings.push(...managedStateRead.warnings);
|
|
2866
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2867
|
-
warnings.push(...installed.warnings);
|
|
2868
|
-
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2869
|
-
if (!candidate) {
|
|
2870
|
-
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2871
|
-
}
|
|
2872
|
-
const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2873
|
-
await fs5.rm(destinationDirectory, { recursive: true, force: true });
|
|
2874
|
-
const updatedState = {
|
|
2875
|
-
...managedStateRead.state,
|
|
2876
|
-
updated_at: nowIso(),
|
|
2877
|
-
/* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
|
|
2878
|
-
entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
|
|
2879
|
-
/* c8 ignore stop */
|
|
2880
2890
|
};
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2891
|
+
});
|
|
2892
|
+
return withResult({
|
|
2893
|
+
adopted_all: adoptedDetails.length > 0,
|
|
2894
|
+
adopted_count: adoptedDetails.length,
|
|
2895
|
+
already_managed_count: adoption.already_managed_count,
|
|
2896
|
+
extensions: adoptedDetails,
|
|
2897
|
+
triage,
|
|
2898
|
+
warning_codes: triage.warning_codes,
|
|
2899
|
+
update_health_partial: triage.update_health_partial,
|
|
2900
|
+
update_health_coverage: triage.update_health_coverage
|
|
2901
|
+
});
|
|
2902
|
+
}
|
|
2903
|
+
async function runExtensionAdoptAction(ctx) {
|
|
2904
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2905
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2906
|
+
const githubOption = resolveGithubOption(options);
|
|
2907
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2908
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2909
|
+
warnings.push(...managedStateRead.warnings);
|
|
2910
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2911
|
+
warnings.push(...installed.warnings);
|
|
2912
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2913
|
+
if (!candidate) {
|
|
2914
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2915
|
+
}
|
|
2916
|
+
if (candidate.managed) {
|
|
2886
2917
|
return withResult({
|
|
2887
|
-
|
|
2918
|
+
adopted: false,
|
|
2919
|
+
already_managed: true,
|
|
2888
2920
|
extension: {
|
|
2889
2921
|
name: candidate.name,
|
|
2890
2922
|
directory: candidate.directory
|
|
2891
|
-
}
|
|
2892
|
-
destination_path: destinationDirectory,
|
|
2893
|
-
settings_changed: stateChanged
|
|
2923
|
+
}
|
|
2894
2924
|
});
|
|
2895
2925
|
}
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
if (
|
|
2909
|
-
|
|
2926
|
+
const extensionDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2927
|
+
const validated = await validateExtensionDirectory(extensionDirectory);
|
|
2928
|
+
const now = nowIso();
|
|
2929
|
+
const sourceRecord = githubOption === void 0 ? {
|
|
2930
|
+
kind: "local",
|
|
2931
|
+
input: extensionTarget,
|
|
2932
|
+
location: extensionDirectory
|
|
2933
|
+
} : (() => {
|
|
2934
|
+
const parsed = parseExtensionInstallSource(githubOption, {
|
|
2935
|
+
forceGithub: true,
|
|
2936
|
+
ref: options.ref
|
|
2937
|
+
});
|
|
2938
|
+
if (parsed.kind !== "github") {
|
|
2939
|
+
throw new PmCliError(`Invalid GitHub shorthand "${githubOption}".`, EXIT_CODE.USAGE);
|
|
2910
2940
|
}
|
|
2911
|
-
return
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2941
|
+
return {
|
|
2942
|
+
kind: "github",
|
|
2943
|
+
input: parsed.input,
|
|
2944
|
+
location: parsed.subpath ?? ".",
|
|
2945
|
+
repository: parsed.repository,
|
|
2946
|
+
owner: parsed.owner,
|
|
2947
|
+
repo: parsed.repo,
|
|
2948
|
+
ref: parsed.ref,
|
|
2949
|
+
subpath: parsed.subpath
|
|
2950
|
+
};
|
|
2951
|
+
})();
|
|
2952
|
+
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2953
|
+
name: validated.manifest.name,
|
|
2954
|
+
directory: candidate.directory,
|
|
2955
|
+
scope,
|
|
2956
|
+
manifest_version: validated.manifest.version,
|
|
2957
|
+
manifest_entry: validated.manifest.entry,
|
|
2958
|
+
capabilities: [...validated.manifest.capabilities],
|
|
2959
|
+
installed_at: now,
|
|
2960
|
+
updated_at: now,
|
|
2961
|
+
source: sourceRecord
|
|
2962
|
+
});
|
|
2963
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2964
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2965
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2966
|
+
const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
|
|
2967
|
+
return withResult({
|
|
2968
|
+
adopted: true,
|
|
2969
|
+
extension: {
|
|
2970
|
+
name: validated.manifest.name,
|
|
2971
|
+
directory: candidate.directory,
|
|
2972
|
+
version: validated.manifest.version,
|
|
2973
|
+
entry: validated.manifest.entry
|
|
2974
|
+
},
|
|
2975
|
+
source: sourceRecord,
|
|
2976
|
+
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2977
|
+
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2980
|
+
async function runExtensionUninstallAction(ctx) {
|
|
2981
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2982
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2983
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2984
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2985
|
+
warnings.push(...managedStateRead.warnings);
|
|
2986
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2987
|
+
warnings.push(...installed.warnings);
|
|
2988
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2989
|
+
if (!candidate) {
|
|
2990
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2991
|
+
}
|
|
2992
|
+
const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2993
|
+
await fs5.rm(destinationDirectory, { recursive: true, force: true });
|
|
2994
|
+
const updatedState = {
|
|
2995
|
+
...managedStateRead.state,
|
|
2996
|
+
updated_at: nowIso(),
|
|
2997
|
+
/* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
|
|
2998
|
+
entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
|
|
2999
|
+
/* c8 ignore stop */
|
|
3000
|
+
};
|
|
3001
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, updatedState);
|
|
3002
|
+
const stateChanged = clearExtensionState(settings, candidate.name);
|
|
3003
|
+
if (stateChanged) {
|
|
3004
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
3005
|
+
}
|
|
3006
|
+
return withResult({
|
|
3007
|
+
removed: true,
|
|
3008
|
+
extension: {
|
|
3009
|
+
name: candidate.name,
|
|
3010
|
+
directory: candidate.directory
|
|
3011
|
+
},
|
|
3012
|
+
destination_path: destinationDirectory,
|
|
3013
|
+
settings_changed: stateChanged
|
|
3014
|
+
});
|
|
3015
|
+
}
|
|
3016
|
+
async function runExtensionActivateDeactivateAction(ctx) {
|
|
3017
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
3018
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
3019
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3020
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3021
|
+
warnings.push(...managedStateRead.warnings);
|
|
3022
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3023
|
+
warnings.push(...installed.warnings);
|
|
3024
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
3025
|
+
if (!candidate) {
|
|
3026
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
3027
|
+
}
|
|
3028
|
+
const settingsChanged = action === "activate" ? ensureActivated(settings, candidate.name) : ensureDeactivated(settings, candidate.name);
|
|
3029
|
+
if (settingsChanged) {
|
|
3030
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
3031
|
+
}
|
|
3032
|
+
return withResult({
|
|
3033
|
+
extension: {
|
|
3034
|
+
name: candidate.name,
|
|
3035
|
+
directory: candidate.directory
|
|
3036
|
+
},
|
|
3037
|
+
active: action === "activate",
|
|
3038
|
+
settings_changed: settingsChanged,
|
|
3039
|
+
settings: {
|
|
3040
|
+
enabled: [...settings.extensions.enabled],
|
|
3041
|
+
disabled: [...settings.extensions.disabled]
|
|
3042
|
+
}
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3045
|
+
function buildDoctorRemediation(baseRemediation, loadFailureCount, activationFailureCount, vocabulary, managedStateFix) {
|
|
3046
|
+
return [
|
|
3047
|
+
...new Set([
|
|
3048
|
+
...baseRemediation,
|
|
3049
|
+
/* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
|
|
3050
|
+
...loadFailureCount > 0 ? [
|
|
3051
|
+
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."
|
|
3052
|
+
] : [],
|
|
3053
|
+
...activationFailureCount > 0 ? [
|
|
3054
|
+
vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
|
|
3055
|
+
] : [],
|
|
3056
|
+
/* c8 ignore stop */
|
|
3057
|
+
...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
|
|
3058
|
+
].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
|
|
3059
|
+
];
|
|
3060
|
+
}
|
|
3061
|
+
async function runExtensionDoctorAction(ctx) {
|
|
3062
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
3063
|
+
if (normalizedTarget && normalizedTarget.trim().length > 0) {
|
|
3064
|
+
throw new PmCliError('Action "doctor" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
3065
|
+
}
|
|
3066
|
+
const detailMode = parseDoctorDetailMode(options.detail);
|
|
3067
|
+
const includeTrace = options.trace === true;
|
|
3068
|
+
if (includeTrace && detailMode !== "deep") {
|
|
3069
|
+
throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
|
|
3070
|
+
}
|
|
3071
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3072
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3073
|
+
warnings.push(...managedStateRead.warnings);
|
|
3074
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3075
|
+
warnings.push(...installed.warnings);
|
|
3076
|
+
let managedState = managedStateRead.state;
|
|
3077
|
+
const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3078
|
+
if (managedStateFix) {
|
|
3079
|
+
managedState = managedStateFix.state;
|
|
3080
|
+
}
|
|
3081
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3082
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
3083
|
+
const loadResult = await loadExtensions({
|
|
3084
|
+
pmRoot: resolvedRoots.pm_root,
|
|
3085
|
+
settings,
|
|
3086
|
+
cwd: process.cwd(),
|
|
3087
|
+
noExtensions: global2.noExtensions === true
|
|
3088
|
+
});
|
|
3089
|
+
const activationResult = await activateExtensions({
|
|
3090
|
+
...loadResult,
|
|
3091
|
+
loaded: loadResult.loaded
|
|
3092
|
+
});
|
|
3093
|
+
warnings.push(...loadResult.warnings);
|
|
3094
|
+
warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
|
|
3095
|
+
warnings.push(...activationResult.warnings);
|
|
3096
|
+
warnings.push(...classifyDoctorActivationFailureWarnings(activationResult.failed));
|
|
3097
|
+
warnings.push(...classifyUnusedCapabilityWarnings(loadResult, activationResult));
|
|
3098
|
+
warnings.push(...collectGlobalOutputOverrideDoctorWarnings(activationResult));
|
|
3099
|
+
warnings.push(...collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResult));
|
|
3100
|
+
const runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3101
|
+
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);
|
|
3102
|
+
warnings.push(...doctorConsistency.warnings);
|
|
3103
|
+
const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3104
|
+
warnings.push(...updateCheckWarnings);
|
|
3105
|
+
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3106
|
+
warnings.push(...triage.warnings);
|
|
3107
|
+
const normalizedWarnings = [...triage.warnings];
|
|
3108
|
+
const policySummary = {
|
|
3109
|
+
mode: loadResult.policy.mode,
|
|
3110
|
+
trust_mode: loadResult.policy.trust_mode,
|
|
3111
|
+
require_provenance: loadResult.policy.require_provenance,
|
|
3112
|
+
default_sandbox_profile: loadResult.policy.default_sandbox_profile,
|
|
3113
|
+
// Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
|
|
3114
|
+
sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
|
|
3115
|
+
trusted_extensions_count: loadResult.policy.trusted_extensions.length,
|
|
3116
|
+
allowed_extensions_count: loadResult.policy.allowed_extensions.length,
|
|
3117
|
+
blocked_extensions_count: loadResult.policy.blocked_extensions.length,
|
|
3118
|
+
allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
|
|
3119
|
+
blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
|
|
3120
|
+
allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
|
|
3121
|
+
blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
|
|
3122
|
+
allowed_commands_count: loadResult.policy.allowed_commands.length,
|
|
3123
|
+
blocked_commands_count: loadResult.policy.blocked_commands.length,
|
|
3124
|
+
allowed_actions_count: loadResult.policy.allowed_actions.length,
|
|
3125
|
+
blocked_actions_count: loadResult.policy.blocked_actions.length,
|
|
3126
|
+
allowed_services_count: loadResult.policy.allowed_services.length,
|
|
3127
|
+
blocked_services_count: loadResult.policy.blocked_services.length,
|
|
3128
|
+
extension_override_count: loadResult.policy.extension_overrides.length
|
|
3129
|
+
};
|
|
3130
|
+
const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
|
|
3131
|
+
const capabilityContract = buildCapabilityContractMetadata();
|
|
3132
|
+
const warningCodes = triage.warning_codes;
|
|
3133
|
+
const remediation = buildDoctorRemediation(triage.remediation, loadResult.failed.length, activationResult.failed.length, options.vocabulary, managedStateFix);
|
|
3134
|
+
const summary = {
|
|
3135
|
+
status: triage.status,
|
|
3136
|
+
scope,
|
|
3137
|
+
warning_count: triage.warning_count,
|
|
3138
|
+
warning_codes: warningCodes,
|
|
3139
|
+
total_extensions: runtimeInstalledExtensions.length,
|
|
3140
|
+
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3141
|
+
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3142
|
+
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3143
|
+
unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
|
|
3144
|
+
unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
|
|
3145
|
+
unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
|
|
3146
|
+
runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
|
|
3147
|
+
activation_status_totals: {
|
|
3148
|
+
ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
|
|
3149
|
+
failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
|
|
3150
|
+
not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
|
|
3151
|
+
unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
|
|
3152
|
+
},
|
|
3153
|
+
unknown_capability_count: capabilityGuidance.length,
|
|
3154
|
+
capability_contract_version: capabilityContract.version,
|
|
3155
|
+
update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
|
|
3156
|
+
update_health_coverage: triage.update_health_coverage,
|
|
3157
|
+
update_health_partial: triage.update_health_partial,
|
|
3158
|
+
update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
|
|
3159
|
+
load_failure_count: loadResult.failed.length,
|
|
3160
|
+
activation_failure_count: activationResult.failed.length,
|
|
3161
|
+
blocking_failure_count: loadResult.failed.length + activationResult.failed.length,
|
|
3162
|
+
has_blocking_failures: loadResult.failed.length + activationResult.failed.length > 0,
|
|
3163
|
+
consistency_warning_count: doctorConsistency.warnings.length,
|
|
3164
|
+
trace_enabled: includeTrace,
|
|
3165
|
+
policy: policySummary,
|
|
3166
|
+
remediation
|
|
3167
|
+
};
|
|
3168
|
+
const managedStateFixSummary = managedStateFix ? {
|
|
3169
|
+
requested: true,
|
|
3170
|
+
applied: managedStateFix.adopted_entries.length > 0,
|
|
3171
|
+
adopted_count: managedStateFix.adopted_entries.length,
|
|
3172
|
+
already_managed_count: managedStateFix.already_managed_count,
|
|
3173
|
+
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name)
|
|
3174
|
+
} : {
|
|
3175
|
+
requested: false,
|
|
3176
|
+
applied: false,
|
|
3177
|
+
adopted_count: 0,
|
|
3178
|
+
already_managed_count: refreshedInstalled.extensions.filter((entry) => entry.managed).length,
|
|
3179
|
+
adopted_extensions: []
|
|
3180
|
+
};
|
|
3181
|
+
const details = {
|
|
3182
|
+
mode: detailMode,
|
|
3183
|
+
summary,
|
|
3184
|
+
triage,
|
|
3185
|
+
trace_enabled: includeTrace,
|
|
3186
|
+
capability_contract: capabilityContract,
|
|
3187
|
+
capability_guidance: capabilityGuidance,
|
|
3188
|
+
managed_state_fix: managedStateFixSummary,
|
|
3189
|
+
policy: loadResult.policy
|
|
3190
|
+
};
|
|
3191
|
+
if (detailMode === "deep") {
|
|
3192
|
+
const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
|
|
3193
|
+
const { trace: _trace, ...rest } = entry;
|
|
3194
|
+
return rest;
|
|
3195
|
+
});
|
|
3196
|
+
details.deep = {
|
|
3197
|
+
warnings: normalizedWarnings,
|
|
3198
|
+
warning_codes: warningCodes,
|
|
3199
|
+
capability_contract: capabilityContract,
|
|
3200
|
+
capability_guidance: capabilityGuidance,
|
|
3201
|
+
trace_enabled: includeTrace,
|
|
3202
|
+
managed_state: {
|
|
3203
|
+
path: managedStateRead.path,
|
|
3204
|
+
count: managedState.entries.length,
|
|
3205
|
+
entries: managedState.entries
|
|
2915
3206
|
},
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
3207
|
+
installed_extensions: runtimeInstalledExtensions,
|
|
3208
|
+
load: {
|
|
3209
|
+
roots: loadResult.roots,
|
|
3210
|
+
policy: loadResult.policy,
|
|
3211
|
+
warnings: loadResult.warnings,
|
|
3212
|
+
failed: loadResult.failed,
|
|
3213
|
+
loaded: loadResult.loaded.map((entry) => ({
|
|
3214
|
+
layer: entry.layer,
|
|
3215
|
+
directory: entry.directory,
|
|
3216
|
+
name: entry.name,
|
|
3217
|
+
version: entry.version,
|
|
3218
|
+
entry: entry.entry,
|
|
3219
|
+
priority: entry.priority
|
|
3220
|
+
}))
|
|
3221
|
+
},
|
|
3222
|
+
activation: {
|
|
3223
|
+
failed: activationFailedDetails,
|
|
3224
|
+
warnings: activationResult.warnings,
|
|
3225
|
+
hook_counts: activationResult.hook_counts,
|
|
3226
|
+
registration_counts: activationResult.registration_counts,
|
|
3227
|
+
parser_override_count: activationResult.parser_override_count,
|
|
3228
|
+
preflight_override_count: activationResult.preflight_override_count,
|
|
3229
|
+
service_override_count: activationResult.service_override_count,
|
|
3230
|
+
renderer_override_count: activationResult.renderer_override_count
|
|
3231
|
+
},
|
|
3232
|
+
consistency: doctorConsistency.summary
|
|
3233
|
+
};
|
|
3234
|
+
if (includeTrace) {
|
|
3235
|
+
details.deep.trace = {
|
|
3236
|
+
activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
|
|
3237
|
+
layer: entry.layer,
|
|
3238
|
+
name: entry.name,
|
|
3239
|
+
entry_path: entry.entry_path,
|
|
3240
|
+
error: entry.error,
|
|
3241
|
+
method: entry.trace?.method,
|
|
3242
|
+
command: entry.trace?.command,
|
|
3243
|
+
capability: entry.trace?.capability,
|
|
3244
|
+
missing_capability: entry.trace?.missing_capability,
|
|
3245
|
+
registration_index: entry.trace?.registration_index,
|
|
3246
|
+
expected_schema: entry.trace?.expected_schema,
|
|
3247
|
+
hint: entry.trace?.hint,
|
|
3248
|
+
received: entry.trace?.received
|
|
3249
|
+
}))
|
|
3250
|
+
};
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
return withResult(details);
|
|
3254
|
+
}
|
|
3255
|
+
async function runExtensionDescribeAction(ctx) {
|
|
3256
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
3257
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3258
|
+
const loadResult = await loadExtensions({
|
|
3259
|
+
pmRoot: resolvedRoots.pm_root,
|
|
3260
|
+
settings,
|
|
3261
|
+
cwd: process.cwd(),
|
|
3262
|
+
noExtensions: global2.noExtensions === true
|
|
3263
|
+
});
|
|
3264
|
+
const activationResult = await activateExtensions(loadResult);
|
|
3265
|
+
warnings.push(...loadResult.warnings);
|
|
3266
|
+
warnings.push(...activationResult.warnings);
|
|
3267
|
+
const describeResult = buildExtensionDescribeResult(normalizedTarget, loadResult, activationResult);
|
|
3268
|
+
if (normalizedTarget !== void 0 && describeResult.extensions.length === 0) {
|
|
3269
|
+
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
3270
|
+
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);
|
|
3271
|
+
}
|
|
3272
|
+
return withResult({
|
|
3273
|
+
target: describeResult.target,
|
|
3274
|
+
total: describeResult.total,
|
|
3275
|
+
extensions: describeResult.extensions,
|
|
3276
|
+
union: describeResult.union
|
|
3277
|
+
});
|
|
3278
|
+
}
|
|
3279
|
+
async function runExtensionExploreManageAction(ctx) {
|
|
3280
|
+
const { action, scope, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
3281
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3282
|
+
const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
|
|
3283
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3284
|
+
warnings.push(...managedStateRead.warnings);
|
|
3285
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3286
|
+
warnings.push(...installed.warnings);
|
|
3287
|
+
let managedState = managedStateRead.state;
|
|
3288
|
+
const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3289
|
+
if (managedStateFix) {
|
|
3290
|
+
managedState = managedStateFix.state;
|
|
3291
|
+
}
|
|
3292
|
+
if (action === "manage") {
|
|
3293
|
+
const updates = await Promise.all(managedState.entries.map(async (entry) => {
|
|
3294
|
+
if (entry.source.kind !== "github") {
|
|
3295
|
+
return entry;
|
|
2921
3296
|
}
|
|
2922
|
-
|
|
3297
|
+
const updateStatus = await checkGithubUpdate(entry.source);
|
|
3298
|
+
return {
|
|
3299
|
+
...entry,
|
|
3300
|
+
last_update_check_at: updateStatus.checked_at,
|
|
3301
|
+
last_update_remote_commit: updateStatus.remote_commit,
|
|
3302
|
+
update_available: updateStatus.available,
|
|
3303
|
+
update_error: updateStatus.error
|
|
3304
|
+
};
|
|
3305
|
+
}));
|
|
3306
|
+
managedState = {
|
|
3307
|
+
...managedState,
|
|
3308
|
+
updated_at: nowIso(),
|
|
3309
|
+
entries: sortManagedEntries(updates)
|
|
3310
|
+
};
|
|
3311
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
3312
|
+
}
|
|
3313
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3314
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
3315
|
+
if (action === "manage") {
|
|
3316
|
+
const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3317
|
+
warnings.push(...updateWarnings);
|
|
2923
3318
|
}
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
const detailMode = parseDoctorDetailMode(options.detail);
|
|
2929
|
-
const includeTrace = options.trace === true;
|
|
2930
|
-
if (includeTrace && detailMode !== "deep") {
|
|
2931
|
-
throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
|
|
2932
|
-
}
|
|
2933
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2934
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2935
|
-
warnings.push(...managedStateRead.warnings);
|
|
2936
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2937
|
-
warnings.push(...installed.warnings);
|
|
2938
|
-
let managedState = managedStateRead.state;
|
|
2939
|
-
const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
2940
|
-
if (managedStateFix) {
|
|
2941
|
-
managedState = managedStateFix.state;
|
|
2942
|
-
}
|
|
2943
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2944
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
3319
|
+
let runtimeProbeSummary;
|
|
3320
|
+
let runtimeInstalledExtensions = refreshedInstalled.extensions;
|
|
3321
|
+
let runtimeActivationFailures;
|
|
3322
|
+
if (action === "explore" || options.runtimeProbe === true) {
|
|
2945
3323
|
const loadResult = await loadExtensions({
|
|
2946
3324
|
pmRoot: resolvedRoots.pm_root,
|
|
2947
3325
|
settings,
|
|
@@ -2953,315 +3331,77 @@ async function runExtension(target, options, global2) {
|
|
|
2953
3331
|
loaded: loadResult.loaded
|
|
2954
3332
|
});
|
|
2955
3333
|
warnings.push(...loadResult.warnings);
|
|
2956
|
-
warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
|
|
2957
3334
|
warnings.push(...activationResult.warnings);
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
warnings.push(...doctorConsistency.warnings);
|
|
2965
|
-
const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
2966
|
-
warnings.push(...updateCheckWarnings);
|
|
2967
|
-
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
2968
|
-
warnings.push(...triage.warnings);
|
|
2969
|
-
const normalizedWarnings = [...triage.warnings];
|
|
2970
|
-
const policySummary = {
|
|
2971
|
-
mode: loadResult.policy.mode,
|
|
2972
|
-
trust_mode: loadResult.policy.trust_mode,
|
|
2973
|
-
require_provenance: loadResult.policy.require_provenance,
|
|
2974
|
-
default_sandbox_profile: loadResult.policy.default_sandbox_profile,
|
|
2975
|
-
// Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
|
|
2976
|
-
sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
|
|
2977
|
-
trusted_extensions_count: loadResult.policy.trusted_extensions.length,
|
|
2978
|
-
allowed_extensions_count: loadResult.policy.allowed_extensions.length,
|
|
2979
|
-
blocked_extensions_count: loadResult.policy.blocked_extensions.length,
|
|
2980
|
-
allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
|
|
2981
|
-
blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
|
|
2982
|
-
allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
|
|
2983
|
-
blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
|
|
2984
|
-
allowed_commands_count: loadResult.policy.allowed_commands.length,
|
|
2985
|
-
blocked_commands_count: loadResult.policy.blocked_commands.length,
|
|
2986
|
-
allowed_actions_count: loadResult.policy.allowed_actions.length,
|
|
2987
|
-
blocked_actions_count: loadResult.policy.blocked_actions.length,
|
|
2988
|
-
allowed_services_count: loadResult.policy.allowed_services.length,
|
|
2989
|
-
blocked_services_count: loadResult.policy.blocked_services.length,
|
|
2990
|
-
extension_override_count: loadResult.policy.extension_overrides.length
|
|
2991
|
-
};
|
|
2992
|
-
const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
|
|
2993
|
-
const capabilityContract = buildCapabilityContractMetadata();
|
|
2994
|
-
const warningCodes = triage.warning_codes;
|
|
2995
|
-
const remediation = [
|
|
2996
|
-
...new Set([
|
|
2997
|
-
...triage.remediation,
|
|
2998
|
-
/* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
|
|
2999
|
-
...loadResult.failed.length > 0 ? [
|
|
3000
|
-
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."
|
|
3001
|
-
] : [],
|
|
3002
|
-
...activationResult.failed.length > 0 ? [
|
|
3003
|
-
options.vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
|
|
3004
|
-
] : [],
|
|
3005
|
-
/* c8 ignore stop */
|
|
3006
|
-
...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
|
|
3007
|
-
].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
|
|
3008
|
-
];
|
|
3009
|
-
const summary = {
|
|
3010
|
-
status: triage.status,
|
|
3011
|
-
scope,
|
|
3012
|
-
warning_count: triage.warning_count,
|
|
3013
|
-
warning_codes: warningCodes,
|
|
3014
|
-
total_extensions: runtimeInstalledExtensions.length,
|
|
3015
|
-
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3016
|
-
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3017
|
-
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3018
|
-
unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
|
|
3019
|
-
unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
|
|
3020
|
-
unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
|
|
3021
|
-
runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
|
|
3022
|
-
activation_status_totals: {
|
|
3023
|
-
ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
|
|
3024
|
-
failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
|
|
3025
|
-
not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
|
|
3026
|
-
unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
|
|
3027
|
-
},
|
|
3028
|
-
unknown_capability_count: capabilityGuidance.length,
|
|
3029
|
-
capability_contract_version: capabilityContract.version,
|
|
3030
|
-
update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
|
|
3031
|
-
update_health_coverage: triage.update_health_coverage,
|
|
3032
|
-
update_health_partial: triage.update_health_partial,
|
|
3033
|
-
update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
|
|
3335
|
+
runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3336
|
+
runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
|
|
3337
|
+
runtimeProbeSummary = {
|
|
3338
|
+
requested: true,
|
|
3339
|
+
executed: true,
|
|
3340
|
+
reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
|
|
3034
3341
|
load_failure_count: loadResult.failed.length,
|
|
3035
3342
|
activation_failure_count: activationResult.failed.length,
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
consistency_warning_count: doctorConsistency.warnings.length,
|
|
3039
|
-
trace_enabled: includeTrace,
|
|
3040
|
-
policy: policySummary,
|
|
3041
|
-
remediation
|
|
3343
|
+
warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
|
|
3344
|
+
policy: loadResult.policy
|
|
3042
3345
|
};
|
|
3043
|
-
|
|
3346
|
+
} else if (action === "manage") {
|
|
3347
|
+
runtimeProbeSummary = {
|
|
3348
|
+
requested: false,
|
|
3349
|
+
executed: false
|
|
3350
|
+
};
|
|
3351
|
+
}
|
|
3352
|
+
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3353
|
+
warnings.push(...triage.warnings);
|
|
3354
|
+
const details = {
|
|
3355
|
+
total: runtimeInstalledExtensions.length,
|
|
3356
|
+
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3357
|
+
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3358
|
+
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3359
|
+
extensions: runtimeInstalledExtensions,
|
|
3360
|
+
triage,
|
|
3361
|
+
policy: configuredPolicy
|
|
3362
|
+
};
|
|
3363
|
+
if (runtimeActivationFailures !== void 0) {
|
|
3364
|
+
details.activation_diagnostics = {
|
|
3365
|
+
failed_count: runtimeActivationFailures.length,
|
|
3366
|
+
failed: runtimeActivationFailures
|
|
3367
|
+
};
|
|
3368
|
+
}
|
|
3369
|
+
if (action === "explore") {
|
|
3370
|
+
details.runtime_probe = runtimeProbeSummary;
|
|
3371
|
+
}
|
|
3372
|
+
if (action === "manage") {
|
|
3373
|
+
details.runtime_probe = runtimeProbeSummary;
|
|
3374
|
+
details.managed_state_fix = managedStateFix !== null ? {
|
|
3044
3375
|
requested: true,
|
|
3045
3376
|
applied: managedStateFix.adopted_entries.length > 0,
|
|
3046
3377
|
adopted_count: managedStateFix.adopted_entries.length,
|
|
3047
|
-
|
|
3048
|
-
|
|
3378
|
+
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
|
|
3379
|
+
already_managed_count: managedStateFix.already_managed_count
|
|
3049
3380
|
} : {
|
|
3050
3381
|
requested: false,
|
|
3051
3382
|
applied: false,
|
|
3052
3383
|
adopted_count: 0,
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
};
|
|
3056
|
-
const details = {
|
|
3057
|
-
mode: detailMode,
|
|
3058
|
-
summary,
|
|
3059
|
-
triage,
|
|
3060
|
-
trace_enabled: includeTrace,
|
|
3061
|
-
capability_contract: capabilityContract,
|
|
3062
|
-
capability_guidance: capabilityGuidance,
|
|
3063
|
-
managed_state_fix: managedStateFixSummary,
|
|
3064
|
-
policy: loadResult.policy
|
|
3065
|
-
};
|
|
3066
|
-
if (detailMode === "deep") {
|
|
3067
|
-
const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
|
|
3068
|
-
const { trace: _trace, ...rest } = entry;
|
|
3069
|
-
return rest;
|
|
3070
|
-
});
|
|
3071
|
-
details.deep = {
|
|
3072
|
-
warnings: normalizedWarnings,
|
|
3073
|
-
warning_codes: warningCodes,
|
|
3074
|
-
capability_contract: capabilityContract,
|
|
3075
|
-
capability_guidance: capabilityGuidance,
|
|
3076
|
-
trace_enabled: includeTrace,
|
|
3077
|
-
managed_state: {
|
|
3078
|
-
path: managedStateRead.path,
|
|
3079
|
-
count: managedState.entries.length,
|
|
3080
|
-
entries: managedState.entries
|
|
3081
|
-
},
|
|
3082
|
-
installed_extensions: runtimeInstalledExtensions,
|
|
3083
|
-
load: {
|
|
3084
|
-
roots: loadResult.roots,
|
|
3085
|
-
policy: loadResult.policy,
|
|
3086
|
-
warnings: loadResult.warnings,
|
|
3087
|
-
failed: loadResult.failed,
|
|
3088
|
-
loaded: loadResult.loaded.map((entry) => ({
|
|
3089
|
-
layer: entry.layer,
|
|
3090
|
-
directory: entry.directory,
|
|
3091
|
-
name: entry.name,
|
|
3092
|
-
version: entry.version,
|
|
3093
|
-
entry: entry.entry,
|
|
3094
|
-
priority: entry.priority
|
|
3095
|
-
}))
|
|
3096
|
-
},
|
|
3097
|
-
activation: {
|
|
3098
|
-
failed: activationFailedDetails,
|
|
3099
|
-
warnings: activationResult.warnings,
|
|
3100
|
-
hook_counts: activationResult.hook_counts,
|
|
3101
|
-
registration_counts: activationResult.registration_counts,
|
|
3102
|
-
parser_override_count: activationResult.parser_override_count,
|
|
3103
|
-
preflight_override_count: activationResult.preflight_override_count,
|
|
3104
|
-
service_override_count: activationResult.service_override_count,
|
|
3105
|
-
renderer_override_count: activationResult.renderer_override_count
|
|
3106
|
-
},
|
|
3107
|
-
consistency: doctorConsistency.summary
|
|
3108
|
-
};
|
|
3109
|
-
if (includeTrace) {
|
|
3110
|
-
details.deep.trace = {
|
|
3111
|
-
activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
|
|
3112
|
-
layer: entry.layer,
|
|
3113
|
-
name: entry.name,
|
|
3114
|
-
entry_path: entry.entry_path,
|
|
3115
|
-
error: entry.error,
|
|
3116
|
-
method: entry.trace?.method,
|
|
3117
|
-
command: entry.trace?.command,
|
|
3118
|
-
capability: entry.trace?.capability,
|
|
3119
|
-
missing_capability: entry.trace?.missing_capability,
|
|
3120
|
-
registration_index: entry.trace?.registration_index,
|
|
3121
|
-
expected_schema: entry.trace?.expected_schema,
|
|
3122
|
-
hint: entry.trace?.hint,
|
|
3123
|
-
received: entry.trace?.received
|
|
3124
|
-
}))
|
|
3125
|
-
};
|
|
3126
|
-
}
|
|
3127
|
-
}
|
|
3128
|
-
return withResult(details);
|
|
3129
|
-
}
|
|
3130
|
-
if (action === "describe") {
|
|
3131
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3132
|
-
const loadResult = await loadExtensions({
|
|
3133
|
-
pmRoot: resolvedRoots.pm_root,
|
|
3134
|
-
settings,
|
|
3135
|
-
cwd: process.cwd(),
|
|
3136
|
-
noExtensions: global2.noExtensions === true
|
|
3137
|
-
});
|
|
3138
|
-
const activationResult = await activateExtensions(loadResult);
|
|
3139
|
-
warnings.push(...loadResult.warnings);
|
|
3140
|
-
warnings.push(...activationResult.warnings);
|
|
3141
|
-
const describeResult = buildExtensionDescribeResult(normalizedTarget, loadResult, activationResult);
|
|
3142
|
-
if (normalizedTarget !== void 0 && describeResult.extensions.length === 0) {
|
|
3143
|
-
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
3144
|
-
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);
|
|
3145
|
-
}
|
|
3146
|
-
return withResult({
|
|
3147
|
-
target: describeResult.target,
|
|
3148
|
-
total: describeResult.total,
|
|
3149
|
-
extensions: describeResult.extensions,
|
|
3150
|
-
union: describeResult.union
|
|
3151
|
-
});
|
|
3152
|
-
}
|
|
3153
|
-
if (action === "explore" || action === "manage") {
|
|
3154
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3155
|
-
const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
|
|
3156
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3157
|
-
warnings.push(...managedStateRead.warnings);
|
|
3158
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3159
|
-
warnings.push(...installed.warnings);
|
|
3160
|
-
let managedState = managedStateRead.state;
|
|
3161
|
-
const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3162
|
-
if (managedStateFix) {
|
|
3163
|
-
managedState = managedStateFix.state;
|
|
3164
|
-
}
|
|
3165
|
-
if (action === "manage") {
|
|
3166
|
-
const updates = await Promise.all(managedState.entries.map(async (entry) => {
|
|
3167
|
-
if (entry.source.kind !== "github") {
|
|
3168
|
-
return entry;
|
|
3169
|
-
}
|
|
3170
|
-
const updateStatus = await checkGithubUpdate(entry.source);
|
|
3171
|
-
return {
|
|
3172
|
-
...entry,
|
|
3173
|
-
last_update_check_at: updateStatus.checked_at,
|
|
3174
|
-
last_update_remote_commit: updateStatus.remote_commit,
|
|
3175
|
-
update_available: updateStatus.available,
|
|
3176
|
-
update_error: updateStatus.error
|
|
3177
|
-
};
|
|
3178
|
-
}));
|
|
3179
|
-
managedState = {
|
|
3180
|
-
...managedState,
|
|
3181
|
-
updated_at: nowIso(),
|
|
3182
|
-
entries: sortManagedEntries(updates)
|
|
3183
|
-
};
|
|
3184
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
3185
|
-
}
|
|
3186
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3187
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
3188
|
-
if (action === "manage") {
|
|
3189
|
-
const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3190
|
-
warnings.push(...updateWarnings);
|
|
3191
|
-
}
|
|
3192
|
-
let runtimeProbeSummary;
|
|
3193
|
-
let runtimeInstalledExtensions = refreshedInstalled.extensions;
|
|
3194
|
-
let runtimeActivationFailures;
|
|
3195
|
-
if (action === "explore" || options.runtimeProbe === true) {
|
|
3196
|
-
const loadResult = await loadExtensions({
|
|
3197
|
-
pmRoot: resolvedRoots.pm_root,
|
|
3198
|
-
settings,
|
|
3199
|
-
cwd: process.cwd(),
|
|
3200
|
-
noExtensions: global2.noExtensions === true
|
|
3201
|
-
});
|
|
3202
|
-
const activationResult = await activateExtensions({
|
|
3203
|
-
...loadResult,
|
|
3204
|
-
loaded: loadResult.loaded
|
|
3205
|
-
});
|
|
3206
|
-
warnings.push(...loadResult.warnings);
|
|
3207
|
-
warnings.push(...activationResult.warnings);
|
|
3208
|
-
runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3209
|
-
runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
|
|
3210
|
-
runtimeProbeSummary = {
|
|
3211
|
-
requested: true,
|
|
3212
|
-
executed: true,
|
|
3213
|
-
reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
|
|
3214
|
-
load_failure_count: loadResult.failed.length,
|
|
3215
|
-
activation_failure_count: activationResult.failed.length,
|
|
3216
|
-
warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
|
|
3217
|
-
policy: loadResult.policy
|
|
3218
|
-
};
|
|
3219
|
-
} else if (action === "manage") {
|
|
3220
|
-
runtimeProbeSummary = {
|
|
3221
|
-
requested: false,
|
|
3222
|
-
executed: false
|
|
3223
|
-
};
|
|
3224
|
-
}
|
|
3225
|
-
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3226
|
-
warnings.push(...triage.warnings);
|
|
3227
|
-
const details = {
|
|
3228
|
-
total: runtimeInstalledExtensions.length,
|
|
3229
|
-
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3230
|
-
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3231
|
-
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3232
|
-
extensions: runtimeInstalledExtensions,
|
|
3233
|
-
triage,
|
|
3234
|
-
policy: configuredPolicy
|
|
3384
|
+
adopted_extensions: [],
|
|
3385
|
+
already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
|
|
3235
3386
|
};
|
|
3236
|
-
if (runtimeActivationFailures !== void 0) {
|
|
3237
|
-
details.activation_diagnostics = {
|
|
3238
|
-
failed_count: runtimeActivationFailures.length,
|
|
3239
|
-
failed: runtimeActivationFailures
|
|
3240
|
-
};
|
|
3241
|
-
}
|
|
3242
|
-
if (action === "explore") {
|
|
3243
|
-
details.runtime_probe = runtimeProbeSummary;
|
|
3244
|
-
}
|
|
3245
|
-
if (action === "manage") {
|
|
3246
|
-
details.runtime_probe = runtimeProbeSummary;
|
|
3247
|
-
details.managed_state_fix = managedStateFix !== null ? {
|
|
3248
|
-
requested: true,
|
|
3249
|
-
applied: managedStateFix.adopted_entries.length > 0,
|
|
3250
|
-
adopted_count: managedStateFix.adopted_entries.length,
|
|
3251
|
-
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
|
|
3252
|
-
already_managed_count: managedStateFix.already_managed_count
|
|
3253
|
-
} : {
|
|
3254
|
-
requested: false,
|
|
3255
|
-
applied: false,
|
|
3256
|
-
adopted_count: 0,
|
|
3257
|
-
adopted_extensions: [],
|
|
3258
|
-
already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
|
|
3259
|
-
};
|
|
3260
|
-
}
|
|
3261
|
-
return withResult(details);
|
|
3262
3387
|
}
|
|
3263
|
-
|
|
3264
|
-
}
|
|
3388
|
+
return withResult(details);
|
|
3389
|
+
}
|
|
3390
|
+
var EXTENSION_ACTION_HANDLERS = {
|
|
3391
|
+
init: runExtensionInitAction,
|
|
3392
|
+
install: runExtensionInstallAction,
|
|
3393
|
+
uninstall: runExtensionUninstallAction,
|
|
3394
|
+
explore: runExtensionExploreManageAction,
|
|
3395
|
+
manage: runExtensionExploreManageAction,
|
|
3396
|
+
describe: runExtensionDescribeAction,
|
|
3397
|
+
reload: runExtensionReloadAction,
|
|
3398
|
+
doctor: runExtensionDoctorAction,
|
|
3399
|
+
catalog: runExtensionCatalogAction,
|
|
3400
|
+
adopt: runExtensionAdoptAction,
|
|
3401
|
+
"adopt-all": runExtensionAdoptAllAction,
|
|
3402
|
+
activate: runExtensionActivateDeactivateAction,
|
|
3403
|
+
deactivate: runExtensionActivateDeactivateAction
|
|
3404
|
+
};
|
|
3265
3405
|
var _testOnly = {
|
|
3266
3406
|
adoptUnmanagedExtensions,
|
|
3267
3407
|
buildExtensionPolicyDetails,
|
|
@@ -3299,4 +3439,4 @@ export {
|
|
|
3299
3439
|
runExtension,
|
|
3300
3440
|
_testOnly
|
|
3301
3441
|
};
|
|
3302
|
-
//# sourceMappingURL=chunk-
|
|
3442
|
+
//# sourceMappingURL=chunk-5QFDBI4F.js.map
|