@mastra/mcp-docs-server 1.3.8 → 1.3.9-alpha.10

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.
Files changed (121) hide show
  1. package/.docs/docs/agents/guardrails.md +3 -0
  2. package/.docs/docs/agents/human-in-the-loop.md +2 -1
  3. package/.docs/docs/agents/processors.md +3 -0
  4. package/.docs/docs/harness/agent-controller.md +1 -1
  5. package/.docs/docs/harness/background-tasks.md +11 -0
  6. package/.docs/docs/harness/durable-agents.md +24 -8
  7. package/.docs/docs/harness/signals.md +3 -1
  8. package/.docs/docs/mastra-platform/connect/channels.md +14 -2
  9. package/.docs/docs/mastra-platform/connect/overview.md +1 -1
  10. package/.docs/docs/mastra-platform/connect/providers.md +1 -0
  11. package/.docs/docs/mastra-platform/connect/tools.md +25 -3
  12. package/.docs/docs/mastra-platform/observability.md +1 -1
  13. package/.docs/docs/memory/observational-memory.md +4 -2
  14. package/.docs/docs/memory/semantic-recall.md +2 -0
  15. package/.docs/docs/studio/overview.md +8 -0
  16. package/.docs/docs/workflows/control-flow.md +3 -1
  17. package/.docs/docs/workflows/overview.md +2 -0
  18. package/.docs/docs/workflows/time-travel.md +1 -1
  19. package/.docs/integrations/databases/clickhouse.md +1 -1
  20. package/.docs/integrations/voice/google.md +6 -0
  21. package/.docs/models/embeddings.md +2 -1
  22. package/.docs/models/environment-variables.md +2 -0
  23. package/.docs/models/gateways/merge-gateway.md +4 -1
  24. package/.docs/models/gateways/netlify.md +14 -4
  25. package/.docs/models/gateways/openrouter.md +11 -4
  26. package/.docs/models/gateways/vercel.md +11 -3
  27. package/.docs/models/index.md +3 -1
  28. package/.docs/models/providers/302ai.md +2 -1
  29. package/.docs/models/providers/aimlapi.md +3 -3
  30. package/.docs/models/providers/alibaba-token-plan-cn.md +31 -30
  31. package/.docs/models/providers/ambient.md +2 -1
  32. package/.docs/models/providers/baseten.md +27 -25
  33. package/.docs/models/providers/cloudflare-workers-ai.md +2 -1
  34. package/.docs/models/providers/commandcode.md +147 -0
  35. package/.docs/models/providers/coralbricks.md +5 -8
  36. package/.docs/models/providers/cortecs.md +5 -6
  37. package/.docs/models/providers/databricks.md +2 -1
  38. package/.docs/models/providers/deepinfra.md +3 -1
  39. package/.docs/models/providers/edenai.md +11 -3
  40. package/.docs/models/providers/empiriolabs.md +3 -1
  41. package/.docs/models/providers/engy.md +12 -11
  42. package/.docs/models/providers/fireworks-ai.md +3 -1
  43. package/.docs/models/providers/huggingface.md +2 -1
  44. package/.docs/models/providers/hyper.md +26 -24
  45. package/.docs/models/providers/iteracompute.md +11 -10
  46. package/.docs/models/providers/kenari.md +1 -1
  47. package/.docs/models/providers/kilo.md +34 -27
  48. package/.docs/models/providers/llmgateway-providers.md +9 -12
  49. package/.docs/models/providers/llmgateway.md +3 -4
  50. package/.docs/models/providers/melious.md +16 -15
  51. package/.docs/models/providers/minimax-cn-coding-plan.md +2 -1
  52. package/.docs/models/providers/minimax-cn.md +3 -2
  53. package/.docs/models/providers/minimax-coding-plan.md +2 -1
  54. package/.docs/models/providers/minimax.md +3 -2
  55. package/.docs/models/providers/nano-gpt.md +62 -55
  56. package/.docs/models/providers/nearai.md +1 -1
  57. package/.docs/models/providers/nebius.md +4 -1
  58. package/.docs/models/providers/novita-ai.md +2 -1
  59. package/.docs/models/providers/nvidia.md +2 -1
  60. package/.docs/models/providers/ofox.md +26 -25
  61. package/.docs/models/providers/ollama-cloud.md +31 -28
  62. package/.docs/models/providers/openai.md +1 -1
  63. package/.docs/models/providers/opencode-go.md +8 -8
  64. package/.docs/models/providers/opencode.md +91 -92
  65. package/.docs/models/providers/pioneer.md +120 -119
  66. package/.docs/models/providers/prime.md +5 -2
  67. package/.docs/models/providers/reflection.md +77 -0
  68. package/.docs/models/providers/requesty.md +7 -2
  69. package/.docs/models/providers/scaleway.md +2 -1
  70. package/.docs/models/providers/standardcompute.md +47 -8
  71. package/.docs/models/providers/togetherai.md +4 -1
  72. package/.docs/models/providers/upstage.md +8 -7
  73. package/.docs/models/providers/wandb.md +26 -23
  74. package/.docs/models/providers/xai.md +0 -1
  75. package/.docs/models/providers/xiaomi-token-plan-ams.md +0 -2
  76. package/.docs/models/providers/xiaomi-token-plan-cn.md +0 -2
  77. package/.docs/models/providers/xiaomi-token-plan-sgp.md +0 -2
  78. package/.docs/models/providers/xiaomi.md +0 -3
  79. package/.docs/models/providers/zenmux.md +2 -1
  80. package/.docs/models/providers.md +2 -0
  81. package/.docs/reference/agent-controller/session.md +3 -2
  82. package/.docs/reference/agents/channels.md +5 -1
  83. package/.docs/reference/agents/durable-agent.md +16 -7
  84. package/.docs/reference/agents/inngest-agent.md +4 -4
  85. package/.docs/reference/classifier/classifier.md +31 -7
  86. package/.docs/reference/cli/mastra.md +44 -7
  87. package/.docs/reference/client-js/agent-controller.md +2 -0
  88. package/.docs/reference/client-js/agents.md +20 -0
  89. package/.docs/reference/client-js/observability.md +165 -6
  90. package/.docs/reference/configuration.md +30 -0
  91. package/.docs/reference/connect/channels.md +2 -2
  92. package/.docs/reference/connect/providers.md +38 -3
  93. package/.docs/reference/connect/tools.md +21 -2
  94. package/.docs/reference/core/mastra-class.md +7 -1
  95. package/.docs/reference/datasets/list.md +9 -1
  96. package/.docs/reference/evals/create-classifier-scorer.md +1 -0
  97. package/.docs/reference/index.md +1 -1
  98. package/.docs/reference/memory/observational-memory.md +2 -2
  99. package/.docs/reference/memory/settled.md +13 -5
  100. package/.docs/reference/observability/metrics/automatic-metrics.md +3 -3
  101. package/.docs/reference/observability/metrics/queries.md +1 -0
  102. package/.docs/reference/observability/tracing/{trace-query.md → advanced-queries.md} +477 -158
  103. package/.docs/reference/observability/tracing/interfaces.md +6 -0
  104. package/.docs/reference/processors/classifier-processor.md +8 -6
  105. package/.docs/reference/processors/model-selection-processor.md +2 -2
  106. package/.docs/reference/processors/moderation-processor.md +5 -1
  107. package/.docs/reference/processors/system-prompt-scrubber.md +4 -0
  108. package/.docs/reference/rag/embeddings.md +18 -0
  109. package/.docs/reference/signals/create-notification-inbox-tool.md +11 -9
  110. package/.docs/reference/streaming/agents/stream.md +19 -1
  111. package/.docs/reference/tools/create-tool.md +2 -2
  112. package/.docs/reference/tools/mcp-client.md +2 -2
  113. package/.docs/reference/workflows/dynamic-workflow-definition.md +1 -1
  114. package/.docs/reference/workflows/run-methods/resume.md +1 -1
  115. package/.docs/reference/workflows/run-methods/timeTravel.md +15 -16
  116. package/.docs/reference/workflows/step.md +1 -0
  117. package/.docs/reference/workflows/workflow-methods/classifier.md +1 -0
  118. package/.docs/reference/workspace/factory-sandbox.md +2 -0
  119. package/.docs/reference/workspace/filesystem.md +4 -0
  120. package/.docs/reference/workspace/workspace-class.md +10 -10
  121. package/package.json +8 -9
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Together AI logo](https://models.dev/logos/togetherai.svg)Together AI
6
6
 
7
- Access 29 Together AI models through Mastra's model router. Authentication is handled automatically using the `TOGETHER_API_KEY` environment variable.
7
+ Access 32 Together AI models through Mastra's model router. Authentication is handled automatically using the `TOGETHER_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Together AI documentation](https://docs.together.ai/docs/serverless-models).
10
10
 
@@ -41,15 +41,18 @@ for await (const chunk of stream) {
41
41
  | `togetherai/deepseek-ai/DeepSeek-V4.1-Flash` | 1.0M | | | | | | $0.30 | $1 |
42
42
  | `togetherai/LiquidAI/LFM2-24B-A2B` | 33K | | | | | | $0.03 | $0.12 |
43
43
  | `togetherai/meta-llama/Llama-3.3-70B-Instruct-Turbo` | 131K | | | | | | $1 | $1 |
44
+ | `togetherai/meta-models/Muse-Spark-Open-816B-A42B` | 1.0M | | | | | | $1 | $4 |
44
45
  | `togetherai/MiniMaxAI/MiniMax-M2.7` | 197K | | | | | | $0.30 | $1 |
45
46
  | `togetherai/MiniMaxAI/MiniMax-M3` | 524K | | | | | | $0.30 | $1 |
46
47
  | `togetherai/moonshotai/Kimi-K3` | 1.0M | | | | | | $3 | $15 |
47
48
  | `togetherai/nvidia/nemotron-3-ultra-550b-a55b` | 512K | | | | | | $0.60 | $4 |
49
+ | `togetherai/nvidia/NVIDIA-Nemotron-3.5-Super-VL` | 262K | | | | | | $0.15 | $0.50 |
48
50
  | `togetherai/openai/gpt-oss-120b` | 131K | | | | | | $0.15 | $0.60 |
49
51
  | `togetherai/Qwen/Qwen2.5-7B-Instruct-Turbo` | 33K | | | | | | $0.30 | $0.30 |
50
52
  | `togetherai/Qwen/Qwen3.5-9B` | 262K | | | | | | $0.17 | $0.25 |
51
53
  | `togetherai/Qwen/Qwen3.6-Plus` | 1.0M | | | | | | $0.50 | $3 |
52
54
  | `togetherai/Qwen/Qwen3.7-Max` | 1.0M | | | | | | $1 | $4 |
55
+ | `togetherai/reflection/Beam-1.0-501B-A23B` | 1.0M | | | | | | $0.40 | $1 |
53
56
  | `togetherai/thinkingmachines/Inkling` | 524K | | | | | | $1 | $4 |
54
57
  | `togetherai/zai-org/GLM-5.2` | 1.0M | | | | | | $1 | $4 |
55
58
  | `togetherai/zai-org/GLM-5.3` | 1.0M | | | | | | $1 | $4 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Upstage logo](https://models.dev/logos/upstage.svg)Upstage
6
6
 
7
- Access 4 Upstage models through Mastra's model router. Authentication is handled automatically using the `UPSTAGE_API_KEY` environment variable.
7
+ Access 5 Upstage models through Mastra's model router. Authentication is handled automatically using the `UPSTAGE_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Upstage documentation](https://developers.upstage.ai).
10
10
 
@@ -36,12 +36,13 @@ for await (const chunk of stream) {
36
36
 
37
37
  ## Models
38
38
 
39
- | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
- | -------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
- | `upstage/solar-mini` | 33K | | | | | | $0.15 | $0.15 |
42
- | `upstage/solar-pro2` | 66K | | | | | | $0.25 | $0.25 |
43
- | `upstage/solar-pro3` | 131K | | | | | | $0.25 | $0.25 |
44
- | `upstage/solar-pro4` | 524K | | | | | | $0.30 | $1 |
39
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
+ | --------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
+ | `upstage/solar-mini` | 33K | | | | | | $0.15 | $0.15 |
42
+ | `upstage/solar-mini4` | 524K | | | | | | $0.10 | $0.40 |
43
+ | `upstage/solar-pro2` | 66K | | | | | | $0.25 | $0.25 |
44
+ | `upstage/solar-pro3` | 131K | | | | | | $0.25 | $0.25 |
45
+ | `upstage/solar-pro4` | 524K | | | | | | $0.30 | $1 |
45
46
 
46
47
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
47
48
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![CoreWeave logo](https://models.dev/logos/wandb.svg)CoreWeave
6
6
 
7
- Access 20 CoreWeave models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
7
+ Access 23 CoreWeave models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [CoreWeave documentation](https://docs.wandb.ai).
10
10
 
@@ -36,28 +36,31 @@ for await (const chunk of stream) {
36
36
 
37
37
  ## Models
38
38
 
39
- | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
- | ---------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
- | `wandb/deepseek-ai/DeepSeek-V3.1` | 161K | | | | | | $0.55 | $2 |
42
- | `wandb/deepseek-ai/DeepSeek-V4-Flash-0731` | 262K | | | | | | $0.13 | $0.28 |
43
- | `wandb/deepseek-ai/DeepSeek-V4-Pro-0813` | 1.0M | | | | | | $1 | $4 |
44
- | `wandb/deepseek-ai/DeepSeek-V4.1-Flash` | 1.0M | | | | | | $0.15 | $0.65 |
45
- | `wandb/google/gemma-4-26B-A4B-it` | 262K | | | | | | $0.10 | $0.30 |
46
- | `wandb/google/gemma-4-31B-it` | 262K | | | | | | $0.10 | $0.34 |
47
- | `wandb/ibm-granite/granite-4.2-8b` | 131K | | | | | | $0.10 | $0.15 |
48
- | `wandb/meta-llama/Llama-3.1-8B-Instruct` | 131K | | | | | | $0.22 | $0.22 |
49
- | `wandb/meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.71 | $0.71 |
50
- | `wandb/MiniMaxAI/MiniMax-M3` | 262K | | | | | | $0.23 | $0.96 |
51
- | `wandb/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.65 | $3 |
52
- | `wandb/moonshotai/Kimi-K2.7-Code` | 262K | | | | | | $0.71 | $4 |
53
- | `wandb/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B` | 262K | | | | | | $0.50 | $2 |
54
- | `wandb/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B` | 262K | | | | | | $0.07 | $0.20 |
55
- | `wandb/openai/gpt-oss-120b` | 131K | | | | | | $0.03 | $0.17 |
56
- | `wandb/openai/gpt-oss-20b` | 131K | | | | | | $0.03 | $0.13 |
57
- | `wandb/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.25 | $1 |
58
- | `wandb/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.40 | $3 |
59
- | `wandb/zai-org/GLM-5.2` | 1.0M | | | | | | $0.62 | $2 |
60
- | `wandb/zai-org/GLM-5.3-Flash` | 1.0M | | | | | | $0.15 | $0.50 |
39
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
+ | ----------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
+ | `wandb/deepseek-ai/DeepSeek-V3.1` | 161K | | | | | | $0.55 | $2 |
42
+ | `wandb/deepseek-ai/DeepSeek-V4-Flash-0731` | 262K | | | | | | $0.13 | $0.28 |
43
+ | `wandb/deepseek-ai/DeepSeek-V4-Pro-0813` | 1.0M | | | | | | $1 | $4 |
44
+ | `wandb/deepseek-ai/DeepSeek-V4.1-Flash` | 1.0M | | | | | | $0.15 | $0.65 |
45
+ | `wandb/google/gemma-4-26B-A4B-it` | 262K | | | | | | $0.10 | $0.30 |
46
+ | `wandb/google/gemma-4-31B-it` | 262K | | | | | | $0.10 | $0.34 |
47
+ | `wandb/ibm-granite/granite-4.2-8b` | 131K | | | | | | $0.10 | $0.15 |
48
+ | `wandb/meta-llama/Llama-3.1-8B-Instruct` | 131K | | | | | | $0.22 | $0.22 |
49
+ | `wandb/meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.71 | $0.71 |
50
+ | `wandb/MiniMaxAI/MiniMax-M3` | 262K | | | | | | $0.23 | $0.96 |
51
+ | `wandb/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.65 | $3 |
52
+ | `wandb/moonshotai/Kimi-K2.7-Code` | 262K | | | | | | $0.71 | $4 |
53
+ | `wandb/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B` | 262K | | | | | | $0.50 | $2 |
54
+ | `wandb/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B` | 262K | | | | | | $0.07 | $0.20 |
55
+ | `wandb/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B` | 1.0M | | | | | | $0.15 | $0.50 |
56
+ | `wandb/openai/gpt-oss-120b` | 131K | | | | | | $0.03 | $0.17 |
57
+ | `wandb/openai/gpt-oss-20b` | 131K | | | | | | $0.03 | $0.13 |
58
+ | `wandb/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.25 | $1 |
59
+ | `wandb/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.40 | $3 |
60
+ | `wandb/reflection/Beam-1.0-501B-A23B` | 1.0M | | | | | | $0.30 | $1 |
61
+ | `wandb/zai-org/GLM-5.2` | 1.0M | | | | | | $0.62 | $2 |
62
+ | `wandb/zai-org/GLM-5.3` | 1.0M | | | | | | $1 | $4 |
63
+ | `wandb/zai-org/GLM-5.3-Flash` | 1.0M | | | | | | $0.15 | $0.50 |
61
64
 
62
65
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
63
66
 
@@ -45,7 +45,6 @@ for await (const chunk of stream) {
45
45
  | `xai/grok-4.7` | 500K | | | | | | $2 | $6 |
46
46
  | `xai/grok-build-0.1` | 256K | | | | | | $1 | $2 |
47
47
  | `xai/grok-imagine-image` | 16K | | | | | | — | — |
48
- | `xai/grok-imagine-image-quality` | 16K | | | | | | — | — |
49
48
  | `xai/grok-imagine-video` | 1K | | | | | | — | — |
50
49
  | `xai/grok-imagine-video-1.5` | 1K | | | | | | — | — |
51
50
  | `xai/grok-imagine-video-1.5-lite` | 1K | | | | | | — | — |
@@ -39,8 +39,6 @@ for await (const chunk of stream) {
39
39
  | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
40
  | ------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
41
  | `xiaomi-token-plan-ams/mimo-v2-tts` | 8K | | | | | | — | — |
42
- | `xiaomi-token-plan-ams/mimo-v2.5` | 1.0M | | | | | | — | — |
43
- | `xiaomi-token-plan-ams/mimo-v2.5-pro` | 1.0M | | | | | | — | — |
44
42
  | `xiaomi-token-plan-ams/mimo-v2.5-tts` | 8K | | | | | | — | — |
45
43
  | `xiaomi-token-plan-ams/mimo-v2.5-tts-voiceclone` | 8K | | | | | | — | — |
46
44
  | `xiaomi-token-plan-ams/mimo-v2.5-tts-voicedesign` | 8K | | | | | | — | — |
@@ -39,8 +39,6 @@ for await (const chunk of stream) {
39
39
  | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
40
  | ------------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
41
  | `xiaomi-token-plan-cn/mimo-v2-tts` | 8K | | | | | | — | — |
42
- | `xiaomi-token-plan-cn/mimo-v2.5` | 1.0M | | | | | | — | — |
43
- | `xiaomi-token-plan-cn/mimo-v2.5-pro` | 1.0M | | | | | | — | — |
44
42
  | `xiaomi-token-plan-cn/mimo-v2.5-tts` | 8K | | | | | | — | — |
45
43
  | `xiaomi-token-plan-cn/mimo-v2.5-tts-voiceclone` | 8K | | | | | | — | — |
46
44
  | `xiaomi-token-plan-cn/mimo-v2.5-tts-voicedesign` | 8K | | | | | | — | — |
@@ -39,8 +39,6 @@ for await (const chunk of stream) {
39
39
  | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
40
  | ------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
41
  | `xiaomi-token-plan-sgp/mimo-v2-tts` | 8K | | | | | | — | — |
42
- | `xiaomi-token-plan-sgp/mimo-v2.5` | 1.0M | | | | | | — | — |
43
- | `xiaomi-token-plan-sgp/mimo-v2.5-pro` | 1.0M | | | | | | — | — |
44
42
  | `xiaomi-token-plan-sgp/mimo-v2.5-tts` | 8K | | | | | | — | — |
45
43
  | `xiaomi-token-plan-sgp/mimo-v2.5-tts-voiceclone` | 8K | | | | | | — | — |
46
44
  | `xiaomi-token-plan-sgp/mimo-v2.5-tts-voicedesign` | 8K | | | | | | — | — |
@@ -38,9 +38,6 @@ for await (const chunk of stream) {
38
38
 
39
39
  | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
40
  | --------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
- | `xiaomi/mimo-v2.5` | 1.0M | | | | | | $0.14 | $0.28 |
42
- | `xiaomi/mimo-v2.5-pro` | 1.0M | | | | | | $0.43 | $0.87 |
43
- | `xiaomi/mimo-v2.5-pro-ultraspeed` | 1.0M | | | | | | $1 | $3 |
44
41
  | `xiaomi/mimo-v2.6-flash` | 1.0M | | | | | | $0.14 | $0.28 |
45
42
  | `xiaomi/mimo-v2.6-pro` | 1.0M | | | | | | $0.43 | $0.87 |
46
43
  | `xiaomi/mimo-v2.6-pro-ultraspeed` | 1.0M | | | | | | $4 | $9 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![ZenMux logo](https://models.dev/logos/zenmux.svg)ZenMux
6
6
 
7
- Access 129 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.
7
+ Access 130 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [ZenMux documentation](https://docs.zenmux.ai).
10
10
 
@@ -76,6 +76,7 @@ for await (const chunk of stream) {
76
76
  | `zenmux/minimax/minimax-m2.7` | 205K | | | | | | $0.31 | $1 |
77
77
  | `zenmux/minimax/minimax-m2.7-highspeed` | 205K | | | | | | $0.61 | $2 |
78
78
  | `zenmux/minimax/minimax-m3` | 1.0M | | | | | | $0.60 | $2 |
79
+ | `zenmux/minimax/minimax-m3.1-flash` | 1.0M | | | | | | $0.15 | $0.60 |
79
80
  | `zenmux/moonshotai/kimi-k2.5` | 262K | | | | | | $0.58 | $3 |
80
81
  | `zenmux/moonshotai/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
81
82
  | `zenmux/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
@@ -53,6 +53,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
53
53
  - [ClinePass](https://mastra.ai/models/providers/cline-pass)
54
54
  - [CloudFerro Sherlock](https://mastra.ai/models/providers/cloudferro-sherlock)
55
55
  - [Cloudflare Workers AI](https://mastra.ai/models/providers/cloudflare-workers-ai)
56
+ - [CommandCode](https://mastra.ai/models/providers/commandcode)
56
57
  - [CoralBricks](https://mastra.ai/models/providers/coralbricks)
57
58
  - [CoreWeave](https://mastra.ai/models/providers/wandb)
58
59
  - [Cortecs](https://mastra.ai/models/providers/cortecs)
@@ -158,6 +159,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
158
159
  - [Privatemode AI](https://mastra.ai/models/providers/privatemode-ai)
159
160
  - [QiHang](https://mastra.ai/models/providers/qihang-ai)
160
161
  - [Qiniu](https://mastra.ai/models/providers/qiniu-ai)
162
+ - [Reflection](https://mastra.ai/models/providers/reflection)
161
163
  - [Regolo AI](https://mastra.ai/models/providers/regolo-ai)
162
164
  - [Requesty](https://mastra.ai/models/providers/requesty)
163
165
  - [routing.run](https://mastra.ai/models/providers/routing-run)
@@ -402,13 +402,14 @@ const ownerId = await session.thread.getOwner()
402
402
 
403
403
  Returns: `Promise<string | undefined>`
404
404
 
405
- ### `session.thread.transferOwnership({ toOwnerId })`
405
+ ### `session.thread.transferOwnership({ toOwnerId, threadId? })`
406
406
 
407
- Store `toOwnerId` in the active thread's `metadata.ownerId` and emit `thread_owner_changed`. The original `metadata.createdBy` value doesn't change.
407
+ Store `toOwnerId` in the thread's `metadata.ownerId` and emit `thread_owner_changed`. The original `metadata.createdBy` value doesn't change. Without `threadId`, this transfers the active thread. With `threadId`, it transfers that thread of the session's resource and the active thread stays the same.
408
408
 
409
409
  ```typescript
410
410
  await session.thread.transferOwnership({
411
411
  toOwnerId: 'user-456',
412
+ threadId: 'thread-123',
412
413
  })
413
414
  ```
414
415
 
@@ -120,7 +120,7 @@ const agent = new Agent({
120
120
 
121
121
  Pass a function to `toolDisplay` for fully custom rendering. The function receives a `ToolDisplayEvent` (`running` / `result` / `error` / `approval` / `approved` / `denied`) and a `ToolDisplayContext` (`{ mode, platform }`); return `{ kind: 'post', message }` for a discrete post/edit, `{ kind: 'stream', chunk }` to push into the active streaming widget, or `undefined` to skip rendering that event.
122
122
 
123
- After a user clicks Approve or Deny, Mastra sends an `approved` or `denied` event (`denied` includes `byUser`, which is undefined in DMs). A `post` result replaces the approval card in place. If the function returns nothing, a blank message, or throws, Mastra shows the default "Approved" or "Denied" card.
123
+ After a user clicks Approve or Deny, Mastra sends an `approved` or `denied` event. Both include `byUser`, the name of the user who clicked, which is undefined in DMs. A `post` result replaces the approval card in place. If the function returns nothing, a blank message, or throws, Mastra shows the default "Approved" or "Denied" card, which names the user outside DMs.
124
124
 
125
125
  By default, a stream result opens a streaming session when none is active. Set `openIfEmpty: false` when the chunk only applies to an existing session. Mastra skips the chunk when no session is active. Static channels ignore this option and keep their existing plain-text fallback behavior.
126
126
 
@@ -312,6 +312,8 @@ The `ResolveResourceIdContext` passed to the function:
312
312
 
313
313
  **defaultResourceId** (`string`): The built-in default (${platform}:${message.author.userId}). Return this to keep the current behavior.
314
314
 
315
+ **requestContext** (`RequestContext`): The per-message request context. Values a channel handler sets before calling defaultHandler (for example a tenant id) are readable here, so you don't need to look them up again.
316
+
315
317
  ## Thread ID resolution
316
318
 
317
319
  By default a new channel thread gets a random UUID as its internal Mastra thread id. Pass `resolveThreadId` to pick the id yourself: for example, give the thread the same id as its session to match the names your app assigns to threads it creates.
@@ -354,6 +356,8 @@ The `ResolveThreadIdContext` passed to the function:
354
356
 
355
357
  **defaultThreadId** (`string`): The built-in default (a random UUID). Return this to keep the current behavior.
356
358
 
359
+ **requestContext** (`RequestContext`): The per-message request context, the same instance passed to resolveResourceId.
360
+
357
361
  ## Inline media
358
362
 
359
363
  Controls which attachment types (images, video, PDFs, etc.) are sent as file parts to the model. Types that don't match are described as text summaries so the agent knows about the file without crashing models that reject unsupported types.
@@ -181,6 +181,10 @@ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
181
181
 
182
182
  Reconnects to an existing run. Use this after a network disconnection. For the supported general reconnect flow, omit `offset` to replay all available cached events before receiving live events.
183
183
 
184
+ The observing agent must have the same effective `id` as the agent that started the run, both for live observations in the same process and for persisted observations from another process. The effective ID is the DurableAgent's `id`, including any ID override, rather than the wrapped agent's original ID. Different DurableAgent instances with the same effective ID can observe the same run.
185
+
186
+ If the live or persisted run identifies a different owner agent ID, `observe()` throws `DURABLE_AGENT_OBSERVE_AGENT_MISMATCH`. Legacy live entries without owner metadata retain their existing behavior.
187
+
184
188
  For runs configured with `structuredOutput`, an observer in another process reconstructs `output.object` from the persisted schema and replayed text.
185
189
 
186
190
  ```typescript
@@ -326,6 +330,10 @@ interface DurableAgentListActiveRunsResult {
326
330
 
327
331
  Discovers runs stuck in `running` status for this agent and re-drives them from the last persisted snapshot. Accepts the same filters and pagination as `listActiveRuns()`, plus `runId`. Returns the outcome for each run.
328
332
 
333
+ Attempts run serially. Each attempt has a single 30-second wait budget covering both `recover()` setup and settlement of the whole recovered workflow. When the budget expires, recovery moves to the next run and returns `status: 'skipped'` with `reason: 'recovery-timeout'` and no `retryAt`. The timeout doesn't cancel setup or execution, release a live claim, or count as success or failure. The attempt continues in the background, and its eventual outcome doesn't change the returned results. Mastra doesn't automatically retry a timed-out attempt.
334
+
335
+ The budget applies only to each run attempt in `recoverActiveRuns()`, not to discovery, a direct `recover()` call, or overridden custom recovery methods. When shutdown begins, recovery stops dispatching new runs. The original attempt remains tracked for Mastra's shared shutdown drain even after the wait times out.
336
+
329
337
  ```typescript
330
338
  const result = await durableAgent.recoverActiveRuns()
331
339
  // {
@@ -346,11 +354,12 @@ await durableAgent.recoverActiveRuns({ runId: 'run-abc-123' })
346
354
 
347
355
  A run that another execution still drives isn't taken over. Its entry has `status: 'skipped'` and a `reason`, and `recoverActiveRuns()` doesn't check it again. For a run held by another process, `retryAt` is the time after which that claim lapses unless renewed. Call `recoverActiveRuns({ runId })` after it to recover the run if its process crashed. [`mastra.recoverAllDurableAgents()`](https://mastra.ai/reference/core/mastra-class) schedules these re-checks itself.
348
356
 
349
- | `reason` | Meaning |
350
- | --------------------- | ------------------------------------------------------------------------------ |
351
- | `run-active` | Another execution, possibly in another process, holds the run. Sets `retryAt`. |
352
- | `run-active-locally` | This process is executing the run. |
353
- | `already-in-progress` | This process is already recovering the run. |
357
+ | `reason` | Meaning |
358
+ | --------------------- | ----------------------------------------------------------------------------------------------------------------- |
359
+ | `run-active` | Another execution, possibly in another process, holds the run. Sets `retryAt`. |
360
+ | `run-active-locally` | This process is executing the run. |
361
+ | `already-in-progress` | This process is already recovering the run. |
362
+ | `recovery-timeout` | The 30-second wait budget expired. The attempt continues in the background, with no `retryAt` or automatic retry. |
354
363
 
355
364
  Returns:
356
365
 
@@ -360,7 +369,7 @@ interface DurableAgentRecoverActiveRunsResult {
360
369
  runId: string
361
370
  status: 'success' | 'failed' | 'skipped'
362
371
  error?: Error
363
- reason?: 'run-active' | 'run-active-locally' | 'already-in-progress'
372
+ reason?: 'run-active' | 'run-active-locally' | 'already-in-progress' | 'recovery-timeout'
364
373
  // Epoch milliseconds
365
374
  retryAt?: number
366
375
  }>
@@ -427,7 +436,7 @@ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
427
436
 
428
437
  **modelSettings** (`object`): Model-specific settings such as temperature. Credential-bearing headers (Authorization, X-Api-Key, and similar) are stripped from the serialized snapshot before it crosses process boundaries.
429
438
 
430
- **stopWhen** (`AgentExecutionOptions['stopWhen']`): Predicate or composition that ends the agentic loop early. The closure rides on the in-process run registry; cross-process resumes degrade to maxSteps only.
439
+ **stopWhen** (`AgentExecutionOptions['stopWhen']`): Predicate or composition that ends the agentic loop early. If it throws, fullStream rejects without emitting a step-finish or error chunk. Durable transports preserve the error name and message, but not its stack, cause, or subclass identity. The closure rides on the in-process run registry; cross-process resumes degrade to maxSteps only.
431
440
 
432
441
  **system** (`string | string[]`): Additional system message appended after the agent instructions and before user messages.
433
442
 
@@ -160,7 +160,7 @@ Returns: [`Promise<InngestAgentStreamResult>`](#inngestagentstreamresult)
160
160
 
161
161
  #### `generate(messages, options?)`
162
162
 
163
- Runs a response on Inngest's durable execution engine and resolves with a single `FullOutput`. If the run suspends, `generate()` resolves with `finishReason: 'suspended'`. The `runId` option is optional. If you omit it, `generate()` creates a run ID and returns it in `result.runId`. Continue the run with [`resumeGenerate()`](#resumegeneraterunid-resumedata-options). Use [`stream()`](#streammessages-options) with `onSuspended` when the caller needs a suspension callback.
163
+ Runs a response on Inngest's durable execution engine and resolves with a single `FullOutput`. If the run suspends, `generate()` resolves with `finishReason: 'suspended'`. The `runId` option is optional. If you omit it, `generate()` creates a run ID and returns it in `result.runId`. Continue the run with [`resumeGenerate()`](#resumegenerateresumedata-options). Use [`stream()`](#streammessages-options) with `onSuspended` when the caller needs a suspension callback.
164
164
 
165
165
  ```typescript
166
166
  const result = await durableAgent.generate('Delete the old records', {
@@ -173,16 +173,16 @@ result.finishReason // 'suspended' when approval is required
173
173
 
174
174
  Returns: `Promise<FullOutput<TOutput>>`
175
175
 
176
- #### `resumeGenerate(runId, resumeData, options?)`
176
+ #### `resumeGenerate(resumeData, options)`
177
177
 
178
- Resumes a suspended `generate()` run and resolves with a single `FullOutput`.
178
+ Resumes a suspended `generate()` run and resolves with a single `FullOutput`. Pass the run ID as `options.runId`, the same as `Agent.resumeGenerate()`. The older `resumeGenerate(runId, resumeData, options?)` order still works but is deprecated.
179
179
 
180
180
  ```typescript
181
181
  if (!result.runId) {
182
182
  throw new Error('Run ID is missing')
183
183
  }
184
184
 
185
- const resumedResult = await durableAgent.resumeGenerate(result.runId, { approved: true })
185
+ const resumedResult = await durableAgent.resumeGenerate({ approved: true }, { runId: result.runId })
186
186
  ```
187
187
 
188
188
  Returns: `Promise<FullOutput<TOutput>>`
@@ -72,10 +72,12 @@ const result = await classifier.decide({
72
72
  },
73
73
  })
74
74
 
75
- result.answers.route.choice // 'billing' | 'support'
76
- result.answers.urgent.probability // P(true), from 0 to 1
75
+ result.answers.route.choice // 'billing' | 'support' | undefined
76
+ result.answers.urgent.probability // P(true), from 0 to 1, or undefined
77
77
  ```
78
78
 
79
+ A field is `undefined` only when the decision model refused the question. See [refused questions](#refused-questions).
80
+
79
81
  The decision model receives every question with the same `state`. When a question omits `instructions`, its question name is used instead.
80
82
 
81
83
  ## Decision models
@@ -198,6 +200,28 @@ const answer = {
198
200
  }
199
201
  ```
200
202
 
203
+ ### Refused questions
204
+
205
+ A decision model can refuse any question, for example when a safety policy prevents it from answering. A refused question returns a `RefusalAnswer` instead of a choice, score, or boolean answer. The other questions in the same call keep their answers.
206
+
207
+ ```typescript
208
+ const answer = {
209
+ type: 'refusal',
210
+ }
211
+ ```
212
+
213
+ A refusal has no `choice`, `score`, or `probability`. Equality checks such as `answers.route.choice === 'billing'` evaluate to `false`. Check `type` before you read a numeric field, and decide how your application handles the refusal:
214
+
215
+ ```typescript
216
+ const urgent = result.answers.urgent
217
+
218
+ if (urgent.type === 'refusal') {
219
+ // Route to a human, block the input, or apply a default.
220
+ } else if (urgent.probability > 0.8) {
221
+ // Escalate.
222
+ }
223
+ ```
224
+
201
225
  ## Designing questions
202
226
 
203
227
  These rules keep a question answerable from the state:
@@ -205,7 +229,7 @@ These rules keep a question answerable from the state:
205
229
  - Ask for one judgment. A question that moves when either of two fields changes can't be routed on.
206
230
  - Keep criteria exclusive. `strong: 'A good fit'` and `partial: 'Maybe a fit'` leak probability between them.
207
231
  - Give a score enough levels to represent intermediate values.
208
- - Add an escape level when the list isn't closed. Three teams and no `other` forces every input into a team.
232
+ - Add an escape level when the list isn't closed. Without an `other` level, the classifier must assign every input to one of the listed teams.
209
233
  - Put fields in `state`, not in `instructions`. One changed field then moves one answer.
210
234
 
211
235
  To check a question, change one field of the state and confirm one answer moves.
@@ -252,7 +276,7 @@ const result = await classifier.decide({
252
276
  },
253
277
  })
254
278
 
255
- result.answers.tone.choice // 'empathetic' | 'neutral'
279
+ result.answers.tone.choice // 'empathetic' | 'neutral' | undefined
256
280
  ```
257
281
 
258
282
  ## Return value
@@ -300,15 +324,15 @@ Input validation includes:
300
324
  - Every question type must be supported by the decision model.
301
325
  - `maxRetries` must be a non-negative integer.
302
326
 
303
- Provider responses must contain exactly one matching answer for each question. The classifier also rejects invalid choices, out-of-range scores or probabilities, incomplete probability distributions, non-finite token counts, malformed warnings, and invalid response timestamps.
327
+ Provider responses must contain exactly one answer for each question. Each answer must match the question type or be a refusal. The classifier also rejects invalid choices, out-of-range scores or probabilities, incomplete probability distributions, non-finite token counts, malformed warnings, and invalid response timestamps.
304
328
 
305
329
  Only retryable AI SDK `APICallError` failures are retried. Other errors reject immediately. When all retries fail, `decide()` rethrows the last provider error. Aborting the supplied signal rejects with the signal's abort reason, including when cancellation occurs during retry backoff.
306
330
 
307
331
  ## Observability
308
332
 
309
- When an active Mastra span exists, `decide()` creates a `CLASSIFIER_EVALUATION` child span. It records the classifier and model identifiers, provider, question count and types, attempts, duration, and token usage.
333
+ When an active Mastra span exists, `decide()` creates a `CLASSIFIER_EVALUATION` child span. The span input holds the evaluated `state` and the questions. The span output holds the answers, including probabilities. Span attributes record the classifier and model identifiers, provider, question count and types, attempts, duration, and token usage. The token usage also produces [token and cost metrics](https://mastra.ai/reference/observability/metrics/automatic-metrics).
310
334
 
311
- The span doesn't include the evaluated state, question instructions, criteria, answers, probabilities, provider response body, or generated text.
335
+ To keep the state and answers out of exported traces, set `hideInput` and `hideOutput` in the `tracingOptions` of the agent or workflow run that calls the classifier. See [hiding sensitive input/output](https://mastra.ai/docs/observability/tracing/overview).
312
336
 
313
337
  ## Customize provider responses
314
338
 
@@ -1287,7 +1287,7 @@ Use `--url` and `--header` when you need to override another target or its crede
1287
1287
 
1288
1288
  ### Factory commands
1289
1289
 
1290
- Use `mastra api factory` to manage Factory projects, work items, decisions, attention items, queue health, and supervisor sessions. These commands use the same JSON input, output, authentication, headers, timeout, and target resolution as other `mastra api` commands.
1290
+ Use `mastra api factory` to manage Factory projects, work items, decisions, attention items, and queue health. These commands use the same JSON input, output, authentication, headers, timeout, and target resolution as other `mastra api` commands.
1291
1291
 
1292
1292
  List the Factory projects available to the current organization:
1293
1293
 
@@ -1661,13 +1661,13 @@ Inspect the command with:
1661
1661
  mastra api trace query --help
1662
1662
  ```
1663
1663
 
1664
- For supported fields, operators, and request options, see [Trace queries](https://mastra.ai/reference/observability/tracing/trace-query). For a local Mastra server, you can also inspect its request and response schemas:
1664
+ For supported fields, operators, and request options, see [Query traces](https://mastra.ai/reference/observability/tracing/advanced-queries). For a local Mastra server, you can also inspect its request and response schemas:
1665
1665
 
1666
1666
  ```bash
1667
1667
  mastra api --url http://localhost:4111 trace query --schema
1668
1668
  ```
1669
1669
 
1670
- Mastra Platform doesn't currently expose the schema endpoint used by `--schema`. To find fields and values recorded in your project, use [field and value discovery](https://mastra.ai/reference/observability/tracing/trace-query).
1670
+ Mastra Platform doesn't currently expose the schema endpoint used by `--schema`. To find fields and values recorded in your project, use [field and value discovery](https://mastra.ai/reference/observability/tracing/advanced-queries).
1671
1671
 
1672
1672
  The response remains nested under `data` to preserve cursor pagination:
1673
1673
 
@@ -1680,7 +1680,7 @@ The response remains nested under `data` to preserve cursor pagination:
1680
1680
  }
1681
1681
  ```
1682
1682
 
1683
- Each invocation makes one query. Pass a non-null `data.page.next` value back as `page.after` in the next query. See [Pagination and errors](https://mastra.ai/reference/observability/tracing/trace-query) for pagination modes, cursor handling, and errors.
1683
+ Each invocation makes one query. Pass a non-null `data.page.next` value back as `page.after` in the next query. See [Pagination and errors](https://mastra.ai/reference/observability/tracing/advanced-queries) for pagination modes, cursor handling, and errors.
1684
1684
 
1685
1685
  To load a numbered page and then poll, keep the same time range and predicate in both requests:
1686
1686
 
@@ -1691,7 +1691,42 @@ mastra api trace query '{"timeRange":{"from":"2026-08-01T00:00:00.000Z","to":"20
1691
1691
 
1692
1692
  Replace `CURSOR_FROM_NUMBERED_RESPONSE` with `data.deltaCursor` from the first response. Delta results remain under `data`, with `traces`, `delta: { limit, hasMore }`, and `deltaCursor`. Merge traces by `traceId`, retain each returned cursor, and continue immediately while `data.delta.hasMore` is `true`. Don't combine delta mode with `page`, `pagination`, or `orderBy`.
1693
1693
 
1694
- Omitting `after` establishes a cursor and returns no historical traces. Changing the time range or predicate requires a fresh numbered request. See [Delta polling limitations](https://mastra.ai/reference/observability/tracing/trace-query) before using this workflow to maintain a local trace list.
1694
+ Omitting `after` establishes a cursor and returns no historical traces. Changing the time range or predicate requires a fresh numbered request. See [Delta polling limitations](https://mastra.ai/reference/observability/tracing/advanced-queries) before using this workflow to maintain a local trace list.
1695
+
1696
+ #### `mastra api trace aggregate`
1697
+
1698
+ Groups the traces selected by a time range and optional `where` predicate, and returns one row of measures per group. The inline JSON input is required and accepts the same predicates as `trace query`. Like other observability commands, it targets `https://observability.mastra.ai` by default.
1699
+
1700
+ ```bash
1701
+ mastra api trace aggregate <input>
1702
+ mastra api trace aggregate '{"timeRange":{"from":"2026-08-01T00:00:00.000Z","to":"2026-08-08T00:00:00.000Z"},"groupBy":["entityName"],"measures":["count","errorRate"]}'
1703
+ ```
1704
+
1705
+ Set `interval` to `1m`, `5m`, `15m`, `1h`, or `1d` to split each group into time buckets:
1706
+
1707
+ ```bash
1708
+ mastra api trace aggregate '{"timeRange":{"from":"2026-08-01T00:00:00.000Z","to":"2026-08-08T00:00:00.000Z"},"where":{"op":"eq","left":{"path":"entityName"},"right":{"literal":"weather-agent"}},"interval":"1d","measures":["count","duration.p95"]}'
1709
+ ```
1710
+
1711
+ For dimensions, measures, and request options, see [Aggregate traces](https://mastra.ai/reference/client-js/observability). Run `mastra api trace aggregate --help` for more examples.
1712
+
1713
+ The response stays nested under `data` so `truncated` is preserved. `truncated` is `true` when more groups matched than `limit`:
1714
+
1715
+ ```json
1716
+ {
1717
+ "data": {
1718
+ "rows": [
1719
+ {
1720
+ "dimensions": { "entityName": "weather-agent" },
1721
+ "measures": { "count": 42, "errorRate": 0.05 }
1722
+ }
1723
+ ],
1724
+ "truncated": false
1725
+ }
1726
+ }
1727
+ ```
1728
+
1729
+ Servers whose observability store doesn't support trace aggregation return `501`. The CLI prints it like other request failures, as an `HTTP_ERROR` with the server response in `error.details.body`.
1695
1730
 
1696
1731
  #### `mastra api trace get`
1697
1732
 
@@ -2016,11 +2051,13 @@ Prints help message and exits.
2016
2051
 
2017
2052
  By default, Mastra collects telemetry about your project, including your OS, Mastra version, and Node.js version. Server events also include the project identifiers described below. You can read the [CLI telemetry source code](https://github.com/mastra-ai/mastra/blob/main/packages/cli/src/analytics/index.ts) to check what's collected by the CLI.
2018
2053
 
2019
- When a server started with `mastra dev` or `mastra start` has observability metrics enabled, Mastra sends aggregated model usage at startup: input and output token counts per provider and model, plus the command (`dev` or `start`) and `NODE_ENV`. No prompts, responses, or other message content is sent. You can read the [model usage telemetry source code](https://github.com/mastra-ai/mastra/blob/main/packages/core/src/telemetry/usage-telemetry.ts) to check what's collected.
2054
+ When a server started with `mastra dev`, `mastra start`, or a `mastra build` output has observability configured, Mastra counts the input and output tokens each model call uses in that server process. Every 15 minutes, and once more when the server shuts down, it sends a `mastra_model_token_usage_v2` event per provider and model used since the previous report. If no model calls finished since then, nothing is sent. Each event contains the tokens used since the previous report, the report window's start and end times, the reason for the report (`interval` or `shutdown`), the command (`dev`, `start`, or `server` when the build output runs directly), and `NODE_ENV`. No prompts, responses, or other message content is sent. You can read the [model usage telemetry source code](https://github.com/mastra-ai/mastra/blob/main/packages/core/src/telemetry/model-usage-telemetry.ts) to check what's collected.
2055
+
2056
+ For compatibility with older analysis, servers also send the earlier `mastra_model_token_usage` event at startup. It reads token totals from observability storage and sends the usage added since a cursor saved in `~/.mastra/usage-telemetry.json`. You can read the [startup usage telemetry source code](https://github.com/mastra-ai/mastra/blob/main/packages/core/src/telemetry/usage-telemetry.ts) to check what's collected.
2020
2057
 
2021
2058
  At server startup, Mastra sends a project-surface snapshot with component counts, feature flags, and the coarse storage backend category, but no component names or component identifiers. You can read the [feature telemetry source code](https://github.com/mastra-ai/mastra/blob/main/packages/core/src/telemetry/feature-telemetry.ts) to check what's collected.
2022
2059
 
2023
- The server events `mastra_feature_usage` and `mastra_model_token_usage` include:
2060
+ The server events `mastra_feature_usage`, `mastra_model_token_usage`, and `mastra_model_token_usage_v2` include:
2024
2061
 
2025
2062
  - `project_id`: The first 16 hexadecimal characters of the SHA-256 hash of `MASTRA_PROJECT_ROOT`, or the current working directory when unset. This identifier also keys the local model-usage cursor.
2026
2063
  - `project_id2`: An optional identifier for correlation across machines and deployments. If the trimmed `MASTRA_PROJECT_ID` value has UUID format, the value is sent **unhashed**, prefixed with `mp_`. Search for `mp_<platform-project-id>` to find that project's telemetry. Names, slugs, and other non-UUID values aren't sent as Platform identifiers.
@@ -111,6 +111,8 @@ Subscribes to the session's event stream over SSE. The promise resolves once the
111
111
 
112
112
  **reconnect** (`boolean | { maxRetries?: number; delayMs?: number; maxDelayMs?: number }`): Re-establishes the stream after an established stream drops. Retries back off exponentially from delayMs (default 1000) up to maxDelayMs (default 30000). maxRetries (default Infinity) bounds the attempts per outage and resets once a connection is re-established. When retries are exhausted, onError fires. A reconnect request that fails with a 4xx (other than 408 and 429) or 501 stops reconnecting immediately and passes that MastraClientError to onError.
113
113
 
114
+ **idleTimeoutMs** (`number`): Treats the stream as dropped after this many milliseconds without receiving any data. Server heartbeats, sent every 25 seconds, reset the timer, so only a silent connection, such as one left half-open by laptop sleep or a proxy timeout, trips it. A timeout is handled like any other drop: it triggers reconnect and onReconnect when reconnect is enabled, otherwise onError. Also bounds opening the stream: subscribe() rejects, and a reconnect attempt counts as failed, when no response arrives in time. Set to 0 to disable. (Default: `60000`)
115
+
114
116
  Returns: `Promise<AgentControllerSubscription>`, an object with an `unsubscribe()` method that stops reading and releases the stream.
115
117
 
116
118
  ### `sendMessage(message, options?)`
@@ -321,6 +321,26 @@ await subscription.processDataStream({
321
321
 
322
322
  Pass `withInitialHistory: true` (or `{ perPage }`) to receive the stored messages as a first `thread-history` chunk instead of fetching history separately. Finished runs aren't replayed after it, so completed answers don't stream again on reconnect.
323
323
 
324
+ In the React SDK, `useChat()` exposes the `hasMore` flag from that first page as `initialHistoryPagination`, so you can decide whether to offer loading older messages without another history request:
325
+
326
+ ```typescript
327
+ import { useChat } from '@mastra/react'
328
+
329
+ const { messages, initialHistoryPagination } = useChat({
330
+ agentId: 'support-agent',
331
+ resourceId: 'user-123',
332
+ threadId: 'thread-abc',
333
+ enableThreadSignals: true,
334
+ withInitialHistory: { perPage: 20 },
335
+ })
336
+
337
+ // { hasMore: true }: older messages exist
338
+ // { hasMore: false }: the page reaches the start of the thread
339
+ // undefined: history is disabled, still loading, or the subscription ended
340
+ ```
341
+
342
+ `initialHistoryPagination` only describes the initial subscription page for the current agent, resource, thread, and `withInitialHistory` value. It isn't changed by live output or `setMessages()`. After you load older pages yourself, use the `hasMore` value from those responses.
343
+
324
344
  `subscribeToThread()` returns the underlying `Response` plus a `processDataStream()` helper. The helper reads the subscription stream until the connection closes or the request is aborted. Pass `reconnect: true` to resubscribe when the transport closes or a reconnect request fails, such as after a proxy idle timeout. If a reconnect request fails with a 4xx status (for example `401` or `403`) or `501`, `processDataStream()` stops reconnecting and rejects with the original `MastraClientError`. `408` and `429` are still retried.
325
345
 
326
346
  **resourceId** (`string`): Resource ID for the memory thread.