@mastra/core 1.0.0-beta.0 → 1.0.0-beta.10
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 +1136 -0
- package/dist/agent/agent-legacy.d.ts +19 -22
- package/dist/agent/agent-legacy.d.ts.map +1 -1
- package/dist/agent/agent-types.test-d.d.ts +2 -0
- package/dist/agent/agent-types.test-d.d.ts.map +1 -0
- package/dist/agent/agent.d.ts +6 -6
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.types.d.ts +6 -4
- package/dist/agent/agent.types.d.ts.map +1 -1
- package/dist/agent/index.cjs +9 -9
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +3 -3
- package/dist/agent/message-list/index.d.ts +60 -3
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/prompt/attachments-to-parts.d.ts.map +1 -1
- package/dist/agent/message-list/prompt/convert-file.d.ts +1 -1
- package/dist/agent/message-list/prompt/convert-file.d.ts.map +1 -1
- package/dist/agent/message-list/prompt/download-assets.d.ts.map +1 -1
- package/dist/agent/save-queue/index.d.ts +3 -1
- package/dist/agent/save-queue/index.d.ts.map +1 -1
- package/dist/agent/test-utils.d.ts +37 -0
- package/dist/agent/test-utils.d.ts.map +1 -1
- package/dist/agent/trip-wire.d.ts.map +1 -1
- package/dist/agent/types.d.ts +21 -6
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/utils.d.ts +3 -3
- package/dist/agent/utils.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +9 -7
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts +3 -3
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts +6 -5
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts +2 -1
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts +8 -8
- package/dist/agent/workflows/prepare-stream/schema.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts +11 -1
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts.map +1 -1
- package/dist/base.cjs +2 -2
- package/dist/base.js +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/cache/index.cjs +3 -3
- package/dist/cache/index.js +1 -1
- package/dist/{chunk-4CDL2QJT.js → chunk-267YOF47.js} +121 -36
- package/dist/chunk-267YOF47.js.map +1 -0
- package/dist/{chunk-OJNJA5ZI.js → chunk-3CKZSDTQ.js} +3 -3
- package/dist/{chunk-OJNJA5ZI.js.map → chunk-3CKZSDTQ.js.map} +1 -1
- package/dist/{chunk-JV2KH24V.js → chunk-3GKKHF36.js} +693 -375
- package/dist/chunk-3GKKHF36.js.map +1 -0
- package/dist/{chunk-TQTAMPSC.js → chunk-3N3QE4ZK.js} +3 -3
- package/dist/chunk-3N3QE4ZK.js.map +1 -0
- package/dist/{chunk-QUKUN6NR.cjs → chunk-4JKEUSCC.cjs} +107 -7
- package/dist/chunk-4JKEUSCC.cjs.map +1 -0
- package/dist/{chunk-XEVG546F.js → chunk-4Q3Z6QRE.js} +178 -12
- package/dist/chunk-4Q3Z6QRE.js.map +1 -0
- package/dist/{chunk-CBAB7GOD.cjs → chunk-6BJ7XHRH.cjs} +2 -2
- package/dist/{chunk-CBAB7GOD.cjs.map → chunk-6BJ7XHRH.cjs.map} +1 -1
- package/dist/{chunk-26SQQNMU.js → chunk-6CYYFT4O.js} +11389 -8193
- package/dist/chunk-6CYYFT4O.js.map +1 -0
- package/dist/{chunk-32CTMD2C.js → chunk-6ONQWD6S.js} +1221 -347
- package/dist/chunk-6ONQWD6S.js.map +1 -0
- package/dist/{chunk-J7O6WENZ.cjs → chunk-6TBWJV35.js} +5 -5
- package/dist/chunk-6TBWJV35.js.map +1 -0
- package/dist/chunk-6XCINXZ7.cjs +194 -0
- package/dist/chunk-6XCINXZ7.cjs.map +1 -0
- package/dist/{chunk-E7K4FTLN.cjs → chunk-72YCRTEX.cjs} +18 -2
- package/dist/chunk-72YCRTEX.cjs.map +1 -0
- package/dist/{chunk-BXOL277H.cjs → chunk-7THRV5KZ.cjs} +762 -27
- package/dist/chunk-7THRV5KZ.cjs.map +1 -0
- package/dist/{chunk-76K3IYWM.js → chunk-ADADLFDR.js} +3 -3
- package/dist/{chunk-76K3IYWM.js.map → chunk-ADADLFDR.js.map} +1 -1
- package/dist/{chunk-DSNPWVIG.cjs → chunk-AF74UXR5.cjs} +4 -3
- package/dist/chunk-AF74UXR5.cjs.map +1 -0
- package/dist/{chunk-QCQLOMJM.cjs → chunk-BCRRHJGV.cjs} +206 -65
- package/dist/chunk-BCRRHJGV.cjs.map +1 -0
- package/dist/chunk-BWYU7D33.js +192 -0
- package/dist/chunk-BWYU7D33.js.map +1 -0
- package/dist/{chunk-MV7KHWUT.js → chunk-BXONP7HX.js} +391 -15
- package/dist/chunk-BXONP7HX.js.map +1 -0
- package/dist/chunk-CDRYT2A5.js +513 -0
- package/dist/chunk-CDRYT2A5.js.map +1 -0
- package/dist/{chunk-S5MJLXMG.cjs → chunk-CZEJQSWB.cjs} +481 -124
- package/dist/chunk-CZEJQSWB.cjs.map +1 -0
- package/dist/chunk-DD2VNRQM.js +62 -0
- package/dist/chunk-DD2VNRQM.js.map +1 -0
- package/dist/{chunk-KEXGB7FK.cjs → chunk-DGV2FWB4.cjs} +7 -7
- package/dist/{chunk-KEXGB7FK.cjs.map → chunk-DGV2FWB4.cjs.map} +1 -1
- package/dist/{chunk-Y63IFHEZ.cjs → chunk-EOPEDKLG.cjs} +4 -4
- package/dist/chunk-EOPEDKLG.cjs.map +1 -0
- package/dist/{chunk-UIZSWUKP.js → chunk-F2GAJSBI.js} +105 -7
- package/dist/chunk-F2GAJSBI.js.map +1 -0
- package/dist/{chunk-VOY2RXOC.cjs → chunk-G4IFCTL5.cjs} +182 -15
- package/dist/chunk-G4IFCTL5.cjs.map +1 -0
- package/dist/chunk-KJBMTK5B.cjs +64 -0
- package/dist/chunk-KJBMTK5B.cjs.map +1 -0
- package/dist/{chunk-S6URFGCZ.js → chunk-LSHPJWM5.js} +3 -3
- package/dist/{chunk-S6URFGCZ.js.map → chunk-LSHPJWM5.js.map} +1 -1
- package/dist/chunk-MGCGWPQJ.cjs +275 -0
- package/dist/chunk-MGCGWPQJ.cjs.map +1 -0
- package/dist/chunk-MRFUISXC.cjs +4981 -0
- package/dist/chunk-MRFUISXC.cjs.map +1 -0
- package/dist/chunk-MSZP3FNH.cjs +518 -0
- package/dist/chunk-MSZP3FNH.cjs.map +1 -0
- package/dist/{chunk-KJ2SW6VA.js → chunk-NRUZYMHE.js} +4 -3
- package/dist/chunk-NRUZYMHE.js.map +1 -0
- package/dist/{chunk-7SKXKUYT.js → chunk-NUA6TSRD.js} +752 -17
- package/dist/chunk-NUA6TSRD.js.map +1 -0
- package/dist/chunk-OEIVMCWX.js +4959 -0
- package/dist/chunk-OEIVMCWX.js.map +1 -0
- package/dist/{chunk-VJUZZB2I.js → chunk-OIDPIW42.js} +26 -11
- package/dist/chunk-OIDPIW42.js.map +1 -0
- package/dist/{chunk-QUZGDSWE.cjs → chunk-OYIDRI3A.cjs} +32 -17
- package/dist/chunk-OYIDRI3A.cjs.map +1 -0
- package/dist/{chunk-YIK3ASEG.cjs → chunk-P2D2VO2O.cjs} +1226 -350
- package/dist/chunk-P2D2VO2O.cjs.map +1 -0
- package/dist/{chunk-L7XKOKOW.js → chunk-PK2A5WBG.js} +472 -125
- package/dist/chunk-PK2A5WBG.js.map +1 -0
- package/dist/{chunk-X7JMA3IY.js → chunk-PSCMWPLC.js} +2 -2
- package/dist/{chunk-X7JMA3IY.js.map → chunk-PSCMWPLC.js.map} +1 -1
- package/dist/{chunk-WM6CK2F3.cjs → chunk-QD3UWFAV.cjs} +130 -48
- package/dist/chunk-QD3UWFAV.cjs.map +1 -0
- package/dist/{chunk-FD734TPS.cjs → chunk-SL7Q6IZF.cjs} +11425 -8211
- package/dist/chunk-SL7Q6IZF.cjs.map +1 -0
- package/dist/{chunk-ECFXGXWO.cjs → chunk-SSPUH2N7.cjs} +693 -375
- package/dist/chunk-SSPUH2N7.cjs.map +1 -0
- package/dist/{chunk-BMAFVZ2D.cjs → chunk-T2VLUFGG.cjs} +4 -4
- package/dist/{chunk-BMAFVZ2D.cjs.map → chunk-T2VLUFGG.cjs.map} +1 -1
- package/dist/chunk-THZTRBFS.js +268 -0
- package/dist/chunk-THZTRBFS.js.map +1 -0
- package/dist/{chunk-Y6ROD72V.cjs → chunk-UIGRFDO6.cjs} +4 -4
- package/dist/{chunk-Y6ROD72V.cjs.map → chunk-UIGRFDO6.cjs.map} +1 -1
- package/dist/{chunk-GRBGQ2GE.js → chunk-UVHSM2GU.cjs} +9 -3
- package/dist/chunk-UVHSM2GU.cjs.map +1 -0
- package/dist/{chunk-GGYKYORQ.cjs → chunk-WX2DLWXF.cjs} +407 -22
- package/dist/chunk-WX2DLWXF.cjs.map +1 -0
- package/dist/{chunk-P6APHXPZ.js → chunk-XRJQ5ZA7.js} +179 -38
- package/dist/chunk-XRJQ5ZA7.js.map +1 -0
- package/dist/{chunk-KIZIOFZC.js → chunk-Y36Y5MTD.js} +17 -3
- package/dist/chunk-Y36Y5MTD.js.map +1 -0
- package/dist/{chunk-VV753WCB.cjs → chunk-YWMMBIOM.cjs} +21 -20
- package/dist/chunk-YWMMBIOM.cjs.map +1 -0
- package/dist/{chunk-BU4IAJWF.js → chunk-Z57R5WS4.js} +16 -15
- package/dist/chunk-Z57R5WS4.js.map +1 -0
- package/dist/deployer/index.cjs +2 -2
- package/dist/deployer/index.js +1 -1
- package/dist/di/index.cjs +10 -2
- package/dist/di/index.d.ts +1 -1
- package/dist/di/index.d.ts.map +1 -1
- package/dist/di/index.js +1 -1
- package/dist/evals/base.d.ts +10 -2
- package/dist/evals/base.d.ts.map +1 -1
- package/dist/evals/base.test-utils.d.ts +25 -25
- package/dist/evals/index.cjs +9 -9
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +7 -6
- package/dist/evals/scoreTraces/index.cjs.map +1 -1
- package/dist/evals/scoreTraces/index.js +4 -3
- package/dist/evals/scoreTraces/index.js.map +1 -1
- package/dist/evals/scoreTraces/scoreTracesWorkflow.d.ts.map +1 -1
- package/dist/evals/types.d.ts +25 -24
- package/dist/evals/types.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.cjs +30 -10
- package/dist/llm/index.d.ts +2 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +5 -1
- package/dist/llm/model/aisdk/v5/model.d.ts +47 -0
- package/dist/llm/model/aisdk/v5/model.d.ts.map +1 -0
- package/dist/llm/model/gateway-resolver.d.ts.map +1 -1
- package/dist/llm/model/gateways/azure.d.ts +36 -0
- package/dist/llm/model/gateways/azure.d.ts.map +1 -0
- package/dist/llm/model/gateways/base.d.ts +9 -4
- package/dist/llm/model/gateways/base.d.ts.map +1 -1
- package/dist/llm/model/gateways/constants.d.ts.map +1 -1
- package/dist/llm/model/gateways/index.d.ts +4 -1
- package/dist/llm/model/gateways/index.d.ts.map +1 -1
- package/dist/llm/model/gateways/models-dev.d.ts +3 -2
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/gateways/netlify.d.ts +4 -3
- package/dist/llm/model/gateways/netlify.d.ts.map +1 -1
- package/dist/llm/model/is-v2-model.d.ts +3 -0
- package/dist/llm/model/is-v2-model.d.ts.map +1 -0
- package/dist/llm/model/model-method-from-agent.d.ts +4 -0
- package/dist/llm/model/model-method-from-agent.d.ts.map +1 -0
- package/dist/llm/model/model.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +2 -2
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/model.loop.types.d.ts +2 -0
- package/dist/llm/model/model.loop.types.d.ts.map +1 -1
- package/dist/llm/model/provider-options.d.ts +4 -1
- package/dist/llm/model/provider-options.d.ts.map +1 -1
- package/dist/llm/model/provider-registry.d.ts +11 -1
- package/dist/llm/model/provider-registry.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +520 -33
- package/dist/llm/model/registry-generator.d.ts +12 -0
- package/dist/llm/model/registry-generator.d.ts.map +1 -1
- package/dist/llm/model/resolve-model.d.ts +1 -1
- package/dist/llm/model/resolve-model.d.ts.map +1 -1
- package/dist/llm/model/router.d.ts +12 -5
- package/dist/llm/model/router.d.ts.map +1 -1
- package/dist/llm/model/shared.types.d.ts +10 -4
- package/dist/llm/model/shared.types.d.ts.map +1 -1
- package/dist/logger/constants.d.ts +1 -0
- package/dist/logger/constants.d.ts.map +1 -1
- package/dist/logger/index.cjs +11 -11
- package/dist/logger/index.js +2 -2
- package/dist/logger/transport.d.ts +1 -1
- package/dist/logger/transport.d.ts.map +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/loop.d.ts.map +1 -1
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts +37 -0
- package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts.map +1 -0
- package/dist/loop/test-utils/fullStream.d.ts.map +1 -1
- package/dist/loop/test-utils/generateText.d.ts.map +1 -1
- package/dist/loop/test-utils/options.d.ts.map +1 -1
- package/dist/loop/test-utils/resultObject.d.ts.map +1 -1
- package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
- package/dist/loop/test-utils/textStream.d.ts.map +1 -1
- package/dist/loop/test-utils/toUIMessageStream.d.ts.map +1 -1
- package/dist/loop/test-utils/tools.d.ts.map +1 -1
- package/dist/loop/test-utils/utils.d.ts +1 -1
- package/dist/loop/test-utils/utils.d.ts.map +1 -1
- package/dist/loop/types.d.ts +22 -5
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +42 -42
- package/dist/loop/workflows/agentic-execution/index.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +29 -29
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +14 -14
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +1 -1
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +44 -43
- package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
- package/dist/loop/workflows/run-state.d.ts +2 -2
- package/dist/loop/workflows/run-state.d.ts.map +1 -1
- package/dist/loop/workflows/schema.d.ts +14 -14
- package/dist/loop/workflows/stream.d.ts +1 -1
- package/dist/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +377 -12
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/mcp/index.cjs +4 -4
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +4 -4
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +2 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/types.d.ts +2 -2
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/memory/index.cjs +21 -327
- package/dist/memory/index.cjs.map +1 -1
- package/dist/memory/index.js +1 -327
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/memory.d.ts +28 -18
- package/dist/memory/memory.d.ts.map +1 -1
- package/dist/memory/mock.d.ts +15 -14
- package/dist/memory/mock.d.ts.map +1 -1
- package/dist/memory/types.d.ts +69 -11
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-23RN2WHG.js +3 -0
- package/dist/{models-dev-7U4NRMM3.js.map → models-dev-23RN2WHG.js.map} +1 -1
- package/dist/models-dev-EO3SUIY2.cjs +12 -0
- package/dist/{models-dev-VKSAQPRK.cjs.map → models-dev-EO3SUIY2.cjs.map} +1 -1
- package/dist/netlify-GXJ5D5DD.js +3 -0
- package/dist/{netlify-42ZNWIDQ.js.map → netlify-GXJ5D5DD.js.map} +1 -1
- package/dist/netlify-KJLY3GFS.cjs +12 -0
- package/dist/{netlify-2IDXTNFW.cjs.map → netlify-KJLY3GFS.cjs.map} +1 -1
- package/dist/observability/index.cjs +16 -8
- package/dist/observability/index.js +1 -1
- package/dist/observability/types/tracing.d.ts +236 -13
- package/dist/observability/types/tracing.d.ts.map +1 -1
- package/dist/observability/utils.d.ts +47 -1
- package/dist/observability/utils.d.ts.map +1 -1
- package/dist/processors/index.cjs +35 -11
- package/dist/processors/index.d.ts +101 -23
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/memory/index.d.ts +7 -0
- package/dist/processors/memory/index.d.ts.map +1 -0
- package/dist/processors/memory/message-history.d.ts +43 -0
- package/dist/processors/memory/message-history.d.ts.map +1 -0
- package/dist/processors/memory/semantic-recall.d.ts +152 -0
- package/dist/processors/memory/semantic-recall.d.ts.map +1 -0
- package/dist/processors/memory/working-memory.d.ts +65 -0
- package/dist/processors/memory/working-memory.d.ts.map +1 -0
- package/dist/processors/processors/batch-parts.d.ts +1 -1
- package/dist/processors/processors/batch-parts.d.ts.map +1 -1
- package/dist/processors/processors/index.d.ts +2 -1
- package/dist/processors/processors/index.d.ts.map +1 -1
- package/dist/processors/processors/language-detector.d.ts +15 -1
- package/dist/processors/processors/language-detector.d.ts.map +1 -1
- package/dist/processors/processors/moderation.d.ts +15 -1
- package/dist/processors/processors/moderation.d.ts.map +1 -1
- package/dist/processors/processors/pii-detector.d.ts +15 -1
- package/dist/processors/processors/pii-detector.d.ts.map +1 -1
- package/dist/processors/processors/prompt-injection-detector.d.ts +15 -1
- package/dist/processors/processors/prompt-injection-detector.d.ts.map +1 -1
- package/dist/processors/processors/structured-output.d.ts +3 -2
- package/dist/processors/processors/structured-output.d.ts.map +1 -1
- package/dist/processors/processors/system-prompt-scrubber.d.ts +1 -1
- package/dist/processors/processors/system-prompt-scrubber.d.ts.map +1 -1
- package/dist/processors/processors/token-limiter.d.ts +22 -12
- package/dist/processors/processors/token-limiter.d.ts.map +1 -1
- package/dist/processors/processors/tool-call-filter.d.ts +28 -0
- package/dist/processors/processors/tool-call-filter.d.ts.map +1 -0
- package/dist/processors/processors/unicode-normalizer.d.ts +1 -1
- package/dist/processors/processors/unicode-normalizer.d.ts.map +1 -1
- package/dist/processors/runner.d.ts +35 -4
- package/dist/processors/runner.d.ts.map +1 -1
- package/dist/provider-registry-A7FILT6Q.cjs +40 -0
- package/dist/provider-registry-A7FILT6Q.cjs.map +1 -0
- package/dist/provider-registry-XM2YDI5X.js +3 -0
- package/dist/provider-registry-XM2YDI5X.js.map +1 -0
- package/dist/provider-registry.json +1135 -77
- package/dist/{registry-generator-MK63POJO.cjs → registry-generator-34SC4TAU.cjs} +23 -6
- package/dist/registry-generator-34SC4TAU.cjs.map +1 -0
- package/dist/{registry-generator-H4YNODDH.js → registry-generator-UMTNPBJX.js} +23 -7
- package/dist/registry-generator-UMTNPBJX.js.map +1 -0
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +1 -1
- package/dist/request-context/index.cjs +10 -2
- package/dist/request-context/index.d.ts +26 -0
- package/dist/request-context/index.d.ts.map +1 -1
- package/dist/request-context/index.js +1 -1
- package/dist/server/auth.d.ts +11 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/base.d.ts +51 -0
- package/dist/server/base.d.ts.map +1 -0
- package/dist/server/composite-auth.d.ts +9 -0
- package/dist/server/composite-auth.d.ts.map +1 -0
- package/dist/server/index.cjs +124 -3
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +121 -3
- package/dist/server/index.js.map +1 -1
- package/dist/server/simple-auth.d.ts +27 -0
- package/dist/server/simple-auth.d.ts.map +1 -0
- package/dist/storage/base.d.ts +76 -3
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/constants.d.ts +3 -1
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/domains/agents/base.d.ts +49 -0
- package/dist/storage/domains/agents/base.d.ts.map +1 -0
- package/dist/storage/domains/agents/index.d.ts +3 -0
- package/dist/storage/domains/agents/index.d.ts.map +1 -0
- package/dist/storage/domains/agents/inmemory.d.ts +22 -0
- package/dist/storage/domains/agents/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/index.d.ts +1 -0
- package/dist/storage/domains/index.d.ts.map +1 -1
- package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/operations/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/scores/base.d.ts +2 -2
- package/dist/storage/domains/scores/base.d.ts.map +1 -1
- package/dist/storage/domains/scores/inmemory.d.ts +2 -2
- package/dist/storage/domains/scores/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/workflows/base.d.ts +4 -0
- package/dist/storage/domains/workflows/base.d.ts.map +1 -1
- package/dist/storage/domains/workflows/inmemory.d.ts +5 -1
- package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
- package/dist/storage/index.cjs +65 -29
- package/dist/storage/index.js +1 -1
- package/dist/storage/mock.d.ts +7 -2
- package/dist/storage/mock.d.ts.map +1 -1
- package/dist/storage/storageWithInit.d.ts.map +1 -1
- package/dist/storage/types.d.ts +85 -2
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/utils.d.ts +82 -0
- package/dist/storage/utils.d.ts.map +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts.map +1 -1
- package/dist/stream/MastraWorkflowStream.d.ts +1 -1
- package/dist/stream/MastraWorkflowStream.d.ts.map +1 -1
- package/dist/stream/RunOutput.d.ts +2 -2
- package/dist/stream/RunOutput.d.ts.map +1 -1
- package/dist/stream/aisdk/v4/usage.d.ts +19 -0
- package/dist/stream/aisdk/v4/usage.d.ts.map +1 -0
- package/dist/stream/aisdk/v5/compat/prepare-tools.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/execute.d.ts +8 -4
- package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/input.d.ts +4 -1
- package/dist/stream/aisdk/v5/input.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output.d.ts +9 -9
- package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
- package/dist/stream/base/base.d.ts +1 -1
- package/dist/stream/base/base.d.ts.map +1 -1
- package/dist/stream/base/input.d.ts +1 -1
- package/dist/stream/base/output-format-handlers.d.ts +14 -1
- package/dist/stream/base/output-format-handlers.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts +3 -3
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +15 -11
- package/dist/stream/index.d.ts +2 -2
- package/dist/stream/index.d.ts.map +1 -1
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +48 -25
- package/dist/stream/types.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.cjs +101 -30
- package/dist/test-utils/llm-mock.cjs.map +1 -1
- package/dist/test-utils/llm-mock.d.ts +7 -2
- package/dist/test-utils/llm-mock.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.js +97 -30
- package/dist/test-utils/llm-mock.js.map +1 -1
- package/dist/tools/index.cjs +6 -6
- package/dist/tools/index.js +2 -2
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/stream.d.ts +10 -4
- package/dist/tools/stream.d.ts.map +1 -1
- package/dist/tools/tool-builder/builder.d.ts +2 -0
- package/dist/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/tool-stream-types.test-d.d.ts +2 -0
- package/dist/tools/tool-stream-types.test-d.d.ts.map +1 -0
- package/dist/tools/tool.d.ts +21 -8
- package/dist/tools/tool.d.ts.map +1 -1
- package/dist/tools/types.d.ts +33 -6
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/validation.d.ts +25 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.js +1 -1
- package/dist/types/zod-compat.d.ts +14 -1
- package/dist/types/zod-compat.d.ts.map +1 -1
- package/dist/utils.cjs +25 -21
- package/dist/utils.d.ts +9 -4
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/vector/filter/index.cjs +7 -189
- package/dist/vector/filter/index.cjs.map +1 -1
- package/dist/vector/filter/index.js +1 -190
- package/dist/vector/filter/index.js.map +1 -1
- package/dist/vector/index.cjs +7 -2
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.d.ts.map +1 -1
- package/dist/vector/index.js +2 -1
- package/dist/vector/index.js.map +1 -1
- package/dist/vector/types.d.ts +86 -3
- package/dist/vector/types.d.ts.map +1 -1
- package/dist/vector/vector.d.ts +39 -2
- package/dist/vector/vector.d.ts.map +1 -1
- package/dist/voice/aisdk/index.d.ts +3 -0
- package/dist/voice/aisdk/index.d.ts.map +1 -0
- package/dist/voice/aisdk/speech.d.ts +23 -0
- package/dist/voice/aisdk/speech.d.ts.map +1 -0
- package/dist/voice/aisdk/transcription.d.ts +22 -0
- package/dist/voice/aisdk/transcription.d.ts.map +1 -0
- package/dist/voice/composite-voice.d.ts +4 -3
- package/dist/voice/composite-voice.d.ts.map +1 -1
- package/dist/voice/index.cjs +12 -4
- package/dist/voice/index.d.ts +1 -0
- package/dist/voice/index.d.ts.map +1 -1
- package/dist/voice/index.js +1 -1
- package/dist/workflows/default.d.ts +179 -270
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/execution-engine.d.ts +3 -1
- package/dist/workflows/evented/execution-engine.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/step-executor.d.ts +1 -1
- package/dist/workflows/evented/step-executor.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts +5 -4
- package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts +1 -1
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/parallel.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/parallel.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/sleep.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/sleep.d.ts.map +1 -1
- package/dist/workflows/evented/workflow.d.ts +2 -1
- package/dist/workflows/evented/workflow.d.ts.map +1 -1
- package/dist/workflows/execution-engine.d.ts +8 -6
- package/dist/workflows/execution-engine.d.ts.map +1 -1
- package/dist/workflows/handlers/control-flow.d.ts +133 -0
- package/dist/workflows/handlers/control-flow.d.ts.map +1 -0
- package/dist/workflows/handlers/entry.d.ts +43 -0
- package/dist/workflows/handlers/entry.d.ts.map +1 -0
- package/dist/workflows/handlers/sleep.d.ts +60 -0
- package/dist/workflows/handlers/sleep.d.ts.map +1 -0
- package/dist/workflows/handlers/step.d.ts +58 -0
- package/dist/workflows/handlers/step.d.ts.map +1 -0
- package/dist/workflows/index.cjs +36 -16
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/step.d.ts +8 -6
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +224 -10
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/utils.d.ts +36 -0
- package/dist/workflows/utils.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +135 -54
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/package.json +26 -29
- package/src/llm/model/provider-types.generated.d.ts +520 -33
- package/dist/chunk-26SQQNMU.js.map +0 -1
- package/dist/chunk-32CTMD2C.js.map +0 -1
- package/dist/chunk-436FFEF6.js +0 -34
- package/dist/chunk-436FFEF6.js.map +0 -1
- package/dist/chunk-4CDL2QJT.js.map +0 -1
- package/dist/chunk-7AHYOMHJ.js +0 -149
- package/dist/chunk-7AHYOMHJ.js.map +0 -1
- package/dist/chunk-7SKXKUYT.js.map +0 -1
- package/dist/chunk-BNBRQS7N.js +0 -910
- package/dist/chunk-BNBRQS7N.js.map +0 -1
- package/dist/chunk-BU4IAJWF.js.map +0 -1
- package/dist/chunk-BXOL277H.cjs.map +0 -1
- package/dist/chunk-DSNPWVIG.cjs.map +0 -1
- package/dist/chunk-E7K4FTLN.cjs.map +0 -1
- package/dist/chunk-ECFXGXWO.cjs.map +0 -1
- package/dist/chunk-ET6UOTTU.cjs +0 -154
- package/dist/chunk-ET6UOTTU.cjs.map +0 -1
- package/dist/chunk-FD734TPS.cjs.map +0 -1
- package/dist/chunk-GGYKYORQ.cjs.map +0 -1
- package/dist/chunk-GRBGQ2GE.js.map +0 -1
- package/dist/chunk-HGNRQ3OG.js +0 -58
- package/dist/chunk-HGNRQ3OG.js.map +0 -1
- package/dist/chunk-IU2SZXJQ.cjs +0 -913
- package/dist/chunk-IU2SZXJQ.cjs.map +0 -1
- package/dist/chunk-J7O6WENZ.cjs.map +0 -1
- package/dist/chunk-JV2KH24V.js.map +0 -1
- package/dist/chunk-KIZIOFZC.js.map +0 -1
- package/dist/chunk-KJ2SW6VA.js.map +0 -1
- package/dist/chunk-L7XKOKOW.js.map +0 -1
- package/dist/chunk-LJFJTTZQ.cjs +0 -4
- package/dist/chunk-LJFJTTZQ.cjs.map +0 -1
- package/dist/chunk-LRSB62Z6.cjs +0 -60
- package/dist/chunk-LRSB62Z6.cjs.map +0 -1
- package/dist/chunk-MV7KHWUT.js.map +0 -1
- package/dist/chunk-P6APHXPZ.js.map +0 -1
- package/dist/chunk-QCQLOMJM.cjs.map +0 -1
- package/dist/chunk-QUKUN6NR.cjs.map +0 -1
- package/dist/chunk-QUZGDSWE.cjs.map +0 -1
- package/dist/chunk-S5MJLXMG.cjs.map +0 -1
- package/dist/chunk-TQTAMPSC.js.map +0 -1
- package/dist/chunk-UIZSWUKP.js.map +0 -1
- package/dist/chunk-V3VLOOSW.cjs +0 -36
- package/dist/chunk-V3VLOOSW.cjs.map +0 -1
- package/dist/chunk-VJUZZB2I.js.map +0 -1
- package/dist/chunk-VOY2RXOC.cjs.map +0 -1
- package/dist/chunk-VV753WCB.cjs.map +0 -1
- package/dist/chunk-WM6CK2F3.cjs.map +0 -1
- package/dist/chunk-XEVG546F.js.map +0 -1
- package/dist/chunk-Y63IFHEZ.cjs.map +0 -1
- package/dist/chunk-YIK3ASEG.cjs.map +0 -1
- package/dist/chunk-ZV5CC35D.js +0 -3
- package/dist/chunk-ZV5CC35D.js.map +0 -1
- package/dist/models-dev-7U4NRMM3.js +0 -3
- package/dist/models-dev-VKSAQPRK.cjs +0 -12
- package/dist/netlify-2IDXTNFW.cjs +0 -12
- package/dist/netlify-42ZNWIDQ.js +0 -3
- package/dist/registry-generator-H4YNODDH.js.map +0 -1
- package/dist/registry-generator-MK63POJO.cjs.map +0 -1
package/dist/mastra/index.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Agent } from '../agent/index.js';
|
|
2
2
|
import type { BundlerConfig } from '../bundler/types.js';
|
|
3
3
|
import type { MastraServerCache } from '../cache/index.js';
|
|
4
4
|
import type { MastraDeployer } from '../deployer/index.js';
|
|
5
5
|
import type { MastraScorer } from '../evals/index.js';
|
|
6
6
|
import type { PubSub } from '../events/pubsub.js';
|
|
7
7
|
import type { Event } from '../events/types.js';
|
|
8
|
+
import type { MastraModelGateway } from '../llm/model/gateways/index.js';
|
|
8
9
|
import { LogLevel } from '../logger/index.js';
|
|
9
10
|
import type { IMastraLogger } from '../logger/index.js';
|
|
10
11
|
import type { MCPServerBase } from '../mcp/index.js';
|
|
12
|
+
import type { MastraMemory } from '../memory/index.js';
|
|
11
13
|
import type { ObservabilityEntrypoint } from '../observability/index.js';
|
|
12
14
|
import type { Processor } from '../processors/index.js';
|
|
15
|
+
import type { MastraServerBase } from '../server/base.js';
|
|
13
16
|
import type { Middleware, ServerConfig } from '../server/types.js';
|
|
14
|
-
import type { MastraStorage } from '../storage/index.js';
|
|
17
|
+
import type { MastraStorage, WorkflowRuns, StorageAgentType } from '../storage/index.js';
|
|
15
18
|
import type { ToolAction } from '../tools/index.js';
|
|
16
19
|
import type { MastraTTS } from '../tts/index.js';
|
|
17
20
|
import type { MastraIdGenerator } from '../types/index.js';
|
|
@@ -48,7 +51,7 @@ import type { Workflow } from '../workflows/index.js';
|
|
|
48
51
|
* });
|
|
49
52
|
* ```
|
|
50
53
|
*/
|
|
51
|
-
export interface Config<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TWorkflows extends Record<string, Workflow<any, any, any, any, any, any>> = Record<string, Workflow<any, any, any, any, any, any>>, TVectors extends Record<string, MastraVector
|
|
54
|
+
export interface Config<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TWorkflows extends Record<string, Workflow<any, any, any, any, any, any>> = Record<string, Workflow<any, any, any, any, any, any>>, TVectors extends Record<string, MastraVector<any>> = Record<string, MastraVector<any>>, TTTS extends Record<string, MastraTTS> = Record<string, MastraTTS>, TLogger extends IMastraLogger = IMastraLogger, TMCPServers extends Record<string, MCPServerBase<any>> = Record<string, MCPServerBase<any>>, TScorers extends Record<string, MastraScorer<any, any, any, any>> = Record<string, MastraScorer<any, any, any, any>>, TTools extends Record<string, ToolAction<any, any, any, any, any, any>> = Record<string, ToolAction<any, any, any, any, any, any>>, TProcessors extends Record<string, Processor<any>> = Record<string, Processor<any>>, TMemory extends Record<string, MastraMemory> = Record<string, MastraMemory>> {
|
|
52
55
|
/**
|
|
53
56
|
* Agents are autonomous systems that can make decisions and take actions.
|
|
54
57
|
*/
|
|
@@ -131,6 +134,16 @@ export interface Config<TAgents extends Record<string, Agent<any>> = Record<stri
|
|
|
131
134
|
* Processors transform inputs and outputs for agents and workflows.
|
|
132
135
|
*/
|
|
133
136
|
processors?: TProcessors;
|
|
137
|
+
/**
|
|
138
|
+
* Memory instances that can be referenced by stored agents.
|
|
139
|
+
* Keys are used to look up memory instances when resolving stored agent configurations.
|
|
140
|
+
*/
|
|
141
|
+
memory?: TMemory;
|
|
142
|
+
/**
|
|
143
|
+
* Custom model router gateways for accessing LLM providers.
|
|
144
|
+
* Gateways handle provider-specific authentication, URL construction, and model resolution.
|
|
145
|
+
*/
|
|
146
|
+
gateways?: Record<string, MastraModelGateway>;
|
|
134
147
|
/**
|
|
135
148
|
* Event handlers for custom application events.
|
|
136
149
|
* Maps event topics to handler functions for event-driven architectures.
|
|
@@ -172,7 +185,7 @@ export interface Config<TAgents extends Record<string, Agent<any>> = Record<stri
|
|
|
172
185
|
* });
|
|
173
186
|
* ```
|
|
174
187
|
*/
|
|
175
|
-
export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TWorkflows extends Record<string, Workflow<any, any, any, any, any, any>> = Record<string, Workflow<any, any, any, any, any, any>>, TVectors extends Record<string, MastraVector
|
|
188
|
+
export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TWorkflows extends Record<string, Workflow<any, any, any, any, any, any>> = Record<string, Workflow<any, any, any, any, any, any>>, TVectors extends Record<string, MastraVector<any>> = Record<string, MastraVector<any>>, TTTS extends Record<string, MastraTTS> = Record<string, MastraTTS>, TLogger extends IMastraLogger = IMastraLogger, TMCPServers extends Record<string, MCPServerBase<any>> = Record<string, MCPServerBase<any>>, TScorers extends Record<string, MastraScorer<any, any, any, any>> = Record<string, MastraScorer<any, any, any, any>>, TTools extends Record<string, ToolAction<any, any, any, any, any, any>> = Record<string, ToolAction<any, any, any, any, any, any>>, TProcessors extends Record<string, Processor<any>> = Record<string, Processor<any>>, TMemory extends Record<string, MastraMemory> = Record<string, MastraMemory>> {
|
|
176
189
|
#private;
|
|
177
190
|
get pubsub(): PubSub;
|
|
178
191
|
/**
|
|
@@ -245,7 +258,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
245
258
|
* });
|
|
246
259
|
* ```
|
|
247
260
|
*/
|
|
248
|
-
constructor(config?: Config<TAgents, TWorkflows, TVectors, TTTS, TLogger, TMCPServers, TScorers, TTools, TProcessors>);
|
|
261
|
+
constructor(config?: Config<TAgents, TWorkflows, TVectors, TTTS, TLogger, TMCPServers, TScorers, TTools, TProcessors, TMemory>);
|
|
249
262
|
/**
|
|
250
263
|
* Retrieves a registered agent by its name.
|
|
251
264
|
*
|
|
@@ -295,7 +308,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
295
308
|
* const sameAgent = mastra.getAgentById(assistant.id);
|
|
296
309
|
* ```
|
|
297
310
|
*/
|
|
298
|
-
getAgentById(id:
|
|
311
|
+
getAgentById<TAgentName extends keyof TAgents>(id: TAgents[TAgentName]['id']): TAgents[TAgentName];
|
|
299
312
|
/**
|
|
300
313
|
* Returns all registered agents as a record keyed by their names.
|
|
301
314
|
*
|
|
@@ -316,6 +329,114 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
316
329
|
* ```
|
|
317
330
|
*/
|
|
318
331
|
listAgents(): TAgents;
|
|
332
|
+
/**
|
|
333
|
+
* Retrieves a stored agent from the database by its unique identifier.
|
|
334
|
+
*
|
|
335
|
+
* By default, returns an executable Agent instance. Set `raw: true` to get
|
|
336
|
+
* the raw stored configuration data instead.
|
|
337
|
+
*
|
|
338
|
+
* @param id - The unique identifier of the stored agent
|
|
339
|
+
* @param options - Options for the query
|
|
340
|
+
* @param options.raw - If true, returns raw stored data instead of Agent instance
|
|
341
|
+
*
|
|
342
|
+
* @throws {MastraError} When storage is not configured or doesn't support agents
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```typescript
|
|
346
|
+
* const mastra = new Mastra({
|
|
347
|
+
* storage: new PostgresStore({ connectionString: process.env.DATABASE_URL })
|
|
348
|
+
* });
|
|
349
|
+
*
|
|
350
|
+
* // Get as executable Agent instance (default)
|
|
351
|
+
* const agent = await mastra.getStoredAgentById('my-agent-id');
|
|
352
|
+
* if (agent) {
|
|
353
|
+
* const response = await agent.generate('Hello!');
|
|
354
|
+
* console.log(response.text);
|
|
355
|
+
* }
|
|
356
|
+
*
|
|
357
|
+
* // Get raw stored configuration
|
|
358
|
+
* const rawConfig = await mastra.getStoredAgentById('my-agent-id', { raw: true });
|
|
359
|
+
* if (rawConfig) {
|
|
360
|
+
* console.log(rawConfig.instructions);
|
|
361
|
+
* }
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
getStoredAgentById(id: string, options?: {
|
|
365
|
+
raw?: false;
|
|
366
|
+
}): Promise<Agent | null>;
|
|
367
|
+
getStoredAgentById(id: string, options: {
|
|
368
|
+
raw: true;
|
|
369
|
+
}): Promise<StorageAgentType | null>;
|
|
370
|
+
/**
|
|
371
|
+
* Lists all stored agents from the database with optional pagination.
|
|
372
|
+
*
|
|
373
|
+
* By default, returns executable Agent instances. Set `raw: true` to get
|
|
374
|
+
* the raw stored configuration data instead.
|
|
375
|
+
*
|
|
376
|
+
* @param args - Options for pagination and output format
|
|
377
|
+
* @param args.page - Zero-indexed page number (default: 0)
|
|
378
|
+
* @param args.perPage - Items per page, or false for all (default: 100)
|
|
379
|
+
* @param args.orderBy - Sort order configuration
|
|
380
|
+
* @param args.raw - If true, returns raw stored data instead of Agent instances
|
|
381
|
+
*
|
|
382
|
+
* @throws {MastraError} When storage is not configured or doesn't support agents
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* ```typescript
|
|
386
|
+
* const mastra = new Mastra({
|
|
387
|
+
* storage: new PostgresStore({ connectionString: process.env.DATABASE_URL })
|
|
388
|
+
* });
|
|
389
|
+
*
|
|
390
|
+
* // List as executable Agent instances (default)
|
|
391
|
+
* const result = await mastra.listStoredAgents();
|
|
392
|
+
* for (const agent of result.agents) {
|
|
393
|
+
* const response = await agent.generate('Hello!');
|
|
394
|
+
* }
|
|
395
|
+
*
|
|
396
|
+
* // List raw stored configurations
|
|
397
|
+
* const rawResult = await mastra.listStoredAgents({ raw: true });
|
|
398
|
+
* for (const config of rawResult.agents) {
|
|
399
|
+
* console.log(config.instructions, config.createdAt);
|
|
400
|
+
* }
|
|
401
|
+
*
|
|
402
|
+
* // With pagination
|
|
403
|
+
* const paginated = await mastra.listStoredAgents({
|
|
404
|
+
* page: 0,
|
|
405
|
+
* perPage: 10,
|
|
406
|
+
* orderBy: { field: 'createdAt', direction: 'DESC' }
|
|
407
|
+
* });
|
|
408
|
+
* ```
|
|
409
|
+
*/
|
|
410
|
+
listStoredAgents(args?: {
|
|
411
|
+
page?: number;
|
|
412
|
+
perPage?: number | false;
|
|
413
|
+
orderBy?: {
|
|
414
|
+
field: 'createdAt' | 'updatedAt';
|
|
415
|
+
direction: 'ASC' | 'DESC';
|
|
416
|
+
};
|
|
417
|
+
raw?: false;
|
|
418
|
+
}): Promise<{
|
|
419
|
+
agents: Agent[];
|
|
420
|
+
total: number;
|
|
421
|
+
page: number;
|
|
422
|
+
perPage: number | false;
|
|
423
|
+
hasMore: boolean;
|
|
424
|
+
}>;
|
|
425
|
+
listStoredAgents(args: {
|
|
426
|
+
page?: number;
|
|
427
|
+
perPage?: number | false;
|
|
428
|
+
orderBy?: {
|
|
429
|
+
field: 'createdAt' | 'updatedAt';
|
|
430
|
+
direction: 'ASC' | 'DESC';
|
|
431
|
+
};
|
|
432
|
+
raw: true;
|
|
433
|
+
}): Promise<{
|
|
434
|
+
agents: StorageAgentType[];
|
|
435
|
+
total: number;
|
|
436
|
+
page: number;
|
|
437
|
+
perPage: number | false;
|
|
438
|
+
hasMore: boolean;
|
|
439
|
+
}>;
|
|
319
440
|
/**
|
|
320
441
|
* Adds a new agent to the Mastra instance.
|
|
321
442
|
*
|
|
@@ -396,7 +517,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
396
517
|
* const vectorStore = mastra.getVectorById('chroma-123');
|
|
397
518
|
* ```
|
|
398
519
|
*/
|
|
399
|
-
getVectorById(id:
|
|
520
|
+
getVectorById<TVectorName extends keyof TVectors>(id: TVectors[TVectorName]['id']): TVectors[TVectorName];
|
|
400
521
|
/**
|
|
401
522
|
* Returns all registered vector stores as a record keyed by their names.
|
|
402
523
|
*
|
|
@@ -526,7 +647,9 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
526
647
|
* console.log(sameWorkflow.name); // "process-data"
|
|
527
648
|
* ```
|
|
528
649
|
*/
|
|
529
|
-
getWorkflowById(id:
|
|
650
|
+
getWorkflowById<TWorkflowName extends keyof TWorkflows>(id: TWorkflows[TWorkflowName]['id']): TWorkflows[TWorkflowName];
|
|
651
|
+
listActiveWorkflowRuns(): Promise<WorkflowRuns>;
|
|
652
|
+
restartAllActiveWorkflowRuns(): Promise<void>;
|
|
530
653
|
/**
|
|
531
654
|
* Returns all registered scorers as a record keyed by their IDs.
|
|
532
655
|
*
|
|
@@ -637,7 +760,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
637
760
|
* });
|
|
638
761
|
* ```
|
|
639
762
|
*/
|
|
640
|
-
getScorerById(id:
|
|
763
|
+
getScorerById<TScorerName extends keyof TScorers>(id: TScorers[TScorerName]['id']): TScorers[TScorerName];
|
|
641
764
|
/**
|
|
642
765
|
* Retrieves a specific tool by registration key.
|
|
643
766
|
*
|
|
@@ -672,7 +795,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
672
795
|
* const tool = mastra.getToolById('calculator-tool-id');
|
|
673
796
|
* ```
|
|
674
797
|
*/
|
|
675
|
-
getToolById(id:
|
|
798
|
+
getToolById<TToolName extends keyof TTools>(id: TTools[TToolName]['id']): TTools[TToolName];
|
|
676
799
|
/**
|
|
677
800
|
* Lists all configured tools.
|
|
678
801
|
*
|
|
@@ -747,7 +870,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
747
870
|
* const processor = mastra.getProcessorById('validator-processor-id');
|
|
748
871
|
* ```
|
|
749
872
|
*/
|
|
750
|
-
getProcessorById(id:
|
|
873
|
+
getProcessorById<TProcessorName extends keyof TProcessors>(id: TProcessors[TProcessorName]['id']): TProcessors[TProcessorName];
|
|
751
874
|
/**
|
|
752
875
|
* Lists all configured processors.
|
|
753
876
|
*
|
|
@@ -788,6 +911,78 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
788
911
|
* ```
|
|
789
912
|
*/
|
|
790
913
|
addProcessor<P extends Processor>(processor: P, key?: string): void;
|
|
914
|
+
/**
|
|
915
|
+
* Retrieves a registered memory instance by its registration key.
|
|
916
|
+
*
|
|
917
|
+
* @throws {MastraError} When the memory instance with the specified key is not found
|
|
918
|
+
*
|
|
919
|
+
* @example
|
|
920
|
+
* ```typescript
|
|
921
|
+
* const mastra = new Mastra({
|
|
922
|
+
* memory: {
|
|
923
|
+
* chat: new Memory({ storage })
|
|
924
|
+
* }
|
|
925
|
+
* });
|
|
926
|
+
*
|
|
927
|
+
* const chatMemory = mastra.getMemory('chat');
|
|
928
|
+
* ```
|
|
929
|
+
*/
|
|
930
|
+
getMemory<TMemoryName extends keyof TMemory>(name: TMemoryName): TMemory[TMemoryName];
|
|
931
|
+
/**
|
|
932
|
+
* Retrieves a registered memory instance by its ID.
|
|
933
|
+
*
|
|
934
|
+
* Searches through all registered memory instances and returns the one whose ID matches.
|
|
935
|
+
*
|
|
936
|
+
* @throws {MastraError} When no memory instance with the specified ID is found
|
|
937
|
+
*
|
|
938
|
+
* @example
|
|
939
|
+
* ```typescript
|
|
940
|
+
* const mastra = new Mastra({
|
|
941
|
+
* memory: {
|
|
942
|
+
* chat: new Memory({ id: 'chat-memory', storage })
|
|
943
|
+
* }
|
|
944
|
+
* });
|
|
945
|
+
*
|
|
946
|
+
* const memory = mastra.getMemoryById('chat-memory');
|
|
947
|
+
* ```
|
|
948
|
+
*/
|
|
949
|
+
getMemoryById(id: string): MastraMemory;
|
|
950
|
+
/**
|
|
951
|
+
* Returns all registered memory instances as a record keyed by their names.
|
|
952
|
+
*
|
|
953
|
+
* @example
|
|
954
|
+
* ```typescript
|
|
955
|
+
* const mastra = new Mastra({
|
|
956
|
+
* memory: {
|
|
957
|
+
* chat: new Memory({ storage }),
|
|
958
|
+
* longTerm: new Memory({ storage })
|
|
959
|
+
* }
|
|
960
|
+
* });
|
|
961
|
+
*
|
|
962
|
+
* const allMemory = mastra.listMemory();
|
|
963
|
+
* console.log(Object.keys(allMemory)); // ['chat', 'longTerm']
|
|
964
|
+
* ```
|
|
965
|
+
*/
|
|
966
|
+
listMemory(): TMemory | undefined;
|
|
967
|
+
/**
|
|
968
|
+
* Adds a new memory instance to the Mastra instance.
|
|
969
|
+
*
|
|
970
|
+
* This method allows dynamic registration of memory instances after the Mastra instance
|
|
971
|
+
* has been created.
|
|
972
|
+
*
|
|
973
|
+
* @example
|
|
974
|
+
* ```typescript
|
|
975
|
+
* const mastra = new Mastra();
|
|
976
|
+
* const chatMemory = new Memory({
|
|
977
|
+
* id: 'chat-memory',
|
|
978
|
+
* storage: mastra.getStorage()
|
|
979
|
+
* });
|
|
980
|
+
* mastra.addMemory(chatMemory); // Uses memory.id as key
|
|
981
|
+
* // or
|
|
982
|
+
* mastra.addMemory(chatMemory, 'customKey'); // Uses custom key
|
|
983
|
+
* ```
|
|
984
|
+
*/
|
|
985
|
+
addMemory<M extends MastraMemory>(memory: M, key?: string): void;
|
|
791
986
|
/**
|
|
792
987
|
* Returns all registered workflows as a record keyed by their IDs.
|
|
793
988
|
*
|
|
@@ -927,6 +1122,60 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
927
1122
|
getServerCache(): MastraServerCache;
|
|
928
1123
|
setServerMiddleware(serverMiddleware: Middleware | Middleware[]): void;
|
|
929
1124
|
getServer(): ServerConfig | undefined;
|
|
1125
|
+
/**
|
|
1126
|
+
* Sets the server adapter for this Mastra instance.
|
|
1127
|
+
*
|
|
1128
|
+
* The server adapter provides access to the underlying server app (e.g., Hono, Express)
|
|
1129
|
+
* and allows users to call routes directly via `app.fetch()` instead of making HTTP requests.
|
|
1130
|
+
*
|
|
1131
|
+
* This is typically called by `createHonoServer` or similar factory functions during
|
|
1132
|
+
* server initialization.
|
|
1133
|
+
*
|
|
1134
|
+
* @param adapter - The server adapter instance (e.g., MastraServer from @mastra/hono or @mastra/express)
|
|
1135
|
+
*
|
|
1136
|
+
* @example
|
|
1137
|
+
* ```typescript
|
|
1138
|
+
* const app = new Hono();
|
|
1139
|
+
* const adapter = new MastraServer({ app, mastra });
|
|
1140
|
+
* mastra.setMastraServer(adapter);
|
|
1141
|
+
* ```
|
|
1142
|
+
*/
|
|
1143
|
+
setMastraServer(adapter: MastraServerBase): void;
|
|
1144
|
+
/**
|
|
1145
|
+
* Gets the server adapter for this Mastra instance.
|
|
1146
|
+
*
|
|
1147
|
+
* @returns The server adapter, or undefined if not set
|
|
1148
|
+
*
|
|
1149
|
+
* @example
|
|
1150
|
+
* ```typescript
|
|
1151
|
+
* const adapter = mastra.getMastraServer();
|
|
1152
|
+
* if (adapter) {
|
|
1153
|
+
* const app = adapter.getApp<Hono>();
|
|
1154
|
+
* }
|
|
1155
|
+
* ```
|
|
1156
|
+
*/
|
|
1157
|
+
getMastraServer(): MastraServerBase | undefined;
|
|
1158
|
+
/**
|
|
1159
|
+
* Gets the server app from the server adapter.
|
|
1160
|
+
*
|
|
1161
|
+
* This is a convenience method that calls `getMastraServer()?.getApp<T>()`.
|
|
1162
|
+
* Use this to access the underlying server framework's app instance (e.g., Hono, Express)
|
|
1163
|
+
* for direct operations like calling routes via `app.fetch()`.
|
|
1164
|
+
*
|
|
1165
|
+
* @template T - The expected type of the app (e.g., Hono, Express Application)
|
|
1166
|
+
* @returns The server app, or undefined if no adapter is set
|
|
1167
|
+
*
|
|
1168
|
+
* @example
|
|
1169
|
+
* ```typescript
|
|
1170
|
+
* // After createHonoServer() is called:
|
|
1171
|
+
* const app = mastra.getServerApp<Hono>();
|
|
1172
|
+
*
|
|
1173
|
+
* // Call routes directly without HTTP overhead
|
|
1174
|
+
* const response = await app?.fetch(new Request('http://localhost/health'));
|
|
1175
|
+
* const data = await response?.json();
|
|
1176
|
+
* ```
|
|
1177
|
+
*/
|
|
1178
|
+
getServerApp<T = unknown>(): T | undefined;
|
|
930
1179
|
getBundlerConfig(): BundlerConfig | undefined;
|
|
931
1180
|
listLogsByRunId({ runId, transportId, fromDate, toDate, logLevel, filters, page, perPage, }: {
|
|
932
1181
|
runId: string;
|
|
@@ -1042,11 +1291,127 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
1042
1291
|
* }
|
|
1043
1292
|
* ```
|
|
1044
1293
|
*/
|
|
1045
|
-
getMCPServerById(serverId:
|
|
1294
|
+
getMCPServerById<TMCPServerName extends keyof TMCPServers>(serverId: TMCPServers[TMCPServerName]['id'], version?: string): TMCPServers[TMCPServerName] | undefined;
|
|
1046
1295
|
addTopicListener(topic: string, listener: (event: any) => Promise<void>): Promise<void>;
|
|
1047
1296
|
removeTopicListener(topic: string, listener: (event: any) => Promise<void>): Promise<void>;
|
|
1048
1297
|
startEventEngine(): Promise<void>;
|
|
1049
1298
|
stopEventEngine(): Promise<void>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Retrieves a registered gateway by its key.
|
|
1301
|
+
*
|
|
1302
|
+
* @throws {MastraError} When the gateway with the specified key is not found
|
|
1303
|
+
*
|
|
1304
|
+
* @example
|
|
1305
|
+
* ```typescript
|
|
1306
|
+
* const mastra = new Mastra({
|
|
1307
|
+
* gateways: {
|
|
1308
|
+
* myGateway: new CustomGateway()
|
|
1309
|
+
* }
|
|
1310
|
+
* });
|
|
1311
|
+
*
|
|
1312
|
+
* const gateway = mastra.getGateway('myGateway');
|
|
1313
|
+
* ```
|
|
1314
|
+
*/
|
|
1315
|
+
getGateway(key: string): MastraModelGateway;
|
|
1316
|
+
/**
|
|
1317
|
+
* Retrieves a registered gateway by its ID.
|
|
1318
|
+
*
|
|
1319
|
+
* Searches through all registered gateways and returns the one whose ID matches.
|
|
1320
|
+
* If a gateway doesn't have an explicit ID, its name is used as the ID.
|
|
1321
|
+
*
|
|
1322
|
+
* @throws {MastraError} When no gateway with the specified ID is found
|
|
1323
|
+
*
|
|
1324
|
+
* @example
|
|
1325
|
+
* ```typescript
|
|
1326
|
+
* class CustomGateway extends MastraModelGateway {
|
|
1327
|
+
* readonly id = 'custom-gateway-v1';
|
|
1328
|
+
* readonly name = 'Custom Gateway';
|
|
1329
|
+
* // ...
|
|
1330
|
+
* }
|
|
1331
|
+
*
|
|
1332
|
+
* const mastra = new Mastra({
|
|
1333
|
+
* gateways: {
|
|
1334
|
+
* myGateway: new CustomGateway()
|
|
1335
|
+
* }
|
|
1336
|
+
* });
|
|
1337
|
+
*
|
|
1338
|
+
* const gateway = mastra.getGatewayById('custom-gateway-v1');
|
|
1339
|
+
* ```
|
|
1340
|
+
*/
|
|
1341
|
+
getGatewayById(id: string): MastraModelGateway;
|
|
1342
|
+
/**
|
|
1343
|
+
* Returns all registered gateways as a record keyed by their names.
|
|
1344
|
+
*
|
|
1345
|
+
* @example
|
|
1346
|
+
* ```typescript
|
|
1347
|
+
* const mastra = new Mastra({
|
|
1348
|
+
* gateways: {
|
|
1349
|
+
* netlify: new NetlifyGateway(),
|
|
1350
|
+
* custom: new CustomGateway()
|
|
1351
|
+
* }
|
|
1352
|
+
* });
|
|
1353
|
+
*
|
|
1354
|
+
* const allGateways = mastra.listGateways();
|
|
1355
|
+
* console.log(Object.keys(allGateways)); // ['netlify', 'custom']
|
|
1356
|
+
* ```
|
|
1357
|
+
*/
|
|
1358
|
+
listGateways(): Record<string, MastraModelGateway> | undefined;
|
|
1359
|
+
/**
|
|
1360
|
+
* Adds a new gateway to the Mastra instance.
|
|
1361
|
+
*
|
|
1362
|
+
* This method allows dynamic registration of gateways after the Mastra instance
|
|
1363
|
+
* has been created. Gateways enable access to LLM providers through custom
|
|
1364
|
+
* authentication and routing logic.
|
|
1365
|
+
*
|
|
1366
|
+
* If no key is provided, the gateway's ID (or name if no ID is set) will be used as the key.
|
|
1367
|
+
*
|
|
1368
|
+
* @example
|
|
1369
|
+
* ```typescript
|
|
1370
|
+
* import { MastraModelGateway } from '@mastra/core';
|
|
1371
|
+
*
|
|
1372
|
+
* class CustomGateway extends MastraModelGateway {
|
|
1373
|
+
* readonly id = 'custom-gateway-v1'; // Optional, defaults to name
|
|
1374
|
+
* readonly name = 'custom';
|
|
1375
|
+
* readonly prefix = 'custom';
|
|
1376
|
+
*
|
|
1377
|
+
* async fetchProviders() {
|
|
1378
|
+
* return {
|
|
1379
|
+
* myProvider: {
|
|
1380
|
+
* name: 'My Provider',
|
|
1381
|
+
* models: ['model-1', 'model-2'],
|
|
1382
|
+
* apiKeyEnvVar: 'MY_API_KEY',
|
|
1383
|
+
* gateway: 'custom'
|
|
1384
|
+
* }
|
|
1385
|
+
* };
|
|
1386
|
+
* }
|
|
1387
|
+
*
|
|
1388
|
+
* buildUrl(modelId: string) {
|
|
1389
|
+
* return 'https://api.myprovider.com/v1';
|
|
1390
|
+
* }
|
|
1391
|
+
*
|
|
1392
|
+
* async getApiKey(modelId: string) {
|
|
1393
|
+
* return process.env.MY_API_KEY || '';
|
|
1394
|
+
* }
|
|
1395
|
+
*
|
|
1396
|
+
* async resolveLanguageModel({ modelId, providerId, apiKey }) {
|
|
1397
|
+
* const baseURL = this.buildUrl(`${providerId}/${modelId}`);
|
|
1398
|
+
* return createOpenAICompatible({
|
|
1399
|
+
* name: providerId,
|
|
1400
|
+
* apiKey,
|
|
1401
|
+
* baseURL,
|
|
1402
|
+
* supportsStructuredOutputs: true,
|
|
1403
|
+
* }).chatModel(modelId);
|
|
1404
|
+
* }
|
|
1405
|
+
* }
|
|
1406
|
+
*
|
|
1407
|
+
* const mastra = new Mastra();
|
|
1408
|
+
* const newGateway = new CustomGateway();
|
|
1409
|
+
* mastra.addGateway(newGateway); // Uses gateway.getId() as key (gateway.id)
|
|
1410
|
+
* // or
|
|
1411
|
+
* mastra.addGateway(newGateway, 'customKey'); // Uses custom key
|
|
1412
|
+
* ```
|
|
1413
|
+
*/
|
|
1414
|
+
addGateway(gateway: MastraModelGateway, key?: string): void;
|
|
1050
1415
|
/**
|
|
1051
1416
|
* Gracefully shuts down the Mastra instance and cleans up all resources.
|
|
1052
1417
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mastra/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAA6B,MAAM,WAAW,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,C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;;;;;;OAwBG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAS/B,IAAW,WAAW,sBAErB;CACF"}
|
package/dist/mastra/index.js
CHANGED
package/dist/mcp/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkTWH4PTDG_cjs = require('../chunk-TWH4PTDG.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkDGV2FWB4_cjs = require('../chunk-DGV2FWB4.cjs');
|
|
5
|
+
var chunkAF74UXR5_cjs = require('../chunk-AF74UXR5.cjs');
|
|
6
6
|
var crypto = require('crypto');
|
|
7
7
|
var slugify = require('@sindresorhus/slugify');
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
10
10
|
|
|
11
11
|
var slugify__default = /*#__PURE__*/_interopDefault(slugify);
|
|
12
12
|
|
|
13
|
-
var MCPServerBase = class extends
|
|
13
|
+
var MCPServerBase = class extends chunkDGV2FWB4_cjs.MastraBase {
|
|
14
14
|
/** Tracks if the server ID has been definitively set. */
|
|
15
15
|
idWasSet = false;
|
|
16
16
|
/** The display name of the MCP server. */
|
|
@@ -121,7 +121,7 @@ var MCPServerBase = class extends chunkKEXGB7FK_cjs.MastraBase {
|
|
|
121
121
|
* @param config Configuration options for the MCP server, including metadata.
|
|
122
122
|
*/
|
|
123
123
|
constructor(config) {
|
|
124
|
-
super({ component:
|
|
124
|
+
super({ component: chunkAF74UXR5_cjs.RegisteredLogger.MCP_SERVER, name: config.name });
|
|
125
125
|
this.name = config.name;
|
|
126
126
|
this.version = config.version;
|
|
127
127
|
if (config.id) {
|
package/dist/mcp/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mcp/index.ts"],"names":["MastraBase","MastraError","RegisteredLogger","slugify","randomUUID"],"mappings":";;;;;;;;;;;;AA2B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,IAAA,IAAA,CAAK,YAAY,MAAA,CAAO,SAAA;AACxB,IAAA,IAAA,CAAK,gBAAgB,MAAA,CAAO,KAAA;AAC5B,IAAA,IAAA,CAAK,cAAA,GAAiB,KAAK,YAAA,CAAa,MAAA,CAAO,OAAO,MAAA,CAAO,MAAA,EAAQ,OAAO,SAAS,CAAA;AAAA,EACvF;AA6EF","file":"index.cjs","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport slugify from '@sindresorhus/slugify';\nimport type { ToolsInput } from '../agent';\nimport { MastraBase } from '../base';\nimport { MastraError } from '../error';\nimport { RegisteredLogger } from '../logger';\nimport type { Mastra } from '../mastra';\nimport type { InternalCoreTool, MCPToolType, ToolAction, ToolExecutionContext } from '../tools';\nimport type {\n MCPServerConfig,\n MCPServerHonoSSEOptions,\n MCPServerHTTPOptions,\n MCPServerSSEOptions,\n PackageInfo,\n RemoteInfo,\n Repository,\n ServerDetailInfo,\n ServerInfo,\n} from './types';\nexport * from './types';\nexport type { MCPToolType } from '../tools';\n\n/**\n * Abstract base class for MCP server implementations.\n * This provides a common interface and shared functionality for all MCP servers\n * that can be registered with Mastra, including handling of server metadata.\n */\nexport abstract class MCPServerBase extends MastraBase {\n /** Tracks if the server ID has been definitively set. */\n private idWasSet = false;\n /** The display name of the MCP server. */\n public readonly name: string;\n /** The semantic version of the MCP server. */\n public readonly version: string;\n /** Internal storage for the server's unique ID. */\n private _id: string;\n /** A description of what the MCP server does. */\n public readonly description?: string;\n /** Repository information for the server's source code. */\n public readonly repository?: Repository;\n /** The release date of this server version (ISO 8601 string). */\n public readonly releaseDate: string;\n /** Indicates if this version is the latest available. */\n public readonly isLatest: boolean;\n /** The canonical packaging format (e.g., \"npm\", \"docker\"), if applicable. */\n public readonly packageCanonical?: MCPServerConfig['packageCanonical'];\n /** Information about installable packages for this server. */\n public readonly packages?: PackageInfo[];\n /** Information about remote access points for this server. */\n public readonly remotes?: RemoteInfo[];\n /** The tools registered with and converted by this MCP server. */\n public convertedTools: Record<string, InternalCoreTool>;\n /** Reference to the Mastra instance if this server is registered with one. */\n public mastra: Mastra | undefined;\n /** Agents to be exposed as tools. */\n protected readonly agents?: MCPServerConfig['agents'];\n /** Workflows to be exposed as tools. */\n protected readonly workflows?: MCPServerConfig['workflows'];\n /** Original tools configuration for re-conversion when Mastra instance is registered. */\n protected readonly originalTools: ToolsInput;\n\n /**\n * Public getter for the server's unique ID.\n * The ID is set at construction or by Mastra and is read-only afterwards.\n */\n public get id(): string {\n return this._id;\n }\n\n /**\n * Gets a read-only view of the registered tools.\n * @returns A readonly record of converted tools.\n */\n tools(): Readonly<Record<string, InternalCoreTool>> {\n return this.convertedTools;\n }\n\n /**\n * Sets the server's unique ID. This method is typically called by Mastra when\n * registering the server, using the key provided in the Mastra configuration.\n * It ensures the ID is set only once.\n * If an ID was already provided in the MCPServerConfig, this method will be a no-op.\n * @param id The unique ID to assign to the server.\n */\n setId(id: string) {\n if (this.idWasSet) {\n return;\n }\n this._id = id;\n this.idWasSet = true;\n }\n\n /**\n * Abstract method to convert and validate tool definitions provided to the server.\n * This method will also handle agents passed in the config.\n * @param tools Tool definitions to convert.\n * @param agents Agent definitions to convert to tools.\n * @param workflows Workflow definitions to convert to tools.\n * @returns A record of converted and validated tools.\n */\n public abstract convertTools(\n tools: ToolsInput,\n agents?: MCPServerConfig['agents'],\n workflows?: MCPServerConfig['workflows'],\n ): Record<string, InternalCoreTool>;\n\n /**\n * Internal method used by Mastra to register itself with the server.\n * @param mastra The Mastra instance.\n * @internal\n */\n __registerMastra(mastra: Mastra): void {\n this.mastra = mastra;\n // Re-convert tools now that we have the Mastra instance to populate MCP tools execute with mastra instance\n this.convertedTools = this.convertTools(this.originalTools, this.agents, this.workflows);\n\n // Auto-register tools with the Mastra instance\n if (this.originalTools && typeof this.originalTools === 'object') {\n Object.entries(this.originalTools).forEach(([key, tool]) => {\n try {\n // Only add tools that have an id property (ToolAction type)\n if (tool && typeof tool === 'object' && 'id' in tool) {\n // Use tool's intrinsic ID to avoid collisions across MCP servers\n const toolKey = typeof (tool as any).id === 'string' ? (tool as any).id : key;\n mastra.addTool(tool as ToolAction<any, any, any, any, ToolExecutionContext<any, any>>, toolKey);\n }\n } catch (error) {\n // Tool might already be registered, that's okay\n if (!(error instanceof MastraError) || error.id !== 'MASTRA_ADD_TOOL_DUPLICATE_KEY') {\n throw error;\n }\n }\n });\n }\n\n // Auto-register agents with the Mastra instance\n if (this.agents && typeof this.agents === 'object') {\n Object.entries(this.agents).forEach(([key, agent]) => {\n try {\n mastra.addAgent(agent, key);\n } catch (error) {\n // Agent might already be registered, that's okay\n if (!(error instanceof MastraError) || error.id !== 'MASTRA_ADD_AGENT_DUPLICATE_KEY') {\n throw error;\n }\n }\n });\n }\n\n // Auto-register workflows with the Mastra instance\n if (this.workflows && typeof this.workflows === 'object') {\n Object.entries(this.workflows).forEach(([key, workflow]) => {\n try {\n mastra.addWorkflow(workflow, key);\n } catch (error) {\n // Workflow might already be registered, that's okay\n if (!(error instanceof MastraError) || error.id !== 'MASTRA_ADD_WORKFLOW_DUPLICATE_KEY') {\n throw error;\n }\n }\n });\n }\n }\n\n /**\n * Constructor for the MCPServerBase.\n * @param config Configuration options for the MCP server, including metadata.\n */\n constructor(config: MCPServerConfig) {\n super({ component: RegisteredLogger.MCP_SERVER, name: config.name });\n this.name = config.name;\n this.version = config.version;\n\n // If user does not provide an ID, we will use the key from the Mastra config, but if user does not pass MCPServer\n // to Mastra, we will generate a random UUID as a backup.\n if (config.id) {\n this._id = slugify(config.id);\n this.idWasSet = true;\n } else {\n this._id = this.mastra?.generateId() || randomUUID();\n }\n\n this.description = config.description;\n this.repository = config.repository;\n this.releaseDate = config.releaseDate || new Date().toISOString();\n this.isLatest = config.isLatest === undefined ? true : config.isLatest;\n this.packageCanonical = config.packageCanonical;\n this.packages = config.packages;\n this.remotes = config.remotes;\n this.agents = config.agents;\n this.workflows = config.workflows;\n this.originalTools = config.tools;\n this.convertedTools = this.convertTools(config.tools, config.agents, config.workflows);\n }\n\n /**\n * Start the MCP server using stdio transport\n * This is typically used for Windsurf integration\n */\n public abstract startStdio(): Promise<void>;\n\n /**\n * Start the MCP server using SSE transport\n * This is typically used for web integration\n * @param options Options for the SSE transport\n */\n public abstract startSSE(options: MCPServerSSEOptions): Promise<void>;\n\n /**\n * Start the MCP server using Hono SSE transport\n * Used for Hono servers\n * @param options Options for the SSE transport\n */\n public abstract startHonoSSE(options: MCPServerHonoSSEOptions): Promise<Response | undefined>;\n\n /**\n * Start the MCP server using HTTP transport\n * @param options Options for the HTTP transport\n */\n public abstract startHTTP(options: MCPServerHTTPOptions): Promise<void>;\n\n /**\n * Close the MCP server and all its connections\n */\n public abstract close(): Promise<void>;\n\n /**\n * Gets the basic information about the server, conforming to the MCP Registry 'Server' schema.\n * This information is suitable for listing multiple servers.\n * @returns ServerInfo object containing basic server metadata.\n */\n public abstract getServerInfo(): ServerInfo;\n\n /**\n * Gets detailed information about the server, conforming to the MCP Registry 'ServerDetail' schema.\n * This includes all information from `getServerInfo` plus package and remote details.\n * @returns ServerDetailInfo object containing comprehensive server metadata.\n */\n public abstract getServerDetail(): ServerDetailInfo;\n\n /**\n * Gets a list of tools provided by this MCP server, including their schemas.\n * @returns An object containing an array of tool information.\n */\n public abstract getToolListInfo(): {\n tools: Array<{ name: string; description?: string; inputSchema: any; outputSchema?: any; toolType?: MCPToolType }>;\n };\n\n /**\n * Gets information for a specific tool provided by this MCP server.\n * @param toolId The ID/name of the tool to retrieve.\n * @returns Tool information (name, description, inputSchema) or undefined if not found.\n */\n public abstract getToolInfo(\n toolId: string,\n ): { name: string; description?: string; inputSchema: any; outputSchema?: any; toolType?: MCPToolType } | undefined;\n\n /**\n * Executes a specific tool provided by this MCP server.\n * @param toolId The ID/name of the tool to execute.\n * @param args The arguments to pass to the tool's execute function.\n * @param executionContext Optional context for the tool execution (e.g., messages, toolCallId).\n * @returns A promise that resolves to the result of the tool execution.\n * @throws Error if the tool is not found, or if execution fails.\n */\n public abstract executeTool(\n toolId: string,\n args: any,\n executionContext?: { messages?: any[]; toolCallId?: string },\n ): Promise<any>;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/mcp/index.ts"],"names":["MastraBase","MastraError","RegisteredLogger","slugify","randomUUID"],"mappings":";;;;;;;;;;;;AA2BO,IAAe,aAAA,GAAf,cAAkEA,4BAAA,CAAW;AAAA;AAAA,EAE1E,QAAA,GAAW,KAAA;AAAA;AAAA,EAEH,IAAA;AAAA;AAAA,EAEA,OAAA;AAAA;AAAA,EAER,GAAA;AAAA;AAAA,EAEQ,WAAA;AAAA;AAAA,EAEA,UAAA;AAAA;AAAA,EAEA,WAAA;AAAA;AAAA,EAEA,QAAA;AAAA;AAAA,EAEA,gBAAA;AAAA;AAAA,EAEA,QAAA;AAAA;AAAA,EAEA,OAAA;AAAA;AAAA,EAET,cAAA;AAAA;AAAA,EAEA,MAAA;AAAA;AAAA,EAEY,MAAA;AAAA;AAAA,EAEA,SAAA;AAAA;AAAA,EAEA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,IAAW,EAAA,GAAU;AACnB,IAAA,OAAO,IAAA,CAAK,GAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KAAA,GAAoD;AAClD,IAAA,OAAO,IAAA,CAAK,cAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,EAAA,EAAS;AACb,IAAA,IAAI,KAAK,QAAA,EAAU;AACjB,MAAA;AAAA,IACF;AACA,IAAA,IAAA,CAAK,GAAA,GAAM,EAAA;AACX,IAAA,IAAA,CAAK,QAAA,GAAW,IAAA;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBA,iBAAiB,MAAA,EAAsB;AACrC,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AAEd,IAAA,IAAA,CAAK,cAAA,GAAiB,KAAK,YAAA,CAAa,IAAA,CAAK,eAAe,IAAA,CAAK,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BAAmB,MAAA,CAAO,gBAAA;AAC/B,IAAA,IAAA,CAAK,WAAW,MAAA,CAAO,QAAA;AACvB,IAAA,IAAA,CAAK,UAAU,MAAA,CAAO,OAAA;AACtB,IAAA,IAAA,CAAK,SAAS,MAAA,CAAO,MAAA;AACrB,IAAA,IAAA,CAAK,YAAY,MAAA,CAAO,SAAA;AACxB,IAAA,IAAA,CAAK,gBAAgB,MAAA,CAAO,KAAA;AAC5B,IAAA,IAAA,CAAK,cAAA,GAAiB,KAAK,YAAA,CAAa,MAAA,CAAO,OAAO,MAAA,CAAO,MAAA,EAAQ,OAAO,SAAS,CAAA;AAAA,EACvF;AA6EF","file":"index.cjs","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport slugify from '@sindresorhus/slugify';\nimport type { ToolsInput } from '../agent';\nimport { MastraBase } from '../base';\nimport { MastraError } from '../error';\nimport { RegisteredLogger } from '../logger';\nimport type { Mastra } from '../mastra';\nimport type { InternalCoreTool, MCPToolType, ToolAction, ToolExecutionContext } from '../tools';\nimport type {\n MCPServerConfig,\n MCPServerHonoSSEOptions,\n MCPServerHTTPOptions,\n MCPServerSSEOptions,\n PackageInfo,\n RemoteInfo,\n Repository,\n ServerDetailInfo,\n ServerInfo,\n} from './types';\nexport * from './types';\nexport type { MCPToolType } from '../tools';\n\n/**\n * Abstract base class for MCP server implementations.\n * This provides a common interface and shared functionality for all MCP servers\n * that can be registered with Mastra, including handling of server metadata.\n */\nexport abstract class MCPServerBase<TId extends string = string> extends MastraBase {\n /** Tracks if the server ID has been definitively set. */\n private idWasSet = false;\n /** The display name of the MCP server. */\n public readonly name: string;\n /** The semantic version of the MCP server. */\n public readonly version: string;\n /** Internal storage for the server's unique ID. */\n private _id: TId;\n /** A description of what the MCP server does. */\n public readonly description?: string;\n /** Repository information for the server's source code. */\n public readonly repository?: Repository;\n /** The release date of this server version (ISO 8601 string). */\n public readonly releaseDate: string;\n /** Indicates if this version is the latest available. */\n public readonly isLatest: boolean;\n /** The canonical packaging format (e.g., \"npm\", \"docker\"), if applicable. */\n public readonly packageCanonical?: MCPServerConfig['packageCanonical'];\n /** Information about installable packages for this server. */\n public readonly packages?: PackageInfo[];\n /** Information about remote access points for this server. */\n public readonly remotes?: RemoteInfo[];\n /** The tools registered with and converted by this MCP server. */\n public convertedTools: Record<string, InternalCoreTool>;\n /** Reference to the Mastra instance if this server is registered with one. */\n public mastra: Mastra | undefined;\n /** Agents to be exposed as tools. */\n protected readonly agents?: MCPServerConfig['agents'];\n /** Workflows to be exposed as tools. */\n protected readonly workflows?: MCPServerConfig['workflows'];\n /** Original tools configuration for re-conversion when Mastra instance is registered. */\n protected readonly originalTools: ToolsInput;\n\n /**\n * Public getter for the server's unique ID.\n * The ID is set at construction or by Mastra and is read-only afterwards.\n */\n public get id(): TId {\n return this._id;\n }\n\n /**\n * Gets a read-only view of the registered tools.\n * @returns A readonly record of converted tools.\n */\n tools(): Readonly<Record<string, InternalCoreTool>> {\n return this.convertedTools;\n }\n\n /**\n * Sets the server's unique ID. This method is typically called by Mastra when\n * registering the server, using the key provided in the Mastra configuration.\n * It ensures the ID is set only once.\n * If an ID was already provided in the MCPServerConfig, this method will be a no-op.\n * @param id The unique ID to assign to the server.\n */\n setId(id: TId) {\n if (this.idWasSet) {\n return;\n }\n this._id = id;\n this.idWasSet = true;\n }\n\n /**\n * Abstract method to convert and validate tool definitions provided to the server.\n * This method will also handle agents passed in the config.\n * @param tools Tool definitions to convert.\n * @param agents Agent definitions to convert to tools.\n * @param workflows Workflow definitions to convert to tools.\n * @returns A record of converted and validated tools.\n */\n public abstract convertTools(\n tools: ToolsInput,\n agents?: MCPServerConfig['agents'],\n workflows?: MCPServerConfig['workflows'],\n ): Record<string, InternalCoreTool>;\n\n /**\n * Internal method used by Mastra to register itself with the server.\n * @param mastra The Mastra instance.\n * @internal\n */\n __registerMastra(mastra: Mastra): void {\n this.mastra = mastra;\n // Re-convert tools now that we have the Mastra instance to populate MCP tools execute with mastra instance\n this.convertedTools = this.convertTools(this.originalTools, this.agents, this.workflows);\n\n // Auto-register tools with the Mastra instance\n if (this.originalTools && typeof this.originalTools === 'object') {\n Object.entries(this.originalTools).forEach(([key, tool]) => {\n try {\n // Only add tools that have an id property (ToolAction type)\n if (tool && typeof tool === 'object' && 'id' in tool) {\n // Use tool's intrinsic ID to avoid collisions across MCP servers\n const toolKey = typeof (tool as any).id === 'string' ? (tool as any).id : key;\n mastra.addTool(tool as ToolAction<any, any, any, any, ToolExecutionContext<any, any>>, toolKey);\n }\n } catch (error) {\n // Tool might already be registered, that's okay\n if (!(error instanceof MastraError) || error.id !== 'MASTRA_ADD_TOOL_DUPLICATE_KEY') {\n throw error;\n }\n }\n });\n }\n\n // Auto-register agents with the Mastra instance\n if (this.agents && typeof this.agents === 'object') {\n Object.entries(this.agents).forEach(([key, agent]) => {\n try {\n mastra.addAgent(agent, key);\n } catch (error) {\n // Agent might already be registered, that's okay\n if (!(error instanceof MastraError) || error.id !== 'MASTRA_ADD_AGENT_DUPLICATE_KEY') {\n throw error;\n }\n }\n });\n }\n\n // Auto-register workflows with the Mastra instance\n if (this.workflows && typeof this.workflows === 'object') {\n Object.entries(this.workflows).forEach(([key, workflow]) => {\n try {\n mastra.addWorkflow(workflow, key);\n } catch (error) {\n // Workflow might already be registered, that's okay\n if (!(error instanceof MastraError) || error.id !== 'MASTRA_ADD_WORKFLOW_DUPLICATE_KEY') {\n throw error;\n }\n }\n });\n }\n }\n\n /**\n * Constructor for the MCPServerBase.\n * @param config Configuration options for the MCP server, including metadata.\n */\n constructor(config: MCPServerConfig<TId>) {\n super({ component: RegisteredLogger.MCP_SERVER, name: config.name });\n this.name = config.name;\n this.version = config.version;\n\n // If user does not provide an ID, we will use the key from the Mastra config, but if user does not pass MCPServer\n // to Mastra, we will generate a random UUID as a backup.\n if (config.id) {\n this._id = slugify(config.id) as TId;\n this.idWasSet = true;\n } else {\n this._id = (this.mastra?.generateId() || randomUUID()) as TId;\n }\n\n this.description = config.description;\n this.repository = config.repository;\n this.releaseDate = config.releaseDate || new Date().toISOString();\n this.isLatest = config.isLatest === undefined ? true : config.isLatest;\n this.packageCanonical = config.packageCanonical;\n this.packages = config.packages;\n this.remotes = config.remotes;\n this.agents = config.agents;\n this.workflows = config.workflows;\n this.originalTools = config.tools;\n this.convertedTools = this.convertTools(config.tools, config.agents, config.workflows);\n }\n\n /**\n * Start the MCP server using stdio transport\n * This is typically used for Windsurf integration\n */\n public abstract startStdio(): Promise<void>;\n\n /**\n * Start the MCP server using SSE transport\n * This is typically used for web integration\n * @param options Options for the SSE transport\n */\n public abstract startSSE(options: MCPServerSSEOptions): Promise<void>;\n\n /**\n * Start the MCP server using Hono SSE transport\n * Used for Hono servers\n * @param options Options for the SSE transport\n */\n public abstract startHonoSSE(options: MCPServerHonoSSEOptions): Promise<Response | undefined>;\n\n /**\n * Start the MCP server using HTTP transport\n * @param options Options for the HTTP transport\n */\n public abstract startHTTP(options: MCPServerHTTPOptions): Promise<void>;\n\n /**\n * Close the MCP server and all its connections\n */\n public abstract close(): Promise<void>;\n\n /**\n * Gets the basic information about the server, conforming to the MCP Registry 'Server' schema.\n * This information is suitable for listing multiple servers.\n * @returns ServerInfo object containing basic server metadata.\n */\n public abstract getServerInfo(): ServerInfo;\n\n /**\n * Gets detailed information about the server, conforming to the MCP Registry 'ServerDetail' schema.\n * This includes all information from `getServerInfo` plus package and remote details.\n * @returns ServerDetailInfo object containing comprehensive server metadata.\n */\n public abstract getServerDetail(): ServerDetailInfo;\n\n /**\n * Gets a list of tools provided by this MCP server, including their schemas.\n * @returns An object containing an array of tool information.\n */\n public abstract getToolListInfo(): {\n tools: Array<{ name: string; description?: string; inputSchema: any; outputSchema?: any; toolType?: MCPToolType }>;\n };\n\n /**\n * Gets information for a specific tool provided by this MCP server.\n * @param toolId The ID/name of the tool to retrieve.\n * @returns Tool information (name, description, inputSchema) or undefined if not found.\n */\n public abstract getToolInfo(\n toolId: string,\n ): { name: string; description?: string; inputSchema: any; outputSchema?: any; toolType?: MCPToolType } | undefined;\n\n /**\n * Executes a specific tool provided by this MCP server.\n * @param toolId The ID/name of the tool to execute.\n * @param args The arguments to pass to the tool's execute function.\n * @param executionContext Optional context for the tool execution (e.g., messages, toolCallId).\n * @returns A promise that resolves to the result of the tool execution.\n * @throws Error if the tool is not found, or if execution fails.\n */\n public abstract executeTool(\n toolId: string,\n args: any,\n executionContext?: { messages?: any[]; toolCallId?: string },\n ): Promise<any>;\n}\n"]}
|