@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,30 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
|
+
splitCommaList
|
|
3
|
+
} from "./chunk-5HIZDR5A.js";
|
|
4
|
+
import {
|
|
5
|
+
ensureTypeFolderScaffold
|
|
6
|
+
} from "./chunk-RMMQ74TG.js";
|
|
7
|
+
import {
|
|
8
|
+
buildExtensionDescribeResult,
|
|
2
9
|
scaffoldExtensionProject
|
|
3
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SDR5J34Q.js";
|
|
4
11
|
import {
|
|
5
12
|
normalizeExtensionNameForMatch,
|
|
6
13
|
normalizeManagedDirectoryName,
|
|
7
14
|
normalizeStringList,
|
|
8
15
|
parseExtensionManifest,
|
|
9
16
|
validateExtensionDirectory
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
splitCommaList
|
|
13
|
-
} from "./chunk-5HIZDR5A.js";
|
|
17
|
+
} from "./chunk-RH5ZBYFD.js";
|
|
14
18
|
import {
|
|
15
19
|
nowIso
|
|
16
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WYDHYJPO.js";
|
|
17
21
|
import {
|
|
18
22
|
EXIT_CODE,
|
|
19
23
|
EXTENSION_CAPABILITY_CONTRACT,
|
|
20
24
|
KNOWN_EXTENSION_CAPABILITIES,
|
|
21
25
|
PmCliError,
|
|
22
26
|
activateExtensions,
|
|
23
|
-
collectUsedExtensionCapabilities,
|
|
24
27
|
isPathWithinDirectory,
|
|
28
|
+
levenshteinDistanceWithinLimit,
|
|
25
29
|
loadExtensions,
|
|
26
30
|
nextExtensionReloadToken,
|
|
27
|
-
normalizeExtensionName,
|
|
28
31
|
parseLegacyExtensionCapabilityAliasWarning,
|
|
29
32
|
parseUnknownExtensionCapabilityWarning,
|
|
30
33
|
pathExists,
|
|
@@ -35,7 +38,7 @@ import {
|
|
|
35
38
|
resolvePmPackageRootFromModule,
|
|
36
39
|
resolvePmRoot,
|
|
37
40
|
writeSettings
|
|
38
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-RVUALSJF.js";
|
|
39
42
|
|
|
40
43
|
// dist/cli/commands/extension.js
|
|
41
44
|
import { execFile as execFile2 } from "node:child_process";
|
|
@@ -50,7 +53,7 @@ import path from "node:path";
|
|
|
50
53
|
!(function() {
|
|
51
54
|
try {
|
|
52
55
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
53
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
56
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0874e784-e274-5edd-8fbf-26d94a6c4a32");
|
|
54
57
|
} catch (e2) {
|
|
55
58
|
}
|
|
56
59
|
})();
|
|
@@ -94,6 +97,63 @@ function managedExtensionSourcesEquivalent(left, right) {
|
|
|
94
97
|
}
|
|
95
98
|
return true;
|
|
96
99
|
}
|
|
100
|
+
function optionalString(value) {
|
|
101
|
+
return typeof value === "string" ? value : void 0;
|
|
102
|
+
}
|
|
103
|
+
function hasRequiredManagedRecordFields(entry) {
|
|
104
|
+
return typeof entry.name === "string" && entry.name.trim().length > 0 && typeof entry.directory === "string" && entry.directory.trim().length > 0 && (entry.scope === "project" || entry.scope === "global") && typeof entry.manifest_version === "string" && typeof entry.manifest_entry === "string" && Array.isArray(entry.capabilities) && entry.capabilities.every((value) => typeof value === "string") && typeof entry.installed_at === "string" && typeof entry.updated_at === "string";
|
|
105
|
+
}
|
|
106
|
+
function normalizeManagedSource(raw) {
|
|
107
|
+
if (typeof raw !== "object" || raw === null) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const source = raw;
|
|
111
|
+
if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
kind: source.kind,
|
|
116
|
+
input: source.input,
|
|
117
|
+
location: source.location,
|
|
118
|
+
name: optionalString(source.name),
|
|
119
|
+
package: optionalString(source.package),
|
|
120
|
+
version: optionalString(source.version),
|
|
121
|
+
repository: optionalString(source.repository),
|
|
122
|
+
owner: optionalString(source.owner),
|
|
123
|
+
repo: optionalString(source.repo),
|
|
124
|
+
ref: optionalString(source.ref),
|
|
125
|
+
subpath: optionalString(source.subpath),
|
|
126
|
+
commit: optionalString(source.commit)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function normalizeManagedRecord(raw) {
|
|
130
|
+
if (typeof raw !== "object" || raw === null) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const entry = raw;
|
|
134
|
+
if (!hasRequiredManagedRecordFields(entry)) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
const source = normalizeManagedSource(entry.source);
|
|
138
|
+
if (!source) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
name: entry.name.trim(),
|
|
143
|
+
directory: entry.directory.trim(),
|
|
144
|
+
scope: entry.scope,
|
|
145
|
+
manifest_version: entry.manifest_version,
|
|
146
|
+
manifest_entry: entry.manifest_entry,
|
|
147
|
+
capabilities: normalizeStringList(entry.capabilities),
|
|
148
|
+
installed_at: entry.installed_at,
|
|
149
|
+
updated_at: entry.updated_at,
|
|
150
|
+
source,
|
|
151
|
+
last_update_check_at: optionalString(entry.last_update_check_at),
|
|
152
|
+
last_update_remote_commit: optionalString(entry.last_update_remote_commit),
|
|
153
|
+
update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
|
|
154
|
+
update_error: optionalString(entry.update_error)
|
|
155
|
+
};
|
|
156
|
+
}
|
|
97
157
|
function normalizeManagedState(raw) {
|
|
98
158
|
if (typeof raw !== "object" || raw === null) {
|
|
99
159
|
return null;
|
|
@@ -104,49 +164,14 @@ function normalizeManagedState(raw) {
|
|
|
104
164
|
}
|
|
105
165
|
const entries = [];
|
|
106
166
|
for (const rawEntry of candidate.entries) {
|
|
107
|
-
|
|
108
|
-
|
|
167
|
+
const record = normalizeManagedRecord(rawEntry);
|
|
168
|
+
if (record) {
|
|
169
|
+
entries.push(record);
|
|
109
170
|
}
|
|
110
|
-
const entry = rawEntry;
|
|
111
|
-
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) {
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
const source = entry.source;
|
|
115
|
-
if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
entries.push({
|
|
119
|
-
name: entry.name.trim(),
|
|
120
|
-
directory: entry.directory.trim(),
|
|
121
|
-
scope: entry.scope,
|
|
122
|
-
manifest_version: entry.manifest_version,
|
|
123
|
-
manifest_entry: entry.manifest_entry,
|
|
124
|
-
capabilities: normalizeStringList(entry.capabilities),
|
|
125
|
-
installed_at: entry.installed_at,
|
|
126
|
-
updated_at: entry.updated_at,
|
|
127
|
-
source: {
|
|
128
|
-
kind: source.kind,
|
|
129
|
-
input: source.input,
|
|
130
|
-
location: source.location,
|
|
131
|
-
name: typeof source.name === "string" ? source.name : void 0,
|
|
132
|
-
package: typeof source.package === "string" ? source.package : void 0,
|
|
133
|
-
version: typeof source.version === "string" ? source.version : void 0,
|
|
134
|
-
repository: typeof source.repository === "string" ? source.repository : void 0,
|
|
135
|
-
owner: typeof source.owner === "string" ? source.owner : void 0,
|
|
136
|
-
repo: typeof source.repo === "string" ? source.repo : void 0,
|
|
137
|
-
ref: typeof source.ref === "string" ? source.ref : void 0,
|
|
138
|
-
subpath: typeof source.subpath === "string" ? source.subpath : void 0,
|
|
139
|
-
commit: typeof source.commit === "string" ? source.commit : void 0
|
|
140
|
-
},
|
|
141
|
-
last_update_check_at: typeof entry.last_update_check_at === "string" ? entry.last_update_check_at : void 0,
|
|
142
|
-
last_update_remote_commit: typeof entry.last_update_remote_commit === "string" ? entry.last_update_remote_commit : void 0,
|
|
143
|
-
update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
|
|
144
|
-
update_error: typeof entry.update_error === "string" ? entry.update_error : void 0
|
|
145
|
-
});
|
|
146
171
|
}
|
|
147
172
|
return {
|
|
148
173
|
version: MANAGED_EXTENSION_STATE_VERSION,
|
|
149
|
-
updated_at:
|
|
174
|
+
updated_at: optionalString(candidate.updated_at) ?? nowIso(),
|
|
150
175
|
entries: sortManagedEntries(entries)
|
|
151
176
|
};
|
|
152
177
|
}
|
|
@@ -205,7 +230,7 @@ import { execFile } from "node:child_process";
|
|
|
205
230
|
import fs3 from "node:fs/promises";
|
|
206
231
|
import os from "node:os";
|
|
207
232
|
import path3 from "node:path";
|
|
208
|
-
import { fileURLToPath
|
|
233
|
+
import { fileURLToPath } from "node:url";
|
|
209
234
|
import { promisify } from "node:util";
|
|
210
235
|
|
|
211
236
|
// dist/core/packages/manifest.js
|
|
@@ -437,7 +462,7 @@ async function collectPackageExtensionDirectories(packageRoot) {
|
|
|
437
462
|
!(function() {
|
|
438
463
|
try {
|
|
439
464
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
440
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
465
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "eab3d475-6769-535e-96a9-6bc5153c9627");
|
|
441
466
|
} catch (e2) {
|
|
442
467
|
}
|
|
443
468
|
})();
|
|
@@ -658,7 +683,7 @@ async function resolveLocalNpmPackagePath(spec) {
|
|
|
658
683
|
async function resolveNpmPackSpec(spec) {
|
|
659
684
|
const localPath = await resolveLocalNpmPackagePath(spec);
|
|
660
685
|
if (localPath) {
|
|
661
|
-
return
|
|
686
|
+
return localPath;
|
|
662
687
|
}
|
|
663
688
|
const localFileAlias = normalizeNpmLocalFileAliasSpec(spec);
|
|
664
689
|
if (localFileAlias !== spec) {
|
|
@@ -677,11 +702,23 @@ function normalizeNpmLocalFileAliasSpec(spec, cwd = process.cwd()) {
|
|
|
677
702
|
}
|
|
678
703
|
const packageName = spec.slice(0, markerIndex);
|
|
679
704
|
const target = spec.slice(markerIndex + marker.length);
|
|
680
|
-
if (packageName.trim().length === 0 || target.trim().length === 0
|
|
705
|
+
if (packageName.trim().length === 0 || target.trim().length === 0) {
|
|
706
|
+
return spec;
|
|
707
|
+
}
|
|
708
|
+
if (target.startsWith("//") && !target.startsWith("///")) {
|
|
681
709
|
return spec;
|
|
682
710
|
}
|
|
683
|
-
|
|
684
|
-
|
|
711
|
+
if (!target.startsWith("/")) {
|
|
712
|
+
return `${packageName}@${path3.resolve(cwd, target)}`;
|
|
713
|
+
}
|
|
714
|
+
let decodedPath;
|
|
715
|
+
try {
|
|
716
|
+
decodedPath = decodeURIComponent(new URL(`file:${target}`).pathname);
|
|
717
|
+
} catch {
|
|
718
|
+
return spec;
|
|
719
|
+
}
|
|
720
|
+
const nativePath = /^\/[A-Za-z]:/.test(decodedPath) ? decodedPath.slice(1) : decodedPath;
|
|
721
|
+
return `${packageName}@${nativePath}`;
|
|
685
722
|
}
|
|
686
723
|
function parsePackedNpmPackage(stdout, packDirectory) {
|
|
687
724
|
try {
|
|
@@ -954,7 +991,7 @@ import path4 from "node:path";
|
|
|
954
991
|
!(function() {
|
|
955
992
|
try {
|
|
956
993
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
957
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
994
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0baef9c6-cdf9-5aea-89f0-088600d538e6");
|
|
958
995
|
} catch (e2) {
|
|
959
996
|
}
|
|
960
997
|
})();
|
|
@@ -1076,6 +1113,42 @@ async function resolveBundledAliasManifestName(input) {
|
|
|
1076
1113
|
return null;
|
|
1077
1114
|
}
|
|
1078
1115
|
}
|
|
1116
|
+
function buildBundledCatalogLinks(manifest) {
|
|
1117
|
+
return {
|
|
1118
|
+
docs: manifest.catalog?.links?.docs ?? manifest.package_homepage,
|
|
1119
|
+
npm: manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0),
|
|
1120
|
+
repository: manifest.catalog?.links?.repository ?? manifest.package_repository_url,
|
|
1121
|
+
report: manifest.catalog?.links?.report ?? manifest.package_bugs_url
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
function buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations) {
|
|
1125
|
+
const installScopeFlag = scope === "global" ? "--global" : "--project";
|
|
1126
|
+
const metadataOnlyResources = Object.fromEntries(PM_PACKAGE_RESOURCE_KINDS.filter((resourceKind) => resourceKind !== "extensions").map((resourceKind) => [resourceKind, manifest.resources[resourceKind] ?? []]).filter(([, entries]) => Array.isArray(entries) && entries.length > 0));
|
|
1127
|
+
return {
|
|
1128
|
+
alias: bundledEntry.alias,
|
|
1129
|
+
bundled: true,
|
|
1130
|
+
available: true,
|
|
1131
|
+
installed: installedBuiltinAliases.has(bundledEntry.alias) || installedLocations.has(path4.resolve(bundledEntry.package_root)),
|
|
1132
|
+
install_target: bundledEntry.alias,
|
|
1133
|
+
install_command: `pm install ${bundledEntry.alias} ${installScopeFlag}`,
|
|
1134
|
+
package_name: manifest.package_name,
|
|
1135
|
+
package_version: manifest.package_version,
|
|
1136
|
+
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
1137
|
+
keywords: manifest.package_keywords ?? [],
|
|
1138
|
+
resources: manifest.resources,
|
|
1139
|
+
installable_resources: {
|
|
1140
|
+
extensions: manifest.resources.extensions ?? []
|
|
1141
|
+
},
|
|
1142
|
+
metadata_only_resources: metadataOnlyResources,
|
|
1143
|
+
catalog: {
|
|
1144
|
+
display_name: manifest.catalog?.display_name,
|
|
1145
|
+
category: manifest.catalog?.category,
|
|
1146
|
+
tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
|
|
1147
|
+
links: buildBundledCatalogLinks(manifest),
|
|
1148
|
+
media: manifest.catalog?.media
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1079
1152
|
async function buildBundledPackageCatalog(scope, global2, options = {}) {
|
|
1080
1153
|
const roots = resolveExtensionRoots(resolvePmRoot(process.cwd(), global2.path), process.cwd());
|
|
1081
1154
|
const selectedRoot = scope === "global" ? roots.global : roots.project;
|
|
@@ -1084,44 +1157,8 @@ async function buildBundledPackageCatalog(scope, global2, options = {}) {
|
|
|
1084
1157
|
const installedBuiltinAliases = new Set(managedStateRead.state.entries.filter((entry) => entry.scope === scope && entry.source.kind === "builtin").flatMap((entry) => [entry.source.name, entry.source.input, entry.source.location]).filter((value) => typeof value === "string" && value.trim().length > 0).map((value) => value.trim().toLowerCase()));
|
|
1085
1158
|
const packages = [];
|
|
1086
1159
|
for (const bundledEntry of await collectBundledPackageEntries()) {
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1089
|
-
const installScopeFlag = scope === "global" ? "--global" : "--project";
|
|
1090
|
-
const manifest = await readPmPackageManifest(packageRoot);
|
|
1091
|
-
const repository = manifest.catalog?.links?.repository ?? manifest.package_repository_url;
|
|
1092
|
-
const report = manifest.catalog?.links?.report ?? manifest.package_bugs_url;
|
|
1093
|
-
const docs = manifest.catalog?.links?.docs ?? manifest.package_homepage;
|
|
1094
|
-
const npm = manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0);
|
|
1095
|
-
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));
|
|
1096
|
-
packages.push({
|
|
1097
|
-
alias,
|
|
1098
|
-
bundled: true,
|
|
1099
|
-
available: true,
|
|
1100
|
-
installed: installedBuiltinAliases.has(alias) || installedLocations.has(path4.resolve(packageRoot)),
|
|
1101
|
-
install_target: alias,
|
|
1102
|
-
install_command: `pm install ${alias} ${installScopeFlag}`,
|
|
1103
|
-
package_name: manifest.package_name,
|
|
1104
|
-
package_version: manifest.package_version,
|
|
1105
|
-
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
1106
|
-
keywords: manifest.package_keywords ?? [],
|
|
1107
|
-
resources: manifest.resources,
|
|
1108
|
-
installable_resources: {
|
|
1109
|
-
extensions: manifest.resources.extensions ?? []
|
|
1110
|
-
},
|
|
1111
|
-
metadata_only_resources: metadataOnlyResources,
|
|
1112
|
-
catalog: {
|
|
1113
|
-
display_name: manifest.catalog?.display_name,
|
|
1114
|
-
category: manifest.catalog?.category,
|
|
1115
|
-
tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
|
|
1116
|
-
links: {
|
|
1117
|
-
docs,
|
|
1118
|
-
npm,
|
|
1119
|
-
repository,
|
|
1120
|
-
report
|
|
1121
|
-
},
|
|
1122
|
-
media: manifest.catalog?.media
|
|
1123
|
-
}
|
|
1124
|
-
});
|
|
1160
|
+
const manifest = await readPmPackageManifest(bundledEntry.package_root);
|
|
1161
|
+
packages.push(buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations));
|
|
1125
1162
|
}
|
|
1126
1163
|
const fields = parsePackageCatalogFields(options.fields);
|
|
1127
1164
|
const outputPackages = fields ? packages.map((entry) => projectPackageCatalogEntry(entry, fields)) : packages;
|
|
@@ -1184,95 +1221,11 @@ function projectPackageCatalogEntry(entry, fields) {
|
|
|
1184
1221
|
return projected;
|
|
1185
1222
|
}
|
|
1186
1223
|
|
|
1187
|
-
// dist/core/extensions/activation-summary.js
|
|
1188
|
-
!(function() {
|
|
1189
|
-
try {
|
|
1190
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
1191
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "13c88992-4da1-549d-8644-3ac448f6960e");
|
|
1192
|
-
} catch (e2) {
|
|
1193
|
-
}
|
|
1194
|
-
})();
|
|
1195
|
-
var HOOK_REGISTRY_FIELD_TO_KIND = [
|
|
1196
|
-
["beforeCommand", "before_command"],
|
|
1197
|
-
["afterCommand", "after_command"],
|
|
1198
|
-
["onWrite", "on_write"],
|
|
1199
|
-
["onRead", "on_read"],
|
|
1200
|
-
["onIndex", "on_index"]
|
|
1201
|
-
];
|
|
1202
|
-
function describeExtensionActivation(activation, options = {}) {
|
|
1203
|
-
const filter = options.extensionName !== void 0 ? normalizeExtensionName(options.extensionName) : null;
|
|
1204
|
-
const matches = (name) => filter === null || normalizeExtensionName(name) === filter;
|
|
1205
|
-
const collect = (entries, identify) => sortUnique(entries.filter((entry) => matches(entry.name)).map(identify));
|
|
1206
|
-
const collectFlat = (entries, expand) => sortUnique(entries.filter((entry) => matches(entry.name)).flatMap(expand));
|
|
1207
|
-
const { registrations, commands, parsers, preflight, services, renderers, hooks } = activation;
|
|
1208
|
-
return {
|
|
1209
|
-
capabilities: collectUsedExtensionCapabilities(activation, options),
|
|
1210
|
-
commands: collect(registrations.commands, (entry) => entry.command),
|
|
1211
|
-
command_overrides: collect(commands.overrides, (entry) => entry.command),
|
|
1212
|
-
command_handlers: collect(commands.handlers, (entry) => entry.command),
|
|
1213
|
-
hooks: HOOK_REGISTRY_FIELD_TO_KIND.filter(([field]) => hooks[field].some((entry) => matches(entry.name))).map(([, kind]) => kind),
|
|
1214
|
-
flag_commands: collect(registrations.flags, (entry) => entry.target_command),
|
|
1215
|
-
item_types: collectFlat(registrations.item_types, (entry) => entry.types.map((type) => type.name)),
|
|
1216
|
-
item_fields: collectFlat(registrations.item_fields, (entry) => entry.fields.map((field) => field.name)),
|
|
1217
|
-
migrations: collectFlat(registrations.migrations, (entry) => typeof entry.definition.id === "string" ? [entry.definition.id] : []),
|
|
1218
|
-
importers: collect(registrations.importers, (entry) => entry.importer),
|
|
1219
|
-
exporters: collect(registrations.exporters, (entry) => entry.exporter),
|
|
1220
|
-
search_providers: collect(registrations.search_providers, (entry) => entry.definition.name),
|
|
1221
|
-
vector_store_adapters: collect(registrations.vector_store_adapters, (entry) => entry.definition.name),
|
|
1222
|
-
parser_overrides: collect(parsers.overrides, (entry) => entry.command),
|
|
1223
|
-
service_overrides: collect(services.overrides, (entry) => entry.service),
|
|
1224
|
-
renderer_overrides: collect(renderers.overrides, (entry) => entry.format),
|
|
1225
|
-
preflight_overrides: preflight.overrides.filter((entry) => matches(entry.name)).length
|
|
1226
|
-
};
|
|
1227
|
-
}
|
|
1228
|
-
function sortUnique(values) {
|
|
1229
|
-
return [...new Set(values)].sort((left, right) => left.localeCompare(right));
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
// dist/cli/commands/extension/describe.js
|
|
1233
|
-
!(function() {
|
|
1234
|
-
try {
|
|
1235
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
1236
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "7a92163a-99b2-5969-acc2-e2b6b0336c2e");
|
|
1237
|
-
} catch (e2) {
|
|
1238
|
-
}
|
|
1239
|
-
})();
|
|
1240
|
-
function layerNameKey(layer, name) {
|
|
1241
|
-
return `${layer}:${normalizeExtensionNameForMatch(name)}`;
|
|
1242
|
-
}
|
|
1243
|
-
function buildExtensionDescribeResult(target, loadResult, activationResult) {
|
|
1244
|
-
const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));
|
|
1245
|
-
const candidates = [
|
|
1246
|
-
...loadResult.loaded.map((entry) => ({
|
|
1247
|
-
name: entry.name,
|
|
1248
|
-
layer: entry.layer,
|
|
1249
|
-
version: entry.version,
|
|
1250
|
-
activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name)) ? "failed" : "ok",
|
|
1251
|
-
surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
|
|
1252
|
-
})),
|
|
1253
|
-
...loadResult.failed.map((entry) => ({
|
|
1254
|
-
name: entry.name,
|
|
1255
|
-
layer: entry.layer,
|
|
1256
|
-
version: "unknown",
|
|
1257
|
-
activation_status: "not_loaded",
|
|
1258
|
-
surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
|
|
1259
|
-
}))
|
|
1260
|
-
].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));
|
|
1261
|
-
const normalizedTarget = typeof target === "string" ? normalizeExtensionNameForMatch(target) : null;
|
|
1262
|
-
const extensions = normalizedTarget === null ? candidates : candidates.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizedTarget);
|
|
1263
|
-
return {
|
|
1264
|
-
target: typeof target === "string" ? target.trim() : null,
|
|
1265
|
-
total: extensions.length,
|
|
1266
|
-
extensions,
|
|
1267
|
-
union: describeExtensionActivation(activationResult, normalizedTarget === null ? {} : { extensionName: target })
|
|
1268
|
-
};
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
1224
|
// dist/cli/commands/extension/doctor.js
|
|
1272
1225
|
!(function() {
|
|
1273
1226
|
try {
|
|
1274
1227
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
1275
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
1228
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "391a9e4b-f4b7-5176-970b-6de9523822e7");
|
|
1276
1229
|
} catch (e2) {
|
|
1277
1230
|
}
|
|
1278
1231
|
})();
|
|
@@ -1528,6 +1481,98 @@ function classifyUnusedCapabilityWarnings(loadResult, activationResult) {
|
|
|
1528
1481
|
}
|
|
1529
1482
|
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1530
1483
|
}
|
|
1484
|
+
var TRIAGE_REMEDIATION_RULES = [
|
|
1485
|
+
{
|
|
1486
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manifest_")),
|
|
1487
|
+
build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "explore")} ${ctx.scopeFlag} to inspect discovered manifests and directories.`
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unknown:")),
|
|
1491
|
+
build: () => `Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:")),
|
|
1495
|
+
build: () => "Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema)."
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_missing:")),
|
|
1499
|
+
build: (ctx) => `Extension activation failed because code registered a surface missing from manifest capabilities. Run ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag} --detail deep --trace and add the reported missing_capability to manifest.json before publishing.`
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unused:")),
|
|
1503
|
+
build: (ctx) => `Extension manifests declare capabilities that are never registered against. Remove each reported unused capability from manifest.json to keep least privilege, or add the matching registration. Run ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag} --detail deep --trace for per-extension registration counts.`
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:")),
|
|
1507
|
+
build: () => "Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility."
|
|
1508
|
+
},
|
|
1509
|
+
{
|
|
1510
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:")),
|
|
1511
|
+
build: () => "Global output service/renderer overrides are active. For output_format, return context.payload/null/undefined unless the extension owns the command. For renderers, return null for unrelated payloads so pm falls back to native rendering."
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_schema_narrow_activation:")),
|
|
1515
|
+
build: () => "A package registers custom item types/fields (a GLOBAL schema contribution) but also declares narrow activation.commands, so it never activates for built-in commands like pm create <type> and the custom type silently fails to register. Remove activation.commands from manifest.json so pm activates the package for every command, or \u2014 if the schema is intentionally command-scoped \u2014 knowingly ignore this advisory."
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:")),
|
|
1519
|
+
build: (ctx) => `Detected extension load failures caused by missing SDK dependency resolution. Ensure extension package dependencies include "@unbrained/pm-cli" and reinstall dependencies before running ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:")),
|
|
1523
|
+
build: (ctx) => `Detected extension module-mode mismatches. For ESM-based extension entries/imports, set package.json "type": "module" or use an explicit .mjs entry and rerun ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_")),
|
|
1527
|
+
build: (ctx) => `Extension pm version-bound warnings detected. Align each package manifest's pm_min_version/pm_max_version with the installed pm CLI version (see the warning's required/allowed=...:current=... details), or upgrade/downgrade the pm CLI to satisfy the declared bounds, then rerun ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
matches: (_warnings, ctx) => ctx.updateCheckFailedTotal > 0,
|
|
1531
|
+
build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "manage")} ${ctx.scopeFlag} after validating network and repository access.`
|
|
1532
|
+
},
|
|
1533
|
+
{
|
|
1534
|
+
matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manager_state_")),
|
|
1535
|
+
build: (ctx) => `Review and repair ${ctx.scope} managed extension state file if schema/read warnings persist.`
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
matches: (_warnings, ctx) => ctx.policyWarningCount > 0,
|
|
1539
|
+
build: () => "Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces."
|
|
1540
|
+
}
|
|
1541
|
+
];
|
|
1542
|
+
function buildExtensionTriageRemediation(params) {
|
|
1543
|
+
const { normalizedWarnings, options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount, updateHealthPartial, skippedUnmanagedTotal, skippedNonGithubTotal, updateAvailableTotal } = params;
|
|
1544
|
+
const remediation = [];
|
|
1545
|
+
const ctx = { options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount };
|
|
1546
|
+
if (normalizedWarnings.length > 0) {
|
|
1547
|
+
const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
|
|
1548
|
+
deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
|
|
1549
|
+
doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
|
|
1550
|
+
});
|
|
1551
|
+
if (registrationCollisionRemediation) {
|
|
1552
|
+
remediation.push(registrationCollisionRemediation);
|
|
1553
|
+
}
|
|
1554
|
+
for (const rule of TRIAGE_REMEDIATION_RULES) {
|
|
1555
|
+
if (rule.matches(normalizedWarnings, ctx)) {
|
|
1556
|
+
remediation.push(rule.build(ctx));
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
if (updateHealthPartial) {
|
|
1561
|
+
remediation.push(`Update-check coverage is partial because unmanaged extensions need adoption. Adopt existing installs via ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state (or ${lifecycleFlagCommand(options, "adopt-all")} ${scopeFlag}, ${lifecycleFlagCommand(options, "adopt")} <name> ${scopeFlag}, or reinstall via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>).`);
|
|
1562
|
+
} else if (skippedUnmanagedTotal > 0) {
|
|
1563
|
+
remediation.push(`Loaded unmanaged extensions are currently treated as informational. Use ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state to adopt them for update checks.`);
|
|
1564
|
+
}
|
|
1565
|
+
if (skippedNonGithubTotal > 0) {
|
|
1566
|
+
remediation.push(`Non-GitHub managed extensions are skipped by update checks. Use doctor output for non-update diagnostics.`);
|
|
1567
|
+
}
|
|
1568
|
+
if (updateAvailableTotal > 0) {
|
|
1569
|
+
remediation.push(`Update available managed extensions via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>.`);
|
|
1570
|
+
}
|
|
1571
|
+
if (remediation.length === 0) {
|
|
1572
|
+
remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
|
|
1573
|
+
}
|
|
1574
|
+
return remediation;
|
|
1575
|
+
}
|
|
1531
1576
|
function buildExtensionTriageSummary(scope, warnings, extensions, options = {}) {
|
|
1532
1577
|
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
1533
1578
|
const managedTotal = extensions.filter((entry) => entry.managed).length;
|
|
@@ -1557,70 +1602,19 @@ function buildExtensionTriageSummary(scope, warnings, extensions, options = {})
|
|
|
1557
1602
|
const warningCodes = [...new Set(effectiveWarnings.map((value) => warningCode(value)))].sort((left, right) => left.localeCompare(right));
|
|
1558
1603
|
const policyWarnings = summarizePolicyWarnings(effectiveWarnings);
|
|
1559
1604
|
const scopeFlag = scope === "global" ? "--global" : "--project";
|
|
1560
|
-
const remediation = [];
|
|
1561
|
-
if (normalizedWarnings.length > 0) {
|
|
1562
|
-
const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
|
|
1563
|
-
deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
|
|
1564
|
-
doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
|
|
1565
|
-
});
|
|
1566
|
-
if (registrationCollisionRemediation) {
|
|
1567
|
-
remediation.push(registrationCollisionRemediation);
|
|
1568
|
-
}
|
|
1569
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_manifest_"))) {
|
|
1570
|
-
remediation.push(`Run ${lifecycleFlagCommand(options, "explore")} ${scopeFlag} to inspect discovered manifests and directories.`);
|
|
1571
|
-
}
|
|
1572
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unknown:"))) {
|
|
1573
|
-
remediation.push(`Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`);
|
|
1574
|
-
}
|
|
1575
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:"))) {
|
|
1576
|
-
remediation.push("Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema).");
|
|
1577
|
-
}
|
|
1578
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_missing:"))) {
|
|
1579
|
-
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.`);
|
|
1580
|
-
}
|
|
1581
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unused:"))) {
|
|
1582
|
-
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.`);
|
|
1583
|
-
}
|
|
1584
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:"))) {
|
|
1585
|
-
remediation.push("Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility.");
|
|
1586
|
-
}
|
|
1587
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:"))) {
|
|
1588
|
-
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.");
|
|
1589
|
-
}
|
|
1590
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:"))) {
|
|
1591
|
-
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}.`);
|
|
1592
|
-
}
|
|
1593
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:"))) {
|
|
1594
|
-
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}.`);
|
|
1595
|
-
}
|
|
1596
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_"))) {
|
|
1597
|
-
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}.`);
|
|
1598
|
-
}
|
|
1599
|
-
if (updateCheckFailedTotal > 0) {
|
|
1600
|
-
remediation.push(`Run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after validating network and repository access.`);
|
|
1601
|
-
}
|
|
1602
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_manager_state_"))) {
|
|
1603
|
-
remediation.push(`Review and repair ${scope} managed extension state file if schema/read warnings persist.`);
|
|
1604
|
-
}
|
|
1605
|
-
if (policyWarnings.warning_count > 0) {
|
|
1606
|
-
remediation.push("Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces.");
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
1605
|
const collisionPlan = buildRegistrationCollisionPlan(scope, normalizedWarnings, extensions, options);
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
|
|
1623
|
-
}
|
|
1606
|
+
const remediation = buildExtensionTriageRemediation({
|
|
1607
|
+
normalizedWarnings,
|
|
1608
|
+
options,
|
|
1609
|
+
scope,
|
|
1610
|
+
scopeFlag,
|
|
1611
|
+
updateCheckFailedTotal,
|
|
1612
|
+
policyWarningCount: policyWarnings.warning_count,
|
|
1613
|
+
updateHealthPartial,
|
|
1614
|
+
skippedUnmanagedTotal,
|
|
1615
|
+
skippedNonGithubTotal,
|
|
1616
|
+
updateAvailableTotal
|
|
1617
|
+
});
|
|
1624
1618
|
return {
|
|
1625
1619
|
status: effectiveWarnings.length === 0 ? "ok" : "warn",
|
|
1626
1620
|
warning_count: effectiveWarnings.length,
|
|
@@ -1742,7 +1736,7 @@ function buildDoctorConsistencySummary(scope, installedExtensions, loadedExtensi
|
|
|
1742
1736
|
!(function() {
|
|
1743
1737
|
try {
|
|
1744
1738
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
1745
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
1739
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0e9a5528-9595-5a89-89b7-5a5acce477a8");
|
|
1746
1740
|
} catch (e2) {
|
|
1747
1741
|
}
|
|
1748
1742
|
})();
|
|
@@ -1751,6 +1745,39 @@ var EXTENSION_INSTALL_COPY_ATTEMPTS = 3;
|
|
|
1751
1745
|
var EXTENSION_INSTALL_LOCK_ATTEMPTS = 120;
|
|
1752
1746
|
var EXTENSION_INSTALL_LOCK_DELAY_MS = 250;
|
|
1753
1747
|
var EXTENSION_INSTALL_LOCK_STALE_MS = 12e4;
|
|
1748
|
+
var LIFECYCLE_ACTION_TARGETS = [
|
|
1749
|
+
["install", "install", "--install"],
|
|
1750
|
+
["uninstall", "uninstall", "--uninstall"],
|
|
1751
|
+
["explore", "explore", "--explore"],
|
|
1752
|
+
["list", "explore", "--explore"],
|
|
1753
|
+
["manage", "manage", "--manage"],
|
|
1754
|
+
["describe", "describe", "--describe"],
|
|
1755
|
+
["reload", "reload", "--reload"],
|
|
1756
|
+
["doctor", "doctor", "--doctor"],
|
|
1757
|
+
["catalog", "catalog", "--catalog"],
|
|
1758
|
+
["init", "init", "--init"],
|
|
1759
|
+
["scaffold", "init", "--scaffold"],
|
|
1760
|
+
["adopt", "adopt", "--adopt"],
|
|
1761
|
+
["adopt-all", "adopt-all", "--adopt-all"],
|
|
1762
|
+
["activate", "activate", "--activate"],
|
|
1763
|
+
["deactivate", "deactivate", "--deactivate"]
|
|
1764
|
+
];
|
|
1765
|
+
var LIFECYCLE_ACTION_FLAG_HINT = LIFECYCLE_ACTION_TARGETS.map(([, , flag]) => flag).filter((flag, index, flags) => flags.indexOf(flag) === index).join(", ");
|
|
1766
|
+
var LIFECYCLE_ACTION_FLAGS = {
|
|
1767
|
+
install: "--install",
|
|
1768
|
+
uninstall: "--uninstall",
|
|
1769
|
+
explore: "--explore",
|
|
1770
|
+
manage: "--manage",
|
|
1771
|
+
describe: "--describe",
|
|
1772
|
+
reload: "--reload",
|
|
1773
|
+
doctor: "--doctor",
|
|
1774
|
+
catalog: "--catalog",
|
|
1775
|
+
adopt: "--adopt",
|
|
1776
|
+
"adopt-all": "--adopt-all",
|
|
1777
|
+
activate: "--activate",
|
|
1778
|
+
deactivate: "--deactivate",
|
|
1779
|
+
init: "--init"
|
|
1780
|
+
};
|
|
1754
1781
|
var NATIVE_OUTPUT_MARKER = "__pm_native_output";
|
|
1755
1782
|
function buildExtensionPolicyDetails(policy) {
|
|
1756
1783
|
const overrides = (policy.extension_overrides ?? []).map((override) => ({
|
|
@@ -1967,49 +1994,106 @@ function clearExtensionState(settings, name) {
|
|
|
1967
1994
|
settings.extensions.disabled = [...disabled].sort((left, right) => left.localeCompare(right));
|
|
1968
1995
|
return settings.extensions.enabled.join("\0") !== previousEnabled.join("\0") || settings.extensions.disabled.join("\0") !== previousDisabled.join("\0");
|
|
1969
1996
|
}
|
|
1970
|
-
function
|
|
1971
|
-
const
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
options.adopt ? "adopt" : null,
|
|
1983
|
-
options.adoptAll ? "adopt-all" : null,
|
|
1984
|
-
options.activate ? "activate" : null,
|
|
1985
|
-
options.deactivate ? "deactivate" : null
|
|
1986
|
-
].filter((value) => value !== null))];
|
|
1987
|
-
if (selected.length === 0) {
|
|
1988
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "doctor") {
|
|
1989
|
-
return "doctor";
|
|
1990
|
-
}
|
|
1991
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "reload") {
|
|
1992
|
-
return "reload";
|
|
1993
|
-
}
|
|
1994
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "catalog") {
|
|
1995
|
-
return "catalog";
|
|
1996
|
-
}
|
|
1997
|
-
if (typeof target === "string" && (target.trim().toLowerCase() === "init" || target.trim().toLowerCase() === "scaffold")) {
|
|
1998
|
-
return "init";
|
|
1999
|
-
}
|
|
2000
|
-
if (typeof target === "string" && target.trim().toLowerCase() === "explore") {
|
|
2001
|
-
return "explore";
|
|
1997
|
+
function suggestLifecycleActionTarget(target) {
|
|
1998
|
+
const normalizedTarget = target.trim().toLowerCase();
|
|
1999
|
+
const exactMatch = LIFECYCLE_ACTION_TARGETS.find(([candidate]) => candidate === normalizedTarget);
|
|
2000
|
+
if (exactMatch) {
|
|
2001
|
+
return { action: exactMatch[1], flag: exactMatch[2] };
|
|
2002
|
+
}
|
|
2003
|
+
const maxDistance = normalizedTarget.length <= 4 ? 1 : 2;
|
|
2004
|
+
let nearest = null;
|
|
2005
|
+
for (const [candidate, action, flag] of LIFECYCLE_ACTION_TARGETS) {
|
|
2006
|
+
const distance = levenshteinDistanceWithinLimit(normalizedTarget, candidate, maxDistance);
|
|
2007
|
+
if (distance === null) {
|
|
2008
|
+
continue;
|
|
2002
2009
|
}
|
|
2003
|
-
if (
|
|
2004
|
-
|
|
2010
|
+
if (nearest === null) {
|
|
2011
|
+
nearest = { action, flag, distance };
|
|
2012
|
+
continue;
|
|
2005
2013
|
}
|
|
2006
|
-
if (
|
|
2007
|
-
|
|
2014
|
+
if (distance < nearest.distance) {
|
|
2015
|
+
nearest = { action, flag, distance };
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
return nearest === null ? null : { action: nearest.action, flag: nearest.flag };
|
|
2019
|
+
}
|
|
2020
|
+
function buildUnknownLifecycleActionError(target, options) {
|
|
2021
|
+
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
2022
|
+
const suggestion = suggestLifecycleActionTarget(target);
|
|
2023
|
+
if (!suggestion) {
|
|
2024
|
+
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);
|
|
2025
|
+
}
|
|
2026
|
+
const command = `pm ${noun} ${suggestion.flag}`;
|
|
2027
|
+
return new PmCliError(`Unknown ${noun} lifecycle action "${target}". Did you mean "${suggestion.flag}"?`, EXIT_CODE.USAGE, {
|
|
2028
|
+
code: "unknown_lifecycle_action",
|
|
2029
|
+
required: `Use one of: ${LIFECYCLE_ACTION_FLAG_HINT}.`,
|
|
2030
|
+
examples: [command, `pm ${noun} --help`],
|
|
2031
|
+
recovery: {
|
|
2032
|
+
attempted_command: `pm ${noun} ${target}`,
|
|
2033
|
+
suggested_retry: command,
|
|
2034
|
+
fallback_candidates: [
|
|
2035
|
+
{
|
|
2036
|
+
source: "lifecycle_action",
|
|
2037
|
+
command,
|
|
2038
|
+
reason: `nearest lifecycle action for "${target}"`
|
|
2039
|
+
}
|
|
2040
|
+
]
|
|
2008
2041
|
}
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
var EXTENSION_ACTION_FLAG_SELECTORS = [
|
|
2045
|
+
["install", "install"],
|
|
2046
|
+
["uninstall", "uninstall"],
|
|
2047
|
+
["explore", "explore"],
|
|
2048
|
+
["manage", "manage"],
|
|
2049
|
+
["describe", "describe"],
|
|
2050
|
+
["reload", "reload"],
|
|
2051
|
+
["doctor", "doctor"],
|
|
2052
|
+
["catalog", "catalog"],
|
|
2053
|
+
["init", "init"],
|
|
2054
|
+
["scaffold", "init"],
|
|
2055
|
+
["adopt", "adopt"],
|
|
2056
|
+
["adoptAll", "adopt-all"],
|
|
2057
|
+
["activate", "activate"],
|
|
2058
|
+
["deactivate", "deactivate"]
|
|
2059
|
+
];
|
|
2060
|
+
function resolveImplicitActionFromTarget(normalizedTarget) {
|
|
2061
|
+
if (normalizedTarget === "doctor") {
|
|
2062
|
+
return "doctor";
|
|
2063
|
+
}
|
|
2064
|
+
if (normalizedTarget === "reload") {
|
|
2065
|
+
return "reload";
|
|
2066
|
+
}
|
|
2067
|
+
if (normalizedTarget === "catalog") {
|
|
2068
|
+
return "catalog";
|
|
2069
|
+
}
|
|
2070
|
+
if (normalizedTarget === "init" || normalizedTarget === "scaffold") {
|
|
2071
|
+
return "init";
|
|
2072
|
+
}
|
|
2073
|
+
if (normalizedTarget === "explore") {
|
|
2074
|
+
return "explore";
|
|
2075
|
+
}
|
|
2076
|
+
if (normalizedTarget === "manage") {
|
|
2077
|
+
return "manage";
|
|
2078
|
+
}
|
|
2079
|
+
if (normalizedTarget === "list" || normalizedTarget === "") {
|
|
2080
|
+
return "explore";
|
|
2081
|
+
}
|
|
2082
|
+
return null;
|
|
2083
|
+
}
|
|
2084
|
+
function resolveAction(target, options) {
|
|
2085
|
+
const selected = [
|
|
2086
|
+
...new Set(EXTENSION_ACTION_FLAG_SELECTORS.filter(([flag]) => options[flag] === true).map(([, mappedAction]) => mappedAction))
|
|
2087
|
+
];
|
|
2088
|
+
if (selected.length === 0) {
|
|
2009
2089
|
if (target === void 0) {
|
|
2010
2090
|
return "explore";
|
|
2011
2091
|
}
|
|
2012
|
-
|
|
2092
|
+
const implicitAction = resolveImplicitActionFromTarget(target.trim().toLowerCase());
|
|
2093
|
+
if (implicitAction) {
|
|
2094
|
+
return implicitAction;
|
|
2095
|
+
}
|
|
2096
|
+
throw buildUnknownLifecycleActionError(target, options);
|
|
2013
2097
|
}
|
|
2014
2098
|
if (selected.length > 1) {
|
|
2015
2099
|
throw new PmCliError("Extension action flags are mutually exclusive.", EXIT_CODE.USAGE);
|
|
@@ -2067,6 +2151,27 @@ function resolveUpdateCheckResolution(managedEntry) {
|
|
|
2067
2151
|
reason: "no_update_check_recorded"
|
|
2068
2152
|
};
|
|
2069
2153
|
}
|
|
2154
|
+
function buildInstalledExtensionSummary(identity, scope, managedEntry, updateCheck) {
|
|
2155
|
+
return {
|
|
2156
|
+
name: identity.name,
|
|
2157
|
+
directory: identity.directory,
|
|
2158
|
+
version: identity.version,
|
|
2159
|
+
entry: identity.entry,
|
|
2160
|
+
scope,
|
|
2161
|
+
active: identity.enabled,
|
|
2162
|
+
enabled: identity.enabled,
|
|
2163
|
+
runtime_active: null,
|
|
2164
|
+
activation_status: "unknown",
|
|
2165
|
+
managed: Boolean(managedEntry),
|
|
2166
|
+
source: managedEntry?.source,
|
|
2167
|
+
update_available: managedEntry?.update_available,
|
|
2168
|
+
last_update_check_at: managedEntry?.last_update_check_at,
|
|
2169
|
+
last_update_remote_commit: managedEntry?.last_update_remote_commit,
|
|
2170
|
+
update_error: managedEntry?.update_error,
|
|
2171
|
+
update_check_status: updateCheck.status,
|
|
2172
|
+
update_check_reason: updateCheck.reason
|
|
2173
|
+
};
|
|
2174
|
+
}
|
|
2070
2175
|
async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
2071
2176
|
if (!await pathExists(extensionsRoot)) {
|
|
2072
2177
|
return {
|
|
@@ -2090,27 +2195,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
|
2090
2195
|
if (!await pathExists(manifestPath)) {
|
|
2091
2196
|
warnings.push(`extension_manifest_missing:${scope}:${directoryName}`);
|
|
2092
2197
|
const managedEntry2 = managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
|
|
2093
|
-
|
|
2094
|
-
const enabled2 = managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false;
|
|
2095
|
-
summaries.push({
|
|
2198
|
+
summaries.push(buildInstalledExtensionSummary({
|
|
2096
2199
|
name: managedEntry2?.name ?? directoryName,
|
|
2097
2200
|
directory: directoryName,
|
|
2098
2201
|
version: managedEntry2?.manifest_version ?? "unknown",
|
|
2099
2202
|
entry: managedEntry2?.manifest_entry ?? "unknown",
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
enabled: enabled2,
|
|
2103
|
-
runtime_active: null,
|
|
2104
|
-
activation_status: "unknown",
|
|
2105
|
-
managed: Boolean(managedEntry2),
|
|
2106
|
-
source: managedEntry2?.source,
|
|
2107
|
-
update_available: managedEntry2?.update_available,
|
|
2108
|
-
last_update_check_at: managedEntry2?.last_update_check_at,
|
|
2109
|
-
last_update_remote_commit: managedEntry2?.last_update_remote_commit,
|
|
2110
|
-
update_error: managedEntry2?.update_error,
|
|
2111
|
-
update_check_status: updateCheck2.status,
|
|
2112
|
-
update_check_reason: updateCheck2.reason
|
|
2113
|
-
});
|
|
2203
|
+
enabled: managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false
|
|
2204
|
+
}, scope, managedEntry2, resolveUpdateCheckResolution(managedEntry2)));
|
|
2114
2205
|
continue;
|
|
2115
2206
|
}
|
|
2116
2207
|
let rawManifest;
|
|
@@ -2126,27 +2217,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
|
|
|
2126
2217
|
continue;
|
|
2127
2218
|
}
|
|
2128
2219
|
const managedEntry = managedByName.get(normalizeExtensionNameForMatch(manifest.name)) ?? managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
|
|
2129
|
-
|
|
2130
|
-
const enabled = isExtensionEnabled(settings, manifest.name);
|
|
2131
|
-
summaries.push({
|
|
2220
|
+
summaries.push(buildInstalledExtensionSummary({
|
|
2132
2221
|
name: manifest.name,
|
|
2133
2222
|
directory: directoryName,
|
|
2134
2223
|
version: manifest.version,
|
|
2135
2224
|
entry: manifest.entry,
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
enabled,
|
|
2139
|
-
runtime_active: null,
|
|
2140
|
-
activation_status: "unknown",
|
|
2141
|
-
managed: Boolean(managedEntry),
|
|
2142
|
-
source: managedEntry?.source,
|
|
2143
|
-
update_available: managedEntry?.update_available,
|
|
2144
|
-
last_update_check_at: managedEntry?.last_update_check_at,
|
|
2145
|
-
last_update_remote_commit: managedEntry?.last_update_remote_commit,
|
|
2146
|
-
update_error: managedEntry?.update_error,
|
|
2147
|
-
update_check_status: updateCheck.status,
|
|
2148
|
-
update_check_reason: updateCheck.reason
|
|
2149
|
-
});
|
|
2225
|
+
enabled: isExtensionEnabled(settings, manifest.name)
|
|
2226
|
+
}, scope, managedEntry, resolveUpdateCheckResolution(managedEntry)));
|
|
2150
2227
|
}
|
|
2151
2228
|
return {
|
|
2152
2229
|
extensions: summaries.sort((left, right) => left.name.localeCompare(right.name)),
|
|
@@ -2228,7 +2305,8 @@ async function probeRuntimeCommandPathsForInstall(pmRoot, settings, refreshedIns
|
|
|
2228
2305
|
return {
|
|
2229
2306
|
installed: applyDoctorRuntimeActivationState(refreshedInstalled, loadResult, activationResult),
|
|
2230
2307
|
warnings: [...loadResult.warnings, ...activationResult.warnings],
|
|
2231
|
-
activation_failures: collectActivationFailureDiagnostics(activationResult.failed)
|
|
2308
|
+
activation_failures: collectActivationFailureDiagnostics(activationResult.failed),
|
|
2309
|
+
item_type_registrations: activationResult.registrations.item_types
|
|
2232
2310
|
};
|
|
2233
2311
|
}
|
|
2234
2312
|
async function checkGithubUpdate(source, gitCommandRunner = runGitCommand) {
|
|
@@ -2354,13 +2432,37 @@ function resolveGithubOption(options) {
|
|
|
2354
2432
|
}
|
|
2355
2433
|
return void 0;
|
|
2356
2434
|
}
|
|
2357
|
-
function
|
|
2435
|
+
function getLifecycleActionFlag(action) {
|
|
2436
|
+
return LIFECYCLE_ACTION_FLAGS[action];
|
|
2437
|
+
}
|
|
2438
|
+
function requireTarget(target, action, options = {}) {
|
|
2358
2439
|
const normalized = target?.trim();
|
|
2359
2440
|
if (!normalized) {
|
|
2360
2441
|
if (action === "init") {
|
|
2361
2442
|
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);
|
|
2362
2443
|
}
|
|
2363
|
-
|
|
2444
|
+
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
2445
|
+
const targetName = action === "install" ? "source" : "name";
|
|
2446
|
+
const targetLabel = `${noun} ${targetName}`;
|
|
2447
|
+
const actionFlag = getLifecycleActionFlag(action);
|
|
2448
|
+
const commandTarget = `<${targetName}>`;
|
|
2449
|
+
const command = `pm ${noun} ${actionFlag} ${commandTarget}`;
|
|
2450
|
+
throw new PmCliError(`Action "${action}" requires ${targetLabel} input.`, EXIT_CODE.USAGE, {
|
|
2451
|
+
code: "missing_lifecycle_target",
|
|
2452
|
+
required: `Provide a ${targetName} target for ${action}.`,
|
|
2453
|
+
examples: [`pm ${noun} ${action} ${commandTarget}`, command, `pm ${noun} --help`],
|
|
2454
|
+
recovery: {
|
|
2455
|
+
attempted_command: `pm ${noun} ${action}`,
|
|
2456
|
+
suggested_retry: command,
|
|
2457
|
+
fallback_candidates: [
|
|
2458
|
+
{
|
|
2459
|
+
source: "lifecycle_action",
|
|
2460
|
+
command,
|
|
2461
|
+
reason: `flag-form ${action} command with required ${targetName} target`
|
|
2462
|
+
}
|
|
2463
|
+
]
|
|
2464
|
+
}
|
|
2465
|
+
});
|
|
2364
2466
|
}
|
|
2365
2467
|
return normalized;
|
|
2366
2468
|
}
|
|
@@ -2377,43 +2479,86 @@ function collectGlobalOutputOverrideDoctorWarnings(activationResult) {
|
|
|
2377
2479
|
}
|
|
2378
2480
|
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
2379
2481
|
}
|
|
2380
|
-
|
|
2381
|
-
const
|
|
2382
|
-
|
|
2383
|
-
|
|
2482
|
+
function collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResult) {
|
|
2483
|
+
const schemaContributors = /* @__PURE__ */ new Set();
|
|
2484
|
+
for (const entry of activationResult.registrations.item_types) {
|
|
2485
|
+
if (entry.types.length > 0) {
|
|
2486
|
+
schemaContributors.add(`${entry.layer}:${normalizeExtensionNameForMatch(entry.name)}`);
|
|
2487
|
+
}
|
|
2384
2488
|
}
|
|
2385
|
-
|
|
2386
|
-
|
|
2489
|
+
for (const entry of activationResult.registrations.item_fields) {
|
|
2490
|
+
if (entry.fields.length > 0) {
|
|
2491
|
+
schemaContributors.add(`${entry.layer}:${normalizeExtensionNameForMatch(entry.name)}`);
|
|
2492
|
+
}
|
|
2387
2493
|
}
|
|
2388
|
-
|
|
2389
|
-
|
|
2494
|
+
const warnings = [];
|
|
2495
|
+
for (const extension of loadResult.loaded) {
|
|
2496
|
+
if ((extension.activation?.commands ?? []).length === 0) {
|
|
2497
|
+
continue;
|
|
2498
|
+
}
|
|
2499
|
+
if (schemaContributors.has(`${extension.layer}:${normalizeExtensionNameForMatch(extension.name)}`)) {
|
|
2500
|
+
warnings.push(`extension_schema_narrow_activation:${extension.layer}:${extension.name}`);
|
|
2501
|
+
}
|
|
2390
2502
|
}
|
|
2391
|
-
|
|
2392
|
-
|
|
2503
|
+
return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
2504
|
+
}
|
|
2505
|
+
function assertExtensionActionOptionScope(action, options) {
|
|
2506
|
+
const guards = [
|
|
2507
|
+
{
|
|
2508
|
+
triggered: options.strictExit === true || options.failOnWarn === true,
|
|
2509
|
+
allowed: action === "doctor",
|
|
2510
|
+
message: "--strict-exit and --fail-on-warn are only valid with --doctor."
|
|
2511
|
+
},
|
|
2512
|
+
{ triggered: options.trace === true, allowed: action === "doctor", message: "--trace is only valid with --doctor." },
|
|
2513
|
+
{ triggered: options.watch === true, allowed: action === "reload", message: "--watch is only valid with --reload." },
|
|
2514
|
+
{
|
|
2515
|
+
triggered: options.runtimeProbe === true,
|
|
2516
|
+
allowed: action === "manage",
|
|
2517
|
+
message: "--runtime-probe is only valid with --manage."
|
|
2518
|
+
},
|
|
2519
|
+
{
|
|
2520
|
+
triggered: options.fixManagedState === true,
|
|
2521
|
+
allowed: action === "manage" || action === "doctor",
|
|
2522
|
+
message: "--fix-managed-state is only valid with --manage or --doctor."
|
|
2523
|
+
},
|
|
2524
|
+
{
|
|
2525
|
+
triggered: options.capability !== void 0,
|
|
2526
|
+
allowed: action === "init",
|
|
2527
|
+
message: "--capability is only valid with --init/--scaffold."
|
|
2528
|
+
},
|
|
2529
|
+
{
|
|
2530
|
+
triggered: options.declarative === true,
|
|
2531
|
+
allowed: action === "init",
|
|
2532
|
+
message: "--declarative is only valid with --init/--scaffold."
|
|
2533
|
+
}
|
|
2534
|
+
];
|
|
2535
|
+
for (const guard of guards) {
|
|
2536
|
+
if (guard.triggered && !guard.allowed) {
|
|
2537
|
+
throw new PmCliError(guard.message, EXIT_CODE.USAGE);
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
function resolveNormalizedExtensionTarget(target, action, options) {
|
|
2542
|
+
const normalizedInput = target?.trim().toLowerCase();
|
|
2543
|
+
if (action === "doctor" && normalizedInput === "doctor") {
|
|
2544
|
+
return void 0;
|
|
2393
2545
|
}
|
|
2394
|
-
if (
|
|
2395
|
-
|
|
2546
|
+
if (action === "reload" && normalizedInput === "reload") {
|
|
2547
|
+
return void 0;
|
|
2396
2548
|
}
|
|
2397
|
-
if (
|
|
2398
|
-
|
|
2549
|
+
if (action === "catalog" && normalizedInput === "catalog") {
|
|
2550
|
+
return void 0;
|
|
2399
2551
|
}
|
|
2400
|
-
const
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
}
|
|
2411
|
-
const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
|
|
2412
|
-
if (inferredInitAlias) {
|
|
2413
|
-
return void 0;
|
|
2414
|
-
}
|
|
2415
|
-
return target;
|
|
2416
|
-
})();
|
|
2552
|
+
const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
|
|
2553
|
+
if (inferredInitAlias) {
|
|
2554
|
+
return void 0;
|
|
2555
|
+
}
|
|
2556
|
+
return target;
|
|
2557
|
+
}
|
|
2558
|
+
async function runExtension(target, options, global2) {
|
|
2559
|
+
const action = resolveAction(target, options);
|
|
2560
|
+
assertExtensionActionOptionScope(action, options);
|
|
2561
|
+
const normalizedTarget = resolveNormalizedExtensionTarget(target, action, options);
|
|
2417
2562
|
const scope = resolveScope(options);
|
|
2418
2563
|
const resolvedRoots = resolveExtensionRootsForScope(scope, global2);
|
|
2419
2564
|
const warnings = [];
|
|
@@ -2445,431 +2590,736 @@ async function runExtension(target, options, global2) {
|
|
|
2445
2590
|
}
|
|
2446
2591
|
return result;
|
|
2447
2592
|
};
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2593
|
+
const ctx = {
|
|
2594
|
+
action,
|
|
2595
|
+
normalizedTarget,
|
|
2596
|
+
scope,
|
|
2597
|
+
resolvedRoots,
|
|
2598
|
+
warnings,
|
|
2599
|
+
options,
|
|
2600
|
+
global: global2,
|
|
2601
|
+
withResult
|
|
2602
|
+
};
|
|
2603
|
+
return EXTENSION_ACTION_HANDLERS[action](ctx);
|
|
2604
|
+
}
|
|
2605
|
+
async function runExtensionInitAction(ctx) {
|
|
2606
|
+
const { action, normalizedTarget, options, withResult } = ctx;
|
|
2607
|
+
const githubOption = resolveGithubOption(options);
|
|
2608
|
+
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2609
|
+
throw new PmCliError('Action "init" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2610
|
+
}
|
|
2611
|
+
const scaffoldTarget = requireTarget(normalizedTarget, action, options);
|
|
2612
|
+
const scaffold = await scaffoldExtensionProject(scaffoldTarget, options.vocabulary ?? "extension", options.capability, options.declarative === true);
|
|
2613
|
+
const quotedTargetPath = JSON.stringify(scaffold.target_path);
|
|
2614
|
+
const quotedShellTargetPath = JSON.stringify(scaffold.target_path.replace(/\\/g, "/"));
|
|
2615
|
+
return withResult({
|
|
2616
|
+
scaffolded: scaffold.created_directory || scaffold.files.some((entry) => entry.status === "created"),
|
|
2617
|
+
extension: {
|
|
2618
|
+
name: scaffold.extension_name,
|
|
2619
|
+
command: scaffold.command_name
|
|
2620
|
+
},
|
|
2621
|
+
capability: scaffold.capability,
|
|
2622
|
+
style: scaffold.style,
|
|
2623
|
+
target_path: scaffold.target_path,
|
|
2624
|
+
created_directory: scaffold.created_directory,
|
|
2625
|
+
files: scaffold.files,
|
|
2626
|
+
next_steps: [
|
|
2627
|
+
// Extensions are authored AND loaded as TypeScript (ADR pm-2c28 / pm-m1uz):
|
|
2628
|
+
// the manifest entry is ./index.ts and pm strips types on load (Node
|
|
2629
|
+
// >=22.18), so there is no compile/build step — install dependencies, then
|
|
2630
|
+
// install the scaffold directly.
|
|
2631
|
+
...options.vocabulary === "package" ? [`Install dependencies: cd ${quotedShellTargetPath}, then run "npm install"`] : [
|
|
2632
|
+
`Install type-check dependencies: cd ${quotedShellTargetPath}, then run "npm install -D typescript @types/node @unbrained/pm-cli"`
|
|
2633
|
+
],
|
|
2634
|
+
`Install the scaffold: ${options.vocabulary === "package" ? "pm install --project" : "pm extension --install --project"} ${quotedTargetPath}`,
|
|
2635
|
+
`Smoke-test command path: pm ${scaffold.command_name}`,
|
|
2636
|
+
...options.vocabulary === "package" ? [`Validate the package: cd ${quotedShellTargetPath}, then run "npm run typecheck" and "npm test"`] : [`Type-check the source (optional): cd ${quotedShellTargetPath}, then run "npx tsc --noEmit"`],
|
|
2637
|
+
`Run diagnostics: ${options.vocabulary === "package" ? "pm package doctor" : "pm extension --doctor"} --project --detail summary`
|
|
2638
|
+
]
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
async function runExtensionReloadAction(ctx) {
|
|
2642
|
+
const { normalizedTarget, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
2643
|
+
if (normalizedTarget !== void 0) {
|
|
2644
|
+
throw new PmCliError('Action "reload" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2479
2645
|
}
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2646
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2647
|
+
const reloadToken = nextExtensionReloadToken();
|
|
2648
|
+
const reloaded = await loadExtensions({
|
|
2649
|
+
pmRoot: resolvedRoots.settings_root,
|
|
2650
|
+
settings,
|
|
2651
|
+
cwd: process.cwd(),
|
|
2652
|
+
noExtensions: global2.noExtensions,
|
|
2653
|
+
reload_token: reloadToken,
|
|
2654
|
+
cache_bust: true
|
|
2655
|
+
});
|
|
2656
|
+
warnings.push(...reloaded.warnings);
|
|
2657
|
+
const activation = await activateExtensions(reloaded);
|
|
2658
|
+
warnings.push(...activation.warnings);
|
|
2659
|
+
const details = {
|
|
2660
|
+
reload: {
|
|
2661
|
+
token: reloadToken,
|
|
2662
|
+
cache_bust: true,
|
|
2663
|
+
watch: options.watch === true
|
|
2664
|
+
},
|
|
2665
|
+
loaded_count: reloaded.loaded.length,
|
|
2666
|
+
failed_count: reloaded.failed.length,
|
|
2667
|
+
activated_count: Math.max(0, reloaded.loaded.length - activation.failed.length),
|
|
2668
|
+
activation_failed_count: activation.failed.length,
|
|
2669
|
+
loaded_extensions: reloaded.loaded.map((entry) => ({
|
|
2670
|
+
name: entry.name,
|
|
2671
|
+
layer: entry.layer,
|
|
2672
|
+
version: entry.version
|
|
2673
|
+
})),
|
|
2674
|
+
failed_extensions: reloaded.failed.map((entry) => ({
|
|
2675
|
+
name: entry.name,
|
|
2676
|
+
layer: entry.layer,
|
|
2677
|
+
error: entry.error
|
|
2678
|
+
})),
|
|
2679
|
+
activation_failures: activation.failed.map((entry) => ({
|
|
2680
|
+
name: entry.name,
|
|
2681
|
+
layer: entry.layer,
|
|
2682
|
+
error: entry.error
|
|
2683
|
+
}))
|
|
2684
|
+
};
|
|
2685
|
+
if (options.watch === true) {
|
|
2686
|
+
warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
|
|
2687
|
+
}
|
|
2688
|
+
return withResult(details);
|
|
2689
|
+
}
|
|
2690
|
+
async function runExtensionCatalogAction(ctx) {
|
|
2691
|
+
const { normalizedTarget, scope, options, global: global2, withResult } = ctx;
|
|
2692
|
+
if (typeof normalizedTarget === "string" && normalizedTarget.length > 0 && normalizedTarget !== "catalog") {
|
|
2693
|
+
throw new PmCliError('Action "catalog" does not accept a package target.', EXIT_CODE.USAGE);
|
|
2694
|
+
}
|
|
2695
|
+
return withResult(await buildBundledPackageCatalog(scope, global2, options));
|
|
2696
|
+
}
|
|
2697
|
+
function buildInstallManagedSource(bundledAliasName, installSource, resolvedSource) {
|
|
2698
|
+
if (bundledAliasName) {
|
|
2699
|
+
return {
|
|
2700
|
+
kind: "builtin",
|
|
2701
|
+
input: bundledAliasName,
|
|
2702
|
+
location: bundledAliasName,
|
|
2703
|
+
name: bundledAliasName
|
|
2522
2704
|
};
|
|
2523
|
-
if (options.watch === true) {
|
|
2524
|
-
warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
|
|
2525
|
-
}
|
|
2526
|
-
return withResult(details);
|
|
2527
2705
|
}
|
|
2528
|
-
if (
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2706
|
+
if (installSource.kind === "local") {
|
|
2707
|
+
return {
|
|
2708
|
+
kind: "local",
|
|
2709
|
+
input: installSource.input,
|
|
2710
|
+
location: installSource.absolute_path
|
|
2711
|
+
};
|
|
2533
2712
|
}
|
|
2534
|
-
if (
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2713
|
+
if (installSource.kind === "npm") {
|
|
2714
|
+
return {
|
|
2715
|
+
kind: "npm",
|
|
2716
|
+
input: installSource.input,
|
|
2717
|
+
location: resolvedSource.resolved_subpath ?? ".",
|
|
2718
|
+
package: resolvedSource.npm_package,
|
|
2719
|
+
version: resolvedSource.npm_version
|
|
2720
|
+
};
|
|
2721
|
+
}
|
|
2722
|
+
return {
|
|
2723
|
+
kind: "github",
|
|
2724
|
+
input: installSource.input,
|
|
2725
|
+
location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
|
|
2726
|
+
repository: installSource.repository,
|
|
2727
|
+
owner: installSource.owner,
|
|
2728
|
+
repo: installSource.repo,
|
|
2729
|
+
ref: installSource.ref,
|
|
2730
|
+
subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
|
|
2731
|
+
commit: resolvedSource.commit
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
async function performExtensionInstallUnderLock(ctx, input) {
|
|
2735
|
+
const { scope, resolvedRoots, warnings, global: global2, withResult } = ctx;
|
|
2736
|
+
const { validated, destinationDirectoryName, bundledAliasName, installSource, resolvedSource } = input;
|
|
2737
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2738
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2739
|
+
warnings.push(...managedStateRead.warnings);
|
|
2740
|
+
const destinationDirectory = path5.join(resolvedRoots.selected_root, destinationDirectoryName);
|
|
2741
|
+
const destinationExists = await pathExists(destinationDirectory);
|
|
2742
|
+
const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
|
|
2743
|
+
await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
|
|
2744
|
+
if (!installInPlace) {
|
|
2745
|
+
await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
|
|
2746
|
+
}
|
|
2747
|
+
const sourceRecord = buildInstallManagedSource(bundledAliasName, installSource, resolvedSource);
|
|
2748
|
+
const now = nowIso();
|
|
2749
|
+
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2750
|
+
const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
2751
|
+
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2752
|
+
name: validated.manifest.name,
|
|
2753
|
+
directory: destinationDirectoryName,
|
|
2754
|
+
scope,
|
|
2755
|
+
manifest_version: validated.manifest.version,
|
|
2756
|
+
manifest_entry: validated.manifest.entry,
|
|
2757
|
+
capabilities: [...validated.manifest.capabilities],
|
|
2758
|
+
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
2759
|
+
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
2760
|
+
source: sourceRecord
|
|
2761
|
+
});
|
|
2762
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2763
|
+
const activationChanged = ensureActivated(settings, validated.manifest.name);
|
|
2764
|
+
if (activationChanged) {
|
|
2765
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2766
|
+
}
|
|
2767
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2768
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2769
|
+
const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global2);
|
|
2770
|
+
warnings.push(...runtimeProbe.warnings);
|
|
2771
|
+
const installedItemTypeDefinitions = runtimeProbe.item_type_registrations.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)).flatMap((entry) => entry.types.map((type) => ({ name: type.name, folder: type.folder })));
|
|
2772
|
+
if (scope === "project" && installedItemTypeDefinitions.length > 0) {
|
|
2773
|
+
await ensureTypeFolderScaffold(resolvedRoots.pm_root, installedItemTypeDefinitions, warnings, "install:type-folder");
|
|
2774
|
+
}
|
|
2775
|
+
const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
|
|
2776
|
+
const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
|
|
2777
|
+
const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
|
|
2778
|
+
return withResult({
|
|
2779
|
+
extension: {
|
|
2780
|
+
name: validated.manifest.name,
|
|
2781
|
+
version: validated.manifest.version,
|
|
2782
|
+
entry: validated.manifest.entry,
|
|
2783
|
+
capabilities: validated.manifest.capabilities,
|
|
2784
|
+
directory: destinationDirectoryName
|
|
2785
|
+
},
|
|
2786
|
+
source: sourceRecord,
|
|
2787
|
+
destination_path: destinationDirectory,
|
|
2788
|
+
overwritten: destinationExists && !installInPlace,
|
|
2789
|
+
installed_in_place: installInPlace,
|
|
2790
|
+
activated: true,
|
|
2791
|
+
settings_changed: activationChanged,
|
|
2792
|
+
runtime_activation_status: runtimeActivationStatus,
|
|
2793
|
+
command_paths: commandSummary.command_paths,
|
|
2794
|
+
action_paths: commandSummary.action_paths,
|
|
2795
|
+
command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
|
|
2796
|
+
activation_diagnostics: {
|
|
2797
|
+
failed_count: runtimeProbe.activation_failures.length,
|
|
2798
|
+
failed: runtimeProbe.activation_failures,
|
|
2799
|
+
installed_extension_failed: installActivationFailure ?? null
|
|
2569
2800
|
}
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
const destinationExists = await pathExists(destinationDirectory);
|
|
2587
|
-
const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
|
|
2588
|
-
await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
|
|
2589
|
-
if (!installInPlace) {
|
|
2590
|
-
await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
|
|
2591
|
-
}
|
|
2592
|
-
const sourceRecord = bundledAliasName ? {
|
|
2593
|
-
kind: "builtin",
|
|
2594
|
-
input: bundledAliasName,
|
|
2595
|
-
location: bundledAliasName,
|
|
2596
|
-
name: bundledAliasName
|
|
2597
|
-
} : installSource.kind === "local" ? {
|
|
2598
|
-
kind: "local",
|
|
2599
|
-
input: installSource.input,
|
|
2600
|
-
location: installSource.absolute_path
|
|
2601
|
-
} : installSource.kind === "npm" ? {
|
|
2602
|
-
kind: "npm",
|
|
2603
|
-
input: installSource.input,
|
|
2604
|
-
location: resolvedSource.resolved_subpath ?? ".",
|
|
2605
|
-
package: resolvedSource.npm_package,
|
|
2606
|
-
version: resolvedSource.npm_version
|
|
2607
|
-
} : {
|
|
2608
|
-
kind: "github",
|
|
2609
|
-
input: installSource.input,
|
|
2610
|
-
location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
|
|
2611
|
-
repository: installSource.repository,
|
|
2612
|
-
owner: installSource.owner,
|
|
2613
|
-
repo: installSource.repo,
|
|
2614
|
-
ref: installSource.ref,
|
|
2615
|
-
subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
|
|
2616
|
-
commit: resolvedSource.commit
|
|
2617
|
-
};
|
|
2618
|
-
const now = nowIso();
|
|
2619
|
-
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2620
|
-
const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
2621
|
-
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2622
|
-
name: validated.manifest.name,
|
|
2623
|
-
directory: destinationDirectoryName,
|
|
2624
|
-
scope,
|
|
2625
|
-
manifest_version: validated.manifest.version,
|
|
2626
|
-
manifest_entry: validated.manifest.entry,
|
|
2627
|
-
capabilities: [...validated.manifest.capabilities],
|
|
2628
|
-
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
2629
|
-
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
2630
|
-
source: sourceRecord
|
|
2631
|
-
});
|
|
2632
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2633
|
-
const activationChanged = ensureActivated(settings, validated.manifest.name);
|
|
2634
|
-
if (activationChanged) {
|
|
2635
|
-
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
2636
|
-
}
|
|
2637
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2638
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2639
|
-
const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global2);
|
|
2640
|
-
warnings.push(...runtimeProbe.warnings);
|
|
2641
|
-
const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
|
|
2642
|
-
const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
|
|
2643
|
-
const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
|
|
2644
|
-
return withResult({
|
|
2645
|
-
extension: {
|
|
2646
|
-
name: validated.manifest.name,
|
|
2647
|
-
version: validated.manifest.version,
|
|
2648
|
-
entry: validated.manifest.entry,
|
|
2649
|
-
capabilities: validated.manifest.capabilities,
|
|
2650
|
-
directory: destinationDirectoryName
|
|
2651
|
-
},
|
|
2652
|
-
source: sourceRecord,
|
|
2653
|
-
destination_path: destinationDirectory,
|
|
2654
|
-
overwritten: destinationExists && !installInPlace,
|
|
2655
|
-
installed_in_place: installInPlace,
|
|
2656
|
-
activated: true,
|
|
2657
|
-
settings_changed: activationChanged,
|
|
2658
|
-
runtime_activation_status: runtimeActivationStatus,
|
|
2659
|
-
command_paths: commandSummary.command_paths,
|
|
2660
|
-
action_paths: commandSummary.action_paths,
|
|
2661
|
-
command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
|
|
2662
|
-
activation_diagnostics: {
|
|
2663
|
-
failed_count: runtimeProbe.activation_failures.length,
|
|
2664
|
-
failed: runtimeProbe.activation_failures,
|
|
2665
|
-
installed_extension_failed: installActivationFailure ?? null
|
|
2666
|
-
}
|
|
2667
|
-
});
|
|
2801
|
+
});
|
|
2802
|
+
}
|
|
2803
|
+
async function runExtensionInstallAction(ctx) {
|
|
2804
|
+
const { action, normalizedTarget, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
2805
|
+
const githubOption = resolveGithubOption(options);
|
|
2806
|
+
const explicitSourceInput = githubOption ?? requireTarget(normalizedTarget, action, options);
|
|
2807
|
+
if (typeof githubOption !== "string" && isBundledPackageInstallAllTarget(explicitSourceInput)) {
|
|
2808
|
+
if (typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2809
|
+
throw new PmCliError('Action "install all" does not accept --ref.', EXIT_CODE.USAGE);
|
|
2810
|
+
}
|
|
2811
|
+
const aliases = await listBundledPackageAliases();
|
|
2812
|
+
const packages = [];
|
|
2813
|
+
for (const alias of aliases) {
|
|
2814
|
+
packages.push({
|
|
2815
|
+
alias,
|
|
2816
|
+
result: await runExtension(alias, { ...options, install: true }, global2)
|
|
2668
2817
|
});
|
|
2669
|
-
} finally {
|
|
2670
|
-
if (resolvedSource.cleanup) {
|
|
2671
|
-
await resolvedSource.cleanup();
|
|
2672
|
-
}
|
|
2673
2818
|
}
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2678
|
-
}
|
|
2679
|
-
const githubOption = resolveGithubOption(options);
|
|
2680
|
-
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2681
|
-
throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2682
|
-
}
|
|
2683
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2684
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2685
|
-
warnings.push(...managedStateRead.warnings);
|
|
2686
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2687
|
-
warnings.push(...installed.warnings);
|
|
2688
|
-
const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
|
|
2689
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
|
|
2690
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2691
|
-
const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
|
|
2692
|
-
warnings.push(...triage.warnings);
|
|
2693
|
-
const adoptedDetails = adoption.adopted_entries.map((entry) => {
|
|
2694
|
-
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 */
|
|
2695
|
-
refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
|
|
2696
|
-
return {
|
|
2697
|
-
...entry,
|
|
2698
|
-
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2699
|
-
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2700
|
-
};
|
|
2701
|
-
});
|
|
2819
|
+
for (const entry of packages) {
|
|
2820
|
+
warnings.push(...entry.result.warnings);
|
|
2821
|
+
}
|
|
2702
2822
|
return withResult({
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2823
|
+
installed_all: true,
|
|
2824
|
+
installed_count: packages.length,
|
|
2825
|
+
packages: packages.map((entry) => ({
|
|
2826
|
+
alias: entry.alias,
|
|
2827
|
+
ok: entry.result.ok,
|
|
2828
|
+
extension: entry.result.details.extension,
|
|
2829
|
+
source: entry.result.details.source,
|
|
2830
|
+
destination_path: entry.result.details.destination_path,
|
|
2831
|
+
activated: entry.result.details.activated,
|
|
2832
|
+
settings_changed: entry.result.details.settings_changed,
|
|
2833
|
+
command_paths: entry.result.details.command_paths,
|
|
2834
|
+
action_paths: entry.result.details.action_paths,
|
|
2835
|
+
command_discovery: entry.result.details.command_discovery,
|
|
2836
|
+
warnings: entry.result.warnings
|
|
2837
|
+
}))
|
|
2711
2838
|
});
|
|
2712
2839
|
}
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
}
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2762
|
-
name: validated.manifest.name,
|
|
2763
|
-
directory: candidate.directory,
|
|
2764
|
-
scope,
|
|
2765
|
-
manifest_version: validated.manifest.version,
|
|
2766
|
-
manifest_entry: validated.manifest.entry,
|
|
2767
|
-
capabilities: [...validated.manifest.capabilities],
|
|
2768
|
-
installed_at: now,
|
|
2769
|
-
updated_at: now,
|
|
2770
|
-
source: sourceRecord
|
|
2771
|
-
});
|
|
2772
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2773
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2774
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
2775
|
-
const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
|
|
2776
|
-
return withResult({
|
|
2777
|
-
adopted: true,
|
|
2778
|
-
extension: {
|
|
2779
|
-
name: validated.manifest.name,
|
|
2780
|
-
directory: candidate.directory,
|
|
2781
|
-
version: validated.manifest.version,
|
|
2782
|
-
entry: validated.manifest.entry
|
|
2783
|
-
},
|
|
2784
|
-
source: sourceRecord,
|
|
2840
|
+
const bundledAliasSource = typeof githubOption === "string" ? null : await resolveBundledExtensionAliasSource(explicitSourceInput);
|
|
2841
|
+
const bundledAliasName = bundledAliasSource === null ? null : explicitSourceInput.trim().toLowerCase();
|
|
2842
|
+
const sourceInput = bundledAliasSource ?? explicitSourceInput;
|
|
2843
|
+
const installSource = parseExtensionInstallSource(sourceInput, {
|
|
2844
|
+
forceGithub: typeof githubOption === "string",
|
|
2845
|
+
ref: options.ref
|
|
2846
|
+
});
|
|
2847
|
+
const resolvedSource = await resolveInstallSource(installSource);
|
|
2848
|
+
try {
|
|
2849
|
+
const validated = await validateExtensionDirectory(resolvedSource.directory);
|
|
2850
|
+
const destinationDirectoryName = normalizeManagedDirectoryName(validated.manifest.name);
|
|
2851
|
+
return await withExtensionInstallLock(resolvedRoots.settings_root, destinationDirectoryName, () => performExtensionInstallUnderLock(ctx, {
|
|
2852
|
+
validated,
|
|
2853
|
+
destinationDirectoryName,
|
|
2854
|
+
bundledAliasName,
|
|
2855
|
+
installSource,
|
|
2856
|
+
resolvedSource
|
|
2857
|
+
}));
|
|
2858
|
+
} finally {
|
|
2859
|
+
if (resolvedSource.cleanup) {
|
|
2860
|
+
await resolvedSource.cleanup();
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
async function runExtensionAdoptAllAction(ctx) {
|
|
2865
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2866
|
+
if (normalizedTarget !== void 0) {
|
|
2867
|
+
throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
2868
|
+
}
|
|
2869
|
+
const githubOption = resolveGithubOption(options);
|
|
2870
|
+
if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
|
|
2871
|
+
throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
|
|
2872
|
+
}
|
|
2873
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2874
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2875
|
+
warnings.push(...managedStateRead.warnings);
|
|
2876
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2877
|
+
warnings.push(...installed.warnings);
|
|
2878
|
+
const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
|
|
2879
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
|
|
2880
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2881
|
+
const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
|
|
2882
|
+
warnings.push(...triage.warnings);
|
|
2883
|
+
const adoptedDetails = adoption.adopted_entries.map((entry) => {
|
|
2884
|
+
const refreshedEntry = refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.name) === normalizeExtensionNameForMatch(entry.name) && normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory)) ?? /* c8 ignore next 3 -- fallback only matters if a manifest renames between adopt and refresh */
|
|
2885
|
+
refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
|
|
2886
|
+
return {
|
|
2887
|
+
...entry,
|
|
2785
2888
|
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2786
2889
|
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2787
|
-
});
|
|
2788
|
-
}
|
|
2789
|
-
if (action === "uninstall") {
|
|
2790
|
-
const extensionTarget = requireTarget(normalizedTarget, action);
|
|
2791
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2792
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2793
|
-
warnings.push(...managedStateRead.warnings);
|
|
2794
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2795
|
-
warnings.push(...installed.warnings);
|
|
2796
|
-
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2797
|
-
if (!candidate) {
|
|
2798
|
-
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2799
|
-
}
|
|
2800
|
-
const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2801
|
-
await fs5.rm(destinationDirectory, { recursive: true, force: true });
|
|
2802
|
-
const updatedState = {
|
|
2803
|
-
...managedStateRead.state,
|
|
2804
|
-
updated_at: nowIso(),
|
|
2805
|
-
/* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
|
|
2806
|
-
entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
|
|
2807
|
-
/* c8 ignore stop */
|
|
2808
2890
|
};
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2891
|
+
});
|
|
2892
|
+
return withResult({
|
|
2893
|
+
adopted_all: adoptedDetails.length > 0,
|
|
2894
|
+
adopted_count: adoptedDetails.length,
|
|
2895
|
+
already_managed_count: adoption.already_managed_count,
|
|
2896
|
+
extensions: adoptedDetails,
|
|
2897
|
+
triage,
|
|
2898
|
+
warning_codes: triage.warning_codes,
|
|
2899
|
+
update_health_partial: triage.update_health_partial,
|
|
2900
|
+
update_health_coverage: triage.update_health_coverage
|
|
2901
|
+
});
|
|
2902
|
+
}
|
|
2903
|
+
async function runExtensionAdoptAction(ctx) {
|
|
2904
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2905
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2906
|
+
const githubOption = resolveGithubOption(options);
|
|
2907
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2908
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2909
|
+
warnings.push(...managedStateRead.warnings);
|
|
2910
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2911
|
+
warnings.push(...installed.warnings);
|
|
2912
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2913
|
+
if (!candidate) {
|
|
2914
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2915
|
+
}
|
|
2916
|
+
if (candidate.managed) {
|
|
2814
2917
|
return withResult({
|
|
2815
|
-
|
|
2918
|
+
adopted: false,
|
|
2919
|
+
already_managed: true,
|
|
2816
2920
|
extension: {
|
|
2817
2921
|
name: candidate.name,
|
|
2818
2922
|
directory: candidate.directory
|
|
2819
|
-
}
|
|
2820
|
-
destination_path: destinationDirectory,
|
|
2821
|
-
settings_changed: stateChanged
|
|
2923
|
+
}
|
|
2822
2924
|
});
|
|
2823
2925
|
}
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
if (
|
|
2837
|
-
|
|
2926
|
+
const extensionDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2927
|
+
const validated = await validateExtensionDirectory(extensionDirectory);
|
|
2928
|
+
const now = nowIso();
|
|
2929
|
+
const sourceRecord = githubOption === void 0 ? {
|
|
2930
|
+
kind: "local",
|
|
2931
|
+
input: extensionTarget,
|
|
2932
|
+
location: extensionDirectory
|
|
2933
|
+
} : (() => {
|
|
2934
|
+
const parsed = parseExtensionInstallSource(githubOption, {
|
|
2935
|
+
forceGithub: true,
|
|
2936
|
+
ref: options.ref
|
|
2937
|
+
});
|
|
2938
|
+
if (parsed.kind !== "github") {
|
|
2939
|
+
throw new PmCliError(`Invalid GitHub shorthand "${githubOption}".`, EXIT_CODE.USAGE);
|
|
2838
2940
|
}
|
|
2839
|
-
return
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2941
|
+
return {
|
|
2942
|
+
kind: "github",
|
|
2943
|
+
input: parsed.input,
|
|
2944
|
+
location: parsed.subpath ?? ".",
|
|
2945
|
+
repository: parsed.repository,
|
|
2946
|
+
owner: parsed.owner,
|
|
2947
|
+
repo: parsed.repo,
|
|
2948
|
+
ref: parsed.ref,
|
|
2949
|
+
subpath: parsed.subpath
|
|
2950
|
+
};
|
|
2951
|
+
})();
|
|
2952
|
+
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
2953
|
+
name: validated.manifest.name,
|
|
2954
|
+
directory: candidate.directory,
|
|
2955
|
+
scope,
|
|
2956
|
+
manifest_version: validated.manifest.version,
|
|
2957
|
+
manifest_entry: validated.manifest.entry,
|
|
2958
|
+
capabilities: [...validated.manifest.capabilities],
|
|
2959
|
+
installed_at: now,
|
|
2960
|
+
updated_at: now,
|
|
2961
|
+
source: sourceRecord
|
|
2962
|
+
});
|
|
2963
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
2964
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2965
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
2966
|
+
const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
|
|
2967
|
+
return withResult({
|
|
2968
|
+
adopted: true,
|
|
2969
|
+
extension: {
|
|
2970
|
+
name: validated.manifest.name,
|
|
2971
|
+
directory: candidate.directory,
|
|
2972
|
+
version: validated.manifest.version,
|
|
2973
|
+
entry: validated.manifest.entry
|
|
2974
|
+
},
|
|
2975
|
+
source: sourceRecord,
|
|
2976
|
+
update_check_status: refreshedEntry?.update_check_status ?? null,
|
|
2977
|
+
update_check_reason: refreshedEntry?.update_check_reason ?? null
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2980
|
+
async function runExtensionUninstallAction(ctx) {
|
|
2981
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
2982
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
2983
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2984
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2985
|
+
warnings.push(...managedStateRead.warnings);
|
|
2986
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2987
|
+
warnings.push(...installed.warnings);
|
|
2988
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
2989
|
+
if (!candidate) {
|
|
2990
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
2991
|
+
}
|
|
2992
|
+
const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
|
|
2993
|
+
await fs5.rm(destinationDirectory, { recursive: true, force: true });
|
|
2994
|
+
const updatedState = {
|
|
2995
|
+
...managedStateRead.state,
|
|
2996
|
+
updated_at: nowIso(),
|
|
2997
|
+
/* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
|
|
2998
|
+
entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
|
|
2999
|
+
/* c8 ignore stop */
|
|
3000
|
+
};
|
|
3001
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, updatedState);
|
|
3002
|
+
const stateChanged = clearExtensionState(settings, candidate.name);
|
|
3003
|
+
if (stateChanged) {
|
|
3004
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
3005
|
+
}
|
|
3006
|
+
return withResult({
|
|
3007
|
+
removed: true,
|
|
3008
|
+
extension: {
|
|
3009
|
+
name: candidate.name,
|
|
3010
|
+
directory: candidate.directory
|
|
3011
|
+
},
|
|
3012
|
+
destination_path: destinationDirectory,
|
|
3013
|
+
settings_changed: stateChanged
|
|
3014
|
+
});
|
|
3015
|
+
}
|
|
3016
|
+
async function runExtensionActivateDeactivateAction(ctx) {
|
|
3017
|
+
const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
|
|
3018
|
+
const extensionTarget = requireTarget(normalizedTarget, action, options);
|
|
3019
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3020
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3021
|
+
warnings.push(...managedStateRead.warnings);
|
|
3022
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3023
|
+
warnings.push(...installed.warnings);
|
|
3024
|
+
const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
|
|
3025
|
+
if (!candidate) {
|
|
3026
|
+
throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
|
|
3027
|
+
}
|
|
3028
|
+
const settingsChanged = action === "activate" ? ensureActivated(settings, candidate.name) : ensureDeactivated(settings, candidate.name);
|
|
3029
|
+
if (settingsChanged) {
|
|
3030
|
+
await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
|
|
3031
|
+
}
|
|
3032
|
+
return withResult({
|
|
3033
|
+
extension: {
|
|
3034
|
+
name: candidate.name,
|
|
3035
|
+
directory: candidate.directory
|
|
3036
|
+
},
|
|
3037
|
+
active: action === "activate",
|
|
3038
|
+
settings_changed: settingsChanged,
|
|
3039
|
+
settings: {
|
|
3040
|
+
enabled: [...settings.extensions.enabled],
|
|
3041
|
+
disabled: [...settings.extensions.disabled]
|
|
3042
|
+
}
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3045
|
+
function buildDoctorRemediation(baseRemediation, loadFailureCount, activationFailureCount, vocabulary, managedStateFix) {
|
|
3046
|
+
return [
|
|
3047
|
+
...new Set([
|
|
3048
|
+
...baseRemediation,
|
|
3049
|
+
/* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
|
|
3050
|
+
...loadFailureCount > 0 ? [
|
|
3051
|
+
vocabulary === "package" ? "Run pm package explore --project and pm package explore --global to inspect load failures." : "Run pm extension --explore --project and pm extension --explore --global to inspect load failures."
|
|
3052
|
+
] : [],
|
|
3053
|
+
...activationFailureCount > 0 ? [
|
|
3054
|
+
vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
|
|
3055
|
+
] : [],
|
|
3056
|
+
/* c8 ignore stop */
|
|
3057
|
+
...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
|
|
3058
|
+
].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
|
|
3059
|
+
];
|
|
3060
|
+
}
|
|
3061
|
+
async function runExtensionDoctorAction(ctx) {
|
|
3062
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
3063
|
+
if (normalizedTarget && normalizedTarget.trim().length > 0) {
|
|
3064
|
+
throw new PmCliError('Action "doctor" does not accept a target argument.', EXIT_CODE.USAGE);
|
|
3065
|
+
}
|
|
3066
|
+
const detailMode = parseDoctorDetailMode(options.detail);
|
|
3067
|
+
const includeTrace = options.trace === true;
|
|
3068
|
+
if (includeTrace && detailMode !== "deep") {
|
|
3069
|
+
throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
|
|
3070
|
+
}
|
|
3071
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3072
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3073
|
+
warnings.push(...managedStateRead.warnings);
|
|
3074
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3075
|
+
warnings.push(...installed.warnings);
|
|
3076
|
+
let managedState = managedStateRead.state;
|
|
3077
|
+
const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3078
|
+
if (managedStateFix) {
|
|
3079
|
+
managedState = managedStateFix.state;
|
|
3080
|
+
}
|
|
3081
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3082
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
3083
|
+
const loadResult = await loadExtensions({
|
|
3084
|
+
pmRoot: resolvedRoots.pm_root,
|
|
3085
|
+
settings,
|
|
3086
|
+
cwd: process.cwd(),
|
|
3087
|
+
noExtensions: global2.noExtensions === true
|
|
3088
|
+
});
|
|
3089
|
+
const activationResult = await activateExtensions({
|
|
3090
|
+
...loadResult,
|
|
3091
|
+
loaded: loadResult.loaded
|
|
3092
|
+
});
|
|
3093
|
+
warnings.push(...loadResult.warnings);
|
|
3094
|
+
warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
|
|
3095
|
+
warnings.push(...activationResult.warnings);
|
|
3096
|
+
warnings.push(...classifyDoctorActivationFailureWarnings(activationResult.failed));
|
|
3097
|
+
warnings.push(...classifyUnusedCapabilityWarnings(loadResult, activationResult));
|
|
3098
|
+
warnings.push(...collectGlobalOutputOverrideDoctorWarnings(activationResult));
|
|
3099
|
+
warnings.push(...collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResult));
|
|
3100
|
+
const runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3101
|
+
const doctorConsistency = buildDoctorConsistencySummary(scope, runtimeInstalledExtensions, loadResult.loaded.map((entry) => ({ layer: entry.layer, name: entry.name })), loadResult.failed.map((entry) => ({ name: entry.name })), loadResult.disabled_by_flag);
|
|
3102
|
+
warnings.push(...doctorConsistency.warnings);
|
|
3103
|
+
const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3104
|
+
warnings.push(...updateCheckWarnings);
|
|
3105
|
+
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3106
|
+
warnings.push(...triage.warnings);
|
|
3107
|
+
const normalizedWarnings = [...triage.warnings];
|
|
3108
|
+
const policySummary = {
|
|
3109
|
+
mode: loadResult.policy.mode,
|
|
3110
|
+
trust_mode: loadResult.policy.trust_mode,
|
|
3111
|
+
require_provenance: loadResult.policy.require_provenance,
|
|
3112
|
+
default_sandbox_profile: loadResult.policy.default_sandbox_profile,
|
|
3113
|
+
// Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
|
|
3114
|
+
sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
|
|
3115
|
+
trusted_extensions_count: loadResult.policy.trusted_extensions.length,
|
|
3116
|
+
allowed_extensions_count: loadResult.policy.allowed_extensions.length,
|
|
3117
|
+
blocked_extensions_count: loadResult.policy.blocked_extensions.length,
|
|
3118
|
+
allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
|
|
3119
|
+
blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
|
|
3120
|
+
allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
|
|
3121
|
+
blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
|
|
3122
|
+
allowed_commands_count: loadResult.policy.allowed_commands.length,
|
|
3123
|
+
blocked_commands_count: loadResult.policy.blocked_commands.length,
|
|
3124
|
+
allowed_actions_count: loadResult.policy.allowed_actions.length,
|
|
3125
|
+
blocked_actions_count: loadResult.policy.blocked_actions.length,
|
|
3126
|
+
allowed_services_count: loadResult.policy.allowed_services.length,
|
|
3127
|
+
blocked_services_count: loadResult.policy.blocked_services.length,
|
|
3128
|
+
extension_override_count: loadResult.policy.extension_overrides.length
|
|
3129
|
+
};
|
|
3130
|
+
const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
|
|
3131
|
+
const capabilityContract = buildCapabilityContractMetadata();
|
|
3132
|
+
const warningCodes = triage.warning_codes;
|
|
3133
|
+
const remediation = buildDoctorRemediation(triage.remediation, loadResult.failed.length, activationResult.failed.length, options.vocabulary, managedStateFix);
|
|
3134
|
+
const summary = {
|
|
3135
|
+
status: triage.status,
|
|
3136
|
+
scope,
|
|
3137
|
+
warning_count: triage.warning_count,
|
|
3138
|
+
warning_codes: warningCodes,
|
|
3139
|
+
total_extensions: runtimeInstalledExtensions.length,
|
|
3140
|
+
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3141
|
+
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3142
|
+
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3143
|
+
unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
|
|
3144
|
+
unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
|
|
3145
|
+
unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
|
|
3146
|
+
runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
|
|
3147
|
+
activation_status_totals: {
|
|
3148
|
+
ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
|
|
3149
|
+
failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
|
|
3150
|
+
not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
|
|
3151
|
+
unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
|
|
3152
|
+
},
|
|
3153
|
+
unknown_capability_count: capabilityGuidance.length,
|
|
3154
|
+
capability_contract_version: capabilityContract.version,
|
|
3155
|
+
update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
|
|
3156
|
+
update_health_coverage: triage.update_health_coverage,
|
|
3157
|
+
update_health_partial: triage.update_health_partial,
|
|
3158
|
+
update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
|
|
3159
|
+
load_failure_count: loadResult.failed.length,
|
|
3160
|
+
activation_failure_count: activationResult.failed.length,
|
|
3161
|
+
blocking_failure_count: loadResult.failed.length + activationResult.failed.length,
|
|
3162
|
+
has_blocking_failures: loadResult.failed.length + activationResult.failed.length > 0,
|
|
3163
|
+
consistency_warning_count: doctorConsistency.warnings.length,
|
|
3164
|
+
trace_enabled: includeTrace,
|
|
3165
|
+
policy: policySummary,
|
|
3166
|
+
remediation
|
|
3167
|
+
};
|
|
3168
|
+
const managedStateFixSummary = managedStateFix ? {
|
|
3169
|
+
requested: true,
|
|
3170
|
+
applied: managedStateFix.adopted_entries.length > 0,
|
|
3171
|
+
adopted_count: managedStateFix.adopted_entries.length,
|
|
3172
|
+
already_managed_count: managedStateFix.already_managed_count,
|
|
3173
|
+
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name)
|
|
3174
|
+
} : {
|
|
3175
|
+
requested: false,
|
|
3176
|
+
applied: false,
|
|
3177
|
+
adopted_count: 0,
|
|
3178
|
+
already_managed_count: refreshedInstalled.extensions.filter((entry) => entry.managed).length,
|
|
3179
|
+
adopted_extensions: []
|
|
3180
|
+
};
|
|
3181
|
+
const details = {
|
|
3182
|
+
mode: detailMode,
|
|
3183
|
+
summary,
|
|
3184
|
+
triage,
|
|
3185
|
+
trace_enabled: includeTrace,
|
|
3186
|
+
capability_contract: capabilityContract,
|
|
3187
|
+
capability_guidance: capabilityGuidance,
|
|
3188
|
+
managed_state_fix: managedStateFixSummary,
|
|
3189
|
+
policy: loadResult.policy
|
|
3190
|
+
};
|
|
3191
|
+
if (detailMode === "deep") {
|
|
3192
|
+
const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
|
|
3193
|
+
const { trace: _trace, ...rest } = entry;
|
|
3194
|
+
return rest;
|
|
3195
|
+
});
|
|
3196
|
+
details.deep = {
|
|
3197
|
+
warnings: normalizedWarnings,
|
|
3198
|
+
warning_codes: warningCodes,
|
|
3199
|
+
capability_contract: capabilityContract,
|
|
3200
|
+
capability_guidance: capabilityGuidance,
|
|
3201
|
+
trace_enabled: includeTrace,
|
|
3202
|
+
managed_state: {
|
|
3203
|
+
path: managedStateRead.path,
|
|
3204
|
+
count: managedState.entries.length,
|
|
3205
|
+
entries: managedState.entries
|
|
2843
3206
|
},
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
3207
|
+
installed_extensions: runtimeInstalledExtensions,
|
|
3208
|
+
load: {
|
|
3209
|
+
roots: loadResult.roots,
|
|
3210
|
+
policy: loadResult.policy,
|
|
3211
|
+
warnings: loadResult.warnings,
|
|
3212
|
+
failed: loadResult.failed,
|
|
3213
|
+
loaded: loadResult.loaded.map((entry) => ({
|
|
3214
|
+
layer: entry.layer,
|
|
3215
|
+
directory: entry.directory,
|
|
3216
|
+
name: entry.name,
|
|
3217
|
+
version: entry.version,
|
|
3218
|
+
entry: entry.entry,
|
|
3219
|
+
priority: entry.priority
|
|
3220
|
+
}))
|
|
3221
|
+
},
|
|
3222
|
+
activation: {
|
|
3223
|
+
failed: activationFailedDetails,
|
|
3224
|
+
warnings: activationResult.warnings,
|
|
3225
|
+
hook_counts: activationResult.hook_counts,
|
|
3226
|
+
registration_counts: activationResult.registration_counts,
|
|
3227
|
+
parser_override_count: activationResult.parser_override_count,
|
|
3228
|
+
preflight_override_count: activationResult.preflight_override_count,
|
|
3229
|
+
service_override_count: activationResult.service_override_count,
|
|
3230
|
+
renderer_override_count: activationResult.renderer_override_count
|
|
3231
|
+
},
|
|
3232
|
+
consistency: doctorConsistency.summary
|
|
3233
|
+
};
|
|
3234
|
+
if (includeTrace) {
|
|
3235
|
+
details.deep.trace = {
|
|
3236
|
+
activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
|
|
3237
|
+
layer: entry.layer,
|
|
3238
|
+
name: entry.name,
|
|
3239
|
+
entry_path: entry.entry_path,
|
|
3240
|
+
error: entry.error,
|
|
3241
|
+
method: entry.trace?.method,
|
|
3242
|
+
command: entry.trace?.command,
|
|
3243
|
+
capability: entry.trace?.capability,
|
|
3244
|
+
missing_capability: entry.trace?.missing_capability,
|
|
3245
|
+
registration_index: entry.trace?.registration_index,
|
|
3246
|
+
expected_schema: entry.trace?.expected_schema,
|
|
3247
|
+
hint: entry.trace?.hint,
|
|
3248
|
+
received: entry.trace?.received
|
|
3249
|
+
}))
|
|
3250
|
+
};
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
return withResult(details);
|
|
3254
|
+
}
|
|
3255
|
+
async function runExtensionDescribeAction(ctx) {
|
|
3256
|
+
const { normalizedTarget, scope, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
3257
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3258
|
+
const loadResult = await loadExtensions({
|
|
3259
|
+
pmRoot: resolvedRoots.pm_root,
|
|
3260
|
+
settings,
|
|
3261
|
+
cwd: process.cwd(),
|
|
3262
|
+
noExtensions: global2.noExtensions === true
|
|
3263
|
+
});
|
|
3264
|
+
const activationResult = await activateExtensions(loadResult);
|
|
3265
|
+
warnings.push(...loadResult.warnings);
|
|
3266
|
+
warnings.push(...activationResult.warnings);
|
|
3267
|
+
const describeResult = buildExtensionDescribeResult(normalizedTarget, loadResult, activationResult);
|
|
3268
|
+
if (normalizedTarget !== void 0 && describeResult.extensions.length === 0) {
|
|
3269
|
+
const noun = options.vocabulary === "package" ? "package" : "extension";
|
|
3270
|
+
throw new PmCliError(`No loaded ${noun} named "${normalizedTarget}" was found in ${scope} scope. Run pm ${noun} explore to list discovered ${noun}s.`, EXIT_CODE.NOT_FOUND);
|
|
3271
|
+
}
|
|
3272
|
+
return withResult({
|
|
3273
|
+
target: describeResult.target,
|
|
3274
|
+
total: describeResult.total,
|
|
3275
|
+
extensions: describeResult.extensions,
|
|
3276
|
+
union: describeResult.union
|
|
3277
|
+
});
|
|
3278
|
+
}
|
|
3279
|
+
async function runExtensionExploreManageAction(ctx) {
|
|
3280
|
+
const { action, scope, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
|
|
3281
|
+
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3282
|
+
const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
|
|
3283
|
+
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3284
|
+
warnings.push(...managedStateRead.warnings);
|
|
3285
|
+
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3286
|
+
warnings.push(...installed.warnings);
|
|
3287
|
+
let managedState = managedStateRead.state;
|
|
3288
|
+
const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3289
|
+
if (managedStateFix) {
|
|
3290
|
+
managedState = managedStateFix.state;
|
|
3291
|
+
}
|
|
3292
|
+
if (action === "manage") {
|
|
3293
|
+
const updates = await Promise.all(managedState.entries.map(async (entry) => {
|
|
3294
|
+
if (entry.source.kind !== "github") {
|
|
3295
|
+
return entry;
|
|
2849
3296
|
}
|
|
2850
|
-
|
|
3297
|
+
const updateStatus = await checkGithubUpdate(entry.source);
|
|
3298
|
+
return {
|
|
3299
|
+
...entry,
|
|
3300
|
+
last_update_check_at: updateStatus.checked_at,
|
|
3301
|
+
last_update_remote_commit: updateStatus.remote_commit,
|
|
3302
|
+
update_available: updateStatus.available,
|
|
3303
|
+
update_error: updateStatus.error
|
|
3304
|
+
};
|
|
3305
|
+
}));
|
|
3306
|
+
managedState = {
|
|
3307
|
+
...managedState,
|
|
3308
|
+
updated_at: nowIso(),
|
|
3309
|
+
entries: sortManagedEntries(updates)
|
|
3310
|
+
};
|
|
3311
|
+
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
3312
|
+
}
|
|
3313
|
+
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3314
|
+
warnings.push(...refreshedInstalled.warnings);
|
|
3315
|
+
if (action === "manage") {
|
|
3316
|
+
const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3317
|
+
warnings.push(...updateWarnings);
|
|
2851
3318
|
}
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
const detailMode = parseDoctorDetailMode(options.detail);
|
|
2857
|
-
const includeTrace = options.trace === true;
|
|
2858
|
-
if (includeTrace && detailMode !== "deep") {
|
|
2859
|
-
throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
|
|
2860
|
-
}
|
|
2861
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
2862
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
2863
|
-
warnings.push(...managedStateRead.warnings);
|
|
2864
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
2865
|
-
warnings.push(...installed.warnings);
|
|
2866
|
-
let managedState = managedStateRead.state;
|
|
2867
|
-
const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
2868
|
-
if (managedStateFix) {
|
|
2869
|
-
managedState = managedStateFix.state;
|
|
2870
|
-
}
|
|
2871
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
2872
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
3319
|
+
let runtimeProbeSummary;
|
|
3320
|
+
let runtimeInstalledExtensions = refreshedInstalled.extensions;
|
|
3321
|
+
let runtimeActivationFailures;
|
|
3322
|
+
if (action === "explore" || options.runtimeProbe === true) {
|
|
2873
3323
|
const loadResult = await loadExtensions({
|
|
2874
3324
|
pmRoot: resolvedRoots.pm_root,
|
|
2875
3325
|
settings,
|
|
@@ -2881,314 +3331,77 @@ async function runExtension(target, options, global2) {
|
|
|
2881
3331
|
loaded: loadResult.loaded
|
|
2882
3332
|
});
|
|
2883
3333
|
warnings.push(...loadResult.warnings);
|
|
2884
|
-
warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
|
|
2885
3334
|
warnings.push(...activationResult.warnings);
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
2893
|
-
warnings.push(...updateCheckWarnings);
|
|
2894
|
-
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
2895
|
-
warnings.push(...triage.warnings);
|
|
2896
|
-
const normalizedWarnings = [...triage.warnings];
|
|
2897
|
-
const policySummary = {
|
|
2898
|
-
mode: loadResult.policy.mode,
|
|
2899
|
-
trust_mode: loadResult.policy.trust_mode,
|
|
2900
|
-
require_provenance: loadResult.policy.require_provenance,
|
|
2901
|
-
default_sandbox_profile: loadResult.policy.default_sandbox_profile,
|
|
2902
|
-
// Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
|
|
2903
|
-
sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
|
|
2904
|
-
trusted_extensions_count: loadResult.policy.trusted_extensions.length,
|
|
2905
|
-
allowed_extensions_count: loadResult.policy.allowed_extensions.length,
|
|
2906
|
-
blocked_extensions_count: loadResult.policy.blocked_extensions.length,
|
|
2907
|
-
allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
|
|
2908
|
-
blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
|
|
2909
|
-
allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
|
|
2910
|
-
blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
|
|
2911
|
-
allowed_commands_count: loadResult.policy.allowed_commands.length,
|
|
2912
|
-
blocked_commands_count: loadResult.policy.blocked_commands.length,
|
|
2913
|
-
allowed_actions_count: loadResult.policy.allowed_actions.length,
|
|
2914
|
-
blocked_actions_count: loadResult.policy.blocked_actions.length,
|
|
2915
|
-
allowed_services_count: loadResult.policy.allowed_services.length,
|
|
2916
|
-
blocked_services_count: loadResult.policy.blocked_services.length,
|
|
2917
|
-
extension_override_count: loadResult.policy.extension_overrides.length
|
|
2918
|
-
};
|
|
2919
|
-
const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
|
|
2920
|
-
const capabilityContract = buildCapabilityContractMetadata();
|
|
2921
|
-
const warningCodes = triage.warning_codes;
|
|
2922
|
-
const remediation = [
|
|
2923
|
-
...new Set([
|
|
2924
|
-
...triage.remediation,
|
|
2925
|
-
/* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
|
|
2926
|
-
...loadResult.failed.length > 0 ? [
|
|
2927
|
-
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."
|
|
2928
|
-
] : [],
|
|
2929
|
-
...activationResult.failed.length > 0 ? [
|
|
2930
|
-
options.vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
|
|
2931
|
-
] : [],
|
|
2932
|
-
/* c8 ignore stop */
|
|
2933
|
-
...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
|
|
2934
|
-
].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
|
|
2935
|
-
];
|
|
2936
|
-
const summary = {
|
|
2937
|
-
status: triage.status,
|
|
2938
|
-
scope,
|
|
2939
|
-
warning_count: triage.warning_count,
|
|
2940
|
-
warning_codes: warningCodes,
|
|
2941
|
-
total_extensions: runtimeInstalledExtensions.length,
|
|
2942
|
-
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
2943
|
-
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
2944
|
-
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
2945
|
-
unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
|
|
2946
|
-
unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
|
|
2947
|
-
unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
|
|
2948
|
-
runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
|
|
2949
|
-
activation_status_totals: {
|
|
2950
|
-
ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
|
|
2951
|
-
failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
|
|
2952
|
-
not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
|
|
2953
|
-
unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
|
|
2954
|
-
},
|
|
2955
|
-
unknown_capability_count: capabilityGuidance.length,
|
|
2956
|
-
capability_contract_version: capabilityContract.version,
|
|
2957
|
-
update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
|
|
2958
|
-
update_health_coverage: triage.update_health_coverage,
|
|
2959
|
-
update_health_partial: triage.update_health_partial,
|
|
2960
|
-
update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
|
|
3335
|
+
runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3336
|
+
runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
|
|
3337
|
+
runtimeProbeSummary = {
|
|
3338
|
+
requested: true,
|
|
3339
|
+
executed: true,
|
|
3340
|
+
reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
|
|
2961
3341
|
load_failure_count: loadResult.failed.length,
|
|
2962
3342
|
activation_failure_count: activationResult.failed.length,
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
consistency_warning_count: doctorConsistency.warnings.length,
|
|
2966
|
-
trace_enabled: includeTrace,
|
|
2967
|
-
policy: policySummary,
|
|
2968
|
-
remediation
|
|
3343
|
+
warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
|
|
3344
|
+
policy: loadResult.policy
|
|
2969
3345
|
};
|
|
2970
|
-
|
|
3346
|
+
} else if (action === "manage") {
|
|
3347
|
+
runtimeProbeSummary = {
|
|
3348
|
+
requested: false,
|
|
3349
|
+
executed: false
|
|
3350
|
+
};
|
|
3351
|
+
}
|
|
3352
|
+
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3353
|
+
warnings.push(...triage.warnings);
|
|
3354
|
+
const details = {
|
|
3355
|
+
total: runtimeInstalledExtensions.length,
|
|
3356
|
+
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3357
|
+
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3358
|
+
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3359
|
+
extensions: runtimeInstalledExtensions,
|
|
3360
|
+
triage,
|
|
3361
|
+
policy: configuredPolicy
|
|
3362
|
+
};
|
|
3363
|
+
if (runtimeActivationFailures !== void 0) {
|
|
3364
|
+
details.activation_diagnostics = {
|
|
3365
|
+
failed_count: runtimeActivationFailures.length,
|
|
3366
|
+
failed: runtimeActivationFailures
|
|
3367
|
+
};
|
|
3368
|
+
}
|
|
3369
|
+
if (action === "explore") {
|
|
3370
|
+
details.runtime_probe = runtimeProbeSummary;
|
|
3371
|
+
}
|
|
3372
|
+
if (action === "manage") {
|
|
3373
|
+
details.runtime_probe = runtimeProbeSummary;
|
|
3374
|
+
details.managed_state_fix = managedStateFix !== null ? {
|
|
2971
3375
|
requested: true,
|
|
2972
3376
|
applied: managedStateFix.adopted_entries.length > 0,
|
|
2973
3377
|
adopted_count: managedStateFix.adopted_entries.length,
|
|
2974
|
-
|
|
2975
|
-
|
|
3378
|
+
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
|
|
3379
|
+
already_managed_count: managedStateFix.already_managed_count
|
|
2976
3380
|
} : {
|
|
2977
3381
|
requested: false,
|
|
2978
3382
|
applied: false,
|
|
2979
3383
|
adopted_count: 0,
|
|
2980
|
-
|
|
2981
|
-
|
|
3384
|
+
adopted_extensions: [],
|
|
3385
|
+
already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
|
|
2982
3386
|
};
|
|
2983
|
-
const details = {
|
|
2984
|
-
mode: detailMode,
|
|
2985
|
-
summary,
|
|
2986
|
-
triage,
|
|
2987
|
-
trace_enabled: includeTrace,
|
|
2988
|
-
capability_contract: capabilityContract,
|
|
2989
|
-
capability_guidance: capabilityGuidance,
|
|
2990
|
-
managed_state_fix: managedStateFixSummary,
|
|
2991
|
-
policy: loadResult.policy
|
|
2992
|
-
};
|
|
2993
|
-
if (detailMode === "deep") {
|
|
2994
|
-
const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
|
|
2995
|
-
const { trace: _trace, ...rest } = entry;
|
|
2996
|
-
return rest;
|
|
2997
|
-
});
|
|
2998
|
-
details.deep = {
|
|
2999
|
-
warnings: normalizedWarnings,
|
|
3000
|
-
warning_codes: warningCodes,
|
|
3001
|
-
capability_contract: capabilityContract,
|
|
3002
|
-
capability_guidance: capabilityGuidance,
|
|
3003
|
-
trace_enabled: includeTrace,
|
|
3004
|
-
managed_state: {
|
|
3005
|
-
path: managedStateRead.path,
|
|
3006
|
-
count: managedState.entries.length,
|
|
3007
|
-
entries: managedState.entries
|
|
3008
|
-
},
|
|
3009
|
-
installed_extensions: runtimeInstalledExtensions,
|
|
3010
|
-
load: {
|
|
3011
|
-
roots: loadResult.roots,
|
|
3012
|
-
policy: loadResult.policy,
|
|
3013
|
-
warnings: loadResult.warnings,
|
|
3014
|
-
failed: loadResult.failed,
|
|
3015
|
-
loaded: loadResult.loaded.map((entry) => ({
|
|
3016
|
-
layer: entry.layer,
|
|
3017
|
-
directory: entry.directory,
|
|
3018
|
-
name: entry.name,
|
|
3019
|
-
version: entry.version,
|
|
3020
|
-
entry: entry.entry,
|
|
3021
|
-
priority: entry.priority
|
|
3022
|
-
}))
|
|
3023
|
-
},
|
|
3024
|
-
activation: {
|
|
3025
|
-
failed: activationFailedDetails,
|
|
3026
|
-
warnings: activationResult.warnings,
|
|
3027
|
-
hook_counts: activationResult.hook_counts,
|
|
3028
|
-
registration_counts: activationResult.registration_counts,
|
|
3029
|
-
parser_override_count: activationResult.parser_override_count,
|
|
3030
|
-
preflight_override_count: activationResult.preflight_override_count,
|
|
3031
|
-
service_override_count: activationResult.service_override_count,
|
|
3032
|
-
renderer_override_count: activationResult.renderer_override_count
|
|
3033
|
-
},
|
|
3034
|
-
consistency: doctorConsistency.summary
|
|
3035
|
-
};
|
|
3036
|
-
if (includeTrace) {
|
|
3037
|
-
details.deep.trace = {
|
|
3038
|
-
activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
|
|
3039
|
-
layer: entry.layer,
|
|
3040
|
-
name: entry.name,
|
|
3041
|
-
entry_path: entry.entry_path,
|
|
3042
|
-
error: entry.error,
|
|
3043
|
-
method: entry.trace?.method,
|
|
3044
|
-
command: entry.trace?.command,
|
|
3045
|
-
capability: entry.trace?.capability,
|
|
3046
|
-
missing_capability: entry.trace?.missing_capability,
|
|
3047
|
-
registration_index: entry.trace?.registration_index,
|
|
3048
|
-
expected_schema: entry.trace?.expected_schema,
|
|
3049
|
-
hint: entry.trace?.hint,
|
|
3050
|
-
received: entry.trace?.received
|
|
3051
|
-
}))
|
|
3052
|
-
};
|
|
3053
|
-
}
|
|
3054
|
-
}
|
|
3055
|
-
return withResult(details);
|
|
3056
3387
|
}
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
target: describeResult.target,
|
|
3075
|
-
total: describeResult.total,
|
|
3076
|
-
extensions: describeResult.extensions,
|
|
3077
|
-
union: describeResult.union
|
|
3078
|
-
});
|
|
3079
|
-
}
|
|
3080
|
-
if (action === "explore" || action === "manage") {
|
|
3081
|
-
const settings = await readSettings(resolvedRoots.settings_root);
|
|
3082
|
-
const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
|
|
3083
|
-
const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
|
|
3084
|
-
warnings.push(...managedStateRead.warnings);
|
|
3085
|
-
const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
|
|
3086
|
-
warnings.push(...installed.warnings);
|
|
3087
|
-
let managedState = managedStateRead.state;
|
|
3088
|
-
const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
|
|
3089
|
-
if (managedStateFix) {
|
|
3090
|
-
managedState = managedStateFix.state;
|
|
3091
|
-
}
|
|
3092
|
-
if (action === "manage") {
|
|
3093
|
-
const updates = await Promise.all(managedState.entries.map(async (entry) => {
|
|
3094
|
-
if (entry.source.kind !== "github") {
|
|
3095
|
-
return entry;
|
|
3096
|
-
}
|
|
3097
|
-
const updateStatus = await checkGithubUpdate(entry.source);
|
|
3098
|
-
return {
|
|
3099
|
-
...entry,
|
|
3100
|
-
last_update_check_at: updateStatus.checked_at,
|
|
3101
|
-
last_update_remote_commit: updateStatus.remote_commit,
|
|
3102
|
-
update_available: updateStatus.available,
|
|
3103
|
-
update_error: updateStatus.error
|
|
3104
|
-
};
|
|
3105
|
-
}));
|
|
3106
|
-
managedState = {
|
|
3107
|
-
...managedState,
|
|
3108
|
-
updated_at: nowIso(),
|
|
3109
|
-
entries: sortManagedEntries(updates)
|
|
3110
|
-
};
|
|
3111
|
-
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
3112
|
-
}
|
|
3113
|
-
const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
|
|
3114
|
-
warnings.push(...refreshedInstalled.warnings);
|
|
3115
|
-
if (action === "manage") {
|
|
3116
|
-
const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
|
|
3117
|
-
warnings.push(...updateWarnings);
|
|
3118
|
-
}
|
|
3119
|
-
let runtimeProbeSummary;
|
|
3120
|
-
let runtimeInstalledExtensions = refreshedInstalled.extensions;
|
|
3121
|
-
let runtimeActivationFailures;
|
|
3122
|
-
if (action === "explore" || options.runtimeProbe === true) {
|
|
3123
|
-
const loadResult = await loadExtensions({
|
|
3124
|
-
pmRoot: resolvedRoots.pm_root,
|
|
3125
|
-
settings,
|
|
3126
|
-
cwd: process.cwd(),
|
|
3127
|
-
noExtensions: global2.noExtensions === true
|
|
3128
|
-
});
|
|
3129
|
-
const activationResult = await activateExtensions({
|
|
3130
|
-
...loadResult,
|
|
3131
|
-
loaded: loadResult.loaded
|
|
3132
|
-
});
|
|
3133
|
-
warnings.push(...loadResult.warnings);
|
|
3134
|
-
warnings.push(...activationResult.warnings);
|
|
3135
|
-
runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
|
|
3136
|
-
runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
|
|
3137
|
-
runtimeProbeSummary = {
|
|
3138
|
-
requested: true,
|
|
3139
|
-
executed: true,
|
|
3140
|
-
reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
|
|
3141
|
-
load_failure_count: loadResult.failed.length,
|
|
3142
|
-
activation_failure_count: activationResult.failed.length,
|
|
3143
|
-
warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
|
|
3144
|
-
policy: loadResult.policy
|
|
3145
|
-
};
|
|
3146
|
-
} else if (action === "manage") {
|
|
3147
|
-
runtimeProbeSummary = {
|
|
3148
|
-
requested: false,
|
|
3149
|
-
executed: false
|
|
3150
|
-
};
|
|
3151
|
-
}
|
|
3152
|
-
const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
|
|
3153
|
-
warnings.push(...triage.warnings);
|
|
3154
|
-
const details = {
|
|
3155
|
-
total: runtimeInstalledExtensions.length,
|
|
3156
|
-
managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
|
|
3157
|
-
enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
|
|
3158
|
-
active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
|
|
3159
|
-
extensions: runtimeInstalledExtensions,
|
|
3160
|
-
triage,
|
|
3161
|
-
policy: configuredPolicy
|
|
3162
|
-
};
|
|
3163
|
-
if (runtimeActivationFailures !== void 0) {
|
|
3164
|
-
details.activation_diagnostics = {
|
|
3165
|
-
failed_count: runtimeActivationFailures.length,
|
|
3166
|
-
failed: runtimeActivationFailures
|
|
3167
|
-
};
|
|
3168
|
-
}
|
|
3169
|
-
if (action === "explore") {
|
|
3170
|
-
details.runtime_probe = runtimeProbeSummary;
|
|
3171
|
-
}
|
|
3172
|
-
if (action === "manage") {
|
|
3173
|
-
details.runtime_probe = runtimeProbeSummary;
|
|
3174
|
-
details.managed_state_fix = managedStateFix !== null ? {
|
|
3175
|
-
requested: true,
|
|
3176
|
-
applied: managedStateFix.adopted_entries.length > 0,
|
|
3177
|
-
adopted_count: managedStateFix.adopted_entries.length,
|
|
3178
|
-
adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
|
|
3179
|
-
already_managed_count: managedStateFix.already_managed_count
|
|
3180
|
-
} : {
|
|
3181
|
-
requested: false,
|
|
3182
|
-
applied: false,
|
|
3183
|
-
adopted_count: 0,
|
|
3184
|
-
adopted_extensions: [],
|
|
3185
|
-
already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
|
|
3186
|
-
};
|
|
3187
|
-
}
|
|
3188
|
-
return withResult(details);
|
|
3189
|
-
}
|
|
3190
|
-
throw new PmCliError(`Unsupported extension action "${action}".`, EXIT_CODE.USAGE);
|
|
3191
|
-
}
|
|
3388
|
+
return withResult(details);
|
|
3389
|
+
}
|
|
3390
|
+
var EXTENSION_ACTION_HANDLERS = {
|
|
3391
|
+
init: runExtensionInitAction,
|
|
3392
|
+
install: runExtensionInstallAction,
|
|
3393
|
+
uninstall: runExtensionUninstallAction,
|
|
3394
|
+
explore: runExtensionExploreManageAction,
|
|
3395
|
+
manage: runExtensionExploreManageAction,
|
|
3396
|
+
describe: runExtensionDescribeAction,
|
|
3397
|
+
reload: runExtensionReloadAction,
|
|
3398
|
+
doctor: runExtensionDoctorAction,
|
|
3399
|
+
catalog: runExtensionCatalogAction,
|
|
3400
|
+
adopt: runExtensionAdoptAction,
|
|
3401
|
+
"adopt-all": runExtensionAdoptAllAction,
|
|
3402
|
+
activate: runExtensionActivateDeactivateAction,
|
|
3403
|
+
deactivate: runExtensionActivateDeactivateAction
|
|
3404
|
+
};
|
|
3192
3405
|
var _testOnly = {
|
|
3193
3406
|
adoptUnmanagedExtensions,
|
|
3194
3407
|
buildExtensionPolicyDetails,
|
|
@@ -3199,6 +3412,7 @@ var _testOnly = {
|
|
|
3199
3412
|
findActivationFailureByName,
|
|
3200
3413
|
resolveInstallRuntimeActivationStatus,
|
|
3201
3414
|
collectGlobalOutputOverrideDoctorWarnings,
|
|
3415
|
+
collectSchemaNarrowActivationDoctorWarnings,
|
|
3202
3416
|
copyExtensionDirectoryWithoutSelfNesting,
|
|
3203
3417
|
isErrnoCode,
|
|
3204
3418
|
isRetriableExtensionInstallCopyError,
|
|
@@ -3225,4 +3439,4 @@ export {
|
|
|
3225
3439
|
runExtension,
|
|
3226
3440
|
_testOnly
|
|
3227
3441
|
};
|
|
3228
|
-
//# sourceMappingURL=chunk-
|
|
3442
|
+
//# sourceMappingURL=chunk-5QFDBI4F.js.map
|