@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../core/governance/metadata-coverage.ts"],"sourcesContent":["/**\n * Metadata governance & coverage observability primitives.\n *\n * One dependency-light module that powers the whole metadata-governance\n * surface: missing-field selection (pm list / pm update-many), coverage\n * percentages (pm stats --metadata-coverage / pm validate), and grouped\n * lifecycle breakdowns (pm stats --by-assignee/--by-tag/--by-priority,\n * pm aggregate explicit labels).\n *\n * The module is pure: it performs no IO and imports no heavy runtime\n * dependencies. Lifecycle semantics are injected via a {@link LifecycleClassifier}\n * so callers map their runtime status registry to lifecycle buckets while the\n * pure logic here stays trivially testable with a fake classifier.\n */\n\nimport { toNonEmptyStringOrUndefined } from \"../shared/primitives.js\";\n\n/** Minimal structural shape this module needs from an item's front matter. */\nexport interface CoverageItem {\n type: string;\n status: string;\n assignee?: string;\n tags?: string[];\n parent?: string;\n priority?: number;\n acceptance_criteria?: string;\n estimated_minutes?: number;\n resolution?: string;\n reviewer?: string;\n risk?: string;\n /** Confidence is a string-like enum or a numeric score depending on workspace. */\n confidence?: string | number;\n sprint?: string;\n release?: string;\n [key: string]: unknown;\n}\n\n/** Lifecycle buckets used by grouped breakdowns and distributions. */\nexport type LifecycleBucket =\n | \"open\"\n | \"in_progress\"\n | \"blocked\"\n | \"draft\"\n | \"closed\"\n | \"canceled\"\n | \"other\";\n\n/** Stable rendering order for lifecycle buckets. */\nexport const LIFECYCLE_BUCKET_ORDER: readonly LifecycleBucket[] = [\n \"open\",\n \"in_progress\",\n \"blocked\",\n \"draft\",\n \"closed\",\n \"canceled\",\n \"other\",\n] as const;\n\n/**\n * Classifies a raw status string into a lifecycle bucket and reports whether a\n * status is terminal (closed/canceled). Callers build this from their resolved\n * runtime status registry via {@link lifecycleClassifierFromStatusRegistry}.\n */\nexport interface LifecycleClassifier {\n classify(status: string): LifecycleBucket;\n isTerminal(status: string): boolean;\n}\n\n/** The subset of a resolved runtime status registry this module consumes. */\nexport interface StatusRegistryLike {\n alias_to_id: Map<string, string>;\n terminal_statuses: Set<string>;\n terminal_canceled_statuses: Set<string>;\n blocked_statuses: Set<string>;\n draft_statuses: Set<string>;\n active_statuses: Set<string>;\n open_status: string;\n}\n\nfunction normalizeStatus(status: string, registry: StatusRegistryLike): string {\n const trimmed = status.trim().toLowerCase();\n return registry.alias_to_id.get(trimmed) ?? trimmed;\n}\n\n/**\n * Adapt a resolved runtime status registry into a {@link LifecycleClassifier}.\n *\n * Precedence is deliberate and disjoint: canceled → closed → blocked → draft →\n * open → in_progress (active but not the default open status) → other.\n */\nexport function lifecycleClassifierFromStatusRegistry(registry: StatusRegistryLike): LifecycleClassifier {\n return {\n isTerminal(status: string): boolean {\n return registry.terminal_statuses.has(normalizeStatus(status, registry));\n },\n classify(status: string): LifecycleBucket {\n const id = normalizeStatus(status, registry);\n if (registry.terminal_canceled_statuses.has(id)) {\n return \"canceled\";\n }\n if (registry.terminal_statuses.has(id)) {\n return \"closed\";\n }\n if (registry.blocked_statuses.has(id)) {\n return \"blocked\";\n }\n if (registry.draft_statuses.has(id)) {\n return \"draft\";\n }\n if (id === registry.open_status) {\n return \"open\";\n }\n if (registry.active_statuses.has(id)) {\n return \"in_progress\";\n }\n return \"other\";\n },\n };\n}\n\n// ---------------------------------------------------------------------------\n// Missing-metadata predicates\n// ---------------------------------------------------------------------------\n\n/** True when an item has no non-empty acceptance_criteria. */\nexport function isAcMissing(item: CoverageItem): boolean {\n return toNonEmptyStringOrUndefined(item.acceptance_criteria) === undefined;\n}\n\n/** True when an item has no finite estimated_minutes. */\nexport function isEstimateMissing(item: CoverageItem): boolean {\n return !Number.isFinite(item.estimated_minutes);\n}\n\n/**\n * True when a terminal (closed/canceled) item has no non-empty resolution.\n * Resolution is only expected on terminal items, so open items are never\n * considered \"resolution-missing\".\n */\nexport function isResolutionMissing(item: CoverageItem, classifier: LifecycleClassifier): boolean {\n if (!classifier.isTerminal(item.status)) {\n return false;\n }\n return toNonEmptyStringOrUndefined(item.resolution) === undefined;\n}\n\n/** True when an item has no non-empty reviewer. */\nexport function isReviewerMissing(item: CoverageItem): boolean {\n return toNonEmptyStringOrUndefined(item.reviewer) === undefined;\n}\n\n/** True when an item has no non-empty risk level. */\nexport function isRiskMissing(item: CoverageItem): boolean {\n return toNonEmptyStringOrUndefined(item.risk) === undefined;\n}\n\n/**\n * True when an item has no confidence value. Confidence is a string-like enum\n * or a numeric score depending on workspace, so a finite number counts as\n * present and only blank/absent values are treated as missing.\n */\nexport function isConfidenceMissing(item: CoverageItem): boolean {\n if (typeof item.confidence === \"number\") {\n return !Number.isFinite(item.confidence);\n }\n return toNonEmptyStringOrUndefined(item.confidence) === undefined;\n}\n\n/** True when an item has no non-empty sprint. */\nexport function isSprintMissing(item: CoverageItem): boolean {\n return toNonEmptyStringOrUndefined(item.sprint) === undefined;\n}\n\n/** True when an item has no non-empty release. */\nexport function isReleaseMissing(item: CoverageItem): boolean {\n return toNonEmptyStringOrUndefined(item.release) === undefined;\n}\n\n/** Selection flags for {@link filterMissingMetadata}. */\nexport interface MissingMetadataFilters {\n acMissing?: boolean;\n estimatesMissing?: boolean;\n resolutionMissing?: boolean;\n reviewerMissing?: boolean;\n riskMissing?: boolean;\n confidenceMissing?: boolean;\n sprintMissing?: boolean;\n releaseMissing?: boolean;\n /** Match items missing ANY of the tracked metadata fields (union). */\n metadataMissing?: boolean;\n}\n\n/** True when any missing-metadata filter is requested. */\nexport function hasMissingMetadataFilter(filters: MissingMetadataFilters): boolean {\n return Boolean(\n filters.acMissing ||\n filters.estimatesMissing ||\n filters.resolutionMissing ||\n filters.reviewerMissing ||\n filters.riskMissing ||\n filters.confidenceMissing ||\n filters.sprintMissing ||\n filters.releaseMissing ||\n filters.metadataMissing,\n );\n}\n\nfunction itemMatchesSpecificMetadataFilters(\n item: CoverageItem,\n filters: MissingMetadataFilters,\n classifier: LifecycleClassifier,\n): boolean {\n const checks: Array<[boolean | undefined, boolean]> = [\n [filters.acMissing, isAcMissing(item)],\n [filters.estimatesMissing, isEstimateMissing(item)],\n [filters.resolutionMissing, isResolutionMissing(item, classifier)],\n [filters.reviewerMissing, isReviewerMissing(item)],\n [filters.riskMissing, isRiskMissing(item)],\n [filters.confidenceMissing, isConfidenceMissing(item)],\n [filters.sprintMissing, isSprintMissing(item)],\n [filters.releaseMissing, isReleaseMissing(item)],\n ];\n return checks.every(([requested, matched]) => requested !== true || matched);\n}\n\nfunction itemMatchesCoreMetadataMissingUnion(item: CoverageItem, classifier: LifecycleClassifier): boolean {\n return isAcMissing(item) || isEstimateMissing(item) || isResolutionMissing(item, classifier);\n}\n\n/**\n * Does a single item satisfy the requested missing-metadata filters?\n *\n * Specific flags (acMissing/estimatesMissing/resolutionMissing plus the\n * governance flags reviewerMissing/riskMissing/confidenceMissing/sprintMissing/\n * releaseMissing) are ANDed together so callers can narrow precisely.\n * `metadataMissing` is ORed in as a union shortcut for \"missing any of the\n * core tracked fields\" (acceptance_criteria/estimated_minutes/resolution); it\n * deliberately excludes the governance fields so the long-standing flag keeps\n * its original meaning. When no filter is requested the item passes.\n */\nexport function itemMatchesMissingMetadata(\n item: CoverageItem,\n filters: MissingMetadataFilters,\n classifier: LifecycleClassifier,\n): boolean {\n if (!hasMissingMetadataFilter(filters)) {\n return true;\n }\n if (!itemMatchesSpecificMetadataFilters(item, filters, classifier)) {\n return false;\n }\n if (filters.metadataMissing && !itemMatchesCoreMetadataMissingUnion(item, classifier)) {\n return false;\n }\n return true;\n}\n\n/** Filter a list of items by the requested missing-metadata predicates. */\nexport function filterMissingMetadata<T extends CoverageItem>(\n items: readonly T[],\n filters: MissingMetadataFilters,\n classifier: LifecycleClassifier,\n): T[] {\n if (!hasMissingMetadataFilter(filters)) {\n return [...items];\n }\n return items.filter((item) => itemMatchesMissingMetadata(item, filters, classifier));\n}\n\n// ---------------------------------------------------------------------------\n// Metadata coverage percentages\n// ---------------------------------------------------------------------------\n\n/** Coverage-tracked metadata fields. */\nexport type CoverageField =\n | \"acceptance_criteria\"\n | \"estimated_minutes\"\n | \"resolution\"\n | \"tags\"\n | \"parent\";\n\n/** Stable ordering of coverage fields for rendering. */\nexport const COVERAGE_FIELD_ORDER: readonly CoverageField[] = [\n \"acceptance_criteria\",\n \"estimated_minutes\",\n \"resolution\",\n \"tags\",\n \"parent\",\n] as const;\n\n/** Coverage of a single field: present vs applicable, with a rounded percent. */\nexport interface FieldCoverage {\n present: number;\n /** Items for which the field is expected (all items, except resolution = terminal only). */\n applicable: number;\n /** present/applicable * 100, rounded to one decimal; 100 when applicable is 0. */\n percent: number;\n}\n\n/**\n * Documents the metadata coverage report payload exchanged by command, SDK, and package integrations.\n */\nexport interface MetadataCoverageReport {\n overall: Record<CoverageField, FieldCoverage>;\n by_type: Record<string, Record<CoverageField, FieldCoverage>>;\n}\n\nfunction isFieldPresent(item: CoverageItem, field: CoverageField): boolean {\n switch (field) {\n case \"acceptance_criteria\":\n return !isAcMissing(item);\n case \"estimated_minutes\":\n return !isEstimateMissing(item);\n case \"resolution\":\n return toNonEmptyStringOrUndefined(item.resolution) !== undefined;\n case \"tags\":\n return Array.isArray(item.tags) && item.tags.length > 0;\n default:\n return toNonEmptyStringOrUndefined(item.parent) !== undefined;\n }\n}\n\n/** Whether a field applies to a given item (resolution only applies to terminal items). */\nfunction isFieldApplicable(item: CoverageItem, field: CoverageField, classifier: LifecycleClassifier): boolean {\n if (field === \"resolution\") {\n return classifier.isTerminal(item.status);\n }\n return true;\n}\n\nfunction roundPercent(present: number, applicable: number): number {\n if (applicable === 0) {\n return 100;\n }\n return Math.round((present / applicable) * 1000) / 10;\n}\n\nfunction emptyFieldCoverage(): Record<CoverageField, FieldCoverage> {\n const record = {} as Record<CoverageField, FieldCoverage>;\n for (const field of COVERAGE_FIELD_ORDER) {\n record[field] = { present: 0, applicable: 0, percent: 100 };\n }\n return record;\n}\n\nfunction accumulateCoverage(\n target: Record<CoverageField, FieldCoverage>,\n item: CoverageItem,\n classifier: LifecycleClassifier,\n): void {\n for (const field of COVERAGE_FIELD_ORDER) {\n if (!isFieldApplicable(item, field, classifier)) {\n continue;\n }\n const entry = target[field];\n entry.applicable += 1;\n if (isFieldPresent(item, field)) {\n entry.present += 1;\n }\n }\n}\n\nfunction finalizePercentages(record: Record<CoverageField, FieldCoverage>): void {\n for (const field of COVERAGE_FIELD_ORDER) {\n const entry = record[field];\n entry.percent = roundPercent(entry.present, entry.applicable);\n }\n}\n\n/**\n * Compute metadata coverage overall and per item type. For each tracked field\n * we report present/applicable counts and a rounded percentage. Resolution is\n * scoped to terminal items (its only applicable population).\n */\nexport function computeMetadataCoverage(\n items: readonly CoverageItem[],\n classifier: LifecycleClassifier,\n): MetadataCoverageReport {\n const overall = emptyFieldCoverage();\n const byType: Record<string, Record<CoverageField, FieldCoverage>> = {};\n for (const item of items) {\n accumulateCoverage(overall, item, classifier);\n const typeRecord = byType[item.type] ?? (byType[item.type] = emptyFieldCoverage());\n accumulateCoverage(typeRecord, item, classifier);\n }\n finalizePercentages(overall);\n for (const typeRecord of Object.values(byType)) {\n finalizePercentages(typeRecord);\n }\n return { overall, by_type: byType };\n}\n\n// ---------------------------------------------------------------------------\n// Grouped lifecycle breakdowns\n// ---------------------------------------------------------------------------\n\n/** Dimensions a breakdown can group by. */\nexport type GroupDimension = \"assignee\" | \"priority\" | \"tag\" | \"parent\" | \"type\" | \"status\";\n\n/** Explicit labels for empty/blank group keys, by dimension. */\nconst EMPTY_GROUP_LABELS: Record<GroupDimension, string> = {\n assignee: \"(unassigned)\",\n priority: \"(no priority)\",\n tag: \"(untagged)\",\n parent: \"(unparented)\",\n type: \"(untyped)\",\n status: \"(no status)\",\n};\n\n/** Explicit label for an empty/blank group value for a given dimension. */\nexport function emptyGroupLabel(dimension: GroupDimension): string {\n return EMPTY_GROUP_LABELS[dimension];\n}\n\n/**\n * Documents the group row payload exchanged by command, SDK, and package integrations.\n */\nexport interface GroupRow {\n /** Display label; explicit \"(unassigned)\"-style label for blank keys. */\n label: string;\n /** Stable structured key (null for the empty/blank group). */\n key: string | null;\n buckets: Record<LifecycleBucket, number>;\n total: number;\n}\n\n/**\n * Documents the grouped breakdown payload exchanged by command, SDK, and package integrations.\n */\nexport interface GroupedBreakdown {\n dimension: GroupDimension;\n rows: GroupRow[];\n /** Distinct items observed (an item can contribute to multiple tag rows). */\n total_items: number;\n}\n\n/**\n * Documents the group options payload exchanged by command, SDK, and package integrations.\n */\nexport interface GroupOptions {\n /** For dimension=\"tag\": only consider tags starting with this prefix. */\n tagPrefix?: string;\n}\n\nfunction emptyBuckets(): Record<LifecycleBucket, number> {\n return {\n open: 0,\n in_progress: 0,\n blocked: 0,\n draft: 0,\n closed: 0,\n canceled: 0,\n other: 0,\n };\n}\n\n/**\n * Resolve the group keys an item belongs to for a dimension. Most dimensions\n * yield exactly one key (possibly null for blank); tag yields one key per\n * matching tag (or [null] when none match), so an item can span multiple rows.\n */\nfunction groupKeysForItem(item: CoverageItem, dimension: GroupDimension, options: GroupOptions): (string | null)[] {\n switch (dimension) {\n case \"assignee\":\n return [toNonEmptyStringOrUndefined(item.assignee) ?? null];\n case \"parent\":\n return [toNonEmptyStringOrUndefined(item.parent) ?? null];\n case \"type\":\n return [toNonEmptyStringOrUndefined(item.type) ?? null];\n case \"status\":\n return [toNonEmptyStringOrUndefined(item.status) ?? null];\n case \"priority\":\n return [typeof item.priority === \"number\" ? `P${item.priority}` : null];\n default: {\n const prefix = options.tagPrefix?.trim();\n const tags = Array.isArray(item.tags) ? item.tags : [];\n const matching = tags.filter(\n (tag) => typeof tag === \"string\" && tag.length > 0 && (!prefix || tag.startsWith(prefix)),\n );\n return matching.length > 0 ? matching : [null];\n }\n }\n}\n\n/**\n * Group items by a dimension into lifecycle-bucketed rows. Blank keys render\n * with an explicit \"(unassigned)\"-style label. Rows are sorted by total\n * descending, then label ascending, with the empty group sorted last on ties.\n */\nexport function groupItemsByDimension(\n items: readonly CoverageItem[],\n dimension: GroupDimension,\n classifier: LifecycleClassifier,\n options: GroupOptions = {},\n): GroupedBreakdown {\n const rows = new Map<string, GroupRow>();\n let totalItems = 0;\n for (const item of items) {\n totalItems += 1;\n const bucket = classifier.classify(item.status);\n for (const key of groupKeysForItem(item, dimension, options)) {\n const mapKey = key ?? \"\u0000empty\";\n let row = rows.get(mapKey);\n if (!row) {\n row = {\n label: key ?? emptyGroupLabel(dimension),\n key,\n buckets: emptyBuckets(),\n total: 0,\n };\n rows.set(mapKey, row);\n }\n row.buckets[bucket] += 1;\n row.total += 1;\n }\n }\n const sorted = [...rows.values()].sort((left, right) => {\n if (right.total !== left.total) {\n return right.total - left.total;\n }\n // All blank-key items collapse into a single row per dimension, so at most\n // one row has key === null; it sorts last on ties.\n if (left.key === null) {\n return 1;\n }\n if (right.key === null) {\n return -1;\n }\n return left.label.localeCompare(right.label);\n });\n return { dimension, rows: sorted, total_items: totalItems };\n}\n\n/** Lifecycle-bucket distribution across all items (for stats lifecycle section). */\nexport function computeLifecycleDistribution(\n items: readonly CoverageItem[],\n classifier: LifecycleClassifier,\n): Record<LifecycleBucket, number> {\n const buckets = emptyBuckets();\n for (const item of items) {\n buckets[classifier.classify(item.status)] += 1;\n }\n return buckets;\n}\n"],"names":[],"mappings":";;;;;;;AA+EA,SAAS,gBAAgB,QAAgB,U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WAAW,CAAC,IAAI;IAC/C;EACF;AACF;AAOM,SAAU,sBACd,OACA,WACA,YACA,UAAwB,CAAA,GAAE;AAE1B,QAAM,OAAO,oBAAI,IAAG;AACpB,MAAI,aAAa;AACjB,aAAW,QAAQ,OAAO;AACxB,kBAAc;AACd,UAAM,SAAS,WAAW,SAAS,KAAK,MAAM;AAC9C,eAAW,OAAO,iBAAiB,MAAM,WAAW,OAAO,GAAG;AAC5D,YAAM,SAAS,OAAO;AACtB,UAAI,MAAM,KAAK,IAAI,MAAM;AACzB,UAAI,CAAC,KAAK;AACR,cAAM;UACJ,OAAO,OAAO,gBAAgB,SAAS;UACvC;UACA,SAAS,aAAY;UACrB,OAAO;;AAET,aAAK,IAAI,QAAQ,GAAG;MACtB;AACA,UAAI,QAAQ,MAAM,KAAK;AACvB,UAAI,SAAS;IACf;EACF;AACA,QAAM,SAAS,CAAC,GAAG,KAAK,OAAM,CAAE,EAAE,KAAK,CAAC,MAAM,UAAS;AACrD,QAAI,MAAM,UAAU,KAAK,OAAO;AAC9B,aAAO,MAAM,QAAQ,KAAK;IAC5B;AAGA,QAAI,KAAK,QAAQ,MAAM;AACrB,aAAO;IACT;AACA,QAAI,MAAM,QAAQ,MAAM;AACtB,aAAO;IACT;AACA,WAAO,KAAK,MAAM,cAAc,MAAM,KAAK;EAC7C,CAAC;AACD,SAAO,EAAE,WAAW,MAAM,QAAQ,aAAa,WAAU;AAC3D","debugId":"1f86aff5-7cfc-566c-8c4b-af6365719945"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7df0fcc5-8ff4-5817-b72d-925ba746d847")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
resolveSubcommandFlagContractsForCommand
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-572FKBRL.js";
|
|
6
6
|
import {
|
|
7
7
|
EXIT_CODE,
|
|
8
8
|
PmCliError,
|
|
9
9
|
isPathWithinDirectory,
|
|
10
10
|
levenshteinDistanceWithinLimit,
|
|
11
11
|
pathExists
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-L4SLHV6G.js";
|
|
13
13
|
|
|
14
14
|
// dist/cli/bootstrap-args.js
|
|
15
15
|
function parseBootstrapPathToken(token, next) {
|
|
@@ -703,6 +703,21 @@ function normalizeManagedDirectoryName(name) {
|
|
|
703
703
|
}
|
|
704
704
|
return normalized;
|
|
705
705
|
}
|
|
706
|
+
function parseOptionalManifestPriority(value) {
|
|
707
|
+
if (value === void 0 || value === null) {
|
|
708
|
+
return DEFAULT_EXTENSION_PRIORITY;
|
|
709
|
+
}
|
|
710
|
+
return typeof value === "number" && Number.isInteger(value) ? value : null;
|
|
711
|
+
}
|
|
712
|
+
function parseOptionalManifestCapabilities(value) {
|
|
713
|
+
if (value === void 0 || value === null) {
|
|
714
|
+
return [];
|
|
715
|
+
}
|
|
716
|
+
if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string")) {
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
719
|
+
return normalizeStringList(value.map((entry) => String(entry).toLowerCase()));
|
|
720
|
+
}
|
|
706
721
|
function parseExtensionManifest(raw) {
|
|
707
722
|
if (typeof raw !== "object" || raw === null) {
|
|
708
723
|
return null;
|
|
@@ -717,19 +732,10 @@ function parseExtensionManifest(raw) {
|
|
|
717
732
|
if (typeof candidate.entry !== "string" || candidate.entry.trim().length === 0) {
|
|
718
733
|
return null;
|
|
719
734
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
priority = candidate.priority;
|
|
726
|
-
}
|
|
727
|
-
let capabilities = [];
|
|
728
|
-
if (candidate.capabilities !== void 0 && candidate.capabilities !== null) {
|
|
729
|
-
if (!Array.isArray(candidate.capabilities) || candidate.capabilities.some((value) => typeof value !== "string")) {
|
|
730
|
-
return null;
|
|
731
|
-
}
|
|
732
|
-
capabilities = normalizeStringList(candidate.capabilities.map((value) => String(value).toLowerCase()));
|
|
735
|
+
const priority = parseOptionalManifestPriority(candidate.priority);
|
|
736
|
+
const capabilities = parseOptionalManifestCapabilities(candidate.capabilities);
|
|
737
|
+
if (priority === null || capabilities === null) {
|
|
738
|
+
return null;
|
|
733
739
|
}
|
|
734
740
|
return {
|
|
735
741
|
name: candidate.name.trim(),
|
|
@@ -794,6 +800,6 @@ export {
|
|
|
794
800
|
parseExtensionManifest,
|
|
795
801
|
validateExtensionDirectory
|
|
796
802
|
};
|
|
797
|
-
//# sourceMappingURL=chunk-
|
|
803
|
+
//# sourceMappingURL=chunk-QNNQAAZ5.js.map
|
|
798
804
|
|
|
799
|
-
//# debugId=
|
|
805
|
+
//# debugId=7df0fcc5-8ff4-5817-b72d-925ba746d847
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/bootstrap-args.ts","../../../../../../../../cli/commands/extension/shared.ts"],"sourcesContent":["/**\n * @module cli/bootstrap-args\n *\n * Provides CLI runtime support for Bootstrap Args.\n */\nimport { resolveSubcommandFlagContractsForCommand, type CliFlagContract } from \"../sdk/cli-contracts.js\";\nimport { levenshteinDistanceWithinLimit } from \"../core/shared/levenshtein.js\";\n\nfunction parseBootstrapPathToken(\n token: string,\n next: string | undefined,\n): { consumed: number; pathValue?: string; preferred: boolean } | null {\n if (token === \"--path\" || token === \"--pm-path\") {\n if (typeof next === \"string\" && next.length > 0) {\n return {\n consumed: 2,\n pathValue: next,\n preferred: token === \"--pm-path\",\n };\n }\n return {\n consumed: 1,\n preferred: token === \"--pm-path\",\n };\n }\n\n const inlinePrefix = token.startsWith(\"--path=\")\n ? \"--path=\"\n : token.startsWith(\"--pm-path=\")\n ? \"--pm-path=\"\n : undefined;\n if (!inlinePrefix) {\n return null;\n }\n\n const value = token.slice(inlinePrefix.length);\n if (value.length > 0) {\n return {\n consumed: 1,\n pathValue: value,\n preferred: inlinePrefix === \"--pm-path=\",\n };\n }\n return {\n consumed: 1,\n preferred: inlinePrefix === \"--pm-path=\",\n };\n}\n\n/**\n * Documents the bootstrap global options payload exchanged by command, SDK, and package integrations.\n */\nexport interface BootstrapGlobalOptions {\n path?: string;\n noExtensions: boolean;\n noPager: boolean;\n json: boolean;\n quiet: boolean;\n}\n\n/**\n * Implements parse bootstrap global options for the public runtime surface of this module.\n */\nexport function parseBootstrapGlobalOptions(argv: string[]): BootstrapGlobalOptions {\n let legacyPathValue: string | undefined;\n let pmPathValue: string | undefined;\n let noExtensions = false;\n let noPager = false;\n let json = false;\n let quiet = false;\n let index = 0;\n while (index < argv.length) {\n const token = argv[index];\n if (token === \"--\") {\n break;\n }\n if (token === \"--no-extensions\") {\n noExtensions = true;\n index += 1;\n continue;\n }\n if (token === \"--no-pager\") {\n noPager = true;\n index += 1;\n continue;\n }\n if (token === \"--json\") {\n json = true;\n index += 1;\n continue;\n }\n if (token === \"--quiet\") {\n quiet = true;\n index += 1;\n continue;\n }\n const parsedPath = parseBootstrapPathToken(token, argv[index + 1]);\n if (parsedPath) {\n if (parsedPath.pathValue !== undefined) {\n if (parsedPath.preferred) {\n pmPathValue = parsedPath.pathValue;\n } else {\n legacyPathValue = parsedPath.pathValue;\n }\n }\n index += parsedPath.consumed;\n continue;\n }\n index += 1;\n }\n return {\n path: pmPathValue ?? legacyPathValue,\n noExtensions,\n noPager,\n json,\n quiet,\n };\n}\n\n/**\n * Implements strip global bootstrap tokens for the public runtime surface of this module.\n */\nexport function stripGlobalBootstrapTokens(argv: string[]): string[] {\n const remaining: string[] = [];\n let index = 0;\n while (index < argv.length) {\n const token = argv[index];\n if (token === \"--\") {\n break;\n }\n if (\n token === \"--json\" ||\n token === \"--quiet\" ||\n token === \"--no-extensions\" ||\n token === \"--no-pager\" ||\n token === \"--profile\" ||\n token === \"--id-only\" ||\n token === \"--explain\"\n ) {\n index += 1;\n continue;\n }\n if (token === \"--path\" || token === \"--pm-path\") {\n index += 2;\n continue;\n }\n if (token.startsWith(\"--path=\") || token.startsWith(\"--pm-path=\")) {\n index += 1;\n continue;\n }\n remaining.push(token);\n index += 1;\n }\n return remaining;\n}\n\n/**\n * Documents the bootstrap help request payload exchanged by command, SDK, and package integrations.\n */\nexport interface BootstrapHelpRequest {\n requested: boolean;\n commandPathTokens: string[];\n}\n\n/**\n * Implements parse bootstrap help request for the public runtime surface of this module.\n */\nexport function parseBootstrapHelpRequest(argv: string[]): BootstrapHelpRequest {\n const stripped = stripGlobalBootstrapTokens(argv);\n const first = stripped[0]?.trim().toLowerCase();\n if (first === \"help\") {\n const commandPathTokens: string[] = [];\n for (let index = 1; index < stripped.length; index += 1) {\n const token = stripped[index];\n if (token.startsWith(\"-\")) {\n break;\n }\n commandPathTokens.push(token.trim().toLowerCase());\n }\n return {\n requested: true,\n commandPathTokens,\n };\n }\n\n const helpFlagIndex = stripped.findIndex((token) => token === \"--help\" || token === \"-h\");\n if (helpFlagIndex < 0) {\n return {\n requested: false,\n commandPathTokens: [],\n };\n }\n\n const commandPathTokens: string[] = [];\n for (const token of stripped) {\n if (token.startsWith(\"-\")) {\n break;\n }\n commandPathTokens.push(token.trim().toLowerCase());\n }\n return {\n requested: true,\n commandPathTokens,\n };\n}\n\n/**\n * Index of the command token in argv — the first non-flag token, skipping the\n * value-consuming/global bootstrap flags. Returns undefined when there is none\n * (bare invocation, only global flags, or a leading `--`). Single source of truth\n * for command-position scanning shared by {@link parseBootstrapCommandName} and the\n * command-alias rewrite so their precedence rules can never drift apart.\n */\nfunction findCommandTokenIndex(argv: string[]): number | undefined {\n for (let index = 0; index < argv.length; index += 1) {\n const token = argv[index];\n if (token === \"--\") {\n return undefined;\n }\n if (token === \"--path\" || token === \"--pm-path\") {\n index += 1;\n continue;\n }\n if (\n token.startsWith(\"--path=\") ||\n token.startsWith(\"--pm-path=\") ||\n token === \"--json\" ||\n token === \"--quiet\" ||\n token === \"--no-extensions\" ||\n token === \"--no-pager\" ||\n token === \"--profile\" ||\n token === \"--id-only\" ||\n token === \"--explain\"\n ) {\n continue;\n }\n if (token.startsWith(\"-\")) {\n continue;\n }\n return index;\n }\n return undefined;\n}\n\n/**\n * Implements parse bootstrap command name for the public runtime surface of this module.\n */\nexport function parseBootstrapCommandName(argv: string[]): string | undefined {\n const index = findCommandTokenIndex(argv);\n return index === undefined ? undefined : argv[index].trim().toLowerCase();\n}\n\nfunction shouldDisablePagerForInvocation(argv: string[], bootstrapGlobal: BootstrapGlobalOptions): boolean {\n if (bootstrapGlobal.noPager) {\n return true;\n }\n if (process.stdout.isTTY === true) {\n return false;\n }\n const helpRequest = parseBootstrapHelpRequest(argv);\n return helpRequest.requested;\n}\n\n/**\n * Implements apply bootstrap pager policy for the public runtime surface of this module.\n */\nexport function applyBootstrapPagerPolicy(argv: string[]): void {\n const bootstrapGlobal = parseBootstrapGlobalOptions(argv);\n if (!shouldDisablePagerForInvocation(argv, bootstrapGlobal)) {\n return;\n }\n process.env.PAGER = \"cat\";\n process.env.MANPAGER = \"cat\";\n process.env.GIT_PAGER = \"cat\";\n if (typeof process.env.LESS !== \"string\" || process.env.LESS.trim().length === 0) {\n process.env.LESS = \"FRX\";\n }\n}\n\ntype ExtensionSubcommandAction =\n | \"init\"\n | \"install\"\n | \"uninstall\"\n | \"explore\"\n | \"manage\"\n | \"doctor\"\n | \"adopt\"\n | \"adopt-all\"\n | \"activate\"\n | \"deactivate\";\n\nconst EXTENSION_ACTION_SYNTAX_TOKENS = new Set<ExtensionSubcommandAction>([\n \"install\",\n \"uninstall\",\n \"explore\",\n \"manage\",\n \"doctor\",\n \"adopt\",\n \"adopt-all\",\n \"activate\",\n \"deactivate\",\n]);\n\n/**\n * Implements normalize legacy extension action syntax for the public runtime surface of this module.\n */\nexport function normalizeLegacyExtensionActionSyntax(argv: string[]): string[] {\n const extensionIndex = argv.findIndex((token) => token === \"extension\");\n if (extensionIndex < 0) {\n return [...argv];\n }\n const actionToken = argv[extensionIndex + 1];\n if (!actionToken || actionToken.startsWith(\"-\")) {\n return [...argv];\n }\n if (!EXTENSION_ACTION_SYNTAX_TOKENS.has(actionToken as ExtensionSubcommandAction)) {\n return [...argv];\n }\n if (argv.includes(\"--help\") || argv.includes(\"-h\")) {\n return [...argv];\n }\n const forcedActionFlag = `--${actionToken}`;\n if (argv.includes(forcedActionFlag)) {\n return [...argv];\n }\n return [...argv.slice(0, extensionIndex + 1), forcedActionFlag, ...argv.slice(extensionIndex + 2)];\n}\n\ntype BootstrapNormalizationReason =\n | \"legacy_extension_action\"\n | \"command_alias\"\n | \"flag_alias\"\n | \"flag_typo\"\n | \"bare_key_value\"\n | \"list_merge\";\ntype BootstrapNormalizationConfidence = \"high\" | \"medium\";\n\n/**\n * Executable command aliases: a leading command token here is rewritten to its\n * canonical command BEFORE commander parses, so the alias actually runs instead of\n * merely being suggested. These are the highest-frequency aliases real agents type\n * (telemetry: `pm show <id>` alone is the single most common unknown-command) and\n * each target takes the same positional/flags as the alias (with `--comment`/\n * `--note`/`--learning` flag-aliased to `--add` on the target command). Keeping this\n * in one place means the alias is consistent across registration, commander dispatch,\n * telemetry, and error handling — all of which read the normalized argv.\n */\nexport const EXECUTABLE_COMMAND_ALIASES: Readonly<Record<string, string>> = {\n show: \"get\",\n view: \"get\",\n comment: \"comments\",\n note: \"notes\",\n learning: \"learnings\",\n};\n\n/**\n * Rewrite a leading command-alias token (e.g. `show` -> `get`) in place. Only the\n * command position is considered — the same token appearing later as an argument\n * (`pm get show`) is left untouched — and only when it is not preceded by `--` or a\n * value-consuming global flag, mirroring {@link parseBootstrapCommandName}.\n */\nfunction rewriteCommandAlias(argv: string[], trace: BootstrapNormalizationEvent[]): string[] {\n const index = findCommandTokenIndex(argv);\n if (index === undefined) {\n return argv;\n }\n const token = argv[index];\n const canonical = EXECUTABLE_COMMAND_ALIASES[token.trim().toLowerCase()];\n if (!canonical) {\n return argv;\n }\n const rewritten = [...argv];\n rewritten[index] = canonical;\n trace.push({ from: token, to: [canonical], reason: \"command_alias\", confidence: \"high\" });\n return rewritten;\n}\n\n/**\n * Documents the bootstrap normalization event payload exchanged by command, SDK, and package integrations.\n */\nexport interface BootstrapNormalizationEvent {\n from: string;\n to: string[];\n reason: BootstrapNormalizationReason;\n confidence: BootstrapNormalizationConfidence;\n}\n\n/**\n * Documents the bootstrap invocation normalization result payload exchanged by command, SDK, and package integrations.\n */\nexport interface BootstrapInvocationNormalizationResult {\n argv: string[];\n commandName: string | undefined;\n trace: BootstrapNormalizationEvent[];\n}\n\ninterface FlagLookup {\n canonicalByNormalized: Map<string, string | null>;\n canonicalByCompact: Map<string, string | null>;\n canonicalComparables: Array<{ canonicalFlag: string; comparable: string }>;\n listCanonicalFlags: Set<string>;\n}\n\nfunction normalizeFlagKeyToken(raw: string): string {\n const withoutPrefix = raw.replace(/^--?/, \"\");\n return withoutPrefix\n .replace(/_/g, \"-\")\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .toLowerCase();\n}\n\nfunction toComparableFlagKey(raw: string): string {\n return normalizeFlagKeyToken(raw).replace(/-/g, \"\");\n}\n\nfunction markUnambiguousFlag(\n map: Map<string, string | null>,\n key: string,\n canonicalFlag: string,\n): void {\n const existing = map.get(key);\n if (existing === undefined) {\n map.set(key, canonicalFlag);\n return;\n }\n if (existing !== canonicalFlag) {\n map.set(key, null);\n }\n}\n\nfunction collectLongFlagCandidates(contract: CliFlagContract): string[] {\n const candidates: string[] = [];\n const pushLongFlag = (value: string | undefined): void => {\n if (typeof value !== \"string\") {\n return;\n }\n if (!value.startsWith(\"--\")) {\n return;\n }\n candidates.push(value);\n };\n pushLongFlag(contract.flag);\n for (const alias of contract.aliases ?? []) {\n pushLongFlag(alias);\n }\n return candidates;\n}\n\nfunction buildFlagLookup(\n commandName: string | undefined,\n contractsOverride?: CliFlagContract[],\n): FlagLookup {\n const contracts = contractsOverride ?? resolveSubcommandFlagContractsForCommand(commandName);\n const canonicalByNormalized = new Map<string, string | null>();\n const canonicalByCompact = new Map<string, string | null>();\n const canonicalComparablesMap = new Map<string, string>();\n const listCanonicalFlags = new Set<string>();\n for (const contract of contracts) {\n const longCandidates = collectLongFlagCandidates(contract);\n if (longCandidates.length === 0) {\n continue;\n }\n const canonicalFlag = `--${normalizeFlagKeyToken(longCandidates[0])}`;\n for (const candidate of longCandidates) {\n markUnambiguousFlag(canonicalByNormalized, normalizeFlagKeyToken(candidate), canonicalFlag);\n markUnambiguousFlag(canonicalByCompact, toComparableFlagKey(candidate), canonicalFlag);\n }\n const comparable = toComparableFlagKey(canonicalFlag);\n if (!canonicalComparablesMap.has(canonicalFlag)) {\n canonicalComparablesMap.set(canonicalFlag, comparable);\n }\n if (contract.list === true) {\n listCanonicalFlags.add(canonicalFlag);\n }\n }\n return {\n canonicalByNormalized,\n canonicalByCompact,\n canonicalComparables: [...canonicalComparablesMap.entries()].map(([canonicalFlag, comparable]) => ({\n canonicalFlag,\n comparable,\n })),\n listCanonicalFlags,\n };\n}\n\nfunction resolveCanonicalFlag(\n rawKey: string,\n lookup: FlagLookup,\n): { flag: string; reason: \"flag_alias\" | \"flag_typo\"; confidence: BootstrapNormalizationConfidence } | null {\n const normalizedKey = normalizeFlagKeyToken(rawKey);\n const direct = lookup.canonicalByNormalized.get(normalizedKey);\n if (typeof direct === \"string\") {\n return {\n flag: direct,\n reason: \"flag_alias\",\n confidence: \"high\",\n };\n }\n const comparableKey = normalizedKey.replace(/-/g, \"\");\n const compactMatch = lookup.canonicalByCompact.get(comparableKey);\n if (typeof compactMatch === \"string\") {\n return {\n flag: compactMatch,\n reason: \"flag_alias\",\n confidence: \"high\",\n };\n }\n const maxDistance = comparableKey.length >= 8 ? 2 : 1;\n let bestDistance = Number.POSITIVE_INFINITY;\n let bestFlag: string | undefined;\n let tied = false;\n for (const candidate of lookup.canonicalComparables) {\n const distance = levenshteinDistanceWithinLimit(comparableKey, candidate.comparable, maxDistance);\n if (distance === null) {\n continue;\n }\n if (distance < bestDistance) {\n bestDistance = distance;\n bestFlag = candidate.canonicalFlag;\n tied = false;\n continue;\n }\n if (distance === bestDistance && bestFlag !== candidate.canonicalFlag) {\n tied = true;\n }\n }\n if (!bestFlag || tied || !Number.isFinite(bestDistance) || bestDistance <= 0) {\n return null;\n }\n return {\n flag: bestFlag,\n reason: \"flag_typo\",\n confidence: bestDistance >= 2 ? \"medium\" : \"high\",\n };\n}\n\n/**\n * Implements list alias plural keys for the public runtime surface of this module.\n */\nexport function listAliasPluralKeys(normalizedKey: string): string[] {\n const candidates = [`${normalizedKey}s`];\n if (normalizedKey.endsWith(\"y\") && normalizedKey.length > 1) {\n candidates.push(`${normalizedKey.slice(0, -1)}ies`);\n }\n return candidates;\n}\n\nfunction parseBareKeyValueToken(token: string): { key: string; value: string } | null {\n if (token.includes(\"://\")) {\n return null;\n }\n const match = token.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);\n if (!match) {\n return null;\n }\n const key = match[1];\n const value = match[3];\n if (value.length === 0) {\n return null;\n }\n return {\n key,\n value,\n };\n}\n\nfunction normalizeLongOptionToken(\n token: string,\n lookup: FlagLookup,\n): { tokens: string[]; event?: BootstrapNormalizationEvent } {\n if (!token.startsWith(\"--\")) {\n return { tokens: [token] };\n }\n const equalsIndex = token.indexOf(\"=\");\n const key = equalsIndex >= 0 ? token.slice(0, equalsIndex) : token;\n const inlineValue = equalsIndex >= 0 ? token.slice(equalsIndex + 1) : undefined;\n const resolution = resolveCanonicalFlag(key, lookup);\n if (!resolution) {\n return { tokens: [token] };\n }\n const normalizedToken = inlineValue === undefined ? resolution.flag : `${resolution.flag}=${inlineValue}`;\n if (normalizedToken === token) {\n return { tokens: [token] };\n }\n return {\n tokens: [normalizedToken],\n event: {\n from: token,\n to: [normalizedToken],\n reason: resolution.reason,\n confidence: resolution.confidence,\n },\n };\n}\n\n// Global option flags whose value may legitimately begin with \"--\" (commander\n// accepts such values). Their value token must not be reinterpreted as a list\n// flag during coalescing. `--pm-path <dir>` and its legacy `--path <dir>`\n// alias are the documented cases; other globals\n// (--json/--quiet/--no-extensions/--no-pager/--profile) are boolean.\nconst GLOBAL_VALUE_CONSUMING_FLAGS = new Set<string>([\"--pm-path\", \"--path\"]);\n\nfunction splitCanonicalListToken(token: string): { flag: string; inlineValue?: string } | null {\n if (!token.startsWith(\"--\")) {\n return null;\n }\n const equalsIndex = token.indexOf(\"=\");\n if (equalsIndex < 0) {\n return { flag: token };\n }\n return {\n flag: token.slice(0, equalsIndex),\n inlineValue: token.slice(equalsIndex + 1),\n };\n}\n\ninterface ListFlagSlot {\n outputIndex: number;\n originalTokens: string[];\n values: string[];\n occurrences: number;\n}\n\ninterface ListFlagOccurrence {\n originalTokens: string[];\n value: string | undefined;\n consumed: number;\n}\n\ninterface ValuedListFlagOccurrence {\n originalTokens: string[];\n value: string;\n}\n\nfunction copyValueConsumingFlag(argv: string[], index: number, result: (string | null)[]): number {\n result.push(argv[index]);\n const next = argv[index + 1];\n if (typeof next === \"string\" && next !== \"--\") {\n result.push(next);\n return index + 2;\n }\n return index + 1;\n}\n\nfunction readListFlagOccurrence(\n argv: string[],\n index: number,\n parsed: { flag: string; inlineValue?: string },\n multiValueListFlags: Set<string>,\n): ListFlagOccurrence {\n if (parsed.inlineValue !== undefined) {\n return {\n originalTokens: [argv[index]],\n value: parsed.inlineValue,\n consumed: 1,\n };\n }\n\n const values: string[] = [];\n let valueIndex = index + 1;\n while (\n valueIndex < argv.length &&\n argv[valueIndex] !== \"--\" &&\n !argv[valueIndex].startsWith(\"-\") &&\n (values.length === 0 || multiValueListFlags.has(parsed.flag))\n ) {\n values.push(argv[valueIndex]);\n valueIndex += 1;\n }\n\n const consumed = values.length === 0 ? 1 : 1 + values.length;\n return {\n originalTokens: argv.slice(index, index + consumed),\n value: values.length === 0 ? undefined : values.join(\",\"),\n consumed,\n };\n}\n\nfunction recordListFlagOccurrence(\n slots: Map<string, ListFlagSlot>,\n result: (string | null)[],\n flag: string,\n occurrence: ValuedListFlagOccurrence,\n): void {\n const existing = slots.get(flag);\n if (existing) {\n existing.values.push(occurrence.value);\n existing.occurrences += 1;\n return;\n }\n\n slots.set(flag, {\n outputIndex: result.length,\n originalTokens: occurrence.originalTokens,\n values: [occurrence.value],\n occurrences: 1,\n });\n // Reserve the anchor position; finalized after the walk so we know the full\n // merged value or can restore the original token form for single uses.\n result.push(null);\n}\n\nfunction buildListFlagCoalescingSplices(\n slots: Map<string, ListFlagSlot>,\n multiValueListFlags: Set<string>,\n): {\n events: BootstrapNormalizationEvent[];\n splices: Array<{ outputIndex: number; tokens: string[] }>;\n} {\n const events: BootstrapNormalizationEvent[] = [];\n const splices: Array<{ outputIndex: number; tokens: string[] }> = [];\n for (const [flag, slot] of slots) {\n const shouldMerge = slot.occurrences >= 2 || (multiValueListFlags.has(flag) && slot.originalTokens.length > 2);\n if (!shouldMerge) {\n splices.push({ outputIndex: slot.outputIndex, tokens: slot.originalTokens });\n continue;\n }\n const mergedToken = `${flag}=${slot.values.join(\",\")}`;\n splices.push({ outputIndex: slot.outputIndex, tokens: [mergedToken] });\n events.push({\n from: `${flag} (x${slot.occurrences})`,\n to: [mergedToken],\n reason: \"list_merge\",\n confidence: \"high\",\n });\n }\n return { events, splices };\n}\n\nfunction applyListFlagSplices(result: (string | null)[], splices: Array<{ outputIndex: number; tokens: string[] }>): void {\n splices.sort((a, b) => b.outputIndex - a.outputIndex);\n for (const splice of splices) {\n result.splice(splice.outputIndex, 1, ...splice.tokens);\n }\n}\n\n/**\n * Coalesce repeated occurrences of comma-separated list flags into a single\n * `--flag=v1,v2,v3` token anchored at the FIRST occurrence. Without this,\n * Commander treats these flags as scalars and silently keeps only the last\n * value (data loss). Both `--flag value` and `--flag=value` forms are merged;\n * a value-less occurrence is preserved untouched, and a `--` terminator stops\n * coalescing (remainder is passed through verbatim).\n *\n * `valueConsumingFlags` lists option flags (e.g. global `--path`) whose value\n * may itself begin with `--`. Their value token is emitted verbatim so a\n * list-flag-looking value (`--path --tags`) is never reinterpreted as a flag\n * nor allowed to swallow the following command/positional token.\n */\nexport function coalesceRepeatedListFlags(\n argv: string[],\n listFlags: Set<string>,\n valueConsumingFlags: Set<string> = new Set(),\n multiValueListFlags: Set<string> = new Set(),\n): { argv: string[]; events: BootstrapNormalizationEvent[] } {\n if (listFlags.size === 0) {\n return { argv: [...argv], events: [] };\n }\n\n const result: (string | null)[] = [];\n const slots = new Map<string, ListFlagSlot>();\n let index = 0;\n while (index < argv.length) {\n const token = argv[index];\n if (token === \"--\") {\n result.push(...argv.slice(index));\n break;\n }\n // A value-consuming option in space form owns the next token as its value,\n // even when that value begins with \"--\". Emit both verbatim so the value is\n // never misread as a list-flag occurrence.\n if (valueConsumingFlags.has(token)) {\n index = copyValueConsumingFlag(argv, index, result);\n continue;\n }\n const parsed = splitCanonicalListToken(token);\n if (!parsed || !listFlags.has(parsed.flag)) {\n result.push(token);\n index += 1;\n continue;\n }\n\n const occurrence = readListFlagOccurrence(argv, index, parsed, multiValueListFlags);\n if (occurrence.value === undefined) {\n // Value-less occurrence: leave untouched, do not coalesce.\n result.push(token);\n index += occurrence.consumed;\n continue;\n }\n\n recordListFlagOccurrence(slots, result, parsed.flag, {\n originalTokens: occurrence.originalTokens,\n value: occurrence.value,\n });\n index += occurrence.consumed;\n }\n\n // Apply anchor splices from the end so earlier indices stay valid when a\n // single-occurrence anchor expands back into two tokens.\n const { events, splices } = buildListFlagCoalescingSplices(slots, multiValueListFlags);\n applyListFlagSplices(result, splices);\n\n return { argv: result as string[], events };\n}\n\n/**\n * Linked-test entry keys accepted in the two-token form `pm test <id> --add command\n * \"npm test -- parser\"` (GH-191). Only entry-identity keys are merged: `command`/`cmd`\n * name the shell command and `path` names the test file, so a single key=value entry is\n * meaningful for them. Other structured keys (scope, env_set, assertions, ...) cannot\n * form a valid standalone entry and are left for the normal parser to reject. `--remove`\n * matches existing entries by `command=`/`path=` only, so `cmd` is excluded there.\n * Key names mirror STRUCTURED_LINKED_TEST_KEYS in src/cli/commands/linked-test-entry.ts.\n */\nconst LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG: ReadonlyMap<string, ReadonlySet<string>> = new Map([\n [\"--add\", new Set([\"command\", \"cmd\", \"path\"])],\n [\"--remove\", new Set([\"command\", \"path\"])],\n]);\n\n/**\n * Sandbox-safe linked-test commands legitimately start with env assignments\n * (`PM_PATH=... PM_GLOBAL_PATH=... vitest run -- parser`), which look like bare\n * key=value settings tokens. When the two preceding tokens are a linked-test\n * flag plus a bare two-token key (`--add command <value>`), the value must be\n * left intact for mergeLinkedTestTwoTokenEntries instead of being rewritten\n * into a canonical flag (e.g. PM_PATH= -> --pm-path), which would silently\n * corrupt the command into `--add command --pm-path ...`.\n */\nfunction isLinkedTestTwoTokenValuePosition(commandName: string | undefined, emittedTokens: readonly string[]): boolean {\n if (commandName !== \"test\" || emittedTokens.length < 2) {\n return false;\n }\n const key = emittedTokens[emittedTokens.length - 1];\n const flag = emittedTokens[emittedTokens.length - 2];\n const keys = LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(flag);\n return keys !== undefined && keys.has(key);\n}\n\n/**\n * Accept the two-token linked-test form `pm test <id> --add command \"npm test -- parser\"`\n * by merging the bare key token and its single quoted value into the documented\n * `--add command=...` shape. Without this merge Commander binds the bare key as the\n * option value and treats the quoted command as an excess positional, failing with\n * \"too many arguments\" (GH-191). The merge only fires when EXACTLY ONE non-flag token\n * follows the bare key, i.e. the value was quoted into one shell token — an unquoted\n * multi-token value stays ambiguous (it may swallow the item id), still fails fast, and\n * is routed to targeted quoting guidance by the commander error classifier instead.\n */\nexport function mergeLinkedTestTwoTokenEntries(\n argv: string[],\n commandName: string | undefined,\n trace: BootstrapNormalizationEvent[],\n): string[] {\n if (commandName !== \"test\") {\n return argv;\n }\n const result: string[] = [];\n let index = 0;\n while (index < argv.length) {\n const token = argv[index];\n if (token === \"--\") {\n result.push(...argv.slice(index));\n return result;\n }\n const keys = LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(token);\n const key = keys ? argv[index + 1] : undefined;\n if (!keys || typeof key !== \"string\" || !keys.has(key)) {\n result.push(token);\n index += 1;\n continue;\n }\n let runEnd = index + 2;\n while (runEnd < argv.length && !argv[runEnd].startsWith(\"-\")) {\n runEnd += 1;\n }\n if (runEnd - (index + 2) !== 1) {\n result.push(token);\n index += 1;\n continue;\n }\n const value = argv[index + 2];\n const mergedValue = `${key}=${value}`;\n result.push(token, mergedValue);\n trace.push({\n from: `${token} ${key} ${value}`,\n to: [token, mergedValue],\n reason: \"bare_key_value\",\n confidence: \"high\",\n });\n index += 3;\n }\n return result;\n}\n\n/**\n * Implements normalize bootstrap invocation for the public runtime surface of this module.\n */\nexport function normalizeBootstrapInvocation(argv: string[]): BootstrapInvocationNormalizationResult {\n const trace: BootstrapNormalizationEvent[] = [];\n const legacyNormalized = normalizeLegacyExtensionActionSyntax(argv);\n if (legacyNormalized.length !== argv.length || legacyNormalized.some((token, index) => token !== argv[index])) {\n trace.push({\n from: argv.join(\" \"),\n to: [...legacyNormalized],\n reason: \"legacy_extension_action\",\n confidence: \"high\",\n });\n }\n const aliasNormalized = rewriteCommandAlias(legacyNormalized, trace);\n const commandName = parseBootstrapCommandName(aliasNormalized);\n const commandPathName = parseBootstrapCommandPathName(aliasNormalized);\n const lookup = buildFlagLookup(commandPathName ?? commandName);\n const normalizedArgv: string[] = [];\n for (let index = 0; index < aliasNormalized.length; index += 1) {\n const token = aliasNormalized[index];\n if (token === \"--\") {\n normalizedArgv.push(...aliasNormalized.slice(index));\n break;\n }\n const previous = normalizedArgv[normalizedArgv.length - 1];\n if (token.startsWith(\"--\")) {\n const normalizedToken = normalizeLongOptionToken(token, lookup);\n normalizedArgv.push(...normalizedToken.tokens);\n if (normalizedToken.event) {\n trace.push(normalizedToken.event);\n }\n continue;\n }\n const bareKeyValue = parseBareKeyValueToken(token);\n if (\n bareKeyValue &&\n !(typeof previous === \"string\" && previous.startsWith(\"-\")) &&\n !isLinkedTestTwoTokenValuePosition(commandName, normalizedArgv)\n ) {\n const resolution = resolveCanonicalFlag(bareKeyValue.key, lookup);\n if (resolution) {\n const replacement = [resolution.flag, bareKeyValue.value];\n normalizedArgv.push(...replacement);\n trace.push({\n from: token,\n to: replacement,\n reason: \"bare_key_value\",\n confidence: resolution.confidence,\n });\n continue;\n }\n }\n normalizedArgv.push(token);\n }\n const linkedTestNormalized = mergeLinkedTestTwoTokenEntries(normalizedArgv, commandName, trace);\n const coalesced = coalesceRepeatedListFlags(\n linkedTestNormalized,\n lookup.listCanonicalFlags,\n GLOBAL_VALUE_CONSUMING_FLAGS,\n commandName === \"create\" ? new Set([\"--tags\"]) : new Set(),\n );\n for (const event of coalesced.events) {\n trace.push(event);\n }\n return {\n argv: coalesced.argv,\n commandName,\n trace,\n };\n}\n\nfunction parseBootstrapCommandPathName(argv: string[]): string | undefined {\n const stripped = stripGlobalBootstrapTokens(argv);\n const first = stripped[0]?.trim().toLowerCase();\n const second = stripped[1]?.trim().toLowerCase();\n if (\n (first === \"extension\" || first === \"package\" || first === \"packages\") &&\n typeof second === \"string\" &&\n second.length > 0 &&\n !second.startsWith(\"-\")\n ) {\n return `${first} ${second}`;\n }\n return first;\n}\n\n/**\n * Implements parse bootstrap type value for the public runtime surface of this module.\n */\nexport function parseBootstrapTypeValue(argv: string[]): string | undefined {\n for (let index = 0; index < argv.length; index += 1) {\n const token = argv[index];\n if (token === \"--type\") {\n const candidate = argv[index + 1];\n if (typeof candidate === \"string\" && candidate.trim().length > 0) {\n return candidate.trim();\n }\n continue;\n }\n if (token.startsWith(\"--type=\")) {\n const candidate = token.slice(\"--type=\".length).trim();\n if (candidate.length > 0) {\n return candidate;\n }\n }\n }\n return undefined;\n}\n\nexport const _testOnly = {\n buildFlagLookup,\n collectLongFlagCandidates,\n markUnambiguousFlag,\n normalizeLongOptionToken,\n resolveCanonicalFlag,\n};\n","/**\n * @module cli/commands/extension/shared\n *\n * Implements extension package-management support for Shared.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../../core/fs/fs-utils.js\";\nimport { isPathWithinDirectory } from \"../../../core/fs/path-utils.js\";\nimport { EXIT_CODE } from \"../../../core/shared/constants.js\";\nimport { PmCliError } from \"../../../core/shared/errors.js\";\nimport type { ExtensionManifest } from \"../../../core/extensions/loader.js\";\n\nexport const DEFAULT_EXTENSION_PRIORITY = 100;\n\n/**\n * Documents the validated extension directory payload exchanged by command, SDK, and package integrations.\n */\nexport interface ValidatedExtensionDirectory {\n directory: string;\n manifest_path: string;\n entry_path: string;\n manifest: ExtensionManifest;\n}\n\n/**\n * Implements normalize string list for the public runtime surface of this module.\n */\nexport function normalizeStringList(values: readonly string[]): string[] {\n return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((left, right) =>\n left.localeCompare(right),\n );\n}\n\n/**\n * Implements normalize extension name for match for the public runtime surface of this module.\n */\nexport function normalizeExtensionNameForMatch(value: string): string {\n return value.trim().toLowerCase();\n}\n\n/**\n * Implements normalize managed directory name for the public runtime surface of this module.\n */\nexport function normalizeManagedDirectoryName(name: string): string {\n const normalized = name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n if (normalized.length === 0) {\n throw new PmCliError(\"Extension manifest name must resolve to a non-empty directory name.\", EXIT_CODE.USAGE);\n }\n if (normalized === \".\" || normalized === \"..\") {\n // Manifest-controlled input must resolve to a dedicated child directory, never\n // the extensions root itself or its parent (path-traversal guard).\n throw new PmCliError(\"Extension manifest name must not resolve to \\\".\\\" or \\\"..\\\".\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\n/**\n * Implements parse extension manifest for the public runtime surface of this module.\n */\nexport function parseExtensionManifest(raw: unknown): ExtensionManifest | null {\n if (typeof raw !== \"object\" || raw === null) {\n return null;\n }\n const candidate = raw as Record<string, unknown>;\n if (typeof candidate.name !== \"string\" || candidate.name.trim().length === 0) {\n return null;\n }\n if (typeof candidate.version !== \"string\" || candidate.version.trim().length === 0) {\n return null;\n }\n if (typeof candidate.entry !== \"string\" || candidate.entry.trim().length === 0) {\n return null;\n }\n\n let priority = DEFAULT_EXTENSION_PRIORITY;\n if (candidate.priority !== undefined && candidate.priority !== null) {\n if (typeof candidate.priority !== \"number\" || !Number.isInteger(candidate.priority)) {\n return null;\n }\n priority = candidate.priority;\n }\n\n let capabilities: string[] = [];\n if (candidate.capabilities !== undefined && candidate.capabilities !== null) {\n if (!Array.isArray(candidate.capabilities) || candidate.capabilities.some((value) => typeof value !== \"string\")) {\n return null;\n }\n capabilities = normalizeStringList(candidate.capabilities.map((value) => String(value).toLowerCase()));\n }\n\n return {\n name: candidate.name.trim(),\n version: candidate.version.trim(),\n entry: candidate.entry.trim(),\n priority,\n capabilities,\n };\n}\n\n/**\n * Implements check whether canonical path within directory for the public runtime surface of this module.\n */\nexport async function isCanonicalPathWithinDirectory(directory: string, targetPath: string): Promise<boolean> {\n const [resolvedDirectory, resolvedTargetPath] = await Promise.all([fs.realpath(directory), fs.realpath(targetPath)]);\n return isPathWithinDirectory(resolvedDirectory, resolvedTargetPath);\n}\n\n/**\n * Implements validate extension directory for the public runtime surface of this module.\n */\nexport async function validateExtensionDirectory(directory: string): Promise<ValidatedExtensionDirectory> {\n const manifestPath = path.join(directory, \"manifest.json\");\n if (!(await pathExists(manifestPath))) {\n throw new PmCliError(`Extension manifest is missing at \"${manifestPath}\".`, EXIT_CODE.USAGE);\n }\n\n let parsedManifest: unknown;\n try {\n parsedManifest = JSON.parse(await fs.readFile(manifestPath, \"utf8\")) as unknown;\n } catch (error: unknown) {\n throw new PmCliError(\n `Failed to parse extension manifest at \"${manifestPath}\": ${formatManifestReadError(error)}`,\n EXIT_CODE.USAGE,\n );\n }\n\n const manifest = parseExtensionManifest(parsedManifest);\n if (!manifest) {\n throw new PmCliError(`Extension manifest at \"${manifestPath}\" is invalid.`, EXIT_CODE.USAGE);\n }\n\n const entryPath = path.resolve(directory, manifest.entry);\n if (!isPathWithinDirectory(directory, entryPath)) {\n throw new PmCliError(\n `Extension entry \"${manifest.entry}\" resolves outside extension directory \"${directory}\".`,\n EXIT_CODE.USAGE,\n );\n }\n if (!(await pathExists(entryPath))) {\n throw new PmCliError(`Extension entry file is missing at \"${entryPath}\".`, EXIT_CODE.USAGE);\n }\n if (!(await isCanonicalPathWithinDirectory(directory, entryPath))) {\n throw new PmCliError(\n `Extension entry \"${manifest.entry}\" resolves outside extension directory after symlink resolution.`,\n EXIT_CODE.USAGE,\n );\n }\n\n return {\n directory,\n manifest_path: manifestPath,\n entry_path: entryPath,\n manifest,\n };\n}\n\nfunction formatManifestReadError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport const _testOnlyExtensionShared = {\n formatManifestReadError,\n};\n"],"names":["commandPathTokens"],"mappings":";;;;;;;;;;;;;;AAQA,SAAS,wBACP,OACA,MAAwB;AAExB,MAAI,UAAU,YAAY,UAAU,aAAa;AAC/C,QAAI,OAAO,SAAS,YAAY,KAAK,SAAS,GAAG;AAC/C,aAAO;QACL,UAAU;QACV,WAAW;QACX,WAAW,UAAU;;IAEzB;AACA,WAAO;MACL,UAAU;MACV,WAAW,UAAU;;EAEzB;AAEA,QAAM,eAAe,MAAM,WAAW,SAAS,IAC3C,YACA,MAAM,WAAW,YAAY,IAC3B,eACA;AACN,MAAI,CAAC,cAAc;AACjB,WAAO;EACT;AAEA,QAAM,QAAQ,MAAM,MAAM,aAAa,MAAM;AAC7C,MAAI,MAAM,SAAS,GAAG;AACpB,WAAO;MACL,UAAU;MACV,WAAW;MACX,WAAW,iBAAiB;;EAEhC;AACA,SAAO;IACL,UAAU;IACV,WAAW,iBAAiB;;AAEhC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SAAS,MACtF,UAAU,KAAK;EAEnB;AACA,MAAI,CAAE,MAAM,WAAW,SAAS,GAAI;AAClC,UAAM,IAAI,WAAW,uCAAuC,SAAS,MAAM,UAAU,KAAK;EAC5F;AACA,MAAI,CAAE,MAAM,+BAA+B,WAAW,SAAS,GAAI;AACjE,UAAM,IAAI,WACR,oBAAoB,SAAS,KAAK,oEAClC,UAAU,KAAK;EAEnB;AAEA,SAAO;IACL;IACA,eAAe;IACf,YAAY;IACZ;;AAEJ;AAEA,SAAS,wBAAwB,OAAc;AAC7C,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D","debugId":"bbea8d94-04ff-5f5e-9dde-660e98ee0b8c"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/bootstrap-args.ts","../../../../../../../../cli/commands/extension/shared.ts"],"sourcesContent":["/**\n * @module cli/bootstrap-args\n *\n * Provides CLI runtime support for Bootstrap Args.\n */\nimport { resolveSubcommandFlagContractsForCommand, type CliFlagContract } from \"../sdk/cli-contracts.js\";\nimport { levenshteinDistanceWithinLimit } from \"../core/shared/levenshtein.js\";\n\nfunction parseBootstrapPathToken(\n token: string,\n next: string | undefined,\n): { consumed: number; pathValue?: string; preferred: boolean } | null {\n if (token === \"--path\" || token === \"--pm-path\") {\n if (typeof next === \"string\" && next.length > 0) {\n return {\n consumed: 2,\n pathValue: next,\n preferred: token === \"--pm-path\",\n };\n }\n return {\n consumed: 1,\n preferred: token === \"--pm-path\",\n };\n }\n\n const inlinePrefix = token.startsWith(\"--path=\")\n ? \"--path=\"\n : token.startsWith(\"--pm-path=\")\n ? \"--pm-path=\"\n : undefined;\n if (!inlinePrefix) {\n return null;\n }\n\n const value = token.slice(inlinePrefix.length);\n if (value.length > 0) {\n return {\n consumed: 1,\n pathValue: value,\n preferred: inlinePrefix === \"--pm-path=\",\n };\n }\n return {\n consumed: 1,\n preferred: inlinePrefix === \"--pm-path=\",\n };\n}\n\n/**\n * Documents the bootstrap global options payload exchanged by command, SDK, and package integrations.\n */\nexport interface BootstrapGlobalOptions {\n path?: string;\n noExtensions: boolean;\n noPager: boolean;\n json: boolean;\n quiet: boolean;\n}\n\n/**\n * Implements parse bootstrap global options for the public runtime surface of this module.\n */\nexport function parseBootstrapGlobalOptions(argv: string[]): BootstrapGlobalOptions {\n let legacyPathValue: string | undefined;\n let pmPathValue: string | undefined;\n let noExtensions = false;\n let noPager = false;\n let json = false;\n let quiet = false;\n let index = 0;\n while (index < argv.length) {\n const token = argv[index];\n if (token === \"--\") {\n break;\n }\n if (token === \"--no-extensions\") {\n noExtensions = true;\n index += 1;\n continue;\n }\n if (token === \"--no-pager\") {\n noPager = true;\n index += 1;\n continue;\n }\n if (token === \"--json\") {\n json = true;\n index += 1;\n continue;\n }\n if (token === \"--quiet\") {\n quiet = true;\n index += 1;\n continue;\n }\n const parsedPath = parseBootstrapPathToken(token, argv[index + 1]);\n if (parsedPath) {\n if (parsedPath.pathValue !== undefined) {\n if (parsedPath.preferred) {\n pmPathValue = parsedPath.pathValue;\n } else {\n legacyPathValue = parsedPath.pathValue;\n }\n }\n index += parsedPath.consumed;\n continue;\n }\n index += 1;\n }\n return {\n path: pmPathValue ?? legacyPathValue,\n noExtensions,\n noPager,\n json,\n quiet,\n };\n}\n\n/**\n * Implements strip global bootstrap tokens for the public runtime surface of this module.\n */\nexport function stripGlobalBootstrapTokens(argv: string[]): string[] {\n const remaining: string[] = [];\n let index = 0;\n while (index < argv.length) {\n const token = argv[index];\n if (token === \"--\") {\n break;\n }\n if (\n token === \"--json\" ||\n token === \"--quiet\" ||\n token === \"--no-extensions\" ||\n token === \"--no-pager\" ||\n token === \"--profile\" ||\n token === \"--id-only\" ||\n token === \"--explain\"\n ) {\n index += 1;\n continue;\n }\n if (token === \"--path\" || token === \"--pm-path\") {\n index += 2;\n continue;\n }\n if (token.startsWith(\"--path=\") || token.startsWith(\"--pm-path=\")) {\n index += 1;\n continue;\n }\n remaining.push(token);\n index += 1;\n }\n return remaining;\n}\n\n/**\n * Documents the bootstrap help request payload exchanged by command, SDK, and package integrations.\n */\nexport interface BootstrapHelpRequest {\n requested: boolean;\n commandPathTokens: string[];\n}\n\n/**\n * Implements parse bootstrap help request for the public runtime surface of this module.\n */\nexport function parseBootstrapHelpRequest(argv: string[]): BootstrapHelpRequest {\n const stripped = stripGlobalBootstrapTokens(argv);\n const first = stripped[0]?.trim().toLowerCase();\n if (first === \"help\") {\n const commandPathTokens: string[] = [];\n for (let index = 1; index < stripped.length; index += 1) {\n const token = stripped[index];\n if (token.startsWith(\"-\")) {\n break;\n }\n commandPathTokens.push(token.trim().toLowerCase());\n }\n return {\n requested: true,\n commandPathTokens,\n };\n }\n\n const helpFlagIndex = stripped.findIndex((token) => token === \"--help\" || token === \"-h\");\n if (helpFlagIndex < 0) {\n return {\n requested: false,\n commandPathTokens: [],\n };\n }\n\n const commandPathTokens: string[] = [];\n for (const token of stripped) {\n if (token.startsWith(\"-\")) {\n break;\n }\n commandPathTokens.push(token.trim().toLowerCase());\n }\n return {\n requested: true,\n commandPathTokens,\n };\n}\n\n/**\n * Index of the command token in argv — the first non-flag token, skipping the\n * value-consuming/global bootstrap flags. Returns undefined when there is none\n * (bare invocation, only global flags, or a leading `--`). Single source of truth\n * for command-position scanning shared by {@link parseBootstrapCommandName} and the\n * command-alias rewrite so their precedence rules can never drift apart.\n */\nfunction findCommandTokenIndex(argv: string[]): number | undefined {\n for (let index = 0; index < argv.length; index += 1) {\n const token = argv[index];\n if (token === \"--\") {\n return undefined;\n }\n if (token === \"--path\" || token === \"--pm-path\") {\n index += 1;\n continue;\n }\n if (\n token.startsWith(\"--path=\") ||\n token.startsWith(\"--pm-path=\") ||\n token === \"--json\" ||\n token === \"--quiet\" ||\n token === \"--no-extensions\" ||\n token === \"--no-pager\" ||\n token === \"--profile\" ||\n token === \"--id-only\" ||\n token === \"--explain\"\n ) {\n continue;\n }\n if (token.startsWith(\"-\")) {\n continue;\n }\n return index;\n }\n return undefined;\n}\n\n/**\n * Implements parse bootstrap command name for the public runtime surface of this module.\n */\nexport function parseBootstrapCommandName(argv: string[]): string | undefined {\n const index = findCommandTokenIndex(argv);\n return index === undefined ? undefined : argv[index].trim().toLowerCase();\n}\n\nfunction shouldDisablePagerForInvocation(argv: string[], bootstrapGlobal: BootstrapGlobalOptions): boolean {\n if (bootstrapGlobal.noPager) {\n return true;\n }\n if (process.stdout.isTTY === true) {\n return false;\n }\n const helpRequest = parseBootstrapHelpRequest(argv);\n return helpRequest.requested;\n}\n\n/**\n * Implements apply bootstrap pager policy for the public runtime surface of this module.\n */\nexport function applyBootstrapPagerPolicy(argv: string[]): void {\n const bootstrapGlobal = parseBootstrapGlobalOptions(argv);\n if (!shouldDisablePagerForInvocation(argv, bootstrapGlobal)) {\n return;\n }\n process.env.PAGER = \"cat\";\n process.env.MANPAGER = \"cat\";\n process.env.GIT_PAGER = \"cat\";\n if (typeof process.env.LESS !== \"string\" || process.env.LESS.trim().length === 0) {\n process.env.LESS = \"FRX\";\n }\n}\n\ntype ExtensionSubcommandAction =\n | \"init\"\n | \"install\"\n | \"uninstall\"\n | \"explore\"\n | \"manage\"\n | \"doctor\"\n | \"adopt\"\n | \"adopt-all\"\n | \"activate\"\n | \"deactivate\";\n\nconst EXTENSION_ACTION_SYNTAX_TOKENS = new Set<ExtensionSubcommandAction>([\n \"install\",\n \"uninstall\",\n \"explore\",\n \"manage\",\n \"doctor\",\n \"adopt\",\n \"adopt-all\",\n \"activate\",\n \"deactivate\",\n]);\n\n/**\n * Implements normalize legacy extension action syntax for the public runtime surface of this module.\n */\nexport function normalizeLegacyExtensionActionSyntax(argv: string[]): string[] {\n const extensionIndex = argv.findIndex((token) => token === \"extension\");\n if (extensionIndex < 0) {\n return [...argv];\n }\n const actionToken = argv[extensionIndex + 1];\n if (!actionToken || actionToken.startsWith(\"-\")) {\n return [...argv];\n }\n if (!EXTENSION_ACTION_SYNTAX_TOKENS.has(actionToken as ExtensionSubcommandAction)) {\n return [...argv];\n }\n if (argv.includes(\"--help\") || argv.includes(\"-h\")) {\n return [...argv];\n }\n const forcedActionFlag = `--${actionToken}`;\n if (argv.includes(forcedActionFlag)) {\n return [...argv];\n }\n return [...argv.slice(0, extensionIndex + 1), forcedActionFlag, ...argv.slice(extensionIndex + 2)];\n}\n\ntype BootstrapNormalizationReason =\n | \"legacy_extension_action\"\n | \"command_alias\"\n | \"flag_alias\"\n | \"flag_typo\"\n | \"bare_key_value\"\n | \"list_merge\";\ntype BootstrapNormalizationConfidence = \"high\" | \"medium\";\n\n/**\n * Executable command aliases: a leading command token here is rewritten to its\n * canonical command BEFORE commander parses, so the alias actually runs instead of\n * merely being suggested. These are the highest-frequency aliases real agents type\n * (telemetry: `pm show <id>` alone is the single most common unknown-command) and\n * each target takes the same positional/flags as the alias (with `--comment`/\n * `--note`/`--learning` flag-aliased to `--add` on the target command). Keeping this\n * in one place means the alias is consistent across registration, commander dispatch,\n * telemetry, and error handling — all of which read the normalized argv.\n */\nexport const EXECUTABLE_COMMAND_ALIASES: Readonly<Record<string, string>> = {\n show: \"get\",\n view: \"get\",\n comment: \"comments\",\n note: \"notes\",\n learning: \"learnings\",\n};\n\n/**\n * Rewrite a leading command-alias token (e.g. `show` -> `get`) in place. Only the\n * command position is considered — the same token appearing later as an argument\n * (`pm get show`) is left untouched — and only when it is not preceded by `--` or a\n * value-consuming global flag, mirroring {@link parseBootstrapCommandName}.\n */\nfunction rewriteCommandAlias(argv: string[], trace: BootstrapNormalizationEvent[]): string[] {\n const index = findCommandTokenIndex(argv);\n if (index === undefined) {\n return argv;\n }\n const token = argv[index];\n const canonical = EXECUTABLE_COMMAND_ALIASES[token.trim().toLowerCase()];\n if (!canonical) {\n return argv;\n }\n const rewritten = [...argv];\n rewritten[index] = canonical;\n trace.push({ from: token, to: [canonical], reason: \"command_alias\", confidence: \"high\" });\n return rewritten;\n}\n\n/**\n * Documents the bootstrap normalization event payload exchanged by command, SDK, and package integrations.\n */\nexport interface BootstrapNormalizationEvent {\n from: string;\n to: string[];\n reason: BootstrapNormalizationReason;\n confidence: BootstrapNormalizationConfidence;\n}\n\n/**\n * Documents the bootstrap invocation normalization result payload exchanged by command, SDK, and package integrations.\n */\nexport interface BootstrapInvocationNormalizationResult {\n argv: string[];\n commandName: string | undefined;\n trace: BootstrapNormalizationEvent[];\n}\n\ninterface FlagLookup {\n canonicalByNormalized: Map<string, string | null>;\n canonicalByCompact: Map<string, string | null>;\n canonicalComparables: Array<{ canonicalFlag: string; comparable: string }>;\n listCanonicalFlags: Set<string>;\n}\n\nfunction normalizeFlagKeyToken(raw: string): string {\n const withoutPrefix = raw.replace(/^--?/, \"\");\n return withoutPrefix\n .replace(/_/g, \"-\")\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .toLowerCase();\n}\n\nfunction toComparableFlagKey(raw: string): string {\n return normalizeFlagKeyToken(raw).replace(/-/g, \"\");\n}\n\nfunction markUnambiguousFlag(\n map: Map<string, string | null>,\n key: string,\n canonicalFlag: string,\n): void {\n const existing = map.get(key);\n if (existing === undefined) {\n map.set(key, canonicalFlag);\n return;\n }\n if (existing !== canonicalFlag) {\n map.set(key, null);\n }\n}\n\nfunction collectLongFlagCandidates(contract: CliFlagContract): string[] {\n const candidates: string[] = [];\n const pushLongFlag = (value: string | undefined): void => {\n if (typeof value !== \"string\") {\n return;\n }\n if (!value.startsWith(\"--\")) {\n return;\n }\n candidates.push(value);\n };\n pushLongFlag(contract.flag);\n for (const alias of contract.aliases ?? []) {\n pushLongFlag(alias);\n }\n return candidates;\n}\n\nfunction buildFlagLookup(\n commandName: string | undefined,\n contractsOverride?: CliFlagContract[],\n): FlagLookup {\n const contracts = contractsOverride ?? resolveSubcommandFlagContractsForCommand(commandName);\n const canonicalByNormalized = new Map<string, string | null>();\n const canonicalByCompact = new Map<string, string | null>();\n const canonicalComparablesMap = new Map<string, string>();\n const listCanonicalFlags = new Set<string>();\n for (const contract of contracts) {\n const longCandidates = collectLongFlagCandidates(contract);\n if (longCandidates.length === 0) {\n continue;\n }\n const canonicalFlag = `--${normalizeFlagKeyToken(longCandidates[0])}`;\n for (const candidate of longCandidates) {\n markUnambiguousFlag(canonicalByNormalized, normalizeFlagKeyToken(candidate), canonicalFlag);\n markUnambiguousFlag(canonicalByCompact, toComparableFlagKey(candidate), canonicalFlag);\n }\n const comparable = toComparableFlagKey(canonicalFlag);\n if (!canonicalComparablesMap.has(canonicalFlag)) {\n canonicalComparablesMap.set(canonicalFlag, comparable);\n }\n if (contract.list === true) {\n listCanonicalFlags.add(canonicalFlag);\n }\n }\n return {\n canonicalByNormalized,\n canonicalByCompact,\n canonicalComparables: [...canonicalComparablesMap.entries()].map(([canonicalFlag, comparable]) => ({\n canonicalFlag,\n comparable,\n })),\n listCanonicalFlags,\n };\n}\n\nfunction resolveCanonicalFlag(\n rawKey: string,\n lookup: FlagLookup,\n): { flag: string; reason: \"flag_alias\" | \"flag_typo\"; confidence: BootstrapNormalizationConfidence } | null {\n const normalizedKey = normalizeFlagKeyToken(rawKey);\n const direct = lookup.canonicalByNormalized.get(normalizedKey);\n if (typeof direct === \"string\") {\n return {\n flag: direct,\n reason: \"flag_alias\",\n confidence: \"high\",\n };\n }\n const comparableKey = normalizedKey.replace(/-/g, \"\");\n const compactMatch = lookup.canonicalByCompact.get(comparableKey);\n if (typeof compactMatch === \"string\") {\n return {\n flag: compactMatch,\n reason: \"flag_alias\",\n confidence: \"high\",\n };\n }\n const maxDistance = comparableKey.length >= 8 ? 2 : 1;\n let bestDistance = Number.POSITIVE_INFINITY;\n let bestFlag: string | undefined;\n let tied = false;\n for (const candidate of lookup.canonicalComparables) {\n const distance = levenshteinDistanceWithinLimit(comparableKey, candidate.comparable, maxDistance);\n if (distance === null) {\n continue;\n }\n if (distance < bestDistance) {\n bestDistance = distance;\n bestFlag = candidate.canonicalFlag;\n tied = false;\n continue;\n }\n if (distance === bestDistance && bestFlag !== candidate.canonicalFlag) {\n tied = true;\n }\n }\n if (!bestFlag || tied || !Number.isFinite(bestDistance) || bestDistance <= 0) {\n return null;\n }\n return {\n flag: bestFlag,\n reason: \"flag_typo\",\n confidence: bestDistance >= 2 ? \"medium\" : \"high\",\n };\n}\n\n/**\n * Implements list alias plural keys for the public runtime surface of this module.\n */\nexport function listAliasPluralKeys(normalizedKey: string): string[] {\n const candidates = [`${normalizedKey}s`];\n if (normalizedKey.endsWith(\"y\") && normalizedKey.length > 1) {\n candidates.push(`${normalizedKey.slice(0, -1)}ies`);\n }\n return candidates;\n}\n\nfunction parseBareKeyValueToken(token: string): { key: string; value: string } | null {\n if (token.includes(\"://\")) {\n return null;\n }\n const match = token.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);\n if (!match) {\n return null;\n }\n const key = match[1];\n const value = match[3];\n if (value.length === 0) {\n return null;\n }\n return {\n key,\n value,\n };\n}\n\nfunction normalizeLongOptionToken(\n token: string,\n lookup: FlagLookup,\n): { tokens: string[]; event?: BootstrapNormalizationEvent } {\n if (!token.startsWith(\"--\")) {\n return { tokens: [token] };\n }\n const equalsIndex = token.indexOf(\"=\");\n const key = equalsIndex >= 0 ? token.slice(0, equalsIndex) : token;\n const inlineValue = equalsIndex >= 0 ? token.slice(equalsIndex + 1) : undefined;\n const resolution = resolveCanonicalFlag(key, lookup);\n if (!resolution) {\n return { tokens: [token] };\n }\n const normalizedToken = inlineValue === undefined ? resolution.flag : `${resolution.flag}=${inlineValue}`;\n if (normalizedToken === token) {\n return { tokens: [token] };\n }\n return {\n tokens: [normalizedToken],\n event: {\n from: token,\n to: [normalizedToken],\n reason: resolution.reason,\n confidence: resolution.confidence,\n },\n };\n}\n\n// Global option flags whose value may legitimately begin with \"--\" (commander\n// accepts such values). Their value token must not be reinterpreted as a list\n// flag during coalescing. `--pm-path <dir>` and its legacy `--path <dir>`\n// alias are the documented cases; other globals\n// (--json/--quiet/--no-extensions/--no-pager/--profile) are boolean.\nconst GLOBAL_VALUE_CONSUMING_FLAGS = new Set<string>([\"--pm-path\", \"--path\"]);\n\nfunction splitCanonicalListToken(token: string): { flag: string; inlineValue?: string } | null {\n if (!token.startsWith(\"--\")) {\n return null;\n }\n const equalsIndex = token.indexOf(\"=\");\n if (equalsIndex < 0) {\n return { flag: token };\n }\n return {\n flag: token.slice(0, equalsIndex),\n inlineValue: token.slice(equalsIndex + 1),\n };\n}\n\ninterface ListFlagSlot {\n outputIndex: number;\n originalTokens: string[];\n values: string[];\n occurrences: number;\n}\n\ninterface ListFlagOccurrence {\n originalTokens: string[];\n value: string | undefined;\n consumed: number;\n}\n\ninterface ValuedListFlagOccurrence {\n originalTokens: string[];\n value: string;\n}\n\nfunction copyValueConsumingFlag(argv: string[], index: number, result: (string | null)[]): number {\n result.push(argv[index]);\n const next = argv[index + 1];\n if (typeof next === \"string\" && next !== \"--\") {\n result.push(next);\n return index + 2;\n }\n return index + 1;\n}\n\nfunction readListFlagOccurrence(\n argv: string[],\n index: number,\n parsed: { flag: string; inlineValue?: string },\n multiValueListFlags: Set<string>,\n): ListFlagOccurrence {\n if (parsed.inlineValue !== undefined) {\n return {\n originalTokens: [argv[index]],\n value: parsed.inlineValue,\n consumed: 1,\n };\n }\n\n const values: string[] = [];\n let valueIndex = index + 1;\n while (\n valueIndex < argv.length &&\n argv[valueIndex] !== \"--\" &&\n !argv[valueIndex].startsWith(\"-\") &&\n (values.length === 0 || multiValueListFlags.has(parsed.flag))\n ) {\n values.push(argv[valueIndex]);\n valueIndex += 1;\n }\n\n const consumed = values.length === 0 ? 1 : 1 + values.length;\n return {\n originalTokens: argv.slice(index, index + consumed),\n value: values.length === 0 ? undefined : values.join(\",\"),\n consumed,\n };\n}\n\nfunction recordListFlagOccurrence(\n slots: Map<string, ListFlagSlot>,\n result: (string | null)[],\n flag: string,\n occurrence: ValuedListFlagOccurrence,\n): void {\n const existing = slots.get(flag);\n if (existing) {\n existing.values.push(occurrence.value);\n existing.occurrences += 1;\n return;\n }\n\n slots.set(flag, {\n outputIndex: result.length,\n originalTokens: occurrence.originalTokens,\n values: [occurrence.value],\n occurrences: 1,\n });\n // Reserve the anchor position; finalized after the walk so we know the full\n // merged value or can restore the original token form for single uses.\n result.push(null);\n}\n\nfunction buildListFlagCoalescingSplices(\n slots: Map<string, ListFlagSlot>,\n multiValueListFlags: Set<string>,\n): {\n events: BootstrapNormalizationEvent[];\n splices: Array<{ outputIndex: number; tokens: string[] }>;\n} {\n const events: BootstrapNormalizationEvent[] = [];\n const splices: Array<{ outputIndex: number; tokens: string[] }> = [];\n for (const [flag, slot] of slots) {\n const shouldMerge = slot.occurrences >= 2 || (multiValueListFlags.has(flag) && slot.originalTokens.length > 2);\n if (!shouldMerge) {\n splices.push({ outputIndex: slot.outputIndex, tokens: slot.originalTokens });\n continue;\n }\n const mergedToken = `${flag}=${slot.values.join(\",\")}`;\n splices.push({ outputIndex: slot.outputIndex, tokens: [mergedToken] });\n events.push({\n from: `${flag} (x${slot.occurrences})`,\n to: [mergedToken],\n reason: \"list_merge\",\n confidence: \"high\",\n });\n }\n return { events, splices };\n}\n\nfunction applyListFlagSplices(result: (string | null)[], splices: Array<{ outputIndex: number; tokens: string[] }>): void {\n splices.sort((a, b) => b.outputIndex - a.outputIndex);\n for (const splice of splices) {\n result.splice(splice.outputIndex, 1, ...splice.tokens);\n }\n}\n\n/**\n * Coalesce repeated occurrences of comma-separated list flags into a single\n * `--flag=v1,v2,v3` token anchored at the FIRST occurrence. Without this,\n * Commander treats these flags as scalars and silently keeps only the last\n * value (data loss). Both `--flag value` and `--flag=value` forms are merged;\n * a value-less occurrence is preserved untouched, and a `--` terminator stops\n * coalescing (remainder is passed through verbatim).\n *\n * `valueConsumingFlags` lists option flags (e.g. global `--path`) whose value\n * may itself begin with `--`. Their value token is emitted verbatim so a\n * list-flag-looking value (`--path --tags`) is never reinterpreted as a flag\n * nor allowed to swallow the following command/positional token.\n */\nexport function coalesceRepeatedListFlags(\n argv: string[],\n listFlags: Set<string>,\n valueConsumingFlags: Set<string> = new Set(),\n multiValueListFlags: Set<string> = new Set(),\n): { argv: string[]; events: BootstrapNormalizationEvent[] } {\n if (listFlags.size === 0) {\n return { argv: [...argv], events: [] };\n }\n\n const result: (string | null)[] = [];\n const slots = new Map<string, ListFlagSlot>();\n let index = 0;\n while (index < argv.length) {\n const token = argv[index];\n if (token === \"--\") {\n result.push(...argv.slice(index));\n break;\n }\n // A value-consuming option in space form owns the next token as its value,\n // even when that value begins with \"--\". Emit both verbatim so the value is\n // never misread as a list-flag occurrence.\n if (valueConsumingFlags.has(token)) {\n index = copyValueConsumingFlag(argv, index, result);\n continue;\n }\n const parsed = splitCanonicalListToken(token);\n if (!parsed || !listFlags.has(parsed.flag)) {\n result.push(token);\n index += 1;\n continue;\n }\n\n const occurrence = readListFlagOccurrence(argv, index, parsed, multiValueListFlags);\n if (occurrence.value === undefined) {\n // Value-less occurrence: leave untouched, do not coalesce.\n result.push(token);\n index += occurrence.consumed;\n continue;\n }\n\n recordListFlagOccurrence(slots, result, parsed.flag, {\n originalTokens: occurrence.originalTokens,\n value: occurrence.value,\n });\n index += occurrence.consumed;\n }\n\n // Apply anchor splices from the end so earlier indices stay valid when a\n // single-occurrence anchor expands back into two tokens.\n const { events, splices } = buildListFlagCoalescingSplices(slots, multiValueListFlags);\n applyListFlagSplices(result, splices);\n\n return { argv: result as string[], events };\n}\n\n/**\n * Linked-test entry keys accepted in the two-token form `pm test <id> --add command\n * \"npm test -- parser\"` (GH-191). Only entry-identity keys are merged: `command`/`cmd`\n * name the shell command and `path` names the test file, so a single key=value entry is\n * meaningful for them. Other structured keys (scope, env_set, assertions, ...) cannot\n * form a valid standalone entry and are left for the normal parser to reject. `--remove`\n * matches existing entries by `command=`/`path=` only, so `cmd` is excluded there.\n * Key names mirror STRUCTURED_LINKED_TEST_KEYS in src/cli/commands/linked-test-entry.ts.\n */\nconst LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG: ReadonlyMap<string, ReadonlySet<string>> = new Map([\n [\"--add\", new Set([\"command\", \"cmd\", \"path\"])],\n [\"--remove\", new Set([\"command\", \"path\"])],\n]);\n\n/**\n * Sandbox-safe linked-test commands legitimately start with env assignments\n * (`PM_PATH=... PM_GLOBAL_PATH=... vitest run -- parser`), which look like bare\n * key=value settings tokens. When the two preceding tokens are a linked-test\n * flag plus a bare two-token key (`--add command <value>`), the value must be\n * left intact for mergeLinkedTestTwoTokenEntries instead of being rewritten\n * into a canonical flag (e.g. PM_PATH= -> --pm-path), which would silently\n * corrupt the command into `--add command --pm-path ...`.\n */\nfunction isLinkedTestTwoTokenValuePosition(commandName: string | undefined, emittedTokens: readonly string[]): boolean {\n if (commandName !== \"test\" || emittedTokens.length < 2) {\n return false;\n }\n const key = emittedTokens[emittedTokens.length - 1];\n const flag = emittedTokens[emittedTokens.length - 2];\n const keys = LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(flag);\n return keys !== undefined && keys.has(key);\n}\n\n/**\n * Accept the two-token linked-test form `pm test <id> --add command \"npm test -- parser\"`\n * by merging the bare key token and its single quoted value into the documented\n * `--add command=...` shape. Without this merge Commander binds the bare key as the\n * option value and treats the quoted command as an excess positional, failing with\n * \"too many arguments\" (GH-191). The merge only fires when EXACTLY ONE non-flag token\n * follows the bare key, i.e. the value was quoted into one shell token — an unquoted\n * multi-token value stays ambiguous (it may swallow the item id), still fails fast, and\n * is routed to targeted quoting guidance by the commander error classifier instead.\n */\nexport function mergeLinkedTestTwoTokenEntries(\n argv: string[],\n commandName: string | undefined,\n trace: BootstrapNormalizationEvent[],\n): string[] {\n if (commandName !== \"test\") {\n return argv;\n }\n const result: string[] = [];\n let index = 0;\n while (index < argv.length) {\n const token = argv[index];\n if (token === \"--\") {\n result.push(...argv.slice(index));\n return result;\n }\n const keys = LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(token);\n const key = keys ? argv[index + 1] : undefined;\n if (!keys || typeof key !== \"string\" || !keys.has(key)) {\n result.push(token);\n index += 1;\n continue;\n }\n let runEnd = index + 2;\n while (runEnd < argv.length && !argv[runEnd].startsWith(\"-\")) {\n runEnd += 1;\n }\n if (runEnd - (index + 2) !== 1) {\n result.push(token);\n index += 1;\n continue;\n }\n const value = argv[index + 2];\n const mergedValue = `${key}=${value}`;\n result.push(token, mergedValue);\n trace.push({\n from: `${token} ${key} ${value}`,\n to: [token, mergedValue],\n reason: \"bare_key_value\",\n confidence: \"high\",\n });\n index += 3;\n }\n return result;\n}\n\n/**\n * Implements normalize bootstrap invocation for the public runtime surface of this module.\n */\nexport function normalizeBootstrapInvocation(argv: string[]): BootstrapInvocationNormalizationResult {\n const trace: BootstrapNormalizationEvent[] = [];\n const legacyNormalized = normalizeLegacyExtensionActionSyntax(argv);\n if (legacyNormalized.length !== argv.length || legacyNormalized.some((token, index) => token !== argv[index])) {\n trace.push({\n from: argv.join(\" \"),\n to: [...legacyNormalized],\n reason: \"legacy_extension_action\",\n confidence: \"high\",\n });\n }\n const aliasNormalized = rewriteCommandAlias(legacyNormalized, trace);\n const commandName = parseBootstrapCommandName(aliasNormalized);\n const commandPathName = parseBootstrapCommandPathName(aliasNormalized);\n const lookup = buildFlagLookup(commandPathName ?? commandName);\n const normalizedArgv: string[] = [];\n for (let index = 0; index < aliasNormalized.length; index += 1) {\n const token = aliasNormalized[index];\n if (token === \"--\") {\n normalizedArgv.push(...aliasNormalized.slice(index));\n break;\n }\n const previous = normalizedArgv[normalizedArgv.length - 1];\n if (token.startsWith(\"--\")) {\n const normalizedToken = normalizeLongOptionToken(token, lookup);\n normalizedArgv.push(...normalizedToken.tokens);\n if (normalizedToken.event) {\n trace.push(normalizedToken.event);\n }\n continue;\n }\n const bareKeyValue = parseBareKeyValueToken(token);\n if (\n bareKeyValue &&\n !(typeof previous === \"string\" && previous.startsWith(\"-\")) &&\n !isLinkedTestTwoTokenValuePosition(commandName, normalizedArgv)\n ) {\n const resolution = resolveCanonicalFlag(bareKeyValue.key, lookup);\n if (resolution) {\n const replacement = [resolution.flag, bareKeyValue.value];\n normalizedArgv.push(...replacement);\n trace.push({\n from: token,\n to: replacement,\n reason: \"bare_key_value\",\n confidence: resolution.confidence,\n });\n continue;\n }\n }\n normalizedArgv.push(token);\n }\n const linkedTestNormalized = mergeLinkedTestTwoTokenEntries(normalizedArgv, commandName, trace);\n const coalesced = coalesceRepeatedListFlags(\n linkedTestNormalized,\n lookup.listCanonicalFlags,\n GLOBAL_VALUE_CONSUMING_FLAGS,\n commandName === \"create\" ? new Set([\"--tags\"]) : new Set(),\n );\n for (const event of coalesced.events) {\n trace.push(event);\n }\n return {\n argv: coalesced.argv,\n commandName,\n trace,\n };\n}\n\nfunction parseBootstrapCommandPathName(argv: string[]): string | undefined {\n const stripped = stripGlobalBootstrapTokens(argv);\n const first = stripped[0]?.trim().toLowerCase();\n const second = stripped[1]?.trim().toLowerCase();\n if (\n (first === \"extension\" || first === \"package\" || first === \"packages\") &&\n typeof second === \"string\" &&\n second.length > 0 &&\n !second.startsWith(\"-\")\n ) {\n return `${first} ${second}`;\n }\n return first;\n}\n\n/**\n * Implements parse bootstrap type value for the public runtime surface of this module.\n */\nexport function parseBootstrapTypeValue(argv: string[]): string | undefined {\n for (let index = 0; index < argv.length; index += 1) {\n const token = argv[index];\n if (token === \"--type\") {\n const candidate = argv[index + 1];\n if (typeof candidate === \"string\" && candidate.trim().length > 0) {\n return candidate.trim();\n }\n continue;\n }\n if (token.startsWith(\"--type=\")) {\n const candidate = token.slice(\"--type=\".length).trim();\n if (candidate.length > 0) {\n return candidate;\n }\n }\n }\n return undefined;\n}\n\nexport const _testOnly = {\n buildFlagLookup,\n collectLongFlagCandidates,\n markUnambiguousFlag,\n normalizeLongOptionToken,\n resolveCanonicalFlag,\n};\n","/**\n * @module cli/commands/extension/shared\n *\n * Implements extension package-management support for Shared.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../../core/fs/fs-utils.js\";\nimport { isPathWithinDirectory } from \"../../../core/fs/path-utils.js\";\nimport { EXIT_CODE } from \"../../../core/shared/constants.js\";\nimport { PmCliError } from \"../../../core/shared/errors.js\";\nimport type { ExtensionManifest } from \"../../../core/extensions/loader.js\";\n\nexport const DEFAULT_EXTENSION_PRIORITY = 100;\n\n/**\n * Documents the validated extension directory payload exchanged by command, SDK, and package integrations.\n */\nexport interface ValidatedExtensionDirectory {\n directory: string;\n manifest_path: string;\n entry_path: string;\n manifest: ExtensionManifest;\n}\n\n/**\n * Implements normalize string list for the public runtime surface of this module.\n */\nexport function normalizeStringList(values: readonly string[]): string[] {\n return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((left, right) =>\n left.localeCompare(right),\n );\n}\n\n/**\n * Implements normalize extension name for match for the public runtime surface of this module.\n */\nexport function normalizeExtensionNameForMatch(value: string): string {\n return value.trim().toLowerCase();\n}\n\n/**\n * Implements normalize managed directory name for the public runtime surface of this module.\n */\nexport function normalizeManagedDirectoryName(name: string): string {\n const normalized = name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n if (normalized.length === 0) {\n throw new PmCliError(\"Extension manifest name must resolve to a non-empty directory name.\", EXIT_CODE.USAGE);\n }\n if (normalized === \".\" || normalized === \"..\") {\n // Manifest-controlled input must resolve to a dedicated child directory, never\n // the extensions root itself or its parent (path-traversal guard).\n throw new PmCliError(\"Extension manifest name must not resolve to \\\".\\\" or \\\"..\\\".\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction parseOptionalManifestPriority(value: unknown): number | null {\n if (value === undefined || value === null) {\n return DEFAULT_EXTENSION_PRIORITY;\n }\n return typeof value === \"number\" && Number.isInteger(value) ? value : null;\n}\n\nfunction parseOptionalManifestCapabilities(value: unknown): string[] | null {\n if (value === undefined || value === null) {\n return [];\n }\n if (!Array.isArray(value) || value.some((entry) => typeof entry !== \"string\")) {\n return null;\n }\n return normalizeStringList(value.map((entry) => String(entry).toLowerCase()));\n}\n\n/**\n * Implements parse extension manifest for the public runtime surface of this module.\n */\nexport function parseExtensionManifest(raw: unknown): ExtensionManifest | null {\n if (typeof raw !== \"object\" || raw === null) {\n return null;\n }\n const candidate = raw as Record<string, unknown>;\n if (typeof candidate.name !== \"string\" || candidate.name.trim().length === 0) {\n return null;\n }\n if (typeof candidate.version !== \"string\" || candidate.version.trim().length === 0) {\n return null;\n }\n if (typeof candidate.entry !== \"string\" || candidate.entry.trim().length === 0) {\n return null;\n }\n\n const priority = parseOptionalManifestPriority(candidate.priority);\n const capabilities = parseOptionalManifestCapabilities(candidate.capabilities);\n if (priority === null || capabilities === null) {\n return null;\n }\n\n return {\n name: candidate.name.trim(),\n version: candidate.version.trim(),\n entry: candidate.entry.trim(),\n priority,\n capabilities,\n };\n}\n\n/**\n * Implements check whether canonical path within directory for the public runtime surface of this module.\n */\nexport async function isCanonicalPathWithinDirectory(directory: string, targetPath: string): Promise<boolean> {\n const [resolvedDirectory, resolvedTargetPath] = await Promise.all([fs.realpath(directory), fs.realpath(targetPath)]);\n return isPathWithinDirectory(resolvedDirectory, resolvedTargetPath);\n}\n\n/**\n * Implements validate extension directory for the public runtime surface of this module.\n */\nexport async function validateExtensionDirectory(directory: string): Promise<ValidatedExtensionDirectory> {\n const manifestPath = path.join(directory, \"manifest.json\");\n if (!(await pathExists(manifestPath))) {\n throw new PmCliError(`Extension manifest is missing at \"${manifestPath}\".`, EXIT_CODE.USAGE);\n }\n\n let parsedManifest: unknown;\n try {\n parsedManifest = JSON.parse(await fs.readFile(manifestPath, \"utf8\")) as unknown;\n } catch (error: unknown) {\n throw new PmCliError(\n `Failed to parse extension manifest at \"${manifestPath}\": ${formatManifestReadError(error)}`,\n EXIT_CODE.USAGE,\n );\n }\n\n const manifest = parseExtensionManifest(parsedManifest);\n if (!manifest) {\n throw new PmCliError(`Extension manifest at \"${manifestPath}\" is invalid.`, EXIT_CODE.USAGE);\n }\n\n const entryPath = path.resolve(directory, manifest.entry);\n if (!isPathWithinDirectory(directory, entryPath)) {\n throw new PmCliError(\n `Extension entry \"${manifest.entry}\" resolves outside extension directory \"${directory}\".`,\n EXIT_CODE.USAGE,\n );\n }\n if (!(await pathExists(entryPath))) {\n throw new PmCliError(`Extension entry file is missing at \"${entryPath}\".`, EXIT_CODE.USAGE);\n }\n if (!(await isCanonicalPathWithinDirectory(directory, entryPath))) {\n throw new PmCliError(\n `Extension entry \"${manifest.entry}\" resolves outside extension directory after symlink resolution.`,\n EXIT_CODE.USAGE,\n );\n }\n\n return {\n directory,\n manifest_path: manifestPath,\n entry_path: entryPath,\n manifest,\n };\n}\n\nfunction formatManifestReadError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport const _testOnlyExtensionShared = {\n formatManifestReadError,\n};\n"],"names":["commandPathTokens"],"mappings":";;;;;;;;;;;;;;AAQA,SAAS,wBACP,OACA,MAAwB;AAExB,MAAI,UAAU,YAAY,UAAU,aAAa;AAC/C,QAAI,OAAO,SAAS,YAAY,KAAK,SAAS,GAAG;AAC/C,aAAO;QACL,UAAU;QACV,WAAW;QACX,WAAW,UAAU;;IAEzB;AACA,WAAO;MACL,UAAU;MACV,WAAW,UAAU;;EAEzB;AAEA,QAAM,eAAe,MAAM,WAAW,SAAS,IAC3C,YACA,MAAM,WAAW,YAAY,IAC3B,eACA;AACN,MAAI,CAAC,cAAc;AACjB,WAAO;EACT;AAEA,QAAM,QAAQ,MAAM,MAAM,aAAa,MAAM;AAC7C,MAAI,MAAM,SAAS,GAAG;AACpB,WAAO;MACL,UAAU;MACV,WAAW;MACX,WAAW,iBAAiB;;EAEhC;AACA,SAAO;IACL,UAAU;IACV,WAAW,iBAAiB;;AAEhC;AAgBM,SAAU,4BAA4B,MAAc;AACxD,MAAI;AACJ,MAAI;AACJ,MAAI,eAAe;AACnB,MAAI,UAAU;AACd,MAAI,OAAO;AACX,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,SAAO,QAAQ,KAAK,QAAQ;AAC1B,UAAM,QAAQ,KAAK,KAAK;AACxB,QAAI,UAAU,MAAM;AAClB;IACF;AACA,QAAI,UAAU,mBAAmB;AAC/B,qBAAe;AAC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M,IAAI,WACR,oBAAoB,SAAS,KAAK,oEAClC,UAAU,KAAK;EAEnB;AAEA,SAAO;IACL;IACA,eAAe;IACf,YAAY;IACZ;;AAEJ;AAEA,SAAS,wBAAwB,OAAc;AAC7C,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D","debugId":"7df0fcc5-8ff4-5817-b72d-925ba746d847"}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
PLAN_MODE_VALUES,
|
|
10
10
|
PLAN_STEP_LINK_KIND_VALUES,
|
|
11
11
|
PLAN_STEP_STATUS_VALUES
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KHVGM5CS.js";
|
|
13
13
|
|
|
14
14
|
// dist/sdk/cli-contracts/commander-types.js
|
|
15
15
|
!(function() {
|
|
@@ -865,7 +865,7 @@ function normalizeUniqueStringList(values) {
|
|
|
865
865
|
!(function() {
|
|
866
866
|
try {
|
|
867
867
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
868
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
868
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "eb82ab31-2042-5c86-b4b9-af5a5e3aeb96");
|
|
869
869
|
} catch (e2) {
|
|
870
870
|
}
|
|
871
871
|
})();
|
|
@@ -931,28 +931,7 @@ var GLOBAL_FLAG_CONTRACTS = [
|
|
|
931
931
|
...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,
|
|
932
932
|
{ flag: "--version" }
|
|
933
933
|
];
|
|
934
|
-
var
|
|
935
|
-
{ flag: "--status", list: true },
|
|
936
|
-
{ flag: "--type" },
|
|
937
|
-
{ flag: "--tag", aliases: ["--tags"] },
|
|
938
|
-
{ flag: "--priority" },
|
|
939
|
-
{ flag: "--deadline-before" },
|
|
940
|
-
{ flag: "--deadline-after" },
|
|
941
|
-
{ flag: "--updated-after" },
|
|
942
|
-
{ flag: "--updated-before" },
|
|
943
|
-
{ flag: "--created-after" },
|
|
944
|
-
{ flag: "--created-before" },
|
|
945
|
-
{ flag: "--ids", list: true },
|
|
946
|
-
{ flag: "--assignee" },
|
|
947
|
-
{ flag: "--assignee-filter" },
|
|
948
|
-
{ flag: "--assignee_filter" },
|
|
949
|
-
{ flag: "--parent" },
|
|
950
|
-
{ flag: "--sprint" },
|
|
951
|
-
{ flag: "--release" },
|
|
952
|
-
{ flag: "--filter-ac-missing" },
|
|
953
|
-
{ flag: "--filter-estimates-missing", aliases: ["--filter-estimate-missing"] },
|
|
954
|
-
{ flag: "--filter-resolution-missing" },
|
|
955
|
-
{ flag: "--filter-metadata-missing" },
|
|
934
|
+
var GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS = [
|
|
956
935
|
{ flag: "--filter-reviewer-missing" },
|
|
957
936
|
{ flag: "--filter-risk-missing" },
|
|
958
937
|
{ flag: "--filter-confidence-missing" },
|
|
@@ -975,7 +954,59 @@ var LIST_FILTER_FLAG_CONTRACTS = [
|
|
|
975
954
|
{ flag: "--has-body" },
|
|
976
955
|
{ flag: "--empty-body" },
|
|
977
956
|
{ flag: "--has-linked-command" },
|
|
978
|
-
{ flag: "--no-linked-command" }
|
|
957
|
+
{ flag: "--no-linked-command" }
|
|
958
|
+
];
|
|
959
|
+
var MANY_GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS = [
|
|
960
|
+
{ flag: "--filter-reviewer-missing" },
|
|
961
|
+
{ flag: "--filter-risk-missing" },
|
|
962
|
+
{ flag: "--filter-confidence-missing" },
|
|
963
|
+
{ flag: "--filter-sprint-missing" },
|
|
964
|
+
{ flag: "--filter-release-missing" },
|
|
965
|
+
{ flag: "--filter-has-notes" },
|
|
966
|
+
{ flag: "--filter-no-notes" },
|
|
967
|
+
{ flag: "--filter-has-learnings" },
|
|
968
|
+
{ flag: "--filter-no-learnings" },
|
|
969
|
+
{ flag: "--filter-has-files" },
|
|
970
|
+
{ flag: "--filter-no-files" },
|
|
971
|
+
{ flag: "--filter-has-docs" },
|
|
972
|
+
{ flag: "--filter-no-docs" },
|
|
973
|
+
{ flag: "--filter-has-tests" },
|
|
974
|
+
{ flag: "--filter-no-tests" },
|
|
975
|
+
{ flag: "--filter-has-comments" },
|
|
976
|
+
{ flag: "--filter-no-comments" },
|
|
977
|
+
{ flag: "--filter-has-deps" },
|
|
978
|
+
{ flag: "--filter-no-deps" },
|
|
979
|
+
{ flag: "--filter-has-body" },
|
|
980
|
+
{ flag: "--filter-empty-body" },
|
|
981
|
+
{ flag: "--filter-has-linked-command" },
|
|
982
|
+
{ flag: "--filter-no-linked-command" },
|
|
983
|
+
{ flag: "--ids", list: true },
|
|
984
|
+
{ flag: "--limit" },
|
|
985
|
+
{ flag: "--offset" }
|
|
986
|
+
];
|
|
987
|
+
var LIST_FILTER_FLAG_CONTRACTS = [
|
|
988
|
+
{ flag: "--status", list: true },
|
|
989
|
+
{ flag: "--type" },
|
|
990
|
+
{ flag: "--tag", aliases: ["--tags"] },
|
|
991
|
+
{ flag: "--priority" },
|
|
992
|
+
{ flag: "--deadline-before" },
|
|
993
|
+
{ flag: "--deadline-after" },
|
|
994
|
+
{ flag: "--updated-after" },
|
|
995
|
+
{ flag: "--updated-before" },
|
|
996
|
+
{ flag: "--created-after" },
|
|
997
|
+
{ flag: "--created-before" },
|
|
998
|
+
{ flag: "--ids", list: true },
|
|
999
|
+
{ flag: "--assignee" },
|
|
1000
|
+
{ flag: "--assignee-filter" },
|
|
1001
|
+
{ flag: "--assignee_filter" },
|
|
1002
|
+
{ flag: "--parent" },
|
|
1003
|
+
{ flag: "--sprint" },
|
|
1004
|
+
{ flag: "--release" },
|
|
1005
|
+
{ flag: "--filter-ac-missing" },
|
|
1006
|
+
{ flag: "--filter-estimates-missing", aliases: ["--filter-estimate-missing"] },
|
|
1007
|
+
{ flag: "--filter-resolution-missing" },
|
|
1008
|
+
{ flag: "--filter-metadata-missing" },
|
|
1009
|
+
...GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS,
|
|
979
1010
|
{ flag: "--limit" },
|
|
980
1011
|
{ flag: "--offset" },
|
|
981
1012
|
{ flag: "--no-truncate", aliases: ["--all"] },
|
|
@@ -1411,32 +1442,7 @@ var CLOSE_MANY_FLAG_CONTRACTS = [
|
|
|
1411
1442
|
{ flag: "--filter-parent" },
|
|
1412
1443
|
{ flag: "--filter-sprint" },
|
|
1413
1444
|
{ flag: "--filter-release" },
|
|
1414
|
-
|
|
1415
|
-
{ flag: "--filter-risk-missing" },
|
|
1416
|
-
{ flag: "--filter-confidence-missing" },
|
|
1417
|
-
{ flag: "--filter-sprint-missing" },
|
|
1418
|
-
{ flag: "--filter-release-missing" },
|
|
1419
|
-
{ flag: "--filter-has-notes" },
|
|
1420
|
-
{ flag: "--filter-no-notes" },
|
|
1421
|
-
{ flag: "--filter-has-learnings" },
|
|
1422
|
-
{ flag: "--filter-no-learnings" },
|
|
1423
|
-
{ flag: "--filter-has-files" },
|
|
1424
|
-
{ flag: "--filter-no-files" },
|
|
1425
|
-
{ flag: "--filter-has-docs" },
|
|
1426
|
-
{ flag: "--filter-no-docs" },
|
|
1427
|
-
{ flag: "--filter-has-tests" },
|
|
1428
|
-
{ flag: "--filter-no-tests" },
|
|
1429
|
-
{ flag: "--filter-has-comments" },
|
|
1430
|
-
{ flag: "--filter-no-comments" },
|
|
1431
|
-
{ flag: "--filter-has-deps" },
|
|
1432
|
-
{ flag: "--filter-no-deps" },
|
|
1433
|
-
{ flag: "--filter-has-body" },
|
|
1434
|
-
{ flag: "--filter-empty-body" },
|
|
1435
|
-
{ flag: "--filter-has-linked-command" },
|
|
1436
|
-
{ flag: "--filter-no-linked-command" },
|
|
1437
|
-
{ flag: "--ids", list: true },
|
|
1438
|
-
{ flag: "--limit" },
|
|
1439
|
-
{ flag: "--offset" },
|
|
1445
|
+
...MANY_GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS,
|
|
1440
1446
|
{ flag: "--reason" },
|
|
1441
1447
|
{ flag: "--resolution" },
|
|
1442
1448
|
{ flag: "--expected-result", aliases: ["--expected_result", "--expected"] },
|
|
@@ -1858,32 +1864,7 @@ var UPDATE_MANY_FLAG_CONTRACTS = [
|
|
|
1858
1864
|
{ flag: "--filter-estimates-missing", aliases: ["--filter-estimate-missing"] },
|
|
1859
1865
|
{ flag: "--filter-resolution-missing" },
|
|
1860
1866
|
{ flag: "--filter-metadata-missing" },
|
|
1861
|
-
|
|
1862
|
-
{ flag: "--filter-risk-missing" },
|
|
1863
|
-
{ flag: "--filter-confidence-missing" },
|
|
1864
|
-
{ flag: "--filter-sprint-missing" },
|
|
1865
|
-
{ flag: "--filter-release-missing" },
|
|
1866
|
-
{ flag: "--filter-has-notes" },
|
|
1867
|
-
{ flag: "--filter-no-notes" },
|
|
1868
|
-
{ flag: "--filter-has-learnings" },
|
|
1869
|
-
{ flag: "--filter-no-learnings" },
|
|
1870
|
-
{ flag: "--filter-has-files" },
|
|
1871
|
-
{ flag: "--filter-no-files" },
|
|
1872
|
-
{ flag: "--filter-has-docs" },
|
|
1873
|
-
{ flag: "--filter-no-docs" },
|
|
1874
|
-
{ flag: "--filter-has-tests" },
|
|
1875
|
-
{ flag: "--filter-no-tests" },
|
|
1876
|
-
{ flag: "--filter-has-comments" },
|
|
1877
|
-
{ flag: "--filter-no-comments" },
|
|
1878
|
-
{ flag: "--filter-has-deps" },
|
|
1879
|
-
{ flag: "--filter-no-deps" },
|
|
1880
|
-
{ flag: "--filter-has-body" },
|
|
1881
|
-
{ flag: "--filter-empty-body" },
|
|
1882
|
-
{ flag: "--filter-has-linked-command" },
|
|
1883
|
-
{ flag: "--filter-no-linked-command" },
|
|
1884
|
-
{ flag: "--ids", list: true },
|
|
1885
|
-
{ flag: "--limit" },
|
|
1886
|
-
{ flag: "--offset" },
|
|
1867
|
+
...MANY_GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS,
|
|
1887
1868
|
{ flag: "--dry-run" },
|
|
1888
1869
|
{ flag: "--rollback" },
|
|
1889
1870
|
{ flag: "--no-checkpoint" },
|
|
@@ -2130,29 +2111,7 @@ var SEARCH_FLAG_CONTRACTS = [
|
|
|
2130
2111
|
{ flag: "--sprint" },
|
|
2131
2112
|
{ flag: "--release" },
|
|
2132
2113
|
{ flag: "--parent" },
|
|
2133
|
-
|
|
2134
|
-
{ flag: "--filter-risk-missing" },
|
|
2135
|
-
{ flag: "--filter-confidence-missing" },
|
|
2136
|
-
{ flag: "--filter-sprint-missing" },
|
|
2137
|
-
{ flag: "--filter-release-missing" },
|
|
2138
|
-
{ flag: "--has-notes" },
|
|
2139
|
-
{ flag: "--no-notes" },
|
|
2140
|
-
{ flag: "--has-learnings" },
|
|
2141
|
-
{ flag: "--no-learnings" },
|
|
2142
|
-
{ flag: "--has-files" },
|
|
2143
|
-
{ flag: "--no-files" },
|
|
2144
|
-
{ flag: "--has-docs" },
|
|
2145
|
-
{ flag: "--no-docs" },
|
|
2146
|
-
{ flag: "--has-tests" },
|
|
2147
|
-
{ flag: "--no-tests" },
|
|
2148
|
-
{ flag: "--has-comments" },
|
|
2149
|
-
{ flag: "--no-comments" },
|
|
2150
|
-
{ flag: "--has-deps" },
|
|
2151
|
-
{ flag: "--no-deps" },
|
|
2152
|
-
{ flag: "--has-body" },
|
|
2153
|
-
{ flag: "--empty-body" },
|
|
2154
|
-
{ flag: "--has-linked-command" },
|
|
2155
|
-
{ flag: "--no-linked-command" }
|
|
2114
|
+
...GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS
|
|
2156
2115
|
];
|
|
2157
2116
|
var CONTRACTS_FLAG_CONTRACTS = [
|
|
2158
2117
|
{ flag: "--action" },
|
|
@@ -4762,4 +4721,4 @@ export {
|
|
|
4762
4721
|
resolveSubcommandFlagContractsForCommand,
|
|
4763
4722
|
PM_TOOL_PARAMETERS_SCHEMA
|
|
4764
4723
|
};
|
|
4765
|
-
//# sourceMappingURL=chunk-
|
|
4724
|
+
//# sourceMappingURL=chunk-RAHINBVP.js.map
|