@unbrained/pm-cli 2026.7.5 → 2026.7.7
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/CHANGELOG.md +42 -0
- package/dist/cli/commands/annotation-command.d.ts +1 -0
- package/dist/cli/commands/annotation-command.js +29 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/comments.js +3 -4
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
- package/dist/cli/commands/extension/bundled-catalog.js +38 -28
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +81 -18
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/health.js +9 -5
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/learnings.js +5 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/notes.js +5 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +4 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +3 -3
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +144 -105
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/extension-command-help.js +10 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +18 -27
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.d.ts +0 -8
- package/dist/cli/register-operations.js +41 -46
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +113 -13
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +5 -1
- package/dist/cli/registration-helpers.js +14 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
- package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js → append-PVCTBVJG.js} +8 -9
- package/dist/cli-bundle/chunks/{chunk-PPE4YUQM.js → chunk-2APXX4TZ.js} +17 -28
- package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js → chunk-2LEJGRQ7.js} +3 -12
- package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js.map → chunk-2LEJGRQ7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js → chunk-2TILG6F2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js → chunk-3G6UMXT3.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js.map → chunk-3G6UMXT3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js → chunk-3TYOW6RR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js → chunk-3X542TEY.js} +7 -7
- package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js → chunk-42LXP4VO.js} +14 -21
- package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js.map → chunk-42LXP4VO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5J2XPTAD.js → chunk-43SIHQND.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js → chunk-43UQN754.js} +12 -19
- package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js.map → chunk-43UQN754.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js → chunk-43YSKY75.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js.map → chunk-43YSKY75.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-72YXN5JX.js → chunk-4BKDAEDF.js} +6 -13
- package/dist/cli-bundle/chunks/{notes-72YXN5JX.js.map → chunk-4BKDAEDF.js.map} +2 -2
- package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js → chunk-4IQKDKGE.js} +18 -32
- package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js.map → chunk-4IQKDKGE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js → chunk-4MZOKTI2.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js.map → chunk-4MZOKTI2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js → chunk-52NS7JDP.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js.map → chunk-52NS7JDP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js → chunk-565WYS5W.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js.map → chunk-565WYS5W.js.map} +1 -1
- package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js → chunk-5FIQ4EX3.js} +13 -19
- package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js.map → chunk-5FIQ4EX3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{config-V57QD47V.js → chunk-6G6O3OPQ.js} +259 -41
- package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js → chunk-6LCJRGPD.js} +9 -13
- package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js.map → chunk-6LCJRGPD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js → chunk-6UQCNWFV.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js.map → chunk-6UQCNWFV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-LEKT4K7I.js → chunk-6XTSYPPO.js} +1216 -387
- package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js → chunk-7PNQA24K.js} +30 -36
- package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js.map → chunk-7PNQA24K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js → chunk-7VQ3JJN5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js → chunk-7Y5N34HX.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js.map → chunk-7Y5N34HX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js → chunk-AGAVEDIE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js → chunk-AJUON7E6.js} +3 -3
- package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js → chunk-ARKHKYYS.js} +16 -30
- package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js.map → chunk-ARKHKYYS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7EQNAZX2.js → chunk-C5ACVMOI.js} +99 -51
- package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js → chunk-CJQM7O7R.js} +16 -20
- package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js.map → chunk-CJQM7O7R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js → chunk-D2DCTFTL.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js.map → chunk-D2DCTFTL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js → chunk-DDDWVPID.js} +7 -11
- package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js.map → chunk-DDDWVPID.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js → chunk-DG6BSXZ7.js} +6 -13
- package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js.map → chunk-DG6BSXZ7.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js → chunk-DR2V5OIV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js → chunk-E3LWJUGF.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js.map → chunk-E3LWJUGF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js → chunk-E3YQFSFE.js} +6 -10
- package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js.map → chunk-E3YQFSFE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js → chunk-EDO7VXSO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FDBARR33.js → chunk-EIUBK2LT.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-FDBARR33.js.map → chunk-EIUBK2LT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js → chunk-EMXPI36L.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js.map → chunk-EMXPI36L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4OFLJHX6.js → chunk-EOUVR7JN.js} +13 -8
- package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js → chunk-EVEPHNXJ.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js → chunk-F6MT7KKE.js} +6 -10
- package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js.map → chunk-F6MT7KKE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js → chunk-F6YC2A6X.js} +7 -11
- package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js.map → chunk-F6YC2A6X.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js → chunk-FN6SB4HU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JLA7EVYV.js → chunk-GLS6VMWI.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js → chunk-GPIDUMMN.js} +10 -17
- package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js.map → chunk-GPIDUMMN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js → chunk-GTM5HQL4.js} +15 -21
- package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js.map → chunk-GTM5HQL4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js → chunk-H2SMKL2N.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-S4APD35C.js → chunk-HHEWQXPD.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js → chunk-HX6QXV5P.js} +2 -2
- package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js → chunk-I74FMIWA.js} +11 -17
- package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js.map → chunk-I74FMIWA.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js +804 -0
- package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js → chunk-II7R6KD4.js} +9 -13
- package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js.map → chunk-II7R6KD4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js → chunk-J7BOLHAV.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js.map → chunk-J7BOLHAV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js → chunk-KTGJ2CBU.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js.map → chunk-KTGJ2CBU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js → chunk-LCFJ7XAM.js} +32 -2
- package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js.map → chunk-LCFJ7XAM.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js → chunk-LZQU6XJG.js} +28 -34
- package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js.map → chunk-LZQU6XJG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js → chunk-M62RO3XK.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js.map → chunk-M62RO3XK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js → chunk-MCEUKJKW.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js.map → chunk-MCEUKJKW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T5Y3QSNF.js → chunk-MHNMCDWR.js} +1447 -86
- package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js → chunk-MRFWUSVA.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js → chunk-N6ZHDLUY.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js.map → chunk-N6ZHDLUY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js → chunk-NWWL22C7.js} +8 -12
- package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js.map → chunk-NWWL22C7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js → chunk-P3MJJW7P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js → chunk-PDXJXEZJ.js} +2 -2
- package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js → chunk-Q64AYQYW.js} +9 -13
- package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js.map → chunk-Q64AYQYW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js → chunk-QDABF2RB.js} +26 -47
- package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js.map → chunk-QDABF2RB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NBFCNJ7Q.js → chunk-QFBSP3NI.js} +529 -46
- package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
- package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js → chunk-RB3KLPAH.js} +11 -16
- package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js.map → chunk-RB3KLPAH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YSAH5FY5.js → chunk-RY7PTTUB.js} +94 -53
- package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WVSGSZ6J.js → chunk-S547WBYG.js} +1477 -86
- package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js → chunk-S5BNGFN5.js} +24 -45
- package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js.map → chunk-S5BNGFN5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js → chunk-S6VC2A2K.js} +9 -14
- package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js.map → chunk-S6VC2A2K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js → chunk-SIM5JDON.js} +7 -14
- package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js.map → chunk-SIM5JDON.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZD34OFFQ.js → chunk-SY75LYXR.js} +12 -7
- package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TT42JUMF.js → chunk-TEISGNSH.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js → chunk-TEKZOS7M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js → chunk-TGUK6XN6.js} +14 -18
- package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js.map → chunk-TGUK6XN6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js → chunk-TNC6MZUD.js} +10 -21
- package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js.map → chunk-TNC6MZUD.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YD5FML7K.js → chunk-UO7XAZK6.js} +27 -4
- package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js → chunk-V5ZWKJNY.js} +5 -14
- package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js.map → chunk-V5ZWKJNY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js → chunk-VGO73OCK.js} +7 -14
- package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js.map → chunk-VGO73OCK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js → chunk-VLEA2UTQ.js} +2 -2
- package/dist/cli-bundle/chunks/{files-6P57MRKL.js → chunk-W5HXHC7C.js} +8 -15
- package/dist/cli-bundle/chunks/{files-6P57MRKL.js.map → chunk-W5HXHC7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js → chunk-WCWVEXGA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
- package/dist/cli-bundle/chunks/{delete-62JQTYT4.js → chunk-XBX5CBRQ.js} +6 -10
- package/dist/cli-bundle/chunks/{delete-62JQTYT4.js.map → chunk-XBX5CBRQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MTTXDAK4.js → chunk-XC3X7BQR.js} +541 -44
- package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js → chunk-XHCVAZGM.js} +17 -23
- package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js.map → chunk-XHCVAZGM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js → chunk-XPMXPR7K.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js.map → chunk-XPMXPR7K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js → chunk-XS2TMNXR.js} +8 -12
- package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js.map → chunk-XS2TMNXR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-XWY5T67S.js → chunk-XXIYUTLK.js} +12 -23
- package/dist/cli-bundle/chunks/{plan-XWY5T67S.js.map → chunk-XXIYUTLK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7QH7DHUB.js → chunk-XZWL7VNE.js} +1220 -398
- package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js → chunk-Y7KYVCZM.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js.map → chunk-Y7KYVCZM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UI5BJ6DO.js → chunk-YCVWWIKY.js} +17 -28
- package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js +780 -0
- package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js → chunk-YPD7SQ5P.js} +8 -12
- package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js.map → chunk-YPD7SQ5P.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js → chunk-YPMZMKN7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js → chunk-YTD5GICJ.js} +4 -4
- package/dist/cli-bundle/chunks/{config-DJJKZB5R.js → chunk-ZNEG2UDO.js} +264 -39
- package/dist/cli-bundle/chunks/{config-DJJKZB5R.js.map → chunk-ZNEG2UDO.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js → chunk-ZO7CLOY2.js} +3 -3
- package/dist/cli-bundle/chunks/{close-3YRR3XY6.js → close-3YYQ5OG2.js} +5 -9
- package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
- package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
- package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
- package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
- package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
- package/dist/cli-bundle/chunks/copy-44RT5GDW.js +13 -0
- package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
- package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js → create-4GWJWPXG.js} +9 -14
- package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
- package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
- package/dist/cli-bundle/chunks/delete-YQ2VPXNF.js +14 -0
- package/dist/cli-bundle/chunks/deps-BU5EBJDU.js +17 -0
- package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
- package/dist/cli-bundle/chunks/docs-OQBSJNIA.js +18 -0
- package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
- package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
- package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js → files-HTSB2KJG.js} +13 -13
- package/dist/cli-bundle/chunks/focus-FOG4ALC2.js +14 -0
- package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
- package/dist/cli-bundle/chunks/history-compact-M6IFAMBP.js +25 -0
- package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
- package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js → history-redact-NQX3OGZP.js} +7 -11
- package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
- package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
- package/dist/cli-bundle/chunks/history-repair-NHOJG7WO.js +23 -0
- package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
- package/dist/cli-bundle/chunks/learnings-T63JGKKN.js +17 -0
- package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
- package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
- package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
- package/dist/cli-bundle/chunks/plan-OSCNYFGC.js.map +7 -0
- package/dist/cli-bundle/chunks/plan-TN537L24.js +28 -0
- package/dist/cli-bundle/chunks/plan-TN537L24.js.map +1 -0
- package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js +37 -0
- package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js.map +1 -0
- package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js +33 -0
- package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-5H66WFYF.js → register-list-query-OHXD7G5N.js} +41 -33
- package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-FB3FNDLZ.js → register-list-query-ZCRABAPN.js} +42 -34
- package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js → register-mutation-P3G4XP6Q.js} +36 -41
- package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js → register-mutation-XX4H56PE.js} +34 -39
- package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js.map → register-mutation-XX4H56PE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-A3XAM5J7.js → register-operations-V6PIYEDU.js} +80 -52
- package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-SG7HBSUP.js → register-operations-V6VKTG54.js} +79 -51
- package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-K6U3NVY5.js → register-setup-6RVAWT6W.js} +129 -31
- package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-I45OGJUV.js → register-setup-6YVUSQYD.js} +130 -32
- package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js → restore-HC3YSWF7.js} +7 -11
- package/dist/cli-bundle/chunks/restore-HC3YSWF7.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
- package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js → schema-DAGSYO6E.js} +6 -10
- package/dist/cli-bundle/chunks/schema-DAGSYO6E.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js → schema-UBXJCQAC.js} +6 -10
- package/dist/cli-bundle/chunks/schema-UBXJCQAC.js.map +1 -0
- package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
- package/dist/cli-bundle/chunks/update-CJGG5WMV.js.map +7 -0
- package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
- package/dist/cli-bundle/chunks/update-LKD64AFP.js.map +1 -0
- package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
- package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
- package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js.map +1 -0
- package/dist/cli-bundle/main.js +29 -31
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +136 -54
- package/dist/cli-bundle/sdk-testing.js +7 -8
- package/dist/cli-bundle/sdk.js +132 -84
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/history/drift-scan.js +3 -8
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/output/mutation-projection.js +11 -5
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/search/cache.js +3 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.d.ts +2 -0
- package/dist/core/search/semantic-defaults.js +11 -4
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -1
- package/dist/core/search/vector-stores.js +33 -7
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/mcp/server.d.ts +22 -50
- package/dist/mcp/server.js +62 -916
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +9 -7
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +4 -2
- package/dist/sdk/index.js +4 -4
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +312 -5
- package/dist/sdk/runtime.js +1391 -26
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/start-task-status.d.ts +13 -0
- package/dist/sdk/start-task-status.js +19 -0
- package/dist/sdk/start-task-status.js.map +1 -0
- package/dist/sdk/workspace-contracts-cache.d.ts +17 -0
- package/dist/sdk/workspace-contracts-cache.js +36 -0
- package/dist/sdk/workspace-contracts-cache.js.map +1 -0
- package/docs/COMMANDS.md +10 -1
- package/docs/RELEASING.md +3 -1
- package/docs/SDK.md +81 -0
- package/docs/TESTING.md +3 -0
- package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +16 -2
- package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +16 -1
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +0 -18
- package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js +0 -375
- package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js.map +0 -7
- package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js +0 -372
- package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js +0 -1961
- package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js +0 -1749
- package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js +0 -822
- package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4OFLJHX6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js +0 -2181
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57C2RLW5.js +0 -1704
- package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js +0 -2330
- package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5J2XPTAD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js +0 -995
- package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js +0 -819
- package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7EQNAZX2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js +0 -530
- package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +0 -275
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js +0 -231
- package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js +0 -2184
- package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js +0 -1615
- package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FJRKQREY.js +0 -228
- package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js +0 -3237
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HK72NWAD.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js +0 -3206
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JLA7EVYV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +0 -76
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +0 -79
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +0 -915
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js +0 -218
- package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js +0 -1858
- package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js +0 -520
- package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js +0 -1041
- package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +0 -918
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js +0 -1985
- package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +0 -238
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +0 -1977
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js +0 -1031
- package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-S4APD35C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js +0 -1149
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +0 -272
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TT42JUMF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +0 -165
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +0 -1932
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +0 -175
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js +0 -1868
- package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js +0 -1152
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YSAH5FY5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js +0 -1005
- package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js +0 -215
- package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZD34OFFQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js +0 -2306
- package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +0 -241
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js +0 -144
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +0 -1
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js +0 -147
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +0 -7
- package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +0 -16
- package/dist/cli-bundle/chunks/config-V57QD47V.js.map +0 -1
- package/dist/cli-bundle/chunks/context-4OQGIPSO.js +0 -45
- package/dist/cli-bundle/chunks/context-WLA6IAWE.js +0 -49
- package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +0 -12
- package/dist/cli-bundle/chunks/create-WKOZKPQR.js +0 -30
- package/dist/cli-bundle/chunks/eval-N6UHFWVO.js +0 -288
- package/dist/cli-bundle/chunks/eval-N6UHFWVO.js.map +0 -7
- package/dist/cli-bundle/chunks/eval-PHOTWYHI.js +0 -278
- package/dist/cli-bundle/chunks/eval-PHOTWYHI.js.map +0 -1
- package/dist/cli-bundle/chunks/extension-NBAH62ML.js +0 -40
- package/dist/cli-bundle/chunks/extension-ZF6ZZPOU.js +0 -44
- package/dist/cli-bundle/chunks/gc-AETFKZ44.js +0 -398
- package/dist/cli-bundle/chunks/gc-AETFKZ44.js.map +0 -7
- package/dist/cli-bundle/chunks/gc-RLBP4QVN.js +0 -388
- package/dist/cli-bundle/chunks/gc-RLBP4QVN.js.map +0 -1
- package/dist/cli-bundle/chunks/get-NH2MPBCI.js +0 -283
- package/dist/cli-bundle/chunks/get-NH2MPBCI.js.map +0 -1
- package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js +0 -286
- package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-3GVPMQBL.js +0 -1612
- package/dist/cli-bundle/chunks/health-3GVPMQBL.js.map +0 -1
- package/dist/cli-bundle/chunks/health-DNTM72GJ.js +0 -1615
- package/dist/cli-bundle/chunks/health-DNTM72GJ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-RYKLC72X.js +0 -20
- package/dist/cli-bundle/chunks/history-SGPYRAFT.js +0 -24
- package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +0 -21
- package/dist/cli-bundle/chunks/init-RPIPQUNV.js +0 -32
- package/dist/cli-bundle/chunks/init-SKQAESQS.js +0 -28
- package/dist/cli-bundle/chunks/list-64LHZ3HM.js +0 -32
- package/dist/cli-bundle/chunks/list-7LXBTEKI.js +0 -36
- package/dist/cli-bundle/chunks/next-7ODPAQ4U.js +0 -306
- package/dist/cli-bundle/chunks/next-7ODPAQ4U.js.map +0 -7
- package/dist/cli-bundle/chunks/next-ODJUM4ZM.js +0 -303
- package/dist/cli-bundle/chunks/next-ODJUM4ZM.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +0 -397
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +0 -400
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-5H66WFYF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-FB3FNDLZ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-A3XAM5J7.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-SG7HBSUP.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-I45OGJUV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-K6U3NVY5.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +0 -19
- package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js +0 -91
- package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js.map +0 -7
- package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js +0 -88
- package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js.map +0 -1
- package/dist/cli-bundle/chunks/search-3S72CTD6.js +0 -38
- package/dist/cli-bundle/chunks/search-WNUNBQXO.js +0 -34
- package/dist/cli-bundle/chunks/stats-IJYTRQGV.js +0 -250
- package/dist/cli-bundle/chunks/stats-IJYTRQGV.js.map +0 -7
- package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js +0 -240
- package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js.map +0 -1
- package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js +0 -309
- package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js +0 -306
- package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js.map +0 -1
- package/dist/cli-bundle/chunks/test-DQ2QFJ7W.js +0 -45
- package/dist/cli-bundle/chunks/test-W7QBLVJS.js +0 -41
- package/dist/cli-bundle/chunks/test-all-636NTRTT.js +0 -434
- package/dist/cli-bundle/chunks/test-all-636NTRTT.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js +0 -437
- package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-245OINZR.js +0 -28
- package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +0 -24
- package/dist/cli-bundle/chunks/update-SFLZPJXX.js +0 -30
- package/dist/cli-bundle/chunks/update-SJZ6S77U.js +0 -26
- package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js +0 -290
- package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js +0 -287
- package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-PA4FDTOV.js +0 -2143
- package/dist/cli-bundle/chunks/validate-PA4FDTOV.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js +0 -2105
- package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-4XQIDNM5.js.map → append-F7WPGIQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js.map → append-PVCTBVJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js.map → chunk-2TILG6F2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js.map → chunk-3TYOW6RR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js.map → chunk-3X542TEY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js.map → chunk-7VQ3JJN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js.map → chunk-AGAVEDIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js.map → chunk-AJUON7E6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js.map → chunk-DR2V5OIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js.map → chunk-EDO7VXSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js.map → chunk-EVEPHNXJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js.map → chunk-FN6SB4HU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js.map → chunk-H2SMKL2N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js.map → chunk-HX6QXV5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js.map → chunk-P3MJJW7P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js.map → chunk-PDXJXEZJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js.map → chunk-TEKZOS7M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js.map → chunk-VLEA2UTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js.map → chunk-WCWVEXGA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js.map → chunk-YPMZMKN7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js.map → chunk-YTD5GICJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js.map → chunk-ZO7CLOY2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-3YRR3XY6.js.map → close-3YYQ5OG2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-OB2Y4QP5.js.map → close-Z3Q4U7TS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-4OQGIPSO.js.map → close-many-3L2RXH3M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-WLA6IAWE.js.map → close-many-D366FTIG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js.map → comments-54XDJNFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-HXJLKCRI.js.map → comments-HGHC2PN6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js.map → copy-44RT5GDW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-WKOZKPQR.js.map → copy-UGMUGHZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ZF6ZZPOU.js.map → create-4GWJWPXG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-NBAH62ML.js.map → create-AZXCUYKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-RYKLC72X.js.map → delete-Y6SXIQ4X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-SGPYRAFT.js.map → delete-YQ2VPXNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js.map → deps-BU5EBJDU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-4H3FCKF3.js.map → deps-FMANWFRP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-RPIPQUNV.js.map → docs-OQBSJNIA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-SKQAESQS.js.map → docs-VNPBZXEL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-64LHZ3HM.js.map → files-72HZEBOE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-7LXBTEKI.js.map → files-HTSB2KJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js.map → focus-FOG4ALC2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-PXOFL6AM.js.map → focus-SUTMKXGX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js.map → history-compact-M6IFAMBP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js.map → history-compact-NEXRPP2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-3S72CTD6.js.map → history-redact-NQX3OGZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-WNUNBQXO.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-W7QBLVJS.js.map → history-repair-CBHMHAJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-DQ2QFJ7W.js.map → history-repair-NHOJG7WO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-ZRD4GCTT.js.map → learnings-M64NTSOR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-245OINZR.js.map → learnings-T63JGKKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SJZ6S77U.js.map → notes-73WE2UV2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SFLZPJXX.js.map → notes-U7L6HQQ2.js.map} +0 -0
package/dist/mcp/server.js
CHANGED
|
@@ -5,28 +5,18 @@
|
|
|
5
5
|
* Runs the MCP server adapter that exposes pm actions and contracts to external agents.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
8
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="027adbba-55f2-5bab-b7dc-6e80fb5408d3")}catch(e){}}();
|
|
9
9
|
import { realpathSync } from "node:fs";
|
|
10
10
|
import readline from "node:readline";
|
|
11
11
|
import { fileURLToPath } from "node:url";
|
|
12
|
-
import { createEmptyExtensionCommandRegistry, createEmptyExtensionHookRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionRegistrationRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionServiceRegistry, } from "../core/extensions/extension-registries.js";
|
|
13
|
-
import { activateExtensions, deactivateExtensions, loadExtensions, runActiveCommandHandler, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, } from "../core/extensions/index.js";
|
|
14
|
-
import { pathExists } from "../core/fs/fs-utils.js";
|
|
15
12
|
import { resolvePmCliVersion } from "../core/packages/root.js";
|
|
16
|
-
import { projectMutationResult } from "../core/output/mutation-projection.js";
|
|
17
|
-
import { withQuerySummary } from "../core/output/query-summary.js";
|
|
18
13
|
import { PmCliError } from "../core/shared/errors.js";
|
|
19
14
|
import { decodeHtmlEntitiesInOptions } from "../core/shared/html-entity-decode.js";
|
|
20
15
|
import { levenshteinDistanceWithinLimit } from "../core/shared/levenshtein.js";
|
|
21
16
|
import { asRecordClone } from "../core/shared/primitives.js";
|
|
22
17
|
import { createSerialQueue } from "../core/shared/serial-queue.js";
|
|
23
|
-
import {
|
|
24
|
-
import { readSettings } from "../core/store/settings.js";
|
|
25
|
-
import { normalizeListOptions, normalizeUpdateOptions } from "../cli/registration-helpers.js";
|
|
26
|
-
import { UPDATE_COMMANDER_STRING_OPTION_CONTRACTS } from "../sdk/cli-contracts/commander-mutation-options.js";
|
|
27
|
-
import { clearWorkspaceContractsCache } from "../sdk/runtime.js";
|
|
18
|
+
import { readRequiredString, runAction } from "../sdk/runtime.js";
|
|
28
19
|
import { TOOLS } from "./tool-definitions.js";
|
|
29
|
-
import { runActivity, runAggregate, runAppend, runClaim, runClose, runCloseMany, runComments, runContracts, runContext, runCreate, runCopy, runFocus, runConfig, runDelete, runDeps, runDocs, runExtension, runFiles, runFilesDiscover, runGc, runGet, runHealth, runHistory, runHistoryCompact, runHistoryRedact, runHistoryRepair, runHistoryRepairAll, assertHistoryRepairTarget, runInit, runLearnings, runList, runNext, runNotes, runPlan, runRelease, runSchemaAddStatus, runSchemaAddType, runSchemaAddField, runSchemaApplyPreset, runSchemaInferTypes, runSchemaList, runSchemaListFields, runSchemaRemoveStatus, runSchemaRemoveType, runSchemaRemoveField, runSchemaShow, runSchemaShowField, runSchemaShowStatus, runProfileApply, runProfileLint, runProfileList, runProfileShow, runSearch, runStats, runTelemetry, runTest, runTestAll, runUpdate, runUpdateMany, runUpgrade, runValidate, } from "../cli/commands/index.js";
|
|
30
20
|
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
31
21
|
function resolvePmPackageRoot() {
|
|
32
22
|
return fileURLToPath(new URL("../..", import.meta.url));
|
|
@@ -96,891 +86,6 @@ function detectUnexpectedTopLevelKeys(toolName, args) {
|
|
|
96
86
|
}
|
|
97
87
|
return warnings;
|
|
98
88
|
}
|
|
99
|
-
function readString(args, key) {
|
|
100
|
-
const value = args[key];
|
|
101
|
-
return typeof value === "string" && value.trim().length > 0 ? value : undefined;
|
|
102
|
-
}
|
|
103
|
-
function readScalarString(args, key) {
|
|
104
|
-
const value = args[key];
|
|
105
|
-
if (typeof value === "string") {
|
|
106
|
-
return value.trim().length > 0 ? value : undefined;
|
|
107
|
-
}
|
|
108
|
-
return typeof value === "number" && Number.isFinite(value) ? String(value) : undefined;
|
|
109
|
-
}
|
|
110
|
-
function readScalarStringAllowBlank(args, key) {
|
|
111
|
-
const value = args[key];
|
|
112
|
-
if (typeof value === "string") {
|
|
113
|
-
return value;
|
|
114
|
-
}
|
|
115
|
-
return typeof value === "number" && Number.isFinite(value) ? String(value) : undefined;
|
|
116
|
-
}
|
|
117
|
-
function isRecord(value) {
|
|
118
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
119
|
-
}
|
|
120
|
-
function readRequiredString(args, key) {
|
|
121
|
-
const value = readString(args, key);
|
|
122
|
-
if (!value) {
|
|
123
|
-
throw new PmCliError(`Missing required argument: ${key}`, 64);
|
|
124
|
-
}
|
|
125
|
-
return value;
|
|
126
|
-
}
|
|
127
|
-
function globalOptions(args) {
|
|
128
|
-
return {
|
|
129
|
-
json: true,
|
|
130
|
-
quiet: true,
|
|
131
|
-
path: readString(args, "path"),
|
|
132
|
-
noExtensions: args.noExtensions === true || args.no_extensions === true,
|
|
133
|
-
noPager: true,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
const ARRAY_TO_CSV_FIELDS = new Set(["tags", "blockedBy", "blocked_by", "skills", "fields"]);
|
|
137
|
-
const SCALAR_TO_ARRAY_FIELDS = new Set([
|
|
138
|
-
"comment",
|
|
139
|
-
"note",
|
|
140
|
-
"learning",
|
|
141
|
-
"reminder",
|
|
142
|
-
"event",
|
|
143
|
-
"dep",
|
|
144
|
-
"depRemove",
|
|
145
|
-
"dep_remove",
|
|
146
|
-
"file",
|
|
147
|
-
"doc",
|
|
148
|
-
"test",
|
|
149
|
-
"unset",
|
|
150
|
-
"addGlob",
|
|
151
|
-
"add_glob",
|
|
152
|
-
"migrate",
|
|
153
|
-
"envSet",
|
|
154
|
-
"env_set",
|
|
155
|
-
"envClear",
|
|
156
|
-
"env_clear",
|
|
157
|
-
]);
|
|
158
|
-
// Actions where the linked-resource fields `add` and `remove` are string[] arrays.
|
|
159
|
-
// For other actions (comments/notes/learnings) `add` and `remove` are scalar strings
|
|
160
|
-
// and must NOT be auto-promoted.
|
|
161
|
-
const ARRAY_ADD_REMOVE_ACTIONS = new Set([
|
|
162
|
-
"files",
|
|
163
|
-
"files-discover",
|
|
164
|
-
"docs",
|
|
165
|
-
"test",
|
|
166
|
-
"test-all",
|
|
167
|
-
]);
|
|
168
|
-
function normalizeMcpOptionsArrays(options, action) {
|
|
169
|
-
const result = {};
|
|
170
|
-
const promoteAddRemove = action !== undefined && ARRAY_ADD_REMOVE_ACTIONS.has(action);
|
|
171
|
-
for (const [key, value] of Object.entries(options)) {
|
|
172
|
-
if (Array.isArray(value) && ARRAY_TO_CSV_FIELDS.has(key)) {
|
|
173
|
-
result[key] = value.join(",");
|
|
174
|
-
continue;
|
|
175
|
-
}
|
|
176
|
-
if (typeof value === "string" && SCALAR_TO_ARRAY_FIELDS.has(key)) {
|
|
177
|
-
result[key] = [value];
|
|
178
|
-
continue;
|
|
179
|
-
}
|
|
180
|
-
if (typeof value === "string" && promoteAddRemove && (key === "add" || key === "remove")) {
|
|
181
|
-
result[key] = [value];
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
result[key] = value;
|
|
185
|
-
}
|
|
186
|
-
return result;
|
|
187
|
-
}
|
|
188
|
-
function optionsWithAuthor(args, action) {
|
|
189
|
-
const baseOptions = asRecordClone(args.options);
|
|
190
|
-
const hoistedTopLevel = {};
|
|
191
|
-
const hoistKey = (key) => {
|
|
192
|
-
if (baseOptions[key] !== undefined || args[key] === undefined) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
hoistedTopLevel[key] = args[key];
|
|
196
|
-
};
|
|
197
|
-
if (action === "list") {
|
|
198
|
-
hoistKey("status");
|
|
199
|
-
hoistKey("type");
|
|
200
|
-
hoistKey("tag");
|
|
201
|
-
hoistKey("priority");
|
|
202
|
-
hoistKey("limit");
|
|
203
|
-
hoistKey("offset");
|
|
204
|
-
}
|
|
205
|
-
else if (action === "search") {
|
|
206
|
-
hoistKey("mode");
|
|
207
|
-
hoistKey("status");
|
|
208
|
-
hoistKey("type");
|
|
209
|
-
hoistKey("tag");
|
|
210
|
-
hoistKey("priority");
|
|
211
|
-
hoistKey("limit");
|
|
212
|
-
}
|
|
213
|
-
else if (action === "create") {
|
|
214
|
-
hoistKey("allowMissingParent");
|
|
215
|
-
}
|
|
216
|
-
else if (action === "close") {
|
|
217
|
-
hoistKey("duplicateOf");
|
|
218
|
-
}
|
|
219
|
-
else if (action === "append") {
|
|
220
|
-
// pm-7u9j: the narrow pm_append tool declares `body` top-level; runAppend
|
|
221
|
-
// reads it from options, so hoist unless options.body already wins.
|
|
222
|
-
// (pm_schema/pm_config top-level args are consumed directly by runAction's
|
|
223
|
-
// schema/config cases, which read args before options — no hoist needed.)
|
|
224
|
-
hoistKey("body");
|
|
225
|
-
}
|
|
226
|
-
const options = normalizeMcpOptionsArrays({ ...hoistedTopLevel, ...baseOptions }, action);
|
|
227
|
-
const author = readString(args, "author");
|
|
228
|
-
return author && options.author === undefined ? { ...options, author } : options;
|
|
229
|
-
}
|
|
230
|
-
// GH-170 (pm-pfnx): the narrow pm_files/pm_docs tools spell the CLI --note flag
|
|
231
|
-
// as `addNote` (the shared `note` parameter is the array-typed create/update
|
|
232
|
-
// note seed). Translate it onto the runner's `note` option; an explicit
|
|
233
|
-
// options.note (pm_run callers) wins.
|
|
234
|
-
function withAddNoteOption(options) {
|
|
235
|
-
if (options.addNote === undefined) {
|
|
236
|
-
return options;
|
|
237
|
-
}
|
|
238
|
-
const next = { ...options };
|
|
239
|
-
if (next.note === undefined && typeof next.addNote === "string") {
|
|
240
|
-
next.note = next.addNote;
|
|
241
|
-
}
|
|
242
|
-
delete next.addNote;
|
|
243
|
-
return next;
|
|
244
|
-
}
|
|
245
|
-
function withFilesDiscoveryOptions(options) {
|
|
246
|
-
const next = { ...options };
|
|
247
|
-
if (next.discoveryNote !== undefined && next.note === undefined && typeof next.discoveryNote === "string") {
|
|
248
|
-
next.note = next.discoveryNote;
|
|
249
|
-
}
|
|
250
|
-
delete next.discover;
|
|
251
|
-
delete next.discoveryNote;
|
|
252
|
-
return next;
|
|
253
|
-
}
|
|
254
|
-
function normalizeActionName(value) {
|
|
255
|
-
return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
256
|
-
}
|
|
257
|
-
function normalizeCommandPath(value) {
|
|
258
|
-
return value.trim().toLowerCase().split(/\s+/).filter(Boolean).join(" ");
|
|
259
|
-
}
|
|
260
|
-
function readStringArray(value) {
|
|
261
|
-
if (!Array.isArray(value)) {
|
|
262
|
-
return [];
|
|
263
|
-
}
|
|
264
|
-
return value.map((entry) => String(entry)).filter((entry) => entry.length > 0);
|
|
265
|
-
}
|
|
266
|
-
function extensionOptionsFromArgs(args, options) {
|
|
267
|
-
const reserved = new Set([
|
|
268
|
-
"action",
|
|
269
|
-
"args",
|
|
270
|
-
"author",
|
|
271
|
-
"cwd",
|
|
272
|
-
"fullChangedFields",
|
|
273
|
-
"id",
|
|
274
|
-
"options",
|
|
275
|
-
"path",
|
|
276
|
-
"query",
|
|
277
|
-
"reason",
|
|
278
|
-
"target",
|
|
279
|
-
]);
|
|
280
|
-
const passthrough = {};
|
|
281
|
-
for (const [key, value] of Object.entries(args)) {
|
|
282
|
-
if (!reserved.has(key)) {
|
|
283
|
-
passthrough[key] = value;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
const normalizedOptions = { ...passthrough, ...options };
|
|
287
|
-
delete normalizedOptions.args;
|
|
288
|
-
return normalizedOptions;
|
|
289
|
-
}
|
|
290
|
-
// pm-bl6m / pm-zumn: every native MCP action runs inside an activation cycle that
|
|
291
|
-
// mutates the process-global active extension registries (set globals -> run -> clear
|
|
292
|
-
// globals in a finally). The stdio transport already processes JSON-RPC lines
|
|
293
|
-
// sequentially, but handleRequest is a public entry point (tests, future concurrent
|
|
294
|
-
// transports) — if two requests ever ran concurrently, the newer one would overwrite
|
|
295
|
-
// the globals mid-flight and whichever finished first would clear them out from under
|
|
296
|
-
// the other (its lazily-read hooks/overrides would silently vanish). Serialize the
|
|
297
|
-
// whole activation cycle (load -> activate -> set -> run -> clear -> deactivate) on a
|
|
298
|
-
// dedicated FIFO queue so the critical section can never interleave. Full
|
|
299
|
-
// request-scoped registry plumbing remains possible later if true intra-server
|
|
300
|
-
// concurrency is ever needed.
|
|
301
|
-
const extensionActivationQueue = createSerialQueue();
|
|
302
|
-
/**
|
|
303
|
-
* Publishes empty active extension registries so built-in fallback actions cannot
|
|
304
|
-
* observe stale or partially published extension state from a failed activation cycle.
|
|
305
|
-
*/
|
|
306
|
-
function resetActiveExtensionRegistries() {
|
|
307
|
-
setActiveExtensionHooks(createEmptyExtensionHookRegistry());
|
|
308
|
-
setActiveExtensionCommands(createEmptyExtensionCommandRegistry());
|
|
309
|
-
setActiveExtensionParsers(createEmptyExtensionParserRegistry());
|
|
310
|
-
setActiveExtensionPreflight(createEmptyExtensionPreflightRegistry());
|
|
311
|
-
setActiveExtensionServices(createEmptyExtensionServiceRegistry());
|
|
312
|
-
setActiveExtensionRenderers(createEmptyExtensionRendererRegistry());
|
|
313
|
-
setActiveExtensionRegistrations(createEmptyExtensionRegistrationRegistry());
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Run `run` with workspace extensions loaded, activated, and published to the
|
|
317
|
-
* process-global active registries, then torn down afterwards. pm-zumn: built-in native
|
|
318
|
-
* actions (pm_list/pm_profile/pm_schema/pm_create/...) read
|
|
319
|
-
* `getActiveExtensionRegistrations()` for custom item types, fields, and profiles, so
|
|
320
|
-
* they must activate extensions exactly like the CLI (main.ts activates for every
|
|
321
|
-
* command). Previously only the dynamic-extension dispatch activated, leaving
|
|
322
|
-
* extension-contributed schema and profiles invisible over MCP for every built-in
|
|
323
|
-
* action. Activation is skipped (`run` receives `null`) when extensions are disabled or
|
|
324
|
-
* no workspace exists yet (for example `init`). EVERY action — activating or not — is
|
|
325
|
-
* serialized on {@link extensionActivationQueue} so a built-in action's reads of the
|
|
326
|
-
* process-global active registries can never interleave with another request's
|
|
327
|
-
* activation cycle; per-request isolation therefore holds even if a truly concurrent
|
|
328
|
-
* transport is added later (not just because the stdio transport is sequential today).
|
|
329
|
-
*/
|
|
330
|
-
async function withActiveExtensions(global, explicitCwd, resolutionCwd, run) {
|
|
331
|
-
// Run the whole cycle on the queue so registry mutations never interleave. Only an
|
|
332
|
-
// EXPLICIT cwd mutates process.cwd() — pinned inside this serialized slot so the chdir
|
|
333
|
-
// can't be clobbered mid-flight and the built-in handler resolves against it too. A
|
|
334
|
-
// request without an explicit cwd runs in the server's current directory and never
|
|
335
|
-
// touches process.cwd() (important so concurrent direct callers can't corrupt a shared
|
|
336
|
-
// cwd). Either way activation resolves against resolutionCwd, the entry-time snapshot,
|
|
337
|
-
// so it never depends on a deferred process.cwd() read.
|
|
338
|
-
return extensionActivationQueue.enqueue(async () => {
|
|
339
|
-
try {
|
|
340
|
-
return explicitCwd === undefined
|
|
341
|
-
? await withActiveExtensionsExclusively(global, resolutionCwd, run)
|
|
342
|
-
: await withCwd(explicitCwd, () => withActiveExtensionsExclusively(global, resolutionCwd, run));
|
|
343
|
-
}
|
|
344
|
-
finally {
|
|
345
|
-
clearWorkspaceContractsCache();
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Body of the activation cycle. Must only ever run under {@link extensionActivationQueue}
|
|
351
|
-
* (see {@link withActiveExtensions}): it is the exclusive owner of the process-global
|
|
352
|
-
* active extension registries while it runs. Returns early with `run(null)` — still
|
|
353
|
-
* inside the serialized critical section — when extensions are disabled or no workspace
|
|
354
|
-
* exists yet, so those built-in actions also observe a stable (empty) registry. This MCP
|
|
355
|
-
* server reloads + reactivates extensions per request, so each call is a fresh cycle with
|
|
356
|
-
* teardown in a finally to release resources opened during activate() (the
|
|
357
|
-
* long-running-server reload contract, pm-k1e4). Load/activate failures are swallowed and
|
|
358
|
-
* `run` is invoked with `null`, mirroring the CLI's resilient snapshot loader
|
|
359
|
-
* (loadRuntimeExtensionSnapshot) so a broken extension can never break a built-in action.
|
|
360
|
-
*/
|
|
361
|
-
async function withActiveExtensionsExclusively(global, cwd, run) {
|
|
362
|
-
if (global.noExtensions) {
|
|
363
|
-
return run(null);
|
|
364
|
-
}
|
|
365
|
-
const pmRoot = resolvePmRoot(cwd, global.path);
|
|
366
|
-
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
367
|
-
return run(null);
|
|
368
|
-
}
|
|
369
|
-
let active = null;
|
|
370
|
-
let activated;
|
|
371
|
-
try {
|
|
372
|
-
const settings = await readSettings(pmRoot);
|
|
373
|
-
const loadResult = await loadExtensions({ pmRoot, settings, cwd, noExtensions: false });
|
|
374
|
-
const activationResult = await activateExtensions({ ...loadResult, loaded: loadResult.loaded });
|
|
375
|
-
// Record the teardown handle BEFORE publishing the registries so a throw from any
|
|
376
|
-
// setActive* setter still runs deactivateExtensions for resources opened during
|
|
377
|
-
// activate() instead of silently leaking them.
|
|
378
|
-
activated = { loadResult, activationResult };
|
|
379
|
-
setActiveExtensionHooks(activationResult.hooks);
|
|
380
|
-
setActiveExtensionCommands(activationResult.commands);
|
|
381
|
-
setActiveExtensionParsers(activationResult.parsers);
|
|
382
|
-
setActiveExtensionPreflight(activationResult.preflight);
|
|
383
|
-
setActiveExtensionServices(activationResult.services);
|
|
384
|
-
setActiveExtensionRenderers(activationResult.renderers);
|
|
385
|
-
setActiveExtensionRegistrations(activationResult.registrations);
|
|
386
|
-
active = { registrations: activationResult.registrations, commands: activationResult.commands, pmRoot };
|
|
387
|
-
}
|
|
388
|
-
catch (error) {
|
|
389
|
-
resetActiveExtensionRegistries();
|
|
390
|
-
// CLI parity (loadRuntimeExtensionSnapshot): a load/activate failure must never
|
|
391
|
-
// break a built-in action — fall back to running with no active extensions. Surface
|
|
392
|
-
// the cause on stderr so a broken extension is diagnosable instead of being silently
|
|
393
|
-
// indistinguishable from a workspace that simply has no extensions.
|
|
394
|
-
console.error("[pm-mcp] extension activation failed; continuing without active extensions:", error);
|
|
395
|
-
active = null;
|
|
396
|
-
}
|
|
397
|
-
try {
|
|
398
|
-
return await run(active);
|
|
399
|
-
}
|
|
400
|
-
finally {
|
|
401
|
-
// Reset the process-global active registries FIRST so a torn-down extension's
|
|
402
|
-
// overrides/hooks cannot leak into a later request in this long-running server
|
|
403
|
-
// (for example a subsequent pm_list/pm_create) even if teardown below misbehaves.
|
|
404
|
-
resetActiveExtensionRegistries();
|
|
405
|
-
// Best-effort teardown of extensions that activated successfully. Skipped when
|
|
406
|
-
// activation never completed (nothing was set up); guarded so an unexpected throw
|
|
407
|
-
// cannot escape the finally.
|
|
408
|
-
if (activated) {
|
|
409
|
-
await deactivateExtensions(activated.loadResult, activated.activationResult).catch(() => undefined);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Resolve `action` against the active extension command registrations and dispatch it.
|
|
415
|
-
* Reached by runAction's default case for dynamic (non-built-in) actions after
|
|
416
|
-
* {@link withActiveExtensions} has published the active registries. `active` is `null`
|
|
417
|
-
* when no extensions are active (disabled, no workspace, or activation failed), in
|
|
418
|
-
* which case no extension command can match and the action is reported unsupported.
|
|
419
|
-
*/
|
|
420
|
-
async function dispatchActiveExtensionAction(action, args, options, global, active) {
|
|
421
|
-
if (!active) {
|
|
422
|
-
throw new PmCliError(`Unsupported native pm action: ${action}`, 64);
|
|
423
|
-
}
|
|
424
|
-
const normalizedAction = normalizeActionName(action);
|
|
425
|
-
const definition = active.registrations.commands.find((entry) => normalizeActionName(entry.action) === normalizedAction);
|
|
426
|
-
const command = definition?.command ??
|
|
427
|
-
active.commands.handlers.find((entry) => normalizeActionName(entry.command) === normalizedAction)?.command;
|
|
428
|
-
if (!command) {
|
|
429
|
-
throw new PmCliError(`Unsupported native pm action: ${action}`, 64);
|
|
430
|
-
}
|
|
431
|
-
const handlerResult = await runActiveCommandHandler({
|
|
432
|
-
command: normalizeCommandPath(command),
|
|
433
|
-
args: readStringArray(options.args ?? args.args),
|
|
434
|
-
options: extensionOptionsFromArgs(args, options),
|
|
435
|
-
global,
|
|
436
|
-
pm_root: active.pmRoot,
|
|
437
|
-
});
|
|
438
|
-
if (!handlerResult.handled) {
|
|
439
|
-
const suffix = handlerResult.warnings.length > 0 ? ` (${handlerResult.warnings.join(", ")})` : "";
|
|
440
|
-
throw new PmCliError(`Unsupported native pm action: ${action}${suffix}`, 64);
|
|
441
|
-
}
|
|
442
|
-
return handlerResult.result;
|
|
443
|
-
}
|
|
444
|
-
async function withCwd(cwd, run) {
|
|
445
|
-
// Only ever called with an explicit, non-empty cwd (readString filters blanks), from
|
|
446
|
-
// inside the serialized activation queue, so the chdir/restore is exclusive per request
|
|
447
|
-
// and can never be clobbered by a concurrent caller.
|
|
448
|
-
const previous = process.cwd();
|
|
449
|
-
process.chdir(cwd);
|
|
450
|
-
try {
|
|
451
|
-
return await run();
|
|
452
|
-
}
|
|
453
|
-
finally {
|
|
454
|
-
process.chdir(previous);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Mutation tools (create/update/close/append/update-many) return a verbose
|
|
459
|
-
* `changed_fields` array. On the agent path we drop it to a `changed_field_count`
|
|
460
|
-
* by default for token efficiency, restoring the full array only when the caller
|
|
461
|
-
* explicitly passes the MCP-level fullChangedFields=true control. Mutation options
|
|
462
|
-
* are forwarded unchanged so runtime fields named `full` remain valid user data.
|
|
463
|
-
*/
|
|
464
|
-
function withMutationCompaction(args, options) {
|
|
465
|
-
return { changedFields: args.fullChangedFields === true ? "full" : "compact", idOnly: args.idOnly === true, runnerOptions: { ...options } };
|
|
466
|
-
}
|
|
467
|
-
function mutationListOptions(options) {
|
|
468
|
-
return {
|
|
469
|
-
type: readScalarString(options, "filterType"),
|
|
470
|
-
tag: readScalarString(options, "filterTag"),
|
|
471
|
-
priority: readScalarString(options, "filterPriority"),
|
|
472
|
-
deadlineBefore: readScalarString(options, "filterDeadlineBefore"),
|
|
473
|
-
deadlineAfter: readScalarString(options, "filterDeadlineAfter"),
|
|
474
|
-
updatedAfter: readScalarString(options, "filterUpdatedAfter"),
|
|
475
|
-
updatedBefore: readScalarString(options, "filterUpdatedBefore"),
|
|
476
|
-
createdAfter: readScalarString(options, "filterCreatedAfter"),
|
|
477
|
-
createdBefore: readScalarString(options, "filterCreatedBefore"),
|
|
478
|
-
ids: readScalarStringAllowBlank(options, "ids"),
|
|
479
|
-
assignee: readScalarString(options, "filterAssignee"),
|
|
480
|
-
assigneeFilter: readScalarString(options, "filterAssigneeFilter") ?? readScalarString(options, "filterAssignee_filter"),
|
|
481
|
-
parent: readScalarString(options, "filterParent"),
|
|
482
|
-
sprint: readScalarString(options, "filterSprint"),
|
|
483
|
-
release: readScalarString(options, "filterRelease"),
|
|
484
|
-
limit: readScalarString(options, "limit"),
|
|
485
|
-
offset: readScalarString(options, "offset"),
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
function closeManyOptionsFromFlat(options) {
|
|
489
|
-
return {
|
|
490
|
-
status: readString(options, "filterStatus"),
|
|
491
|
-
list: isRecord(options.list) ? normalizeListOptions(options.list) : mutationListOptions(options),
|
|
492
|
-
reason: readString(options, "reason"),
|
|
493
|
-
resolution: readString(options, "resolution"),
|
|
494
|
-
expectedResult: readString(options, "expectedResult") ?? readString(options, "expected_result") ?? readString(options, "expected"),
|
|
495
|
-
actualResult: readString(options, "actualResult") ?? readString(options, "actual_result") ?? readString(options, "actual"),
|
|
496
|
-
validateClose: readString(options, "validateClose") ?? readString(options, "validate_close"),
|
|
497
|
-
author: readString(options, "author"),
|
|
498
|
-
message: readString(options, "message"),
|
|
499
|
-
force: options.force === true ? true : undefined,
|
|
500
|
-
dryRun: options.dryRun === true || options.dry_run === true ? true : undefined,
|
|
501
|
-
rollback: readString(options, "rollback"),
|
|
502
|
-
checkpoint: options.checkpoint === false || options.noCheckpoint === true || options.no_checkpoint === true ? false : undefined,
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
const UPDATE_MANY_FLAT_CONTROL_KEYS = new Set([
|
|
506
|
-
"filterStatus",
|
|
507
|
-
"filterType",
|
|
508
|
-
"filterTag",
|
|
509
|
-
"filterPriority",
|
|
510
|
-
"filterDeadlineBefore",
|
|
511
|
-
"filterDeadlineAfter",
|
|
512
|
-
"filterUpdatedAfter",
|
|
513
|
-
"filterUpdatedBefore",
|
|
514
|
-
"filterCreatedAfter",
|
|
515
|
-
"filterCreatedBefore",
|
|
516
|
-
"filterAssignee",
|
|
517
|
-
"filterAssigneeFilter",
|
|
518
|
-
"filterAssignee_filter",
|
|
519
|
-
"filterParent",
|
|
520
|
-
"filterSprint",
|
|
521
|
-
"filterRelease",
|
|
522
|
-
"ids",
|
|
523
|
-
"list",
|
|
524
|
-
"update",
|
|
525
|
-
"limit",
|
|
526
|
-
"offset",
|
|
527
|
-
"dryRun",
|
|
528
|
-
"dry_run",
|
|
529
|
-
"rollback",
|
|
530
|
-
"checkpoint",
|
|
531
|
-
"noCheckpoint",
|
|
532
|
-
"no_checkpoint",
|
|
533
|
-
]);
|
|
534
|
-
function updateManyUpdateOptionsFromFlat(options) {
|
|
535
|
-
const update = {};
|
|
536
|
-
for (const [key, value] of Object.entries(options)) {
|
|
537
|
-
if (UPDATE_MANY_FLAT_CONTROL_KEYS.has(key)) {
|
|
538
|
-
continue;
|
|
539
|
-
}
|
|
540
|
-
update[key] = value;
|
|
541
|
-
}
|
|
542
|
-
return normalizeMcpUpdateOptions(update);
|
|
543
|
-
}
|
|
544
|
-
function normalizeMcpUpdateOptions(options) {
|
|
545
|
-
const normalizedInput = normalizeMcpOptionsArrays(options, "update-many");
|
|
546
|
-
for (const contract of UPDATE_COMMANDER_STRING_OPTION_CONTRACTS) {
|
|
547
|
-
for (const key of contract.keys) {
|
|
548
|
-
const value = normalizedInput[key];
|
|
549
|
-
if (typeof value === "number" && Number.isFinite(value)) {
|
|
550
|
-
normalizedInput[key] = String(value);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
return normalizeUpdateOptions(normalizedInput);
|
|
555
|
-
}
|
|
556
|
-
function updateManyOptionsFromFlat(options) {
|
|
557
|
-
if (isRecord(options.list) || isRecord(options.update)) {
|
|
558
|
-
const updateSource = isRecord(options.update) ? options.update : updateManyUpdateOptionsFromFlat(options);
|
|
559
|
-
return {
|
|
560
|
-
status: readScalarString(options, "filterStatus"),
|
|
561
|
-
list: isRecord(options.list) ? normalizeListOptions(options.list) : mutationListOptions(options),
|
|
562
|
-
update: normalizeMcpUpdateOptions(updateSource),
|
|
563
|
-
dryRun: options.dryRun === true || options.dry_run === true ? true : undefined,
|
|
564
|
-
rollback: readString(options, "rollback"),
|
|
565
|
-
checkpoint: options.checkpoint === false || options.noCheckpoint === true || options.no_checkpoint === true ? false : undefined,
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
return {
|
|
569
|
-
status: readScalarString(options, "filterStatus"),
|
|
570
|
-
list: mutationListOptions(options),
|
|
571
|
-
update: updateManyUpdateOptionsFromFlat(options),
|
|
572
|
-
dryRun: options.dryRun === true || options.dry_run === true ? true : undefined,
|
|
573
|
-
rollback: readString(options, "rollback"),
|
|
574
|
-
checkpoint: options.checkpoint === false || options.noCheckpoint === true || options.no_checkpoint === true ? false : undefined,
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
async function runAction(args) {
|
|
578
|
-
const action = readRequiredString(args, "action");
|
|
579
|
-
const global = globalOptions(args);
|
|
580
|
-
// pm-zumn: dispatch every action (built-in and dynamic) inside one extension
|
|
581
|
-
// activation cycle so built-in actions see extension-contributed item types, fields,
|
|
582
|
-
// and profiles, consistent with the CLI. Snapshot the effective resolution cwd HERE,
|
|
583
|
-
// at request entry (the explicit args.cwd, else the server's current directory), so the
|
|
584
|
-
// queued cycle resolves against the directory the request arrived in rather than a value
|
|
585
|
-
// process.cwd() might hold by the time the task runs. Only an explicit cwd additionally
|
|
586
|
-
// pins process.cwd() (inside the serialized slot) for the built-in handler.
|
|
587
|
-
const explicitCwd = readString(args, "cwd");
|
|
588
|
-
const resolutionCwd = explicitCwd ?? process.cwd();
|
|
589
|
-
return withActiveExtensions(global, explicitCwd, resolutionCwd, (activeExtensions) => dispatchAction(action, args, global, activeExtensions));
|
|
590
|
-
}
|
|
591
|
-
function getOwnHandler(handlers, key) {
|
|
592
|
-
return Object.prototype.hasOwnProperty.call(handlers, key) ? handlers[key] : undefined;
|
|
593
|
-
}
|
|
594
|
-
function readMcpTarget(ctx) {
|
|
595
|
-
return readString(ctx.args, "target") ?? readString(ctx.options, "target");
|
|
596
|
-
}
|
|
597
|
-
function requireMcpItemId(ctx, source = ctx.options) {
|
|
598
|
-
return ctx.id ?? readRequiredString(source, "id");
|
|
599
|
-
}
|
|
600
|
-
async function runMcpListAction(ctx) {
|
|
601
|
-
const listOptions = { ...ctx.options };
|
|
602
|
-
if (listOptions.compact === undefined &&
|
|
603
|
-
listOptions.brief === undefined &&
|
|
604
|
-
listOptions.fields === undefined &&
|
|
605
|
-
listOptions.includeBody === undefined) {
|
|
606
|
-
listOptions.compact = true;
|
|
607
|
-
}
|
|
608
|
-
// pm-rmjy: echo applied filters + projection mode so agents get structured confirmation.
|
|
609
|
-
return withQuerySummary((await runList(readString(ctx.args, "status"), listOptions, ctx.global)), listOptions);
|
|
610
|
-
}
|
|
611
|
-
async function runMcpSearchAction(ctx) {
|
|
612
|
-
const searchOptions = { ...ctx.options };
|
|
613
|
-
if (searchOptions.compact === undefined && searchOptions.full === undefined && searchOptions.fields === undefined) {
|
|
614
|
-
searchOptions.compact = true;
|
|
615
|
-
}
|
|
616
|
-
return withQuerySummary((await runSearch(readRequiredString(ctx.args, "query"), searchOptions, ctx.global)), searchOptions);
|
|
617
|
-
}
|
|
618
|
-
async function runMcpCreateAction(ctx) {
|
|
619
|
-
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
620
|
-
return projectMutationResult(await runCreate(runnerOptions, ctx.global), { changedFields, idOnly });
|
|
621
|
-
}
|
|
622
|
-
async function runMcpCopyAction(ctx) {
|
|
623
|
-
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
624
|
-
const copyOptions = {
|
|
625
|
-
...runnerOptions,
|
|
626
|
-
...(runnerOptions.title === undefined && typeof ctx.args.title === "string" ? { title: ctx.args.title } : {}),
|
|
627
|
-
...(runnerOptions.message === undefined && typeof ctx.args.message === "string" ? { message: ctx.args.message } : {}),
|
|
628
|
-
};
|
|
629
|
-
return projectMutationResult(await runCopy(requireMcpItemId(ctx, copyOptions), copyOptions, ctx.global), {
|
|
630
|
-
changedFields,
|
|
631
|
-
idOnly,
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
|
-
async function runMcpUpdateAction(ctx) {
|
|
635
|
-
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
636
|
-
return projectMutationResult(await runUpdate(requireMcpItemId(ctx, runnerOptions), runnerOptions, ctx.global), {
|
|
637
|
-
changedFields,
|
|
638
|
-
idOnly,
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
async function runMcpCloseAction(ctx) {
|
|
642
|
-
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
643
|
-
const closeReason = readString(ctx.args, "reason") ??
|
|
644
|
-
readString(ctx.args, "text") ??
|
|
645
|
-
readString(runnerOptions, "reason") ??
|
|
646
|
-
readString(runnerOptions, "text");
|
|
647
|
-
return projectMutationResult(await runClose(requireMcpItemId(ctx, runnerOptions), closeReason, runnerOptions, ctx.global), { changedFields, idOnly });
|
|
648
|
-
}
|
|
649
|
-
function runMcpCommentsAction(ctx) {
|
|
650
|
-
const commentOptions = { ...ctx.options };
|
|
651
|
-
const isListing = commentOptions.add === undefined &&
|
|
652
|
-
commentOptions.stdin === undefined &&
|
|
653
|
-
commentOptions.file === undefined &&
|
|
654
|
-
commentOptions.edit === undefined &&
|
|
655
|
-
commentOptions.delete === undefined;
|
|
656
|
-
if (isListing) {
|
|
657
|
-
commentOptions.includeMeta = true;
|
|
658
|
-
if (commentOptions.limit === undefined && commentOptions.full !== true) {
|
|
659
|
-
commentOptions.limit = "20";
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
delete commentOptions.full;
|
|
663
|
-
return runComments(requireMcpItemId(ctx), commentOptions, ctx.global);
|
|
664
|
-
}
|
|
665
|
-
function runMcpFilesAction(ctx) {
|
|
666
|
-
const fileId = requireMcpItemId(ctx);
|
|
667
|
-
return ctx.options.discover === true
|
|
668
|
-
? runFilesDiscover(fileId, withFilesDiscoveryOptions(ctx.options), ctx.global)
|
|
669
|
-
: runFiles(fileId, withAddNoteOption(ctx.options), ctx.global);
|
|
670
|
-
}
|
|
671
|
-
function runMcpTelemetryAction(ctx) {
|
|
672
|
-
return runTelemetry({
|
|
673
|
-
subcommand: readString(ctx.args, "subcommand") ?? readString(ctx.options, "subcommand"),
|
|
674
|
-
limit: resolveMcpTelemetryLimit(ctx.args, ctx.options),
|
|
675
|
-
}, ctx.global);
|
|
676
|
-
}
|
|
677
|
-
function resolveMcpTelemetryLimit(args, options) {
|
|
678
|
-
if (typeof args.limit === "number" && Number.isFinite(args.limit)) {
|
|
679
|
-
return args.limit;
|
|
680
|
-
}
|
|
681
|
-
if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
|
|
682
|
-
return options.limit;
|
|
683
|
-
}
|
|
684
|
-
return readString(args, "limit") ?? readString(options, "limit");
|
|
685
|
-
}
|
|
686
|
-
function runMcpHealthAction(ctx) {
|
|
687
|
-
const healthOptions = { ...ctx.options };
|
|
688
|
-
if (healthOptions.brief === undefined && healthOptions.summary === undefined && healthOptions.full === undefined) {
|
|
689
|
-
healthOptions.summary = true;
|
|
690
|
-
}
|
|
691
|
-
return runHealth(ctx.global, healthOptions);
|
|
692
|
-
}
|
|
693
|
-
function runMcpConfigAction(ctx) {
|
|
694
|
-
const configAction = readString(ctx.args, "configAction") ?? readString(ctx.options, "configAction") ?? readString(ctx.options, "action");
|
|
695
|
-
if (configAction === undefined) {
|
|
696
|
-
throw new PmCliError("Missing required argument: configAction", 64);
|
|
697
|
-
}
|
|
698
|
-
return runConfig(readString(ctx.args, "scope") ?? readString(ctx.options, "scope") ?? "project", configAction, readString(ctx.args, "key") ?? readString(ctx.options, "key"), ctx.options, ctx.global, readString(ctx.args, "value") ?? readString(ctx.options, "value"));
|
|
699
|
-
}
|
|
700
|
-
function runMcpActivityAction(ctx) {
|
|
701
|
-
const activityOptions = { ...ctx.options };
|
|
702
|
-
if (activityOptions.compact === undefined) {
|
|
703
|
-
activityOptions.compact = activityOptions.full === true ? false : true;
|
|
704
|
-
}
|
|
705
|
-
delete activityOptions.full;
|
|
706
|
-
return runActivity(activityOptions, ctx.global);
|
|
707
|
-
}
|
|
708
|
-
function runMcpHistoryRepairAction(ctx) {
|
|
709
|
-
const repairAll = ctx.options.all === true;
|
|
710
|
-
const repairId = ctx.id ?? readString(ctx.options, "id");
|
|
711
|
-
assertHistoryRepairTarget(repairId, repairAll);
|
|
712
|
-
return repairAll ? runHistoryRepairAll(ctx.options, ctx.global) : runHistoryRepair(repairId, ctx.options, ctx.global);
|
|
713
|
-
}
|
|
714
|
-
function parseMcpInteger(value, label) {
|
|
715
|
-
if (typeof value === "number") {
|
|
716
|
-
if (!Number.isInteger(value)) {
|
|
717
|
-
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
718
|
-
}
|
|
719
|
-
return value;
|
|
720
|
-
}
|
|
721
|
-
if (typeof value === "string" && value.trim().length > 0) {
|
|
722
|
-
const parsed = Number(value);
|
|
723
|
-
if (!Number.isInteger(parsed)) {
|
|
724
|
-
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
725
|
-
}
|
|
726
|
-
return parsed;
|
|
727
|
-
}
|
|
728
|
-
return undefined;
|
|
729
|
-
}
|
|
730
|
-
function parseMcpIntegerPrefix(value, label) {
|
|
731
|
-
if (typeof value === "number") {
|
|
732
|
-
const parsed = Number.parseInt(String(value), 10);
|
|
733
|
-
if (!Number.isInteger(parsed)) {
|
|
734
|
-
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
735
|
-
}
|
|
736
|
-
return parsed;
|
|
737
|
-
}
|
|
738
|
-
if (typeof value === "string" && value.trim().length > 0) {
|
|
739
|
-
const trimmed = value.trim();
|
|
740
|
-
if (!/^[+-]?\d+(?:st|nd|rd|th)?$/i.test(trimmed)) {
|
|
741
|
-
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
742
|
-
}
|
|
743
|
-
const parsed = Number.parseInt(trimmed, 10);
|
|
744
|
-
if (!Number.isInteger(parsed)) {
|
|
745
|
-
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
746
|
-
}
|
|
747
|
-
return parsed;
|
|
748
|
-
}
|
|
749
|
-
return undefined;
|
|
750
|
-
}
|
|
751
|
-
function runMcpPlanAction(ctx) {
|
|
752
|
-
const subcommand = readRequiredString(ctx.options, "subcommand");
|
|
753
|
-
const planRecord = ctx.options;
|
|
754
|
-
return runPlan({
|
|
755
|
-
subcommand: subcommand,
|
|
756
|
-
id: typeof ctx.id === "string" ? ctx.id : typeof planRecord.id === "string" ? planRecord.id : undefined,
|
|
757
|
-
stepRef: readMcpPlanStepRef(ctx),
|
|
758
|
-
reorderTo: parseMcpIntegerPrefix(planRecord.reorderTo ?? ctx.args.reorderTo, "plan reorderTo"),
|
|
759
|
-
options: ctx.options,
|
|
760
|
-
global: ctx.global,
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
function readMcpPlanStepRef(ctx) {
|
|
764
|
-
return typeof ctx.options.stepRef === "string"
|
|
765
|
-
? ctx.options.stepRef
|
|
766
|
-
: typeof ctx.args.stepRef === "string"
|
|
767
|
-
? ctx.args.stepRef
|
|
768
|
-
: undefined;
|
|
769
|
-
}
|
|
770
|
-
function createMcpSchemaContext(ctx) {
|
|
771
|
-
const subcommand = readString(ctx.args, "subcommand") ?? readRequiredString(ctx.options, "subcommand");
|
|
772
|
-
const aliasSource = ctx.args.alias ?? ctx.options.alias;
|
|
773
|
-
return {
|
|
774
|
-
ctx,
|
|
775
|
-
subcommand: subcommand.trim().toLowerCase(),
|
|
776
|
-
name: readString(ctx.args, "name") ?? readString(ctx.options, "name"),
|
|
777
|
-
author: readString(ctx.args, "author") ?? readString(ctx.options, "author"),
|
|
778
|
-
force: ctx.args.force === true || ctx.options.force === true,
|
|
779
|
-
aliases: aliasSource === undefined ? undefined : readStringArray(aliasSource),
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
function runMcpSchemaReadOrRemoveAction(schema) {
|
|
783
|
-
const { ctx, subcommand, name, author, force } = schema;
|
|
784
|
-
const simpleHandlers = {
|
|
785
|
-
list: () => runSchemaList(ctx.global),
|
|
786
|
-
show: () => runSchemaShow(name, ctx.global),
|
|
787
|
-
"show-status": () => runSchemaShowStatus(name, ctx.global),
|
|
788
|
-
"list-fields": () => runSchemaListFields(ctx.global),
|
|
789
|
-
"show-field": () => runSchemaShowField(name, ctx.global),
|
|
790
|
-
"remove-type": () => runSchemaRemoveType(name, { author, force }, ctx.global),
|
|
791
|
-
"remove-field": () => runSchemaRemoveField(name, { author, force }, ctx.global),
|
|
792
|
-
"remove-status": () => runSchemaRemoveStatus(name, { author, force }, ctx.global),
|
|
793
|
-
"apply-preset": () => runSchemaApplyPreset(readString(ctx.args, "typePreset") ?? readString(ctx.options, "typePreset"), { author, force }, ctx.global),
|
|
794
|
-
};
|
|
795
|
-
const handler = getOwnHandler(simpleHandlers, subcommand);
|
|
796
|
-
return handler ? handler() : null;
|
|
797
|
-
}
|
|
798
|
-
function runMcpSchemaAddFieldAction(schema) {
|
|
799
|
-
const { ctx, name, author, force, aliases } = schema;
|
|
800
|
-
const commandsSource = ctx.args.commands ?? ctx.options.commands;
|
|
801
|
-
const requiredTypesSource = ctx.args.requiredTypes ?? ctx.options.requiredTypes;
|
|
802
|
-
return runSchemaAddField(name, {
|
|
803
|
-
type: readString(ctx.args, "fieldType") ?? readString(ctx.options, "fieldType"),
|
|
804
|
-
commands: commandsSource === undefined ? undefined : readStringArray(commandsSource),
|
|
805
|
-
description: readString(ctx.args, "description") ?? readString(ctx.options, "description"),
|
|
806
|
-
cliFlag: readString(ctx.args, "cliFlag") ?? readString(ctx.options, "cliFlag"),
|
|
807
|
-
alias: aliases,
|
|
808
|
-
required: ctx.args.required === true || ctx.options.required === true,
|
|
809
|
-
requiredOnCreate: ctx.args.requiredOnCreate === true || ctx.options.requiredOnCreate === true,
|
|
810
|
-
allowUnset: !(ctx.args.allowUnset === false || ctx.options.allowUnset === false),
|
|
811
|
-
requiredTypes: requiredTypesSource === undefined ? undefined : readStringArray(requiredTypesSource),
|
|
812
|
-
author,
|
|
813
|
-
force,
|
|
814
|
-
}, ctx.global);
|
|
815
|
-
}
|
|
816
|
-
function runMcpSchemaAddStatusAction(schema) {
|
|
817
|
-
const { ctx, name, author, force, aliases } = schema;
|
|
818
|
-
const roleSource = ctx.args.role ?? ctx.options.role;
|
|
819
|
-
return runSchemaAddStatus(name, {
|
|
820
|
-
role: roleSource === undefined ? undefined : readStringArray(roleSource),
|
|
821
|
-
alias: aliases,
|
|
822
|
-
description: readString(ctx.args, "description") ?? readString(ctx.options, "description"),
|
|
823
|
-
order: parseMcpInteger(ctx.args.order ?? ctx.options.order, "schema add-status order"),
|
|
824
|
-
author,
|
|
825
|
-
force,
|
|
826
|
-
}, ctx.global);
|
|
827
|
-
}
|
|
828
|
-
function runMcpSchemaAddTypeAction(schema) {
|
|
829
|
-
const { ctx, name, author, force, aliases } = schema;
|
|
830
|
-
return runSchemaAddType(name, {
|
|
831
|
-
description: readString(ctx.args, "description") ?? readString(ctx.options, "description"),
|
|
832
|
-
defaultStatus: readString(ctx.args, "defaultStatus") ??
|
|
833
|
-
readString(ctx.args, "default_status") ??
|
|
834
|
-
readString(ctx.options, "defaultStatus") ??
|
|
835
|
-
readString(ctx.options, "default_status"),
|
|
836
|
-
folder: readString(ctx.args, "folder") ?? readString(ctx.options, "folder"),
|
|
837
|
-
alias: aliases,
|
|
838
|
-
author,
|
|
839
|
-
force,
|
|
840
|
-
}, ctx.global);
|
|
841
|
-
}
|
|
842
|
-
function runMcpSchemaAction(ctx) {
|
|
843
|
-
const schema = createMcpSchemaContext(ctx);
|
|
844
|
-
const simpleResult = runMcpSchemaReadOrRemoveAction(schema);
|
|
845
|
-
if (simpleResult !== null) {
|
|
846
|
-
return simpleResult;
|
|
847
|
-
}
|
|
848
|
-
if (schema.subcommand === "add-field") {
|
|
849
|
-
return runMcpSchemaAddFieldAction(schema);
|
|
850
|
-
}
|
|
851
|
-
if (schema.subcommand === "add-status") {
|
|
852
|
-
return runMcpSchemaAddStatusAction(schema);
|
|
853
|
-
}
|
|
854
|
-
if (schema.subcommand === "add-type") {
|
|
855
|
-
if (ctx.args.infer === true || ctx.options.infer === true) {
|
|
856
|
-
return runSchemaInferTypes({
|
|
857
|
-
minCount: parseMcpInteger(ctx.args.minCount ?? ctx.options.minCount, "schema infer minCount"),
|
|
858
|
-
apply: ctx.args.apply === true || ctx.options.apply === true,
|
|
859
|
-
author: schema.author,
|
|
860
|
-
force: schema.force,
|
|
861
|
-
}, ctx.global);
|
|
862
|
-
}
|
|
863
|
-
return runMcpSchemaAddTypeAction(schema);
|
|
864
|
-
}
|
|
865
|
-
throw new PmCliError(`Unknown pm schema subcommand "${schema.subcommand}". Allowed: add-type, remove-type, add-status, remove-status, add-field, remove-field, list-fields, show-field, apply-preset, list, show, show-status`, 64);
|
|
866
|
-
}
|
|
867
|
-
function runMcpProfileAction(ctx) {
|
|
868
|
-
const subcommand = readString(ctx.args, "subcommand") ?? readRequiredString(ctx.options, "subcommand");
|
|
869
|
-
const normalizedSubcommand = subcommand.trim().toLowerCase();
|
|
870
|
-
const profileName = readString(ctx.args, "name") ?? readString(ctx.options, "name");
|
|
871
|
-
const handlers = {
|
|
872
|
-
list: () => runProfileList(),
|
|
873
|
-
show: () => runProfileShow(profileName),
|
|
874
|
-
lint: () => runProfileLint(profileName),
|
|
875
|
-
apply: () => runProfileApply(profileName, {
|
|
876
|
-
dryRun: ctx.args.dryRun === true || ctx.options.dryRun === true,
|
|
877
|
-
author: readString(ctx.args, "author") ?? readString(ctx.options, "author"),
|
|
878
|
-
force: ctx.args.force === true || ctx.options.force === true,
|
|
879
|
-
}, ctx.global),
|
|
880
|
-
};
|
|
881
|
-
const handler = getOwnHandler(handlers, normalizedSubcommand);
|
|
882
|
-
if (!handler) {
|
|
883
|
-
throw new PmCliError(`Unknown pm profile subcommand "${subcommand}". Allowed: list, show, apply, lint`, 64);
|
|
884
|
-
}
|
|
885
|
-
return handler();
|
|
886
|
-
}
|
|
887
|
-
function runMcpStatsAction(ctx) {
|
|
888
|
-
return runStats(ctx.global, {
|
|
889
|
-
storage: ctx.options.storage === true,
|
|
890
|
-
metadataCoverage: ctx.options.metadataCoverage === true,
|
|
891
|
-
fieldUtilization: ctx.options.fieldUtilization === true,
|
|
892
|
-
byAssignee: ctx.options.byAssignee === true,
|
|
893
|
-
byTag: ctx.options.byTag === true,
|
|
894
|
-
byPriority: ctx.options.byPriority === true,
|
|
895
|
-
tagPrefix: typeof ctx.options.tagPrefix === "string" ? ctx.options.tagPrefix : undefined,
|
|
896
|
-
});
|
|
897
|
-
}
|
|
898
|
-
async function runMcpAppendAction(ctx) {
|
|
899
|
-
const { changedFields, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
900
|
-
return projectMutationResult(await runAppend(requireMcpItemId(ctx, runnerOptions), runnerOptions, ctx.global), {
|
|
901
|
-
changedFields,
|
|
902
|
-
});
|
|
903
|
-
}
|
|
904
|
-
async function runMcpUpdateManyAction(ctx) {
|
|
905
|
-
const { changedFields, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
906
|
-
return projectMutationResult(await runUpdateMany(updateManyOptionsFromFlat(runnerOptions), ctx.global), { changedFields });
|
|
907
|
-
}
|
|
908
|
-
async function runMcpCloseManyAction(ctx) {
|
|
909
|
-
const { changedFields, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
910
|
-
const topLevelReason = readString(ctx.args, "reason");
|
|
911
|
-
const closeManyRunnerOptions = topLevelReason !== undefined && runnerOptions.reason === undefined
|
|
912
|
-
? { ...runnerOptions, reason: topLevelReason }
|
|
913
|
-
: { ...runnerOptions };
|
|
914
|
-
if (ctx.force && closeManyRunnerOptions.force === undefined) {
|
|
915
|
-
closeManyRunnerOptions.force = true;
|
|
916
|
-
}
|
|
917
|
-
return projectMutationResult(await runCloseMany(closeManyOptionsFromFlat(closeManyRunnerOptions), ctx.global), { changedFields });
|
|
918
|
-
}
|
|
919
|
-
const MCP_ACTION_HANDLERS = {
|
|
920
|
-
init: (ctx) => runInit(readString(ctx.args, "prefix"), ctx.global, ctx.options),
|
|
921
|
-
context: (ctx) => runContext(ctx.options, ctx.global),
|
|
922
|
-
next: (ctx) => runNext(ctx.options, ctx.global),
|
|
923
|
-
list: runMcpListAction,
|
|
924
|
-
get: (ctx) => runGet(requireMcpItemId(ctx), ctx.global, ctx.options),
|
|
925
|
-
search: runMcpSearchAction,
|
|
926
|
-
create: runMcpCreateAction,
|
|
927
|
-
copy: runMcpCopyAction,
|
|
928
|
-
focus: (ctx) => runFocus(ctx.id, { clear: ctx.options.clear === true || ctx.args.clear === true }, ctx.global),
|
|
929
|
-
update: runMcpUpdateAction,
|
|
930
|
-
claim: (ctx) => runClaim(requireMcpItemId(ctx), ctx.force, ctx.global, ctx.options),
|
|
931
|
-
release: (ctx) => runRelease(requireMcpItemId(ctx), ctx.force, ctx.global, ctx.options),
|
|
932
|
-
close: runMcpCloseAction,
|
|
933
|
-
comments: runMcpCommentsAction,
|
|
934
|
-
notes: (ctx) => runNotes(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
935
|
-
learnings: (ctx) => runLearnings(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
936
|
-
files: runMcpFilesAction,
|
|
937
|
-
docs: (ctx) => runDocs(requireMcpItemId(ctx), withAddNoteOption(ctx.options), ctx.global),
|
|
938
|
-
test: (ctx) => runTest(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
939
|
-
"test-all": (ctx) => runTestAll(ctx.options, ctx.global),
|
|
940
|
-
telemetry: runMcpTelemetryAction,
|
|
941
|
-
validate: (ctx) => runValidate(ctx.options, ctx.global),
|
|
942
|
-
health: runMcpHealthAction,
|
|
943
|
-
contracts: (ctx) => runContracts(ctx.options, ctx.global),
|
|
944
|
-
config: runMcpConfigAction,
|
|
945
|
-
activity: runMcpActivityAction,
|
|
946
|
-
aggregate: (ctx) => runAggregate(ctx.options, ctx.global),
|
|
947
|
-
extension: (ctx) => runExtension(readMcpTarget(ctx), ctx.options, ctx.global),
|
|
948
|
-
"extension-reload": (ctx) => runExtension(undefined, { ...ctx.options, reload: true }, ctx.global),
|
|
949
|
-
package: (ctx) => runExtension(readMcpTarget(ctx), ctx.options, ctx.global),
|
|
950
|
-
"package-install": (ctx) => runExtension(readMcpTarget(ctx), { ...ctx.options, install: true }, ctx.global),
|
|
951
|
-
install: (ctx) => runExtension(readMcpTarget(ctx), { ...ctx.options, install: true }, ctx.global),
|
|
952
|
-
"package-catalog": (ctx) => runExtension(undefined, { ...ctx.options, catalog: true, vocabulary: "package" }, ctx.global),
|
|
953
|
-
upgrade: (ctx) => runUpgrade(readMcpTarget(ctx), ctx.options, ctx.global),
|
|
954
|
-
delete: (ctx) => runDelete(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
955
|
-
deps: (ctx) => runDeps(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
956
|
-
"files-discover": (ctx) => runFilesDiscover(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
957
|
-
history: (ctx) => runHistory(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
958
|
-
"history-redact": (ctx) => runHistoryRedact(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
959
|
-
"history-repair": runMcpHistoryRepairAction,
|
|
960
|
-
"history-compact": (ctx) => runHistoryCompact(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
961
|
-
plan: runMcpPlanAction,
|
|
962
|
-
schema: runMcpSchemaAction,
|
|
963
|
-
profile: runMcpProfileAction,
|
|
964
|
-
stats: runMcpStatsAction,
|
|
965
|
-
append: runMcpAppendAction,
|
|
966
|
-
"update-many": runMcpUpdateManyAction,
|
|
967
|
-
"close-many": runMcpCloseManyAction,
|
|
968
|
-
gc: (ctx) => runGc(ctx.global, ctx.options),
|
|
969
|
-
};
|
|
970
|
-
async function dispatchAction(action, args, global, activeExtensions) {
|
|
971
|
-
const options = optionsWithAuthor(args, action);
|
|
972
|
-
const ctx = {
|
|
973
|
-
action,
|
|
974
|
-
args,
|
|
975
|
-
options,
|
|
976
|
-
id: readString(args, "id"),
|
|
977
|
-
force: args.force === true,
|
|
978
|
-
global,
|
|
979
|
-
activeExtensions,
|
|
980
|
-
};
|
|
981
|
-
const handler = getOwnHandler(MCP_ACTION_HANDLERS, action);
|
|
982
|
-
return handler ? handler(ctx) : dispatchActiveExtensionAction(action, args, options, global, activeExtensions);
|
|
983
|
-
}
|
|
984
89
|
const HANDLERS = {
|
|
985
90
|
pm_run: (args) => runAction(args),
|
|
986
91
|
pm_context: (args) => runAction({ ...args, action: "context" }),
|
|
@@ -1073,7 +178,7 @@ export async function handleRequest(request) {
|
|
|
1073
178
|
if (request.method === "tools/call") {
|
|
1074
179
|
const params = asRecordClone(request.params);
|
|
1075
180
|
const name = readRequiredString(params, "name");
|
|
1076
|
-
const handler =
|
|
181
|
+
const handler = Object.prototype.hasOwnProperty.call(HANDLERS, name) ? HANDLERS[name] : undefined;
|
|
1077
182
|
if (!handler) {
|
|
1078
183
|
throw new PmCliError(`Unknown pm MCP tool: ${name}`, 64);
|
|
1079
184
|
}
|
|
@@ -1183,28 +288,69 @@ export function isInvokedAsMcpMainModule(argvPath, moduleUrl) {
|
|
|
1183
288
|
return false;
|
|
1184
289
|
}
|
|
1185
290
|
}
|
|
291
|
+
function readRuntimeTestHook(key) {
|
|
292
|
+
const runtimeTestHooks = globalThis.__pmCliActionRunnerTestHooks;
|
|
293
|
+
if (runtimeTestHooks === undefined) {
|
|
294
|
+
throw new PmCliError(`MCP runtime test hook "${String(key)}" is only available in test environments.`, 64);
|
|
295
|
+
}
|
|
296
|
+
return runtimeTestHooks[key];
|
|
297
|
+
}
|
|
1186
298
|
export const _testOnly = {
|
|
1187
|
-
closeManyOptionsFromFlat
|
|
299
|
+
get closeManyOptionsFromFlat() {
|
|
300
|
+
return readRuntimeTestHook("closeManyOptionsFromFlat");
|
|
301
|
+
},
|
|
1188
302
|
detectUnexpectedTopLevelKeys,
|
|
1189
303
|
errorContent,
|
|
1190
|
-
extensionOptionsFromArgs
|
|
1191
|
-
|
|
1192
|
-
|
|
304
|
+
get extensionOptionsFromArgs() {
|
|
305
|
+
return readRuntimeTestHook("extensionOptionsFromArgs");
|
|
306
|
+
},
|
|
307
|
+
get globalOptions() {
|
|
308
|
+
return readRuntimeTestHook("globalOptions");
|
|
309
|
+
},
|
|
310
|
+
get mutationListOptions() {
|
|
311
|
+
return readRuntimeTestHook("mutationListOptions");
|
|
312
|
+
},
|
|
1193
313
|
nearestDeclaredKey,
|
|
1194
|
-
normalizeActionName
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
314
|
+
get normalizeActionName() {
|
|
315
|
+
return readRuntimeTestHook("normalizeActionName");
|
|
316
|
+
},
|
|
317
|
+
get normalizeCommandPath() {
|
|
318
|
+
return readRuntimeTestHook("normalizeCommandPath");
|
|
319
|
+
},
|
|
320
|
+
get normalizeMcpOptionsArrays() {
|
|
321
|
+
return readRuntimeTestHook("normalizeMcpOptionsArrays");
|
|
322
|
+
},
|
|
323
|
+
get normalizeMcpUpdateOptions() {
|
|
324
|
+
return readRuntimeTestHook("normalizeMcpUpdateOptions");
|
|
325
|
+
},
|
|
326
|
+
get optionsWithAuthor() {
|
|
327
|
+
return readRuntimeTestHook("optionsWithAuthor");
|
|
328
|
+
},
|
|
329
|
+
get readRequiredString() {
|
|
330
|
+
return readRuntimeTestHook("readRequiredString");
|
|
331
|
+
},
|
|
332
|
+
get readScalarString() {
|
|
333
|
+
return readRuntimeTestHook("readScalarString");
|
|
334
|
+
},
|
|
335
|
+
get readScalarStringAllowBlank() {
|
|
336
|
+
return readRuntimeTestHook("readScalarStringAllowBlank");
|
|
337
|
+
},
|
|
338
|
+
get readStringArray() {
|
|
339
|
+
return readRuntimeTestHook("readStringArray");
|
|
340
|
+
},
|
|
1203
341
|
runAction,
|
|
1204
|
-
updateManyOptionsFromFlat
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
342
|
+
get updateManyOptionsFromFlat() {
|
|
343
|
+
return readRuntimeTestHook("updateManyOptionsFromFlat");
|
|
344
|
+
},
|
|
345
|
+
get withAddNoteOption() {
|
|
346
|
+
return readRuntimeTestHook("withAddNoteOption");
|
|
347
|
+
},
|
|
348
|
+
get withFilesDiscoveryOptions() {
|
|
349
|
+
return readRuntimeTestHook("withFilesDiscoveryOptions");
|
|
350
|
+
},
|
|
351
|
+
get withMutationCompaction() {
|
|
352
|
+
return readRuntimeTestHook("withMutationCompaction");
|
|
353
|
+
},
|
|
1208
354
|
writeError,
|
|
1209
355
|
};
|
|
1210
356
|
/* c8 ignore start */
|
|
@@ -1213,4 +359,4 @@ if (isInvokedAsMcpMainModule(process.argv[1], import.meta.url)) {
|
|
|
1213
359
|
}
|
|
1214
360
|
/* c8 ignore stop */
|
|
1215
361
|
//# sourceMappingURL=server.js.map
|
|
1216
|
-
//# debugId=
|
|
362
|
+
//# debugId=027adbba-55f2-5bab-b7dc-6e80fb5408d3
|