@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/sdk/runtime.js
CHANGED
|
@@ -4,13 +4,27 @@
|
|
|
4
4
|
* Defines public SDK APIs and package-author helpers for Runtime.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="89db1e15-b152-57e2-910d-64ed77eb540b")}catch(e){}}();
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import {
|
|
9
|
+
import { createEmptyExtensionCommandRegistry, createEmptyExtensionHookRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionRegistrationRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionServiceRegistry, } from "../core/extensions/extension-registries.js";
|
|
10
|
+
import { activateExtensions, deactivateExtensions, loadExtensions, runActiveCommandHandler, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, } from "../core/extensions/index.js";
|
|
11
|
+
import { pathExists } from "../core/fs/fs-utils.js";
|
|
10
12
|
import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
|
|
13
|
+
import { projectMutationResult } from "../core/output/mutation-projection.js";
|
|
14
|
+
import { withQuerySummary } from "../core/output/query-summary.js";
|
|
15
|
+
import { PmCliError } from "../core/shared/errors.js";
|
|
16
|
+
import { asRecordClone } from "../core/shared/primitives.js";
|
|
17
|
+
import { createSerialQueue } from "../core/shared/serial-queue.js";
|
|
11
18
|
import { resolveRuntimeStatusRegistry } from "../core/schema/runtime-schema.js";
|
|
19
|
+
import { getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
|
|
12
20
|
import { readSettings } from "../core/store/settings.js";
|
|
21
|
+
import { normalizeListOptions, normalizeUpdateOptions } from "../cli/registration-helpers.js";
|
|
22
|
+
import { UPDATE_COMMANDER_STRING_OPTION_CONTRACTS } from "./cli-contracts/commander-mutation-options.js";
|
|
23
|
+
import { clearWorkspaceContractsCache, memoizeWorkspaceExtensionRegistrations, } from "./workspace-contracts-cache.js";
|
|
24
|
+
export { clearWorkspaceContractsCache } from "./workspace-contracts-cache.js";
|
|
25
|
+
import { assertHistoryRepairTarget, runActivity, runAggregate, runAppend, runClaim, runClose, runCloseMany, runComments, runConfig, runContext, runCopy, runCreate, runDelete, runDeps, runDocs, runExtension, runFiles, runFilesDiscover, runFocus, runGc, runGet, runHealth, runHistory, runHistoryCompact, runHistoryRedact, runHistoryRepair, runHistoryRepairAll, runInit, runLearnings, runList, runNext, runNotes, runPlan, runProfileApply, runProfileLint, runProfileList, runProfileShow, runRestore, runRelease, runSchemaAddField, runSchemaAddStatus, runSchemaAddType, runSchemaApplyPreset, runSchemaInferTypes, runSchemaList, runSchemaListFields, runSchemaRemoveField, runSchemaRemoveStatus, runSchemaRemoveType, runSchemaShow, runSchemaShowField, runSchemaShowStatus, runSearch, runStats, runTelemetry, runTest, runTestAll, runUpdate, runUpdateMany, runUpgrade, runValidate, } from "../cli/commands/index.js";
|
|
13
26
|
import { runContracts, } from "../cli/commands/contracts.js";
|
|
27
|
+
import { resolveStartTaskInProgressStatus } from "./start-task-status.js";
|
|
14
28
|
export { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks, } from "../core/extensions/index.js";
|
|
15
29
|
export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from "../core/fs/fs-utils.js";
|
|
16
30
|
export { appendHistoryEntry, createHistoryEntry } from "../core/history/history.js";
|
|
@@ -31,6 +45,13 @@ export { isTimestampLiteral, nowIso } from "../core/shared/time.js";
|
|
|
31
45
|
export { listAllFrontMatter, locateItem, readLocatedItem } from "../core/store/item-store.js";
|
|
32
46
|
export { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
|
|
33
47
|
export { readSettings } from "../core/store/settings.js";
|
|
48
|
+
export { runAggregate, } from "../cli/commands/aggregate.js";
|
|
49
|
+
export { CONTEXT_OUTPUT_VALUES, runContext, } from "../cli/commands/context.js";
|
|
50
|
+
export { runGet, } from "../cli/commands/get.js";
|
|
51
|
+
export { runList, } from "../cli/commands/list.js";
|
|
52
|
+
export { NEXT_OUTPUT_VALUES, runNext, } from "../cli/commands/next.js";
|
|
53
|
+
export { runSearch, } from "../cli/commands/search.js";
|
|
54
|
+
export { runStats, } from "../cli/commands/stats.js";
|
|
34
55
|
export { renderCalendarMarkdown, renderCalendarToon, resolveCalendarOutputFormat, runCalendar, } from "../cli/commands/calendar.js";
|
|
35
56
|
export { renderGuideMarkdown, resolveGuideOutputFormat, runGuide, } from "../cli/commands/guide.js";
|
|
36
57
|
export { runCompletion } from "../cli/commands/completion.js";
|
|
@@ -39,10 +60,291 @@ export { runDedupeAudit, } from "../cli/commands/dedupe-audit.js";
|
|
|
39
60
|
export { runDedupeMerge, } from "../cli/commands/dedupe-merge.js";
|
|
40
61
|
export { runNormalize } from "../cli/commands/normalize.js";
|
|
41
62
|
export { runReindex } from "../cli/commands/reindex.js";
|
|
42
|
-
export { runSearch } from "../cli/commands/search.js";
|
|
43
63
|
export { loadCreateTemplateOptions, runTemplatesList, runTemplatesSave, runTemplatesShow, } from "../cli/commands/templates.js";
|
|
44
64
|
export { runTestRunsList, runTestRunsLogs, runTestRunsResume, runTestRunsStatus, runTestRunsStop, } from "../cli/commands/test-runs.js";
|
|
45
65
|
export { CONFIDENCE_TEXT_VALUES, DEPENDENCY_KIND_VALUES, BUILTIN_ITEM_TYPE_VALUES, ISSUE_SEVERITY_VALUES, ITEM_TYPE_VALUES, RISK_VALUES, STATUS_VALUES, } from "../types/index.js";
|
|
66
|
+
function splitClientMutationOptions(options) {
|
|
67
|
+
const { fullChangedFields, idOnly, ...runnerOptions } = options;
|
|
68
|
+
return {
|
|
69
|
+
...(fullChangedFields === undefined ? {} : { fullChangedFields }),
|
|
70
|
+
...(idOnly === undefined ? {} : { idOnly }),
|
|
71
|
+
options: runnerOptions,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Programmatic pm client for custom tools, CI jobs, bots, and embedded runtimes.
|
|
76
|
+
*
|
|
77
|
+
* Action execution shares the same process-wide extension activation queue used
|
|
78
|
+
* by MCP. Concurrent calls from one process are serialized across extension
|
|
79
|
+
* load, activation, dispatch, cleanup, and deactivate so active registries cannot
|
|
80
|
+
* interleave.
|
|
81
|
+
*
|
|
82
|
+
* Convenience methods accept command options only. Use {@link PmClient.run} for
|
|
83
|
+
* per-call runtime overrides such as `cwd`, `path`, or `noExtensions`.
|
|
84
|
+
*/
|
|
85
|
+
export class PmClient {
|
|
86
|
+
defaults;
|
|
87
|
+
/**
|
|
88
|
+
* Create a client with workspace, author, and extension-loading defaults.
|
|
89
|
+
*/
|
|
90
|
+
constructor(options = {}) {
|
|
91
|
+
this.defaults = {
|
|
92
|
+
...(options.pmRoot === undefined ? {} : { path: options.pmRoot }),
|
|
93
|
+
...(options.cwd === undefined ? {} : { cwd: options.cwd }),
|
|
94
|
+
...(options.author === undefined ? {} : { author: options.author }),
|
|
95
|
+
...(options.noExtensions === undefined ? {} : { noExtensions: options.noExtensions }),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Run any native or extension-contributed action through the SDK dispatcher.
|
|
100
|
+
*/
|
|
101
|
+
run(action, args = {}) {
|
|
102
|
+
return runAction({ ...this.defaults, ...args, action });
|
|
103
|
+
}
|
|
104
|
+
runTyped(action, args = {}) {
|
|
105
|
+
return this.run(action, args);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Return the same context snapshot produced by `pm context`.
|
|
109
|
+
*/
|
|
110
|
+
context(options = {}) {
|
|
111
|
+
return this.runTyped("context", { options });
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* List items with the MCP/agent compact defaults.
|
|
115
|
+
*/
|
|
116
|
+
list(options = {}) {
|
|
117
|
+
return this.runTyped("list", { options });
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Search items with the MCP/agent compact defaults.
|
|
121
|
+
*/
|
|
122
|
+
search(query, options = {}) {
|
|
123
|
+
return this.runTyped("search", { query, options });
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Read one item by id.
|
|
127
|
+
*/
|
|
128
|
+
get(id, options = {}) {
|
|
129
|
+
return this.runTyped("get", { id, options });
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Return the ranked next-work recommendation produced by `pm next`.
|
|
133
|
+
*/
|
|
134
|
+
next(options = {}) {
|
|
135
|
+
return this.runTyped("next", { options });
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Group matching items with the same semantics as `pm aggregate`.
|
|
139
|
+
*/
|
|
140
|
+
aggregate(options = {}) {
|
|
141
|
+
return this.runTyped("aggregate", { options });
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Return project tracker statistics with the same sections as `pm stats`.
|
|
145
|
+
*/
|
|
146
|
+
stats(options = {}) {
|
|
147
|
+
return this.runTyped("stats", { options });
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Create an item using the same mutation path as `pm create`.
|
|
151
|
+
*/
|
|
152
|
+
create(options = {}) {
|
|
153
|
+
return this.run("create", splitClientMutationOptions(options));
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Update an item using the same mutation path as `pm update`.
|
|
157
|
+
*/
|
|
158
|
+
update(id, options = {}) {
|
|
159
|
+
return this.run("update", { id, ...splitClientMutationOptions(options) });
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Close an item using the same mutation path as `pm close`.
|
|
163
|
+
*/
|
|
164
|
+
close(id, reason, options = {}) {
|
|
165
|
+
return this.run("close", { id, reason, ...splitClientMutationOptions(options) });
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Claim an item using the same mutation path as `pm claim`.
|
|
169
|
+
*/
|
|
170
|
+
claim(id, options = {}) {
|
|
171
|
+
return this.run("claim", { id, ...splitClientMutationOptions(options) });
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Release an item's active claim using the same mutation path as `pm release`.
|
|
175
|
+
*/
|
|
176
|
+
release(id, options = {}) {
|
|
177
|
+
return this.run("release", { id, ...splitClientMutationOptions(options) });
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Copy an item using the same mutation path as `pm copy`.
|
|
181
|
+
*/
|
|
182
|
+
copy(id, options = {}) {
|
|
183
|
+
return this.run("copy", { id, ...splitClientMutationOptions(options) });
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Delete an item using the same mutation path as `pm delete`.
|
|
187
|
+
*/
|
|
188
|
+
delete(id, options = {}) {
|
|
189
|
+
return this.run("delete", { id, ...splitClientMutationOptions(options) });
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Restore an item to a history version or timestamp using `pm restore`.
|
|
193
|
+
*/
|
|
194
|
+
restore(id, target, options = {}) {
|
|
195
|
+
const { fullChangedFields, idOnly, ...runnerOptions } = options;
|
|
196
|
+
return this.run("restore", {
|
|
197
|
+
...(fullChangedFields === undefined ? {} : { fullChangedFields }),
|
|
198
|
+
...(idOnly === undefined ? {} : { idOnly }),
|
|
199
|
+
id,
|
|
200
|
+
options: { ...runnerOptions, target },
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Set, clear, or read workspace focus using the same path as `pm focus`.
|
|
205
|
+
*/
|
|
206
|
+
focus(id, options = {}) {
|
|
207
|
+
return this.run("focus", { ...(id === undefined ? {} : { id }), ...splitClientMutationOptions(options) });
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Claim an item and transition it to the workspace in-progress status.
|
|
211
|
+
*/
|
|
212
|
+
startTask(id, options = {}) {
|
|
213
|
+
return this.run("start-task", { id, ...splitClientMutationOptions(options) });
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Move an item back to the workspace open status and release the claim.
|
|
217
|
+
*/
|
|
218
|
+
pauseTask(id, options = {}) {
|
|
219
|
+
return this.run("pause-task", { id, ...splitClientMutationOptions(options) });
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Close an item and release its active assignment.
|
|
223
|
+
*/
|
|
224
|
+
closeTask(id, reason, options = {}) {
|
|
225
|
+
return this.run("close-task", { id, reason, ...splitClientMutationOptions(options) });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Return the same context snapshot produced by `pm context` without constructing
|
|
230
|
+
* a reusable client.
|
|
231
|
+
*/
|
|
232
|
+
export function context(options = {}, clientOptions = {}) {
|
|
233
|
+
return new PmClient(clientOptions).context(options);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* List items with the MCP/agent compact defaults without constructing a
|
|
237
|
+
* reusable client.
|
|
238
|
+
*/
|
|
239
|
+
export function list(options = {}, clientOptions = {}) {
|
|
240
|
+
return new PmClient(clientOptions).list(options);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Search items with the MCP/agent compact defaults without constructing a
|
|
244
|
+
* reusable client.
|
|
245
|
+
*/
|
|
246
|
+
export function search(query, options = {}, clientOptions = {}) {
|
|
247
|
+
return new PmClient(clientOptions).search(query, options);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Read one item by id without constructing a reusable client.
|
|
251
|
+
*/
|
|
252
|
+
export function get(id, options = {}, clientOptions = {}) {
|
|
253
|
+
return new PmClient(clientOptions).get(id, options);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Return the ranked next-work recommendation produced by `pm next` without
|
|
257
|
+
* constructing a reusable client.
|
|
258
|
+
*/
|
|
259
|
+
export function next(options = {}, clientOptions = {}) {
|
|
260
|
+
return new PmClient(clientOptions).next(options);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Group matching items with the same semantics as `pm aggregate` without
|
|
264
|
+
* constructing a reusable client.
|
|
265
|
+
*/
|
|
266
|
+
export function aggregate(options = {}, clientOptions = {}) {
|
|
267
|
+
return new PmClient(clientOptions).aggregate(options);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Return project tracker statistics with the same sections as `pm stats`
|
|
271
|
+
* without constructing a reusable client.
|
|
272
|
+
*/
|
|
273
|
+
export function stats(options = {}, clientOptions = {}) {
|
|
274
|
+
return new PmClient(clientOptions).stats(options);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Create an item without constructing a reusable client.
|
|
278
|
+
*/
|
|
279
|
+
export function create(options = {}, clientOptions = {}) {
|
|
280
|
+
return new PmClient(clientOptions).create(options);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Update an item without constructing a reusable client.
|
|
284
|
+
*/
|
|
285
|
+
export function update(id, options = {}, clientOptions = {}) {
|
|
286
|
+
return new PmClient(clientOptions).update(id, options);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Close an item without constructing a reusable client.
|
|
290
|
+
*/
|
|
291
|
+
export function close(id, reason, options = {}, clientOptions = {}) {
|
|
292
|
+
return new PmClient(clientOptions).close(id, reason, options);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Claim an item without constructing a reusable client.
|
|
296
|
+
*/
|
|
297
|
+
export function claim(id, options = {}, clientOptions = {}) {
|
|
298
|
+
return new PmClient(clientOptions).claim(id, options);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Release an item's active claim without constructing a reusable client.
|
|
302
|
+
*/
|
|
303
|
+
export function release(id, options = {}, clientOptions = {}) {
|
|
304
|
+
return new PmClient(clientOptions).release(id, options);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Copy an item without constructing a reusable client.
|
|
308
|
+
*/
|
|
309
|
+
export function copy(id, options = {}, clientOptions = {}) {
|
|
310
|
+
return new PmClient(clientOptions).copy(id, options);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Delete an item without constructing a reusable client.
|
|
314
|
+
*/
|
|
315
|
+
export function deleteItem(id, options = {}, clientOptions = {}) {
|
|
316
|
+
return new PmClient(clientOptions).delete(id, options);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Restore an item without constructing a reusable client.
|
|
320
|
+
*/
|
|
321
|
+
export function restore(id, target, options = {}, clientOptions = {}) {
|
|
322
|
+
return new PmClient(clientOptions).restore(id, target, options);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Set, clear, or read workspace focus without constructing a reusable client.
|
|
326
|
+
*/
|
|
327
|
+
export function focus(id, options = {}, clientOptions = {}) {
|
|
328
|
+
return new PmClient(clientOptions).focus(id, options);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Claim an item and transition it to in-progress without constructing a client.
|
|
332
|
+
*/
|
|
333
|
+
export function startTask(id, options = {}, clientOptions = {}) {
|
|
334
|
+
return new PmClient(clientOptions).startTask(id, options);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Move an item to open and release it without constructing a client.
|
|
338
|
+
*/
|
|
339
|
+
export function pauseTask(id, options = {}, clientOptions = {}) {
|
|
340
|
+
return new PmClient(clientOptions).pauseTask(id, options);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Close an item and release its active assignment without constructing a client.
|
|
344
|
+
*/
|
|
345
|
+
export function closeTask(id, reason, options = {}, clientOptions = {}) {
|
|
346
|
+
return new PmClient(clientOptions).closeTask(id, reason, options);
|
|
347
|
+
}
|
|
46
348
|
/**
|
|
47
349
|
* Process-lifetime memo of activated extension registrations, keyed by resolved
|
|
48
350
|
* pm root + cwd + extension settings. `getWorkspaceContracts` is frequently
|
|
@@ -57,8 +359,6 @@ export { CONFIDENCE_TEXT_VALUES, DEPENDENCY_KIND_VALUES, BUILTIN_ITEM_TYPE_VALUE
|
|
|
57
359
|
* toggling extensions or editing settings. Settings themselves are re-read on
|
|
58
360
|
* every call — only the extension load+activate step is memoized.
|
|
59
361
|
*/
|
|
60
|
-
const WORKSPACE_CONTRACTS_CACHE_LIMIT = 50;
|
|
61
|
-
const workspaceExtensionRegistrationsCache = new Map();
|
|
62
362
|
function buildWorkspaceExtensionRegistrationsCacheKey(pmRoot, settings, cwd) {
|
|
63
363
|
return JSON.stringify([
|
|
64
364
|
path.resolve(pmRoot),
|
|
@@ -68,27 +368,9 @@ function buildWorkspaceExtensionRegistrationsCacheKey(pmRoot, settings, cwd) {
|
|
|
68
368
|
settings.extensions.policy,
|
|
69
369
|
]);
|
|
70
370
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Drop all memoized workspace extension registrations so the next
|
|
73
|
-
* `getWorkspaceContracts` call re-loads and re-activates extensions from disk.
|
|
74
|
-
* Long-lived hosts should call this after any extension or settings mutation.
|
|
75
|
-
*/
|
|
76
|
-
export function clearWorkspaceContractsCache() {
|
|
77
|
-
workspaceExtensionRegistrationsCache.clear();
|
|
78
|
-
}
|
|
79
371
|
async function resolveWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
|
|
80
372
|
const cacheKey = buildWorkspaceExtensionRegistrationsCacheKey(pmRoot, settings, cwd);
|
|
81
|
-
|
|
82
|
-
if (cached !== undefined) {
|
|
83
|
-
return cached;
|
|
84
|
-
}
|
|
85
|
-
if (workspaceExtensionRegistrationsCache.size >= WORKSPACE_CONTRACTS_CACHE_LIMIT) {
|
|
86
|
-
const oldestKey = workspaceExtensionRegistrationsCache.keys().next().value;
|
|
87
|
-
workspaceExtensionRegistrationsCache.delete(oldestKey);
|
|
88
|
-
}
|
|
89
|
-
const registrations = loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd);
|
|
90
|
-
workspaceExtensionRegistrationsCache.set(cacheKey, registrations);
|
|
91
|
-
return registrations;
|
|
373
|
+
return memoizeWorkspaceExtensionRegistrations(cacheKey, () => loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd));
|
|
92
374
|
}
|
|
93
375
|
/**
|
|
94
376
|
* Implements get workspace contracts for the public runtime surface of this module.
|
|
@@ -124,6 +406,1079 @@ export async function getContracts(pmRootOrOptions, options = {}) {
|
|
|
124
406
|
};
|
|
125
407
|
return runContracts(resolvedOptions, global);
|
|
126
408
|
}
|
|
409
|
+
function readString(args, key) {
|
|
410
|
+
const value = args[key];
|
|
411
|
+
return typeof value === "string" && value.trim().length > 0 ? value : undefined;
|
|
412
|
+
}
|
|
413
|
+
function readScalarString(args, key) {
|
|
414
|
+
const value = args[key];
|
|
415
|
+
if (typeof value === "string") {
|
|
416
|
+
return value.trim().length > 0 ? value : undefined;
|
|
417
|
+
}
|
|
418
|
+
return typeof value === "number" && Number.isFinite(value) ? String(value) : undefined;
|
|
419
|
+
}
|
|
420
|
+
function readScalarStringAllowBlank(args, key) {
|
|
421
|
+
const value = args[key];
|
|
422
|
+
if (typeof value === "string") {
|
|
423
|
+
return value;
|
|
424
|
+
}
|
|
425
|
+
return typeof value === "number" && Number.isFinite(value) ? String(value) : undefined;
|
|
426
|
+
}
|
|
427
|
+
function isRecord(value) {
|
|
428
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Read a required non-empty string from an action argument bag.
|
|
432
|
+
*/
|
|
433
|
+
export function readRequiredString(args, key) {
|
|
434
|
+
const value = readString(args, key);
|
|
435
|
+
if (!value) {
|
|
436
|
+
throw new PmCliError(`Missing required argument: ${key}`, 64);
|
|
437
|
+
}
|
|
438
|
+
return value;
|
|
439
|
+
}
|
|
440
|
+
function globalOptions(args) {
|
|
441
|
+
return {
|
|
442
|
+
json: true,
|
|
443
|
+
quiet: true,
|
|
444
|
+
path: readString(args, "path"),
|
|
445
|
+
noExtensions: args.noExtensions === true || args.no_extensions === true,
|
|
446
|
+
noPager: true,
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
const ARRAY_TO_CSV_FIELDS = new Set(["tags", "blockedBy", "blocked_by", "skills", "fields"]);
|
|
450
|
+
const SCALAR_TO_ARRAY_FIELDS = new Set([
|
|
451
|
+
"comment",
|
|
452
|
+
"note",
|
|
453
|
+
"learning",
|
|
454
|
+
"reminder",
|
|
455
|
+
"event",
|
|
456
|
+
"dep",
|
|
457
|
+
"depRemove",
|
|
458
|
+
"dep_remove",
|
|
459
|
+
"file",
|
|
460
|
+
"doc",
|
|
461
|
+
"test",
|
|
462
|
+
"unset",
|
|
463
|
+
"addGlob",
|
|
464
|
+
"add_glob",
|
|
465
|
+
"migrate",
|
|
466
|
+
"envSet",
|
|
467
|
+
"env_set",
|
|
468
|
+
"envClear",
|
|
469
|
+
"env_clear",
|
|
470
|
+
]);
|
|
471
|
+
// Actions where the linked-resource fields `add` and `remove` are string[] arrays.
|
|
472
|
+
// For other actions (comments/notes/learnings) `add` and `remove` are scalar strings
|
|
473
|
+
// and must NOT be auto-promoted.
|
|
474
|
+
const ARRAY_ADD_REMOVE_ACTIONS = new Set([
|
|
475
|
+
"files",
|
|
476
|
+
"files-discover",
|
|
477
|
+
"docs",
|
|
478
|
+
"test",
|
|
479
|
+
"test-all",
|
|
480
|
+
]);
|
|
481
|
+
const LIFECYCLE_AUTHOR_ALIAS_ACTIONS = new Set([
|
|
482
|
+
"claim",
|
|
483
|
+
"release",
|
|
484
|
+
"start-task",
|
|
485
|
+
"pause-task",
|
|
486
|
+
"close-task",
|
|
487
|
+
]);
|
|
488
|
+
function normalizeMcpOptionsArrays(options, action) {
|
|
489
|
+
const result = {};
|
|
490
|
+
const promoteAddRemove = action !== undefined && ARRAY_ADD_REMOVE_ACTIONS.has(action);
|
|
491
|
+
for (const [key, value] of Object.entries(options)) {
|
|
492
|
+
if (Array.isArray(value) && ARRAY_TO_CSV_FIELDS.has(key)) {
|
|
493
|
+
result[key] = value.join(",");
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
if (typeof value === "string" && SCALAR_TO_ARRAY_FIELDS.has(key)) {
|
|
497
|
+
result[key] = [value];
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
if (typeof value === "string" && promoteAddRemove && (key === "add" || key === "remove")) {
|
|
501
|
+
result[key] = [value];
|
|
502
|
+
continue;
|
|
503
|
+
}
|
|
504
|
+
result[key] = value;
|
|
505
|
+
}
|
|
506
|
+
return result;
|
|
507
|
+
}
|
|
508
|
+
function optionsWithAuthor(args, action) {
|
|
509
|
+
const baseOptions = asRecordClone(args.options);
|
|
510
|
+
const hoistedTopLevel = {};
|
|
511
|
+
const hoistKey = (key) => {
|
|
512
|
+
if (baseOptions[key] !== undefined || args[key] === undefined) {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
hoistedTopLevel[key] = args[key];
|
|
516
|
+
};
|
|
517
|
+
if (action === "list") {
|
|
518
|
+
hoistKey("status");
|
|
519
|
+
hoistKey("type");
|
|
520
|
+
hoistKey("tag");
|
|
521
|
+
hoistKey("priority");
|
|
522
|
+
hoistKey("limit");
|
|
523
|
+
hoistKey("offset");
|
|
524
|
+
}
|
|
525
|
+
else if (action === "search") {
|
|
526
|
+
hoistKey("mode");
|
|
527
|
+
hoistKey("status");
|
|
528
|
+
hoistKey("type");
|
|
529
|
+
hoistKey("tag");
|
|
530
|
+
hoistKey("priority");
|
|
531
|
+
hoistKey("limit");
|
|
532
|
+
}
|
|
533
|
+
else if (action === "create") {
|
|
534
|
+
hoistKey("title");
|
|
535
|
+
hoistKey("type");
|
|
536
|
+
hoistKey("status");
|
|
537
|
+
hoistKey("description");
|
|
538
|
+
hoistKey("body");
|
|
539
|
+
hoistKey("priority");
|
|
540
|
+
hoistKey("tags");
|
|
541
|
+
hoistKey("parent");
|
|
542
|
+
hoistKey("createMode");
|
|
543
|
+
hoistKey("create_mode");
|
|
544
|
+
hoistKey("allowMissingParent");
|
|
545
|
+
}
|
|
546
|
+
else if (action === "close") {
|
|
547
|
+
hoistKey("duplicateOf");
|
|
548
|
+
}
|
|
549
|
+
else if (action === "append") {
|
|
550
|
+
// pm-7u9j: the narrow pm_append tool declares `body` top-level; runAppend
|
|
551
|
+
// reads it from options, so hoist unless options.body already wins.
|
|
552
|
+
// (pm_schema/pm_config top-level args are consumed directly by runAction's
|
|
553
|
+
// schema/config cases, which read args before options — no hoist needed.)
|
|
554
|
+
hoistKey("body");
|
|
555
|
+
}
|
|
556
|
+
const options = normalizeMcpOptionsArrays({ ...hoistedTopLevel, ...baseOptions }, action);
|
|
557
|
+
const author = readString(args, "author");
|
|
558
|
+
const authorFromAssignee = action !== undefined && LIFECYCLE_AUTHOR_ALIAS_ACTIONS.has(action) ? readString(args, "assignee") ?? readString(options, "assignee") : undefined;
|
|
559
|
+
if (author && options.author === undefined) {
|
|
560
|
+
return { ...options, author };
|
|
561
|
+
}
|
|
562
|
+
if (authorFromAssignee && options.author === undefined) {
|
|
563
|
+
return { ...options, author: authorFromAssignee };
|
|
564
|
+
}
|
|
565
|
+
return options;
|
|
566
|
+
}
|
|
567
|
+
// GH-170 (pm-pfnx): the narrow pm_files/pm_docs tools spell the CLI --note flag
|
|
568
|
+
// as `addNote` (the shared `note` parameter is the array-typed create/update
|
|
569
|
+
// note seed). Translate it onto the runner's `note` option; an explicit
|
|
570
|
+
// options.note (pm_run callers) wins.
|
|
571
|
+
function withAddNoteOption(options) {
|
|
572
|
+
if (options.addNote === undefined) {
|
|
573
|
+
return options;
|
|
574
|
+
}
|
|
575
|
+
const next = { ...options };
|
|
576
|
+
if (next.note === undefined && typeof next.addNote === "string") {
|
|
577
|
+
next.note = next.addNote;
|
|
578
|
+
}
|
|
579
|
+
delete next.addNote;
|
|
580
|
+
return next;
|
|
581
|
+
}
|
|
582
|
+
function withFilesDiscoveryOptions(options) {
|
|
583
|
+
const next = { ...options };
|
|
584
|
+
if (next.discoveryNote !== undefined && next.note === undefined && typeof next.discoveryNote === "string") {
|
|
585
|
+
next.note = next.discoveryNote;
|
|
586
|
+
}
|
|
587
|
+
delete next.discover;
|
|
588
|
+
delete next.discoveryNote;
|
|
589
|
+
return next;
|
|
590
|
+
}
|
|
591
|
+
function normalizeActionName(value) {
|
|
592
|
+
const chunks = [];
|
|
593
|
+
let lastWasSeparator = true;
|
|
594
|
+
for (const character of value.trim().toLowerCase()) {
|
|
595
|
+
const isAlphaNumeric = (character >= "a" && character <= "z") || (character >= "0" && character <= "9");
|
|
596
|
+
if (isAlphaNumeric) {
|
|
597
|
+
chunks.push(character);
|
|
598
|
+
lastWasSeparator = false;
|
|
599
|
+
continue;
|
|
600
|
+
}
|
|
601
|
+
if (!lastWasSeparator) {
|
|
602
|
+
chunks.push("-");
|
|
603
|
+
lastWasSeparator = true;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
if (chunks.at(-1) === "-") {
|
|
607
|
+
chunks.pop();
|
|
608
|
+
}
|
|
609
|
+
return chunks.join("");
|
|
610
|
+
}
|
|
611
|
+
function normalizeCommandPath(value) {
|
|
612
|
+
return value.trim().toLowerCase().split(/\s+/).filter(Boolean).join(" ");
|
|
613
|
+
}
|
|
614
|
+
function readStringArray(value) {
|
|
615
|
+
if (!Array.isArray(value)) {
|
|
616
|
+
return [];
|
|
617
|
+
}
|
|
618
|
+
return value.map((entry) => String(entry)).filter((entry) => entry.length > 0);
|
|
619
|
+
}
|
|
620
|
+
function extensionOptionsFromArgs(args, options) {
|
|
621
|
+
const reserved = new Set([
|
|
622
|
+
"action",
|
|
623
|
+
"args",
|
|
624
|
+
"author",
|
|
625
|
+
"cwd",
|
|
626
|
+
"fullChangedFields",
|
|
627
|
+
"id",
|
|
628
|
+
"options",
|
|
629
|
+
"path",
|
|
630
|
+
"query",
|
|
631
|
+
"reason",
|
|
632
|
+
"target",
|
|
633
|
+
]);
|
|
634
|
+
const passthrough = {};
|
|
635
|
+
for (const [key, value] of Object.entries(args)) {
|
|
636
|
+
if (!reserved.has(key)) {
|
|
637
|
+
passthrough[key] = value;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
const normalizedOptions = { ...passthrough, ...options };
|
|
641
|
+
delete normalizedOptions.args;
|
|
642
|
+
return normalizedOptions;
|
|
643
|
+
}
|
|
644
|
+
// pm-bl6m / pm-zumn: every native MCP action runs inside an activation cycle that
|
|
645
|
+
// mutates the process-global active extension registries (set globals -> run -> clear
|
|
646
|
+
// globals in a finally). The stdio transport already processes JSON-RPC lines
|
|
647
|
+
// sequentially, but handleRequest is a public entry point (tests, future concurrent
|
|
648
|
+
// transports) — if two requests ever ran concurrently, the newer one would overwrite
|
|
649
|
+
// the globals mid-flight and whichever finished first would clear them out from under
|
|
650
|
+
// the other (its lazily-read hooks/overrides would silently vanish). Serialize the
|
|
651
|
+
// whole activation cycle (load -> activate -> set -> run -> clear -> deactivate) on a
|
|
652
|
+
// dedicated FIFO queue so the critical section can never interleave. Full
|
|
653
|
+
// request-scoped registry plumbing remains possible later if true intra-server
|
|
654
|
+
// concurrency is ever needed.
|
|
655
|
+
const extensionActivationQueue = createSerialQueue();
|
|
656
|
+
/**
|
|
657
|
+
* Publishes empty active extension registries so built-in fallback actions cannot
|
|
658
|
+
* observe stale or partially published extension state from a failed activation cycle.
|
|
659
|
+
*/
|
|
660
|
+
function resetActiveExtensionRegistries() {
|
|
661
|
+
setActiveExtensionHooks(createEmptyExtensionHookRegistry());
|
|
662
|
+
setActiveExtensionCommands(createEmptyExtensionCommandRegistry());
|
|
663
|
+
setActiveExtensionParsers(createEmptyExtensionParserRegistry());
|
|
664
|
+
setActiveExtensionPreflight(createEmptyExtensionPreflightRegistry());
|
|
665
|
+
setActiveExtensionServices(createEmptyExtensionServiceRegistry());
|
|
666
|
+
setActiveExtensionRenderers(createEmptyExtensionRendererRegistry());
|
|
667
|
+
setActiveExtensionRegistrations(createEmptyExtensionRegistrationRegistry());
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Run `run` with workspace extensions loaded, activated, and published to the
|
|
671
|
+
* process-global active registries, then torn down afterwards. pm-zumn: built-in native
|
|
672
|
+
* actions (pm_list/pm_profile/pm_schema/pm_create/...) read
|
|
673
|
+
* `getActiveExtensionRegistrations()` for custom item types, fields, and profiles, so
|
|
674
|
+
* they must activate extensions exactly like the CLI (main.ts activates for every
|
|
675
|
+
* command). Previously only the dynamic-extension dispatch activated, leaving
|
|
676
|
+
* extension-contributed schema and profiles invisible over MCP for every built-in
|
|
677
|
+
* action. Activation is skipped (`run` receives `null`) when extensions are disabled or
|
|
678
|
+
* no workspace exists yet (for example `init`). EVERY action — activating or not — is
|
|
679
|
+
* serialized on {@link extensionActivationQueue} so a built-in action's reads of the
|
|
680
|
+
* process-global active registries can never interleave with another request's
|
|
681
|
+
* activation cycle; per-request isolation therefore holds even if a truly concurrent
|
|
682
|
+
* transport is added later (not just because the stdio transport is sequential today).
|
|
683
|
+
*/
|
|
684
|
+
async function withActiveExtensions(global, explicitCwd, resolutionCwd, run) {
|
|
685
|
+
// Run the whole cycle on the queue so registry mutations never interleave. Only an
|
|
686
|
+
// EXPLICIT cwd mutates process.cwd() — pinned inside this serialized slot so the chdir
|
|
687
|
+
// can't be clobbered mid-flight and the built-in handler resolves against it too. A
|
|
688
|
+
// request without an explicit cwd runs in the server's current directory and never
|
|
689
|
+
// touches process.cwd() (important so concurrent direct callers can't corrupt a shared
|
|
690
|
+
// cwd). Either way activation resolves against resolutionCwd, the entry-time snapshot,
|
|
691
|
+
// so it never depends on a deferred process.cwd() read.
|
|
692
|
+
return extensionActivationQueue.enqueue(async () => explicitCwd === undefined
|
|
693
|
+
? await withActiveExtensionsExclusively(global, resolutionCwd, run)
|
|
694
|
+
: await withCwd(explicitCwd, () => withActiveExtensionsExclusively(global, resolutionCwd, run)));
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Body of the activation cycle. Must only ever run under {@link extensionActivationQueue}
|
|
698
|
+
* (see {@link withActiveExtensions}): it is the exclusive owner of the process-global
|
|
699
|
+
* active extension registries while it runs. Returns early with `run(null)` — still
|
|
700
|
+
* inside the serialized critical section — when extensions are disabled or no workspace
|
|
701
|
+
* exists yet, so those built-in actions also observe a stable (empty) registry. MCP and
|
|
702
|
+
* PmClient callers reload + reactivate extensions per request, so each call is a fresh
|
|
703
|
+
* cycle with teardown in a finally to release resources opened during activate() (the
|
|
704
|
+
* long-running-server reload contract, pm-k1e4). Load/activate failures are swallowed and
|
|
705
|
+
* `run` is invoked with `null`, mirroring the CLI's resilient snapshot loader
|
|
706
|
+
* (loadRuntimeExtensionSnapshot) so a broken extension can never break a built-in action.
|
|
707
|
+
*/
|
|
708
|
+
async function withActiveExtensionsExclusively(global, cwd, run) {
|
|
709
|
+
if (global.noExtensions) {
|
|
710
|
+
resetActiveExtensionRegistries();
|
|
711
|
+
return run(null);
|
|
712
|
+
}
|
|
713
|
+
const pmRoot = resolvePmRoot(cwd, global.path);
|
|
714
|
+
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
715
|
+
resetActiveExtensionRegistries();
|
|
716
|
+
return run(null);
|
|
717
|
+
}
|
|
718
|
+
let active = null;
|
|
719
|
+
let activated;
|
|
720
|
+
try {
|
|
721
|
+
const settings = await readSettings(pmRoot);
|
|
722
|
+
const loadResult = await loadExtensions({ pmRoot, settings, cwd, noExtensions: false });
|
|
723
|
+
const activationResult = await activateExtensions({ ...loadResult, loaded: loadResult.loaded });
|
|
724
|
+
// Record the teardown handle BEFORE publishing the registries so a throw from any
|
|
725
|
+
// setActive* setter still runs deactivateExtensions for resources opened during
|
|
726
|
+
// activate() instead of silently leaking them.
|
|
727
|
+
activated = { loadResult, activationResult };
|
|
728
|
+
setActiveExtensionHooks(activationResult.hooks);
|
|
729
|
+
setActiveExtensionCommands(activationResult.commands);
|
|
730
|
+
setActiveExtensionParsers(activationResult.parsers);
|
|
731
|
+
setActiveExtensionPreflight(activationResult.preflight);
|
|
732
|
+
setActiveExtensionServices(activationResult.services);
|
|
733
|
+
setActiveExtensionRenderers(activationResult.renderers);
|
|
734
|
+
setActiveExtensionRegistrations(activationResult.registrations);
|
|
735
|
+
active = { registrations: activationResult.registrations, commands: activationResult.commands, pmRoot };
|
|
736
|
+
}
|
|
737
|
+
catch (error) {
|
|
738
|
+
resetActiveExtensionRegistries();
|
|
739
|
+
// CLI parity (loadRuntimeExtensionSnapshot): a load/activate failure must never
|
|
740
|
+
// break a built-in action — fall back to running with no active extensions. Surface
|
|
741
|
+
// the cause on stderr so a broken extension is diagnosable instead of being silently
|
|
742
|
+
// indistinguishable from a workspace that simply has no extensions.
|
|
743
|
+
console.error("[pm-sdk] extension activation failed; continuing without active extensions:", error);
|
|
744
|
+
}
|
|
745
|
+
try {
|
|
746
|
+
return await run(active);
|
|
747
|
+
}
|
|
748
|
+
finally {
|
|
749
|
+
// Reset the process-global active registries FIRST so a torn-down extension's
|
|
750
|
+
// overrides/hooks cannot leak into a later request in this long-running server
|
|
751
|
+
// (for example a subsequent pm_list/pm_create) even if teardown below misbehaves.
|
|
752
|
+
resetActiveExtensionRegistries();
|
|
753
|
+
// Best-effort teardown of extensions that activated successfully. Skipped when
|
|
754
|
+
// activation never completed (nothing was set up); guarded so an unexpected throw
|
|
755
|
+
// cannot escape the finally.
|
|
756
|
+
if (activated) {
|
|
757
|
+
await deactivateExtensions(activated.loadResult, activated.activationResult).catch(() => undefined);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Resolve `action` against the active extension command registrations and dispatch it.
|
|
763
|
+
* Reached by runAction's default case for dynamic (non-built-in) actions after
|
|
764
|
+
* {@link withActiveExtensions} has published the active registries. `active` is `null`
|
|
765
|
+
* when no extensions are active (disabled, no workspace, or activation failed), in
|
|
766
|
+
* which case no extension command can match and the action is reported unsupported.
|
|
767
|
+
*/
|
|
768
|
+
async function dispatchActiveExtensionAction(action, args, options, global, active) {
|
|
769
|
+
if (!active) {
|
|
770
|
+
throw new PmCliError(`Unsupported native pm action: ${action}`, 64);
|
|
771
|
+
}
|
|
772
|
+
const normalizedAction = normalizeActionName(action);
|
|
773
|
+
const definition = active.registrations.commands.find((entry) => normalizeActionName(entry.action) === normalizedAction);
|
|
774
|
+
const command = definition?.command ??
|
|
775
|
+
active.commands.handlers.find((entry) => normalizeActionName(entry.command) === normalizedAction)?.command;
|
|
776
|
+
if (!command) {
|
|
777
|
+
throw new PmCliError(`Unsupported native pm action: ${action}`, 64);
|
|
778
|
+
}
|
|
779
|
+
const handlerResult = await runActiveCommandHandler({
|
|
780
|
+
command: normalizeCommandPath(command),
|
|
781
|
+
args: readStringArray(options.args ?? args.args),
|
|
782
|
+
options: extensionOptionsFromArgs(args, options),
|
|
783
|
+
global,
|
|
784
|
+
pm_root: active.pmRoot,
|
|
785
|
+
});
|
|
786
|
+
if (!handlerResult.handled) {
|
|
787
|
+
const suffix = handlerResult.warnings.length > 0 ? ` (${handlerResult.warnings.join(", ")})` : "";
|
|
788
|
+
throw new PmCliError(`Unsupported native pm action: ${action}${suffix}`, 64);
|
|
789
|
+
}
|
|
790
|
+
return handlerResult.result;
|
|
791
|
+
}
|
|
792
|
+
async function withCwd(cwd, run) {
|
|
793
|
+
// Only ever called with an explicit, non-empty cwd (readString filters blanks), from
|
|
794
|
+
// inside the serialized activation queue, so the chdir/restore is exclusive per request
|
|
795
|
+
// and can never be clobbered by a concurrent caller.
|
|
796
|
+
const previous = process.cwd();
|
|
797
|
+
process.chdir(cwd);
|
|
798
|
+
try {
|
|
799
|
+
return await run();
|
|
800
|
+
}
|
|
801
|
+
finally {
|
|
802
|
+
process.chdir(previous);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Mutation tools (create/update/close/append/update-many) return a verbose
|
|
807
|
+
* `changed_fields` array. On the agent path we drop it to a `changed_field_count`
|
|
808
|
+
* by default for token efficiency, restoring the full array only when the caller
|
|
809
|
+
* explicitly passes the MCP-level fullChangedFields=true control. Mutation options
|
|
810
|
+
* are forwarded unchanged so runtime fields named `full` remain valid user data.
|
|
811
|
+
*/
|
|
812
|
+
function withMutationCompaction(args, options) {
|
|
813
|
+
return { changedFields: args.fullChangedFields === true ? "full" : "compact", idOnly: args.idOnly === true, runnerOptions: { ...options } };
|
|
814
|
+
}
|
|
815
|
+
function mutationListOptions(options) {
|
|
816
|
+
return {
|
|
817
|
+
type: readScalarString(options, "filterType"),
|
|
818
|
+
tag: readScalarString(options, "filterTag"),
|
|
819
|
+
priority: readScalarString(options, "filterPriority"),
|
|
820
|
+
deadlineBefore: readScalarString(options, "filterDeadlineBefore"),
|
|
821
|
+
deadlineAfter: readScalarString(options, "filterDeadlineAfter"),
|
|
822
|
+
updatedAfter: readScalarString(options, "filterUpdatedAfter"),
|
|
823
|
+
updatedBefore: readScalarString(options, "filterUpdatedBefore"),
|
|
824
|
+
createdAfter: readScalarString(options, "filterCreatedAfter"),
|
|
825
|
+
createdBefore: readScalarString(options, "filterCreatedBefore"),
|
|
826
|
+
ids: readScalarStringAllowBlank(options, "ids"),
|
|
827
|
+
assignee: readScalarString(options, "filterAssignee"),
|
|
828
|
+
assigneeFilter: readScalarString(options, "filterAssigneeFilter") ?? readScalarString(options, "filterAssignee_filter"),
|
|
829
|
+
parent: readScalarString(options, "filterParent"),
|
|
830
|
+
sprint: readScalarString(options, "filterSprint"),
|
|
831
|
+
release: readScalarString(options, "filterRelease"),
|
|
832
|
+
limit: readScalarString(options, "limit"),
|
|
833
|
+
offset: readScalarString(options, "offset"),
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
function closeManyOptionsFromFlat(options) {
|
|
837
|
+
return {
|
|
838
|
+
status: readString(options, "filterStatus"),
|
|
839
|
+
list: isRecord(options.list) ? normalizeListOptions(options.list) : mutationListOptions(options),
|
|
840
|
+
reason: readString(options, "reason"),
|
|
841
|
+
resolution: readString(options, "resolution"),
|
|
842
|
+
expectedResult: readString(options, "expectedResult") ?? readString(options, "expected_result") ?? readString(options, "expected"),
|
|
843
|
+
actualResult: readString(options, "actualResult") ?? readString(options, "actual_result") ?? readString(options, "actual"),
|
|
844
|
+
validateClose: readString(options, "validateClose") ?? readString(options, "validate_close"),
|
|
845
|
+
author: readString(options, "author"),
|
|
846
|
+
message: readString(options, "message"),
|
|
847
|
+
force: options.force === true ? true : undefined,
|
|
848
|
+
dryRun: options.dryRun === true || options.dry_run === true ? true : undefined,
|
|
849
|
+
rollback: readString(options, "rollback"),
|
|
850
|
+
checkpoint: options.checkpoint === false || options.noCheckpoint === true || options.no_checkpoint === true ? false : undefined,
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
const UPDATE_MANY_FLAT_CONTROL_KEYS = new Set([
|
|
854
|
+
"filterStatus",
|
|
855
|
+
"filterType",
|
|
856
|
+
"filterTag",
|
|
857
|
+
"filterPriority",
|
|
858
|
+
"filterDeadlineBefore",
|
|
859
|
+
"filterDeadlineAfter",
|
|
860
|
+
"filterUpdatedAfter",
|
|
861
|
+
"filterUpdatedBefore",
|
|
862
|
+
"filterCreatedAfter",
|
|
863
|
+
"filterCreatedBefore",
|
|
864
|
+
"filterAssignee",
|
|
865
|
+
"filterAssigneeFilter",
|
|
866
|
+
"filterAssignee_filter",
|
|
867
|
+
"filterParent",
|
|
868
|
+
"filterSprint",
|
|
869
|
+
"filterRelease",
|
|
870
|
+
"ids",
|
|
871
|
+
"list",
|
|
872
|
+
"update",
|
|
873
|
+
"limit",
|
|
874
|
+
"offset",
|
|
875
|
+
"dryRun",
|
|
876
|
+
"dry_run",
|
|
877
|
+
"rollback",
|
|
878
|
+
"checkpoint",
|
|
879
|
+
"noCheckpoint",
|
|
880
|
+
"no_checkpoint",
|
|
881
|
+
]);
|
|
882
|
+
function updateManyUpdateOptionsFromFlat(options) {
|
|
883
|
+
const update = {};
|
|
884
|
+
for (const [key, value] of Object.entries(options)) {
|
|
885
|
+
if (UPDATE_MANY_FLAT_CONTROL_KEYS.has(key)) {
|
|
886
|
+
continue;
|
|
887
|
+
}
|
|
888
|
+
update[key] = value;
|
|
889
|
+
}
|
|
890
|
+
return normalizeMcpUpdateOptions(update);
|
|
891
|
+
}
|
|
892
|
+
function normalizeMcpUpdateOptions(options) {
|
|
893
|
+
const normalizedInput = normalizeMcpOptionsArrays(options, "update-many");
|
|
894
|
+
for (const contract of UPDATE_COMMANDER_STRING_OPTION_CONTRACTS) {
|
|
895
|
+
for (const key of contract.keys) {
|
|
896
|
+
const value = normalizedInput[key];
|
|
897
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
898
|
+
normalizedInput[key] = String(value);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
return normalizeUpdateOptions(normalizedInput);
|
|
903
|
+
}
|
|
904
|
+
function updateManyOptionsFromFlat(options) {
|
|
905
|
+
if (isRecord(options.list) || isRecord(options.update)) {
|
|
906
|
+
const updateSource = isRecord(options.update) ? options.update : updateManyUpdateOptionsFromFlat(options);
|
|
907
|
+
return {
|
|
908
|
+
status: readScalarString(options, "filterStatus"),
|
|
909
|
+
list: isRecord(options.list) ? normalizeListOptions(options.list) : mutationListOptions(options),
|
|
910
|
+
update: normalizeMcpUpdateOptions(updateSource),
|
|
911
|
+
dryRun: options.dryRun === true || options.dry_run === true ? true : undefined,
|
|
912
|
+
rollback: readString(options, "rollback"),
|
|
913
|
+
checkpoint: options.checkpoint === false || options.noCheckpoint === true || options.no_checkpoint === true ? false : undefined,
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
return {
|
|
917
|
+
status: readScalarString(options, "filterStatus"),
|
|
918
|
+
list: mutationListOptions(options),
|
|
919
|
+
update: updateManyUpdateOptionsFromFlat(options),
|
|
920
|
+
dryRun: options.dryRun === true || options.dry_run === true ? true : undefined,
|
|
921
|
+
rollback: readString(options, "rollback"),
|
|
922
|
+
checkpoint: options.checkpoint === false || options.noCheckpoint === true || options.no_checkpoint === true ? false : undefined,
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
const WORKSPACE_CONTRACTS_CACHE_PRESERVING_ACTIONS = new Set([
|
|
926
|
+
"activity",
|
|
927
|
+
"aggregate",
|
|
928
|
+
"context",
|
|
929
|
+
"contracts",
|
|
930
|
+
"deps",
|
|
931
|
+
"files-discover",
|
|
932
|
+
"get",
|
|
933
|
+
"health",
|
|
934
|
+
"history",
|
|
935
|
+
"list",
|
|
936
|
+
"next",
|
|
937
|
+
"search",
|
|
938
|
+
"stats",
|
|
939
|
+
"telemetry",
|
|
940
|
+
"validate",
|
|
941
|
+
]);
|
|
942
|
+
const LIST_ACTION_ALIASES = {
|
|
943
|
+
"list-all": { action: "list", options: { excludeTerminal: false } },
|
|
944
|
+
"list-draft": { action: "list", options: { status: "draft", excludeTerminal: false } },
|
|
945
|
+
"list-open": { action: "list", options: { status: "open", excludeTerminal: false } },
|
|
946
|
+
"list-in-progress": { action: "list", options: { status: "in_progress", excludeTerminal: false } },
|
|
947
|
+
"list-blocked": { action: "list", options: { status: "blocked", excludeTerminal: false } },
|
|
948
|
+
"list-closed": { action: "list", options: { status: "closed", excludeTerminal: false } },
|
|
949
|
+
"list-canceled": { action: "list", options: { status: "canceled", excludeTerminal: false } },
|
|
950
|
+
};
|
|
951
|
+
const EXTENSION_ACTION_ALIASES = {
|
|
952
|
+
"extension-init": { action: "extension", options: { init: true } },
|
|
953
|
+
"extension-install": { action: "extension", options: { install: true } },
|
|
954
|
+
"extension-uninstall": { action: "extension", options: { uninstall: true } },
|
|
955
|
+
"extension-explore": { action: "extension", options: { explore: true } },
|
|
956
|
+
"extension-manage": { action: "extension", options: { manage: true } },
|
|
957
|
+
"extension-describe": { action: "extension", options: { describe: true } },
|
|
958
|
+
"extension-reload": { action: "extension", options: { reload: true } },
|
|
959
|
+
"extension-doctor": { action: "extension", options: { doctor: true } },
|
|
960
|
+
"extension-catalog": { action: "extension", options: { catalog: true } },
|
|
961
|
+
"extension-adopt": { action: "extension", options: { adopt: true } },
|
|
962
|
+
"extension-adopt-all": { action: "extension", options: { adoptAll: true } },
|
|
963
|
+
"extension-activate": { action: "extension", options: { activate: true } },
|
|
964
|
+
"extension-deactivate": { action: "extension", options: { deactivate: true } },
|
|
965
|
+
};
|
|
966
|
+
const PACKAGE_ACTION_ALIASES = {
|
|
967
|
+
"package-init": { action: "package", options: { init: true, vocabulary: "package" } },
|
|
968
|
+
"package-install": { action: "package", options: { install: true, vocabulary: "package" } },
|
|
969
|
+
"package-uninstall": { action: "package", options: { uninstall: true, vocabulary: "package" } },
|
|
970
|
+
"package-explore": { action: "package", options: { explore: true, vocabulary: "package" } },
|
|
971
|
+
"package-manage": { action: "package", options: { manage: true, vocabulary: "package" } },
|
|
972
|
+
"package-describe": { action: "package", options: { describe: true, vocabulary: "package" } },
|
|
973
|
+
"package-reload": { action: "package", options: { reload: true, vocabulary: "package" } },
|
|
974
|
+
"package-doctor": { action: "package", options: { doctor: true, vocabulary: "package" } },
|
|
975
|
+
"package-catalog": { action: "package", options: { catalog: true, vocabulary: "package" } },
|
|
976
|
+
"package-adopt": { action: "package", options: { adopt: true, vocabulary: "package" } },
|
|
977
|
+
"package-adopt-all": { action: "package", options: { adoptAll: true, vocabulary: "package" } },
|
|
978
|
+
"package-activate": { action: "package", options: { activate: true, vocabulary: "package" } },
|
|
979
|
+
"package-deactivate": { action: "package", options: { deactivate: true, vocabulary: "package" } },
|
|
980
|
+
};
|
|
981
|
+
const SDK_ACTION_ALIASES = {
|
|
982
|
+
ctx: { action: "context" },
|
|
983
|
+
...LIST_ACTION_ALIASES,
|
|
984
|
+
...EXTENSION_ACTION_ALIASES,
|
|
985
|
+
...PACKAGE_ACTION_ALIASES,
|
|
986
|
+
};
|
|
987
|
+
function resolveSdkActionInput(args) {
|
|
988
|
+
const rawAction = readRequiredString(args, "action");
|
|
989
|
+
const normalizedAction = normalizeActionName(rawAction);
|
|
990
|
+
const alias = getOwnHandler(SDK_ACTION_ALIASES, normalizedAction);
|
|
991
|
+
const action = alias?.action ?? normalizedAction;
|
|
992
|
+
const resolvedArgs = { ...args, action };
|
|
993
|
+
if (alias?.options !== undefined) {
|
|
994
|
+
resolvedArgs.options = { ...alias.options, ...asRecordClone(args.options) };
|
|
995
|
+
}
|
|
996
|
+
return { action, args: resolvedArgs };
|
|
997
|
+
}
|
|
998
|
+
function shouldInvalidateWorkspaceContractsCacheAfterAction(action) {
|
|
999
|
+
return !WORKSPACE_CONTRACTS_CACHE_PRESERVING_ACTIONS.has(normalizeActionName(action));
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Execute one native or extension-contributed pm action in-process.
|
|
1003
|
+
*/
|
|
1004
|
+
export async function runAction(args) {
|
|
1005
|
+
const resolved = resolveSdkActionInput(args);
|
|
1006
|
+
const global = globalOptions(resolved.args);
|
|
1007
|
+
const invalidateWorkspaceContractsCache = shouldInvalidateWorkspaceContractsCacheAfterAction(resolved.action);
|
|
1008
|
+
// pm-zumn: dispatch every action (built-in and dynamic) inside one extension
|
|
1009
|
+
// activation cycle so built-in actions see extension-contributed item types, fields,
|
|
1010
|
+
// and profiles, consistent with the CLI. Snapshot the effective resolution cwd HERE,
|
|
1011
|
+
// at request entry (the explicit args.cwd, else the server's current directory), so the
|
|
1012
|
+
// queued cycle resolves against the directory the request arrived in rather than a value
|
|
1013
|
+
// process.cwd() might hold by the time the task runs. Only an explicit cwd additionally
|
|
1014
|
+
// pins process.cwd() (inside the serialized slot) for the built-in handler.
|
|
1015
|
+
const explicitCwd = readString(resolved.args, "cwd");
|
|
1016
|
+
const resolutionCwd = explicitCwd ?? process.cwd();
|
|
1017
|
+
try {
|
|
1018
|
+
return await withActiveExtensions(global, explicitCwd, resolutionCwd, (activeExtensions) => dispatchAction(resolved.action, resolved.args, global, activeExtensions));
|
|
1019
|
+
}
|
|
1020
|
+
finally {
|
|
1021
|
+
if (invalidateWorkspaceContractsCache) {
|
|
1022
|
+
clearWorkspaceContractsCache();
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
function getOwnHandler(handlers, key) {
|
|
1027
|
+
return Object.prototype.hasOwnProperty.call(handlers, key) ? handlers[key] : undefined;
|
|
1028
|
+
}
|
|
1029
|
+
function readMcpTarget(ctx) {
|
|
1030
|
+
return readString(ctx.args, "target") ?? readString(ctx.options, "target");
|
|
1031
|
+
}
|
|
1032
|
+
function requireMcpItemId(ctx, source = ctx.options) {
|
|
1033
|
+
return ctx.id ?? readRequiredString(source, "id");
|
|
1034
|
+
}
|
|
1035
|
+
async function runMcpListAction(ctx) {
|
|
1036
|
+
const listOptions = { ...ctx.options };
|
|
1037
|
+
if (listOptions.compact === undefined &&
|
|
1038
|
+
listOptions.brief === undefined &&
|
|
1039
|
+
listOptions.fields === undefined &&
|
|
1040
|
+
listOptions.includeBody === undefined) {
|
|
1041
|
+
listOptions.compact = true;
|
|
1042
|
+
}
|
|
1043
|
+
// pm-rmjy: echo applied filters + projection mode so agents get structured confirmation.
|
|
1044
|
+
return withQuerySummary((await runList(readString(ctx.args, "status") ?? readString(listOptions, "status"), listOptions, ctx.global)), listOptions);
|
|
1045
|
+
}
|
|
1046
|
+
async function runMcpSearchAction(ctx) {
|
|
1047
|
+
const searchOptions = { ...ctx.options };
|
|
1048
|
+
if (searchOptions.compact === undefined && searchOptions.full === undefined && searchOptions.fields === undefined) {
|
|
1049
|
+
searchOptions.compact = true;
|
|
1050
|
+
}
|
|
1051
|
+
return withQuerySummary((await runSearch(readRequiredString(ctx.args, "query"), searchOptions, ctx.global)), searchOptions);
|
|
1052
|
+
}
|
|
1053
|
+
async function runMcpCreateAction(ctx) {
|
|
1054
|
+
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
1055
|
+
return projectMutationResult(await runCreate(runnerOptions, ctx.global), { changedFields, idOnly });
|
|
1056
|
+
}
|
|
1057
|
+
async function runMcpCopyAction(ctx) {
|
|
1058
|
+
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
1059
|
+
const copyOptions = {
|
|
1060
|
+
...runnerOptions,
|
|
1061
|
+
...(runnerOptions.title === undefined && typeof ctx.args.title === "string" ? { title: ctx.args.title } : {}),
|
|
1062
|
+
...(runnerOptions.message === undefined && typeof ctx.args.message === "string" ? { message: ctx.args.message } : {}),
|
|
1063
|
+
};
|
|
1064
|
+
return projectMutationResult(await runCopy(requireMcpItemId(ctx, copyOptions), copyOptions, ctx.global), {
|
|
1065
|
+
changedFields,
|
|
1066
|
+
idOnly,
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
async function runMcpUpdateAction(ctx) {
|
|
1070
|
+
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
1071
|
+
return projectMutationResult(await runUpdate(requireMcpItemId(ctx, runnerOptions), runnerOptions, ctx.global), {
|
|
1072
|
+
changedFields,
|
|
1073
|
+
idOnly,
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
async function runMcpCloseAction(ctx) {
|
|
1077
|
+
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
1078
|
+
const closeReason = readString(ctx.args, "reason") ??
|
|
1079
|
+
readString(ctx.args, "text") ??
|
|
1080
|
+
readString(runnerOptions, "reason") ??
|
|
1081
|
+
readString(runnerOptions, "text");
|
|
1082
|
+
return projectMutationResult(await runClose(requireMcpItemId(ctx, runnerOptions), closeReason, runnerOptions, ctx.global), { changedFields, idOnly });
|
|
1083
|
+
}
|
|
1084
|
+
function runMcpCommentsAction(ctx) {
|
|
1085
|
+
const commentOptions = { ...ctx.options };
|
|
1086
|
+
const isListing = commentOptions.add === undefined &&
|
|
1087
|
+
commentOptions.stdin === undefined &&
|
|
1088
|
+
commentOptions.file === undefined &&
|
|
1089
|
+
commentOptions.edit === undefined &&
|
|
1090
|
+
commentOptions.delete === undefined;
|
|
1091
|
+
if (isListing) {
|
|
1092
|
+
commentOptions.includeMeta = true;
|
|
1093
|
+
if (commentOptions.limit === undefined && commentOptions.full !== true) {
|
|
1094
|
+
commentOptions.limit = "20";
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
delete commentOptions.full;
|
|
1098
|
+
return runComments(requireMcpItemId(ctx), commentOptions, ctx.global);
|
|
1099
|
+
}
|
|
1100
|
+
function runMcpFilesAction(ctx) {
|
|
1101
|
+
const fileId = requireMcpItemId(ctx);
|
|
1102
|
+
return ctx.options.discover === true
|
|
1103
|
+
? runFilesDiscover(fileId, withFilesDiscoveryOptions(ctx.options), ctx.global)
|
|
1104
|
+
: runFiles(fileId, withAddNoteOption(ctx.options), ctx.global);
|
|
1105
|
+
}
|
|
1106
|
+
function runMcpTelemetryAction(ctx) {
|
|
1107
|
+
return runTelemetry({
|
|
1108
|
+
subcommand: readString(ctx.args, "subcommand") ?? readString(ctx.options, "subcommand"),
|
|
1109
|
+
limit: resolveMcpTelemetryLimit(ctx.args, ctx.options),
|
|
1110
|
+
}, ctx.global);
|
|
1111
|
+
}
|
|
1112
|
+
function resolveMcpTelemetryLimit(args, options) {
|
|
1113
|
+
if (typeof args.limit === "number" && Number.isFinite(args.limit)) {
|
|
1114
|
+
return args.limit;
|
|
1115
|
+
}
|
|
1116
|
+
if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
|
|
1117
|
+
return options.limit;
|
|
1118
|
+
}
|
|
1119
|
+
return readString(args, "limit") ?? readString(options, "limit");
|
|
1120
|
+
}
|
|
1121
|
+
function runMcpHealthAction(ctx) {
|
|
1122
|
+
const healthOptions = { ...ctx.options };
|
|
1123
|
+
if (healthOptions.brief === undefined && healthOptions.summary === undefined && healthOptions.full === undefined) {
|
|
1124
|
+
healthOptions.summary = true;
|
|
1125
|
+
}
|
|
1126
|
+
return runHealth(ctx.global, healthOptions);
|
|
1127
|
+
}
|
|
1128
|
+
function runMcpConfigAction(ctx) {
|
|
1129
|
+
const configAction = readString(ctx.args, "configAction") ?? readString(ctx.options, "configAction") ?? readString(ctx.options, "action");
|
|
1130
|
+
if (configAction === undefined) {
|
|
1131
|
+
throw new PmCliError("Missing required argument: configAction", 64);
|
|
1132
|
+
}
|
|
1133
|
+
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"));
|
|
1134
|
+
}
|
|
1135
|
+
function runMcpActivityAction(ctx) {
|
|
1136
|
+
const activityOptions = { ...ctx.options };
|
|
1137
|
+
if (activityOptions.compact === undefined) {
|
|
1138
|
+
activityOptions.compact = activityOptions.full === true ? false : true;
|
|
1139
|
+
}
|
|
1140
|
+
delete activityOptions.full;
|
|
1141
|
+
return runActivity(activityOptions, ctx.global);
|
|
1142
|
+
}
|
|
1143
|
+
function runMcpHistoryRepairAction(ctx) {
|
|
1144
|
+
const repairAll = ctx.options.all === true;
|
|
1145
|
+
const repairId = ctx.id ?? readString(ctx.options, "id");
|
|
1146
|
+
assertHistoryRepairTarget(repairId, repairAll);
|
|
1147
|
+
return repairAll ? runHistoryRepairAll(ctx.options, ctx.global) : runHistoryRepair(repairId, ctx.options, ctx.global);
|
|
1148
|
+
}
|
|
1149
|
+
function parseMcpInteger(value, label) {
|
|
1150
|
+
if (typeof value === "number") {
|
|
1151
|
+
if (!Number.isInteger(value)) {
|
|
1152
|
+
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
1153
|
+
}
|
|
1154
|
+
return value;
|
|
1155
|
+
}
|
|
1156
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
1157
|
+
const parsed = Number(value);
|
|
1158
|
+
if (!Number.isInteger(parsed)) {
|
|
1159
|
+
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
1160
|
+
}
|
|
1161
|
+
return parsed;
|
|
1162
|
+
}
|
|
1163
|
+
return undefined;
|
|
1164
|
+
}
|
|
1165
|
+
function parseMcpIntegerPrefix(value, label) {
|
|
1166
|
+
if (typeof value === "number") {
|
|
1167
|
+
if (!Number.isFinite(value) || !Number.isInteger(value)) {
|
|
1168
|
+
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
1169
|
+
}
|
|
1170
|
+
return value;
|
|
1171
|
+
}
|
|
1172
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
1173
|
+
const trimmed = value.trim();
|
|
1174
|
+
if (!/^[+-]?\d+(?:st|nd|rd|th)?$/i.test(trimmed)) {
|
|
1175
|
+
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
1176
|
+
}
|
|
1177
|
+
const parsed = Number.parseInt(trimmed, 10);
|
|
1178
|
+
if (!Number.isInteger(parsed)) {
|
|
1179
|
+
throw new PmCliError(`${label} must be a finite integer.`, 64);
|
|
1180
|
+
}
|
|
1181
|
+
return parsed;
|
|
1182
|
+
}
|
|
1183
|
+
return undefined;
|
|
1184
|
+
}
|
|
1185
|
+
function runMcpPlanAction(ctx) {
|
|
1186
|
+
const subcommand = readString(ctx.args, "subcommand") ?? readRequiredString(ctx.options, "subcommand");
|
|
1187
|
+
const planRecord = ctx.options;
|
|
1188
|
+
return runPlan({
|
|
1189
|
+
subcommand: subcommand,
|
|
1190
|
+
id: typeof ctx.id === "string" ? ctx.id : typeof planRecord.id === "string" ? planRecord.id : undefined,
|
|
1191
|
+
stepRef: readMcpPlanStepRef(ctx),
|
|
1192
|
+
reorderTo: parseMcpIntegerPrefix(planRecord.reorderTo ?? ctx.args.reorderTo, "plan reorderTo"),
|
|
1193
|
+
options: ctx.options,
|
|
1194
|
+
global: ctx.global,
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
function readMcpPlanStepRef(ctx) {
|
|
1198
|
+
return typeof ctx.options.stepRef === "string"
|
|
1199
|
+
? ctx.options.stepRef
|
|
1200
|
+
: typeof ctx.args.stepRef === "string"
|
|
1201
|
+
? ctx.args.stepRef
|
|
1202
|
+
: undefined;
|
|
1203
|
+
}
|
|
1204
|
+
function createMcpSchemaContext(ctx) {
|
|
1205
|
+
const subcommand = readString(ctx.args, "subcommand") ?? readRequiredString(ctx.options, "subcommand");
|
|
1206
|
+
const aliasSource = ctx.args.alias ?? ctx.options.alias;
|
|
1207
|
+
return {
|
|
1208
|
+
ctx,
|
|
1209
|
+
subcommand: subcommand.trim().toLowerCase(),
|
|
1210
|
+
name: readString(ctx.args, "name") ?? readString(ctx.options, "name"),
|
|
1211
|
+
author: readString(ctx.args, "author") ?? readString(ctx.options, "author"),
|
|
1212
|
+
force: ctx.args.force === true || ctx.options.force === true,
|
|
1213
|
+
aliases: aliasSource === undefined ? undefined : readStringArray(aliasSource),
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
function runMcpSchemaReadOrRemoveAction(schema) {
|
|
1217
|
+
const { ctx, subcommand, name, author, force } = schema;
|
|
1218
|
+
const simpleHandlers = {
|
|
1219
|
+
list: () => runSchemaList(ctx.global),
|
|
1220
|
+
show: () => runSchemaShow(name, ctx.global),
|
|
1221
|
+
"show-status": () => runSchemaShowStatus(name, ctx.global),
|
|
1222
|
+
"list-fields": () => runSchemaListFields(ctx.global),
|
|
1223
|
+
"show-field": () => runSchemaShowField(name, ctx.global),
|
|
1224
|
+
"remove-type": () => runSchemaRemoveType(name, { author, force }, ctx.global),
|
|
1225
|
+
"remove-field": () => runSchemaRemoveField(name, { author, force }, ctx.global),
|
|
1226
|
+
"remove-status": () => runSchemaRemoveStatus(name, { author, force }, ctx.global),
|
|
1227
|
+
"apply-preset": () => runSchemaApplyPreset(readString(ctx.args, "typePreset") ?? readString(ctx.options, "typePreset"), { author, force }, ctx.global),
|
|
1228
|
+
};
|
|
1229
|
+
const handler = getOwnHandler(simpleHandlers, subcommand);
|
|
1230
|
+
return handler ? handler() : null;
|
|
1231
|
+
}
|
|
1232
|
+
function runMcpSchemaAddFieldAction(schema) {
|
|
1233
|
+
const { ctx, name, author, force, aliases } = schema;
|
|
1234
|
+
const commandsSource = ctx.args.commands ?? ctx.options.commands;
|
|
1235
|
+
const requiredTypesSource = ctx.args.requiredTypes ?? ctx.options.requiredTypes;
|
|
1236
|
+
return runSchemaAddField(name, {
|
|
1237
|
+
type: readString(ctx.args, "fieldType") ?? readString(ctx.options, "fieldType"),
|
|
1238
|
+
commands: commandsSource === undefined ? undefined : readStringArray(commandsSource),
|
|
1239
|
+
description: readString(ctx.args, "description") ?? readString(ctx.options, "description"),
|
|
1240
|
+
cliFlag: readString(ctx.args, "cliFlag") ?? readString(ctx.options, "cliFlag"),
|
|
1241
|
+
alias: aliases,
|
|
1242
|
+
required: ctx.args.required === true || ctx.options.required === true,
|
|
1243
|
+
requiredOnCreate: ctx.args.requiredOnCreate === true || ctx.options.requiredOnCreate === true,
|
|
1244
|
+
allowUnset: !(ctx.args.allowUnset === false || ctx.options.allowUnset === false),
|
|
1245
|
+
requiredTypes: requiredTypesSource === undefined ? undefined : readStringArray(requiredTypesSource),
|
|
1246
|
+
author,
|
|
1247
|
+
force,
|
|
1248
|
+
}, ctx.global);
|
|
1249
|
+
}
|
|
1250
|
+
function runMcpSchemaAddStatusAction(schema) {
|
|
1251
|
+
const { ctx, name, author, force, aliases } = schema;
|
|
1252
|
+
const roleSource = ctx.args.role ?? ctx.options.role;
|
|
1253
|
+
return runSchemaAddStatus(name, {
|
|
1254
|
+
role: roleSource === undefined ? undefined : readStringArray(roleSource),
|
|
1255
|
+
alias: aliases,
|
|
1256
|
+
description: readString(ctx.args, "description") ?? readString(ctx.options, "description"),
|
|
1257
|
+
order: parseMcpInteger(ctx.args.order ?? ctx.options.order, "schema add-status order"),
|
|
1258
|
+
author,
|
|
1259
|
+
force,
|
|
1260
|
+
}, ctx.global);
|
|
1261
|
+
}
|
|
1262
|
+
function runMcpSchemaAddTypeAction(schema) {
|
|
1263
|
+
const { ctx, name, author, force, aliases } = schema;
|
|
1264
|
+
return runSchemaAddType(name, {
|
|
1265
|
+
description: readString(ctx.args, "description") ?? readString(ctx.options, "description"),
|
|
1266
|
+
defaultStatus: readString(ctx.args, "defaultStatus") ??
|
|
1267
|
+
readString(ctx.args, "default_status") ??
|
|
1268
|
+
readString(ctx.options, "defaultStatus") ??
|
|
1269
|
+
readString(ctx.options, "default_status"),
|
|
1270
|
+
folder: readString(ctx.args, "folder") ?? readString(ctx.options, "folder"),
|
|
1271
|
+
alias: aliases,
|
|
1272
|
+
author,
|
|
1273
|
+
force,
|
|
1274
|
+
}, ctx.global);
|
|
1275
|
+
}
|
|
1276
|
+
function runMcpSchemaAction(ctx) {
|
|
1277
|
+
const schema = createMcpSchemaContext(ctx);
|
|
1278
|
+
const simpleResult = runMcpSchemaReadOrRemoveAction(schema);
|
|
1279
|
+
if (simpleResult !== null) {
|
|
1280
|
+
return simpleResult;
|
|
1281
|
+
}
|
|
1282
|
+
if (schema.subcommand === "add-field") {
|
|
1283
|
+
return runMcpSchemaAddFieldAction(schema);
|
|
1284
|
+
}
|
|
1285
|
+
if (schema.subcommand === "add-status") {
|
|
1286
|
+
return runMcpSchemaAddStatusAction(schema);
|
|
1287
|
+
}
|
|
1288
|
+
if (schema.subcommand === "add-type") {
|
|
1289
|
+
if (ctx.args.infer === true || ctx.options.infer === true) {
|
|
1290
|
+
return runSchemaInferTypes({
|
|
1291
|
+
minCount: parseMcpInteger(ctx.args.minCount ?? ctx.options.minCount, "schema infer minCount"),
|
|
1292
|
+
apply: ctx.args.apply === true || ctx.options.apply === true,
|
|
1293
|
+
author: schema.author,
|
|
1294
|
+
force: schema.force,
|
|
1295
|
+
}, ctx.global);
|
|
1296
|
+
}
|
|
1297
|
+
return runMcpSchemaAddTypeAction(schema);
|
|
1298
|
+
}
|
|
1299
|
+
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);
|
|
1300
|
+
}
|
|
1301
|
+
function runMcpProfileAction(ctx) {
|
|
1302
|
+
const subcommand = readString(ctx.args, "subcommand") ?? readRequiredString(ctx.options, "subcommand");
|
|
1303
|
+
const normalizedSubcommand = subcommand.trim().toLowerCase();
|
|
1304
|
+
const profileName = readString(ctx.args, "name") ?? readString(ctx.options, "name");
|
|
1305
|
+
const handlers = {
|
|
1306
|
+
list: () => runProfileList(),
|
|
1307
|
+
show: () => runProfileShow(profileName),
|
|
1308
|
+
lint: () => runProfileLint(profileName),
|
|
1309
|
+
apply: () => runProfileApply(profileName, {
|
|
1310
|
+
dryRun: ctx.args.dryRun === true || ctx.options.dryRun === true,
|
|
1311
|
+
author: readString(ctx.args, "author") ?? readString(ctx.options, "author"),
|
|
1312
|
+
force: ctx.args.force === true || ctx.options.force === true,
|
|
1313
|
+
}, ctx.global),
|
|
1314
|
+
};
|
|
1315
|
+
const handler = getOwnHandler(handlers, normalizedSubcommand);
|
|
1316
|
+
if (!handler) {
|
|
1317
|
+
throw new PmCliError(`Unknown pm profile subcommand "${subcommand}". Allowed: list, show, apply, lint`, 64);
|
|
1318
|
+
}
|
|
1319
|
+
return handler();
|
|
1320
|
+
}
|
|
1321
|
+
function runMcpStatsAction(ctx) {
|
|
1322
|
+
return runStats(ctx.global, {
|
|
1323
|
+
storage: ctx.options.storage === true,
|
|
1324
|
+
metadataCoverage: ctx.options.metadataCoverage === true,
|
|
1325
|
+
fieldUtilization: ctx.options.fieldUtilization === true,
|
|
1326
|
+
byAssignee: ctx.options.byAssignee === true,
|
|
1327
|
+
byTag: ctx.options.byTag === true,
|
|
1328
|
+
byPriority: ctx.options.byPriority === true,
|
|
1329
|
+
tagPrefix: typeof ctx.options.tagPrefix === "string" ? ctx.options.tagPrefix : undefined,
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
async function runMcpAppendAction(ctx) {
|
|
1333
|
+
const { changedFields, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
1334
|
+
return projectMutationResult(await runAppend(requireMcpItemId(ctx, runnerOptions), runnerOptions, ctx.global), {
|
|
1335
|
+
changedFields,
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
async function runMcpUpdateManyAction(ctx) {
|
|
1339
|
+
const { changedFields, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
1340
|
+
return projectMutationResult(await runUpdateMany(updateManyOptionsFromFlat(runnerOptions), ctx.global), { changedFields });
|
|
1341
|
+
}
|
|
1342
|
+
async function runMcpCloseManyAction(ctx) {
|
|
1343
|
+
const { changedFields, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
1344
|
+
const topLevelReason = readString(ctx.args, "reason");
|
|
1345
|
+
const closeManyRunnerOptions = topLevelReason !== undefined && runnerOptions.reason === undefined
|
|
1346
|
+
? { ...runnerOptions, reason: topLevelReason }
|
|
1347
|
+
: { ...runnerOptions };
|
|
1348
|
+
if (ctx.force && closeManyRunnerOptions.force === undefined) {
|
|
1349
|
+
closeManyRunnerOptions.force = true;
|
|
1350
|
+
}
|
|
1351
|
+
return projectMutationResult(await runCloseMany(closeManyOptionsFromFlat(closeManyRunnerOptions), ctx.global), { changedFields });
|
|
1352
|
+
}
|
|
1353
|
+
async function runMcpRestoreAction(ctx) {
|
|
1354
|
+
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
|
|
1355
|
+
const target = readString(runnerOptions, "target") ?? readRequiredString(ctx.args, "target");
|
|
1356
|
+
return projectMutationResult(await runRestore(requireMcpItemId(ctx, runnerOptions), target, runnerOptions, ctx.global), {
|
|
1357
|
+
changedFields,
|
|
1358
|
+
idOnly,
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
function withoutLifecycleAssigneeAlias(options) {
|
|
1362
|
+
const updateOptions = { ...options };
|
|
1363
|
+
delete updateOptions.assignee;
|
|
1364
|
+
return updateOptions;
|
|
1365
|
+
}
|
|
1366
|
+
async function runMcpStartTaskAction(ctx) {
|
|
1367
|
+
const pmRoot = resolvePmRoot(process.cwd(), ctx.global.path);
|
|
1368
|
+
const settings = await readSettings(pmRoot);
|
|
1369
|
+
const inProgressStatus = resolveStartTaskInProgressStatus(resolveRuntimeStatusRegistry(settings.schema));
|
|
1370
|
+
const id = requireMcpItemId(ctx);
|
|
1371
|
+
const claimResult = await runClaim(id, ctx.force, ctx.global, ctx.options);
|
|
1372
|
+
const updateResult = await runUpdate(id, { ...withoutLifecycleAssigneeAlias(ctx.options), status: inProgressStatus, force: ctx.force }, ctx.global);
|
|
1373
|
+
return { id, action: "start_task", claim: claimResult, update: updateResult };
|
|
1374
|
+
}
|
|
1375
|
+
async function runMcpPauseTaskAction(ctx) {
|
|
1376
|
+
const pmRoot = resolvePmRoot(process.cwd(), ctx.global.path);
|
|
1377
|
+
const settings = await readSettings(pmRoot);
|
|
1378
|
+
const id = requireMcpItemId(ctx);
|
|
1379
|
+
const openStatus = resolveRuntimeStatusRegistry(settings.schema).open_status;
|
|
1380
|
+
const updateResult = await runUpdate(id, { ...withoutLifecycleAssigneeAlias(ctx.options), status: openStatus, force: ctx.force }, ctx.global);
|
|
1381
|
+
const releaseResult = await runRelease(id, ctx.force, ctx.global, ctx.options);
|
|
1382
|
+
return { id, action: "pause_task", update: updateResult, release: releaseResult };
|
|
1383
|
+
}
|
|
1384
|
+
async function runMcpCloseTaskAction(ctx) {
|
|
1385
|
+
const id = requireMcpItemId(ctx);
|
|
1386
|
+
const closeReason = readString(ctx.args, "reason") ??
|
|
1387
|
+
readString(ctx.args, "text") ??
|
|
1388
|
+
readString(ctx.options, "reason") ??
|
|
1389
|
+
readString(ctx.options, "text");
|
|
1390
|
+
const closeResult = await runClose(id, closeReason, { ...ctx.options, force: ctx.force }, ctx.global);
|
|
1391
|
+
const releaseResult = await runRelease(id, ctx.force, ctx.global, ctx.options);
|
|
1392
|
+
return { id, action: "close_task", close: closeResult, release: releaseResult };
|
|
1393
|
+
}
|
|
1394
|
+
const SDK_ACTION_HANDLERS = {
|
|
1395
|
+
init: (ctx) => runInit(readString(ctx.args, "prefix"), ctx.global, ctx.options),
|
|
1396
|
+
context: (ctx) => runContext(ctx.options, ctx.global),
|
|
1397
|
+
next: (ctx) => runNext(ctx.options, ctx.global),
|
|
1398
|
+
list: runMcpListAction,
|
|
1399
|
+
get: (ctx) => runGet(requireMcpItemId(ctx), ctx.global, ctx.options),
|
|
1400
|
+
search: runMcpSearchAction,
|
|
1401
|
+
create: runMcpCreateAction,
|
|
1402
|
+
copy: runMcpCopyAction,
|
|
1403
|
+
focus: (ctx) => runFocus(ctx.id, { clear: ctx.options.clear === true || ctx.args.clear === true }, ctx.global),
|
|
1404
|
+
update: runMcpUpdateAction,
|
|
1405
|
+
restore: runMcpRestoreAction,
|
|
1406
|
+
claim: (ctx) => runClaim(requireMcpItemId(ctx), ctx.force, ctx.global, ctx.options),
|
|
1407
|
+
release: (ctx) => runRelease(requireMcpItemId(ctx), ctx.force, ctx.global, ctx.options),
|
|
1408
|
+
"start-task": runMcpStartTaskAction,
|
|
1409
|
+
"pause-task": runMcpPauseTaskAction,
|
|
1410
|
+
"close-task": runMcpCloseTaskAction,
|
|
1411
|
+
close: runMcpCloseAction,
|
|
1412
|
+
comments: runMcpCommentsAction,
|
|
1413
|
+
notes: (ctx) => runNotes(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1414
|
+
learnings: (ctx) => runLearnings(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1415
|
+
files: runMcpFilesAction,
|
|
1416
|
+
docs: (ctx) => runDocs(requireMcpItemId(ctx), withAddNoteOption(ctx.options), ctx.global),
|
|
1417
|
+
test: (ctx) => runTest(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1418
|
+
"test-all": (ctx) => runTestAll(ctx.options, ctx.global),
|
|
1419
|
+
telemetry: runMcpTelemetryAction,
|
|
1420
|
+
validate: (ctx) => runValidate(ctx.options, ctx.global),
|
|
1421
|
+
health: runMcpHealthAction,
|
|
1422
|
+
contracts: (ctx) => runContracts(ctx.options, ctx.global),
|
|
1423
|
+
config: runMcpConfigAction,
|
|
1424
|
+
activity: runMcpActivityAction,
|
|
1425
|
+
aggregate: (ctx) => runAggregate(ctx.options, ctx.global),
|
|
1426
|
+
extension: (ctx) => runExtension(readMcpTarget(ctx), ctx.options, ctx.global),
|
|
1427
|
+
package: (ctx) => runExtension(readMcpTarget(ctx), ctx.options, ctx.global),
|
|
1428
|
+
install: (ctx) => runExtension(readMcpTarget(ctx), { ...ctx.options, install: true }, ctx.global),
|
|
1429
|
+
upgrade: (ctx) => runUpgrade(readMcpTarget(ctx), ctx.options, ctx.global),
|
|
1430
|
+
delete: (ctx) => runDelete(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1431
|
+
deps: (ctx) => runDeps(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1432
|
+
"files-discover": (ctx) => runFilesDiscover(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1433
|
+
history: (ctx) => runHistory(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1434
|
+
"history-redact": (ctx) => runHistoryRedact(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1435
|
+
"history-repair": runMcpHistoryRepairAction,
|
|
1436
|
+
"history-compact": (ctx) => runHistoryCompact(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1437
|
+
plan: runMcpPlanAction,
|
|
1438
|
+
schema: runMcpSchemaAction,
|
|
1439
|
+
profile: runMcpProfileAction,
|
|
1440
|
+
stats: runMcpStatsAction,
|
|
1441
|
+
append: runMcpAppendAction,
|
|
1442
|
+
"update-many": runMcpUpdateManyAction,
|
|
1443
|
+
"close-many": runMcpCloseManyAction,
|
|
1444
|
+
gc: (ctx) => runGc(ctx.global, ctx.options),
|
|
1445
|
+
};
|
|
1446
|
+
async function dispatchAction(action, args, global, activeExtensions) {
|
|
1447
|
+
const options = optionsWithAuthor(args, action);
|
|
1448
|
+
const ctx = {
|
|
1449
|
+
action,
|
|
1450
|
+
args,
|
|
1451
|
+
options,
|
|
1452
|
+
id: readString(args, "id"),
|
|
1453
|
+
force: args.force === true || options.force === true,
|
|
1454
|
+
global,
|
|
1455
|
+
activeExtensions,
|
|
1456
|
+
};
|
|
1457
|
+
const handler = getOwnHandler(SDK_ACTION_HANDLERS, action);
|
|
1458
|
+
return handler ? handler(ctx) : dispatchActiveExtensionAction(action, args, options, global, activeExtensions);
|
|
1459
|
+
}
|
|
1460
|
+
const actionRunnerTestHooks = {
|
|
1461
|
+
closeManyOptionsFromFlat,
|
|
1462
|
+
extensionOptionsFromArgs,
|
|
1463
|
+
globalOptions,
|
|
1464
|
+
mutationListOptions,
|
|
1465
|
+
normalizeActionName,
|
|
1466
|
+
normalizeCommandPath,
|
|
1467
|
+
normalizeMcpUpdateOptions,
|
|
1468
|
+
normalizeMcpOptionsArrays,
|
|
1469
|
+
optionsWithAuthor,
|
|
1470
|
+
readRequiredString,
|
|
1471
|
+
readScalarString,
|
|
1472
|
+
readScalarStringAllowBlank,
|
|
1473
|
+
readStringArray,
|
|
1474
|
+
updateManyOptionsFromFlat,
|
|
1475
|
+
withAddNoteOption,
|
|
1476
|
+
withFilesDiscoveryOptions,
|
|
1477
|
+
withMutationCompaction,
|
|
1478
|
+
};
|
|
1479
|
+
if (process.env.NODE_ENV === "test" || process.env.VITEST !== undefined || process.env.VITEST_WORKER_ID !== undefined) {
|
|
1480
|
+
globalThis.__pmCliActionRunnerTestHooks = actionRunnerTestHooks;
|
|
1481
|
+
}
|
|
127
1482
|
async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
|
|
128
1483
|
const loadResult = await loadExtensions({
|
|
129
1484
|
pmRoot,
|
|
@@ -132,7 +1487,17 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
|
|
|
132
1487
|
noExtensions: false,
|
|
133
1488
|
});
|
|
134
1489
|
const activationResult = await activateExtensions(loadResult);
|
|
135
|
-
|
|
1490
|
+
try {
|
|
1491
|
+
return activationResult.registrations;
|
|
1492
|
+
}
|
|
1493
|
+
finally {
|
|
1494
|
+
try {
|
|
1495
|
+
await deactivateExtensions(loadResult, activationResult);
|
|
1496
|
+
}
|
|
1497
|
+
catch {
|
|
1498
|
+
// Workspace contract reads should stay best-effort even if teardown itself fails.
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
136
1501
|
}
|
|
137
1502
|
//# sourceMappingURL=runtime.js.map
|
|
138
|
-
//# debugId=
|
|
1503
|
+
//# debugId=89db1e15-b152-57e2-910d-64ed77eb540b
|