@mastra/mcp-docs-server 1.0.0-beta.1 → 1.0.0-beta.11
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/.docs/organized/changelogs/%40internal%2Fchangeset-cli.md +1 -15
- package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +1 -7
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +201 -1
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +1 -55
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +276 -76
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fauth.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +200 -0
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +26 -0
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +89 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +392 -192
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +200 -0
- package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +42 -0
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +61 -0
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Flance.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +263 -63
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Frag.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Freact.md +154 -1
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +18 -0
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +42 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +274 -74
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +92 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +67 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +201 -1
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +201 -1
- package/.docs/organized/changelogs/create-mastra.md +201 -1
- package/.docs/organized/changelogs/mastra.md +201 -1
- package/.docs/organized/code-examples/agui.md +1 -0
- package/.docs/organized/code-examples/ai-elements.md +2 -2
- package/.docs/organized/code-examples/ai-sdk-useChat.md +2 -2
- package/.docs/organized/code-examples/ai-sdk-v5.md +3 -2
- package/.docs/organized/code-examples/assistant-ui.md +2 -2
- package/.docs/organized/code-examples/bird-checker-with-express.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +2 -2
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +2 -2
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/organized/code-examples/crypto-chatbot.md +2 -2
- package/.docs/organized/code-examples/fireworks-r1.md +1 -1
- package/.docs/organized/code-examples/heads-up-game.md +1 -1
- package/.docs/organized/code-examples/mcp-configuration.md +0 -3
- package/.docs/organized/code-examples/mcp-server-adapters.md +720 -0
- package/.docs/organized/code-examples/memory-per-resource-example.md +1 -1
- package/.docs/organized/code-examples/memory-with-processors.md +1 -1
- package/.docs/organized/code-examples/openapi-spec-writer.md +1 -1
- package/.docs/organized/code-examples/processors-with-ai-sdk.md +14 -0
- package/.docs/organized/code-examples/quick-start.md +2 -2
- package/.docs/organized/code-examples/server-app-access.md +342 -0
- package/.docs/organized/code-examples/server-express-adapter.md +87 -0
- package/.docs/organized/code-examples/server-hono-adapter.md +85 -0
- package/.docs/organized/code-examples/stock-price-tool.md +1 -21
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -1
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-memory.md +1 -1
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +56 -10
- package/.docs/raw/agents/agent-approval.mdx +189 -0
- package/.docs/raw/agents/agent-memory.mdx +1 -1
- package/.docs/raw/agents/guardrails.mdx +70 -30
- package/.docs/raw/agents/networks.mdx +3 -3
- package/.docs/raw/agents/overview.mdx +18 -167
- package/.docs/raw/agents/processors.mdx +430 -0
- package/.docs/raw/agents/structured-output.mdx +224 -0
- package/.docs/raw/agents/using-tools.mdx +14 -14
- package/.docs/raw/auth/auth0.mdx +1 -1
- package/.docs/raw/auth/clerk.mdx +1 -1
- package/.docs/raw/auth/firebase.mdx +1 -1
- package/.docs/raw/auth/index.mdx +1 -1
- package/.docs/raw/auth/jwt.mdx +1 -1
- package/.docs/raw/auth/supabase.mdx +1 -1
- package/.docs/raw/auth/workos.mdx +1 -1
- package/.docs/raw/community/contributing-templates.mdx +1 -1
- package/.docs/raw/community/discord.mdx +2 -2
- package/.docs/raw/community/licensing.mdx +1 -1
- package/.docs/raw/course/01-first-agent/05-running-playground.md +5 -5
- package/.docs/raw/course/01-first-agent/09-testing-your-agent.md +3 -3
- package/.docs/raw/course/01-first-agent/13-testing-your-tool.md +3 -3
- package/.docs/raw/course/01-first-agent/17-testing-memory.md +2 -2
- package/.docs/raw/course/04-workflows/07-using-playground.md +1 -1
- package/.docs/raw/deployment/{server-deployment.mdx → building-mastra.mdx} +4 -4
- package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +2 -2
- package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +3 -3
- package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +2 -2
- package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/cloudflare-deployer.mdx +1 -1
- package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +2 -2
- package/.docs/raw/deployment/cloud-providers/index.mdx +26 -29
- package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/netlify-deployer.mdx +45 -14
- package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/vercel-deployer.mdx +1 -1
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/dashboard.mdx +3 -3
- package/.docs/raw/deployment/mastra-cloud/observability.mdx +53 -0
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/overview.mdx +3 -3
- package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/setting-up.mdx +4 -4
- package/.docs/raw/deployment/monorepo.mdx +3 -3
- package/.docs/raw/deployment/overview.mdx +7 -7
- package/.docs/raw/deployment/web-framework.mdx +6 -6
- package/.docs/raw/evals/{off-the-shelf-scorers.mdx → built-in-scorers.mdx} +17 -15
- package/.docs/raw/evals/custom-scorers.mdx +4 -6
- package/.docs/raw/evals/overview.mdx +5 -6
- package/.docs/raw/evals/running-in-ci.mdx +2 -4
- package/.docs/raw/getting-started/{installation.mdx → manual-install.mdx} +6 -80
- package/.docs/raw/getting-started/mcp-docs-server.mdx +63 -6
- package/.docs/raw/getting-started/project-structure.mdx +2 -2
- package/.docs/raw/getting-started/start.mdx +72 -0
- package/.docs/raw/getting-started/studio.mdx +32 -7
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +147 -0
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +627 -0
- package/.docs/raw/{frameworks/agentic-uis → guides/build-your-ui}/assistant-ui.mdx +71 -19
- package/.docs/raw/guides/build-your-ui/copilotkit.mdx +206 -0
- package/.docs/raw/{frameworks/web-frameworks → guides/getting-started}/astro.mdx +24 -26
- package/.docs/raw/{frameworks/servers → guides/getting-started}/express.mdx +4 -5
- package/.docs/raw/guides/{quickstarts/nextjs.mdx → getting-started/next-js.mdx} +26 -25
- package/.docs/raw/guides/getting-started/quickstart.mdx +97 -0
- package/.docs/raw/{frameworks/web-frameworks → guides/getting-started}/sveltekit.mdx +24 -26
- package/.docs/raw/{frameworks/web-frameworks → guides/getting-started}/vite-react.mdx +7 -7
- package/.docs/raw/guides/guide/ai-recruiter.mdx +2 -3
- package/.docs/raw/guides/guide/chef-michel.mdx +2 -3
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +2 -2
- package/.docs/raw/guides/guide/research-assistant.mdx +7 -8
- package/.docs/raw/guides/guide/stock-agent.mdx +4 -6
- package/.docs/raw/guides/guide/web-search.mdx +12 -10
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +421 -0
- package/.docs/raw/guides/index.mdx +3 -35
- package/.docs/raw/guides/migrations/agentnetwork.mdx +4 -4
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +119 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +121 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +42 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/evals.mdx +31 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +27 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/mcp.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +28 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +25 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +80 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +68 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +25 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +174 -1
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +2 -2
- package/.docs/raw/index.mdx +3 -3
- package/.docs/raw/mcp/overview.mdx +358 -0
- package/.docs/raw/mcp/publishing-mcp-server.mdx +139 -0
- package/.docs/raw/memory/conversation-history.mdx +1 -1
- package/.docs/raw/memory/memory-processors.mdx +265 -80
- package/.docs/raw/memory/overview.mdx +2 -2
- package/.docs/raw/memory/semantic-recall.mdx +9 -9
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +3 -8
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +150 -0
- package/.docs/raw/memory/storage/memory-with-pg.mdx +3 -8
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +3 -8
- package/.docs/raw/memory/threads-and-resources.mdx +4 -4
- package/.docs/raw/memory/working-memory.mdx +16 -8
- package/.docs/raw/{logging.mdx → observability/logging.mdx} +7 -7
- package/.docs/raw/observability/overview.mdx +3 -4
- package/.docs/raw/observability/tracing/bridges/otel.mdx +200 -0
- package/.docs/raw/observability/tracing/exporters/arize.mdx +37 -1
- package/.docs/raw/observability/tracing/exporters/braintrust.mdx +20 -1
- package/.docs/raw/observability/tracing/exporters/cloud.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/default.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +84 -1
- package/.docs/raw/observability/tracing/exporters/langsmith.mdx +13 -1
- package/.docs/raw/observability/tracing/exporters/otel.mdx +123 -25
- package/.docs/raw/observability/tracing/exporters/posthog.mdx +127 -0
- package/.docs/raw/observability/tracing/overview.mdx +80 -9
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +1 -2
- package/.docs/raw/rag/chunking-and-embedding.mdx +16 -17
- package/.docs/raw/rag/overview.mdx +4 -3
- package/.docs/raw/rag/retrieval.mdx +44 -39
- package/.docs/raw/rag/vector-databases.mdx +94 -3
- package/.docs/raw/reference/agents/agent.mdx +19 -16
- package/.docs/raw/reference/agents/generate.mdx +67 -99
- package/.docs/raw/reference/agents/generateLegacy.mdx +3 -3
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +1 -1
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +1 -1
- package/.docs/raw/reference/agents/getLLM.mdx +2 -2
- package/.docs/raw/reference/agents/getMemory.mdx +1 -1
- package/.docs/raw/reference/agents/getModel.mdx +1 -1
- package/.docs/raw/reference/agents/getTools.mdx +69 -0
- package/.docs/raw/reference/agents/getVoice.mdx +1 -1
- package/.docs/raw/reference/agents/listAgents.mdx +1 -1
- package/.docs/raw/reference/agents/listScorers.mdx +1 -1
- package/.docs/raw/reference/agents/listTools.mdx +2 -2
- package/.docs/raw/reference/agents/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/agents/network.mdx +33 -72
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +127 -0
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +117 -0
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +64 -0
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +116 -0
- package/.docs/raw/reference/ai-sdk/network-route.mdx +99 -0
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +289 -0
- package/.docs/raw/reference/ai-sdk/with-mastra.mdx +119 -0
- package/.docs/raw/reference/ai-sdk/workflow-route.mdx +110 -0
- package/.docs/raw/reference/auth/auth0.mdx +1 -1
- package/.docs/raw/reference/auth/clerk.mdx +1 -1
- package/.docs/raw/reference/auth/firebase.mdx +1 -1
- package/.docs/raw/reference/auth/jwt.mdx +1 -1
- package/.docs/raw/reference/auth/supabase.mdx +1 -1
- package/.docs/raw/reference/auth/workos.mdx +1 -1
- package/.docs/raw/reference/cli/create-mastra.mdx +1 -1
- package/.docs/raw/reference/cli/mastra.mdx +19 -6
- package/.docs/raw/reference/client-js/agents.mdx +252 -68
- package/.docs/raw/reference/client-js/error-handling.mdx +1 -1
- package/.docs/raw/reference/client-js/logs.mdx +1 -1
- package/.docs/raw/reference/client-js/mastra-client.mdx +4 -4
- package/.docs/raw/reference/client-js/memory.mdx +48 -2
- package/.docs/raw/reference/client-js/observability.mdx +1 -1
- package/.docs/raw/reference/client-js/telemetry.mdx +1 -1
- package/.docs/raw/reference/client-js/tools.mdx +1 -1
- package/.docs/raw/reference/client-js/vectors.mdx +1 -1
- package/.docs/raw/reference/client-js/workflows.mdx +93 -64
- package/.docs/raw/reference/core/addGateway.mdx +59 -0
- package/.docs/raw/reference/core/getAgent.mdx +1 -1
- package/.docs/raw/reference/core/getAgentById.mdx +1 -1
- package/.docs/raw/reference/core/getDeployer.mdx +1 -1
- package/.docs/raw/reference/core/getGateway.mdx +59 -0
- package/.docs/raw/reference/core/getGatewayById.mdx +62 -0
- package/.docs/raw/reference/core/getLogger.mdx +2 -2
- package/.docs/raw/reference/core/getMCPServer.mdx +2 -2
- package/.docs/raw/reference/core/getMCPServerById.mdx +2 -2
- package/.docs/raw/reference/core/getMemory.mdx +73 -0
- package/.docs/raw/reference/core/getScorer.mdx +1 -1
- package/.docs/raw/reference/core/getScorerById.mdx +1 -1
- package/.docs/raw/reference/core/getServer.mdx +3 -3
- package/.docs/raw/reference/core/getStorage.mdx +1 -1
- package/.docs/raw/reference/core/getStoredAgentById.mdx +183 -0
- package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
- package/.docs/raw/reference/core/getVector.mdx +1 -1
- package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +1 -1
- package/.docs/raw/reference/core/listGateways.mdx +53 -0
- package/.docs/raw/reference/core/listLogs.mdx +2 -2
- package/.docs/raw/reference/core/listLogsByRunId.mdx +2 -2
- package/.docs/raw/reference/core/listMCPServers.mdx +2 -2
- package/.docs/raw/reference/core/listMemory.mdx +70 -0
- package/.docs/raw/reference/core/listScorers.mdx +1 -1
- package/.docs/raw/reference/core/listStoredAgents.mdx +151 -0
- package/.docs/raw/reference/core/listVectors.mdx +1 -1
- package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/core/mastra-class.mdx +17 -1
- package/.docs/raw/reference/core/mastra-model-gateway.mdx +227 -0
- package/.docs/raw/reference/core/setLogger.mdx +2 -2
- package/.docs/raw/reference/core/setStorage.mdx +1 -1
- package/.docs/raw/reference/core/setTelemetry.mdx +2 -2
- package/.docs/raw/reference/deployer/cloudflare.mdx +1 -1
- package/.docs/raw/reference/deployer/deployer.mdx +1 -1
- package/.docs/raw/reference/deployer/netlify.mdx +2 -3
- package/.docs/raw/reference/deployer/vercel.mdx +1 -1
- package/.docs/raw/reference/evals/answer-relevancy.mdx +29 -99
- package/.docs/raw/reference/evals/answer-similarity.mdx +13 -259
- package/.docs/raw/reference/evals/bias.mdx +30 -88
- package/.docs/raw/reference/evals/completeness.mdx +32 -91
- package/.docs/raw/reference/evals/content-similarity.mdx +29 -89
- package/.docs/raw/reference/evals/context-precision.mdx +29 -131
- package/.docs/raw/reference/evals/context-relevance.mdx +12 -12
- package/.docs/raw/reference/evals/create-scorer.mdx +1 -1
- package/.docs/raw/reference/evals/faithfulness.mdx +29 -102
- package/.docs/raw/reference/evals/hallucination.mdx +29 -104
- package/.docs/raw/reference/evals/keyword-coverage.mdx +29 -108
- package/.docs/raw/reference/evals/mastra-scorer.mdx +1 -1
- package/.docs/raw/reference/evals/noise-sensitivity.mdx +12 -12
- package/.docs/raw/reference/evals/prompt-alignment.mdx +16 -16
- package/.docs/raw/reference/evals/run-evals.mdx +1 -1
- package/.docs/raw/reference/evals/scorer-utils.mdx +362 -0
- package/.docs/raw/reference/evals/textual-difference.mdx +28 -101
- package/.docs/raw/reference/evals/tone-consistency.mdx +26 -99
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +8 -8
- package/.docs/raw/reference/evals/toxicity.mdx +30 -93
- package/.docs/raw/reference/index.mdx +1 -0
- package/.docs/raw/reference/logging/pino-logger.mdx +2 -2
- package/.docs/raw/reference/memory/createThread.mdx +1 -1
- package/.docs/raw/reference/memory/deleteMessages.mdx +1 -1
- package/.docs/raw/reference/memory/getThreadById.mdx +1 -1
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +1 -1
- package/.docs/raw/reference/memory/memory-class.mdx +6 -8
- package/.docs/raw/reference/memory/query.mdx +1 -1
- package/.docs/raw/reference/memory/recall.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +177 -0
- package/.docs/raw/reference/observability/tracing/configuration.mdx +1 -5
- package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +30 -1
- package/.docs/raw/reference/observability/tracing/exporters/braintrust.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/cloud-exporter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/console-exporter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/default-exporter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +44 -1
- package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +18 -2
- package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +34 -44
- package/.docs/raw/reference/observability/tracing/exporters/posthog.mdx +132 -0
- package/.docs/raw/reference/observability/tracing/instances.mdx +1 -5
- package/.docs/raw/reference/observability/tracing/interfaces.mdx +30 -5
- package/.docs/raw/reference/observability/tracing/processors/sensitive-data-filter.mdx +1 -1
- package/.docs/raw/reference/observability/tracing/spans.mdx +1 -5
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +2 -2
- package/.docs/raw/reference/processors/language-detector.mdx +11 -4
- package/.docs/raw/reference/processors/message-history-processor.mdx +131 -0
- package/.docs/raw/reference/processors/moderation-processor.mdx +13 -6
- package/.docs/raw/reference/processors/pii-detector.mdx +13 -6
- package/.docs/raw/reference/processors/processor-interface.mdx +803 -0
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +11 -4
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +197 -0
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +4 -5
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +3 -3
- package/.docs/raw/reference/processors/tool-call-filter.mdx +125 -0
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +2 -2
- package/.docs/raw/reference/processors/working-memory-processor.mdx +221 -0
- package/.docs/raw/reference/rag/chunk.mdx +1 -1
- package/.docs/raw/reference/rag/database-config.mdx +1 -1
- package/.docs/raw/reference/rag/document.mdx +1 -1
- package/.docs/raw/reference/rag/embeddings.mdx +6 -6
- package/.docs/raw/reference/rag/extract-params.mdx +1 -1
- package/.docs/raw/reference/rag/graph-rag.mdx +1 -1
- package/.docs/raw/reference/rag/metadata-filters.mdx +1 -1
- package/.docs/raw/reference/rag/rerank.mdx +2 -3
- package/.docs/raw/reference/rag/rerankWithScorer.mdx +1 -2
- package/.docs/raw/reference/server/create-route.mdx +328 -0
- package/.docs/raw/reference/server/express-adapter.mdx +260 -0
- package/.docs/raw/reference/server/hono-adapter.mdx +242 -0
- package/.docs/raw/reference/server/mastra-server.mdx +345 -0
- package/.docs/raw/reference/server/routes.mdx +250 -0
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +38 -1
- package/.docs/raw/reference/storage/cloudflare.mdx +1 -1
- package/.docs/raw/reference/storage/convex.mdx +164 -0
- package/.docs/raw/reference/storage/dynamodb.mdx +1 -1
- package/.docs/raw/reference/storage/lance.mdx +34 -1
- package/.docs/raw/reference/storage/libsql.mdx +38 -1
- package/.docs/raw/reference/storage/mongodb.mdx +40 -1
- package/.docs/raw/reference/storage/mssql.mdx +38 -1
- package/.docs/raw/reference/storage/postgresql.mdx +38 -1
- package/.docs/raw/reference/storage/upstash.mdx +1 -1
- package/.docs/raw/reference/streaming/ChunkType.mdx +25 -4
- package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/stream.mdx +84 -124
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +8 -10
- package/.docs/raw/reference/streaming/workflows/{resumeStreamVNext.mdx → resumeStream.mdx} +51 -11
- package/.docs/raw/reference/streaming/workflows/stream.mdx +84 -25
- package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +170 -0
- package/.docs/raw/reference/templates/overview.mdx +2 -5
- package/.docs/raw/reference/tools/client.mdx +2 -3
- package/.docs/raw/reference/tools/create-tool.mdx +135 -4
- package/.docs/raw/reference/tools/document-chunker-tool.mdx +1 -1
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +7 -7
- package/.docs/raw/reference/tools/mcp-client.mdx +131 -23
- package/.docs/raw/reference/tools/mcp-server.mdx +56 -8
- package/.docs/raw/reference/tools/vector-query-tool.mdx +16 -17
- package/.docs/raw/reference/vectors/astra.mdx +1 -1
- package/.docs/raw/reference/vectors/chroma.mdx +82 -2
- package/.docs/raw/reference/vectors/convex.mdx +429 -0
- package/.docs/raw/reference/vectors/couchbase.mdx +25 -18
- package/.docs/raw/reference/vectors/duckdb.mdx +462 -0
- package/.docs/raw/reference/vectors/elasticsearch.mdx +310 -0
- package/.docs/raw/reference/vectors/lance.mdx +39 -23
- package/.docs/raw/reference/vectors/libsql.mdx +36 -3
- package/.docs/raw/reference/vectors/mongodb.mdx +36 -3
- package/.docs/raw/reference/vectors/opensearch.mdx +38 -17
- package/.docs/raw/reference/vectors/pg.mdx +44 -37
- package/.docs/raw/reference/vectors/pinecone.mdx +70 -3
- package/.docs/raw/reference/vectors/qdrant.mdx +37 -2
- package/.docs/raw/reference/vectors/s3vectors.mdx +1 -1
- package/.docs/raw/reference/vectors/turbopuffer.mdx +75 -1
- package/.docs/raw/reference/vectors/upstash.mdx +1 -1
- package/.docs/raw/reference/vectors/vectorize.mdx +1 -1
- package/.docs/raw/reference/voice/azure.mdx +96 -81
- package/.docs/raw/reference/voice/cloudflare.mdx +1 -1
- package/.docs/raw/reference/voice/composite-voice.mdx +72 -29
- package/.docs/raw/reference/voice/deepgram.mdx +1 -1
- package/.docs/raw/reference/voice/elevenlabs.mdx +1 -1
- package/.docs/raw/reference/voice/google-gemini-live.mdx +1 -1
- package/.docs/raw/reference/voice/google.mdx +160 -21
- package/.docs/raw/reference/voice/mastra-voice.mdx +1 -1
- package/.docs/raw/reference/voice/murf.mdx +1 -1
- package/.docs/raw/reference/voice/openai-realtime.mdx +3 -3
- package/.docs/raw/reference/voice/openai.mdx +1 -1
- package/.docs/raw/reference/voice/playai.mdx +1 -1
- package/.docs/raw/reference/voice/sarvam.mdx +1 -1
- package/.docs/raw/reference/voice/speechify.mdx +1 -1
- package/.docs/raw/reference/voice/voice.addInstructions.mdx +3 -4
- package/.docs/raw/reference/voice/voice.addTools.mdx +2 -2
- package/.docs/raw/reference/voice/voice.answer.mdx +2 -2
- package/.docs/raw/reference/voice/voice.close.mdx +2 -2
- package/.docs/raw/reference/voice/voice.connect.mdx +2 -2
- package/.docs/raw/reference/voice/voice.events.mdx +1 -1
- package/.docs/raw/reference/voice/voice.getSpeakers.mdx +1 -1
- package/.docs/raw/reference/voice/voice.listen.mdx +87 -53
- package/.docs/raw/reference/voice/voice.off.mdx +2 -2
- package/.docs/raw/reference/voice/voice.on.mdx +2 -2
- package/.docs/raw/reference/voice/voice.send.mdx +2 -2
- package/.docs/raw/reference/voice/voice.speak.mdx +76 -41
- package/.docs/raw/reference/voice/voice.updateConfig.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +142 -0
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +45 -1
- package/.docs/raw/reference/workflows/run-methods/start.mdx +48 -4
- package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +310 -0
- package/.docs/raw/reference/workflows/run.mdx +28 -6
- package/.docs/raw/reference/workflows/step.mdx +65 -1
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +69 -4
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow.mdx +44 -2
- package/.docs/raw/server-db/custom-adapters.mdx +386 -0
- package/.docs/raw/server-db/custom-api-routes.mdx +6 -6
- package/.docs/raw/server-db/mastra-client.mdx +3 -4
- package/.docs/raw/server-db/{production-server.mdx → mastra-server.mdx} +22 -12
- package/.docs/raw/server-db/middleware.mdx +31 -31
- package/.docs/raw/server-db/request-context.mdx +3 -4
- package/.docs/raw/server-db/server-adapters.mdx +312 -0
- package/.docs/raw/server-db/storage.mdx +12 -1
- package/.docs/raw/streaming/events.mdx +1 -1
- package/.docs/raw/streaming/overview.mdx +27 -16
- package/.docs/raw/streaming/tool-streaming.mdx +58 -19
- package/.docs/raw/streaming/workflow-streaming.mdx +6 -12
- package/.docs/raw/tools-mcp/advanced-usage.mdx +2 -3
- package/.docs/raw/tools-mcp/mcp-overview.mdx +4 -6
- package/.docs/raw/tools-mcp/overview.mdx +1 -1
- package/.docs/raw/voice/overview.mdx +88 -41
- package/.docs/raw/voice/speech-to-speech.mdx +5 -5
- package/.docs/raw/voice/speech-to-text.mdx +2 -3
- package/.docs/raw/voice/text-to-speech.mdx +2 -3
- package/.docs/raw/workflows/agents-and-tools.mdx +43 -5
- package/.docs/raw/workflows/control-flow.mdx +534 -3
- package/.docs/raw/workflows/error-handling.mdx +5 -4
- package/.docs/raw/workflows/human-in-the-loop.mdx +160 -213
- package/.docs/raw/workflows/inngest-workflow.mdx +1 -1
- package/.docs/raw/workflows/input-data-mapping.mdx +1 -1
- package/.docs/raw/workflows/overview.mdx +67 -47
- package/.docs/raw/workflows/snapshots.mdx +5 -3
- package/.docs/raw/workflows/suspend-and-resume.mdx +121 -204
- package/.docs/raw/workflows/time-travel.mdx +313 -0
- package/.docs/raw/workflows/workflow-state.mdx +190 -0
- package/CHANGELOG.md +88 -0
- package/dist/{chunk-5NJC7NRO.js → chunk-4CM2BQNP.js} +24 -4
- package/dist/prepare-docs/package-changes.d.ts.map +1 -1
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/stdio.js +17 -19
- package/package.json +10 -14
- package/.docs/raw/deployment/serverless-platforms/index.mdx +0 -58
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +0 -688
- package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +0 -123
- package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +0 -382
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +0 -179
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +0 -379
- package/.docs/raw/getting-started/templates.mdx +0 -73
- package/.docs/raw/mastra-cloud/observability.mdx +0 -51
- package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +0 -47
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +0 -153
|
@@ -1,302 +1,502 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
-
## 1.0.0-beta.
|
|
3
|
+
## 1.0.0-beta.11
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Respect structured outputs for v2 models so tool schemas aren’t stripped ([#11038](https://github.com/mastra-ai/mastra/pull/11038))
|
|
4
8
|
|
|
5
9
|
### Patch Changes
|
|
6
10
|
|
|
7
|
-
-
|
|
11
|
+
- Fix type safety for message ordering - restrict `orderBy` to only accept `'createdAt'` field ([#11069](https://github.com/mastra-ai/mastra/pull/11069))
|
|
8
12
|
|
|
9
|
-
-
|
|
13
|
+
Messages don't have an `updatedAt` field, but the previous type allowed ordering by it, which would return empty results. This change adds compile-time type safety by making `StorageOrderBy` generic and restricting `StorageListMessagesInput.orderBy` to only accept `'createdAt'`. The API validation schemas have also been updated to reject invalid orderBy values at runtime.
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
- Loosen tools types in processInputStep / prepareStep. ([#11071](https://github.com/mastra-ai/mastra/pull/11071))
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
- Added the ability to provide a base path for Mastra Studio. ([#10441](https://github.com/mastra-ai/mastra/pull/10441))
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { Mastra } from '@mastra/core';
|
|
21
|
+
|
|
22
|
+
export const mastra = new Mastra({
|
|
23
|
+
server: {
|
|
24
|
+
studioBase: '/my-mastra-studio',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This will make Mastra Studio available at `http://localhost:4111/my-mastra-studio`.
|
|
14
30
|
|
|
15
|
-
-
|
|
31
|
+
- Expand `processInputStep` processor method and integrate `prepareStep` as a processor ([#10774](https://github.com/mastra-ai/mastra/pull/10774))
|
|
16
32
|
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- Updated `getUserMessageFromRunInput()` and `getAssistantMessageFromRunOutput()` to use new message structure
|
|
23
|
-
- Removed `createUIMessage()`
|
|
33
|
+
**New Features:**
|
|
34
|
+
- `prepareStep` callback now runs through the standard `processInputStep` pipeline
|
|
35
|
+
- Processors can now modify per-step: `model`, `tools`, `toolChoice`, `activeTools`, `messages`, `systemMessages`, `providerOptions`, `modelSettings`, and `structuredOutput`
|
|
36
|
+
- Processor chaining: each processor receives accumulated state from previous processors
|
|
37
|
+
- System messages are isolated per-step (reset at start of each step)
|
|
24
38
|
|
|
25
|
-
|
|
39
|
+
**Breaking Change:**
|
|
40
|
+
- `prepareStep` messages format changed from AI SDK v5 model messages to `MastraDBMessage` format
|
|
41
|
+
- Migration: Use `messageList.get.all.aiV5.model()` if you need the old format
|
|
26
42
|
|
|
27
|
-
|
|
43
|
+
- Multiple Processor improvements including: ([#10947](https://github.com/mastra-ai/mastra/pull/10947))
|
|
44
|
+
- Workflows can now return tripwires, they bubble up from agents that return tripwires in a step
|
|
45
|
+
- You can write processors as workflows using the existing Workflow primitive, every processor flow is now a workflow.
|
|
46
|
+
- tripwires that you throw can now return additional information including ability to retry the step
|
|
47
|
+
- New processor method `processOutputStep` added which runs after every step.
|
|
28
48
|
|
|
29
|
-
|
|
49
|
+
**What's new:**
|
|
30
50
|
|
|
31
|
-
|
|
51
|
+
**1. Retry mechanism with LLM feedback** - Processors can now request retries with feedback that gets sent back to the LLM:
|
|
32
52
|
|
|
33
|
-
|
|
53
|
+
```typescript
|
|
54
|
+
processOutputStep: async ({ text, abort, retryCount }) => {
|
|
55
|
+
if (isLowQuality(text)) {
|
|
56
|
+
abort('Response quality too low', { retry: true, metadata: { score: 0.6 } });
|
|
57
|
+
}
|
|
58
|
+
return [];
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Configure with `maxProcessorRetries` (default: 3). Rejected steps are preserved in `result.steps[n].tripwire`. Retries are only available in `processOutputStep` and `processInputStep`. It will replay the step with additional context added.
|
|
63
|
+
|
|
64
|
+
**2. Workflow orchestration for processors** - Processors can now be composed using workflow primitives:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { createStep, createWorkflow } from '@mastra/core/workflows';
|
|
68
|
+
import {
|
|
69
|
+
ProcessorStepSchema,
|
|
70
|
+
} from '@mastra/core/processors';
|
|
34
71
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- Scores: `listScoresBySpan()`, `listScoresByRunId()`, `listScoresByExecutionId()`
|
|
40
|
-
- HTTP query parser accepts `"false"` string (e.g., `?perPage=false`)
|
|
72
|
+
const moderationWorkflow = createWorkflow({ id: 'moderation', inputSchema: ProcessorStepSchema, outputSchema: ProcessorStepSchema })
|
|
73
|
+
.then(createStep(new lengthValidator({...})))
|
|
74
|
+
.parallel([createStep(new piiDetector({...}), createStep(new toxicityChecker({...}))])
|
|
75
|
+
.commit();
|
|
41
76
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- Uses flat parameters (`page`, `perPage`, `include`, `filter`, `vectorSearchString`) instead of `selectBy` object
|
|
77
|
+
const agent = new Agent({ inputProcessors: [moderationWorkflow] });
|
|
78
|
+
```
|
|
45
79
|
|
|
46
|
-
|
|
47
|
-
|
|
80
|
+
Every processor array that gets passed to an agent gets added as a workflow
|
|
81
|
+
<img width="614" height="673" alt="image" src="https://github.com/user-attachments/assets/0d79f1fd-8fca-4d86-8b45-22fddea984a8" />
|
|
48
82
|
|
|
49
|
-
**
|
|
83
|
+
**3. Extended tripwire API** - `abort()` now accepts options for retry control and typed metadata:
|
|
50
84
|
|
|
51
85
|
```typescript
|
|
52
|
-
|
|
53
|
-
- storage.getMessagesPaginated({ threadId, selectBy: { pagination: { page: 0, perPage: 20 } } })
|
|
54
|
-
+ storage.listMessages({ threadId, page: 0, perPage: 20 })
|
|
55
|
-
+ storage.listMessages({ threadId, page: 0, perPage: false }) // Fetch all
|
|
56
|
-
|
|
57
|
-
// Memory: Replace selectBy with flat parameters
|
|
58
|
-
- memory.query({ threadId, selectBy: { last: 20, include: [...] } })
|
|
59
|
-
+ memory.query({ threadId, perPage: 20, include: [...] })
|
|
60
|
-
|
|
61
|
-
// Client SDK
|
|
62
|
-
- thread.getMessagesPaginated({ selectBy: { pagination: { page: 0 } } })
|
|
63
|
-
+ thread.listMessages({ page: 0, perPage: 20 })
|
|
86
|
+
abort('reason', { retry: true, metadata: { score: 0.8, category: 'quality' } });
|
|
64
87
|
```
|
|
65
88
|
|
|
66
|
-
-
|
|
89
|
+
**4. New `processOutputStep` method** - Per-step output processing with access to step number, finish reason, tool calls, and retry count.
|
|
90
|
+
|
|
91
|
+
**5. Workflow tripwire status** - Workflows now have a `'tripwire'` status distinct from `'failed'`, properly bubbling up processor rejections.
|
|
67
92
|
|
|
68
|
-
|
|
93
|
+
## 1.0.0-beta.10
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
69
96
|
|
|
70
|
-
|
|
97
|
+
- Add support for typed structured output in agent workflow steps ([#11014](https://github.com/mastra-ai/mastra/pull/11014))
|
|
71
98
|
|
|
72
|
-
|
|
99
|
+
When wrapping an agent with `createStep()` and providing a `structuredOutput.schema`, the step's `outputSchema` is now correctly inferred from the provided schema instead of defaulting to `{ text: string }`.
|
|
73
100
|
|
|
74
|
-
|
|
101
|
+
This enables type-safe chaining of agent steps with structured output to subsequent steps:
|
|
75
102
|
|
|
76
103
|
```typescript
|
|
77
|
-
|
|
78
|
-
|
|
104
|
+
const articleSchema = z.object({
|
|
105
|
+
title: z.string(),
|
|
106
|
+
summary: z.string(),
|
|
107
|
+
tags: z.array(z.string()),
|
|
108
|
+
});
|
|
79
109
|
|
|
80
|
-
//
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
110
|
+
// Agent step with structured output - outputSchema is now articleSchema
|
|
111
|
+
const agentStep = createStep(agent, {
|
|
112
|
+
structuredOutput: { schema: articleSchema },
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// Next step can receive the structured output directly
|
|
116
|
+
const processStep = createStep({
|
|
117
|
+
id: 'process',
|
|
118
|
+
inputSchema: articleSchema, // Matches agent's outputSchema
|
|
119
|
+
outputSchema: z.object({ tagCount: z.number() }),
|
|
120
|
+
execute: async ({ inputData }) => ({
|
|
121
|
+
tagCount: inputData.tags.length, // Fully typed!
|
|
122
|
+
}),
|
|
85
123
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
console.log(result.hasMore); // Whether more pages exist
|
|
124
|
+
|
|
125
|
+
workflow.then(agentStep).then(processStep).commit();
|
|
89
126
|
```
|
|
90
127
|
|
|
91
|
-
|
|
128
|
+
When `structuredOutput` is not provided, the agent step continues to use the default `{ text: string }` output schema.
|
|
92
129
|
|
|
93
|
-
|
|
130
|
+
- Fixed a bug where multiple tools streaming output simultaneously could fail with "WritableStreamDefaultWriter is locked" errors. Tool streaming now works reliably during concurrent tool executions. ([#10830](https://github.com/mastra-ai/mastra/pull/10830))
|
|
94
131
|
|
|
95
|
-
|
|
132
|
+
- Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
|
|
96
133
|
|
|
97
134
|
```typescript
|
|
98
|
-
|
|
99
|
-
threadId: 'thread-1',
|
|
100
|
-
orderBy: { field: 'createdAt', direction: 'DESC' },
|
|
101
|
-
});
|
|
135
|
+
await workflow.deleteWorkflowRunById(runId);
|
|
102
136
|
```
|
|
103
137
|
|
|
104
|
-
|
|
138
|
+
- Fixed CachedToken tracking in all Observability Exporters. Also fixed TimeToFirstToken in Langfuse, Braintrust, PostHog exporters. Fixed trace formatting in Posthog Exporter. ([#11029](https://github.com/mastra-ai/mastra/pull/11029))
|
|
139
|
+
|
|
140
|
+
- fix: persist data-\* chunks from writer.custom() to memory storage ([#10884](https://github.com/mastra-ai/mastra/pull/10884))
|
|
141
|
+
- Add persistence for custom data chunks (`data-*` parts) emitted via `writer.custom()` in tools
|
|
142
|
+
- Data chunks are now saved to message storage so they survive page refreshes
|
|
143
|
+
- Update `@assistant-ui/react` to v0.11.47 with native `DataMessagePart` support
|
|
144
|
+
- Convert `data-*` parts to `DataMessagePart` format (`{ type: 'data', name: string, data: T }`)
|
|
145
|
+
- Update related `@assistant-ui/*` packages for compatibility
|
|
146
|
+
|
|
147
|
+
- Fixed double validation bug that prevented Zod transforms from working correctly in tool schemas. ([#11025](https://github.com/mastra-ai/mastra/pull/11025))
|
|
148
|
+
|
|
149
|
+
When tools with Zod `.transform()` or `.pipe()` in their `outputSchema` were executed through the Agent pipeline, validation was happening twice - once in Tool.execute() (correct) and again in CoreToolBuilder (incorrect). The second validation received already-transformed data but expected pre-transform data, causing validation errors.
|
|
150
|
+
|
|
151
|
+
This fix enables proper use of Zod transforms in both `inputSchema` (for normalizing/cleaning input data) and `outputSchema` (for transforming output data to be LLM-friendly).
|
|
152
|
+
|
|
153
|
+
- Updated dependencies [[`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932)]:
|
|
154
|
+
- @mastra/observability@1.0.0-beta.4
|
|
105
155
|
|
|
106
|
-
|
|
156
|
+
## 1.0.0-beta.9
|
|
107
157
|
|
|
108
|
-
|
|
158
|
+
### Minor Changes
|
|
159
|
+
|
|
160
|
+
- Add stored agents support ([#10953](https://github.com/mastra-ai/mastra/pull/10953))
|
|
161
|
+
|
|
162
|
+
Agents can now be stored in the database and loaded at runtime. This lets you persist agent configurations and dynamically create executable Agent instances from storage.
|
|
109
163
|
|
|
110
164
|
```typescript
|
|
111
|
-
|
|
112
|
-
|
|
165
|
+
import { Mastra } from '@mastra/core';
|
|
166
|
+
import { LibSQLStore } from '@mastra/libsql';
|
|
167
|
+
|
|
168
|
+
const mastra = new Mastra({
|
|
169
|
+
storage: new LibSQLStore({ url: ':memory:' }),
|
|
170
|
+
tools: { myTool },
|
|
171
|
+
scorers: { myScorer },
|
|
172
|
+
});
|
|
113
173
|
|
|
114
|
-
//
|
|
115
|
-
|
|
174
|
+
// Create agent in storage via API or directly
|
|
175
|
+
await mastra.getStorage().createAgent({
|
|
176
|
+
agent: {
|
|
177
|
+
id: 'my-agent',
|
|
178
|
+
name: 'My Agent',
|
|
179
|
+
instructions: 'You are helpful',
|
|
180
|
+
model: { provider: 'openai', name: 'gpt-4' },
|
|
181
|
+
tools: { myTool: {} },
|
|
182
|
+
scorers: { myScorer: { sampling: { type: 'ratio', rate: 0.5 } } },
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// Load and use the agent
|
|
187
|
+
const agent = await mastra.getStoredAgentById('my-agent');
|
|
188
|
+
const response = await agent.generate({ messages: 'Hello!' });
|
|
189
|
+
|
|
190
|
+
// List all stored agents with pagination
|
|
191
|
+
const { agents, total, hasMore } = await mastra.listStoredAgents({
|
|
192
|
+
page: 0,
|
|
193
|
+
perPage: 10,
|
|
194
|
+
});
|
|
116
195
|
```
|
|
117
196
|
|
|
118
|
-
|
|
197
|
+
Also adds a memory registry to Mastra so stored agents can reference memory instances by key.
|
|
198
|
+
|
|
199
|
+
### Patch Changes
|
|
200
|
+
|
|
201
|
+
- Add agentId and agentName attributes to MODEL_GENERATION spans. This allows users to correlate gen_ai.usage metrics with specific agents when analyzing LLM operation spans. The attributes are exported as gen_ai.agent.id and gen_ai.agent.name in the OtelExporter. ([#10984](https://github.com/mastra-ai/mastra/pull/10984))
|
|
202
|
+
|
|
203
|
+
- Fix JSON parsing errors when LLMs output unescaped newlines in structured output strings ([#10965](https://github.com/mastra-ai/mastra/pull/10965))
|
|
204
|
+
|
|
205
|
+
Some LLMs (particularly when not using native JSON mode) output actual newline characters inside JSON string values instead of properly escaped `\n` sequences. This breaks JSON parsing and causes structured output to fail.
|
|
119
206
|
|
|
120
|
-
|
|
207
|
+
This change adds preprocessing to escape unescaped control characters (`\n`, `\r`, `\t`) within JSON string values before parsing, making structured output more robust across different LLM providers.
|
|
121
208
|
|
|
122
|
-
|
|
209
|
+
- Fix toolCallId propagation in agent network tool execution. The toolCallId property was undefined at runtime despite being required by TypeScript type definitions in AgentToolExecutionContext. Now properly passes the toolCallId through to the tool's context during network tool execution. ([#10951](https://github.com/mastra-ai/mastra/pull/10951))
|
|
123
210
|
|
|
124
|
-
|
|
211
|
+
- Exports `convertFullStreamChunkToMastra` from the stream module for AI SDK stream chunk transformations. ([#10911](https://github.com/mastra-ai/mastra/pull/10911))
|
|
212
|
+
|
|
213
|
+
## 1.0.0-beta.8
|
|
214
|
+
|
|
215
|
+
### Patch Changes
|
|
216
|
+
|
|
217
|
+
- Fix saveScore not persisting ID correctly, breaking getScoreById retrieval ([#10915](https://github.com/mastra-ai/mastra/pull/10915))
|
|
218
|
+
|
|
219
|
+
**What Changed**
|
|
220
|
+
- saveScore now correctly returns scores that can be retrieved with getScoreById
|
|
221
|
+
- Validation errors now include contextual information (scorer, entity, trace details) for easier debugging
|
|
222
|
+
|
|
223
|
+
**Impact**
|
|
224
|
+
Previously, calling getScoreById after saveScore would return null because the generated ID wasn't persisted to the database. This is now fixed across all store implementations, ensuring consistent behavior and data integrity.
|
|
225
|
+
|
|
226
|
+
- `setState` is now async ([#10944](https://github.com/mastra-ai/mastra/pull/10944))
|
|
227
|
+
- `setState` must now be awaited: `await setState({ key: value })`
|
|
228
|
+
- State updates are merged automatically—no need to spread the previous state
|
|
229
|
+
- State data is validated against the step's `stateSchema` when `validateInputs` is enabled (default: `true`)
|
|
230
|
+
|
|
231
|
+
- Add human-in-the-loop support for workflows used in agent ([#10871](https://github.com/mastra-ai/mastra/pull/10871))
|
|
232
|
+
|
|
233
|
+
## 1.0.0-beta.7
|
|
234
|
+
|
|
235
|
+
### Minor Changes
|
|
236
|
+
|
|
237
|
+
- Add `disableInit` option to all storage adapters ([#10851](https://github.com/mastra-ai/mastra/pull/10851))
|
|
238
|
+
|
|
239
|
+
Adds a new `disableInit` config option to all storage providers that allows users to disable automatic table creation/migrations at runtime. This is useful for CI/CD pipelines where you want to run migrations during deployment with elevated credentials, then run the application with `disableInit: true` so it doesn't attempt schema changes at runtime.
|
|
125
240
|
|
|
126
241
|
```typescript
|
|
127
|
-
//
|
|
128
|
-
|
|
242
|
+
// CI/CD script - run migrations
|
|
243
|
+
const storage = new PostgresStore({
|
|
244
|
+
connectionString: DATABASE_URL,
|
|
245
|
+
id: 'pg-storage',
|
|
246
|
+
});
|
|
247
|
+
await storage.init();
|
|
248
|
+
|
|
249
|
+
// Runtime - skip auto-init
|
|
250
|
+
const storage = new PostgresStore({
|
|
251
|
+
connectionString: DATABASE_URL,
|
|
252
|
+
id: 'pg-storage',
|
|
253
|
+
disableInit: true,
|
|
254
|
+
});
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Patch Changes
|
|
129
258
|
|
|
130
|
-
|
|
131
|
-
|
|
259
|
+
- Add time-to-first-token (TTFT) support for Langfuse integration ([#10781](https://github.com/mastra-ai/mastra/pull/10781))
|
|
260
|
+
|
|
261
|
+
Adds `completionStartTime` to model generation spans, which Langfuse uses to calculate TTFT metrics. The timestamp is automatically captured when the first content chunk arrives during streaming.
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
// completionStartTime is now automatically captured and sent to Langfuse
|
|
265
|
+
// enabling TTFT metrics in your Langfuse dashboard
|
|
266
|
+
const result = await agent.stream('Hello');
|
|
132
267
|
```
|
|
133
268
|
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
|
|
269
|
+
- Updated OtelExporters, Bridge, and Arize packages to better implement GenAI v1.38.0 Otel Semantic Conventions. See: ([#10591](https://github.com/mastra-ai/mastra/pull/10591))
|
|
270
|
+
https://github.com/open-telemetry/semantic-conventions/blob/v1.38.0/docs/gen-ai/README.md
|
|
271
|
+
|
|
272
|
+
- Standardize error IDs across all storage and vector stores using centralized helper functions (`createStorageErrorId` and `createVectorErrorId`). This ensures consistent error ID patterns (`MASTRA_STORAGE_{STORE}_{OPERATION}_{STATUS}` and `MASTRA_VECTOR_{STORE}_{OPERATION}_{STATUS}`) across the codebase for better error tracking and debugging. ([#10913](https://github.com/mastra-ai/mastra/pull/10913))
|
|
137
273
|
|
|
138
|
-
|
|
139
|
-
- getDefaultGenerateOptions → getDefaultGenerateOptionsLegacy
|
|
140
|
-
- getDefaultStreamOptions → getDefaultStreamOptionsLegacy
|
|
141
|
-
- getDefaultVNextStreamOptions → getDefaultStreamOptions
|
|
274
|
+
- fix: generate unique text IDs for Anthropic/Google providers ([#10740](https://github.com/mastra-ai/mastra/pull/10740))
|
|
142
275
|
|
|
143
|
-
|
|
276
|
+
Workaround for duplicate text-start/text-end IDs in multi-step agentic flows.
|
|
144
277
|
|
|
145
|
-
-
|
|
278
|
+
The `@ai-sdk/anthropic` and `@ai-sdk/google` providers use numeric indices ("0", "1", etc.) for text block IDs that reset for each LLM call. This caused duplicate IDs when an agent does TEXT → TOOL → TEXT, breaking message ordering and storage.
|
|
146
279
|
|
|
147
|
-
|
|
280
|
+
The fix replaces numeric IDs with UUIDs, maintaining a map per step so text-start, text-delta, and text-end chunks for the same block share the same UUID. OpenAI's UUIDs pass through unchanged.
|
|
148
281
|
|
|
149
|
-
|
|
282
|
+
Related: #9909
|
|
150
283
|
|
|
151
|
-
|
|
284
|
+
- Fix sub-agent requestContext propagation in listAgentTools ([#10844](https://github.com/mastra-ai/mastra/pull/10844))
|
|
285
|
+
|
|
286
|
+
Sub-agents with dynamic model configurations were broken because `requestContext` was not being passed to `getModel()` when creating agent tools. This caused sub-agents using function-based model configurations to receive an empty context instead of the parent's context.
|
|
287
|
+
|
|
288
|
+
No code changes required for consumers - this fix restores expected behavior for dynamic model configurations in sub-agents.
|
|
289
|
+
|
|
290
|
+
- Fix ToolStream type error when piping streams with different types ([#10845](https://github.com/mastra-ai/mastra/pull/10845))
|
|
291
|
+
|
|
292
|
+
Changes `ToolStream` to extend `WritableStream<unknown>` instead of `WritableStream<T>`. This fixes the TypeScript error when piping `objectStream` or `fullStream` to `writer` in workflow steps.
|
|
293
|
+
|
|
294
|
+
Before:
|
|
152
295
|
|
|
153
296
|
```typescript
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
tool.execute(data);
|
|
297
|
+
// TypeError: ToolStream<ChunkType> is not assignable to WritableStream<Partial<StoryPlan>>
|
|
298
|
+
await response.objectStream.pipeTo(writer);
|
|
299
|
+
```
|
|
158
300
|
|
|
159
|
-
|
|
160
|
-
|
|
301
|
+
After:
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
// Works without type errors
|
|
305
|
+
await response.objectStream.pipeTo(writer);
|
|
161
306
|
```
|
|
162
307
|
|
|
308
|
+
- feat: add native Perplexity provider support ([#10885](https://github.com/mastra-ai/mastra/pull/10885))
|
|
309
|
+
|
|
310
|
+
- When sending the first message to a new thread with PostgresStore, users would get a "Thread not found" error. This happened because the thread was created in memory but not persisted to the database before the MessageHistory output processor tried to save messages. ([#10881](https://github.com/mastra-ai/mastra/pull/10881))
|
|
311
|
+
|
|
163
312
|
**Before:**
|
|
164
313
|
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
314
|
+
```ts
|
|
315
|
+
threadObject = await memory.createThread({
|
|
316
|
+
// ...
|
|
317
|
+
saveThread: false, // thread not in DB yet
|
|
318
|
+
});
|
|
319
|
+
// Later: MessageHistory calls saveMessages() -> PostgresStore throws "Thread not found"
|
|
170
320
|
```
|
|
171
321
|
|
|
172
322
|
**After:**
|
|
173
323
|
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (agent) {
|
|
181
|
-
doSomething(inputData.something, agent)
|
|
182
|
-
// context that only a workflow would get like runId, state, suspend, resume, etc
|
|
183
|
-
} else if (workflow) {
|
|
184
|
-
doSomething(inputData.something, workflow)
|
|
185
|
-
// context that only a workflow would get like "extra", "elicitation"
|
|
186
|
-
} else if (mcp) {
|
|
187
|
-
doSomething(inputData.something, mcp)
|
|
188
|
-
} else {
|
|
189
|
-
// Running a tool in no execution context
|
|
190
|
-
return doSomething(inputData.something);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
324
|
+
```ts
|
|
325
|
+
threadObject = await memory.createThread({
|
|
326
|
+
// ...
|
|
327
|
+
saveThread: true, // thread persisted immediately
|
|
328
|
+
});
|
|
329
|
+
// MessageHistory can now save messages without error
|
|
193
330
|
```
|
|
194
331
|
|
|
195
|
-
-
|
|
332
|
+
- Emit error chunk and call onError when agent workflow step fails ([#10907](https://github.com/mastra-ai/mastra/pull/10907))
|
|
196
333
|
|
|
197
|
-
|
|
334
|
+
When a workflow step fails (e.g., tool not found), the error is now properly emitted as an error chunk to the stream and the onError callback is called. This fixes the issue where agent.generate() would throw "promise 'text' was not resolved or rejected" instead of the actual error message.
|
|
198
335
|
|
|
199
|
-
|
|
200
|
-
import { Mastra, type Config } from "@mastra/core";
|
|
201
|
-
- import { Agent } from "@mastra/core";
|
|
202
|
-
- import { createTool } from "@mastra/core";
|
|
203
|
-
- import { createStep } from "@mastra/core";
|
|
336
|
+
- fix(core): use agent description when converting agent to tool ([#10879](https://github.com/mastra-ai/mastra/pull/10879))
|
|
204
337
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
338
|
+
- Adds native @ai-sdk/deepseek provider support instead of using the OpenAI-compatible fallback. ([#10822](https://github.com/mastra-ai/mastra/pull/10822))
|
|
339
|
+
|
|
340
|
+
```typescript
|
|
341
|
+
const agent = new Agent({
|
|
342
|
+
model: 'deepseek/deepseek-reasoner',
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// With provider options for reasoning
|
|
346
|
+
const response = await agent.generate('Solve this problem', {
|
|
347
|
+
providerOptions: {
|
|
348
|
+
deepseek: {
|
|
349
|
+
thinking: { type: 'enabled' },
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
});
|
|
208
353
|
```
|
|
209
354
|
|
|
210
|
-
|
|
355
|
+
Also updates the doc generation scripts so DeepSeek provider options show up in the generated docs.
|
|
211
356
|
|
|
212
|
-
|
|
357
|
+
- Return state too if `includeState: true` is in `outputOptions` and workflow run is not successful ([#10806](https://github.com/mastra-ai/mastra/pull/10806))
|
|
213
358
|
|
|
214
|
-
|
|
359
|
+
- feat: Add partial response support for agent and workflow list endpoints ([#10886](https://github.com/mastra-ai/mastra/pull/10886))
|
|
215
360
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
361
|
+
Add optional `partial` query parameter to `/api/agents` and `/api/workflows` endpoints to return minimal data without schemas, reducing payload size for list views:
|
|
362
|
+
- When `partial=true`: tool schemas (inputSchema, outputSchema) are omitted
|
|
363
|
+
- When `partial=true`: workflow steps are replaced with stepCount integer
|
|
364
|
+
- When `partial=true`: workflow root schemas (inputSchema, outputSchema) are omitted
|
|
365
|
+
- Maintains backward compatibility when partial parameter is not provided
|
|
366
|
+
|
|
367
|
+
## Server Endpoint Usage
|
|
368
|
+
|
|
369
|
+
```http
|
|
370
|
+
# Get partial agent data (no tool schemas)
|
|
371
|
+
GET /api/agents?partial=true
|
|
372
|
+
|
|
373
|
+
# Get full agent data (default behavior)
|
|
374
|
+
GET /api/agents
|
|
375
|
+
|
|
376
|
+
# Get partial workflow data (stepCount instead of steps, no schemas)
|
|
377
|
+
GET /api/workflows?partial=true
|
|
378
|
+
|
|
379
|
+
# Get full workflow data (default behavior)
|
|
380
|
+
GET /api/workflows
|
|
220
381
|
```
|
|
221
382
|
|
|
222
|
-
|
|
383
|
+
## Client SDK Usage
|
|
223
384
|
|
|
224
385
|
```typescript
|
|
225
|
-
|
|
226
|
-
|
|
386
|
+
import { MastraClient } from '@mastra/client-js';
|
|
387
|
+
|
|
388
|
+
const client = new MastraClient({ baseUrl: 'http://localhost:4111' });
|
|
389
|
+
|
|
390
|
+
// Get partial agent list (smaller payload)
|
|
391
|
+
const partialAgents = await client.listAgents({ partial: true });
|
|
392
|
+
|
|
393
|
+
// Get full agent list with tool schemas
|
|
394
|
+
const fullAgents = await client.listAgents();
|
|
395
|
+
|
|
396
|
+
// Get partial workflow list (smaller payload)
|
|
397
|
+
const partialWorkflows = await client.listWorkflows({ partial: true });
|
|
398
|
+
|
|
399
|
+
// Get full workflow list with steps and schemas
|
|
400
|
+
const fullWorkflows = await client.listWorkflows();
|
|
227
401
|
```
|
|
228
402
|
|
|
229
|
-
|
|
403
|
+
- Fix processInputStep so it runs correctly. ([#10909](https://github.com/mastra-ai/mastra/pull/10909))
|
|
230
404
|
|
|
231
|
-
-
|
|
405
|
+
- Updated dependencies [[`6c59a40`](https://github.com/mastra-ai/mastra/commit/6c59a40e0ad160467bd13d63a8a287028d75b02d), [`3076c67`](https://github.com/mastra-ai/mastra/commit/3076c6778b18988ae7d5c4c5c466366974b2d63f), [`0bada2f`](https://github.com/mastra-ai/mastra/commit/0bada2f2c1234932cf30c1c47a719ffb64b801c5), [`cc60ff6`](https://github.com/mastra-ai/mastra/commit/cc60ff616541a3b0fb531a7e469bf9ae7bb90528)]:
|
|
406
|
+
- @mastra/observability@1.0.0-beta.3
|
|
232
407
|
|
|
233
|
-
|
|
408
|
+
## 1.0.0-beta.6
|
|
234
409
|
|
|
235
|
-
|
|
410
|
+
### Major Changes
|
|
236
411
|
|
|
237
|
-
-
|
|
412
|
+
- Changed `.branch()` result schema to make all branch output fields optional. ([#10693](https://github.com/mastra-ai/mastra/pull/10693))
|
|
238
413
|
|
|
239
|
-
|
|
414
|
+
**Breaking change**: Branch outputs are now optional since only one branch executes at runtime. Update your workflow schemas to handle optional branch results.
|
|
240
415
|
|
|
241
|
-
|
|
416
|
+
**Before:**
|
|
242
417
|
|
|
243
|
-
|
|
418
|
+
```typescript
|
|
419
|
+
const workflow = createWorkflow({...})
|
|
420
|
+
.branch([
|
|
421
|
+
[condition1, stepA], // outputSchema: { result: z.string() }
|
|
422
|
+
[condition2, stepB], // outputSchema: { data: z.number() }
|
|
423
|
+
])
|
|
424
|
+
.map({
|
|
425
|
+
finalResult: { step: stepA, path: 'result' } // Expected non-optional
|
|
426
|
+
});
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
**After:**
|
|
430
|
+
|
|
431
|
+
```typescript
|
|
432
|
+
const workflow = createWorkflow({...})
|
|
433
|
+
.branch([
|
|
434
|
+
[condition1, stepA],
|
|
435
|
+
[condition2, stepB],
|
|
436
|
+
])
|
|
437
|
+
.map({
|
|
438
|
+
finalResult: {
|
|
439
|
+
step: stepA,
|
|
440
|
+
path: 'result' // Now optional - provide fallback
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
```
|
|
244
444
|
|
|
245
|
-
|
|
445
|
+
**Why**: Branch conditionals execute only one path, so non-executed branches don't produce outputs. The type system now correctly reflects this runtime behavior.
|
|
246
446
|
|
|
247
|
-
|
|
447
|
+
Related issue: https://github.com/mastra-ai/mastra/issues/10642
|
|
248
448
|
|
|
249
|
-
|
|
449
|
+
### Minor Changes
|
|
250
450
|
|
|
251
|
-
|
|
252
|
-
- Removed legacy v1 watch event handlers and types
|
|
253
|
-
- Renamed `watch-v2` to `watch` throughout the codebase
|
|
254
|
-
- Removed `.watch()` method from client-js SDK (`Workflow` and `AgentBuilder` classes)
|
|
255
|
-
- Removed `/watch` HTTP endpoints from server and deployer
|
|
256
|
-
- Removed `WorkflowWatchResult` and v1 `WatchEvent` types
|
|
451
|
+
- Memory system now uses processors. Memory processors (`MessageHistory`, `SemanticRecall`, `WorkingMemory`) are now exported from `@mastra/memory/processors` and automatically added to the agent pipeline based on your memory config. Core processors (`ToolCallFilter`, `TokenLimiter`) remain in `@mastra/core/processors`. ([#9254](https://github.com/mastra-ai/mastra/pull/9254))
|
|
257
452
|
|
|
258
|
-
-
|
|
259
|
-
- `agent.llm` → `agent.getLLM()`
|
|
260
|
-
- `agent.tools` → `agent.getTools()`
|
|
261
|
-
- `agent.instructions` → `agent.getInstructions()`
|
|
262
|
-
- `agent.speak()` → `agent.voice.speak()`
|
|
263
|
-
- `agent.getSpeakers()` → `agent.voice.getSpeakers()`
|
|
264
|
-
- `agent.listen` → `agent.voice.listen()`
|
|
265
|
-
- `agent.fetchMemory` → `(await agent.getMemory()).query()`
|
|
266
|
-
- `agent.toStep` → Add agent directly to the step, workflows handle the transformation
|
|
453
|
+
- Add reserved keys in RequestContext for secure resourceId/threadId setting from middleware ([#10657](https://github.com/mastra-ai/mastra/pull/10657))
|
|
267
454
|
|
|
268
|
-
|
|
455
|
+
This allows middleware to securely set `resourceId` and `threadId` via reserved keys in RequestContext (`MASTRA_RESOURCE_ID_KEY` and `MASTRA_THREAD_ID_KEY`), which take precedence over client-provided values for security.
|
|
269
456
|
|
|
270
|
-
|
|
457
|
+
- feat(workflows): add suspendData parameter to step execute function ([#10734](https://github.com/mastra-ai/mastra/pull/10734))
|
|
271
458
|
|
|
272
|
-
|
|
273
|
-
- `Memory.listThreadsByResourceId()`
|
|
274
|
-
- `Memory.listMessages()`
|
|
275
|
-
- `Storage.listWorkflowRuns()`
|
|
459
|
+
Adds a new `suspendData` parameter to workflow step execute functions that provides access to the data originally passed to `suspend()` when the step was suspended. This enables steps to access context about why they were suspended when they are later resumed.
|
|
276
460
|
|
|
277
|
-
**
|
|
461
|
+
**New Features:**
|
|
462
|
+
- `suspendData` parameter automatically populated in step execute function when resuming
|
|
463
|
+
- Type-safe access to suspend data matching the step's `suspendSchema`
|
|
464
|
+
- Backward compatible - existing workflows continue to work unchanged
|
|
465
|
+
|
|
466
|
+
**Example:**
|
|
278
467
|
|
|
279
468
|
```typescript
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
469
|
+
const step = createStep({
|
|
470
|
+
suspendSchema: z.object({ reason: z.string() }),
|
|
471
|
+
resumeSchema: z.object({ approved: z.boolean() }),
|
|
472
|
+
execute: async ({ suspend, suspendData, resumeData }) => {
|
|
473
|
+
if (!resumeData?.approved) {
|
|
474
|
+
return await suspend({ reason: 'Approval required' });
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// Access original suspend data when resuming
|
|
478
|
+
console.log(`Resuming after: ${suspendData?.reason}`);
|
|
479
|
+
return { result: 'Approved' };
|
|
480
|
+
},
|
|
285
481
|
});
|
|
482
|
+
```
|
|
286
483
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
});
|
|
484
|
+
- feat(storage): support querying messages from multiple threads ([#10663](https://github.com/mastra-ai/mastra/pull/10663))
|
|
485
|
+
- Fixed TypeScript errors where `threadId: string | string[]` was being passed to places expecting `Scalar` type
|
|
486
|
+
- Added proper multi-thread support for `listMessages` across all adapters when `threadId` is an array
|
|
487
|
+
- Updated `_getIncludedMessages` to look up message threadId by ID (since message IDs are globally unique)
|
|
488
|
+
- **upstash**: Added `msg-idx:{messageId}` index for O(1) message lookups (backwards compatible with fallback to scan for old messages, with automatic backfill)
|
|
293
489
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
});
|
|
490
|
+
- Adds trace tagging support to the BrainTrust and Langfuse tracing exporters. ([#10765](https://github.com/mastra-ai/mastra/pull/10765))
|
|
491
|
+
|
|
492
|
+
- Add `messageList` parameter to `processOutputStream` for accessing remembered messages during streaming ([#10608](https://github.com/mastra-ai/mastra/pull/10608))
|
|
493
|
+
|
|
494
|
+
- Unify transformScoreRow functions across storage adapters ([#10648](https://github.com/mastra-ai/mastra/pull/10648))
|
|
300
495
|
|
|
496
|
+
Added a unified `transformScoreRow` function in `@mastra/core/storage` that provides schema-driven row transformation for score data. This eliminates code duplication across 10 storage adapters while maintaining store-specific behavior through configurable options:
|
|
497
|
+
- `preferredTimestampFields`: Preferred source fields for timestamps (PostgreSQL, Cloudflare D1)
|
|
498
|
+
- `convertTimestamps`: Convert timestamp strings to Date objects (MSSQL, MongoDB, ClickHouse)
|
|
499
|
+
- `nullValuePattern`: Skip values matching pattern (ClickHouse's `'_null_'`)
|
|
500
|
+
- `fieldMappings`: Map source column names to schema fields (LibSQL's `additionalLLMContext`)
|
|
301
501
|
|
|
302
|
-
...
|
|
502
|
+
... 6146 more lines hidden. See full changelog in package directory.
|