@mastra/core 0.24.0 → 1.0.0-beta.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/CHANGELOG.md +478 -141
- package/README.md +2 -3
- package/agent/message-list.d.ts +1 -0
- package/dist/action/index.d.ts +0 -2
- package/dist/action/index.d.ts.map +1 -1
- package/dist/agent/__tests__/mock-model.d.ts +3 -1
- package/dist/agent/__tests__/mock-model.d.ts.map +1 -1
- package/dist/agent/agent-legacy.d.ts +176 -0
- package/dist/agent/agent-legacy.d.ts.map +1 -0
- package/dist/agent/agent.d.ts +83 -229
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.types.d.ts +10 -25
- package/dist/agent/agent.types.d.ts.map +1 -1
- package/dist/agent/index.cjs +10 -26
- package/dist/agent/index.d.ts +1 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +16 -0
- package/dist/agent/message-list/index.d.ts +77 -87
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/message-list/index.js +3 -0
- package/dist/agent/message-list/prompt/attachments-to-parts.d.ts +2 -2
- package/dist/agent/message-list/prompt/attachments-to-parts.d.ts.map +1 -1
- package/dist/agent/message-list/prompt/convert-to-mastra-v1.d.ts +2 -2
- package/dist/agent/message-list/prompt/download-assets.d.ts.map +1 -1
- package/dist/agent/message-list/prompt/invalid-content-error.d.ts +1 -1
- package/dist/agent/message-list/prompt/invalid-content-error.d.ts.map +1 -1
- package/dist/agent/message-list/types.d.ts +2 -1
- package/dist/agent/message-list/types.d.ts.map +1 -1
- package/dist/agent/message-list/utils/ai-v4-v5/core-model-message.d.ts +3 -2
- package/dist/agent/message-list/utils/ai-v4-v5/core-model-message.d.ts.map +1 -1
- package/dist/agent/message-list/utils/ai-v4-v5/ui-message.d.ts +3 -2
- package/dist/agent/message-list/utils/ai-v4-v5/ui-message.d.ts.map +1 -1
- package/dist/agent/message-list/utils/ai-v5/gemini-compatibility.d.ts +1 -1
- package/dist/agent/message-list/utils/ai-v5/gemini-compatibility.d.ts.map +1 -1
- package/dist/agent/message-list/utils/convert-messages.d.ts +4 -4
- package/dist/agent/message-list/utils/convert-messages.d.ts.map +1 -1
- package/dist/agent/test-utils.d.ts +2 -79
- package/dist/agent/test-utils.d.ts.map +1 -1
- package/dist/agent/trip-wire.d.ts +1 -1
- package/dist/agent/trip-wire.d.ts.map +1 -1
- package/dist/agent/types.d.ts +23 -37
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/utils.d.ts +15 -64
- package/dist/agent/utils.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +16 -20
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts +5 -7
- 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 +14 -18
- 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 +6 -6
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts +10 -12
- package/dist/agent/workflows/prepare-stream/schema.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts +3 -7
- package/dist/agent/workflows/prepare-stream/stream-step.d.ts.map +1 -1
- package/dist/ai-sdk.types.d.ts +4705 -0
- package/dist/base.cjs +2 -2
- package/dist/base.d.ts +0 -16
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.d.ts +2 -1
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/index.js +1 -1
- package/dist/cache/index.cjs +3 -3
- package/dist/cache/index.js +1 -1
- package/dist/chunk-26SQQNMU.js +15754 -0
- package/dist/chunk-26SQQNMU.js.map +1 -0
- package/dist/{chunk-FHVFGVIO.js → chunk-32CTMD2C.js} +90 -32
- package/dist/chunk-32CTMD2C.js.map +1 -0
- package/dist/chunk-4CDL2QJT.js +649 -0
- package/dist/chunk-4CDL2QJT.js.map +1 -0
- package/dist/chunk-5WRI5ZAA.js +29 -0
- package/dist/{chunk-3HXBPDKN.js.map → chunk-5WRI5ZAA.js.map} +1 -1
- package/dist/{chunk-KAEQISOW.js → chunk-76K3IYWM.js} +5 -5
- package/dist/chunk-76K3IYWM.js.map +1 -0
- package/dist/chunk-7AHYOMHJ.js +149 -0
- package/dist/chunk-7AHYOMHJ.js.map +1 -0
- package/dist/{chunk-BWGXM3D4.js → chunk-7SKXKUYT.js} +712 -541
- package/dist/chunk-7SKXKUYT.js.map +1 -0
- package/dist/{chunk-UZKIGB7M.cjs → chunk-BMAFVZ2D.cjs} +5 -5
- package/dist/chunk-BMAFVZ2D.cjs.map +1 -0
- package/dist/chunk-BNBRQS7N.js +910 -0
- package/dist/chunk-BNBRQS7N.js.map +1 -0
- package/dist/{chunk-34ZCWSUA.js → chunk-BU4IAJWF.js} +6 -9
- package/dist/chunk-BU4IAJWF.js.map +1 -0
- package/dist/{chunk-ABZOBBLL.cjs → chunk-BXOL277H.cjs} +735 -562
- package/dist/chunk-BXOL277H.cjs.map +1 -0
- package/dist/{chunk-6TEQIYXV.cjs → chunk-CBAB7GOD.cjs} +15 -15
- package/dist/chunk-CBAB7GOD.cjs.map +1 -0
- package/dist/{chunk-A5KDVZDL.cjs → chunk-DSNPWVIG.cjs} +9 -9
- package/dist/chunk-DSNPWVIG.cjs.map +1 -0
- package/dist/chunk-DZUJEN5N.cjs +32 -0
- package/dist/{chunk-EBVYYC2Q.cjs.map → chunk-DZUJEN5N.cjs.map} +1 -1
- package/dist/chunk-E7K4FTLN.cjs +273 -0
- package/dist/chunk-E7K4FTLN.cjs.map +1 -0
- package/dist/{chunk-MJMID7LX.cjs → chunk-ECFXGXWO.cjs} +609 -644
- package/dist/chunk-ECFXGXWO.cjs.map +1 -0
- package/dist/chunk-ET6UOTTU.cjs +154 -0
- package/dist/chunk-ET6UOTTU.cjs.map +1 -0
- package/dist/chunk-FD734TPS.cjs +15818 -0
- package/dist/chunk-FD734TPS.cjs.map +1 -0
- package/dist/chunk-GGYKYORQ.cjs +2060 -0
- package/dist/chunk-GGYKYORQ.cjs.map +1 -0
- package/dist/{chunk-HLRWYUFN.js → chunk-GRBGQ2GE.js} +5 -5
- package/dist/{chunk-HLRWYUFN.js.map → chunk-GRBGQ2GE.js.map} +1 -1
- package/dist/chunk-IU2SZXJQ.cjs +913 -0
- package/dist/chunk-IU2SZXJQ.cjs.map +1 -0
- package/dist/{chunk-GPWMM745.cjs → chunk-J7O6WENZ.cjs} +5 -5
- package/dist/{chunk-GPWMM745.cjs.map → chunk-J7O6WENZ.cjs.map} +1 -1
- package/dist/{chunk-PZUZNPFM.js → chunk-JJ5O45LH.js} +3 -4
- package/dist/chunk-JJ5O45LH.js.map +1 -0
- package/dist/{chunk-E3PG7G6E.js → chunk-JV2KH24V.js} +599 -633
- package/dist/chunk-JV2KH24V.js.map +1 -0
- package/dist/chunk-KEXGB7FK.cjs +29 -0
- package/dist/chunk-KEXGB7FK.cjs.map +1 -0
- package/dist/chunk-KIZIOFZC.js +265 -0
- package/dist/chunk-KIZIOFZC.js.map +1 -0
- package/dist/{chunk-UXG7PYML.js → chunk-KJ2SW6VA.js} +9 -9
- package/dist/chunk-KJ2SW6VA.js.map +1 -0
- package/dist/{chunk-TTELJD4F.js → chunk-L54GIUCB.js} +2 -2
- package/dist/chunk-L54GIUCB.js.map +1 -0
- package/dist/chunk-L7XKOKOW.js +12385 -0
- package/dist/chunk-L7XKOKOW.js.map +1 -0
- package/dist/{chunk-TSNDVBUU.cjs → chunk-MR7ZWBL6.cjs} +2 -2
- package/dist/chunk-MR7ZWBL6.cjs.map +1 -0
- package/dist/chunk-MV7KHWUT.js +2031 -0
- package/dist/chunk-MV7KHWUT.js.map +1 -0
- package/dist/{chunk-3NTOFNIU.js → chunk-OJNJA5ZI.js} +3 -3
- package/dist/{chunk-3NTOFNIU.js.map → chunk-OJNJA5ZI.js.map} +1 -1
- package/dist/{chunk-3VXXCPKX.js → chunk-P6APHXPZ.js} +334 -410
- package/dist/chunk-P6APHXPZ.js.map +1 -0
- package/dist/{chunk-77JHIM4E.cjs → chunk-QCQLOMJM.cjs} +348 -424
- package/dist/chunk-QCQLOMJM.cjs.map +1 -0
- package/dist/chunk-QM5SRDJX.js +9022 -0
- package/dist/chunk-QM5SRDJX.js.map +1 -0
- package/dist/{chunk-WBAXXG34.cjs → chunk-QUKUN6NR.cjs} +32 -66
- package/dist/chunk-QUKUN6NR.cjs.map +1 -0
- package/dist/{chunk-ROS5CMJS.cjs → chunk-QUZGDSWE.cjs} +63 -50
- package/dist/chunk-QUZGDSWE.cjs.map +1 -0
- package/dist/chunk-S5MJLXMG.cjs +12424 -0
- package/dist/chunk-S5MJLXMG.cjs.map +1 -0
- package/dist/chunk-S6URFGCZ.js +27 -0
- package/dist/chunk-S6URFGCZ.js.map +1 -0
- package/dist/chunk-SVLMF4UZ.cjs +9033 -0
- package/dist/chunk-SVLMF4UZ.cjs.map +1 -0
- package/dist/{chunk-ZMELUU72.js → chunk-TQTAMPSC.js} +3 -3
- package/dist/chunk-TQTAMPSC.js.map +1 -0
- package/dist/{chunk-5NTO7S5I.cjs → chunk-TWH4PTDG.cjs} +2 -4
- package/dist/chunk-TWH4PTDG.cjs.map +1 -0
- package/dist/{chunk-WCHE6FJ7.js → chunk-UIZSWUKP.js} +15 -50
- package/dist/chunk-UIZSWUKP.js.map +1 -0
- package/dist/{chunk-Z4RIRDU3.js → chunk-VJUZZB2I.js} +45 -32
- package/dist/chunk-VJUZZB2I.js.map +1 -0
- package/dist/{chunk-MCASUJWY.cjs → chunk-VOY2RXOC.cjs} +36 -59
- package/dist/chunk-VOY2RXOC.cjs.map +1 -0
- package/dist/{chunk-3JX2Y3WH.cjs → chunk-VV753WCB.cjs} +18 -21
- package/dist/chunk-VV753WCB.cjs.map +1 -0
- package/dist/chunk-WM6CK2F3.cjs +674 -0
- package/dist/chunk-WM6CK2F3.cjs.map +1 -0
- package/dist/{chunk-PFXXH2RP.js → chunk-X7JMA3IY.js} +15 -15
- package/dist/chunk-X7JMA3IY.js.map +1 -0
- package/dist/{chunk-NR77P3TK.js → chunk-XEVG546F.js} +14 -37
- package/dist/chunk-XEVG546F.js.map +1 -0
- package/dist/{chunk-QFF5JUKT.cjs → chunk-Y63IFHEZ.cjs} +4 -4
- package/dist/chunk-Y63IFHEZ.cjs.map +1 -0
- package/dist/{chunk-B7V6NYWH.cjs → chunk-Y6ROD72V.cjs} +4 -4
- package/dist/{chunk-B7V6NYWH.cjs.map → chunk-Y6ROD72V.cjs.map} +1 -1
- package/dist/{chunk-7J3XX4AO.cjs → chunk-YIK3ASEG.cjs} +100 -42
- package/dist/chunk-YIK3ASEG.cjs.map +1 -0
- package/dist/deployer/index.cjs +8 -6
- package/dist/deployer/index.cjs.map +1 -1
- package/dist/deployer/index.js +10 -1
- package/dist/deployer/index.js.map +1 -1
- package/dist/di/index.cjs +3 -3
- package/dist/di/index.d.ts +1 -1
- package/dist/di/index.js +1 -1
- package/dist/error/index.cjs +6 -6
- package/dist/error/index.d.ts +0 -1
- package/dist/error/index.d.ts.map +1 -1
- package/dist/error/index.js +1 -1
- package/dist/{scores → evals}/base.d.ts +20 -18
- package/dist/evals/base.d.ts.map +1 -0
- package/dist/{scores → evals}/base.test-utils.d.ts +25 -25
- package/dist/evals/base.test-utils.d.ts.map +1 -0
- package/dist/{scores → evals}/hooks.d.ts +3 -3
- package/dist/evals/hooks.d.ts.map +1 -0
- package/dist/evals/index.cjs +37 -0
- package/dist/evals/index.d.ts +4 -0
- package/dist/evals/index.d.ts.map +1 -0
- package/dist/evals/index.js +4 -0
- package/dist/{scores/run-experiment → evals/run}/index.d.ts +18 -18
- package/dist/evals/run/index.d.ts.map +1 -0
- package/dist/evals/run/scorerAccumulator.d.ts.map +1 -0
- package/dist/{scores → evals}/scoreTraces/index.cjs +79 -99
- package/dist/evals/scoreTraces/index.cjs.map +1 -0
- package/dist/evals/scoreTraces/index.d.ts.map +1 -0
- package/dist/{scores → evals}/scoreTraces/index.js +72 -92
- package/dist/evals/scoreTraces/index.js.map +1 -0
- package/dist/{scores → evals}/scoreTraces/scoreTraces.d.ts +2 -2
- package/dist/evals/scoreTraces/scoreTraces.d.ts.map +1 -0
- package/dist/{scores → evals}/scoreTraces/scoreTracesWorkflow.d.ts +11 -11
- package/dist/evals/scoreTraces/scoreTracesWorkflow.d.ts.map +1 -0
- package/dist/{scores → evals}/scoreTraces/utils.d.ts +7 -7
- package/dist/evals/scoreTraces/utils.d.ts.map +1 -0
- package/dist/{scores → evals}/types.d.ts +22 -22
- package/dist/evals/types.d.ts.map +1 -0
- package/dist/features/index.cjs +8 -0
- package/dist/features/index.cjs.map +1 -0
- package/dist/features/index.d.ts +17 -0
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/index.js +6 -0
- package/dist/features/index.js.map +1 -0
- package/dist/hooks/index.cjs +4 -4
- package/dist/hooks/index.d.ts +1 -27
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +2 -340
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -113
- package/dist/index.js.map +1 -1
- package/dist/integration/index.cjs +87 -10
- package/dist/integration/index.cjs.map +1 -1
- package/dist/integration/index.js +88 -1
- package/dist/integration/index.js.map +1 -1
- package/dist/integration/integration.d.ts +3 -3
- package/dist/integration/integration.d.ts.map +1 -1
- package/dist/llm/index.cjs +7 -7
- package/dist/llm/index.d.ts +5 -6
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +1 -1
- package/dist/llm/model/base.types.d.ts +6 -7
- package/dist/llm/model/base.types.d.ts.map +1 -1
- package/dist/llm/model/model.d.ts +7 -7
- package/dist/llm/model/model.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +1 -1
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/model.loop.types.d.ts +3 -3
- package/dist/llm/model/model.loop.types.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +32 -7
- package/dist/llm/model/resolve-model.d.ts +8 -8
- package/dist/llm/model/shared.types.d.ts +2 -2
- package/dist/llm/model/shared.types.d.ts.map +1 -1
- package/dist/logger/constants.d.ts +1 -1
- package/dist/logger/default-logger.d.ts +2 -2
- package/dist/logger/default-logger.d.ts.map +1 -1
- package/dist/logger/index.cjs +11 -11
- package/dist/logger/index.js +2 -2
- package/dist/logger/logger.d.ts +4 -4
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/multi-logger.d.ts +2 -2
- package/dist/logger/multi-logger.d.ts.map +1 -1
- package/dist/logger/transport.d.ts +3 -3
- 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 +1 -1
- package/dist/loop/loop.d.ts.map +1 -1
- package/dist/loop/network/index.d.ts +15 -15
- package/dist/loop/network/index.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/types.d.ts +4 -7
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +55 -55
- package/dist/loop/workflows/agentic-execution/index.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +38 -38
- 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 +20 -20
- 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 +2 -2
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +55 -55
- package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
- package/dist/loop/workflows/schema.d.ts +19 -20
- package/dist/loop/workflows/schema.d.ts.map +1 -1
- package/dist/loop/workflows/stream.d.ts +1 -1
- package/dist/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/hooks.d.ts +2 -2
- package/dist/mastra/hooks.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +389 -180
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/mcp/index.cjs +41 -4
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +6 -4
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +39 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/types.d.ts +0 -15
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/memory/index.cjs +327 -13
- package/dist/memory/index.cjs.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +327 -1
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/memory.d.ts +33 -57
- package/dist/memory/memory.d.ts.map +1 -1
- package/dist/memory/mock.d.ts +61 -0
- package/dist/memory/mock.d.ts.map +1 -0
- package/dist/memory/types.d.ts +48 -45
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-7U4NRMM3.js +3 -0
- package/dist/{models-dev-4VGIWYS3.js.map → models-dev-7U4NRMM3.js.map} +1 -1
- package/dist/models-dev-VKSAQPRK.cjs +12 -0
- package/dist/{models-dev-AXZASLL2.cjs.map → models-dev-VKSAQPRK.cjs.map} +1 -1
- package/dist/netlify-2IDXTNFW.cjs +12 -0
- package/dist/{netlify-TX6V7SJJ.cjs.map → netlify-2IDXTNFW.cjs.map} +1 -1
- package/dist/netlify-42ZNWIDQ.js +3 -0
- package/dist/{netlify-VJXBII33.js.map → netlify-42ZNWIDQ.js.map} +1 -1
- package/dist/{ai-tracing → observability}/context.d.ts +5 -5
- package/dist/observability/context.d.ts.map +1 -0
- package/dist/observability/index.cjs +36 -0
- package/dist/observability/index.d.ts +11 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +3 -0
- package/dist/observability/no-op.d.ts +22 -0
- package/dist/observability/no-op.d.ts.map +1 -0
- package/dist/observability/types/index.d.ts +2 -0
- package/dist/observability/types/index.d.ts.map +1 -0
- package/dist/{ai-tracing/types.d.ts → observability/types/tracing.d.ts} +161 -107
- package/dist/observability/types/tracing.d.ts.map +1 -0
- package/dist/observability/utils.d.ts +12 -0
- package/dist/observability/utils.d.ts.map +1 -0
- package/dist/processors/index.cjs +11 -11
- package/dist/processors/index.d.ts +10 -9
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/processors/batch-parts.d.ts +2 -1
- package/dist/processors/processors/batch-parts.d.ts.map +1 -1
- package/dist/processors/processors/language-detector.d.ts +6 -5
- package/dist/processors/processors/language-detector.d.ts.map +1 -1
- package/dist/processors/processors/moderation.d.ts +8 -7
- package/dist/processors/processors/moderation.d.ts.map +1 -1
- package/dist/processors/processors/pii-detector.d.ts +8 -7
- package/dist/processors/processors/pii-detector.d.ts.map +1 -1
- package/dist/processors/processors/prompt-injection-detector.d.ts +6 -5
- 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 +6 -5
- package/dist/processors/processors/system-prompt-scrubber.d.ts.map +1 -1
- package/dist/processors/processors/token-limiter.d.ts +5 -4
- package/dist/processors/processors/token-limiter.d.ts.map +1 -1
- package/dist/processors/processors/unicode-normalizer.d.ts +5 -4
- package/dist/processors/processors/unicode-normalizer.d.ts.map +1 -1
- package/dist/processors/runner.d.ts +5 -5
- package/dist/processors/runner.d.ts.map +1 -1
- package/dist/provider-registry.json +76 -18
- package/dist/{registry-generator-DXRSYYYT.js → registry-generator-H4YNODDH.js} +2 -2
- package/dist/{registry-generator-DXRSYYYT.js.map → registry-generator-H4YNODDH.js.map} +1 -1
- package/dist/{registry-generator-6WVOHM2L.cjs → registry-generator-MK63POJO.cjs} +2 -2
- package/dist/{registry-generator-6WVOHM2L.cjs.map → registry-generator-MK63POJO.cjs.map} +1 -1
- package/dist/relevance/index.cjs +47 -13
- package/dist/relevance/index.cjs.map +1 -1
- package/dist/relevance/index.d.ts +0 -1
- package/dist/relevance/index.d.ts.map +1 -1
- package/dist/relevance/index.js +49 -1
- package/dist/relevance/index.js.map +1 -1
- package/dist/relevance/mastra-agent/index.d.ts.map +1 -1
- package/dist/request-context/index.cjs +12 -0
- package/dist/{runtime-context → request-context}/index.d.ts +1 -1
- package/dist/{runtime-context → request-context}/index.d.ts.map +1 -1
- package/dist/request-context/index.js +3 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/index.cjs +9 -25
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +4 -21
- package/dist/server/index.js.map +1 -1
- package/dist/server/types.d.ts +3 -3
- package/dist/server/types.d.ts.map +1 -1
- package/dist/storage/base.d.ts +75 -143
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/constants.d.ts +3 -4
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/domains/index.d.ts +0 -2
- package/dist/storage/domains/index.d.ts.map +1 -1
- package/dist/storage/domains/memory/base.d.ts +19 -56
- package/dist/storage/domains/memory/base.d.ts.map +1 -1
- package/dist/storage/domains/memory/inmemory.d.ts +15 -35
- package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/base.d.ts +24 -24
- package/dist/storage/domains/observability/base.d.ts.map +1 -1
- package/dist/storage/domains/observability/inmemory.d.ts +18 -18
- package/dist/storage/domains/observability/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 +5 -5
- package/dist/storage/domains/scores/base.d.ts.map +1 -1
- package/dist/storage/domains/scores/inmemory.d.ts +5 -5
- package/dist/storage/domains/scores/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/workflows/base.d.ts +4 -11
- package/dist/storage/domains/workflows/base.d.ts.map +1 -1
- package/dist/storage/domains/workflows/inmemory.d.ts +4 -11
- package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
- package/dist/storage/index.cjs +74 -1775
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.js +1 -1744
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/mock.d.ts +35 -92
- package/dist/storage/mock.d.ts.map +1 -1
- package/dist/storage/types.d.ts +77 -75
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts +4 -2
- 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 +1 -0
- package/dist/stream/RunOutput.d.ts.map +1 -1
- package/dist/stream/aisdk/v4/input.d.ts +1 -1
- package/dist/stream/aisdk/v4/input.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/execute.d.ts +4 -11
- package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output.d.ts +1 -1
- package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts +1 -1
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.d.ts +1 -1
- package/dist/stream/index.d.ts.map +1 -1
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +2 -6
- package/dist/stream/types.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.cjs +8 -8
- package/dist/test-utils/llm-mock.cjs.map +1 -1
- package/dist/test-utils/llm-mock.d.ts +1 -1
- package/dist/test-utils/llm-mock.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.js +3 -3
- package/dist/test-utils/llm-mock.js.map +1 -1
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.js +1 -1
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/tool-builder/builder.d.ts +3 -71
- package/dist/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/tool.d.ts +25 -25
- package/dist/tools/tool.d.ts.map +1 -1
- package/dist/tools/types.d.ts +102 -11
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/validation.d.ts +4 -3
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/tts/index.cjs +12 -6
- package/dist/tts/index.cjs.map +1 -1
- package/dist/tts/index.d.ts +0 -1
- package/dist/tts/index.d.ts.map +1 -1
- package/dist/tts/index.js +14 -1
- package/dist/tts/index.js.map +1 -1
- package/dist/types/dynamic-argument.d.ts +3 -3
- package/dist/utils/fetchWithRetry.d.ts +9 -0
- package/dist/utils/fetchWithRetry.d.ts.map +1 -0
- package/dist/utils.cjs +33 -17
- package/dist/utils.d.ts +39 -6
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/vector/embed.d.ts +1 -1
- package/dist/vector/embed.d.ts.map +1 -1
- package/dist/vector/index.cjs +80 -8
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.js +80 -1
- package/dist/vector/index.js.map +1 -1
- package/dist/vector/vector.d.ts +5 -2
- package/dist/vector/vector.d.ts.map +1 -1
- package/dist/voice/composite-voice.d.ts +1 -7
- package/dist/voice/composite-voice.d.ts.map +1 -1
- package/dist/voice/index.cjs +4 -4
- package/dist/voice/index.js +1 -1
- package/dist/voice/voice.d.ts +0 -1
- package/dist/voice/voice.d.ts.map +1 -1
- package/dist/workflows/default.d.ts +35 -43
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/execution-engine.d.ts +5 -3
- 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 +15 -13
- package/dist/workflows/evented/step-executor.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts +5 -5
- package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts +3 -3
- 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/sleep.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/utils.d.ts +2 -7
- package/dist/workflows/evented/workflow-event-processor/utils.d.ts.map +1 -1
- package/dist/workflows/evented/workflow.d.ts +11 -14
- package/dist/workflows/evented/workflow.d.ts.map +1 -1
- package/dist/workflows/execution-engine.d.ts +6 -6
- package/dist/workflows/execution-engine.d.ts.map +1 -1
- package/dist/workflows/index.cjs +22 -14
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/step.d.ts +5 -5
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +20 -44
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/utils.d.ts +14 -0
- package/dist/workflows/utils.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +74 -64
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/evals/scoreTraces.d.ts +1 -0
- package/evals.d.ts +1 -0
- package/features.d.ts +1 -0
- package/observability.d.ts +1 -0
- package/package.json +48 -64
- package/request-context.d.ts +1 -0
- package/src/_types/ai-sdk.types.d.ts +4705 -0
- package/src/llm/model/provider-types.generated.d.ts +32 -7
- package/agent/input-processor/processors.d.ts +0 -1
- package/ai-tracing.d.ts +0 -1
- package/dist/agent/index.warning.d.ts +0 -13
- package/dist/agent/index.warning.d.ts.map +0 -1
- package/dist/agent/input-processor/index.cjs +0 -28
- package/dist/agent/input-processor/index.d.ts +0 -10
- package/dist/agent/input-processor/index.d.ts.map +0 -1
- package/dist/agent/input-processor/index.js +0 -3
- package/dist/agent/input-processor/processors/index.d.ts +0 -6
- package/dist/agent/input-processor/processors/index.d.ts.map +0 -1
- package/dist/agent/input-processor/processors/language-detector.d.ts +0 -18
- package/dist/agent/input-processor/processors/language-detector.d.ts.map +0 -1
- package/dist/agent/input-processor/processors/moderation.d.ts +0 -18
- package/dist/agent/input-processor/processors/moderation.d.ts.map +0 -1
- package/dist/agent/input-processor/processors/pii-detector.d.ts +0 -18
- package/dist/agent/input-processor/processors/pii-detector.d.ts.map +0 -1
- package/dist/agent/input-processor/processors/prompt-injection-detector.d.ts +0 -18
- package/dist/agent/input-processor/processors/prompt-injection-detector.d.ts.map +0 -1
- package/dist/agent/input-processor/processors/unicode-normalizer.d.ts +0 -18
- package/dist/agent/input-processor/processors/unicode-normalizer.d.ts.map +0 -1
- package/dist/ai-tracing/context.d.ts.map +0 -1
- package/dist/ai-tracing/exporters/base.d.ts +0 -111
- package/dist/ai-tracing/exporters/base.d.ts.map +0 -1
- package/dist/ai-tracing/exporters/cloud.d.ts +0 -30
- package/dist/ai-tracing/exporters/cloud.d.ts.map +0 -1
- package/dist/ai-tracing/exporters/console.d.ts +0 -10
- package/dist/ai-tracing/exporters/console.d.ts.map +0 -1
- package/dist/ai-tracing/exporters/default.d.ts +0 -98
- package/dist/ai-tracing/exporters/default.d.ts.map +0 -1
- package/dist/ai-tracing/exporters/index.d.ts +0 -9
- package/dist/ai-tracing/exporters/index.d.ts.map +0 -1
- package/dist/ai-tracing/index.cjs +0 -148
- package/dist/ai-tracing/index.d.ts +0 -13
- package/dist/ai-tracing/index.d.ts.map +0 -1
- package/dist/ai-tracing/index.js +0 -3
- package/dist/ai-tracing/model-tracing.d.ts +0 -63
- package/dist/ai-tracing/model-tracing.d.ts.map +0 -1
- package/dist/ai-tracing/registry.d.ts +0 -51
- package/dist/ai-tracing/registry.d.ts.map +0 -1
- package/dist/ai-tracing/span_processors/index.d.ts +0 -5
- package/dist/ai-tracing/span_processors/index.d.ts.map +0 -1
- package/dist/ai-tracing/span_processors/sensitive-data-filter.d.ts +0 -85
- package/dist/ai-tracing/span_processors/sensitive-data-filter.d.ts.map +0 -1
- package/dist/ai-tracing/spans/base.d.ts +0 -65
- package/dist/ai-tracing/spans/base.d.ts.map +0 -1
- package/dist/ai-tracing/spans/default.d.ts +0 -13
- package/dist/ai-tracing/spans/default.d.ts.map +0 -1
- package/dist/ai-tracing/spans/index.d.ts +0 -7
- package/dist/ai-tracing/spans/index.d.ts.map +0 -1
- package/dist/ai-tracing/spans/no-op.d.ts +0 -15
- package/dist/ai-tracing/spans/no-op.d.ts.map +0 -1
- package/dist/ai-tracing/tracers/base.d.ts +0 -105
- package/dist/ai-tracing/tracers/base.d.ts.map +0 -1
- package/dist/ai-tracing/tracers/default.d.ts +0 -7
- package/dist/ai-tracing/tracers/default.d.ts.map +0 -1
- package/dist/ai-tracing/tracers/index.d.ts +0 -6
- package/dist/ai-tracing/tracers/index.d.ts.map +0 -1
- package/dist/ai-tracing/types.d.ts.map +0 -1
- package/dist/ai-tracing/utils.d.ts +0 -68
- package/dist/ai-tracing/utils.d.ts.map +0 -1
- package/dist/base.warning.d.ts +0 -9
- package/dist/base.warning.d.ts.map +0 -1
- package/dist/bundler/index.warning.d.ts +0 -9
- package/dist/bundler/index.warning.d.ts.map +0 -1
- package/dist/chunk-253FBVD4.cjs +0 -1303
- package/dist/chunk-253FBVD4.cjs.map +0 -1
- package/dist/chunk-2B3VLGTH.js +0 -87
- package/dist/chunk-2B3VLGTH.js.map +0 -1
- package/dist/chunk-34ZCWSUA.js.map +0 -1
- package/dist/chunk-3HXBPDKN.js +0 -105
- package/dist/chunk-3JX2Y3WH.cjs.map +0 -1
- package/dist/chunk-3VXXCPKX.js.map +0 -1
- package/dist/chunk-4R2TBRS7.cjs +0 -191
- package/dist/chunk-4R2TBRS7.cjs.map +0 -1
- package/dist/chunk-5NTO7S5I.cjs.map +0 -1
- package/dist/chunk-6C7VGVK4.js +0 -267
- package/dist/chunk-6C7VGVK4.js.map +0 -1
- package/dist/chunk-6KOL2B3A.cjs +0 -75
- package/dist/chunk-6KOL2B3A.cjs.map +0 -1
- package/dist/chunk-6TEQIYXV.cjs.map +0 -1
- package/dist/chunk-6VOPKVYH.cjs +0 -57
- package/dist/chunk-6VOPKVYH.cjs.map +0 -1
- package/dist/chunk-77JHIM4E.cjs.map +0 -1
- package/dist/chunk-7J3XX4AO.cjs.map +0 -1
- package/dist/chunk-A5KDVZDL.cjs.map +0 -1
- package/dist/chunk-ABZOBBLL.cjs.map +0 -1
- package/dist/chunk-AQGLVU53.cjs +0 -603
- package/dist/chunk-AQGLVU53.cjs.map +0 -1
- package/dist/chunk-BLUDYAPI.js +0 -596
- package/dist/chunk-BLUDYAPI.js.map +0 -1
- package/dist/chunk-BWGXM3D4.js.map +0 -1
- package/dist/chunk-C7OVZMPW.cjs +0 -91
- package/dist/chunk-C7OVZMPW.cjs.map +0 -1
- package/dist/chunk-DMBN72QF.cjs +0 -39
- package/dist/chunk-DMBN72QF.cjs.map +0 -1
- package/dist/chunk-DTTOVV72.js +0 -2880
- package/dist/chunk-DTTOVV72.js.map +0 -1
- package/dist/chunk-E3PG7G6E.js.map +0 -1
- package/dist/chunk-EBVYYC2Q.cjs +0 -111
- package/dist/chunk-FHVFGVIO.js.map +0 -1
- package/dist/chunk-GB5BIA4V.js +0 -167
- package/dist/chunk-GB5BIA4V.js.map +0 -1
- package/dist/chunk-HEQTUMUA.cjs +0 -271
- package/dist/chunk-HEQTUMUA.cjs.map +0 -1
- package/dist/chunk-HF3GZRFP.cjs +0 -9
- package/dist/chunk-HF3GZRFP.cjs.map +0 -1
- package/dist/chunk-JVV5LREI.js +0 -431
- package/dist/chunk-JVV5LREI.js.map +0 -1
- package/dist/chunk-KAEQISOW.js.map +0 -1
- package/dist/chunk-KDX3ZMQ2.js +0 -12
- package/dist/chunk-KDX3ZMQ2.js.map +0 -1
- package/dist/chunk-LG5B3KIW.js +0 -1215
- package/dist/chunk-LG5B3KIW.js.map +0 -1
- package/dist/chunk-LZUSZT7R.cjs +0 -170
- package/dist/chunk-LZUSZT7R.cjs.map +0 -1
- package/dist/chunk-MCASUJWY.cjs.map +0 -1
- package/dist/chunk-MJMID7LX.cjs.map +0 -1
- package/dist/chunk-MKCC5K77.js +0 -90
- package/dist/chunk-MKCC5K77.js.map +0 -1
- package/dist/chunk-NPNGPMT2.js +0 -39
- package/dist/chunk-NPNGPMT2.js.map +0 -1
- package/dist/chunk-NR77P3TK.js.map +0 -1
- package/dist/chunk-NUAURT4I.cjs +0 -82
- package/dist/chunk-NUAURT4I.cjs.map +0 -1
- package/dist/chunk-OIT3PCWA.js +0 -72
- package/dist/chunk-OIT3PCWA.js.map +0 -1
- package/dist/chunk-P35FNLTQ.cjs +0 -2936
- package/dist/chunk-P35FNLTQ.cjs.map +0 -1
- package/dist/chunk-PFXXH2RP.js.map +0 -1
- package/dist/chunk-PZUZNPFM.js.map +0 -1
- package/dist/chunk-QFF5JUKT.cjs.map +0 -1
- package/dist/chunk-RKXWLG33.js +0 -7
- package/dist/chunk-RKXWLG33.js.map +0 -1
- package/dist/chunk-ROS5CMJS.cjs.map +0 -1
- package/dist/chunk-SJMKDSRF.js +0 -179
- package/dist/chunk-SJMKDSRF.js.map +0 -1
- package/dist/chunk-SSULK22X.cjs +0 -14
- package/dist/chunk-SSULK22X.cjs.map +0 -1
- package/dist/chunk-TSNDVBUU.cjs.map +0 -1
- package/dist/chunk-TTELJD4F.js.map +0 -1
- package/dist/chunk-TX4TTPYJ.cjs +0 -436
- package/dist/chunk-TX4TTPYJ.cjs.map +0 -1
- package/dist/chunk-UXG7PYML.js.map +0 -1
- package/dist/chunk-UZKIGB7M.cjs.map +0 -1
- package/dist/chunk-VF676YCO.cjs +0 -150
- package/dist/chunk-VF676YCO.cjs.map +0 -1
- package/dist/chunk-VQASQG5D.js +0 -55
- package/dist/chunk-VQASQG5D.js.map +0 -1
- package/dist/chunk-WBAXXG34.cjs.map +0 -1
- package/dist/chunk-WCHE6FJ7.js.map +0 -1
- package/dist/chunk-WM4RO23J.js +0 -145
- package/dist/chunk-WM4RO23J.js.map +0 -1
- package/dist/chunk-Z4RIRDU3.js.map +0 -1
- package/dist/chunk-ZABG3SZ2.cjs +0 -93
- package/dist/chunk-ZABG3SZ2.cjs.map +0 -1
- package/dist/chunk-ZISECZZO.js +0 -72
- package/dist/chunk-ZISECZZO.js.map +0 -1
- package/dist/chunk-ZMELUU72.js.map +0 -1
- package/dist/deployer/index.warning.d.ts +0 -9
- package/dist/deployer/index.warning.d.ts.map +0 -1
- package/dist/eval/evaluation.d.ts +0 -14
- package/dist/eval/evaluation.d.ts.map +0 -1
- package/dist/eval/index.cjs +0 -16
- package/dist/eval/index.d.ts +0 -4
- package/dist/eval/index.d.ts.map +0 -1
- package/dist/eval/index.js +0 -3
- package/dist/eval/metric.d.ts +0 -8
- package/dist/eval/metric.d.ts.map +0 -1
- package/dist/eval/types.d.ts +0 -9
- package/dist/eval/types.d.ts.map +0 -1
- package/dist/integration/index.warning.d.ts +0 -3
- package/dist/integration/index.warning.d.ts.map +0 -1
- package/dist/integration/integration.warning.d.ts +0 -5
- package/dist/integration/integration.warning.d.ts.map +0 -1
- package/dist/integration/openapi-toolset.warning.d.ts +0 -5
- package/dist/integration/openapi-toolset.warning.d.ts.map +0 -1
- package/dist/loop/telemetry/index.d.ts +0 -36
- package/dist/loop/telemetry/index.d.ts.map +0 -1
- package/dist/loop/telemetry/noop.d.ts +0 -3
- package/dist/loop/telemetry/noop.d.ts.map +0 -1
- package/dist/loop/test-utils/mockTracer.d.ts +0 -47
- package/dist/loop/test-utils/mockTracer.d.ts.map +0 -1
- package/dist/loop/test-utils/telemetry.d.ts +0 -6
- package/dist/loop/test-utils/telemetry.d.ts.map +0 -1
- package/dist/memory/index.warning.d.ts +0 -6
- package/dist/memory/index.warning.d.ts.map +0 -1
- package/dist/models-dev-4VGIWYS3.js +0 -3
- package/dist/models-dev-AXZASLL2.cjs +0 -12
- package/dist/netlify-TX6V7SJJ.cjs +0 -12
- package/dist/netlify-VJXBII33.js +0 -3
- package/dist/relevance/cohere/index.d.ts +0 -9
- package/dist/relevance/cohere/index.d.ts.map +0 -1
- package/dist/runtime-context/index.cjs +0 -12
- package/dist/runtime-context/index.js +0 -3
- package/dist/scores/base.d.ts.map +0 -1
- package/dist/scores/base.test-utils.d.ts.map +0 -1
- package/dist/scores/hooks.d.ts.map +0 -1
- package/dist/scores/index.cjs +0 -37
- package/dist/scores/index.cjs.map +0 -1
- package/dist/scores/index.d.ts +0 -4
- package/dist/scores/index.d.ts.map +0 -1
- package/dist/scores/index.js +0 -4
- package/dist/scores/index.js.map +0 -1
- package/dist/scores/run-experiment/index.d.ts.map +0 -1
- package/dist/scores/run-experiment/scorerAccumulator.d.ts.map +0 -1
- package/dist/scores/scoreTraces/index.cjs.map +0 -1
- package/dist/scores/scoreTraces/index.d.ts.map +0 -1
- package/dist/scores/scoreTraces/index.js.map +0 -1
- package/dist/scores/scoreTraces/scoreTraces.d.ts.map +0 -1
- package/dist/scores/scoreTraces/scoreTracesWorkflow.d.ts.map +0 -1
- package/dist/scores/scoreTraces/utils.d.ts.map +0 -1
- package/dist/scores/types.d.ts.map +0 -1
- package/dist/storage/base.warning.d.ts +0 -8
- package/dist/storage/base.warning.d.ts.map +0 -1
- package/dist/storage/domains/legacy-evals/base.d.ts +0 -13
- package/dist/storage/domains/legacy-evals/base.d.ts.map +0 -1
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -2
- package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
- package/dist/storage/domains/legacy-evals/inmemory.d.ts +0 -17
- package/dist/storage/domains/legacy-evals/inmemory.d.ts.map +0 -1
- package/dist/storage/domains/traces/base.d.ts +0 -14
- package/dist/storage/domains/traces/base.d.ts.map +0 -1
- package/dist/storage/domains/traces/index.d.ts +0 -3
- package/dist/storage/domains/traces/index.d.ts.map +0 -1
- package/dist/storage/domains/traces/inmemory.d.ts +0 -22
- package/dist/storage/domains/traces/inmemory.d.ts.map +0 -1
- package/dist/storage/index.warning.d.ts +0 -3
- package/dist/storage/index.warning.d.ts.map +0 -1
- package/dist/telemetry/composite-exporter.d.ts +0 -10
- package/dist/telemetry/composite-exporter.d.ts.map +0 -1
- package/dist/telemetry/index.cjs +0 -32
- package/dist/telemetry/index.cjs.map +0 -1
- package/dist/telemetry/index.d.ts +0 -6
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/index.js +0 -3
- package/dist/telemetry/index.js.map +0 -1
- package/dist/telemetry/otel-vendor.cjs +0 -105
- package/dist/telemetry/otel-vendor.cjs.map +0 -1
- package/dist/telemetry/otel-vendor.d.ts +0 -11
- package/dist/telemetry/otel-vendor.d.ts.map +0 -1
- package/dist/telemetry/otel-vendor.js +0 -59
- package/dist/telemetry/otel-vendor.js.map +0 -1
- package/dist/telemetry/storage-exporter.d.ts +0 -21
- package/dist/telemetry/storage-exporter.d.ts.map +0 -1
- package/dist/telemetry/telemetry.d.ts +0 -59
- package/dist/telemetry/telemetry.d.ts.map +0 -1
- package/dist/telemetry/telemetry.decorators.d.ts +0 -15
- package/dist/telemetry/telemetry.decorators.d.ts.map +0 -1
- package/dist/telemetry/types.d.ts +0 -74
- package/dist/telemetry/types.d.ts.map +0 -1
- package/dist/telemetry/utility.d.ts +0 -15
- package/dist/telemetry/utility.d.ts.map +0 -1
- package/dist/tools/index.warning.d.ts +0 -8
- package/dist/tools/index.warning.d.ts.map +0 -1
- package/dist/tts/index.warning.d.ts +0 -7
- package/dist/tts/index.warning.d.ts.map +0 -1
- package/dist/vector/index.warning.d.ts +0 -6
- package/dist/vector/index.warning.d.ts.map +0 -1
- package/dist/workflows/index.warning.d.ts +0 -6
- package/dist/workflows/index.warning.d.ts.map +0 -1
- package/dist/workflows/legacy/index.cjs +0 -92
- package/dist/workflows/legacy/index.cjs.map +0 -1
- package/dist/workflows/legacy/index.d.ts +0 -5
- package/dist/workflows/legacy/index.d.ts.map +0 -1
- package/dist/workflows/legacy/index.js +0 -3
- package/dist/workflows/legacy/index.js.map +0 -1
- package/dist/workflows/legacy/machine.d.ts +0 -386
- package/dist/workflows/legacy/machine.d.ts.map +0 -1
- package/dist/workflows/legacy/step.d.ts +0 -15
- package/dist/workflows/legacy/step.d.ts.map +0 -1
- package/dist/workflows/legacy/types.d.ts +0 -397
- package/dist/workflows/legacy/types.d.ts.map +0 -1
- package/dist/workflows/legacy/utils.d.ts +0 -68
- package/dist/workflows/legacy/utils.d.ts.map +0 -1
- package/dist/workflows/legacy/workflow-instance.d.ts +0 -97
- package/dist/workflows/legacy/workflow-instance.d.ts.map +0 -1
- package/dist/workflows/legacy/workflow.d.ts +0 -109
- package/dist/workflows/legacy/workflow.d.ts.map +0 -1
- package/dist/workflows/workflow.warning.d.ts +0 -9
- package/dist/workflows/workflow.warning.d.ts.map +0 -1
- package/eval.d.ts +0 -1
- package/runtime-context.d.ts +0 -1
- package/scores/scoreTraces.d.ts +0 -1
- package/scores.d.ts +0 -1
- package/telemetry/otel-vendor.d.ts +0 -1
- package/telemetry.d.ts +0 -1
- package/workflows/legacy.d.ts +0 -1
- /package/dist/agent/{input-processor → message-list}/index.cjs.map +0 -0
- /package/dist/agent/{input-processor → message-list}/index.js.map +0 -0
- /package/dist/{ai-tracing → evals}/index.cjs.map +0 -0
- /package/dist/{ai-tracing → evals}/index.js.map +0 -0
- /package/dist/{scores/run-experiment → evals/run}/scorerAccumulator.d.ts +0 -0
- /package/dist/{scores → evals}/scoreTraces/index.d.ts +0 -0
- /package/dist/{eval → observability}/index.cjs.map +0 -0
- /package/dist/{eval → observability}/index.js.map +0 -0
- /package/dist/{runtime-context → request-context}/index.cjs.map +0 -0
- /package/dist/{runtime-context → request-context}/index.js.map +0 -0
package/dist/mastra/index.d.ts
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import type { Agent } from '../agent/index.js';
|
|
2
|
-
import type { ObservabilityRegistryConfig } from '../ai-tracing/index.js';
|
|
3
2
|
import type { BundlerConfig } from '../bundler/types.js';
|
|
4
3
|
import type { MastraServerCache } from '../cache/index.js';
|
|
5
4
|
import type { MastraDeployer } from '../deployer/index.js';
|
|
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
8
|
import { LogLevel } from '../logger/index.js';
|
|
9
9
|
import type { IMastraLogger } from '../logger/index.js';
|
|
10
10
|
import type { MCPServerBase } from '../mcp/index.js';
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
11
|
+
import type { ObservabilityEntrypoint } from '../observability/index.js';
|
|
12
|
+
import type { Processor } from '../processors/index.js';
|
|
13
13
|
import type { Middleware, ServerConfig } from '../server/types.js';
|
|
14
14
|
import type { MastraStorage } from '../storage/index.js';
|
|
15
|
-
import {
|
|
16
|
-
import type { OtelConfig } from '../telemetry/index.js';
|
|
15
|
+
import type { ToolAction } from '../tools/index.js';
|
|
17
16
|
import type { MastraTTS } from '../tts/index.js';
|
|
18
17
|
import type { MastraIdGenerator } from '../types/index.js';
|
|
19
18
|
import type { MastraVector } from '../vector/index.js';
|
|
20
19
|
import type { Workflow } from '../workflows/index.js';
|
|
21
|
-
import type { LegacyWorkflow } from '../workflows/legacy/index.js';
|
|
22
20
|
/**
|
|
23
21
|
* Configuration interface for initializing a Mastra instance.
|
|
24
22
|
*
|
|
@@ -26,7 +24,6 @@ import type { LegacyWorkflow } from '../workflows/legacy/index.js';
|
|
|
26
24
|
* with a Mastra instance, including agents, workflows, storage, logging, and more.
|
|
27
25
|
*
|
|
28
26
|
* @template TAgents - Record of agent instances keyed by their names
|
|
29
|
-
* @template TLegacyWorkflows - Record of legacy workflow instances
|
|
30
27
|
* @template TWorkflows - Record of workflow instances
|
|
31
28
|
* @template TVectors - Record of vector store instances
|
|
32
29
|
* @template TTTS - Record of text-to-speech instances
|
|
@@ -40,17 +37,18 @@ import type { LegacyWorkflow } from '../workflows/legacy/index.js';
|
|
|
40
37
|
* const mastra = new Mastra({
|
|
41
38
|
* agents: {
|
|
42
39
|
* weatherAgent: new Agent({
|
|
43
|
-
*
|
|
40
|
+
* id: 'weather-agent',
|
|
41
|
+
* name: 'Weather Agent',
|
|
44
42
|
* instructions: 'You help with weather information',
|
|
45
43
|
* model: 'openai/gpt-5'
|
|
46
44
|
* })
|
|
47
45
|
* },
|
|
48
|
-
* storage: new LibSQLStore({ url: ':memory:' }),
|
|
46
|
+
* storage: new LibSQLStore({ id: 'mastra-storage', url: ':memory:' }),
|
|
49
47
|
* logger: new PinoLogger({ name: 'MyApp' })
|
|
50
48
|
* });
|
|
51
49
|
* ```
|
|
52
50
|
*/
|
|
53
|
-
export interface Config<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>,
|
|
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> = Record<string, MastraVector>, TTTS extends Record<string, MastraTTS> = Record<string, MastraTTS>, TLogger extends IMastraLogger = IMastraLogger, TMCPServers extends Record<string, MCPServerBase> = Record<string, MCPServerBase>, 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>> = Record<string, ToolAction<any, any, any, any>>, TProcessors extends Record<string, Processor> = Record<string, Processor>> {
|
|
54
52
|
/**
|
|
55
53
|
* Agents are autonomous systems that can make decisions and take actions.
|
|
56
54
|
*/
|
|
@@ -71,11 +69,6 @@ export interface Config<TAgents extends Record<string, Agent<any>> = Record<stri
|
|
|
71
69
|
* @default `INFO` level in development, `WARN` in production.
|
|
72
70
|
*/
|
|
73
71
|
logger?: TLogger | false;
|
|
74
|
-
/**
|
|
75
|
-
* Legacy workflow definitions for backward compatibility.
|
|
76
|
-
* @deprecated Use `workflows` instead.
|
|
77
|
-
*/
|
|
78
|
-
legacy_workflows?: TLegacyWorkflows;
|
|
79
72
|
/**
|
|
80
73
|
* Workflows provide type-safe, composable task execution with built-in error handling.
|
|
81
74
|
*/
|
|
@@ -85,15 +78,21 @@ export interface Config<TAgents extends Record<string, Agent<any>> = Record<stri
|
|
|
85
78
|
*/
|
|
86
79
|
tts?: TTTS;
|
|
87
80
|
/**
|
|
88
|
-
*
|
|
81
|
+
* Observability entrypoint for tracking model interactions and tracing.
|
|
82
|
+
* Pass an instance of the Observability class from @mastra/observability.
|
|
89
83
|
*
|
|
90
|
-
* @
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* import { Observability } from '@mastra/observability';
|
|
87
|
+
*
|
|
88
|
+
* new Mastra({
|
|
89
|
+
* observability: new Observability({
|
|
90
|
+
* default: { enabled: true }
|
|
91
|
+
* })
|
|
92
|
+
* })
|
|
93
|
+
* ```
|
|
95
94
|
*/
|
|
96
|
-
observability?:
|
|
95
|
+
observability?: ObservabilityEntrypoint;
|
|
97
96
|
/**
|
|
98
97
|
* Custom ID generator function for creating unique identifiers.
|
|
99
98
|
* @default `crypto.randomUUID()`
|
|
@@ -125,15 +124,13 @@ export interface Config<TAgents extends Record<string, Agent<any>> = Record<stri
|
|
|
125
124
|
*/
|
|
126
125
|
scorers?: TScorers;
|
|
127
126
|
/**
|
|
128
|
-
*
|
|
129
|
-
* Each middleware can specify a path pattern (defaults to '/api/*')
|
|
130
|
-
* @deprecated use server.middleware instead
|
|
127
|
+
* Tools are reusable functions that agents can use to interact with external systems.
|
|
131
128
|
*/
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
tools?: TTools;
|
|
130
|
+
/**
|
|
131
|
+
* Processors transform inputs and outputs for agents and workflows.
|
|
132
|
+
*/
|
|
133
|
+
processors?: TProcessors;
|
|
137
134
|
/**
|
|
138
135
|
* Event handlers for custom application events.
|
|
139
136
|
* Maps event topics to handler functions for event-driven architectures.
|
|
@@ -142,20 +139,41 @@ export interface Config<TAgents extends Record<string, Agent<any>> = Record<stri
|
|
|
142
139
|
[topic: string]: (event: Event, cb?: () => Promise<void>) => Promise<void> | ((event: Event, cb?: () => Promise<void>) => Promise<void>)[];
|
|
143
140
|
};
|
|
144
141
|
}
|
|
145
|
-
|
|
142
|
+
/**
|
|
143
|
+
* The central orchestrator for Mastra applications, managing agents, workflows, storage, logging, observability, and more.
|
|
144
|
+
*
|
|
145
|
+
* The `Mastra` class serves as the main entry point and registry for all components in a Mastra application.
|
|
146
|
+
* It coordinates the interaction between agents, workflows, storage systems, and other services.
|
|
147
|
+
|
|
148
|
+
* @template TAgents - Record of agent instances keyed by their names
|
|
149
|
+
* @template TWorkflows - Record of modern workflow instances
|
|
150
|
+
* @template TVectors - Record of vector store instances for semantic search and RAG
|
|
151
|
+
* @template TTTS - Record of text-to-speech provider instances
|
|
152
|
+
* @template TLogger - Logger implementation type for application logging
|
|
153
|
+
* @template TVNextNetworks - Record of next-generation agent network instances
|
|
154
|
+
* @template TMCPServers - Record of Model Context Protocol server instances
|
|
155
|
+
* @template TScorers - Record of evaluation scorer instances for measuring AI performance
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const mastra = new Mastra({
|
|
160
|
+
* agents: {
|
|
161
|
+
* weatherAgent: new Agent({
|
|
162
|
+
* id: 'weather-agent',
|
|
163
|
+
* name: 'Weather Agent',
|
|
164
|
+
* instructions: 'You provide weather information',
|
|
165
|
+
* model: 'openai/gpt-5',
|
|
166
|
+
* tools: [getWeatherTool]
|
|
167
|
+
* })
|
|
168
|
+
* },
|
|
169
|
+
* workflows: { dataWorkflow },
|
|
170
|
+
* storage: new LibSQLStore({ id: 'mastra-storage', url: ':memory:' }),
|
|
171
|
+
* logger: new PinoLogger({ name: 'MyApp' })
|
|
172
|
+
* });
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
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> = Record<string, MastraVector>, TTTS extends Record<string, MastraTTS> = Record<string, MastraTTS>, TLogger extends IMastraLogger = IMastraLogger, TMCPServers extends Record<string, MCPServerBase> = Record<string, MCPServerBase>, 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>> = Record<string, ToolAction<any, any, any, any>>, TProcessors extends Record<string, Processor> = Record<string, Processor>> {
|
|
146
176
|
#private;
|
|
147
|
-
/**
|
|
148
|
-
* @deprecated use {@link getAITracing()} instead
|
|
149
|
-
*/
|
|
150
|
-
get telemetry(): Telemetry | undefined;
|
|
151
|
-
/**
|
|
152
|
-
* @deprecated use getStorage() instead
|
|
153
|
-
*/
|
|
154
|
-
get storage(): MastraStorage | undefined;
|
|
155
|
-
/**
|
|
156
|
-
* @deprecated use getMemory() instead
|
|
157
|
-
*/
|
|
158
|
-
get memory(): MastraMemory | undefined;
|
|
159
177
|
get pubsub(): PubSub;
|
|
160
178
|
/**
|
|
161
179
|
* Gets the currently configured ID generator function.
|
|
@@ -206,14 +224,15 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
206
224
|
* Creates a new Mastra instance with the provided configuration.
|
|
207
225
|
*
|
|
208
226
|
* The constructor initializes all the components specified in the config, sets up
|
|
209
|
-
* internal systems like logging and
|
|
227
|
+
* internal systems like logging and observability, and registers components with each other.
|
|
210
228
|
*
|
|
211
229
|
* @example
|
|
212
230
|
* ```typescript
|
|
213
231
|
* const mastra = new Mastra({
|
|
214
232
|
* agents: {
|
|
215
233
|
* assistant: new Agent({
|
|
216
|
-
*
|
|
234
|
+
* id: 'assistant',
|
|
235
|
+
* name: 'Assistant',
|
|
217
236
|
* instructions: 'You are a helpful assistant',
|
|
218
237
|
* model: 'openai/gpt-5'
|
|
219
238
|
* })
|
|
@@ -221,19 +240,12 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
221
240
|
* storage: new PostgresStore({
|
|
222
241
|
* connectionString: process.env.DATABASE_URL
|
|
223
242
|
* }),
|
|
224
|
-
* logger: new PinoLogger({ name: 'MyApp' })
|
|
243
|
+
* logger: new PinoLogger({ name: 'MyApp' }),
|
|
244
|
+
* observability: { default: { enabled: true }},
|
|
225
245
|
* });
|
|
226
246
|
* ```
|
|
227
247
|
*/
|
|
228
|
-
constructor(config?: Config<TAgents,
|
|
229
|
-
/**
|
|
230
|
-
* Register this Mastra instance with AI tracing exporters that need it
|
|
231
|
-
*/
|
|
232
|
-
private registerAITracingExporters;
|
|
233
|
-
/**
|
|
234
|
-
* Initialize all AI tracing exporters after registration is complete
|
|
235
|
-
*/
|
|
236
|
-
private initAITracingExporters;
|
|
248
|
+
constructor(config?: Config<TAgents, TWorkflows, TVectors, TTTS, TLogger, TMCPServers, TScorers, TTools, TProcessors>);
|
|
237
249
|
/**
|
|
238
250
|
* Retrieves a registered agent by its name.
|
|
239
251
|
*
|
|
@@ -245,6 +257,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
245
257
|
* const mastra = new Mastra({
|
|
246
258
|
* agents: {
|
|
247
259
|
* weatherAgent: new Agent({
|
|
260
|
+
* id: 'weather-agent',
|
|
248
261
|
* name: 'weather-agent',
|
|
249
262
|
* instructions: 'You provide weather information',
|
|
250
263
|
* model: 'openai/gpt-5'
|
|
@@ -261,7 +274,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
261
274
|
*
|
|
262
275
|
* This method searches for an agent using its internal ID property. If no agent
|
|
263
276
|
* is found with the given ID, it also attempts to find an agent using the ID as
|
|
264
|
-
* a name
|
|
277
|
+
* a name.
|
|
265
278
|
*
|
|
266
279
|
* @throws {MastraError} When no agent is found with the specified ID
|
|
267
280
|
*
|
|
@@ -270,6 +283,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
270
283
|
* const mastra = new Mastra({
|
|
271
284
|
* agents: {
|
|
272
285
|
* assistant: new Agent({
|
|
286
|
+
* id: 'assistant',
|
|
273
287
|
* name: 'assistant',
|
|
274
288
|
* instructions: 'You are a helpful assistant',
|
|
275
289
|
* model: 'openai/gpt-5'
|
|
@@ -292,16 +306,38 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
292
306
|
* ```typescript
|
|
293
307
|
* const mastra = new Mastra({
|
|
294
308
|
* agents: {
|
|
295
|
-
* weatherAgent: new Agent({ name: 'weather', model: openai
|
|
296
|
-
* supportAgent: new Agent({ name: 'support', model: openai
|
|
309
|
+
* weatherAgent: new Agent({ id: 'weather-agent', name: 'weather', model: 'openai/gpt-4o' }),
|
|
310
|
+
* supportAgent: new Agent({ id: 'support-agent', name: 'support', model: 'openai/gpt-4o' })
|
|
297
311
|
* }
|
|
298
312
|
* });
|
|
299
313
|
*
|
|
300
|
-
* const allAgents = mastra.
|
|
314
|
+
* const allAgents = mastra.listAgents();
|
|
301
315
|
* console.log(Object.keys(allAgents)); // ['weatherAgent', 'supportAgent']
|
|
302
316
|
* ```
|
|
303
317
|
*/
|
|
304
|
-
|
|
318
|
+
listAgents(): TAgents;
|
|
319
|
+
/**
|
|
320
|
+
* Adds a new agent to the Mastra instance.
|
|
321
|
+
*
|
|
322
|
+
* This method allows dynamic registration of agents after the Mastra instance
|
|
323
|
+
* has been created. The agent will be initialized with the current logger.
|
|
324
|
+
*
|
|
325
|
+
* @throws {MastraError} When an agent with the same key already exists
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* ```typescript
|
|
329
|
+
* const mastra = new Mastra();
|
|
330
|
+
* const newAgent = new Agent({
|
|
331
|
+
* id: 'chat-agent',
|
|
332
|
+
* name: 'Chat Assistant',
|
|
333
|
+
* model: 'openai/gpt-4o'
|
|
334
|
+
* });
|
|
335
|
+
* mastra.addAgent(newAgent); // Uses agent.id as key
|
|
336
|
+
* // or
|
|
337
|
+
* mastra.addAgent(newAgent, 'customKey'); // Uses custom key
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
addAgent<A extends Agent<any>>(agent: A, key?: string): void;
|
|
305
341
|
/**
|
|
306
342
|
* Retrieves a registered vector store by its name.
|
|
307
343
|
*
|
|
@@ -341,6 +377,26 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
341
377
|
* ```
|
|
342
378
|
*/
|
|
343
379
|
getVector<TVectorName extends keyof TVectors>(name: TVectorName): TVectors[TVectorName];
|
|
380
|
+
/**
|
|
381
|
+
* Retrieves a specific vector store instance by its ID.
|
|
382
|
+
*
|
|
383
|
+
* This method searches for a vector store by its internal ID property.
|
|
384
|
+
* If not found by ID, it falls back to searching by registration key.
|
|
385
|
+
*
|
|
386
|
+
* @throws {MastraError} When the specified vector store is not found
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* ```typescript
|
|
390
|
+
* const mastra = new Mastra({
|
|
391
|
+
* vectors: {
|
|
392
|
+
* embeddings: chromaVector
|
|
393
|
+
* }
|
|
394
|
+
* });
|
|
395
|
+
*
|
|
396
|
+
* const vectorStore = mastra.getVectorById('chroma-123');
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
getVectorById(id: string): MastraVector;
|
|
344
400
|
/**
|
|
345
401
|
* Returns all registered vector stores as a record keyed by their names.
|
|
346
402
|
*
|
|
@@ -363,6 +419,28 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
363
419
|
* }
|
|
364
420
|
* ```
|
|
365
421
|
*/
|
|
422
|
+
listVectors(): TVectors | undefined;
|
|
423
|
+
/**
|
|
424
|
+
* Adds a new vector store to the Mastra instance.
|
|
425
|
+
*
|
|
426
|
+
* This method allows dynamic registration of vector stores after the Mastra instance
|
|
427
|
+
* has been created. The vector store will be initialized with the current logger.
|
|
428
|
+
*
|
|
429
|
+
* @throws {MastraError} When a vector store with the same key already exists
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```typescript
|
|
433
|
+
* const mastra = new Mastra();
|
|
434
|
+
* const newVector = new ChromaVector({ id: 'chroma-embeddings' });
|
|
435
|
+
* mastra.addVector(newVector); // Uses vector.id as key
|
|
436
|
+
* // or
|
|
437
|
+
* mastra.addVector(newVector, 'customKey'); // Uses custom key
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
addVector<V extends MastraVector>(vector: V, key?: string): void;
|
|
441
|
+
/**
|
|
442
|
+
* @deprecated Use listVectors() instead
|
|
443
|
+
*/
|
|
366
444
|
getVectors(): TVectors | undefined;
|
|
367
445
|
/**
|
|
368
446
|
* Gets the currently configured deployment provider.
|
|
@@ -386,32 +464,6 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
386
464
|
* ```
|
|
387
465
|
*/
|
|
388
466
|
getDeployer(): MastraDeployer | undefined;
|
|
389
|
-
/**
|
|
390
|
-
* Retrieves a registered legacy workflow by its ID.
|
|
391
|
-
*
|
|
392
|
-
* Legacy workflows are the previous generation of workflow system in Mastra,
|
|
393
|
-
* maintained for backward compatibility. For new implementations, use the
|
|
394
|
-
* modern workflow system accessed via `getWorkflow()`.
|
|
395
|
-
*
|
|
396
|
-
* @template TWorkflowId - The specific workflow ID type from the registered legacy workflows
|
|
397
|
-
* @throws {MastraError} When the legacy workflow with the specified ID is not found
|
|
398
|
-
* @deprecated Use `getWorkflow()` for new implementations
|
|
399
|
-
*
|
|
400
|
-
* @example Getting a legacy workflow
|
|
401
|
-
* ```typescript
|
|
402
|
-
* const mastra = new Mastra({
|
|
403
|
-
* legacy_workflows: {
|
|
404
|
-
* oldDataFlow: legacyWorkflowInstance
|
|
405
|
-
* }
|
|
406
|
-
* });
|
|
407
|
-
*
|
|
408
|
-
* const workflow = mastra.legacy_getWorkflow('oldDataFlow');
|
|
409
|
-
* const result = await workflow.execute({ input: 'data' });
|
|
410
|
-
* ```
|
|
411
|
-
*/
|
|
412
|
-
legacy_getWorkflow<TWorkflowId extends keyof TLegacyWorkflows>(id: TWorkflowId, { serialized }?: {
|
|
413
|
-
serialized?: boolean;
|
|
414
|
-
}): TLegacyWorkflows[TWorkflowId];
|
|
415
467
|
/**
|
|
416
468
|
* Retrieves a registered workflow by its ID.
|
|
417
469
|
*
|
|
@@ -450,7 +502,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
450
502
|
*
|
|
451
503
|
* This method searches for a workflow using its internal ID property. If no workflow
|
|
452
504
|
* is found with the given ID, it also attempts to find a workflow using the ID as
|
|
453
|
-
* a name
|
|
505
|
+
* a name.
|
|
454
506
|
*
|
|
455
507
|
* @throws {MastraError} When no workflow is found with the specified ID
|
|
456
508
|
*
|
|
@@ -475,35 +527,6 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
475
527
|
* ```
|
|
476
528
|
*/
|
|
477
529
|
getWorkflowById(id: string): Workflow;
|
|
478
|
-
/**
|
|
479
|
-
* Returns all registered legacy workflows as a record keyed by their IDs.
|
|
480
|
-
*
|
|
481
|
-
* Legacy workflows are the previous generation of workflow system in Mastra,
|
|
482
|
-
* maintained for backward compatibility. For new implementations, use `getWorkflows()`.
|
|
483
|
-
*
|
|
484
|
-
* @deprecated Use `getWorkflows()` for new implementations
|
|
485
|
-
*
|
|
486
|
-
* @example Listing all legacy workflows
|
|
487
|
-
* ```typescript
|
|
488
|
-
* const mastra = new Mastra({
|
|
489
|
-
* legacy_workflows: {
|
|
490
|
-
* oldFlow1: legacyWorkflow1,
|
|
491
|
-
* oldFlow2: legacyWorkflow2
|
|
492
|
-
* }
|
|
493
|
-
* });
|
|
494
|
-
*
|
|
495
|
-
* const allLegacyWorkflows = mastra.legacy_getWorkflows();
|
|
496
|
-
* console.log(Object.keys(allLegacyWorkflows)); // ['oldFlow1', 'oldFlow2']
|
|
497
|
-
*
|
|
498
|
-
* // Execute all legacy workflows
|
|
499
|
-
* for (const [id, workflow] of Object.entries(allLegacyWorkflows)) {
|
|
500
|
-
* console.log(`Legacy workflow ${id}:`, workflow.name);
|
|
501
|
-
* }
|
|
502
|
-
* ```
|
|
503
|
-
*/
|
|
504
|
-
legacy_getWorkflows(props?: {
|
|
505
|
-
serialized?: boolean;
|
|
506
|
-
}): Record<string, LegacyWorkflow>;
|
|
507
530
|
/**
|
|
508
531
|
* Returns all registered scorers as a record keyed by their IDs.
|
|
509
532
|
*
|
|
@@ -519,16 +542,37 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
519
542
|
* }
|
|
520
543
|
* });
|
|
521
544
|
*
|
|
522
|
-
* const allScorers = mastra.
|
|
545
|
+
* const allScorers = mastra.listScorers();
|
|
523
546
|
* console.log(Object.keys(allScorers)); // ['helpfulness', 'accuracy', 'relevance']
|
|
524
547
|
*
|
|
525
548
|
* // Check scorer configurations
|
|
526
549
|
* for (const [id, scorer] of Object.entries(allScorers)) {
|
|
527
|
-
* console.log(`Scorer ${id}:`, scorer.name, scorer.description);
|
|
550
|
+
* console.log(`Scorer ${id}:`, scorer.id, scorer.name, scorer.description);
|
|
528
551
|
* }
|
|
529
552
|
* ```
|
|
530
553
|
*/
|
|
531
|
-
|
|
554
|
+
listScorers(): TScorers | undefined;
|
|
555
|
+
/**
|
|
556
|
+
* Adds a new scorer to the Mastra instance.
|
|
557
|
+
*
|
|
558
|
+
* This method allows dynamic registration of scorers after the Mastra instance
|
|
559
|
+
* has been created.
|
|
560
|
+
*
|
|
561
|
+
* @throws {MastraError} When a scorer with the same key already exists
|
|
562
|
+
*
|
|
563
|
+
* @example
|
|
564
|
+
* ```typescript
|
|
565
|
+
* const mastra = new Mastra();
|
|
566
|
+
* const newScorer = new MastraScorer({
|
|
567
|
+
* id: 'quality-scorer',
|
|
568
|
+
* name: 'Quality Scorer'
|
|
569
|
+
* });
|
|
570
|
+
* mastra.addScorer(newScorer); // Uses scorer.id as key
|
|
571
|
+
* // or
|
|
572
|
+
* mastra.addScorer(newScorer, 'customKey'); // Uses custom key
|
|
573
|
+
* ```
|
|
574
|
+
*/
|
|
575
|
+
addScorer<S extends MastraScorer<any, any, any, any>>(scorer: S, key?: string): void;
|
|
532
576
|
/**
|
|
533
577
|
* Retrieves a registered scorer by its key.
|
|
534
578
|
*
|
|
@@ -542,7 +586,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
542
586
|
* const mastra = new Mastra({
|
|
543
587
|
* scorers: {
|
|
544
588
|
* helpfulness: new HelpfulnessScorer({
|
|
545
|
-
* model: openai
|
|
589
|
+
* model: 'openai/gpt-4o',
|
|
546
590
|
* criteria: 'Rate how helpful this response is'
|
|
547
591
|
* }),
|
|
548
592
|
* accuracy: new AccuracyScorer({
|
|
@@ -586,14 +630,164 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
586
630
|
* });
|
|
587
631
|
*
|
|
588
632
|
* // Find scorer by its internal name, not the registration key
|
|
589
|
-
* const scorer = mastra.
|
|
633
|
+
* const scorer = mastra.getScorerById('helpfulness-evaluator');
|
|
590
634
|
* const score = await scorer.score({
|
|
591
635
|
* input: 'question',
|
|
592
636
|
* output: 'answer'
|
|
593
637
|
* });
|
|
594
638
|
* ```
|
|
595
639
|
*/
|
|
596
|
-
|
|
640
|
+
getScorerById(id: string): MastraScorer<any, any, any, any>;
|
|
641
|
+
/**
|
|
642
|
+
* Retrieves a specific tool by registration key.
|
|
643
|
+
*
|
|
644
|
+
* @throws {MastraError} When the specified tool is not found
|
|
645
|
+
*
|
|
646
|
+
* @example
|
|
647
|
+
* ```typescript
|
|
648
|
+
* const mastra = new Mastra({
|
|
649
|
+
* tools: {
|
|
650
|
+
* calculator: calculatorTool,
|
|
651
|
+
* weather: weatherTool
|
|
652
|
+
* }
|
|
653
|
+
* });
|
|
654
|
+
*
|
|
655
|
+
* const tool = mastra.getTool('calculator');
|
|
656
|
+
* ```
|
|
657
|
+
*/
|
|
658
|
+
getTool<TToolName extends keyof TTools>(name: TToolName): TTools[TToolName];
|
|
659
|
+
/**
|
|
660
|
+
* Retrieves a specific tool by its ID.
|
|
661
|
+
*
|
|
662
|
+
* @throws {MastraError} When the specified tool is not found
|
|
663
|
+
*
|
|
664
|
+
* @example
|
|
665
|
+
* ```typescript
|
|
666
|
+
* const mastra = new Mastra({
|
|
667
|
+
* tools: {
|
|
668
|
+
* calculator: calculatorTool
|
|
669
|
+
* }
|
|
670
|
+
* });
|
|
671
|
+
*
|
|
672
|
+
* const tool = mastra.getToolById('calculator-tool-id');
|
|
673
|
+
* ```
|
|
674
|
+
*/
|
|
675
|
+
getToolById(id: string): ToolAction<any, any, any, any>;
|
|
676
|
+
/**
|
|
677
|
+
* Lists all configured tools.
|
|
678
|
+
*
|
|
679
|
+
* @example
|
|
680
|
+
* ```typescript
|
|
681
|
+
* const mastra = new Mastra({
|
|
682
|
+
* tools: {
|
|
683
|
+
* calculator: calculatorTool,
|
|
684
|
+
* weather: weatherTool
|
|
685
|
+
* }
|
|
686
|
+
* });
|
|
687
|
+
*
|
|
688
|
+
* const tools = mastra.listTools();
|
|
689
|
+
* Object.entries(tools || {}).forEach(([name, tool]) => {
|
|
690
|
+
* console.log(`Tool "${name}":`, tool.id);
|
|
691
|
+
* });
|
|
692
|
+
* ```
|
|
693
|
+
*/
|
|
694
|
+
listTools(): TTools | undefined;
|
|
695
|
+
/**
|
|
696
|
+
* Adds a new tool to the Mastra instance.
|
|
697
|
+
*
|
|
698
|
+
* This method allows dynamic registration of tools after the Mastra instance
|
|
699
|
+
* has been created.
|
|
700
|
+
*
|
|
701
|
+
* @throws {MastraError} When a tool with the same key already exists
|
|
702
|
+
*
|
|
703
|
+
* @example
|
|
704
|
+
* ```typescript
|
|
705
|
+
* const mastra = new Mastra();
|
|
706
|
+
* const newTool = createTool({
|
|
707
|
+
* id: 'calculator-tool',
|
|
708
|
+
* description: 'Performs calculations'
|
|
709
|
+
* });
|
|
710
|
+
* mastra.addTool(newTool); // Uses tool.id as key
|
|
711
|
+
* // or
|
|
712
|
+
* mastra.addTool(newTool, 'customKey'); // Uses custom key
|
|
713
|
+
* ```
|
|
714
|
+
*/
|
|
715
|
+
addTool<T extends ToolAction<any, any, any, any>>(tool: T, key?: string): void;
|
|
716
|
+
/**
|
|
717
|
+
* Retrieves a specific processor by registration key.
|
|
718
|
+
*
|
|
719
|
+
* @throws {MastraError} When the specified processor is not found
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* ```typescript
|
|
723
|
+
* const mastra = new Mastra({
|
|
724
|
+
* processors: {
|
|
725
|
+
* validator: validatorProcessor,
|
|
726
|
+
* transformer: transformerProcessor
|
|
727
|
+
* }
|
|
728
|
+
* });
|
|
729
|
+
*
|
|
730
|
+
* const processor = mastra.getProcessor('validator');
|
|
731
|
+
* ```
|
|
732
|
+
*/
|
|
733
|
+
getProcessor<TProcessorName extends keyof TProcessors>(name: TProcessorName): TProcessors[TProcessorName];
|
|
734
|
+
/**
|
|
735
|
+
* Retrieves a specific processor by its ID.
|
|
736
|
+
*
|
|
737
|
+
* @throws {MastraError} When the specified processor is not found
|
|
738
|
+
*
|
|
739
|
+
* @example
|
|
740
|
+
* ```typescript
|
|
741
|
+
* const mastra = new Mastra({
|
|
742
|
+
* processors: {
|
|
743
|
+
* validator: validatorProcessor
|
|
744
|
+
* }
|
|
745
|
+
* });
|
|
746
|
+
*
|
|
747
|
+
* const processor = mastra.getProcessorById('validator-processor-id');
|
|
748
|
+
* ```
|
|
749
|
+
*/
|
|
750
|
+
getProcessorById(id: string): Processor;
|
|
751
|
+
/**
|
|
752
|
+
* Lists all configured processors.
|
|
753
|
+
*
|
|
754
|
+
* @example
|
|
755
|
+
* ```typescript
|
|
756
|
+
* const mastra = new Mastra({
|
|
757
|
+
* processors: {
|
|
758
|
+
* validator: validatorProcessor,
|
|
759
|
+
* transformer: transformerProcessor
|
|
760
|
+
* }
|
|
761
|
+
* });
|
|
762
|
+
*
|
|
763
|
+
* const processors = mastra.listProcessors();
|
|
764
|
+
* Object.entries(processors || {}).forEach(([name, processor]) => {
|
|
765
|
+
* console.log(`Processor "${name}":`, processor.id);
|
|
766
|
+
* });
|
|
767
|
+
* ```
|
|
768
|
+
*/
|
|
769
|
+
listProcessors(): TProcessors | undefined;
|
|
770
|
+
/**
|
|
771
|
+
* Adds a new processor to the Mastra instance.
|
|
772
|
+
*
|
|
773
|
+
* This method allows dynamic registration of processors after the Mastra instance
|
|
774
|
+
* has been created.
|
|
775
|
+
*
|
|
776
|
+
* @throws {MastraError} When a processor with the same key already exists
|
|
777
|
+
*
|
|
778
|
+
* @example
|
|
779
|
+
* ```typescript
|
|
780
|
+
* const mastra = new Mastra();
|
|
781
|
+
* const newProcessor = {
|
|
782
|
+
* id: 'text-processor',
|
|
783
|
+
* processInput: async (messages) => messages
|
|
784
|
+
* };
|
|
785
|
+
* mastra.addProcessor(newProcessor); // Uses processor.id as key
|
|
786
|
+
* // or
|
|
787
|
+
* mastra.addProcessor(newProcessor, 'customKey'); // Uses custom key
|
|
788
|
+
* ```
|
|
789
|
+
*/
|
|
790
|
+
addProcessor<P extends Processor>(processor: P, key?: string): void;
|
|
597
791
|
/**
|
|
598
792
|
* Returns all registered workflows as a record keyed by their IDs.
|
|
599
793
|
*
|
|
@@ -607,7 +801,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
607
801
|
* }
|
|
608
802
|
* });
|
|
609
803
|
*
|
|
610
|
-
* const allWorkflows = mastra.
|
|
804
|
+
* const allWorkflows = mastra.listWorkflows();
|
|
611
805
|
* console.log(Object.keys(allWorkflows)); // ['dataProcessor', 'emailSender', 'reportGenerator']
|
|
612
806
|
*
|
|
613
807
|
* // Execute all workflows with sample data
|
|
@@ -617,9 +811,30 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
617
811
|
* }
|
|
618
812
|
* ```
|
|
619
813
|
*/
|
|
620
|
-
|
|
814
|
+
listWorkflows(props?: {
|
|
621
815
|
serialized?: boolean;
|
|
622
816
|
}): Record<string, Workflow>;
|
|
817
|
+
/**
|
|
818
|
+
* Adds a new workflow to the Mastra instance.
|
|
819
|
+
*
|
|
820
|
+
* This method allows dynamic registration of workflows after the Mastra instance
|
|
821
|
+
* has been created. The workflow will be initialized with Mastra and primitives.
|
|
822
|
+
*
|
|
823
|
+
* @throws {MastraError} When a workflow with the same key already exists
|
|
824
|
+
*
|
|
825
|
+
* @example
|
|
826
|
+
* ```typescript
|
|
827
|
+
* const mastra = new Mastra();
|
|
828
|
+
* const newWorkflow = createWorkflow({
|
|
829
|
+
* id: 'data-pipeline',
|
|
830
|
+
* name: 'Data Pipeline'
|
|
831
|
+
* }).commit();
|
|
832
|
+
* mastra.addWorkflow(newWorkflow); // Uses workflow.id as key
|
|
833
|
+
* // or
|
|
834
|
+
* mastra.addWorkflow(newWorkflow, 'customKey'); // Uses custom key
|
|
835
|
+
* ```
|
|
836
|
+
*/
|
|
837
|
+
addWorkflow<W extends Workflow<any, any, any, any, any, any>>(workflow: W, key?: string): void;
|
|
623
838
|
/**
|
|
624
839
|
* Sets the storage provider for the Mastra instance.
|
|
625
840
|
*
|
|
@@ -634,6 +849,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
634
849
|
*
|
|
635
850
|
* // Now agents can use memory with the storage
|
|
636
851
|
* const agent = new Agent({
|
|
852
|
+
* id: 'assistant',
|
|
637
853
|
* name: 'assistant',
|
|
638
854
|
* memory: new Memory({ storage: mastra.getStorage() })
|
|
639
855
|
* });
|
|
@@ -643,7 +859,6 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
643
859
|
setLogger({ logger }: {
|
|
644
860
|
logger: TLogger;
|
|
645
861
|
}): void;
|
|
646
|
-
setTelemetry(telemetry: OtelConfig): void;
|
|
647
862
|
/**
|
|
648
863
|
* Gets all registered text-to-speech (TTS) providers.
|
|
649
864
|
*
|
|
@@ -684,63 +899,18 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
684
899
|
* ```
|
|
685
900
|
*/
|
|
686
901
|
getLogger(): TLogger;
|
|
687
|
-
/**
|
|
688
|
-
* Gets the currently configured telemetry instance.
|
|
689
|
-
*
|
|
690
|
-
* @example
|
|
691
|
-
* ```typescript
|
|
692
|
-
* const mastra = new Mastra({
|
|
693
|
-
* telemetry: {
|
|
694
|
-
* enabled: true,
|
|
695
|
-
* serviceName: 'my-mastra-app'
|
|
696
|
-
* }
|
|
697
|
-
* });
|
|
698
|
-
*
|
|
699
|
-
* const telemetry = mastra.getTelemetry();
|
|
700
|
-
* if (telemetry) {
|
|
701
|
-
* const span = telemetry.startSpan('custom-operation');
|
|
702
|
-
* span.setAttributes({ operation: 'data-processing' });
|
|
703
|
-
* span.end();
|
|
704
|
-
* }
|
|
705
|
-
* ```
|
|
706
|
-
*
|
|
707
|
-
* @deprecated use {@link getAITracing()} instead
|
|
708
|
-
*/
|
|
709
|
-
getTelemetry(): Telemetry | undefined;
|
|
710
|
-
/**
|
|
711
|
-
* Gets the currently configured memory instance.
|
|
712
|
-
*
|
|
713
|
-
* @deprecated Memory should be configured directly on agents instead of on the Mastra instance.
|
|
714
|
-
* Use `new Agent({ memory: new Memory() })` instead.
|
|
715
|
-
*
|
|
716
|
-
* @example Legacy memory usage (deprecated)
|
|
717
|
-
* ```typescript
|
|
718
|
-
* // This approach is deprecated
|
|
719
|
-
* const mastra = new Mastra({
|
|
720
|
-
* // memory: new Memory() // This is no longer supported
|
|
721
|
-
* });
|
|
722
|
-
*
|
|
723
|
-
* // Use this instead:
|
|
724
|
-
* const agent = new Agent({
|
|
725
|
-
* name: 'assistant',
|
|
726
|
-
* memory: new Memory({
|
|
727
|
-
* storage: new LibSQLStore({ url: ':memory:' })
|
|
728
|
-
* })
|
|
729
|
-
* });
|
|
730
|
-
* ```
|
|
731
|
-
*/
|
|
732
|
-
getMemory(): MastraMemory | undefined;
|
|
733
902
|
/**
|
|
734
903
|
* Gets the currently configured storage provider.
|
|
735
904
|
*
|
|
736
905
|
* @example
|
|
737
906
|
* ```typescript
|
|
738
907
|
* const mastra = new Mastra({
|
|
739
|
-
* storage: new LibSQLStore({ url: 'file:./data.db' })
|
|
908
|
+
* storage: new LibSQLStore({ id: 'mastra-storage', url: 'file:./data.db' })
|
|
740
909
|
* });
|
|
741
910
|
*
|
|
742
911
|
* // Use the storage in agent memory
|
|
743
912
|
* const agent = new Agent({
|
|
913
|
+
* id: 'assistant',
|
|
744
914
|
* name: 'assistant',
|
|
745
915
|
* memory: new Memory({
|
|
746
916
|
* storage: mastra.getStorage()
|
|
@@ -749,6 +919,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
749
919
|
* ```
|
|
750
920
|
*/
|
|
751
921
|
getStorage(): MastraStorage | undefined;
|
|
922
|
+
get observability(): ObservabilityEntrypoint;
|
|
752
923
|
getServerMiddleware(): {
|
|
753
924
|
handler: (c: any, next: () => Promise<void>) => Promise<Response | void>;
|
|
754
925
|
path: string;
|
|
@@ -757,7 +928,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
757
928
|
setServerMiddleware(serverMiddleware: Middleware | Middleware[]): void;
|
|
758
929
|
getServer(): ServerConfig | undefined;
|
|
759
930
|
getBundlerConfig(): BundlerConfig | undefined;
|
|
760
|
-
|
|
931
|
+
listLogsByRunId({ runId, transportId, fromDate, toDate, logLevel, filters, page, perPage, }: {
|
|
761
932
|
runId: string;
|
|
762
933
|
transportId: string;
|
|
763
934
|
fromDate?: Date;
|
|
@@ -773,7 +944,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
773
944
|
perPage: number;
|
|
774
945
|
hasMore: boolean;
|
|
775
946
|
}>;
|
|
776
|
-
|
|
947
|
+
listLogs(transportId: string, params?: {
|
|
777
948
|
fromDate?: Date;
|
|
778
949
|
toDate?: Date;
|
|
779
950
|
logLevel?: LogLevel;
|
|
@@ -803,11 +974,49 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
803
974
|
* const mcpServers = mastra.getMCPServers();
|
|
804
975
|
* if (mcpServers) {
|
|
805
976
|
* const fsServer = mcpServers.filesystem;
|
|
806
|
-
* const tools = await fsServer.
|
|
977
|
+
* const tools = await fsServer.listTools();
|
|
807
978
|
* }
|
|
808
979
|
* ```
|
|
809
980
|
*/
|
|
810
|
-
|
|
981
|
+
listMCPServers(): Record<string, MCPServerBase> | undefined;
|
|
982
|
+
/**
|
|
983
|
+
* Adds a new MCP server to the Mastra instance.
|
|
984
|
+
*
|
|
985
|
+
* This method allows dynamic registration of MCP servers after the Mastra instance
|
|
986
|
+
* has been created. The server will be initialized with ID, Mastra instance, and logger.
|
|
987
|
+
*
|
|
988
|
+
* @throws {MastraError} When an MCP server with the same key already exists
|
|
989
|
+
*
|
|
990
|
+
* @example
|
|
991
|
+
* ```typescript
|
|
992
|
+
* const mastra = new Mastra();
|
|
993
|
+
* const newServer = new FileSystemMCPServer({
|
|
994
|
+
* rootPath: '/data'
|
|
995
|
+
* });
|
|
996
|
+
* mastra.addMCPServer(newServer); // Uses server.id as key
|
|
997
|
+
* // or
|
|
998
|
+
* mastra.addMCPServer(newServer, 'customKey'); // Uses custom key
|
|
999
|
+
* ```
|
|
1000
|
+
*/
|
|
1001
|
+
addMCPServer<M extends MCPServerBase>(server: M, key?: string): void;
|
|
1002
|
+
/**
|
|
1003
|
+
* Retrieves a specific MCP server instance by registration key.
|
|
1004
|
+
*
|
|
1005
|
+
* @throws {MastraError} When the specified MCP server is not found
|
|
1006
|
+
*
|
|
1007
|
+
* @example
|
|
1008
|
+
* ```typescript
|
|
1009
|
+
* const mastra = new Mastra({
|
|
1010
|
+
* mcpServers: {
|
|
1011
|
+
* filesystem: new FileSystemMCPServer({...})
|
|
1012
|
+
* }
|
|
1013
|
+
* });
|
|
1014
|
+
*
|
|
1015
|
+
* const fsServer = mastra.getMCPServer('filesystem');
|
|
1016
|
+
* const tools = await fsServer.listTools();
|
|
1017
|
+
* ```
|
|
1018
|
+
*/
|
|
1019
|
+
getMCPServer<TMCPServerName extends keyof TMCPServers>(name: TMCPServerName): TMCPServers[TMCPServerName] | undefined;
|
|
811
1020
|
/**
|
|
812
1021
|
* Retrieves a specific Model Context Protocol (MCP) server instance by its logical ID.
|
|
813
1022
|
*
|
|
@@ -827,13 +1036,13 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
827
1036
|
* }
|
|
828
1037
|
* });
|
|
829
1038
|
*
|
|
830
|
-
* const fsServer = mastra.
|
|
1039
|
+
* const fsServer = mastra.getMCPServerById('fs-server');
|
|
831
1040
|
* if (fsServer) {
|
|
832
|
-
* const tools = await fsServer.
|
|
1041
|
+
* const tools = await fsServer.listTools();
|
|
833
1042
|
* }
|
|
834
1043
|
* ```
|
|
835
1044
|
*/
|
|
836
|
-
|
|
1045
|
+
getMCPServerById(serverId: string, version?: string): MCPServerBase | undefined;
|
|
837
1046
|
addTopicListener(topic: string, listener: (event: any) => Promise<void>): Promise<void>;
|
|
838
1047
|
removeTopicListener(topic: string, listener: (event: any) => Promise<void>): Promise<void>;
|
|
839
1048
|
startEventEngine(): Promise<void>;
|
|
@@ -842,7 +1051,7 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
|
|
|
842
1051
|
* Gracefully shuts down the Mastra instance and cleans up all resources.
|
|
843
1052
|
*
|
|
844
1053
|
* This method performs a clean shutdown of all Mastra components, including:
|
|
845
|
-
* -
|
|
1054
|
+
* - tracing registry and all tracing instances
|
|
846
1055
|
* - Event engine and pub/sub system
|
|
847
1056
|
* - All registered components and their resources
|
|
848
1057
|
*
|