@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
|
@@ -6,24 +6,47 @@ Executes commands in isolated [Daytona](https://www.daytona.io) cloud sandboxes.
|
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
+
**npm**:
|
|
10
|
+
|
|
9
11
|
```bash
|
|
10
12
|
npm install @mastra/daytona
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
**pnpm**:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add @mastra/daytona
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Yarn**:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
yarn add @mastra/daytona
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Bun**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bun add @mastra/daytona
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Set your Daytona API key in one of three ways.
|
|
34
|
+
|
|
35
|
+
**Shell export**:
|
|
14
36
|
|
|
15
37
|
```bash
|
|
16
|
-
# Shell export
|
|
17
38
|
export DAYTONA_API_KEY=your-api-key
|
|
18
39
|
```
|
|
19
40
|
|
|
41
|
+
**.env file**:
|
|
42
|
+
|
|
20
43
|
```bash
|
|
21
|
-
# .env file
|
|
22
44
|
DAYTONA_API_KEY=your-api-key
|
|
23
45
|
```
|
|
24
46
|
|
|
47
|
+
**Constructor**:
|
|
48
|
+
|
|
25
49
|
```typescript
|
|
26
|
-
// Passed directly as constructor argument
|
|
27
50
|
new DaytonaSandbox({ apiKey: 'your-api-key' })
|
|
28
51
|
```
|
|
29
52
|
|
|
@@ -36,13 +59,13 @@ import { Agent } from '@mastra/core/agent'
|
|
|
36
59
|
import { Workspace } from '@mastra/core/workspace'
|
|
37
60
|
import { DaytonaSandbox } from '@mastra/daytona'
|
|
38
61
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
62
|
+
const workspace = new Workspace({
|
|
63
|
+
sandbox: new DaytonaSandbox({
|
|
64
|
+
language: 'typescript',
|
|
65
|
+
timeout: 120_000,
|
|
66
|
+
}),
|
|
42
67
|
})
|
|
43
68
|
|
|
44
|
-
const workspace = new Workspace({ sandbox })
|
|
45
|
-
|
|
46
69
|
const agent = new Agent({
|
|
47
70
|
id: 'code-agent',
|
|
48
71
|
name: 'Code Agent',
|
|
@@ -138,7 +161,7 @@ const result = await sandbox2.executeCommand('cat', ['/tmp/state.txt'])
|
|
|
138
161
|
console.log(result.stdout) // "session 1"
|
|
139
162
|
```
|
|
140
163
|
|
|
141
|
-
If the sandbox is in a stopped or archived state, it
|
|
164
|
+
If the sandbox is in a stopped or archived state, it's restarted automatically. If it's in a dead state (destroyed, errored), a fresh sandbox is created instead.
|
|
142
165
|
|
|
143
166
|
### Filesystem mounting
|
|
144
167
|
|
|
@@ -175,7 +198,7 @@ const workspace = new Workspace({
|
|
|
175
198
|
|
|
176
199
|
When the workspace starts, the filesystems are automatically mounted at the specified paths. Code running in the sandbox can then access files at `/s3-data` and `/gcs-data` as if they were local directories.
|
|
177
200
|
|
|
178
|
-
#### Via sandbox.mount()
|
|
201
|
+
#### Via `sandbox.mount()`
|
|
179
202
|
|
|
180
203
|
Mount manually at any point after the sandbox has started:
|
|
181
204
|
|
|
@@ -296,146 +319,31 @@ const workspace = new Workspace({
|
|
|
296
319
|
|
|
297
320
|
**instance** (`Sandbox`): The underlying Daytona Sandbox instance. Throws SandboxNotReadyError if the sandbox has not been started.
|
|
298
321
|
|
|
299
|
-
|
|
322
|
+
**processes** (`DaytonaProcessManager`): Background process manager. See \[SandboxProcessManager reference]\(/reference/workspace/process-manager).
|
|
300
323
|
|
|
301
|
-
|
|
324
|
+
## Background processes
|
|
302
325
|
|
|
303
|
-
|
|
326
|
+
`DaytonaSandbox` includes a built-in process manager for spawning and managing background processes. Processes run in the Daytona cloud sandbox using session-based command execution.
|
|
304
327
|
|
|
305
328
|
```typescript
|
|
329
|
+
const sandbox = new DaytonaSandbox({ language: 'typescript' })
|
|
306
330
|
await sandbox.start()
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
Called automatically on first command execution or by `workspace.init()`.
|
|
310
|
-
|
|
311
|
-
### `stop()`
|
|
312
|
-
|
|
313
|
-
Stop the sandbox. The sandbox can be restarted later — files and state persist.
|
|
314
|
-
|
|
315
|
-
```typescript
|
|
316
|
-
await sandbox.stop()
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
### `destroy()`
|
|
320
|
-
|
|
321
|
-
Delete the sandbox and clean up all resources.
|
|
322
331
|
|
|
323
|
-
|
|
324
|
-
await sandbox.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
### `executeCommand(command, args?, options?)`
|
|
328
|
-
|
|
329
|
-
Execute a shell command in the sandbox. Automatically starts the sandbox if not already running, and retries once if the sandbox has timed out.
|
|
330
|
-
|
|
331
|
-
```typescript
|
|
332
|
-
const result = await sandbox.executeCommand('node', ['-e', 'console.log("Hello!")'])
|
|
333
|
-
const output = await sandbox.executeCommand('pip', ['install', 'requests'], {
|
|
334
|
-
timeout: 60_000,
|
|
335
|
-
cwd: '/workspace',
|
|
336
|
-
})
|
|
337
|
-
|
|
338
|
-
// Stream output in real time
|
|
339
|
-
await sandbox.executeCommand('bash', ['-c', 'for i in 1 2 3; do echo "line $i"; sleep 1; done'], {
|
|
340
|
-
onStdout: chunk => process.stdout.write(chunk),
|
|
341
|
-
onStderr: chunk => process.stderr.write(chunk),
|
|
332
|
+
// Spawn a background process
|
|
333
|
+
const handle = await sandbox.processes.spawn('node server.js', {
|
|
334
|
+
env: { PORT: '3000' },
|
|
335
|
+
onStdout: data => console.log(data),
|
|
342
336
|
})
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
**Parameters:**
|
|
346
|
-
|
|
347
|
-
**command** (`string`): Command to execute.
|
|
348
|
-
|
|
349
|
-
**args** (`string[]`): Command arguments.
|
|
350
|
-
|
|
351
|
-
**options.timeout** (`number`): Execution timeout in milliseconds. Overrides the instance default.
|
|
352
|
-
|
|
353
|
-
**options.cwd** (`string`): Working directory for the command.
|
|
354
|
-
|
|
355
|
-
**options.env** (`Record<string, string>`): Additional environment variables for this command. Merged with instance-level env.
|
|
356
|
-
|
|
357
|
-
**options.onStdout** (`(data: string) => void`): Callback for stdout streaming.
|
|
358
337
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
Mount a filesystem at a path in the sandbox using FUSE tools (`s3fs` for S3, `gcsfuse` for GCS). FUSE tools are installed automatically if not present.
|
|
364
|
-
|
|
365
|
-
```typescript
|
|
366
|
-
import { S3Filesystem } from '@mastra/s3'
|
|
367
|
-
|
|
368
|
-
const result = await sandbox.mount(
|
|
369
|
-
new S3Filesystem({
|
|
370
|
-
bucket: process.env.S3_BUCKET!,
|
|
371
|
-
region: 'us-east-1',
|
|
372
|
-
accessKeyId: process.env.S3_ACCESS_KEY_ID,
|
|
373
|
-
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
|
|
374
|
-
}),
|
|
375
|
-
'/data',
|
|
376
|
-
)
|
|
377
|
-
// { success: true, mountPath: '/data' }
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
Returns a `MountResult`: `{ success: boolean; mountPath: string; error?: string }`.
|
|
381
|
-
|
|
382
|
-
### `unmount(mountPath)`
|
|
383
|
-
|
|
384
|
-
Unmount a filesystem from a path in the sandbox.
|
|
385
|
-
|
|
386
|
-
```typescript
|
|
387
|
-
await sandbox.unmount('/data')
|
|
338
|
+
// Interact with the process
|
|
339
|
+
console.log(handle.stdout)
|
|
340
|
+
await handle.sendStdin('input\n')
|
|
341
|
+
await handle.kill()
|
|
388
342
|
```
|
|
389
343
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
Get sandbox status and resource information.
|
|
393
|
-
|
|
394
|
-
```typescript
|
|
395
|
-
const info = await sandbox.getInfo()
|
|
396
|
-
// {
|
|
397
|
-
// id: 'daytona-sandbox-abc123',
|
|
398
|
-
// name: 'DaytonaSandbox',
|
|
399
|
-
// provider: 'daytona',
|
|
400
|
-
// status: 'running',
|
|
401
|
-
// createdAt: Date,
|
|
402
|
-
// mounts: [],
|
|
403
|
-
// resources: {
|
|
404
|
-
// cpuCores: 2, // vCPU count from the running sandbox
|
|
405
|
-
// memoryMB: 4096, // converted from GB (×1024)
|
|
406
|
-
// diskMB: 20480, // converted from GiB (×1024)
|
|
407
|
-
// },
|
|
408
|
-
// metadata: {
|
|
409
|
-
// language: 'typescript',
|
|
410
|
-
// ephemeral: false,
|
|
411
|
-
// snapshot: 'my-snapshot-id', // only when snapshot is set
|
|
412
|
-
// image: 'node:20-slim', // only when image is set
|
|
413
|
-
// target: 'us', // only when sandbox is running
|
|
414
|
-
// },
|
|
415
|
-
// }
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
### `getInstructions()`
|
|
419
|
-
|
|
420
|
-
Get a description of the sandbox environment. Used in tool descriptions so agents understand the execution context.
|
|
421
|
-
|
|
422
|
-
```typescript
|
|
423
|
-
// Default (no options)
|
|
424
|
-
new DaytonaSandbox().getInstructions()
|
|
425
|
-
// 'Cloud sandbox with isolated execution (typescript runtime). Default working directory: /home/daytona. Command timeout: 300s. Running as user: daytona.'
|
|
426
|
-
|
|
427
|
-
// All options set
|
|
428
|
-
new DaytonaSandbox({
|
|
429
|
-
language: 'python',
|
|
430
|
-
timeout: 60_000,
|
|
431
|
-
user: 'app',
|
|
432
|
-
volumes: [{ volumeId: 'vol-123', mountPath: '/data' }],
|
|
433
|
-
networkBlockAll: true,
|
|
434
|
-
}).getInstructions()
|
|
435
|
-
// 'Cloud sandbox with isolated execution (python runtime). Default working directory: /home/daytona. Command timeout: 60s. Running as user: app. 1 volume(s) attached. Network access is blocked.'
|
|
436
|
-
```
|
|
344
|
+
See [`SandboxProcessManager` reference](https://mastra.ai/reference/workspace/process-manager) for the full API.
|
|
437
345
|
|
|
438
|
-
## Mounting
|
|
346
|
+
## Mounting cloud storage
|
|
439
347
|
|
|
440
348
|
Daytona sandboxes can mount S3 or GCS buckets, making cloud storage accessible as local directories inside the sandbox. This is useful for:
|
|
441
349
|
|
|
@@ -557,7 +465,7 @@ await daytonaSandbox.fs.uploadFile(Buffer.from('hello'), '/tmp/hello.txt')
|
|
|
557
465
|
await daytonaSandbox.git.clone('https://github.com/org/repo', '/workspace/repo')
|
|
558
466
|
```
|
|
559
467
|
|
|
560
|
-
The `instance` getter throws `SandboxNotReadyError` if the sandbox
|
|
468
|
+
The `instance` getter throws `SandboxNotReadyError` if the sandbox hasn't been started yet.
|
|
561
469
|
|
|
562
470
|
## Sandbox creation modes
|
|
563
471
|
|
|
@@ -573,6 +481,7 @@ Resources are only applied when `image` is set. Passing `resources` without `ima
|
|
|
573
481
|
|
|
574
482
|
## Related
|
|
575
483
|
|
|
484
|
+
- [SandboxProcessManager reference](https://mastra.ai/reference/workspace/process-manager)
|
|
576
485
|
- [WorkspaceSandbox interface](https://mastra.ai/reference/workspace/sandbox)
|
|
577
486
|
- [LocalSandbox reference](https://mastra.ai/reference/workspace/local-sandbox)
|
|
578
487
|
- [S3Filesystem reference](https://mastra.ai/reference/workspace/s3-filesystem)
|
|
@@ -6,10 +6,30 @@ Executes commands in isolated [E2B](https://e2b.dev) cloud sandboxes. Provides s
|
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
+
**npm**:
|
|
10
|
+
|
|
9
11
|
```bash
|
|
10
12
|
npm install @mastra/e2b
|
|
11
13
|
```
|
|
12
14
|
|
|
15
|
+
**pnpm**:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add @mastra/e2b
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Yarn**:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
yarn add @mastra/e2b
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Bun**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bun add @mastra/e2b
|
|
31
|
+
```
|
|
32
|
+
|
|
13
33
|
## Usage
|
|
14
34
|
|
|
15
35
|
Add an `E2BSandbox` to a workspace and assign it to an agent:
|
|
@@ -63,97 +83,40 @@ const agent = new Agent({
|
|
|
63
83
|
|
|
64
84
|
**supportsMounting** (`boolean`): Always true - E2B sandboxes support mounting cloud filesystems
|
|
65
85
|
|
|
66
|
-
|
|
86
|
+
**processes** (`E2BProcessManager`): Background process manager. See \[SandboxProcessManager reference]\(/reference/workspace/process-manager).
|
|
67
87
|
|
|
68
|
-
|
|
88
|
+
## Background processes
|
|
69
89
|
|
|
70
|
-
|
|
90
|
+
`E2BSandbox` includes a built-in process manager for spawning and managing background processes. Processes run in the E2B cloud sandbox using the E2B SDK's `commands.run()` with `background: true`.
|
|
71
91
|
|
|
72
92
|
```typescript
|
|
93
|
+
const sandbox = new E2BSandbox({ id: 'dev-sandbox' })
|
|
73
94
|
await sandbox.start()
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Called automatically on first command execution or by `workspace.init()`.
|
|
77
|
-
|
|
78
|
-
### `stop()`
|
|
79
|
-
|
|
80
|
-
Stop the sandbox and release resources.
|
|
81
|
-
|
|
82
|
-
```typescript
|
|
83
|
-
await sandbox.stop()
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### `destroy()`
|
|
87
|
-
|
|
88
|
-
Clean up sandbox resources completely.
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
await sandbox.destroy()
|
|
92
|
-
```
|
|
93
95
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
const result = await sandbox.executeCommand('ls', ['-la'])
|
|
100
|
-
const npmResult = await sandbox.executeCommand('npm', ['install', 'lodash'], {
|
|
101
|
-
timeout: 60000,
|
|
102
|
-
cwd: '/app',
|
|
96
|
+
// Spawn a background process
|
|
97
|
+
const handle = await sandbox.processes.spawn('node server.js', {
|
|
98
|
+
env: { PORT: '3000' },
|
|
99
|
+
onStdout: data => console.log(data),
|
|
103
100
|
})
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
**Parameters:**
|
|
107
|
-
|
|
108
|
-
**command** (`string`): Command to execute
|
|
109
|
-
|
|
110
|
-
**args** (`string[]`): Command arguments
|
|
111
|
-
|
|
112
|
-
**options.timeout** (`number`): Execution timeout in milliseconds
|
|
113
|
-
|
|
114
|
-
**options.cwd** (`string`): Working directory for the command
|
|
115
|
-
|
|
116
|
-
**options.env** (`Record<string, string>`): Additional environment variables
|
|
117
|
-
|
|
118
|
-
**options.onStdout** (`(data: string) => void`): Callback for stdout streaming
|
|
119
|
-
|
|
120
|
-
**options.onStderr** (`(data: string) => void`): Callback for stderr streaming
|
|
121
|
-
|
|
122
|
-
### `canMount(filesystem)`
|
|
123
101
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
// true for S3Filesystem and GCSFilesystem
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### `mount(filesystem, mountPath)`
|
|
132
|
-
|
|
133
|
-
Mount a filesystem into the sandbox at the specified path.
|
|
134
|
-
|
|
135
|
-
```typescript
|
|
136
|
-
await sandbox.mount(s3Filesystem, '/mnt/data')
|
|
102
|
+
// Interact with the process
|
|
103
|
+
console.log(handle.stdout)
|
|
104
|
+
await handle.sendStdin('input\n')
|
|
105
|
+
await handle.kill()
|
|
137
106
|
```
|
|
138
107
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
Unmount a previously mounted filesystem.
|
|
108
|
+
The E2B process manager supports reconnecting to processes that were spawned externally or before a reconnection. Call `get(pid)` with a PID to connect to an existing process:
|
|
142
109
|
|
|
143
110
|
```typescript
|
|
144
|
-
await sandbox.
|
|
111
|
+
const handle = await sandbox.processes.get(existingPid)
|
|
112
|
+
if (handle) {
|
|
113
|
+
console.log(handle.stdout)
|
|
114
|
+
}
|
|
145
115
|
```
|
|
146
116
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
Get sandbox status and resource information.
|
|
150
|
-
|
|
151
|
-
```typescript
|
|
152
|
-
const info = await sandbox.getInfo()
|
|
153
|
-
// { id: '...', name: 'E2BSandbox', provider: 'e2b', status: 'ready', supportsMounting: true }
|
|
154
|
-
```
|
|
117
|
+
See [`SandboxProcessManager` reference](https://mastra.ai/reference/workspace/process-manager) for the full API.
|
|
155
118
|
|
|
156
|
-
## Mounting
|
|
119
|
+
## Mounting cloud storage
|
|
157
120
|
|
|
158
121
|
E2B sandboxes can mount S3 or GCS filesystems, making cloud storage accessible as local directories inside the sandbox. This is useful for:
|
|
159
122
|
|
|
@@ -200,7 +163,7 @@ E2B sandboxes use FUSE (Filesystem in Userspace) to mount cloud storage:
|
|
|
200
163
|
|
|
201
164
|
The E2B sandbox automatically installs the required FUSE tools when mounting is used. For best performance, pre-build a custom template with the tools installed.
|
|
202
165
|
|
|
203
|
-
## Custom
|
|
166
|
+
## Custom templates
|
|
204
167
|
|
|
205
168
|
By default, when no template is specified, E2BSandbox automatically builds a template with `s3fs` installed for S3 mounting support. This template is cached and reused across sandbox instances.
|
|
206
169
|
|
|
@@ -282,6 +245,7 @@ This is optional—`gcsfuse` is installed automatically at mount time if not pre
|
|
|
282
245
|
|
|
283
246
|
## Related
|
|
284
247
|
|
|
248
|
+
- [SandboxProcessManager reference](https://mastra.ai/reference/workspace/process-manager)
|
|
285
249
|
- [WorkspaceSandbox interface](https://mastra.ai/reference/workspace/sandbox)
|
|
286
250
|
- [LocalSandbox reference](https://mastra.ai/reference/workspace/local-sandbox)
|
|
287
251
|
- [S3Filesystem reference](https://mastra.ai/reference/workspace/s3-filesystem)
|
|
@@ -19,7 +19,9 @@ const buffer = await filesystem.readFile('/image.png', { encoding: 'binary' })
|
|
|
19
19
|
|
|
20
20
|
**path** (`string`): File path relative to basePath
|
|
21
21
|
|
|
22
|
-
**options
|
|
22
|
+
**options** (`Options`): readFile options.
|
|
23
|
+
|
|
24
|
+
**options.encoding** (`'utf-8' | 'binary'`): Text or binary encoding
|
|
23
25
|
|
|
24
26
|
**Returns:** `Promise<string | Buffer>`
|
|
25
27
|
|
|
@@ -38,9 +40,11 @@ await filesystem.writeFile('/nested/path/file.md', content, { recursive: true })
|
|
|
38
40
|
|
|
39
41
|
**content** (`string | Buffer`): File content
|
|
40
42
|
|
|
41
|
-
**options
|
|
43
|
+
**options** (`Options`): Configuration options.
|
|
44
|
+
|
|
45
|
+
**options.recursive** (`boolean`): Create parent directories if they don't exist
|
|
42
46
|
|
|
43
|
-
**options.overwrite** (`boolean`): Overwrite existing file
|
|
47
|
+
**options.overwrite** (`boolean`): Overwrite existing file
|
|
44
48
|
|
|
45
49
|
### `deleteFile(path, options?)`
|
|
46
50
|
|
|
@@ -55,11 +59,13 @@ await filesystem.deleteFile('/docs/maybe.md', { force: true }) // Don't throw if
|
|
|
55
59
|
|
|
56
60
|
**path** (`string`): File path
|
|
57
61
|
|
|
58
|
-
**options
|
|
62
|
+
**options** (`Options`): Configuration options.
|
|
63
|
+
|
|
64
|
+
**options.force** (`boolean`): Don't throw error if file doesn't exist
|
|
59
65
|
|
|
60
66
|
### `appendFile(path, content)`
|
|
61
67
|
|
|
62
|
-
Append content to a file, creating it if it
|
|
68
|
+
Append content to a file, creating it if it doesn't already exist. Parent directories are created automatically.
|
|
63
69
|
|
|
64
70
|
```typescript
|
|
65
71
|
await filesystem.appendFile('/logs/app.log', 'New log entry\n')
|
|
@@ -85,7 +91,9 @@ await filesystem.copyFile('/docs/template.md', '/docs/new-doc.md')
|
|
|
85
91
|
|
|
86
92
|
**dest** (`string`): Destination file path
|
|
87
93
|
|
|
88
|
-
**options
|
|
94
|
+
**options** (`Options`): Configuration options.
|
|
95
|
+
|
|
96
|
+
**options.overwrite** (`boolean`): Overwrite destination if it exists
|
|
89
97
|
|
|
90
98
|
### `moveFile(src, dest, options?)`
|
|
91
99
|
|
|
@@ -101,7 +109,9 @@ await filesystem.moveFile('/docs/draft.md', '/docs/final.md')
|
|
|
101
109
|
|
|
102
110
|
**dest** (`string`): Destination file path
|
|
103
111
|
|
|
104
|
-
**options
|
|
112
|
+
**options** (`Options`): Configuration options.
|
|
113
|
+
|
|
114
|
+
**options.overwrite** (`boolean`): Overwrite destination if it exists
|
|
105
115
|
|
|
106
116
|
### `readdir(path, options?)`
|
|
107
117
|
|
|
@@ -137,7 +147,9 @@ await filesystem.mkdir('/deeply/nested/path', { recursive: true })
|
|
|
137
147
|
|
|
138
148
|
**path** (`string`): Directory path
|
|
139
149
|
|
|
140
|
-
**options
|
|
150
|
+
**options** (`Options`): Configuration options.
|
|
151
|
+
|
|
152
|
+
**options.recursive** (`boolean`): Create parent directories
|
|
141
153
|
|
|
142
154
|
### `rmdir(path, options?)`
|
|
143
155
|
|
|
@@ -152,9 +164,11 @@ await filesystem.rmdir('/docs/nested', { recursive: true })
|
|
|
152
164
|
|
|
153
165
|
**path** (`string`): Directory path
|
|
154
166
|
|
|
155
|
-
**options
|
|
167
|
+
**options** (`Options`): Configuration options.
|
|
168
|
+
|
|
169
|
+
**options.recursive** (`boolean`): Remove contents recursively
|
|
156
170
|
|
|
157
|
-
**options.force** (`boolean`): Don't throw if directory doesn't exist
|
|
171
|
+
**options.force** (`boolean`): Don't throw if directory doesn't exist
|
|
158
172
|
|
|
159
173
|
### `exists(path)`
|
|
160
174
|
|
|
@@ -189,7 +203,7 @@ interface FileStat {
|
|
|
189
203
|
}
|
|
190
204
|
```
|
|
191
205
|
|
|
192
|
-
## Optional
|
|
206
|
+
## Optional methods
|
|
193
207
|
|
|
194
208
|
### `init()`
|
|
195
209
|
|
|
@@ -6,10 +6,30 @@ Stores files in Google Cloud Storage.
|
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
+
**npm**:
|
|
10
|
+
|
|
9
11
|
```bash
|
|
10
12
|
npm install @mastra/gcs
|
|
11
13
|
```
|
|
12
14
|
|
|
15
|
+
**pnpm**:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add @mastra/gcs
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Yarn**:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
yarn add @mastra/gcs
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Bun**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bun add @mastra/gcs
|
|
31
|
+
```
|
|
32
|
+
|
|
13
33
|
## Usage
|
|
14
34
|
|
|
15
35
|
Add a `GCSFilesystem` to a workspace and assign it to an agent:
|
|
@@ -143,7 +163,7 @@ const config = filesystem.getMountConfig()
|
|
|
143
163
|
// { type: 'gcs', bucket: 'my-bucket', ... }
|
|
144
164
|
```
|
|
145
165
|
|
|
146
|
-
## Mounting in E2B
|
|
166
|
+
## Mounting in E2B sandboxes
|
|
147
167
|
|
|
148
168
|
GCSFilesystem can be mounted into E2B sandboxes, making the bucket accessible as a local directory:
|
|
149
169
|
|
|
@@ -116,7 +116,9 @@ const buffer = await filesystem.readFile('/image.png', { encoding: 'binary' })
|
|
|
116
116
|
|
|
117
117
|
**path** (`string`): File path relative to basePath
|
|
118
118
|
|
|
119
|
-
**options
|
|
119
|
+
**options** (`Options`): Configuration options.
|
|
120
|
+
|
|
121
|
+
**options.encoding** (`'utf-8' | 'binary'`): Text or binary encoding
|
|
120
122
|
|
|
121
123
|
### `writeFile(path, content, options?)`
|
|
122
124
|
|
|
@@ -133,9 +135,11 @@ await filesystem.writeFile('/nested/path/file.md', content, { recursive: true })
|
|
|
133
135
|
|
|
134
136
|
**content** (`string | Buffer`): File content
|
|
135
137
|
|
|
136
|
-
**options
|
|
138
|
+
**options** (`Options`): Configuration options.
|
|
139
|
+
|
|
140
|
+
**options.recursive** (`boolean`): Create parent directories if they don't exist
|
|
137
141
|
|
|
138
|
-
**options.overwrite** (`boolean`): Overwrite existing file
|
|
142
|
+
**options.overwrite** (`boolean`): Overwrite existing file
|
|
139
143
|
|
|
140
144
|
### `appendFile(path, content)`
|
|
141
145
|
|
|
@@ -164,7 +168,9 @@ await filesystem.deleteFile('/docs/maybe.md', { force: true }) // Don't throw if
|
|
|
164
168
|
|
|
165
169
|
**path** (`string`): File path
|
|
166
170
|
|
|
167
|
-
**options
|
|
171
|
+
**options** (`Options`): Configuration options.
|
|
172
|
+
|
|
173
|
+
**options.force** (`boolean`): Don't throw error if file doesn't exist
|
|
168
174
|
|
|
169
175
|
### `copyFile(src, dest, options?)`
|
|
170
176
|
|
|
@@ -181,7 +187,9 @@ await filesystem.copyFile('/src/config.json', '/backup/config.json', { overwrite
|
|
|
181
187
|
|
|
182
188
|
**dest** (`string`): Destination file path
|
|
183
189
|
|
|
184
|
-
**options
|
|
190
|
+
**options** (`Options`): Configuration options.
|
|
191
|
+
|
|
192
|
+
**options.overwrite** (`boolean`): Overwrite destination if it exists
|
|
185
193
|
|
|
186
194
|
### `moveFile(src, dest, options?)`
|
|
187
195
|
|
|
@@ -198,7 +206,9 @@ await filesystem.moveFile('/temp/upload.txt', '/files/document.txt')
|
|
|
198
206
|
|
|
199
207
|
**dest** (`string`): Destination file path
|
|
200
208
|
|
|
201
|
-
**options
|
|
209
|
+
**options** (`Options`): Configuration options.
|
|
210
|
+
|
|
211
|
+
**options.overwrite** (`boolean`): Overwrite destination if it exists
|
|
202
212
|
|
|
203
213
|
### `mkdir(path, options?)`
|
|
204
214
|
|
|
@@ -213,7 +223,9 @@ await filesystem.mkdir('/deeply/nested/path', { recursive: true })
|
|
|
213
223
|
|
|
214
224
|
**path** (`string`): Directory path
|
|
215
225
|
|
|
216
|
-
**options
|
|
226
|
+
**options** (`Options`): Configuration options.
|
|
227
|
+
|
|
228
|
+
**options.recursive** (`boolean`): Create parent directories
|
|
217
229
|
|
|
218
230
|
### `rmdir(path, options?)`
|
|
219
231
|
|
|
@@ -228,9 +240,11 @@ await filesystem.rmdir('/docs/nested', { recursive: true })
|
|
|
228
240
|
|
|
229
241
|
**path** (`string`): Directory path
|
|
230
242
|
|
|
231
|
-
**options
|
|
243
|
+
**options** (`Options`): Configuration options.
|
|
244
|
+
|
|
245
|
+
**options.recursive** (`boolean`): Remove contents recursively
|
|
232
246
|
|
|
233
|
-
**options.force** (`boolean`): Don't throw if directory doesn't exist
|
|
247
|
+
**options.force** (`boolean`): Don't throw if directory doesn't exist
|
|
234
248
|
|
|
235
249
|
### `readdir(path, options?)`
|
|
236
250
|
|
|
@@ -292,7 +306,7 @@ To override the default output, pass an `instructions` option to the constructor
|
|
|
292
306
|
|
|
293
307
|
## Path resolution
|
|
294
308
|
|
|
295
|
-
### How basePath works
|
|
309
|
+
### How `basePath` works
|
|
296
310
|
|
|
297
311
|
The `basePath` option sets the root directory for all file operations. File paths passed to methods like `readFile()` are resolved relative to this base:
|
|
298
312
|
|