@mastra/mcp-docs-server 1.3.9-alpha.9 → 1.3.10-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/code-mode.md +2 -2
- package/.docs/docs/agents/guardrails.md +5 -2
- package/.docs/docs/agents/human-in-the-loop.md +18 -5
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +8 -7
- package/.docs/docs/agents/processors.md +72 -21
- package/.docs/docs/agents/structured-output.md +6 -6
- package/.docs/docs/agents/tools.md +10 -10
- package/.docs/docs/auth/composite-auth.md +4 -2
- package/.docs/docs/auth/custom-auth-provider.md +1 -1
- package/.docs/docs/auth/overview.md +3 -1
- package/.docs/docs/browser.md +13 -1
- package/.docs/docs/channels.md +33 -6
- package/.docs/docs/connections/a2a.md +1 -1
- package/.docs/docs/connections/acp.md +2 -2
- package/.docs/docs/connections/mcp.md +159 -50
- package/.docs/docs/connections/overview.md +1 -1
- package/.docs/docs/connections/sdk-agents.md +26 -15
- package/.docs/docs/develop.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +5 -5
- package/.docs/docs/evals/experiments.md +29 -4
- package/.docs/docs/evals/multi-turn.md +2 -2
- package/.docs/docs/evals/overview.md +4 -4
- package/.docs/docs/evals/quick-checks.md +2 -2
- package/.docs/docs/guides/build-an-eval-loop.md +3 -3
- package/.docs/docs/guides/context-engineering.md +13 -6
- package/.docs/docs/guides/mcp-authentication-authorization.md +4 -4
- package/.docs/docs/guides/streaming.md +1 -1
- package/.docs/docs/harness/agent-controller.md +18 -21
- package/.docs/docs/harness/background-tasks.md +14 -3
- package/.docs/docs/harness/durable-agents.md +15 -9
- package/.docs/docs/harness/goals.md +5 -5
- package/.docs/docs/harness/overview.md +2 -2
- package/.docs/docs/harness/schedules.md +13 -11
- package/.docs/docs/index.md +7 -6
- package/.docs/docs/mastra-platform/connect/channels.md +1 -1
- package/.docs/docs/mastra-platform/connect/tools.md +4 -4
- package/.docs/docs/mastra-platform/environments.md +1 -1
- package/.docs/docs/mastra-platform/observability.md +1 -1
- package/.docs/docs/mastra-platform/server.md +1 -1
- package/.docs/docs/mastra-platform/studio.md +1 -1
- package/.docs/docs/memory/memory-processors.md +21 -15
- package/.docs/docs/memory/message-history.md +5 -5
- package/.docs/docs/memory/multi-user-threads.md +1 -1
- package/.docs/docs/memory/observational-memory.md +14 -14
- package/.docs/docs/memory/semantic-recall.md +22 -2
- package/.docs/docs/memory/working-memory.md +3 -3
- package/.docs/docs/observability/logging.md +5 -5
- package/.docs/docs/observability/tracing/overview.md +1 -0
- package/.docs/docs/sandbox/filesystem.md +26 -11
- package/.docs/docs/sandbox/overview.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/middleware.md +1 -1
- package/.docs/docs/server/overview.md +27 -0
- package/.docs/docs/server/request-context.md +3 -3
- package/.docs/docs/server/server-adapters.md +12 -204
- package/.docs/docs/signals/notifications.md +233 -0
- package/.docs/docs/signals/overview.md +94 -0
- package/.docs/docs/signals/running-across-processes.md +132 -0
- package/.docs/docs/signals/sending-signals.md +166 -0
- package/.docs/docs/signals/signal-providers.md +278 -0
- package/.docs/docs/signals/state-signals.md +103 -0
- package/.docs/docs/signals/thread-streams.md +94 -0
- package/.docs/docs/skills.md +4 -4
- package/.docs/docs/storage.md +1 -1
- package/.docs/docs/studio/auth.md +2 -2
- package/.docs/docs/studio/editor.md +39 -23
- package/.docs/docs/studio/observability.md +5 -1
- package/.docs/docs/subagents.md +6 -6
- package/.docs/docs/workflows/control-flow.md +14 -14
- package/.docs/docs/workflows/error-handling.md +1 -1
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +1 -1
- package/.docs/integrations/agentic-ui/copilotkit.md +1 -1
- package/.docs/integrations/agentic-ui/openui.md +1 -1
- package/.docs/integrations/browsers/agent-browser.md +1 -1
- package/.docs/integrations/browsers/browser-viewer.md +1 -1
- package/.docs/integrations/browsers/firecrawl.md +1 -1
- package/.docs/integrations/browsers/stagehand.md +6 -6
- package/.docs/integrations/channels/discord.md +1 -1
- package/.docs/integrations/channels/github.md +2 -2
- package/.docs/integrations/channels/imessage.md +2 -50
- package/.docs/integrations/channels/slack.md +1 -1
- package/.docs/integrations/channels/teams.md +1 -1
- package/.docs/integrations/channels/telegram.md +1 -1
- package/.docs/integrations/channels/whatsapp.md +1 -1
- package/.docs/integrations/databases/aurora-dsql.md +1 -1
- package/.docs/integrations/databases/cloudflare-kv.md +4 -0
- package/.docs/integrations/databases/elasticsearch.md +1 -1
- package/.docs/integrations/databases/mongodb.md +1 -1
- package/.docs/integrations/databases/oracledb.md +1 -1
- package/.docs/integrations/databases/postgresql.md +1 -1
- package/.docs/integrations/databases/redis.md +1 -1
- package/.docs/integrations/databases/upstash.md +1 -1
- package/.docs/integrations/deploy/aws-bedrock-agentcore.md +1 -0
- package/.docs/integrations/deploy/kubernetes.md +1 -1
- package/.docs/integrations/deploy/neon.md +2 -1
- package/.docs/integrations/deploy/render.md +2 -2
- package/.docs/integrations/file-storage/agentfs.md +1 -1
- package/.docs/integrations/file-storage/amazon-s3.md +20 -3
- package/.docs/integrations/file-storage/archil.md +1 -1
- package/.docs/integrations/file-storage/azure-blob.md +1 -1
- package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
- package/.docs/integrations/file-storage/google-drive.md +1 -1
- package/.docs/integrations/file-storage/mesa.md +1 -1
- package/.docs/integrations/file-storage/neon.md +210 -0
- package/.docs/integrations/file-storage/vercel-files.md +5 -1
- package/.docs/integrations/frameworks/express.md +0 -64
- package/.docs/integrations/observability/langfuse.md +1 -1
- package/.docs/integrations/observability/langsmith.md +2 -2
- package/.docs/integrations/observability/opentelemetry.md +5 -5
- package/.docs/integrations/sandboxes/apple-container.md +1 -1
- package/.docs/integrations/sandboxes/blaxel.md +1 -1
- package/.docs/integrations/sandboxes/daytona.md +1 -1
- package/.docs/integrations/sandboxes/docker.md +1 -1
- package/.docs/integrations/sandboxes/e2b-desktop.md +1 -1
- package/.docs/integrations/sandboxes/e2b.md +6 -2
- package/.docs/integrations/sandboxes/modal.md +1 -1
- package/.docs/integrations/sandboxes/railway.md +1 -1
- package/.docs/integrations/sandboxes/sprites.md +1 -1
- package/.docs/integrations/sandboxes/vercel.md +2 -2
- package/.docs/integrations/tools/brightdata.md +1 -1
- package/.docs/integrations/tools/firecrawl.md +1 -1
- package/.docs/integrations/tools/parallel.md +1 -1
- package/.docs/integrations/tools/perplexity.md +1 -1
- package/.docs/integrations/tools/tavily.md +1 -1
- package/.docs/integrations/voice/livekit.md +2 -2
- package/.docs/integrations.md +1 -0
- package/.docs/models/embeddings.md +2 -1
- package/.docs/models/environment-variables.md +1 -3
- package/.docs/models/gateways/custom-gateways.md +3 -3
- package/.docs/models/gateways/merge-gateway.md +7 -13
- package/.docs/models/gateways/netlify.md +2 -1
- package/.docs/models/gateways/openrouter.md +3 -2
- package/.docs/models/gateways/vercel.md +8 -5
- package/.docs/models/index.md +14 -16
- package/.docs/models/providers/302ai.md +3 -3
- package/.docs/models/providers/abacus.md +70 -110
- package/.docs/models/providers/aimlapi.md +171 -171
- package/.docs/models/providers/aixy.md +3 -1
- package/.docs/models/providers/aki-io.md +5 -6
- package/.docs/models/providers/alibaba-cn.md +9 -57
- package/.docs/models/providers/alibaba-coding-plan-cn.md +8 -12
- package/.docs/models/providers/alibaba-coding-plan.md +8 -12
- package/.docs/models/providers/alibaba-token-plan-cn.md +0 -2
- package/.docs/models/providers/alibaba-token-plan.md +29 -30
- package/.docs/models/providers/alibaba.md +33 -62
- package/.docs/models/providers/ambient.md +1 -9
- package/.docs/models/providers/amd.md +13 -9
- package/.docs/models/providers/anthropic.md +4 -2
- package/.docs/models/providers/arcee.md +6 -4
- package/.docs/models/providers/auriko.md +2 -2
- package/.docs/models/providers/baseten.md +4 -14
- package/.docs/models/providers/berget.md +3 -4
- package/.docs/models/providers/bothub.md +4 -4
- package/.docs/models/providers/boundless.md +0 -4
- package/.docs/models/providers/cline-pass.md +2 -8
- package/.docs/models/providers/cloudflare-workers-ai.md +1 -1
- package/.docs/models/providers/commandcode.md +0 -1
- package/.docs/models/providers/coralbricks.md +1 -1
- package/.docs/models/providers/cortecs.md +1 -1
- package/.docs/models/providers/crossmodel.md +69 -73
- package/.docs/models/providers/crusoe.md +1 -7
- package/.docs/models/providers/daoxe.md +1 -1
- package/.docs/models/providers/databricks.md +5 -10
- package/.docs/models/providers/deepinfra.md +2 -2
- package/.docs/models/providers/digitalocean.md +8 -24
- package/.docs/models/providers/dinference.md +0 -3
- package/.docs/models/providers/edenai.md +29 -5
- package/.docs/models/providers/empiriolabs.md +1 -8
- package/.docs/models/providers/engy.md +2 -2
- package/.docs/models/providers/evroc.md +2 -2
- package/.docs/models/providers/fastrouter.md +41 -50
- package/.docs/models/providers/fireworks-ai.md +6 -5
- package/.docs/models/providers/friendli.md +4 -5
- package/.docs/models/providers/frogbot.md +2 -7
- package/.docs/models/providers/google.md +5 -5
- package/.docs/models/providers/greenpt.md +14 -20
- package/.docs/models/providers/groq.md +3 -8
- package/.docs/models/providers/huggingface.md +5 -6
- package/.docs/models/providers/iflowcn.md +2 -18
- package/.docs/models/providers/impossibl.md +2 -9
- package/.docs/models/providers/inception.md +3 -2
- package/.docs/models/providers/inceptron.md +8 -6
- package/.docs/models/providers/inco.md +1 -1
- package/.docs/models/providers/inference.md +5 -11
- package/.docs/models/providers/infomaniak.md +10 -12
- package/.docs/models/providers/io-net.md +11 -17
- package/.docs/models/providers/iteracompute.md +5 -5
- package/.docs/models/providers/jalapeno.md +14 -19
- package/.docs/models/providers/jiekou.md +53 -63
- package/.docs/models/providers/kenari.md +35 -54
- package/.docs/models/providers/kilo.md +19 -33
- package/.docs/models/providers/lilac.md +2 -8
- package/.docs/models/providers/liquid.md +77 -0
- package/.docs/models/providers/llama.md +2 -11
- package/.docs/models/providers/llmgateway-providers.md +10 -27
- package/.docs/models/providers/llmgateway.md +12 -21
- package/.docs/models/providers/llmtr.md +1 -6
- package/.docs/models/providers/longcat.md +6 -5
- package/.docs/models/providers/lowrouter.md +1 -1
- package/.docs/models/providers/lucidquery.md +2 -2
- package/.docs/models/providers/meganova.md +6 -7
- package/.docs/models/providers/melious.md +11 -15
- package/.docs/models/providers/minimax-cn-coding-plan.md +4 -11
- package/.docs/models/providers/minimax-cn.md +4 -10
- package/.docs/models/providers/minimax-coding-plan.md +4 -11
- package/.docs/models/providers/minimax.md +4 -10
- package/.docs/models/providers/mistral.md +7 -6
- package/.docs/models/providers/moark.md +0 -2
- package/.docs/models/providers/modal.md +11 -7
- package/.docs/models/providers/moonshotai-cn.md +2 -2
- package/.docs/models/providers/nan.md +1 -1
- package/.docs/models/providers/nano-gpt.md +28 -31
- package/.docs/models/providers/nearai.md +3 -2
- package/.docs/models/providers/neuralwatt.md +1 -4
- package/.docs/models/providers/novita-ai.md +2 -1
- package/.docs/models/providers/nvidia.md +15 -35
- package/.docs/models/providers/oci.md +0 -1
- package/.docs/models/providers/ofox.md +149 -157
- package/.docs/models/providers/ollama-cloud.md +7 -12
- package/.docs/models/providers/openai.md +4 -2
- package/.docs/models/providers/opencode-go.md +2 -3
- package/.docs/models/providers/opencode.md +85 -87
- package/.docs/models/providers/opper.md +1 -4
- package/.docs/models/providers/orcarouter.md +14 -16
- package/.docs/models/providers/pareto.md +1 -1
- package/.docs/models/providers/perplexity-agent.md +43 -29
- package/.docs/models/providers/perplexity.md +2 -8
- package/.docs/models/providers/pioneer.md +13 -118
- package/.docs/models/providers/poe.md +16 -70
- package/.docs/models/providers/prime.md +2 -1
- package/.docs/models/providers/qihang-ai.md +7 -11
- package/.docs/models/providers/qiniu-ai.md +9 -94
- package/.docs/models/providers/regolo-ai.md +5 -7
- package/.docs/models/providers/requesty.md +0 -4
- package/.docs/models/providers/runinfra.md +3 -5
- package/.docs/models/providers/sarvam.md +1 -2
- package/.docs/models/providers/scaleway.md +12 -13
- package/.docs/models/providers/siliconflow-cn.md +35 -41
- package/.docs/models/providers/siliconflow.md +3 -6
- package/.docs/models/providers/snowflake-cortex.md +22 -22
- package/.docs/models/providers/stackit.md +2 -4
- package/.docs/models/providers/stepfun-ai.md +5 -7
- package/.docs/models/providers/stepfun.md +8 -10
- package/.docs/models/providers/submodel.md +1 -1
- package/.docs/models/providers/synthetic.md +2 -5
- package/.docs/models/providers/tempr.md +1 -4
- package/.docs/models/providers/tencent-coding-plan.md +3 -10
- package/.docs/models/providers/tensorx.md +0 -13
- package/.docs/models/providers/the-grid-ai.md +2 -1
- package/.docs/models/providers/thinkingmachines.md +45 -9
- package/.docs/models/providers/togetherai.md +17 -23
- package/.docs/models/providers/tokengo.md +1 -1
- package/.docs/models/providers/umans-ai-coding-plan.md +12 -11
- package/.docs/models/providers/umans-ai.md +11 -10
- package/.docs/models/providers/unorouter.md +0 -13
- package/.docs/models/providers/vancine.md +0 -1
- package/.docs/models/providers/vivgrid.md +3 -3
- package/.docs/models/providers/volcengine-coding-plan.md +8 -12
- package/.docs/models/providers/volcengine.md +12 -18
- package/.docs/models/providers/vultr.md +0 -2
- package/.docs/models/providers/wafer.ai.md +3 -7
- package/.docs/models/providers/wandb.md +1 -1
- package/.docs/models/providers/xai.md +21 -4
- package/.docs/models/providers/xiaomi-token-plan-ams.md +4 -5
- package/.docs/models/providers/xiaomi-token-plan-cn.md +4 -5
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +4 -5
- package/.docs/models/providers/xiaomi.md +4 -4
- package/.docs/models/providers/xpersona.md +0 -1
- package/.docs/models/providers/zai-coding-plan.md +0 -4
- package/.docs/models/providers/zenmux.md +105 -125
- package/.docs/models/providers/zhipuai-coding-plan.md +0 -1
- package/.docs/models/providers/zhipuai.md +12 -12
- package/.docs/models/providers.md +1 -3
- package/.docs/reference/acp/acp-agent.md +4 -4
- package/.docs/reference/acp/create-acp-tool.md +1 -1
- package/.docs/reference/agent-controller/agent-controller-class.md +18 -23
- package/.docs/reference/agent-controller/session.md +8 -8
- package/.docs/reference/agents/agent.md +22 -46
- package/.docs/reference/agents/channels.md +17 -9
- package/.docs/reference/agents/durable-agent.md +14 -10
- package/.docs/reference/agents/generate.md +57 -3
- package/.docs/reference/agents/generateLegacy.md +2 -2
- package/.docs/reference/agents/getLLM.md +2 -2
- package/.docs/reference/agents/getMetadata.md +2 -2
- package/.docs/reference/agents/getSkill.md +1 -1
- package/.docs/reference/agents/inngest-agent.md +1 -1
- package/.docs/reference/agents/listSkills.md +1 -4
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/browser/agent-browser.md +1 -1
- package/.docs/reference/browser/browser-viewer.md +1 -1
- package/.docs/reference/browser/firecrawl-browser.md +1 -1
- package/.docs/reference/browser/mastra-browser.md +2 -2
- package/.docs/reference/browser/stagehand-browser.md +4 -4
- package/.docs/reference/channels/slack-provider.md +3 -0
- package/.docs/reference/cli/mastra.md +26 -0
- package/.docs/reference/client-js/agent-controller.md +14 -4
- package/.docs/reference/client-js/agents.md +21 -1
- package/.docs/reference/client-js/mastra-client.md +1 -1
- package/.docs/reference/client-js/observability.md +29 -4
- package/.docs/reference/coding-agent/build-base-prompt.md +1 -1
- package/.docs/reference/coding-agent/create-coding-agent.md +8 -8
- package/.docs/reference/configuration.md +33 -3
- package/.docs/reference/connect/tools.md +2 -2
- package/.docs/reference/core/getAgentById.md +1 -1
- package/.docs/reference/core/mastra-class.md +2 -2
- package/.docs/reference/core/mastra-model-gateway.md +34 -5
- package/.docs/reference/datasets/delete.md +6 -0
- package/.docs/reference/editor/mastra-editor.md +11 -9
- package/.docs/reference/editor/tool-provider.md +2 -2
- package/.docs/reference/evals/answer-relevancy.md +1 -1
- package/.docs/reference/evals/answer-similarity.md +1 -1
- package/.docs/reference/evals/bias.md +1 -1
- package/.docs/reference/evals/checks.md +1 -1
- package/.docs/reference/evals/context-precision.md +3 -3
- package/.docs/reference/evals/context-recall.md +3 -3
- package/.docs/reference/evals/context-relevance.md +11 -11
- package/.docs/reference/evals/create-classifier-scorer.md +6 -2
- package/.docs/reference/evals/faithfulness.md +1 -1
- package/.docs/reference/evals/hallucination.md +5 -5
- package/.docs/reference/evals/multi-turn-judge.md +2 -2
- package/.docs/reference/evals/noise-sensitivity.md +12 -12
- package/.docs/reference/evals/not-scorable.md +1 -1
- package/.docs/reference/evals/prompt-alignment.md +16 -16
- package/.docs/reference/evals/rubric.md +5 -5
- package/.docs/reference/evals/summarization.md +4 -4
- package/.docs/reference/evals/tool-call-accuracy.md +4 -4
- package/.docs/reference/evals/toxicity.md +1 -1
- package/.docs/reference/file-based-agents/config.md +3 -3
- package/.docs/reference/file-based-agents/instructions.md +1 -1
- package/.docs/reference/file-based-agents/processors.md +2 -0
- package/.docs/reference/file-based-agents/schedules.md +2 -2
- package/.docs/reference/file-based-agents/skills.md +1 -1
- package/.docs/reference/file-based-agents/subagents.md +5 -5
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/manual-install.md +3 -2
- package/.docs/reference/memory/cloneThread.md +1 -1
- package/.docs/reference/memory/copyThread.md +1 -1
- package/.docs/reference/memory/deleteMessages.md +4 -1
- package/.docs/reference/memory/memory-class.md +5 -3
- package/.docs/reference/memory/observational-memory.md +16 -16
- package/.docs/reference/memory/serialized-memory-config.md +1 -1
- package/.docs/reference/memory/summarizeConversation.md +3 -3
- package/.docs/reference/memory/summarizeThread.md +3 -3
- package/.docs/reference/migrations/agentnetwork.md +4 -4
- package/.docs/reference/migrations/mcp-v2.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/agent.md +1 -1
- package/.docs/reference/migrations/vnext-to-standard-apis.md +2 -2
- package/.docs/reference/observability/tracing/advanced-queries.md +131 -41
- package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
- package/.docs/reference/observability/tracing/interfaces.md +2 -0
- package/.docs/reference/processors/batch-parts-processor.md +1 -1
- package/.docs/reference/processors/classifier-processor.md +2 -2
- package/.docs/reference/processors/cyber-refusal-handler.md +1 -1
- package/.docs/reference/processors/file-upload-processor.md +1 -1
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/message-history-processor.md +2 -2
- package/.docs/reference/processors/model-selection-processor.md +7 -7
- package/.docs/reference/processors/moderation-processor.md +2 -2
- package/.docs/reference/processors/pii-detector.md +2 -2
- package/.docs/reference/processors/prefill-error-handler.md +2 -2
- package/.docs/reference/processors/processor-interface.md +76 -12
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/provider-history-compat.md +1 -1
- package/.docs/reference/processors/regex-filter-processor.md +1 -1
- package/.docs/reference/processors/response-cache.md +1 -1
- package/.docs/reference/processors/semantic-recall-processor.md +2 -2
- package/.docs/reference/processors/skill-search-processor.md +1 -1
- package/.docs/reference/processors/stream-error-retry-processor.md +3 -3
- package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
- package/.docs/reference/processors/token-cost-control.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +3 -3
- package/.docs/reference/processors/tool-call-filter.md +2 -2
- package/.docs/reference/processors/tool-search-processor.md +3 -3
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/processors/working-memory-processor.md +2 -2
- package/.docs/reference/pubsub/lease-provider.md +2 -2
- package/.docs/reference/pubsub/redis-streams.md +1 -1
- package/.docs/reference/rag/chunking-and-embedding.md +1 -1
- package/.docs/reference/rag/graph-rag-guide.md +2 -2
- package/.docs/reference/rag/metadata-filters.md +1 -1
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/rag/retrieval.md +13 -13
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/server/routes.md +159 -0
- package/.docs/reference/signals/create-notification-inbox-tool.md +4 -4
- package/.docs/reference/signals/notifications.md +249 -0
- package/.docs/reference/signals/signal-provider.md +2 -0
- package/.docs/reference/signals/task-signal-provider.md +3 -3
- package/.docs/reference/signals/thread-events.md +69 -0
- package/.docs/reference/streaming/ChunkType.md +68 -0
- package/.docs/reference/streaming/agents/stream.md +3 -3
- package/.docs/reference/tools/create-code-mode.md +1 -1
- package/.docs/reference/tools/create-tool.md +17 -0
- package/.docs/reference/tools/mcp-client.md +430 -3
- package/.docs/reference/tools/mcp-server.md +173 -1
- package/.docs/reference/tools/task-tools.md +1 -1
- package/.docs/reference/tools/vector-query-tool.md +1 -1
- package/.docs/reference/vectors/libsql.md +1 -1
- package/.docs/reference/vectors/mongodb.md +2 -2
- package/.docs/reference/vectors/oracledb.md +2 -2
- package/.docs/reference/vectors/pg.md +1 -1
- package/.docs/reference/vectors/upstash.md +1 -1
- package/.docs/reference/voice/overview.md +24 -24
- package/.docs/reference/voice/speech-to-speech.md +6 -6
- package/.docs/reference/voice/speech-to-text.md +1 -1
- package/.docs/reference/voice/text-to-speech.md +1 -1
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/workflows/workflow-methods/branch.md +1 -1
- package/.docs/reference/workspace/filesystem.md +17 -17
- package/.docs/reference/workspace/local-filesystem.md +52 -27
- package/.docs/reference/workspace/local-sandbox.md +1 -1
- package/.docs/reference/workspace/platform-filesystem.md +1 -1
- package/.docs/reference/workspace/platform-sandbox.md +23 -2
- package/.docs/reference/workspace/process-manager.md +13 -2
- package/.docs/reference/workspace/sandbox.md +16 -0
- package/.docs/reference/workspace/workspace-class.md +13 -12
- package/dist/index.js +1 -2
- package/dist/{src-Baf8l9Sp.js → src-DnH_jHt9.js} +2 -3
- package/dist/{src-Baf8l9Sp.js.map → src-DnH_jHt9.js.map} +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +9 -9
- package/.docs/docs/harness/signal-providers.md +0 -212
- package/.docs/docs/harness/signals.md +0 -546
|
@@ -15,8 +15,8 @@ The `WorkspaceFilesystem` interface defines how workspaces interact with file st
|
|
|
15
15
|
Read file contents.
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
|
-
const content = await filesystem.readFile('
|
|
19
|
-
const buffer = await filesystem.readFile('
|
|
18
|
+
const content = await filesystem.readFile('docs/guide.md', { encoding: 'utf-8' })
|
|
19
|
+
const buffer = await filesystem.readFile('image.png') // Buffer
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
**Parameters:**
|
|
@@ -34,8 +34,8 @@ const buffer = await filesystem.readFile('/image.png') // Buffer
|
|
|
34
34
|
Write file contents.
|
|
35
35
|
|
|
36
36
|
```typescript
|
|
37
|
-
await filesystem.writeFile('
|
|
38
|
-
await filesystem.writeFile('
|
|
37
|
+
await filesystem.writeFile('docs/new.md', '# New Document')
|
|
38
|
+
await filesystem.writeFile('nested/path/file.md', content, { recursive: true })
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
**Parameters:**
|
|
@@ -57,8 +57,8 @@ await filesystem.writeFile('/nested/path/file.md', content, { recursive: true })
|
|
|
57
57
|
Delete a file.
|
|
58
58
|
|
|
59
59
|
```typescript
|
|
60
|
-
await filesystem.deleteFile('
|
|
61
|
-
await filesystem.deleteFile('
|
|
60
|
+
await filesystem.deleteFile('docs/old.md')
|
|
61
|
+
await filesystem.deleteFile('docs/maybe.md', { force: true }) // Don't throw if missing
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
**Parameters:**
|
|
@@ -74,7 +74,7 @@ await filesystem.deleteFile('/docs/maybe.md', { force: true }) // Don't throw if
|
|
|
74
74
|
Append content to a file, creating it if it doesn't already exist. Parent directories are created automatically.
|
|
75
75
|
|
|
76
76
|
```typescript
|
|
77
|
-
await filesystem.appendFile('
|
|
77
|
+
await filesystem.appendFile('logs/app.log', 'New log entry\n')
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
**Parameters:**
|
|
@@ -88,7 +88,7 @@ await filesystem.appendFile('/logs/app.log', 'New log entry\n')
|
|
|
88
88
|
Copy a file to a new location.
|
|
89
89
|
|
|
90
90
|
```typescript
|
|
91
|
-
await filesystem.copyFile('
|
|
91
|
+
await filesystem.copyFile('docs/template.md', 'docs/new-doc.md')
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
**Parameters:**
|
|
@@ -106,7 +106,7 @@ await filesystem.copyFile('/docs/template.md', '/docs/new-doc.md')
|
|
|
106
106
|
Move or rename a file.
|
|
107
107
|
|
|
108
108
|
```typescript
|
|
109
|
-
await filesystem.moveFile('
|
|
109
|
+
await filesystem.moveFile('docs/draft.md', 'docs/final.md')
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
**Parameters:**
|
|
@@ -124,7 +124,7 @@ await filesystem.moveFile('/docs/draft.md', '/docs/final.md')
|
|
|
124
124
|
List directory contents.
|
|
125
125
|
|
|
126
126
|
```typescript
|
|
127
|
-
const entries = await filesystem.readdir('
|
|
127
|
+
const entries = await filesystem.readdir('docs')
|
|
128
128
|
// [{ name: 'guide.md', type: 'file' }, { name: 'api', type: 'directory' }]
|
|
129
129
|
```
|
|
130
130
|
|
|
@@ -145,8 +145,8 @@ interface FileEntry {
|
|
|
145
145
|
Create a directory.
|
|
146
146
|
|
|
147
147
|
```typescript
|
|
148
|
-
await filesystem.mkdir('
|
|
149
|
-
await filesystem.mkdir('
|
|
148
|
+
await filesystem.mkdir('docs/api')
|
|
149
|
+
await filesystem.mkdir('deeply/nested/path', { recursive: true })
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
**Parameters:**
|
|
@@ -162,8 +162,8 @@ await filesystem.mkdir('/deeply/nested/path', { recursive: true })
|
|
|
162
162
|
Remove a directory.
|
|
163
163
|
|
|
164
164
|
```typescript
|
|
165
|
-
await filesystem.rmdir('
|
|
166
|
-
await filesystem.rmdir('
|
|
165
|
+
await filesystem.rmdir('docs/old')
|
|
166
|
+
await filesystem.rmdir('docs/nested', { recursive: true })
|
|
167
167
|
```
|
|
168
168
|
|
|
169
169
|
**Parameters:**
|
|
@@ -181,7 +181,7 @@ await filesystem.rmdir('/docs/nested', { recursive: true })
|
|
|
181
181
|
Check if a path exists.
|
|
182
182
|
|
|
183
183
|
```typescript
|
|
184
|
-
const exists = await filesystem.exists('
|
|
184
|
+
const exists = await filesystem.exists('docs/guide.md')
|
|
185
185
|
```
|
|
186
186
|
|
|
187
187
|
**Returns:** `Promise<boolean>`
|
|
@@ -191,8 +191,8 @@ const exists = await filesystem.exists('/docs/guide.md')
|
|
|
191
191
|
Get file or directory metadata.
|
|
192
192
|
|
|
193
193
|
```typescript
|
|
194
|
-
const stat = await filesystem.stat('
|
|
195
|
-
// { name: 'guide.md', path: '
|
|
194
|
+
const stat = await filesystem.stat('docs/guide.md')
|
|
195
|
+
// { name: 'guide.md', path: 'docs/guide.md', type: 'file', size: 1234, createdAt: Date, modifiedAt: Date }
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
**Returns:** `Promise<FileStat>`
|
|
@@ -24,7 +24,7 @@ const workspace = new Workspace({
|
|
|
24
24
|
|
|
25
25
|
const agent = new Agent({
|
|
26
26
|
id: 'file-agent',
|
|
27
|
-
model: 'openai/gpt-
|
|
27
|
+
model: 'openai/gpt-6.1-sol',
|
|
28
28
|
workspace,
|
|
29
29
|
})
|
|
30
30
|
|
|
@@ -110,8 +110,8 @@ filesystem.setAllowedPaths([])
|
|
|
110
110
|
Read file contents.
|
|
111
111
|
|
|
112
112
|
```typescript
|
|
113
|
-
const content = await filesystem.readFile('
|
|
114
|
-
const buffer = await filesystem.readFile('
|
|
113
|
+
const content = await filesystem.readFile('docs/guide.md', { encoding: 'utf-8' })
|
|
114
|
+
const buffer = await filesystem.readFile('image.png')
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
**Parameters:**
|
|
@@ -127,8 +127,8 @@ const buffer = await filesystem.readFile('/image.png')
|
|
|
127
127
|
Write content to a file.
|
|
128
128
|
|
|
129
129
|
```typescript
|
|
130
|
-
await filesystem.writeFile('
|
|
131
|
-
await filesystem.writeFile('
|
|
130
|
+
await filesystem.writeFile('docs/new.md', '# New Document')
|
|
131
|
+
await filesystem.writeFile('nested/path/file.md', content, { recursive: true })
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
**Parameters:**
|
|
@@ -150,7 +150,7 @@ await filesystem.writeFile('/nested/path/file.md', content, { recursive: true })
|
|
|
150
150
|
Append content to an existing file.
|
|
151
151
|
|
|
152
152
|
```typescript
|
|
153
|
-
await filesystem.appendFile('
|
|
153
|
+
await filesystem.appendFile('logs/app.log', 'New log entry\n')
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
**Parameters:**
|
|
@@ -164,8 +164,8 @@ await filesystem.appendFile('/logs/app.log', 'New log entry\n')
|
|
|
164
164
|
Delete a file.
|
|
165
165
|
|
|
166
166
|
```typescript
|
|
167
|
-
await filesystem.deleteFile('
|
|
168
|
-
await filesystem.deleteFile('
|
|
167
|
+
await filesystem.deleteFile('docs/old.md')
|
|
168
|
+
await filesystem.deleteFile('docs/maybe.md', { force: true }) // Don't throw if missing
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
**Parameters:**
|
|
@@ -181,8 +181,8 @@ await filesystem.deleteFile('/docs/maybe.md', { force: true }) // Don't throw if
|
|
|
181
181
|
Copy a file to a new location.
|
|
182
182
|
|
|
183
183
|
```typescript
|
|
184
|
-
await filesystem.copyFile('
|
|
185
|
-
await filesystem.copyFile('
|
|
184
|
+
await filesystem.copyFile('docs/template.md', 'docs/new-doc.md')
|
|
185
|
+
await filesystem.copyFile('src/config.json', 'backup/config.json', { overwrite: false })
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
**Parameters:**
|
|
@@ -200,8 +200,8 @@ await filesystem.copyFile('/src/config.json', '/backup/config.json', { overwrite
|
|
|
200
200
|
Move or rename a file.
|
|
201
201
|
|
|
202
202
|
```typescript
|
|
203
|
-
await filesystem.moveFile('
|
|
204
|
-
await filesystem.moveFile('
|
|
203
|
+
await filesystem.moveFile('docs/draft.md', 'docs/final.md')
|
|
204
|
+
await filesystem.moveFile('temp/upload.txt', 'files/document.txt')
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
**Parameters:**
|
|
@@ -219,8 +219,8 @@ await filesystem.moveFile('/temp/upload.txt', '/files/document.txt')
|
|
|
219
219
|
Create a directory.
|
|
220
220
|
|
|
221
221
|
```typescript
|
|
222
|
-
await filesystem.mkdir('
|
|
223
|
-
await filesystem.mkdir('
|
|
222
|
+
await filesystem.mkdir('docs/api')
|
|
223
|
+
await filesystem.mkdir('deeply/nested/path', { recursive: true })
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
**Parameters:**
|
|
@@ -236,8 +236,8 @@ await filesystem.mkdir('/deeply/nested/path', { recursive: true })
|
|
|
236
236
|
Remove a directory.
|
|
237
237
|
|
|
238
238
|
```typescript
|
|
239
|
-
await filesystem.rmdir('
|
|
240
|
-
await filesystem.rmdir('
|
|
239
|
+
await filesystem.rmdir('docs/old')
|
|
240
|
+
await filesystem.rmdir('docs/nested', { recursive: true })
|
|
241
241
|
```
|
|
242
242
|
|
|
243
243
|
**Parameters:**
|
|
@@ -255,8 +255,11 @@ await filesystem.rmdir('/docs/nested', { recursive: true })
|
|
|
255
255
|
List directory contents.
|
|
256
256
|
|
|
257
257
|
```typescript
|
|
258
|
-
const entries = await filesystem.readdir('
|
|
258
|
+
const entries = await filesystem.readdir('docs')
|
|
259
259
|
// [{ name: 'guide.md', type: 'file' }, { name: 'api', type: 'directory' }]
|
|
260
|
+
|
|
261
|
+
// List the basePath root
|
|
262
|
+
const rootEntries = await filesystem.readdir('.')
|
|
260
263
|
```
|
|
261
264
|
|
|
262
265
|
### `exists(path)`
|
|
@@ -264,7 +267,7 @@ const entries = await filesystem.readdir('/docs')
|
|
|
264
267
|
Check if a path exists.
|
|
265
268
|
|
|
266
269
|
```typescript
|
|
267
|
-
const exists = await filesystem.exists('
|
|
270
|
+
const exists = await filesystem.exists('docs/guide.md')
|
|
268
271
|
```
|
|
269
272
|
|
|
270
273
|
### `stat(path)`
|
|
@@ -272,8 +275,8 @@ const exists = await filesystem.exists('/docs/guide.md')
|
|
|
272
275
|
Get file or directory metadata.
|
|
273
276
|
|
|
274
277
|
```typescript
|
|
275
|
-
const stat = await filesystem.stat('
|
|
276
|
-
// { type: 'file', size: 1234, modifiedAt: Date, createdAt: Date, path: '
|
|
278
|
+
const stat = await filesystem.stat('docs/guide.md')
|
|
279
|
+
// { type: 'file', size: 1234, modifiedAt: Date, createdAt: Date, path: 'docs/guide.md' }
|
|
277
280
|
```
|
|
278
281
|
|
|
279
282
|
### `getInfo()`
|
|
@@ -291,7 +294,7 @@ Returns a description of how paths work in this filesystem. When assigned to an
|
|
|
291
294
|
|
|
292
295
|
```typescript
|
|
293
296
|
const instructions = filesystem.getInstructions()
|
|
294
|
-
// 'Local filesystem at "/workspace".
|
|
297
|
+
// 'Local filesystem at "/workspace". Relative paths resolve from this directory. File access is restricted to this directory.'
|
|
295
298
|
```
|
|
296
299
|
|
|
297
300
|
Pass `requestContext` to enable per-request customization when the `instructions` constructor option is a function:
|
|
@@ -312,22 +315,44 @@ To override the default output, pass an `instructions` option to the constructor
|
|
|
312
315
|
|
|
313
316
|
### How `basePath` works
|
|
314
317
|
|
|
315
|
-
The `basePath` option sets the root directory for all file operations.
|
|
318
|
+
The `basePath` option sets the root directory for all file operations. Paths passed to methods like `readFile()` are resolved as follows:
|
|
316
319
|
|
|
317
|
-
-
|
|
318
|
-
-
|
|
319
|
-
-
|
|
320
|
+
- Relative paths are resolved against `basePath`: `docs/guide.md` → `<basePath>/docs/guide.md`
|
|
321
|
+
- Use `.` to refer to the root of `basePath`, for example `readdir('.')`
|
|
322
|
+
- Absolute paths are treated as host paths, not as paths inside `basePath`. With the default `contained: true`, any absolute path that falls outside `basePath` and the configured `allowedPaths` is rejected with a `PermissionError`
|
|
323
|
+
- `~` expands to the user's home directory, so it's also a host path and is subject to the same containment rules
|
|
320
324
|
|
|
321
325
|
```typescript
|
|
322
326
|
const filesystem = new LocalFilesystem({
|
|
323
327
|
basePath: './workspace',
|
|
324
328
|
})
|
|
325
329
|
|
|
326
|
-
//
|
|
327
|
-
await filesystem.readFile('/docs/guide.md')
|
|
330
|
+
// Resolves to ./workspace/docs/guide.md
|
|
328
331
|
await filesystem.readFile('docs/guide.md')
|
|
332
|
+
await filesystem.readFile('./docs/guide.md')
|
|
333
|
+
|
|
334
|
+
// Root of basePath
|
|
335
|
+
await filesystem.readdir('.')
|
|
336
|
+
|
|
337
|
+
// Throws a PermissionError with the default contained: true
|
|
338
|
+
await filesystem.readFile('/docs/guide.md')
|
|
329
339
|
```
|
|
330
340
|
|
|
341
|
+
To read host absolute paths outside `basePath`, add them to `allowedPaths` or set `contained: false`. Prefer `allowedPaths` when only a few external directories are needed.
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
const filesystem = new LocalFilesystem({
|
|
345
|
+
basePath: './workspace',
|
|
346
|
+
allowedPaths: ['/home/user/shared-docs'],
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
await filesystem.readFile('/home/user/shared-docs/guide.md')
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Mounted filesystems
|
|
353
|
+
|
|
354
|
+
When a `LocalFilesystem` is mounted in a workspace through `CompositeFilesystem`, workspace-facing paths include the mount prefix. For example, with a mount at `/workspace`, the workspace path `/workspace/report.md` is passed to the underlying filesystem as `report.md`, relative to its `basePath`. See [Filesystem mounts](https://mastra.ai/docs/sandbox/filesystem) for mount configuration.
|
|
355
|
+
|
|
331
356
|
### Relative paths and execution context
|
|
332
357
|
|
|
333
358
|
When you use a relative path for `basePath`, it resolves from `process.cwd()`. In Mastra projects, the cwd changes based on how you run your code:
|
|
@@ -83,7 +83,7 @@ const agent = new Agent({
|
|
|
83
83
|
id: 'code-agent',
|
|
84
84
|
name: 'Code Agent',
|
|
85
85
|
instructions: 'You are a coding assistant working in this workspace.',
|
|
86
|
-
model: 'anthropic/claude-sonnet-
|
|
86
|
+
model: 'anthropic/claude-sonnet-5-5',
|
|
87
87
|
workspace,
|
|
88
88
|
})
|
|
89
89
|
|
|
@@ -314,6 +314,25 @@ console.log(result.exitCode)
|
|
|
314
314
|
|
|
315
315
|
> **Warning:** The `command` argument is a shell string and is concatenated verbatim into the remote shell. This lets you use pipes, redirects, and chaining (`ls -la | grep foo`) but means untrusted input must be passed through `args` (safely quoted) or shell-quoted by the caller. Untrusted `command` values allow arbitrary shell execution on the sandbox.
|
|
316
316
|
|
|
317
|
+
### Background processes
|
|
318
|
+
|
|
319
|
+
`sandbox.processes` runs commands in the background. Output streams while they run, and you can list, attach to and stop them:
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
const handle = await sandbox.processes.spawn('pnpm dev', {
|
|
323
|
+
onStdout: data => console.log(data),
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
// Everything running in the sandbox, plus exited processes not read yet
|
|
327
|
+
const running = await sandbox.processes.list()
|
|
328
|
+
|
|
329
|
+
await handle.kill()
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
A process has no time limit unless you pass `timeout` to `spawn()` or the constructor. Call `get(pid)` to attach to a process this manager didn't start, for example after your app restarts. Output written before attaching isn't available.
|
|
333
|
+
|
|
334
|
+
A long-running process's output stream reconnects periodically, and the process keeps running through it. Output written during a reconnect is lost, and a process that exits while its stream reconnects reports exit code `1` from `wait()` instead of its real exit code.
|
|
335
|
+
|
|
317
336
|
## Constructor parameters
|
|
318
337
|
|
|
319
338
|
**accessToken** (`string`): Platform access token. Falls back to the MASTRA\_PLATFORM\_ACCESS\_TOKEN environment variable.
|
|
@@ -358,7 +377,9 @@ console.log(result.exitCode)
|
|
|
358
377
|
|
|
359
378
|
**status** (`ProviderStatus`): 'pending' | 'initializing' | 'ready' | 'starting' | 'running' | 'stopping' | 'stopped' | 'destroying' | 'destroyed' | 'error'.
|
|
360
379
|
|
|
361
|
-
**processes** (`
|
|
380
|
+
**processes** (`SandboxProcessManager`): Background process manager. spawn() streams output while the process runs, kill() stops it, list() shows what is running in the sandbox, and get(pid) attaches to a process this manager didn't start. See Background processes and the SandboxProcessManager reference.
|
|
381
|
+
|
|
382
|
+
**filesystem** (`PlatformSandboxFilesystem | undefined`): The sandbox's disk through E2B's files API, sent straight to the VM with the same lease executeCommand() uses. undefined when the sandbox isn't E2B-backed; use executeCommand() then. Paths are absolute and not confined to a root. Copies, appends, and no-overwrite writes run as one command in the VM. See Native filesystem.
|
|
362
383
|
|
|
363
384
|
**templatePending** (`{ templateId: string; retryAfterMs: number } | undefined`): Set when the running sandbox booted from a fallback template (same-lineage stale or provider base) while the exact template continues to build in the background. Undefined when the sandbox booted from the exact template. Observability only — PlatformSandbox does not re-execute template operations; reconcile filesystem state in your own runtime setup.
|
|
364
385
|
|
|
@@ -76,6 +76,8 @@ const handle = await sandbox.processes.spawn('npm run dev', {
|
|
|
76
76
|
|
|
77
77
|
List all tracked processes. Returns info about each process including PID, running state, and exit code.
|
|
78
78
|
|
|
79
|
+
A process that has exited stays in the list until something reads it with `get(pid)`, so a finished command's output can still be read.
|
|
80
|
+
|
|
79
81
|
```typescript
|
|
80
82
|
const procs = await sandbox.processes.list()
|
|
81
83
|
for (const proc of procs) {
|
|
@@ -85,18 +87,27 @@ for (const proc of procs) {
|
|
|
85
87
|
|
|
86
88
|
**Returns:** `Promise<ProcessInfo[]>`
|
|
87
89
|
|
|
88
|
-
### `get(pid)`
|
|
90
|
+
### `get(pid, options?)`
|
|
89
91
|
|
|
90
92
|
Get a handle to a process by PID. Returns `undefined` if the process isn't found or has already been dismissed.
|
|
91
93
|
|
|
94
|
+
Reading a process that has exited dismisses it: later calls return `undefined` and it leaves `list()`. Pass `{ release: false }` to read it and leave it available, so one reader can look at a finished process's output without taking it from another, such as the agent that started it.
|
|
95
|
+
|
|
92
96
|
```typescript
|
|
93
|
-
const handle = await sandbox.processes.get(1234)
|
|
97
|
+
const handle = await sandbox.processes.get('1234')
|
|
94
98
|
if (handle) {
|
|
95
99
|
console.log(handle.stdout)
|
|
96
100
|
await handle.kill()
|
|
97
101
|
}
|
|
102
|
+
|
|
103
|
+
// Read without dismissing an exited process
|
|
104
|
+
const peek = await sandbox.processes.get('1234', { release: false })
|
|
98
105
|
```
|
|
99
106
|
|
|
107
|
+
**pid** (`string`): Process ID.
|
|
108
|
+
|
|
109
|
+
**options.release** (`boolean`): Whether reading an exited process dismisses it. Defaults to true. (Default: `true`)
|
|
110
|
+
|
|
100
111
|
**Returns:** `Promise<ProcessHandle | undefined>`
|
|
101
112
|
|
|
102
113
|
### `kill(pid)`
|
|
@@ -14,6 +14,8 @@ The `WorkspaceSandbox` interface defines how workspaces execute commands and man
|
|
|
14
14
|
|
|
15
15
|
**computer** (`SandboxComputer`): Computer-use (desktop) capability. If not implemented, computer tools won't be available. See Computer capability.
|
|
16
16
|
|
|
17
|
+
**filesystem** (`WorkspaceFilesystem`): Direct access to the sandbox's disk through the provider's file API, one request per operation instead of a shell command. See Native filesystem.
|
|
18
|
+
|
|
17
19
|
## Methods
|
|
18
20
|
|
|
19
21
|
### `start()`
|
|
@@ -216,6 +218,20 @@ const instructions = sandbox.getInstructions?.()
|
|
|
216
218
|
|
|
217
219
|
**Returns:** `string`
|
|
218
220
|
|
|
221
|
+
## Native filesystem
|
|
222
|
+
|
|
223
|
+
Sandboxes whose provider has a file API expose it on the optional `filesystem` property. Reads, writes, and listings take one request each, where the same work through `executeCommand()` takes a command per step. Paths are absolute inside the sandbox.
|
|
224
|
+
|
|
225
|
+
The provider owns containment: `filesystem` doesn't confine paths or symlinks to a workspace root. Fall back to `executeCommand()` when the property is absent:
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
const pkg = sandbox.filesystem
|
|
229
|
+
? await sandbox.filesystem.readFile('/workspace/app/package.json', { encoding: 'utf-8' })
|
|
230
|
+
: (await sandbox.executeCommand?.('cat', ['/workspace/app/package.json']))?.stdout
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
`E2BSandbox` and `PlatformSandbox` implement `filesystem`. A `Workspace` doesn't use it automatically; pass it as the workspace `filesystem` or call it directly.
|
|
234
|
+
|
|
219
235
|
## Computer capability
|
|
220
236
|
|
|
221
237
|
Sandboxes with a controllable desktop environment implement the optional `SandboxComputer` interface on the `computer` property. When present on a statically configured sandbox, the workspace tools factory registers the `mastra_workspace_computer_*` tools automatically. See [Computer-use tools](https://mastra.ai/docs/sandbox/computer).
|
|
@@ -471,18 +471,19 @@ A workspace provides tools to agents based on what's configured.
|
|
|
471
471
|
|
|
472
472
|
Added when a filesystem is configured:
|
|
473
473
|
|
|
474
|
-
| Tool
|
|
475
|
-
|
|
|
476
|
-
| `mastra_workspace_read_file`
|
|
477
|
-
| `mastra_workspace_write_file`
|
|
478
|
-
| `mastra_workspace_edit_file`
|
|
479
|
-
| `mastra_workspace_list_files`
|
|
480
|
-
| `mastra_workspace_delete`
|
|
481
|
-
| `mastra_workspace_file_stat`
|
|
482
|
-
| `mastra_workspace_mkdir`
|
|
483
|
-
| `mastra_workspace_grep`
|
|
484
|
-
|
|
485
|
-
|
|
474
|
+
| Tool | Description |
|
|
475
|
+
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
476
|
+
| `mastra_workspace_read_file` | Read file contents. Text files return as text (with optional line range). Images and PDFs return as native media parts the model can view directly. Other binaries return metadata only unless an explicit `encoding` is passed. |
|
|
477
|
+
| `mastra_workspace_write_file` | Create or overwrite a file with new content. Creates parent directories automatically. |
|
|
478
|
+
| `mastra_workspace_edit_file` | Edit an existing file by finding and replacing text. Useful for targeted changes without rewriting the entire file. |
|
|
479
|
+
| `mastra_workspace_list_files` | List directory contents as a tree structure. Supports recursive listing with depth limits, glob patterns, and `.gitignore` filtering (enabled by default: every `.gitignore` applies relative to its own directory, and `node_modules` is skipped unless the listed path is inside it). |
|
|
480
|
+
| `mastra_workspace_delete` | Delete a file or directory. Supports recursive deletion for directories. |
|
|
481
|
+
| `mastra_workspace_file_stat` | Get metadata about a file or directory including size, type, and modification time. |
|
|
482
|
+
| `mastra_workspace_mkdir` | Create a directory. Creates parent directories automatically if they don't exist. |
|
|
483
|
+
| `mastra_workspace_grep` | Search file contents using regex patterns. Supports glob filtering, context lines, and case-insensitive search. Applies `.gitignore` files the same way as `list_files` and skips `node_modules` unless the search path is inside it. |
|
|
484
|
+
| `mastra_workspace_apply_patch` | Create, update, move, and delete several files in one call using a patch. Opt-in: only added when `tools[WORKSPACE_TOOLS.FILESYSTEM.APPLY_PATCH].enabled` is set. The top-level `tools.enabled` doesn't enable it. The tool checks every hunk before it writes anything. If a hunk doesn't match, every file stays as it was. |
|
|
485
|
+
|
|
486
|
+
With a static filesystem, write tools (`write_file`, `edit_file`, `delete`, `mkdir`, `apply_patch`) are excluded when the filesystem is in read-only mode. With a [runtime-defined filesystem](https://mastra.ai/docs/sandbox/filesystem), write tools are always included and read-only is enforced at runtime.
|
|
486
487
|
|
|
487
488
|
The `read_file` tool accepts `mediaTypes` and `maxMediaBytes` options to control which mime types are surfaced to the model as native media parts and how large those files can be:
|
|
488
489
|
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { createDocsServer, runServer };
|
|
1
|
+
export { t as createDocsServer, n as runServer } from "./src-DnH_jHt9.js";
|
|
@@ -3,8 +3,7 @@ import { MCPServer } from "@mastra/mcp";
|
|
|
3
3
|
import { MCPServer as MCPServer$1 } from "@mastra/mcp-legacy";
|
|
4
4
|
import * as fs$1 from "fs";
|
|
5
5
|
import { existsSync, mkdirSync } from "fs";
|
|
6
|
-
import * as os$1 from "os";
|
|
7
|
-
import os from "os";
|
|
6
|
+
import os, * as os$1 from "os";
|
|
8
7
|
import * as path$1 from "path";
|
|
9
8
|
import path, { dirname } from "path";
|
|
10
9
|
import { z } from "zod";
|
|
@@ -1856,4 +1855,4 @@ async function runServer() {
|
|
|
1856
1855
|
//#endregion
|
|
1857
1856
|
export { writeErrorLog as i, runServer as n, setLogLevel as r, createDocsServer as t };
|
|
1858
1857
|
|
|
1859
|
-
//# sourceMappingURL=src-
|
|
1858
|
+
//# sourceMappingURL=src-DnH_jHt9.js.map
|