@mastra/mcp-docs-server 1.1.5 → 1.1.6-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agents/adding-voice.md +349 -0
- package/.docs/docs/agents/agent-approval.md +558 -0
- package/.docs/docs/agents/agent-memory.md +209 -0
- package/.docs/docs/agents/guardrails.md +374 -0
- package/.docs/docs/agents/network-approval.md +275 -0
- package/.docs/docs/agents/networks.md +299 -0
- package/.docs/docs/agents/overview.md +304 -0
- package/.docs/docs/agents/processors.md +622 -0
- package/.docs/docs/agents/structured-output.md +273 -0
- package/.docs/docs/agents/supervisor-agents.md +304 -0
- package/.docs/docs/agents/using-tools.md +214 -0
- package/.docs/docs/build-with-ai/mcp-docs-server.md +238 -0
- package/.docs/docs/build-with-ai/skills.md +35 -0
- package/.docs/docs/community/contributing-templates.md +3 -0
- package/.docs/docs/community/discord.md +9 -0
- package/.docs/docs/community/licensing.md +66 -0
- package/.docs/docs/deployment/cloud-providers.md +15 -0
- package/.docs/docs/deployment/mastra-server.md +122 -0
- package/.docs/docs/deployment/monorepo.md +142 -0
- package/.docs/docs/deployment/overview.md +62 -0
- package/.docs/docs/deployment/studio.md +239 -0
- package/.docs/docs/deployment/web-framework.md +52 -0
- package/.docs/docs/deployment/workflow-runners.md +9 -0
- package/.docs/docs/evals/built-in-scorers.md +47 -0
- package/.docs/docs/evals/custom-scorers.md +519 -0
- package/.docs/docs/evals/overview.md +141 -0
- package/.docs/docs/evals/running-in-ci.md +124 -0
- package/.docs/docs/getting-started/build-with-ai.md +68 -0
- package/.docs/docs/getting-started/manual-install.md +226 -0
- package/.docs/docs/getting-started/project-structure.md +60 -0
- package/.docs/docs/getting-started/start.md +28 -0
- package/.docs/docs/getting-started/studio.md +101 -0
- package/.docs/docs/index.md +43 -0
- package/.docs/docs/mastra-cloud/deployment.md +77 -0
- package/.docs/docs/mastra-cloud/observability.md +38 -0
- package/.docs/docs/mastra-cloud/overview.md +23 -0
- package/.docs/docs/mastra-cloud/setup.md +42 -0
- package/.docs/docs/mastra-cloud/studio.md +24 -0
- package/.docs/docs/mastra-code/configuration.md +299 -0
- package/.docs/docs/mastra-code/customization.md +228 -0
- package/.docs/docs/mastra-code/modes.md +104 -0
- package/.docs/docs/mastra-code/overview.md +135 -0
- package/.docs/docs/mastra-code/tools.md +229 -0
- package/.docs/docs/mcp/overview.md +373 -0
- package/.docs/docs/mcp/publishing-mcp-server.md +95 -0
- package/.docs/docs/memory/memory-processors.md +314 -0
- package/.docs/docs/memory/message-history.md +260 -0
- package/.docs/docs/memory/observational-memory.md +248 -0
- package/.docs/docs/memory/overview.md +45 -0
- package/.docs/docs/memory/semantic-recall.md +272 -0
- package/.docs/docs/memory/storage.md +261 -0
- package/.docs/docs/memory/working-memory.md +400 -0
- package/.docs/docs/observability/datasets/overview.md +198 -0
- package/.docs/docs/observability/datasets/running-experiments.md +274 -0
- package/.docs/docs/observability/logging.md +99 -0
- package/.docs/docs/observability/overview.md +70 -0
- package/.docs/docs/observability/tracing/bridges/otel.md +209 -0
- package/.docs/docs/observability/tracing/exporters/arize.md +272 -0
- package/.docs/docs/observability/tracing/exporters/braintrust.md +111 -0
- package/.docs/docs/observability/tracing/exporters/cloud.md +127 -0
- package/.docs/docs/observability/tracing/exporters/datadog.md +187 -0
- package/.docs/docs/observability/tracing/exporters/default.md +209 -0
- package/.docs/docs/observability/tracing/exporters/laminar.md +100 -0
- package/.docs/docs/observability/tracing/exporters/langfuse.md +213 -0
- package/.docs/docs/observability/tracing/exporters/langsmith.md +198 -0
- package/.docs/docs/observability/tracing/exporters/otel.md +476 -0
- package/.docs/docs/observability/tracing/exporters/posthog.md +148 -0
- package/.docs/docs/observability/tracing/exporters/sentry.md +208 -0
- package/.docs/docs/observability/tracing/overview.md +1112 -0
- package/.docs/docs/observability/tracing/processors/sensitive-data-filter.md +300 -0
- package/.docs/docs/rag/chunking-and-embedding.md +183 -0
- package/.docs/docs/rag/graph-rag.md +215 -0
- package/.docs/docs/rag/overview.md +72 -0
- package/.docs/docs/rag/retrieval.md +515 -0
- package/.docs/docs/rag/vector-databases.md +645 -0
- package/.docs/docs/server/auth/auth0.md +220 -0
- package/.docs/docs/server/auth/better-auth.md +203 -0
- package/.docs/docs/server/auth/clerk.md +132 -0
- package/.docs/docs/server/auth/composite-auth.md +234 -0
- package/.docs/docs/server/auth/custom-auth-provider.md +513 -0
- package/.docs/docs/server/auth/firebase.md +272 -0
- package/.docs/docs/server/auth/jwt.md +110 -0
- package/.docs/docs/server/auth/simple-auth.md +180 -0
- package/.docs/docs/server/auth/supabase.md +117 -0
- package/.docs/docs/server/auth/workos.md +186 -0
- package/.docs/docs/server/auth.md +38 -0
- package/.docs/docs/server/custom-adapters.md +378 -0
- package/.docs/docs/server/custom-api-routes.md +267 -0
- package/.docs/docs/server/mastra-client.md +243 -0
- package/.docs/docs/server/mastra-server.md +71 -0
- package/.docs/docs/server/middleware.md +225 -0
- package/.docs/docs/server/request-context.md +471 -0
- package/.docs/docs/server/server-adapters.md +547 -0
- package/.docs/docs/streaming/events.md +237 -0
- package/.docs/docs/streaming/overview.md +175 -0
- package/.docs/docs/streaming/tool-streaming.md +175 -0
- package/.docs/docs/streaming/workflow-streaming.md +109 -0
- package/.docs/docs/voice/overview.md +959 -0
- package/.docs/docs/voice/speech-to-speech.md +102 -0
- package/.docs/docs/voice/speech-to-text.md +79 -0
- package/.docs/docs/voice/text-to-speech.md +83 -0
- package/.docs/docs/workflows/agents-and-tools.md +166 -0
- package/.docs/docs/workflows/control-flow.md +822 -0
- package/.docs/docs/workflows/error-handling.md +360 -0
- package/.docs/docs/workflows/human-in-the-loop.md +215 -0
- package/.docs/docs/workflows/overview.md +370 -0
- package/.docs/docs/workflows/snapshots.md +238 -0
- package/.docs/docs/workflows/suspend-and-resume.md +205 -0
- package/.docs/docs/workflows/time-travel.md +309 -0
- package/.docs/docs/workflows/workflow-state.md +181 -0
- package/.docs/docs/workspace/filesystem.md +164 -0
- package/.docs/docs/workspace/overview.md +239 -0
- package/.docs/docs/workspace/sandbox.md +63 -0
- package/.docs/docs/workspace/search.md +243 -0
- package/.docs/docs/workspace/skills.md +169 -0
- package/.docs/guides/agent-frameworks/ai-sdk.md +140 -0
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +1499 -0
- package/.docs/guides/build-your-ui/assistant-ui.md +156 -0
- package/.docs/guides/build-your-ui/copilotkit.md +289 -0
- package/.docs/guides/deployment/amazon-ec2.md +130 -0
- package/.docs/guides/deployment/aws-lambda.md +248 -0
- package/.docs/guides/deployment/azure-app-services.md +114 -0
- package/.docs/guides/deployment/cloudflare.md +99 -0
- package/.docs/guides/deployment/digital-ocean.md +168 -0
- package/.docs/guides/deployment/inngest.md +682 -0
- package/.docs/guides/deployment/netlify.md +77 -0
- package/.docs/guides/deployment/vercel.md +101 -0
- package/.docs/guides/getting-started/astro.md +398 -0
- package/.docs/guides/getting-started/electron.md +504 -0
- package/.docs/guides/getting-started/express.md +251 -0
- package/.docs/guides/getting-started/hono.md +190 -0
- package/.docs/guides/getting-started/next-js.md +347 -0
- package/.docs/guides/getting-started/nuxt.md +497 -0
- package/.docs/guides/getting-started/quickstart.md +67 -0
- package/.docs/guides/getting-started/sveltekit.md +296 -0
- package/.docs/guides/getting-started/vite-react.md +425 -0
- package/.docs/guides/guide/ai-recruiter.md +226 -0
- package/.docs/guides/guide/chef-michel.md +211 -0
- package/.docs/guides/guide/code-review-bot.md +226 -0
- package/.docs/guides/guide/dev-assistant.md +307 -0
- package/.docs/guides/guide/docs-manager.md +238 -0
- package/.docs/guides/guide/github-actions-pr-description.md +236 -0
- package/.docs/guides/guide/notes-mcp-server.md +416 -0
- package/.docs/guides/guide/research-assistant.md +348 -0
- package/.docs/guides/guide/research-coordinator.md +416 -0
- package/.docs/guides/guide/stock-agent.md +132 -0
- package/.docs/guides/guide/web-search.md +320 -0
- package/.docs/guides/guide/whatsapp-chat-bot.md +405 -0
- package/.docs/guides/index.md +3 -0
- package/.docs/guides/migrations/agentnetwork.md +97 -0
- package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +112 -0
- package/.docs/guides/migrations/network-to-supervisor.md +261 -0
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +404 -0
- package/.docs/guides/migrations/upgrade-to-v1/cli.md +57 -0
- package/.docs/guides/migrations/upgrade-to-v1/client.md +337 -0
- package/.docs/guides/migrations/upgrade-to-v1/deployment.md +37 -0
- package/.docs/guides/migrations/upgrade-to-v1/evals.md +239 -0
- package/.docs/guides/migrations/upgrade-to-v1/mastra.md +143 -0
- package/.docs/guides/migrations/upgrade-to-v1/mcp.md +97 -0
- package/.docs/guides/migrations/upgrade-to-v1/memory.md +285 -0
- package/.docs/guides/migrations/upgrade-to-v1/overview.md +119 -0
- package/.docs/guides/migrations/upgrade-to-v1/processors.md +68 -0
- package/.docs/guides/migrations/upgrade-to-v1/rag.md +42 -0
- package/.docs/guides/migrations/upgrade-to-v1/storage.md +553 -0
- package/.docs/guides/migrations/upgrade-to-v1/tools.md +180 -0
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +412 -0
- package/.docs/guides/migrations/upgrade-to-v1/vectors.md +87 -0
- package/.docs/guides/migrations/upgrade-to-v1/voice.md +30 -0
- package/.docs/guides/migrations/upgrade-to-v1/workflows.md +341 -0
- package/.docs/guides/migrations/vnext-to-standard-apis.md +362 -0
- package/.docs/models/embeddings.md +161 -0
- package/.docs/models/gateways/azure-openai.md +128 -0
- package/.docs/models/gateways/custom-gateways.md +545 -0
- package/.docs/models/gateways/netlify.md +88 -0
- package/.docs/models/gateways/openrouter.md +219 -0
- package/.docs/models/gateways/vercel.md +225 -0
- package/.docs/models/gateways.md +14 -0
- package/.docs/models/index.md +286 -0
- package/.docs/models/providers/302ai.md +134 -0
- package/.docs/models/providers/abacus.md +125 -0
- package/.docs/models/providers/agentrouter.md +90 -0
- package/.docs/models/providers/aihubmix.md +107 -0
- package/.docs/models/providers/alibaba-cn.md +135 -0
- package/.docs/models/providers/alibaba.md +111 -0
- package/.docs/models/providers/amazon-bedrock.md +33 -0
- package/.docs/models/providers/anthropic.md +153 -0
- package/.docs/models/providers/azure.md +33 -0
- package/.docs/models/providers/bailing.md +72 -0
- package/.docs/models/providers/baseten.md +77 -0
- package/.docs/models/providers/berget.md +78 -0
- package/.docs/models/providers/cerebras.md +101 -0
- package/.docs/models/providers/chutes.md +136 -0
- package/.docs/models/providers/cloudflare-ai-gateway.md +33 -0
- package/.docs/models/providers/cloudflare-workers-ai.md +109 -0
- package/.docs/models/providers/cohere.md +33 -0
- package/.docs/models/providers/cortecs.md +91 -0
- package/.docs/models/providers/deepinfra.md +112 -0
- package/.docs/models/providers/deepseek.md +88 -0
- package/.docs/models/providers/fastrouter.md +84 -0
- package/.docs/models/providers/fireworks-ai.md +89 -0
- package/.docs/models/providers/firmware.md +85 -0
- package/.docs/models/providers/friendli.md +78 -0
- package/.docs/models/providers/github-models.md +125 -0
- package/.docs/models/providers/google-vertex.md +33 -0
- package/.docs/models/providers/google.md +159 -0
- package/.docs/models/providers/groq.md +107 -0
- package/.docs/models/providers/helicone.md +161 -0
- package/.docs/models/providers/huggingface.md +90 -0
- package/.docs/models/providers/iflowcn.md +84 -0
- package/.docs/models/providers/inception.md +72 -0
- package/.docs/models/providers/inference.md +79 -0
- package/.docs/models/providers/io-intelligence.md +87 -0
- package/.docs/models/providers/io-net.md +87 -0
- package/.docs/models/providers/jiekou.md +131 -0
- package/.docs/models/providers/kilo.md +333 -0
- package/.docs/models/providers/kimi-for-coding.md +100 -0
- package/.docs/models/providers/kuae-cloud-coding-plan.md +71 -0
- package/.docs/models/providers/llama.md +77 -0
- package/.docs/models/providers/lmstudio.md +73 -0
- package/.docs/models/providers/lucidquery.md +72 -0
- package/.docs/models/providers/minimax-cn-coding-plan.md +102 -0
- package/.docs/models/providers/minimax-cn.md +102 -0
- package/.docs/models/providers/minimax-coding-plan.md +102 -0
- package/.docs/models/providers/minimax.md +104 -0
- package/.docs/models/providers/mistral.md +124 -0
- package/.docs/models/providers/moark.md +72 -0
- package/.docs/models/providers/modelscope.md +77 -0
- package/.docs/models/providers/moonshotai-cn.md +76 -0
- package/.docs/models/providers/moonshotai.md +76 -0
- package/.docs/models/providers/morph.md +73 -0
- package/.docs/models/providers/nano-gpt.md +103 -0
- package/.docs/models/providers/nebius.md +116 -0
- package/.docs/models/providers/nova.md +72 -0
- package/.docs/models/providers/novita-ai.md +154 -0
- package/.docs/models/providers/nvidia.md +141 -0
- package/.docs/models/providers/ollama-cloud.md +103 -0
- package/.docs/models/providers/ollama.md +33 -0
- package/.docs/models/providers/openai.md +193 -0
- package/.docs/models/providers/opencode.md +100 -0
- package/.docs/models/providers/ovhcloud.md +83 -0
- package/.docs/models/providers/perplexity.md +100 -0
- package/.docs/models/providers/poe.md +183 -0
- package/.docs/models/providers/privatemode-ai.md +75 -0
- package/.docs/models/providers/requesty.md +90 -0
- package/.docs/models/providers/scaleway.md +84 -0
- package/.docs/models/providers/siliconflow-cn.md +138 -0
- package/.docs/models/providers/siliconflow.md +140 -0
- package/.docs/models/providers/stackit.md +78 -0
- package/.docs/models/providers/stepfun.md +73 -0
- package/.docs/models/providers/submodel.md +79 -0
- package/.docs/models/providers/synthetic.md +96 -0
- package/.docs/models/providers/togetherai.md +115 -0
- package/.docs/models/providers/upstage.md +73 -0
- package/.docs/models/providers/venice.md +95 -0
- package/.docs/models/providers/vivgrid.md +106 -0
- package/.docs/models/providers/vultr.md +75 -0
- package/.docs/models/providers/wandb.md +80 -0
- package/.docs/models/providers/xai.md +141 -0
- package/.docs/models/providers/xiaomi.md +71 -0
- package/.docs/models/providers/zai-coding-plan.md +80 -0
- package/.docs/models/providers/zai.md +79 -0
- package/.docs/models/providers/zenmux.md +161 -0
- package/.docs/models/providers/zhipuai-coding-plan.md +79 -0
- package/.docs/models/providers/zhipuai.md +79 -0
- package/.docs/models/providers.md +81 -0
- package/.docs/reference/agents/agent.md +141 -0
- package/.docs/reference/agents/generate.md +186 -0
- package/.docs/reference/agents/generateLegacy.md +173 -0
- package/.docs/reference/agents/getDefaultGenerateOptions.md +36 -0
- package/.docs/reference/agents/getDefaultOptions.md +34 -0
- package/.docs/reference/agents/getDefaultStreamOptions.md +36 -0
- package/.docs/reference/agents/getDescription.md +21 -0
- package/.docs/reference/agents/getInstructions.md +34 -0
- package/.docs/reference/agents/getLLM.md +37 -0
- package/.docs/reference/agents/getMemory.md +34 -0
- package/.docs/reference/agents/getModel.md +34 -0
- package/.docs/reference/agents/getTools.md +29 -0
- package/.docs/reference/agents/getVoice.md +34 -0
- package/.docs/reference/agents/listAgents.md +35 -0
- package/.docs/reference/agents/listScorers.md +34 -0
- package/.docs/reference/agents/listTools.md +34 -0
- package/.docs/reference/agents/listWorkflows.md +34 -0
- package/.docs/reference/agents/network.md +133 -0
- package/.docs/reference/ai-sdk/chat-route.md +82 -0
- package/.docs/reference/ai-sdk/handle-chat-stream.md +53 -0
- package/.docs/reference/ai-sdk/handle-network-stream.md +37 -0
- package/.docs/reference/ai-sdk/handle-workflow-stream.md +55 -0
- package/.docs/reference/ai-sdk/network-route.md +74 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +231 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +79 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +76 -0
- package/.docs/reference/ai-sdk/with-mastra.md +59 -0
- package/.docs/reference/ai-sdk/workflow-route.md +79 -0
- package/.docs/reference/auth/auth0.md +73 -0
- package/.docs/reference/auth/better-auth.md +71 -0
- package/.docs/reference/auth/clerk.md +36 -0
- package/.docs/reference/auth/firebase.md +80 -0
- package/.docs/reference/auth/jwt.md +26 -0
- package/.docs/reference/auth/supabase.md +33 -0
- package/.docs/reference/auth/workos.md +84 -0
- package/.docs/reference/cli/create-mastra.md +137 -0
- package/.docs/reference/cli/mastra.md +336 -0
- package/.docs/reference/client-js/agents.md +437 -0
- package/.docs/reference/client-js/error-handling.md +16 -0
- package/.docs/reference/client-js/logs.md +24 -0
- package/.docs/reference/client-js/mastra-client.md +63 -0
- package/.docs/reference/client-js/memory.md +221 -0
- package/.docs/reference/client-js/observability.md +72 -0
- package/.docs/reference/client-js/telemetry.md +20 -0
- package/.docs/reference/client-js/tools.md +44 -0
- package/.docs/reference/client-js/vectors.md +79 -0
- package/.docs/reference/client-js/workflows.md +199 -0
- package/.docs/reference/configuration.md +752 -0
- package/.docs/reference/core/addGateway.md +42 -0
- package/.docs/reference/core/getAgent.md +21 -0
- package/.docs/reference/core/getAgentById.md +21 -0
- package/.docs/reference/core/getDeployer.md +22 -0
- package/.docs/reference/core/getGateway.md +38 -0
- package/.docs/reference/core/getGatewayById.md +41 -0
- package/.docs/reference/core/getLogger.md +22 -0
- package/.docs/reference/core/getMCPServer.md +47 -0
- package/.docs/reference/core/getMCPServerById.md +55 -0
- package/.docs/reference/core/getMemory.md +50 -0
- package/.docs/reference/core/getScorer.md +54 -0
- package/.docs/reference/core/getScorerById.md +54 -0
- package/.docs/reference/core/getServer.md +22 -0
- package/.docs/reference/core/getStorage.md +22 -0
- package/.docs/reference/core/getStoredAgentById.md +89 -0
- package/.docs/reference/core/getTelemetry.md +22 -0
- package/.docs/reference/core/getVector.md +22 -0
- package/.docs/reference/core/getWorkflow.md +42 -0
- package/.docs/reference/core/listAgents.md +21 -0
- package/.docs/reference/core/listGateways.md +40 -0
- package/.docs/reference/core/listLogs.md +38 -0
- package/.docs/reference/core/listLogsByRunId.md +36 -0
- package/.docs/reference/core/listMCPServers.md +55 -0
- package/.docs/reference/core/listMemory.md +56 -0
- package/.docs/reference/core/listScorers.md +29 -0
- package/.docs/reference/core/listStoredAgents.md +93 -0
- package/.docs/reference/core/listVectors.md +22 -0
- package/.docs/reference/core/listWorkflows.md +21 -0
- package/.docs/reference/core/mastra-class.md +66 -0
- package/.docs/reference/core/mastra-model-gateway.md +153 -0
- package/.docs/reference/core/setLogger.md +26 -0
- package/.docs/reference/core/setStorage.md +27 -0
- package/.docs/reference/datasets/addItem.md +37 -0
- package/.docs/reference/datasets/addItems.md +35 -0
- package/.docs/reference/datasets/compareExperiments.md +52 -0
- package/.docs/reference/datasets/create.md +51 -0
- package/.docs/reference/datasets/dataset.md +82 -0
- package/.docs/reference/datasets/datasets-manager.md +94 -0
- package/.docs/reference/datasets/delete.md +25 -0
- package/.docs/reference/datasets/deleteExperiment.md +27 -0
- package/.docs/reference/datasets/deleteItem.md +27 -0
- package/.docs/reference/datasets/deleteItems.md +29 -0
- package/.docs/reference/datasets/get.md +31 -0
- package/.docs/reference/datasets/getDetails.md +47 -0
- package/.docs/reference/datasets/getExperiment.md +30 -0
- package/.docs/reference/datasets/getItem.md +33 -0
- package/.docs/reference/datasets/getItemHistory.md +31 -0
- package/.docs/reference/datasets/list.md +31 -0
- package/.docs/reference/datasets/listExperimentResults.md +39 -0
- package/.docs/reference/datasets/listExperiments.md +33 -0
- package/.docs/reference/datasets/listItems.md +46 -0
- package/.docs/reference/datasets/listVersions.md +33 -0
- package/.docs/reference/datasets/startExperiment.md +62 -0
- package/.docs/reference/datasets/startExperimentAsync.md +43 -0
- package/.docs/reference/datasets/update.md +48 -0
- package/.docs/reference/datasets/updateItem.md +38 -0
- package/.docs/reference/deployer/cloudflare.md +79 -0
- package/.docs/reference/deployer/netlify.md +80 -0
- package/.docs/reference/deployer/vercel.md +91 -0
- package/.docs/reference/deployer.md +100 -0
- package/.docs/reference/evals/answer-relevancy.md +105 -0
- package/.docs/reference/evals/answer-similarity.md +99 -0
- package/.docs/reference/evals/bias.md +120 -0
- package/.docs/reference/evals/completeness.md +136 -0
- package/.docs/reference/evals/content-similarity.md +101 -0
- package/.docs/reference/evals/context-precision.md +196 -0
- package/.docs/reference/evals/context-relevance.md +531 -0
- package/.docs/reference/evals/create-scorer.md +270 -0
- package/.docs/reference/evals/faithfulness.md +114 -0
- package/.docs/reference/evals/hallucination.md +213 -0
- package/.docs/reference/evals/keyword-coverage.md +128 -0
- package/.docs/reference/evals/mastra-scorer.md +123 -0
- package/.docs/reference/evals/noise-sensitivity.md +675 -0
- package/.docs/reference/evals/prompt-alignment.md +614 -0
- package/.docs/reference/evals/run-evals.md +179 -0
- package/.docs/reference/evals/scorer-utils.md +326 -0
- package/.docs/reference/evals/textual-difference.md +113 -0
- package/.docs/reference/evals/tone-consistency.md +119 -0
- package/.docs/reference/evals/tool-call-accuracy.md +533 -0
- package/.docs/reference/evals/toxicity.md +123 -0
- package/.docs/reference/harness/harness-class.md +708 -0
- package/.docs/reference/index.md +277 -0
- package/.docs/reference/logging/pino-logger.md +117 -0
- package/.docs/reference/mastra-code/createMastraCode.md +108 -0
- package/.docs/reference/memory/clone-utilities.md +199 -0
- package/.docs/reference/memory/cloneThread.md +130 -0
- package/.docs/reference/memory/createThread.md +68 -0
- package/.docs/reference/memory/deleteMessages.md +38 -0
- package/.docs/reference/memory/getThreadById.md +24 -0
- package/.docs/reference/memory/listThreads.md +145 -0
- package/.docs/reference/memory/memory-class.md +147 -0
- package/.docs/reference/memory/observational-memory.md +565 -0
- package/.docs/reference/memory/recall.md +91 -0
- package/.docs/reference/observability/tracing/bridges/otel.md +131 -0
- package/.docs/reference/observability/tracing/configuration.md +178 -0
- package/.docs/reference/observability/tracing/exporters/arize.md +141 -0
- package/.docs/reference/observability/tracing/exporters/braintrust.md +93 -0
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +163 -0
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +138 -0
- package/.docs/reference/observability/tracing/exporters/datadog.md +116 -0
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +174 -0
- package/.docs/reference/observability/tracing/exporters/laminar.md +78 -0
- package/.docs/reference/observability/tracing/exporters/langfuse.md +134 -0
- package/.docs/reference/observability/tracing/exporters/langsmith.md +108 -0
- package/.docs/reference/observability/tracing/exporters/otel.md +199 -0
- package/.docs/reference/observability/tracing/exporters/posthog.md +92 -0
- package/.docs/reference/observability/tracing/exporters/sentry.md +184 -0
- package/.docs/reference/observability/tracing/instances.md +107 -0
- package/.docs/reference/observability/tracing/interfaces.md +743 -0
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +144 -0
- package/.docs/reference/observability/tracing/spans.md +224 -0
- package/.docs/reference/processors/batch-parts-processor.md +61 -0
- package/.docs/reference/processors/language-detector.md +82 -0
- package/.docs/reference/processors/message-history-processor.md +85 -0
- package/.docs/reference/processors/moderation-processor.md +104 -0
- package/.docs/reference/processors/pii-detector.md +108 -0
- package/.docs/reference/processors/processor-interface.md +521 -0
- package/.docs/reference/processors/prompt-injection-detector.md +72 -0
- package/.docs/reference/processors/semantic-recall-processor.md +117 -0
- package/.docs/reference/processors/system-prompt-scrubber.md +80 -0
- package/.docs/reference/processors/token-limiter-processor.md +115 -0
- package/.docs/reference/processors/tool-call-filter.md +85 -0
- package/.docs/reference/processors/tool-search-processor.md +111 -0
- package/.docs/reference/processors/unicode-normalizer.md +62 -0
- package/.docs/reference/processors/working-memory-processor.md +152 -0
- package/.docs/reference/rag/chunk.md +221 -0
- package/.docs/reference/rag/database-config.md +261 -0
- package/.docs/reference/rag/document.md +114 -0
- package/.docs/reference/rag/embeddings.md +92 -0
- package/.docs/reference/rag/extract-params.md +168 -0
- package/.docs/reference/rag/graph-rag.md +111 -0
- package/.docs/reference/rag/metadata-filters.md +216 -0
- package/.docs/reference/rag/rerank.md +75 -0
- package/.docs/reference/rag/rerankWithScorer.md +80 -0
- package/.docs/reference/server/create-route.md +262 -0
- package/.docs/reference/server/express-adapter.md +176 -0
- package/.docs/reference/server/fastify-adapter.md +90 -0
- package/.docs/reference/server/hono-adapter.md +162 -0
- package/.docs/reference/server/koa-adapter.md +127 -0
- package/.docs/reference/server/mastra-server.md +298 -0
- package/.docs/reference/server/register-api-route.md +249 -0
- package/.docs/reference/server/routes.md +306 -0
- package/.docs/reference/storage/cloudflare-d1.md +218 -0
- package/.docs/reference/storage/cloudflare.md +88 -0
- package/.docs/reference/storage/composite.md +235 -0
- package/.docs/reference/storage/convex.md +161 -0
- package/.docs/reference/storage/dynamodb.md +282 -0
- package/.docs/reference/storage/lance.md +131 -0
- package/.docs/reference/storage/libsql.md +135 -0
- package/.docs/reference/storage/mongodb.md +262 -0
- package/.docs/reference/storage/mssql.md +157 -0
- package/.docs/reference/storage/overview.md +121 -0
- package/.docs/reference/storage/postgresql.md +526 -0
- package/.docs/reference/storage/upstash.md +160 -0
- package/.docs/reference/streaming/ChunkType.md +292 -0
- package/.docs/reference/streaming/agents/MastraModelOutput.md +182 -0
- package/.docs/reference/streaming/agents/stream.md +221 -0
- package/.docs/reference/streaming/agents/streamLegacy.md +142 -0
- package/.docs/reference/streaming/workflows/observeStream.md +42 -0
- package/.docs/reference/streaming/workflows/resumeStream.md +61 -0
- package/.docs/reference/streaming/workflows/stream.md +88 -0
- package/.docs/reference/streaming/workflows/timeTravelStream.md +142 -0
- package/.docs/reference/templates/overview.md +194 -0
- package/.docs/reference/tools/create-tool.md +237 -0
- package/.docs/reference/tools/document-chunker-tool.md +89 -0
- package/.docs/reference/tools/graph-rag-tool.md +182 -0
- package/.docs/reference/tools/mcp-client.md +954 -0
- package/.docs/reference/tools/mcp-server.md +1271 -0
- package/.docs/reference/tools/vector-query-tool.md +459 -0
- package/.docs/reference/vectors/astra.md +121 -0
- package/.docs/reference/vectors/chroma.md +264 -0
- package/.docs/reference/vectors/convex.md +300 -0
- package/.docs/reference/vectors/couchbase.md +226 -0
- package/.docs/reference/vectors/duckdb.md +318 -0
- package/.docs/reference/vectors/elasticsearch.md +189 -0
- package/.docs/reference/vectors/lance.md +220 -0
- package/.docs/reference/vectors/libsql.md +305 -0
- package/.docs/reference/vectors/mongodb.md +295 -0
- package/.docs/reference/vectors/opensearch.md +99 -0
- package/.docs/reference/vectors/pg.md +408 -0
- package/.docs/reference/vectors/pinecone.md +168 -0
- package/.docs/reference/vectors/qdrant.md +222 -0
- package/.docs/reference/vectors/s3vectors.md +277 -0
- package/.docs/reference/vectors/turbopuffer.md +157 -0
- package/.docs/reference/vectors/upstash.md +294 -0
- package/.docs/reference/vectors/vectorize.md +147 -0
- package/.docs/reference/voice/azure.md +148 -0
- package/.docs/reference/voice/cloudflare.md +83 -0
- package/.docs/reference/voice/composite-voice.md +121 -0
- package/.docs/reference/voice/deepgram.md +79 -0
- package/.docs/reference/voice/elevenlabs.md +98 -0
- package/.docs/reference/voice/google-gemini-live.md +378 -0
- package/.docs/reference/voice/google.md +228 -0
- package/.docs/reference/voice/mastra-voice.md +311 -0
- package/.docs/reference/voice/murf.md +122 -0
- package/.docs/reference/voice/openai-realtime.md +203 -0
- package/.docs/reference/voice/openai.md +88 -0
- package/.docs/reference/voice/playai.md +80 -0
- package/.docs/reference/voice/sarvam.md +126 -0
- package/.docs/reference/voice/speechify.md +75 -0
- package/.docs/reference/voice/voice.addInstructions.md +55 -0
- package/.docs/reference/voice/voice.addTools.md +67 -0
- package/.docs/reference/voice/voice.answer.md +54 -0
- package/.docs/reference/voice/voice.close.md +51 -0
- package/.docs/reference/voice/voice.connect.md +94 -0
- package/.docs/reference/voice/voice.events.md +37 -0
- package/.docs/reference/voice/voice.getSpeakers.md +129 -0
- package/.docs/reference/voice/voice.listen.md +164 -0
- package/.docs/reference/voice/voice.off.md +54 -0
- package/.docs/reference/voice/voice.on.md +111 -0
- package/.docs/reference/voice/voice.send.md +65 -0
- package/.docs/reference/voice/voice.speak.md +157 -0
- package/.docs/reference/voice/voice.updateConfig.md +60 -0
- package/.docs/reference/workflows/run-methods/cancel.md +86 -0
- package/.docs/reference/workflows/run-methods/restart.md +33 -0
- package/.docs/reference/workflows/run-methods/resume.md +59 -0
- package/.docs/reference/workflows/run-methods/start.md +58 -0
- package/.docs/reference/workflows/run-methods/startAsync.md +67 -0
- package/.docs/reference/workflows/run-methods/timeTravel.md +142 -0
- package/.docs/reference/workflows/run.md +59 -0
- package/.docs/reference/workflows/step.md +119 -0
- package/.docs/reference/workflows/workflow-methods/branch.md +25 -0
- package/.docs/reference/workflows/workflow-methods/commit.md +17 -0
- package/.docs/reference/workflows/workflow-methods/create-run.md +63 -0
- package/.docs/reference/workflows/workflow-methods/dountil.md +25 -0
- package/.docs/reference/workflows/workflow-methods/dowhile.md +25 -0
- package/.docs/reference/workflows/workflow-methods/foreach.md +118 -0
- package/.docs/reference/workflows/workflow-methods/map.md +93 -0
- package/.docs/reference/workflows/workflow-methods/parallel.md +21 -0
- package/.docs/reference/workflows/workflow-methods/sleep.md +35 -0
- package/.docs/reference/workflows/workflow-methods/sleepUntil.md +35 -0
- package/.docs/reference/workflows/workflow-methods/then.md +21 -0
- package/.docs/reference/workflows/workflow.md +157 -0
- package/.docs/reference/workspace/e2b-sandbox.md +289 -0
- package/.docs/reference/workspace/filesystem.md +255 -0
- package/.docs/reference/workspace/gcs-filesystem.md +174 -0
- package/.docs/reference/workspace/local-filesystem.md +343 -0
- package/.docs/reference/workspace/local-sandbox.md +301 -0
- package/.docs/reference/workspace/s3-filesystem.md +175 -0
- package/.docs/reference/workspace/sandbox.md +87 -0
- package/.docs/reference/workspace/workspace-class.md +244 -0
- package/CHANGELOG.md +8 -0
- package/package.json +5 -5
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# S3Filesystem
|
|
2
|
+
|
|
3
|
+
Stores files in Amazon S3 or S3-compatible storage services like Cloudflare R2, MinIO, and DigitalOcean Spaces.
|
|
4
|
+
|
|
5
|
+
> **Info:** For interface details, see [WorkspaceFilesystem Interface](https://mastra.ai/reference/workspace/filesystem).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @mastra/s3
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Add an `S3Filesystem` to a workspace and assign it to an agent:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { Agent } from '@mastra/core/agent'
|
|
19
|
+
import { Workspace } from '@mastra/core/workspace'
|
|
20
|
+
import { S3Filesystem } from '@mastra/s3'
|
|
21
|
+
|
|
22
|
+
const workspace = new Workspace({
|
|
23
|
+
filesystem: new S3Filesystem({
|
|
24
|
+
bucket: 'my-bucket',
|
|
25
|
+
region: 'us-east-1',
|
|
26
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
27
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
|
28
|
+
}),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const agent = new Agent({
|
|
32
|
+
name: 'file-agent',
|
|
33
|
+
model: 'anthropic/claude-opus-4-5',
|
|
34
|
+
workspace,
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Cloudflare R2
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { S3Filesystem } from '@mastra/s3'
|
|
42
|
+
|
|
43
|
+
const filesystem = new S3Filesystem({
|
|
44
|
+
bucket: 'my-r2-bucket',
|
|
45
|
+
region: 'auto',
|
|
46
|
+
endpoint: `https://${process.env.R2_ACCOUNT_ID}.r2.cloudflarestorage.com`,
|
|
47
|
+
accessKeyId: process.env.R2_ACCESS_KEY_ID,
|
|
48
|
+
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY,
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### MinIO
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { S3Filesystem } from '@mastra/s3'
|
|
56
|
+
|
|
57
|
+
const filesystem = new S3Filesystem({
|
|
58
|
+
bucket: 'my-bucket',
|
|
59
|
+
region: 'us-east-1',
|
|
60
|
+
endpoint: 'http://localhost:9000',
|
|
61
|
+
accessKeyId: 'minioadmin',
|
|
62
|
+
secretAccessKey: 'minioadmin',
|
|
63
|
+
})
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Constructor parameters
|
|
67
|
+
|
|
68
|
+
**bucket:** (`string`): S3 bucket name
|
|
69
|
+
|
|
70
|
+
**region:** (`string`): AWS region (use 'auto' for R2)
|
|
71
|
+
|
|
72
|
+
**accessKeyId?:** (`string`): AWS access key ID. Optional for public buckets (read-only access).
|
|
73
|
+
|
|
74
|
+
**secretAccessKey?:** (`string`): AWS secret access key. Optional for public buckets (read-only access).
|
|
75
|
+
|
|
76
|
+
**endpoint?:** (`string`): Custom endpoint URL for S3-compatible storage (R2, MinIO, etc.)
|
|
77
|
+
|
|
78
|
+
**forcePathStyle?:** (`boolean`): Force path-style URLs instead of virtual-hosted-style. Required for some S3-compatible services like MinIO. Defaults to true when a custom endpoint is provided. (Default: `true (when endpoint is set)`)
|
|
79
|
+
|
|
80
|
+
**prefix?:** (`string`): Optional prefix for all keys (acts like a subdirectory)
|
|
81
|
+
|
|
82
|
+
**id?:** (`string`): Unique identifier for this filesystem instance (Default: `Auto-generated`)
|
|
83
|
+
|
|
84
|
+
**displayName?:** (`string`): Human-friendly display name for the UI
|
|
85
|
+
|
|
86
|
+
**icon?:** (`FilesystemIcon`): Icon identifier for the UI
|
|
87
|
+
|
|
88
|
+
**description?:** (`string`): Short description of this filesystem for the UI
|
|
89
|
+
|
|
90
|
+
**readOnly?:** (`boolean`): When true, all write operations are blocked (Default: `false`)
|
|
91
|
+
|
|
92
|
+
## Properties
|
|
93
|
+
|
|
94
|
+
**id:** (`string`): Filesystem instance identifier
|
|
95
|
+
|
|
96
|
+
**name:** (`string`): Provider name ('S3Filesystem')
|
|
97
|
+
|
|
98
|
+
**provider:** (`string`): Provider identifier ('s3')
|
|
99
|
+
|
|
100
|
+
**bucket:** (`string`): The S3 bucket name
|
|
101
|
+
|
|
102
|
+
**readOnly:** (`boolean | undefined`): Whether the filesystem is in read-only mode
|
|
103
|
+
|
|
104
|
+
## Methods
|
|
105
|
+
|
|
106
|
+
S3Filesystem implements the [WorkspaceFilesystem interface](https://mastra.ai/reference/workspace/filesystem), providing all standard filesystem methods:
|
|
107
|
+
|
|
108
|
+
- `readFile(path, options?)` - Read file contents
|
|
109
|
+
- `writeFile(path, content, options?)` - Write content to a file
|
|
110
|
+
- `appendFile(path, content)` - Append content to a file
|
|
111
|
+
- `deleteFile(path, options?)` - Delete a file
|
|
112
|
+
- `copyFile(src, dest, options?)` - Copy a file
|
|
113
|
+
- `moveFile(src, dest, options?)` - Move or rename a file
|
|
114
|
+
- `mkdir(path, options?)` - Create a directory
|
|
115
|
+
- `rmdir(path, options?)` - Remove a directory
|
|
116
|
+
- `readdir(path, options?)` - List directory contents
|
|
117
|
+
- `exists(path)` - Check if a path exists
|
|
118
|
+
- `stat(path)` - Get file or directory metadata
|
|
119
|
+
|
|
120
|
+
### `init()`
|
|
121
|
+
|
|
122
|
+
Initialize the filesystem. Verifies bucket access and credentials.
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
await filesystem.init()
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### `getInfo()`
|
|
129
|
+
|
|
130
|
+
Returns metadata about this filesystem instance.
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
const info = filesystem.getInfo()
|
|
134
|
+
// { id: '...', name: 'S3Filesystem', provider: 's3', status: 'ready' }
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### `getMountConfig()`
|
|
138
|
+
|
|
139
|
+
Returns the mount configuration for sandboxes that support mounting this filesystem type.
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
const config = filesystem.getMountConfig()
|
|
143
|
+
// { type: 's3', bucket: 'my-bucket', region: 'us-east-1', ... }
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Mounting in E2B Sandboxes
|
|
147
|
+
|
|
148
|
+
S3Filesystem can be mounted into E2B sandboxes, making the bucket accessible as a local directory:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import { Workspace } from '@mastra/core/workspace'
|
|
152
|
+
import { S3Filesystem } from '@mastra/s3'
|
|
153
|
+
import { E2BSandbox } from '@mastra/e2b'
|
|
154
|
+
|
|
155
|
+
const workspace = new Workspace({
|
|
156
|
+
mounts: {
|
|
157
|
+
'/data': new S3Filesystem({
|
|
158
|
+
bucket: 'my-bucket',
|
|
159
|
+
region: 'us-east-1',
|
|
160
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
161
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
|
162
|
+
}),
|
|
163
|
+
},
|
|
164
|
+
sandbox: new E2BSandbox({ id: 'dev-sandbox' }),
|
|
165
|
+
})
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
See [E2BSandbox reference](https://mastra.ai/reference/workspace/e2b-sandbox) for more details on mounting.
|
|
169
|
+
|
|
170
|
+
## Related
|
|
171
|
+
|
|
172
|
+
- [WorkspaceFilesystem interface](https://mastra.ai/reference/workspace/filesystem)
|
|
173
|
+
- [GCSFilesystem reference](https://mastra.ai/reference/workspace/gcs-filesystem)
|
|
174
|
+
- [E2BSandbox reference](https://mastra.ai/reference/workspace/e2b-sandbox)
|
|
175
|
+
- [Workspace overview](https://mastra.ai/docs/workspace/overview)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# WorkspaceSandbox
|
|
2
|
+
|
|
3
|
+
**Added in:** `@mastra/core@1.1.0`
|
|
4
|
+
|
|
5
|
+
The `WorkspaceSandbox` interface defines how workspaces execute commands.
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
### `start()`
|
|
10
|
+
|
|
11
|
+
Start the sandbox. Called automatically by `workspace.init()` or on first `executeCommand()` call.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
await sandbox.start()
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This method prepares the sandbox for command execution.
|
|
18
|
+
|
|
19
|
+
### `stop()`
|
|
20
|
+
|
|
21
|
+
Stop the sandbox.
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
await sandbox.stop?.()
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### `destroy()`
|
|
28
|
+
|
|
29
|
+
Clean up sandbox resources. Called by `workspace.destroy()`.
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
await sandbox.destroy()
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### `executeCommand(command, args?, options?)`
|
|
36
|
+
|
|
37
|
+
Execute a shell command.
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
const result = await sandbox.executeCommand('ls', ['-la', '/docs'])
|
|
41
|
+
const result = await sandbox.executeCommand('npm', ['install', 'lodash'])
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Parameters:**
|
|
45
|
+
|
|
46
|
+
**command:** (`string`): Command to execute
|
|
47
|
+
|
|
48
|
+
**args?:** (`string[]`): Command arguments
|
|
49
|
+
|
|
50
|
+
**options.timeout?:** (`number`): Execution timeout in milliseconds
|
|
51
|
+
|
|
52
|
+
**options.cwd?:** (`string`): Working directory for the command
|
|
53
|
+
|
|
54
|
+
**options.env?:** (`Record<string, string>`): Additional environment variables
|
|
55
|
+
|
|
56
|
+
**options.onStdout?:** (`(data: string) => void`): Callback for stdout streaming
|
|
57
|
+
|
|
58
|
+
**options.onStderr?:** (`(data: string) => void`): Callback for stderr streaming
|
|
59
|
+
|
|
60
|
+
### `getInfo()`
|
|
61
|
+
|
|
62
|
+
Get sandbox status and resource information.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
const info = await sandbox.getInfo()
|
|
66
|
+
// { status: 'running', resources: { memoryMB: 512, cpuPercent: 5 } }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### `getInstructions(opts?)`
|
|
70
|
+
|
|
71
|
+
Returns a description of how this sandbox works. Injected into the agent's system message when the workspace is assigned to an agent.
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
const instructions = sandbox.getInstructions?.()
|
|
75
|
+
// 'Local command execution. Working directory: "/workspace".'
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Parameters:**
|
|
79
|
+
|
|
80
|
+
**opts.requestContext?:** (`RequestContext`): Forwarded to the \`instructions\` function if one was provided in the constructor.
|
|
81
|
+
|
|
82
|
+
**Returns:** `string`
|
|
83
|
+
|
|
84
|
+
## Related
|
|
85
|
+
|
|
86
|
+
- [Workspace Class](https://mastra.ai/reference/workspace/workspace-class)
|
|
87
|
+
- [Filesystem Interface](https://mastra.ai/reference/workspace/filesystem)
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Workspace Class
|
|
2
|
+
|
|
3
|
+
**Added in:** `@mastra/core@1.1.0`
|
|
4
|
+
|
|
5
|
+
The `Workspace` class combines a filesystem and sandbox to provide agents with file storage and command execution capabilities. It also supports BM25 and vector search for indexed content.
|
|
6
|
+
|
|
7
|
+
## Usage Example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { Workspace, LocalFilesystem, LocalSandbox } from '@mastra/core/workspace'
|
|
11
|
+
|
|
12
|
+
const workspace = new Workspace({
|
|
13
|
+
id: 'my-workspace',
|
|
14
|
+
name: 'My Workspace',
|
|
15
|
+
filesystem: new LocalFilesystem({
|
|
16
|
+
basePath: './workspace',
|
|
17
|
+
}),
|
|
18
|
+
sandbox: new LocalSandbox({
|
|
19
|
+
workingDirectory: './workspace',
|
|
20
|
+
}),
|
|
21
|
+
bm25: true,
|
|
22
|
+
autoIndexPaths: ['/docs'],
|
|
23
|
+
})
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Constructor parameters
|
|
27
|
+
|
|
28
|
+
**id?:** (`string`): Unique identifier for the workspace (Default: `Auto-generated`)
|
|
29
|
+
|
|
30
|
+
**name?:** (`string`): Human-readable name (Default: `workspace-{id}`)
|
|
31
|
+
|
|
32
|
+
**filesystem?:** (`WorkspaceFilesystem`): Filesystem provider instance (e.g., LocalFilesystem)
|
|
33
|
+
|
|
34
|
+
**sandbox?:** (`WorkspaceSandbox`): Sandbox provider instance (e.g., LocalSandbox)
|
|
35
|
+
|
|
36
|
+
**bm25?:** (`boolean | BM25Config`): Enable BM25 keyword search. Pass true for defaults or a config object. (Default: `undefined`)
|
|
37
|
+
|
|
38
|
+
**vectorStore?:** (`MastraVector`): Vector store for semantic search
|
|
39
|
+
|
|
40
|
+
**embedder?:** (`(text: string) => Promise<number[]>`): Embedder function for generating vectors. Required when vectorStore is provided.
|
|
41
|
+
|
|
42
|
+
**autoIndexPaths?:** (`string[]`): Paths or glob patterns to auto-index on init(). Supports glob patterns like '\*\*/\*.md' for selective indexing.
|
|
43
|
+
|
|
44
|
+
**skills?:** (`string[] | ((context: SkillsContext) => string[] | Promise<string[]>)`): Paths where SKILL.md files are located. This can be a static array or an async function that resolves paths dynamically. Supports glob patterns like './\*\*/skills' for discovery.
|
|
45
|
+
|
|
46
|
+
**skillSource?:** (`SkillSource`): Custom skill source for skill discovery. When provided, this source is used instead of the workspace filesystem. Use VersionedSkillSource to serve published skill versions from a content-addressable blob store.
|
|
47
|
+
|
|
48
|
+
**onMount?:** (`OnMountHook`): Pre-mount hook called for each filesystem before mounting into a sandbox. Return false to skip mounting, or return { success: true } if the hook handled the mount. Return undefined to use the default mount behavior.
|
|
49
|
+
|
|
50
|
+
**searchIndexName?:** (`string`): Custom index name for the vector store. Must be a valid SQL identifier (start with a letter or underscore, contain only letters, numbers, or underscores, max 63 characters). Defaults to a sanitized version of '{id}\_search'.
|
|
51
|
+
|
|
52
|
+
**tools?:** (`WorkspaceToolsConfig`): Per-tool configuration for enabling tools and setting safety options
|
|
53
|
+
|
|
54
|
+
**operationTimeout?:** (`number`): Timeout for operations in milliseconds
|
|
55
|
+
|
|
56
|
+
## Tool configuration
|
|
57
|
+
|
|
58
|
+
The `tools` option accepts a `WorkspaceToolsConfig` object that controls which workspace tools are enabled and their safety settings.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { WORKSPACE_TOOLS } from '@mastra/core/workspace';
|
|
62
|
+
|
|
63
|
+
tools: {
|
|
64
|
+
// Global defaults (apply to all tools)
|
|
65
|
+
enabled: true,
|
|
66
|
+
requireApproval: false,
|
|
67
|
+
|
|
68
|
+
// Per-tool overrides using WORKSPACE_TOOLS constants
|
|
69
|
+
[WORKSPACE_TOOLS.FILESYSTEM.WRITE_FILE]: {
|
|
70
|
+
requireApproval: true,
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The config object has two parts:
|
|
76
|
+
|
|
77
|
+
- **Global defaults** (`enabled`, `requireApproval`) - Apply to all tools unless overridden
|
|
78
|
+
- **Per-tool overrides** - Use `WORKSPACE_TOOLS` constants as keys to configure individual tools
|
|
79
|
+
|
|
80
|
+
See [workspace overview](https://mastra.ai/docs/workspace/overview) for more examples.
|
|
81
|
+
|
|
82
|
+
### Per-tool options
|
|
83
|
+
|
|
84
|
+
Each tool can be configured with these options:
|
|
85
|
+
|
|
86
|
+
**enabled?:** (`boolean`): Whether the tool is available to agents (Default: `true`)
|
|
87
|
+
|
|
88
|
+
**requireApproval?:** (`boolean`): Whether the tool requires user approval before execution (Default: `false`)
|
|
89
|
+
|
|
90
|
+
**requireReadBeforeWrite?:** (`boolean`): For write tools: require reading the file first to prevent overwrites (Default: `false`)
|
|
91
|
+
|
|
92
|
+
## Properties
|
|
93
|
+
|
|
94
|
+
**id:** (`string`): Workspace identifier
|
|
95
|
+
|
|
96
|
+
**name:** (`string`): Workspace name
|
|
97
|
+
|
|
98
|
+
**status:** (`WorkspaceStatus`): 'pending' | 'initializing' | 'ready' | 'paused' | 'error' | 'destroying' | 'destroyed'
|
|
99
|
+
|
|
100
|
+
**filesystem:** (`WorkspaceFilesystem | undefined`): The filesystem provider
|
|
101
|
+
|
|
102
|
+
**sandbox:** (`WorkspaceSandbox | undefined`): The sandbox provider
|
|
103
|
+
|
|
104
|
+
**skills:** (`WorkspaceSkills | undefined`): Skills interface for accessing SKILL.md files
|
|
105
|
+
|
|
106
|
+
**canBM25:** (`boolean`): Whether BM25 search is available
|
|
107
|
+
|
|
108
|
+
**canVector:** (`boolean`): Whether vector search is available
|
|
109
|
+
|
|
110
|
+
**canHybrid:** (`boolean`): Whether hybrid search is available
|
|
111
|
+
|
|
112
|
+
## Methods
|
|
113
|
+
|
|
114
|
+
### Lifecycle
|
|
115
|
+
|
|
116
|
+
#### `init()`
|
|
117
|
+
|
|
118
|
+
Initialize the workspace and prepare resources.
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
await workspace.init()
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Calling `init()` is optional in most cases:
|
|
125
|
+
|
|
126
|
+
- **Sandbox**: Auto-starts on first `executeCommand()` call. Use `init()` to avoid first-command latency.
|
|
127
|
+
- **Filesystem**: Creates the base directory and runs any provider-specific setup. Some providers auto-create the directory on first operation.
|
|
128
|
+
- **Search**: Required only if using `autoIndexPaths` for auto-indexing.
|
|
129
|
+
|
|
130
|
+
Initialization performs:
|
|
131
|
+
|
|
132
|
+
- Starts the filesystem provider (creates base directory if needed)
|
|
133
|
+
- Starts the sandbox provider (creates working directory, sets up isolation if configured)
|
|
134
|
+
- Indexes files from `autoIndexPaths` for search
|
|
135
|
+
|
|
136
|
+
#### `destroy()`
|
|
137
|
+
|
|
138
|
+
Destroy the workspace and clean up resources.
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
await workspace.destroy()
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Search operations
|
|
145
|
+
|
|
146
|
+
#### `index(path, content, options?)`
|
|
147
|
+
|
|
148
|
+
Index content for search.
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
await workspace.index('/docs/guide.md', 'Guide content...')
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### `search(query, options?)`
|
|
155
|
+
|
|
156
|
+
Search indexed content.
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
const results = await workspace.search('password reset', {
|
|
160
|
+
topK: 10,
|
|
161
|
+
mode: 'hybrid',
|
|
162
|
+
})
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Utility
|
|
166
|
+
|
|
167
|
+
#### `getInfo()`
|
|
168
|
+
|
|
169
|
+
Get workspace information.
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
const info = await workspace.getInfo()
|
|
173
|
+
// { id, name, status, createdAt, lastAccessedAt, filesystem?, sandbox? }
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### `getInstructions(opts?)`
|
|
177
|
+
|
|
178
|
+
Returns combined instructions from the filesystem and sandbox providers. Injected into the agent's system message to help it understand the execution context.
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
const instructions = workspace.getInstructions()
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Pass `requestContext` to enable per-request customization when a provider's `instructions` option is a function:
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
const instructions = workspace.getInstructions({ requestContext })
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Parameters:**
|
|
191
|
+
|
|
192
|
+
**opts.requestContext?:** (`RequestContext`): Forwarded to the \`instructions\` function on the filesystem or sandbox provider, if one is configured.
|
|
193
|
+
|
|
194
|
+
**Returns:** `string`
|
|
195
|
+
|
|
196
|
+
To override the default output, pass an `instructions` option to [LocalFilesystem](https://mastra.ai/reference/workspace/local-filesystem) or [LocalSandbox](https://mastra.ai/reference/workspace/local-sandbox).
|
|
197
|
+
|
|
198
|
+
#### `getToolsConfig()`
|
|
199
|
+
|
|
200
|
+
Get the tools configuration.
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
const config = workspace.getToolsConfig()
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Agent tools
|
|
207
|
+
|
|
208
|
+
A workspace provides tools to agents based on what is configured.
|
|
209
|
+
|
|
210
|
+
### Filesystem tools
|
|
211
|
+
|
|
212
|
+
Added when a filesystem is configured:
|
|
213
|
+
|
|
214
|
+
| Tool | Description |
|
|
215
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
216
|
+
| `mastra_workspace_read_file` | Read file contents. Supports optional line range for reading specific portions of large files. |
|
|
217
|
+
| `mastra_workspace_write_file` | Create or overwrite a file with new content. Creates parent directories automatically. |
|
|
218
|
+
| `mastra_workspace_edit_file` | Edit an existing file by finding and replacing text. Useful for targeted changes without rewriting the entire file. |
|
|
219
|
+
| `mastra_workspace_list_files` | List directory contents as a tree structure. Supports recursive listing with depth limits. |
|
|
220
|
+
| `mastra_workspace_delete` | Delete a file or directory. Supports recursive deletion for directories. |
|
|
221
|
+
| `mastra_workspace_file_stat` | Get metadata about a file or directory including size, type, and modification time. |
|
|
222
|
+
| `mastra_workspace_mkdir` | Create a directory. Creates parent directories automatically if they don't exist. |
|
|
223
|
+
| `mastra_workspace_grep` | Search file contents using regex patterns. Supports glob filtering, context lines, and case-insensitive search. |
|
|
224
|
+
|
|
225
|
+
Write tools (`write_file`, `edit_file`, `delete`, `mkdir`) are excluded when the filesystem is in read-only mode.
|
|
226
|
+
|
|
227
|
+
### Sandbox tools
|
|
228
|
+
|
|
229
|
+
Added when a sandbox is configured:
|
|
230
|
+
|
|
231
|
+
| Tool | Description |
|
|
232
|
+
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
233
|
+
| `mastra_workspace_execute_command` | Execute a shell command with arguments. Returns stdout, stderr, and exit code. Supports timeouts and streaming output. |
|
|
234
|
+
|
|
235
|
+
### Search tools
|
|
236
|
+
|
|
237
|
+
Added when BM25 or vector search is configured:
|
|
238
|
+
|
|
239
|
+
| Tool | Description |
|
|
240
|
+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
241
|
+
| `mastra_workspace_search` | Search indexed content using keyword (BM25), semantic (vector), or hybrid search. Returns ranked results with scores. |
|
|
242
|
+
| `mastra_workspace_index` | Index content for search. Associates content with a path for later retrieval. |
|
|
243
|
+
|
|
244
|
+
The `index` tool is excluded when the filesystem is in read-only mode.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.6-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`df170fd`](https://github.com/mastra-ai/mastra/commit/df170fd139b55f845bfd2de8488b16435bd3d0da), [`ae55343`](https://github.com/mastra-ai/mastra/commit/ae5534397fc006fd6eef3e4f80c235bcdc9289ef), [`b8621e2`](https://github.com/mastra-ai/mastra/commit/b8621e25e70cae69a9343353f878a9112493a2fe), [`c290cec`](https://github.com/mastra-ai/mastra/commit/c290cec5bf9107225de42942b56b487107aa9dce), [`f03e794`](https://github.com/mastra-ai/mastra/commit/f03e794630f812b56e95aad54f7b1993dc003add), [`aa4a5ae`](https://github.com/mastra-ai/mastra/commit/aa4a5aedb80d8d6837bab8cbb2e301215d1ba3e9), [`de3f584`](https://github.com/mastra-ai/mastra/commit/de3f58408752a8d80a295275c7f23fc306cf7f4f), [`74ae019`](https://github.com/mastra-ai/mastra/commit/74ae0197a6895f8897c369038c643d7e32dd84c2), [`d3fb010`](https://github.com/mastra-ai/mastra/commit/d3fb010c98f575f1c0614452667396e2653815f6), [`702ee1c`](https://github.com/mastra-ai/mastra/commit/702ee1c41be67cc532b4dbe89bcb62143508f6f0), [`f495051`](https://github.com/mastra-ai/mastra/commit/f495051eb6496a720f637fc85b6d69941c12554c), [`e622f1d`](https://github.com/mastra-ai/mastra/commit/e622f1d3ab346a8e6aca6d1fe2eac99bd961e50b), [`861f111`](https://github.com/mastra-ai/mastra/commit/861f11189211b20ddb70d8df81a6b901fc78d11e), [`00f43e8`](https://github.com/mastra-ai/mastra/commit/00f43e8e97a80c82b27d5bd30494f10a715a1df9), [`1b6f651`](https://github.com/mastra-ai/mastra/commit/1b6f65127d4a0d6c38d0a1055cb84527db529d6b), [`96a1702`](https://github.com/mastra-ai/mastra/commit/96a1702ce362c50dda20c8b4a228b4ad1a36a17a), [`cb9f921`](https://github.com/mastra-ai/mastra/commit/cb9f921320913975657abb1404855d8c510f7ac5), [`114e7c1`](https://github.com/mastra-ai/mastra/commit/114e7c146ac682925f0fb37376c1be70e5d6e6e5), [`1b6f651`](https://github.com/mastra-ai/mastra/commit/1b6f65127d4a0d6c38d0a1055cb84527db529d6b), [`72df4a8`](https://github.com/mastra-ai/mastra/commit/72df4a8f9bf1a20cfd3d9006a4fdb597ad56d10a)]:
|
|
8
|
+
- @mastra/core@1.8.0-alpha.0
|
|
9
|
+
- @mastra/mcp@1.0.2-alpha.0
|
|
10
|
+
|
|
3
11
|
## 1.1.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6-alpha.0",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"jsdom": "^26.1.0",
|
|
30
30
|
"local-pkg": "^1.1.2",
|
|
31
31
|
"zod": "^3.25.76",
|
|
32
|
-
"@mastra/
|
|
33
|
-
"@mastra/
|
|
32
|
+
"@mastra/mcp": "^1.0.2-alpha.0",
|
|
33
|
+
"@mastra/core": "1.8.0-alpha.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@hono/node-server": "^1.19.9",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"tsx": "^4.21.0",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vitest": "4.0.18",
|
|
49
|
-
"@internal/lint": "0.0.62",
|
|
50
49
|
"@internal/types-builder": "0.0.37",
|
|
51
|
-
"@
|
|
50
|
+
"@internal/lint": "0.0.62",
|
|
51
|
+
"@mastra/core": "1.8.0-alpha.0"
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://mastra.ai",
|
|
54
54
|
"repository": {
|