@mastra/mcp-docs-server 1.1.8 → 1.1.9-alpha.1
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/docs/agents/adding-voice.md +4 -4
- package/.docs/docs/agents/agent-approval.md +3 -3
- package/.docs/docs/agents/agent-memory.md +3 -3
- package/.docs/docs/agents/guardrails.md +3 -3
- package/.docs/docs/agents/network-approval.md +5 -2
- package/.docs/docs/agents/networks.md +2 -2
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/processors.md +42 -24
- package/.docs/docs/agents/structured-output.md +2 -2
- package/.docs/docs/agents/supervisor-agents.md +3 -3
- package/.docs/docs/agents/using-tools.md +3 -3
- package/.docs/docs/build-with-ai/mcp-docs-server.md +5 -5
- package/.docs/docs/build-with-ai/skills.md +2 -2
- package/.docs/docs/community/contributing-templates.md +1 -1
- package/.docs/docs/community/discord.md +3 -3
- package/.docs/docs/community/licensing.md +2 -2
- package/.docs/docs/deployment/cloud-providers.md +2 -2
- package/.docs/docs/deployment/mastra-server.md +2 -2
- package/.docs/docs/deployment/monorepo.md +1 -1
- package/.docs/docs/deployment/overview.md +3 -3
- package/.docs/docs/deployment/studio.md +3 -3
- package/.docs/docs/deployment/web-framework.md +2 -2
- package/.docs/docs/deployment/workflow-runners.md +1 -1
- package/.docs/docs/evals/built-in-scorers.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +6 -6
- package/.docs/docs/evals/overview.md +2 -2
- package/.docs/docs/evals/running-in-ci.md +6 -6
- package/.docs/docs/getting-started/build-with-ai.md +3 -3
- package/.docs/docs/getting-started/manual-install.md +1 -1
- package/.docs/docs/getting-started/project-structure.md +2 -2
- package/.docs/docs/index.md +63 -17
- package/.docs/docs/mastra-cloud/deployment.md +1 -1
- package/.docs/docs/mastra-cloud/studio.md +1 -1
- package/.docs/docs/mcp/overview.md +1 -1
- package/.docs/docs/mcp/publishing-mcp-server.md +4 -4
- package/.docs/docs/memory/memory-processors.md +9 -9
- package/.docs/docs/memory/message-history.md +4 -4
- package/.docs/docs/memory/observational-memory.md +11 -7
- package/.docs/docs/memory/semantic-recall.md +9 -9
- package/.docs/docs/memory/storage.md +1 -1
- package/.docs/docs/memory/working-memory.md +20 -20
- package/.docs/docs/observability/datasets/overview.md +1 -1
- package/.docs/docs/observability/datasets/running-experiments.md +1 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/overview.md +5 -5
- package/.docs/docs/observability/tracing/bridges/otel.md +9 -9
- package/.docs/docs/observability/tracing/exporters/arize.md +3 -3
- package/.docs/docs/observability/tracing/exporters/braintrust.md +1 -1
- package/.docs/docs/observability/tracing/exporters/cloud.md +2 -2
- package/.docs/docs/observability/tracing/exporters/datadog.md +3 -3
- package/.docs/docs/observability/tracing/exporters/default.md +8 -8
- package/.docs/docs/observability/tracing/exporters/laminar.md +1 -1
- package/.docs/docs/observability/tracing/exporters/langfuse.md +3 -3
- package/.docs/docs/observability/tracing/exporters/langsmith.md +4 -4
- package/.docs/docs/observability/tracing/exporters/otel.md +8 -8
- package/.docs/docs/observability/tracing/exporters/posthog.md +2 -2
- package/.docs/docs/observability/tracing/exporters/sentry.md +4 -4
- package/.docs/docs/observability/tracing/overview.md +24 -24
- package/.docs/docs/observability/tracing/processors/sensitive-data-filter.md +13 -13
- package/.docs/docs/rag/chunking-and-embedding.md +5 -5
- package/.docs/docs/rag/overview.md +2 -2
- package/.docs/docs/rag/retrieval.md +4 -4
- package/.docs/docs/rag/vector-databases.md +13 -13
- package/.docs/docs/server/auth/auth0.md +2 -2
- package/.docs/docs/server/auth/clerk.md +1 -1
- package/.docs/docs/server/auth/composite-auth.md +9 -9
- package/.docs/docs/server/auth/custom-auth-provider.md +12 -12
- package/.docs/docs/server/auth/firebase.md +3 -3
- package/.docs/docs/server/auth/jwt.md +1 -1
- package/.docs/docs/server/auth/simple-auth.md +9 -9
- package/.docs/docs/server/auth/supabase.md +1 -1
- package/.docs/docs/server/auth/workos.md +1 -1
- package/.docs/docs/server/auth.md +2 -2
- package/.docs/docs/server/custom-adapters.md +7 -7
- package/.docs/docs/server/custom-api-routes.md +2 -2
- package/.docs/docs/server/mastra-client.md +2 -2
- package/.docs/docs/server/mastra-server.md +2 -2
- package/.docs/docs/server/request-context.md +2 -2
- package/.docs/docs/server/server-adapters.md +3 -3
- package/.docs/docs/streaming/events.md +2 -2
- package/.docs/docs/streaming/overview.md +2 -2
- package/.docs/docs/streaming/tool-streaming.md +46 -32
- package/.docs/docs/streaming/workflow-streaming.md +1 -1
- package/.docs/docs/voice/overview.md +3 -3
- package/.docs/docs/voice/speech-to-speech.md +1 -1
- package/.docs/docs/voice/speech-to-text.md +2 -2
- package/.docs/docs/voice/text-to-speech.md +2 -2
- package/.docs/docs/workflows/agents-and-tools.md +1 -1
- package/.docs/docs/workflows/control-flow.md +45 -3
- package/.docs/docs/workflows/error-handling.md +4 -4
- package/.docs/docs/workflows/overview.md +3 -3
- package/.docs/docs/workflows/snapshots.md +1 -1
- package/.docs/docs/workflows/suspend-and-resume.md +1 -1
- package/.docs/docs/workflows/time-travel.md +3 -3
- package/.docs/docs/workflows/workflow-state.md +1 -1
- package/.docs/docs/workspace/filesystem.md +3 -3
- package/.docs/docs/workspace/overview.md +53 -8
- package/.docs/docs/workspace/sandbox.md +72 -13
- package/.docs/docs/workspace/search.md +1 -1
- package/.docs/docs/workspace/skills.md +4 -4
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +2 -2
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit.md +2 -2
- package/.docs/guides/deployment/digital-ocean.md +1 -1
- package/.docs/guides/deployment/inngest.md +4 -4
- package/.docs/guides/getting-started/astro.md +1 -1
- package/.docs/guides/getting-started/electron.md +1 -1
- package/.docs/guides/getting-started/next-js.md +1 -1
- package/.docs/guides/getting-started/vite-react.md +1 -1
- package/.docs/guides/guide/ai-recruiter.md +4 -4
- package/.docs/guides/guide/chef-michel.md +4 -4
- package/.docs/guides/guide/code-review-bot.md +3 -3
- package/.docs/guides/guide/dev-assistant.md +5 -5
- package/.docs/guides/guide/docs-manager.md +3 -3
- package/.docs/guides/guide/github-actions-pr-description.md +4 -4
- package/.docs/guides/guide/notes-mcp-server.md +4 -4
- package/.docs/guides/guide/research-assistant.md +4 -4
- package/.docs/guides/guide/research-coordinator.md +1 -1
- package/.docs/guides/guide/stock-agent.md +6 -6
- package/.docs/guides/guide/web-search.md +2 -2
- package/.docs/guides/guide/whatsapp-chat-bot.md +1 -1
- package/.docs/guides/migrations/agentnetwork.md +1 -1
- package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +3 -3
- package/.docs/guides/migrations/network-to-supervisor.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/client.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/deployment.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/evals.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/mastra.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/memory.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/overview.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/storage.md +4 -4
- package/.docs/guides/migrations/upgrade-to-v1/tools.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/vectors.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/voice.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/workflows.md +6 -6
- package/.docs/guides/migrations/vnext-to-standard-apis.md +3 -3
- package/.docs/models/embeddings.md +4 -4
- package/.docs/models/gateways/custom-gateways.md +4 -4
- package/.docs/models/gateways/netlify.md +2 -3
- package/.docs/models/gateways/openrouter.md +9 -2
- package/.docs/models/gateways/vercel.md +11 -2
- package/.docs/models/gateways.md +2 -2
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/302ai.md +3 -3
- package/.docs/models/providers/abacus.md +24 -14
- package/.docs/models/providers/aihubmix.md +10 -5
- package/.docs/models/providers/alibaba-cn.md +83 -74
- package/.docs/models/providers/alibaba-coding-plan-cn.md +78 -0
- package/.docs/models/providers/alibaba-coding-plan.md +78 -0
- package/.docs/models/providers/alibaba.md +3 -3
- package/.docs/models/providers/anthropic.md +4 -4
- package/.docs/models/providers/bailing.md +3 -3
- package/.docs/models/providers/baseten.md +3 -3
- package/.docs/models/providers/berget.md +3 -3
- package/.docs/models/providers/cerebras.md +4 -4
- package/.docs/models/providers/chutes.md +7 -6
- package/.docs/models/providers/clarifai.md +81 -0
- package/.docs/models/providers/cloudferro-sherlock.md +8 -7
- package/.docs/models/providers/cloudflare-workers-ai.md +6 -5
- package/.docs/models/providers/cortecs.md +10 -8
- package/.docs/models/providers/deepinfra.md +11 -6
- package/.docs/models/providers/deepseek.md +4 -4
- package/.docs/models/providers/drun.md +73 -0
- package/.docs/models/providers/evroc.md +3 -3
- package/.docs/models/providers/fastrouter.md +3 -3
- package/.docs/models/providers/fireworks-ai.md +3 -3
- package/.docs/models/providers/firmware.md +31 -23
- package/.docs/models/providers/friendli.md +3 -3
- package/.docs/models/providers/github-models.md +3 -3
- package/.docs/models/providers/google.md +7 -5
- package/.docs/models/providers/groq.md +4 -4
- package/.docs/models/providers/helicone.md +3 -3
- package/.docs/models/providers/huggingface.md +3 -3
- package/.docs/models/providers/iflowcn.md +3 -3
- package/.docs/models/providers/inception.md +7 -5
- package/.docs/models/providers/inference.md +3 -3
- package/.docs/models/providers/io-net.md +3 -3
- package/.docs/models/providers/jiekou.md +3 -3
- package/.docs/models/providers/kilo.md +6 -4
- package/.docs/models/providers/kimi-for-coding.md +4 -4
- package/.docs/models/providers/kuae-cloud-coding-plan.md +3 -3
- package/.docs/models/providers/llama.md +3 -3
- package/.docs/models/providers/lmstudio.md +3 -3
- package/.docs/models/providers/lucidquery.md +3 -3
- package/.docs/models/providers/meganova.md +3 -3
- package/.docs/models/providers/minimax-cn-coding-plan.md +4 -4
- package/.docs/models/providers/minimax-cn.md +4 -4
- package/.docs/models/providers/minimax-coding-plan.md +4 -4
- package/.docs/models/providers/minimax.md +4 -4
- package/.docs/models/providers/mistral.md +4 -4
- package/.docs/models/providers/moark.md +3 -3
- package/.docs/models/providers/modelscope.md +3 -3
- package/.docs/models/providers/moonshotai-cn.md +3 -3
- package/.docs/models/providers/moonshotai.md +3 -3
- package/.docs/models/providers/morph.md +3 -3
- package/.docs/models/providers/nano-gpt.md +523 -42
- package/.docs/models/providers/nebius.md +37 -37
- package/.docs/models/providers/nova.md +3 -3
- package/.docs/models/providers/novita-ai.md +3 -3
- package/.docs/models/providers/nvidia.md +7 -5
- package/.docs/models/providers/ollama-cloud.md +4 -5
- package/.docs/models/providers/openai.md +7 -5
- package/.docs/models/providers/opencode-go.md +3 -3
- package/.docs/models/providers/opencode.md +39 -36
- package/.docs/models/providers/ovhcloud.md +3 -3
- package/.docs/models/providers/perplexity-agent.md +4 -4
- package/.docs/models/providers/perplexity.md +4 -4
- package/.docs/models/providers/poe.md +11 -5
- package/.docs/models/providers/privatemode-ai.md +3 -3
- package/.docs/models/providers/qihang-ai.md +3 -3
- package/.docs/models/providers/qiniu-ai.md +23 -8
- package/.docs/models/providers/requesty.md +20 -4
- package/.docs/models/providers/scaleway.md +3 -3
- package/.docs/models/providers/siliconflow-cn.md +10 -4
- package/.docs/models/providers/siliconflow.md +3 -3
- package/.docs/models/providers/stackit.md +3 -3
- package/.docs/models/providers/stepfun.md +3 -3
- package/.docs/models/providers/submodel.md +3 -3
- package/.docs/models/providers/synthetic.md +3 -3
- package/.docs/models/providers/togetherai.md +5 -7
- package/.docs/models/providers/upstage.md +3 -3
- package/.docs/models/providers/vivgrid.md +4 -4
- package/.docs/models/providers/vultr.md +3 -3
- package/.docs/models/providers/wandb.md +3 -3
- package/.docs/models/providers/xai.md +34 -31
- package/.docs/models/providers/xiaomi.md +4 -4
- package/.docs/models/providers/zai-coding-plan.md +3 -3
- package/.docs/models/providers/zai.md +3 -3
- package/.docs/models/providers/zenmux.md +7 -5
- package/.docs/models/providers/zhipuai-coding-plan.md +3 -3
- package/.docs/models/providers/zhipuai.md +3 -3
- package/.docs/models/providers.md +4 -0
- package/.docs/reference/agents/agent.md +3 -3
- package/.docs/reference/agents/generateLegacy.md +1 -1
- package/.docs/reference/agents/getDefaultGenerateOptions.md +1 -1
- package/.docs/reference/agents/getDefaultOptions.md +1 -1
- package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
- package/.docs/reference/agents/getDescription.md +1 -1
- package/.docs/reference/agents/network.md +5 -3
- package/.docs/reference/ai-sdk/handle-chat-stream.md +2 -0
- package/.docs/reference/ai-sdk/handle-network-stream.md +2 -0
- package/.docs/reference/ai-sdk/network-route.md +2 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
- package/.docs/reference/auth/auth0.md +7 -7
- package/.docs/reference/auth/better-auth.md +2 -2
- package/.docs/reference/auth/clerk.md +1 -1
- package/.docs/reference/auth/firebase.md +5 -5
- package/.docs/reference/auth/jwt.md +1 -1
- package/.docs/reference/auth/supabase.md +1 -1
- package/.docs/reference/auth/workos.md +6 -6
- package/.docs/reference/cli/mastra.md +5 -5
- package/.docs/reference/client-js/agents.md +22 -22
- package/.docs/reference/client-js/error-handling.md +2 -2
- package/.docs/reference/client-js/logs.md +2 -2
- package/.docs/reference/client-js/mastra-client.md +2 -2
- package/.docs/reference/client-js/memory.md +6 -6
- package/.docs/reference/client-js/observability.md +4 -4
- package/.docs/reference/client-js/telemetry.md +1 -1
- package/.docs/reference/client-js/tools.md +3 -3
- package/.docs/reference/client-js/vectors.md +2 -2
- package/.docs/reference/client-js/workflows.md +12 -12
- package/.docs/reference/configuration.md +62 -6
- package/.docs/reference/core/getDeployer.md +1 -1
- package/.docs/reference/core/getGatewayById.md +1 -1
- package/.docs/reference/core/getLogger.md +1 -1
- package/.docs/reference/core/getMCPServer.md +2 -2
- package/.docs/reference/core/getMCPServerById.md +2 -2
- package/.docs/reference/core/getMemory.md +1 -1
- package/.docs/reference/core/getScorer.md +4 -4
- package/.docs/reference/core/getScorerById.md +2 -2
- package/.docs/reference/core/getServer.md +1 -1
- package/.docs/reference/core/getStorage.md +1 -1
- package/.docs/reference/core/getStoredAgentById.md +3 -3
- package/.docs/reference/core/getTelemetry.md +1 -1
- package/.docs/reference/core/getWorkflow.md +1 -1
- package/.docs/reference/core/listAgents.md +1 -1
- package/.docs/reference/core/listMCPServers.md +3 -3
- package/.docs/reference/core/listMemory.md +1 -1
- package/.docs/reference/core/listScorers.md +1 -1
- package/.docs/reference/core/listStoredAgents.md +3 -3
- package/.docs/reference/core/listVectors.md +1 -1
- package/.docs/reference/core/mastra-class.md +2 -2
- package/.docs/reference/core/mastra-model-gateway.md +11 -11
- package/.docs/reference/core/setLogger.md +1 -1
- package/.docs/reference/core/setStorage.md +1 -1
- package/.docs/reference/datasets/dataset.md +2 -2
- package/.docs/reference/datasets/datasets-manager.md +1 -1
- package/.docs/reference/datasets/get.md +2 -2
- package/.docs/reference/datasets/getDetails.md +1 -1
- package/.docs/reference/datasets/listItems.md +1 -1
- package/.docs/reference/deployer/vercel.md +1 -1
- package/.docs/reference/deployer.md +4 -4
- package/.docs/reference/evals/answer-relevancy.md +4 -4
- package/.docs/reference/evals/answer-similarity.md +3 -3
- package/.docs/reference/evals/bias.md +4 -4
- package/.docs/reference/evals/completeness.md +6 -6
- package/.docs/reference/evals/content-similarity.md +3 -3
- package/.docs/reference/evals/context-precision.md +9 -9
- package/.docs/reference/evals/context-relevance.md +7 -7
- package/.docs/reference/evals/create-scorer.md +7 -7
- package/.docs/reference/evals/faithfulness.md +3 -3
- package/.docs/reference/evals/hallucination.md +8 -14
- package/.docs/reference/evals/keyword-coverage.md +4 -4
- package/.docs/reference/evals/mastra-scorer.md +7 -7
- package/.docs/reference/evals/noise-sensitivity.md +11 -11
- package/.docs/reference/evals/prompt-alignment.md +5 -5
- package/.docs/reference/evals/run-evals.md +5 -5
- package/.docs/reference/evals/scorer-utils.md +17 -17
- package/.docs/reference/evals/textual-difference.md +4 -4
- package/.docs/reference/evals/tone-consistency.md +5 -5
- package/.docs/reference/evals/tool-call-accuracy.md +10 -10
- package/.docs/reference/evals/toxicity.md +3 -3
- package/.docs/reference/harness/harness-class.md +5 -3
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/memory/clone-utilities.md +7 -7
- package/.docs/reference/memory/cloneThread.md +5 -5
- package/.docs/reference/memory/createThread.md +1 -1
- package/.docs/reference/memory/deleteMessages.md +1 -1
- package/.docs/reference/memory/getThreadById.md +1 -1
- package/.docs/reference/memory/listThreads.md +3 -3
- package/.docs/reference/memory/memory-class.md +1 -1
- package/.docs/reference/memory/observational-memory.md +8 -6
- package/.docs/reference/memory/recall.md +1 -1
- package/.docs/reference/observability/tracing/bridges/otel.md +6 -6
- package/.docs/reference/observability/tracing/configuration.md +17 -17
- package/.docs/reference/observability/tracing/exporters/arize.md +4 -4
- package/.docs/reference/observability/tracing/exporters/braintrust.md +3 -3
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +6 -6
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +4 -4
- package/.docs/reference/observability/tracing/exporters/datadog.md +4 -4
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +6 -6
- package/.docs/reference/observability/tracing/exporters/laminar.md +2 -2
- package/.docs/reference/observability/tracing/exporters/langfuse.md +4 -4
- package/.docs/reference/observability/tracing/exporters/langsmith.md +6 -6
- package/.docs/reference/observability/tracing/exporters/otel.md +12 -12
- package/.docs/reference/observability/tracing/exporters/posthog.md +3 -3
- package/.docs/reference/observability/tracing/exporters/sentry.md +5 -5
- package/.docs/reference/observability/tracing/instances.md +9 -9
- package/.docs/reference/observability/tracing/interfaces.md +39 -39
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +6 -6
- package/.docs/reference/observability/tracing/spans.md +15 -13
- package/.docs/reference/processors/message-history-processor.md +1 -1
- package/.docs/reference/processors/processor-interface.md +21 -17
- package/.docs/reference/processors/token-limiter-processor.md +2 -2
- package/.docs/reference/rag/chunk.md +2 -2
- package/.docs/reference/rag/database-config.md +8 -8
- package/.docs/reference/rag/document.md +11 -11
- package/.docs/reference/rag/embeddings.md +5 -5
- package/.docs/reference/rag/extract-params.md +8 -8
- package/.docs/reference/rag/graph-rag.md +4 -4
- package/.docs/reference/rag/metadata-filters.md +15 -15
- package/.docs/reference/rag/rerank.md +2 -2
- package/.docs/reference/rag/rerankWithScorer.md +2 -2
- package/.docs/reference/server/create-route.md +2 -0
- package/.docs/reference/server/express-adapter.md +1 -1
- package/.docs/reference/server/fastify-adapter.md +1 -1
- package/.docs/reference/server/hono-adapter.md +1 -1
- package/.docs/reference/server/koa-adapter.md +2 -2
- package/.docs/reference/server/mastra-server.md +16 -16
- package/.docs/reference/server/register-api-route.md +7 -7
- package/.docs/reference/server/routes.md +1 -1
- package/.docs/reference/storage/cloudflare-d1.md +5 -5
- package/.docs/reference/storage/cloudflare.md +3 -3
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/convex.md +6 -6
- package/.docs/reference/storage/dynamodb.md +7 -7
- package/.docs/reference/storage/lance.md +5 -5
- package/.docs/reference/storage/libsql.md +1 -1
- package/.docs/reference/storage/mongodb.md +6 -6
- package/.docs/reference/storage/mssql.md +4 -4
- package/.docs/reference/storage/overview.md +2 -2
- package/.docs/reference/storage/postgresql.md +7 -7
- package/.docs/reference/storage/upstash.md +4 -4
- package/.docs/reference/streaming/ChunkType.md +13 -13
- package/.docs/reference/streaming/agents/MastraModelOutput.md +6 -6
- package/.docs/reference/streaming/agents/stream.md +2 -2
- package/.docs/reference/streaming/agents/streamLegacy.md +1 -1
- package/.docs/reference/streaming/workflows/observeStream.md +2 -2
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/streaming/workflows/stream.md +1 -1
- package/.docs/reference/templates/overview.md +4 -4
- package/.docs/reference/tools/create-tool.md +10 -10
- package/.docs/reference/tools/document-chunker-tool.md +4 -4
- package/.docs/reference/tools/graph-rag-tool.md +7 -7
- package/.docs/reference/tools/mcp-client.md +13 -13
- package/.docs/reference/tools/mcp-server.md +27 -27
- package/.docs/reference/tools/vector-query-tool.md +12 -12
- package/.docs/reference/vectors/astra.md +13 -13
- package/.docs/reference/vectors/chroma.md +18 -18
- package/.docs/reference/vectors/convex.md +15 -15
- package/.docs/reference/vectors/couchbase.md +21 -21
- package/.docs/reference/vectors/duckdb.md +17 -17
- package/.docs/reference/vectors/elasticsearch.md +14 -14
- package/.docs/reference/vectors/lance.md +22 -22
- package/.docs/reference/vectors/libsql.md +15 -15
- package/.docs/reference/vectors/mongodb.md +18 -18
- package/.docs/reference/vectors/opensearch.md +11 -11
- package/.docs/reference/vectors/pg.md +23 -21
- package/.docs/reference/vectors/pinecone.md +15 -15
- package/.docs/reference/vectors/qdrant.md +15 -15
- package/.docs/reference/vectors/s3vectors.md +22 -22
- package/.docs/reference/vectors/turbopuffer.md +14 -14
- package/.docs/reference/vectors/upstash.md +15 -15
- package/.docs/reference/vectors/vectorize.md +16 -16
- package/.docs/reference/voice/azure.md +12 -10
- package/.docs/reference/voice/cloudflare.md +9 -7
- package/.docs/reference/voice/composite-voice.md +5 -5
- package/.docs/reference/voice/deepgram.md +5 -5
- package/.docs/reference/voice/elevenlabs.md +7 -7
- package/.docs/reference/voice/google-gemini-live.md +22 -22
- package/.docs/reference/voice/google.md +12 -12
- package/.docs/reference/voice/mastra-voice.md +18 -18
- package/.docs/reference/voice/murf.md +8 -8
- package/.docs/reference/voice/openai-realtime.md +19 -17
- package/.docs/reference/voice/openai.md +12 -8
- package/.docs/reference/voice/playai.md +9 -7
- package/.docs/reference/voice/sarvam.md +8 -6
- package/.docs/reference/voice/speechify.md +11 -9
- package/.docs/reference/voice/voice.addInstructions.md +4 -4
- package/.docs/reference/voice/voice.addTools.md +3 -3
- package/.docs/reference/voice/voice.answer.md +2 -2
- package/.docs/reference/voice/voice.close.md +4 -4
- package/.docs/reference/voice/voice.connect.md +9 -7
- package/.docs/reference/voice/voice.events.md +4 -4
- package/.docs/reference/voice/voice.getSpeakers.md +4 -4
- package/.docs/reference/voice/voice.listen.md +17 -11
- package/.docs/reference/voice/voice.off.md +4 -4
- package/.docs/reference/voice/voice.on.md +5 -5
- package/.docs/reference/voice/voice.send.md +2 -2
- package/.docs/reference/voice/voice.speak.md +19 -9
- package/.docs/reference/voice/voice.updateConfig.md +4 -4
- package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workflows/run.md +3 -3
- package/.docs/reference/workflows/step.md +2 -2
- package/.docs/reference/workflows/workflow-methods/create-run.md +1 -1
- package/.docs/reference/workflows/workflow.md +1 -1
- package/.docs/reference/workspace/blaxel-sandbox.md +164 -0
- package/.docs/reference/workspace/daytona-sandbox.md +50 -141
- package/.docs/reference/workspace/e2b-sandbox.md +41 -77
- package/.docs/reference/workspace/filesystem.md +25 -11
- package/.docs/reference/workspace/gcs-filesystem.md +21 -1
- package/.docs/reference/workspace/local-filesystem.md +24 -10
- package/.docs/reference/workspace/local-sandbox.md +27 -102
- package/.docs/reference/workspace/process-manager.md +296 -0
- package/.docs/reference/workspace/s3-filesystem.md +21 -1
- package/.docs/reference/workspace/sandbox.md +9 -1
- package/.docs/reference/workspace/workspace-class.md +95 -27
- package/CHANGELOG.md +15 -0
- package/dist/tools/course.d.ts +7 -27
- package/dist/tools/course.d.ts.map +1 -1
- package/dist/tools/docs.d.ts +6 -18
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/embedded-docs.d.ts +12 -112
- package/dist/tools/embedded-docs.d.ts.map +1 -1
- package/dist/tools/migration.d.ts +6 -26
- package/dist/tools/migration.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Time
|
|
1
|
+
# Time travel
|
|
2
2
|
|
|
3
|
-
Time travel allows you to re-execute a workflow starting from any specific step, using either stored snapshot data or custom context you provide. This is useful for debugging failed workflows, testing individual steps with different inputs, or recovering from errors without re-running the entire workflow. You can also use time travel to execute a workflow that
|
|
3
|
+
Time travel allows you to re-execute a workflow starting from any specific step, using either stored snapshot data or custom context you provide. This is useful for debugging failed workflows, testing individual steps with different inputs, or recovering from errors without re-running the entire workflow. You can also use time travel to execute a workflow that hasn't been run yet, starting from any specific step.
|
|
4
4
|
|
|
5
5
|
## How time travel works
|
|
6
6
|
|
|
@@ -193,7 +193,7 @@ Time travel throws errors in specific situations:
|
|
|
193
193
|
|
|
194
194
|
### Running workflow
|
|
195
195
|
|
|
196
|
-
You
|
|
196
|
+
You can't time travel to a workflow that's currently running:
|
|
197
197
|
|
|
198
198
|
```typescript
|
|
199
199
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Workflow
|
|
1
|
+
# Workflow state
|
|
2
2
|
|
|
3
3
|
Workflow state lets you share values across steps without passing them through every step's inputSchema and outputSchema. This is useful for tracking progress, accumulating results, or sharing configuration across the entire workflow.
|
|
4
4
|
|
|
@@ -101,9 +101,9 @@ const workspace = new Workspace({
|
|
|
101
101
|
})
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
When read-only, write tools (`write_file`, `edit_file`, `delete`, `mkdir`)
|
|
104
|
+
When read-only, write tools (`write_file`, `edit_file`, `delete`, `mkdir`) aren't added to the agent's toolset. The agent can still read and list files.
|
|
105
105
|
|
|
106
|
-
## Mounts and CompositeFilesystem
|
|
106
|
+
## Mounts and `CompositeFilesystem`
|
|
107
107
|
|
|
108
108
|
When you use the `mounts` option on a workspace, Mastra creates a `CompositeFilesystem` that routes file operations to the correct provider based on path prefix.
|
|
109
109
|
|
|
@@ -140,7 +140,7 @@ With this configuration:
|
|
|
140
140
|
|
|
141
141
|
All file paths must start with a mount prefix. Operations on paths that don't match any mount will fail. Listing the root directory (`/`) returns virtual directory entries for each mount point.
|
|
142
142
|
|
|
143
|
-
Mount paths
|
|
143
|
+
Mount paths can't be nested — for example, you can't mount at both `/data` and `/data/sub`.
|
|
144
144
|
|
|
145
145
|
### `filesystem` vs `mounts`
|
|
146
146
|
|
|
@@ -7,7 +7,7 @@ A Mastra workspace gives agents a persistent environment for storing files and e
|
|
|
7
7
|
A workspace supports the following features:
|
|
8
8
|
|
|
9
9
|
- **[Filesystem](https://mastra.ai/docs/workspace/filesystem)**: File storage (read, write, list, delete, copy, move, grep)
|
|
10
|
-
- **[Sandbox](https://mastra.ai/docs/workspace/sandbox)**: Command execution (shell commands)
|
|
10
|
+
- **[Sandbox](https://mastra.ai/docs/workspace/sandbox)**: Command execution (shell commands) and background processes
|
|
11
11
|
- **[Search](https://mastra.ai/docs/workspace/search)**: BM25, vector, or hybrid search over indexed content
|
|
12
12
|
- **[Skills](https://mastra.ai/docs/workspace/skills)**: Reusable instructions for agents
|
|
13
13
|
|
|
@@ -117,7 +117,7 @@ Under the hood, `mounts` creates a [CompositeFilesystem](https://mastra.ai/docs/
|
|
|
117
117
|
|
|
118
118
|
You can mount multiple providers at different paths. Each mount path must be unique and non-overlapping.
|
|
119
119
|
|
|
120
|
-
> **Note:** `filesystem` and `mounts` are mutually exclusive — you
|
|
120
|
+
> **Note:** `filesystem` and `mounts` are mutually exclusive — you can't use both in the same workspace. Use `filesystem` for a single provider without a sandbox, or `mounts` when you need to combine cloud storage with a sandbox.
|
|
121
121
|
|
|
122
122
|
### Filesystem only
|
|
123
123
|
|
|
@@ -190,11 +190,56 @@ const workspace = new Workspace({
|
|
|
190
190
|
|
|
191
191
|
### Tool options
|
|
192
192
|
|
|
193
|
-
| Option | Type | Description
|
|
194
|
-
| ------------------------ | --------- |
|
|
195
|
-
| `enabled` | `boolean` | Whether the tool is available (default: `true`)
|
|
196
|
-
| `requireApproval` | `boolean` | Whether the tool requires user approval before execution (default: `false`)
|
|
197
|
-
| `requireReadBeforeWrite` | `boolean` | For write tools: require reading the file first (default: `false`)
|
|
193
|
+
| Option | Type | Description |
|
|
194
|
+
| ------------------------ | --------- | ---------------------------------------------------------------------------------------------------------- |
|
|
195
|
+
| `enabled` | `boolean` | Whether the tool is available (default: `true`) |
|
|
196
|
+
| `requireApproval` | `boolean` | Whether the tool requires user approval before execution (default: `false`) |
|
|
197
|
+
| `requireReadBeforeWrite` | `boolean` | For write tools: require reading the file first (default: `false`) |
|
|
198
|
+
| `name` | `string` | Custom name for the tool. Replaces the default `mastra_workspace_*` name. |
|
|
199
|
+
| `maxOutputTokens` | `number` | Maximum tokens for tool output (default: `2000`). Output exceeding this limit is truncated using tiktoken. |
|
|
200
|
+
|
|
201
|
+
### Tool name remapping
|
|
202
|
+
|
|
203
|
+
Rename workspace tools to match the conventions your agent expects. The config key remains the original `WORKSPACE_TOOLS` constant — only the exposed name changes.
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
import { Workspace, LocalFilesystem, LocalSandbox, WORKSPACE_TOOLS } from '@mastra/core/workspace'
|
|
207
|
+
|
|
208
|
+
const workspace = new Workspace({
|
|
209
|
+
filesystem: new LocalFilesystem({ basePath: './workspace' }),
|
|
210
|
+
sandbox: new LocalSandbox({ workingDirectory: './workspace' }),
|
|
211
|
+
tools: {
|
|
212
|
+
[WORKSPACE_TOOLS.FILESYSTEM.READ_FILE]: { name: 'view' },
|
|
213
|
+
[WORKSPACE_TOOLS.FILESYSTEM.GREP]: { name: 'search_content' },
|
|
214
|
+
[WORKSPACE_TOOLS.FILESYSTEM.LIST_FILES]: { name: 'find_files' },
|
|
215
|
+
[WORKSPACE_TOOLS.SANDBOX.EXECUTE_COMMAND]: { name: 'execute_command' },
|
|
216
|
+
},
|
|
217
|
+
})
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The agent sees `view`, `search_content`, `find_files`, and `execute_command` instead of the default `mastra_workspace_*` names. Tool names must be unique — duplicate names or conflicts with other default names throw an error.
|
|
221
|
+
|
|
222
|
+
### Output truncation
|
|
223
|
+
|
|
224
|
+
Workspace tools automatically truncate large outputs to avoid exceeding LLM context limits. Two layers of truncation apply:
|
|
225
|
+
|
|
226
|
+
1. **Line-based tail**: Command output is limited to the last 200 lines by default (configurable per-command via the `tail` parameter)
|
|
227
|
+
2. **Token-based limit**: Tool output is capped at 2000 tokens by default
|
|
228
|
+
|
|
229
|
+
Set `maxOutputTokens` per tool to adjust the token limit:
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
const workspace = new Workspace({
|
|
233
|
+
// ...
|
|
234
|
+
tools: {
|
|
235
|
+
[WORKSPACE_TOOLS.SANDBOX.EXECUTE_COMMAND]: {
|
|
236
|
+
maxOutputTokens: 5000,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
})
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
ANSI escape codes (colors, cursor sequences) are automatically stripped from command output before it reaches the model.
|
|
198
243
|
|
|
199
244
|
### Read-before-write
|
|
200
245
|
|
|
@@ -220,7 +265,7 @@ const workspace = new Workspace({
|
|
|
220
265
|
await workspace.init()
|
|
221
266
|
```
|
|
222
267
|
|
|
223
|
-
### What init() does
|
|
268
|
+
### What `init()` does
|
|
224
269
|
|
|
225
270
|
Initialization runs setup logic for each configured provider:
|
|
226
271
|
|
|
@@ -6,21 +6,19 @@ Sandbox providers give agents the ability to execute shell commands. When you co
|
|
|
6
6
|
|
|
7
7
|
A sandbox provider executes commands in a controlled environment:
|
|
8
8
|
|
|
9
|
-
- **Command execution
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
|
|
15
|
-
When you assign a workspace with a sandbox to an agent, Mastra automatically includes the `execute_command` tool in the agent's toolset.
|
|
9
|
+
- **Command execution**: Run shell commands with arguments
|
|
10
|
+
- **Background processes**: Spawn long-running processes like dev servers and watchers
|
|
11
|
+
- **Working directory**: Commands run from a specific directory
|
|
12
|
+
- **Environment variables**: Control what variables are available
|
|
13
|
+
- **Timeouts**: Prevent long-running commands from hanging
|
|
14
|
+
- **Isolation**: Optional OS-level sandboxing for security
|
|
16
15
|
|
|
17
16
|
## Supported providers
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- [`
|
|
22
|
-
- [`
|
|
23
|
-
- [`E2BSandbox`](https://mastra.ai/reference/workspace/e2b-sandbox) - Executes commands in isolated E2B cloud sandboxes
|
|
18
|
+
- [`LocalSandbox`](https://mastra.ai/reference/workspace/local-sandbox): Executes commands on the local machine
|
|
19
|
+
- [`BlaxelSandbox`](https://mastra.ai/reference/workspace/blaxel-sandbox): Executes commands in isolated Blaxel cloud sandboxes
|
|
20
|
+
- [`DaytonaSandbox`](https://mastra.ai/reference/workspace/daytona-sandbox): Executes commands in isolated Daytona cloud sandboxes
|
|
21
|
+
- [`E2BSandbox`](https://mastra.ai/reference/workspace/e2b-sandbox): Executes commands in isolated E2B cloud sandboxes
|
|
24
22
|
|
|
25
23
|
## Basic usage
|
|
26
24
|
|
|
@@ -54,10 +52,71 @@ See [`LocalSandbox` reference](https://mastra.ai/reference/workspace/local-sandb
|
|
|
54
52
|
|
|
55
53
|
## Agent tools
|
|
56
54
|
|
|
57
|
-
When you configure a sandbox on a workspace, agents receive the `execute_command` tool for running shell commands.
|
|
55
|
+
When you configure a sandbox on a workspace, agents receive the `execute_command` tool for running shell commands.
|
|
56
|
+
|
|
57
|
+
If your sandbox provider supports running processes in the background, the `execute_command` tool also accepts `background: true` for starting long-running processes, and two additional tools are registered:
|
|
58
|
+
|
|
59
|
+
| Tool | Description |
|
|
60
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
61
|
+
| `execute_command` | Run a shell command. Returns stdout, stderr, and exit code. Supports `background: true` to spawn a long-running process and return a PID. |
|
|
62
|
+
| `get_process_output` | Get stdout, stderr, and status of a background process by PID. Supports `tail` to limit output lines and `wait: true` to block until exit. |
|
|
63
|
+
| `kill_process` | Stop a background process by PID. Returns recent output. |
|
|
64
|
+
|
|
65
|
+
These tools are registered automatically. See [Workspace class reference](https://mastra.ai/reference/workspace/workspace-class) for the full tool name list.
|
|
66
|
+
|
|
67
|
+
## Background process callbacks
|
|
68
|
+
|
|
69
|
+
When agents start background processes through the `execute_command` tool, you can receive lifecycle callbacks for stdout, stderr, and process exit. Configure these through the `backgroundProcesses` option on the `execute_command` tool:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { Workspace, LocalSandbox, WORKSPACE_TOOLS } from '@mastra/core/workspace'
|
|
73
|
+
|
|
74
|
+
const workspace = new Workspace({
|
|
75
|
+
sandbox: new LocalSandbox({ workingDirectory: './workspace' }),
|
|
76
|
+
tools: {
|
|
77
|
+
[WORKSPACE_TOOLS.SANDBOX.EXECUTE_COMMAND]: {
|
|
78
|
+
backgroundProcesses: {
|
|
79
|
+
onStdout: (data, { pid }) => console.log(`[${pid}] ${data}`),
|
|
80
|
+
onStderr: (data, { pid }) => console.error(`[${pid}] ${data}`),
|
|
81
|
+
onExit: ({ pid, exitCode }) => console.log(`Process ${pid} exited: ${exitCode}`),
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
These callbacks fire for all background processes started by the agent through the `execute_command` tool.
|
|
89
|
+
|
|
90
|
+
### Abort signal
|
|
91
|
+
|
|
92
|
+
By default, background processes inherit the agent's abort signal and are killed when the agent disconnects. Control this behavior with the `abortSignal` option:
|
|
93
|
+
|
|
94
|
+
- **`undefined`** (default): Uses the agent's abort signal
|
|
95
|
+
- **`AbortSignal`**: Uses a custom signal
|
|
96
|
+
- **`null` or `false`**: Disables abort — processes persist after agent shutdown
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { Workspace, LocalSandbox, WORKSPACE_TOOLS } from '@mastra/core/workspace'
|
|
100
|
+
|
|
101
|
+
const workspace = new Workspace({
|
|
102
|
+
sandbox: new LocalSandbox({ workingDirectory: './workspace' }),
|
|
103
|
+
tools: {
|
|
104
|
+
[WORKSPACE_TOOLS.SANDBOX.EXECUTE_COMMAND]: {
|
|
105
|
+
backgroundProcesses: {
|
|
106
|
+
abortSignal: null, // Processes survive agent disconnection
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
})
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Use `null` or `false` for cloud sandboxes (for example, E2B or Daytona) where processes should outlive the agent.
|
|
114
|
+
|
|
115
|
+
> **Note:** For the full `SandboxProcessManager` API (spawning processes programmatically, reading output, sending stdin), see the [`SandboxProcessManager` reference](https://mastra.ai/reference/workspace/process-manager).
|
|
58
116
|
|
|
59
117
|
## Related
|
|
60
118
|
|
|
119
|
+
- [`SandboxProcessManager` reference](https://mastra.ai/reference/workspace/process-manager)
|
|
61
120
|
- [`LocalSandbox` reference](https://mastra.ai/reference/workspace/local-sandbox)
|
|
62
121
|
- [`DaytonaSandbox` reference](https://mastra.ai/reference/workspace/daytona-sandbox)
|
|
63
122
|
- [`E2BSandbox` reference](https://mastra.ai/reference/workspace/e2b-sandbox)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Workspace
|
|
1
|
+
# Workspace skills
|
|
2
2
|
|
|
3
3
|
**Added in:** `@mastra/core@1.1.0`
|
|
4
4
|
|
|
@@ -24,7 +24,7 @@ A skill is a folder containing:
|
|
|
24
24
|
|
|
25
25
|
When skills are configured on a workspace, agents can discover and activate them during conversations.
|
|
26
26
|
|
|
27
|
-
## SKILL.md format
|
|
27
|
+
## `SKILL.md` format
|
|
28
28
|
|
|
29
29
|
Follow the official [skill specification](https://agentskills.io/specification) when creating your skill. Here is an example `SKILL.md` for a code review skill:
|
|
30
30
|
|
|
@@ -123,7 +123,7 @@ The agent has three skill tools:
|
|
|
123
123
|
|
|
124
124
|
- **`skill`** — Loads a skill's full instructions and returns them in the tool result. The agent calls this whenever it needs a skill's guidance.
|
|
125
125
|
- **`skill_read`** — Reads a file from a skill's `references/`, `scripts/`, or `assets/` directory.
|
|
126
|
-
- **`skill_search`** — Searches across all skill content. Uses BM25 or vector search when configured, otherwise falls back to
|
|
126
|
+
- **`skill_search`** — Searches across all skill content. Uses BM25 or vector search when configured, otherwise falls back to basic text matching.
|
|
127
127
|
|
|
128
128
|
This design is stateless — there is no activation state to track. If the skill instructions leave the conversation context (due to context window limits or compaction), the agent can call `skill` again to reload them.
|
|
129
129
|
|
|
@@ -162,7 +162,7 @@ const workspace = new Workspace({
|
|
|
162
162
|
- **`blobStore`** (`BlobStore`) — A content-addressable blob store instance that holds the actual file contents referenced by hash.
|
|
163
163
|
- **`versionCreatedAt`** (`Date`) — The timestamp when this skill version was published. Used as the modification time for all files in the version.
|
|
164
164
|
|
|
165
|
-
When `skillSource` is provided, it
|
|
165
|
+
When `skillSource` is provided, it's used instead of the workspace filesystem for skill discovery.
|
|
166
166
|
|
|
167
167
|
## Related
|
|
168
168
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
> **Tip:** Want to see more examples? Visit Mastra's [**UI Dojo**](https://ui-dojo.mastra.ai/) or the [Next.js quickstart guide](https://mastra.ai/guides/getting-started/next-js).
|
|
8
8
|
|
|
9
|
-
## Getting
|
|
9
|
+
## Getting started
|
|
10
10
|
|
|
11
11
|
Use Mastra and AI SDK UI together by installing the `@mastra/ai-sdk` package. `@mastra/ai-sdk` provides custom API routes and utilities for streaming Mastra agents in AI SDK-compatible formats. This includes chat, workflow, and network route handlers, along with utilities and exported types for UI integrations.
|
|
12
12
|
|
|
@@ -40,7 +40,7 @@ bun add @mastra/ai-sdk@latest @ai-sdk/react ai
|
|
|
40
40
|
|
|
41
41
|
You're now ready to follow the integration guides and recipes below!
|
|
42
42
|
|
|
43
|
-
## Integration
|
|
43
|
+
## Integration guides
|
|
44
44
|
|
|
45
45
|
Typically, you'll set up API routes that stream Mastra content in AI SDK-compatible format, and then use those routes in AI SDK UI hooks like `useChat()`. Below you'll find two main approaches to achieve this:
|
|
46
46
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
> **Tip:** Visit Mastra's [**"UI Dojo"**](https://ui-dojo.mastra.ai/) to see real-world examples of Assistant UI integrated with Mastra.
|
|
8
8
|
|
|
9
|
-
## Integration
|
|
9
|
+
## Integration guide
|
|
10
10
|
|
|
11
11
|
Run Mastra as a standalone server and connect your Next.js frontend (with Assistant UI) to its API endpoints.
|
|
12
12
|
|
|
@@ -8,7 +8,7 @@ Visit the [CopilotKit documentation](https://docs.copilotkit.ai/) to learn more
|
|
|
8
8
|
|
|
9
9
|
> **Tip:** Visit Mastra's [**"UI Dojo"**](https://ui-dojo.mastra.ai/) to see real-world examples of CopilotKit integrated with Mastra.
|
|
10
10
|
|
|
11
|
-
## Integration
|
|
11
|
+
## Integration guide
|
|
12
12
|
|
|
13
13
|
Run Mastra as a standalone server and connect your Next.js frontend (with CopilotKit) to its API endpoints.
|
|
14
14
|
|
|
@@ -274,7 +274,7 @@ Congratulations! You have successfully integrated Mastra with CopilotKit using a
|
|
|
274
274
|
|
|
275
275
|
## Deployment
|
|
276
276
|
|
|
277
|
-
When deploying your Mastra server with CopilotKit, you must exclude `@copilotkit/runtime` from the bundle. This package contains dependencies that
|
|
277
|
+
When deploying your Mastra server with CopilotKit, you must exclude `@copilotkit/runtime` from the bundle. This package contains dependencies that aren't compatible with bundling and will cause 500 errors if included.
|
|
278
278
|
|
|
279
279
|
> **Note:** This issue doesn't occur during development with `mastra dev` since it doesn't require bundling. However, anyone running `mastra build` for deployment will encounter this issue.
|
|
280
280
|
|
|
@@ -10,7 +10,7 @@ You'll need a [Mastra application](https://mastra.ai/guides/getting-started/quic
|
|
|
10
10
|
|
|
11
11
|
The **App Platform** uses an ephemeral filesystem, so any storage you configure (including observability storage) must be hosted externally. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a file URL, switch to a remotely hosted database.
|
|
12
12
|
|
|
13
|
-
## App
|
|
13
|
+
## App platform
|
|
14
14
|
|
|
15
15
|
After setting up your project, push it to your remote Git provider of choice (e.g. GitHub).
|
|
16
16
|
|
|
@@ -105,7 +105,7 @@ const incrementStep = createStep({
|
|
|
105
105
|
|
|
106
106
|
### Creating the workflow
|
|
107
107
|
|
|
108
|
-
Compose the steps into a workflow using the `dountil` loop pattern. The `createWorkflow()` function creates a function on Inngest server that
|
|
108
|
+
Compose the steps into a workflow using the `dountil` loop pattern. The `createWorkflow()` function creates a function on Inngest server that's invocable.
|
|
109
109
|
|
|
110
110
|
```ts
|
|
111
111
|
// workflow that is registered as a function on inngest server
|
|
@@ -169,7 +169,7 @@ export const mastra = new Mastra({
|
|
|
169
169
|
|
|
170
170
|
3. Open the Inngest Dashboard at <http://localhost:8288> and go to the **Apps** section in the sidebar to verify your Mastra workflow is registered
|
|
171
171
|
|
|
172
|
-
4. Invoke the workflow by going to **Functions**, selecting your workflow, and
|
|
172
|
+
4. Invoke the workflow by going to **Functions**, selecting your workflow, and selecting **Invoke** with the following input:
|
|
173
173
|
|
|
174
174
|
```json
|
|
175
175
|
{
|
|
@@ -227,9 +227,9 @@ Before you begin, make sure you have:
|
|
|
227
227
|
vercel --prod
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
-
5. Sync with the [Inngest dashboard](https://app.inngest.com/env/production/apps) by
|
|
230
|
+
5. Sync with the [Inngest dashboard](https://app.inngest.com/env/production/apps) by selecting **Sync new app with Vercel** and following the instructions
|
|
231
231
|
|
|
232
|
-
6. Invoke the workflow by going to **Functions**, selecting `workflow.increment-workflow`,
|
|
232
|
+
6. Invoke the workflow by going to **Functions**, selecting `workflow.increment-workflow`, selecting **All actions** > **Invoke**, and providing the following input:
|
|
233
233
|
|
|
234
234
|
```json
|
|
235
235
|
{
|
|
@@ -123,7 +123,7 @@ This creates a `src/mastra` folder with an example weather agent and the followi
|
|
|
123
123
|
|
|
124
124
|
You'll call `weather-agent.ts` from your Astro routes in the next steps.
|
|
125
125
|
|
|
126
|
-
## Install AI SDK UI & AI
|
|
126
|
+
## Install AI SDK UI & AI elements
|
|
127
127
|
|
|
128
128
|
Install AI SDK UI along with the Mastra adapter:
|
|
129
129
|
|
|
@@ -109,7 +109,7 @@ This creates a `src/mastra` folder with an example weather agent and the followi
|
|
|
109
109
|
|
|
110
110
|
You'll call `weather-agent.ts` from your chat UI in the next steps.
|
|
111
111
|
|
|
112
|
-
## Install AI SDK UI & AI
|
|
112
|
+
## Install AI SDK UI & AI elements
|
|
113
113
|
|
|
114
114
|
Install AI SDK UI along with the Mastra adapter:
|
|
115
115
|
|
|
@@ -95,7 +95,7 @@ You'll call `weather-agent.ts` from your Next.js routes in the next steps.
|
|
|
95
95
|
>
|
|
96
96
|
> Relative paths resolve based on each process's working directory, which differs between `next dev` and `mastra dev`.
|
|
97
97
|
|
|
98
|
-
## Install AI SDK UI & AI
|
|
98
|
+
## Install AI SDK UI & AI elements
|
|
99
99
|
|
|
100
100
|
Install AI SDK UI along with the Mastra adapter:
|
|
101
101
|
|
|
@@ -166,7 +166,7 @@ This creates a `src/mastra` folder with an example weather agent and the followi
|
|
|
166
166
|
|
|
167
167
|
You'll call `weather-agent.ts` from your chat UI in the next steps.
|
|
168
168
|
|
|
169
|
-
## Install AI SDK UI & AI
|
|
169
|
+
## Install AI SDK UI & AI elements
|
|
170
170
|
|
|
171
171
|
Install AI SDK UI along with the Mastra adapter:
|
|
172
172
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Building an AI
|
|
1
|
+
# Building an AI recruiter
|
|
2
2
|
|
|
3
3
|
In this guide, you'll learn how Mastra helps you build workflows with LLMs.
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ You'll create a workflow that gathers information from a candidate's resume, the
|
|
|
10
10
|
- An API key from a supported [Model Provider](https://mastra.ai/models)
|
|
11
11
|
- An existing Mastra project (Follow the [installation guide](https://mastra.ai/guides/getting-started/quickstart) to set up a new project)
|
|
12
12
|
|
|
13
|
-
## Building the
|
|
13
|
+
## Building the workflow
|
|
14
14
|
|
|
15
15
|
Set up the Workflow, define steps to extract and classify candidate data, and then ask suitable follow-up questions.
|
|
16
16
|
|
|
@@ -176,7 +176,7 @@ Set up the Workflow, define steps to extract and classify candidate data, and th
|
|
|
176
176
|
})
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
## Testing the
|
|
179
|
+
## Testing the workflow
|
|
180
180
|
|
|
181
181
|
You can test your workflow inside [Studio](https://mastra.ai/docs/getting-started/studio) by starting the development server:
|
|
182
182
|
|
|
@@ -223,4 +223,4 @@ Now, run the workflow and get output in your terminal:
|
|
|
223
223
|
npx tsx src/test-workflow.ts
|
|
224
224
|
```
|
|
225
225
|
|
|
226
|
-
You've
|
|
226
|
+
You've built a workflow to parse a resume and decide which question to ask based on the candidate's technical abilities. Congrats and happy hacking!
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# How to build an AI chef assistant
|
|
2
2
|
|
|
3
3
|
In this guide, you'll create a "Chef Assistant" agent that helps users cook meals with available ingredients.
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ You'll learn how to create the agent and register it with Mastra. Next, you'll i
|
|
|
12
12
|
- An API key from a supported [Model Provider](https://mastra.ai/models)
|
|
13
13
|
- An existing Mastra project (Follow the [installation guide](https://mastra.ai/guides/getting-started/quickstart) to set up a new project)
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Create the agent
|
|
16
16
|
|
|
17
17
|
To create an agent in Mastra use the `Agent` class to define it and then register it with Mastra.
|
|
18
18
|
|
|
@@ -42,7 +42,7 @@ To create an agent in Mastra use the `Agent` class to define it and then registe
|
|
|
42
42
|
})
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
##
|
|
45
|
+
## Interact with the agent
|
|
46
46
|
|
|
47
47
|
Depending on your requirements you can interact and get responses from the agent in different formats. In the following steps you'll learn how to generate, stream, and get structured output.
|
|
48
48
|
|
|
@@ -169,7 +169,7 @@ Depending on your requirements you can interact and get responses from the agent
|
|
|
169
169
|
}
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
##
|
|
172
|
+
## Run the agent server
|
|
173
173
|
|
|
174
174
|
Learn how to interact with your agent through Mastra's API.
|
|
175
175
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Building a
|
|
1
|
+
# Building a code review bot
|
|
2
2
|
|
|
3
3
|
In this guide, you'll build a code review bot that automatically reviews pull requests using workspace skills. The bot loads coding standards from skill files and provides structured feedback. You'll learn how to create a workspace with a skills directory, define an [Agent Skill](https://agentskills.io) with review instructions and reference files, and connect it to an agent that performs automated reviews.
|
|
4
4
|
|
|
@@ -75,7 +75,7 @@ Inside `workspace/skills/code-standards`, create a `references` folder to hold r
|
|
|
75
75
|
- Files: `kebab-case.ts`
|
|
76
76
|
- Booleans: Start with `is`, `has`, `should`
|
|
77
77
|
|
|
78
|
-
## Code
|
|
78
|
+
## Code organization
|
|
79
79
|
|
|
80
80
|
```typescript
|
|
81
81
|
// 1. Imports
|
|
@@ -96,7 +96,7 @@ function doSomething() {}
|
|
|
96
96
|
export { doSomething }
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
## Error
|
|
99
|
+
## Error handling
|
|
100
100
|
|
|
101
101
|
Always handle errors explicitly - never silently catch.
|
|
102
102
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Building a
|
|
1
|
+
# Building a dev assistant
|
|
2
2
|
|
|
3
3
|
In this guide, you'll build a complete development assistant that combines all workspace features:
|
|
4
4
|
|
|
@@ -123,7 +123,7 @@ description: Project coding standards and testing guidelines
|
|
|
123
123
|
|
|
124
124
|
# Coding Standards
|
|
125
125
|
|
|
126
|
-
## Code
|
|
126
|
+
## Code quality
|
|
127
127
|
|
|
128
128
|
- Functions under 50 lines
|
|
129
129
|
- Use descriptive variable names
|
|
@@ -135,7 +135,7 @@ description: Project coding standards and testing guidelines
|
|
|
135
135
|
- Use AAA pattern: Arrange, Act, Assert
|
|
136
136
|
- Cover happy paths and edge cases
|
|
137
137
|
|
|
138
|
-
## Before
|
|
138
|
+
## Before committing
|
|
139
139
|
|
|
140
140
|
1. Write implementation
|
|
141
141
|
2. Write comprehensive tests
|
|
@@ -148,7 +148,7 @@ Create a reference file at `workspace/skills/coding-standards/references/testing
|
|
|
148
148
|
````markdown
|
|
149
149
|
# Testing Guide
|
|
150
150
|
|
|
151
|
-
## AAA
|
|
151
|
+
## AAA pattern
|
|
152
152
|
|
|
153
153
|
```typescript
|
|
154
154
|
it('descriptive test name', () => {
|
|
@@ -163,7 +163,7 @@ it('descriptive test name', () => {
|
|
|
163
163
|
})
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
## What to
|
|
166
|
+
## What to test
|
|
167
167
|
|
|
168
168
|
- Happy paths (normal inputs)
|
|
169
169
|
- Edge cases (empty, null, boundary values)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Building a
|
|
1
|
+
# Building a docs manager
|
|
2
2
|
|
|
3
3
|
In this guide, you'll build a documentation manager that maintains your project's docs. It creates well-structured markdown files, keeps documentation organized, and prevents accidental overwrites. You'll learn how to set up a workspace filesystem, create an agent with document management instructions, and use it to generate and update documentation through conversational prompts.
|
|
4
4
|
|
|
@@ -65,7 +65,7 @@ Quick start guide for the project.
|
|
|
65
65
|
npm install example-package
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
## Quick
|
|
68
|
+
## Quick example
|
|
69
69
|
|
|
70
70
|
```typescript
|
|
71
71
|
import { Example } from 'example-package'
|
|
@@ -193,7 +193,7 @@ export const authConfig = {
|
|
|
193
193
|
}
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
-
## Basic
|
|
196
|
+
## Basic example
|
|
197
197
|
|
|
198
198
|
```typescript
|
|
199
199
|
import { createAuth } from '@example/auth'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Building a PR
|
|
1
|
+
# Building a PR description agent for GitHub Actions
|
|
2
2
|
|
|
3
3
|
In this guide, you'll build a [GitHub Action](https://docs.github.com/en/actions) that uses a Mastra agent to read pull request diffs, generate multi-language summaries, and write them directly to the PR description in the GitHub UI. The action runs whenever a pull request is created or updated and regenerates the description as the diff changes.
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ The setup consists of three parts:
|
|
|
10
10
|
- A GitHub Actions workflow that triggers on pull requests
|
|
11
11
|
- A Node.js script that connects the workflow to the agent
|
|
12
12
|
|
|
13
|
-
The finished action writes a description with summaries in English, Spanish, and Japanese, each marked with a flag emoji for
|
|
13
|
+
The finished action writes a description with summaries in English, Spanish, and Japanese, each marked with a flag emoji for quick scanning. For example:
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
16
|
🇬🇧 English
|
|
@@ -49,7 +49,7 @@ The workflow references this secret as `${{ secrets.OPENAI_API_KEY }}` and makes
|
|
|
49
49
|
|
|
50
50
|
The PR description agent is responsible for turning a git diff into a clear, reviewer-friendly pull request description.
|
|
51
51
|
|
|
52
|
-
This agent receives the raw diff from a pull request. It generates descriptions in the configured languages and formats the output using emoji flags so each language section is
|
|
52
|
+
This agent receives the raw diff from a pull request. It generates descriptions in the configured languages and formats the output using emoji flags so each language section is quick to scan in the PR.
|
|
53
53
|
|
|
54
54
|
```ts
|
|
55
55
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -117,7 +117,7 @@ Before deploying the workflow, you can test the agent in [Mastra Studio](https:/
|
|
|
117
117
|
|
|
118
118
|
The agent will return a formatted description with sections in English, Spanish, and Japanese.
|
|
119
119
|
|
|
120
|
-
## GitHub
|
|
120
|
+
## GitHub actions
|
|
121
121
|
|
|
122
122
|
GitHub Actions run your workflows in short-lived environments on GitHub's infrastructure. Each run starts with a clean virtual machine, checks out your code, installs dependencies, runs your workflow steps, and then shuts down. Nothing persists between runs unless you explicitly save it as an artifact or cache.
|
|
123
123
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Building a
|
|
1
|
+
# Building a notes MCP server
|
|
2
2
|
|
|
3
3
|
In this guide, you'll learn how to build a complete MCP (Model Context Protocol) server from scratch. This server will manage a collection of markdown notes and has these features:
|
|
4
4
|
|
|
@@ -99,7 +99,7 @@ Before you can create an MCP server you first need to install additional depende
|
|
|
99
99
|
└── tools/
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
## Creating the MCP
|
|
102
|
+
## Creating the MCP server
|
|
103
103
|
|
|
104
104
|
Let's add the MCP server!
|
|
105
105
|
|
|
@@ -401,7 +401,7 @@ Let's add the MCP server!
|
|
|
401
401
|
})
|
|
402
402
|
```
|
|
403
403
|
|
|
404
|
-
## Run the
|
|
404
|
+
## Run the server
|
|
405
405
|
|
|
406
406
|
Great, you've authored your first MCP server! Now you can try it out by starting the Mastra dev server and opening [Studio](https://mastra.ai/docs/getting-started/studio):
|
|
407
407
|
|
|
@@ -413,4 +413,4 @@ Open [`http://localhost:4111`](http://localhost:4111) in your browser. In the le
|
|
|
413
413
|
|
|
414
414
|
You'll now be presented with instructions on how to add the MCP server to your IDE. You're able to use this MCP server with any MCP Client. On the right side under **Available Tools** you can also select the **write** tool.
|
|
415
415
|
|
|
416
|
-
Inside the **write** tool, try it out by providing `test` as a name and `this is a test` for the markdown content. After
|
|
416
|
+
Inside the **write** tool, try it out by providing `test` as a name and `this is a test` for the markdown content. After selecting **Submit** you'll have a new `test.md` file inside `notes`.
|