@unbrained/pm-cli 2026.6.24 → 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 +113 -1
- package/CONTRIBUTING.md +30 -0
- package/README.md +16 -3
- package/dist/cli/bootstrap-args.js +89 -79
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +3 -3
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/aggregate.js +8 -7
- package/dist/cli/commands/aggregate.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/close.d.ts +2 -4
- package/dist/cli/commands/close.js +5 -17
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/completion.js +158 -9
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/config.js +2 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +31 -4
- package/dist/cli/commands/context.js +33 -10
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +48 -8
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -6
- package/dist/cli/commands/create.js +491 -587
- 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/describe.d.ts +15 -0
- package/dist/cli/commands/extension/describe.js +48 -2
- package/dist/cli/commands/extension/describe.js.map +1 -1
- package/dist/cli/commands/extension/doctor.js +129 -75
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +37 -7
- package/dist/cli/commands/extension/install-sources.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 +38 -8
- package/dist/cli/commands/extension/scaffold.js +1956 -242
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +28 -3
- package/dist/cli/commands/extension.js +1181 -880
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/item-filter-options.d.ts +63 -0
- package/dist/cli/commands/item-filter-options.js +10 -0
- package/dist/cli/commands/item-filter-options.js.map +1 -0
- package/dist/cli/commands/legacy-none-tokens.d.ts +14 -0
- package/dist/cli/commands/legacy-none-tokens.js +31 -2
- package/dist/cli/commands/legacy-none-tokens.js.map +1 -1
- package/dist/cli/commands/linked-artifacts.d.ts +7 -0
- package/dist/cli/commands/linked-artifacts.js +12 -2
- package/dist/cli/commands/linked-artifacts.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/list.d.ts +16 -39
- package/dist/cli/commands/list.js +127 -118
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/next.d.ts +98 -0
- package/dist/cli/commands/next.js +304 -0
- package/dist/cli/commands/next.js.map +1 -0
- package/dist/cli/commands/profile.d.ts +208 -0
- package/dist/cli/commands/profile.js +418 -0
- package/dist/cli/commands/profile.js.map +1 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js +12 -13
- package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +7 -0
- package/dist/cli/commands/schema.js +9 -3
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +2 -39
- package/dist/cli/commands/search.js +196 -172
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/shared-unset-fields.d.ts +30 -0
- package/dist/cli/commands/shared-unset-fields.js +161 -0
- package/dist/cli/commands/shared-unset-fields.js.map +1 -0
- package/dist/cli/commands/stats.js +15 -3
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/test.js +115 -125
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update.d.ts +1 -6
- package/dist/cli/commands/update.js +37 -232
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.js +20 -5
- package/dist/cli/commands/validate.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/help-content.js +26 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.js +3 -3
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +27 -12
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +42 -3
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +86 -2
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-setup.js +67 -6
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +9 -1
- package/dist/cli/registration-helpers.js +149 -123
- 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-N7RVTLBQ.js → activity-DBLQVIP6.js} +9 -11
- package/dist/cli-bundle/chunks/{aggregate-63NWNIBR.js → aggregate-JTEF4BP7.js} +17 -18
- package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-YHCYX2EV.js → aggregate-SDF7DUOD.js} +16 -17
- package/dist/cli-bundle/chunks/aggregate-SDF7DUOD.js.map +7 -0
- package/dist/cli-bundle/chunks/{append-VLQQDHMJ.js → append-LOVPGVPT.js} +8 -10
- package/dist/cli-bundle/chunks/{append-VLQQDHMJ.js.map → append-LOVPGVPT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-PUKREFV5.js → append-QCFJSDFL.js} +10 -12
- package/dist/cli-bundle/chunks/{append-PUKREFV5.js.map → append-QCFJSDFL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ABYCA5VX.js → chunk-22WKIL3H.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-ABYCA5VX.js.map → chunk-22WKIL3H.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-A66VYUOV.js → chunk-2466X6E4.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-A66VYUOV.js.map → chunk-2466X6E4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-F32L4HR6.js → chunk-27BXPBAY.js} +3 -3
- package/dist/cli-bundle/chunks/{schema-QO5I4FBL.js → chunk-2D4HATP2.js} +136 -66
- package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-J7I4C5ZB.js → chunk-3J6JRJ3I.js} +153 -125
- package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OHDQNKJB.js → chunk-3K2M5OYU.js} +106 -34
- package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XVYKWZNL.js → chunk-3S2KT7NG.js} +127 -127
- package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5BBEWX6C.js → chunk-3VGN2UWE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N5B6WZC5.js → chunk-3XZCOZ5J.js} +115 -123
- 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-HZF5RLKX.js → chunk-4DSGXSBL.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-HZF5RLKX.js.map → chunk-4DSGXSBL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JV27C7OZ.js → chunk-4DUVCVLZ.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-JV27C7OZ.js.map → chunk-4DUVCVLZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IAP5KYBQ.js → chunk-4XOIEKSD.js} +563 -506
- package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-5LB7UGKE.js → chunk-55SNVXRQ.js} +79 -82
- package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-BFFO3AIB.js → chunk-5CGRF3L5.js} +128 -128
- package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JKL6HRMV.js → chunk-5QFDBI4F.js} +1260 -1046
- package/dist/cli-bundle/chunks/chunk-5QFDBI4F.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LU36E6GU.js → chunk-64HNBBFQ.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-LU36E6GU.js.map → chunk-64HNBBFQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js +2444 -0
- package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-7M2HAZEB.js +17 -0
- package/dist/cli-bundle/chunks/chunk-7M2HAZEB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VSAABFGQ.js → chunk-7R4QEMZZ.js} +1490 -734
- package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-M6TUBOGW.js → chunk-A7FPBAQS.js} +19 -12
- package/dist/cli-bundle/chunks/chunk-A7FPBAQS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GQYJEEFX.js → chunk-AVEE5EHK.js} +53 -54
- package/dist/cli-bundle/chunks/chunk-AVEE5EHK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FMWW2JDU.js → chunk-AXIDKKAT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TIM4OD74.js → chunk-BDTISOSD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-C4C3EJCJ.js → chunk-BHO33VBQ.js} +509 -363
- package/dist/cli-bundle/chunks/chunk-BHO33VBQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6W3Y65PL.js → chunk-BZCEN4JA.js} +198 -177
- package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RRP6D345.js → chunk-CF7RL6FR.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-RRP6D345.js.map → chunk-CF7RL6FR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HC2S36NB.js → chunk-CWFNTKQJ.js} +154 -126
- package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-CZVISY5A.js +87 -0
- package/dist/cli-bundle/chunks/chunk-CZVISY5A.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CZIFFMZI.js → chunk-DDPTYJIM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AYPQUFCX.js → chunk-EJUDVUYZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EOGBMLCE.js → chunk-EVMTBV6V.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RAWA3Y7O.js → chunk-FFMQB7WR.js} +199 -178
- package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CG3KP6I5.js → chunk-G7I7DEZA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MEXZ5XUM.js → chunk-GJ326ZKX.js} +53 -54
- package/dist/cli-bundle/chunks/chunk-GJ326ZKX.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-HPPFYYOV.js +119 -0
- package/dist/cli-bundle/chunks/chunk-HPPFYYOV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OF7V47P3.js → chunk-HXTQJXWT.js} +2172 -2146
- package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-F4BNR2IN.js → chunk-HYTGA6GI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2WCYE3IF.js → chunk-HZZEHPRG.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-IBMFIKVS.js +14 -0
- package/dist/cli-bundle/chunks/chunk-IBMFIKVS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YV2OSAMS.js → chunk-IJYK2T43.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4XDGYFHL.js → chunk-IPYBJWTE.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-4XDGYFHL.js.map → chunk-IPYBJWTE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6EBNFQOR.js → chunk-IZBR4NRW.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-6EBNFQOR.js.map → chunk-IZBR4NRW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VFJYVXHL.js → chunk-JLM7BHI7.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-VFJYVXHL.js.map → chunk-JLM7BHI7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6EL7SW5C.js → chunk-JMP4E6D7.js} +114 -122
- package/dist/cli-bundle/chunks/chunk-JMP4E6D7.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QOUOMPHO.js → chunk-JPECA746.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KJZOSF7J.js → chunk-JSU5P7VS.js} +100 -35
- package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-55VEOYI3.js → chunk-JWXRETDF.js} +79 -82
- package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OQ2E64FH.js → chunk-KNPEF7QG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3BKH2CL3.js → chunk-L5OEFZQG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DTABLLVE.js → chunk-LB6TP6MC.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-DTABLLVE.js.map → chunk-LB6TP6MC.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TSI32UEL.js → chunk-MAUKX7JC.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-TSI32UEL.js.map → chunk-MAUKX7JC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SMXSDY7J.js → chunk-MDPEOIGN.js} +2221 -2172
- package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5S4ZGDB2.js → chunk-N74UMG5H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IXAZI443.js → chunk-NFDPYAIP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SKC4UTRP.js → chunk-NKZAN7BD.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-NOLPZMSV.js +116 -0
- package/dist/cli-bundle/chunks/chunk-NOLPZMSV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-L7UXKP2I.js → chunk-NU2UEROZ.js} +1257 -1029
- package/dist/cli-bundle/chunks/chunk-NU2UEROZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HBAEFWX3.js → chunk-NUHHPVVS.js} +65 -335
- package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JPJDP4VU.js → chunk-NWMZWYYB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MWMHZOZZ.js → chunk-OGXLACHC.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-MWMHZOZZ.js.map → chunk-OGXLACHC.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-OKQ22KTH.js +379 -0
- package/dist/cli-bundle/chunks/chunk-OKQ22KTH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KKX4Z2SE.js → chunk-OTUHB4HS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ZLWRPBOW.js → chunk-QCWF6IYD.js} +510 -364
- package/dist/cli-bundle/chunks/chunk-QCWF6IYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PRVTGX64.js → chunk-RGEMWD6Q.js} +11 -23
- package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +7 -0
- 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-ALQKV6U7.js → chunk-RLDHZHQS.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-ALQKV6U7.js.map → chunk-RLDHZHQS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{schema-C6QA367T.js → chunk-RMMQ74TG.js} +144 -67
- package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EYPINTFR.js → chunk-RVUALSJF.js} +1516 -753
- package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js +2468 -0
- package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WB5BYQMF.js → chunk-SLMUGTK3.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-SUREE24M.js → chunk-TP5Q5ZD3.js} +12 -24
- package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UACWNBL2.js → chunk-UYUYDGIB.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-UACWNBL2.js.map → chunk-UYUYDGIB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-V4UYNSEM.js → chunk-UZIWVBE6.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-V4UYNSEM.js.map → chunk-UZIWVBE6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EWRSXOIZ.js → chunk-V3NOKJF2.js} +11 -13
- package/dist/cli-bundle/chunks/{chunk-EWRSXOIZ.js.map → chunk-V3NOKJF2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XXKV4UWE.js → chunk-VARHOHYV.js} +571 -507
- package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AEACLRVH.js → chunk-VICZWYGZ.js} +18 -11
- package/dist/cli-bundle/chunks/chunk-VICZWYGZ.js.map +7 -0
- 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-VZDBVEZR.js +382 -0
- package/dist/cli-bundle/chunks/chunk-VZDBVEZR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GDUMGZK3.js → chunk-W4ULYO7Z.js} +11 -13
- package/dist/cli-bundle/chunks/{chunk-GDUMGZK3.js.map → chunk-W4ULYO7Z.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-I6QMJ2XT.js → chunk-WYDHYJPO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ALKFCIIB.js → chunk-YITK2PJ6.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-ALKFCIIB.js.map → chunk-YITK2PJ6.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-YJIEJRZB.js +84 -0
- package/dist/cli-bundle/chunks/chunk-YJIEJRZB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LNEDHJNQ.js → chunk-ZETXE4SE.js} +66 -329
- package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KIEAK7YE.js → chunk-ZRP4VG5U.js} +2 -2
- package/dist/cli-bundle/chunks/{claim-FZZZCAY6.js → claim-EMQLYPRW.js} +10 -12
- package/dist/cli-bundle/chunks/{claim-FZZZCAY6.js.map → claim-EMQLYPRW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{claim-XK5QBZE3.js → claim-T3GCKV7C.js} +8 -10
- package/dist/cli-bundle/chunks/{claim-XK5QBZE3.js.map → claim-T3GCKV7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +14 -0
- package/dist/cli-bundle/chunks/{close-QHMVWM7M.js → close-TQYAAFJP.js} +7 -8
- package/dist/cli-bundle/chunks/{close-many-OIXJE2JZ.js → close-many-BG5QQIDQ.js} +16 -18
- package/dist/cli-bundle/chunks/{close-many-OIXJE2JZ.js.map → close-many-BG5QQIDQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{close-many-SUU5BS2C.js → close-many-LDRVEQY2.js} +18 -20
- package/dist/cli-bundle/chunks/{close-many-SUU5BS2C.js.map → close-many-LDRVEQY2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{comments-5YM62D75.js → comments-QCKR2YY2.js} +11 -13
- package/dist/cli-bundle/chunks/{comments-5YM62D75.js.map → comments-QCKR2YY2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{comments-RH3IBIRH.js → comments-YUXJRZPQ.js} +9 -11
- package/dist/cli-bundle/chunks/{comments-RH3IBIRH.js.map → comments-YUXJRZPQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{config-NCNNWF6R.js → config-DMSU64QO.js} +18 -387
- package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +7 -0
- package/dist/cli-bundle/chunks/{config-SW3U7XP2.js → config-QH2DICD6.js} +18 -380
- package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +1 -0
- package/dist/cli-bundle/chunks/context-B6275WPX.js +46 -0
- package/dist/cli-bundle/chunks/context-OCZ3FJ4Z.js +42 -0
- package/dist/cli-bundle/chunks/{contracts-SY6PDFIK.js → contracts-HN7ABKLP.js} +72 -15
- package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-JXFGBOYT.js → contracts-W4FZVVD6.js} +72 -15
- package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +1 -0
- package/dist/cli-bundle/chunks/{copy-N3GE6FYS.js → copy-BTJOSKKT.js} +7 -11
- package/dist/cli-bundle/chunks/{copy-N3GE6FYS.js.map → copy-BTJOSKKT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{copy-IEDBJOOX.js → copy-DEM4DATS.js} +9 -13
- package/dist/cli-bundle/chunks/{copy-IEDBJOOX.js.map → copy-DEM4DATS.js.map} +1 -1
- package/dist/cli-bundle/chunks/create-OH3BDGBB.js +28 -0
- package/dist/cli-bundle/chunks/{create-O4VONGPG.js → create-RLRJMRTM.js} +12 -14
- package/dist/cli-bundle/chunks/{delete-LPEIF7RU.js → delete-BHK7VB2Z.js} +5 -7
- package/dist/cli-bundle/chunks/{delete-LPEIF7RU.js.map → delete-BHK7VB2Z.js.map} +1 -1
- package/dist/cli-bundle/chunks/{delete-724EQ6OS.js → delete-LSVHAB4Y.js} +7 -9
- package/dist/cli-bundle/chunks/{delete-724EQ6OS.js.map → delete-LSVHAB4Y.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-RSBU4SIU.js → deps-4UDFJRUA.js} +8 -11
- package/dist/cli-bundle/chunks/{deps-RSBU4SIU.js.map → deps-4UDFJRUA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-T3Y6Y7RT.js → deps-XHYXWEPT.js} +6 -9
- package/dist/cli-bundle/chunks/{deps-T3Y6Y7RT.js.map → deps-XHYXWEPT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-IFS7HZPP.js → docs-26S44RXU.js} +8 -9
- package/dist/cli-bundle/chunks/{docs-IFS7HZPP.js.map → docs-26S44RXU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-75ZLCO3G.js → docs-GYZNVS26.js} +10 -11
- package/dist/cli-bundle/chunks/{docs-75ZLCO3G.js.map → docs-GYZNVS26.js.map} +1 -1
- package/dist/cli-bundle/chunks/{eval-L2KD7W3M.js → eval-PGRVIJQU.js} +12 -14
- package/dist/cli-bundle/chunks/{eval-L2KD7W3M.js.map → eval-PGRVIJQU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{eval-QGR7JCQO.js → eval-UYF3ZPVO.js} +10 -12
- package/dist/cli-bundle/chunks/{eval-QGR7JCQO.js.map → eval-UYF3ZPVO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{extension-YQF4CPIR.js → extension-CPSLJQVE.js} +12 -7
- package/dist/cli-bundle/chunks/{extension-3JYWJ5K2.js → extension-CXJ6RELI.js} +12 -7
- package/dist/cli-bundle/chunks/{files-EPEJMJHQ.js → files-MBNICQFM.js} +9 -11
- package/dist/cli-bundle/chunks/{files-EPEJMJHQ.js.map → files-MBNICQFM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{files-5BQWDRDT.js → files-NQHEXUZD.js} +11 -13
- package/dist/cli-bundle/chunks/{files-5BQWDRDT.js.map → files-NQHEXUZD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-RWGKD76E.js → focus-DWYIG7GU.js} +10 -14
- package/dist/cli-bundle/chunks/{focus-RWGKD76E.js.map → focus-DWYIG7GU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-DQVJAPOE.js → focus-XZW5423D.js} +8 -12
- package/dist/cli-bundle/chunks/{focus-DQVJAPOE.js.map → focus-XZW5423D.js.map} +1 -1
- package/dist/cli-bundle/chunks/{gc-BEJMQT64.js → gc-7GQYOS2G.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-JEFQDJPA.js → gc-LPVMKJQJ.js} +3 -3
- package/dist/cli-bundle/chunks/{get-LQG6PEVG.js → get-A7MAOHCU.js} +10 -13
- package/dist/cli-bundle/chunks/{get-LQG6PEVG.js.map → get-A7MAOHCU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{get-WVN75H42.js → get-DSDEKJ3L.js} +12 -15
- package/dist/cli-bundle/chunks/{get-WVN75H42.js.map → get-DSDEKJ3L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{health-JJJOY7DJ.js → health-3IPFLKXB.js} +17 -17
- package/dist/cli-bundle/chunks/{health-P67NZ6TT.js → health-GZXGBZ36.js} +17 -17
- package/dist/cli-bundle/chunks/{history-RUKPKNY7.js → history-NERDJNUB.js} +8 -10
- package/dist/cli-bundle/chunks/history-WSZHY3PN.js +18 -0
- package/dist/cli-bundle/chunks/{history-compact-NQ7VPRVT.js → history-compact-2WRZ2WK4.js} +11 -14
- package/dist/cli-bundle/chunks/{history-compact-NQ7VPRVT.js.map → history-compact-2WRZ2WK4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-compact-ZAOWR7GD.js → history-compact-HR7BB4LR.js} +13 -16
- package/dist/cli-bundle/chunks/{history-compact-ZAOWR7GD.js.map → history-compact-HR7BB4LR.js.map} +1 -1
- package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-YY4XYVEP.js → history-redact-O3NBCNWC.js} +9 -11
- package/dist/cli-bundle/chunks/{history-repair-EHL4ODQY.js → history-repair-LCMOS45X.js} +11 -14
- package/dist/cli-bundle/chunks/{history-repair-EHL4ODQY.js.map → history-repair-LCMOS45X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-repair-YSQH6SY6.js → history-repair-XA3LC4GA.js} +13 -16
- package/dist/cli-bundle/chunks/{history-repair-YSQH6SY6.js.map → history-repair-XA3LC4GA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{init-HBFGYS66.js → init-64XDLQJB.js} +12 -11
- package/dist/cli-bundle/chunks/init-PAX32BJA.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-KFQO7GEZ.js → learnings-JR6MA5TI.js} +9 -11
- package/dist/cli-bundle/chunks/{learnings-KFQO7GEZ.js.map → learnings-JR6MA5TI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-J555ZFPD.js → learnings-LPKCSJX7.js} +11 -13
- package/dist/cli-bundle/chunks/{learnings-J555ZFPD.js.map → learnings-LPKCSJX7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{list-C7R33MD5.js → list-DNBJVO3E.js} +10 -10
- package/dist/cli-bundle/chunks/{list-DSN6UNFB.js → list-G5Y65VF6.js} +10 -10
- package/dist/cli-bundle/chunks/next-BCERKDUR.js +277 -0
- package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +7 -0
- package/dist/cli-bundle/chunks/next-FYTQF6HG.js +274 -0
- package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +1 -0
- package/dist/cli-bundle/chunks/{notes-V4VNIQL4.js → notes-2BMU3VVQ.js} +9 -11
- package/dist/cli-bundle/chunks/{notes-V4VNIQL4.js.map → notes-2BMU3VVQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-VYJFN2A3.js → notes-6KTGO2OJ.js} +11 -13
- package/dist/cli-bundle/chunks/{notes-VYJFN2A3.js.map → notes-6KTGO2OJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-RBHQ5PO7.js → plan-4WXEQCTN.js} +15 -18
- package/dist/cli-bundle/chunks/{plan-RBHQ5PO7.js.map → plan-4WXEQCTN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-DHRSVSHR.js → plan-RKZHQVXR.js} +17 -20
- package/dist/cli-bundle/chunks/{plan-DHRSVSHR.js.map → plan-RKZHQVXR.js.map} +1 -1
- package/dist/cli-bundle/chunks/profile-4OMM32CD.js +1235 -0
- package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +7 -0
- package/dist/cli-bundle/chunks/profile-QLER5ENE.js +1197 -0
- package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-OM3E2KMY.js → register-list-query-7LV46VAU.js} +45 -21
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-CCMHGZTF.js → register-list-query-SNG5PGA4.js} +44 -20
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-N3CDEGZU.js → register-mutation-ENNDUAZG.js} +106 -40
- package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-UXTTWL6N.js → register-mutation-KK7PHYYU.js} +105 -39
- package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-UDIFMQKD.js → register-operations-C6OWLDSH.js} +32 -34
- package/dist/cli-bundle/chunks/{register-operations-UDIFMQKD.js.map → register-operations-C6OWLDSH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-R2FLOCRI.js → register-operations-HZ6XERQG.js} +30 -32
- package/dist/cli-bundle/chunks/{register-operations-R2FLOCRI.js.map → register-operations-HZ6XERQG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-G5LTSFYK.js → register-setup-P67EMBDJ.js} +68 -25
- package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-TWHKICM2.js → register-setup-ZKJ53RS7.js} +67 -24
- package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +7 -0
- package/dist/cli-bundle/chunks/{restore-LL2WLEDG.js → restore-4MHZFJ2E.js} +9 -11
- package/dist/cli-bundle/chunks/restore-YALDGTQR.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-M4H2ZI64.js → scheduling-shortcuts-LB6DOLRL.js} +14 -16
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-M4H2ZI64.js.map → scheduling-shortcuts-LB6DOLRL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-255GI3BU.js → scheduling-shortcuts-UTOYKLXQ.js} +12 -14
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-255GI3BU.js.map → scheduling-shortcuts-UTOYKLXQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/schema-73HR2OJW.js +75 -0
- package/dist/cli-bundle/chunks/schema-U6LJKSIR.js +71 -0
- package/dist/cli-bundle/chunks/{search-2EI6EAXH.js → search-AXPXKZER.js} +10 -12
- package/dist/cli-bundle/chunks/{search-QBFBLQRO.js → search-KILGT37L.js} +10 -12
- package/dist/cli-bundle/chunks/{stats-TKC6CAKB.js → stats-PSYVVTNZ.js} +21 -13
- package/dist/cli-bundle/chunks/stats-PSYVVTNZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{stats-TCW2SZQG.js → stats-W5KNVJWQ.js} +20 -12
- package/dist/cli-bundle/chunks/stats-W5KNVJWQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{telemetry-BT2VSWU2.js → telemetry-BZUF6H7G.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-LQ6FRTUT.js → telemetry-GAHHQTOS.js} +4 -4
- package/dist/cli-bundle/chunks/test-ACD52Z3S.js +35 -0
- package/dist/cli-bundle/chunks/test-ACD52Z3S.js.map +7 -0
- package/dist/cli-bundle/chunks/{test-NV2DRPUS.js → test-PWDIZ255.js} +15 -16
- package/dist/cli-bundle/chunks/test-PWDIZ255.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-all-DZ76VTPQ.js → test-all-L2MDDUCA.js} +20 -22
- package/dist/cli-bundle/chunks/{test-all-DZ76VTPQ.js.map → test-all-L2MDDUCA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-REW67LXT.js → test-all-RBZ6DLU2.js} +18 -20
- package/dist/cli-bundle/chunks/{test-all-REW67LXT.js.map → test-all-RBZ6DLU2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-runs-PX73DMMI.js → test-runs-PLRAZEFW.js} +5 -6
- package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +7 -0
- package/dist/cli-bundle/chunks/{test-runs-FQ5WNQLP.js → test-runs-UXIXPDKU.js} +6 -7
- package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +1 -0
- package/dist/cli-bundle/chunks/update-AMRSOIWP.js +24 -0
- package/dist/cli-bundle/chunks/update-AMRSOIWP.js.map +7 -0
- package/dist/cli-bundle/chunks/update-KFX2SIAC.js +28 -0
- package/dist/cli-bundle/chunks/update-KFX2SIAC.js.map +1 -0
- package/dist/cli-bundle/chunks/{update-many-Q5ZEI64S.js → update-many-RNSBX2TA.js} +35 -36
- package/dist/cli-bundle/chunks/{update-many-Q5ZEI64S.js.map → update-many-RNSBX2TA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-2ILP6E4Y.js → update-many-Z5GJS5LC.js} +33 -34
- package/dist/cli-bundle/chunks/{update-many-2ILP6E4Y.js.map → update-many-Z5GJS5LC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-FOZKQTQF.js → upgrade-BRL6KCOJ.js} +13 -8
- package/dist/cli-bundle/chunks/{upgrade-FOZKQTQF.js.map → upgrade-BRL6KCOJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-DHL74PQH.js → upgrade-HAK6JG2O.js} +11 -6
- package/dist/cli-bundle/chunks/{upgrade-DHL74PQH.js.map → upgrade-HAK6JG2O.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-HYZNIB6W.js → validate-MTUVL5VC.js} +38 -28
- package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-54SYJ7QW.js → validate-X5W76YJL.js} +39 -29
- package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +1 -0
- package/dist/cli-bundle/main.js +95 -724
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/config/positional-value.d.ts +2 -0
- package/dist/core/config/positional-value.js +2 -2
- package/dist/core/config/positional-value.js.map +1 -1
- package/dist/core/extensions/activation-summary-markdown.d.ts +71 -0
- package/dist/core/extensions/activation-summary-markdown.js +151 -0
- package/dist/core/extensions/activation-summary-markdown.js.map +1 -0
- package/dist/core/extensions/activation-summary.d.ts +2 -0
- package/dist/core/extensions/activation-summary.js +3 -2
- package/dist/core/extensions/activation-summary.js.map +1 -1
- package/dist/core/extensions/capability-usage.d.ts +1 -1
- package/dist/core/extensions/capability-usage.js +4 -3
- package/dist/core/extensions/capability-usage.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/extension-registries.js +3 -2
- package/dist/core/extensions/extension-registries.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +21 -1
- package/dist/core/extensions/extension-types.js +3 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.js +439 -232
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/fs-utils.js +27 -2
- package/dist/core/fs/fs-utils.js.map +1 -1
- package/dist/core/item/actionability.d.ts +57 -0
- package/dist/core/item/actionability.js +178 -0
- package/dist/core/item/actionability.js.map +1 -0
- package/dist/core/item/item-format.js +523 -410
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/type-registry.js +18 -45
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/profile/profile-describe.d.ts +64 -0
- package/dist/core/profile/profile-describe.js +83 -0
- package/dist/core/profile/profile-describe.js.map +1 -0
- package/dist/core/profile/profile-lint.d.ts +53 -0
- package/dist/core/profile/profile-lint.js +422 -0
- package/dist/core/profile/profile-lint.js.map +1 -0
- package/dist/core/profile/profile-plan.d.ts +145 -0
- package/dist/core/profile/profile-plan.js +0 -0
- package/dist/core/profile/profile-plan.js.map +1 -0
- package/dist/core/profile/profile-presets.d.ts +218 -0
- package/dist/core/profile/profile-presets.js +325 -0
- package/dist/core/profile/profile-presets.js.map +1 -0
- package/dist/core/schema/fields-file.js +25 -25
- package/dist/core/schema/fields-file.js.map +1 -1
- package/dist/core/schema/item-types-file.js +3 -3
- package/dist/core/schema/item-types-file.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +4 -4
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.js +3 -3
- package/dist/core/schema/status-defs-file.js.map +1 -1
- package/dist/core/shared/serialization.js +83 -62
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/store/item-store.d.ts +1 -0
- package/dist/core/store/item-store.js +16 -8
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.js +4 -32
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings.js +14 -14
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/observability.js +50 -54
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +11 -2
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/background-runs.js +3 -2
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/core/validate/linked-artifact-reference.d.ts +24 -0
- package/dist/core/validate/linked-artifact-reference.js +41 -0
- package/dist/core/validate/linked-artifact-reference.js.map +1 -0
- package/dist/mcp/server.js +540 -420
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.js +33 -2
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
- package/dist/sdk/cli-contracts/commander-types.js +15 -2
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +3 -3
- package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +149 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +1514 -0
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -0
- package/dist/sdk/cli-contracts/string-lists.d.ts +14 -0
- package/dist/sdk/cli-contracts/string-lists.js +20 -0
- package/dist/sdk/cli-contracts/string-lists.js.map +1 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +51 -109
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +17 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +54 -5
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +74 -0
- package/dist/sdk/cli-contracts/tool-schema.js +871 -0
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +13 -193
- package/dist/sdk/cli-contracts.js +5 -2277
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/compose.d.ts +11 -5
- package/dist/sdk/compose.js +240 -124
- package/dist/sdk/compose.js.map +1 -1
- package/dist/sdk/define.d.ts +14 -0
- package/dist/sdk/define.js +17 -2
- package/dist/sdk/define.js.map +1 -1
- package/dist/sdk/index.d.ts +14 -3
- package/dist/sdk/index.js +14 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/testing.d.ts +82 -2
- package/dist/sdk/testing.js +74 -3
- package/dist/sdk/testing.js.map +1 -1
- package/docs/AGENT_GUIDE.md +2 -0
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +37 -0
- package/docs/EXTENSIONS.md +12 -13
- package/docs/RELEASING.md +8 -4
- package/docs/SDK.md +184 -17
- package/docs/TESTING.md +12 -0
- package/docs/examples/policy-restricted-extension/README.md +6 -0
- package/docs/examples/policy-restricted-extension/index.ts +40 -0
- package/docs/examples/policy-restricted-extension/manifest.json +2 -2
- package/docs/examples/starter-extension/README.md +14 -2
- package/docs/examples/starter-extension/{index.js → index.ts} +51 -6
- package/docs/examples/starter-extension/manifest.json +2 -2
- package/package.json +20 -7
- package/packages/pm-beads/extensions/beads/index.ts +3 -3
- package/packages/pm-beads/extensions/beads/manifest.json +2 -2
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +19 -7
- package/packages/pm-beads/extensions/beads/runtime.ts +155 -37
- package/packages/pm-calendar/extensions/calendar/index.ts +3 -3
- package/packages/pm-calendar/extensions/calendar/manifest.json +2 -2
- package/packages/pm-calendar/extensions/calendar/runtime.ts +2 -2
- package/packages/pm-command-kit/extensions/command-kit/index.ts +1 -1
- package/packages/pm-command-kit/extensions/command-kit/manifest.json +2 -2
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +2 -2
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +2 -2
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +2 -2
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +2 -2
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +1 -1
- package/packages/pm-kanban/README.md +97 -0
- package/packages/pm-kanban/extensions/kanban/index.ts +191 -0
- package/packages/pm-kanban/extensions/kanban/manifest.json +19 -0
- package/packages/pm-kanban/package.json +57 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +1 -1
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +2 -2
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +2 -2
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +2 -2
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +1 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +2 -2
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +2 -2
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +1 -1
- package/packages/pm-templates/extensions/templates/index.ts +2 -2
- package/packages/pm-templates/extensions/templates/manifest.json +2 -2
- package/packages/pm-templates/extensions/templates/runtime.ts +1 -1
- package/packages/pm-todos/extensions/todos/index.ts +3 -3
- package/packages/pm-todos/extensions/todos/manifest.json +2 -2
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +19 -7
- package/packages/pm-todos/extensions/todos/runtime.ts +177 -43
- package/plugins/pm-claude/scripts/pm-mcp-server.mjs +2 -2
- package/plugins/pm-codex/scripts/pm-mcp-server.mjs +2 -2
- package/scripts/bundle-cli.mjs +1 -1
- package/dist/cli-bundle/chunks/activity-54TXGJ2T.js +0 -18
- package/dist/cli-bundle/chunks/aggregate-63NWNIBR.js.map +0 -1
- package/dist/cli-bundle/chunks/aggregate-YHCYX2EV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6EL7SW5C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6W3Y65PL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AEACLRVH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B74BP6IS.js +0 -78
- package/dist/cli-bundle/chunks/chunk-B74BP6IS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BFFO3AIB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C4C3EJCJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EYPINTFR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FBLT6WGK.js +0 -75
- package/dist/cli-bundle/chunks/chunk-FBLT6WGK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GQYJEEFX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-HBAEFWX3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HC2S36NB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IAP5KYBQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-INPHFO33.js +0 -764
- package/dist/cli-bundle/chunks/chunk-INPHFO33.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IOT6WRL5.js +0 -86
- package/dist/cli-bundle/chunks/chunk-IOT6WRL5.js.map +0 -7
- 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-J3NMWFIN.js +0 -115
- package/dist/cli-bundle/chunks/chunk-J3NMWFIN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-J7I4C5ZB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JKL6HRMV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KJZOSF7J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-L7UXKP2I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LNEDHJNQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-M6TUBOGW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MEXZ5XUM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-N5B6WZC5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NJ73ALW2.js +0 -761
- package/dist/cli-bundle/chunks/chunk-NJ73ALW2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NVXGVEFD.js +0 -83
- package/dist/cli-bundle/chunks/chunk-NVXGVEFD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OF7V47P3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OHDQNKJB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PEL2NLQE.js +0 -118
- package/dist/cli-bundle/chunks/chunk-PEL2NLQE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PRVTGX64.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RAWA3Y7O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SMXSDY7J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SUREE24M.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TKPP4GOO.js +0 -654
- package/dist/cli-bundle/chunks/chunk-TKPP4GOO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VSAABFGQ.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-XVYKWZNL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XXKV4UWE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZLWRPBOW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZV7IQ23N.js +0 -657
- package/dist/cli-bundle/chunks/chunk-ZV7IQ23N.js.map +0 -7
- package/dist/cli-bundle/chunks/close-JEBZXONN.js +0 -15
- package/dist/cli-bundle/chunks/config-NCNNWF6R.js.map +0 -7
- package/dist/cli-bundle/chunks/config-SW3U7XP2.js.map +0 -1
- package/dist/cli-bundle/chunks/context-55VEOYI3.js.map +0 -1
- package/dist/cli-bundle/chunks/context-5LB7UGKE.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-JXFGBOYT.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-SY6PDFIK.js.map +0 -7
- package/dist/cli-bundle/chunks/create-CLSCHGJJ.js +0 -30
- package/dist/cli-bundle/chunks/history-ALTM2RRP.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-5YGLWUDH.js +0 -21
- package/dist/cli-bundle/chunks/init-C4CRHW22.js +0 -21
- package/dist/cli-bundle/chunks/register-list-query-CCMHGZTF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-OM3E2KMY.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-N3CDEGZU.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-UXTTWL6N.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-G5LTSFYK.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-TWHKICM2.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-LQHXBAY5.js +0 -19
- package/dist/cli-bundle/chunks/schema-C6QA367T.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-QO5I4FBL.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-TCW2SZQG.js.map +0 -7
- package/dist/cli-bundle/chunks/stats-TKC6CAKB.js.map +0 -1
- package/dist/cli-bundle/chunks/test-WA6RZGM2.js +0 -36
- package/dist/cli-bundle/chunks/test-runs-FQ5WNQLP.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-PX73DMMI.js.map +0 -7
- package/dist/cli-bundle/chunks/update-BSKMQOYH.js +0 -28
- package/dist/cli-bundle/chunks/update-FIGYNQ2I.js +0 -24
- package/dist/cli-bundle/chunks/validate-54SYJ7QW.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-HYZNIB6W.js.map +0 -7
- package/docs/examples/policy-restricted-extension/index.js +0 -21
- package/packages/pm-beads/extensions/beads/index.js +0 -64
- package/packages/pm-beads/extensions/beads/runtime-loader.js +0 -86
- package/packages/pm-beads/extensions/beads/runtime.js +0 -482
- package/packages/pm-calendar/extensions/calendar/index.js +0 -150
- package/packages/pm-calendar/extensions/calendar/runtime.js +0 -126
- package/packages/pm-command-kit/extensions/command-kit/index.js +0 -181
- package/packages/pm-governance-audit/extensions/governance-audit/index.js +0 -177
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +0 -153
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +0 -98
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +0 -294
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +0 -18
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +0 -124
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +0 -110
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +0 -258
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +0 -361
- package/packages/pm-templates/extensions/templates/index.js +0 -132
- package/packages/pm-templates/extensions/templates/runtime.js +0 -35
- package/packages/pm-todos/extensions/todos/index.js +0 -81
- package/packages/pm-todos/extensions/todos/runtime-loader.js +0 -86
- package/packages/pm-todos/extensions/todos/runtime.js +0 -545
- /package/dist/cli-bundle/chunks/{activity-54TXGJ2T.js.map → activity-AW6XVFH6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-N7RVTLBQ.js.map → activity-DBLQVIP6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F32L4HR6.js.map → chunk-27BXPBAY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5BBEWX6C.js.map → chunk-3VGN2UWE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FMWW2JDU.js.map → chunk-AXIDKKAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TIM4OD74.js.map → chunk-BDTISOSD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CZIFFMZI.js.map → chunk-DDPTYJIM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AYPQUFCX.js.map → chunk-EJUDVUYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EOGBMLCE.js.map → chunk-EVMTBV6V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CG3KP6I5.js.map → chunk-G7I7DEZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F4BNR2IN.js.map → chunk-HYTGA6GI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2WCYE3IF.js.map → chunk-HZZEHPRG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YV2OSAMS.js.map → chunk-IJYK2T43.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QOUOMPHO.js.map → chunk-JPECA746.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OQ2E64FH.js.map → chunk-KNPEF7QG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3BKH2CL3.js.map → chunk-L5OEFZQG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5S4ZGDB2.js.map → chunk-N74UMG5H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IXAZI443.js.map → chunk-NFDPYAIP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SKC4UTRP.js.map → chunk-NKZAN7BD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JPJDP4VU.js.map → chunk-NWMZWYYB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KKX4Z2SE.js.map → chunk-OTUHB4HS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WB5BYQMF.js.map → chunk-SLMUGTK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I6QMJ2XT.js.map → chunk-WYDHYJPO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KIEAK7YE.js.map → chunk-ZRP4VG5U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-JEBZXONN.js.map → close-E6ZZGCJY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-QHMVWM7M.js.map → close-TQYAAFJP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-O4VONGPG.js.map → context-B6275WPX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-CLSCHGJJ.js.map → context-OCZ3FJ4Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-YQF4CPIR.js.map → create-OH3BDGBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-3JYWJ5K2.js.map → create-RLRJMRTM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-ALTM2RRP.js.map → extension-CPSLJQVE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-RUKPKNY7.js.map → extension-CXJ6RELI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-BEJMQT64.js.map → gc-7GQYOS2G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-JEFQDJPA.js.map → gc-LPVMKJQJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-JJJOY7DJ.js.map → health-3IPFLKXB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-P67NZ6TT.js.map → health-GZXGBZ36.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-YY4XYVEP.js.map → history-NERDJNUB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-5YGLWUDH.js.map → history-WSZHY3PN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-C4CRHW22.js.map → history-redact-MP6CH7U5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-HBFGYS66.js.map → history-redact-O3NBCNWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-C7R33MD5.js.map → init-64XDLQJB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DSN6UNFB.js.map → init-PAX32BJA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-LL2WLEDG.js.map → list-DNBJVO3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-LQHXBAY5.js.map → list-G5Y65VF6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-2EI6EAXH.js.map → restore-4MHZFJ2E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-QBFBLQRO.js.map → restore-YALDGTQR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-NV2DRPUS.js.map → schema-73HR2OJW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-WA6RZGM2.js.map → schema-U6LJKSIR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-BSKMQOYH.js.map → search-AXPXKZER.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-FIGYNQ2I.js.map → search-KILGT37L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-BT2VSWU2.js.map → telemetry-BZUF6H7G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-LQ6FRTUT.js.map → telemetry-GAHHQTOS.js.map} +0 -0
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bfb4fc80-65a7-5c83-b180-b171fcfa4f33")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
|
+
splitCommaList
|
|
5
|
+
} from "./chunk-P4SESZGT.js";
|
|
6
|
+
import {
|
|
7
|
+
ensureTypeFolderScaffold
|
|
8
|
+
} from "./chunk-2D4HATP2.js";
|
|
9
|
+
import {
|
|
10
|
+
buildExtensionDescribeResult,
|
|
4
11
|
scaffoldExtensionProject
|
|
5
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6AQZPVHQ.js";
|
|
6
13
|
import {
|
|
7
14
|
normalizeExtensionNameForMatch,
|
|
8
15
|
normalizeManagedDirectoryName,
|
|
9
16
|
normalizeStringList,
|
|
10
17
|
parseExtensionManifest,
|
|
11
18
|
validateExtensionDirectory
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
splitCommaList
|
|
15
|
-
} from "./chunk-P4SESZGT.js";
|
|
19
|
+
} from "./chunk-4A3BJ675.js";
|
|
16
20
|
import {
|
|
17
21
|
nowIso
|
|
18
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-AXIDKKAT.js";
|
|
19
23
|
import {
|
|
20
24
|
EXIT_CODE,
|
|
21
25
|
EXTENSION_CAPABILITY_CONTRACT,
|
|
22
26
|
KNOWN_EXTENSION_CAPABILITIES,
|
|
23
27
|
PmCliError,
|
|
24
28
|
activateExtensions,
|
|
25
|
-
collectUsedExtensionCapabilities,
|
|
26
29
|
isPathWithinDirectory,
|
|
30
|
+
levenshteinDistanceWithinLimit,
|
|
27
31
|
loadExtensions,
|
|
28
32
|
nextExtensionReloadToken,
|
|
29
|
-
normalizeExtensionName,
|
|
30
33
|
parseLegacyExtensionCapabilityAliasWarning,
|
|
31
34
|
parseUnknownExtensionCapabilityWarning,
|
|
32
35
|
pathExists,
|
|
@@ -37,7 +40,7 @@ import {
|
|
|
37
40
|
resolvePmPackageRootFromModule,
|
|
38
41
|
resolvePmRoot,
|
|
39
42
|
writeSettings
|
|
40
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-7R4QEMZZ.js";
|
|
41
44
|
|
|
42
45
|
// dist/cli/commands/extension.js
|
|
43
46
|
import { execFile as execFile2 } from "node:child_process";
|
|
@@ -89,6 +92,63 @@ function managedExtensionSourcesEquivalent(left, right) {
|
|
|
89
92
|
}
|
|
90
93
|
return true;
|
|
91
94
|
}
|
|
95
|
+
function optionalString(value) {
|
|
96
|
+
return typeof value === "string" ? value : void 0;
|
|
97
|
+
}
|
|
98
|
+
function hasRequiredManagedRecordFields(entry) {
|
|
99
|
+
return typeof entry.name === "string" && entry.name.trim().length > 0 && typeof entry.directory === "string" && entry.directory.trim().length > 0 && (entry.scope === "project" || entry.scope === "global") && typeof entry.manifest_version === "string" && typeof entry.manifest_entry === "string" && Array.isArray(entry.capabilities) && entry.capabilities.every((value) => typeof value === "string") && typeof entry.installed_at === "string" && typeof entry.updated_at === "string";
|
|
100
|
+
}
|
|
101
|
+
function normalizeManagedSource(raw) {
|
|
102
|
+
if (typeof raw !== "object" || raw === null) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const source = raw;
|
|
106
|
+
if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
kind: source.kind,
|
|
111
|
+
input: source.input,
|
|
112
|
+
location: source.location,
|
|
113
|
+
name: optionalString(source.name),
|
|
114
|
+
package: optionalString(source.package),
|
|
115
|
+
version: optionalString(source.version),
|
|
116
|
+
repository: optionalString(source.repository),
|
|
117
|
+
owner: optionalString(source.owner),
|
|
118
|
+
repo: optionalString(source.repo),
|
|
119
|
+
ref: optionalString(source.ref),
|
|
120
|
+
subpath: optionalString(source.subpath),
|
|
121
|
+
commit: optionalString(source.commit)
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function normalizeManagedRecord(raw) {
|
|
125
|
+
if (typeof raw !== "object" || raw === null) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
const entry = raw;
|
|
129
|
+
if (!hasRequiredManagedRecordFields(entry)) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const source = normalizeManagedSource(entry.source);
|
|
133
|
+
if (!source) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
name: entry.name.trim(),
|
|
138
|
+
directory: entry.directory.trim(),
|
|
139
|
+
scope: entry.scope,
|
|
140
|
+
manifest_version: entry.manifest_version,
|
|
141
|
+
manifest_entry: entry.manifest_entry,
|
|
142
|
+
capabilities: normalizeStringList(entry.capabilities),
|
|
143
|
+
installed_at: entry.installed_at,
|
|
144
|
+
updated_at: entry.updated_at,
|
|
145
|
+
source,
|
|
146
|
+
last_update_check_at: optionalString(entry.last_update_check_at),
|
|
147
|
+
last_update_remote_commit: optionalString(entry.last_update_remote_commit),
|
|
148
|
+
update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
|
|
149
|
+
update_error: optionalString(entry.update_error)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
92
152
|
function normalizeManagedState(raw) {
|
|
93
153
|
if (typeof raw !== "object" || raw === null) {
|
|
94
154
|
return null;
|
|
@@ -99,49 +159,14 @@ function normalizeManagedState(raw) {
|
|
|
99
159
|
}
|
|
100
160
|
const entries = [];
|
|
101
161
|
for (const rawEntry of candidate.entries) {
|
|
102
|
-
|
|
103
|
-
|
|
162
|
+
const record = normalizeManagedRecord(rawEntry);
|
|
163
|
+
if (record) {
|
|
164
|
+
entries.push(record);
|
|
104
165
|
}
|
|
105
|
-
const entry = rawEntry;
|
|
106
|
-
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) {
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
const source = entry.source;
|
|
110
|
-
if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
entries.push({
|
|
114
|
-
name: entry.name.trim(),
|
|
115
|
-
directory: entry.directory.trim(),
|
|
116
|
-
scope: entry.scope,
|
|
117
|
-
manifest_version: entry.manifest_version,
|
|
118
|
-
manifest_entry: entry.manifest_entry,
|
|
119
|
-
capabilities: normalizeStringList(entry.capabilities),
|
|
120
|
-
installed_at: entry.installed_at,
|
|
121
|
-
updated_at: entry.updated_at,
|
|
122
|
-
source: {
|
|
123
|
-
kind: source.kind,
|
|
124
|
-
input: source.input,
|
|
125
|
-
location: source.location,
|
|
126
|
-
name: typeof source.name === "string" ? source.name : void 0,
|
|
127
|
-
package: typeof source.package === "string" ? source.package : void 0,
|
|
128
|
-
version: typeof source.version === "string" ? source.version : void 0,
|
|
129
|
-
repository: typeof source.repository === "string" ? source.repository : void 0,
|
|
130
|
-
owner: typeof source.owner === "string" ? source.owner : void 0,
|
|
131
|
-
repo: typeof source.repo === "string" ? source.repo : void 0,
|
|
132
|
-
ref: typeof source.ref === "string" ? source.ref : void 0,
|
|
133
|
-
subpath: typeof source.subpath === "string" ? source.subpath : void 0,
|
|
134
|
-
commit: typeof source.commit === "string" ? source.commit : void 0
|
|
135
|
-
},
|
|
136
|
-
last_update_check_at: typeof entry.last_update_check_at === "string" ? entry.last_update_check_at : void 0,
|
|
137
|
-
last_update_remote_commit: typeof entry.last_update_remote_commit === "string" ? entry.last_update_remote_commit : void 0,
|
|
138
|
-
update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
|
|
139
|
-
update_error: typeof entry.update_error === "string" ? entry.update_error : void 0
|
|
140
|
-
});
|
|
141
166
|
}
|
|
142
167
|
return {
|
|
143
168
|
version: MANAGED_EXTENSION_STATE_VERSION,
|
|
144
|
-
updated_at:
|
|
169
|
+
updated_at: optionalString(candidate.updated_at) ?? nowIso(),
|
|
145
170
|
entries: sortManagedEntries(entries)
|
|
146
171
|
};
|
|
147
172
|
}
|
|
@@ -200,7 +225,7 @@ import { execFile } from "node:child_process";
|
|
|
200
225
|
import fs3 from "node:fs/promises";
|
|
201
226
|
import os from "node:os";
|
|
202
227
|
import path3 from "node:path";
|
|
203
|
-
import { fileURLToPath
|
|
228
|
+
import { fileURLToPath } from "node:url";
|
|
204
229
|
import { promisify } from "node:util";
|
|
205
230
|
|
|
206
231
|
// dist/core/packages/manifest.js
|
|
@@ -639,7 +664,7 @@ async function resolveLocalNpmPackagePath(spec) {
|
|
|
639
664
|
async function resolveNpmPackSpec(spec) {
|
|
640
665
|
const localPath = await resolveLocalNpmPackagePath(spec);
|
|
641
666
|
if (localPath) {
|
|
642
|
-
return
|
|
667
|
+
return localPath;
|
|
643
668
|
}
|
|
644
669
|
const localFileAlias = normalizeNpmLocalFileAliasSpec(spec);
|
|
645
670
|
if (localFileAlias !== spec) {
|
|
@@ -658,11 +683,23 @@ function normalizeNpmLocalFileAliasSpec(spec, cwd = process.cwd()) {
|
|
|
658
683
|
}
|
|
659
684
|
const packageName = spec.slice(0, markerIndex);
|
|
660
685
|
const target = spec.slice(markerIndex + marker.length);
|
|
661
|
-
if (packageName.trim().length === 0 || target.trim().length === 0
|
|
686
|
+
if (packageName.trim().length === 0 || target.trim().length === 0) {
|
|
687
|
+
return spec;
|
|
688
|
+
}
|
|
689
|
+
if (target.startsWith("//") && !target.startsWith("///")) {
|
|
662
690
|
return spec;
|
|
663
691
|
}
|
|
664
|
-
|
|
665
|
-
|
|
692
|
+
if (!target.startsWith("/")) {
|
|
693
|
+
return `${packageName}@${path3.resolve(cwd, target)}`;
|
|
694
|
+
}
|
|
695
|
+
let decodedPath;
|
|
696
|
+
try {
|
|
697
|
+
decodedPath = decodeURIComponent(new URL(`file:${target}`).pathname);
|
|
698
|
+
} catch {
|
|
699
|
+
return spec;
|
|
700
|
+
}
|
|
701
|
+
const nativePath = /^\/[A-Za-z]:/.test(decodedPath) ? decodedPath.slice(1) : decodedPath;
|
|
702
|
+
return `${packageName}@${nativePath}`;
|
|
666
703
|
}
|
|
667
704
|
function parsePackedNpmPackage(stdout, packDirectory) {
|
|
668
705
|
try {
|
|
@@ -1050,6 +1087,42 @@ async function resolveBundledAliasManifestName(input) {
|
|
|
1050
1087
|
return null;
|
|
1051
1088
|
}
|
|
1052
1089
|
}
|
|
1090
|
+
function buildBundledCatalogLinks(manifest) {
|
|
1091
|
+
return {
|
|
1092
|
+
docs: manifest.catalog?.links?.docs ?? manifest.package_homepage,
|
|
1093
|
+
npm: manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0),
|
|
1094
|
+
repository: manifest.catalog?.links?.repository ?? manifest.package_repository_url,
|
|
1095
|
+
report: manifest.catalog?.links?.report ?? manifest.package_bugs_url
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
function buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations) {
|
|
1099
|
+
const installScopeFlag = scope === "global" ? "--global" : "--project";
|
|
1100
|
+
const metadataOnlyResources = Object.fromEntries(PM_PACKAGE_RESOURCE_KINDS.filter((resourceKind) => resourceKind !== "extensions").map((resourceKind) => [resourceKind, manifest.resources[resourceKind] ?? []]).filter(([, entries]) => Array.isArray(entries) && entries.length > 0));
|
|
1101
|
+
return {
|
|
1102
|
+
alias: bundledEntry.alias,
|
|
1103
|
+
bundled: true,
|
|
1104
|
+
available: true,
|
|
1105
|
+
installed: installedBuiltinAliases.has(bundledEntry.alias) || installedLocations.has(path4.resolve(bundledEntry.package_root)),
|
|
1106
|
+
install_target: bundledEntry.alias,
|
|
1107
|
+
install_command: `pm install ${bundledEntry.alias} ${installScopeFlag}`,
|
|
1108
|
+
package_name: manifest.package_name,
|
|
1109
|
+
package_version: manifest.package_version,
|
|
1110
|
+
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
1111
|
+
keywords: manifest.package_keywords ?? [],
|
|
1112
|
+
resources: manifest.resources,
|
|
1113
|
+
installable_resources: {
|
|
1114
|
+
extensions: manifest.resources.extensions ?? []
|
|
1115
|
+
},
|
|
1116
|
+
metadata_only_resources: metadataOnlyResources,
|
|
1117
|
+
catalog: {
|
|
1118
|
+
display_name: manifest.catalog?.display_name,
|
|
1119
|
+
category: manifest.catalog?.category,
|
|
1120
|
+
tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
|
|
1121
|
+
links: buildBundledCatalogLinks(manifest),
|
|
1122
|
+
media: manifest.catalog?.media
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1053
1126
|
async function buildBundledPackageCatalog(scope, global, options = {}) {
|
|
1054
1127
|
const roots = resolveExtensionRoots(resolvePmRoot(process.cwd(), global.path), process.cwd());
|
|
1055
1128
|
const selectedRoot = scope === "global" ? roots.global : roots.project;
|
|
@@ -1058,44 +1131,8 @@ async function buildBundledPackageCatalog(scope, global, options = {}) {
|
|
|
1058
1131
|
const installedBuiltinAliases = new Set(managedStateRead.state.entries.filter((entry) => entry.scope === scope && entry.source.kind === "builtin").flatMap((entry) => [entry.source.name, entry.source.input, entry.source.location]).filter((value) => typeof value === "string" && value.trim().length > 0).map((value) => value.trim().toLowerCase()));
|
|
1059
1132
|
const packages = [];
|
|
1060
1133
|
for (const bundledEntry of await collectBundledPackageEntries()) {
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1063
|
-
const installScopeFlag = scope === "global" ? "--global" : "--project";
|
|
1064
|
-
const manifest = await readPmPackageManifest(packageRoot);
|
|
1065
|
-
const repository = manifest.catalog?.links?.repository ?? manifest.package_repository_url;
|
|
1066
|
-
const report = manifest.catalog?.links?.report ?? manifest.package_bugs_url;
|
|
1067
|
-
const docs = manifest.catalog?.links?.docs ?? manifest.package_homepage;
|
|
1068
|
-
const npm = manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0);
|
|
1069
|
-
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));
|
|
1070
|
-
packages.push({
|
|
1071
|
-
alias,
|
|
1072
|
-
bundled: true,
|
|
1073
|
-
available: true,
|
|
1074
|
-
installed: installedBuiltinAliases.has(alias) || installedLocations.has(path4.resolve(packageRoot)),
|
|
1075
|
-
install_target: alias,
|
|
1076
|
-
install_command: `pm install ${alias} ${installScopeFlag}`,
|
|
1077
|
-
package_name: manifest.package_name,
|
|
1078
|
-
package_version: manifest.package_version,
|
|
1079
|
-
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
1080
|
-
keywords: manifest.package_keywords ?? [],
|
|
1081
|
-
resources: manifest.resources,
|
|
1082
|
-
installable_resources: {
|
|
1083
|
-
extensions: manifest.resources.extensions ?? []
|
|
1084
|
-
},
|
|
1085
|
-
metadata_only_resources: metadataOnlyResources,
|
|
1086
|
-
catalog: {
|
|
1087
|
-
display_name: manifest.catalog?.display_name,
|
|
1088
|
-
category: manifest.catalog?.category,
|
|
1089
|
-
tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
|
|
1090
|
-
links: {
|
|
1091
|
-
docs,
|
|
1092
|
-
npm,
|
|
1093
|
-
repository,
|
|
1094
|
-
report
|
|
1095
|
-
},
|
|
1096
|
-
media: manifest.catalog?.media
|
|
1097
|
-
}
|
|
1098
|
-
});
|
|
1134
|
+
const manifest = await readPmPackageManifest(bundledEntry.package_root);
|
|
1135
|
+
packages.push(buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations));
|
|
1099
1136
|
}
|
|
1100
1137
|
const fields = parsePackageCatalogFields(options.fields);
|
|
1101
1138
|
const outputPackages = fields ? packages.map((entry) => projectPackageCatalogEntry(entry, fields)) : packages;
|
|
@@ -1158,76 +1195,6 @@ function projectPackageCatalogEntry(entry, fields) {
|
|
|
1158
1195
|
return projected;
|
|
1159
1196
|
}
|
|
1160
1197
|
|
|
1161
|
-
// dist/core/extensions/activation-summary.js
|
|
1162
|
-
var HOOK_REGISTRY_FIELD_TO_KIND = [
|
|
1163
|
-
["beforeCommand", "before_command"],
|
|
1164
|
-
["afterCommand", "after_command"],
|
|
1165
|
-
["onWrite", "on_write"],
|
|
1166
|
-
["onRead", "on_read"],
|
|
1167
|
-
["onIndex", "on_index"]
|
|
1168
|
-
];
|
|
1169
|
-
function describeExtensionActivation(activation, options = {}) {
|
|
1170
|
-
const filter = options.extensionName !== void 0 ? normalizeExtensionName(options.extensionName) : null;
|
|
1171
|
-
const matches = (name) => filter === null || normalizeExtensionName(name) === filter;
|
|
1172
|
-
const collect = (entries, identify) => sortUnique(entries.filter((entry) => matches(entry.name)).map(identify));
|
|
1173
|
-
const collectFlat = (entries, expand) => sortUnique(entries.filter((entry) => matches(entry.name)).flatMap(expand));
|
|
1174
|
-
const { registrations, commands, parsers, preflight, services, renderers, hooks } = activation;
|
|
1175
|
-
return {
|
|
1176
|
-
capabilities: collectUsedExtensionCapabilities(activation, options),
|
|
1177
|
-
commands: collect(registrations.commands, (entry) => entry.command),
|
|
1178
|
-
command_overrides: collect(commands.overrides, (entry) => entry.command),
|
|
1179
|
-
command_handlers: collect(commands.handlers, (entry) => entry.command),
|
|
1180
|
-
hooks: HOOK_REGISTRY_FIELD_TO_KIND.filter(([field]) => hooks[field].some((entry) => matches(entry.name))).map(([, kind]) => kind),
|
|
1181
|
-
flag_commands: collect(registrations.flags, (entry) => entry.target_command),
|
|
1182
|
-
item_types: collectFlat(registrations.item_types, (entry) => entry.types.map((type) => type.name)),
|
|
1183
|
-
item_fields: collectFlat(registrations.item_fields, (entry) => entry.fields.map((field) => field.name)),
|
|
1184
|
-
migrations: collectFlat(registrations.migrations, (entry) => typeof entry.definition.id === "string" ? [entry.definition.id] : []),
|
|
1185
|
-
importers: collect(registrations.importers, (entry) => entry.importer),
|
|
1186
|
-
exporters: collect(registrations.exporters, (entry) => entry.exporter),
|
|
1187
|
-
search_providers: collect(registrations.search_providers, (entry) => entry.definition.name),
|
|
1188
|
-
vector_store_adapters: collect(registrations.vector_store_adapters, (entry) => entry.definition.name),
|
|
1189
|
-
parser_overrides: collect(parsers.overrides, (entry) => entry.command),
|
|
1190
|
-
service_overrides: collect(services.overrides, (entry) => entry.service),
|
|
1191
|
-
renderer_overrides: collect(renderers.overrides, (entry) => entry.format),
|
|
1192
|
-
preflight_overrides: preflight.overrides.filter((entry) => matches(entry.name)).length
|
|
1193
|
-
};
|
|
1194
|
-
}
|
|
1195
|
-
function sortUnique(values) {
|
|
1196
|
-
return [...new Set(values)].sort((left, right) => left.localeCompare(right));
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
// dist/cli/commands/extension/describe.js
|
|
1200
|
-
function layerNameKey(layer, name) {
|
|
1201
|
-
return `${layer}:${normalizeExtensionNameForMatch(name)}`;
|
|
1202
|
-
}
|
|
1203
|
-
function buildExtensionDescribeResult(target, loadResult, activationResult) {
|
|
1204
|
-
const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));
|
|
1205
|
-
const candidates = [
|
|
1206
|
-
...loadResult.loaded.map((entry) => ({
|
|
1207
|
-
name: entry.name,
|
|
1208
|
-
layer: entry.layer,
|
|
1209
|
-
version: entry.version,
|
|
1210
|
-
activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name)) ? "failed" : "ok",
|
|
1211
|
-
surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
|
|
1212
|
-
})),
|
|
1213
|
-
...loadResult.failed.map((entry) => ({
|
|
1214
|
-
name: entry.name,
|
|
1215
|
-
layer: entry.layer,
|
|
1216
|
-
version: "unknown",
|
|
1217
|
-
activation_status: "not_loaded",
|
|
1218
|
-
surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
|
|
1219
|
-
}))
|
|
1220
|
-
].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));
|
|
1221
|
-
const normalizedTarget = typeof target === "string" ? normalizeExtensionNameForMatch(target) : null;
|
|
1222
|
-
const extensions = normalizedTarget === null ? candidates : candidates.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizedTarget);
|
|
1223
|
-
return {
|
|
1224
|
-
target: typeof target === "string" ? target.trim() : null,
|
|
1225
|
-
total: extensions.length,
|
|
1226
|
-
extensions,
|
|
1227
|
-
union: describeExtensionActivation(activationResult, normalizedTarget === null ? {} : { extensionName: target })
|
|
1228
|
-
};
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
1198
|
// dist/cli/commands/extension/doctor.js
|
|
1232
1199
|
function applyDoctorRuntimeActivationState(extensions, loadResult, activationResult) {
|
|
1233
1200
|
const loadedNames = new Set(loadResult.loaded.map((entry) => normalizeExtensionNameForMatch(entry.name)));
|
|
@@ -1481,6 +1448,98 @@ function classifyUnusedCapabilityWarnings(loadResult, activationResult) {
|
|
|
1481
1448
|
}
|
|
1482
1449
|
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1483
1450
|
}
|
|
1451
|
+
var TRIAGE_REMEDIATION_RULES = [
|
|
1452
|
+
{
|
|
1453
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manifest_")),
|
|
1454
|
+
build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "explore")} ${ctx.scopeFlag} to inspect discovered manifests and directories.`
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unknown:")),
|
|
1458
|
+
build: () => `Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:")),
|
|
1462
|
+
build: () => "Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema)."
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_missing:")),
|
|
1466
|
+
build: (ctx) => `Extension activation failed because code registered a surface missing from manifest capabilities. Run ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag} --detail deep --trace and add the reported missing_capability to manifest.json before publishing.`
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unused:")),
|
|
1470
|
+
build: (ctx) => `Extension manifests declare capabilities that are never registered against. Remove each reported unused capability from manifest.json to keep least privilege, or add the matching registration. Run ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag} --detail deep --trace for per-extension registration counts.`
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:")),
|
|
1474
|
+
build: () => "Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility."
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:")),
|
|
1478
|
+
build: () => "Global output service/renderer overrides are active. For output_format, return context.payload/null/undefined unless the extension owns the command. For renderers, return null for unrelated payloads so pm falls back to native rendering."
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_schema_narrow_activation:")),
|
|
1482
|
+
build: () => "A package registers custom item types/fields (a GLOBAL schema contribution) but also declares narrow activation.commands, so it never activates for built-in commands like pm create <type> and the custom type silently fails to register. Remove activation.commands from manifest.json so pm activates the package for every command, or \u2014 if the schema is intentionally command-scoped \u2014 knowingly ignore this advisory."
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:")),
|
|
1486
|
+
build: (ctx) => `Detected extension load failures caused by missing SDK dependency resolution. Ensure extension package dependencies include "@unbrained/pm-cli" and reinstall dependencies before running ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:")),
|
|
1490
|
+
build: (ctx) => `Detected extension module-mode mismatches. For ESM-based extension entries/imports, set package.json "type": "module" or use an explicit .mjs entry and rerun ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_")),
|
|
1494
|
+
build: (ctx) => `Extension pm version-bound warnings detected. Align each package manifest's pm_min_version/pm_max_version with the installed pm CLI version (see the warning's required/allowed=...:current=... details), or upgrade/downgrade the pm CLI to satisfy the declared bounds, then rerun ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
matches: (_warnings, ctx) => ctx.updateCheckFailedTotal > 0,
|
|
1498
|
+
build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "manage")} ${ctx.scopeFlag} after validating network and repository access.`
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manager_state_")),
|
|
1502
|
+
build: (ctx) => `Review and repair ${ctx.scope} managed extension state file if schema/read warnings persist.`
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
matches: (_warnings, ctx) => ctx.policyWarningCount > 0,
|
|
1506
|
+
build: () => "Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces."
|
|
1507
|
+
}
|
|
1508
|
+
];
|
|
1509
|
+
function buildExtensionTriageRemediation(params) {
|
|
1510
|
+
const { normalizedWarnings, options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount, updateHealthPartial, skippedUnmanagedTotal, skippedNonGithubTotal, updateAvailableTotal } = params;
|
|
1511
|
+
const remediation = [];
|
|
1512
|
+
const ctx = { options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount };
|
|
1513
|
+
if (normalizedWarnings.length > 0) {
|
|
1514
|
+
const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
|
|
1515
|
+
deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
|
|
1516
|
+
doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
|
|
1517
|
+
});
|
|
1518
|
+
if (registrationCollisionRemediation) {
|
|
1519
|
+
remediation.push(registrationCollisionRemediation);
|
|
1520
|
+
}
|
|
1521
|
+
for (const rule of TRIAGE_REMEDIATION_RULES) {
|
|
1522
|
+
if (rule.matches(normalizedWarnings, ctx)) {
|
|
1523
|
+
remediation.push(rule.build(ctx));
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
if (updateHealthPartial) {
|
|
1528
|
+
remediation.push(`Update-check coverage is partial because unmanaged extensions need adoption. Adopt existing installs via ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state (or ${lifecycleFlagCommand(options, "adopt-all")} ${scopeFlag}, ${lifecycleFlagCommand(options, "adopt")} <name> ${scopeFlag}, or reinstall via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>).`);
|
|
1529
|
+
} else if (skippedUnmanagedTotal > 0) {
|
|
1530
|
+
remediation.push(`Loaded unmanaged extensions are currently treated as informational. Use ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state to adopt them for update checks.`);
|
|
1531
|
+
}
|
|
1532
|
+
if (skippedNonGithubTotal > 0) {
|
|
1533
|
+
remediation.push(`Non-GitHub managed extensions are skipped by update checks. Use doctor output for non-update diagnostics.`);
|
|
1534
|
+
}
|
|
1535
|
+
if (updateAvailableTotal > 0) {
|
|
1536
|
+
remediation.push(`Update available managed extensions via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>.`);
|
|
1537
|
+
}
|
|
1538
|
+
if (remediation.length === 0) {
|
|
1539
|
+
remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
|
|
1540
|
+
}
|
|
1541
|
+
return remediation;
|
|
1542
|
+
}
|
|
1484
1543
|
function buildExtensionTriageSummary(scope, warnings, extensions, options = {}) {
|
|
1485
1544
|
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1486
1545
|
const managedTotal = extensions.filter((entry) => entry.managed).length;
|
|
@@ -1510,70 +1569,19 @@ function buildExtensionTriageSummary(scope, warnings, extensions, options = {})
|
|
|
1510
1569
|
const warningCodes = [...new Set(effectiveWarnings.map((value) => warningCode(value)))].sort((left, right) => left.localeCompare(right));
|
|
1511
1570
|
const policyWarnings = summarizePolicyWarnings(effectiveWarnings);
|
|
1512
1571
|
const scopeFlag = scope === "global" ? "--global" : "--project";
|
|
1513
|
-
const remediation = [];
|
|
1514
|
-
if (normalizedWarnings.length > 0) {
|
|
1515
|
-
const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
|
|
1516
|
-
deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
|
|
1517
|
-
doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
|
|
1518
|
-
});
|
|
1519
|
-
if (registrationCollisionRemediation) {
|
|
1520
|
-
remediation.push(registrationCollisionRemediation);
|
|
1521
|
-
}
|
|
1522
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_manifest_"))) {
|
|
1523
|
-
remediation.push(`Run ${lifecycleFlagCommand(options, "explore")} ${scopeFlag} to inspect discovered manifests and directories.`);
|
|
1524
|
-
}
|
|
1525
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unknown:"))) {
|
|
1526
|
-
remediation.push(`Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`);
|
|
1527
|
-
}
|
|
1528
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:"))) {
|
|
1529
|
-
remediation.push("Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema).");
|
|
1530
|
-
}
|
|
1531
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_missing:"))) {
|
|
1532
|
-
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.`);
|
|
1533
|
-
}
|
|
1534
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unused:"))) {
|
|
1535
|
-
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.`);
|
|
1536
|
-
}
|
|
1537
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:"))) {
|
|
1538
|
-
remediation.push("Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility.");
|
|
1539
|
-
}
|
|
1540
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:"))) {
|
|
1541
|
-
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.");
|
|
1542
|
-
}
|
|
1543
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:"))) {
|
|
1544
|
-
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}.`);
|
|
1545
|
-
}
|
|
1546
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:"))) {
|
|
1547
|
-
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}.`);
|
|
1548
|
-
}
|
|
1549
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_"))) {
|
|
1550
|
-
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}.`);
|
|
1551
|
-
}
|
|
1552
|
-
if (updateCheckFailedTotal > 0) {
|
|
1553
|
-
remediation.push(`Run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after validating network and repository access.`);
|
|
1554
|
-
}
|
|
1555
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_manager_state_"))) {
|
|
1556
|
-
remediation.push(`Review and repair ${scope} managed extension state file if schema/read warnings persist.`);
|
|
1557
|
-
}
|
|
1558
|
-
if (policyWarnings.warning_count > 0) {
|
|
1559
|
-
remediation.push("Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces.");
|
|
1560
|
-
}
|
|
1561
|
-
}
|
|
1562
1572
|
const collisionPlan = buildRegistrationCollisionPlan(scope, normalizedWarnings, extensions, options);
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
|
|
1576
|
-
}
|
|
1573
|
+
const remediation = buildExtensionTriageRemediation({
|
|
1574
|
+
normalizedWarnings,
|
|
1575
|
+
options,
|
|
1576
|
+
scope,
|
|
1577
|
+
scopeFlag,
|
|
1578
|
+
updateCheckFailedTotal,
|
|
1579
|
+
policyWarningCount: policyWarnings.warning_count,
|
|
1580
|
+
updateHealthPartial,
|
|
1581
|
+
skippedUnmanagedTotal,
|
|
1582
|
+
skippedNonGithubTotal,
|
|
1583
|
+
updateAvailableTotal
|
|
1584
|
+
});
|
|
1577
1585
|
return {
|
|
1578
1586
|
status: effectiveWarnings.length === 0 ? "ok" : "warn",
|
|
1579
1587
|
warning_count: effectiveWarnings.length,
|
|
@@ -1697,6 +1705,39 @@ var EXTENSION_INSTALL_COPY_ATTEMPTS = 3;
|
|
|
1697
1705
|
var EXTENSION_INSTALL_LOCK_ATTEMPTS = 120;
|
|
1698
1706
|
var EXTENSION_INSTALL_LOCK_DELAY_MS = 250;
|
|
1699
1707
|
var EXTENSION_INSTALL_LOCK_STALE_MS = 12e4;
|
|
1708
|
+
var LIFECYCLE_ACTION_TARGETS = [
|
|
1709
|
+
["install", "install", "--install"],
|
|
1710
|
+
["uninstall", "uninstall", "--uninstall"],
|
|
1711
|
+
["explore", "explore", "--explore"],
|
|
1712
|
+
["list", "explore", "--explore"],
|
|
1713
|
+
["manage", "manage", "--manage"],
|
|
1714
|
+
["describe", "describe", "--describe"],
|
|
1715
|
+
["reload", "reload", "--reload"],
|
|
1716
|
+
["doctor", "doctor", "--doctor"],
|
|
1717
|
+
["catalog", "catalog", "--catalog"],
|
|
1718
|
+
["init", "init", "--init"],
|
|
1719
|
+
["scaffold", "init", "--scaffold"],
|
|
1720
|
+
["adopt", "adopt", "--adopt"],
|
|
1721
|
+
["adopt-all", "adopt-all", "--adopt-all"],
|
|
1722
|
+
["activate", "activate", "--activate"],
|
|
1723
|
+
["deactivate", "deactivate", "--deactivate"]
|
|
1724
|
+
];
|
|
1725
|
+
var LIFECYCLE_ACTION_FLAG_HINT = LIFECYCLE_ACTION_TARGETS.map(([, , flag]) => flag).filter((flag, index, flags) => flags.indexOf(flag) === index).join(", ");
|
|
1726
|
+
var LIFECYCLE_ACTION_FLAGS = {
|
|
1727
|
+
install: "--install",
|
|
1728
|
+
uninstall: "--uninstall",
|
|
1729
|
+
explore: "--explore",
|
|
1730
|
+
manage: "--manage",
|
|
1731
|
+
describe: "--describe",
|
|
1732
|
+
reload: "--reload",
|
|
1733
|
+
doctor: "--doctor",
|
|
1734
|
+
catalog: "--catalog",
|
|
1735
|
+
adopt: "--adopt",
|
|
1736
|
+
"adopt-all": "--adopt-all",
|
|
1737
|
+
activate: "--activate",
|
|
1738
|
+
deactivate: "--deactivate",
|
|
1739
|
+
init: "--init"
|
|
1740
|
+
};
|
|
1700
1741
|
var NATIVE_OUTPUT_MARKER = "__pm_native_output";
|
|
1701
1742
|
function buildExtensionPolicyDetails(policy) {
|
|
1702
1743
|
const overrides = (policy.extension_overrides ?? []).map((override) => ({
|
|
@@ -1913,49 +1954,106 @@ function clearExtensionState(settings, name) {
|
|
|
1913
1954
|
settings.extensions.disabled = [...disabled].sort((left, right) => left.localeCompare(right));
|
|
1914
1955
|
return settings.extensions.enabled.join("\0") !== previousEnabled.join("\0") || settings.extensions.disabled.join("\0") !== previousDisabled.join("\0");
|
|
1915
1956
|
}
|
|
1916
|
-
function
|
|
1917
|
-
const
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
options.adopt ? "adopt" : null,
|
|
1929
|
-
options.adoptAll ? "adopt-all" : null,
|
|
1930
|
-
options.activate ? "activate" : null,
|
|
1931
|
-
options.deactivate ? "deactivate" : null
|
|
1932
|
-
].filter((value) => value !== null))];
|
|
1933
|
-
if (selected.length === 0) {
|
|
1934
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "doctor") {
|
|
1935
|
-
return "doctor";
|
|
1936
|
-
}
|
|
1937
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "reload") {
|
|
1938
|
-
return "reload";
|
|
1939
|
-
}
|
|
1940
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "catalog") {
|
|
1941
|
-
return "catalog";
|
|
1942
|
-
}
|
|
1943
|
-
if (typeof target === "string" && (target.trim().toLowerCase() === "init" || target.trim().toLowerCase() === "scaffold")) {
|
|
1944
|
-
return "init";
|
|
1945
|
-
}
|
|
1946
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "explore") {
|
|
1947
|
-
return "explore";
|
|
1957
|
+
function suggestLifecycleActionTarget(target) {
|
|
1958
|
+
const normalizedTarget = target.trim().toLowerCase();
|
|
1959
|
+
const exactMatch = LIFECYCLE_ACTION_TARGETS.find(([candidate]) => candidate === normalizedTarget);
|
|
1960
|
+
if (exactMatch) {
|
|
1961
|
+
return { action: exactMatch[1], flag: exactMatch[2] };
|
|
1962
|
+
}
|
|
1963
|
+
const maxDistance = normalizedTarget.length <= 4 ? 1 : 2;
|
|
1964
|
+
let nearest = null;
|
|
1965
|
+
for (const [candidate, action, flag] of LIFECYCLE_ACTION_TARGETS) {
|
|
1966
|
+
const distance = levenshteinDistanceWithinLimit(normalizedTarget, candidate, maxDistance);
|
|
1967
|
+
if (distance === null) {
|
|
1968
|
+
continue;
|
|
1948
1969
|
}
|
|
1949
|
-
if (
|
|
1950
|
-
|
|
1970
|
+
if (nearest === null) {
|
|
1971
|
+
nearest = { action, flag, distance };
|
|
1972
|
+
continue;
|
|
1951
1973
|
}
|
|
1952
|
-
if (
|
|
1953
|
-
|
|
1974
|
+
if (distance < nearest.distance) {
|
|
1975
|
+
nearest = { action, flag, distance };
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
return nearest === null ? null : { action: nearest.action, flag: nearest.flag };
|
|
1979
|
+
}
|
|
1980
|
+
function buildUnknownLifecycleActionError(target, options) {
|
|
1981
|
+
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
1982
|
+
const suggestion = suggestLifecycleActionTarget(target);
|
|
1983
|
+
if (!suggestion) {
|
|
1984
|
+
return new PmCliError(`One action flag is required. Use one of: ${LIFECYCLE_ACTION_FLAG_HINT}. Bare \`pm package\` and \`pm extension\` default to --explore.`, EXIT_CODE.USAGE);
|
|
1985
|
+
}
|
|
1986
|
+
const command = `pm ${noun} ${suggestion.flag}`;
|
|
1987
|
+
return new PmCliError(`Unknown ${noun} lifecycle action "${target}". Did you mean "${suggestion.flag}"?`, EXIT_CODE.USAGE, {
|
|
1988
|
+
code: "unknown_lifecycle_action",
|
|
1989
|
+
required: `Use one of: ${LIFECYCLE_ACTION_FLAG_HINT}.`,
|
|
1990
|
+
examples: [command, `pm ${noun} --help`],
|
|
1991
|
+
recovery: {
|
|
1992
|
+
attempted_command: `pm ${noun} ${target}`,
|
|
1993
|
+
suggested_retry: command,
|
|
1994
|
+
fallback_candidates: [
|
|
1995
|
+
{
|
|
1996
|
+
source: "lifecycle_action",
|
|
1997
|
+
command,
|
|
1998
|
+
reason: `nearest lifecycle action for "${target}"`
|
|
1999
|
+
}
|
|
2000
|
+
]
|
|
1954
2001
|
}
|
|
2002
|
+
});
|
|
2003
|
+
}
|
|
2004
|
+
var EXTENSION_ACTION_FLAG_SELECTORS = [
|
|
2005
|
+
["install", "install"],
|
|
2006
|
+
["uninstall", "uninstall"],
|
|
2007
|
+
["explore", "explore"],
|
|
2008
|
+
["manage", "manage"],
|
|
2009
|
+
["describe", "describe"],
|
|
2010
|
+
["reload", "reload"],
|
|
2011
|
+
["doctor", "doctor"],
|
|
2012
|
+
["catalog", "catalog"],
|
|
2013
|
+
["init", "init"],
|
|
2014
|
+
["scaffold", "init"],
|
|
2015
|
+
["adopt", "adopt"],
|
|
2016
|
+
["adoptAll", "adopt-all"],
|
|
2017
|
+
["activate", "activate"],
|
|
2018
|
+
["deactivate", "deactivate"]
|
|
2019
|
+
];
|
|
2020
|
+
function resolveImplicitActionFromTarget(normalizedTarget) {
|
|
2021
|
+
if (normalizedTarget === "doctor") {
|
|
2022
|
+
return "doctor";
|
|
2023
|
+
}
|
|
2024
|
+
if (normalizedTarget === "reload") {
|
|
2025
|
+
return "reload";
|
|
2026
|
+
}
|
|
2027
|
+
if (normalizedTarget === "catalog") {
|
|
2028
|
+
return "catalog";
|
|
2029
|
+
}
|
|
2030
|
+
if (normalizedTarget === "init" || normalizedTarget === "scaffold") {
|
|
2031
|
+
return "init";
|
|
2032
|
+
}
|
|
2033
|
+
if (normalizedTarget === "explore") {
|
|
2034
|
+
return "explore";
|
|
2035
|
+
}
|
|
2036
|
+
if (normalizedTarget === "manage") {
|
|
2037
|
+
return "manage";
|
|
2038
|
+
}
|
|
2039
|
+
if (normalizedTarget === "list" || normalizedTarget === "") {
|
|
2040
|
+
return "explore";
|
|
2041
|
+
}
|
|
2042
|
+
return null;
|
|
2043
|
+
}
|
|
2044
|
+
function resolveAction(target, options) {
|
|
2045
|
+
const selected = [
|
|
2046
|
+
...new Set(EXTENSION_ACTION_FLAG_SELECTORS.filter(([flag]) => options[flag] === true).map(([, mappedAction]) => mappedAction))
|
|
2047
|
+
];
|
|
2048
|
+
if (selected.length === 0) {
|
|
1955
2049
|
if (target === void 0) {
|
|
1956
2050
|
return "explore";
|
|
1957
2051
|
}
|
|
1958
|
-
|
|
2052
|
+
const implicitAction = resolveImplicitActionFromTarget(target.trim().toLowerCase());
|
|
2053
|
+
if (implicitAction) {
|
|
2054
|
+
return implicitAction;
|
|
2055
|
+
}
|
|
2056
|
+
throw buildUnknownLifecycleActionError(target, options);
|
|
1959
2057
|
}
|
|
1960
2058
|
if (selected.length > 1) {
|
|
1961
2059
|
throw new PmCliError("Extension action flags are mutually exclusive.", EXIT_CODE.USAGE);
|
|
@@ -2013,6 +2111,27 @@ function resolveUpdateCheckResolution(managedEntry) {
|
|
|
2013
2111
|
reason: "no_update_check_recorded"
|
|
2014
2112
|
};
|
|
2015
2113
|
}
|
|
2114
|
+
function buildInstalledExtensionSummary(identity, scope, managedEntry, updateCheck) {
|
|
2115
|
+
return {
|
|
2116
|
+
name: identity.name,
|
|
2117
|
+
directory: identity.directory,
|
|
2118
|
+
version: identity.version,
|
|
2119
|
+
entry: identity.entry,
|
|
2120
|
+
scope,
|
|
2121
|
+
active: identity.enabled,
|
|
2122
|
+
enabled: identity.enabled,
|
|
2123
|
+
runtime_active: null,
|
|
2124
|
+
activation_status: "unknown",
|
|
2125
|
+
managed: Boolean(managedEntry),
|
|
2126
|
+
source: managedEntry?.source,
|
|
2127
|
+
update_available: managedEntry?.update_available,
|
|
2128
|
+
last_update_check_at: managedEntry?.last_update_check_at,
|
|
2129
|
+
last_update_remote_commit: managedEntry?.last_update_remote_commit,
|
|
2130
|
+
update_error: managedEntry?.update_error,
|
|
2131
|
+
update_check_status: updateCheck.status,
|
|
2132
|
+
update_check_reason: updateCheck.reason
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2016
2135
|
async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
2017
2136
|
if (!await pathExists(extensionsRoot)) {
|
|
2018
2137
|
return {
|
|
@@ -2036,27 +2155,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
|
2036
2155
|
if (!await pathExists(manifestPath)) {
|
|
2037
2156
|
warnings.push(`extension_manifest_missing:${scope}:${directoryName}`);
|
|
2038
2157
|
const managedEntry2 = managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
|
|
2039
|
-
|
|
2040
|
-
const enabled2 = managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false;
|
|
2041
|
-
summaries.push({
|
|
2158
|
+
summaries.push(buildInstalledExtensionSummary({
|
|
2042
2159
|
name: managedEntry2?.name ?? directoryName,
|
|
2043
2160
|
directory: directoryName,
|
|
2044
2161
|
version: managedEntry2?.manifest_version ?? "unknown",
|
|
2045
2162
|
entry: managedEntry2?.manifest_entry ?? "unknown",
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
enabled: enabled2,
|
|
2049
|
-
runtime_active: null,
|
|
2050
|
-
activation_status: "unknown",
|
|
2051
|
-
managed: Boolean(managedEntry2),
|
|
2052
|
-
source: managedEntry2?.source,
|
|
2053
|
-
update_available: managedEntry2?.update_available,
|
|
2054
|
-
last_update_check_at: managedEntry2?.last_update_check_at,
|
|
2055
|
-
last_update_remote_commit: managedEntry2?.last_update_remote_commit,
|
|
2056
|
-
update_error: managedEntry2?.update_error,
|
|
2057
|
-
update_check_status: updateCheck2.status,
|
|
2058
|
-
update_check_reason: updateCheck2.reason
|
|
2059
|
-
});
|
|
2163
|
+
enabled: managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false
|
|
2164
|
+
}, scope, managedEntry2, resolveUpdateCheckResolution(managedEntry2)));
|
|
2060
2165
|
continue;
|
|
2061
2166
|
}
|
|
2062
2167
|
let rawManifest;
|
|
@@ -2072,27 +2177,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
|
2072
2177
|
continue;
|
|
2073
2178
|
}
|
|
2074
2179
|
const managedEntry = managedByName.get(normalizeExtensionNameForMatch(manifest.name)) ?? managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
|
|
2075
|
-
|
|
2076
|
-
const enabled = isExtensionEnabled(settings, manifest.name);
|
|
2077
|
-
summaries.push({
|
|
2180
|
+
summaries.push(buildInstalledExtensionSummary({
|
|
2078
2181
|
name: manifest.name,
|
|
2079
2182
|
directory: directoryName,
|
|
2080
2183
|
version: manifest.version,
|
|
2081
2184
|
entry: manifest.entry,
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
enabled,
|
|
2085
|
-
runtime_active: null,
|
|
2086
|
-
activation_status: "unknown",
|
|
2087
|
-
managed: Boolean(managedEntry),
|
|
2088
|
-
source: managedEntry?.source,
|
|
2089
|
-
update_available: managedEntry?.update_available,
|
|
2090
|
-
last_update_check_at: managedEntry?.last_update_check_at,
|
|
2091
|
-
last_update_remote_commit: managedEntry?.last_update_remote_commit,
|
|
2092
|
-
update_error: managedEntry?.update_error,
|
|
2093
|
-
update_check_status: updateCheck.status,
|
|
2094
|
-
update_check_reason: updateCheck.reason
|
|
2095
|
-
});
|
|
2185
|
+
enabled: isExtensionEnabled(settings, manifest.name)
|
|
2186
|
+
}, scope, managedEntry, resolveUpdateCheckResolution(managedEntry)));
|
|
2096
2187
|
}
|
|
2097
2188
|
return {
|
|
2098
2189
|
extensions: summaries.sort((left, right) => left.name.localeCompare(right.name)),
|
|
@@ -2174,7 +2265,8 @@ async function probeRuntimeCommandPathsForInstall(pmRoot, settings, refreshedIns
|
|
|
2174
2265
|
return {
|
|
2175
2266
|
installed: applyDoctorRuntimeActivationState(refreshedInstalled, loadResult, activationResult),
|
|
2176
2267
|
warnings: [...loadResult.warnings, ...activationResult.warnings],
|
|
2177
|
-
activation_failures: collectActivationFailureDiagnostics(activationResult.failed)
|
|
2268
|
+
activation_failures: collectActivationFailureDiagnostics(activationResult.failed),
|
|
2269
|
+
item_type_registrations: activationResult.registrations.item_types
|
|
2178
2270
|
};
|
|
2179
2271
|
}
|
|
2180
2272
|
async function checkGithubUpdate(source, gitCommandRunner = runGitCommand) {
|
|
@@ -2300,13 +2392,37 @@ function resolveGithubOption(options) {
|
|
|
2300
2392
|
}
|
|
2301
2393
|
return void 0;
|
|
2302
2394
|
}
|
|
2303
|
-
function
|
|
2395
|
+
function getLifecycleActionFlag(action) {
|
|
2396
|
+
return LIFECYCLE_ACTION_FLAGS[action];
|
|
2397
|
+
}
|
|
2398
|
+
function requireTarget(target, action, options = {}) {
|
|
2304
2399
|
const normalized = target?.trim();
|
|
2305
2400
|
if (!normalized) {
|
|
2306
2401
|
if (action === "init") {
|
|
2307
2402
|
throw new PmCliError('Action "init" requires a scaffold target path (for example: pm package init ./my-package or pm extension init ./my-extension).', EXIT_CODE.USAGE);
|
|
2308
2403
|
}
|
|
2309
|
-
|
|
2404
|
+
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
2405
|
+
const targetName = action === "install" ? "source" : "name";
|
|
2406
|
+
const targetLabel = `${noun} ${targetName}`;
|
|
2407
|
+
const actionFlag = getLifecycleActionFlag(action);
|
|
2408
|
+
const commandTarget = `<${targetName}>`;
|
|
2409
|
+
const command = `pm ${noun} ${actionFlag} ${commandTarget}`;
|
|
2410
|
+
throw new PmCliError(`Action "${action}" requires ${targetLabel} input.`, EXIT_CODE.USAGE, {
|
|
2411
|
+
code: "missing_lifecycle_target",
|
|
2412
|
+
required: `Provide a ${targetName} target for ${action}.`,
|
|
2413
|
+
examples: [`pm ${noun} ${action} ${commandTarget}`, command, `pm ${noun} --help`],
|
|
2414
|
+
recovery: {
|
|
2415
|
+
attempted_command: `pm ${noun} ${action}`,
|
|
2416
|
+
suggested_retry: command,
|
|
2417
|
+
fallback_candidates: [
|
|
2418
|
+
{
|
|
2419
|
+
source: "lifecycle_action",
|
|
2420
|
+
command,
|
|
2421
|
+
reason: `flag-form ${action} command with required ${targetName} target`
|
|
2422
|
+
}
|
|
2423
|
+
]
|
|
2424
|
+
}
|
|
2425
|
+
});
|
|
2310
2426
|
}
|
|
2311
2427
|
return normalized;
|
|
2312
2428
|
}
|
|
@@ -2323,43 +2439,86 @@ function collectGlobalOutputOverrideDoctorWarnings(activationResult) {
|
|
|
2323
2439
|
}
|
|
2324
2440
|
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
2325
2441
|
}
|
|
2326
|
-
|
|
2327
|
-
const
|
|
2328
|
-
|
|
2329
|
-
|
|
2442
|
+
function collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResult) {
|
|
2443
|
+
const schemaContributors = /* @__PURE__ */ new Set();
|
|
2444
|
+
for (const entry of activationResult.registrations.item_types) {
|
|
2445
|
+
if (entry.types.length > 0) {
|
|
2446
|
+
schemaContributors.add(`${entry.layer}:${normalizeExtensionNameForMatch(entry.name)}`);
|
|
2447
|
+
}
|
|
2330
2448
|
}
|
|
2331
|
-
|
|
2332
|
-
|
|
2449
|
+
for (const entry of activationResult.registrations.item_fields) {
|
|
2450
|
+
if (entry.fields.length > 0) {
|
|
2451
|
+
schemaContributors.add(`${entry.layer}:${normalizeExtensionNameForMatch(entry.name)}`);
|
|
2452
|
+
}
|
|
2333
2453
|
}
|
|
2334
|
-
|
|
2335
|
-
|
|
2454
|
+
const warnings = [];
|
|
2455
|
+
for (const extension of loadResult.loaded) {
|
|
2456
|
+
if ((extension.activation?.commands ?? []).length === 0) {
|
|
2457
|
+
continue;
|
|
2458
|
+
}
|
|
2459
|
+
if (schemaContributors.has(`${extension.layer}:${normalizeExtensionNameForMatch(extension.name)}`)) {
|
|
2460
|
+
warnings.push(`extension_schema_narrow_activation:${extension.layer}:${extension.name}`);
|
|
2461
|
+
}
|
|
2336
2462
|
}
|
|
2337
|
-
|
|
2338
|
-
|
|
2463
|
+
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
2464
|
+
}
|
|
2465
|
+
function assertExtensionActionOptionScope(action, options) {
|
|
2466
|
+
const guards = [
|
|
2467
|
+
{
|
|
2468
|
+
triggered: options.strictExit === true || options.failOnWarn === true,
|
|
2469
|
+
allowed: action === "doctor",
|
|
2470
|
+
message: "--strict-exit and --fail-on-warn are only valid with --doctor."
|
|
2471
|
+
},
|
|
2472
|
+
{ triggered: options.trace === true, allowed: action === "doctor", message: "--trace is only valid with --doctor." },
|
|
2473
|
+
{ triggered: options.watch === true, allowed: action === "reload", message: "--watch is only valid with --reload." },
|
|
2474
|
+
{
|
|
2475
|
+
triggered: options.runtimeProbe === true,
|
|
2476
|
+
allowed: action === "manage",
|
|
2477
|
+
message: "--runtime-probe is only valid with --manage."
|
|
2478
|
+
},
|
|
2479
|
+
{
|
|
2480
|
+
triggered: options.fixManagedState === true,
|
|
2481
|
+
allowed: action === "manage" || action === "doctor",
|
|
2482
|
+
message: "--fix-managed-state is only valid with --manage or --doctor."
|
|
2483
|
+
},
|
|
2484
|
+
{
|
|
2485
|
+
triggered: options.capability !== void 0,
|
|
2486
|
+
allowed: action === "init",
|
|
2487
|
+
message: "--capability is only valid with --init/--scaffold."
|
|
2488
|
+
},
|
|
2489
|
+
{
|
|
2490
|
+
triggered: options.declarative === true,
|
|
2491
|
+
allowed: action === "init",
|
|
2492
|
+
message: "--declarative is only valid with --init/--scaffold."
|
|
2493
|
+
}
|
|
2494
|
+
];
|
|
2495
|
+
for (const guard of guards) {
|
|
2496
|
+
if (guard.triggered && !guard.allowed) {
|
|
2497
|
+
throw new PmCliError(guard.message, EXIT_CODE.USAGE);
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
function resolveNormalizedExtensionTarget(target, action, options) {
|
|
2502
|
+
const normalizedInput = target?.trim().toLowerCase();
|
|
2503
|
+
if (action === "doctor" && normalizedInput === "doctor") {
|
|
2504
|
+
return void 0;
|
|
2339
2505
|
}
|
|
2340
|
-
if (
|
|
2341
|
-
|
|
2506
|
+
if (action === "reload" && normalizedInput === "reload") {
|
|
2507
|
+
return void 0;
|
|
2342
2508
|
}
|
|
2343
|
-
if (
|
|
2344
|
-
|
|
2509
|
+
if (action === "catalog" && normalizedInput === "catalog") {
|
|
2510
|
+
return void 0;
|
|
2345
2511
|
}
|
|
2346
|
-
const
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
}
|
|
2357
|
-
const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
|
|
2358
|
-
if (inferredInitAlias) {
|
|
2359
|
-
return void 0;
|
|
2360
|
-
}
|
|
2361
|
-
return target;
|
|
2362
|
-
})();
|
|
2512
|
+
const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
|
|
2513
|
+
if (inferredInitAlias) {
|
|
2514
|
+
return void 0;
|
|
2515
|
+
}
|
|
2516
|
+
return target;
|
|
2517
|
+
}
|
|
2518
|
+
async function runExtension(target, options, global) {
|
|
2519
|
+
const action = resolveAction(target, options);
|
|
2520
|
+
assertExtensionActionOptionScope(action, options);
|
|
2521
|
+
const normalizedTarget = resolveNormalizedExtensionTarget(target, action, options);
|
|
2363
2522
|
const scope = resolveScope(options);
|
|
2364
2523
|
const resolvedRoots = resolveExtensionRootsForScope(scope, global);
|
|
2365
2524
|
const warnings = [];
|
|
@@ -2391,431 +2550,736 @@ async function runExtension(target, options, global) {
|
|
|
2391
2550
|
}
|
|
2392
2551
|
return result;
|
|
2393
2552
|
};
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2553
|
+
const ctx = {
|
|
2554
|
+
action,
|
|
2555
|
+
normalizedTarget,
|
|
2556
|
+
scope,
|
|
2557
|
+
resolvedRoots,
|
|
2558
|
+
warnings,
|
|
2559
|
+
options,
|
|
2560
|
+
global,
|
|
2561
|
+
withResult
|
|
2562
|
+
};
|
|
2563
|
+
return EXTENSION_ACTION_HANDLERS[action](ctx);
|
|
2564
|
+
}
|
|
2565
|
+
async function runExtensionInitAction(ctx) {
|
|
2566
|
+
const { action, normalizedTarget, options, withResult } = ctx;
|
|
2567
|
+
const githubOption = resolveGithubOption(options);
|
|
2568
|
+
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2569
|
+
throw new PmCliError('Action "init" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2570
|
+
}
|
|
2571
|
+
const scaffoldTarget = requireTarget(normalizedTarget, action, options);
|
|
2572
|
+
const scaffold = await scaffoldExtensionProject(scaffoldTarget, options.vocabulary ?? "extension", options.capability, options.declarative === true);
|
|
2573
|
+
const quotedTargetPath = JSON.stringify(scaffold.target_path);
|
|
2574
|
+
const quotedShellTargetPath = JSON.stringify(scaffold.target_path.replace(/\\/g, "/"));
|
|
2575
|
+
return withResult({
|
|
2576
|
+
scaffolded: scaffold.created_directory || scaffold.files.some((entry) => entry.status === "created"),
|
|
2577
|
+
extension: {
|
|
2578
|
+
name: scaffold.extension_name,
|
|
2579
|
+
command: scaffold.command_name
|
|
2580
|
+
},
|
|
2581
|
+
capability: scaffold.capability,
|
|
2582
|
+
style: scaffold.style,
|
|
2583
|
+
target_path: scaffold.target_path,
|
|
2584
|
+
created_directory: scaffold.created_directory,
|
|
2585
|
+
files: scaffold.files,
|
|
2586
|
+
next_steps: [
|
|
2587
|
+
// Extensions are authored AND loaded as TypeScript (ADR pm-2c28 / pm-m1uz):
|
|
2588
|
+
// the manifest entry is ./index.ts and pm strips types on load (Node
|
|
2589
|
+
// >=22.18), so there is no compile/build step — install dependencies, then
|
|
2590
|
+
// install the scaffold directly.
|
|
2591
|
+
...options.vocabulary === "package" ? [`Install dependencies: cd ${quotedShellTargetPath}, then run "npm install"`] : [
|
|
2592
|
+
`Install type-check dependencies: cd ${quotedShellTargetPath}, then run "npm install -D typescript @types/node @unbrained/pm-cli"`
|
|
2593
|
+
],
|
|
2594
|
+
`Install the scaffold: ${options.vocabulary === "package" ? "pm install --project" : "pm extension --install --project"} ${quotedTargetPath}`,
|
|
2595
|
+
`Smoke-test command path: pm ${scaffold.command_name}`,
|
|
2596
|
+
...options.vocabulary === "package" ? [`Validate the package: cd ${quotedShellTargetPath}, then run "npm run typecheck" and "npm test"`] : [`Type-check the source (optional): cd ${quotedShellTargetPath}, then run "npx tsc --noEmit"`],
|
|
2597
|
+
`Run diagnostics: ${options.vocabulary === "package" ? "pm package doctor" : "pm extension --doctor"} --project --detail summary`
|
|
2598
|
+
]
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
async function runExtensionReloadAction(ctx) {
|
|
2602
|
+
const { normalizedTarget, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
2603
|
+
if (normalizedTarget !== void 0) {
|
|
2604
|
+
throw new PmCliError('Action "reload" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2425
2605
|
}
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2606
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2607
|
+
const reloadToken = nextExtensionReloadToken();
|
|
2608
|
+
const reloaded = await loadExtensions({
|
|
2609
|
+
pmRoot: resolvedRoots.settings_root,
|
|
2610
|
+
settings,
|
|
2611
|
+
cwd: process.cwd(),
|
|
2612
|
+
noExtensions: global.noExtensions,
|
|
2613
|
+
reload_token: reloadToken,
|
|
2614
|
+
cache_bust: true
|
|
2615
|
+
});
|
|
2616
|
+
warnings.push(...reloaded.warnings);
|
|
2617
|
+
const activation = await activateExtensions(reloaded);
|
|
2618
|
+
warnings.push(...activation.warnings);
|
|
2619
|
+
const details = {
|
|
2620
|
+
reload: {
|
|
2621
|
+
token: reloadToken,
|
|
2622
|
+
cache_bust: true,
|
|
2623
|
+
watch: options.watch === true
|
|
2624
|
+
},
|
|
2625
|
+
loaded_count: reloaded.loaded.length,
|
|
2626
|
+
failed_count: reloaded.failed.length,
|
|
2627
|
+
activated_count: Math.max(0, reloaded.loaded.length - activation.failed.length),
|
|
2628
|
+
activation_failed_count: activation.failed.length,
|
|
2629
|
+
loaded_extensions: reloaded.loaded.map((entry) => ({
|
|
2630
|
+
name: entry.name,
|
|
2631
|
+
layer: entry.layer,
|
|
2632
|
+
version: entry.version
|
|
2633
|
+
})),
|
|
2634
|
+
failed_extensions: reloaded.failed.map((entry) => ({
|
|
2635
|
+
name: entry.name,
|
|
2636
|
+
layer: entry.layer,
|
|
2637
|
+
error: entry.error
|
|
2638
|
+
})),
|
|
2639
|
+
activation_failures: activation.failed.map((entry) => ({
|
|
2640
|
+
name: entry.name,
|
|
2641
|
+
layer: entry.layer,
|
|
2642
|
+
error: entry.error
|
|
2643
|
+
}))
|
|
2644
|
+
};
|
|
2645
|
+
if (options.watch === true) {
|
|
2646
|
+
warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
|
|
2647
|
+
}
|
|
2648
|
+
return withResult(details);
|
|
2649
|
+
}
|
|
2650
|
+
async function runExtensionCatalogAction(ctx) {
|
|
2651
|
+
const { normalizedTarget, scope, options, global, withResult } = ctx;
|
|
2652
|
+
if (typeof normalizedTarget === "string" && normalizedTarget.length > 0 && normalizedTarget !== "catalog") {
|
|
2653
|
+
throw new PmCliError('Action "catalog" does not accept a package target.', EXIT_CODE.USAGE);
|
|
2654
|
+
}
|
|
2655
|
+
return withResult(await buildBundledPackageCatalog(scope, global, options));
|
|
2656
|
+
}
|
|
2657
|
+
function buildInstallManagedSource(bundledAliasName, installSource, resolvedSource) {
|
|
2658
|
+
if (bundledAliasName) {
|
|
2659
|
+
return {
|
|
2660
|
+
kind: "builtin",
|
|
2661
|
+
input: bundledAliasName,
|
|
2662
|
+
location: bundledAliasName,
|
|
2663
|
+
name: bundledAliasName
|
|
2468
2664
|
};
|
|
2469
|
-
if (options.watch === true) {
|
|
2470
|
-
warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
|
|
2471
|
-
}
|
|
2472
|
-
return withResult(details);
|
|
2473
2665
|
}
|
|
2474
|
-
if (
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2666
|
+
if (installSource.kind === "local") {
|
|
2667
|
+
return {
|
|
2668
|
+
kind: "local",
|
|
2669
|
+
input: installSource.input,
|
|
2670
|
+
location: installSource.absolute_path
|
|
2671
|
+
};
|
|
2479
2672
|
}
|
|
2480
|
-
if (
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2673
|
+
if (installSource.kind === "npm") {
|
|
2674
|
+
return {
|
|
2675
|
+
kind: "npm",
|
|
2676
|
+
input: installSource.input,
|
|
2677
|
+
location: resolvedSource.resolved_subpath ?? ".",
|
|
2678
|
+
package: resolvedSource.npm_package,
|
|
2679
|
+
version: resolvedSource.npm_version
|
|
2680
|
+
};
|
|
2681
|
+
}
|
|
2682
|
+
return {
|
|
2683
|
+
kind: "github",
|
|
2684
|
+
input: installSource.input,
|
|
2685
|
+
location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
|
|
2686
|
+
repository: installSource.repository,
|
|
2687
|
+
owner: installSource.owner,
|
|
2688
|
+
repo: installSource.repo,
|
|
2689
|
+
ref: installSource.ref,
|
|
2690
|
+
subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
|
|
2691
|
+
commit: resolvedSource.commit
|
|
2692
|
+
};
|
|
2693
|
+
}
|
|
2694
|
+
async function performExtensionInstallUnderLock(ctx, input) {
|
|
2695
|
+
const { scope, resolvedRoots, warnings, global, withResult } = ctx;
|
|
2696
|
+
const { validated, destinationDirectoryName, bundledAliasName, installSource, resolvedSource } = input;
|
|
2697
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2698
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2699
|
+
warnings.push(...managedStateRead.warnings);
|
|
2700
|
+
const destinationDirectory = path5.join(resolvedRoots.selected_root, destinationDirectoryName);
|
|
2701
|
+
const destinationExists = await pathExists(destinationDirectory);
|
|
2702
|
+
const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
|
|
2703
|
+
await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
|
|
2704
|
+
if (!installInPlace) {
|
|
2705
|
+
await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
|
|
2706
|
+
}
|
|
2707
|
+
const sourceRecord = buildInstallManagedSource(bundledAliasName, installSource, resolvedSource);
|
|
2708
|
+
const now = nowIso();
|
|
2709
|
+
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2710
|
+
const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
2711
|
+
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2712
|
+
name: validated.manifest.name,
|
|
2713
|
+
directory: destinationDirectoryName,
|
|
2714
|
+
scope,
|
|
2715
|
+
manifest_version: validated.manifest.version,
|
|
2716
|
+
manifest_entry: validated.manifest.entry,
|
|
2717
|
+
capabilities: [...validated.manifest.capabilities],
|
|
2718
|
+
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
2719
|
+
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
2720
|
+
source: sourceRecord
|
|
2721
|
+
});
|
|
2722
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2723
|
+
const activationChanged = ensureActivated(settings, validated.manifest.name);
|
|
2724
|
+
if (activationChanged) {
|
|
2725
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2726
|
+
}
|
|
2727
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2728
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2729
|
+
const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global);
|
|
2730
|
+
warnings.push(...runtimeProbe.warnings);
|
|
2731
|
+
const installedItemTypeDefinitions = runtimeProbe.item_type_registrations.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)).flatMap((entry) => entry.types.map((type) => ({ name: type.name, folder: type.folder })));
|
|
2732
|
+
if (scope === "project" && installedItemTypeDefinitions.length > 0) {
|
|
2733
|
+
await ensureTypeFolderScaffold(resolvedRoots.pm_root, installedItemTypeDefinitions, warnings, "install:type-folder");
|
|
2734
|
+
}
|
|
2735
|
+
const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
|
|
2736
|
+
const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
|
|
2737
|
+
const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
|
|
2738
|
+
return withResult({
|
|
2739
|
+
extension: {
|
|
2740
|
+
name: validated.manifest.name,
|
|
2741
|
+
version: validated.manifest.version,
|
|
2742
|
+
entry: validated.manifest.entry,
|
|
2743
|
+
capabilities: validated.manifest.capabilities,
|
|
2744
|
+
directory: destinationDirectoryName
|
|
2745
|
+
},
|
|
2746
|
+
source: sourceRecord,
|
|
2747
|
+
destination_path: destinationDirectory,
|
|
2748
|
+
overwritten: destinationExists && !installInPlace,
|
|
2749
|
+
installed_in_place: installInPlace,
|
|
2750
|
+
activated: true,
|
|
2751
|
+
settings_changed: activationChanged,
|
|
2752
|
+
runtime_activation_status: runtimeActivationStatus,
|
|
2753
|
+
command_paths: commandSummary.command_paths,
|
|
2754
|
+
action_paths: commandSummary.action_paths,
|
|
2755
|
+
command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
|
|
2756
|
+
activation_diagnostics: {
|
|
2757
|
+
failed_count: runtimeProbe.activation_failures.length,
|
|
2758
|
+
failed: runtimeProbe.activation_failures,
|
|
2759
|
+
installed_extension_failed: installActivationFailure ?? null
|
|
2515
2760
|
}
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
const destinationExists = await pathExists(destinationDirectory);
|
|
2533
|
-
const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
|
|
2534
|
-
await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
|
|
2535
|
-
if (!installInPlace) {
|
|
2536
|
-
await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
|
|
2537
|
-
}
|
|
2538
|
-
const sourceRecord = bundledAliasName ? {
|
|
2539
|
-
kind: "builtin",
|
|
2540
|
-
input: bundledAliasName,
|
|
2541
|
-
location: bundledAliasName,
|
|
2542
|
-
name: bundledAliasName
|
|
2543
|
-
} : installSource.kind === "local" ? {
|
|
2544
|
-
kind: "local",
|
|
2545
|
-
input: installSource.input,
|
|
2546
|
-
location: installSource.absolute_path
|
|
2547
|
-
} : installSource.kind === "npm" ? {
|
|
2548
|
-
kind: "npm",
|
|
2549
|
-
input: installSource.input,
|
|
2550
|
-
location: resolvedSource.resolved_subpath ?? ".",
|
|
2551
|
-
package: resolvedSource.npm_package,
|
|
2552
|
-
version: resolvedSource.npm_version
|
|
2553
|
-
} : {
|
|
2554
|
-
kind: "github",
|
|
2555
|
-
input: installSource.input,
|
|
2556
|
-
location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
|
|
2557
|
-
repository: installSource.repository,
|
|
2558
|
-
owner: installSource.owner,
|
|
2559
|
-
repo: installSource.repo,
|
|
2560
|
-
ref: installSource.ref,
|
|
2561
|
-
subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
|
|
2562
|
-
commit: resolvedSource.commit
|
|
2563
|
-
};
|
|
2564
|
-
const now = nowIso();
|
|
2565
|
-
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2566
|
-
const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
2567
|
-
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2568
|
-
name: validated.manifest.name,
|
|
2569
|
-
directory: destinationDirectoryName,
|
|
2570
|
-
scope,
|
|
2571
|
-
manifest_version: validated.manifest.version,
|
|
2572
|
-
manifest_entry: validated.manifest.entry,
|
|
2573
|
-
capabilities: [...validated.manifest.capabilities],
|
|
2574
|
-
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
2575
|
-
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
2576
|
-
source: sourceRecord
|
|
2577
|
-
});
|
|
2578
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2579
|
-
const activationChanged = ensureActivated(settings, validated.manifest.name);
|
|
2580
|
-
if (activationChanged) {
|
|
2581
|
-
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2582
|
-
}
|
|
2583
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2584
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2585
|
-
const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global);
|
|
2586
|
-
warnings.push(...runtimeProbe.warnings);
|
|
2587
|
-
const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
|
|
2588
|
-
const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
|
|
2589
|
-
const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
|
|
2590
|
-
return withResult({
|
|
2591
|
-
extension: {
|
|
2592
|
-
name: validated.manifest.name,
|
|
2593
|
-
version: validated.manifest.version,
|
|
2594
|
-
entry: validated.manifest.entry,
|
|
2595
|
-
capabilities: validated.manifest.capabilities,
|
|
2596
|
-
directory: destinationDirectoryName
|
|
2597
|
-
},
|
|
2598
|
-
source: sourceRecord,
|
|
2599
|
-
destination_path: destinationDirectory,
|
|
2600
|
-
overwritten: destinationExists && !installInPlace,
|
|
2601
|
-
installed_in_place: installInPlace,
|
|
2602
|
-
activated: true,
|
|
2603
|
-
settings_changed: activationChanged,
|
|
2604
|
-
runtime_activation_status: runtimeActivationStatus,
|
|
2605
|
-
command_paths: commandSummary.command_paths,
|
|
2606
|
-
action_paths: commandSummary.action_paths,
|
|
2607
|
-
command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
|
|
2608
|
-
activation_diagnostics: {
|
|
2609
|
-
failed_count: runtimeProbe.activation_failures.length,
|
|
2610
|
-
failed: runtimeProbe.activation_failures,
|
|
2611
|
-
installed_extension_failed: installActivationFailure ?? null
|
|
2612
|
-
}
|
|
2613
|
-
});
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2763
|
+
async function runExtensionInstallAction(ctx) {
|
|
2764
|
+
const { action, normalizedTarget, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
2765
|
+
const githubOption = resolveGithubOption(options);
|
|
2766
|
+
const explicitSourceInput = githubOption ?? requireTarget(normalizedTarget, action, options);
|
|
2767
|
+
if (typeof githubOption !== "string" && isBundledPackageInstallAllTarget(explicitSourceInput)) {
|
|
2768
|
+
if (typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2769
|
+
throw new PmCliError('Action "install all" does not accept --ref.', EXIT_CODE.USAGE);
|
|
2770
|
+
}
|
|
2771
|
+
const aliases = await listBundledPackageAliases();
|
|
2772
|
+
const packages = [];
|
|
2773
|
+
for (const alias of aliases) {
|
|
2774
|
+
packages.push({
|
|
2775
|
+
alias,
|
|
2776
|
+
result: await runExtension(alias, { ...options, install: true }, global)
|
|
2614
2777
|
});
|
|
2615
|
-
} finally {
|
|
2616
|
-
if (resolvedSource.cleanup) {
|
|
2617
|
-
await resolvedSource.cleanup();
|
|
2618
|
-
}
|
|
2619
2778
|
}
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2624
|
-
}
|
|
2625
|
-
const githubOption = resolveGithubOption(options);
|
|
2626
|
-
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2627
|
-
throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2628
|
-
}
|
|
2629
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2630
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2631
|
-
warnings.push(...managedStateRead.warnings);
|
|
2632
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2633
|
-
warnings.push(...installed.warnings);
|
|
2634
|
-
const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
|
|
2635
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
|
|
2636
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2637
|
-
const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
|
|
2638
|
-
warnings.push(...triage.warnings);
|
|
2639
|
-
const adoptedDetails = adoption.adopted_entries.map((entry) => {
|
|
2640
|
-
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 */
|
|
2641
|
-
refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
|
|
2642
|
-
return {
|
|
2643
|
-
...entry,
|
|
2644
|
-
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2645
|
-
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2646
|
-
};
|
|
2647
|
-
});
|
|
2779
|
+
for (const entry of packages) {
|
|
2780
|
+
warnings.push(...entry.result.warnings);
|
|
2781
|
+
}
|
|
2648
2782
|
return withResult({
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2783
|
+
installed_all: true,
|
|
2784
|
+
installed_count: packages.length,
|
|
2785
|
+
packages: packages.map((entry) => ({
|
|
2786
|
+
alias: entry.alias,
|
|
2787
|
+
ok: entry.result.ok,
|
|
2788
|
+
extension: entry.result.details.extension,
|
|
2789
|
+
source: entry.result.details.source,
|
|
2790
|
+
destination_path: entry.result.details.destination_path,
|
|
2791
|
+
activated: entry.result.details.activated,
|
|
2792
|
+
settings_changed: entry.result.details.settings_changed,
|
|
2793
|
+
command_paths: entry.result.details.command_paths,
|
|
2794
|
+
action_paths: entry.result.details.action_paths,
|
|
2795
|
+
command_discovery: entry.result.details.command_discovery,
|
|
2796
|
+
warnings: entry.result.warnings
|
|
2797
|
+
}))
|
|
2657
2798
|
});
|
|
2658
2799
|
}
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
}
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2708
|
-
name: validated.manifest.name,
|
|
2709
|
-
directory: candidate.directory,
|
|
2710
|
-
scope,
|
|
2711
|
-
manifest_version: validated.manifest.version,
|
|
2712
|
-
manifest_entry: validated.manifest.entry,
|
|
2713
|
-
capabilities: [...validated.manifest.capabilities],
|
|
2714
|
-
installed_at: now,
|
|
2715
|
-
updated_at: now,
|
|
2716
|
-
source: sourceRecord
|
|
2717
|
-
});
|
|
2718
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2719
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2720
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2721
|
-
const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
|
|
2722
|
-
return withResult({
|
|
2723
|
-
adopted: true,
|
|
2724
|
-
extension: {
|
|
2725
|
-
name: validated.manifest.name,
|
|
2726
|
-
directory: candidate.directory,
|
|
2727
|
-
version: validated.manifest.version,
|
|
2728
|
-
entry: validated.manifest.entry
|
|
2729
|
-
},
|
|
2730
|
-
source: sourceRecord,
|
|
2800
|
+
const bundledAliasSource = typeof githubOption === "string" ? null : await resolveBundledExtensionAliasSource(explicitSourceInput);
|
|
2801
|
+
const bundledAliasName = bundledAliasSource === null ? null : explicitSourceInput.trim().toLowerCase();
|
|
2802
|
+
const sourceInput = bundledAliasSource ?? explicitSourceInput;
|
|
2803
|
+
const installSource = parseExtensionInstallSource(sourceInput, {
|
|
2804
|
+
forceGithub: typeof githubOption === "string",
|
|
2805
|
+
ref: options.ref
|
|
2806
|
+
});
|
|
2807
|
+
const resolvedSource = await resolveInstallSource(installSource);
|
|
2808
|
+
try {
|
|
2809
|
+
const validated = await validateExtensionDirectory(resolvedSource.directory);
|
|
2810
|
+
const destinationDirectoryName = normalizeManagedDirectoryName(validated.manifest.name);
|
|
2811
|
+
return await withExtensionInstallLock(resolvedRoots.settings_root, destinationDirectoryName, () => performExtensionInstallUnderLock(ctx, {
|
|
2812
|
+
validated,
|
|
2813
|
+
destinationDirectoryName,
|
|
2814
|
+
bundledAliasName,
|
|
2815
|
+
installSource,
|
|
2816
|
+
resolvedSource
|
|
2817
|
+
}));
|
|
2818
|
+
} finally {
|
|
2819
|
+
if (resolvedSource.cleanup) {
|
|
2820
|
+
await resolvedSource.cleanup();
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
async function runExtensionAdoptAllAction(ctx) {
|
|
2825
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2826
|
+
if (normalizedTarget !== void 0) {
|
|
2827
|
+
throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2828
|
+
}
|
|
2829
|
+
const githubOption = resolveGithubOption(options);
|
|
2830
|
+
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2831
|
+
throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2832
|
+
}
|
|
2833
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2834
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2835
|
+
warnings.push(...managedStateRead.warnings);
|
|
2836
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2837
|
+
warnings.push(...installed.warnings);
|
|
2838
|
+
const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
|
|
2839
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
|
|
2840
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2841
|
+
const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
|
|
2842
|
+
warnings.push(...triage.warnings);
|
|
2843
|
+
const adoptedDetails = adoption.adopted_entries.map((entry) => {
|
|
2844
|
+
const refreshedEntry = refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.name) === normalizeExtensionNameForMatch(entry.name) && normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory)) ?? /* c8 ignore next 3 -- fallback only matters if a manifest renames between adopt and refresh */
|
|
2845
|
+
refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
|
|
2846
|
+
return {
|
|
2847
|
+
...entry,
|
|
2731
2848
|
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2732
2849
|
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2733
|
-
});
|
|
2734
|
-
}
|
|
2735
|
-
if (action === "uninstall") {
|
|
2736
|
-
const extensionTarget = requireTarget(normalizedTarget, action);
|
|
2737
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2738
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2739
|
-
warnings.push(...managedStateRead.warnings);
|
|
2740
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2741
|
-
warnings.push(...installed.warnings);
|
|
2742
|
-
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2743
|
-
if (!candidate) {
|
|
2744
|
-
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2745
|
-
}
|
|
2746
|
-
const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2747
|
-
await fs5.rm(destinationDirectory, { recursive: true, force: true });
|
|
2748
|
-
const updatedState = {
|
|
2749
|
-
...managedStateRead.state,
|
|
2750
|
-
updated_at: nowIso(),
|
|
2751
|
-
/* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
|
|
2752
|
-
entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
|
|
2753
|
-
/* c8 ignore stop */
|
|
2754
2850
|
};
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2851
|
+
});
|
|
2852
|
+
return withResult({
|
|
2853
|
+
adopted_all: adoptedDetails.length > 0,
|
|
2854
|
+
adopted_count: adoptedDetails.length,
|
|
2855
|
+
already_managed_count: adoption.already_managed_count,
|
|
2856
|
+
extensions: adoptedDetails,
|
|
2857
|
+
triage,
|
|
2858
|
+
warning_codes: triage.warning_codes,
|
|
2859
|
+
update_health_partial: triage.update_health_partial,
|
|
2860
|
+
update_health_coverage: triage.update_health_coverage
|
|
2861
|
+
});
|
|
2862
|
+
}
|
|
2863
|
+
async function runExtensionAdoptAction(ctx) {
|
|
2864
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2865
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2866
|
+
const githubOption = resolveGithubOption(options);
|
|
2867
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2868
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2869
|
+
warnings.push(...managedStateRead.warnings);
|
|
2870
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2871
|
+
warnings.push(...installed.warnings);
|
|
2872
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2873
|
+
if (!candidate) {
|
|
2874
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2875
|
+
}
|
|
2876
|
+
if (candidate.managed) {
|
|
2760
2877
|
return withResult({
|
|
2761
|
-
|
|
2878
|
+
adopted: false,
|
|
2879
|
+
already_managed: true,
|
|
2762
2880
|
extension: {
|
|
2763
2881
|
name: candidate.name,
|
|
2764
2882
|
directory: candidate.directory
|
|
2765
|
-
}
|
|
2766
|
-
destination_path: destinationDirectory,
|
|
2767
|
-
settings_changed: stateChanged
|
|
2883
|
+
}
|
|
2768
2884
|
});
|
|
2769
2885
|
}
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
if (
|
|
2783
|
-
|
|
2886
|
+
const extensionDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2887
|
+
const validated = await validateExtensionDirectory(extensionDirectory);
|
|
2888
|
+
const now = nowIso();
|
|
2889
|
+
const sourceRecord = githubOption === void 0 ? {
|
|
2890
|
+
kind: "local",
|
|
2891
|
+
input: extensionTarget,
|
|
2892
|
+
location: extensionDirectory
|
|
2893
|
+
} : (() => {
|
|
2894
|
+
const parsed = parseExtensionInstallSource(githubOption, {
|
|
2895
|
+
forceGithub: true,
|
|
2896
|
+
ref: options.ref
|
|
2897
|
+
});
|
|
2898
|
+
if (parsed.kind !== "github") {
|
|
2899
|
+
throw new PmCliError(`Invalid GitHub shorthand "${githubOption}".`, EXIT_CODE.USAGE);
|
|
2784
2900
|
}
|
|
2785
|
-
return
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2901
|
+
return {
|
|
2902
|
+
kind: "github",
|
|
2903
|
+
input: parsed.input,
|
|
2904
|
+
location: parsed.subpath ?? ".",
|
|
2905
|
+
repository: parsed.repository,
|
|
2906
|
+
owner: parsed.owner,
|
|
2907
|
+
repo: parsed.repo,
|
|
2908
|
+
ref: parsed.ref,
|
|
2909
|
+
subpath: parsed.subpath
|
|
2910
|
+
};
|
|
2911
|
+
})();
|
|
2912
|
+
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2913
|
+
name: validated.manifest.name,
|
|
2914
|
+
directory: candidate.directory,
|
|
2915
|
+
scope,
|
|
2916
|
+
manifest_version: validated.manifest.version,
|
|
2917
|
+
manifest_entry: validated.manifest.entry,
|
|
2918
|
+
capabilities: [...validated.manifest.capabilities],
|
|
2919
|
+
installed_at: now,
|
|
2920
|
+
updated_at: now,
|
|
2921
|
+
source: sourceRecord
|
|
2922
|
+
});
|
|
2923
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2924
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2925
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2926
|
+
const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
|
|
2927
|
+
return withResult({
|
|
2928
|
+
adopted: true,
|
|
2929
|
+
extension: {
|
|
2930
|
+
name: validated.manifest.name,
|
|
2931
|
+
directory: candidate.directory,
|
|
2932
|
+
version: validated.manifest.version,
|
|
2933
|
+
entry: validated.manifest.entry
|
|
2934
|
+
},
|
|
2935
|
+
source: sourceRecord,
|
|
2936
|
+
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2937
|
+
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2938
|
+
});
|
|
2939
|
+
}
|
|
2940
|
+
async function runExtensionUninstallAction(ctx) {
|
|
2941
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2942
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2943
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2944
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2945
|
+
warnings.push(...managedStateRead.warnings);
|
|
2946
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2947
|
+
warnings.push(...installed.warnings);
|
|
2948
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2949
|
+
if (!candidate) {
|
|
2950
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2951
|
+
}
|
|
2952
|
+
const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2953
|
+
await fs5.rm(destinationDirectory, { recursive: true, force: true });
|
|
2954
|
+
const updatedState = {
|
|
2955
|
+
...managedStateRead.state,
|
|
2956
|
+
updated_at: nowIso(),
|
|
2957
|
+
/* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
|
|
2958
|
+
entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
|
|
2959
|
+
/* c8 ignore stop */
|
|
2960
|
+
};
|
|
2961
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, updatedState);
|
|
2962
|
+
const stateChanged = clearExtensionState(settings, candidate.name);
|
|
2963
|
+
if (stateChanged) {
|
|
2964
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2965
|
+
}
|
|
2966
|
+
return withResult({
|
|
2967
|
+
removed: true,
|
|
2968
|
+
extension: {
|
|
2969
|
+
name: candidate.name,
|
|
2970
|
+
directory: candidate.directory
|
|
2971
|
+
},
|
|
2972
|
+
destination_path: destinationDirectory,
|
|
2973
|
+
settings_changed: stateChanged
|
|
2974
|
+
});
|
|
2975
|
+
}
|
|
2976
|
+
async function runExtensionActivateDeactivateAction(ctx) {
|
|
2977
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2978
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2979
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2980
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2981
|
+
warnings.push(...managedStateRead.warnings);
|
|
2982
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2983
|
+
warnings.push(...installed.warnings);
|
|
2984
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2985
|
+
if (!candidate) {
|
|
2986
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2987
|
+
}
|
|
2988
|
+
const settingsChanged = action === "activate" ? ensureActivated(settings, candidate.name) : ensureDeactivated(settings, candidate.name);
|
|
2989
|
+
if (settingsChanged) {
|
|
2990
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2991
|
+
}
|
|
2992
|
+
return withResult({
|
|
2993
|
+
extension: {
|
|
2994
|
+
name: candidate.name,
|
|
2995
|
+
directory: candidate.directory
|
|
2996
|
+
},
|
|
2997
|
+
active: action === "activate",
|
|
2998
|
+
settings_changed: settingsChanged,
|
|
2999
|
+
settings: {
|
|
3000
|
+
enabled: [...settings.extensions.enabled],
|
|
3001
|
+
disabled: [...settings.extensions.disabled]
|
|
3002
|
+
}
|
|
3003
|
+
});
|
|
3004
|
+
}
|
|
3005
|
+
function buildDoctorRemediation(baseRemediation, loadFailureCount, activationFailureCount, vocabulary, managedStateFix) {
|
|
3006
|
+
return [
|
|
3007
|
+
...new Set([
|
|
3008
|
+
...baseRemediation,
|
|
3009
|
+
/* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
|
|
3010
|
+
...loadFailureCount > 0 ? [
|
|
3011
|
+
vocabulary === "package" ? "Run pm package explore --project and pm package explore --global to inspect load failures." : "Run pm extension --explore --project and pm extension --explore --global to inspect load failures."
|
|
3012
|
+
] : [],
|
|
3013
|
+
...activationFailureCount > 0 ? [
|
|
3014
|
+
vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
|
|
3015
|
+
] : [],
|
|
3016
|
+
/* c8 ignore stop */
|
|
3017
|
+
...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
|
|
3018
|
+
].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
|
|
3019
|
+
];
|
|
3020
|
+
}
|
|
3021
|
+
async function runExtensionDoctorAction(ctx) {
|
|
3022
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
3023
|
+
if (normalizedTarget && normalizedTarget.trim().length > 0) {
|
|
3024
|
+
throw new PmCliError('Action "doctor" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
3025
|
+
}
|
|
3026
|
+
const detailMode = parseDoctorDetailMode(options.detail);
|
|
3027
|
+
const includeTrace = options.trace === true;
|
|
3028
|
+
if (includeTrace && detailMode !== "deep") {
|
|
3029
|
+
throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
|
|
3030
|
+
}
|
|
3031
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3032
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3033
|
+
warnings.push(...managedStateRead.warnings);
|
|
3034
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3035
|
+
warnings.push(...installed.warnings);
|
|
3036
|
+
let managedState = managedStateRead.state;
|
|
3037
|
+
const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3038
|
+
if (managedStateFix) {
|
|
3039
|
+
managedState = managedStateFix.state;
|
|
3040
|
+
}
|
|
3041
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3042
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
3043
|
+
const loadResult = await loadExtensions({
|
|
3044
|
+
pmRoot: resolvedRoots.pm_root,
|
|
3045
|
+
settings,
|
|
3046
|
+
cwd: process.cwd(),
|
|
3047
|
+
noExtensions: global.noExtensions === true
|
|
3048
|
+
});
|
|
3049
|
+
const activationResult = await activateExtensions({
|
|
3050
|
+
...loadResult,
|
|
3051
|
+
loaded: loadResult.loaded
|
|
3052
|
+
});
|
|
3053
|
+
warnings.push(...loadResult.warnings);
|
|
3054
|
+
warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
|
|
3055
|
+
warnings.push(...activationResult.warnings);
|
|
3056
|
+
warnings.push(...classifyDoctorActivationFailureWarnings(activationResult.failed));
|
|
3057
|
+
warnings.push(...classifyUnusedCapabilityWarnings(loadResult, activationResult));
|
|
3058
|
+
warnings.push(...collectGlobalOutputOverrideDoctorWarnings(activationResult));
|
|
3059
|
+
warnings.push(...collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResult));
|
|
3060
|
+
const runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3061
|
+
const doctorConsistency = buildDoctorConsistencySummary(scope, runtimeInstalledExtensions, loadResult.loaded.map((entry) => ({ layer: entry.layer, name: entry.name })), loadResult.failed.map((entry) => ({ name: entry.name })), loadResult.disabled_by_flag);
|
|
3062
|
+
warnings.push(...doctorConsistency.warnings);
|
|
3063
|
+
const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3064
|
+
warnings.push(...updateCheckWarnings);
|
|
3065
|
+
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3066
|
+
warnings.push(...triage.warnings);
|
|
3067
|
+
const normalizedWarnings = [...triage.warnings];
|
|
3068
|
+
const policySummary = {
|
|
3069
|
+
mode: loadResult.policy.mode,
|
|
3070
|
+
trust_mode: loadResult.policy.trust_mode,
|
|
3071
|
+
require_provenance: loadResult.policy.require_provenance,
|
|
3072
|
+
default_sandbox_profile: loadResult.policy.default_sandbox_profile,
|
|
3073
|
+
// Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
|
|
3074
|
+
sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
|
|
3075
|
+
trusted_extensions_count: loadResult.policy.trusted_extensions.length,
|
|
3076
|
+
allowed_extensions_count: loadResult.policy.allowed_extensions.length,
|
|
3077
|
+
blocked_extensions_count: loadResult.policy.blocked_extensions.length,
|
|
3078
|
+
allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
|
|
3079
|
+
blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
|
|
3080
|
+
allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
|
|
3081
|
+
blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
|
|
3082
|
+
allowed_commands_count: loadResult.policy.allowed_commands.length,
|
|
3083
|
+
blocked_commands_count: loadResult.policy.blocked_commands.length,
|
|
3084
|
+
allowed_actions_count: loadResult.policy.allowed_actions.length,
|
|
3085
|
+
blocked_actions_count: loadResult.policy.blocked_actions.length,
|
|
3086
|
+
allowed_services_count: loadResult.policy.allowed_services.length,
|
|
3087
|
+
blocked_services_count: loadResult.policy.blocked_services.length,
|
|
3088
|
+
extension_override_count: loadResult.policy.extension_overrides.length
|
|
3089
|
+
};
|
|
3090
|
+
const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
|
|
3091
|
+
const capabilityContract = buildCapabilityContractMetadata();
|
|
3092
|
+
const warningCodes = triage.warning_codes;
|
|
3093
|
+
const remediation = buildDoctorRemediation(triage.remediation, loadResult.failed.length, activationResult.failed.length, options.vocabulary, managedStateFix);
|
|
3094
|
+
const summary = {
|
|
3095
|
+
status: triage.status,
|
|
3096
|
+
scope,
|
|
3097
|
+
warning_count: triage.warning_count,
|
|
3098
|
+
warning_codes: warningCodes,
|
|
3099
|
+
total_extensions: runtimeInstalledExtensions.length,
|
|
3100
|
+
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3101
|
+
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3102
|
+
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3103
|
+
unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
|
|
3104
|
+
unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
|
|
3105
|
+
unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
|
|
3106
|
+
runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
|
|
3107
|
+
activation_status_totals: {
|
|
3108
|
+
ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
|
|
3109
|
+
failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
|
|
3110
|
+
not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
|
|
3111
|
+
unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
|
|
3112
|
+
},
|
|
3113
|
+
unknown_capability_count: capabilityGuidance.length,
|
|
3114
|
+
capability_contract_version: capabilityContract.version,
|
|
3115
|
+
update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
|
|
3116
|
+
update_health_coverage: triage.update_health_coverage,
|
|
3117
|
+
update_health_partial: triage.update_health_partial,
|
|
3118
|
+
update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
|
|
3119
|
+
load_failure_count: loadResult.failed.length,
|
|
3120
|
+
activation_failure_count: activationResult.failed.length,
|
|
3121
|
+
blocking_failure_count: loadResult.failed.length + activationResult.failed.length,
|
|
3122
|
+
has_blocking_failures: loadResult.failed.length + activationResult.failed.length > 0,
|
|
3123
|
+
consistency_warning_count: doctorConsistency.warnings.length,
|
|
3124
|
+
trace_enabled: includeTrace,
|
|
3125
|
+
policy: policySummary,
|
|
3126
|
+
remediation
|
|
3127
|
+
};
|
|
3128
|
+
const managedStateFixSummary = managedStateFix ? {
|
|
3129
|
+
requested: true,
|
|
3130
|
+
applied: managedStateFix.adopted_entries.length > 0,
|
|
3131
|
+
adopted_count: managedStateFix.adopted_entries.length,
|
|
3132
|
+
already_managed_count: managedStateFix.already_managed_count,
|
|
3133
|
+
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name)
|
|
3134
|
+
} : {
|
|
3135
|
+
requested: false,
|
|
3136
|
+
applied: false,
|
|
3137
|
+
adopted_count: 0,
|
|
3138
|
+
already_managed_count: refreshedInstalled.extensions.filter((entry) => entry.managed).length,
|
|
3139
|
+
adopted_extensions: []
|
|
3140
|
+
};
|
|
3141
|
+
const details = {
|
|
3142
|
+
mode: detailMode,
|
|
3143
|
+
summary,
|
|
3144
|
+
triage,
|
|
3145
|
+
trace_enabled: includeTrace,
|
|
3146
|
+
capability_contract: capabilityContract,
|
|
3147
|
+
capability_guidance: capabilityGuidance,
|
|
3148
|
+
managed_state_fix: managedStateFixSummary,
|
|
3149
|
+
policy: loadResult.policy
|
|
3150
|
+
};
|
|
3151
|
+
if (detailMode === "deep") {
|
|
3152
|
+
const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
|
|
3153
|
+
const { trace: _trace, ...rest } = entry;
|
|
3154
|
+
return rest;
|
|
3155
|
+
});
|
|
3156
|
+
details.deep = {
|
|
3157
|
+
warnings: normalizedWarnings,
|
|
3158
|
+
warning_codes: warningCodes,
|
|
3159
|
+
capability_contract: capabilityContract,
|
|
3160
|
+
capability_guidance: capabilityGuidance,
|
|
3161
|
+
trace_enabled: includeTrace,
|
|
3162
|
+
managed_state: {
|
|
3163
|
+
path: managedStateRead.path,
|
|
3164
|
+
count: managedState.entries.length,
|
|
3165
|
+
entries: managedState.entries
|
|
3166
|
+
},
|
|
3167
|
+
installed_extensions: runtimeInstalledExtensions,
|
|
3168
|
+
load: {
|
|
3169
|
+
roots: loadResult.roots,
|
|
3170
|
+
policy: loadResult.policy,
|
|
3171
|
+
warnings: loadResult.warnings,
|
|
3172
|
+
failed: loadResult.failed,
|
|
3173
|
+
loaded: loadResult.loaded.map((entry) => ({
|
|
3174
|
+
layer: entry.layer,
|
|
3175
|
+
directory: entry.directory,
|
|
3176
|
+
name: entry.name,
|
|
3177
|
+
version: entry.version,
|
|
3178
|
+
entry: entry.entry,
|
|
3179
|
+
priority: entry.priority
|
|
3180
|
+
}))
|
|
3181
|
+
},
|
|
3182
|
+
activation: {
|
|
3183
|
+
failed: activationFailedDetails,
|
|
3184
|
+
warnings: activationResult.warnings,
|
|
3185
|
+
hook_counts: activationResult.hook_counts,
|
|
3186
|
+
registration_counts: activationResult.registration_counts,
|
|
3187
|
+
parser_override_count: activationResult.parser_override_count,
|
|
3188
|
+
preflight_override_count: activationResult.preflight_override_count,
|
|
3189
|
+
service_override_count: activationResult.service_override_count,
|
|
3190
|
+
renderer_override_count: activationResult.renderer_override_count
|
|
2789
3191
|
},
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
3192
|
+
consistency: doctorConsistency.summary
|
|
3193
|
+
};
|
|
3194
|
+
if (includeTrace) {
|
|
3195
|
+
details.deep.trace = {
|
|
3196
|
+
activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
|
|
3197
|
+
layer: entry.layer,
|
|
3198
|
+
name: entry.name,
|
|
3199
|
+
entry_path: entry.entry_path,
|
|
3200
|
+
error: entry.error,
|
|
3201
|
+
method: entry.trace?.method,
|
|
3202
|
+
command: entry.trace?.command,
|
|
3203
|
+
capability: entry.trace?.capability,
|
|
3204
|
+
missing_capability: entry.trace?.missing_capability,
|
|
3205
|
+
registration_index: entry.trace?.registration_index,
|
|
3206
|
+
expected_schema: entry.trace?.expected_schema,
|
|
3207
|
+
hint: entry.trace?.hint,
|
|
3208
|
+
received: entry.trace?.received
|
|
3209
|
+
}))
|
|
3210
|
+
};
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
return withResult(details);
|
|
3214
|
+
}
|
|
3215
|
+
async function runExtensionDescribeAction(ctx) {
|
|
3216
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
3217
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3218
|
+
const loadResult = await loadExtensions({
|
|
3219
|
+
pmRoot: resolvedRoots.pm_root,
|
|
3220
|
+
settings,
|
|
3221
|
+
cwd: process.cwd(),
|
|
3222
|
+
noExtensions: global.noExtensions === true
|
|
3223
|
+
});
|
|
3224
|
+
const activationResult = await activateExtensions(loadResult);
|
|
3225
|
+
warnings.push(...loadResult.warnings);
|
|
3226
|
+
warnings.push(...activationResult.warnings);
|
|
3227
|
+
const describeResult = buildExtensionDescribeResult(normalizedTarget, loadResult, activationResult);
|
|
3228
|
+
if (normalizedTarget !== void 0 && describeResult.extensions.length === 0) {
|
|
3229
|
+
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
3230
|
+
throw new PmCliError(`No loaded ${noun} named "${normalizedTarget}" was found in ${scope} scope. Run pm ${noun} explore to list discovered ${noun}s.`, EXIT_CODE.NOT_FOUND);
|
|
3231
|
+
}
|
|
3232
|
+
return withResult({
|
|
3233
|
+
target: describeResult.target,
|
|
3234
|
+
total: describeResult.total,
|
|
3235
|
+
extensions: describeResult.extensions,
|
|
3236
|
+
union: describeResult.union
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
async function runExtensionExploreManageAction(ctx) {
|
|
3240
|
+
const { action, scope, resolvedRoots, warnings, options, global, withResult } = ctx;
|
|
3241
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3242
|
+
const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
|
|
3243
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3244
|
+
warnings.push(...managedStateRead.warnings);
|
|
3245
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3246
|
+
warnings.push(...installed.warnings);
|
|
3247
|
+
let managedState = managedStateRead.state;
|
|
3248
|
+
const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3249
|
+
if (managedStateFix) {
|
|
3250
|
+
managedState = managedStateFix.state;
|
|
3251
|
+
}
|
|
3252
|
+
if (action === "manage") {
|
|
3253
|
+
const updates = await Promise.all(managedState.entries.map(async (entry) => {
|
|
3254
|
+
if (entry.source.kind !== "github") {
|
|
3255
|
+
return entry;
|
|
2795
3256
|
}
|
|
2796
|
-
|
|
3257
|
+
const updateStatus = await checkGithubUpdate(entry.source);
|
|
3258
|
+
return {
|
|
3259
|
+
...entry,
|
|
3260
|
+
last_update_check_at: updateStatus.checked_at,
|
|
3261
|
+
last_update_remote_commit: updateStatus.remote_commit,
|
|
3262
|
+
update_available: updateStatus.available,
|
|
3263
|
+
update_error: updateStatus.error
|
|
3264
|
+
};
|
|
3265
|
+
}));
|
|
3266
|
+
managedState = {
|
|
3267
|
+
...managedState,
|
|
3268
|
+
updated_at: nowIso(),
|
|
3269
|
+
entries: sortManagedEntries(updates)
|
|
3270
|
+
};
|
|
3271
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
3272
|
+
}
|
|
3273
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3274
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
3275
|
+
if (action === "manage") {
|
|
3276
|
+
const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3277
|
+
warnings.push(...updateWarnings);
|
|
2797
3278
|
}
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
const detailMode = parseDoctorDetailMode(options.detail);
|
|
2803
|
-
const includeTrace = options.trace === true;
|
|
2804
|
-
if (includeTrace && detailMode !== "deep") {
|
|
2805
|
-
throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
|
|
2806
|
-
}
|
|
2807
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2808
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2809
|
-
warnings.push(...managedStateRead.warnings);
|
|
2810
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2811
|
-
warnings.push(...installed.warnings);
|
|
2812
|
-
let managedState = managedStateRead.state;
|
|
2813
|
-
const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
2814
|
-
if (managedStateFix) {
|
|
2815
|
-
managedState = managedStateFix.state;
|
|
2816
|
-
}
|
|
2817
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2818
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
3279
|
+
let runtimeProbeSummary;
|
|
3280
|
+
let runtimeInstalledExtensions = refreshedInstalled.extensions;
|
|
3281
|
+
let runtimeActivationFailures;
|
|
3282
|
+
if (action === "explore" || options.runtimeProbe === true) {
|
|
2819
3283
|
const loadResult = await loadExtensions({
|
|
2820
3284
|
pmRoot: resolvedRoots.pm_root,
|
|
2821
3285
|
settings,
|
|
@@ -2827,314 +3291,77 @@ async function runExtension(target, options, global) {
|
|
|
2827
3291
|
loaded: loadResult.loaded
|
|
2828
3292
|
});
|
|
2829
3293
|
warnings.push(...loadResult.warnings);
|
|
2830
|
-
warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
|
|
2831
3294
|
warnings.push(...activationResult.warnings);
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
2839
|
-
warnings.push(...updateCheckWarnings);
|
|
2840
|
-
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
2841
|
-
warnings.push(...triage.warnings);
|
|
2842
|
-
const normalizedWarnings = [...triage.warnings];
|
|
2843
|
-
const policySummary = {
|
|
2844
|
-
mode: loadResult.policy.mode,
|
|
2845
|
-
trust_mode: loadResult.policy.trust_mode,
|
|
2846
|
-
require_provenance: loadResult.policy.require_provenance,
|
|
2847
|
-
default_sandbox_profile: loadResult.policy.default_sandbox_profile,
|
|
2848
|
-
// Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
|
|
2849
|
-
sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
|
|
2850
|
-
trusted_extensions_count: loadResult.policy.trusted_extensions.length,
|
|
2851
|
-
allowed_extensions_count: loadResult.policy.allowed_extensions.length,
|
|
2852
|
-
blocked_extensions_count: loadResult.policy.blocked_extensions.length,
|
|
2853
|
-
allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
|
|
2854
|
-
blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
|
|
2855
|
-
allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
|
|
2856
|
-
blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
|
|
2857
|
-
allowed_commands_count: loadResult.policy.allowed_commands.length,
|
|
2858
|
-
blocked_commands_count: loadResult.policy.blocked_commands.length,
|
|
2859
|
-
allowed_actions_count: loadResult.policy.allowed_actions.length,
|
|
2860
|
-
blocked_actions_count: loadResult.policy.blocked_actions.length,
|
|
2861
|
-
allowed_services_count: loadResult.policy.allowed_services.length,
|
|
2862
|
-
blocked_services_count: loadResult.policy.blocked_services.length,
|
|
2863
|
-
extension_override_count: loadResult.policy.extension_overrides.length
|
|
2864
|
-
};
|
|
2865
|
-
const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
|
|
2866
|
-
const capabilityContract = buildCapabilityContractMetadata();
|
|
2867
|
-
const warningCodes = triage.warning_codes;
|
|
2868
|
-
const remediation = [
|
|
2869
|
-
...new Set([
|
|
2870
|
-
...triage.remediation,
|
|
2871
|
-
/* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
|
|
2872
|
-
...loadResult.failed.length > 0 ? [
|
|
2873
|
-
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."
|
|
2874
|
-
] : [],
|
|
2875
|
-
...activationResult.failed.length > 0 ? [
|
|
2876
|
-
options.vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
|
|
2877
|
-
] : [],
|
|
2878
|
-
/* c8 ignore stop */
|
|
2879
|
-
...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
|
|
2880
|
-
].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
|
|
2881
|
-
];
|
|
2882
|
-
const summary = {
|
|
2883
|
-
status: triage.status,
|
|
2884
|
-
scope,
|
|
2885
|
-
warning_count: triage.warning_count,
|
|
2886
|
-
warning_codes: warningCodes,
|
|
2887
|
-
total_extensions: runtimeInstalledExtensions.length,
|
|
2888
|
-
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
2889
|
-
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
2890
|
-
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
2891
|
-
unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
|
|
2892
|
-
unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
|
|
2893
|
-
unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
|
|
2894
|
-
runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
|
|
2895
|
-
activation_status_totals: {
|
|
2896
|
-
ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
|
|
2897
|
-
failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
|
|
2898
|
-
not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
|
|
2899
|
-
unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
|
|
2900
|
-
},
|
|
2901
|
-
unknown_capability_count: capabilityGuidance.length,
|
|
2902
|
-
capability_contract_version: capabilityContract.version,
|
|
2903
|
-
update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
|
|
2904
|
-
update_health_coverage: triage.update_health_coverage,
|
|
2905
|
-
update_health_partial: triage.update_health_partial,
|
|
2906
|
-
update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
|
|
3295
|
+
runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3296
|
+
runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
|
|
3297
|
+
runtimeProbeSummary = {
|
|
3298
|
+
requested: true,
|
|
3299
|
+
executed: true,
|
|
3300
|
+
reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
|
|
2907
3301
|
load_failure_count: loadResult.failed.length,
|
|
2908
3302
|
activation_failure_count: activationResult.failed.length,
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
3303
|
+
warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
|
|
3304
|
+
policy: loadResult.policy
|
|
3305
|
+
};
|
|
3306
|
+
} else if (action === "manage") {
|
|
3307
|
+
runtimeProbeSummary = {
|
|
3308
|
+
requested: false,
|
|
3309
|
+
executed: false
|
|
2915
3310
|
};
|
|
2916
|
-
|
|
3311
|
+
}
|
|
3312
|
+
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3313
|
+
warnings.push(...triage.warnings);
|
|
3314
|
+
const details = {
|
|
3315
|
+
total: runtimeInstalledExtensions.length,
|
|
3316
|
+
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3317
|
+
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3318
|
+
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3319
|
+
extensions: runtimeInstalledExtensions,
|
|
3320
|
+
triage,
|
|
3321
|
+
policy: configuredPolicy
|
|
3322
|
+
};
|
|
3323
|
+
if (runtimeActivationFailures !== void 0) {
|
|
3324
|
+
details.activation_diagnostics = {
|
|
3325
|
+
failed_count: runtimeActivationFailures.length,
|
|
3326
|
+
failed: runtimeActivationFailures
|
|
3327
|
+
};
|
|
3328
|
+
}
|
|
3329
|
+
if (action === "explore") {
|
|
3330
|
+
details.runtime_probe = runtimeProbeSummary;
|
|
3331
|
+
}
|
|
3332
|
+
if (action === "manage") {
|
|
3333
|
+
details.runtime_probe = runtimeProbeSummary;
|
|
3334
|
+
details.managed_state_fix = managedStateFix !== null ? {
|
|
2917
3335
|
requested: true,
|
|
2918
3336
|
applied: managedStateFix.adopted_entries.length > 0,
|
|
2919
3337
|
adopted_count: managedStateFix.adopted_entries.length,
|
|
2920
|
-
|
|
2921
|
-
|
|
3338
|
+
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
|
|
3339
|
+
already_managed_count: managedStateFix.already_managed_count
|
|
2922
3340
|
} : {
|
|
2923
3341
|
requested: false,
|
|
2924
3342
|
applied: false,
|
|
2925
3343
|
adopted_count: 0,
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
};
|
|
2929
|
-
const details = {
|
|
2930
|
-
mode: detailMode,
|
|
2931
|
-
summary,
|
|
2932
|
-
triage,
|
|
2933
|
-
trace_enabled: includeTrace,
|
|
2934
|
-
capability_contract: capabilityContract,
|
|
2935
|
-
capability_guidance: capabilityGuidance,
|
|
2936
|
-
managed_state_fix: managedStateFixSummary,
|
|
2937
|
-
policy: loadResult.policy
|
|
3344
|
+
adopted_extensions: [],
|
|
3345
|
+
already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
|
|
2938
3346
|
};
|
|
2939
|
-
if (detailMode === "deep") {
|
|
2940
|
-
const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
|
|
2941
|
-
const { trace: _trace, ...rest } = entry;
|
|
2942
|
-
return rest;
|
|
2943
|
-
});
|
|
2944
|
-
details.deep = {
|
|
2945
|
-
warnings: normalizedWarnings,
|
|
2946
|
-
warning_codes: warningCodes,
|
|
2947
|
-
capability_contract: capabilityContract,
|
|
2948
|
-
capability_guidance: capabilityGuidance,
|
|
2949
|
-
trace_enabled: includeTrace,
|
|
2950
|
-
managed_state: {
|
|
2951
|
-
path: managedStateRead.path,
|
|
2952
|
-
count: managedState.entries.length,
|
|
2953
|
-
entries: managedState.entries
|
|
2954
|
-
},
|
|
2955
|
-
installed_extensions: runtimeInstalledExtensions,
|
|
2956
|
-
load: {
|
|
2957
|
-
roots: loadResult.roots,
|
|
2958
|
-
policy: loadResult.policy,
|
|
2959
|
-
warnings: loadResult.warnings,
|
|
2960
|
-
failed: loadResult.failed,
|
|
2961
|
-
loaded: loadResult.loaded.map((entry) => ({
|
|
2962
|
-
layer: entry.layer,
|
|
2963
|
-
directory: entry.directory,
|
|
2964
|
-
name: entry.name,
|
|
2965
|
-
version: entry.version,
|
|
2966
|
-
entry: entry.entry,
|
|
2967
|
-
priority: entry.priority
|
|
2968
|
-
}))
|
|
2969
|
-
},
|
|
2970
|
-
activation: {
|
|
2971
|
-
failed: activationFailedDetails,
|
|
2972
|
-
warnings: activationResult.warnings,
|
|
2973
|
-
hook_counts: activationResult.hook_counts,
|
|
2974
|
-
registration_counts: activationResult.registration_counts,
|
|
2975
|
-
parser_override_count: activationResult.parser_override_count,
|
|
2976
|
-
preflight_override_count: activationResult.preflight_override_count,
|
|
2977
|
-
service_override_count: activationResult.service_override_count,
|
|
2978
|
-
renderer_override_count: activationResult.renderer_override_count
|
|
2979
|
-
},
|
|
2980
|
-
consistency: doctorConsistency.summary
|
|
2981
|
-
};
|
|
2982
|
-
if (includeTrace) {
|
|
2983
|
-
details.deep.trace = {
|
|
2984
|
-
activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
|
|
2985
|
-
layer: entry.layer,
|
|
2986
|
-
name: entry.name,
|
|
2987
|
-
entry_path: entry.entry_path,
|
|
2988
|
-
error: entry.error,
|
|
2989
|
-
method: entry.trace?.method,
|
|
2990
|
-
command: entry.trace?.command,
|
|
2991
|
-
capability: entry.trace?.capability,
|
|
2992
|
-
missing_capability: entry.trace?.missing_capability,
|
|
2993
|
-
registration_index: entry.trace?.registration_index,
|
|
2994
|
-
expected_schema: entry.trace?.expected_schema,
|
|
2995
|
-
hint: entry.trace?.hint,
|
|
2996
|
-
received: entry.trace?.received
|
|
2997
|
-
}))
|
|
2998
|
-
};
|
|
2999
|
-
}
|
|
3000
|
-
}
|
|
3001
|
-
return withResult(details);
|
|
3002
3347
|
}
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
target: describeResult.target,
|
|
3021
|
-
total: describeResult.total,
|
|
3022
|
-
extensions: describeResult.extensions,
|
|
3023
|
-
union: describeResult.union
|
|
3024
|
-
});
|
|
3025
|
-
}
|
|
3026
|
-
if (action === "explore" || action === "manage") {
|
|
3027
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3028
|
-
const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
|
|
3029
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3030
|
-
warnings.push(...managedStateRead.warnings);
|
|
3031
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3032
|
-
warnings.push(...installed.warnings);
|
|
3033
|
-
let managedState = managedStateRead.state;
|
|
3034
|
-
const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3035
|
-
if (managedStateFix) {
|
|
3036
|
-
managedState = managedStateFix.state;
|
|
3037
|
-
}
|
|
3038
|
-
if (action === "manage") {
|
|
3039
|
-
const updates = await Promise.all(managedState.entries.map(async (entry) => {
|
|
3040
|
-
if (entry.source.kind !== "github") {
|
|
3041
|
-
return entry;
|
|
3042
|
-
}
|
|
3043
|
-
const updateStatus = await checkGithubUpdate(entry.source);
|
|
3044
|
-
return {
|
|
3045
|
-
...entry,
|
|
3046
|
-
last_update_check_at: updateStatus.checked_at,
|
|
3047
|
-
last_update_remote_commit: updateStatus.remote_commit,
|
|
3048
|
-
update_available: updateStatus.available,
|
|
3049
|
-
update_error: updateStatus.error
|
|
3050
|
-
};
|
|
3051
|
-
}));
|
|
3052
|
-
managedState = {
|
|
3053
|
-
...managedState,
|
|
3054
|
-
updated_at: nowIso(),
|
|
3055
|
-
entries: sortManagedEntries(updates)
|
|
3056
|
-
};
|
|
3057
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
3058
|
-
}
|
|
3059
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3060
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
3061
|
-
if (action === "manage") {
|
|
3062
|
-
const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3063
|
-
warnings.push(...updateWarnings);
|
|
3064
|
-
}
|
|
3065
|
-
let runtimeProbeSummary;
|
|
3066
|
-
let runtimeInstalledExtensions = refreshedInstalled.extensions;
|
|
3067
|
-
let runtimeActivationFailures;
|
|
3068
|
-
if (action === "explore" || options.runtimeProbe === true) {
|
|
3069
|
-
const loadResult = await loadExtensions({
|
|
3070
|
-
pmRoot: resolvedRoots.pm_root,
|
|
3071
|
-
settings,
|
|
3072
|
-
cwd: process.cwd(),
|
|
3073
|
-
noExtensions: global.noExtensions === true
|
|
3074
|
-
});
|
|
3075
|
-
const activationResult = await activateExtensions({
|
|
3076
|
-
...loadResult,
|
|
3077
|
-
loaded: loadResult.loaded
|
|
3078
|
-
});
|
|
3079
|
-
warnings.push(...loadResult.warnings);
|
|
3080
|
-
warnings.push(...activationResult.warnings);
|
|
3081
|
-
runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3082
|
-
runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
|
|
3083
|
-
runtimeProbeSummary = {
|
|
3084
|
-
requested: true,
|
|
3085
|
-
executed: true,
|
|
3086
|
-
reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
|
|
3087
|
-
load_failure_count: loadResult.failed.length,
|
|
3088
|
-
activation_failure_count: activationResult.failed.length,
|
|
3089
|
-
warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
|
|
3090
|
-
policy: loadResult.policy
|
|
3091
|
-
};
|
|
3092
|
-
} else if (action === "manage") {
|
|
3093
|
-
runtimeProbeSummary = {
|
|
3094
|
-
requested: false,
|
|
3095
|
-
executed: false
|
|
3096
|
-
};
|
|
3097
|
-
}
|
|
3098
|
-
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3099
|
-
warnings.push(...triage.warnings);
|
|
3100
|
-
const details = {
|
|
3101
|
-
total: runtimeInstalledExtensions.length,
|
|
3102
|
-
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3103
|
-
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3104
|
-
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3105
|
-
extensions: runtimeInstalledExtensions,
|
|
3106
|
-
triage,
|
|
3107
|
-
policy: configuredPolicy
|
|
3108
|
-
};
|
|
3109
|
-
if (runtimeActivationFailures !== void 0) {
|
|
3110
|
-
details.activation_diagnostics = {
|
|
3111
|
-
failed_count: runtimeActivationFailures.length,
|
|
3112
|
-
failed: runtimeActivationFailures
|
|
3113
|
-
};
|
|
3114
|
-
}
|
|
3115
|
-
if (action === "explore") {
|
|
3116
|
-
details.runtime_probe = runtimeProbeSummary;
|
|
3117
|
-
}
|
|
3118
|
-
if (action === "manage") {
|
|
3119
|
-
details.runtime_probe = runtimeProbeSummary;
|
|
3120
|
-
details.managed_state_fix = managedStateFix !== null ? {
|
|
3121
|
-
requested: true,
|
|
3122
|
-
applied: managedStateFix.adopted_entries.length > 0,
|
|
3123
|
-
adopted_count: managedStateFix.adopted_entries.length,
|
|
3124
|
-
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
|
|
3125
|
-
already_managed_count: managedStateFix.already_managed_count
|
|
3126
|
-
} : {
|
|
3127
|
-
requested: false,
|
|
3128
|
-
applied: false,
|
|
3129
|
-
adopted_count: 0,
|
|
3130
|
-
adopted_extensions: [],
|
|
3131
|
-
already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
|
|
3132
|
-
};
|
|
3133
|
-
}
|
|
3134
|
-
return withResult(details);
|
|
3135
|
-
}
|
|
3136
|
-
throw new PmCliError(`Unsupported extension action "${action}".`, EXIT_CODE.USAGE);
|
|
3137
|
-
}
|
|
3348
|
+
return withResult(details);
|
|
3349
|
+
}
|
|
3350
|
+
var EXTENSION_ACTION_HANDLERS = {
|
|
3351
|
+
init: runExtensionInitAction,
|
|
3352
|
+
install: runExtensionInstallAction,
|
|
3353
|
+
uninstall: runExtensionUninstallAction,
|
|
3354
|
+
explore: runExtensionExploreManageAction,
|
|
3355
|
+
manage: runExtensionExploreManageAction,
|
|
3356
|
+
describe: runExtensionDescribeAction,
|
|
3357
|
+
reload: runExtensionReloadAction,
|
|
3358
|
+
doctor: runExtensionDoctorAction,
|
|
3359
|
+
catalog: runExtensionCatalogAction,
|
|
3360
|
+
adopt: runExtensionAdoptAction,
|
|
3361
|
+
"adopt-all": runExtensionAdoptAllAction,
|
|
3362
|
+
activate: runExtensionActivateDeactivateAction,
|
|
3363
|
+
deactivate: runExtensionActivateDeactivateAction
|
|
3364
|
+
};
|
|
3138
3365
|
var _testOnly = {
|
|
3139
3366
|
adoptUnmanagedExtensions,
|
|
3140
3367
|
buildExtensionPolicyDetails,
|
|
@@ -3145,6 +3372,7 @@ var _testOnly = {
|
|
|
3145
3372
|
findActivationFailureByName,
|
|
3146
3373
|
resolveInstallRuntimeActivationStatus,
|
|
3147
3374
|
collectGlobalOutputOverrideDoctorWarnings,
|
|
3375
|
+
collectSchemaNarrowActivationDoctorWarnings,
|
|
3148
3376
|
copyExtensionDirectoryWithoutSelfNesting,
|
|
3149
3377
|
isErrnoCode,
|
|
3150
3378
|
isRetriableExtensionInstallCopyError,
|
|
@@ -3171,6 +3399,6 @@ export {
|
|
|
3171
3399
|
runExtension,
|
|
3172
3400
|
_testOnly
|
|
3173
3401
|
};
|
|
3174
|
-
//# sourceMappingURL=chunk-
|
|
3402
|
+
//# sourceMappingURL=chunk-NU2UEROZ.js.map
|
|
3175
3403
|
|
|
3176
|
-
//# debugId=
|
|
3404
|
+
//# debugId=bfb4fc80-65a7-5c83-b180-b171fcfa4f33
|