@mastra/mcp-docs-server 1.0.0-beta.11 → 1.0.0-beta.14
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/%40mastra%2Fagent-builder.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +51 -51
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +180 -180
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +68 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +331 -331
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +24 -24
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +24 -24
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +96 -96
- package/.docs/organized/changelogs/%40mastra%2Frag.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Freact.md +49 -2
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +122 -122
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +39 -39
- package/.docs/organized/changelogs/create-mastra.md +31 -31
- package/.docs/organized/changelogs/mastra.md +51 -51
- package/.docs/organized/code-examples/agent-v6.md +151 -0
- package/.docs/organized/code-examples/ai-elements.md +1 -1
- package/.docs/organized/code-examples/quick-start.md +0 -4
- package/.docs/organized/code-examples/stock-price-tool.md +21 -2
- package/.docs/raw/agents/adding-voice.mdx +2 -3
- package/.docs/raw/agents/agent-approval.mdx +139 -6
- package/.docs/raw/agents/agent-memory.mdx +24 -32
- package/.docs/raw/agents/guardrails.mdx +61 -51
- package/.docs/raw/agents/networks.mdx +9 -13
- package/.docs/raw/agents/overview.mdx +40 -24
- package/.docs/raw/agents/processors.mdx +20 -19
- package/.docs/raw/agents/structured-output.mdx +11 -7
- package/.docs/raw/agents/using-tools.mdx +5 -6
- package/.docs/raw/course/01-first-agent/07-creating-your-agent.md +1 -2
- package/.docs/raw/course/01-first-agent/12-connecting-tool-to-agent.md +1 -1
- package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +1 -2
- package/.docs/raw/course/02-agent-tools-mcp/05-updating-your-agent.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/10-updating-agent-instructions-zapier.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/16-updating-agent-instructions-github.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/21-updating-agent-instructions-hackernews.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/27-updating-agent-instructions-filesystem.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +2 -2
- package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +1 -2
- package/.docs/raw/course/03-agent-memory/08-configuring-conversation-history.md +1 -2
- package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +3 -4
- package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +2 -3
- package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +2 -3
- package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +1 -2
- package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +2 -3
- package/.docs/raw/course/04-workflows/11-creating-an-ai-agent.md +2 -3
- package/.docs/raw/deployment/cloud-providers.mdx +20 -0
- package/.docs/raw/deployment/{building-mastra.mdx → mastra-server.mdx} +5 -5
- package/.docs/raw/deployment/monorepo.mdx +23 -44
- package/.docs/raw/deployment/overview.mdx +32 -50
- package/.docs/raw/deployment/web-framework.mdx +15 -19
- package/.docs/raw/evals/custom-scorers.mdx +9 -6
- package/.docs/raw/evals/overview.mdx +3 -6
- package/.docs/raw/evals/running-in-ci.mdx +2 -2
- package/.docs/raw/getting-started/manual-install.mdx +20 -20
- package/.docs/raw/getting-started/mcp-docs-server.mdx +2 -2
- package/.docs/raw/getting-started/start.mdx +10 -1
- package/.docs/raw/getting-started/studio.mdx +1 -1
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +4 -4
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +1033 -79
- package/.docs/raw/guides/build-your-ui/assistant-ui.mdx +8 -8
- package/.docs/raw/guides/build-your-ui/copilotkit.mdx +11 -11
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/amazon-ec2.mdx +9 -9
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/aws-lambda.mdx +13 -16
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/azure-app-services.mdx +5 -7
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/cloudflare-deployer.mdx +8 -5
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/digital-ocean.mdx +12 -15
- package/.docs/raw/guides/deployment/index.mdx +32 -0
- package/.docs/raw/guides/deployment/inngest.mdx +386 -0
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/netlify-deployer.mdx +7 -3
- package/.docs/raw/{deployment/cloud-providers → guides/deployment}/vercel-deployer.mdx +8 -5
- package/.docs/raw/guides/getting-started/astro.mdx +292 -451
- package/.docs/raw/guides/getting-started/express.mdx +72 -153
- package/.docs/raw/guides/getting-started/hono.mdx +227 -0
- package/.docs/raw/guides/getting-started/next-js.mdx +170 -61
- package/.docs/raw/guides/getting-started/quickstart.mdx +4 -4
- package/.docs/raw/guides/getting-started/sveltekit.mdx +238 -409
- package/.docs/raw/guides/getting-started/vite-react.mdx +317 -147
- package/.docs/raw/guides/guide/ai-recruiter.mdx +10 -10
- package/.docs/raw/guides/guide/chef-michel.mdx +9 -11
- package/.docs/raw/guides/guide/notes-mcp-server.mdx +15 -15
- package/.docs/raw/guides/guide/research-assistant.mdx +17 -17
- package/.docs/raw/guides/guide/stock-agent.mdx +5 -5
- package/.docs/raw/guides/guide/web-search.mdx +8 -8
- package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +7 -7
- package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +2 -2
- package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +1 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +17 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +6 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +0 -2
- package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +21 -23
- package/.docs/raw/index.mdx +2 -2
- package/.docs/raw/{deployment/mastra-cloud → mastra-cloud}/dashboard.mdx +2 -6
- package/.docs/raw/{deployment/mastra-cloud → mastra-cloud}/observability.mdx +1 -5
- package/.docs/raw/{deployment/mastra-cloud → mastra-cloud}/overview.mdx +2 -6
- package/.docs/raw/{deployment/mastra-cloud → mastra-cloud}/setting-up.mdx +8 -7
- package/.docs/raw/mcp/overview.mdx +31 -13
- package/.docs/raw/mcp/publishing-mcp-server.mdx +2 -2
- package/.docs/raw/memory/memory-processors.mdx +9 -9
- package/.docs/raw/memory/message-history.mdx +69 -0
- package/.docs/raw/memory/overview.mdx +34 -76
- package/.docs/raw/memory/semantic-recall.mdx +58 -49
- package/.docs/raw/memory/storage.mdx +188 -0
- package/.docs/raw/memory/working-memory.mdx +7 -7
- package/.docs/raw/observability/logging.mdx +10 -11
- package/.docs/raw/observability/overview.mdx +0 -1
- package/.docs/raw/observability/tracing/bridges/otel.mdx +2 -2
- package/.docs/raw/observability/tracing/exporters/cloud.mdx +1 -1
- package/.docs/raw/observability/tracing/exporters/default.mdx +3 -3
- package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -2
- package/.docs/raw/observability/tracing/overview.mdx +23 -25
- package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +3 -3
- package/.docs/raw/rag/chunking-and-embedding.mdx +18 -31
- package/.docs/raw/rag/graph-rag.mdx +220 -0
- package/.docs/raw/rag/overview.mdx +2 -3
- package/.docs/raw/rag/retrieval.mdx +34 -51
- package/.docs/raw/rag/vector-databases.mdx +29 -25
- package/.docs/raw/reference/agents/agent.mdx +3 -3
- package/.docs/raw/reference/agents/generate.mdx +1 -1
- package/.docs/raw/reference/agents/generateLegacy.mdx +2 -2
- package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +3 -3
- package/.docs/raw/reference/agents/getDefaultOptions.mdx +3 -3
- package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +3 -3
- package/.docs/raw/reference/agents/getDescription.mdx +1 -1
- package/.docs/raw/reference/agents/getInstructions.mdx +3 -3
- package/.docs/raw/reference/agents/getLLM.mdx +3 -3
- package/.docs/raw/reference/agents/getMemory.mdx +3 -3
- package/.docs/raw/reference/agents/getModel.mdx +3 -3
- package/.docs/raw/reference/agents/getTools.mdx +2 -2
- package/.docs/raw/reference/agents/getVoice.mdx +2 -2
- package/.docs/raw/reference/agents/listAgents.mdx +2 -2
- package/.docs/raw/reference/agents/listScorers.mdx +3 -3
- package/.docs/raw/reference/agents/listTools.mdx +2 -2
- package/.docs/raw/reference/agents/listWorkflows.mdx +2 -2
- package/.docs/raw/reference/agents/network.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +2 -2
- package/.docs/raw/reference/ai-sdk/network-route.mdx +3 -3
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +6 -6
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +127 -0
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +107 -0
- package/.docs/raw/reference/ai-sdk/with-mastra.mdx +1 -1
- package/.docs/raw/reference/ai-sdk/workflow-route.mdx +3 -3
- package/.docs/raw/reference/auth/auth0.mdx +2 -3
- package/.docs/raw/reference/auth/clerk.mdx +2 -3
- package/.docs/raw/reference/auth/firebase.mdx +3 -5
- package/.docs/raw/reference/auth/jwt.mdx +2 -3
- package/.docs/raw/reference/auth/supabase.mdx +2 -3
- package/.docs/raw/reference/auth/workos.mdx +2 -3
- package/.docs/raw/reference/cli/create-mastra.mdx +10 -10
- package/.docs/raw/reference/cli/mastra.mdx +10 -10
- package/.docs/raw/reference/client-js/agents.mdx +1 -2
- package/.docs/raw/reference/client-js/mastra-client.mdx +2 -2
- package/.docs/raw/reference/client-js/workflows.mdx +20 -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/getLogger.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServer.mdx +1 -1
- package/.docs/raw/reference/core/getMCPServerById.mdx +1 -1
- package/.docs/raw/reference/core/getMemory.mdx +2 -2
- package/.docs/raw/reference/core/getServer.mdx +3 -3
- package/.docs/raw/reference/core/getStorage.mdx +2 -2
- package/.docs/raw/reference/core/getStoredAgentById.mdx +3 -3
- 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/listLogs.mdx +1 -1
- package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
- package/.docs/raw/reference/core/listMCPServers.mdx +1 -1
- package/.docs/raw/reference/core/listMemory.mdx +2 -2
- package/.docs/raw/reference/core/listStoredAgents.mdx +4 -4
- package/.docs/raw/reference/core/listVectors.mdx +1 -1
- package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
- package/.docs/raw/reference/core/setLogger.mdx +1 -1
- package/.docs/raw/reference/core/setStorage.mdx +2 -2
- package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
- package/.docs/raw/reference/deployer/cloudflare.mdx +1 -2
- package/.docs/raw/reference/deployer/deployer.mdx +0 -1
- package/.docs/raw/reference/deployer/netlify.mdx +1 -1
- package/.docs/raw/reference/deployer/vercel.mdx +2 -4
- package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
- package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/bias.mdx +1 -1
- package/.docs/raw/reference/evals/completeness.mdx +1 -1
- package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
- package/.docs/raw/reference/evals/context-precision.mdx +1 -1
- package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
- package/.docs/raw/reference/evals/hallucination.mdx +1 -1
- package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
- package/.docs/raw/reference/evals/prompt-alignment.mdx +7 -7
- package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
- package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
- package/.docs/raw/reference/evals/tool-call-accuracy.mdx +10 -10
- package/.docs/raw/reference/evals/toxicity.mdx +1 -1
- package/.docs/raw/reference/logging/pino-logger.mdx +7 -8
- package/.docs/raw/reference/memory/createThread.mdx +2 -2
- package/.docs/raw/reference/memory/deleteMessages.mdx +2 -2
- package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +2 -2
- package/.docs/raw/reference/memory/memory-class.mdx +3 -3
- package/.docs/raw/reference/memory/query.mdx +2 -2
- package/.docs/raw/reference/memory/recall.mdx +2 -2
- package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +2 -2
- package/.docs/raw/reference/processors/language-detector.mdx +2 -2
- package/.docs/raw/reference/processors/message-history-processor.mdx +2 -2
- package/.docs/raw/reference/processors/moderation-processor.mdx +3 -3
- package/.docs/raw/reference/processors/pii-detector.mdx +3 -3
- package/.docs/raw/reference/processors/processor-interface.mdx +13 -13
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +2 -2
- package/.docs/raw/reference/processors/semantic-recall-processor.mdx +2 -2
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +2 -2
- package/.docs/raw/reference/processors/tool-call-filter.mdx +3 -3
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +2 -2
- package/.docs/raw/reference/processors/working-memory-processor.mdx +3 -3
- package/.docs/raw/reference/rag/chunk.mdx +1 -1
- package/.docs/raw/reference/rag/database-config.mdx +1 -1
- package/.docs/raw/reference/rag/extract-params.mdx +2 -2
- package/.docs/raw/reference/rag/metadata-filters.mdx +7 -7
- package/.docs/raw/reference/server/create-route.mdx +14 -14
- package/.docs/raw/reference/server/express-adapter.mdx +10 -11
- package/.docs/raw/reference/server/hono-adapter.mdx +10 -11
- package/.docs/raw/reference/server/mastra-server.mdx +22 -22
- package/.docs/raw/reference/server/routes.mdx +28 -1
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +3 -3
- package/.docs/raw/reference/storage/cloudflare.mdx +2 -2
- package/.docs/raw/reference/storage/convex.mdx +6 -6
- package/.docs/raw/reference/storage/dynamodb.mdx +4 -4
- package/.docs/raw/reference/storage/lance.mdx +3 -3
- package/.docs/raw/reference/storage/libsql.mdx +69 -54
- package/.docs/raw/reference/storage/mongodb.mdx +80 -7
- package/.docs/raw/reference/storage/mssql.mdx +4 -4
- package/.docs/raw/{server-db/storage.mdx → reference/storage/overview.mdx} +13 -111
- package/.docs/raw/reference/storage/postgresql.mdx +78 -7
- package/.docs/raw/reference/storage/upstash.mdx +74 -2
- package/.docs/raw/reference/streaming/agents/stream.mdx +27 -5
- package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +2 -2
- package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/resumeStream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +35 -22
- package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +4 -4
- package/.docs/raw/reference/templates/overview.mdx +1 -2
- package/.docs/raw/reference/tools/create-tool.mdx +24 -5
- package/.docs/raw/reference/tools/graph-rag-tool.mdx +3 -3
- package/.docs/raw/reference/tools/vector-query-tool.mdx +4 -4
- package/.docs/raw/reference/vectors/astra.mdx +3 -3
- package/.docs/raw/reference/vectors/chroma.mdx +3 -3
- package/.docs/raw/reference/vectors/convex.mdx +12 -12
- package/.docs/raw/reference/vectors/couchbase.mdx +5 -5
- package/.docs/raw/reference/vectors/duckdb.mdx +10 -10
- package/.docs/raw/reference/vectors/elasticsearch.mdx +4 -4
- package/.docs/raw/reference/vectors/lance.mdx +4 -4
- package/.docs/raw/reference/vectors/libsql.mdx +61 -11
- package/.docs/raw/reference/vectors/mongodb.mdx +58 -5
- package/.docs/raw/reference/vectors/pg.mdx +53 -6
- package/.docs/raw/reference/vectors/pinecone.mdx +3 -3
- package/.docs/raw/reference/vectors/qdrant.mdx +3 -3
- package/.docs/raw/reference/vectors/s3vectors.mdx +6 -6
- package/.docs/raw/reference/vectors/turbopuffer.mdx +4 -4
- package/.docs/raw/reference/vectors/upstash.mdx +55 -6
- package/.docs/raw/reference/vectors/vectorize.mdx +3 -3
- package/.docs/raw/reference/workflows/run-methods/cancel.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/restart.mdx +1 -3
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/start.mdx +2 -2
- package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +143 -0
- package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +5 -5
- package/.docs/raw/reference/workflows/run.mdx +1 -1
- package/.docs/raw/reference/workflows/step.mdx +3 -3
- 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 +37 -2
- 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 +6 -6
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +7 -7
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow.mdx +17 -3
- package/.docs/raw/{auth → server/auth}/auth0.mdx +20 -14
- package/.docs/raw/{auth → server/auth}/clerk.mdx +16 -9
- package/.docs/raw/{auth → server/auth}/firebase.mdx +21 -15
- package/.docs/raw/{auth → server/auth}/index.mdx +6 -6
- package/.docs/raw/{auth → server/auth}/jwt.mdx +14 -7
- package/.docs/raw/{auth → server/auth}/supabase.mdx +16 -9
- package/.docs/raw/{auth → server/auth}/workos.mdx +19 -13
- package/.docs/raw/{server-db → server}/custom-adapters.mdx +13 -13
- package/.docs/raw/{server-db → server}/custom-api-routes.mdx +3 -5
- package/.docs/raw/{server-db → server}/mastra-client.mdx +26 -15
- package/.docs/raw/{server-db → server}/mastra-server.mdx +8 -8
- package/.docs/raw/{server-db → server}/middleware.mdx +9 -9
- package/.docs/raw/{server-db → server}/request-context.mdx +33 -32
- package/.docs/raw/{server-db → server}/server-adapters.mdx +12 -12
- package/.docs/raw/streaming/events.mdx +14 -7
- package/.docs/raw/streaming/overview.mdx +21 -10
- package/.docs/raw/streaming/tool-streaming.mdx +6 -6
- package/.docs/raw/streaming/workflow-streaming.mdx +6 -8
- package/.docs/raw/tools-mcp/advanced-usage.mdx +2 -2
- package/.docs/raw/tools-mcp/mcp-overview.mdx +31 -12
- package/.docs/raw/tools-mcp/overview.mdx +10 -11
- package/.docs/raw/voice/overview.mdx +1 -1
- package/.docs/raw/workflows/agents-and-tools.mdx +28 -19
- package/.docs/raw/workflows/control-flow.mdx +27 -40
- package/.docs/raw/workflows/error-handling.mdx +172 -18
- package/.docs/raw/workflows/human-in-the-loop.mdx +6 -7
- package/.docs/raw/workflows/inngest-workflow.mdx +8 -9
- package/.docs/raw/workflows/input-data-mapping.mdx +7 -7
- package/.docs/raw/workflows/overview.mdx +34 -23
- package/.docs/raw/workflows/snapshots.mdx +14 -44
- package/.docs/raw/workflows/suspend-and-resume.mdx +7 -7
- package/.docs/raw/workflows/time-travel.mdx +16 -16
- package/.docs/raw/workflows/workflow-state.mdx +5 -8
- package/CHANGELOG.md +23 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/stdio.js +53 -0
- package/package.json +4 -4
- package/.docs/organized/changelogs/%40internal%2Fai-sdk-v4.md +0 -1
- package/.docs/raw/deployment/cloud-providers/index.mdx +0 -55
- package/.docs/raw/memory/conversation-history.mdx +0 -24
- package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
- package/.docs/raw/memory/storage/memory-with-mongodb.mdx +0 -150
- package/.docs/raw/memory/storage/memory-with-pg.mdx +0 -138
- package/.docs/raw/memory/storage/memory-with-upstash.mdx +0 -146
- package/.docs/raw/memory/threads-and-resources.mdx +0 -95
|
@@ -1,502 +1,502 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
-
## 1.0.0-beta.
|
|
3
|
+
## 1.0.0-beta.14
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- Add support for AI SDK v6 (LanguageModelV3) ([#11191](https://github.com/mastra-ai/mastra/pull/11191))
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Agents can now use `LanguageModelV3` models from AI SDK v6 beta providers like `@ai-sdk/openai@^3.0.0-beta`.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**New features:**
|
|
12
|
+
- Usage normalization: V3's nested usage format is normalized to Mastra's flat format with `reasoningTokens`, `cachedInputTokens`, and raw data preserved in a `raw` field
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
**Backward compatible:** All existing V1 and V2 models continue to work unchanged.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
### Patch Changes
|
|
16
17
|
|
|
17
|
-
-
|
|
18
|
+
- Fix model-level and runtime header support for LLM calls ([#11275](https://github.com/mastra-ai/mastra/pull/11275))
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
import { Mastra } from '@mastra/core';
|
|
20
|
+
This fixes a bug where custom headers configured on models (like `anthropic-beta`) were not being passed through to the underlying AI SDK calls. The fix properly handles headers from multiple sources with correct priority:
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
**Header Priority (low to high):**
|
|
23
|
+
1. Model config headers - Headers set in model configuration
|
|
24
|
+
2. ModelSettings headers - Runtime headers that override model config
|
|
25
|
+
3. Provider-level headers - Headers baked into AI SDK providers (not overridden)
|
|
26
|
+
|
|
27
|
+
**Examples that now work:**
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// Model config headers
|
|
31
|
+
new Agent({
|
|
32
|
+
model: {
|
|
33
|
+
id: 'anthropic/claude-4-5-sonnet',
|
|
34
|
+
headers: { 'anthropic-beta': 'context-1m-2025-08-07' },
|
|
25
35
|
},
|
|
26
36
|
});
|
|
37
|
+
|
|
38
|
+
// Runtime headers override config
|
|
39
|
+
agent.generate('...', {
|
|
40
|
+
modelSettings: { headers: { 'x-custom': 'runtime-value' } },
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Provider-level headers preserved
|
|
44
|
+
const openai = createOpenAI({ headers: { 'openai-organization': 'org-123' } });
|
|
45
|
+
new Agent({ model: openai('gpt-4o-mini') });
|
|
27
46
|
```
|
|
28
47
|
|
|
29
|
-
|
|
48
|
+
- Fixed AbortSignal not propagating from parent workflows to nested sub-workflows in the evented workflow engine. ([#11142](https://github.com/mastra-ai/mastra/pull/11142))
|
|
30
49
|
|
|
31
|
-
-
|
|
50
|
+
Previously, canceling a parent workflow did not stop nested sub-workflows, causing them to continue running and consuming resources after the parent was canceled.
|
|
32
51
|
|
|
33
|
-
|
|
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)
|
|
52
|
+
Now, when you cancel a parent workflow, all nested sub-workflows are automatically canceled as well, ensuring clean termination of the entire workflow tree.
|
|
38
53
|
|
|
39
|
-
**
|
|
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
|
|
54
|
+
**Example:**
|
|
42
55
|
|
|
43
|
-
|
|
44
|
-
|
|
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.
|
|
56
|
+
```typescript
|
|
57
|
+
const parentWorkflow = createWorkflow({ id: 'parent-workflow' }).then(someStep).then(nestedChildWorkflow).commit();
|
|
48
58
|
|
|
49
|
-
|
|
59
|
+
const run = await parentWorkflow.createRun();
|
|
60
|
+
const resultPromise = run.start({ inputData: { value: 5 } });
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
// Cancel the parent workflow - nested workflows will also be canceled
|
|
63
|
+
await run.cancel();
|
|
64
|
+
// or use: run.abortController.abort();
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
abort('Response quality too low', { retry: true, metadata: { score: 0.6 } });
|
|
57
|
-
}
|
|
58
|
-
return [];
|
|
59
|
-
};
|
|
66
|
+
const result = await resultPromise;
|
|
67
|
+
// result.status === 'canceled'
|
|
68
|
+
// All nested child workflows are also canceled
|
|
60
69
|
```
|
|
61
70
|
|
|
62
|
-
|
|
71
|
+
Related to #11063
|
|
63
72
|
|
|
64
|
-
|
|
73
|
+
- Fix empty overrideScorers causing error instead of skipping scoring ([#11257](https://github.com/mastra-ai/mastra/pull/11257))
|
|
65
74
|
|
|
66
|
-
|
|
67
|
-
import { createStep, createWorkflow } from '@mastra/core/workflows';
|
|
68
|
-
import {
|
|
69
|
-
ProcessorStepSchema,
|
|
70
|
-
} from '@mastra/core/processors';
|
|
75
|
+
When `overrideScorers` was passed as an empty object `{}`, the agent would throw a "No scorers found" error. Now an empty object explicitly skips scoring, while `undefined` continues to use default scorers.
|
|
71
76
|
|
|
72
|
-
|
|
73
|
-
.then(createStep(new lengthValidator({...})))
|
|
74
|
-
.parallel([createStep(new piiDetector({...}), createStep(new toxicityChecker({...}))])
|
|
75
|
-
.commit();
|
|
77
|
+
- feat: Add field filtering and nested workflow control to workflow execution result endpoint ([#11246](https://github.com/mastra-ai/mastra/pull/11246))
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
Adds two optional query parameters to `/api/workflows/:workflowId/runs/:runId/execution-result` endpoint:
|
|
80
|
+
- `fields`: Request only specific fields (e.g., `status`, `result`, `error`)
|
|
81
|
+
- `withNestedWorkflows`: Control whether to fetch nested workflow data
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
<img width="614" height="673" alt="image" src="https://github.com/user-attachments/assets/0d79f1fd-8fca-4d86-8b45-22fddea984a8" />
|
|
83
|
+
This significantly reduces response payload size and improves response times for large workflows.
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
## Server Endpoint Usage
|
|
84
86
|
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
```http
|
|
88
|
+
# Get only status (minimal payload - fastest)
|
|
89
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
# Get status and result
|
|
92
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,result
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
# Get all fields but without nested workflow data (faster)
|
|
95
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?withNestedWorkflows=false
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
# Get only specific fields without nested workflow data
|
|
98
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,steps&withNestedWorkflows=false
|
|
94
99
|
|
|
95
|
-
|
|
100
|
+
# Get full data (default behavior)
|
|
101
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result
|
|
102
|
+
```
|
|
96
103
|
|
|
97
|
-
|
|
104
|
+
## Client SDK Usage
|
|
98
105
|
|
|
99
|
-
|
|
106
|
+
```typescript
|
|
107
|
+
import { MastraClient } from '@mastra/client-js';
|
|
100
108
|
|
|
101
|
-
|
|
109
|
+
const client = new MastraClient({ baseUrl: 'http://localhost:4111' });
|
|
110
|
+
const workflow = client.getWorkflow('myWorkflow');
|
|
102
111
|
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
summary: z.string(),
|
|
107
|
-
tags: z.array(z.string()),
|
|
112
|
+
// Get only status (minimal payload - fastest)
|
|
113
|
+
const statusOnly = await workflow.runExecutionResult(runId, {
|
|
114
|
+
fields: ['status'],
|
|
108
115
|
});
|
|
116
|
+
console.log(statusOnly.status); // 'success' | 'failed' | 'running' | etc.
|
|
109
117
|
|
|
110
|
-
//
|
|
111
|
-
const
|
|
112
|
-
|
|
118
|
+
// Get status and result
|
|
119
|
+
const statusAndResult = await workflow.runExecutionResult(runId, {
|
|
120
|
+
fields: ['status', 'result'],
|
|
113
121
|
});
|
|
114
122
|
|
|
115
|
-
//
|
|
116
|
-
const
|
|
117
|
-
|
|
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
|
-
}),
|
|
123
|
+
// Get all fields but without nested workflow data (faster)
|
|
124
|
+
const resultWithoutNested = await workflow.runExecutionResult(runId, {
|
|
125
|
+
withNestedWorkflows: false,
|
|
123
126
|
});
|
|
124
127
|
|
|
125
|
-
workflow
|
|
126
|
-
|
|
128
|
+
// Get specific fields without nested workflow data
|
|
129
|
+
const optimized = await workflow.runExecutionResult(runId, {
|
|
130
|
+
fields: ['status', 'steps'],
|
|
131
|
+
withNestedWorkflows: false,
|
|
132
|
+
});
|
|
127
133
|
|
|
128
|
-
|
|
134
|
+
// Get full execution result (default behavior)
|
|
135
|
+
const fullResult = await workflow.runExecutionResult(runId);
|
|
136
|
+
```
|
|
129
137
|
|
|
130
|
-
|
|
138
|
+
## Core API Changes
|
|
131
139
|
|
|
132
|
-
|
|
140
|
+
The `Workflow.getWorkflowRunExecutionResult` method now accepts an options object:
|
|
133
141
|
|
|
134
142
|
```typescript
|
|
135
|
-
await workflow.
|
|
143
|
+
await workflow.getWorkflowRunExecutionResult(runId, {
|
|
144
|
+
withNestedWorkflows: false, // default: true, set to false to skip nested workflow data
|
|
145
|
+
fields: ['status', 'result'], // optional field filtering
|
|
146
|
+
});
|
|
136
147
|
```
|
|
137
148
|
|
|
138
|
-
|
|
149
|
+
## Inngest Compatibility
|
|
139
150
|
|
|
140
|
-
|
|
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
|
|
151
|
+
The `@mastra/inngest` package has been updated to use the new options object API. This is a non-breaking internal change - no action required from inngest workflow users.
|
|
146
152
|
|
|
147
|
-
|
|
153
|
+
## Performance Impact
|
|
148
154
|
|
|
149
|
-
|
|
155
|
+
For workflows with large step outputs:
|
|
156
|
+
- Requesting only `status`: ~99% reduction in payload size
|
|
157
|
+
- Requesting `status,result,error`: ~95% reduction in payload size
|
|
158
|
+
- Using `withNestedWorkflows=false`: Avoids expensive nested workflow data fetching
|
|
159
|
+
- Combining both: Maximum performance optimization
|
|
150
160
|
|
|
151
|
-
|
|
161
|
+
- Removed a debug log that printed large Zod schemas, resulting in cleaner console output when using agents with memory enabled. ([#11279](https://github.com/mastra-ai/mastra/pull/11279))
|
|
152
162
|
|
|
153
|
-
-
|
|
154
|
-
- @mastra/observability@1.0.0-beta.4
|
|
163
|
+
- Set `externals: true` as the default for `mastra build` and cloud-deployer to reduce bundle issues with native dependencies. ([`0dbf199`](https://github.com/mastra-ai/mastra/commit/0dbf199110f22192ce5c95b1c8148d4872b4d119))
|
|
155
164
|
|
|
156
|
-
|
|
165
|
+
**Note:** If you previously relied on the default bundling behavior (all dependencies bundled), you can explicitly set `externals: false` in your bundler configuration.
|
|
157
166
|
|
|
158
|
-
|
|
167
|
+
- Fix delayed promises rejecting when stream suspends on tool-call-approval ([#11278](https://github.com/mastra-ai/mastra/pull/11278))
|
|
159
168
|
|
|
160
|
-
|
|
169
|
+
When a stream ends in suspended state (e.g., requiring tool approval), the delayed promises like `toolResults`, `toolCalls`, `text`, etc. now resolve with partial results instead of rejecting with an error. This allows consumers to access data that was produced before the suspension.
|
|
161
170
|
|
|
162
|
-
|
|
171
|
+
Also improves generic type inference for `LLMStepResult` and related types throughout the streaming infrastructure.
|
|
163
172
|
|
|
164
|
-
|
|
165
|
-
import { Mastra } from '@mastra/core';
|
|
166
|
-
import { LibSQLStore } from '@mastra/libsql';
|
|
173
|
+
## 1.0.0-beta.13
|
|
167
174
|
|
|
168
|
-
|
|
169
|
-
storage: new LibSQLStore({ url: ':memory:' }),
|
|
170
|
-
tools: { myTool },
|
|
171
|
-
scorers: { myScorer },
|
|
172
|
-
});
|
|
175
|
+
### Patch Changes
|
|
173
176
|
|
|
174
|
-
|
|
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
|
-
});
|
|
177
|
+
- Add `onFinish` and `onError` lifecycle callbacks to workflow options ([#11200](https://github.com/mastra-ai/mastra/pull/11200))
|
|
185
178
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
179
|
+
Workflows now support lifecycle callbacks for server-side handling of workflow completion and errors:
|
|
180
|
+
- `onFinish`: Called when workflow completes with any status (success, failed, suspended, tripwire)
|
|
181
|
+
- `onError`: Called only when workflow fails (failed or tripwire status)
|
|
189
182
|
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
183
|
+
```typescript
|
|
184
|
+
const workflow = createWorkflow({
|
|
185
|
+
id: 'my-workflow',
|
|
186
|
+
inputSchema: z.object({ ... }),
|
|
187
|
+
outputSchema: z.object({ ... }),
|
|
188
|
+
options: {
|
|
189
|
+
onFinish: async (result) => {
|
|
190
|
+
// Handle any workflow completion
|
|
191
|
+
await updateJobStatus(result.status);
|
|
192
|
+
},
|
|
193
|
+
onError: async (errorInfo) => {
|
|
194
|
+
// Handle workflow failures
|
|
195
|
+
await logError(errorInfo.error);
|
|
196
|
+
},
|
|
197
|
+
},
|
|
194
198
|
});
|
|
195
199
|
```
|
|
196
200
|
|
|
197
|
-
|
|
201
|
+
Both callbacks support sync and async functions. Callback errors are caught and logged, not propagated to the workflow result.
|
|
202
|
+
|
|
203
|
+
## 1.0.0-beta.12
|
|
198
204
|
|
|
199
205
|
### Patch Changes
|
|
200
206
|
|
|
201
|
-
-
|
|
207
|
+
- Remove redundant toolCalls from network agent finalResult ([#11189](https://github.com/mastra-ai/mastra/pull/11189))
|
|
202
208
|
|
|
203
|
-
|
|
209
|
+
The network agent's `finalResult` was storing `toolCalls` separately even though all tool call information is already present in the `messages` array (as `tool-call` and `tool-result` type messages). This caused significant token waste since the routing agent reads this data from memory on every iteration.
|
|
204
210
|
|
|
205
|
-
|
|
211
|
+
**Before:** `finalResult: { text, toolCalls, messages }`
|
|
212
|
+
**After:** `finalResult: { text, messages }`
|
|
206
213
|
|
|
207
|
-
|
|
214
|
+
+**Migration:** If you were accessing `finalResult.toolCalls`, retrieve tool calls from `finalResult.messages` by filtering for messages with `type: 'tool-call'`.
|
|
208
215
|
|
|
209
|
-
|
|
216
|
+
Updated `@mastra/react` to extract tool calls directly from the `messages` array instead of the removed `toolCalls` field when resolving initial messages from memory.
|
|
210
217
|
|
|
211
|
-
|
|
218
|
+
Fixes #11059
|
|
212
219
|
|
|
213
|
-
|
|
220
|
+
- Embed AI types to fix peerdeps mismatches ([`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808))
|
|
214
221
|
|
|
215
|
-
|
|
222
|
+
- Fix invalid state: Controller is already closed ([`932d63d`](https://github.com/mastra-ai/mastra/commit/932d63dd51be9c8bf1e00e3671fe65606c6fb9cd))
|
|
216
223
|
|
|
217
|
-
|
|
224
|
+
Fixes #11005
|
|
218
225
|
|
|
219
|
-
|
|
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
|
|
226
|
+
- Fix HITL (Human-In-The-Loop) tool execution bug when mixing tools with and without execute functions. ([#11178](https://github.com/mastra-ai/mastra/pull/11178))
|
|
222
227
|
|
|
223
|
-
|
|
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.
|
|
228
|
+
When an agent called multiple tools simultaneously where some had `execute` functions and others didn't (HITL tools expecting `addToolResult` from the frontend), the HITL tools would incorrectly receive `result: undefined` and be marked as "output-available" instead of "input-available". This caused the agent to continue instead of pausing for user input.
|
|
225
229
|
|
|
226
|
-
-
|
|
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
|
+
- Add resourceId to workflow routes ([#11166](https://github.com/mastra-ai/mastra/pull/11166))
|
|
230
231
|
|
|
231
|
-
-
|
|
232
|
+
- Auto resume suspended tools if `autoResumeSuspendedTools: true` ([#11157](https://github.com/mastra-ai/mastra/pull/11157))
|
|
232
233
|
|
|
233
|
-
|
|
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.
|
|
234
|
+
The flag can be added to `defaultAgentOptions` when creating the agent or to options in `agent.stream` or `agent.generate`
|
|
240
235
|
|
|
241
236
|
```typescript
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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,
|
|
237
|
+
const agent = new Agent({
|
|
238
|
+
//...agent information,
|
|
239
|
+
defaultAgentOptions: {
|
|
240
|
+
autoResumeSuspendedTools: true,
|
|
241
|
+
},
|
|
254
242
|
});
|
|
255
243
|
```
|
|
256
244
|
|
|
257
|
-
|
|
245
|
+
- Preserve error details when thrown from workflow steps ([#10992](https://github.com/mastra-ai/mastra/pull/10992))
|
|
246
|
+
- Errors thrown in workflow steps now preserve full error details including `cause` chain and custom properties
|
|
247
|
+
- Added `SerializedError` type with proper cause chain support
|
|
248
|
+
- Added `SerializedStepResult` and `SerializedStepFailure` types for handling errors loaded from storage
|
|
249
|
+
- Enhanced `addErrorToJSON` to recursively serialize error cause chains with max depth protection
|
|
250
|
+
- Added `hydrateSerializedStepErrors` to convert serialized errors back to Error instances
|
|
251
|
+
- Fixed Inngest workflow error handling to extract original error from `NonRetriableError.cause`
|
|
258
252
|
|
|
259
|
-
-
|
|
253
|
+
- Move `@ai-sdk/azure` to devDependencies ([#10218](https://github.com/mastra-ai/mastra/pull/10218))
|
|
260
254
|
|
|
261
|
-
|
|
255
|
+
- Refactor internal event system from Emitter to PubSub abstraction for workflow event handling. This change replaces the EventEmitter-based event system with a pluggable PubSub interface, enabling support for distributed workflow execution backends like Inngest. Adds `close()` method to PubSub implementations for proper cleanup. ([#11052](https://github.com/mastra-ai/mastra/pull/11052))
|
|
262
256
|
|
|
263
|
-
|
|
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');
|
|
267
|
-
```
|
|
257
|
+
- Add `startAsync()` method and fix Inngest duplicate workflow execution bug ([#11093](https://github.com/mastra-ai/mastra/pull/11093))
|
|
268
258
|
|
|
269
|
-
|
|
270
|
-
|
|
259
|
+
**New Feature: `startAsync()` for fire-and-forget workflow execution**
|
|
260
|
+
- Add `Run.startAsync()` to base workflow class - starts workflow in background and returns `{ runId }` immediately
|
|
261
|
+
- Add `EventedRun.startAsync()` - publishes workflow start event without subscribing for completion
|
|
262
|
+
- Add `InngestRun.startAsync()` - sends Inngest event without polling for result
|
|
271
263
|
|
|
272
|
-
|
|
264
|
+
**Bug Fix: Prevent duplicate Inngest workflow executions**
|
|
265
|
+
- Fix `getRuns()` to properly handle rate limits (429), empty responses, and JSON parse errors with retry logic and exponential backoff
|
|
266
|
+
- Fix `getRunOutput()` to throw `NonRetriableError` when polling fails, preventing Inngest from retrying the parent function and re-triggering the workflow
|
|
267
|
+
- Add timeout to `getRunOutput()` polling (default 5 minutes) with `NonRetriableError` on timeout
|
|
273
268
|
|
|
274
|
-
|
|
269
|
+
This fixes a production issue where polling failures after successful workflow completion caused Inngest to retry the parent function, which fired a new workflow event and resulted in duplicate executions (e.g., duplicate Slack messages).
|
|
275
270
|
|
|
276
|
-
|
|
271
|
+
- Preserve error details when thrown from workflow steps ([#10992](https://github.com/mastra-ai/mastra/pull/10992))
|
|
277
272
|
|
|
278
|
-
|
|
273
|
+
Workflow errors now retain custom properties like `statusCode`, `responseHeaders`, and `cause` chains. This enables error-specific recovery logic in your applications.
|
|
279
274
|
|
|
280
|
-
|
|
275
|
+
**Before:**
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
const result = await workflow.execute({ input });
|
|
279
|
+
if (result.status === 'failed') {
|
|
280
|
+
// Custom error properties were lost
|
|
281
|
+
console.log(result.error); // "Step execution failed" (just a string)
|
|
282
|
+
}
|
|
283
|
+
```
|
|
281
284
|
|
|
282
|
-
|
|
285
|
+
**After:**
|
|
283
286
|
|
|
284
|
-
|
|
287
|
+
```typescript
|
|
288
|
+
const result = await workflow.execute({ input });
|
|
289
|
+
if (result.status === 'failed') {
|
|
290
|
+
// Custom properties are preserved
|
|
291
|
+
console.log(result.error.message); // "Step execution failed"
|
|
292
|
+
console.log(result.error.statusCode); // 429
|
|
293
|
+
console.log(result.error.cause?.name); // "RateLimitError"
|
|
294
|
+
}
|
|
295
|
+
```
|
|
285
296
|
|
|
286
|
-
|
|
297
|
+
**Type change:** `WorkflowState.error` and `WorkflowRunState.error` types changed from `string | Error` to `SerializedError`.
|
|
287
298
|
|
|
288
|
-
|
|
299
|
+
Other changes:
|
|
300
|
+
- Added `UpdateWorkflowStateOptions` type for workflow state updates
|
|
289
301
|
|
|
290
|
-
- Fix
|
|
302
|
+
- Fix Zod 4 compatibility issue with structuredOutput in agent.generate() ([#11133](https://github.com/mastra-ai/mastra/pull/11133))
|
|
291
303
|
|
|
292
|
-
|
|
304
|
+
Users with Zod 4 installed would see `TypeError: undefined is not an object (evaluating 'def.valueType._zod')` when using `structuredOutput` with agent.generate(). This happened because ProcessorStepSchema contains `z.custom()` fields that hold user-provided Zod schemas, and the workflow validation was trying to deeply validate these schemas causing version conflicts.
|
|
293
305
|
|
|
294
|
-
|
|
306
|
+
The fix disables input validation for processor workflows since `z.custom()` fields are meant to pass through arbitrary types without deep validation.
|
|
295
307
|
|
|
296
|
-
|
|
297
|
-
// TypeError: ToolStream<ChunkType> is not assignable to WritableStream<Partial<StoryPlan>>
|
|
298
|
-
await response.objectStream.pipeTo(writer);
|
|
299
|
-
```
|
|
308
|
+
- Truncate map config when too long ([#11175](https://github.com/mastra-ai/mastra/pull/11175))
|
|
300
309
|
|
|
301
|
-
|
|
310
|
+
- Add helpful JSDoc comments to `BundlerConfig` properties (used with `bundler` option) ([#10218](https://github.com/mastra-ai/mastra/pull/10218))
|
|
302
311
|
|
|
303
|
-
|
|
304
|
-
// Works without type errors
|
|
305
|
-
await response.objectStream.pipeTo(writer);
|
|
306
|
-
```
|
|
312
|
+
- Fixes .network() method ignores MASTRA_RESOURCE_ID_KEY from requestContext ([`4524734`](https://github.com/mastra-ai/mastra/commit/45247343e384717a7c8404296275c56201d6470f))
|
|
307
313
|
|
|
308
|
-
-
|
|
314
|
+
- fix: make getSqlType consistent across storage adapters ([#11112](https://github.com/mastra-ai/mastra/pull/11112))
|
|
315
|
+
- PostgreSQL: use `getSqlType()` in `createTable` instead of `toUpperCase()`
|
|
316
|
+
- LibSQL: use `getSqlType()` in `createTable`, return `JSONB` for jsonb type (matches SQLite 3.45+ support)
|
|
317
|
+
- ClickHouse: use `getSqlType()` in `createTable` instead of `COLUMN_TYPES` constant, add missing types (uuid, float, boolean)
|
|
318
|
+
- Remove unused `getSqlType()` and `getDefaultValue()` from `MastraStorage` base class (all stores use `StoreOperations` versions)
|
|
309
319
|
|
|
310
|
-
-
|
|
320
|
+
- Fix workflow cancel not updating status when workflow is suspended ([#11139](https://github.com/mastra-ai/mastra/pull/11139))
|
|
321
|
+
- `Run.cancel()` now updates workflow status to 'canceled' in storage, resolving the issue where suspended workflows remained in 'suspended' status after cancellation
|
|
322
|
+
- Cancellation status is immediately persisted and reflected to observers
|
|
311
323
|
|
|
312
|
-
|
|
324
|
+
- What changed: ([#10998](https://github.com/mastra-ai/mastra/pull/10998))
|
|
313
325
|
|
|
314
|
-
|
|
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"
|
|
320
|
-
```
|
|
326
|
+
Support for sequential tool execution was added. Tool call concurrency is now set conditionally, defaulting to 1 when sequential execution is needed (to avoid race conditions that interfere with human-in-the-loop approval during the workflow) rather than the default of 10 when concurrency is acceptable.
|
|
321
327
|
|
|
322
|
-
|
|
328
|
+
How it was changed:
|
|
323
329
|
|
|
324
|
-
|
|
325
|
-
threadObject = await memory.createThread({
|
|
326
|
-
// ...
|
|
327
|
-
saveThread: true, // thread persisted immediately
|
|
328
|
-
});
|
|
329
|
-
// MessageHistory can now save messages without error
|
|
330
|
-
```
|
|
330
|
+
A `sequentialExecutionRequired` constant was set to a boolean depending on whether any of the tools involved in a returned agentic execution workflow would require approval. If any tool has a 'suspendSchema' property (used for conditionally suspending execution and waiting for human input), or if they have their `requireApproval` property set to `true`, then the concurrency property used in the toolCallStep is set to 1, causing sequential execution. The old default of 10 remains otherwise.
|
|
331
331
|
|
|
332
|
-
-
|
|
332
|
+
- Fixed duplicate assistant messages appearing when using `useChat` with memory enabled. ([#11195](https://github.com/mastra-ai/mastra/pull/11195))
|
|
333
333
|
|
|
334
|
-
|
|
334
|
+
**What was happening:** When using `useChat` with `chatRoute` and memory, assistant messages were being duplicated in storage after multiple conversation turns. This occurred because the backend-generated message ID wasn't being sent back to `useChat`, causing ID mismatches during deduplication.
|
|
335
335
|
|
|
336
|
-
|
|
336
|
+
**What changed:**
|
|
337
|
+
- The backend now sends the assistant message ID in the stream's start event, so `useChat` uses the same ID as storage
|
|
338
|
+
- Custom `data-*` parts (from `writer.custom()`) are now preserved when messages contain V5 tool parts
|
|
337
339
|
|
|
338
|
-
|
|
340
|
+
Fixes #11091
|
|
339
341
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
});
|
|
342
|
+
- Updated dependencies [[`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808), [`5a632bd`](https://github.com/mastra-ai/mastra/commit/5a632bdf7b78953b664f5e038e98d4ba5f971e47)]:
|
|
343
|
+
- @mastra/schema-compat@1.0.0-beta.3
|
|
344
|
+
- @mastra/observability@1.0.0-beta.5
|
|
344
345
|
|
|
345
|
-
|
|
346
|
-
const response = await agent.generate('Solve this problem', {
|
|
347
|
-
providerOptions: {
|
|
348
|
-
deepseek: {
|
|
349
|
-
thinking: { type: 'enabled' },
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
});
|
|
353
|
-
```
|
|
346
|
+
## 1.0.0-beta.11
|
|
354
347
|
|
|
355
|
-
|
|
348
|
+
### Minor Changes
|
|
356
349
|
|
|
357
|
-
-
|
|
350
|
+
- Respect structured outputs for v2 models so tool schemas aren’t stripped ([#11038](https://github.com/mastra-ai/mastra/pull/11038))
|
|
358
351
|
|
|
359
|
-
|
|
352
|
+
### Patch Changes
|
|
360
353
|
|
|
361
|
-
|
|
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
|
|
354
|
+
- Fix type safety for message ordering - restrict `orderBy` to only accept `'createdAt'` field ([#11069](https://github.com/mastra-ai/mastra/pull/11069))
|
|
366
355
|
|
|
367
|
-
|
|
356
|
+
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.
|
|
368
357
|
|
|
369
|
-
|
|
370
|
-
# Get partial agent data (no tool schemas)
|
|
371
|
-
GET /api/agents?partial=true
|
|
358
|
+
- Loosen tools types in processInputStep / prepareStep. ([#11071](https://github.com/mastra-ai/mastra/pull/11071))
|
|
372
359
|
|
|
373
|
-
|
|
374
|
-
GET /api/agents
|
|
360
|
+
- Added the ability to provide a base path for Mastra Studio. ([#10441](https://github.com/mastra-ai/mastra/pull/10441))
|
|
375
361
|
|
|
376
|
-
|
|
377
|
-
|
|
362
|
+
```ts
|
|
363
|
+
import { Mastra } from '@mastra/core';
|
|
378
364
|
|
|
379
|
-
|
|
380
|
-
|
|
365
|
+
export const mastra = new Mastra({
|
|
366
|
+
server: {
|
|
367
|
+
studioBase: '/my-mastra-studio',
|
|
368
|
+
},
|
|
369
|
+
});
|
|
381
370
|
```
|
|
382
371
|
|
|
383
|
-
|
|
372
|
+
This will make Mastra Studio available at `http://localhost:4111/my-mastra-studio`.
|
|
384
373
|
|
|
385
|
-
|
|
386
|
-
import { MastraClient } from '@mastra/client-js';
|
|
374
|
+
- Expand `processInputStep` processor method and integrate `prepareStep` as a processor ([#10774](https://github.com/mastra-ai/mastra/pull/10774))
|
|
387
375
|
|
|
388
|
-
|
|
376
|
+
**New Features:**
|
|
377
|
+
- `prepareStep` callback now runs through the standard `processInputStep` pipeline
|
|
378
|
+
- Processors can now modify per-step: `model`, `tools`, `toolChoice`, `activeTools`, `messages`, `systemMessages`, `providerOptions`, `modelSettings`, and `structuredOutput`
|
|
379
|
+
- Processor chaining: each processor receives accumulated state from previous processors
|
|
380
|
+
- System messages are isolated per-step (reset at start of each step)
|
|
381
|
+
|
|
382
|
+
**Breaking Change:**
|
|
383
|
+
- `prepareStep` messages format changed from AI SDK v5 model messages to `MastraDBMessage` format
|
|
384
|
+
- Migration: Use `messageList.get.all.aiV5.model()` if you need the old format
|
|
389
385
|
|
|
390
|
-
|
|
391
|
-
|
|
386
|
+
- Multiple Processor improvements including: ([#10947](https://github.com/mastra-ai/mastra/pull/10947))
|
|
387
|
+
- Workflows can now return tripwires, they bubble up from agents that return tripwires in a step
|
|
388
|
+
- You can write processors as workflows using the existing Workflow primitive, every processor flow is now a workflow.
|
|
389
|
+
- tripwires that you throw can now return additional information including ability to retry the step
|
|
390
|
+
- New processor method `processOutputStep` added which runs after every step.
|
|
392
391
|
|
|
393
|
-
|
|
394
|
-
const fullAgents = await client.listAgents();
|
|
392
|
+
**What's new:**
|
|
395
393
|
|
|
396
|
-
|
|
397
|
-
const partialWorkflows = await client.listWorkflows({ partial: true });
|
|
394
|
+
**1. Retry mechanism with LLM feedback** - Processors can now request retries with feedback that gets sent back to the LLM:
|
|
398
395
|
|
|
399
|
-
|
|
400
|
-
|
|
396
|
+
```typescript
|
|
397
|
+
processOutputStep: async ({ text, abort, retryCount }) => {
|
|
398
|
+
if (isLowQuality(text)) {
|
|
399
|
+
abort('Response quality too low', { retry: true, metadata: { score: 0.6 } });
|
|
400
|
+
}
|
|
401
|
+
return [];
|
|
402
|
+
};
|
|
401
403
|
```
|
|
402
404
|
|
|
403
|
-
|
|
405
|
+
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.
|
|
404
406
|
|
|
405
|
-
|
|
406
|
-
- @mastra/observability@1.0.0-beta.3
|
|
407
|
+
**2. Workflow orchestration for processors** - Processors can now be composed using workflow primitives:
|
|
407
408
|
|
|
408
|
-
|
|
409
|
+
```typescript
|
|
410
|
+
import { createStep, createWorkflow } from '@mastra/core/workflows';
|
|
411
|
+
import {
|
|
412
|
+
ProcessorStepSchema,
|
|
413
|
+
} from '@mastra/core/processors';
|
|
409
414
|
|
|
410
|
-
|
|
415
|
+
const moderationWorkflow = createWorkflow({ id: 'moderation', inputSchema: ProcessorStepSchema, outputSchema: ProcessorStepSchema })
|
|
416
|
+
.then(createStep(new lengthValidator({...})))
|
|
417
|
+
.parallel([createStep(new piiDetector({...}), createStep(new toxicityChecker({...}))])
|
|
418
|
+
.commit();
|
|
411
419
|
|
|
412
|
-
|
|
420
|
+
const agent = new Agent({ inputProcessors: [moderationWorkflow] });
|
|
421
|
+
```
|
|
413
422
|
|
|
414
|
-
|
|
423
|
+
Every processor array that gets passed to an agent gets added as a workflow
|
|
424
|
+
<img width="614" height="673" alt="image" src="https://github.com/user-attachments/assets/0d79f1fd-8fca-4d86-8b45-22fddea984a8" />
|
|
415
425
|
|
|
416
|
-
**
|
|
426
|
+
**3. Extended tripwire API** - `abort()` now accepts options for retry control and typed metadata:
|
|
417
427
|
|
|
418
428
|
```typescript
|
|
419
|
-
|
|
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
|
-
});
|
|
429
|
+
abort('reason', { retry: true, metadata: { score: 0.8, category: 'quality' } });
|
|
427
430
|
```
|
|
428
431
|
|
|
429
|
-
**
|
|
432
|
+
**4. New `processOutputStep` method** - Per-step output processing with access to step number, finish reason, tool calls, and retry count.
|
|
430
433
|
|
|
431
|
-
|
|
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
|
-
```
|
|
434
|
+
**5. Workflow tripwire status** - Workflows now have a `'tripwire'` status distinct from `'failed'`, properly bubbling up processor rejections.
|
|
444
435
|
|
|
445
|
-
|
|
436
|
+
## 1.0.0-beta.10
|
|
446
437
|
|
|
447
|
-
|
|
438
|
+
### Patch Changes
|
|
448
439
|
|
|
449
|
-
|
|
440
|
+
- Add support for typed structured output in agent workflow steps ([#11014](https://github.com/mastra-ai/mastra/pull/11014))
|
|
441
|
+
|
|
442
|
+
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 }`.
|
|
443
|
+
|
|
444
|
+
This enables type-safe chaining of agent steps with structured output to subsequent steps:
|
|
450
445
|
|
|
451
|
-
|
|
446
|
+
```typescript
|
|
447
|
+
const articleSchema = z.object({
|
|
448
|
+
title: z.string(),
|
|
449
|
+
summary: z.string(),
|
|
450
|
+
tags: z.array(z.string()),
|
|
451
|
+
});
|
|
452
452
|
|
|
453
|
-
|
|
453
|
+
// Agent step with structured output - outputSchema is now articleSchema
|
|
454
|
+
const agentStep = createStep(agent, {
|
|
455
|
+
structuredOutput: { schema: articleSchema },
|
|
456
|
+
});
|
|
454
457
|
|
|
455
|
-
|
|
458
|
+
// Next step can receive the structured output directly
|
|
459
|
+
const processStep = createStep({
|
|
460
|
+
id: 'process',
|
|
461
|
+
inputSchema: articleSchema, // Matches agent's outputSchema
|
|
462
|
+
outputSchema: z.object({ tagCount: z.number() }),
|
|
463
|
+
execute: async ({ inputData }) => ({
|
|
464
|
+
tagCount: inputData.tags.length, // Fully typed!
|
|
465
|
+
}),
|
|
466
|
+
});
|
|
456
467
|
|
|
457
|
-
|
|
468
|
+
workflow.then(agentStep).then(processStep).commit();
|
|
469
|
+
```
|
|
458
470
|
|
|
459
|
-
|
|
471
|
+
When `structuredOutput` is not provided, the agent step continues to use the default `{ text: string }` output schema.
|
|
460
472
|
|
|
461
|
-
|
|
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
|
|
473
|
+
- 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))
|
|
465
474
|
|
|
466
|
-
|
|
475
|
+
- Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
|
|
467
476
|
|
|
468
477
|
```typescript
|
|
469
|
-
|
|
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
|
-
},
|
|
481
|
-
});
|
|
478
|
+
await workflow.deleteWorkflowRunById(runId);
|
|
482
479
|
```
|
|
483
480
|
|
|
484
|
-
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
-
|
|
488
|
-
-
|
|
481
|
+
- 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))
|
|
482
|
+
|
|
483
|
+
- fix: persist data-\* chunks from writer.custom() to memory storage ([#10884](https://github.com/mastra-ai/mastra/pull/10884))
|
|
484
|
+
- Add persistence for custom data chunks (`data-*` parts) emitted via `writer.custom()` in tools
|
|
485
|
+
- Data chunks are now saved to message storage so they survive page refreshes
|
|
486
|
+
- Update `@assistant-ui/react` to v0.11.47 with native `DataMessagePart` support
|
|
487
|
+
- Convert `data-*` parts to `DataMessagePart` format (`{ type: 'data', name: string, data: T }`)
|
|
488
|
+
- Update related `@assistant-ui/*` packages for compatibility
|
|
489
|
+
|
|
490
|
+
- Fixed double validation bug that prevented Zod transforms from working correctly in tool schemas. ([#11025](https://github.com/mastra-ai/mastra/pull/11025))
|
|
489
491
|
|
|
490
|
-
|
|
492
|
+
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.
|
|
491
493
|
|
|
492
|
-
|
|
494
|
+
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).
|
|
493
495
|
|
|
494
|
-
-
|
|
496
|
+
- Updated dependencies [[`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932)]:
|
|
497
|
+
- @mastra/observability@1.0.0-beta.4
|
|
498
|
+
|
|
499
|
+
## 1.0.0-beta.9
|
|
495
500
|
|
|
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`)
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 6489 more lines hidden. See full changelog in package directory.
|