@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,62 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runUpdate
|
|
3
|
-
} from "./chunk-HBAEFWX3.js";
|
|
4
1
|
import {
|
|
5
2
|
createCheckpointId,
|
|
6
3
|
loadMutationCheckpoint,
|
|
7
4
|
restoreCheckpointItems,
|
|
8
5
|
writeMutationCheckpoint
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-PRVTGX64.js";
|
|
6
|
+
} from "./chunk-27BXPBAY.js";
|
|
11
7
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import
|
|
15
|
-
resolveAuthor
|
|
16
|
-
} from "./chunk-WW4E2DC3.js";
|
|
17
|
-
import "./chunk-LU36E6GU.js";
|
|
18
|
-
import "./chunk-CG3KP6I5.js";
|
|
8
|
+
runUpdate
|
|
9
|
+
} from "./chunk-NUHHPVVS.js";
|
|
10
|
+
import "./chunk-CZVISY5A.js";
|
|
19
11
|
import {
|
|
20
12
|
resolvePriority
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-VARHOHYV.js";
|
|
14
|
+
import "./chunk-HYTGA6GI.js";
|
|
23
15
|
import {
|
|
24
16
|
applyTagRemovals,
|
|
25
17
|
mergeAdditiveTags,
|
|
26
18
|
parseTags
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-DDPTYJIM.js";
|
|
20
|
+
import "./chunk-IJYK2T43.js";
|
|
21
|
+
import "./chunk-RGEMWD6Q.js";
|
|
30
22
|
import {
|
|
31
|
-
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import
|
|
23
|
+
runRestore
|
|
24
|
+
} from "./chunk-IPYBJWTE.js";
|
|
25
|
+
import {
|
|
26
|
+
resolveAuthor
|
|
27
|
+
} from "./chunk-WW4E2DC3.js";
|
|
34
28
|
import {
|
|
35
29
|
hasListFilters
|
|
36
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4BU75MF4.js";
|
|
31
|
+
import "./chunk-HPPFYYOV.js";
|
|
32
|
+
import "./chunk-64HNBBFQ.js";
|
|
33
|
+
import "./chunk-G7I7DEZA.js";
|
|
34
|
+
import "./chunk-JPECA746.js";
|
|
37
35
|
import "./chunk-5HIZDR5A.js";
|
|
36
|
+
import {
|
|
37
|
+
buildInvalidTypeError
|
|
38
|
+
} from "./chunk-LB6TP6MC.js";
|
|
39
|
+
import "./chunk-BDTISOSD.js";
|
|
38
40
|
import {
|
|
39
41
|
runList
|
|
40
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-3S2KT7NG.js";
|
|
41
43
|
import "./chunk-R23CSHGI.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-NFDPYAIP.js";
|
|
45
|
+
import "./chunk-4DUVCVLZ.js";
|
|
44
46
|
import {
|
|
45
47
|
toItemRecord
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import "./chunk-B74BP6IS.js";
|
|
48
|
+
} from "./chunk-3K2M5OYU.js";
|
|
48
49
|
import {
|
|
49
50
|
collectRuntimeUpdateFieldValues,
|
|
50
51
|
normalizeStatusInput
|
|
51
|
-
} from "./chunk-
|
|
52
|
-
import {
|
|
53
|
-
resolveItemTypeRegistry,
|
|
54
|
-
resolveTypeName
|
|
55
|
-
} from "./chunk-ZV7IQ23N.js";
|
|
52
|
+
} from "./chunk-BHO33VBQ.js";
|
|
56
53
|
import {
|
|
57
54
|
nowIso,
|
|
58
55
|
resolveIsoOrRelative
|
|
59
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-WYDHYJPO.js";
|
|
60
57
|
import {
|
|
61
58
|
EXIT_CODE,
|
|
62
59
|
PmCliError,
|
|
@@ -64,13 +61,15 @@ import {
|
|
|
64
61
|
getSettingsPath,
|
|
65
62
|
pathExists,
|
|
66
63
|
readSettings,
|
|
64
|
+
resolveItemTypeRegistry,
|
|
67
65
|
resolveItemTypesFilePath,
|
|
68
66
|
resolvePmRoot,
|
|
69
67
|
resolveRuntimeFieldRegistry,
|
|
70
68
|
resolveRuntimeStatusRegistry,
|
|
69
|
+
resolveTypeName,
|
|
71
70
|
stableValueEquals,
|
|
72
71
|
toErrorMessage
|
|
73
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-RVUALSJF.js";
|
|
74
73
|
|
|
75
74
|
// dist/cli/commands/update-many.js
|
|
76
75
|
!(function() {
|
|
@@ -651,4 +650,4 @@ export {
|
|
|
651
650
|
_testOnlyUpdateManyCommand,
|
|
652
651
|
runUpdateMany
|
|
653
652
|
};
|
|
654
|
-
//# sourceMappingURL=update-many-
|
|
653
|
+
//# sourceMappingURL=update-many-Z5GJS5LC.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../cli/commands/update-many.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * @module cli/commands/update-many\n *\n * Implements the pm update many command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport {\n createCheckpointId,\n loadMutationCheckpoint,\n restoreCheckpointItems,\n writeMutationCheckpoint,\n type MutationCheckpointItem,\n} from \"../../core/checkpoint/mutation-checkpoint.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { applyTagRemovals, mergeAdditiveTags, parseTags } from \"../../core/item/parse.js\";\nimport { resolvePriority } from \"../../core/item/priority.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry, resolveTypeName } from \"../../core/item/type-registry.js\";\nimport { collectRuntimeUpdateFieldValues } from \"../../core/schema/runtime-field-values.js\";\nimport { buildInvalidTypeError } from \"../../core/schema/item-types-file.js\";\nimport {\n resolveItemTypesFilePath,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeFieldRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { toErrorMessage } from \"../../core/shared/primitives.js\";\nimport { stableValueEquals } from \"../../core/shared/serialization.js\";\nimport { nowIso, resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport type { PmSettings } from \"../../types/index.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type { ItemStatus } from \"../../types/index.js\";\nimport { hasListFilters } from \"./list-filter-shared.js\";\nimport { runList, type ListOptions, type ListedItem } from \"./list.js\";\nimport { runRestore } from \"./restore.js\";\nimport { runUpdate, type UpdateCommandOptions } from \"./update.js\";\n\nconst UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION = 1;\nconst UPDATE_MANY_CHECKPOINT_SUBDIR = \"update-many\";\n\nconst NON_MUTATION_UPDATE_OPTION_KEYS = new Set<keyof UpdateCommandOptions>([\n \"author\",\n \"message\",\n \"force\",\n \"allowAuditUpdate\",\n \"allowAuditDepUpdate\",\n]);\n\nconst UPDATE_MANY_MUTATION_FLAG_GUIDANCE = [\n \"--status\",\n \"--priority\",\n \"--type\",\n \"--tags\",\n \"--description\",\n \"--body\",\n \"--deadline\",\n \"--estimate\",\n \"--assignee\",\n \"--dep\",\n \"--dep-remove\",\n \"--comment\",\n \"--note\",\n \"--learning\",\n \"--file\",\n \"--test\",\n \"--doc\",\n \"--replace-deps\",\n \"--replace-tests\",\n \"--unset\",\n \"--clear-*\",\n].join(\", \");\n\nconst UPDATE_OPTION_TO_ITEM_KEY: Partial<Record<keyof UpdateCommandOptions, string>> = {\n title: \"title\",\n description: \"description\",\n body: \"body\",\n status: \"status\",\n closeReason: \"close_reason\",\n priority: \"priority\",\n type: \"type\",\n deadline: \"deadline\",\n estimatedMinutes: \"estimated_minutes\",\n acceptanceCriteria: \"acceptance_criteria\",\n definitionOfReady: \"definition_of_ready\",\n order: \"order\",\n goal: \"goal\",\n objective: \"objective\",\n value: \"value\",\n impact: \"impact\",\n outcome: \"outcome\",\n whyNow: \"why_now\",\n assignee: \"assignee\",\n parent: \"parent\",\n reviewer: \"reviewer\",\n risk: \"risk\",\n confidence: \"confidence\",\n sprint: \"sprint\",\n release: \"release\",\n blockedBy: \"blocked_by\",\n blockedReason: \"blocked_reason\",\n unblockNote: \"unblock_note\",\n reporter: \"reporter\",\n severity: \"severity\",\n environment: \"environment\",\n reproSteps: \"repro_steps\",\n resolution: \"resolution\",\n expectedResult: \"expected_result\",\n actualResult: \"actual_result\",\n affectedVersion: \"affected_version\",\n fixedVersion: \"fixed_version\",\n component: \"component\",\n regression: \"regression\",\n customerImpact: \"customer_impact\",\n};\n\ninterface CollectionMutationPlanDefinition {\n field: string;\n addKey: keyof UpdateCommandOptions;\n removeKey?: keyof UpdateCommandOptions;\n clearKey: keyof UpdateCommandOptions;\n replaceKey?: keyof UpdateCommandOptions;\n}\n\nconst COLLECTION_MUTATION_PLAN_DEFINITIONS: CollectionMutationPlanDefinition[] = [\n {\n field: \"dependencies\",\n addKey: \"dep\",\n removeKey: \"depRemove\",\n clearKey: \"clearDeps\",\n replaceKey: \"replaceDeps\",\n },\n {\n field: \"comments\",\n addKey: \"comment\",\n clearKey: \"clearComments\",\n },\n {\n field: \"notes\",\n addKey: \"note\",\n clearKey: \"clearNotes\",\n },\n {\n field: \"learnings\",\n addKey: \"learning\",\n clearKey: \"clearLearnings\",\n },\n {\n field: \"files\",\n addKey: \"file\",\n clearKey: \"clearFiles\",\n },\n {\n field: \"tests\",\n addKey: \"test\",\n clearKey: \"clearTests\",\n replaceKey: \"replaceTests\",\n },\n {\n field: \"docs\",\n addKey: \"doc\",\n clearKey: \"clearDocs\",\n },\n {\n field: \"reminders\",\n addKey: \"reminder\",\n clearKey: \"clearReminders\",\n },\n {\n field: \"events\",\n addKey: \"event\",\n clearKey: \"clearEvents\",\n },\n {\n field: \"type_options\",\n addKey: \"typeOption\",\n clearKey: \"clearTypeOptions\",\n },\n];\n\nconst UNSET_FIELD_ALIASES: Record<string, string> = {\n close_reason: \"close_reason\",\n \"close-reason\": \"close_reason\",\n deadline: \"deadline\",\n estimate: \"estimated_minutes\",\n estimated_minutes: \"estimated_minutes\",\n \"estimated-minutes\": \"estimated_minutes\",\n acceptance_criteria: \"acceptance_criteria\",\n \"acceptance-criteria\": \"acceptance_criteria\",\n ac: \"acceptance_criteria\",\n definition_of_ready: \"definition_of_ready\",\n \"definition-of-ready\": \"definition_of_ready\",\n order: \"order\",\n rank: \"order\",\n goal: \"goal\",\n objective: \"objective\",\n value: \"value\",\n impact: \"impact\",\n outcome: \"outcome\",\n why_now: \"why_now\",\n \"why-now\": \"why_now\",\n assignee: \"assignee\",\n parent: \"parent\",\n reviewer: \"reviewer\",\n risk: \"risk\",\n confidence: \"confidence\",\n sprint: \"sprint\",\n release: \"release\",\n blocked_by: \"blocked_by\",\n \"blocked-by\": \"blocked_by\",\n blocked_reason: \"blocked_reason\",\n \"blocked-reason\": \"blocked_reason\",\n unblock_note: \"unblock_note\",\n \"unblock-note\": \"unblock_note\",\n reporter: \"reporter\",\n severity: \"severity\",\n environment: \"environment\",\n repro_steps: \"repro_steps\",\n \"repro-steps\": \"repro_steps\",\n resolution: \"resolution\",\n expected_result: \"expected_result\",\n \"expected-result\": \"expected_result\",\n actual_result: \"actual_result\",\n \"actual-result\": \"actual_result\",\n affected_version: \"affected_version\",\n \"affected-version\": \"affected_version\",\n fixed_version: \"fixed_version\",\n \"fixed-version\": \"fixed_version\",\n component: \"component\",\n regression: \"regression\",\n customer_impact: \"customer_impact\",\n \"customer-impact\": \"customer_impact\",\n type_options: \"type_options\",\n \"type-options\": \"type_options\",\n tags: \"tags\",\n};\n\ninterface UpdateManyCheckpoint {\n schema_version: number;\n id: string;\n created_at: string;\n author: string;\n status_filter: string | null;\n list_filters: Record<string, unknown>;\n update_options: Record<string, unknown>;\n items: MutationCheckpointItem[];\n}\n\n/**\n * Documents the update many command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpdateManyCommandOptions {\n status?: string;\n list: ListOptions;\n update: UpdateCommandOptions;\n dryRun?: boolean;\n rollback?: string;\n checkpoint?: boolean;\n}\n\ninterface PlannedChange {\n field: string;\n before: unknown;\n after: unknown;\n}\n\ninterface PlannedItemDiff {\n id: string;\n changes: PlannedChange[];\n}\n\ninterface UpdateManyApplyResultRow {\n id: string;\n status: \"updated\" | \"failed\" | \"skipped\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\ninterface UpdateManyRollbackResultRow {\n id: string;\n status: \"restored\" | \"failed\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\n/**\n * Documents the update many result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpdateManyResult {\n mode: \"dry_run\" | \"apply\" | \"rollback\";\n matched_count: number;\n dry_run: boolean;\n filters?: Record<string, unknown>;\n planned_update_options?: Record<string, unknown>;\n item_plans?: PlannedItemDiff[];\n checkpoint?: {\n id: string;\n created_at: string;\n path: string;\n rollback_command: string;\n };\n updated_count?: number;\n skipped_count?: number;\n failed_count?: number;\n restored_count?: number;\n rollback_checkpoint_id?: string;\n rows?: UpdateManyApplyResultRow[] | UpdateManyRollbackResultRow[];\n ids: string[];\n}\n\nfunction sanitizeUpdateOptionsForSummary(options: UpdateCommandOptions): Record<string, unknown> {\n const summary: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(options) as Array<[keyof UpdateCommandOptions, unknown]>) {\n if (NON_MUTATION_UPDATE_OPTION_KEYS.has(key)) {\n continue;\n }\n if (value === undefined) {\n continue;\n }\n summary[key] = value;\n }\n return summary;\n}\n\nfunction hasAnyUpdateMutationInput(options: UpdateCommandOptions): boolean {\n return Object.keys(sanitizeUpdateOptionsForSummary(options)).length > 0;\n}\n\nfunction toComparablePreviewValue(optionKey: keyof UpdateCommandOptions, value: unknown): unknown {\n if (value === undefined) {\n return undefined;\n }\n if (optionKey === \"priority\") {\n const parsed = Number(String(value).trim());\n return Number.isInteger(parsed) ? parsed : String(value).trim();\n }\n if (optionKey === \"estimatedMinutes\" || optionKey === \"order\" || optionKey === \"rank\") {\n const parsed = Number(String(value).trim());\n return Number.isFinite(parsed) ? parsed : String(value).trim();\n }\n if (optionKey === \"regression\") {\n const normalized = String(value).trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\") {\n return false;\n }\n }\n if (typeof value === \"string\") {\n return value.trim();\n }\n return value;\n}\n\nfunction normalizeUnsetField(rawField: string): string {\n const normalized = rawField.trim().toLowerCase().replaceAll(\"-\", \"_\");\n return UNSET_FIELD_ALIASES[normalized] ?? normalized;\n}\n\nfunction areValuesEqual(left: unknown, right: unknown): boolean {\n return stableValueEquals(left, right);\n}\n\nfunction normalizeCollectionBeforeValue(field: string, value: unknown): unknown {\n if (value !== undefined) {\n return value;\n }\n if (field === \"type_options\") {\n return {};\n }\n return [];\n}\n\nfunction collectionValueCount(field: string, value: unknown): number {\n if (Array.isArray(value)) {\n return value.length;\n }\n if (field === \"type_options\" && value && typeof value === \"object\") {\n return Object.keys(value as Record<string, unknown>).length;\n }\n return 0;\n}\n\nfunction buildCollectionMutationPlans(row: Record<string, unknown>, update: UpdateCommandOptions): PlannedChange[] {\n const changes: PlannedChange[] = [];\n for (const definition of COLLECTION_MUTATION_PLAN_DEFINITIONS) {\n const addValues = update[definition.addKey];\n const removeValues = definition.removeKey ? update[definition.removeKey] : undefined;\n const addCount = Array.isArray(addValues) ? addValues.length : 0;\n const removeCount = Array.isArray(removeValues) ? removeValues.length : 0;\n const clear = update[definition.clearKey] === true;\n const replace = definition.replaceKey ? update[definition.replaceKey] === true : false;\n if (!clear && !replace && addCount === 0 && removeCount === 0) {\n continue;\n }\n\n const before = normalizeCollectionBeforeValue(definition.field, row[definition.field]);\n const beforeCount = collectionValueCount(definition.field, before);\n const operation = replace ? \"replace\" : clear ? \"clear_or_reset\" : removeCount > 0 ? \"merge_remove\" : \"append\";\n changes.push({\n field: definition.field,\n before,\n after: {\n operation,\n clear,\n replace,\n add_count: addCount,\n remove_count: removeCount,\n before_count: beforeCount,\n },\n });\n }\n return changes;\n}\n\nfunction normalizeExistingTags(value: unknown): string[] {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.filter((tag): tag is string => typeof tag === \"string\");\n}\n\n// Tags support three mutation modes that compose: --tags replaces, --add-tags\n// extends, --remove-tags prunes. Replicate runUpdate's resolution order so the\n// dry-run preview and the apply-mode actionable detection both account for\n// additive/subtractive tag mutations (a --add-tags-only update must NOT be\n// treated as a no-op skip).\nfunction buildTagMutationPlan(row: Record<string, unknown>, update: UpdateCommandOptions): PlannedChange | undefined {\n const hasReplace = update.tags !== undefined;\n const hasAdd = Array.isArray(update.addTags) && update.addTags.length > 0;\n const hasRemove = Array.isArray(update.removeTags) && update.removeTags.length > 0;\n if (!hasReplace && !hasAdd && !hasRemove) {\n return undefined;\n }\n const existing = normalizeExistingTags(row.tags);\n const baseTags = hasReplace ? parseTags(update.tags as string) : existing;\n const withAdditions = mergeAdditiveTags(baseTags, update.addTags);\n const after = applyTagRemovals(withAdditions, update.removeTags).slice().sort((a, b) => a.localeCompare(b));\n const before = existing.slice().sort((a, b) => a.localeCompare(b));\n if (areValuesEqual(before, after)) {\n return undefined;\n }\n return { field: \"tags\", before: existing, after };\n}\n\nfunction buildPlannedItemDiff(\n item: ListedItem,\n update: UpdateCommandOptions = {},\n runtimeFieldRegistry: RuntimeFieldRegistry,\n): PlannedItemDiff {\n const safeUpdate = update;\n const row = toItemRecord(item);\n const changes: PlannedChange[] = [];\n const tagPlan = buildTagMutationPlan(row, safeUpdate);\n if (tagPlan) {\n changes.push(tagPlan);\n }\n for (const [optionKey, itemKey] of Object.entries(UPDATE_OPTION_TO_ITEM_KEY) as Array<[keyof UpdateCommandOptions, string]>) {\n const candidate = safeUpdate[optionKey];\n if (candidate === undefined) {\n continue;\n }\n const before = row[itemKey];\n const after = toComparablePreviewValue(optionKey, candidate);\n if (areValuesEqual(before, after)) {\n continue;\n }\n changes.push({\n field: itemKey,\n before,\n after,\n });\n }\n changes.push(...buildCollectionMutationPlans(row, safeUpdate));\n\n const runtimeFieldUpdates = collectRuntimeUpdateFieldValues(\n safeUpdate as Record<string, unknown>,\n runtimeFieldRegistry,\n [\"update_many\"],\n );\n for (const [fieldKey, fieldValue] of Object.entries(runtimeFieldUpdates)) {\n const before = row[fieldKey];\n if (areValuesEqual(before, fieldValue)) {\n continue;\n }\n changes.push({\n field: fieldKey,\n before,\n after: fieldValue,\n });\n }\n\n if (safeUpdate.unset && safeUpdate.unset.length > 0) {\n for (const rawUnsetField of safeUpdate.unset) {\n const field = normalizeUnsetField(rawUnsetField);\n const before = row[field];\n if (before === undefined) {\n continue;\n }\n changes.push({\n field,\n before,\n after: null,\n });\n }\n }\n\n return {\n id: item.id,\n changes,\n };\n}\n\nfunction normalizeStatusFilter(value: string | undefined, statusRegistry: RuntimeStatusRegistry): ItemStatus | undefined {\n if (value === undefined) {\n return undefined;\n }\n const normalized = normalizeStatusInput(value, statusRegistry);\n if (!normalized) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(\n `Invalid --filter-status value \"${value}\". Allowed: ${allowedStatuses.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized;\n}\n\nfunction rejectBlankIdsFilter(list: ListOptions | undefined): void {\n if (list?.ids != null && String(list.ids).trim().length === 0) {\n throw new PmCliError(\"--ids requires at least one non-empty item ID\", EXIT_CODE.USAGE);\n }\n}\n\n// GH-256: validate planned scalar enum/format fields up front so a `--dry-run`\n// preview rejects globally-invalid values exactly as apply would (true\n// preview==apply parity), and so apply itself fails fast before creating an\n// orphan checkpoint. Only VALUE/ENUM/FORMAT correctness is checked here — these\n// are invalid regardless of the matched item. Per-item governance and\n// workflow-transition rules stay in the apply path (runUpdate). Each field is\n// validated only when the caller actually provided it, reusing the exact same\n// resolvers and error messages runUpdate raises so single/bulk/dry-run stay\n// consistent.\nfunction assertPlannedUpdateValuesValid(\n update: UpdateCommandOptions,\n settings: PmSettings,\n statusRegistry: RuntimeStatusRegistry,\n pmRoot: string,\n): void {\n if (update.priority !== undefined) {\n resolvePriority(update.priority);\n }\n if (update.type !== undefined) {\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n if (!resolveTypeName(update.type, typeRegistry)) {\n throw new PmCliError(\n buildInvalidTypeError(update.type, typeRegistry.types, resolveItemTypesFilePath(pmRoot, settings.schema)),\n EXIT_CODE.USAGE,\n );\n }\n }\n if (update.status !== undefined && !normalizeStatusInput(update.status, statusRegistry)) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(\n `Invalid --status value \"${update.status}\". Allowed: ${allowedStatuses.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n if (update.deadline !== undefined) {\n resolveIsoOrRelative(update.deadline, new Date(), \"deadline\");\n }\n}\n\n\n/**\n * Implements run update many for the public runtime surface of this module.\n */\nexport async function runUpdateMany(options: UpdateManyCommandOptions, global: GlobalOptions): Promise<UpdateManyResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);\n\n const dryRun = options.dryRun === true;\n const rollbackId = typeof options.rollback === \"string\" ? options.rollback : undefined;\n const updateSummary = sanitizeUpdateOptionsForSummary(options.update);\n rejectBlankIdsFilter(options.list);\n\n if (rollbackId) {\n if (dryRun) {\n throw new PmCliError(\"--dry-run cannot be combined with --rollback\", EXIT_CODE.USAGE);\n }\n if (hasListFilters(options.list, options.status)) {\n throw new PmCliError(\"Rollback mode does not accept filter options\", EXIT_CODE.USAGE);\n }\n if (Object.keys(updateSummary).length > 0) {\n throw new PmCliError(\"Rollback mode does not accept update mutation flags\", EXIT_CODE.USAGE);\n }\n\n const checkpoint = await loadMutationCheckpoint(\n pmRoot,\n UPDATE_MANY_CHECKPOINT_SUBDIR,\n rollbackId,\n UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION,\n );\n const restoreMessage = options.update?.message ?? `Rollback update-many checkpoint ${checkpoint.id}`;\n const rollback = await restoreCheckpointItems(checkpoint.items, (id, targetUpdatedAt) =>\n runRestore(\n id,\n targetUpdatedAt,\n {\n author: options.update?.author,\n message: restoreMessage,\n force: options.update?.force ?? true,\n },\n global,\n ),\n );\n return {\n mode: \"rollback\",\n matched_count: checkpoint.items.length,\n dry_run: false,\n rollback_checkpoint_id: checkpoint.id,\n checkpoint: {\n id: checkpoint.id,\n created_at: checkpoint.created_at,\n path: checkpoint.path,\n rollback_command: `pm update-many --rollback ${checkpoint.id}`,\n },\n restored_count: rollback.restored_ids.length,\n failed_count: rollback.failed_count,\n rows: rollback.rows,\n ids: rollback.restored_ids,\n };\n }\n\n if (!hasAnyUpdateMutationInput(options.update)) {\n throw new PmCliError(\n `No update-many mutation flags provided. Add at least one mutation flag (for example: ${UPDATE_MANY_MUTATION_FLAG_GUIDANCE}).`,\n EXIT_CODE.USAGE,\n );\n }\n\n // GH-256: validate planned scalar values before listing/checkpointing so\n // dry-run previews and apply both reject globally-invalid enum/format input.\n assertPlannedUpdateValuesValid(options.update, settings, statusRegistry, pmRoot);\n\n const statusFilter = normalizeStatusFilter(options.status, statusRegistry);\n const listed = await runList(statusFilter, { ...options.list, includeBody: true }, global);\n const planned = listed.items.map((item) => buildPlannedItemDiff(item, options.update, runtimeFieldRegistry));\n const actionable = planned.filter((row) => row.changes.length > 0);\n if (dryRun) {\n return {\n mode: \"dry_run\",\n matched_count: listed.items.length,\n dry_run: true,\n filters: listed.filters,\n planned_update_options: updateSummary,\n item_plans: planned,\n ids: [],\n };\n }\n\n if (actionable.length === 0) {\n return {\n mode: \"apply\",\n matched_count: listed.items.length,\n dry_run: false,\n filters: listed.filters,\n planned_update_options: updateSummary,\n updated_count: 0,\n skipped_count: listed.items.length,\n failed_count: 0,\n rows: planned.map((row) => ({\n id: row.id,\n status: \"skipped\" as const,\n })),\n ids: [],\n };\n }\n\n const nowValue = nowIso();\n const checkpointId = createCheckpointId(UPDATE_MANY_CHECKPOINT_SUBDIR, nowValue);\n const checkpointEnabled = options.checkpoint !== false;\n const checkpointItems: MutationCheckpointItem[] = listed.items\n .filter((item) => actionable.some((candidate) => candidate.id === item.id))\n .map((item) => ({\n id: item.id,\n target_updated_at: item.updated_at,\n }));\n\n let checkpointInfo: UpdateManyResult[\"checkpoint\"] | undefined;\n if (checkpointEnabled) {\n const checkpointPayload: UpdateManyCheckpoint = {\n schema_version: UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION,\n id: checkpointId,\n created_at: nowValue,\n author: resolveAuthor(options.update.author, \"unknown\"),\n status_filter: statusFilter ?? null,\n list_filters: listed.filters,\n update_options: updateSummary,\n items: checkpointItems,\n };\n const checkpointPath = await writeMutationCheckpoint(\n pmRoot,\n UPDATE_MANY_CHECKPOINT_SUBDIR,\n checkpointId,\n checkpointPayload,\n );\n checkpointInfo = {\n id: checkpointId,\n created_at: nowValue,\n path: checkpointPath,\n rollback_command: `pm update-many --rollback ${checkpointId}`,\n };\n }\n\n const applyRows: UpdateManyApplyResultRow[] = [];\n const updatedIds: string[] = [];\n const updateMessage = options.update.message ?? `update-many apply ${checkpointId}`;\n const actionableById = new Set(actionable.map((row) => row.id));\n for (const item of listed.items) {\n if (!actionableById.has(item.id)) {\n applyRows.push({ id: item.id, status: \"skipped\" });\n continue;\n }\n try {\n const result = await runUpdate(\n item.id,\n {\n ...options.update,\n message: updateMessage,\n runtimeFieldCommands: [\"update_many\"],\n },\n global,\n );\n applyRows.push({\n id: item.id,\n status: \"updated\",\n changed_fields: result.changed_fields,\n warnings: result.warnings,\n });\n updatedIds.push(item.id);\n } catch (error: unknown) {\n applyRows.push({\n id: item.id,\n status: \"failed\",\n error: toErrorMessage(error),\n });\n }\n }\n\n const updatedCount = applyRows.filter((row) => row.status === \"updated\").length;\n const skippedCount = applyRows.filter((row) => row.status === \"skipped\").length;\n const failedCount = applyRows.filter((row) => row.status === \"failed\").length;\n\n return {\n mode: \"apply\",\n matched_count: listed.items.length,\n dry_run: false,\n filters: listed.filters,\n planned_update_options: updateSummary,\n ...(checkpointInfo ? { checkpoint: checkpointInfo } : {}),\n updated_count: updatedCount,\n skipped_count: skippedCount,\n failed_count: failedCount,\n rows: applyRows,\n ids: updatedIds,\n };\n}\n\nexport const _testOnlyUpdateManyCommand = {\n assertPlannedUpdateValuesValid,\n buildCollectionMutationPlans,\n buildPlannedItemDiff,\n buildTagMutationPlan,\n collectionValueCount,\n hasAnyUpdateMutationInput,\n hasListFilters,\n normalizeStatusFilter,\n normalizeCollectionBeforeValue,\n normalizeExistingTags,\n normalizeUnsetField,\n rejectBlankIdsFilter,\n sanitizeUpdateOptionsForSummary,\n toComparablePreviewValue,\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAM,wCAAwC;AAC9C,IAAM,gCAAgC;AAEtC,IAAM,kCAAkC,oBAAI,IAAgC;EAC1E;EACA;EACA;EACA;EACA;CACD;AAED,IAAM,qCAAqC;EACzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA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ACA;EACA;EACA;EACA;EACA;EACA;;",
|
|
6
6
|
"names": ["global"]
|
|
7
7
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4009e0ef-d00a-5422-82a2-e126fbaaba96")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
readManagedExtensionState,
|
|
5
5
|
runExtension
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-NJ73ALW2.js";
|
|
8
|
-
import "./chunk-J3NMWFIN.js";
|
|
6
|
+
} from "./chunk-NU2UEROZ.js";
|
|
9
7
|
import "./chunk-P4SESZGT.js";
|
|
10
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-2D4HATP2.js";
|
|
9
|
+
import "./chunk-MAUKX7JC.js";
|
|
10
|
+
import "./chunk-6AQZPVHQ.js";
|
|
11
|
+
import "./chunk-4A3BJ675.js";
|
|
12
|
+
import "./chunk-HXTQJXWT.js";
|
|
13
|
+
import "./chunk-JSU5P7VS.js";
|
|
14
|
+
import "./chunk-QCWF6IYD.js";
|
|
15
|
+
import "./chunk-AXIDKKAT.js";
|
|
11
16
|
import {
|
|
12
17
|
EXIT_CODE,
|
|
13
18
|
PmCliError,
|
|
@@ -15,7 +20,7 @@ import {
|
|
|
15
20
|
resolveExtensionRoots,
|
|
16
21
|
resolvePmCliVersion,
|
|
17
22
|
resolvePmRoot
|
|
18
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-7R4QEMZZ.js";
|
|
19
24
|
|
|
20
25
|
// dist/cli/commands/upgrade.js
|
|
21
26
|
import { execFile } from "node:child_process";
|
|
@@ -270,6 +275,6 @@ export {
|
|
|
270
275
|
_testOnly,
|
|
271
276
|
runUpgrade
|
|
272
277
|
};
|
|
273
|
-
//# sourceMappingURL=upgrade-
|
|
278
|
+
//# sourceMappingURL=upgrade-BRL6KCOJ.js.map
|
|
274
279
|
|
|
275
|
-
//# debugId=
|
|
280
|
+
//# debugId=4009e0ef-d00a-5422-82a2-e126fbaaba96
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/upgrade.ts"],"sourcesContent":["/**\n * @module cli/commands/upgrade\n *\n * Implements the pm upgrade command surface and its agent-facing runtime behavior.\n */\nimport { execFile } from \"node:child_process\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\nimport {\n readManagedExtensionState,\n runExtension,\n type ExtensionScope,\n type ManagedExtensionRecord,\n type ManagedExtensionSource,\n} from \"./extension.js\";\nimport { resolveExtensionRoots } from \"../../core/extensions/loader.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { resolvePmCliVersion } from \"../../core/packages/root.js\";\n\nconst execFileAsync = promisify(execFile);\nconst DEFAULT_CLI_PACKAGE = \"@unbrained/pm-cli\";\nconst DEFAULT_TAG = \"latest\";\n\n/**\n * Documents the upgrade command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandOptions {\n dryRun?: boolean;\n cliOnly?: boolean;\n packagesOnly?: boolean;\n project?: boolean;\n local?: boolean;\n global?: boolean;\n repair?: boolean;\n tag?: string;\n packageName?: string;\n commandRunner?: UpgradeCommandRunner;\n}\n\nexport const _testOnly = {\n defaultCommandRunner,\n isLocalNpmSpec,\n normalizeTarget,\n packageRecordMatchesTarget,\n resolveCliPackage,\n resolvePackageInstallSource,\n resolveRunnablePackageSource,\n resolveScope,\n resolveTag,\n packageCommandFor,\n summarize,\n};\n\n/**\n * Documents the upgrade command runner result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandRunnerResult {\n stdout: string;\n stderr: string;\n}\n\n/**\n * Restricts upgrade command runner values accepted by command, SDK, and storage contracts.\n */\nexport type UpgradeCommandRunner = (\n command: string,\n args: string[],\n options?: { cwd?: string },\n) => Promise<UpgradeCommandRunnerResult>;\n\n/**\n * Documents the upgrade cli result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCliResult {\n requested: boolean;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n package: string;\n target: string;\n command: string[];\n before_version?: string;\n after_version?: string;\n repair: boolean;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade package result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradePackageResult {\n name: string;\n directory: string;\n scope: ExtensionScope;\n source: ManagedExtensionSource;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n command: string[];\n previous_version: string;\n installed_version?: string;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeResult {\n ok: boolean;\n action: \"upgrade\";\n dry_run: boolean;\n scope: ExtensionScope;\n target?: string;\n cli: UpgradeCliResult;\n packages: UpgradePackageResult[];\n summary: {\n requested_cli: boolean;\n requested_packages: boolean;\n planned: number;\n updated: number;\n skipped: number;\n failed: number;\n };\n}\n\nfunction resolveScope(options: UpgradeCommandOptions): ExtensionScope {\n const projectLike = options.project === true || options.local === true;\n const global = options.global === true;\n if (projectLike && global) {\n throw new PmCliError('Options \"--project/--local\" and \"--global\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n return global ? \"global\" : \"project\";\n}\n\nfunction normalizeTarget(value: string): string {\n return value.trim().toLowerCase();\n}\n\nfunction packageRecordMatchesTarget(record: ManagedExtensionRecord, target: string): boolean {\n const normalizedTarget = normalizeTarget(target);\n const values = [\n record.name,\n record.directory,\n record.source.input,\n record.source.location,\n record.source.package,\n record.source.repository,\n record.source.owner && record.source.repo ? `${record.source.owner}/${record.source.repo}` : undefined,\n ];\n return values.some((value) => typeof value === \"string\" && normalizeTarget(value) === normalizedTarget);\n}\n\nfunction resolveRoots(scope: ExtensionScope, global: GlobalOptions): {\n selected_root: string;\n} {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const roots = resolveExtensionRoots(pmRoot, process.cwd());\n return {\n selected_root: scope === \"global\" ? roots.global : roots.project,\n };\n}\n\nasync function defaultCommandRunner(\n command: string,\n args: string[],\n options?: { cwd?: string },\n): Promise<UpgradeCommandRunnerResult> {\n try {\n const result = await execFileAsync(command, args, {\n cwd: options?.cwd,\n encoding: \"utf8\",\n });\n return {\n stdout: result.stdout,\n stderr: result.stderr,\n };\n } catch (error: unknown) {\n const stderr = typeof error === \"object\" && error !== null && \"stderr\" in error\n ? String((error as { stderr?: unknown }).stderr ?? \"\")\n : \"\";\n const message = stderr.trim().length > 0 ? stderr.trim() : error instanceof Error ? error.message : String(error);\n throw new PmCliError(`Command failed: ${command} ${args.join(\" \")}\\n${message}`, EXIT_CODE.GENERIC_FAILURE);\n }\n}\n\nasync function readCurrentVersion(): Promise<string | undefined> {\n return resolvePmCliVersion(import.meta.url, [\"../../..\"]);\n}\n\nfunction resolveTag(options: UpgradeCommandOptions): string {\n return typeof options.tag === \"string\" && options.tag.trim().length > 0 ? options.tag.trim() : DEFAULT_TAG;\n}\n\nfunction resolveCliPackage(options: UpgradeCommandOptions): string {\n return typeof options.packageName === \"string\" && options.packageName.trim().length > 0\n ? options.packageName.trim()\n : DEFAULT_CLI_PACKAGE;\n}\n\nasync function upgradeCli(options: UpgradeCommandOptions, dryRun: boolean): Promise<UpgradeCliResult> {\n const runner = options.commandRunner ?? defaultCommandRunner;\n const packageName = resolveCliPackage(options);\n const tag = resolveTag(options);\n const target = `${packageName}@${tag}`;\n const command = [\"npm\", \"install\", \"-g\", target];\n if (options.repair === true) {\n command.push(\"--force\");\n }\n const beforeVersion = await readCurrentVersion();\n const planned: UpgradeCliResult = {\n requested: true,\n status: \"planned\",\n package: packageName,\n target,\n command,\n before_version: beforeVersion,\n repair: options.repair === true,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runner(command[0]!, command.slice(1));\n const verified = await runner(\"pm\", [\"--version\"]);\n return {\n ...planned,\n status: \"updated\",\n after_version: verified.stdout.trim() || undefined,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction isLocalNpmSpec(spec: string): boolean {\n return path.isAbsolute(spec) || spec.startsWith(\".\") || spec.startsWith(\"..\") || spec.startsWith(\"file:\");\n}\n\nfunction resolvePackageInstallSource(source: ManagedExtensionSource, tag: string): string {\n if (source.kind === \"npm\") {\n const rawSpec = source.input.startsWith(\"npm:\") ? source.input.slice(\"npm:\".length).trim() : source.input.trim();\n if (!isLocalNpmSpec(rawSpec) && source.package && source.package.trim().length > 0) {\n return `npm:${source.package.trim()}@${tag}`;\n }\n return source.input.startsWith(\"npm:\") ? source.input : `npm:${source.input}`;\n }\n return source.input;\n}\n\nasync function resolveRunnablePackageSource(source: ManagedExtensionSource, tag: string): Promise<string> {\n const installSource = resolvePackageInstallSource(source, tag);\n if (source.kind !== \"local\") {\n return installSource;\n }\n if (await pathExists(installSource)) {\n return installSource;\n }\n if (await pathExists(source.location)) {\n return source.location;\n }\n return installSource;\n}\n\nfunction packageCommandFor(source: ManagedExtensionSource, installSource: string, scope: ExtensionScope, ref?: string): string[] {\n const command = [\"pm\", \"install\", installSource, scope === \"global\" ? \"--global\" : \"--project\"];\n if (source.kind === \"github\" && ref && ref.trim().length > 0) {\n command.push(\"--ref\", ref.trim());\n }\n return command;\n}\n\nasync function readManagedRecords(scope: ExtensionScope, global: GlobalOptions): Promise<ManagedExtensionRecord[]> {\n const roots = resolveRoots(scope, global);\n const managedState = await readManagedExtensionState(roots.selected_root);\n return managedState.state.entries.filter((entry) => entry.scope === scope);\n}\n\nasync function refreshManagedRecord(\n scope: ExtensionScope,\n global: GlobalOptions,\n record: ManagedExtensionRecord,\n): Promise<ManagedExtensionRecord | undefined> {\n const records = await readManagedRecords(scope, global);\n return records.find((candidate) => packageRecordMatchesTarget(candidate, record.name)) ??\n records.find((candidate) => normalizeTarget(candidate.directory) === normalizeTarget(record.directory));\n}\n\nasync function upgradePackageRecord(\n record: ManagedExtensionRecord,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n scope: ExtensionScope,\n dryRun: boolean,\n): Promise<UpgradePackageResult> {\n const tag = resolveTag(options);\n const installSource = await resolveRunnablePackageSource(record.source, tag);\n const command = packageCommandFor(record.source, installSource, scope, record.source.ref);\n const planned: UpgradePackageResult = {\n name: record.name,\n directory: record.directory,\n scope,\n source: record.source,\n status: \"planned\",\n command,\n previous_version: record.manifest_version,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runExtension(\n installSource,\n {\n install: true,\n project: scope === \"project\",\n global: scope === \"global\",\n ref: record.source.kind === \"github\" ? record.source.ref : undefined,\n },\n global,\n );\n const refreshed = await refreshManagedRecord(scope, global, record);\n return {\n ...planned,\n status: \"updated\",\n installed_version: refreshed?.manifest_version,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction summarize(\n cli: UpgradeCliResult,\n packages: UpgradePackageResult[],\n includeCli: boolean,\n includePackages: boolean,\n): UpgradeResult[\"summary\"] {\n const statuses = [includeCli ? cli.status : undefined, ...packages.map((entry) => entry.status)].filter(\n (value): value is UpgradeCliResult[\"status\"] => typeof value === \"string\",\n );\n return {\n requested_cli: includeCli,\n requested_packages: includePackages,\n planned: statuses.filter((status) => status === \"planned\").length,\n updated: statuses.filter((status) => status === \"updated\").length,\n skipped: statuses.filter((status) => status === \"skipped\").length,\n failed: statuses.filter((status) => status === \"failed\").length,\n };\n}\n\n/**\n * Implements run upgrade for the public runtime surface of this module.\n */\nexport async function runUpgrade(\n target: string | undefined,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n): Promise<UpgradeResult> {\n if (options.cliOnly === true && options.packagesOnly === true) {\n throw new PmCliError('Options \"--cli-only\" and \"--packages-only\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n\n const scope = resolveScope(options);\n const dryRun = options.dryRun === true;\n const normalizedTarget = typeof target === \"string\" && target.trim().length > 0 ? target.trim() : undefined;\n if (options.cliOnly === true && normalizedTarget) {\n throw new PmCliError('A package target cannot be used with \"--cli-only\".', EXIT_CODE.USAGE);\n }\n const includeCli = options.packagesOnly === true || normalizedTarget ? false : true;\n const includePackages = options.cliOnly === true ? false : true;\n const cli = includeCli\n ? await upgradeCli(options, dryRun)\n : {\n requested: false,\n status: \"skipped\",\n package: resolveCliPackage(options),\n target: `${resolveCliPackage(options)}@${resolveTag(options)}`,\n command: [\"npm\", \"install\", \"-g\", `${resolveCliPackage(options)}@${resolveTag(options)}`],\n repair: options.repair === true,\n reason: \"not_requested\",\n } as UpgradeCliResult;\n\n let packageRecords = includePackages ? await readManagedRecords(scope, global) : [];\n if (normalizedTarget) {\n packageRecords = packageRecords.filter((entry) => packageRecordMatchesTarget(entry, normalizedTarget));\n if (packageRecords.length === 0) {\n throw new PmCliError(`Managed package \"${normalizedTarget}\" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);\n }\n }\n\n const packages: UpgradePackageResult[] = [];\n for (const record of packageRecords) {\n packages.push(await upgradePackageRecord(record, options, global, scope, dryRun));\n }\n\n const summary = summarize(cli, packages, includeCli, includePackages);\n return {\n ok: summary.failed === 0,\n action: \"upgrade\",\n dry_run: dryRun,\n scope,\n target: normalizedTarget,\n cli,\n packages,\n summary,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAKA,SAAS,gBAAgB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AAkB,MAAM,mBAAmB,OAAO,MAAM,IAAI,CAAA;AACjF,MAAI,kBAAkB;AACpB,qBAAiB,eAAe,OAAO,CAAC,UAAU,2BAA2B,OAAO,gBAAgB,CAAC;AACrG,QAAI,eAAe,WAAW,GAAG;AAC/B,YAAM,IAAI,WAAW,oBAAoB,gBAAgB,sBAAsB,KAAK,WAAW,UAAU,SAAS;IACpH;EACF;AAEA,QAAM,WAAmC,CAAA;AACzC,aAAW,UAAU,gBAAgB;AACnC,aAAS,KAAK,MAAM,qBAAqB,QAAQ,SAAS,QAAQ,OAAO,MAAM,CAAC;EAClF;AAEA,QAAM,UAAU,UAAU,KAAK,UAAU,YAAY,eAAe;AACpE,SAAO;IACL,IAAI,QAAQ,WAAW;IACvB,QAAQ;IACR,SAAS;IACT;IACA,QAAQ;IACR;IACA;IACA;;AAEJ","debugId":"e29e4c63-bf56-5d14-b8f1-25beaf2d15da"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/upgrade.ts"],"sourcesContent":["/**\n * @module cli/commands/upgrade\n *\n * Implements the pm upgrade command surface and its agent-facing runtime behavior.\n */\nimport { execFile } from \"node:child_process\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\nimport {\n readManagedExtensionState,\n runExtension,\n type ExtensionScope,\n type ManagedExtensionRecord,\n type ManagedExtensionSource,\n} from \"./extension.js\";\nimport { resolveExtensionRoots } from \"../../core/extensions/loader.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { resolvePmCliVersion } from \"../../core/packages/root.js\";\n\nconst execFileAsync = promisify(execFile);\nconst DEFAULT_CLI_PACKAGE = \"@unbrained/pm-cli\";\nconst DEFAULT_TAG = \"latest\";\n\n/**\n * Documents the upgrade command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandOptions {\n dryRun?: boolean;\n cliOnly?: boolean;\n packagesOnly?: boolean;\n project?: boolean;\n local?: boolean;\n global?: boolean;\n repair?: boolean;\n tag?: string;\n packageName?: string;\n commandRunner?: UpgradeCommandRunner;\n}\n\nexport const _testOnly = {\n defaultCommandRunner,\n isLocalNpmSpec,\n normalizeTarget,\n packageRecordMatchesTarget,\n resolveCliPackage,\n resolvePackageInstallSource,\n resolveRunnablePackageSource,\n resolveScope,\n resolveTag,\n packageCommandFor,\n summarize,\n};\n\n/**\n * Documents the upgrade command runner result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandRunnerResult {\n stdout: string;\n stderr: string;\n}\n\n/**\n * Restricts upgrade command runner values accepted by command, SDK, and storage contracts.\n */\nexport type UpgradeCommandRunner = (\n command: string,\n args: string[],\n options?: { cwd?: string },\n) => Promise<UpgradeCommandRunnerResult>;\n\n/**\n * Documents the upgrade cli result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCliResult {\n requested: boolean;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n package: string;\n target: string;\n command: string[];\n before_version?: string;\n after_version?: string;\n repair: boolean;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade package result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradePackageResult {\n name: string;\n directory: string;\n scope: ExtensionScope;\n source: ManagedExtensionSource;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n command: string[];\n previous_version: string;\n installed_version?: string;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeResult {\n ok: boolean;\n action: \"upgrade\";\n dry_run: boolean;\n scope: ExtensionScope;\n target?: string;\n cli: UpgradeCliResult;\n packages: UpgradePackageResult[];\n summary: {\n requested_cli: boolean;\n requested_packages: boolean;\n planned: number;\n updated: number;\n skipped: number;\n failed: number;\n };\n}\n\nfunction resolveScope(options: UpgradeCommandOptions): ExtensionScope {\n const projectLike = options.project === true || options.local === true;\n const global = options.global === true;\n if (projectLike && global) {\n throw new PmCliError('Options \"--project/--local\" and \"--global\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n return global ? \"global\" : \"project\";\n}\n\nfunction normalizeTarget(value: string): string {\n return value.trim().toLowerCase();\n}\n\nfunction packageRecordMatchesTarget(record: ManagedExtensionRecord, target: string): boolean {\n const normalizedTarget = normalizeTarget(target);\n const values = [\n record.name,\n record.directory,\n record.source.input,\n record.source.location,\n record.source.package,\n record.source.repository,\n record.source.owner && record.source.repo ? `${record.source.owner}/${record.source.repo}` : undefined,\n ];\n return values.some((value) => typeof value === \"string\" && normalizeTarget(value) === normalizedTarget);\n}\n\nfunction resolveRoots(scope: ExtensionScope, global: GlobalOptions): {\n selected_root: string;\n} {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const roots = resolveExtensionRoots(pmRoot, process.cwd());\n return {\n selected_root: scope === \"global\" ? roots.global : roots.project,\n };\n}\n\nasync function defaultCommandRunner(\n command: string,\n args: string[],\n options?: { cwd?: string },\n): Promise<UpgradeCommandRunnerResult> {\n try {\n const result = await execFileAsync(command, args, {\n cwd: options?.cwd,\n encoding: \"utf8\",\n });\n return {\n stdout: result.stdout,\n stderr: result.stderr,\n };\n } catch (error: unknown) {\n const stderr = typeof error === \"object\" && error !== null && \"stderr\" in error\n ? String((error as { stderr?: unknown }).stderr ?? \"\")\n : \"\";\n const message = stderr.trim().length > 0 ? stderr.trim() : error instanceof Error ? error.message : String(error);\n throw new PmCliError(`Command failed: ${command} ${args.join(\" \")}\\n${message}`, EXIT_CODE.GENERIC_FAILURE);\n }\n}\n\nasync function readCurrentVersion(): Promise<string | undefined> {\n return resolvePmCliVersion(import.meta.url, [\"../../..\"]);\n}\n\nfunction resolveTag(options: UpgradeCommandOptions): string {\n return typeof options.tag === \"string\" && options.tag.trim().length > 0 ? options.tag.trim() : DEFAULT_TAG;\n}\n\nfunction resolveCliPackage(options: UpgradeCommandOptions): string {\n return typeof options.packageName === \"string\" && options.packageName.trim().length > 0\n ? options.packageName.trim()\n : DEFAULT_CLI_PACKAGE;\n}\n\nasync function upgradeCli(options: UpgradeCommandOptions, dryRun: boolean): Promise<UpgradeCliResult> {\n const runner = options.commandRunner ?? defaultCommandRunner;\n const packageName = resolveCliPackage(options);\n const tag = resolveTag(options);\n const target = `${packageName}@${tag}`;\n const command = [\"npm\", \"install\", \"-g\", target];\n if (options.repair === true) {\n command.push(\"--force\");\n }\n const beforeVersion = await readCurrentVersion();\n const planned: UpgradeCliResult = {\n requested: true,\n status: \"planned\",\n package: packageName,\n target,\n command,\n before_version: beforeVersion,\n repair: options.repair === true,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runner(command[0]!, command.slice(1));\n const verified = await runner(\"pm\", [\"--version\"]);\n return {\n ...planned,\n status: \"updated\",\n after_version: verified.stdout.trim() || undefined,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction isLocalNpmSpec(spec: string): boolean {\n return path.isAbsolute(spec) || spec.startsWith(\".\") || spec.startsWith(\"..\") || spec.startsWith(\"file:\");\n}\n\nfunction resolvePackageInstallSource(source: ManagedExtensionSource, tag: string): string {\n if (source.kind === \"npm\") {\n const rawSpec = source.input.startsWith(\"npm:\") ? source.input.slice(\"npm:\".length).trim() : source.input.trim();\n if (!isLocalNpmSpec(rawSpec) && source.package && source.package.trim().length > 0) {\n return `npm:${source.package.trim()}@${tag}`;\n }\n return source.input.startsWith(\"npm:\") ? source.input : `npm:${source.input}`;\n }\n return source.input;\n}\n\nasync function resolveRunnablePackageSource(source: ManagedExtensionSource, tag: string): Promise<string> {\n const installSource = resolvePackageInstallSource(source, tag);\n if (source.kind !== \"local\") {\n return installSource;\n }\n if (await pathExists(installSource)) {\n return installSource;\n }\n if (await pathExists(source.location)) {\n return source.location;\n }\n return installSource;\n}\n\nfunction packageCommandFor(source: ManagedExtensionSource, installSource: string, scope: ExtensionScope, ref?: string): string[] {\n const command = [\"pm\", \"install\", installSource, scope === \"global\" ? \"--global\" : \"--project\"];\n if (source.kind === \"github\" && ref && ref.trim().length > 0) {\n command.push(\"--ref\", ref.trim());\n }\n return command;\n}\n\nasync function readManagedRecords(scope: ExtensionScope, global: GlobalOptions): Promise<ManagedExtensionRecord[]> {\n const roots = resolveRoots(scope, global);\n const managedState = await readManagedExtensionState(roots.selected_root);\n return managedState.state.entries.filter((entry) => entry.scope === scope);\n}\n\nasync function refreshManagedRecord(\n scope: ExtensionScope,\n global: GlobalOptions,\n record: ManagedExtensionRecord,\n): Promise<ManagedExtensionRecord | undefined> {\n const records = await readManagedRecords(scope, global);\n return records.find((candidate) => packageRecordMatchesTarget(candidate, record.name)) ??\n records.find((candidate) => normalizeTarget(candidate.directory) === normalizeTarget(record.directory));\n}\n\nasync function upgradePackageRecord(\n record: ManagedExtensionRecord,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n scope: ExtensionScope,\n dryRun: boolean,\n): Promise<UpgradePackageResult> {\n const tag = resolveTag(options);\n const installSource = await resolveRunnablePackageSource(record.source, tag);\n const command = packageCommandFor(record.source, installSource, scope, record.source.ref);\n const planned: UpgradePackageResult = {\n name: record.name,\n directory: record.directory,\n scope,\n source: record.source,\n status: \"planned\",\n command,\n previous_version: record.manifest_version,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runExtension(\n installSource,\n {\n install: true,\n project: scope === \"project\",\n global: scope === \"global\",\n ref: record.source.kind === \"github\" ? record.source.ref : undefined,\n },\n global,\n );\n const refreshed = await refreshManagedRecord(scope, global, record);\n return {\n ...planned,\n status: \"updated\",\n installed_version: refreshed?.manifest_version,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction summarize(\n cli: UpgradeCliResult,\n packages: UpgradePackageResult[],\n includeCli: boolean,\n includePackages: boolean,\n): UpgradeResult[\"summary\"] {\n const statuses = [includeCli ? cli.status : undefined, ...packages.map((entry) => entry.status)].filter(\n (value): value is UpgradeCliResult[\"status\"] => typeof value === \"string\",\n );\n return {\n requested_cli: includeCli,\n requested_packages: includePackages,\n planned: statuses.filter((status) => status === \"planned\").length,\n updated: statuses.filter((status) => status === \"updated\").length,\n skipped: statuses.filter((status) => status === \"skipped\").length,\n failed: statuses.filter((status) => status === \"failed\").length,\n };\n}\n\n/**\n * Implements run upgrade for the public runtime surface of this module.\n */\nexport async function runUpgrade(\n target: string | undefined,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n): Promise<UpgradeResult> {\n if (options.cliOnly === true && options.packagesOnly === true) {\n throw new PmCliError('Options \"--cli-only\" and \"--packages-only\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n\n const scope = resolveScope(options);\n const dryRun = options.dryRun === true;\n const normalizedTarget = typeof target === \"string\" && target.trim().length > 0 ? target.trim() : undefined;\n if (options.cliOnly === true && normalizedTarget) {\n throw new PmCliError('A package target cannot be used with \"--cli-only\".', EXIT_CODE.USAGE);\n }\n const includeCli = options.packagesOnly === true || normalizedTarget ? false : true;\n const includePackages = options.cliOnly === true ? false : true;\n const cli = includeCli\n ? await upgradeCli(options, dryRun)\n : {\n requested: false,\n status: \"skipped\",\n package: resolveCliPackage(options),\n target: `${resolveCliPackage(options)}@${resolveTag(options)}`,\n command: [\"npm\", \"install\", \"-g\", `${resolveCliPackage(options)}@${resolveTag(options)}`],\n repair: options.repair === true,\n reason: \"not_requested\",\n } as UpgradeCliResult;\n\n let packageRecords = includePackages ? await readManagedRecords(scope, global) : [];\n if (normalizedTarget) {\n packageRecords = packageRecords.filter((entry) => packageRecordMatchesTarget(entry, normalizedTarget));\n if (packageRecords.length === 0) {\n throw new PmCliError(`Managed package \"${normalizedTarget}\" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);\n }\n }\n\n const packages: UpgradePackageResult[] = [];\n for (const record of packageRecords) {\n packages.push(await upgradePackageRecord(record, options, global, scope, dryRun));\n }\n\n const summary = summarize(cli, packages, includeCli, includePackages);\n return {\n ok: summary.failed === 0,\n action: \"upgrade\",\n dry_run: dryRun,\n scope,\n target: normalizedTarget,\n cli,\n packages,\n summary,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,SAAS,iBAAiB;AAgB1B,IAAM,gBAAgB,UAAU,QAAQ;AACxC,IAAM,sBAAsB;AAC5B,IAAM,cAAc;AAkBb,IAAM,YAAY;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAyEF,SAAS,aAAa,SAA8B;AAClD,QAAM,cAAc,QAAQ,YAAY,QAAQ,QAAQ,UAAU;AAClE,QAAM,SAAS,QAAQ,WAAW;AAClC,MAAI,eAAe,QAAQ;AACzB,UAAM,IAAI,WAAW,sEAAsE,UAAU,KAAK;EAC5G;AACA,SAAO,SAAS,WAAW;AAC7B;AAEA,SAAS,gBAAgB,OAAa;AACpC,SAAO,MAAM,KAAI,EAAG,YAAW;AACjC;AAEA,SAAS,2BAA2B,QAAgC,QAAc;AAChF,QAAM,mBAAmB,gBAAgB,MAAM;AAC/C,QAAM,SAAS;IACb,OAAO;IACP,OAAO;IACP,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO,SAAS,OAAO,OAAO,OAAO,GAAG,OAAO,OAAO,KAAK,IAAI,OAAO,OAAO,IAAI,KAAK;;AAE/F,SAAO,OAAO,KAAK,CAAC,UAAU,OAAO,UAAU,YAAY,gBAAgB,KAAK,MAAM,gBAAgB;AACxG;AAEA,SAAS,aAAa,OAAuB,QAAqB;AAGhE,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IAAI;AACvD,QAAM,QAAQ,sBAAsB,QAAQ,QAAQ,IAAG,CAAE;AACzD,SAAO;IACL,e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kB,OAAO;IAClC,QAAQ,GAAG,kBAAkB,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC;IAC5D,SAAS,CAAC,OAAO,WAAW,MAAM,GAAG,kBAAkB,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC,EAAE;IACxF,QAAQ,QAAQ,WAAW;IAC3B,QAAQ;;AAGd,MAAI,iBAAiB,kBAAkB,MAAM,mBAAmB,OAAO,MAAM,IAAI,CAAA;AACjF,MAAI,kBAAkB;AACpB,qBAAiB,eAAe,OAAO,CAAC,UAAU,2BAA2B,OAAO,gBAAgB,CAAC;AACrG,QAAI,eAAe,WAAW,GAAG;AAC/B,YAAM,IAAI,WAAW,oBAAoB,gBAAgB,sBAAsB,KAAK,WAAW,UAAU,SAAS;IACpH;EACF;AAEA,QAAM,WAAmC,CAAA;AACzC,aAAW,UAAU,gBAAgB;AACnC,aAAS,KAAK,MAAM,qBAAqB,QAAQ,SAAS,QAAQ,OAAO,MAAM,CAAC;EAClF;AAEA,QAAM,UAAU,UAAU,KAAK,UAAU,YAAY,eAAe;AACpE,SAAO;IACL,IAAI,QAAQ,WAAW;IACvB,QAAQ;IACR,SAAS;IACT;IACA,QAAQ;IACR;IACA;IACA;;AAEJ","debugId":"4009e0ef-d00a-5422-82a2-e126fbaaba96"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readManagedExtensionState,
|
|
3
3
|
runExtension
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-INPHFO33.js";
|
|
6
|
-
import "./chunk-PEL2NLQE.js";
|
|
4
|
+
} from "./chunk-5QFDBI4F.js";
|
|
7
5
|
import "./chunk-5HIZDR5A.js";
|
|
8
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-RMMQ74TG.js";
|
|
7
|
+
import "./chunk-LB6TP6MC.js";
|
|
8
|
+
import "./chunk-SDR5J34Q.js";
|
|
9
|
+
import "./chunk-RH5ZBYFD.js";
|
|
10
|
+
import "./chunk-MDPEOIGN.js";
|
|
11
|
+
import "./chunk-3K2M5OYU.js";
|
|
12
|
+
import "./chunk-BHO33VBQ.js";
|
|
13
|
+
import "./chunk-WYDHYJPO.js";
|
|
9
14
|
import {
|
|
10
15
|
EXIT_CODE,
|
|
11
16
|
PmCliError,
|
|
@@ -13,7 +18,7 @@ import {
|
|
|
13
18
|
resolveExtensionRoots,
|
|
14
19
|
resolvePmCliVersion,
|
|
15
20
|
resolvePmRoot
|
|
16
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RVUALSJF.js";
|
|
17
22
|
|
|
18
23
|
// dist/cli/commands/upgrade.js
|
|
19
24
|
import { execFile } from "node:child_process";
|
|
@@ -275,4 +280,4 @@ export {
|
|
|
275
280
|
_testOnly,
|
|
276
281
|
runUpgrade
|
|
277
282
|
};
|
|
278
|
-
//# sourceMappingURL=upgrade-
|
|
283
|
+
//# sourceMappingURL=upgrade-HAK6JG2O.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../cli/commands/upgrade.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * @module cli/commands/upgrade\n *\n * Implements the pm upgrade command surface and its agent-facing runtime behavior.\n */\nimport { execFile } from \"node:child_process\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\nimport {\n readManagedExtensionState,\n runExtension,\n type ExtensionScope,\n type ManagedExtensionRecord,\n type ManagedExtensionSource,\n} from \"./extension.js\";\nimport { resolveExtensionRoots } from \"../../core/extensions/loader.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { resolvePmCliVersion } from \"../../core/packages/root.js\";\n\nconst execFileAsync = promisify(execFile);\nconst DEFAULT_CLI_PACKAGE = \"@unbrained/pm-cli\";\nconst DEFAULT_TAG = \"latest\";\n\n/**\n * Documents the upgrade command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandOptions {\n dryRun?: boolean;\n cliOnly?: boolean;\n packagesOnly?: boolean;\n project?: boolean;\n local?: boolean;\n global?: boolean;\n repair?: boolean;\n tag?: string;\n packageName?: string;\n commandRunner?: UpgradeCommandRunner;\n}\n\nexport const _testOnly = {\n defaultCommandRunner,\n isLocalNpmSpec,\n normalizeTarget,\n packageRecordMatchesTarget,\n resolveCliPackage,\n resolvePackageInstallSource,\n resolveRunnablePackageSource,\n resolveScope,\n resolveTag,\n packageCommandFor,\n summarize,\n};\n\n/**\n * Documents the upgrade command runner result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandRunnerResult {\n stdout: string;\n stderr: string;\n}\n\n/**\n * Restricts upgrade command runner values accepted by command, SDK, and storage contracts.\n */\nexport type UpgradeCommandRunner = (\n command: string,\n args: string[],\n options?: { cwd?: string },\n) => Promise<UpgradeCommandRunnerResult>;\n\n/**\n * Documents the upgrade cli result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCliResult {\n requested: boolean;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n package: string;\n target: string;\n command: string[];\n before_version?: string;\n after_version?: string;\n repair: boolean;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade package result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradePackageResult {\n name: string;\n directory: string;\n scope: ExtensionScope;\n source: ManagedExtensionSource;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n command: string[];\n previous_version: string;\n installed_version?: string;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeResult {\n ok: boolean;\n action: \"upgrade\";\n dry_run: boolean;\n scope: ExtensionScope;\n target?: string;\n cli: UpgradeCliResult;\n packages: UpgradePackageResult[];\n summary: {\n requested_cli: boolean;\n requested_packages: boolean;\n planned: number;\n updated: number;\n skipped: number;\n failed: number;\n };\n}\n\nfunction resolveScope(options: UpgradeCommandOptions): ExtensionScope {\n const projectLike = options.project === true || options.local === true;\n const global = options.global === true;\n if (projectLike && global) {\n throw new PmCliError('Options \"--project/--local\" and \"--global\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n return global ? \"global\" : \"project\";\n}\n\nfunction normalizeTarget(value: string): string {\n return value.trim().toLowerCase();\n}\n\nfunction packageRecordMatchesTarget(record: ManagedExtensionRecord, target: string): boolean {\n const normalizedTarget = normalizeTarget(target);\n const values = [\n record.name,\n record.directory,\n record.source.input,\n record.source.location,\n record.source.package,\n record.source.repository,\n record.source.owner && record.source.repo ? `${record.source.owner}/${record.source.repo}` : undefined,\n ];\n return values.some((value) => typeof value === \"string\" && normalizeTarget(value) === normalizedTarget);\n}\n\nfunction resolveRoots(scope: ExtensionScope, global: GlobalOptions): {\n selected_root: string;\n} {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const roots = resolveExtensionRoots(pmRoot, process.cwd());\n return {\n selected_root: scope === \"global\" ? roots.global : roots.project,\n };\n}\n\nasync function defaultCommandRunner(\n command: string,\n args: string[],\n options?: { cwd?: string },\n): Promise<UpgradeCommandRunnerResult> {\n try {\n const result = await execFileAsync(command, args, {\n cwd: options?.cwd,\n encoding: \"utf8\",\n });\n return {\n stdout: result.stdout,\n stderr: result.stderr,\n };\n } catch (error: unknown) {\n const stderr = typeof error === \"object\" && error !== null && \"stderr\" in error\n ? String((error as { stderr?: unknown }).stderr ?? \"\")\n : \"\";\n const message = stderr.trim().length > 0 ? stderr.trim() : error instanceof Error ? error.message : String(error);\n throw new PmCliError(`Command failed: ${command} ${args.join(\" \")}\\n${message}`, EXIT_CODE.GENERIC_FAILURE);\n }\n}\n\nasync function readCurrentVersion(): Promise<string | undefined> {\n return resolvePmCliVersion(import.meta.url, [\"../../..\"]);\n}\n\nfunction resolveTag(options: UpgradeCommandOptions): string {\n return typeof options.tag === \"string\" && options.tag.trim().length > 0 ? options.tag.trim() : DEFAULT_TAG;\n}\n\nfunction resolveCliPackage(options: UpgradeCommandOptions): string {\n return typeof options.packageName === \"string\" && options.packageName.trim().length > 0\n ? options.packageName.trim()\n : DEFAULT_CLI_PACKAGE;\n}\n\nasync function upgradeCli(options: UpgradeCommandOptions, dryRun: boolean): Promise<UpgradeCliResult> {\n const runner = options.commandRunner ?? defaultCommandRunner;\n const packageName = resolveCliPackage(options);\n const tag = resolveTag(options);\n const target = `${packageName}@${tag}`;\n const command = [\"npm\", \"install\", \"-g\", target];\n if (options.repair === true) {\n command.push(\"--force\");\n }\n const beforeVersion = await readCurrentVersion();\n const planned: UpgradeCliResult = {\n requested: true,\n status: \"planned\",\n package: packageName,\n target,\n command,\n before_version: beforeVersion,\n repair: options.repair === true,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runner(command[0]!, command.slice(1));\n const verified = await runner(\"pm\", [\"--version\"]);\n return {\n ...planned,\n status: \"updated\",\n after_version: verified.stdout.trim() || undefined,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction isLocalNpmSpec(spec: string): boolean {\n return path.isAbsolute(spec) || spec.startsWith(\".\") || spec.startsWith(\"..\") || spec.startsWith(\"file:\");\n}\n\nfunction resolvePackageInstallSource(source: ManagedExtensionSource, tag: string): string {\n if (source.kind === \"npm\") {\n const rawSpec = source.input.startsWith(\"npm:\") ? source.input.slice(\"npm:\".length).trim() : source.input.trim();\n if (!isLocalNpmSpec(rawSpec) && source.package && source.package.trim().length > 0) {\n return `npm:${source.package.trim()}@${tag}`;\n }\n return source.input.startsWith(\"npm:\") ? source.input : `npm:${source.input}`;\n }\n return source.input;\n}\n\nasync function resolveRunnablePackageSource(source: ManagedExtensionSource, tag: string): Promise<string> {\n const installSource = resolvePackageInstallSource(source, tag);\n if (source.kind !== \"local\") {\n return installSource;\n }\n if (await pathExists(installSource)) {\n return installSource;\n }\n if (await pathExists(source.location)) {\n return source.location;\n }\n return installSource;\n}\n\nfunction packageCommandFor(source: ManagedExtensionSource, installSource: string, scope: ExtensionScope, ref?: string): string[] {\n const command = [\"pm\", \"install\", installSource, scope === \"global\" ? \"--global\" : \"--project\"];\n if (source.kind === \"github\" && ref && ref.trim().length > 0) {\n command.push(\"--ref\", ref.trim());\n }\n return command;\n}\n\nasync function readManagedRecords(scope: ExtensionScope, global: GlobalOptions): Promise<ManagedExtensionRecord[]> {\n const roots = resolveRoots(scope, global);\n const managedState = await readManagedExtensionState(roots.selected_root);\n return managedState.state.entries.filter((entry) => entry.scope === scope);\n}\n\nasync function refreshManagedRecord(\n scope: ExtensionScope,\n global: GlobalOptions,\n record: ManagedExtensionRecord,\n): Promise<ManagedExtensionRecord | undefined> {\n const records = await readManagedRecords(scope, global);\n return records.find((candidate) => packageRecordMatchesTarget(candidate, record.name)) ??\n records.find((candidate) => normalizeTarget(candidate.directory) === normalizeTarget(record.directory));\n}\n\nasync function upgradePackageRecord(\n record: ManagedExtensionRecord,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n scope: ExtensionScope,\n dryRun: boolean,\n): Promise<UpgradePackageResult> {\n const tag = resolveTag(options);\n const installSource = await resolveRunnablePackageSource(record.source, tag);\n const command = packageCommandFor(record.source, installSource, scope, record.source.ref);\n const planned: UpgradePackageResult = {\n name: record.name,\n directory: record.directory,\n scope,\n source: record.source,\n status: \"planned\",\n command,\n previous_version: record.manifest_version,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runExtension(\n installSource,\n {\n install: true,\n project: scope === \"project\",\n global: scope === \"global\",\n ref: record.source.kind === \"github\" ? record.source.ref : undefined,\n },\n global,\n );\n const refreshed = await refreshManagedRecord(scope, global, record);\n return {\n ...planned,\n status: \"updated\",\n installed_version: refreshed?.manifest_version,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction summarize(\n cli: UpgradeCliResult,\n packages: UpgradePackageResult[],\n includeCli: boolean,\n includePackages: boolean,\n): UpgradeResult[\"summary\"] {\n const statuses = [includeCli ? cli.status : undefined, ...packages.map((entry) => entry.status)].filter(\n (value): value is UpgradeCliResult[\"status\"] => typeof value === \"string\",\n );\n return {\n requested_cli: includeCli,\n requested_packages: includePackages,\n planned: statuses.filter((status) => status === \"planned\").length,\n updated: statuses.filter((status) => status === \"updated\").length,\n skipped: statuses.filter((status) => status === \"skipped\").length,\n failed: statuses.filter((status) => status === \"failed\").length,\n };\n}\n\n/**\n * Implements run upgrade for the public runtime surface of this module.\n */\nexport async function runUpgrade(\n target: string | undefined,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n): Promise<UpgradeResult> {\n if (options.cliOnly === true && options.packagesOnly === true) {\n throw new PmCliError('Options \"--cli-only\" and \"--packages-only\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n\n const scope = resolveScope(options);\n const dryRun = options.dryRun === true;\n const normalizedTarget = typeof target === \"string\" && target.trim().length > 0 ? target.trim() : undefined;\n if (options.cliOnly === true && normalizedTarget) {\n throw new PmCliError('A package target cannot be used with \"--cli-only\".', EXIT_CODE.USAGE);\n }\n const includeCli = options.packagesOnly === true || normalizedTarget ? false : true;\n const includePackages = options.cliOnly === true ? false : true;\n const cli = includeCli\n ? await upgradeCli(options, dryRun)\n : {\n requested: false,\n status: \"skipped\",\n package: resolveCliPackage(options),\n target: `${resolveCliPackage(options)}@${resolveTag(options)}`,\n command: [\"npm\", \"install\", \"-g\", `${resolveCliPackage(options)}@${resolveTag(options)}`],\n repair: options.repair === true,\n reason: \"not_requested\",\n } as UpgradeCliResult;\n\n let packageRecords = includePackages ? await readManagedRecords(scope, global) : [];\n if (normalizedTarget) {\n packageRecords = packageRecords.filter((entry) => packageRecordMatchesTarget(entry, normalizedTarget));\n if (packageRecords.length === 0) {\n throw new PmCliError(`Managed package \"${normalizedTarget}\" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);\n }\n }\n\n const packages: UpgradePackageResult[] = [];\n for (const record of packageRecords) {\n packages.push(await upgradePackageRecord(record, options, global, scope, dryRun));\n }\n\n const summary = summarize(cli, packages, includeCli, includePackages);\n return {\n ok: summary.failed === 0,\n action: \"upgrade\",\n dry_run: dryRun,\n scope,\n target: normalizedTarget,\n cli,\n packages,\n summary,\n };\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,SAAS,iBAAiB;;;;;;;;AAgB1B,IAAM,gBAAgB,UAAU,QAAQ;AACxC,IAAM,sBAAsB;AAC5B,IAAM,cAAc;AAkBb,IAAM,YAAY;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAyEF,SAAS,aAAa,SAA8B;AAClD,QAAM,cAAc,QAAQ,YAAY,QAAQ,QAAQ,UAAU;AAClE,QAAMA,UAAS,QAAQ,WAAW;AAClC,MAAI,eAAeA,SAAQ;AACzB,UAAM,IAAI,WAAW,sEAAsE,UAAU,KAAK;EAC5G;AACA,SAAOA,UAAS,WAAW;AAC7B;AAEA,SAAS,gBAAgB,OAAa;AACpC,SAAO,MAAM,KAAI,EAAG,YAAW;AACjC;AAEA,SAAS,2BAA2B,QAAgC,QAAc;AAChF,QAAM,mBAAmB,gBAAgB,MAAM;AAC/C,QAAM,SAAS;IACb,OAAO;IACP,OAAO;IACP,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO,SAAS,OAAO,OAAO,OAAO,GAAG,OAAO,OAAO,KAAK,IAAI,OAAO,OAAO,IAAI,KAAK;;AAE/F,SAAO,OAAO,KAAK,CAAC,UAAU,OAAO,UAAU,YAAY,gBAAgB,KAAK,MAAM,gBAAgB;AACxG;AAEA,SAAS,aAAa,OAAuBA,SAAqB;AAGhE,QAAM,SAAS,cAAc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