@mastra/mcp-docs-server 1.2.15-alpha.15 → 1.2.15-alpha.20
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 +16 -1
- package/.docs/docs/agents/processors.md +3 -3
- package/.docs/docs/browser/recording.md +2 -2
- package/.docs/docs/deployment/workers.md +1 -1
- package/.docs/docs/getting-started/develop.md +1 -1
- package/.docs/docs/harness/agent-controller.md +43 -2
- package/.docs/docs/harness/overview.md +2 -4
- package/.docs/docs/long-running-agents/durable-agents.md +1 -1
- package/.docs/docs/long-running-agents/goals.md +1 -1
- package/.docs/docs/long-running-agents/schedules.md +1 -1
- package/.docs/docs/long-running-agents/signal-providers.md +1 -1
- package/.docs/docs/long-running-agents/signals.md +1 -1
- package/.docs/docs/mastra-platform/deploy.md +27 -0
- package/.docs/docs/mastra-platform/trace-intelligence.md +9 -13
- package/.docs/docs/memory/message-history.md +2 -2
- package/.docs/docs/observability/integrations/exporters/mastra-platform.md +1 -1
- package/.docs/docs/observability/integrations/exporters/otel.md +2 -2
- package/.docs/docs/server/auth/auth0.md +1 -1
- package/.docs/docs/server/auth/clerk.md +2 -2
- package/.docs/docs/server/auth/firebase.md +1 -1
- package/.docs/docs/server/auth/okta.md +24 -4
- package/.docs/docs/server/auth/supabase.md +2 -2
- package/.docs/docs/server/auth/workers.md +2 -0
- package/.docs/docs/server/auth/workos.md +1 -1
- package/.docs/docs/server/custom-adapters.md +1 -1
- package/.docs/docs/server/custom-api-routes.md +35 -0
- package/.docs/docs/server/mastra-client.md +2 -2
- package/.docs/docs/server/mastra-server.md +1 -1
- package/.docs/docs/workflows/dynamic-workflows.md +1 -1
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/docs/workflows/time-travel.md +2 -0
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +3 -3
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/channels.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/overview.md +1 -1
- package/.docs/guides/deployment/amazon-ec2.md +1 -1
- package/.docs/guides/deployment/aws-bedrock-agentcore.md +1 -1
- package/.docs/guides/deployment/aws-lambda.md +1 -1
- package/.docs/guides/deployment/azure-app-services.md +1 -1
- package/.docs/guides/deployment/cloudflare.md +1 -1
- package/.docs/guides/deployment/digital-ocean.md +2 -2
- package/.docs/guides/deployment/kubernetes.md +2 -2
- package/.docs/guides/deployment/mastra-workers.md +3 -1
- package/.docs/guides/deployment/netlify.md +2 -2
- package/.docs/guides/deployment/vercel.md +1 -1
- package/.docs/guides/getting-started/electron.md +2 -2
- package/.docs/guides/getting-started/manual-install.md +2 -2
- package/.docs/guides/guide/signal-provider.md +1 -1
- package/.docs/guides/migrations/mastra-cloud.md +1 -1
- package/.docs/models/embeddings.md +1 -1
- package/.docs/models/environment-variables.md +1 -0
- package/.docs/models/gateways/neon.md +1 -1
- package/.docs/models/gateways/netlify.md +1 -1
- package/.docs/models/gateways/openrouter.md +2 -2
- package/.docs/models/gateways/vercel.md +2 -2
- package/.docs/models/index.md +3 -3
- package/.docs/models/providers/302ai.md +1 -1
- package/.docs/models/providers/abacus.md +1 -1
- package/.docs/models/providers/abliteration-ai.md +1 -1
- package/.docs/models/providers/agentrouter.md +1 -1
- package/.docs/models/providers/ai-router.md +1 -1
- package/.docs/models/providers/aiand.md +1 -1
- package/.docs/models/providers/aki-io.md +1 -1
- package/.docs/models/providers/alibaba-cn.md +1 -1
- package/.docs/models/providers/alibaba-coding-plan-cn.md +1 -1
- package/.docs/models/providers/alibaba-coding-plan.md +1 -1
- package/.docs/models/providers/alibaba-token-plan-cn.md +1 -1
- package/.docs/models/providers/alibaba-token-plan.md +1 -1
- package/.docs/models/providers/alibaba.md +1 -1
- package/.docs/models/providers/ambient.md +1 -1
- package/.docs/models/providers/anyapi.md +1 -1
- package/.docs/models/providers/atomic-chat.md +1 -1
- package/.docs/models/providers/auriko.md +1 -1
- package/.docs/models/providers/bailing.md +1 -1
- package/.docs/models/providers/baseten.md +1 -1
- package/.docs/models/providers/berget.md +1 -1
- package/.docs/models/providers/blueclaw.md +1 -1
- package/.docs/models/providers/chutes.md +1 -1
- package/.docs/models/providers/clarifai.md +1 -1
- package/.docs/models/providers/claudinio.md +1 -1
- package/.docs/models/providers/cline-pass.md +1 -1
- package/.docs/models/providers/cloudferro-sherlock.md +1 -1
- package/.docs/models/providers/cloudflare-workers-ai.md +1 -1
- package/.docs/models/providers/coralbricks.md +75 -0
- package/.docs/models/providers/cortecs.md +1 -1
- package/.docs/models/providers/crof.md +1 -1
- package/.docs/models/providers/crossmodel.md +2 -3
- package/.docs/models/providers/daoxe.md +1 -1
- package/.docs/models/providers/databricks.md +1 -1
- package/.docs/models/providers/deepinfra.md +1 -1
- package/.docs/models/providers/digitalocean.md +2 -2
- package/.docs/models/providers/dinference.md +1 -1
- package/.docs/models/providers/drun.md +1 -1
- package/.docs/models/providers/ebcloud.md +1 -1
- package/.docs/models/providers/empiriolabs.md +1 -1
- package/.docs/models/providers/evroc.md +3 -4
- package/.docs/models/providers/fastrouter.md +1 -1
- package/.docs/models/providers/firepass.md +1 -1
- package/.docs/models/providers/fireworks-ai.md +1 -1
- package/.docs/models/providers/firmware.md +1 -1
- package/.docs/models/providers/freemodel.md +1 -1
- package/.docs/models/providers/friendli.md +1 -1
- package/.docs/models/providers/frogbot.md +1 -1
- package/.docs/models/providers/github-models.md +1 -1
- package/.docs/models/providers/gmicloud.md +1 -1
- package/.docs/models/providers/google.md +1 -1
- package/.docs/models/providers/greenpt.md +1 -1
- package/.docs/models/providers/helicone.md +1 -1
- package/.docs/models/providers/hetzner.md +1 -1
- package/.docs/models/providers/hpc-ai.md +1 -1
- package/.docs/models/providers/huggingface.md +1 -1
- package/.docs/models/providers/hyper.md +7 -7
- package/.docs/models/providers/iflowcn.md +1 -1
- package/.docs/models/providers/impossibl.md +1 -1
- package/.docs/models/providers/inception.md +1 -1
- package/.docs/models/providers/inceptron.md +1 -1
- package/.docs/models/providers/inference.md +1 -1
- package/.docs/models/providers/inferx.md +1 -1
- package/.docs/models/providers/infomaniak.md +1 -1
- package/.docs/models/providers/io-intelligence.md +1 -1
- package/.docs/models/providers/io-net.md +1 -1
- package/.docs/models/providers/jiekou.md +1 -1
- package/.docs/models/providers/kenari.md +1 -1
- package/.docs/models/providers/kilo.md +6 -7
- package/.docs/models/providers/kimi-for-coding.md +1 -1
- package/.docs/models/providers/kiro.md +1 -1
- package/.docs/models/providers/kuae-cloud-coding-plan.md +1 -1
- package/.docs/models/providers/lilac.md +1 -1
- package/.docs/models/providers/llama.md +1 -1
- package/.docs/models/providers/llmgateway.md +2 -5
- package/.docs/models/providers/llmtr.md +1 -1
- package/.docs/models/providers/lmstudio.md +1 -1
- package/.docs/models/providers/longcat.md +1 -1
- package/.docs/models/providers/lucidquery.md +1 -1
- package/.docs/models/providers/lynkr.md +1 -1
- package/.docs/models/providers/meganova.md +1 -1
- package/.docs/models/providers/meta.md +1 -1
- package/.docs/models/providers/minimax-cn-coding-plan.md +1 -1
- package/.docs/models/providers/minimax-cn.md +1 -1
- package/.docs/models/providers/minimax-coding-plan.md +1 -1
- package/.docs/models/providers/minimax.md +1 -1
- package/.docs/models/providers/mixlayer.md +1 -1
- package/.docs/models/providers/moark.md +1 -1
- package/.docs/models/providers/modal.md +1 -1
- package/.docs/models/providers/model-oracle-ai.md +1 -1
- package/.docs/models/providers/modelis.md +1 -1
- package/.docs/models/providers/modelscope.md +1 -1
- package/.docs/models/providers/moonshotai-cn.md +1 -1
- package/.docs/models/providers/moonshotai.md +1 -1
- package/.docs/models/providers/morph.md +1 -1
- package/.docs/models/providers/nano-gpt.md +3 -3
- package/.docs/models/providers/nearai.md +1 -1
- package/.docs/models/providers/nebius.md +1 -1
- package/.docs/models/providers/neuralwatt.md +1 -1
- package/.docs/models/providers/nova.md +1 -1
- package/.docs/models/providers/novita-ai.md +1 -1
- package/.docs/models/providers/nvidia.md +1 -1
- package/.docs/models/providers/ofox.md +4 -3
- package/.docs/models/providers/ollama-cloud.md +1 -1
- package/.docs/models/providers/opencode-go.md +1 -1
- package/.docs/models/providers/opencode.md +1 -1
- package/.docs/models/providers/orcarouter.md +1 -1
- package/.docs/models/providers/ovhcloud.md +1 -1
- package/.docs/models/providers/perplexity-agent.md +1 -1
- package/.docs/models/providers/pioneer.md +1 -1
- package/.docs/models/providers/poe.md +1 -1
- package/.docs/models/providers/poolside.md +1 -1
- package/.docs/models/providers/privatemode-ai.md +6 -5
- package/.docs/models/providers/qihang-ai.md +1 -1
- package/.docs/models/providers/qiniu-ai.md +1 -1
- package/.docs/models/providers/regolo-ai.md +1 -1
- package/.docs/models/providers/requesty.md +3 -3
- package/.docs/models/providers/routing-run.md +1 -1
- package/.docs/models/providers/sakana.md +1 -1
- package/.docs/models/providers/sarvam.md +1 -1
- package/.docs/models/providers/scaleway.md +1 -1
- package/.docs/models/providers/scx.md +1 -1
- package/.docs/models/providers/siliconflow-cn.md +1 -1
- package/.docs/models/providers/siliconflow.md +1 -1
- package/.docs/models/providers/snowflake-cortex.md +6 -2
- package/.docs/models/providers/stackit.md +1 -1
- package/.docs/models/providers/stepfun-ai-step-plan.md +1 -1
- package/.docs/models/providers/stepfun-ai.md +1 -1
- package/.docs/models/providers/stepfun-step-plan.md +1 -1
- package/.docs/models/providers/stepfun.md +1 -1
- package/.docs/models/providers/subconscious.md +1 -1
- package/.docs/models/providers/submodel.md +1 -1
- package/.docs/models/providers/synthetic.md +1 -1
- package/.docs/models/providers/tencent-coding-plan.md +1 -1
- package/.docs/models/providers/tencent-token-plan.md +1 -1
- package/.docs/models/providers/tencent-tokenhub.md +1 -1
- package/.docs/models/providers/tensorx.md +1 -1
- package/.docs/models/providers/the-grid-ai.md +1 -1
- package/.docs/models/providers/thinkingmachines.md +1 -1
- package/.docs/models/providers/tinfoil.md +2 -3
- package/.docs/models/providers/togetherai.md +1 -1
- package/.docs/models/providers/trustedrouter.md +1 -1
- package/.docs/models/providers/umans-ai-coding-plan.md +1 -1
- package/.docs/models/providers/umans-ai.md +1 -1
- package/.docs/models/providers/unorouter.md +1 -1
- package/.docs/models/providers/upstage.md +1 -1
- package/.docs/models/providers/venice.md +1 -1
- package/.docs/models/providers/vivgrid.md +1 -1
- package/.docs/models/providers/vultr.md +1 -1
- package/.docs/models/providers/wafer.ai.md +1 -1
- package/.docs/models/providers/wandb.md +3 -2
- package/.docs/models/providers/xiaomi-token-plan-ams.md +1 -1
- package/.docs/models/providers/xiaomi-token-plan-cn.md +1 -1
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +1 -1
- package/.docs/models/providers/xiaomi.md +1 -1
- package/.docs/models/providers/xpersona.md +1 -1
- package/.docs/models/providers/zai-coding-plan.md +1 -1
- package/.docs/models/providers/zai.md +1 -1
- package/.docs/models/providers/zeldoc.md +1 -1
- package/.docs/models/providers/zenifra.md +1 -1
- package/.docs/models/providers/zenmux.md +1 -16
- package/.docs/models/providers/zhipuai-coding-plan.md +1 -1
- package/.docs/models/providers/zhipuai.md +1 -1
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/agent-controller/agent-controller-class.md +3 -3
- package/.docs/reference/agent-controller/session.md +1 -1
- package/.docs/reference/agents/durable-agent.md +2 -0
- package/.docs/reference/agents/generateLegacy.md +1 -1
- package/.docs/reference/agents/inngest-agent.md +2 -0
- package/.docs/reference/auth/okta.md +5 -1
- package/.docs/reference/cli/mastra.md +4 -4
- package/.docs/reference/client-js/workflows.md +3 -3
- package/.docs/reference/code-sdk/mount-agent-controller.md +1 -1
- package/.docs/reference/core/addDynamicWorkflow.md +1 -1
- package/.docs/reference/core/addDynamicWorkflows.md +1 -1
- package/.docs/reference/file-based-agents/config.md +2 -0
- package/.docs/reference/file-based-agents/instructions.md +2 -0
- package/.docs/reference/file-based-agents/logger.md +2 -0
- package/.docs/reference/file-based-agents/memory.md +2 -0
- package/.docs/reference/file-based-agents/observability.md +2 -0
- package/.docs/reference/file-based-agents/processors.md +2 -0
- package/.docs/reference/file-based-agents/schedules.md +2 -0
- package/.docs/reference/file-based-agents/scorers.md +2 -0
- package/.docs/reference/file-based-agents/server.md +2 -0
- package/.docs/reference/file-based-agents/skills.md +2 -0
- package/.docs/reference/file-based-agents/storage.md +2 -0
- package/.docs/reference/file-based-agents/studio.md +2 -0
- package/.docs/reference/file-based-agents/subagents.md +2 -0
- package/.docs/reference/file-based-agents/tools.md +2 -0
- package/.docs/reference/file-based-agents/workflows.md +2 -0
- package/.docs/reference/file-based-agents/workspace.md +2 -0
- package/.docs/reference/index.md +1 -0
- package/.docs/reference/observability/tracing/exporters/datadog.md +1 -1
- package/.docs/reference/processors/pii-detector.md +2 -0
- package/.docs/reference/processors/prompt-injection-detector.md +2 -0
- package/.docs/reference/processors/response-cache.md +2 -0
- package/.docs/reference/schedules/overview.md +2 -0
- package/.docs/reference/server/create-route.md +27 -1
- package/.docs/reference/signals/create-notification-inbox-tool.md +2 -0
- package/.docs/reference/signals/signal-provider.md +2 -0
- package/.docs/reference/signals/task-signal-provider.md +2 -0
- package/.docs/reference/signals/webhook-signal-provider.md +2 -0
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/streaming/agents/stream.md +1 -1
- package/.docs/reference/streaming/agents/streamLegacy.md +1 -1
- package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
- package/.docs/reference/tools/create-code-mode.md +3 -1
- package/.docs/reference/tools/isolated-vm-transport.md +1 -1
- package/.docs/reference/tools/mcp-client.md +51 -0
- package/.docs/reference/tools/quickjs-transport.md +92 -0
- package/.docs/reference/vectors/chroma.md +1 -1
- package/.docs/reference/workers/overview.md +2 -0
- package/.docs/reference/workflows/dynamic-workflow-definition.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -0
- package/.docs/reference/workspace/mesa-filesystem.md +1 -1
- package/.docs/reference/workspace/platform-filesystem.md +1 -1
- package/.docs/reference/workspace/platform-sandbox.md +9 -1
- package/.docs/reference/workspace/railway-sandbox.md +8 -0
- package/.docs/reference/workspace/sandbox.md +10 -0
- package/CHANGELOG.md +29 -0
- package/package.json +5 -5
|
@@ -30,14 +30,12 @@ for await (const chunk of stream) {
|
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
> **
|
|
33
|
+
> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [ZenMux documentation](https://docs.zenmux.ai) for details.
|
|
34
34
|
|
|
35
35
|
## Models
|
|
36
36
|
|
|
37
37
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
38
|
| --------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
-
| `zenmux/anthropic/claude-3.5-haiku` | 200K | | | | | | $0.80 | $4 |
|
|
40
|
-
| `zenmux/anthropic/claude-3.7-sonnet` | 200K | | | | | | $3 | $15 |
|
|
41
39
|
| `zenmux/anthropic/claude-fable-5` | 1.0M | | | | | | $10 | $50 |
|
|
42
40
|
| `zenmux/anthropic/claude-haiku-4.5` | 200K | | | | | | $1 | $5 |
|
|
43
41
|
| `zenmux/anthropic/claude-opus-4` | 200K | | | | | | $15 | $75 |
|
|
@@ -52,7 +50,6 @@ for await (const chunk of stream) {
|
|
|
52
50
|
| `zenmux/anthropic/claude-sonnet-5` | 1.0M | | | | | | $2 | $10 |
|
|
53
51
|
| `zenmux/anthropic/claude-sonnet-5-free` | 1.0M | | | | | | — | — |
|
|
54
52
|
| `zenmux/baidu/ernie-5.0-thinking-preview` | 128K | | | | | | $0.84 | $3 |
|
|
55
|
-
| `zenmux/deepseek/deepseek-chat` | 128K | | | | | | $0.28 | $0.42 |
|
|
56
53
|
| `zenmux/deepseek/deepseek-v3.2` | 128K | | | | | | $0.28 | $0.43 |
|
|
57
54
|
| `zenmux/deepseek/deepseek-v3.2-exp` | 163K | | | | | | $0.22 | $0.33 |
|
|
58
55
|
| `zenmux/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
@@ -65,8 +62,6 @@ for await (const chunk of stream) {
|
|
|
65
62
|
| `zenmux/google/gemini-3.1-flash-lite-preview` | 1.1M | | | | | | $0.25 | $2 |
|
|
66
63
|
| `zenmux/google/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
67
64
|
| `zenmux/google/gemini-3.5-flash` | 1.0M | | | | | | $2 | $9 |
|
|
68
|
-
| `zenmux/inclusionai/ling-1t` | 128K | | | | | | $0.56 | $2 |
|
|
69
|
-
| `zenmux/inclusionai/ring-1t` | 128K | | | | | | $0.56 | $2 |
|
|
70
65
|
| `zenmux/inclusionai/ring-2.6-1t` | 262K | | | | | | $0.30 | $3 |
|
|
71
66
|
| `zenmux/kuaishou/kat-coder-pro-v2` | 256K | | | | | | $0.30 | $1 |
|
|
72
67
|
| `zenmux/minimax/minimax-m2` | 204K | | | | | | $0.30 | $1 |
|
|
@@ -76,9 +71,6 @@ for await (const chunk of stream) {
|
|
|
76
71
|
| `zenmux/minimax/minimax-m2.7` | 205K | | | | | | $0.31 | $1 |
|
|
77
72
|
| `zenmux/minimax/minimax-m2.7-highspeed` | 205K | | | | | | $0.61 | $2 |
|
|
78
73
|
| `zenmux/minimax/minimax-m3` | 512K | | | | | | $0.60 | $2 |
|
|
79
|
-
| `zenmux/moonshotai/kimi-k2-0905` | 262K | | | | | | $0.60 | $3 |
|
|
80
|
-
| `zenmux/moonshotai/kimi-k2-thinking` | 262K | | | | | | $0.60 | $3 |
|
|
81
|
-
| `zenmux/moonshotai/kimi-k2-thinking-turbo` | 262K | | | | | | $1 | $8 |
|
|
82
74
|
| `zenmux/moonshotai/kimi-k2.5` | 262K | | | | | | $0.58 | $3 |
|
|
83
75
|
| `zenmux/moonshotai/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
|
|
84
76
|
| `zenmux/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
|
|
@@ -115,7 +107,6 @@ for await (const chunk of stream) {
|
|
|
115
107
|
| `zenmux/qwen/qwen3.7-plus` | 1.0M | | | | | | $0.40 | $2 |
|
|
116
108
|
| `zenmux/sapiens-ai/agnes-1.5-lite` | 256K | | | | | | $0.12 | $0.60 |
|
|
117
109
|
| `zenmux/sapiens-ai/agnes-1.5-pro` | 256K | | | | | | $0.16 | $0.80 |
|
|
118
|
-
| `zenmux/stepfun/step-3` | 66K | | | | | | $0.21 | $0.57 |
|
|
119
110
|
| `zenmux/stepfun/step-3.5-flash` | 256K | | | | | | $0.10 | $0.30 |
|
|
120
111
|
| `zenmux/stepfun/step-3.7-flash` | 256K | | | | | | $0.20 | $1 |
|
|
121
112
|
| `zenmux/stepfun/step-3.7-flash-free` | 256K | | | | | | — | — |
|
|
@@ -125,17 +116,11 @@ for await (const chunk of stream) {
|
|
|
125
116
|
| `zenmux/volcengine/doubao-seed-2.0-lite` | 256K | | | | | | $0.09 | $0.51 |
|
|
126
117
|
| `zenmux/volcengine/doubao-seed-2.0-mini` | 256K | | | | | | $0.03 | $0.28 |
|
|
127
118
|
| `zenmux/volcengine/doubao-seed-2.0-pro` | 256K | | | | | | $0.45 | $2 |
|
|
128
|
-
| `zenmux/volcengine/doubao-seed-code` | 256K | | | | | | $0.17 | $1 |
|
|
129
|
-
| `zenmux/x-ai/grok-4` | 256K | | | | | | $3 | $15 |
|
|
130
|
-
| `zenmux/x-ai/grok-4-fast` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
131
|
-
| `zenmux/x-ai/grok-4.1-fast` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
132
|
-
| `zenmux/x-ai/grok-4.1-fast-non-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
|
|
133
119
|
| `zenmux/x-ai/grok-4.2-fast` | 2.0M | | | | | | $3 | $9 |
|
|
134
120
|
| `zenmux/x-ai/grok-4.2-fast-non-reasoning` | 2.0M | | | | | | $3 | $9 |
|
|
135
121
|
| `zenmux/x-ai/grok-4.3` | 1.0M | | | | | | $1 | $3 |
|
|
136
122
|
| `zenmux/x-ai/grok-4.5` | 500K | | | | | | $2 | $6 |
|
|
137
123
|
| `zenmux/x-ai/grok-build-0.1` | 256K | | | | | | $1 | $2 |
|
|
138
|
-
| `zenmux/x-ai/grok-code-fast-1` | 256K | | | | | | $0.20 | $2 |
|
|
139
124
|
| `zenmux/xiaomi/mimo-v2-flash` | 262K | | | | | | $0.10 | $0.30 |
|
|
140
125
|
| `zenmux/xiaomi/mimo-v2-omni` | 265K | | | | | | $0.40 | $2 |
|
|
141
126
|
| `zenmux/xiaomi/mimo-v2-pro` | 1.0M | | | | | | $1 | $3 |
|
|
@@ -30,7 +30,7 @@ for await (const chunk of stream) {
|
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
> **
|
|
33
|
+
> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Zhipu AI Coding Plan documentation](https://docs.bigmodel.cn/cn/coding-plan/overview) for details.
|
|
34
34
|
|
|
35
35
|
## Models
|
|
36
36
|
|
|
@@ -30,7 +30,7 @@ for await (const chunk of stream) {
|
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
> **
|
|
33
|
+
> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Zhipu AI documentation](https://docs.z.ai/guides/overview/pricing) for details.
|
|
34
34
|
|
|
35
35
|
## Models
|
|
36
36
|
|
|
@@ -39,6 +39,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
39
39
|
- [ClinePass](https://mastra.ai/models/providers/cline-pass)
|
|
40
40
|
- [CloudFerro Sherlock](https://mastra.ai/models/providers/cloudferro-sherlock)
|
|
41
41
|
- [Cloudflare Workers AI](https://mastra.ai/models/providers/cloudflare-workers-ai)
|
|
42
|
+
- [CoralBricks](https://mastra.ai/models/providers/coralbricks)
|
|
42
43
|
- [Cortecs](https://mastra.ai/models/providers/cortecs)
|
|
43
44
|
- [CrofAI](https://mastra.ai/models/providers/crof)
|
|
44
45
|
- [CrossModel](https://mastra.ai/models/providers/crossmodel)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# AgentController
|
|
4
4
|
|
|
5
|
-
> **Beta:**
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
6
|
|
|
7
7
|
The `AgentController` class is a shared host for one or more [`Session`](https://mastra.ai/reference/agent-controller/session) instances. Initialize the controller, create a session, then use `session.*` APIs for conversation state and run control.
|
|
8
8
|
|
|
@@ -280,7 +280,7 @@ Returns: `boolean`
|
|
|
280
280
|
|
|
281
281
|
#### `getWorkspace()`
|
|
282
282
|
|
|
283
|
-
Return a static controller workspace. Dynamic workspace factories return `undefined`
|
|
283
|
+
Return a static controller workspace. Dynamic workspace factories resolve per session and return `undefined` here, so use `resolveWorkspace` instead.
|
|
284
284
|
|
|
285
285
|
```typescript
|
|
286
286
|
const workspace = controller.getWorkspace()
|
|
@@ -290,7 +290,7 @@ Returns: `Workspace | undefined`
|
|
|
290
290
|
|
|
291
291
|
#### `resolveWorkspace({ session, requestContext? })`
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
Return the workspace a session runs against. Sessions resolve theirs at creation, dynamic factories included, so this returns that instance and only falls back to the factory for a session created without one.
|
|
294
294
|
|
|
295
295
|
```typescript
|
|
296
296
|
const workspace = await controller.resolveWorkspace({ session, requestContext })
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Session
|
|
4
4
|
|
|
5
|
-
> **Beta:**
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
6
|
|
|
7
7
|
A `Session` is the isolated runtime for one resource and optional scope. It owns its event bus, thread binding, state, mode and model selections, run control, approvals, suspensions, follow-ups, and display state. The [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class) supplies shared agents, configuration, storage, workspaces, and services.
|
|
8
8
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# DurableAgent
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
`DurableAgent` wraps an existing [`Agent`](https://mastra.ai/reference/agents/agent) with durable execution and resumable streams. It runs the agentic loop so that a client can disconnect and reconnect without missing events, and it streams those events over [PubSub](https://mastra.ai/docs/server/pubsub). Use it when a run must outlive a single request or survive a dropped connection.
|
|
6
8
|
|
|
7
9
|
Create one with the [`createDurableAgent`](#createdurableagentoptions) factory, or use [`createEventedAgent`](#createeventedagentoptions) for fire-and-forget execution on the built-in workflow engine. For Inngest-powered execution, use [`createInngestAgent`](https://mastra.ai/reference/agents/inngest-agent) from `@mastra/inngest`.
|
|
@@ -138,7 +138,7 @@ Scorer judges with legacy model adapters call `generateLegacy()`. They don't rec
|
|
|
138
138
|
|
|
139
139
|
## Migration to new API
|
|
140
140
|
|
|
141
|
-
> **
|
|
141
|
+
> **Note:** The new `.generate()` method offers enhanced capabilities including AI SDK v5+ compatibility, better structured output handling, and improved streaming support. See the [migration guide](https://mastra.ai/guides/migrations/vnext-to-standard-apis) for detailed migration instructions.
|
|
142
142
|
|
|
143
143
|
### Quick Migration Example
|
|
144
144
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# `createInngestAgent()`
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
`createInngestAgent()` wraps an existing [`Agent`](https://mastra.ai/reference/agents/agent) with [Inngest](https://www.inngest.com/docs)-powered durable execution. Like [`createDurableAgent()`](https://mastra.ai/reference/agents/durable-agent), it streams events over [PubSub](https://mastra.ai/docs/server/pubsub) and supports resumable streams, but runs the agentic loop on Inngest's execution engine instead of in-process. Use it when a run must survive process restarts or run in a distributed environment.
|
|
6
8
|
|
|
7
9
|
For in-process durable execution, use [`createDurableAgent()`](https://mastra.ai/reference/agents/durable-agent). For fire-and-forget execution on the built-in workflow engine, use [`createEventedAgent()`](https://mastra.ai/reference/agents/durable-agent).
|
|
@@ -38,6 +38,8 @@ export const mastra = new Mastra({
|
|
|
38
38
|
|
|
39
39
|
**redirectUri** (`string`): The OAuth redirect URI for the SSO callback. Must match the redirect URI configured in your Okta application. (Default: `process.env.OKTA_REDIRECT_URI`)
|
|
40
40
|
|
|
41
|
+
**audience** (`string | string[]`): Expected aud claim for Bearer tokens. Defaults to the client ID, which matches Okta ID tokens. Set it to the authorization server's audience to accept access tokens, or pass an array to accept several. Does not affect the ID token verified during the SSO login flow, which always uses the client ID. (Default: `process.env.OKTA_AUDIENCE ?? clientId`)
|
|
42
|
+
|
|
41
43
|
**scopes** (`string[]`): OAuth scopes to request during the login flow. (Default: `['openid', 'profile', 'email', 'groups']`)
|
|
42
44
|
|
|
43
45
|
**apiToken** (`string`): Okta API token for user lookups via the Users API. Required for getUser() to return user data by ID. (Default: `process.env.OKTA_API_TOKEN`)
|
|
@@ -66,6 +68,8 @@ The following environment variables are automatically used when constructor opti
|
|
|
66
68
|
|
|
67
69
|
**OKTA\_ISSUER** (`string`): Token issuer URL. Defaults to https\://{domain}/oauth2/default if not set.
|
|
68
70
|
|
|
71
|
+
**OKTA\_AUDIENCE** (`string`): Expected aud claim for Bearer tokens. Defaults to the client ID if not set.
|
|
72
|
+
|
|
69
73
|
**OKTA\_REDIRECT\_URI** (`string`): OAuth redirect URI for the SSO callback.
|
|
70
74
|
|
|
71
75
|
**OKTA\_COOKIE\_PASSWORD** (`string`): Password for encrypting session cookies. Must be at least 32 characters.
|
|
@@ -77,7 +81,7 @@ The following environment variables are automatically used when constructor opti
|
|
|
77
81
|
`MastraAuthOkta` authenticates requests in the following order:
|
|
78
82
|
|
|
79
83
|
1. **Session cookie**: Reads the encrypted session cookie and decrypts it. If the session is valid and not expired, the user is authenticated.
|
|
80
|
-
2. **JWT fallback**: If no session cookie is present, verifies the `Authorization` header token against Okta's JWKS endpoint.
|
|
84
|
+
2. **JWT fallback**: If no session cookie is present, verifies the `Authorization` header token against Okta's JWKS endpoint. The token's `iss` claim is checked against `issuer` and its `aud` claim against `audience`.
|
|
81
85
|
|
|
82
86
|
After authentication, `authorizeUser` checks that the user has a valid `oktaId`. Provide a custom `authorizeUser` function to implement additional logic.
|
|
83
87
|
|
|
@@ -153,7 +153,7 @@ MASTRA_CONCURRENCY=2 mastra build
|
|
|
153
153
|
|
|
154
154
|
## `mastra start`
|
|
155
155
|
|
|
156
|
-
> **
|
|
156
|
+
> **Note:** You need to run `mastra build` before using `mastra start`.
|
|
157
157
|
|
|
158
158
|
Starts a local server to serve your built Mastra application in production mode. By default, [OTEL Tracing](https://mastra.ai/docs/observability/tracing/overview) is enabled.
|
|
159
159
|
|
|
@@ -266,7 +266,7 @@ Enable debug logging during the build.
|
|
|
266
266
|
|
|
267
267
|
## `mastra worker start`
|
|
268
268
|
|
|
269
|
-
> **
|
|
269
|
+
> **Note:** You need to run `mastra worker build` or `mastra build` before using `mastra worker start`.
|
|
270
270
|
|
|
271
271
|
Starts a worker process from a previously built bundle. The optional `name` argument sets `MASTRA_WORKERS` in the spawned process, controlling which worker starts.
|
|
272
272
|
|
|
@@ -609,7 +609,7 @@ Emit machine-readable JSON.
|
|
|
609
609
|
|
|
610
610
|
## `mastra studio deploy`
|
|
611
611
|
|
|
612
|
-
> **
|
|
612
|
+
> **Note:** `mastra studio deploy` continues to work but is superseded by [`mastra deploy`](#mastra-deploy), which supports environments (`--env staging`, `--env production`) on a single project. New setups should use `mastra deploy`.
|
|
613
613
|
|
|
614
614
|
Builds and deploys your project to Mastra platform. Requires authentication via [`mastra auth login`](#mastra-auth-login) or a `MASTRA_API_TOKEN` environment variable.
|
|
615
615
|
|
|
@@ -727,7 +727,7 @@ Creates a new project through an interactive prompt. This command doesn't accept
|
|
|
727
727
|
|
|
728
728
|
## `mastra server deploy`
|
|
729
729
|
|
|
730
|
-
> **
|
|
730
|
+
> **Note:** `mastra server deploy` continues to work but is superseded by [`mastra deploy`](#mastra-deploy), which deploys a single project to multiple environments instead of separate Studio and Server commands. New setups should use `mastra deploy`.
|
|
731
731
|
|
|
732
732
|
Builds and deploys your project to Server on Mastra platform. Works the same as [`mastra studio deploy`](#mastra-studio-deploy) with the same flags, arguments, and resolution logic.
|
|
733
733
|
|
|
@@ -14,7 +14,7 @@ const workflows = await mastraClient.listWorkflows()
|
|
|
14
14
|
|
|
15
15
|
## Getting workflow run counts
|
|
16
16
|
|
|
17
|
-
Retrieve per-workflow counts of `running` and [`suspended`](https://mastra.ai/docs/workflows/suspend-and-resume) runs in a single request. The counts are computed on the server and keyed by the workflow's registry key
|
|
17
|
+
Retrieve per-workflow counts of `running` and [`suspended`](https://mastra.ai/docs/workflows/suspend-and-resume) runs in a single request. The counts are computed on the server and keyed by the workflow's registry key, the key used when registering the workflow in the Mastra config, which can differ from the workflow's own `id`:
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
20
|
const runCounts = await mastraClient.listWorkflowRunCounts()
|
|
@@ -23,7 +23,7 @@ const runCounts = await mastraClient.listWorkflowRunCounts()
|
|
|
23
23
|
|
|
24
24
|
Returns: `Record<string, { running: number; suspended: number }>`
|
|
25
25
|
|
|
26
|
-
The server may cache the counts for a few seconds between requests. Servers that predate this endpoint respond with `404 Not Found
|
|
26
|
+
The server may cache the counts for a few seconds between requests. Servers that predate this endpoint respond with `404 Not Found`. Handle the error when the client can talk to older deployments.
|
|
27
27
|
|
|
28
28
|
## Working with a specific workflow
|
|
29
29
|
|
|
@@ -227,7 +227,7 @@ A workflow run result yields the following:
|
|
|
227
227
|
|
|
228
228
|
## Dynamic workflows
|
|
229
229
|
|
|
230
|
-
> **Beta:**
|
|
230
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
231
231
|
|
|
232
232
|
Dynamic workflows are workflow definitions expressed as JSON. The server persists each definition and registers it as a runnable workflow. See [Dynamic workflows](https://mastra.ai/docs/workflows/dynamic-workflows) for the definition format.
|
|
233
233
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# mountAgentControllerOnMastra()
|
|
4
4
|
|
|
5
|
-
> **Beta:**
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
6
|
|
|
7
7
|
The `mountAgentControllerOnMastra()` function builds the Mastra Code agent controller (the coding agent behind the [`mastracode`](https://www.npmjs.com/package/mastracode) CLI, with its modes, tools, memory, and thread management) and registers it on a server-owned [Mastra](https://mastra.ai/reference/core/mastra-class) instance. Use it to serve the Mastra Code agent to your own UI (web app, editor, bot): each client creates or resumes its own isolated session through the returned [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class).
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Mastra.addDynamicWorkflow()
|
|
4
4
|
|
|
5
|
-
> **Beta:**
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
6
|
|
|
7
7
|
The `.addDynamicWorkflow()` method validates a dynamic workflow definition and registers it as a live workflow on the instance, persisting it through the `workflowDefinitions` storage domain. Once registered, the workflow runs like any other workflow via [`getWorkflow()`](https://mastra.ai/reference/core/getWorkflow).
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Mastra.addDynamicWorkflows()
|
|
4
4
|
|
|
5
|
-
> **Beta:**
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
6
|
|
|
7
7
|
The `.addDynamicWorkflows()` method adds a bundle of dynamic workflow definitions that may reference each other. The typical case is a root workflow plus helper workflows it nests, where none of the definitions exist yet.
|
|
8
8
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# config.ts
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
An agent's `config.ts` sets its model and runtime options. Use it for options that belong to the [`Agent`](https://mastra.ai/reference/agents/agent) itself, while sibling files provide instructions, tools, skills, et cetera.
|
|
6
8
|
|
|
7
9
|
## What belongs in `config.ts`
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Instructions
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
An agent's instructions hold its always-on system prompt: the model reads it on every turn. Use them to define the agent's identity, tone, role, and standing rules.
|
|
6
8
|
|
|
7
9
|
Write them in one of two files at the agent root. Use `instructions.md` when the prompt is fixed text. Use `instructions.ts` when the prompt needs code, for example when it's built from shared constants or resolved per request.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Logger
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
Mastra sets the project's [logger](https://mastra.ai/docs/observability/logging) from a `logger.ts` file directly under `src/mastra/`. The file default-exports a logger, which replaces the built-in `ConsoleLogger` used across agents, workflows, and other components.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For log levels, transports, and provider details, see [logging](https://mastra.ai/docs/observability/logging).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Memory
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
A file-based agent gets [memory](https://mastra.ai/docs/memory/overview) from a `memory.ts` file that default-exports a [`Memory`](https://mastra.ai/reference/memory/memory-class) instance. Use this page for the file-based convention; use the memory docs for message history, semantic recall, storage, and processors.
|
|
6
8
|
|
|
7
9
|
Without `memory.ts` or `config.memory`, the agent has no memory by default. Each `generate()` or `stream()` call starts without remembered conversation state unless you pass the prior context yourself.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Observability
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
Mastra configures [observability](https://mastra.ai/docs/observability/overview) from an `observability.ts` file directly under `src/mastra/`. The file default-exports an `Observability` instance that sets up tracing, logging, metrics, and feedback for the project.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For the signal model, exporters, storage, and multi-config setup, see the [observability overview](https://mastra.ai/docs/observability/overview) and [observability configuration](https://mastra.ai/docs/observability/overview).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Processors
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
A file-based agent discovers [processors](https://mastra.ai/docs/agents/processors) from its `processors/` directory. Use this page for the file-based convention; use the processors guide for built-in processors, custom processors, streaming behavior, and advanced patterns.
|
|
6
8
|
|
|
7
9
|
Files under `processors/input/` run before messages reach the model. Files under `processors/output/` run after the model responds. Each file default-exports one [`Processor`](https://mastra.ai/reference/processors/processor-interface), and the filename becomes its discovery key.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Schedules
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
A file-based agent discovers **schedules** from its `schedules/` directory. Each file declares one recurring task: a cron expression plus what the agent should do when it fires. Mastra registers them into schedule storage at startup, so a scheduled agent needs no runtime registration code.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. To create schedules at runtime instead, see [Schedules](https://mastra.ai/reference/schedules/overview).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Scorers
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
A file-based agent discovers [scorers](https://mastra.ai/docs/evals/overview) from its `scorers/` directory. Use this page for the file-based convention; use the scorers guide for built-in scorers, custom scorers, and sampling.
|
|
6
8
|
|
|
7
9
|
Each file under `scorers/` default-exports one scorer, and the filename becomes its key. The default export is either a [`MastraScorer`](https://mastra.ai/reference/evals/create-scorer) or a `{ scorer, sampling }` entry.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Server
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
Mastra configures its HTTP [server](https://mastra.ai/docs/server/mastra-server) from a `server.ts` file directly under `src/mastra/`. The server exposes agents, workflows, and other registered primitives as REST endpoints, and the file default-exports the same `ServerConfig` shape you'd pass to [`new Mastra()`](https://mastra.ai/reference/core/mastra-class).
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For server features, middleware, custom routes, generated API docs, and deployment behavior, see [Server overview](https://mastra.ai/docs/server/mastra-server).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Skills
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
A file-based agent discovers skills from its `skills/` directory and bundles them at build time. Skills are reusable procedures or reference material that the agent can load when relevant, instead of putting every detail into the always-on prompt.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For code-defined skills, see [Agent skills](https://mastra.ai/docs/agents/skills). For the `SKILL.md` package format, see [Workspace skills](https://mastra.ai/docs/workspace/skills).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Storage
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
Mastra sets the project's default [storage](https://mastra.ai/docs/storage/overview) from a `storage.ts` file directly under `src/mastra/`. The file default-exports a store, which replaces the built-in in-memory store used for memory, workflows, observability, and other storage domains.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For backend choice, storage domains, retention, and provider details, see [storage overview](https://mastra.ai/docs/storage/overview).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Studio
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
Mastra configures [Studio](https://mastra.ai/docs/studio/overview) from a `studio.ts` file directly under `src/mastra/`. The file default-exports a `StudioConfig` object for Studio authentication and authorization: who can access Studio, and what authenticated users can do.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For auth providers, role-based access control (RBAC), and fine-grained authorization (FGA), see [Studio auth](https://mastra.ai/docs/studio/auth).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Subagents
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
A file-based agent can declare **subagents**, specialist child agents it delegates to. The parent model sees each subagent as a delegation tool named after the subagent directory and calls that tool to hand off a task. The subagent's result returns to the parent conversation.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For broader delegation patterns, hooks, memory isolation, tool approval propagation, and scoring, see [Supervisor agents](https://mastra.ai/docs/capabilities/subagents).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Tools
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
A file-based agent discovers tools from `.ts` and `.js` files directly under its `tools/` directory. Each discovered file is imported at build time, the file must default-export a [`createTool()`](https://mastra.ai/reference/tools/create-tool) result, and the filename without its extension becomes the tool key the model can call.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For tool schemas, execution options, output shaping, and approval options, see the [`createTool()` reference](https://mastra.ai/reference/tools/create-tool).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Workflows
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
Mastra discovers project-level workflows from `.ts` and `.js` files under `src/mastra/workflows/`. This convention isn't scoped to one agent: every file with a default export becomes a registered workflow, and the filename becomes the workflow key.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For steps, schemas, control flow, streaming, state, and workflow execution, see [Workflows overview](https://mastra.ai/docs/workflows/overview).
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Workspace
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
A [workspace](https://mastra.ai/docs/workspace/overview) gives an agent filesystem access and command execution. File-based agents get a default workspace automatically when discovered through `mastra dev` or `mastra build`, so they can read and write files and run shell commands without extra configuration.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For workspace providers, tools, search, lifecycle, and sandbox details, see [Workspaces](https://mastra.ai/docs/workspace/overview).
|
package/.docs/reference/index.md
CHANGED
|
@@ -313,6 +313,7 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
313
313
|
- [MCPClient](https://mastra.ai/reference/tools/mcp-client)
|
|
314
314
|
- [MCPServer](https://mastra.ai/reference/tools/mcp-server)
|
|
315
315
|
- [Perplexity Tools](https://mastra.ai/reference/tools/perplexity)
|
|
316
|
+
- [QuickJsCodeModeTransport](https://mastra.ai/reference/tools/quickjs-transport)
|
|
316
317
|
- [submitPlanTool](https://mastra.ai/reference/tools/submit-plan-tool)
|
|
317
318
|
- [Task tools](https://mastra.ai/reference/tools/task-tools)
|
|
318
319
|
- [Tavily Tools](https://mastra.ai/reference/tools/tavily)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Sends Tracing data to Datadog's LLM Observability product for monitoring and analytics.
|
|
6
6
|
|
|
7
|
-
> **
|
|
7
|
+
> **Note:** If you also use `dd-trace` APM auto-instrumentation and need it correctly parented under Mastra spans, use the [DatadogBridge](https://mastra.ai/reference/observability/tracing/bridges/datadog) instead. The exporter sends LLM Observability data after execution completes, so it doesn't participate in `dd-trace`'s live scope.
|
|
8
8
|
|
|
9
9
|
## Constructor
|
|
10
10
|
|
|
@@ -42,6 +42,8 @@ const processor = new PIIDetector({
|
|
|
42
42
|
|
|
43
43
|
**options.providerOptions** (`ProviderOptions`): Provider-specific options passed to the internal detection agent. Use this to control model behavior like reasoning effort for thinking models (e.g., { openai: { reasoningEffort: 'low' } })
|
|
44
44
|
|
|
45
|
+
**options.onDetection** (`(event: PIIDetectionEvent) => void | Promise<void>`): Called whenever a detection result is produced, with detectionResult, the analyzed input, whether it was flagged, and the strategyApplied (the configured strategy when flagged, otherwise none). Fires for every analyzed message in processInput and processOutputResult, and for every LLM buffer flush during streaming; the streaming regex pass only reports when PII is found. Errors thrown by the callback are logged and ignored
|
|
46
|
+
|
|
45
47
|
## Returns
|
|
46
48
|
|
|
47
49
|
**id** (`string`): Processor identifier set to 'pii-detector'
|
|
@@ -38,6 +38,8 @@ const processor = new PromptInjectionDetector({
|
|
|
38
38
|
|
|
39
39
|
**options.providerOptions** (`ProviderOptions`): Provider-specific options passed to the internal detection agent. Use this to control model behavior like reasoning effort for thinking models (e.g., { openai: { reasoningEffort: 'low' } })
|
|
40
40
|
|
|
41
|
+
**options.onDetection** (`(event: PromptInjectionDetectionEvent) => void | Promise<void>`): Called for every analyzed message with detectionResult, the analyzed input, whether it was flagged, and the strategyApplied (the configured strategy when flagged, otherwise none). Use it to emit custom metrics. Errors thrown by the callback are logged and ignored
|
|
42
|
+
|
|
41
43
|
## Returns
|
|
42
44
|
|
|
43
45
|
**id** (`string`): Processor identifier set to 'prompt-injection-detector'
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# ResponseCache
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
`ResponseCache` is an input processor that caches LLM responses on the request/response boundary inside the agentic loop. It hooks into `processLLMRequest` for cache lookup and short-circuits on a hit. It uses `processLLMResponse` to write the completed response.
|
|
6
8
|
|
|
7
9
|
The cache key is derived from the resolved `LanguageModelV2Prompt` Mastra is about to send to the model (i.e. _after_ memory has loaded and earlier input processors have transformed the prompt) so two users with different memory contexts produce different cache keys. Each step in an agentic tool loop is independently cached.
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
**Added in:** `@mastra/core@1.50.0`
|
|
6
6
|
|
|
7
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
+
|
|
7
9
|
`mastra.schedules` is the CRUD service for persisted cron schedules. Use it to create, list, update, pause, resume, manually run, and delete schedules for agents or workflows.
|
|
8
10
|
|
|
9
11
|
For usage patterns and concepts, see [Schedules](https://mastra.ai/docs/long-running-agents/schedules).
|
|
@@ -72,10 +72,36 @@ handler: async params => {
|
|
|
72
72
|
|
|
73
73
|
## Return value
|
|
74
74
|
|
|
75
|
-
Returns a `ServerRoute` object that can be registered with an adapter.
|
|
75
|
+
Returns a `ServerRoute` object that can be registered with an adapter or passed to `server.apiRoutes` on the `Mastra` instance.
|
|
76
76
|
|
|
77
77
|
## Examples
|
|
78
78
|
|
|
79
|
+
### Register through `server.apiRoutes`
|
|
80
|
+
|
|
81
|
+
Routes created with `createRoute()` can be passed to `server.apiRoutes`. The adapter registers them with runtime validation, typed handler parameters, and generated OpenAPI metadata. See [Custom API routes](https://mastra.ai/docs/server/custom-api-routes) for details.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { Mastra } from '@mastra/core'
|
|
85
|
+
import { createRoute } from '@mastra/server/server-adapter'
|
|
86
|
+
import { z } from 'zod'
|
|
87
|
+
|
|
88
|
+
const createItemRoute = createRoute({
|
|
89
|
+
method: 'POST',
|
|
90
|
+
path: '/items',
|
|
91
|
+
responseType: 'json',
|
|
92
|
+
bodySchema: z.object({
|
|
93
|
+
name: z.string(),
|
|
94
|
+
}),
|
|
95
|
+
handler: async ({ name }) => ({ id: 'new-id', name }),
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
export const mastra = new Mastra({
|
|
99
|
+
server: {
|
|
100
|
+
apiRoutes: [createItemRoute],
|
|
101
|
+
},
|
|
102
|
+
})
|
|
103
|
+
```
|
|
104
|
+
|
|
79
105
|
### GET route with path params
|
|
80
106
|
|
|
81
107
|
```typescript
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
**Added in:** `@mastra/core@1.39.0`
|
|
6
6
|
|
|
7
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
+
|
|
7
9
|
`createNotificationInboxTool()` creates a Mastra tool that lets an agent inspect and manage notification inbox records for the current thread.
|
|
8
10
|
|
|
9
11
|
Use this tool with durable notification signals. For sending notification records, see [`Agent.sendNotificationSignal()`](https://mastra.ai/reference/agents/agent).
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
**Added in:** `@mastra/core@1.39.0`
|
|
6
6
|
|
|
7
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
+
|
|
7
9
|
Abstract base class for building signal providers. A signal provider monitors external sources (APIs, webhooks, event streams) and pushes notification signals into agent threads through a built-in subscription registry.
|
|
8
10
|
|
|
9
11
|
Signal providers aren't processors by default. Providers that need to intercept agent execution return processors from `getInputProcessors()` or `getOutputProcessors()`. Providers that expose agent-callable tools return them from `getTools()`.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# TaskSignalProvider
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
Bundles the built-in task tools (`task_write`, `task_update`, `task_complete`, `task_check`) and the `TaskStateProcessor` behind a single agent registration. Use it to add a structured, durable task list to an agent without wiring the tools and processor separately.
|
|
6
8
|
|
|
7
9
|
Extends [`SignalProvider`](https://mastra.ai/reference/signals/signal-provider). The task list is stored in the thread-scoped `tasks` storage domain (the source of truth) and projected onto the agent state-signal lane by the processor, so it survives observational-memory truncation without invalidating the prompt cache.
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
**Added in:** `@mastra/core@1.39.0`
|
|
6
6
|
|
|
7
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
+
|
|
7
9
|
Concrete signal provider for push-based event delivery. Routes incoming webhook payloads to subscribed agent threads by matching the payload against a configurable resource ID extractor.
|
|
8
10
|
|
|
9
11
|
Extends [`SignalProvider`](https://mastra.ai/reference/signals/signal-provider) with public subscription management and a built-in `handleWebhook()` implementation.
|