@mastra/server 1.79.0-alpha.9 → 1.79.0
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/dist/{a2a-CHBSYHxu.js → a2a-BqLB3McP.js} +17 -16
- package/dist/a2a-BqLB3McP.js.map +1 -0
- package/dist/{a2a-B465DD1u.cjs → a2a-Uood_0DN.cjs} +19 -18
- package/dist/a2a-Uood_0DN.cjs.map +1 -0
- package/dist/agent-builder-CuBD1tpv.cjs +728 -0
- package/dist/agent-builder-CuBD1tpv.cjs.map +1 -0
- package/dist/agent-builder-VhM8ADW-.js +627 -0
- package/dist/agent-builder-VhM8ADW-.js.map +1 -0
- package/dist/{agents-X1E7fW3p.js → agents-BHLTMBff.js} +2 -2
- package/dist/{agents-X1E7fW3p.js.map → agents-BHLTMBff.js.map} +1 -1
- package/dist/agents-BOWEUKyV.cjs +3127 -0
- package/dist/agents-BOWEUKyV.cjs.map +1 -0
- package/dist/agents-DRQ3ScbX.js +2828 -0
- package/dist/agents-DRQ3ScbX.js.map +1 -0
- package/dist/{agents-DoNMSCMt.cjs → agents-T-OIM9IK.cjs} +2 -2
- package/dist/{agents-DoNMSCMt.cjs.map → agents-T-OIM9IK.cjs.map} +1 -1
- package/dist/{api-schema-manifest-CWRIJP-B.js → api-schema-manifest-CI90M4sX.js} +3 -3
- package/dist/{api-schema-manifest-CWRIJP-B.js.map → api-schema-manifest-CI90M4sX.js.map} +1 -1
- package/dist/{api-schema-manifest-DUseI2VG.cjs → api-schema-manifest-DIlNfbyw.cjs} +4 -4
- package/dist/{api-schema-manifest-DUseI2VG.cjs.map → api-schema-manifest-DIlNfbyw.cjs.map} +1 -1
- package/dist/{background-tasks-CabImVak.cjs → background-tasks-B3VAKTJh.cjs} +3 -3
- package/dist/{background-tasks-CabImVak.cjs.map → background-tasks-B3VAKTJh.cjs.map} +1 -1
- package/dist/{background-tasks-oBaLtnCn.js → background-tasks-Du2zYOPl.js} +2 -2
- package/dist/{background-tasks-oBaLtnCn.js.map → background-tasks-Du2zYOPl.js.map} +1 -1
- package/dist/{builder-registry-DOkLe8ES.js → builder-registry-DLdu9bWH.js} +3 -3
- package/dist/{builder-registry-DOkLe8ES.js.map → builder-registry-DLdu9bWH.js.map} +1 -1
- package/dist/{builder-registry-D0frV8lQ.cjs → builder-registry-DaFAaMTf.cjs} +3 -3
- package/dist/{builder-registry-D0frV8lQ.cjs.map → builder-registry-DaFAaMTf.cjs.map} +1 -1
- package/dist/{channels-CBIopVWd.cjs → channels-BnVRmnzK.cjs} +6 -3
- package/dist/{channels-CBIopVWd.cjs.map → channels-BnVRmnzK.cjs.map} +1 -1
- package/dist/{channels-BOxgHvzI.js → channels-Db-4pXVZ.js} +6 -3
- package/dist/{channels-BOxgHvzI.js.map → channels-Db-4pXVZ.js.map} +1 -1
- package/dist/conversations-8BWryNlF.js +165 -0
- package/dist/conversations-8BWryNlF.js.map +1 -0
- package/dist/conversations-C5MkQBB8.cjs +194 -0
- package/dist/conversations-C5MkQBB8.cjs.map +1 -0
- package/dist/{conversations-Bj5TLNqF.cjs → conversations-DasqEDCF.cjs} +3 -3
- package/dist/{conversations-Bj5TLNqF.cjs.map → conversations-DasqEDCF.cjs.map} +1 -1
- package/dist/{dist-9c3PXXpk.cjs → dist-B-bEVWlJ.cjs} +4733 -1251
- package/dist/dist-B-bEVWlJ.cjs.map +1 -0
- package/dist/dist-B3kC8Yd0.cjs +3 -0
- package/dist/{dist-CQ3FSKT-.cjs → dist-B9ery9Zw.cjs} +38 -35
- package/dist/{dist-CQ3FSKT-.cjs.map → dist-B9ery9Zw.cjs.map} +1 -1
- package/dist/{dist-BxMmGD3n.js → dist-BBOnrL_A.js} +10 -12
- package/dist/{dist-BxMmGD3n.js.map → dist-BBOnrL_A.js.map} +1 -1
- package/dist/{dist-DOWsEmo6.js → dist-BIrQLUV9.js} +20 -20
- package/dist/{dist-DOWsEmo6.js.map → dist-BIrQLUV9.js.map} +1 -1
- package/dist/dist-BM9J-PTK.js +1 -0
- package/dist/{dist-DC1Pewf5.cjs → dist-Bo3GdQwf.cjs} +21 -21
- package/dist/{dist-DC1Pewf5.cjs.map → dist-Bo3GdQwf.cjs.map} +1 -1
- package/dist/{dist-BwYL7Ykb.js → dist-CREG82cy.js} +37 -34
- package/dist/{dist-BwYL7Ykb.js.map → dist-CREG82cy.js.map} +1 -1
- package/dist/{dist-rDRetJVY.cjs → dist-CeTLA-e5.cjs} +2 -3
- package/dist/{dist-rDRetJVY.cjs.map → dist-CeTLA-e5.cjs.map} +1 -1
- package/dist/{dist-CBRJax5e.js → dist-DLld1qjf.js} +25 -31
- package/dist/{dist-CBRJax5e.js.map → dist-DLld1qjf.js.map} +1 -1
- package/dist/{dist-B_bet8uz.js → dist-DjkPkAzV.js} +2 -3
- package/dist/{dist-B_bet8uz.js.map → dist-DjkPkAzV.js.map} +1 -1
- package/dist/{dist-UKEksCGq.cjs → dist-DsrJXwic.cjs} +11 -13
- package/dist/{dist-UKEksCGq.cjs.map → dist-DsrJXwic.cjs.map} +1 -1
- package/dist/{dist-DGCnbhNe.js → dist-k77XQGUn.js} +4493 -1043
- package/dist/dist-k77XQGUn.js.map +1 -0
- package/dist/{dist-3FPW9nVj.cjs → dist-lT2rqyY9.cjs} +26 -32
- package/dist/{dist-3FPW9nVj.cjs.map → dist-lT2rqyY9.cjs.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-server-routes.md +159 -0
- package/dist/{dynamic-workflows-Rr_6ac1y.js → dynamic-workflows-CTUO0SFu.js} +3 -3
- package/dist/{dynamic-workflows-Rr_6ac1y.js.map → dynamic-workflows-CTUO0SFu.js.map} +1 -1
- package/dist/{dynamic-workflows-DXlkr-jK.cjs → dynamic-workflows-HwPX3mcf.cjs} +3 -3
- package/dist/{dynamic-workflows-DXlkr-jK.cjs.map → dynamic-workflows-HwPX3mcf.cjs.map} +1 -1
- package/dist/{editor-builder-BclcHxN6.cjs → editor-builder-BDtiWw0f.cjs} +2 -2
- package/dist/{editor-builder-BclcHxN6.cjs.map → editor-builder-BDtiWw0f.cjs.map} +1 -1
- package/dist/{editor-builder-D16kc1P6.js → editor-builder-ClFlGXoX.js} +4 -4
- package/dist/{editor-builder-D16kc1P6.js.map → editor-builder-ClFlGXoX.js.map} +1 -1
- package/dist/{editor-builder-s9WqPJgA.js → editor-builder-DnLCfqnY.js} +2 -2
- package/dist/{editor-builder-s9WqPJgA.js.map → editor-builder-DnLCfqnY.js.map} +1 -1
- package/dist/{editor-builder-DXHiPX1A.cjs → editor-builder-DtpP1FtW.cjs} +5 -5
- package/dist/{editor-builder-DXHiPX1A.cjs.map → editor-builder-DtpP1FtW.cjs.map} +1 -1
- package/dist/{helpers-ElhPeCSK.cjs → helpers-CAcEhq38.cjs} +21 -17
- package/dist/{helpers-ElhPeCSK.cjs.map → helpers-CAcEhq38.cjs.map} +1 -1
- package/dist/{helpers-DLhX1fqc.js → helpers-vrqddDd5.js} +21 -17
- package/dist/{helpers-DLhX1fqc.js.map → helpers-vrqddDd5.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/logs-CiSw7r0s.cjs +119 -0
- package/dist/logs-CiSw7r0s.cjs.map +1 -0
- package/dist/logs-CxfPk-iL.js +96 -0
- package/dist/logs-CxfPk-iL.js.map +1 -0
- package/dist/mcp-CWDfSu7w.js +474 -0
- package/dist/mcp-CWDfSu7w.js.map +1 -0
- package/dist/mcp-CWGJRqkC.cjs +563 -0
- package/dist/mcp-CWGJRqkC.cjs.map +1 -0
- package/dist/{mcp-DzpwLXEY.js → mcp-Drqt0GqD.js} +79 -4
- package/dist/mcp-Drqt0GqD.js.map +1 -0
- package/dist/{mcp-ShaKO7gA.cjs → mcp-ziWVk7Ol.cjs} +126 -3
- package/dist/mcp-ziWVk7Ol.cjs.map +1 -0
- package/dist/memory-BHtTSzvJ.js +1739 -0
- package/dist/memory-BHtTSzvJ.js.map +1 -0
- package/dist/memory-CwwkVDh1.cjs +1906 -0
- package/dist/memory-CwwkVDh1.cjs.map +1 -0
- package/dist/observability-BBMCMeT-.cjs +502 -0
- package/dist/observability-BBMCMeT-.cjs.map +1 -0
- package/dist/observability-ZRgRcvoX.js +431 -0
- package/dist/observability-ZRgRcvoX.js.map +1 -0
- package/dist/{observability-new-endpoints-BU8JYPfh.js → observability-new-endpoints-fjoZzEtk.js} +10 -9
- package/dist/{observability-new-endpoints-BU8JYPfh.js.map → observability-new-endpoints-fjoZzEtk.js.map} +1 -1
- package/dist/{observability-new-endpoints-AMp9bnMV.cjs → observability-new-endpoints-tG3-odLa.cjs} +11 -10
- package/dist/observability-new-endpoints-tG3-odLa.cjs.map +1 -0
- package/dist/plans-CiPgWBhO.cjs +68 -0
- package/dist/plans-CiPgWBhO.cjs.map +1 -0
- package/dist/plans-DCepEY7n.js +57 -0
- package/dist/plans-DCepEY7n.js.map +1 -0
- package/dist/{probe-image-size-DBGjhUtJ.cjs → probe-image-size-Alv3gwKl.cjs} +194 -184
- package/dist/probe-image-size-Alv3gwKl.cjs.map +1 -0
- package/dist/{probe-image-size-Dmoxv93t.js → probe-image-size-BdfbUHxx.js} +158 -148
- package/dist/probe-image-size-BdfbUHxx.js.map +1 -0
- package/dist/responses-4FwMNxoJ.js +628 -0
- package/dist/responses-4FwMNxoJ.js.map +1 -0
- package/dist/responses-CCRijwDF.cjs +651 -0
- package/dist/responses-CCRijwDF.cjs.map +1 -0
- package/dist/{responses-CKNdSRkS.cjs → responses-CfcIc53b.cjs} +2 -2
- package/dist/{responses-CKNdSRkS.cjs.map → responses-CfcIc53b.cjs.map} +1 -1
- package/dist/{rolldown-runtime-Bd6kNlEP.cjs → rolldown-runtime-BwC_XMyb.cjs} +2 -2
- package/dist/{rolldown-runtime-maW3aOIk.js → rolldown-runtime-D3Hj5m0v.js} +2 -2
- package/dist/{route-builder-BNZs643f.cjs → route-builder-B2Qhhd7C.cjs} +52 -66
- package/dist/route-builder-B2Qhhd7C.cjs.map +1 -0
- package/dist/{route-builder-BfQYtclb.js → route-builder-CjkWxv4E.js} +51 -65
- package/dist/route-builder-CjkWxv4E.js.map +1 -0
- package/dist/{routes-rwufkyUe.js → routes-BC20mdNN.js} +30 -26
- package/dist/routes-BC20mdNN.js.map +1 -0
- package/dist/{routes-Dl6_kWm7.js → routes-CKfXiwRc.js} +5 -3
- package/dist/routes-CKfXiwRc.js.map +1 -0
- package/dist/{routes-DPojsNf1.cjs → routes-DGLJyqjD.cjs} +203 -199
- package/dist/routes-DGLJyqjD.cjs.map +1 -0
- package/dist/{routes-BULZI-PU.cjs → routes-jXksmX9G.cjs} +5 -3
- package/dist/routes-jXksmX9G.cjs.map +1 -0
- package/dist/{schedules-Bj-giFbc.cjs → schedules-GokZKBYg.cjs} +6 -4
- package/dist/schedules-GokZKBYg.cjs.map +1 -0
- package/dist/{schedules-BQYgaz66.js → schedules-_3zPKyqm.js} +5 -3
- package/dist/schedules-_3zPKyqm.js.map +1 -0
- package/dist/{schema-e0VHpMt0-C0452jOk.cjs → schema-CzbEIyhE-20gGIWkz.cjs} +83 -88
- package/dist/schema-CzbEIyhE-20gGIWkz.cjs.map +1 -0
- package/dist/{schema-e0VHpMt0-CVP5Hnxy.js → schema-CzbEIyhE-BsMcj9Ws.js} +82 -87
- package/dist/schema-CzbEIyhE-BsMcj9Ws.js.map +1 -0
- package/dist/scores-D9UgETt_.js +288 -0
- package/dist/scores-D9UgETt_.js.map +1 -0
- package/dist/scores-DRdtS7NT.cjs +329 -0
- package/dist/scores-DRdtS7NT.cjs.map +1 -0
- package/dist/server/a2a/store.cjs +1 -1
- package/dist/server/auth/index.cjs +2 -2
- package/dist/server/auth/index.js +1 -1
- package/dist/server/browser-stream/index.cjs +9 -11
- package/dist/server/browser-stream/index.cjs.map +1 -1
- package/dist/server/browser-stream/index.js +8 -10
- package/dist/server/browser-stream/index.js.map +1 -1
- package/dist/server/handlers/a2a.cjs +2 -2
- package/dist/server/handlers/a2a.js +1 -2
- package/dist/server/handlers/agent-builder.cjs +18 -648
- package/dist/server/handlers/agent-builder.js +1 -627
- package/dist/server/handlers/agent-controller.cjs +5 -5
- package/dist/server/handlers/agent-controller.cjs.map +1 -1
- package/dist/server/handlers/agent-controller.js +11 -9
- package/dist/server/handlers/agent-controller.js.map +1 -1
- package/dist/server/handlers/agent-versions.cjs +15 -8
- package/dist/server/handlers/agent-versions.cjs.map +1 -1
- package/dist/server/handlers/agent-versions.js +14 -7
- package/dist/server/handlers/agent-versions.js.map +1 -1
- package/dist/server/handlers/agents.cjs +51 -2860
- package/dist/server/handlers/agents.js +1 -2806
- package/dist/server/handlers/auth.cjs +14 -12
- package/dist/server/handlers/auth.cjs.map +1 -1
- package/dist/server/handlers/auth.js +20 -16
- package/dist/server/handlers/auth.js.map +1 -1
- package/dist/server/handlers/author-enrichment.cjs +1 -1
- package/dist/server/handlers/authorship.cjs +1 -1
- package/dist/server/handlers/authorship.cjs.map +1 -1
- package/dist/server/handlers/background-tasks.cjs +2 -2
- package/dist/server/handlers/background-tasks.js +1 -2
- package/dist/server/handlers/builder-registry.cjs +2 -2
- package/dist/server/handlers/builder-registry.js +1 -2
- package/dist/server/handlers/channels.cjs +2 -2
- package/dist/server/handlers/channels.js +1 -2
- package/dist/server/handlers/conversations.cjs +6 -171
- package/dist/server/handlers/conversations.js +1 -162
- package/dist/server/handlers/datasets.cjs +2 -2
- package/dist/server/handlers/datasets.cjs.map +1 -1
- package/dist/server/handlers/datasets.js +1 -1
- package/dist/server/handlers/dynamic-workflows.cjs +2 -2
- package/dist/server/handlers/dynamic-workflows.js +1 -2
- package/dist/server/handlers/editor-builder.cjs +2 -2
- package/dist/server/handlers/editor-builder.js +1 -2
- package/dist/server/handlers/error.cjs +18 -13
- package/dist/server/handlers/error.cjs.map +1 -1
- package/dist/server/handlers/error.js +17 -12
- package/dist/server/handlers/error.js.map +1 -1
- package/dist/server/handlers/favorites-enrichment.cjs +2 -2
- package/dist/server/handlers/favorites-enrichment.js +1 -1
- package/dist/server/handlers/gateway-memory-client.cjs +1 -1
- package/dist/server/handlers/logs.cjs +5 -104
- package/dist/server/handlers/logs.js +1 -96
- package/dist/server/handlers/mcp-client-versions.cjs +15 -8
- package/dist/server/handlers/mcp-client-versions.cjs.map +1 -1
- package/dist/server/handlers/mcp-client-versions.js +14 -7
- package/dist/server/handlers/mcp-client-versions.js.map +1 -1
- package/dist/server/handlers/mcp.cjs +16 -289
- package/dist/server/handlers/mcp.d.ts +219 -0
- package/dist/server/handlers/mcp.d.ts.map +1 -1
- package/dist/server/handlers/mcp.js +1 -274
- package/dist/server/handlers/memory.cjs +29 -1763
- package/dist/server/handlers/memory.js +1 -1731
- package/dist/server/handlers/observability-list-query-schemas.cjs +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +2 -2
- package/dist/server/handlers/observability-new-endpoints.js +1 -2
- package/dist/server/handlers/observability-shared.cjs +2 -2
- package/dist/server/handlers/observability-shared.js +1 -1
- package/dist/server/handlers/observability-storage-schemas.cjs +1 -1
- package/dist/server/handlers/observability.cjs +14 -445
- package/dist/server/handlers/observability.js +3 -429
- package/dist/server/handlers/plans.cjs +3 -63
- package/dist/server/handlers/plans.js +1 -57
- package/dist/server/handlers/processor-providers.cjs +2 -2
- package/dist/server/handlers/processor-providers.cjs.map +1 -1
- package/dist/server/handlers/processor-providers.js +1 -1
- package/dist/server/handlers/processors.cjs +13 -15
- package/dist/server/handlers/processors.cjs.map +1 -1
- package/dist/server/handlers/processors.js +12 -14
- package/dist/server/handlers/processors.js.map +1 -1
- package/dist/server/handlers/prompt-block-versions.cjs +15 -8
- package/dist/server/handlers/prompt-block-versions.cjs.map +1 -1
- package/dist/server/handlers/prompt-block-versions.js +14 -7
- package/dist/server/handlers/prompt-block-versions.js.map +1 -1
- package/dist/server/handlers/responses.adapter.cjs +1 -1
- package/dist/server/handlers/responses.adapter.cjs.map +1 -1
- package/dist/server/handlers/responses.cjs +5 -632
- package/dist/server/handlers/responses.js +1 -624
- package/dist/server/handlers/responses.storage.cjs +2 -2
- package/dist/server/handlers/schedules-workflows-shim.cjs +1 -1
- package/dist/server/handlers/schedules.cjs +2 -2
- package/dist/server/handlers/schedules.d.ts +16 -0
- package/dist/server/handlers/schedules.d.ts.map +1 -1
- package/dist/server/handlers/schedules.js +1 -2
- package/dist/server/handlers/scorer-versions.cjs +15 -8
- package/dist/server/handlers/scorer-versions.cjs.map +1 -1
- package/dist/server/handlers/scorer-versions.js +14 -7
- package/dist/server/handlers/scorer-versions.js.map +1 -1
- package/dist/server/handlers/scores.cjs +8 -299
- package/dist/server/handlers/scores.js +1 -288
- package/dist/server/handlers/skills-sh-shared.cjs +1 -1
- package/dist/server/handlers/stored-agent-favorites.cjs +4 -4
- package/dist/server/handlers/stored-agent-favorites.js +3 -3
- package/dist/server/handlers/stored-agents.cjs +19 -13
- package/dist/server/handlers/stored-agents.cjs.map +1 -1
- package/dist/server/handlers/stored-agents.js +18 -12
- package/dist/server/handlers/stored-agents.js.map +1 -1
- package/dist/server/handlers/stored-mcp-clients.cjs +8 -6
- package/dist/server/handlers/stored-mcp-clients.cjs.map +1 -1
- package/dist/server/handlers/stored-mcp-clients.js +7 -5
- package/dist/server/handlers/stored-mcp-clients.js.map +1 -1
- package/dist/server/handlers/stored-prompt-blocks.cjs +3 -3
- package/dist/server/handlers/stored-prompt-blocks.js +2 -2
- package/dist/server/handlers/stored-scorers.cjs +3 -3
- package/dist/server/handlers/stored-scorers.js +2 -2
- package/dist/server/handlers/stored-skill-favorites.cjs +4 -4
- package/dist/server/handlers/stored-skill-favorites.js +3 -3
- package/dist/server/handlers/stored-skills.cjs +6 -5
- package/dist/server/handlers/stored-skills.cjs.map +1 -1
- package/dist/server/handlers/stored-skills.js +5 -4
- package/dist/server/handlers/stored-skills.js.map +1 -1
- package/dist/server/handlers/stored-workspaces.cjs +3 -3
- package/dist/server/handlers/stored-workspaces.js +2 -2
- package/dist/server/handlers/system.cjs +3 -3
- package/dist/server/handlers/system.cjs.map +1 -1
- package/dist/server/handlers/system.js +2 -2
- package/dist/server/handlers/test-utils.cjs +1 -1
- package/dist/server/handlers/tool-providers.cjs +2 -2
- package/dist/server/handlers/tool-providers.js +1 -1
- package/dist/server/handlers/tool-schema-overrides.cjs +1 -1
- package/dist/server/handlers/tools.cjs +7 -267
- package/dist/server/handlers/tools.js +1 -257
- package/dist/server/handlers/utils.cjs +2 -2
- package/dist/server/handlers/utils.js +1 -2
- package/dist/server/handlers/validate-agent-instructions.cjs +2 -2
- package/dist/server/handlers/validate-agent-instructions.js +1 -1
- package/dist/server/handlers/validate-avatar.cjs +2 -2
- package/dist/server/handlers/validate-avatar.cjs.map +1 -1
- package/dist/server/handlers/validate-avatar.js +1 -1
- package/dist/server/handlers/validate-avatar.js.map +1 -1
- package/dist/server/handlers/vector.cjs +17 -334
- package/dist/server/handlers/vector.js +1 -314
- package/dist/server/handlers/version-helpers.cjs +1 -1
- package/dist/server/handlers/voice.cjs +9 -35
- package/dist/server/handlers/voice.js +1 -23
- package/dist/server/handlers/workflow-builder.cjs +2 -2
- package/dist/server/handlers/workflow-builder.js +1 -2
- package/dist/server/handlers/workflows.cjs +30 -1293
- package/dist/server/handlers/workflows.js +1 -1257
- package/dist/server/handlers/workspace.cjs +27 -1176
- package/dist/server/handlers/workspace.js +1 -1146
- package/dist/server/handlers.cjs +33 -33
- package/dist/server/handlers.js +17 -17
- package/dist/server/schemas/index.cjs +7 -7
- package/dist/server/schemas/index.js +4 -4
- package/dist/server/schemas/mcp.d.ts +102 -0
- package/dist/server/schemas/mcp.d.ts.map +1 -1
- package/dist/server/schemas/schedules.d.ts +5 -0
- package/dist/server/schemas/schedules.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +5 -5
- package/dist/server/server-adapter/index.cjs.map +1 -1
- package/dist/server/server-adapter/index.js +4 -4
- package/dist/server/server-adapter/index.js.map +1 -1
- package/dist/server/server-adapter/routes/mcp.d.ts +214 -0
- package/dist/server/server-adapter/routes/mcp.d.ts.map +1 -1
- package/dist/tools-CmFSfDMn.js +256 -0
- package/dist/tools-CmFSfDMn.js.map +1 -0
- package/dist/tools-SPJtxG9N.cjs +291 -0
- package/dist/tools-SPJtxG9N.cjs.map +1 -0
- package/dist/{utils-DCgeTrq2.cjs → utils-CF76qzZR.cjs} +12 -17
- package/dist/{utils-DCgeTrq2.cjs.map → utils-CF76qzZR.cjs.map} +1 -1
- package/dist/{utils-DCAUeb6M.js → utils-aoLN3Wfi.js} +11 -16
- package/dist/{utils-DCAUeb6M.js.map → utils-aoLN3Wfi.js.map} +1 -1
- package/dist/{utils-Du-EpvDs.cjs → utils-dDLIDg8O.cjs} +2 -2
- package/dist/{utils-Du-EpvDs.cjs.map → utils-dDLIDg8O.cjs.map} +1 -1
- package/dist/vector-BKDD1kwc.cjs +409 -0
- package/dist/vector-BKDD1kwc.cjs.map +1 -0
- package/dist/vector-TWv4t-4g.js +314 -0
- package/dist/vector-TWv4t-4g.js.map +1 -0
- package/dist/voice-BnGwlZ75.cjs +70 -0
- package/dist/voice-BnGwlZ75.cjs.map +1 -0
- package/dist/voice-DjG8tBAD.js +23 -0
- package/dist/voice-DjG8tBAD.js.map +1 -0
- package/dist/{workflow-builder-Brj3IArM.cjs → workflow-builder-C9-8ZOWF.cjs} +5 -5
- package/dist/{workflow-builder-Brj3IArM.cjs.map → workflow-builder-C9-8ZOWF.cjs.map} +1 -1
- package/dist/{workflow-builder-DOa1Vx6w.js → workflow-builder-CjlLoQvo.js} +10 -8
- package/dist/{workflow-builder-DOa1Vx6w.js.map → workflow-builder-CjlLoQvo.js.map} +1 -1
- package/dist/workflows-DjqeJcdJ.cjs +1446 -0
- package/dist/workflows-DjqeJcdJ.cjs.map +1 -0
- package/dist/workflows-bb-otd2o.js +1273 -0
- package/dist/workflows-bb-otd2o.js.map +1 -0
- package/dist/workspace-B6kzp-bo.js +1154 -0
- package/dist/workspace-B6kzp-bo.js.map +1 -0
- package/dist/workspace-COKR1SxH.cjs +1309 -0
- package/dist/workspace-COKR1SxH.cjs.map +1 -0
- package/package.json +9 -9
- package/dist/a2a-B465DD1u.cjs.map +0 -1
- package/dist/a2a-CHBSYHxu.js.map +0 -1
- package/dist/dist-9c3PXXpk.cjs.map +0 -1
- package/dist/dist-B5OwHWTo.cjs +0 -2294
- package/dist/dist-B5OwHWTo.cjs.map +0 -1
- package/dist/dist-DGCnbhNe.js.map +0 -1
- package/dist/dist-DcoIg_tp.js +0 -2293
- package/dist/dist-DcoIg_tp.js.map +0 -1
- package/dist/mcp-DzpwLXEY.js.map +0 -1
- package/dist/mcp-ShaKO7gA.cjs.map +0 -1
- package/dist/observability-new-endpoints-AMp9bnMV.cjs.map +0 -1
- package/dist/probe-image-size-DBGjhUtJ.cjs.map +0 -1
- package/dist/probe-image-size-Dmoxv93t.js.map +0 -1
- package/dist/route-builder-BNZs643f.cjs.map +0 -1
- package/dist/route-builder-BfQYtclb.js.map +0 -1
- package/dist/routes-BULZI-PU.cjs.map +0 -1
- package/dist/routes-DPojsNf1.cjs.map +0 -1
- package/dist/routes-Dl6_kWm7.js.map +0 -1
- package/dist/routes-rwufkyUe.js.map +0 -1
- package/dist/schedules-BQYgaz66.js.map +0 -1
- package/dist/schedules-Bj-giFbc.cjs.map +0 -1
- package/dist/schema-Drf2W04o.js +0 -2
- package/dist/schema-EQanefYq.cjs +0 -1
- package/dist/schema-e0VHpMt0-C0452jOk.cjs.map +0 -1
- package/dist/schema-e0VHpMt0-CVP5Hnxy.js.map +0 -1
- package/dist/server/handlers/agent-builder.cjs.map +0 -1
- package/dist/server/handlers/agent-builder.js.map +0 -1
- package/dist/server/handlers/agents.cjs.map +0 -1
- package/dist/server/handlers/agents.js.map +0 -1
- package/dist/server/handlers/conversations.cjs.map +0 -1
- package/dist/server/handlers/conversations.js.map +0 -1
- package/dist/server/handlers/logs.cjs.map +0 -1
- package/dist/server/handlers/logs.js.map +0 -1
- package/dist/server/handlers/mcp.cjs.map +0 -1
- package/dist/server/handlers/mcp.js.map +0 -1
- package/dist/server/handlers/memory.cjs.map +0 -1
- package/dist/server/handlers/memory.js.map +0 -1
- package/dist/server/handlers/observability.cjs.map +0 -1
- package/dist/server/handlers/observability.js.map +0 -1
- package/dist/server/handlers/plans.cjs.map +0 -1
- package/dist/server/handlers/plans.js.map +0 -1
- package/dist/server/handlers/responses.cjs.map +0 -1
- package/dist/server/handlers/responses.js.map +0 -1
- package/dist/server/handlers/scores.cjs.map +0 -1
- package/dist/server/handlers/scores.js.map +0 -1
- package/dist/server/handlers/tools.cjs.map +0 -1
- package/dist/server/handlers/tools.js.map +0 -1
- package/dist/server/handlers/vector.cjs.map +0 -1
- package/dist/server/handlers/vector.js.map +0 -1
- package/dist/server/handlers/voice.cjs.map +0 -1
- package/dist/server/handlers/voice.js.map +0 -1
- package/dist/server/handlers/workflows.cjs.map +0 -1
- package/dist/server/handlers/workflows.js.map +0 -1
- package/dist/server/handlers/workspace.cjs.map +0 -1
- package/dist/server/handlers/workspace.js.map +0 -1
- package/dist/sync-Ai_ZDz7U.js +0 -1700
- package/dist/sync-Ai_ZDz7U.js.map +0 -1
- package/dist/sync-BrO5MtSe.cjs +0 -1729
- package/dist/sync-BrO5MtSe.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as HTTPException } from "../../http-exception-CyfxZB6W.js";
|
|
2
|
-
import { n as createRoute } from "../../route-builder-
|
|
3
|
-
import { i as getStoredResourceScope, n as assertStoredResourceScope } from "../../utils-
|
|
2
|
+
import { n as createRoute } from "../../route-builder-CjkWxv4E.js";
|
|
3
|
+
import { i as getStoredResourceScope, n as assertStoredResourceScope } from "../../utils-aoLN3Wfi.js";
|
|
4
4
|
import { handleError } from "./error.js";
|
|
5
5
|
import { MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS, calculateChangedFields, computeVersionDiffs, createVersionWithRetry, enforceRetentionLimit, extractConfigFromVersion } from "./version-helpers.js";
|
|
6
6
|
import { a as createMCPClientVersionResponseSchema, c as listMCPClientVersionsQuerySchema, d as mcpClientVersionPathParams, i as createMCPClientVersionBodySchema, l as listMCPClientVersionsResponseSchema, n as compareMCPClientVersionsQuerySchema, o as deleteMCPClientVersionResponseSchema, p as restoreMCPClientVersionResponseSchema, r as compareMCPClientVersionsResponseSchema, s as getMCPClientVersionResponseSchema, t as activateMCPClientVersionResponseSchema, u as mcpClientVersionIdPathParams } from "../../mcp-client-versions-DxBkzcYH.js";
|
|
@@ -69,7 +69,8 @@ const CREATE_MCP_CLIENT_VERSION_ROUTE = createRoute({
|
|
|
69
69
|
}
|
|
70
70
|
const latestVersion = await mcpClientStore.getLatestVersion(mcpClientId);
|
|
71
71
|
if (!mcpClient.activeVersionId && latestVersion) currentConfig = extractConfigFromVersion(latestVersion, MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS);
|
|
72
|
-
const
|
|
72
|
+
const previousConfig = latestVersion ? extractConfigFromVersion(latestVersion, MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS) : null;
|
|
73
|
+
const changedFields = calculateChangedFields(previousConfig, currentConfig);
|
|
73
74
|
const { versionId } = await createVersionWithRetry(mcpClientStore, mcpClientId, "mcpClientId", currentConfig, changedFields, { changeMessage });
|
|
74
75
|
const version = await mcpClientStore.getVersion(versionId);
|
|
75
76
|
if (!version) throw new HTTPException(500, { message: "Failed to retrieve created version" });
|
|
@@ -102,7 +103,8 @@ const GET_MCP_CLIENT_VERSION_ROUTE = createRoute({
|
|
|
102
103
|
const version = await mcpClientStore.getVersion(versionId);
|
|
103
104
|
if (!version) throw new HTTPException(404, { message: `Version with id ${versionId} not found` });
|
|
104
105
|
if (version.mcpClientId !== mcpClientId) throw new HTTPException(404, { message: `Version with id ${versionId} not found for MCP client ${mcpClientId}` });
|
|
105
|
-
|
|
106
|
+
const mcpClient = await mcpClientStore.getById(mcpClientId);
|
|
107
|
+
assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));
|
|
106
108
|
return version;
|
|
107
109
|
} catch (error) {
|
|
108
110
|
return handleError(error, "Error getting MCP client version");
|
|
@@ -181,7 +183,9 @@ const RESTORE_MCP_CLIENT_VERSION_ROUTE = createRoute({
|
|
|
181
183
|
...restoredConfig
|
|
182
184
|
});
|
|
183
185
|
const latestVersion = await mcpClientStore.getLatestVersion(mcpClientId);
|
|
184
|
-
const
|
|
186
|
+
const previousConfig = latestVersion ? extractConfigFromVersion(latestVersion, MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS) : null;
|
|
187
|
+
const changedFields = calculateChangedFields(previousConfig, restoredConfig);
|
|
188
|
+
const { versionId: newVersionId } = await createVersionWithRetry(mcpClientStore, mcpClientId, "mcpClientId", restoredConfig, changedFields, { changeMessage: `Restored from version ${versionToRestore.versionNumber}` });
|
|
185
189
|
const newVersion = await mcpClientStore.getVersion(newVersionId);
|
|
186
190
|
if (!newVersion) throw new HTTPException(500, { message: "Failed to retrieve created version" });
|
|
187
191
|
await enforceRetentionLimit(mcpClientStore, mcpClientId, "mcpClientId", mcpClient.activeVersionId);
|
|
@@ -249,15 +253,18 @@ const COMPARE_MCP_CLIENT_VERSIONS_ROUTE = createRoute({
|
|
|
249
253
|
if (!storage) throw new HTTPException(500, { message: "Storage is not configured" });
|
|
250
254
|
const mcpClientStore = await storage.getStore("mcpClients");
|
|
251
255
|
if (!mcpClientStore) throw new HTTPException(500, { message: "MCP clients storage domain is not available" });
|
|
252
|
-
|
|
256
|
+
const mcpClient = await mcpClientStore.getById(mcpClientId);
|
|
257
|
+
assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));
|
|
253
258
|
const fromVersion = await mcpClientStore.getVersion(from);
|
|
254
259
|
if (!fromVersion) throw new HTTPException(404, { message: `Version with id ${from} not found` });
|
|
255
260
|
if (fromVersion.mcpClientId !== mcpClientId) throw new HTTPException(404, { message: `Version with id ${from} not found for MCP client ${mcpClientId}` });
|
|
256
261
|
const toVersion = await mcpClientStore.getVersion(to);
|
|
257
262
|
if (!toVersion) throw new HTTPException(404, { message: `Version with id ${to} not found` });
|
|
258
263
|
if (toVersion.mcpClientId !== mcpClientId) throw new HTTPException(404, { message: `Version with id ${to} not found for MCP client ${mcpClientId}` });
|
|
264
|
+
const fromConfig = extractConfigFromVersion(fromVersion, MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS);
|
|
265
|
+
const toConfig = extractConfigFromVersion(toVersion, MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS);
|
|
259
266
|
return {
|
|
260
|
-
diffs: computeVersionDiffs(
|
|
267
|
+
diffs: computeVersionDiffs(fromConfig, toConfig),
|
|
261
268
|
fromVersion,
|
|
262
269
|
toVersion
|
|
263
270
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-client-versions.js","names":[],"sources":["../../../src/server/handlers/mcp-client-versions.ts"],"sourcesContent":["import { HTTPException } from '../http-exception';\nimport {\n mcpClientVersionPathParams,\n mcpClientVersionIdPathParams,\n listMCPClientVersionsQuerySchema,\n createMCPClientVersionBodySchema,\n compareMCPClientVersionsQuerySchema,\n listMCPClientVersionsResponseSchema,\n getMCPClientVersionResponseSchema,\n createMCPClientVersionResponseSchema,\n activateMCPClientVersionResponseSchema,\n restoreMCPClientVersionResponseSchema,\n deleteMCPClientVersionResponseSchema,\n compareMCPClientVersionsResponseSchema,\n} from '../schemas/mcp-client-versions';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { assertStoredResourceScope, getStoredResourceScope } from '../utils';\n\nimport { handleError } from './error';\nimport {\n extractConfigFromVersion,\n calculateChangedFields,\n computeVersionDiffs,\n createVersionWithRetry,\n enforceRetentionLimit,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n} from './version-helpers';\nimport type { VersionedStoreInterface } from './version-helpers';\n\n/**\n * GET /stored/mcp-clients/:mcpClientId/versions - List all versions for an MCP client\n */\nexport const LIST_MCP_CLIENT_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/mcp-clients/:mcpClientId/versions',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionPathParams,\n queryParamSchema: listMCPClientVersionsQuerySchema,\n responseSchema: listMCPClientVersionsResponseSchema,\n summary: 'List MCP client versions',\n description: 'Returns a paginated list of all versions for a stored MCP client',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, page, perPage, orderBy, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const result = await mcpClientStore.listVersions({\n mcpClientId,\n page,\n perPage,\n orderBy,\n });\n\n return result;\n } catch (error) {\n return handleError(error, 'Error listing MCP client versions');\n }\n },\n});\n\n/**\n * POST /stored/mcp-clients/:mcpClientId/versions - Create a new version snapshot\n */\nexport const CREATE_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/mcp-clients/:mcpClientId/versions',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionPathParams,\n bodySchema: createMCPClientVersionBodySchema,\n responseSchema: createMCPClientVersionResponseSchema,\n summary: 'Create MCP client version',\n description: 'Creates a new version snapshot of the current MCP client configuration',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, changeMessage, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n let currentConfig: Record<string, unknown> = {};\n if (mcpClient.activeVersionId) {\n const activeVersion = await mcpClientStore.getVersion(mcpClient.activeVersionId);\n if (activeVersion) {\n currentConfig = extractConfigFromVersion(\n activeVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n }\n }\n\n const latestVersion = await mcpClientStore.getLatestVersion(mcpClientId);\n\n // If no activeVersionId, fall back to latest version config\n if (!mcpClient.activeVersionId && latestVersion) {\n currentConfig = extractConfigFromVersion(\n latestVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n }\n const previousConfig = latestVersion\n ? extractConfigFromVersion(\n latestVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n )\n : null;\n\n const changedFields = calculateChangedFields(previousConfig, currentConfig);\n\n const { versionId } = await createVersionWithRetry(\n mcpClientStore as unknown as VersionedStoreInterface,\n mcpClientId,\n 'mcpClientId',\n currentConfig,\n changedFields,\n { changeMessage },\n );\n\n const version = await mcpClientStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(500, { message: 'Failed to retrieve created version' });\n }\n\n await enforceRetentionLimit(\n mcpClientStore as unknown as VersionedStoreInterface,\n mcpClientId,\n 'mcpClientId',\n mcpClient.activeVersionId,\n );\n\n return version;\n } catch (error) {\n return handleError(error, 'Error creating MCP client version');\n }\n },\n});\n\n/**\n * GET /stored/mcp-clients/:mcpClientId/versions/:versionId - Get a specific version\n */\nexport const GET_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/mcp-clients/:mcpClientId/versions/:versionId',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionIdPathParams,\n responseSchema: getMCPClientVersionResponseSchema,\n summary: 'Get MCP client version',\n description: 'Returns a specific version of an MCP client by its version ID',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const version = await mcpClientStore.getVersion(versionId);\n\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n\n if (version.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${versionId} not found for MCP client ${mcpClientId}`,\n });\n }\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n return version;\n } catch (error) {\n return handleError(error, 'Error getting MCP client version');\n }\n },\n});\n\n/**\n * POST /stored/mcp-clients/:mcpClientId/versions/:versionId/activate - Set a version as active\n */\nexport const ACTIVATE_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/mcp-clients/:mcpClientId/versions/:versionId/activate',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionIdPathParams,\n responseSchema: activateMCPClientVersionResponseSchema,\n summary: 'Activate MCP client version',\n description: 'Sets a specific version as the active version for the MCP client',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const version = await mcpClientStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (version.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${versionId} not found for MCP client ${mcpClientId}`,\n });\n }\n\n await mcpClientStore.update({\n id: mcpClientId,\n activeVersionId: versionId,\n status: 'published',\n });\n\n // Clear the editor cache so subsequent requests see the new active version\n mastra.getEditor()?.mcp.clearCache(mcpClientId);\n\n return {\n success: true,\n message: `Version ${version.versionNumber} is now active`,\n activeVersionId: versionId,\n };\n } catch (error) {\n return handleError(error, 'Error activating MCP client version');\n }\n },\n});\n\n/**\n * POST /stored/mcp-clients/:mcpClientId/versions/:versionId/restore - Restore MCP client to a version\n */\nexport const RESTORE_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/mcp-clients/:mcpClientId/versions/:versionId/restore',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionIdPathParams,\n responseSchema: restoreMCPClientVersionResponseSchema,\n summary: 'Restore MCP client version',\n description: 'Restores the MCP client configuration from a version, creating a new version',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const versionToRestore = await mcpClientStore.getVersion(versionId);\n if (!versionToRestore) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (versionToRestore.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${versionId} not found for MCP client ${mcpClientId}`,\n });\n }\n\n const restoredConfig = extractConfigFromVersion(\n versionToRestore as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n\n await mcpClientStore.update({\n id: mcpClientId,\n ...restoredConfig,\n });\n\n const latestVersion = await mcpClientStore.getLatestVersion(mcpClientId);\n const previousConfig = latestVersion\n ? extractConfigFromVersion(\n latestVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n )\n : null;\n\n const changedFields = calculateChangedFields(previousConfig, restoredConfig);\n\n const { versionId: newVersionId } = await createVersionWithRetry(\n mcpClientStore as unknown as VersionedStoreInterface,\n mcpClientId,\n 'mcpClientId',\n restoredConfig,\n changedFields,\n {\n changeMessage: `Restored from version ${versionToRestore.versionNumber}`,\n },\n );\n\n const newVersion = await mcpClientStore.getVersion(newVersionId);\n if (!newVersion) {\n throw new HTTPException(500, { message: 'Failed to retrieve created version' });\n }\n\n await enforceRetentionLimit(\n mcpClientStore as unknown as VersionedStoreInterface,\n mcpClientId,\n 'mcpClientId',\n mcpClient.activeVersionId,\n );\n\n // Clear the editor cache so subsequent requests see the updated config\n mastra.getEditor()?.mcp.clearCache(mcpClientId);\n\n return newVersion;\n } catch (error) {\n return handleError(error, 'Error restoring MCP client version');\n }\n },\n});\n\n/**\n * DELETE /stored/mcp-clients/:mcpClientId/versions/:versionId - Delete a version\n */\nexport const DELETE_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'DELETE',\n path: '/stored/mcp-clients/:mcpClientId/versions/:versionId',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionIdPathParams,\n responseSchema: deleteMCPClientVersionResponseSchema,\n summary: 'Delete MCP client version',\n description: 'Deletes a specific version (cannot delete the active version)',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const version = await mcpClientStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (version.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${versionId} not found for MCP client ${mcpClientId}`,\n });\n }\n\n if (mcpClient.activeVersionId === versionId) {\n throw new HTTPException(400, {\n message: 'Cannot delete the active version. Activate a different version first.',\n });\n }\n\n await mcpClientStore.deleteVersion(versionId);\n\n // Clear the editor cache so subsequent requests see the updated config\n mastra.getEditor()?.mcp.clearCache(mcpClientId);\n\n return {\n success: true,\n message: `Version ${version.versionNumber} deleted successfully`,\n };\n } catch (error) {\n return handleError(error, 'Error deleting MCP client version');\n }\n },\n});\n\n/**\n * GET /stored/mcp-clients/:mcpClientId/versions/compare - Compare two versions\n */\nexport const COMPARE_MCP_CLIENT_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/mcp-clients/:mcpClientId/versions/compare',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionPathParams,\n queryParamSchema: compareMCPClientVersionsQuerySchema,\n responseSchema: compareMCPClientVersionsResponseSchema,\n summary: 'Compare MCP client versions',\n description: 'Compares two versions and returns the differences between them',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, from, to, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const fromVersion = await mcpClientStore.getVersion(from);\n if (!fromVersion) {\n throw new HTTPException(404, { message: `Version with id ${from} not found` });\n }\n if (fromVersion.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${from} not found for MCP client ${mcpClientId}`,\n });\n }\n\n const toVersion = await mcpClientStore.getVersion(to);\n if (!toVersion) {\n throw new HTTPException(404, { message: `Version with id ${to} not found` });\n }\n if (toVersion.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${to} not found for MCP client ${mcpClientId}`,\n });\n }\n\n const fromConfig = extractConfigFromVersion(\n fromVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n const toConfig = extractConfigFromVersion(\n toVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n\n const diffs = computeVersionDiffs(fromConfig, toConfig);\n\n return {\n diffs,\n fromVersion,\n toVersion,\n };\n } catch (error) {\n return handleError(error, 'Error comparing MCP client versions');\n }\n },\n});\n"],"mappings":";;;;;;;;;;AAgCA,MAAa,iCAAiC,YAAY;CACxD,QAAQ;CACR,MAAM;CACN,cAAc;CACd,cAAc;CACd,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,SAAS;CACT,aAAa;CACb,MAAM,CAAC,qBAAqB;CAC5B,SAAS,OAAO,EAAE,QAAQ,aAAa,MAAM,SAAS,SAAS,qBAAqB;EAClF,IAAI;GACF,MAAM,UAAU,OAAO,WAAW;GAElC,IAAI,CAAC,SACH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,4BAA4B,CAAC;GAGvE,MAAM,iBAAiB,MAAM,QAAQ,SAAS,YAAY;GAC1D,IAAI,CAAC,gBACH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,8CAA8C,CAAC;GAGzF,MAAM,YAAY,MAAM,eAAe,QAAQ,WAAW;GAC1D,IA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":3,"file":"mcp-client-versions.js","names":[],"sources":["../../../src/server/handlers/mcp-client-versions.ts"],"sourcesContent":["import { HTTPException } from '../http-exception';\nimport {\n mcpClientVersionPathParams,\n mcpClientVersionIdPathParams,\n listMCPClientVersionsQuerySchema,\n createMCPClientVersionBodySchema,\n compareMCPClientVersionsQuerySchema,\n listMCPClientVersionsResponseSchema,\n getMCPClientVersionResponseSchema,\n createMCPClientVersionResponseSchema,\n activateMCPClientVersionResponseSchema,\n restoreMCPClientVersionResponseSchema,\n deleteMCPClientVersionResponseSchema,\n compareMCPClientVersionsResponseSchema,\n} from '../schemas/mcp-client-versions';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { assertStoredResourceScope, getStoredResourceScope } from '../utils';\n\nimport { handleError } from './error';\nimport {\n extractConfigFromVersion,\n calculateChangedFields,\n computeVersionDiffs,\n createVersionWithRetry,\n enforceRetentionLimit,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n} from './version-helpers';\nimport type { VersionedStoreInterface } from './version-helpers';\n\n/**\n * GET /stored/mcp-clients/:mcpClientId/versions - List all versions for an MCP client\n */\nexport const LIST_MCP_CLIENT_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/mcp-clients/:mcpClientId/versions',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionPathParams,\n queryParamSchema: listMCPClientVersionsQuerySchema,\n responseSchema: listMCPClientVersionsResponseSchema,\n summary: 'List MCP client versions',\n description: 'Returns a paginated list of all versions for a stored MCP client',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, page, perPage, orderBy, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const result = await mcpClientStore.listVersions({\n mcpClientId,\n page,\n perPage,\n orderBy,\n });\n\n return result;\n } catch (error) {\n return handleError(error, 'Error listing MCP client versions');\n }\n },\n});\n\n/**\n * POST /stored/mcp-clients/:mcpClientId/versions - Create a new version snapshot\n */\nexport const CREATE_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/mcp-clients/:mcpClientId/versions',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionPathParams,\n bodySchema: createMCPClientVersionBodySchema,\n responseSchema: createMCPClientVersionResponseSchema,\n summary: 'Create MCP client version',\n description: 'Creates a new version snapshot of the current MCP client configuration',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, changeMessage, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n let currentConfig: Record<string, unknown> = {};\n if (mcpClient.activeVersionId) {\n const activeVersion = await mcpClientStore.getVersion(mcpClient.activeVersionId);\n if (activeVersion) {\n currentConfig = extractConfigFromVersion(\n activeVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n }\n }\n\n const latestVersion = await mcpClientStore.getLatestVersion(mcpClientId);\n\n // If no activeVersionId, fall back to latest version config\n if (!mcpClient.activeVersionId && latestVersion) {\n currentConfig = extractConfigFromVersion(\n latestVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n }\n const previousConfig = latestVersion\n ? extractConfigFromVersion(\n latestVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n )\n : null;\n\n const changedFields = calculateChangedFields(previousConfig, currentConfig);\n\n const { versionId } = await createVersionWithRetry(\n mcpClientStore as unknown as VersionedStoreInterface,\n mcpClientId,\n 'mcpClientId',\n currentConfig,\n changedFields,\n { changeMessage },\n );\n\n const version = await mcpClientStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(500, { message: 'Failed to retrieve created version' });\n }\n\n await enforceRetentionLimit(\n mcpClientStore as unknown as VersionedStoreInterface,\n mcpClientId,\n 'mcpClientId',\n mcpClient.activeVersionId,\n );\n\n return version;\n } catch (error) {\n return handleError(error, 'Error creating MCP client version');\n }\n },\n});\n\n/**\n * GET /stored/mcp-clients/:mcpClientId/versions/:versionId - Get a specific version\n */\nexport const GET_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/mcp-clients/:mcpClientId/versions/:versionId',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionIdPathParams,\n responseSchema: getMCPClientVersionResponseSchema,\n summary: 'Get MCP client version',\n description: 'Returns a specific version of an MCP client by its version ID',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const version = await mcpClientStore.getVersion(versionId);\n\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n\n if (version.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${versionId} not found for MCP client ${mcpClientId}`,\n });\n }\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n return version;\n } catch (error) {\n return handleError(error, 'Error getting MCP client version');\n }\n },\n});\n\n/**\n * POST /stored/mcp-clients/:mcpClientId/versions/:versionId/activate - Set a version as active\n */\nexport const ACTIVATE_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/mcp-clients/:mcpClientId/versions/:versionId/activate',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionIdPathParams,\n responseSchema: activateMCPClientVersionResponseSchema,\n summary: 'Activate MCP client version',\n description: 'Sets a specific version as the active version for the MCP client',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const version = await mcpClientStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (version.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${versionId} not found for MCP client ${mcpClientId}`,\n });\n }\n\n await mcpClientStore.update({\n id: mcpClientId,\n activeVersionId: versionId,\n status: 'published',\n });\n\n // Clear the editor cache so subsequent requests see the new active version\n mastra.getEditor()?.mcp.clearCache(mcpClientId);\n\n return {\n success: true,\n message: `Version ${version.versionNumber} is now active`,\n activeVersionId: versionId,\n };\n } catch (error) {\n return handleError(error, 'Error activating MCP client version');\n }\n },\n});\n\n/**\n * POST /stored/mcp-clients/:mcpClientId/versions/:versionId/restore - Restore MCP client to a version\n */\nexport const RESTORE_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'POST',\n path: '/stored/mcp-clients/:mcpClientId/versions/:versionId/restore',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionIdPathParams,\n responseSchema: restoreMCPClientVersionResponseSchema,\n summary: 'Restore MCP client version',\n description: 'Restores the MCP client configuration from a version, creating a new version',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const versionToRestore = await mcpClientStore.getVersion(versionId);\n if (!versionToRestore) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (versionToRestore.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${versionId} not found for MCP client ${mcpClientId}`,\n });\n }\n\n const restoredConfig = extractConfigFromVersion(\n versionToRestore as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n\n await mcpClientStore.update({\n id: mcpClientId,\n ...restoredConfig,\n });\n\n const latestVersion = await mcpClientStore.getLatestVersion(mcpClientId);\n const previousConfig = latestVersion\n ? extractConfigFromVersion(\n latestVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n )\n : null;\n\n const changedFields = calculateChangedFields(previousConfig, restoredConfig);\n\n const { versionId: newVersionId } = await createVersionWithRetry(\n mcpClientStore as unknown as VersionedStoreInterface,\n mcpClientId,\n 'mcpClientId',\n restoredConfig,\n changedFields,\n {\n changeMessage: `Restored from version ${versionToRestore.versionNumber}`,\n },\n );\n\n const newVersion = await mcpClientStore.getVersion(newVersionId);\n if (!newVersion) {\n throw new HTTPException(500, { message: 'Failed to retrieve created version' });\n }\n\n await enforceRetentionLimit(\n mcpClientStore as unknown as VersionedStoreInterface,\n mcpClientId,\n 'mcpClientId',\n mcpClient.activeVersionId,\n );\n\n // Clear the editor cache so subsequent requests see the updated config\n mastra.getEditor()?.mcp.clearCache(mcpClientId);\n\n return newVersion;\n } catch (error) {\n return handleError(error, 'Error restoring MCP client version');\n }\n },\n});\n\n/**\n * DELETE /stored/mcp-clients/:mcpClientId/versions/:versionId - Delete a version\n */\nexport const DELETE_MCP_CLIENT_VERSION_ROUTE = createRoute({\n method: 'DELETE',\n path: '/stored/mcp-clients/:mcpClientId/versions/:versionId',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionIdPathParams,\n responseSchema: deleteMCPClientVersionResponseSchema,\n summary: 'Delete MCP client version',\n description: 'Deletes a specific version (cannot delete the active version)',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, versionId, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n if (!mcpClient) {\n throw new HTTPException(404, { message: `MCP client with id ${mcpClientId} not found` });\n }\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const version = await mcpClientStore.getVersion(versionId);\n if (!version) {\n throw new HTTPException(404, { message: `Version with id ${versionId} not found` });\n }\n if (version.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${versionId} not found for MCP client ${mcpClientId}`,\n });\n }\n\n if (mcpClient.activeVersionId === versionId) {\n throw new HTTPException(400, {\n message: 'Cannot delete the active version. Activate a different version first.',\n });\n }\n\n await mcpClientStore.deleteVersion(versionId);\n\n // Clear the editor cache so subsequent requests see the updated config\n mastra.getEditor()?.mcp.clearCache(mcpClientId);\n\n return {\n success: true,\n message: `Version ${version.versionNumber} deleted successfully`,\n };\n } catch (error) {\n return handleError(error, 'Error deleting MCP client version');\n }\n },\n});\n\n/**\n * GET /stored/mcp-clients/:mcpClientId/versions/compare - Compare two versions\n */\nexport const COMPARE_MCP_CLIENT_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/stored/mcp-clients/:mcpClientId/versions/compare',\n requiresAuth: true,\n responseType: 'json',\n pathParamSchema: mcpClientVersionPathParams,\n queryParamSchema: compareMCPClientVersionsQuerySchema,\n responseSchema: compareMCPClientVersionsResponseSchema,\n summary: 'Compare MCP client versions',\n description: 'Compares two versions and returns the differences between them',\n tags: ['MCP Client Versions'],\n handler: async ({ mastra, mcpClientId, from, to, requestContext }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const mcpClientStore = await storage.getStore('mcpClients');\n if (!mcpClientStore) {\n throw new HTTPException(500, { message: 'MCP clients storage domain is not available' });\n }\n const mcpClient = await mcpClientStore.getById(mcpClientId);\n assertStoredResourceScope(mcpClient, await getStoredResourceScope(mastra, requestContext));\n\n const fromVersion = await mcpClientStore.getVersion(from);\n if (!fromVersion) {\n throw new HTTPException(404, { message: `Version with id ${from} not found` });\n }\n if (fromVersion.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${from} not found for MCP client ${mcpClientId}`,\n });\n }\n\n const toVersion = await mcpClientStore.getVersion(to);\n if (!toVersion) {\n throw new HTTPException(404, { message: `Version with id ${to} not found` });\n }\n if (toVersion.mcpClientId !== mcpClientId) {\n throw new HTTPException(404, {\n message: `Version with id ${to} not found for MCP client ${mcpClientId}`,\n });\n }\n\n const fromConfig = extractConfigFromVersion(\n fromVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n const toConfig = extractConfigFromVersion(\n toVersion as unknown as Record<string, unknown>,\n MCP_CLIENT_SNAPSHOT_CONFIG_FIELDS,\n );\n\n const diffs = computeVersionDiffs(fromConfig, toConfig);\n\n return {\n diffs,\n fromVersion,\n toVersion,\n };\n } catch (error) {\n return handleError(error, 'Error comparing MCP client versions');\n }\n },\n});\n"],"mappings":";;;;;;;;;;AAgCA,MAAa,iCAAiC,YAAY;CACxD,QAAQ;CACR,MAAM;CACN,cAAc;CACd,cAAc;CACd,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,SAAS;CACT,aAAa;CACb,MAAM,CAAC,qBAAqB;CAC5B,SAAS,OAAO,EAAE,QAAQ,aAAa,MAAM,SAAS,SAAS,qBAAqB;EAClF,IAAI;GACF,MAAM,UAAU,OAAO,WAAW;GAElC,IAAI,CAAC,SACH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,4BAA4B,CAAC;GAGvE,MAAM,iBAAiB,MAAM,QAAQ,SAAS,YAAY;GAC1D,IAAI,CAAC,gBACH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,8CAA8C,CAAC;GAGzF,MAAM,YAAY,MAAM,eAAe,QAAQ,WAAW;GAC1D,IAAI,CAAC,WACH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,sBAAsB,YAAY,YAAY,CAAC;GAEzF,0BAA0B,WAAW,MAAM,uBAAuB,QAAQ,cAAc,CAAC;GASzF,OAAO,MAPc,eAAe,aAAa;IAC/C;IACA;IACA;IACA;GACF,CAAC;EAGH,SAAS,OAAO;GACd,OAAO,YAAY,OAAO,mCAAmC;EAC/D;CACF;AACF,CAAC;;;;AAKD,MAAa,kCAAkC,YAAY;CACzD,QAAQ;CACR,MAAM;CACN,cAAc;CACd,cAAc;CACd,iBAAiB;CACjB,YAAY;CACZ,gBAAgB;CAChB,SAAS;CACT,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18
|
-
READ_MCP_SERVER_RESOURCE_ROUTE: () => READ_MCP_SERVER_RESOURCE_ROUTE
|
|
19
|
-
});
|
|
20
|
-
/**
|
|
21
|
-
* Only `@mastra/mcp` 1.x servers implement the standalone HTTP+SSE transport; on a
|
|
22
|
-
* 2026-07-28 server the inherited `startSSE`/`startHonoSSE` throw.
|
|
23
|
-
*/
|
|
24
|
-
function hasSSETransport(server) {
|
|
25
|
-
return server.mcpVersion !== 2;
|
|
26
|
-
}
|
|
27
|
-
function transportsOf(server) {
|
|
28
|
-
return hasSSETransport(server) ? ["streamable-http", "sse"] : ["streamable-http"];
|
|
29
|
-
}
|
|
30
|
-
const LIST_MCP_SERVERS_ROUTE = require_route_builder.createRoute({
|
|
31
|
-
method: "GET",
|
|
32
|
-
path: "/mcp/v0/servers",
|
|
33
|
-
responseType: "json",
|
|
34
|
-
queryParamSchema: require_mcp.listMcpServersQuerySchema,
|
|
35
|
-
responseSchema: require_mcp.listMcpServersResponseSchema,
|
|
36
|
-
summary: "List MCP servers",
|
|
37
|
-
description: "Returns a list of registered MCP servers with pagination support",
|
|
38
|
-
tags: ["MCP"],
|
|
39
|
-
requiresAuth: true,
|
|
40
|
-
handler: async ({ mastra, routePrefix, page, perPage, limit, offset }) => {
|
|
41
|
-
if (!mastra || typeof mastra.listMCPServers !== "function") throw new require_http_exception.HTTPException(500, { message: "Mastra instance or listMCPServers method not available" });
|
|
42
|
-
const servers = mastra.listMCPServers();
|
|
43
|
-
if (!servers) return {
|
|
44
|
-
servers: [],
|
|
45
|
-
total_count: 0,
|
|
46
|
-
next: null
|
|
47
|
-
};
|
|
48
|
-
const serverList = Object.values(servers);
|
|
49
|
-
const totalCount = serverList.length;
|
|
50
|
-
const useLegacyFormat = (limit !== void 0 || offset !== void 0) && page === void 0 && perPage === void 0;
|
|
51
|
-
const finalPerPage = perPage ?? limit;
|
|
52
|
-
let finalPage = page;
|
|
53
|
-
if (finalPage === void 0 && offset !== void 0 && finalPerPage !== void 0 && finalPerPage > 0) finalPage = Math.floor(offset / finalPerPage);
|
|
54
|
-
const actualOffset = finalPage !== void 0 && finalPerPage !== void 0 ? finalPage * finalPerPage : 0;
|
|
55
|
-
let paginatedServers = serverList;
|
|
56
|
-
let nextUrl = null;
|
|
57
|
-
if (finalPerPage !== void 0) {
|
|
58
|
-
paginatedServers = serverList.slice(actualOffset, actualOffset + finalPerPage);
|
|
59
|
-
if (actualOffset + finalPerPage < totalCount) {
|
|
60
|
-
const nextPage = (finalPage ?? 0) + 1;
|
|
61
|
-
const prefix = routePrefix ?? "";
|
|
62
|
-
if (useLegacyFormat) nextUrl = `${prefix}/mcp/v0/servers?limit=${finalPerPage}&offset=${actualOffset + finalPerPage}`;
|
|
63
|
-
else nextUrl = `${prefix}/mcp/v0/servers?perPage=${finalPerPage}&page=${nextPage}`;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
servers: paginatedServers.map((server) => ({
|
|
68
|
-
...server.getServerInfo(),
|
|
69
|
-
transports: transportsOf(server)
|
|
70
|
-
})),
|
|
71
|
-
total_count: totalCount,
|
|
72
|
-
next: nextUrl
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
const GET_MCP_SERVER_DETAIL_ROUTE = require_route_builder.createRoute({
|
|
77
|
-
method: "GET",
|
|
78
|
-
path: "/mcp/v0/servers/:id",
|
|
79
|
-
responseType: "json",
|
|
80
|
-
pathParamSchema: require_mcp.mcpServerDetailPathParams,
|
|
81
|
-
queryParamSchema: require_mcp.getMcpServerDetailQuerySchema,
|
|
82
|
-
responseSchema: require_mcp.serverDetailSchema,
|
|
83
|
-
summary: "Get MCP server details",
|
|
84
|
-
description: "Returns detailed information about a specific MCP server",
|
|
85
|
-
tags: ["MCP"],
|
|
86
|
-
requiresAuth: true,
|
|
87
|
-
handler: async ({ mastra, id, version }) => {
|
|
88
|
-
if (!mastra || typeof mastra.getMCPServerById !== "function") throw new require_http_exception.HTTPException(500, { message: "Mastra instance or getMCPServerById method not available" });
|
|
89
|
-
const server = mastra.getMCPServerById(id);
|
|
90
|
-
if (!server) throw new require_http_exception.HTTPException(404, { message: `MCP server with ID '${id}' not found` });
|
|
91
|
-
const serverDetail = {
|
|
92
|
-
...server.getServerDetail(),
|
|
93
|
-
transports: transportsOf(server)
|
|
94
|
-
};
|
|
95
|
-
if (version && serverDetail.version_detail.version !== version) throw new require_http_exception.HTTPException(404, { message: `MCP server with ID '${id}' found, but not version '${version}'. Available version: ${serverDetail.version_detail.version}` });
|
|
96
|
-
return serverDetail;
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
const LIST_MCP_SERVER_TOOLS_ROUTE = require_route_builder.createRoute({
|
|
100
|
-
method: "GET",
|
|
101
|
-
path: "/mcp/:serverId/tools",
|
|
102
|
-
responseType: "json",
|
|
103
|
-
pathParamSchema: require_mcp.mcpServerIdPathParams,
|
|
104
|
-
responseSchema: require_mcp.listMcpServerToolsResponseSchema,
|
|
105
|
-
summary: "List MCP server tools",
|
|
106
|
-
description: "Returns a list of tools available on the specified MCP server",
|
|
107
|
-
tags: ["MCP"],
|
|
108
|
-
requiresAuth: true,
|
|
109
|
-
handler: async ({ mastra, serverId, requestContext }) => {
|
|
110
|
-
if (!mastra || typeof mastra.getMCPServerById !== "function") throw new require_http_exception.HTTPException(500, { message: "Mastra instance or getMCPServerById method not available" });
|
|
111
|
-
const server = mastra.getMCPServerById(serverId);
|
|
112
|
-
if (!server) throw new require_http_exception.HTTPException(404, { message: `MCP server with ID '${serverId}' not found` });
|
|
113
|
-
if (typeof server.getToolListInfo !== "function") throw new require_http_exception.HTTPException(501, { message: `Server '${serverId}' cannot list tools in this way.` });
|
|
114
|
-
return await server.getToolListInfo(requestContext);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
const GET_MCP_SERVER_TOOL_DETAIL_ROUTE = require_route_builder.createRoute({
|
|
118
|
-
method: "GET",
|
|
119
|
-
path: "/mcp/:serverId/tools/:toolId",
|
|
120
|
-
responseType: "json",
|
|
121
|
-
pathParamSchema: require_mcp.mcpServerToolPathParams,
|
|
122
|
-
responseSchema: require_mcp.mcpToolInfoSchema,
|
|
123
|
-
summary: "Get MCP server tool details",
|
|
124
|
-
description: "Returns detailed information about a specific tool on the MCP server",
|
|
125
|
-
tags: ["MCP"],
|
|
126
|
-
requiresAuth: true,
|
|
127
|
-
handler: async ({ mastra, serverId, toolId }) => {
|
|
128
|
-
if (!mastra || typeof mastra.getMCPServerById !== "function") throw new require_http_exception.HTTPException(500, { message: "Mastra instance or getMCPServerById method not available" });
|
|
129
|
-
const server = mastra.getMCPServerById(serverId);
|
|
130
|
-
if (!server) throw new require_http_exception.HTTPException(404, { message: `MCP server with ID '${serverId}' not found` });
|
|
131
|
-
if (typeof server.getToolInfo !== "function") throw new require_http_exception.HTTPException(501, { message: `Server '${serverId}' cannot provide tool details in this way.` });
|
|
132
|
-
const toolInfo = await server.getToolInfo(toolId);
|
|
133
|
-
if (!toolInfo) throw new require_http_exception.HTTPException(404, { message: `Tool with ID '${toolId}' not found on MCP server '${serverId}'` });
|
|
134
|
-
return toolInfo;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
const EXECUTE_MCP_SERVER_TOOL_ROUTE = require_route_builder.createRoute({
|
|
138
|
-
method: "POST",
|
|
139
|
-
path: "/mcp/:serverId/tools/:toolId/execute",
|
|
140
|
-
responseType: "json",
|
|
141
|
-
pathParamSchema: require_mcp.mcpServerToolPathParams,
|
|
142
|
-
bodySchema: require_mcp.executeToolBodySchema,
|
|
143
|
-
responseSchema: require_mcp.executeToolResponseSchema,
|
|
144
|
-
summary: "Execute MCP server tool",
|
|
145
|
-
description: "Executes a tool on the specified MCP server with the provided arguments",
|
|
146
|
-
tags: ["MCP"],
|
|
147
|
-
requiresAuth: true,
|
|
148
|
-
handler: async ({ mastra, serverId, toolId, data, resumeData, suspendPayload, requestContext }) => {
|
|
149
|
-
if (!mastra || typeof mastra.getMCPServerById !== "function") throw new require_http_exception.HTTPException(500, { message: "Mastra instance or getMCPServerById method not available" });
|
|
150
|
-
const server = mastra.getMCPServerById(serverId);
|
|
151
|
-
if (!server) throw new require_http_exception.HTTPException(404, { message: `MCP server with ID '${serverId}' not found` });
|
|
152
|
-
if (typeof server.executeTool !== "function") throw new require_http_exception.HTTPException(501, { message: `Server '${serverId}' cannot execute tools in this way.` });
|
|
153
|
-
if (server.mcpVersion === 2) {
|
|
154
|
-
let execution;
|
|
155
|
-
try {
|
|
156
|
-
execution = await server.executeTool(toolId, data, {
|
|
157
|
-
requestContext,
|
|
158
|
-
resumeData,
|
|
159
|
-
suspendPayload
|
|
160
|
-
});
|
|
161
|
-
} catch (error) {
|
|
162
|
-
if (error instanceof _mastra_core_error.MastraError && error.id === "MCP_SERVER_TOOL_INVALID_INPUT") throw new require_http_exception.HTTPException(400, {
|
|
163
|
-
message: error.message,
|
|
164
|
-
cause: error
|
|
165
|
-
});
|
|
166
|
-
throw error;
|
|
167
|
-
}
|
|
168
|
-
if (execution.status === "suspended") return {
|
|
169
|
-
status: "suspended",
|
|
170
|
-
suspendPayload: execution.suspendPayload,
|
|
171
|
-
resumeSchema: execution.resumeSchema
|
|
172
|
-
};
|
|
173
|
-
return { result: execution.output };
|
|
174
|
-
}
|
|
175
|
-
return { result: await server.executeTool(toolId, data, { requestContext }) };
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
const LIST_MCP_SERVER_RESOURCES_ROUTE = require_route_builder.createRoute({
|
|
179
|
-
method: "GET",
|
|
180
|
-
path: "/mcp/:serverId/resources",
|
|
181
|
-
responseType: "json",
|
|
182
|
-
pathParamSchema: require_mcp.mcpServerResourcePathParams,
|
|
183
|
-
responseSchema: require_mcp.listResourcesResponseSchema,
|
|
184
|
-
summary: "List MCP server resources",
|
|
185
|
-
description: "Returns a list of resources available on the MCP server, including ui:// app resources",
|
|
186
|
-
tags: ["MCP"],
|
|
187
|
-
requiresAuth: true,
|
|
188
|
-
handler: async ({ mastra, serverId }) => {
|
|
189
|
-
if (!mastra || typeof mastra.getMCPServerById !== "function") throw new require_http_exception.HTTPException(500, { message: "Mastra instance or getMCPServerById method not available" });
|
|
190
|
-
const server = mastra.getMCPServerById(serverId);
|
|
191
|
-
if (!server) throw new require_http_exception.HTTPException(404, { message: `MCP server with ID '${serverId}' not found` });
|
|
192
|
-
if (typeof server.listResources !== "function") return { resources: [] };
|
|
193
|
-
return server.listResources();
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
const READ_MCP_SERVER_RESOURCE_ROUTE = require_route_builder.createRoute({
|
|
197
|
-
method: "POST",
|
|
198
|
-
path: "/mcp/:serverId/resources/read",
|
|
199
|
-
responseType: "json",
|
|
200
|
-
pathParamSchema: require_mcp.mcpServerResourcePathParams,
|
|
201
|
-
bodySchema: require_mcp.readResourceBodySchema,
|
|
202
|
-
responseSchema: require_mcp.readResourceResponseSchema,
|
|
203
|
-
summary: "Read MCP server resource content",
|
|
204
|
-
description: "Reads the content of a resource by URI, used for rendering MCP App ui:// resources",
|
|
205
|
-
tags: ["MCP"],
|
|
206
|
-
requiresAuth: true,
|
|
207
|
-
handler: async ({ mastra, serverId, uri }) => {
|
|
208
|
-
if (!mastra || typeof mastra.getMCPServerById !== "function") throw new require_http_exception.HTTPException(500, { message: "Mastra instance or getMCPServerById method not available" });
|
|
209
|
-
const server = mastra.getMCPServerById(serverId);
|
|
210
|
-
if (!server) throw new require_http_exception.HTTPException(404, { message: `MCP server with ID '${serverId}' not found` });
|
|
211
|
-
if (typeof server.readResource !== "function") throw new require_http_exception.HTTPException(501, { message: `Server '${serverId}' does not support reading resources` });
|
|
212
|
-
try {
|
|
213
|
-
return await server.readResource(uri);
|
|
214
|
-
} catch (error) {
|
|
215
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
216
|
-
if (message.includes("not found") || message.includes("not configured")) throw new require_http_exception.HTTPException(404, { message: `Resource '${uri}' not found on server '${serverId}'` });
|
|
217
|
-
throw error;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
const MCP_HTTP_TRANSPORT_ROUTE = require_route_builder.createRoute({
|
|
222
|
-
method: "ALL",
|
|
223
|
-
path: "/mcp/:serverId/mcp",
|
|
224
|
-
responseType: "mcp-http",
|
|
225
|
-
pathParamSchema: require_mcp.mcpServerIdPathParams,
|
|
226
|
-
summary: "MCP HTTP Transport",
|
|
227
|
-
description: "Streamable HTTP transport endpoint for MCP protocol communication",
|
|
228
|
-
tags: ["MCP"],
|
|
229
|
-
requiresAuth: true,
|
|
230
|
-
handler: async ({ mastra, serverId }) => {
|
|
231
|
-
if (!mastra || typeof mastra.getMCPServerById !== "function") throw new require_http_exception.HTTPException(500, { message: "Mastra instance or getMCPServerById method not available" });
|
|
232
|
-
const server = mastra.getMCPServerById(serverId);
|
|
233
|
-
if (!server) throw new require_http_exception.HTTPException(404, { message: `MCP server '${serverId}' not found` });
|
|
234
|
-
return {
|
|
235
|
-
server,
|
|
236
|
-
httpPath: `/mcp/${serverId}/mcp`
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
const MCP_SSE_TRANSPORT_ROUTE = require_route_builder.createRoute({
|
|
241
|
-
method: "ALL",
|
|
242
|
-
path: "/mcp/:serverId/sse",
|
|
243
|
-
responseType: "mcp-sse",
|
|
244
|
-
pathParamSchema: require_mcp.mcpServerIdPathParams,
|
|
245
|
-
summary: "MCP SSE Transport",
|
|
246
|
-
description: "SSE transport endpoint for MCP protocol communication",
|
|
247
|
-
tags: ["MCP"],
|
|
248
|
-
requiresAuth: true,
|
|
249
|
-
handler: async ({ mastra, serverId }) => {
|
|
250
|
-
if (!mastra || typeof mastra.getMCPServerById !== "function") throw new require_http_exception.HTTPException(500, { message: "Mastra instance or getMCPServerById method not available" });
|
|
251
|
-
const server = mastra.getMCPServerById(serverId);
|
|
252
|
-
if (!server) throw new require_http_exception.HTTPException(404, { message: `MCP server '${serverId}' not found` });
|
|
253
|
-
if (!hasSSETransport(server)) throw new require_http_exception.HTTPException(404, { message: "Legacy SSE transport is unavailable for MCP v2 servers" });
|
|
254
|
-
return {
|
|
255
|
-
server,
|
|
256
|
-
ssePath: `/mcp/${serverId}/sse`,
|
|
257
|
-
messagePath: `/mcp/${serverId}/messages`
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
const MCP_SSE_MESSAGES_ROUTE = require_route_builder.createRoute({
|
|
262
|
-
method: "POST",
|
|
263
|
-
path: "/mcp/:serverId/messages",
|
|
264
|
-
responseType: "mcp-sse",
|
|
265
|
-
pathParamSchema: require_mcp.mcpServerIdPathParams,
|
|
266
|
-
summary: "MCP SSE Messages",
|
|
267
|
-
description: "Message endpoint for SSE transport (posts messages to active SSE streams)",
|
|
268
|
-
tags: ["MCP"],
|
|
269
|
-
requiresAuth: true,
|
|
270
|
-
handler: MCP_SSE_TRANSPORT_ROUTE.handler
|
|
271
|
-
});
|
|
272
|
-
//#endregion
|
|
273
|
-
exports.EXECUTE_MCP_SERVER_TOOL_ROUTE = EXECUTE_MCP_SERVER_TOOL_ROUTE;
|
|
274
|
-
exports.GET_MCP_SERVER_DETAIL_ROUTE = GET_MCP_SERVER_DETAIL_ROUTE;
|
|
275
|
-
exports.GET_MCP_SERVER_TOOL_DETAIL_ROUTE = GET_MCP_SERVER_TOOL_DETAIL_ROUTE;
|
|
276
|
-
exports.LIST_MCP_SERVERS_ROUTE = LIST_MCP_SERVERS_ROUTE;
|
|
277
|
-
exports.LIST_MCP_SERVER_RESOURCES_ROUTE = LIST_MCP_SERVER_RESOURCES_ROUTE;
|
|
278
|
-
exports.LIST_MCP_SERVER_TOOLS_ROUTE = LIST_MCP_SERVER_TOOLS_ROUTE;
|
|
279
|
-
exports.MCP_HTTP_TRANSPORT_ROUTE = MCP_HTTP_TRANSPORT_ROUTE;
|
|
280
|
-
exports.MCP_SSE_MESSAGES_ROUTE = MCP_SSE_MESSAGES_ROUTE;
|
|
281
|
-
exports.MCP_SSE_TRANSPORT_ROUTE = MCP_SSE_TRANSPORT_ROUTE;
|
|
282
|
-
exports.READ_MCP_SERVER_RESOURCE_ROUTE = READ_MCP_SERVER_RESOURCE_ROUTE;
|
|
283
|
-
Object.defineProperty(exports, "mcp_exports", {
|
|
284
|
-
enumerable: true,
|
|
285
|
-
get: function() {
|
|
286
|
-
return mcp_exports;
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
//# sourceMappingURL=mcp.cjs.map
|
|
2
|
+
require("../../rolldown-runtime-BwC_XMyb.cjs");
|
|
3
|
+
const require_mcp = require("../../mcp-CWGJRqkC.cjs");
|
|
4
|
+
exports.EMIT_MCP_SERVER_EVENT_ROUTE = require_mcp.EMIT_MCP_SERVER_EVENT_ROUTE;
|
|
5
|
+
exports.EXECUTE_MCP_SERVER_TOOL_ROUTE = require_mcp.EXECUTE_MCP_SERVER_TOOL_ROUTE;
|
|
6
|
+
exports.GET_MCP_SERVER_DETAIL_ROUTE = require_mcp.GET_MCP_SERVER_DETAIL_ROUTE;
|
|
7
|
+
exports.GET_MCP_SERVER_TOOL_DETAIL_ROUTE = require_mcp.GET_MCP_SERVER_TOOL_DETAIL_ROUTE;
|
|
8
|
+
exports.LIST_MCP_SERVERS_ROUTE = require_mcp.LIST_MCP_SERVERS_ROUTE;
|
|
9
|
+
exports.LIST_MCP_SERVER_EVENTS_ROUTE = require_mcp.LIST_MCP_SERVER_EVENTS_ROUTE;
|
|
10
|
+
exports.LIST_MCP_SERVER_RESOURCES_ROUTE = require_mcp.LIST_MCP_SERVER_RESOURCES_ROUTE;
|
|
11
|
+
exports.LIST_MCP_SERVER_TOOLS_ROUTE = require_mcp.LIST_MCP_SERVER_TOOLS_ROUTE;
|
|
12
|
+
exports.MCP_HTTP_TRANSPORT_ROUTE = require_mcp.MCP_HTTP_TRANSPORT_ROUTE;
|
|
13
|
+
exports.MCP_SSE_MESSAGES_ROUTE = require_mcp.MCP_SSE_MESSAGES_ROUTE;
|
|
14
|
+
exports.MCP_SSE_TRANSPORT_ROUTE = require_mcp.MCP_SSE_TRANSPORT_ROUTE;
|
|
15
|
+
exports.POLL_MCP_SERVER_EVENT_ROUTE = require_mcp.POLL_MCP_SERVER_EVENT_ROUTE;
|
|
16
|
+
exports.READ_MCP_SERVER_RESOURCE_ROUTE = require_mcp.READ_MCP_SERVER_RESOURCE_ROUTE;
|
|
17
|
+
exports.STREAM_MCP_SERVER_EVENT_ROUTE = require_mcp.STREAM_MCP_SERVER_EVENT_ROUTE;
|