@unbrained/pm-cli 2026.7.1 → 2026.7.3
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/.claude-plugin/marketplace.json +3 -3
- package/CHANGELOG.md +25 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +1 -1
- package/dist/cli/commander-usage.d.ts +2 -0
- package/dist/cli/commander-usage.js +110 -86
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +79 -57
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/aggregate.js +102 -79
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/calendar.js +278 -243
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +176 -114
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.js +157 -129
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +50 -42
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/config.d.ts +2 -0
- package/dist/cli/commands/config.js +443 -879
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.js +365 -287
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +352 -238
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +32 -17
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +46 -39
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/dedupe-merge.js +88 -69
- package/dist/cli/commands/dedupe-merge.js.map +1 -1
- package/dist/cli/commands/extension/doctor.js +56 -67
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/shared.js +21 -15
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/get.js +114 -81
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +17 -0
- package/dist/cli/commands/health.js +545 -417
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.js +209 -140
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.js +162 -119
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +120 -85
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.js +32 -19
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.d.ts +8 -2
- package/dist/cli/commands/init.js +263 -162
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.js +152 -102
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/next.js +60 -40
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/plan.js +373 -298
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/profile.js +23 -15
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/commands/recurrence-parsers.js +43 -25
- package/dist/cli/commands/recurrence-parsers.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +21 -5
- package/dist/cli/commands/reindex.js +345 -205
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +8 -7
- package/dist/cli/commands/restore.js +105 -69
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.js +33 -30
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +10 -2
- package/dist/cli/commands/search.js +503 -470
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/telemetry.js +98 -87
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/test-all.js +237 -168
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +6 -5
- package/dist/cli/commands/test.js +424 -344
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +57 -42
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +1 -1
- package/dist/cli/commands/update.js +738 -671
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +20 -1
- package/dist/cli/commands/validate.js +478 -343
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +406 -361
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.js +27 -19
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-json-payload.js +57 -49
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.d.ts +47 -0
- package/dist/cli/main.js +474 -371
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migration-gates.js +22 -45
- package/dist/cli/migration-gates.js.map +1 -1
- package/dist/cli/register-list-query.js +299 -310
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +763 -779
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +386 -362
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +120 -101
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +4 -0
- package/dist/cli/registration-helpers.js +45 -56
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js → activity-5YWLSPGE.js} +9 -9
- package/dist/cli-bundle/chunks/activity-BIML7K2D.js +16 -0
- package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js → aggregate-2V2M3JZU.js} +107 -83
- package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js.map → aggregate-2V2M3JZU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{aggregate-JTEF4BP7.js → aggregate-EK7DXML7.js} +108 -84
- package/dist/cli-bundle/chunks/aggregate-EK7DXML7.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-LOVPGVPT.js → append-EZESUVJT.js} +8 -8
- package/dist/cli-bundle/chunks/{append-QCFJSDFL.js → append-JFG4WQMG.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-TP5Q5ZD3.js → chunk-32IUNTG4.js} +158 -119
- package/dist/cli-bundle/chunks/chunk-32IUNTG4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js → chunk-3W2HJKJX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VARHOHYV.js → chunk-4EXFFP7T.js} +86 -52
- package/dist/cli-bundle/chunks/chunk-4EXFFP7T.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js → chunk-4PFVUUYV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JSU5P7VS.js → chunk-4WB6S4YX.js} +308 -184
- package/dist/cli-bundle/chunks/chunk-4WB6S4YX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HXTQJXWT.js → chunk-572FKBRL.js} +61 -102
- package/dist/cli-bundle/chunks/chunk-572FKBRL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js → chunk-5E7N4T2Z.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js → chunk-5IZUBZBR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js → chunk-5JIWFWOZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FFMQB7WR.js → chunk-67LARBDL.js} +493 -404
- package/dist/cli-bundle/chunks/chunk-67LARBDL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js → chunk-6CDCWKSX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3K2M5OYU.js → chunk-6KRFL33E.js} +308 -184
- package/dist/cli-bundle/chunks/chunk-6KRFL33E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js → chunk-6NYJGMTY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js → chunk-7CLLC75T.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2466X6E4.js → chunk-7LYO6S5A.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js → chunk-A3OQ7TFW.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-5CGRF3L5.js → chunk-AIKU3IIL.js} +153 -90
- package/dist/cli-bundle/chunks/chunk-AIKU3IIL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WYDHYJPO.js → chunk-AJHYQCBJ.js} +39 -5
- package/dist/cli-bundle/chunks/chunk-AJHYQCBJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
- package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OTUHB4HS.js → chunk-BE2SR6QL.js} +92 -77
- package/dist/cli-bundle/chunks/chunk-BE2SR6QL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JLM7BHI7.js → chunk-BI4R7HI2.js} +75 -53
- package/dist/cli-bundle/chunks/chunk-BI4R7HI2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AXIDKKAT.js → chunk-CXR3CMBQ.js} +33 -6
- package/dist/cli-bundle/chunks/chunk-CXR3CMBQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZETXE4SE.js → chunk-ECU6MMTQ.js} +713 -613
- package/dist/cli-bundle/chunks/chunk-ECU6MMTQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2D4HATP2.js → chunk-EJ2OCBHF.js} +54 -30
- package/dist/cli-bundle/chunks/chunk-EJ2OCBHF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BDTISOSD.js → chunk-EQURFOMH.js} +41 -26
- package/dist/cli-bundle/chunks/chunk-EQURFOMH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js → chunk-ER4ME5U2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js → chunk-ERG65A2L.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IZBR4NRW.js → chunk-F6WNBITZ.js} +157 -113
- package/dist/cli-bundle/chunks/chunk-F6WNBITZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js → chunk-FH2H3CBD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JPECA746.js → chunk-FUFFPIYA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CF7RL6FR.js → chunk-FZJM2TXF.js} +110 -73
- package/dist/cli-bundle/chunks/chunk-FZJM2TXF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js → chunk-GUYNUXQT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js → chunk-GVJE5T7Q.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3J6JRJ3I.js → chunk-HB4FAT3O.js} +42 -60
- package/dist/cli-bundle/chunks/chunk-HB4FAT3O.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-55SNVXRQ.js → chunk-HQAF23Q2.js} +626 -484
- package/dist/cli-bundle/chunks/chunk-HQAF23Q2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js → chunk-JBZ2NTKX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RMMQ74TG.js → chunk-JPATY4SE.js} +54 -30
- package/dist/cli-bundle/chunks/chunk-JPATY4SE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IPYBJWTE.js → chunk-K5DT2YKM.js} +109 -72
- package/dist/cli-bundle/chunks/chunk-K5DT2YKM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js → chunk-KEZOIPCR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RVUALSJF.js → chunk-KHVGM5CS.js} +466 -365
- package/dist/cli-bundle/chunks/chunk-KHVGM5CS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YITK2PJ6.js → chunk-KS6ATO47.js} +288 -175
- package/dist/cli-bundle/chunks/chunk-KS6ATO47.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7R4QEMZZ.js → chunk-L4SLHV6G.js} +463 -362
- package/dist/cli-bundle/chunks/chunk-L4SLHV6G.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RLDHZHQS.js → chunk-LBE5QFMZ.js} +158 -114
- package/dist/cli-bundle/chunks/chunk-LBE5QFMZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-22WKIL3H.js → chunk-LCWQP6NM.js} +76 -54
- package/dist/cli-bundle/chunks/chunk-LCWQP6NM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KNPEF7QG.js → chunk-LOWVNZBZ.js} +91 -76
- package/dist/cli-bundle/chunks/chunk-LOWVNZBZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js → chunk-MDHWWBNZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js → chunk-MEZZZBYX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-V3NOKJF2.js → chunk-MHRS5FUX.js} +288 -175
- package/dist/cli-bundle/chunks/chunk-MHRS5FUX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3XZCOZ5J.js → chunk-NOIEVOK5.js} +391 -313
- package/dist/cli-bundle/chunks/chunk-NOIEVOK5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js → chunk-NZ7QIUP5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js → chunk-OGLGI22K.js} +115 -67
- package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js.map → chunk-OGLGI22K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js → chunk-P5L7Z2O6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BZCEN4JA.js → chunk-PULUSQAV.js} +492 -403
- package/dist/cli-bundle/chunks/chunk-PULUSQAV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3VGN2UWE.js → chunk-QCDTQCMW.js} +22 -30
- package/dist/cli-bundle/chunks/chunk-QCDTQCMW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js → chunk-QNNQAAZ5.js} +24 -18
- package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js.map → chunk-QNNQAAZ5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MDPEOIGN.js → chunk-RAHINBVP.js} +60 -101
- package/dist/cli-bundle/chunks/chunk-RAHINBVP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CWFNTKQJ.js → chunk-RJH5VQHW.js} +43 -61
- package/dist/cli-bundle/chunks/chunk-RJH5VQHW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js → chunk-SU2E4AWU.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js → chunk-SU3TB4NS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JWXRETDF.js → chunk-SYE6WMV6.js} +626 -484
- package/dist/cli-bundle/chunks/chunk-SYE6WMV6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NWMZWYYB.js → chunk-T3P7PMZP.js} +42 -27
- package/dist/cli-bundle/chunks/chunk-T3P7PMZP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js → chunk-T4XBKJ3F.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js → chunk-T6AXEBOP.js} +23 -17
- package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js.map → chunk-T6AXEBOP.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js → chunk-TQ6AX5SQ.js} +58 -69
- package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js.map → chunk-TQ6AX5SQ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4XOIEKSD.js → chunk-U3S2B7TA.js} +86 -52
- package/dist/cli-bundle/chunks/chunk-U3S2B7TA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js → chunk-U5TR4N7J.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js → chunk-UMNQZS4H.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js → chunk-WJA3PXW7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-RGEMWD6Q.js → chunk-WRYERRZX.js} +157 -118
- package/dist/cli-bundle/chunks/chunk-WRYERRZX.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NUHHPVVS.js → chunk-WYOIIFSE.js} +712 -612
- package/dist/cli-bundle/chunks/chunk-WYOIIFSE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js → chunk-XRYSCRZR.js} +116 -68
- package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js.map → chunk-XRYSCRZR.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js → chunk-YF746GTH.js} +59 -70
- package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js.map → chunk-YF746GTH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js → chunk-YPWUSH72.js} +390 -312
- package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js.map → chunk-YPWUSH72.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js → chunk-YSDFIY7N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js → chunk-YSGTMDWC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NFDPYAIP.js → chunk-YVKZ3ANP.js} +21 -29
- package/dist/cli-bundle/chunks/chunk-YVKZ3ANP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
- package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js → chunk-Z5F6XZXE.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js → chunk-Z7RPDF2Y.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3S2KT7NG.js → chunk-ZFTKYWIF.js} +152 -89
- package/dist/cli-bundle/chunks/chunk-ZFTKYWIF.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js → claim-2BGBGSVI.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js → claim-5GU7OE67.js} +8 -8
- package/dist/cli-bundle/chunks/close-6YODBUIV.js +14 -0
- package/dist/cli-bundle/chunks/{close-TQYAAFJP.js → close-AFVKPR57.js} +7 -7
- package/dist/cli-bundle/chunks/{close-many-BG5QQIDQ.js → close-many-7KLOSYLP.js} +186 -122
- package/dist/cli-bundle/chunks/close-many-7KLOSYLP.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-many-LDRVEQY2.js → close-many-JKUJMHLG.js} +187 -123
- package/dist/cli-bundle/chunks/close-many-JKUJMHLG.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js → comments-DNWHEBOS.js} +9 -9
- package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js → comments-RW23R3VE.js} +9 -9
- package/dist/cli-bundle/chunks/config-AUM5WBYA.js +1072 -0
- package/dist/cli-bundle/chunks/config-AUM5WBYA.js.map +7 -0
- package/dist/cli-bundle/chunks/config-OZWSA2NP.js +1062 -0
- package/dist/cli-bundle/chunks/config-OZWSA2NP.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-B6275WPX.js → context-OYXRGY7S.js} +12 -12
- package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js → context-PKCEHQY3.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-HN7ABKLP.js → contracts-L6ODXNUM.js} +320 -199
- package/dist/cli-bundle/chunks/contracts-L6ODXNUM.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-W4FZVVD6.js → contracts-X74F2GSM.js} +321 -200
- package/dist/cli-bundle/chunks/contracts-X74F2GSM.js.map +1 -0
- package/dist/cli-bundle/chunks/{copy-DEM4DATS.js → copy-6XOR3HKN.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js → copy-I4NCLBR4.js} +5 -5
- package/dist/cli-bundle/chunks/{create-RLRJMRTM.js → create-PM45M6PE.js} +12 -12
- package/dist/cli-bundle/chunks/create-Z7YCH3BE.js +28 -0
- package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js → delete-7YXHYG67.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js → delete-LPISP43T.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js → deps-N2T26FME.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js → deps-WATKQDE3.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-GYZNVS26.js → docs-6LQ3GLM7.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-26S44RXU.js → docs-Z3X6JZLT.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js → eval-6DCLG52D.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js → eval-Y3ZCUTHK.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js → extension-BNINIMT7.js} +11 -11
- package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js → extension-QWE4YYK5.js} +11 -11
- package/dist/cli-bundle/chunks/{files-NQHEXUZD.js → files-6SGKHS6O.js} +7 -7
- package/dist/cli-bundle/chunks/{files-MBNICQFM.js → files-FUYPSOFJ.js} +7 -7
- package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js → focus-2Q3K76G2.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-XZW5423D.js → focus-ATLBWXXD.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js → gc-RUYEMNRF.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js → gc-TDWSDR66.js} +3 -3
- package/dist/cli-bundle/chunks/{get-A7MAOHCU.js → get-2WGLX74N.js} +120 -80
- package/dist/cli-bundle/chunks/get-2WGLX74N.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-DSDEKJ3L.js → get-LY6M2JIM.js} +121 -81
- package/dist/cli-bundle/chunks/get-LY6M2JIM.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-3IPFLKXB.js → health-4RKHYS3T.js} +535 -371
- package/dist/cli-bundle/chunks/health-4RKHYS3T.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-GZXGBZ36.js → health-TMFVNYRA.js} +534 -370
- package/dist/cli-bundle/chunks/health-TMFVNYRA.js.map +7 -0
- package/dist/cli-bundle/chunks/history-CGNQJXFE.js +18 -0
- package/dist/cli-bundle/chunks/{history-NERDJNUB.js → history-SGRRS72R.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-2WRZ2WK4.js → history-compact-LOED43R3.js} +213 -134
- package/dist/cli-bundle/chunks/history-compact-LOED43R3.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-HR7BB4LR.js → history-compact-V5DNAQHH.js} +214 -135
- package/dist/cli-bundle/chunks/history-compact-V5DNAQHH.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js → history-redact-IRL7WJ3E.js} +9 -9
- package/dist/cli-bundle/chunks/history-redact-N3JK7VBW.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-XA3LC4GA.js → history-repair-4WVBVHFR.js} +124 -84
- package/dist/cli-bundle/chunks/history-repair-4WVBVHFR.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-LCMOS45X.js → history-repair-PGYQJMGD.js} +123 -83
- package/dist/cli-bundle/chunks/history-repair-PGYQJMGD.js.map +7 -0
- package/dist/cli-bundle/chunks/{init-64XDLQJB.js → init-4GESW7RM.js} +12 -12
- package/dist/cli-bundle/chunks/init-XIDPABA4.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js → learnings-4BHWFFUV.js} +9 -9
- package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js → learnings-4FJY7WIW.js} +9 -9
- package/dist/cli-bundle/chunks/{list-G5Y65VF6.js → list-472TIOVK.js} +8 -8
- package/dist/cli-bundle/chunks/{list-DNBJVO3E.js → list-D7BF5CL2.js} +8 -8
- package/dist/cli-bundle/chunks/{next-FYTQF6HG.js → next-D5STGWI2.js} +71 -46
- package/dist/cli-bundle/chunks/next-D5STGWI2.js.map +1 -0
- package/dist/cli-bundle/chunks/{next-BCERKDUR.js → next-SFQZVX2B.js} +70 -45
- package/dist/cli-bundle/chunks/next-SFQZVX2B.js.map +7 -0
- package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js → notes-6KNOSLIT.js} +9 -9
- package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js → notes-W4UEICGF.js} +9 -9
- package/dist/cli-bundle/chunks/{plan-RKZHQVXR.js → plan-JO6V7BXO.js} +373 -279
- package/dist/cli-bundle/chunks/plan-JO6V7BXO.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-4WXEQCTN.js → plan-MJQW5XK3.js} +372 -278
- package/dist/cli-bundle/chunks/plan-MJQW5XK3.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-4OMM32CD.js → profile-3TOTMUR4.js} +27 -19
- package/dist/cli-bundle/chunks/profile-3TOTMUR4.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-QLER5ENE.js → profile-WIQY2KCV.js} +28 -20
- package/dist/cli-bundle/chunks/profile-WIQY2KCV.js.map +1 -0
- package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js +416 -0
- package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js.map +7 -0
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js +406 -0
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-KK7PHYYU.js → register-mutation-ROFE2YPC.js} +729 -702
- package/dist/cli-bundle/chunks/register-mutation-ROFE2YPC.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-ENNDUAZG.js → register-mutation-SJWMVIJ2.js} +730 -703
- package/dist/cli-bundle/chunks/register-mutation-SJWMVIJ2.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-HZ6XERQG.js → register-operations-IADFVH53.js} +389 -365
- package/dist/cli-bundle/chunks/register-operations-IADFVH53.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js +510 -0
- package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-ZKJ53RS7.js → register-setup-3QJY43CY.js} +128 -103
- package/dist/cli-bundle/chunks/register-setup-3QJY43CY.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-P67EMBDJ.js → register-setup-AJWUSSQX.js} +129 -104
- package/dist/cli-bundle/chunks/register-setup-AJWUSSQX.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js → restore-44IHMMZZ.js} +9 -9
- package/dist/cli-bundle/chunks/restore-EXHU34EU.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js → scheduling-shortcuts-OLHNLAZY.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js → scheduling-shortcuts-TSBK4AY5.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-73HR2OJW.js → schema-IB2NZZWD.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js → schema-VBCELP5G.js} +7 -7
- package/dist/cli-bundle/chunks/{search-AXPXKZER.js → search-7UBETML4.js} +10 -10
- package/dist/cli-bundle/chunks/{search-KILGT37L.js → search-R227JOL6.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js → stats-FAG7COEH.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js → stats-MCK7PLYS.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-GAHHQTOS.js → telemetry-DRPDZMAO.js} +84 -70
- package/dist/cli-bundle/chunks/telemetry-DRPDZMAO.js.map +7 -0
- package/dist/cli-bundle/chunks/{telemetry-BZUF6H7G.js → telemetry-GVVUQSJQ.js} +85 -71
- package/dist/cli-bundle/chunks/telemetry-GVVUQSJQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-PWDIZ255.js → test-QY44WAMR.js} +15 -15
- package/dist/cli-bundle/chunks/{test-ACD52Z3S.js → test-SY76DZTO.js} +15 -15
- package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js +430 -0
- package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js.map +7 -0
- package/dist/cli-bundle/chunks/test-all-USPJHXFR.js +427 -0
- package/dist/cli-bundle/chunks/test-all-USPJHXFR.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-UXIXPDKU.js → test-runs-MG5VIGSK.js} +185 -147
- package/dist/cli-bundle/chunks/test-runs-MG5VIGSK.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-PLRAZEFW.js → test-runs-QIR5MJPL.js} +184 -146
- package/dist/cli-bundle/chunks/test-runs-QIR5MJPL.js.map +7 -0
- package/dist/cli-bundle/chunks/update-A7EICML6.js +24 -0
- package/dist/cli-bundle/chunks/{update-KFX2SIAC.js → update-IKJZWLQC.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js → update-many-BEMTDA2X.js} +84 -69
- package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js.map → update-many-BEMTDA2X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js → update-many-RATAARHU.js} +83 -68
- package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js.map → update-many-RATAARHU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js → upgrade-NWMR3VQL.js} +11 -11
- package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js → upgrade-VU46BLJZ.js} +11 -11
- package/dist/cli-bundle/chunks/{validate-X5W76YJL.js → validate-GAJ6FUSI.js} +451 -321
- package/dist/cli-bundle/chunks/validate-GAJ6FUSI.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-MTUVL5VC.js → validate-NRY6MFXN.js} +450 -320
- package/dist/cli-bundle/chunks/validate-NRY6MFXN.js.map +7 -0
- package/dist/cli-bundle/main.js +1107 -916
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/config/nested-settings.js +89 -67
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/governance/metadata-coverage.js +20 -28
- package/dist/core/governance/metadata-coverage.js.map +1 -1
- package/dist/core/history/drift-scan.js +93 -81
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/item/item-type-definition.js +14 -14
- package/dist/core/item/item-type-definition.js.map +1 -1
- package/dist/core/item/type-registry.js +114 -99
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/output/mutation-projection.js +42 -26
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +97 -80
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.js +26 -3
- package/dist/core/schema/status-defs-file.js.map +1 -1
- package/dist/core/search/corpus.js +25 -19
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +64 -37
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.js +32 -17
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.js +31 -28
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/sentry/instrument.js +54 -43
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/memo.d.ts +12 -0
- package/dist/core/shared/memo.js +25 -0
- package/dist/core/shared/memo.js.map +1 -0
- package/dist/core/shared/serialization.js +24 -14
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/shared/time.js +26 -4
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +5 -0
- package/dist/core/store/front-matter-cache.js +316 -171
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.js +33 -26
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings.js +247 -203
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/test/background-runs.js +189 -160
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +71 -99
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/compose.js +51 -42
- package/dist/sdk/compose.js.map +1 -1
- package/docs/AGENT_GUIDE.md +2 -2
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/COMMANDS.md +8 -4
- package/docs/CONFIGURATION.md +1 -1
- package/docs/EXTENSIONS.md +12 -12
- package/docs/ONBOARDING.md +4 -2
- package/docs/README.md +2 -0
- package/docs/examples/starter-extension/README.md +11 -10
- package/marketplace.json +3 -3
- package/package.json +2 -2
- package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
- package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
- package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
- package/plugins/pm-claude/README.md +6 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-22WKIL3H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VGN2UWE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AXIDKKAT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BDTISOSD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CF7RL6FR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IPYBJWTE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IZBR4NRW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JLM7BHI7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KNPEF7QG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NFDPYAIP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NWMZWYYB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OTUHB4HS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RLDHZHQS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-V3NOKJF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WYDHYJPO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YITK2PJ6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +0 -1
- package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +0 -14
- package/dist/cli-bundle/chunks/close-many-BG5QQIDQ.js.map +0 -7
- package/dist/cli-bundle/chunks/close-many-LDRVEQY2.js.map +0 -1
- package/dist/cli-bundle/chunks/config-DMSU64QO.js +0 -1541
- package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +0 -7
- package/dist/cli-bundle/chunks/config-QH2DICD6.js +0 -1531
- package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +0 -1
- package/dist/cli-bundle/chunks/create-OH3BDGBB.js +0 -28
- package/dist/cli-bundle/chunks/get-A7MAOHCU.js.map +0 -7
- package/dist/cli-bundle/chunks/get-DSDEKJ3L.js.map +0 -1
- package/dist/cli-bundle/chunks/health-3IPFLKXB.js.map +0 -1
- package/dist/cli-bundle/chunks/health-GZXGBZ36.js.map +0 -7
- package/dist/cli-bundle/chunks/history-WSZHY3PN.js +0 -18
- package/dist/cli-bundle/chunks/history-compact-2WRZ2WK4.js.map +0 -7
- package/dist/cli-bundle/chunks/history-compact-HR7BB4LR.js.map +0 -1
- package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-LCMOS45X.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-XA3LC4GA.js.map +0 -1
- package/dist/cli-bundle/chunks/init-PAX32BJA.js +0 -22
- package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +0 -7
- package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-4WXEQCTN.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-RKZHQVXR.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js +0 -400
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js +0 -410
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js +0 -486
- package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-HZ6XERQG.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-YALDGTQR.js +0 -17
- package/dist/cli-bundle/chunks/telemetry-BZUF6H7G.js.map +0 -1
- package/dist/cli-bundle/chunks/telemetry-GAHHQTOS.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js +0 -358
- package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js +0 -361
- package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +0 -1
- package/dist/cli-bundle/chunks/update-AMRSOIWP.js +0 -24
- package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js.map → activity-5YWLSPGE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-AW6XVFH6.js.map → activity-BIML7K2D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-LOVPGVPT.js.map → append-EZESUVJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-QCFJSDFL.js.map → append-JFG4WQMG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js.map → chunk-3W2HJKJX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js.map → chunk-4PFVUUYV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js.map → chunk-5E7N4T2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js.map → chunk-5IZUBZBR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js.map → chunk-5JIWFWOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js.map → chunk-6CDCWKSX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js.map → chunk-6NYJGMTY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js.map → chunk-7CLLC75T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2466X6E4.js.map → chunk-7LYO6S5A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js.map → chunk-A3OQ7TFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js.map → chunk-ER4ME5U2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js.map → chunk-ERG65A2L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js.map → chunk-FH2H3CBD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JPECA746.js.map → chunk-FUFFPIYA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js.map → chunk-GUYNUXQT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js.map → chunk-GVJE5T7Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js.map → chunk-JBZ2NTKX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js.map → chunk-KEZOIPCR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js.map → chunk-MDHWWBNZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js.map → chunk-MEZZZBYX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js.map → chunk-NZ7QIUP5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js.map → chunk-P5L7Z2O6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js.map → chunk-SU2E4AWU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js.map → chunk-SU3TB4NS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js.map → chunk-T4XBKJ3F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js.map → chunk-U5TR4N7J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js.map → chunk-UMNQZS4H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js.map → chunk-WJA3PXW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js.map → chunk-YSDFIY7N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js.map → chunk-YSGTMDWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js.map → chunk-Z5F6XZXE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js.map → chunk-Z7RPDF2Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js.map → claim-2BGBGSVI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js.map → claim-5GU7OE67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-E6ZZGCJY.js.map → close-6YODBUIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-TQYAAFJP.js.map → close-AFVKPR57.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js.map → comments-DNWHEBOS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js.map → comments-RW23R3VE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-B6275WPX.js.map → context-OYXRGY7S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js.map → context-PKCEHQY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-DEM4DATS.js.map → copy-6XOR3HKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js.map → copy-I4NCLBR4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-RLRJMRTM.js.map → create-PM45M6PE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-OH3BDGBB.js.map → create-Z7YCH3BE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js.map → delete-7YXHYG67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js.map → delete-LPISP43T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js.map → deps-N2T26FME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js.map → deps-WATKQDE3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-GYZNVS26.js.map → docs-6LQ3GLM7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-26S44RXU.js.map → docs-Z3X6JZLT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js.map → eval-6DCLG52D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js.map → eval-Y3ZCUTHK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js.map → extension-BNINIMT7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js.map → extension-QWE4YYK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-NQHEXUZD.js.map → files-6SGKHS6O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-MBNICQFM.js.map → files-FUYPSOFJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js.map → focus-2Q3K76G2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-XZW5423D.js.map → focus-ATLBWXXD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js.map → gc-RUYEMNRF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js.map → gc-TDWSDR66.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-WSZHY3PN.js.map → history-CGNQJXFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-NERDJNUB.js.map → history-SGRRS72R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js.map → history-redact-IRL7WJ3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-MP6CH7U5.js.map → history-redact-N3JK7VBW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-64XDLQJB.js.map → init-4GESW7RM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-PAX32BJA.js.map → init-XIDPABA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js.map → learnings-4BHWFFUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js.map → learnings-4FJY7WIW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-G5Y65VF6.js.map → list-472TIOVK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DNBJVO3E.js.map → list-D7BF5CL2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js.map → notes-6KNOSLIT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js.map → notes-W4UEICGF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js.map → restore-44IHMMZZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YALDGTQR.js.map → restore-EXHU34EU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js.map → scheduling-shortcuts-OLHNLAZY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js.map → scheduling-shortcuts-TSBK4AY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-73HR2OJW.js.map → schema-IB2NZZWD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js.map → schema-VBCELP5G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-AXPXKZER.js.map → search-7UBETML4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-KILGT37L.js.map → search-R227JOL6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js.map → stats-FAG7COEH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js.map → stats-MCK7PLYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-PWDIZ255.js.map → test-QY44WAMR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-ACD52Z3S.js.map → test-SY76DZTO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-AMRSOIWP.js.map → update-A7EICML6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-KFX2SIAC.js.map → update-IKJZWLQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js.map → upgrade-NWMR3VQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js.map → upgrade-VU46BLJZ.js.map} +0 -0
package/dist/cli/main.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Provides CLI runtime support for Main.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!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]="
|
|
8
|
+
!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]="aa682568-77f6-5659-a6dd-3a69dd4e1fc0")}catch(e){}}();
|
|
9
9
|
import { Command } from "commander";
|
|
10
10
|
import { activateExtensions, clearActiveExtensionHooks, createEmptyExtensionRegistrationRegistry, discoverExtensions, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, consumeAfterCommandAffectedItems, runActiveCommandHandler, runActiveParserOverride, runActivePreflightOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandResult, setActiveCommandContext, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, } from "../core/extensions/index.js";
|
|
11
11
|
import { pathExists } from "../core/fs/fs-utils.js";
|
|
@@ -132,6 +132,59 @@ function inferMissingFieldsFromErrorMessage(message) {
|
|
|
132
132
|
/* c8 ignore next */
|
|
133
133
|
return normalized.length > 0 ? normalized : undefined;
|
|
134
134
|
}
|
|
135
|
+
function inferMissingFieldsForRecovery(rawMessage, invocationArgv, existingRecovery) {
|
|
136
|
+
if (existingRecovery?.suggested_retry) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
const providedFields = extractProvidedOptionFlags(invocationArgv);
|
|
140
|
+
const providedSet = new Set(providedFields.map((flag) => normalizeLongOptionFlag(flag) ?? flag));
|
|
141
|
+
const rawInferred = inferMissingFieldsFromErrorMessage(rawMessage);
|
|
142
|
+
const trulyMissing = rawInferred?.filter((flag) => !providedSet.has(normalizeLongOptionFlag(flag) ?? flag));
|
|
143
|
+
return trulyMissing && trulyMissing.length > 0 ? trulyMissing : undefined;
|
|
144
|
+
}
|
|
145
|
+
function resolveRecoverySuggestedRetry(invocationArgv, attemptedCommand, inferredMissing, existingRecovery) {
|
|
146
|
+
if (existingRecovery?.suggested_retry) {
|
|
147
|
+
return existingRecovery.suggested_retry;
|
|
148
|
+
}
|
|
149
|
+
const missingFlag = inferredMissing?.[0];
|
|
150
|
+
const normalizedMissing = missingFlag ? normalizeLongOptionFlag(missingFlag) : undefined;
|
|
151
|
+
const suggestedRetry = normalizedMissing
|
|
152
|
+
? renderAttemptedCommand([...invocationArgv, normalizedMissing, "<value>"])
|
|
153
|
+
: attemptedCommand;
|
|
154
|
+
return suggestedRetry === attemptedCommand ? undefined : suggestedRetry;
|
|
155
|
+
}
|
|
156
|
+
function projectExistingRecoveryOptionalFields(existingRecovery) {
|
|
157
|
+
if (!existingRecovery) {
|
|
158
|
+
return {};
|
|
159
|
+
}
|
|
160
|
+
const optionalFields = [
|
|
161
|
+
"recovery_mode",
|
|
162
|
+
"missing_required_fields",
|
|
163
|
+
"suggested_flags",
|
|
164
|
+
"fallback_candidates",
|
|
165
|
+
"next_best_command",
|
|
166
|
+
];
|
|
167
|
+
const projected = {};
|
|
168
|
+
for (const field of optionalFields) {
|
|
169
|
+
const value = existingRecovery[field];
|
|
170
|
+
if (value !== undefined && value !== null) {
|
|
171
|
+
projected[field] = value;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return projected;
|
|
175
|
+
}
|
|
176
|
+
function buildRecoveryPayload(params) {
|
|
177
|
+
const existingRecovery = params.existingRecovery;
|
|
178
|
+
return {
|
|
179
|
+
attempted_command: existingRecovery?.attempted_command ?? params.attemptedCommand,
|
|
180
|
+
normalized_args: existingRecovery?.normalized_args ?? [...params.invocationArgv],
|
|
181
|
+
/* c8 ignore next */
|
|
182
|
+
provided_fields: existingRecovery?.provided_fields ?? (params.providedFields.length > 0 ? params.providedFields : undefined),
|
|
183
|
+
missing: existingRecovery?.missing ?? params.inferredMissing,
|
|
184
|
+
...projectExistingRecoveryOptionalFields(existingRecovery),
|
|
185
|
+
...(params.suggestedRetry ? { suggested_retry: params.suggestedRetry } : {}),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
135
188
|
function buildPmCliRecoveryContext(context, invocationArgv, rawMessage) {
|
|
136
189
|
const explainRequested = invocationArgv.includes("--explain");
|
|
137
190
|
const existingRecovery = context?.recovery;
|
|
@@ -144,40 +197,16 @@ function buildPmCliRecoveryContext(context, invocationArgv, rawMessage) {
|
|
|
144
197
|
}
|
|
145
198
|
const attemptedCommand = renderAttemptedCommand(invocationArgv);
|
|
146
199
|
const providedFields = extractProvidedOptionFlags(invocationArgv);
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
/* c8 ignore next */
|
|
158
|
-
if (normalizedMissing) {
|
|
159
|
-
suggestedRetry = renderAttemptedCommand([...invocationArgv, normalizedMissing, "<value>"]);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if (!suggestedRetry) {
|
|
163
|
-
suggestedRetry = attemptedCommand;
|
|
164
|
-
}
|
|
165
|
-
if (!existingRecovery?.suggested_retry && suggestedRetry === attemptedCommand) {
|
|
166
|
-
suggestedRetry = undefined;
|
|
167
|
-
}
|
|
168
|
-
const recovery = {
|
|
169
|
-
attempted_command: existingRecovery?.attempted_command ?? attemptedCommand,
|
|
170
|
-
normalized_args: existingRecovery?.normalized_args ?? [...invocationArgv],
|
|
171
|
-
/* c8 ignore next */
|
|
172
|
-
provided_fields: existingRecovery?.provided_fields ?? (providedFields.length > 0 ? providedFields : undefined),
|
|
173
|
-
missing: existingRecovery?.missing ?? inferredMissing,
|
|
174
|
-
...(existingRecovery?.recovery_mode ? { recovery_mode: existingRecovery.recovery_mode } : {}),
|
|
175
|
-
...(existingRecovery?.missing_required_fields ? { missing_required_fields: existingRecovery.missing_required_fields } : {}),
|
|
176
|
-
...(existingRecovery?.suggested_flags ? { suggested_flags: existingRecovery.suggested_flags } : {}),
|
|
177
|
-
...(suggestedRetry ? { suggested_retry: suggestedRetry } : {}),
|
|
178
|
-
...(existingRecovery?.fallback_candidates ? { fallback_candidates: existingRecovery.fallback_candidates } : {}),
|
|
179
|
-
...(existingRecovery?.next_best_command ? { next_best_command: existingRecovery.next_best_command } : {}),
|
|
180
|
-
};
|
|
200
|
+
const inferredMissing = inferMissingFieldsForRecovery(rawMessage, invocationArgv, existingRecovery);
|
|
201
|
+
const suggestedRetry = resolveRecoverySuggestedRetry(invocationArgv, attemptedCommand, inferredMissing, existingRecovery);
|
|
202
|
+
const recovery = buildRecoveryPayload({
|
|
203
|
+
invocationArgv,
|
|
204
|
+
attemptedCommand,
|
|
205
|
+
providedFields,
|
|
206
|
+
inferredMissing,
|
|
207
|
+
suggestedRetry,
|
|
208
|
+
existingRecovery,
|
|
209
|
+
});
|
|
181
210
|
return {
|
|
182
211
|
...context,
|
|
183
212
|
recovery,
|
|
@@ -536,8 +565,11 @@ function collectExtensionFlagDefinitionsForInvocation(registrations, commandPath
|
|
|
536
565
|
}
|
|
537
566
|
return nestedMatch.length > 0 ? nestedMatch : exact;
|
|
538
567
|
}
|
|
568
|
+
function dynamicCommandArguments(descriptor) {
|
|
569
|
+
return descriptor.arguments ?? [];
|
|
570
|
+
}
|
|
539
571
|
function formatDynamicCommandUsage(descriptor) {
|
|
540
|
-
const argumentSuffix = descriptor
|
|
572
|
+
const argumentSuffix = dynamicCommandArguments(descriptor)
|
|
541
573
|
.map((argument) => {
|
|
542
574
|
const label = argument.variadic ? `${argument.name}...` : argument.name;
|
|
543
575
|
return argument.required ? `<${label}>` : `[${label}]`;
|
|
@@ -562,10 +594,12 @@ function isImporterOrExporterCommandPath(registrations, commandPath) {
|
|
|
562
594
|
registrations.exporters.some((entry) => normalizeExtensionCommandPath(`${entry.exporter} export`) === normalized));
|
|
563
595
|
}
|
|
564
596
|
function validateDynamicExtensionCommandArgs(descriptor, args) {
|
|
565
|
-
const
|
|
566
|
-
const
|
|
567
|
-
const
|
|
568
|
-
const
|
|
597
|
+
const descriptorArguments = dynamicCommandArguments(descriptor);
|
|
598
|
+
const requiredCount = descriptorArguments.filter((argument) => argument.required).length;
|
|
599
|
+
const variadic = descriptorArguments.some((argument) => argument.variadic);
|
|
600
|
+
const maxCount = variadic ? Number.POSITIVE_INFINITY : descriptorArguments.length;
|
|
601
|
+
const failureHints = descriptor.failure_hints ?? [];
|
|
602
|
+
const hintSuffix = failureHints.length > 0 ? ` ${failureHints.join(" ")}` : "";
|
|
569
603
|
if (args.length < requiredCount) {
|
|
570
604
|
throw new PmCliError(`Missing required argument for extension command '${descriptor.command}'. Usage: ${formatDynamicCommandUsage(descriptor)}${hintSuffix}`, EXIT_CODE.USAGE);
|
|
571
605
|
}
|
|
@@ -1210,15 +1244,44 @@ async function runRequiredExtensionCommand(command, options, globalOptions, exte
|
|
|
1210
1244
|
return extensionCommandResult.result;
|
|
1211
1245
|
}
|
|
1212
1246
|
const WRAPPED_ACTION_HANDLER = Symbol("pm.wrappedActionHandler");
|
|
1247
|
+
function resolveActionCommand(actionArgs, fallback) {
|
|
1248
|
+
const possibleCommand = actionArgs[actionArgs.length - 1];
|
|
1249
|
+
/* c8 ignore next */
|
|
1250
|
+
return possibleCommand instanceof Command ? possibleCommand : fallback;
|
|
1251
|
+
}
|
|
1252
|
+
function maybePrintExtensionProfileWarnings(enabled, label, warnings) {
|
|
1253
|
+
if (enabled && warnings.length > 0) {
|
|
1254
|
+
printError(`profile:extensions ${label}=${formatHookWarnings(warnings)}`);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
function validateDynamicInvocationArgs(params) {
|
|
1258
|
+
const dynamicDescriptor = activeRuntimeExtensionCommandDescriptors.get(normalizeExtensionCommandPath(params.commandPath));
|
|
1259
|
+
if (!dynamicDescriptor || !isImporterOrExporterCommandPath(params.activeRegistrations, params.commandPath)) {
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
const positionalArgs = dynamicCommandArguments(dynamicDescriptor).length === 0
|
|
1263
|
+
? collectLoosePositionalArgs(params.commandArgs)
|
|
1264
|
+
: stripLooseCommandOptionTokens(params.commandArgs, params.extensionFlagDefinitions);
|
|
1265
|
+
validateDynamicExtensionCommandArgs(dynamicDescriptor, positionalArgs);
|
|
1266
|
+
}
|
|
1267
|
+
function syncCommanderActionArgs(actionCommand, actionArgs, commandArgs) {
|
|
1268
|
+
actionCommand.args = [...commandArgs];
|
|
1269
|
+
/* c8 ignore next */
|
|
1270
|
+
if ("_processArguments" in actionCommand && typeof actionCommand._processArguments === "function") {
|
|
1271
|
+
actionCommand._processArguments();
|
|
1272
|
+
}
|
|
1273
|
+
/* c8 ignore next */
|
|
1274
|
+
if (actionArgs.length > 0 && Array.isArray(actionArgs[0])) {
|
|
1275
|
+
actionArgs[0] = [...actionCommand.processedArgs];
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1213
1278
|
function wrapProgramActionsForExtensionHandlers(rootProgram) {
|
|
1214
1279
|
const visit = (entry) => {
|
|
1215
1280
|
const actionEntry = entry;
|
|
1216
1281
|
if (typeof actionEntry._actionHandler === "function" && actionEntry[WRAPPED_ACTION_HANDLER] !== true) {
|
|
1217
1282
|
const originalAction = actionEntry._actionHandler;
|
|
1218
1283
|
actionEntry._actionHandler = async function wrappedActionHandler(...actionArgs) {
|
|
1219
|
-
const
|
|
1220
|
-
/* c8 ignore next */
|
|
1221
|
-
const actionCommand = possibleCommand instanceof Command ? possibleCommand : entry;
|
|
1284
|
+
const actionCommand = resolveActionCommand(actionArgs, entry);
|
|
1222
1285
|
const startedAt = Date.now();
|
|
1223
1286
|
clearResolvedGlobalOptions(actionCommand);
|
|
1224
1287
|
let globalOptions = getGlobalOptions(actionCommand);
|
|
@@ -1241,9 +1304,7 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
|
|
|
1241
1304
|
global: globalOptions,
|
|
1242
1305
|
pm_root: pmRoot,
|
|
1243
1306
|
});
|
|
1244
|
-
|
|
1245
|
-
printError(`profile:extensions parser_warnings=${formatHookWarnings(parserOverride.warnings)}`);
|
|
1246
|
-
}
|
|
1307
|
+
maybePrintExtensionProfileWarnings(globalOptions.profile, "parser_warnings", parserOverride.warnings);
|
|
1247
1308
|
commandArgs = parserOverride.context.args;
|
|
1248
1309
|
commandOptions = parserOverride.context.options;
|
|
1249
1310
|
globalOptions = parserOverride.context.global;
|
|
@@ -1252,24 +1313,10 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
|
|
|
1252
1313
|
// only arity validation, so excess positionals could reach handlers.
|
|
1253
1314
|
// Free-form `registerCommand` commands intentionally accept positionals
|
|
1254
1315
|
// via context.args, and core commands have no descriptor.
|
|
1255
|
-
|
|
1256
|
-
if (dynamicDescriptor && isImporterOrExporterCommandPath(activeRegistrations, commandPath)) {
|
|
1257
|
-
const positionalArgs = dynamicDescriptor.arguments.length === 0
|
|
1258
|
-
? collectLoosePositionalArgs(commandArgs)
|
|
1259
|
-
: stripLooseCommandOptionTokens(commandArgs, extensionFlagDefinitions);
|
|
1260
|
-
validateDynamicExtensionCommandArgs(dynamicDescriptor, positionalArgs);
|
|
1261
|
-
}
|
|
1316
|
+
validateDynamicInvocationArgs({ activeRegistrations, commandPath, commandArgs, extensionFlagDefinitions });
|
|
1262
1317
|
globalOptions = await applyDefaultOutputFormat(globalOptions);
|
|
1263
1318
|
setResolvedGlobalOptions(actionCommand, globalOptions);
|
|
1264
|
-
actionCommand
|
|
1265
|
-
/* c8 ignore next */
|
|
1266
|
-
if ("_processArguments" in actionCommand && typeof actionCommand._processArguments === "function") {
|
|
1267
|
-
actionCommand._processArguments();
|
|
1268
|
-
}
|
|
1269
|
-
/* c8 ignore next */
|
|
1270
|
-
if (actionArgs.length > 0 && Array.isArray(actionArgs[0])) {
|
|
1271
|
-
actionArgs[0] = [...actionCommand.processedArgs];
|
|
1272
|
-
}
|
|
1319
|
+
syncCommanderActionArgs(actionCommand, actionArgs, commandArgs);
|
|
1273
1320
|
for (const [key, value] of Object.entries(commandOptions)) {
|
|
1274
1321
|
actionCommand.setOptionValueWithSource(key, value, "cli");
|
|
1275
1322
|
}
|
|
@@ -1288,9 +1335,7 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
|
|
|
1288
1335
|
global: globalOptions,
|
|
1289
1336
|
pm_root: pmRoot,
|
|
1290
1337
|
});
|
|
1291
|
-
|
|
1292
|
-
printError(`profile:extensions command_handler_warnings=${formatHookWarnings(extensionCommandResult.warnings)}`);
|
|
1293
|
-
}
|
|
1338
|
+
maybePrintExtensionProfileWarnings(globalOptions.profile, "command_handler_warnings", extensionCommandResult.warnings);
|
|
1294
1339
|
if (extensionCommandResult.handled) {
|
|
1295
1340
|
setActiveCommandResult(extensionCommandResult.result);
|
|
1296
1341
|
printResult(extensionCommandResult.result, {
|
|
@@ -1316,36 +1361,67 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
|
|
|
1316
1361
|
visit(rootProgram);
|
|
1317
1362
|
}
|
|
1318
1363
|
/* c8 ignore stop */
|
|
1364
|
+
async function clearDynamicExtensionCommandState(params) {
|
|
1365
|
+
activeRuntimeExtensionCommandDescriptors = new Map();
|
|
1366
|
+
setActiveExtensionServices({ overrides: [] });
|
|
1367
|
+
if (params) {
|
|
1368
|
+
await maybeAttachCreateUpdatePolicyHelpText(params.rootProgram, params.pmRoot, params.invocationArgv, createEmptyExtensionRegistrationRegistry(), params.settings);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
/* v8 ignore start -- dynamic help fallback variants are exercised through registration integration tests; residual legacy branches are defensive */
|
|
1372
|
+
function attachDynamicExtensionHelp(command, descriptor, flagHelp, metadataHelp) {
|
|
1373
|
+
if (descriptor?.flags && descriptor.flags.length > 0) {
|
|
1374
|
+
applyDynamicExtensionFlagOptions(command, descriptor.flags);
|
|
1375
|
+
const residualFlagHelp = buildResidualDynamicExtensionFlagHelp(command, descriptor.flags);
|
|
1376
|
+
if (residualFlagHelp) {
|
|
1377
|
+
command.addHelpText("after", residualFlagHelp);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
else if (flagHelp) {
|
|
1381
|
+
command.addHelpText("after", flagHelp);
|
|
1382
|
+
}
|
|
1383
|
+
if (metadataHelp) {
|
|
1384
|
+
command.addHelpText("after", metadataHelp);
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
/* v8 ignore stop */
|
|
1319
1388
|
/* c8 ignore start */
|
|
1320
1389
|
async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv) {
|
|
1321
1390
|
const bootstrapGlobalOptions = parseBootstrapGlobalOptions(invocationArgv);
|
|
1322
1391
|
const pmRoot = resolvePmRoot(process.cwd(), bootstrapGlobalOptions.path);
|
|
1323
1392
|
if (bootstrapGlobalOptions.noExtensions) {
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1393
|
+
await clearDynamicExtensionCommandState({
|
|
1394
|
+
rootProgram,
|
|
1395
|
+
pmRoot,
|
|
1396
|
+
invocationArgv,
|
|
1397
|
+
});
|
|
1327
1398
|
return;
|
|
1328
1399
|
}
|
|
1329
1400
|
const discoverySnapshot = await loadRuntimeExtensionDiscoverySnapshot(pmRoot);
|
|
1330
1401
|
const probe = buildBootstrapActivationProbe(invocationArgv);
|
|
1331
1402
|
if (!discoverySnapshot) {
|
|
1332
|
-
|
|
1333
|
-
setActiveExtensionServices({ overrides: [] });
|
|
1403
|
+
await clearDynamicExtensionCommandState();
|
|
1334
1404
|
return;
|
|
1335
1405
|
}
|
|
1336
1406
|
if (!discoveryNeedsActivationForProbe(discoverySnapshot.discovery, probe)) {
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1407
|
+
await clearDynamicExtensionCommandState({
|
|
1408
|
+
rootProgram,
|
|
1409
|
+
pmRoot,
|
|
1410
|
+
invocationArgv,
|
|
1411
|
+
settings: discoverySnapshot.settings,
|
|
1412
|
+
});
|
|
1340
1413
|
emitExtensionSkippedProfile(bootstrapProfileEnabled(invocationArgv), discoverySnapshot, probe);
|
|
1341
1414
|
return;
|
|
1342
1415
|
}
|
|
1343
1416
|
const snapshot = await loadRuntimeExtensionSnapshot(pmRoot);
|
|
1344
1417
|
/* c8 ignore next */
|
|
1345
1418
|
if (!snapshot) {
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1419
|
+
await clearDynamicExtensionCommandState({
|
|
1420
|
+
rootProgram,
|
|
1421
|
+
pmRoot,
|
|
1422
|
+
invocationArgv,
|
|
1423
|
+
settings: discoverySnapshot.settings,
|
|
1424
|
+
});
|
|
1349
1425
|
return;
|
|
1350
1426
|
}
|
|
1351
1427
|
// Ensure usage/help/error formatting overrides are available even when parse
|
|
@@ -1364,20 +1440,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
|
|
|
1364
1440
|
const flagHelp = snapshot.commandFlagHelp.get(commandPath);
|
|
1365
1441
|
const metadataHelp = descriptor ? buildDynamicExtensionCommandMetadataHelp(descriptor) : null;
|
|
1366
1442
|
if (existingCommand) {
|
|
1367
|
-
|
|
1368
|
-
applyDynamicExtensionFlagOptions(existingCommand, descriptor.flags);
|
|
1369
|
-
const residualFlagHelp = buildResidualDynamicExtensionFlagHelp(existingCommand, descriptor.flags);
|
|
1370
|
-
if (residualFlagHelp) {
|
|
1371
|
-
existingCommand.addHelpText("after", residualFlagHelp);
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
else if (flagHelp) {
|
|
1375
|
-
existingCommand.addHelpText("after", flagHelp);
|
|
1376
|
-
}
|
|
1377
|
-
/* c8 ignore next */
|
|
1378
|
-
if (metadataHelp) {
|
|
1379
|
-
existingCommand.addHelpText("after", metadataHelp);
|
|
1380
|
-
}
|
|
1443
|
+
attachDynamicExtensionHelp(existingCommand, descriptor, flagHelp, metadataHelp);
|
|
1381
1444
|
continue;
|
|
1382
1445
|
}
|
|
1383
1446
|
const dynamicCommand = ensureCommandPath(rootProgram, pathParts);
|
|
@@ -1861,6 +1924,315 @@ function enforceExplicitRetryForFlagTypos(bootstrapInvocation) {
|
|
|
1861
1924
|
},
|
|
1862
1925
|
});
|
|
1863
1926
|
}
|
|
1927
|
+
function createTelemetryCommandErrorEmitter(params) {
|
|
1928
|
+
return async (event) => {
|
|
1929
|
+
const errorCategory = resolveTelemetryErrorCategory(event.errorCode);
|
|
1930
|
+
const commandResolution = deriveTelemetryCommandResolution({
|
|
1931
|
+
ok: false,
|
|
1932
|
+
errorCode: event.errorCode,
|
|
1933
|
+
errorCategory,
|
|
1934
|
+
});
|
|
1935
|
+
await emitTelemetryErrorEvent({
|
|
1936
|
+
command: event.command,
|
|
1937
|
+
args: params.invocationArgv,
|
|
1938
|
+
options: event.options,
|
|
1939
|
+
global: params.bootstrapGlobal,
|
|
1940
|
+
pm_version: CLI_VERSION,
|
|
1941
|
+
pm_root: params.bootstrapPmRoot,
|
|
1942
|
+
error_code: event.errorCode,
|
|
1943
|
+
error_message: event.errorMessage,
|
|
1944
|
+
exit_code: event.exitCode,
|
|
1945
|
+
error_category: errorCategory,
|
|
1946
|
+
command_resolution: commandResolution,
|
|
1947
|
+
resolution_stage: event.resolutionStage,
|
|
1948
|
+
});
|
|
1949
|
+
return {
|
|
1950
|
+
errorCategory,
|
|
1951
|
+
commandResolution,
|
|
1952
|
+
};
|
|
1953
|
+
};
|
|
1954
|
+
}
|
|
1955
|
+
async function prepareExtensionServicesForRunPmCliError(params) {
|
|
1956
|
+
if (params.bootstrapGlobal.noExtensions) {
|
|
1957
|
+
return;
|
|
1958
|
+
}
|
|
1959
|
+
const bootstrapProbe = buildBootstrapActivationProbe(params.invocationArgv);
|
|
1960
|
+
const discoverySnapshot = await loadRuntimeExtensionDiscoverySnapshot(params.bootstrapPmRoot);
|
|
1961
|
+
if (discoverySnapshot && discoveryNeedsActivationForProbe(discoverySnapshot.discovery, bootstrapProbe)) {
|
|
1962
|
+
const bootstrapSnapshot = await loadRuntimeExtensionSnapshot(params.bootstrapPmRoot);
|
|
1963
|
+
setRecoveredExtensionServices(bootstrapSnapshot);
|
|
1964
|
+
return;
|
|
1965
|
+
}
|
|
1966
|
+
if (discoverySnapshot) {
|
|
1967
|
+
emitExtensionSkippedProfile(bootstrapProfileEnabled(params.invocationArgv), discoverySnapshot, bootstrapProbe);
|
|
1968
|
+
}
|
|
1969
|
+
setActiveExtensionServices({ overrides: [] });
|
|
1970
|
+
}
|
|
1971
|
+
function setRecoveredExtensionServices(bootstrapSnapshot) {
|
|
1972
|
+
if (!bootstrapSnapshot) {
|
|
1973
|
+
setActiveExtensionServices({ overrides: [] });
|
|
1974
|
+
return;
|
|
1975
|
+
}
|
|
1976
|
+
setActiveExtensionServices(bootstrapSnapshot.services);
|
|
1977
|
+
}
|
|
1978
|
+
async function finishRunPmCliFailure(params) {
|
|
1979
|
+
sentryFinishCommandSpan(false, params.errorMessage, {
|
|
1980
|
+
error_code: params.classificationCode,
|
|
1981
|
+
error_category: params.errorCategory,
|
|
1982
|
+
exit_code: params.exitCode,
|
|
1983
|
+
command_resolution: params.commandResolution,
|
|
1984
|
+
resolution_stage: params.resolutionStage,
|
|
1985
|
+
});
|
|
1986
|
+
await runAndClearAfterCommandHooks({
|
|
1987
|
+
ok: false,
|
|
1988
|
+
error: params.errorMessage,
|
|
1989
|
+
exit_code: params.exitCode,
|
|
1990
|
+
error_code: params.classificationCode,
|
|
1991
|
+
error_category: params.errorCategory,
|
|
1992
|
+
command_resolution: params.commandResolution,
|
|
1993
|
+
resolution_stage: params.resolutionStage,
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
async function finishRunPmCliSuccessParse() {
|
|
1997
|
+
sentryFinishCommandSpan(true, undefined, {
|
|
1998
|
+
exit_code: EXIT_CODE.SUCCESS,
|
|
1999
|
+
command_resolution: "success",
|
|
2000
|
+
resolution_stage: "parse",
|
|
2001
|
+
});
|
|
2002
|
+
await runAndClearAfterCommandHooks({
|
|
2003
|
+
ok: true,
|
|
2004
|
+
exit_code: EXIT_CODE.SUCCESS,
|
|
2005
|
+
command_resolution: "success",
|
|
2006
|
+
resolution_stage: "parse",
|
|
2007
|
+
});
|
|
2008
|
+
process.exitCode = EXIT_CODE.SUCCESS;
|
|
2009
|
+
}
|
|
2010
|
+
async function handleRunPmCliKnownError(context, numericExitCode) {
|
|
2011
|
+
const hasExplicitExitCode = typeof numericExitCode === "number" && Number.isFinite(numericExitCode);
|
|
2012
|
+
if (!(context.error instanceof PmCliError) &&
|
|
2013
|
+
(isCommanderError(context.error) || !hasExplicitExitCode)) {
|
|
2014
|
+
return false;
|
|
2015
|
+
}
|
|
2016
|
+
const errorMessage = describeUnknownError(context.error);
|
|
2017
|
+
const exitCode = context.error instanceof PmCliError ? context.error.exitCode : normalizeThrownExitCode(numericExitCode);
|
|
2018
|
+
const rawContext = context.error instanceof PmCliError ? context.error.context : undefined;
|
|
2019
|
+
const enrichedContext = buildPmCliRecoveryContext(rawContext, context.invocationArgv, errorMessage);
|
|
2020
|
+
const classification = classifyPmCliError(errorMessage, enrichedContext);
|
|
2021
|
+
const renderedError = context.jsonErrors
|
|
2022
|
+
? JSON.stringify(formatPmCliErrorForJson(errorMessage, exitCode, enrichedContext), null, 2)
|
|
2023
|
+
: formatPmCliErrorForDisplay(errorMessage, enrichedContext);
|
|
2024
|
+
printError(renderedError);
|
|
2025
|
+
const { errorCategory, commandResolution } = await context.emitTelemetryCommandError({
|
|
2026
|
+
command: context.attemptedCommand,
|
|
2027
|
+
errorCode: classification.code,
|
|
2028
|
+
errorMessage: classification.detail,
|
|
2029
|
+
exitCode,
|
|
2030
|
+
options: {
|
|
2031
|
+
bootstrap_global_options: context.bootstrapGlobal,
|
|
2032
|
+
},
|
|
2033
|
+
resolutionStage: "execute",
|
|
2034
|
+
});
|
|
2035
|
+
const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
|
|
2036
|
+
command: context.attemptedCommand,
|
|
2037
|
+
error_code: classification.code,
|
|
2038
|
+
error_category: errorCategory,
|
|
2039
|
+
exit_code: exitCode,
|
|
2040
|
+
error_message: classification.detail,
|
|
2041
|
+
command_resolution: commandResolution,
|
|
2042
|
+
resolution_stage: "execute",
|
|
2043
|
+
source_context: activeTelemetryCommandContext?.source_context,
|
|
2044
|
+
});
|
|
2045
|
+
await finishRunPmCliFailure({
|
|
2046
|
+
errorMessage,
|
|
2047
|
+
exitCode,
|
|
2048
|
+
classificationCode: classification.code,
|
|
2049
|
+
errorCategory,
|
|
2050
|
+
commandResolution,
|
|
2051
|
+
resolutionStage: "execute",
|
|
2052
|
+
});
|
|
2053
|
+
if (loggedHandledErrorToSentry) {
|
|
2054
|
+
sentryCaptureCliError(wrapThrownErrorForSentry(context.error, errorMessage));
|
|
2055
|
+
await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
|
|
2056
|
+
}
|
|
2057
|
+
process.exitCode = exitCode;
|
|
2058
|
+
return true;
|
|
2059
|
+
}
|
|
2060
|
+
function resolveUnknownHelpToken(invocationArgv) {
|
|
2061
|
+
const helpRequest = parseBootstrapHelpRequest(invocationArgv);
|
|
2062
|
+
return helpRequest.commandPathTokens[0] ?? parseBootstrapCommandName(invocationArgv) ?? "<command>";
|
|
2063
|
+
}
|
|
2064
|
+
async function handleUnknownHelpCommandError(context, code) {
|
|
2065
|
+
const unknownToken = resolveUnknownHelpToken(context.invocationArgv);
|
|
2066
|
+
const unknownMessage = `unknown command '${unknownToken}'`;
|
|
2067
|
+
const recoveryCommandDescriptors = await loadRuntimeExtensionCommandDescriptorsForRecovery(resolvePmRoot(process.cwd(), context.bootstrapGlobal.path));
|
|
2068
|
+
const usageContext = await resolveCommanderUsageContext({ message: unknownMessage }, program, recoveryCommandDescriptors);
|
|
2069
|
+
const classification = classifyCommanderError(usageContext.message, usageContext.commandName, usageContext.allowedTypes, {
|
|
2070
|
+
unknownCommandExamples: usageContext.unknownCommandExamples,
|
|
2071
|
+
unknownCommandNextSteps: usageContext.unknownCommandNextSteps,
|
|
2072
|
+
attemptedCommand: usageContext.attemptedCommand,
|
|
2073
|
+
normalizedInvocationArgs: usageContext.normalizedInvocationArgs,
|
|
2074
|
+
providedOptionFlags: usageContext.providedOptionFlags,
|
|
2075
|
+
unknownOptionSuggestions: usageContext.unknownOptionSuggestions,
|
|
2076
|
+
suggestedRetryCommand: usageContext.suggestedRetryCommand,
|
|
2077
|
+
});
|
|
2078
|
+
const { errorCategory, commandResolution } = await context.emitTelemetryCommandError({
|
|
2079
|
+
command: unknownToken,
|
|
2080
|
+
errorCode: classification.code,
|
|
2081
|
+
errorMessage: classification.detail,
|
|
2082
|
+
exitCode: EXIT_CODE.USAGE,
|
|
2083
|
+
options: {
|
|
2084
|
+
bootstrap_global_options: context.bootstrapGlobal,
|
|
2085
|
+
commander_code: code ?? "commander.helpDisplayed",
|
|
2086
|
+
},
|
|
2087
|
+
resolutionStage: "parse",
|
|
2088
|
+
});
|
|
2089
|
+
const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
|
|
2090
|
+
command: unknownToken,
|
|
2091
|
+
error_code: classification.code,
|
|
2092
|
+
error_category: errorCategory,
|
|
2093
|
+
exit_code: EXIT_CODE.USAGE,
|
|
2094
|
+
error_message: classification.detail,
|
|
2095
|
+
command_resolution: commandResolution,
|
|
2096
|
+
resolution_stage: "parse",
|
|
2097
|
+
source_context: activeTelemetryCommandContext?.source_context,
|
|
2098
|
+
});
|
|
2099
|
+
const renderedUsage = context.jsonErrors
|
|
2100
|
+
? await formatCommanderUsageJson({ message: unknownMessage }, program, recoveryCommandDescriptors)
|
|
2101
|
+
: await formatCommanderUsageMessage({ message: unknownMessage }, program, recoveryCommandDescriptors);
|
|
2102
|
+
await finishRunPmCliFailure({
|
|
2103
|
+
errorMessage: unknownMessage,
|
|
2104
|
+
exitCode: EXIT_CODE.USAGE,
|
|
2105
|
+
classificationCode: classification.code,
|
|
2106
|
+
errorCategory,
|
|
2107
|
+
commandResolution,
|
|
2108
|
+
resolutionStage: "parse",
|
|
2109
|
+
});
|
|
2110
|
+
printError(renderedUsage);
|
|
2111
|
+
if (loggedHandledErrorToSentry) {
|
|
2112
|
+
await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
|
|
2113
|
+
}
|
|
2114
|
+
process.exitCode = EXIT_CODE.USAGE;
|
|
2115
|
+
}
|
|
2116
|
+
async function handleRunPmCliHelpDisplayError(context, code, rawMessage) {
|
|
2117
|
+
const isHelpDisplayCode = code === "commander.helpDisplayed" || code === "commander.help" || code === "commander.helpCommand";
|
|
2118
|
+
if (!isHelpDisplayCode && !rawMessage.includes("(outputHelp)")) {
|
|
2119
|
+
return false;
|
|
2120
|
+
}
|
|
2121
|
+
const helpRequest = parseBootstrapHelpRequest(context.invocationArgv);
|
|
2122
|
+
if (helpRequest.requested && !isKnownHelpCommandPath(program, helpRequest.commandPathTokens)) {
|
|
2123
|
+
await handleUnknownHelpCommandError(context, code);
|
|
2124
|
+
return true;
|
|
2125
|
+
}
|
|
2126
|
+
await finishRunPmCliSuccessParse();
|
|
2127
|
+
return true;
|
|
2128
|
+
}
|
|
2129
|
+
async function handleRunPmCliCommanderUsageError(context, code) {
|
|
2130
|
+
const usageContext = await resolveCommanderUsageContext(context.error, program, activeRuntimeExtensionCommandDescriptors);
|
|
2131
|
+
const classification = classifyCommanderError(usageContext.message, usageContext.commandName, usageContext.allowedTypes, {
|
|
2132
|
+
unknownCommandExamples: usageContext.unknownCommandExamples,
|
|
2133
|
+
unknownCommandNextSteps: usageContext.unknownCommandNextSteps,
|
|
2134
|
+
attemptedCommand: usageContext.attemptedCommand,
|
|
2135
|
+
normalizedInvocationArgs: usageContext.normalizedInvocationArgs,
|
|
2136
|
+
providedOptionFlags: usageContext.providedOptionFlags,
|
|
2137
|
+
unknownOptionSuggestions: usageContext.unknownOptionSuggestions,
|
|
2138
|
+
suggestedRetryCommand: usageContext.suggestedRetryCommand,
|
|
2139
|
+
});
|
|
2140
|
+
const { errorCategory, commandResolution } = await context.emitTelemetryCommandError({
|
|
2141
|
+
command: context.attemptedCommand,
|
|
2142
|
+
errorCode: classification.code,
|
|
2143
|
+
errorMessage: classification.detail,
|
|
2144
|
+
exitCode: EXIT_CODE.USAGE,
|
|
2145
|
+
options: {
|
|
2146
|
+
bootstrap_global_options: context.bootstrapGlobal,
|
|
2147
|
+
commander_code: code,
|
|
2148
|
+
},
|
|
2149
|
+
resolutionStage: "parse",
|
|
2150
|
+
});
|
|
2151
|
+
const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
|
|
2152
|
+
command: context.attemptedCommand,
|
|
2153
|
+
error_code: classification.code,
|
|
2154
|
+
error_category: errorCategory,
|
|
2155
|
+
exit_code: EXIT_CODE.USAGE,
|
|
2156
|
+
error_message: classification.detail,
|
|
2157
|
+
command_resolution: commandResolution,
|
|
2158
|
+
resolution_stage: "parse",
|
|
2159
|
+
source_context: activeTelemetryCommandContext?.source_context,
|
|
2160
|
+
});
|
|
2161
|
+
const renderedUsage = context.jsonErrors
|
|
2162
|
+
? await formatCommanderUsageJson(context.error, program, activeRuntimeExtensionCommandDescriptors)
|
|
2163
|
+
: await formatCommanderUsageMessage(context.error, program, activeRuntimeExtensionCommandDescriptors);
|
|
2164
|
+
await finishRunPmCliFailure({
|
|
2165
|
+
errorMessage: usageContext.message,
|
|
2166
|
+
exitCode: EXIT_CODE.USAGE,
|
|
2167
|
+
classificationCode: classification.code,
|
|
2168
|
+
errorCategory,
|
|
2169
|
+
commandResolution,
|
|
2170
|
+
resolutionStage: "parse",
|
|
2171
|
+
});
|
|
2172
|
+
printError(renderedUsage);
|
|
2173
|
+
if (loggedHandledErrorToSentry) {
|
|
2174
|
+
await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
|
|
2175
|
+
}
|
|
2176
|
+
process.exitCode = EXIT_CODE.USAGE;
|
|
2177
|
+
}
|
|
2178
|
+
function shouldHandleRunPmCliCommanderError(error) {
|
|
2179
|
+
if (typeof error !== "object" || error === null || !("code" in error)) {
|
|
2180
|
+
return false;
|
|
2181
|
+
}
|
|
2182
|
+
const code = error.code;
|
|
2183
|
+
if (typeof code === "string" && (code === "commander.version" || code.startsWith("commander."))) {
|
|
2184
|
+
return true;
|
|
2185
|
+
}
|
|
2186
|
+
const rawMessage = String(error.message ?? "");
|
|
2187
|
+
return rawMessage.includes("(outputHelp)");
|
|
2188
|
+
}
|
|
2189
|
+
async function handleRunPmCliCommanderError(context) {
|
|
2190
|
+
const code = context.error.code;
|
|
2191
|
+
const rawMessage = String(context.error.message ?? "");
|
|
2192
|
+
if (await handleRunPmCliHelpDisplayError(context, code, rawMessage)) {
|
|
2193
|
+
return;
|
|
2194
|
+
}
|
|
2195
|
+
if (code === "commander.version") {
|
|
2196
|
+
await finishRunPmCliSuccessParse();
|
|
2197
|
+
return;
|
|
2198
|
+
}
|
|
2199
|
+
await handleRunPmCliCommanderUsageError(context, code);
|
|
2200
|
+
}
|
|
2201
|
+
async function handleRunPmCliError(params) {
|
|
2202
|
+
const bootstrapGlobal = parseBootstrapGlobalOptions(params.invocationArgv);
|
|
2203
|
+
const bootstrapPmRoot = resolvePmRoot(process.cwd(), bootstrapGlobal.path);
|
|
2204
|
+
const context = {
|
|
2205
|
+
error: params.error,
|
|
2206
|
+
invocationArgv: params.invocationArgv,
|
|
2207
|
+
bootstrapGlobal,
|
|
2208
|
+
jsonErrors: bootstrapGlobal.json,
|
|
2209
|
+
bootstrapPmRoot,
|
|
2210
|
+
attemptedCommand: parseBootstrapCommandName(params.invocationArgv) ?? "<unknown>",
|
|
2211
|
+
emitTelemetryCommandError: createTelemetryCommandErrorEmitter({
|
|
2212
|
+
invocationArgv: params.invocationArgv,
|
|
2213
|
+
bootstrapGlobal,
|
|
2214
|
+
bootstrapPmRoot,
|
|
2215
|
+
}),
|
|
2216
|
+
};
|
|
2217
|
+
await prepareExtensionServicesForRunPmCliError({
|
|
2218
|
+
invocationArgv: params.invocationArgv,
|
|
2219
|
+
bootstrapGlobal,
|
|
2220
|
+
bootstrapPmRoot,
|
|
2221
|
+
});
|
|
2222
|
+
if (await handleRunPmCliKnownError(context, readThrownExitCode(params.error))) {
|
|
2223
|
+
return;
|
|
2224
|
+
}
|
|
2225
|
+
if (shouldHandleRunPmCliCommanderError(params.error)) {
|
|
2226
|
+
await handleRunPmCliCommanderError(context);
|
|
2227
|
+
return;
|
|
2228
|
+
}
|
|
2229
|
+
await handleGenericRunPmCliError({
|
|
2230
|
+
error: params.error,
|
|
2231
|
+
attemptedCommand: context.attemptedCommand,
|
|
2232
|
+
bootstrapGlobal,
|
|
2233
|
+
emitTelemetryCommandError: context.emitTelemetryCommandError,
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
1864
2236
|
/**
|
|
1865
2237
|
* Implements run pm cli for the public runtime surface of this module.
|
|
1866
2238
|
*/
|
|
@@ -1900,286 +2272,7 @@ export async function runPmCli(rawArgv = process.argv.slice(2)) {
|
|
|
1900
2272
|
await program.parseAsync(invocationProcessArgv);
|
|
1901
2273
|
}
|
|
1902
2274
|
catch (error) {
|
|
1903
|
-
|
|
1904
|
-
const bootstrapGlobal = parseBootstrapGlobalOptions(invocationArgv);
|
|
1905
|
-
const jsonErrors = bootstrapGlobal.json;
|
|
1906
|
-
const bootstrapPmRoot = resolvePmRoot(process.cwd(), bootstrapGlobal.path);
|
|
1907
|
-
const attemptedCommand = parseBootstrapCommandName(invocationArgv) ?? "<unknown>";
|
|
1908
|
-
const emitTelemetryCommandError = async (params) => {
|
|
1909
|
-
const errorCategory = resolveTelemetryErrorCategory(params.errorCode);
|
|
1910
|
-
const commandResolution = deriveTelemetryCommandResolution({
|
|
1911
|
-
ok: false,
|
|
1912
|
-
errorCode: params.errorCode,
|
|
1913
|
-
errorCategory,
|
|
1914
|
-
});
|
|
1915
|
-
await emitTelemetryErrorEvent({
|
|
1916
|
-
command: params.command,
|
|
1917
|
-
args: invocationArgv,
|
|
1918
|
-
options: params.options,
|
|
1919
|
-
global: bootstrapGlobal,
|
|
1920
|
-
pm_version: CLI_VERSION,
|
|
1921
|
-
pm_root: bootstrapPmRoot,
|
|
1922
|
-
error_code: params.errorCode,
|
|
1923
|
-
error_message: params.errorMessage,
|
|
1924
|
-
exit_code: params.exitCode,
|
|
1925
|
-
error_category: errorCategory,
|
|
1926
|
-
command_resolution: commandResolution,
|
|
1927
|
-
resolution_stage: params.resolutionStage,
|
|
1928
|
-
});
|
|
1929
|
-
return {
|
|
1930
|
-
errorCategory,
|
|
1931
|
-
commandResolution,
|
|
1932
|
-
};
|
|
1933
|
-
};
|
|
1934
|
-
if (!bootstrapGlobal.noExtensions) {
|
|
1935
|
-
const bootstrapProbe = buildBootstrapActivationProbe(invocationArgv);
|
|
1936
|
-
const discoverySnapshot = await loadRuntimeExtensionDiscoverySnapshot(bootstrapPmRoot);
|
|
1937
|
-
if (discoverySnapshot && discoveryNeedsActivationForProbe(discoverySnapshot.discovery, bootstrapProbe)) {
|
|
1938
|
-
const bootstrapSnapshot = await loadRuntimeExtensionSnapshot(bootstrapPmRoot);
|
|
1939
|
-
/* c8 ignore next */
|
|
1940
|
-
setActiveExtensionServices(bootstrapSnapshot?.services ?? { overrides: [] });
|
|
1941
|
-
}
|
|
1942
|
-
else {
|
|
1943
|
-
/* c8 ignore next */
|
|
1944
|
-
if (discoverySnapshot) {
|
|
1945
|
-
emitExtensionSkippedProfile(bootstrapProfileEnabled(invocationArgv), discoverySnapshot, bootstrapProbe);
|
|
1946
|
-
}
|
|
1947
|
-
setActiveExtensionServices({ overrides: [] });
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
const numericExitCode = readThrownExitCode(error);
|
|
1951
|
-
if (error instanceof PmCliError ||
|
|
1952
|
-
(!isCommanderError(error) && typeof numericExitCode === "number" && Number.isFinite(numericExitCode))) {
|
|
1953
|
-
const errorMessage = describeUnknownError(error);
|
|
1954
|
-
const exitCode = error instanceof PmCliError ? error.exitCode : normalizeThrownExitCode(numericExitCode);
|
|
1955
|
-
const context = error instanceof PmCliError ? error.context : undefined;
|
|
1956
|
-
const enrichedContext = buildPmCliRecoveryContext(context, invocationArgv, errorMessage);
|
|
1957
|
-
const classification = classifyPmCliError(errorMessage, enrichedContext);
|
|
1958
|
-
const renderedError = jsonErrors
|
|
1959
|
-
? JSON.stringify(formatPmCliErrorForJson(errorMessage, exitCode, enrichedContext), null, 2)
|
|
1960
|
-
: formatPmCliErrorForDisplay(errorMessage, enrichedContext);
|
|
1961
|
-
printError(renderedError);
|
|
1962
|
-
const { errorCategory, commandResolution } = await emitTelemetryCommandError({
|
|
1963
|
-
command: attemptedCommand,
|
|
1964
|
-
errorCode: classification.code,
|
|
1965
|
-
errorMessage: classification.detail,
|
|
1966
|
-
exitCode,
|
|
1967
|
-
options: {
|
|
1968
|
-
bootstrap_global_options: bootstrapGlobal,
|
|
1969
|
-
},
|
|
1970
|
-
resolutionStage: "execute",
|
|
1971
|
-
});
|
|
1972
|
-
const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
|
|
1973
|
-
command: attemptedCommand,
|
|
1974
|
-
error_code: classification.code,
|
|
1975
|
-
error_category: errorCategory,
|
|
1976
|
-
exit_code: exitCode,
|
|
1977
|
-
error_message: classification.detail,
|
|
1978
|
-
command_resolution: commandResolution,
|
|
1979
|
-
resolution_stage: "execute",
|
|
1980
|
-
source_context: activeTelemetryCommandContext?.source_context,
|
|
1981
|
-
});
|
|
1982
|
-
sentryFinishCommandSpan(false, errorMessage, {
|
|
1983
|
-
error_code: classification.code,
|
|
1984
|
-
error_category: errorCategory,
|
|
1985
|
-
exit_code: exitCode,
|
|
1986
|
-
command_resolution: commandResolution,
|
|
1987
|
-
resolution_stage: "execute",
|
|
1988
|
-
});
|
|
1989
|
-
await runAndClearAfterCommandHooks({
|
|
1990
|
-
ok: false,
|
|
1991
|
-
error: errorMessage,
|
|
1992
|
-
exit_code: exitCode,
|
|
1993
|
-
error_code: classification.code,
|
|
1994
|
-
error_category: errorCategory,
|
|
1995
|
-
command_resolution: commandResolution,
|
|
1996
|
-
resolution_stage: "execute",
|
|
1997
|
-
});
|
|
1998
|
-
if (loggedHandledErrorToSentry) {
|
|
1999
|
-
sentryCaptureCliError(wrapThrownErrorForSentry(error, errorMessage));
|
|
2000
|
-
}
|
|
2001
|
-
if (loggedHandledErrorToSentry) {
|
|
2002
|
-
await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
|
|
2003
|
-
}
|
|
2004
|
-
process.exitCode = exitCode;
|
|
2005
|
-
return;
|
|
2006
|
-
}
|
|
2007
|
-
if (typeof error === "object" && error !== null && "code" in error) {
|
|
2008
|
-
const code = error.code;
|
|
2009
|
-
/* c8 ignore next */
|
|
2010
|
-
const rawMessage = typeof error.message === "string" ? (error.message ?? "") : "";
|
|
2011
|
-
const isHelpDisplayCode = code === "commander.helpDisplayed" || code === "commander.help" || code === "commander.helpCommand";
|
|
2012
|
-
if (isHelpDisplayCode || rawMessage.includes("(outputHelp)")) {
|
|
2013
|
-
const helpRequest = parseBootstrapHelpRequest(invocationArgv);
|
|
2014
|
-
if (helpRequest.requested && !isKnownHelpCommandPath(program, helpRequest.commandPathTokens)) {
|
|
2015
|
-
/* c8 ignore next */
|
|
2016
|
-
const unknownToken = helpRequest.commandPathTokens[0] ?? parseBootstrapCommandName(invocationArgv) ?? "<command>";
|
|
2017
|
-
const unknownMessage = `unknown command '${unknownToken}'`;
|
|
2018
|
-
const recoveryCommandDescriptors = await loadRuntimeExtensionCommandDescriptorsForRecovery(resolvePmRoot(process.cwd(), bootstrapGlobal.path));
|
|
2019
|
-
const usageContext = await resolveCommanderUsageContext({ message: unknownMessage }, program, recoveryCommandDescriptors);
|
|
2020
|
-
const classification = classifyCommanderError(usageContext.message, usageContext.commandName, usageContext.allowedTypes, {
|
|
2021
|
-
unknownCommandExamples: usageContext.unknownCommandExamples,
|
|
2022
|
-
unknownCommandNextSteps: usageContext.unknownCommandNextSteps,
|
|
2023
|
-
attemptedCommand: usageContext.attemptedCommand,
|
|
2024
|
-
normalizedInvocationArgs: usageContext.normalizedInvocationArgs,
|
|
2025
|
-
providedOptionFlags: usageContext.providedOptionFlags,
|
|
2026
|
-
unknownOptionSuggestions: usageContext.unknownOptionSuggestions,
|
|
2027
|
-
suggestedRetryCommand: usageContext.suggestedRetryCommand,
|
|
2028
|
-
});
|
|
2029
|
-
const { errorCategory, commandResolution } = await emitTelemetryCommandError({
|
|
2030
|
-
command: unknownToken,
|
|
2031
|
-
errorCode: classification.code,
|
|
2032
|
-
errorMessage: classification.detail,
|
|
2033
|
-
exitCode: EXIT_CODE.USAGE,
|
|
2034
|
-
options: {
|
|
2035
|
-
bootstrap_global_options: bootstrapGlobal,
|
|
2036
|
-
commander_code: code ?? "commander.helpDisplayed",
|
|
2037
|
-
},
|
|
2038
|
-
resolutionStage: "parse",
|
|
2039
|
-
});
|
|
2040
|
-
const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
|
|
2041
|
-
command: unknownToken,
|
|
2042
|
-
error_code: classification.code,
|
|
2043
|
-
error_category: errorCategory,
|
|
2044
|
-
exit_code: EXIT_CODE.USAGE,
|
|
2045
|
-
error_message: classification.detail,
|
|
2046
|
-
command_resolution: commandResolution,
|
|
2047
|
-
resolution_stage: "parse",
|
|
2048
|
-
source_context: activeTelemetryCommandContext?.source_context,
|
|
2049
|
-
});
|
|
2050
|
-
const renderedUsage = jsonErrors
|
|
2051
|
-
? await formatCommanderUsageJson({ message: unknownMessage }, program, recoveryCommandDescriptors)
|
|
2052
|
-
: await formatCommanderUsageMessage({ message: unknownMessage }, program, recoveryCommandDescriptors);
|
|
2053
|
-
sentryFinishCommandSpan(false, unknownMessage, {
|
|
2054
|
-
error_code: classification.code,
|
|
2055
|
-
error_category: errorCategory,
|
|
2056
|
-
exit_code: EXIT_CODE.USAGE,
|
|
2057
|
-
command_resolution: commandResolution,
|
|
2058
|
-
resolution_stage: "parse",
|
|
2059
|
-
});
|
|
2060
|
-
await runAndClearAfterCommandHooks({
|
|
2061
|
-
ok: false,
|
|
2062
|
-
error: unknownMessage,
|
|
2063
|
-
exit_code: EXIT_CODE.USAGE,
|
|
2064
|
-
error_code: classification.code,
|
|
2065
|
-
error_category: errorCategory,
|
|
2066
|
-
command_resolution: commandResolution,
|
|
2067
|
-
resolution_stage: "parse",
|
|
2068
|
-
});
|
|
2069
|
-
if (jsonErrors) {
|
|
2070
|
-
printError(renderedUsage);
|
|
2071
|
-
}
|
|
2072
|
-
else {
|
|
2073
|
-
printError(renderedUsage);
|
|
2074
|
-
}
|
|
2075
|
-
if (loggedHandledErrorToSentry) {
|
|
2076
|
-
await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
|
|
2077
|
-
}
|
|
2078
|
-
process.exitCode = EXIT_CODE.USAGE;
|
|
2079
|
-
return;
|
|
2080
|
-
}
|
|
2081
|
-
sentryFinishCommandSpan(true, undefined, {
|
|
2082
|
-
exit_code: EXIT_CODE.SUCCESS,
|
|
2083
|
-
command_resolution: "success",
|
|
2084
|
-
resolution_stage: "parse",
|
|
2085
|
-
});
|
|
2086
|
-
await runAndClearAfterCommandHooks({
|
|
2087
|
-
ok: true,
|
|
2088
|
-
exit_code: EXIT_CODE.SUCCESS,
|
|
2089
|
-
command_resolution: "success",
|
|
2090
|
-
resolution_stage: "parse",
|
|
2091
|
-
});
|
|
2092
|
-
process.exitCode = EXIT_CODE.SUCCESS;
|
|
2093
|
-
return;
|
|
2094
|
-
}
|
|
2095
|
-
if (code === "commander.version") {
|
|
2096
|
-
sentryFinishCommandSpan(true, undefined, {
|
|
2097
|
-
exit_code: EXIT_CODE.SUCCESS,
|
|
2098
|
-
command_resolution: "success",
|
|
2099
|
-
resolution_stage: "parse",
|
|
2100
|
-
});
|
|
2101
|
-
await runAndClearAfterCommandHooks({
|
|
2102
|
-
ok: true,
|
|
2103
|
-
exit_code: EXIT_CODE.SUCCESS,
|
|
2104
|
-
command_resolution: "success",
|
|
2105
|
-
resolution_stage: "parse",
|
|
2106
|
-
});
|
|
2107
|
-
process.exitCode = EXIT_CODE.SUCCESS;
|
|
2108
|
-
return;
|
|
2109
|
-
}
|
|
2110
|
-
/* c8 ignore next */
|
|
2111
|
-
if (code?.startsWith("commander.")) {
|
|
2112
|
-
const usageContext = await resolveCommanderUsageContext(error, program, activeRuntimeExtensionCommandDescriptors);
|
|
2113
|
-
const classification = classifyCommanderError(usageContext.message, usageContext.commandName, usageContext.allowedTypes, {
|
|
2114
|
-
unknownCommandExamples: usageContext.unknownCommandExamples,
|
|
2115
|
-
unknownCommandNextSteps: usageContext.unknownCommandNextSteps,
|
|
2116
|
-
attemptedCommand: usageContext.attemptedCommand,
|
|
2117
|
-
normalizedInvocationArgs: usageContext.normalizedInvocationArgs,
|
|
2118
|
-
providedOptionFlags: usageContext.providedOptionFlags,
|
|
2119
|
-
unknownOptionSuggestions: usageContext.unknownOptionSuggestions,
|
|
2120
|
-
suggestedRetryCommand: usageContext.suggestedRetryCommand,
|
|
2121
|
-
});
|
|
2122
|
-
const { errorCategory, commandResolution } = await emitTelemetryCommandError({
|
|
2123
|
-
command: attemptedCommand,
|
|
2124
|
-
errorCode: classification.code,
|
|
2125
|
-
errorMessage: classification.detail,
|
|
2126
|
-
exitCode: EXIT_CODE.USAGE,
|
|
2127
|
-
options: {
|
|
2128
|
-
bootstrap_global_options: bootstrapGlobal,
|
|
2129
|
-
commander_code: code,
|
|
2130
|
-
},
|
|
2131
|
-
resolutionStage: "parse",
|
|
2132
|
-
});
|
|
2133
|
-
const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
|
|
2134
|
-
command: attemptedCommand,
|
|
2135
|
-
error_code: classification.code,
|
|
2136
|
-
error_category: errorCategory,
|
|
2137
|
-
exit_code: EXIT_CODE.USAGE,
|
|
2138
|
-
error_message: classification.detail,
|
|
2139
|
-
command_resolution: commandResolution,
|
|
2140
|
-
resolution_stage: "parse",
|
|
2141
|
-
source_context: activeTelemetryCommandContext?.source_context,
|
|
2142
|
-
});
|
|
2143
|
-
const renderedUsage = jsonErrors
|
|
2144
|
-
? await formatCommanderUsageJson(error, program, activeRuntimeExtensionCommandDescriptors)
|
|
2145
|
-
: await formatCommanderUsageMessage(error, program, activeRuntimeExtensionCommandDescriptors);
|
|
2146
|
-
sentryFinishCommandSpan(false, usageContext.message, {
|
|
2147
|
-
error_code: classification.code,
|
|
2148
|
-
error_category: errorCategory,
|
|
2149
|
-
exit_code: EXIT_CODE.USAGE,
|
|
2150
|
-
command_resolution: commandResolution,
|
|
2151
|
-
resolution_stage: "parse",
|
|
2152
|
-
});
|
|
2153
|
-
await runAndClearAfterCommandHooks({
|
|
2154
|
-
ok: false,
|
|
2155
|
-
error: usageContext.message,
|
|
2156
|
-
exit_code: EXIT_CODE.USAGE,
|
|
2157
|
-
error_code: classification.code,
|
|
2158
|
-
error_category: errorCategory,
|
|
2159
|
-
command_resolution: commandResolution,
|
|
2160
|
-
resolution_stage: "parse",
|
|
2161
|
-
});
|
|
2162
|
-
if (jsonErrors) {
|
|
2163
|
-
printError(renderedUsage);
|
|
2164
|
-
}
|
|
2165
|
-
else {
|
|
2166
|
-
printError(renderedUsage);
|
|
2167
|
-
}
|
|
2168
|
-
if (loggedHandledErrorToSentry) {
|
|
2169
|
-
await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
|
|
2170
|
-
}
|
|
2171
|
-
process.exitCode = EXIT_CODE.USAGE;
|
|
2172
|
-
return;
|
|
2173
|
-
}
|
|
2174
|
-
}
|
|
2175
|
-
/* c8 ignore next */
|
|
2176
|
-
await handleGenericRunPmCliError({
|
|
2177
|
-
error,
|
|
2178
|
-
attemptedCommand,
|
|
2179
|
-
bootstrapGlobal,
|
|
2180
|
-
emitTelemetryCommandError,
|
|
2181
|
-
});
|
|
2182
|
-
/* c8 ignore stop */
|
|
2275
|
+
await handleRunPmCliError({ error, invocationArgv });
|
|
2183
2276
|
}
|
|
2184
2277
|
}
|
|
2185
2278
|
export const _testOnly = {
|
|
@@ -2218,6 +2311,12 @@ export const _testOnly = {
|
|
|
2218
2311
|
extensionProvidesTemplatesRuntime,
|
|
2219
2312
|
hasAnyCapability,
|
|
2220
2313
|
handleGenericRunPmCliError,
|
|
2314
|
+
handleRunPmCliCommanderError,
|
|
2315
|
+
handleRunPmCliError,
|
|
2316
|
+
handleRunPmCliHelpDisplayError,
|
|
2317
|
+
handleRunPmCliKnownError,
|
|
2318
|
+
handleRunPmCliCommanderUsageError,
|
|
2319
|
+
handleUnknownHelpCommandError,
|
|
2221
2320
|
inferMissingFieldsFromErrorMessage,
|
|
2222
2321
|
inferPostActionErrorCode,
|
|
2223
2322
|
inferPostActionFailureMessage,
|
|
@@ -2234,12 +2333,14 @@ export const _testOnly = {
|
|
|
2234
2333
|
normalizeTelemetryResolutionStage,
|
|
2235
2334
|
normalizeThrownExitCode,
|
|
2236
2335
|
probeUsesAnyFlag,
|
|
2336
|
+
prepareExtensionServicesForRunPmCliError,
|
|
2237
2337
|
readRecordBoolean,
|
|
2238
2338
|
readRecordNumber,
|
|
2239
2339
|
readRecordString,
|
|
2240
2340
|
registerDynamicExtensionCommandPaths,
|
|
2241
2341
|
registerRuntimeSchemaFieldFlags,
|
|
2242
2342
|
resolveCoreCommandRegistrationSelection,
|
|
2343
|
+
resolveUnknownHelpToken,
|
|
2243
2344
|
readThrownExitCode,
|
|
2244
2345
|
runAndClearAfterCommandHooks,
|
|
2245
2346
|
runRequiredExtensionCommand,
|
|
@@ -2247,8 +2348,10 @@ export const _testOnly = {
|
|
|
2247
2348
|
shouldLogHandledErrorToSentry,
|
|
2248
2349
|
shouldRegisterDynamicExtensionPaths,
|
|
2249
2350
|
shouldRegisterRuntimeSchemaFlags,
|
|
2351
|
+
shouldHandleRunPmCliCommanderError,
|
|
2250
2352
|
setActiveExtensionHookContextForTest,
|
|
2251
2353
|
setActiveRuntimeExtensionCommandDescriptorsForTest,
|
|
2354
|
+
setRecoveredExtensionServices,
|
|
2252
2355
|
toLooseFieldDefinitionType,
|
|
2253
2356
|
isImporterOrExporterCommandPath,
|
|
2254
2357
|
validateDynamicExtensionCommandInvocation,
|
|
@@ -2256,4 +2359,4 @@ export const _testOnly = {
|
|
|
2256
2359
|
wrapThrownErrorForSentry,
|
|
2257
2360
|
};
|
|
2258
2361
|
//# sourceMappingURL=main.js.map
|
|
2259
|
-
//# debugId=
|
|
2362
|
+
//# debugId=aa682568-77f6-5659-a6dd-3a69dd4e1fc0
|