@mastra/mcp-docs-server 0.0.0-error-handler-fix-20251020202607 → 0.0.0-execa-dynamic-import-20260304221256

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 (1226) hide show
  1. package/.docs/course/01-first-agent/04-project-structure.md +19 -0
  2. package/.docs/course/01-first-agent/05-running-playground.md +19 -0
  3. package/.docs/course/01-first-agent/07-creating-your-agent.md +50 -0
  4. package/.docs/course/01-first-agent/08-exporting-your-agent.md +34 -0
  5. package/.docs/course/01-first-agent/09-testing-your-agent.md +12 -0
  6. package/.docs/course/01-first-agent/11-creating-transactions-tool.md +41 -0
  7. package/.docs/course/01-first-agent/12-connecting-tool-to-agent.md +29 -0
  8. package/.docs/course/01-first-agent/13-testing-your-tool.md +15 -0
  9. package/.docs/course/01-first-agent/15-installing-memory.md +13 -0
  10. package/.docs/course/01-first-agent/16-adding-memory-to-agent.md +33 -0
  11. package/.docs/course/01-first-agent/17-testing-memory.md +15 -0
  12. package/.docs/course/02-agent-tools-mcp/03-setting-up-mcp-configuration.md +21 -0
  13. package/.docs/course/02-agent-tools-mcp/04-initializing-mcp-tools.md +11 -0
  14. package/.docs/course/02-agent-tools-mcp/05-updating-your-agent.md +20 -0
  15. package/.docs/course/02-agent-tools-mcp/07-what-is-zapier-mcp.md +23 -0
  16. package/.docs/course/02-agent-tools-mcp/08-getting-zapier-mcp-url.md +21 -0
  17. package/.docs/course/02-agent-tools-mcp/09-updating-mcp-config-zapier.md +29 -0
  18. package/.docs/course/02-agent-tools-mcp/10-updating-agent-instructions-zapier.md +29 -0
  19. package/.docs/course/02-agent-tools-mcp/12-troubleshooting-zapier.md +19 -0
  20. package/.docs/course/02-agent-tools-mcp/13-what-is-github-mcp.md +14 -0
  21. package/.docs/course/02-agent-tools-mcp/14-getting-github-mcp-url.md +40 -0
  22. package/.docs/course/02-agent-tools-mcp/15-updating-mcp-config-github.md +36 -0
  23. package/.docs/course/02-agent-tools-mcp/16-updating-agent-instructions-github.md +33 -0
  24. package/.docs/course/02-agent-tools-mcp/18-troubleshooting-github.md +17 -0
  25. package/.docs/course/02-agent-tools-mcp/20-updating-mcp-config-hackernews.md +36 -0
  26. package/.docs/course/02-agent-tools-mcp/21-updating-agent-instructions-hackernews.md +38 -0
  27. package/.docs/course/02-agent-tools-mcp/26-updating-mcp-config-filesystem.md +43 -0
  28. package/.docs/course/02-agent-tools-mcp/27-updating-agent-instructions-filesystem.md +45 -0
  29. package/.docs/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +78 -0
  30. package/.docs/course/02-agent-tools-mcp/32-conclusion.md +17 -0
  31. package/.docs/course/03-agent-memory/03-installing-memory.md +13 -0
  32. package/.docs/course/03-agent-memory/04-creating-basic-memory-agent.md +36 -0
  33. package/.docs/course/03-agent-memory/05-updating-mastra-export.md +18 -0
  34. package/.docs/course/03-agent-memory/07-understanding-memory-threads.md +49 -0
  35. package/.docs/course/03-agent-memory/08-configuring-conversation-history.md +36 -0
  36. package/.docs/course/03-agent-memory/09-using-memory-in-application.md +19 -0
  37. package/.docs/course/03-agent-memory/10-storage-configuration.md +29 -0
  38. package/.docs/course/03-agent-memory/12-handling-memory-frontend.md +62 -0
  39. package/.docs/course/03-agent-memory/13-vector-store-configuration.md +29 -0
  40. package/.docs/course/03-agent-memory/16-configuring-semantic-recall.md +42 -0
  41. package/.docs/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +29 -0
  42. package/.docs/course/03-agent-memory/21-configuring-working-memory.md +64 -0
  43. package/.docs/course/03-agent-memory/22-custom-working-memory-templates.md +89 -0
  44. package/.docs/course/03-agent-memory/25-combining-memory-features.md +80 -0
  45. package/.docs/course/03-agent-memory/26-updating-mastra-export-comprehensive.md +0 -0
  46. package/.docs/course/03-agent-memory/27-creating-learning-assistant.md +103 -0
  47. package/.docs/course/04-workflows/01-introduction-to-workflows.md +44 -0
  48. package/.docs/course/04-workflows/02-understanding-steps.md +53 -0
  49. package/.docs/course/04-workflows/03-creating-your-first-step.md +57 -0
  50. package/.docs/course/04-workflows/04-creating-a-second-step.md +58 -0
  51. package/.docs/course/04-workflows/05-chaining-steps-together.md +57 -0
  52. package/.docs/course/04-workflows/06-registering-with-mastra.md +24 -0
  53. package/.docs/course/04-workflows/07-using-playground.md +58 -0
  54. package/.docs/course/04-workflows/08-running-workflows-programmatically.md +73 -0
  55. package/.docs/course/04-workflows/09-adding-a-third-step.md +68 -0
  56. package/.docs/course/04-workflows/10-updating-the-workflow.md +55 -0
  57. package/.docs/course/04-workflows/11-creating-an-ai-agent.md +66 -0
  58. package/.docs/course/04-workflows/12-using-agent-in-workflow.md +89 -0
  59. package/.docs/course/04-workflows/13-creating-ai-enhanced-workflow.md +72 -0
  60. package/.docs/course/04-workflows/14-understanding-parallel-execution.md +38 -0
  61. package/.docs/course/04-workflows/15-creating-parallel-steps.md +111 -0
  62. package/.docs/course/04-workflows/16-building-parallel-workflow.md +100 -0
  63. package/.docs/course/04-workflows/17-testing-parallel-performance.md +36 -0
  64. package/.docs/course/04-workflows/18-understanding-conditional-branching.md +61 -0
  65. package/.docs/course/04-workflows/19-creating-conditional-steps.md +124 -0
  66. package/.docs/course/04-workflows/20-building-conditional-workflow.md +55 -0
  67. package/.docs/course/04-workflows/21-testing-conditional-logic.md +58 -0
  68. package/.docs/docs/agents/adding-voice.md +349 -0
  69. package/.docs/docs/agents/agent-approval.md +588 -0
  70. package/.docs/docs/agents/agent-memory.md +209 -0
  71. package/.docs/docs/agents/guardrails.md +374 -0
  72. package/.docs/docs/agents/network-approval.md +275 -0
  73. package/.docs/docs/agents/networks.md +299 -0
  74. package/.docs/docs/agents/overview.md +304 -0
  75. package/.docs/docs/agents/processors.md +622 -0
  76. package/.docs/docs/agents/structured-output.md +273 -0
  77. package/.docs/docs/agents/supervisor-agents.md +304 -0
  78. package/.docs/docs/agents/using-tools.md +248 -0
  79. package/.docs/docs/build-with-ai/mcp-docs-server.md +238 -0
  80. package/.docs/docs/build-with-ai/skills.md +35 -0
  81. package/.docs/docs/community/contributing-templates.md +3 -0
  82. package/.docs/docs/community/discord.md +9 -0
  83. package/.docs/docs/community/licensing.md +66 -0
  84. package/.docs/docs/deployment/cloud-providers.md +15 -0
  85. package/.docs/docs/deployment/mastra-server.md +122 -0
  86. package/.docs/docs/deployment/monorepo.md +142 -0
  87. package/.docs/docs/deployment/overview.md +62 -0
  88. package/.docs/docs/deployment/studio.md +247 -0
  89. package/.docs/docs/deployment/web-framework.md +52 -0
  90. package/.docs/docs/deployment/workflow-runners.md +9 -0
  91. package/.docs/docs/evals/built-in-scorers.md +47 -0
  92. package/.docs/docs/evals/custom-scorers.md +519 -0
  93. package/.docs/docs/evals/overview.md +141 -0
  94. package/.docs/docs/evals/running-in-ci.md +124 -0
  95. package/.docs/docs/getting-started/build-with-ai.md +68 -0
  96. package/.docs/docs/getting-started/manual-install.md +226 -0
  97. package/.docs/docs/getting-started/project-structure.md +60 -0
  98. package/.docs/docs/getting-started/start.md +28 -0
  99. package/.docs/docs/getting-started/studio.md +101 -0
  100. package/.docs/docs/index.md +43 -0
  101. package/.docs/docs/mastra-cloud/deployment.md +77 -0
  102. package/.docs/docs/mastra-cloud/observability.md +38 -0
  103. package/.docs/docs/mastra-cloud/overview.md +23 -0
  104. package/.docs/docs/mastra-cloud/setup.md +42 -0
  105. package/.docs/docs/mastra-cloud/studio.md +24 -0
  106. package/.docs/docs/mcp/overview.md +373 -0
  107. package/.docs/docs/mcp/publishing-mcp-server.md +95 -0
  108. package/.docs/docs/memory/memory-processors.md +314 -0
  109. package/.docs/docs/memory/message-history.md +260 -0
  110. package/.docs/docs/memory/observational-memory.md +255 -0
  111. package/.docs/docs/memory/overview.md +45 -0
  112. package/.docs/docs/memory/semantic-recall.md +288 -0
  113. package/.docs/docs/memory/storage.md +261 -0
  114. package/.docs/docs/memory/working-memory.md +400 -0
  115. package/.docs/docs/observability/datasets/overview.md +198 -0
  116. package/.docs/docs/observability/datasets/running-experiments.md +274 -0
  117. package/.docs/docs/observability/logging.md +99 -0
  118. package/.docs/docs/observability/overview.md +70 -0
  119. package/.docs/docs/observability/tracing/bridges/otel.md +209 -0
  120. package/.docs/docs/observability/tracing/exporters/arize.md +272 -0
  121. package/.docs/docs/observability/tracing/exporters/braintrust.md +111 -0
  122. package/.docs/docs/observability/tracing/exporters/cloud.md +127 -0
  123. package/.docs/docs/observability/tracing/exporters/datadog.md +187 -0
  124. package/.docs/docs/observability/tracing/exporters/default.md +209 -0
  125. package/.docs/docs/observability/tracing/exporters/laminar.md +100 -0
  126. package/.docs/docs/observability/tracing/exporters/langfuse.md +213 -0
  127. package/.docs/docs/observability/tracing/exporters/langsmith.md +198 -0
  128. package/.docs/docs/observability/tracing/exporters/otel.md +476 -0
  129. package/.docs/docs/observability/tracing/exporters/posthog.md +148 -0
  130. package/.docs/docs/observability/tracing/exporters/sentry.md +208 -0
  131. package/.docs/docs/observability/tracing/overview.md +1112 -0
  132. package/.docs/docs/observability/tracing/processors/sensitive-data-filter.md +300 -0
  133. package/.docs/docs/rag/chunking-and-embedding.md +183 -0
  134. package/.docs/docs/rag/graph-rag.md +215 -0
  135. package/.docs/docs/rag/overview.md +72 -0
  136. package/.docs/docs/rag/retrieval.md +515 -0
  137. package/.docs/docs/rag/vector-databases.md +645 -0
  138. package/.docs/docs/server/auth/auth0.md +220 -0
  139. package/.docs/docs/server/auth/better-auth.md +220 -0
  140. package/.docs/docs/server/auth/clerk.md +132 -0
  141. package/.docs/docs/server/auth/composite-auth.md +234 -0
  142. package/.docs/docs/server/auth/custom-auth-provider.md +513 -0
  143. package/.docs/docs/server/auth/firebase.md +272 -0
  144. package/.docs/docs/server/auth/jwt.md +110 -0
  145. package/.docs/docs/server/auth/simple-auth.md +180 -0
  146. package/.docs/docs/server/auth/supabase.md +117 -0
  147. package/.docs/docs/server/auth/workos.md +186 -0
  148. package/.docs/docs/server/auth.md +38 -0
  149. package/.docs/docs/server/custom-adapters.md +378 -0
  150. package/.docs/docs/server/custom-api-routes.md +267 -0
  151. package/.docs/docs/server/mastra-client.md +243 -0
  152. package/.docs/docs/server/mastra-server.md +71 -0
  153. package/.docs/docs/server/middleware.md +225 -0
  154. package/.docs/docs/server/request-context.md +471 -0
  155. package/.docs/docs/server/server-adapters.md +547 -0
  156. package/.docs/docs/streaming/events.md +237 -0
  157. package/.docs/docs/streaming/overview.md +175 -0
  158. package/.docs/docs/streaming/tool-streaming.md +175 -0
  159. package/.docs/docs/streaming/workflow-streaming.md +109 -0
  160. package/.docs/docs/voice/overview.md +959 -0
  161. package/.docs/docs/voice/speech-to-speech.md +102 -0
  162. package/.docs/docs/voice/speech-to-text.md +79 -0
  163. package/.docs/docs/voice/text-to-speech.md +83 -0
  164. package/.docs/docs/workflows/agents-and-tools.md +166 -0
  165. package/.docs/docs/workflows/control-flow.md +822 -0
  166. package/.docs/docs/workflows/error-handling.md +360 -0
  167. package/.docs/docs/workflows/human-in-the-loop.md +215 -0
  168. package/.docs/docs/workflows/overview.md +370 -0
  169. package/.docs/docs/workflows/snapshots.md +238 -0
  170. package/.docs/docs/workflows/suspend-and-resume.md +205 -0
  171. package/.docs/docs/workflows/time-travel.md +309 -0
  172. package/.docs/docs/workflows/workflow-state.md +181 -0
  173. package/.docs/docs/workspace/filesystem.md +164 -0
  174. package/.docs/docs/workspace/overview.md +239 -0
  175. package/.docs/docs/workspace/sandbox.md +65 -0
  176. package/.docs/docs/workspace/search.md +243 -0
  177. package/.docs/docs/workspace/skills.md +169 -0
  178. package/.docs/guides/agent-frameworks/ai-sdk.md +140 -0
  179. package/.docs/guides/build-your-ui/ai-sdk-ui.md +1499 -0
  180. package/.docs/guides/build-your-ui/assistant-ui.md +156 -0
  181. package/.docs/guides/build-your-ui/copilotkit.md +289 -0
  182. package/.docs/guides/deployment/amazon-ec2.md +130 -0
  183. package/.docs/guides/deployment/aws-lambda.md +248 -0
  184. package/.docs/guides/deployment/azure-app-services.md +114 -0
  185. package/.docs/guides/deployment/cloudflare.md +99 -0
  186. package/.docs/guides/deployment/digital-ocean.md +168 -0
  187. package/.docs/guides/deployment/inngest.md +682 -0
  188. package/.docs/guides/deployment/netlify.md +77 -0
  189. package/.docs/guides/deployment/vercel.md +120 -0
  190. package/.docs/guides/getting-started/astro.md +398 -0
  191. package/.docs/guides/getting-started/electron.md +504 -0
  192. package/.docs/guides/getting-started/express.md +251 -0
  193. package/.docs/guides/getting-started/hono.md +190 -0
  194. package/.docs/guides/getting-started/next-js.md +347 -0
  195. package/.docs/guides/getting-started/nuxt.md +497 -0
  196. package/.docs/guides/getting-started/quickstart.md +67 -0
  197. package/.docs/guides/getting-started/sveltekit.md +296 -0
  198. package/.docs/guides/getting-started/vite-react.md +425 -0
  199. package/.docs/guides/guide/ai-recruiter.md +226 -0
  200. package/.docs/guides/guide/chef-michel.md +211 -0
  201. package/.docs/guides/guide/code-review-bot.md +226 -0
  202. package/.docs/guides/guide/dev-assistant.md +307 -0
  203. package/.docs/guides/guide/docs-manager.md +238 -0
  204. package/.docs/guides/guide/github-actions-pr-description.md +236 -0
  205. package/.docs/guides/guide/notes-mcp-server.md +416 -0
  206. package/.docs/guides/guide/research-assistant.md +348 -0
  207. package/.docs/guides/guide/research-coordinator.md +416 -0
  208. package/.docs/guides/guide/stock-agent.md +132 -0
  209. package/.docs/guides/guide/web-search.md +320 -0
  210. package/.docs/guides/guide/whatsapp-chat-bot.md +405 -0
  211. package/.docs/guides/index.md +22 -0
  212. package/.docs/guides/migrations/agentnetwork.md +97 -0
  213. package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +112 -0
  214. package/.docs/guides/migrations/network-to-supervisor.md +261 -0
  215. package/.docs/guides/migrations/upgrade-to-v1/agent.md +404 -0
  216. package/.docs/guides/migrations/upgrade-to-v1/cli.md +57 -0
  217. package/.docs/guides/migrations/upgrade-to-v1/client.md +337 -0
  218. package/.docs/guides/migrations/upgrade-to-v1/deployment.md +37 -0
  219. package/.docs/guides/migrations/upgrade-to-v1/evals.md +239 -0
  220. package/.docs/guides/migrations/upgrade-to-v1/mastra.md +143 -0
  221. package/.docs/guides/migrations/upgrade-to-v1/mcp.md +97 -0
  222. package/.docs/guides/migrations/upgrade-to-v1/memory.md +285 -0
  223. package/.docs/guides/migrations/upgrade-to-v1/overview.md +119 -0
  224. package/.docs/guides/migrations/upgrade-to-v1/processors.md +68 -0
  225. package/.docs/guides/migrations/upgrade-to-v1/rag.md +42 -0
  226. package/.docs/guides/migrations/upgrade-to-v1/storage.md +553 -0
  227. package/.docs/guides/migrations/upgrade-to-v1/tools.md +180 -0
  228. package/.docs/guides/migrations/upgrade-to-v1/tracing.md +412 -0
  229. package/.docs/guides/migrations/upgrade-to-v1/vectors.md +87 -0
  230. package/.docs/guides/migrations/upgrade-to-v1/voice.md +30 -0
  231. package/.docs/guides/migrations/upgrade-to-v1/workflows.md +341 -0
  232. package/.docs/guides/migrations/vnext-to-standard-apis.md +362 -0
  233. package/.docs/models/embeddings.md +161 -0
  234. package/.docs/models/gateways/azure-openai.md +128 -0
  235. package/.docs/models/gateways/custom-gateways.md +545 -0
  236. package/.docs/models/gateways/netlify.md +93 -0
  237. package/.docs/models/gateways/openrouter.md +222 -0
  238. package/.docs/models/gateways/vercel.md +235 -0
  239. package/.docs/models/gateways.md +14 -0
  240. package/.docs/models/index.md +286 -0
  241. package/.docs/models/providers/302ai.md +134 -0
  242. package/.docs/models/providers/abacus.md +125 -0
  243. package/.docs/models/providers/agentrouter.md +90 -0
  244. package/.docs/models/providers/aihubmix.md +113 -0
  245. package/.docs/models/providers/alibaba-cn.md +135 -0
  246. package/.docs/models/providers/alibaba.md +111 -0
  247. package/.docs/models/providers/amazon-bedrock.md +33 -0
  248. package/.docs/models/providers/anthropic.md +154 -0
  249. package/.docs/models/providers/azure.md +33 -0
  250. package/.docs/models/providers/bailing.md +72 -0
  251. package/.docs/models/providers/baseten.md +79 -0
  252. package/.docs/models/providers/berget.md +78 -0
  253. package/.docs/models/providers/cerebras.md +101 -0
  254. package/.docs/models/providers/chutes.md +137 -0
  255. package/.docs/models/providers/cloudferro-sherlock.md +74 -0
  256. package/.docs/models/providers/cloudflare-ai-gateway.md +33 -0
  257. package/.docs/models/providers/cloudflare-workers-ai.md +109 -0
  258. package/.docs/models/providers/cohere.md +33 -0
  259. package/.docs/models/providers/cortecs.md +91 -0
  260. package/.docs/models/providers/deepinfra.md +112 -0
  261. package/.docs/models/providers/deepseek.md +88 -0
  262. package/.docs/models/providers/evroc.md +83 -0
  263. package/.docs/models/providers/fastrouter.md +84 -0
  264. package/.docs/models/providers/fireworks-ai.md +83 -0
  265. package/.docs/models/providers/firmware.md +86 -0
  266. package/.docs/models/providers/friendli.md +77 -0
  267. package/.docs/models/providers/github-models.md +125 -0
  268. package/.docs/models/providers/google-vertex.md +33 -0
  269. package/.docs/models/providers/google.md +161 -0
  270. package/.docs/models/providers/groq.md +107 -0
  271. package/.docs/models/providers/helicone.md +161 -0
  272. package/.docs/models/providers/huggingface.md +90 -0
  273. package/.docs/models/providers/iflowcn.md +84 -0
  274. package/.docs/models/providers/inception.md +72 -0
  275. package/.docs/models/providers/inference.md +79 -0
  276. package/.docs/models/providers/io-intelligence.md +87 -0
  277. package/.docs/models/providers/io-net.md +87 -0
  278. package/.docs/models/providers/jiekou.md +131 -0
  279. package/.docs/models/providers/kilo.md +333 -0
  280. package/.docs/models/providers/kimi-for-coding.md +100 -0
  281. package/.docs/models/providers/kuae-cloud-coding-plan.md +71 -0
  282. package/.docs/models/providers/llama.md +77 -0
  283. package/.docs/models/providers/lmstudio.md +73 -0
  284. package/.docs/models/providers/lucidquery.md +72 -0
  285. package/.docs/models/providers/meganova.md +89 -0
  286. package/.docs/models/providers/minimax-cn-coding-plan.md +102 -0
  287. package/.docs/models/providers/minimax-cn.md +102 -0
  288. package/.docs/models/providers/minimax-coding-plan.md +102 -0
  289. package/.docs/models/providers/minimax.md +104 -0
  290. package/.docs/models/providers/mistral.md +124 -0
  291. package/.docs/models/providers/moark.md +72 -0
  292. package/.docs/models/providers/modelscope.md +77 -0
  293. package/.docs/models/providers/moonshotai-cn.md +76 -0
  294. package/.docs/models/providers/moonshotai.md +76 -0
  295. package/.docs/models/providers/morph.md +73 -0
  296. package/.docs/models/providers/nano-gpt.md +103 -0
  297. package/.docs/models/providers/nebius.md +116 -0
  298. package/.docs/models/providers/nova.md +72 -0
  299. package/.docs/models/providers/novita-ai.md +154 -0
  300. package/.docs/models/providers/nvidia.md +141 -0
  301. package/.docs/models/providers/ollama-cloud.md +103 -0
  302. package/.docs/models/providers/ollama.md +33 -0
  303. package/.docs/models/providers/openai.md +193 -0
  304. package/.docs/models/providers/opencode-go.md +73 -0
  305. package/.docs/models/providers/opencode.md +100 -0
  306. package/.docs/models/providers/ovhcloud.md +83 -0
  307. package/.docs/models/providers/perplexity-agent.md +113 -0
  308. package/.docs/models/providers/perplexity.md +101 -0
  309. package/.docs/models/providers/poe.md +184 -0
  310. package/.docs/models/providers/privatemode-ai.md +75 -0
  311. package/.docs/models/providers/qihang-ai.md +79 -0
  312. package/.docs/models/providers/qiniu-ai.md +146 -0
  313. package/.docs/models/providers/requesty.md +90 -0
  314. package/.docs/models/providers/scaleway.md +84 -0
  315. package/.docs/models/providers/siliconflow-cn.md +142 -0
  316. package/.docs/models/providers/siliconflow.md +140 -0
  317. package/.docs/models/providers/stackit.md +78 -0
  318. package/.docs/models/providers/stepfun.md +73 -0
  319. package/.docs/models/providers/submodel.md +79 -0
  320. package/.docs/models/providers/synthetic.md +96 -0
  321. package/.docs/models/providers/togetherai.md +116 -0
  322. package/.docs/models/providers/upstage.md +73 -0
  323. package/.docs/models/providers/venice.md +95 -0
  324. package/.docs/models/providers/vivgrid.md +106 -0
  325. package/.docs/models/providers/vultr.md +75 -0
  326. package/.docs/models/providers/wandb.md +80 -0
  327. package/.docs/models/providers/xai.md +141 -0
  328. package/.docs/models/providers/xiaomi.md +71 -0
  329. package/.docs/models/providers/zai-coding-plan.md +80 -0
  330. package/.docs/models/providers/zai.md +79 -0
  331. package/.docs/models/providers/zenmux.md +165 -0
  332. package/.docs/models/providers/zhipuai-coding-plan.md +79 -0
  333. package/.docs/models/providers/zhipuai.md +79 -0
  334. package/.docs/models/providers.md +88 -0
  335. package/.docs/reference/agents/agent.md +141 -0
  336. package/.docs/reference/agents/generate.md +186 -0
  337. package/.docs/reference/agents/generateLegacy.md +173 -0
  338. package/.docs/reference/agents/getDefaultGenerateOptions.md +36 -0
  339. package/.docs/reference/agents/getDefaultOptions.md +34 -0
  340. package/.docs/reference/agents/getDefaultStreamOptions.md +36 -0
  341. package/.docs/reference/agents/getDescription.md +21 -0
  342. package/.docs/reference/agents/getInstructions.md +34 -0
  343. package/.docs/reference/agents/getLLM.md +37 -0
  344. package/.docs/reference/agents/getMemory.md +34 -0
  345. package/.docs/reference/agents/getModel.md +34 -0
  346. package/.docs/reference/agents/getTools.md +29 -0
  347. package/.docs/reference/agents/getVoice.md +34 -0
  348. package/.docs/reference/agents/listAgents.md +35 -0
  349. package/.docs/reference/agents/listScorers.md +34 -0
  350. package/.docs/reference/agents/listTools.md +34 -0
  351. package/.docs/reference/agents/listWorkflows.md +34 -0
  352. package/.docs/reference/agents/network.md +170 -0
  353. package/.docs/reference/ai-sdk/chat-route.md +82 -0
  354. package/.docs/reference/ai-sdk/handle-chat-stream.md +53 -0
  355. package/.docs/reference/ai-sdk/handle-network-stream.md +37 -0
  356. package/.docs/reference/ai-sdk/handle-workflow-stream.md +55 -0
  357. package/.docs/reference/ai-sdk/network-route.md +74 -0
  358. package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +231 -0
  359. package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +79 -0
  360. package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +76 -0
  361. package/.docs/reference/ai-sdk/with-mastra.md +63 -0
  362. package/.docs/reference/ai-sdk/workflow-route.md +79 -0
  363. package/.docs/reference/auth/auth0.md +73 -0
  364. package/.docs/reference/auth/better-auth.md +71 -0
  365. package/.docs/reference/auth/clerk.md +36 -0
  366. package/.docs/reference/auth/firebase.md +80 -0
  367. package/.docs/reference/auth/jwt.md +26 -0
  368. package/.docs/reference/auth/supabase.md +33 -0
  369. package/.docs/reference/auth/workos.md +84 -0
  370. package/.docs/reference/cli/create-mastra.md +137 -0
  371. package/.docs/reference/cli/mastra.md +336 -0
  372. package/.docs/reference/client-js/agents.md +437 -0
  373. package/.docs/reference/client-js/error-handling.md +16 -0
  374. package/.docs/reference/client-js/logs.md +24 -0
  375. package/.docs/reference/client-js/mastra-client.md +63 -0
  376. package/.docs/reference/client-js/memory.md +221 -0
  377. package/.docs/reference/client-js/observability.md +72 -0
  378. package/.docs/reference/client-js/telemetry.md +20 -0
  379. package/.docs/reference/client-js/tools.md +44 -0
  380. package/.docs/reference/client-js/vectors.md +79 -0
  381. package/.docs/reference/client-js/workflows.md +199 -0
  382. package/.docs/reference/configuration.md +752 -0
  383. package/.docs/reference/core/addGateway.md +42 -0
  384. package/.docs/reference/core/getAgent.md +21 -0
  385. package/.docs/reference/core/getAgentById.md +21 -0
  386. package/.docs/reference/core/getDeployer.md +22 -0
  387. package/.docs/reference/core/getGateway.md +38 -0
  388. package/.docs/reference/core/getGatewayById.md +41 -0
  389. package/.docs/reference/core/getLogger.md +22 -0
  390. package/.docs/reference/core/getMCPServer.md +47 -0
  391. package/.docs/reference/core/getMCPServerById.md +55 -0
  392. package/.docs/reference/core/getMemory.md +50 -0
  393. package/.docs/reference/core/getScorer.md +54 -0
  394. package/.docs/reference/core/getScorerById.md +54 -0
  395. package/.docs/reference/core/getServer.md +22 -0
  396. package/.docs/reference/core/getStorage.md +22 -0
  397. package/.docs/reference/core/getStoredAgentById.md +89 -0
  398. package/.docs/reference/core/getTelemetry.md +22 -0
  399. package/.docs/reference/core/getVector.md +22 -0
  400. package/.docs/reference/core/getWorkflow.md +42 -0
  401. package/.docs/reference/core/listAgents.md +21 -0
  402. package/.docs/reference/core/listGateways.md +40 -0
  403. package/.docs/reference/core/listLogs.md +38 -0
  404. package/.docs/reference/core/listLogsByRunId.md +36 -0
  405. package/.docs/reference/core/listMCPServers.md +55 -0
  406. package/.docs/reference/core/listMemory.md +56 -0
  407. package/.docs/reference/core/listScorers.md +29 -0
  408. package/.docs/reference/core/listStoredAgents.md +93 -0
  409. package/.docs/reference/core/listVectors.md +22 -0
  410. package/.docs/reference/core/listWorkflows.md +21 -0
  411. package/.docs/reference/core/mastra-class.md +66 -0
  412. package/.docs/reference/core/mastra-model-gateway.md +153 -0
  413. package/.docs/reference/core/setLogger.md +26 -0
  414. package/.docs/reference/core/setStorage.md +27 -0
  415. package/.docs/reference/datasets/addItem.md +37 -0
  416. package/.docs/reference/datasets/addItems.md +35 -0
  417. package/.docs/reference/datasets/compareExperiments.md +52 -0
  418. package/.docs/reference/datasets/create.md +51 -0
  419. package/.docs/reference/datasets/dataset.md +82 -0
  420. package/.docs/reference/datasets/datasets-manager.md +94 -0
  421. package/.docs/reference/datasets/delete.md +25 -0
  422. package/.docs/reference/datasets/deleteExperiment.md +27 -0
  423. package/.docs/reference/datasets/deleteItem.md +27 -0
  424. package/.docs/reference/datasets/deleteItems.md +29 -0
  425. package/.docs/reference/datasets/get.md +31 -0
  426. package/.docs/reference/datasets/getDetails.md +47 -0
  427. package/.docs/reference/datasets/getExperiment.md +30 -0
  428. package/.docs/reference/datasets/getItem.md +33 -0
  429. package/.docs/reference/datasets/getItemHistory.md +31 -0
  430. package/.docs/reference/datasets/list.md +31 -0
  431. package/.docs/reference/datasets/listExperimentResults.md +39 -0
  432. package/.docs/reference/datasets/listExperiments.md +33 -0
  433. package/.docs/reference/datasets/listItems.md +46 -0
  434. package/.docs/reference/datasets/listVersions.md +33 -0
  435. package/.docs/reference/datasets/startExperiment.md +62 -0
  436. package/.docs/reference/datasets/startExperimentAsync.md +43 -0
  437. package/.docs/reference/datasets/update.md +48 -0
  438. package/.docs/reference/datasets/updateItem.md +38 -0
  439. package/.docs/reference/deployer/cloudflare.md +79 -0
  440. package/.docs/reference/deployer/netlify.md +80 -0
  441. package/.docs/reference/deployer/vercel.md +116 -0
  442. package/.docs/reference/deployer.md +100 -0
  443. package/.docs/reference/evals/answer-relevancy.md +105 -0
  444. package/.docs/reference/evals/answer-similarity.md +99 -0
  445. package/.docs/reference/evals/bias.md +120 -0
  446. package/.docs/reference/evals/completeness.md +136 -0
  447. package/.docs/reference/evals/content-similarity.md +101 -0
  448. package/.docs/reference/evals/context-precision.md +196 -0
  449. package/.docs/reference/evals/context-relevance.md +531 -0
  450. package/.docs/reference/evals/create-scorer.md +270 -0
  451. package/.docs/reference/evals/faithfulness.md +114 -0
  452. package/.docs/reference/evals/hallucination.md +213 -0
  453. package/.docs/reference/evals/keyword-coverage.md +128 -0
  454. package/.docs/reference/evals/mastra-scorer.md +123 -0
  455. package/.docs/reference/evals/noise-sensitivity.md +675 -0
  456. package/.docs/reference/evals/prompt-alignment.md +614 -0
  457. package/.docs/reference/evals/run-evals.md +179 -0
  458. package/.docs/reference/evals/scorer-utils.md +326 -0
  459. package/.docs/reference/evals/textual-difference.md +113 -0
  460. package/.docs/reference/evals/tone-consistency.md +119 -0
  461. package/.docs/reference/evals/tool-call-accuracy.md +533 -0
  462. package/.docs/reference/evals/toxicity.md +123 -0
  463. package/.docs/reference/harness/harness-class.md +760 -0
  464. package/.docs/reference/index.md +277 -0
  465. package/.docs/reference/logging/pino-logger.md +117 -0
  466. package/.docs/reference/memory/clone-utilities.md +199 -0
  467. package/.docs/reference/memory/cloneThread.md +142 -0
  468. package/.docs/reference/memory/createThread.md +68 -0
  469. package/.docs/reference/memory/deleteMessages.md +38 -0
  470. package/.docs/reference/memory/getThreadById.md +24 -0
  471. package/.docs/reference/memory/listThreads.md +145 -0
  472. package/.docs/reference/memory/memory-class.md +147 -0
  473. package/.docs/reference/memory/observational-memory.md +577 -0
  474. package/.docs/reference/memory/recall.md +91 -0
  475. package/.docs/reference/observability/tracing/bridges/otel.md +131 -0
  476. package/.docs/reference/observability/tracing/configuration.md +178 -0
  477. package/.docs/reference/observability/tracing/exporters/arize.md +141 -0
  478. package/.docs/reference/observability/tracing/exporters/braintrust.md +93 -0
  479. package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +163 -0
  480. package/.docs/reference/observability/tracing/exporters/console-exporter.md +138 -0
  481. package/.docs/reference/observability/tracing/exporters/datadog.md +116 -0
  482. package/.docs/reference/observability/tracing/exporters/default-exporter.md +174 -0
  483. package/.docs/reference/observability/tracing/exporters/laminar.md +78 -0
  484. package/.docs/reference/observability/tracing/exporters/langfuse.md +134 -0
  485. package/.docs/reference/observability/tracing/exporters/langsmith.md +108 -0
  486. package/.docs/reference/observability/tracing/exporters/otel.md +199 -0
  487. package/.docs/reference/observability/tracing/exporters/posthog.md +92 -0
  488. package/.docs/reference/observability/tracing/exporters/sentry.md +184 -0
  489. package/.docs/reference/observability/tracing/instances.md +107 -0
  490. package/.docs/reference/observability/tracing/interfaces.md +743 -0
  491. package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +144 -0
  492. package/.docs/reference/observability/tracing/spans.md +224 -0
  493. package/.docs/reference/processors/batch-parts-processor.md +61 -0
  494. package/.docs/reference/processors/language-detector.md +82 -0
  495. package/.docs/reference/processors/message-history-processor.md +85 -0
  496. package/.docs/reference/processors/moderation-processor.md +104 -0
  497. package/.docs/reference/processors/pii-detector.md +108 -0
  498. package/.docs/reference/processors/processor-interface.md +521 -0
  499. package/.docs/reference/processors/prompt-injection-detector.md +72 -0
  500. package/.docs/reference/processors/semantic-recall-processor.md +117 -0
  501. package/.docs/reference/processors/system-prompt-scrubber.md +80 -0
  502. package/.docs/reference/processors/token-limiter-processor.md +115 -0
  503. package/.docs/reference/processors/tool-call-filter.md +85 -0
  504. package/.docs/reference/processors/tool-search-processor.md +111 -0
  505. package/.docs/reference/processors/unicode-normalizer.md +62 -0
  506. package/.docs/reference/processors/working-memory-processor.md +152 -0
  507. package/.docs/reference/rag/chunk.md +221 -0
  508. package/.docs/reference/rag/database-config.md +261 -0
  509. package/.docs/reference/rag/document.md +114 -0
  510. package/.docs/reference/rag/embeddings.md +92 -0
  511. package/.docs/reference/rag/extract-params.md +168 -0
  512. package/.docs/reference/rag/graph-rag.md +111 -0
  513. package/.docs/reference/rag/metadata-filters.md +216 -0
  514. package/.docs/reference/rag/rerank.md +75 -0
  515. package/.docs/reference/rag/rerankWithScorer.md +80 -0
  516. package/.docs/reference/server/create-route.md +262 -0
  517. package/.docs/reference/server/express-adapter.md +176 -0
  518. package/.docs/reference/server/fastify-adapter.md +90 -0
  519. package/.docs/reference/server/hono-adapter.md +162 -0
  520. package/.docs/reference/server/koa-adapter.md +127 -0
  521. package/.docs/reference/server/mastra-server.md +298 -0
  522. package/.docs/reference/server/register-api-route.md +249 -0
  523. package/.docs/reference/server/routes.md +306 -0
  524. package/.docs/reference/storage/cloudflare-d1.md +218 -0
  525. package/.docs/reference/storage/cloudflare.md +88 -0
  526. package/.docs/reference/storage/composite.md +235 -0
  527. package/.docs/reference/storage/convex.md +161 -0
  528. package/.docs/reference/storage/dynamodb.md +282 -0
  529. package/.docs/reference/storage/lance.md +131 -0
  530. package/.docs/reference/storage/libsql.md +135 -0
  531. package/.docs/reference/storage/mongodb.md +262 -0
  532. package/.docs/reference/storage/mssql.md +157 -0
  533. package/.docs/reference/storage/overview.md +121 -0
  534. package/.docs/reference/storage/postgresql.md +526 -0
  535. package/.docs/reference/storage/upstash.md +160 -0
  536. package/.docs/reference/streaming/ChunkType.md +292 -0
  537. package/.docs/reference/streaming/agents/MastraModelOutput.md +182 -0
  538. package/.docs/reference/streaming/agents/stream.md +255 -0
  539. package/.docs/reference/streaming/agents/streamLegacy.md +142 -0
  540. package/.docs/reference/streaming/workflows/observeStream.md +42 -0
  541. package/.docs/reference/streaming/workflows/resumeStream.md +61 -0
  542. package/.docs/reference/streaming/workflows/stream.md +88 -0
  543. package/.docs/reference/streaming/workflows/timeTravelStream.md +142 -0
  544. package/.docs/reference/templates/overview.md +194 -0
  545. package/.docs/reference/tools/create-tool.md +285 -0
  546. package/.docs/reference/tools/document-chunker-tool.md +89 -0
  547. package/.docs/reference/tools/graph-rag-tool.md +182 -0
  548. package/.docs/reference/tools/mcp-client.md +965 -0
  549. package/.docs/reference/tools/mcp-server.md +1271 -0
  550. package/.docs/reference/tools/vector-query-tool.md +459 -0
  551. package/.docs/reference/vectors/astra.md +121 -0
  552. package/.docs/reference/vectors/chroma.md +264 -0
  553. package/.docs/reference/vectors/convex.md +300 -0
  554. package/.docs/reference/vectors/couchbase.md +226 -0
  555. package/.docs/reference/vectors/duckdb.md +318 -0
  556. package/.docs/reference/vectors/elasticsearch.md +189 -0
  557. package/.docs/reference/vectors/lance.md +220 -0
  558. package/.docs/reference/vectors/libsql.md +305 -0
  559. package/.docs/reference/vectors/mongodb.md +295 -0
  560. package/.docs/reference/vectors/opensearch.md +99 -0
  561. package/.docs/reference/vectors/pg.md +408 -0
  562. package/.docs/reference/vectors/pinecone.md +168 -0
  563. package/.docs/reference/vectors/qdrant.md +222 -0
  564. package/.docs/reference/vectors/s3vectors.md +277 -0
  565. package/.docs/reference/vectors/turbopuffer.md +157 -0
  566. package/.docs/reference/vectors/upstash.md +294 -0
  567. package/.docs/reference/vectors/vectorize.md +147 -0
  568. package/.docs/reference/voice/azure.md +148 -0
  569. package/.docs/reference/voice/cloudflare.md +83 -0
  570. package/.docs/reference/voice/composite-voice.md +121 -0
  571. package/.docs/reference/voice/deepgram.md +79 -0
  572. package/.docs/reference/voice/elevenlabs.md +98 -0
  573. package/.docs/reference/voice/google-gemini-live.md +378 -0
  574. package/.docs/reference/voice/google.md +228 -0
  575. package/.docs/reference/voice/mastra-voice.md +311 -0
  576. package/.docs/reference/voice/murf.md +122 -0
  577. package/.docs/reference/voice/openai-realtime.md +203 -0
  578. package/.docs/reference/voice/openai.md +88 -0
  579. package/.docs/reference/voice/playai.md +80 -0
  580. package/.docs/reference/voice/sarvam.md +126 -0
  581. package/.docs/reference/voice/speechify.md +75 -0
  582. package/.docs/reference/voice/voice.addInstructions.md +55 -0
  583. package/.docs/reference/voice/voice.addTools.md +67 -0
  584. package/.docs/reference/voice/voice.answer.md +54 -0
  585. package/.docs/reference/voice/voice.close.md +51 -0
  586. package/.docs/reference/voice/voice.connect.md +94 -0
  587. package/.docs/reference/voice/voice.events.md +37 -0
  588. package/.docs/reference/voice/voice.getSpeakers.md +129 -0
  589. package/.docs/reference/voice/voice.listen.md +164 -0
  590. package/.docs/reference/voice/voice.off.md +54 -0
  591. package/.docs/reference/voice/voice.on.md +111 -0
  592. package/.docs/reference/voice/voice.send.md +65 -0
  593. package/.docs/reference/voice/voice.speak.md +157 -0
  594. package/.docs/reference/voice/voice.updateConfig.md +60 -0
  595. package/.docs/reference/workflows/run-methods/cancel.md +86 -0
  596. package/.docs/reference/workflows/run-methods/restart.md +33 -0
  597. package/.docs/reference/workflows/run-methods/resume.md +59 -0
  598. package/.docs/reference/workflows/run-methods/start.md +58 -0
  599. package/.docs/reference/workflows/run-methods/startAsync.md +67 -0
  600. package/.docs/reference/workflows/run-methods/timeTravel.md +142 -0
  601. package/.docs/reference/workflows/run.md +59 -0
  602. package/.docs/reference/workflows/step.md +119 -0
  603. package/.docs/reference/workflows/workflow-methods/branch.md +25 -0
  604. package/.docs/reference/workflows/workflow-methods/commit.md +17 -0
  605. package/.docs/reference/workflows/workflow-methods/create-run.md +63 -0
  606. package/.docs/reference/workflows/workflow-methods/dountil.md +25 -0
  607. package/.docs/reference/workflows/workflow-methods/dowhile.md +25 -0
  608. package/.docs/reference/workflows/workflow-methods/foreach.md +118 -0
  609. package/.docs/reference/workflows/workflow-methods/map.md +93 -0
  610. package/.docs/reference/workflows/workflow-methods/parallel.md +21 -0
  611. package/.docs/reference/workflows/workflow-methods/sleep.md +35 -0
  612. package/.docs/reference/workflows/workflow-methods/sleepUntil.md +35 -0
  613. package/.docs/reference/workflows/workflow-methods/then.md +21 -0
  614. package/.docs/reference/workflows/workflow.md +157 -0
  615. package/.docs/reference/workspace/daytona-sandbox.md +580 -0
  616. package/.docs/reference/workspace/e2b-sandbox.md +289 -0
  617. package/.docs/reference/workspace/filesystem.md +255 -0
  618. package/.docs/reference/workspace/gcs-filesystem.md +174 -0
  619. package/.docs/reference/workspace/local-filesystem.md +343 -0
  620. package/.docs/reference/workspace/local-sandbox.md +301 -0
  621. package/.docs/reference/workspace/s3-filesystem.md +177 -0
  622. package/.docs/reference/workspace/sandbox.md +87 -0
  623. package/.docs/reference/workspace/workspace-class.md +244 -0
  624. package/CHANGELOG.md +659 -4
  625. package/LICENSE.md +15 -0
  626. package/README.md +63 -125
  627. package/dist/index.d.ts.map +1 -1
  628. package/dist/logger.d.ts +3 -0
  629. package/dist/logger.d.ts.map +1 -1
  630. package/dist/prompts/migration.d.ts +6 -0
  631. package/dist/prompts/migration.d.ts.map +1 -0
  632. package/dist/stdio.js +1253 -293
  633. package/dist/stdio.js.map +1 -0
  634. package/dist/tools/course.d.ts.map +1 -1
  635. package/dist/tools/docs.d.ts.map +1 -1
  636. package/dist/tools/embedded-docs.d.ts +276 -0
  637. package/dist/tools/embedded-docs.d.ts.map +1 -0
  638. package/dist/tools/migration.d.ts +40 -0
  639. package/dist/tools/migration.d.ts.map +1 -0
  640. package/dist/utils.d.ts +0 -54
  641. package/dist/utils.d.ts.map +1 -1
  642. package/package.json +22 -21
  643. package/.docs/organized/changelogs/%40internal%2Fchangeset-cli.md +0 -9
  644. package/.docs/organized/changelogs/%40internal%2Fplayground.md +0 -3
  645. package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +0 -302
  646. package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +0 -49
  647. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +0 -302
  648. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +0 -302
  649. package/.docs/organized/changelogs/%40mastra%2Fastra.md +0 -302
  650. package/.docs/organized/changelogs/%40mastra%2Fauth.md +0 -31
  651. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +0 -302
  652. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +0 -302
  653. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +0 -302
  654. package/.docs/organized/changelogs/%40mastra%2Fcloud.md +0 -302
  655. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +0 -302
  656. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +0 -302
  657. package/.docs/organized/changelogs/%40mastra%2Fcore.md +0 -302
  658. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +0 -302
  659. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +0 -302
  660. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +0 -302
  661. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +0 -302
  662. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +0 -302
  663. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +0 -302
  664. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +0 -302
  665. package/.docs/organized/changelogs/%40mastra%2Fevals.md +0 -302
  666. package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +0 -87
  667. package/.docs/organized/changelogs/%40mastra%2Flance.md +0 -302
  668. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +0 -302
  669. package/.docs/organized/changelogs/%40mastra%2Floggers.md +0 -302
  670. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +0 -302
  671. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +0 -302
  672. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +0 -302
  673. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +0 -302
  674. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +0 -302
  675. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +0 -302
  676. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +0 -302
  677. package/.docs/organized/changelogs/%40mastra%2Fpg.md +0 -302
  678. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +0 -302
  679. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +0 -302
  680. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +0 -302
  681. package/.docs/organized/changelogs/%40mastra%2Frag.md +0 -302
  682. package/.docs/organized/changelogs/%40mastra%2Freact.md +0 -247
  683. package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +0 -149
  684. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +0 -195
  685. package/.docs/organized/changelogs/%40mastra%2Fserver.md +0 -302
  686. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +0 -302
  687. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +0 -302
  688. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +0 -302
  689. package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +0 -302
  690. package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +0 -302
  691. package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +0 -302
  692. package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +0 -302
  693. package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +0 -302
  694. package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +0 -265
  695. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +0 -302
  696. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +0 -302
  697. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +0 -302
  698. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +0 -302
  699. package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +0 -302
  700. package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +0 -302
  701. package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +0 -302
  702. package/.docs/organized/changelogs/create-mastra.md +0 -302
  703. package/.docs/organized/changelogs/mastra.md +0 -302
  704. package/.docs/organized/code-examples/a2a.md +0 -208
  705. package/.docs/organized/code-examples/agent.md +0 -1333
  706. package/.docs/organized/code-examples/agui.md +0 -173
  707. package/.docs/organized/code-examples/ai-elements.md +0 -47
  708. package/.docs/organized/code-examples/ai-sdk-useChat.md +0 -369
  709. package/.docs/organized/code-examples/ai-sdk-v5.md +0 -203
  710. package/.docs/organized/code-examples/assistant-ui.md +0 -28
  711. package/.docs/organized/code-examples/bird-checker-with-express.md +0 -223
  712. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +0 -347
  713. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +0 -241
  714. package/.docs/organized/code-examples/client-side-tools.md +0 -59
  715. package/.docs/organized/code-examples/crypto-chatbot.md +0 -87
  716. package/.docs/organized/code-examples/experimental-auth-weather-agent.md +0 -564
  717. package/.docs/organized/code-examples/fireworks-r1.md +0 -148
  718. package/.docs/organized/code-examples/heads-up-game.md +0 -252
  719. package/.docs/organized/code-examples/mcp-configuration.md +0 -556
  720. package/.docs/organized/code-examples/mcp-registry-registry.md +0 -50
  721. package/.docs/organized/code-examples/memory-per-resource-example.md +0 -222
  722. package/.docs/organized/code-examples/memory-todo-agent.md +0 -152
  723. package/.docs/organized/code-examples/memory-with-context.md +0 -155
  724. package/.docs/organized/code-examples/memory-with-libsql.md +0 -190
  725. package/.docs/organized/code-examples/memory-with-pg.md +0 -211
  726. package/.docs/organized/code-examples/memory-with-processors.md +0 -594
  727. package/.docs/organized/code-examples/memory-with-upstash.md +0 -254
  728. package/.docs/organized/code-examples/openapi-spec-writer.md +0 -567
  729. package/.docs/organized/code-examples/quick-start.md +0 -156
  730. package/.docs/organized/code-examples/stock-price-tool.md +0 -111
  731. package/.docs/organized/code-examples/weather-agent.md +0 -576
  732. package/.docs/organized/code-examples/workflow-ai-recruiter.md +0 -147
  733. package/.docs/organized/code-examples/workflow-with-inline-steps.md +0 -99
  734. package/.docs/organized/code-examples/workflow-with-memory.md +0 -381
  735. package/.docs/organized/code-examples/workflow-with-separate-steps.md +0 -160
  736. package/.docs/organized/code-examples/workflow-with-suspend-resume.md +0 -182
  737. package/.docs/raw/agents/adding-voice.mdx +0 -290
  738. package/.docs/raw/agents/agent-memory.mdx +0 -158
  739. package/.docs/raw/agents/guardrails.mdx +0 -342
  740. package/.docs/raw/agents/networks.mdx +0 -235
  741. package/.docs/raw/agents/overview.mdx +0 -425
  742. package/.docs/raw/agents/using-tools.mdx +0 -95
  743. package/.docs/raw/auth/auth0.mdx +0 -235
  744. package/.docs/raw/auth/clerk.mdx +0 -142
  745. package/.docs/raw/auth/firebase.mdx +0 -285
  746. package/.docs/raw/auth/index.mdx +0 -19
  747. package/.docs/raw/auth/jwt.mdx +0 -101
  748. package/.docs/raw/auth/supabase.mdx +0 -128
  749. package/.docs/raw/auth/workos.mdx +0 -198
  750. package/.docs/raw/community/contributing-templates.mdx +0 -193
  751. package/.docs/raw/community/discord.mdx +0 -12
  752. package/.docs/raw/community/licensing.mdx +0 -71
  753. package/.docs/raw/course/01-first-agent/04-project-structure.md +0 -17
  754. package/.docs/raw/course/01-first-agent/05-running-playground.md +0 -19
  755. package/.docs/raw/course/01-first-agent/07-creating-your-agent.md +0 -51
  756. package/.docs/raw/course/01-first-agent/08-exporting-your-agent.md +0 -33
  757. package/.docs/raw/course/01-first-agent/09-testing-your-agent.md +0 -12
  758. package/.docs/raw/course/01-first-agent/11-creating-transactions-tool.md +0 -41
  759. package/.docs/raw/course/01-first-agent/12-connecting-tool-to-agent.md +0 -29
  760. package/.docs/raw/course/01-first-agent/13-testing-your-tool.md +0 -15
  761. package/.docs/raw/course/01-first-agent/15-installing-memory.md +0 -13
  762. package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +0 -33
  763. package/.docs/raw/course/01-first-agent/17-testing-memory.md +0 -15
  764. package/.docs/raw/course/02-agent-tools-mcp/03-setting-up-mcp-configuration.md +0 -21
  765. package/.docs/raw/course/02-agent-tools-mcp/04-initializing-mcp-tools.md +0 -11
  766. package/.docs/raw/course/02-agent-tools-mcp/05-updating-your-agent.md +0 -20
  767. package/.docs/raw/course/02-agent-tools-mcp/07-what-is-zapier-mcp.md +0 -14
  768. package/.docs/raw/course/02-agent-tools-mcp/08-getting-zapier-mcp-url.md +0 -16
  769. package/.docs/raw/course/02-agent-tools-mcp/09-updating-mcp-config-zapier.md +0 -17
  770. package/.docs/raw/course/02-agent-tools-mcp/10-updating-agent-instructions-zapier.md +0 -29
  771. package/.docs/raw/course/02-agent-tools-mcp/12-troubleshooting-zapier.md +0 -17
  772. package/.docs/raw/course/02-agent-tools-mcp/13-what-is-github-mcp.md +0 -14
  773. package/.docs/raw/course/02-agent-tools-mcp/14-getting-github-mcp-url.md +0 -35
  774. package/.docs/raw/course/02-agent-tools-mcp/15-updating-mcp-config-github.md +0 -20
  775. package/.docs/raw/course/02-agent-tools-mcp/16-updating-agent-instructions-github.md +0 -33
  776. package/.docs/raw/course/02-agent-tools-mcp/18-troubleshooting-github.md +0 -17
  777. package/.docs/raw/course/02-agent-tools-mcp/20-updating-mcp-config-hackernews.md +0 -26
  778. package/.docs/raw/course/02-agent-tools-mcp/21-updating-agent-instructions-hackernews.md +0 -38
  779. package/.docs/raw/course/02-agent-tools-mcp/26-updating-mcp-config-filesystem.md +0 -33
  780. package/.docs/raw/course/02-agent-tools-mcp/27-updating-agent-instructions-filesystem.md +0 -45
  781. package/.docs/raw/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +0 -76
  782. package/.docs/raw/course/02-agent-tools-mcp/32-conclusion.md +0 -17
  783. package/.docs/raw/course/03-agent-memory/03-installing-memory.md +0 -13
  784. package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +0 -36
  785. package/.docs/raw/course/03-agent-memory/05-updating-mastra-export.md +0 -18
  786. package/.docs/raw/course/03-agent-memory/07-understanding-memory-threads.md +0 -14
  787. package/.docs/raw/course/03-agent-memory/08-configuring-conversation-history.md +0 -37
  788. package/.docs/raw/course/03-agent-memory/09-using-memory-in-application.md +0 -19
  789. package/.docs/raw/course/03-agent-memory/10-storage-configuration.md +0 -30
  790. package/.docs/raw/course/03-agent-memory/12-handling-memory-frontend.md +0 -62
  791. package/.docs/raw/course/03-agent-memory/13-vector-store-configuration.md +0 -27
  792. package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +0 -41
  793. package/.docs/raw/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +0 -28
  794. package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +0 -63
  795. package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +0 -89
  796. package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +0 -80
  797. package/.docs/raw/course/03-agent-memory/26-updating-mastra-export-comprehensive.md +0 -32
  798. package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +0 -103
  799. package/.docs/raw/course/04-workflows/01-introduction-to-workflows.md +0 -44
  800. package/.docs/raw/course/04-workflows/02-understanding-steps.md +0 -53
  801. package/.docs/raw/course/04-workflows/03-creating-your-first-step.md +0 -57
  802. package/.docs/raw/course/04-workflows/04-creating-a-second-step.md +0 -58
  803. package/.docs/raw/course/04-workflows/05-chaining-steps-together.md +0 -57
  804. package/.docs/raw/course/04-workflows/06-registering-with-mastra.md +0 -24
  805. package/.docs/raw/course/04-workflows/07-using-playground.md +0 -58
  806. package/.docs/raw/course/04-workflows/08-running-workflows-programmatically.md +0 -77
  807. package/.docs/raw/course/04-workflows/09-adding-a-third-step.md +0 -70
  808. package/.docs/raw/course/04-workflows/10-updating-the-workflow.md +0 -55
  809. package/.docs/raw/course/04-workflows/11-creating-an-ai-agent.md +0 -67
  810. package/.docs/raw/course/04-workflows/12-using-agent-in-workflow.md +0 -91
  811. package/.docs/raw/course/04-workflows/13-creating-ai-enhanced-workflow.md +0 -75
  812. package/.docs/raw/course/04-workflows/14-understanding-parallel-execution.md +0 -38
  813. package/.docs/raw/course/04-workflows/15-creating-parallel-steps.md +0 -115
  814. package/.docs/raw/course/04-workflows/16-building-parallel-workflow.md +0 -100
  815. package/.docs/raw/course/04-workflows/17-testing-parallel-performance.md +0 -40
  816. package/.docs/raw/course/04-workflows/18-understanding-conditional-branching.md +0 -61
  817. package/.docs/raw/course/04-workflows/19-creating-conditional-steps.md +0 -128
  818. package/.docs/raw/course/04-workflows/20-building-conditional-workflow.md +0 -60
  819. package/.docs/raw/course/04-workflows/21-testing-conditional-logic.md +0 -58
  820. package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +0 -115
  821. package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +0 -273
  822. package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +0 -137
  823. package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +0 -206
  824. package/.docs/raw/deployment/cloud-providers/index.mdx +0 -52
  825. package/.docs/raw/deployment/monorepo.mdx +0 -107
  826. package/.docs/raw/deployment/overview.mdx +0 -82
  827. package/.docs/raw/deployment/server-deployment.mdx +0 -86
  828. package/.docs/raw/deployment/serverless-platforms/cloudflare-deployer.mdx +0 -87
  829. package/.docs/raw/deployment/serverless-platforms/index.mdx +0 -52
  830. package/.docs/raw/deployment/serverless-platforms/netlify-deployer.mdx +0 -94
  831. package/.docs/raw/deployment/serverless-platforms/vercel-deployer.mdx +0 -109
  832. package/.docs/raw/deployment/web-framework.mdx +0 -63
  833. package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +0 -675
  834. package/.docs/raw/frameworks/agentic-uis/assistant-ui.mdx +0 -125
  835. package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +0 -108
  836. package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +0 -341
  837. package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +0 -165
  838. package/.docs/raw/frameworks/servers/express.mdx +0 -208
  839. package/.docs/raw/frameworks/web-frameworks/astro.mdx +0 -519
  840. package/.docs/raw/frameworks/web-frameworks/next-js.mdx +0 -336
  841. package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +0 -461
  842. package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +0 -242
  843. package/.docs/raw/getting-started/installation.mdx +0 -316
  844. package/.docs/raw/getting-started/mcp-docs-server.mdx +0 -183
  845. package/.docs/raw/getting-started/project-structure.mdx +0 -72
  846. package/.docs/raw/getting-started/templates.mdx +0 -70
  847. package/.docs/raw/index.mdx +0 -58
  848. package/.docs/raw/mastra-cloud/dashboard.mdx +0 -100
  849. package/.docs/raw/mastra-cloud/observability.mdx +0 -52
  850. package/.docs/raw/mastra-cloud/overview.mdx +0 -71
  851. package/.docs/raw/mastra-cloud/setting-up.mdx +0 -92
  852. package/.docs/raw/memory/conversation-history.mdx +0 -23
  853. package/.docs/raw/memory/memory-processors.mdx +0 -136
  854. package/.docs/raw/memory/overview.mdx +0 -119
  855. package/.docs/raw/memory/semantic-recall.mdx +0 -226
  856. package/.docs/raw/memory/threads-and-resources.mdx +0 -94
  857. package/.docs/raw/memory/working-memory.mdx +0 -378
  858. package/.docs/raw/observability/ai-tracing/exporters/braintrust.mdx +0 -81
  859. package/.docs/raw/observability/ai-tracing/exporters/cloud.mdx +0 -120
  860. package/.docs/raw/observability/ai-tracing/exporters/default.mdx +0 -168
  861. package/.docs/raw/observability/ai-tracing/exporters/langfuse.mdx +0 -121
  862. package/.docs/raw/observability/ai-tracing/exporters/langsmith.mdx +0 -88
  863. package/.docs/raw/observability/ai-tracing/exporters/otel.mdx +0 -253
  864. package/.docs/raw/observability/ai-tracing/overview.mdx +0 -565
  865. package/.docs/raw/observability/ai-tracing/processors/sensitive-data-filter.mdx +0 -274
  866. package/.docs/raw/observability/logging.mdx +0 -113
  867. package/.docs/raw/observability/nextjs-tracing.mdx +0 -109
  868. package/.docs/raw/observability/otel-tracing.mdx +0 -190
  869. package/.docs/raw/observability/overview.mdx +0 -66
  870. package/.docs/raw/rag/chunking-and-embedding.mdx +0 -208
  871. package/.docs/raw/rag/overview.mdx +0 -87
  872. package/.docs/raw/rag/retrieval.mdx +0 -543
  873. package/.docs/raw/rag/vector-databases.mdx +0 -529
  874. package/.docs/raw/reference/agents/agent.mdx +0 -230
  875. package/.docs/raw/reference/agents/generate.mdx +0 -577
  876. package/.docs/raw/reference/agents/generateLegacy.mdx +0 -528
  877. package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +0 -67
  878. package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +0 -67
  879. package/.docs/raw/reference/agents/getDescription.mdx +0 -34
  880. package/.docs/raw/reference/agents/getInstructions.mdx +0 -67
  881. package/.docs/raw/reference/agents/getLLM.mdx +0 -74
  882. package/.docs/raw/reference/agents/getMemory.mdx +0 -67
  883. package/.docs/raw/reference/agents/getModel.mdx +0 -67
  884. package/.docs/raw/reference/agents/getScorers.mdx +0 -67
  885. package/.docs/raw/reference/agents/getTools.mdx +0 -67
  886. package/.docs/raw/reference/agents/getVoice.mdx +0 -67
  887. package/.docs/raw/reference/agents/getWorkflows.mdx +0 -67
  888. package/.docs/raw/reference/agents/listAgents.mdx +0 -68
  889. package/.docs/raw/reference/agents/network.mdx +0 -290
  890. package/.docs/raw/reference/auth/auth0.mdx +0 -117
  891. package/.docs/raw/reference/auth/clerk.mdx +0 -71
  892. package/.docs/raw/reference/auth/firebase.mdx +0 -128
  893. package/.docs/raw/reference/auth/jwt.mdx +0 -41
  894. package/.docs/raw/reference/auth/supabase.mdx +0 -62
  895. package/.docs/raw/reference/auth/workos.mdx +0 -128
  896. package/.docs/raw/reference/cli/create-mastra.mdx +0 -177
  897. package/.docs/raw/reference/cli/mastra.mdx +0 -258
  898. package/.docs/raw/reference/client-js/agents.mdx +0 -220
  899. package/.docs/raw/reference/client-js/error-handling.mdx +0 -23
  900. package/.docs/raw/reference/client-js/logs.mdx +0 -29
  901. package/.docs/raw/reference/client-js/mastra-client.mdx +0 -157
  902. package/.docs/raw/reference/client-js/memory.mdx +0 -130
  903. package/.docs/raw/reference/client-js/observability.mdx +0 -76
  904. package/.docs/raw/reference/client-js/telemetry.mdx +0 -25
  905. package/.docs/raw/reference/client-js/tools.mdx +0 -49
  906. package/.docs/raw/reference/client-js/vectors.mdx +0 -84
  907. package/.docs/raw/reference/client-js/workflows-legacy.mdx +0 -143
  908. package/.docs/raw/reference/client-js/workflows.mdx +0 -175
  909. package/.docs/raw/reference/core/getAgent.mdx +0 -43
  910. package/.docs/raw/reference/core/getAgentById.mdx +0 -43
  911. package/.docs/raw/reference/core/getAgents.mdx +0 -35
  912. package/.docs/raw/reference/core/getDeployer.mdx +0 -35
  913. package/.docs/raw/reference/core/getLogger.mdx +0 -35
  914. package/.docs/raw/reference/core/getLogs.mdx +0 -92
  915. package/.docs/raw/reference/core/getLogsByRunId.mdx +0 -84
  916. package/.docs/raw/reference/core/getMCPServer.mdx +0 -49
  917. package/.docs/raw/reference/core/getMCPServers.mdx +0 -35
  918. package/.docs/raw/reference/core/getMemory.mdx +0 -35
  919. package/.docs/raw/reference/core/getScorer.mdx +0 -75
  920. package/.docs/raw/reference/core/getScorerByName.mdx +0 -75
  921. package/.docs/raw/reference/core/getScorers.mdx +0 -42
  922. package/.docs/raw/reference/core/getServer.mdx +0 -35
  923. package/.docs/raw/reference/core/getStorage.mdx +0 -35
  924. package/.docs/raw/reference/core/getTelemetry.mdx +0 -35
  925. package/.docs/raw/reference/core/getVector.mdx +0 -43
  926. package/.docs/raw/reference/core/getVectors.mdx +0 -35
  927. package/.docs/raw/reference/core/getWorkflow.mdx +0 -48
  928. package/.docs/raw/reference/core/getWorkflows.mdx +0 -43
  929. package/.docs/raw/reference/core/mastra-class.mdx +0 -143
  930. package/.docs/raw/reference/core/setLogger.mdx +0 -47
  931. package/.docs/raw/reference/core/setStorage.mdx +0 -39
  932. package/.docs/raw/reference/core/setTelemetry.mdx +0 -35
  933. package/.docs/raw/reference/deployer/cloudflare.mdx +0 -91
  934. package/.docs/raw/reference/deployer/deployer.mdx +0 -165
  935. package/.docs/raw/reference/deployer/netlify.mdx +0 -20
  936. package/.docs/raw/reference/deployer/vercel.mdx +0 -46
  937. package/.docs/raw/reference/evals/answer-relevancy.mdx +0 -190
  938. package/.docs/raw/reference/evals/bias.mdx +0 -195
  939. package/.docs/raw/reference/evals/completeness.mdx +0 -184
  940. package/.docs/raw/reference/evals/content-similarity.mdx +0 -185
  941. package/.docs/raw/reference/evals/context-position.mdx +0 -198
  942. package/.docs/raw/reference/evals/context-precision.mdx +0 -196
  943. package/.docs/raw/reference/evals/context-relevancy.mdx +0 -197
  944. package/.docs/raw/reference/evals/contextual-recall.mdx +0 -197
  945. package/.docs/raw/reference/evals/faithfulness.mdx +0 -200
  946. package/.docs/raw/reference/evals/hallucination.mdx +0 -227
  947. package/.docs/raw/reference/evals/keyword-coverage.mdx +0 -186
  948. package/.docs/raw/reference/evals/prompt-alignment.mdx +0 -248
  949. package/.docs/raw/reference/evals/summarization.mdx +0 -214
  950. package/.docs/raw/reference/evals/textual-difference.mdx +0 -172
  951. package/.docs/raw/reference/evals/tone-consistency.mdx +0 -190
  952. package/.docs/raw/reference/evals/toxicity.mdx +0 -173
  953. package/.docs/raw/reference/index.mdx +0 -12
  954. package/.docs/raw/reference/legacyWorkflows/after.mdx +0 -89
  955. package/.docs/raw/reference/legacyWorkflows/afterEvent.mdx +0 -79
  956. package/.docs/raw/reference/legacyWorkflows/commit.mdx +0 -33
  957. package/.docs/raw/reference/legacyWorkflows/createRun.mdx +0 -76
  958. package/.docs/raw/reference/legacyWorkflows/else.mdx +0 -68
  959. package/.docs/raw/reference/legacyWorkflows/events.mdx +0 -305
  960. package/.docs/raw/reference/legacyWorkflows/execute.mdx +0 -110
  961. package/.docs/raw/reference/legacyWorkflows/if.mdx +0 -108
  962. package/.docs/raw/reference/legacyWorkflows/resume.mdx +0 -158
  963. package/.docs/raw/reference/legacyWorkflows/resumeWithEvent.mdx +0 -133
  964. package/.docs/raw/reference/legacyWorkflows/snapshots.mdx +0 -207
  965. package/.docs/raw/reference/legacyWorkflows/start.mdx +0 -87
  966. package/.docs/raw/reference/legacyWorkflows/step-class.mdx +0 -100
  967. package/.docs/raw/reference/legacyWorkflows/step-condition.mdx +0 -137
  968. package/.docs/raw/reference/legacyWorkflows/step-function.mdx +0 -93
  969. package/.docs/raw/reference/legacyWorkflows/step-options.mdx +0 -69
  970. package/.docs/raw/reference/legacyWorkflows/step-retries.mdx +0 -196
  971. package/.docs/raw/reference/legacyWorkflows/suspend.mdx +0 -70
  972. package/.docs/raw/reference/legacyWorkflows/then.mdx +0 -72
  973. package/.docs/raw/reference/legacyWorkflows/until.mdx +0 -168
  974. package/.docs/raw/reference/legacyWorkflows/watch.mdx +0 -124
  975. package/.docs/raw/reference/legacyWorkflows/while.mdx +0 -168
  976. package/.docs/raw/reference/legacyWorkflows/workflow.mdx +0 -234
  977. package/.docs/raw/reference/memory/Memory.mdx +0 -206
  978. package/.docs/raw/reference/memory/createThread.mdx +0 -119
  979. package/.docs/raw/reference/memory/deleteMessages.mdx +0 -60
  980. package/.docs/raw/reference/memory/getThreadById.mdx +0 -46
  981. package/.docs/raw/reference/memory/getThreadsByResourceId.mdx +0 -78
  982. package/.docs/raw/reference/memory/getThreadsByResourceIdPaginated.mdx +0 -109
  983. package/.docs/raw/reference/memory/query.mdx +0 -174
  984. package/.docs/raw/reference/observability/ai-tracing/ai-tracing.mdx +0 -182
  985. package/.docs/raw/reference/observability/ai-tracing/configuration.mdx +0 -234
  986. package/.docs/raw/reference/observability/ai-tracing/exporters/braintrust.mdx +0 -112
  987. package/.docs/raw/reference/observability/ai-tracing/exporters/cloud-exporter.mdx +0 -176
  988. package/.docs/raw/reference/observability/ai-tracing/exporters/console-exporter.mdx +0 -148
  989. package/.docs/raw/reference/observability/ai-tracing/exporters/default-exporter.mdx +0 -196
  990. package/.docs/raw/reference/observability/ai-tracing/exporters/langfuse.mdx +0 -116
  991. package/.docs/raw/reference/observability/ai-tracing/exporters/langsmith.mdx +0 -112
  992. package/.docs/raw/reference/observability/ai-tracing/exporters/otel.mdx +0 -361
  993. package/.docs/raw/reference/observability/ai-tracing/interfaces.mdx +0 -651
  994. package/.docs/raw/reference/observability/ai-tracing/processors/sensitive-data-filter.mdx +0 -178
  995. package/.docs/raw/reference/observability/ai-tracing/span.mdx +0 -371
  996. package/.docs/raw/reference/observability/logging/pino-logger.mdx +0 -148
  997. package/.docs/raw/reference/observability/otel-tracing/otel-config.mdx +0 -117
  998. package/.docs/raw/reference/observability/otel-tracing/providers/arize-ax.mdx +0 -81
  999. package/.docs/raw/reference/observability/otel-tracing/providers/arize-phoenix.mdx +0 -120
  1000. package/.docs/raw/reference/observability/otel-tracing/providers/braintrust.mdx +0 -40
  1001. package/.docs/raw/reference/observability/otel-tracing/providers/dash0.mdx +0 -40
  1002. package/.docs/raw/reference/observability/otel-tracing/providers/index.mdx +0 -22
  1003. package/.docs/raw/reference/observability/otel-tracing/providers/keywordsai.mdx +0 -73
  1004. package/.docs/raw/reference/observability/otel-tracing/providers/laminar.mdx +0 -41
  1005. package/.docs/raw/reference/observability/otel-tracing/providers/langfuse.mdx +0 -84
  1006. package/.docs/raw/reference/observability/otel-tracing/providers/langsmith.mdx +0 -48
  1007. package/.docs/raw/reference/observability/otel-tracing/providers/langwatch.mdx +0 -43
  1008. package/.docs/raw/reference/observability/otel-tracing/providers/new-relic.mdx +0 -40
  1009. package/.docs/raw/reference/observability/otel-tracing/providers/signoz.mdx +0 -40
  1010. package/.docs/raw/reference/observability/otel-tracing/providers/traceloop.mdx +0 -40
  1011. package/.docs/raw/reference/processors/batch-parts-processor.mdx +0 -111
  1012. package/.docs/raw/reference/processors/language-detector.mdx +0 -154
  1013. package/.docs/raw/reference/processors/moderation-processor.mdx +0 -145
  1014. package/.docs/raw/reference/processors/pii-detector.mdx +0 -153
  1015. package/.docs/raw/reference/processors/prompt-injection-detector.mdx +0 -130
  1016. package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +0 -145
  1017. package/.docs/raw/reference/processors/token-limiter-processor.mdx +0 -136
  1018. package/.docs/raw/reference/processors/unicode-normalizer.mdx +0 -114
  1019. package/.docs/raw/reference/rag/chunk.mdx +0 -445
  1020. package/.docs/raw/reference/rag/database-config.mdx +0 -334
  1021. package/.docs/raw/reference/rag/document.mdx +0 -131
  1022. package/.docs/raw/reference/rag/embeddings.mdx +0 -168
  1023. package/.docs/raw/reference/rag/extract-params.mdx +0 -254
  1024. package/.docs/raw/reference/rag/graph-rag.mdx +0 -186
  1025. package/.docs/raw/reference/rag/metadata-filters.mdx +0 -347
  1026. package/.docs/raw/reference/rag/rerank.mdx +0 -213
  1027. package/.docs/raw/reference/rag/rerankWithScorer.mdx +0 -213
  1028. package/.docs/raw/reference/scorers/answer-relevancy.mdx +0 -209
  1029. package/.docs/raw/reference/scorers/answer-similarity.mdx +0 -423
  1030. package/.docs/raw/reference/scorers/bias.mdx +0 -225
  1031. package/.docs/raw/reference/scorers/completeness.mdx +0 -209
  1032. package/.docs/raw/reference/scorers/content-similarity.mdx +0 -195
  1033. package/.docs/raw/reference/scorers/context-precision.mdx +0 -343
  1034. package/.docs/raw/reference/scorers/context-relevance.mdx +0 -599
  1035. package/.docs/raw/reference/scorers/create-scorer.mdx +0 -495
  1036. package/.docs/raw/reference/scorers/faithfulness.mdx +0 -233
  1037. package/.docs/raw/reference/scorers/hallucination.mdx +0 -247
  1038. package/.docs/raw/reference/scorers/keyword-coverage.mdx +0 -224
  1039. package/.docs/raw/reference/scorers/mastra-scorer.mdx +0 -182
  1040. package/.docs/raw/reference/scorers/noise-sensitivity.mdx +0 -766
  1041. package/.docs/raw/reference/scorers/prompt-alignment.mdx +0 -614
  1042. package/.docs/raw/reference/scorers/run-experiment.mdx +0 -216
  1043. package/.docs/raw/reference/scorers/textual-difference.mdx +0 -204
  1044. package/.docs/raw/reference/scorers/tone-consistency.mdx +0 -208
  1045. package/.docs/raw/reference/scorers/tool-call-accuracy.mdx +0 -567
  1046. package/.docs/raw/reference/scorers/toxicity.mdx +0 -224
  1047. package/.docs/raw/reference/storage/cloudflare-d1.mdx +0 -104
  1048. package/.docs/raw/reference/storage/cloudflare.mdx +0 -95
  1049. package/.docs/raw/reference/storage/dynamodb.mdx +0 -196
  1050. package/.docs/raw/reference/storage/lance.mdx +0 -101
  1051. package/.docs/raw/reference/storage/libsql.mdx +0 -74
  1052. package/.docs/raw/reference/storage/mssql.mdx +0 -112
  1053. package/.docs/raw/reference/storage/postgresql.mdx +0 -305
  1054. package/.docs/raw/reference/storage/upstash.mdx +0 -91
  1055. package/.docs/raw/reference/streaming/ChunkType.mdx +0 -854
  1056. package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +0 -321
  1057. package/.docs/raw/reference/streaming/agents/stream.mdx +0 -698
  1058. package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +0 -515
  1059. package/.docs/raw/reference/streaming/workflows/observeStream.mdx +0 -49
  1060. package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +0 -47
  1061. package/.docs/raw/reference/streaming/workflows/resumeStreamVNext.mdx +0 -118
  1062. package/.docs/raw/reference/streaming/workflows/stream.mdx +0 -125
  1063. package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +0 -144
  1064. package/.docs/raw/reference/templates/overview.mdx +0 -228
  1065. package/.docs/raw/reference/tools/client.mdx +0 -336
  1066. package/.docs/raw/reference/tools/create-tool.mdx +0 -130
  1067. package/.docs/raw/reference/tools/document-chunker-tool.mdx +0 -141
  1068. package/.docs/raw/reference/tools/graph-rag-tool.mdx +0 -262
  1069. package/.docs/raw/reference/tools/mcp-client.mdx +0 -830
  1070. package/.docs/raw/reference/tools/mcp-server.mdx +0 -1079
  1071. package/.docs/raw/reference/tools/vector-query-tool.mdx +0 -604
  1072. package/.docs/raw/reference/vectors/astra.mdx +0 -258
  1073. package/.docs/raw/reference/vectors/chroma.mdx +0 -422
  1074. package/.docs/raw/reference/vectors/couchbase.mdx +0 -345
  1075. package/.docs/raw/reference/vectors/lance.mdx +0 -451
  1076. package/.docs/raw/reference/vectors/libsql.mdx +0 -355
  1077. package/.docs/raw/reference/vectors/mongodb.mdx +0 -309
  1078. package/.docs/raw/reference/vectors/opensearch.mdx +0 -200
  1079. package/.docs/raw/reference/vectors/pg.mdx +0 -632
  1080. package/.docs/raw/reference/vectors/pinecone.mdx +0 -286
  1081. package/.docs/raw/reference/vectors/qdrant.mdx +0 -236
  1082. package/.docs/raw/reference/vectors/s3vectors.mdx +0 -386
  1083. package/.docs/raw/reference/vectors/turbopuffer.mdx +0 -249
  1084. package/.docs/raw/reference/vectors/upstash.mdx +0 -354
  1085. package/.docs/raw/reference/vectors/vectorize.mdx +0 -298
  1086. package/.docs/raw/reference/voice/azure.mdx +0 -218
  1087. package/.docs/raw/reference/voice/cloudflare.mdx +0 -154
  1088. package/.docs/raw/reference/voice/composite-voice.mdx +0 -144
  1089. package/.docs/raw/reference/voice/deepgram.mdx +0 -166
  1090. package/.docs/raw/reference/voice/elevenlabs.mdx +0 -218
  1091. package/.docs/raw/reference/voice/google-gemini-live.mdx +0 -629
  1092. package/.docs/raw/reference/voice/google.mdx +0 -203
  1093. package/.docs/raw/reference/voice/mastra-voice.mdx +0 -413
  1094. package/.docs/raw/reference/voice/murf.mdx +0 -253
  1095. package/.docs/raw/reference/voice/openai-realtime.mdx +0 -376
  1096. package/.docs/raw/reference/voice/openai.mdx +0 -169
  1097. package/.docs/raw/reference/voice/playai.mdx +0 -163
  1098. package/.docs/raw/reference/voice/sarvam.mdx +0 -260
  1099. package/.docs/raw/reference/voice/speechify.mdx +0 -147
  1100. package/.docs/raw/reference/voice/voice.addInstructions.mdx +0 -72
  1101. package/.docs/raw/reference/voice/voice.addTools.mdx +0 -83
  1102. package/.docs/raw/reference/voice/voice.answer.mdx +0 -69
  1103. package/.docs/raw/reference/voice/voice.close.mdx +0 -56
  1104. package/.docs/raw/reference/voice/voice.connect.mdx +0 -123
  1105. package/.docs/raw/reference/voice/voice.events.mdx +0 -85
  1106. package/.docs/raw/reference/voice/voice.getSpeakers.mdx +0 -298
  1107. package/.docs/raw/reference/voice/voice.listen.mdx +0 -201
  1108. package/.docs/raw/reference/voice/voice.off.mdx +0 -74
  1109. package/.docs/raw/reference/voice/voice.on.mdx +0 -132
  1110. package/.docs/raw/reference/voice/voice.send.mdx +0 -81
  1111. package/.docs/raw/reference/voice/voice.speak.mdx +0 -206
  1112. package/.docs/raw/reference/voice/voice.updateConfig.mdx +0 -92
  1113. package/.docs/raw/reference/workflows/run-methods/cancel.mdx +0 -58
  1114. package/.docs/raw/reference/workflows/run-methods/resume.mdx +0 -137
  1115. package/.docs/raw/reference/workflows/run-methods/start.mdx +0 -134
  1116. package/.docs/raw/reference/workflows/run-methods/watch.mdx +0 -74
  1117. package/.docs/raw/reference/workflows/run.mdx +0 -104
  1118. package/.docs/raw/reference/workflows/step.mdx +0 -155
  1119. package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +0 -48
  1120. package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +0 -30
  1121. package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +0 -65
  1122. package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +0 -52
  1123. package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +0 -52
  1124. package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +0 -60
  1125. package/.docs/raw/reference/workflows/workflow-methods/map.mdx +0 -43
  1126. package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +0 -43
  1127. package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +0 -70
  1128. package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +0 -61
  1129. package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +0 -61
  1130. package/.docs/raw/reference/workflows/workflow-methods/then.mdx +0 -44
  1131. package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +0 -66
  1132. package/.docs/raw/reference/workflows/workflow.mdx +0 -132
  1133. package/.docs/raw/scorers/custom-scorers.mdx +0 -473
  1134. package/.docs/raw/scorers/evals-old-api/custom-eval.mdx +0 -26
  1135. package/.docs/raw/scorers/evals-old-api/overview.mdx +0 -106
  1136. package/.docs/raw/scorers/evals-old-api/running-in-ci.mdx +0 -85
  1137. package/.docs/raw/scorers/evals-old-api/textual-evals.mdx +0 -58
  1138. package/.docs/raw/scorers/off-the-shelf-scorers.mdx +0 -48
  1139. package/.docs/raw/scorers/overview.mdx +0 -138
  1140. package/.docs/raw/server-db/custom-api-routes.mdx +0 -67
  1141. package/.docs/raw/server-db/local-dev-playground.mdx +0 -233
  1142. package/.docs/raw/server-db/mastra-client.mdx +0 -274
  1143. package/.docs/raw/server-db/middleware.mdx +0 -173
  1144. package/.docs/raw/server-db/production-server.mdx +0 -91
  1145. package/.docs/raw/server-db/runtime-context.mdx +0 -190
  1146. package/.docs/raw/server-db/storage.mdx +0 -514
  1147. package/.docs/raw/streaming/events.mdx +0 -223
  1148. package/.docs/raw/streaming/overview.mdx +0 -177
  1149. package/.docs/raw/streaming/tool-streaming.mdx +0 -143
  1150. package/.docs/raw/streaming/workflow-streaming.mdx +0 -124
  1151. package/.docs/raw/tools-mcp/advanced-usage.mdx +0 -128
  1152. package/.docs/raw/tools-mcp/mcp-overview.mdx +0 -370
  1153. package/.docs/raw/tools-mcp/overview.mdx +0 -93
  1154. package/.docs/raw/voice/overview.mdx +0 -944
  1155. package/.docs/raw/voice/speech-to-speech.mdx +0 -105
  1156. package/.docs/raw/voice/speech-to-text.mdx +0 -86
  1157. package/.docs/raw/voice/text-to-speech.mdx +0 -90
  1158. package/.docs/raw/workflows/control-flow.mdx +0 -265
  1159. package/.docs/raw/workflows/error-handling.mdx +0 -213
  1160. package/.docs/raw/workflows/inngest-workflow.mdx +0 -359
  1161. package/.docs/raw/workflows/input-data-mapping.mdx +0 -107
  1162. package/.docs/raw/workflows/overview.mdx +0 -277
  1163. package/.docs/raw/workflows/snapshots.mdx +0 -250
  1164. package/.docs/raw/workflows/suspend-and-resume.mdx +0 -298
  1165. package/.docs/raw/workflows/using-with-agents-and-tools.mdx +0 -350
  1166. package/.docs/raw/workflows-legacy/control-flow.mdx +0 -776
  1167. package/.docs/raw/workflows-legacy/dynamic-workflows.mdx +0 -237
  1168. package/.docs/raw/workflows-legacy/error-handling.mdx +0 -185
  1169. package/.docs/raw/workflows-legacy/nested-workflows.mdx +0 -354
  1170. package/.docs/raw/workflows-legacy/overview.mdx +0 -180
  1171. package/.docs/raw/workflows-legacy/runtime-variables.mdx +0 -154
  1172. package/.docs/raw/workflows-legacy/steps.mdx +0 -113
  1173. package/.docs/raw/workflows-legacy/suspend-and-resume.mdx +0 -404
  1174. package/.docs/raw/workflows-legacy/variables.mdx +0 -316
  1175. package/dist/chunk-TUAHUTTB.js +0 -356
  1176. package/dist/prepare-docs/code-examples.d.ts +0 -5
  1177. package/dist/prepare-docs/code-examples.d.ts.map +0 -1
  1178. package/dist/prepare-docs/copy-raw.d.ts +0 -2
  1179. package/dist/prepare-docs/copy-raw.d.ts.map +0 -1
  1180. package/dist/prepare-docs/package-changes.d.ts +0 -5
  1181. package/dist/prepare-docs/package-changes.d.ts.map +0 -1
  1182. package/dist/prepare-docs/prepare.d.ts +0 -2
  1183. package/dist/prepare-docs/prepare.d.ts.map +0 -1
  1184. package/dist/prepare-docs/prepare.js +0 -1
  1185. package/dist/tools/__tests__/test-setup.d.ts +0 -5
  1186. package/dist/tools/__tests__/test-setup.d.ts.map +0 -1
  1187. package/dist/tools/blog.d.ts +0 -22
  1188. package/dist/tools/blog.d.ts.map +0 -1
  1189. package/dist/tools/changes.d.ts +0 -22
  1190. package/dist/tools/changes.d.ts.map +0 -1
  1191. package/dist/tools/examples.d.ts +0 -28
  1192. package/dist/tools/examples.d.ts.map +0 -1
  1193. /package/.docs/{raw/course → course}/01-first-agent/01-introduction-to-mastra.md +0 -0
  1194. /package/.docs/{raw/course → course}/01-first-agent/02-what-is-mastra.md +0 -0
  1195. /package/.docs/{raw/course → course}/01-first-agent/03-verifying-installation.md +0 -0
  1196. /package/.docs/{raw/course → course}/01-first-agent/06-understanding-system-prompts.md +0 -0
  1197. /package/.docs/{raw/course → course}/01-first-agent/10-understanding-tools.md +0 -0
  1198. /package/.docs/{raw/course → course}/01-first-agent/14-understanding-memory.md +0 -0
  1199. /package/.docs/{raw/course → course}/01-first-agent/18-conclusion.md +0 -0
  1200. /package/.docs/{raw/course → course}/02-agent-tools-mcp/01-introduction-to-mcp.md +0 -0
  1201. /package/.docs/{raw/course → course}/02-agent-tools-mcp/02-installing-mcp.md +0 -0
  1202. /package/.docs/{raw/course → course}/02-agent-tools-mcp/06-testing-mcp-setup.md +0 -0
  1203. /package/.docs/{raw/course → course}/02-agent-tools-mcp/11-testing-zapier-integration.md +0 -0
  1204. /package/.docs/{raw/course → course}/02-agent-tools-mcp/17-testing-github-integration.md +0 -0
  1205. /package/.docs/{raw/course → course}/02-agent-tools-mcp/19-what-is-hackernews-mcp.md +0 -0
  1206. /package/.docs/{raw/course → course}/02-agent-tools-mcp/22-testing-hackernews-integration.md +0 -0
  1207. /package/.docs/{raw/course → course}/02-agent-tools-mcp/23-troubleshooting-hackernews.md +0 -0
  1208. /package/.docs/{raw/course → course}/02-agent-tools-mcp/24-what-is-filesystem-mcp.md +0 -0
  1209. /package/.docs/{raw/course → course}/02-agent-tools-mcp/25-creating-notes-directory.md +0 -0
  1210. /package/.docs/{raw/course → course}/02-agent-tools-mcp/28-testing-filesystem-integration.md +0 -0
  1211. /package/.docs/{raw/course → course}/02-agent-tools-mcp/29-troubleshooting-filesystem.md +0 -0
  1212. /package/.docs/{raw/course → course}/03-agent-memory/01-understanding-memory.md +0 -0
  1213. /package/.docs/{raw/course → course}/03-agent-memory/02-why-memory-matters.md +0 -0
  1214. /package/.docs/{raw/course → course}/03-agent-memory/06-testing-memory-agent.md +0 -0
  1215. /package/.docs/{raw/course → course}/03-agent-memory/11-testing-conversation-history.md +0 -0
  1216. /package/.docs/{raw/course → course}/03-agent-memory/14-what-is-semantic-recall.md +0 -0
  1217. /package/.docs/{raw/course → course}/03-agent-memory/15-how-semantic-recall-works.md +0 -0
  1218. /package/.docs/{raw/course → course}/03-agent-memory/17-testing-semantic-recall.md +0 -0
  1219. /package/.docs/{raw/course → course}/03-agent-memory/19-what-is-working-memory.md +0 -0
  1220. /package/.docs/{raw/course → course}/03-agent-memory/20-how-working-memory-works.md +0 -0
  1221. /package/.docs/{raw/course → course}/03-agent-memory/23-testing-working-memory.md +0 -0
  1222. /package/.docs/{raw/course → course}/03-agent-memory/24-working-memory-in-practice.md +0 -0
  1223. /package/.docs/{raw/course → course}/03-agent-memory/28-testing-memory-enhanced-agents.md +0 -0
  1224. /package/.docs/{raw/course → course}/03-agent-memory/29-memory-best-practices.md +0 -0
  1225. /package/.docs/{raw/course → course}/03-agent-memory/30-conclusion.md +0 -0
  1226. /package/.docs/{raw/course → course}/04-workflows/22-conclusion.md +0 -0
package/dist/stdio.js CHANGED
@@ -1,15 +1,50 @@
1
1
  #!/usr/bin/env node
2
- import { fromPackageRoot, prepare, getMatchingPaths, blogPostSchema } from './chunk-TUAHUTTB.js';
3
2
  import * as fs from 'fs';
4
3
  import { existsSync, mkdirSync } from 'fs';
5
4
  import * as os2 from 'os';
6
5
  import os2__default from 'os';
7
- import * as path3 from 'path';
8
- import path3__default from 'path';
6
+ import * as path5 from 'path';
7
+ import path5__default, { dirname } from 'path';
9
8
  import fs3 from 'fs/promises';
10
9
  import { MCPServer } from '@mastra/mcp';
11
10
  import { z } from 'zod';
11
+ import { fileURLToPath } from 'url';
12
+ import { getPackageInfo } from 'local-pkg';
12
13
 
14
+ var LOG_LEVEL_PRIORITY = {
15
+ debug: 0,
16
+ info: 1,
17
+ warn: 2,
18
+ error: 3,
19
+ none: 4
20
+ // none = disable all logs
21
+ };
22
+ function mapToLogLevel(level) {
23
+ switch (level) {
24
+ case "debug":
25
+ return "debug";
26
+ case "info":
27
+ case "notice":
28
+ return "info";
29
+ case "warning":
30
+ return "warn";
31
+ case "error":
32
+ case "critical":
33
+ case "alert":
34
+ case "emergency":
35
+ return "error";
36
+ default:
37
+ return "info";
38
+ }
39
+ }
40
+ var currentLogLevel = "debug";
41
+ function setLogLevel(level) {
42
+ currentLogLevel = level;
43
+ }
44
+ function shouldLog(level) {
45
+ const mappedLevel = mapToLogLevel(level);
46
+ return LOG_LEVEL_PRIORITY[mappedLevel] >= LOG_LEVEL_PRIORITY[currentLogLevel];
47
+ }
13
48
  var writeErrorLog = (message, data) => {
14
49
  const now = /* @__PURE__ */ new Date();
15
50
  const timestamp = now.toISOString();
@@ -20,9 +55,9 @@ var writeErrorLog = (message, data) => {
20
55
  ...data ? typeof data === "object" ? data : { data } : {}
21
56
  };
22
57
  try {
23
- const cacheDir = path3.join(os2.homedir(), ".cache", "mastra", "mcp-docs-server-logs");
58
+ const cacheDir = path5.join(os2.homedir(), ".cache", "mastra", "mcp-docs-server-logs");
24
59
  fs.mkdirSync(cacheDir, { recursive: true });
25
- const logFile = path3.join(cacheDir, `${hourTimestamp}.log`);
60
+ const logFile = path5.join(cacheDir, `${hourTimestamp}.log`);
26
61
  fs.appendFileSync(logFile, JSON.stringify(logMessage) + "\n", "utf8");
27
62
  } catch (err) {
28
63
  console.error("Failed to write to log file:", err);
@@ -31,6 +66,7 @@ var writeErrorLog = (message, data) => {
31
66
  function createLogger(server2) {
32
67
  const sendLog = async (level, message, data) => {
33
68
  if (!server2) return;
69
+ if (!shouldLog(level)) return;
34
70
  try {
35
71
  const sdkServer = server2.getServer();
36
72
  if (!sdkServer) return;
@@ -102,169 +138,226 @@ function createLogger(server2) {
102
138
  };
103
139
  }
104
140
  var logger = createLogger();
105
- var BLOG_BASE_URL = process.env.BLOG_URL || "https://mastra.ai";
106
- async function fetchBlogPosts() {
107
- void logger.debug("Fetching list of blog posts");
108
- const response = await fetch(`${BLOG_BASE_URL}/api/blog`);
109
- if (!response.ok) {
110
- throw new Error("Failed to fetch blog posts");
111
- }
112
- const blogData = await response.json();
113
- const blogPosts = blogPostSchema.array().safeParse(blogData);
114
- if (!blogPosts.success) {
115
- return "Failed to parse blog posts";
141
+
142
+ // src/prompts/migration.ts
143
+ var migrationPrompts = [
144
+ {
145
+ name: "upgrade-to-v1",
146
+ version: "v1",
147
+ description: "Get a guided migration plan for upgrading from Mastra v0.x to v1.0. Provides step-by-step instructions for handling all breaking changes.",
148
+ arguments: [
149
+ {
150
+ name: "area",
151
+ description: "Optional: Focus on a specific area (e.g., agent, tools, workflows, memory, storage, voice). The tool will check if a migration guide exists for this area and suggest alternatives if not found. If not provided, gives an overview of all changes.",
152
+ required: false
153
+ }
154
+ ]
155
+ },
156
+ {
157
+ name: "migration-checklist",
158
+ version: "v1",
159
+ description: "Get a comprehensive checklist for migrating to Mastra v1.0. Lists all breaking changes that need to be addressed."
116
160
  }
117
- const blogLinks = blogPosts.data.map((post) => {
118
- const title = post.metadata.title;
119
- const href = post.slug;
120
- if (title && href) {
121
- return `[${title}](${BLOG_BASE_URL}/blog/${href}) | [Markdown URL](${BLOG_BASE_URL}/api/blog/${href})`;
161
+ ];
162
+ var migrationPromptMessages = {
163
+ listPrompts: async () => migrationPrompts,
164
+ getPromptMessages: async ({ name, args }) => {
165
+ const prompt = migrationPrompts.find((p) => p.name === name);
166
+ if (!prompt) {
167
+ throw new Error(`Prompt not found: ${name}`);
122
168
  }
123
- return null;
124
- }).filter(Boolean);
125
- return "Mastra.ai Blog Posts:\n\n" + blogLinks.join("\n");
126
- }
127
- function validateBlogUrl(url) {
128
- try {
129
- const inputUrl = new URL(url);
130
- const baseUrl = new URL(BLOG_BASE_URL);
131
- return inputUrl.hostname === baseUrl.hostname;
132
- } catch {
133
- return false;
134
- }
135
- }
136
- async function fetchBlogPost(url) {
137
- void logger.debug(`Fetching blog post: ${url}`);
138
- if (!validateBlogUrl(url)) {
139
- void logger.error(`Rejected request to unauthorized domain: ${url}`);
140
- return `URL must be from the same domain as ${BLOG_BASE_URL}`;
141
- }
142
- const response = await fetch(url);
143
- if (!response.ok) {
144
- if (response.status === 429) {
145
- throw new Error("Rate limit exceeded");
169
+ if (name === "upgrade-to-v1") {
170
+ return getUpgradeToV1Messages(args?.area);
146
171
  }
147
- let blogList;
148
- try {
149
- const blogPosts = await fetchBlogPosts();
150
- blogList = `Here are available blog posts:
151
-
152
- ${blogPosts}`;
153
- } catch (e) {
154
- void logger.error(
155
- `Blog post not found or failed to fetch: ${url}, and failed to fetch blog post listing as fallback.`,
156
- e
157
- );
158
- blogList = "Additionally, the list of available blog posts could not be fetched at this time.";
172
+ if (name === "migration-checklist") {
173
+ return getMigrationChecklistMessages();
159
174
  }
160
- return `The requested blog post could not be found or fetched: ${url}
161
-
162
- ${blogList}`;
175
+ throw new Error(`No message handler for prompt: ${name}`);
163
176
  }
164
- const blogData = await response.json();
165
- const blogPost = blogPostSchema.safeParse(blogData);
166
- if (!blogPost.success) {
167
- return "Failed to parse blog post";
168
- }
169
- const content = blogPost.data.content;
170
- if (!content) {
171
- throw new Error("No content found in blog post");
177
+ };
178
+ function getUpgradeToV1Messages(area) {
179
+ if (area) {
180
+ return [
181
+ {
182
+ role: "user",
183
+ content: {
184
+ type: "text",
185
+ text: `I need help migrating my Mastra ${area} code from v0.x to v1.0. Use the mastraMigration tool to:
186
+
187
+ 1. If packages aren't already at the 'latest' tag, upgrade packages to the 'latest' tag and do an install of the new packages.
188
+ 2. First, try to get the specific migration guide for "${area}" using path: "upgrade-to-v1/${area}"
189
+ 3. If that doesn't exist, try the alternate form (singular/plural):
190
+ - If "${area}" ends with 's', try without the 's' (e.g., "agents" \u2192 "agent")
191
+ - If "${area}" doesn't end with 's', try adding 's' (e.g., "agent" \u2192 "agents")
192
+ 4. If the guide exists, walk me through the changes step by step
193
+ 5. If neither form exists, list available migration guides in "upgrade-to-v1/" and suggest which ones might be relevant to "${area}"
194
+ 6. After you find the guide, collect all the codemod calls to run to codemods. These callouts are marked with "> **Codemod:**" in the docs. Run the codemods with "npx @mastra/codemod@latest <codemod-name> <path>" to automate all those changes. Afterwards, help me with any remaining manual changes needed.`
195
+ }
196
+ }
197
+ ];
172
198
  }
173
- return content;
199
+ return [
200
+ {
201
+ role: "user",
202
+ content: {
203
+ type: "text",
204
+ text: `I need to migrate my Mastra project from v0.x to v1.0. Use the mastraMigration tool to:
205
+
206
+ 1. If packages aren't already at the 'latest' tag, upgrade packages to the 'latest' tag and do an install of the new packages.
207
+ 2. First, list all available migration guides with path: "upgrade-to-v1/"
208
+ 2. Give me a high-level overview of what changed in each area
209
+ 3. Find relevant migration areas to focus on based on my project's codebase and confirm the list with me
210
+ 4. After the areas are confirmed, check the migration guides for callouts to codemods. These callouts are marked with "> **Codemod:**" in the docs. Run the codemods with "npx @mastra/codemod@latest v1" to automate all those changes. Afterwards, help me with any remaining manual changes needed.
211
+
212
+ After the areas are confirmed, we'll go through each one systematically.`
213
+ }
214
+ }
215
+ ];
174
216
  }
175
- var blogInputSchema = z.object({
176
- url: z.string().describe(
177
- "URL of a specific blog post to fetch. If the string /api/blog is passed as the url it returns a list of all blog posts. The markdownUrl is the URL of a single blog post which can be used to fetch the blog post content in markdown format."
178
- )
179
- });
180
- var blogTool = {
181
- name: "mastraBlog",
182
- description: "Get Mastra.ai blog content. Without a URL, returns a list of all blog posts. With a URL, returns the specific blog post content in markdown format. The blog contains changelog posts as well as announcements and posts about Mastra features and AI news",
183
- parameters: blogInputSchema,
184
- execute: async (args) => {
185
- void logger.debug("Executing mastraBlog tool", { url: args.url });
186
- try {
187
- let content;
188
- if (args.url.trim() !== `/api/blog`) {
189
- content = await fetchBlogPost(args.url);
190
- } else {
191
- content = await fetchBlogPosts();
217
+ function getMigrationChecklistMessages() {
218
+ return [
219
+ {
220
+ role: "user",
221
+ content: {
222
+ type: "text",
223
+ text: `Create a comprehensive migration checklist for upgrading from Mastra v0.x to v1.0. Use the mastraMigration tool to:
224
+
225
+ 1. List all available migration guides (path: "upgrade-to-v1/")
226
+ 2. For each guide, extract the key breaking changes
227
+ 3. Present them as a checklist I can work through
228
+
229
+ Format the checklist with:
230
+ - [ ] checkbox items for each breaking change
231
+ - Brief description of what needs to change
232
+ - Reference to the specific migration guide
233
+
234
+ Group the checklist by area (Agents, Tools, Workflows, etc.) so I can tackle one area at a time.`
192
235
  }
193
- return content;
194
- } catch (error) {
195
- void logger.error("Failed to execute mastraBlog tool", error);
196
- throw error;
197
236
  }
198
- }
199
- };
200
- function encodePackageName(name) {
201
- return encodeURIComponent(name);
237
+ ];
202
238
  }
203
- function decodePackageName(name) {
204
- return decodeURIComponent(name);
239
+ var mdFileCache = /* @__PURE__ */ new Map();
240
+ var __dirname$1 = dirname(fileURLToPath(import.meta.url));
241
+ function fromPackageRoot(relative) {
242
+ return path5__default.resolve(__dirname$1, `../`, relative);
205
243
  }
206
- var changelogsDir = fromPackageRoot(".docs/organized/changelogs");
207
- async function listPackageChangelogs() {
208
- void logger.debug("Listing package changelogs");
209
- try {
210
- const files = await fs3.readdir(changelogsDir);
211
- return files.filter((f) => f.endsWith(".md")).map((f) => ({
212
- name: decodePackageName(f.replace(".md", "")),
213
- path: f
214
- })).sort((a, b) => a.name.localeCompare(b.name));
215
- } catch {
216
- return [];
244
+ async function* walkMdFiles(dir) {
245
+ if (mdFileCache.has(dir)) {
246
+ for (const file of mdFileCache.get(dir)) yield file;
247
+ return;
217
248
  }
218
- }
219
- async function readPackageChangelog(filename) {
220
- const encodedName = encodePackageName(filename.replace(".md", ""));
221
- const filePath = path3__default.join(changelogsDir, `${encodedName}.md`);
222
- void logger.debug(`Reading changelog: ${filename}`);
223
- try {
224
- return await fs3.readFile(filePath, "utf-8");
225
- } catch {
226
- const packages = await listPackageChangelogs();
227
- const availablePackages = packages.map((pkg) => `- ${pkg.name}`).join("\n");
228
- return `Changelog for "${filename.replace(".md", "")}" not found.
229
-
230
- Available packages:
231
- ${availablePackages}`;
249
+ const filesInDir = [];
250
+ const entries = await fs3.readdir(dir, { withFileTypes: true });
251
+ for (const entry of entries) {
252
+ const fullPath = path5__default.join(dir, entry.name);
253
+ if (entry.isDirectory()) {
254
+ for await (const file of walkMdFiles(fullPath)) {
255
+ filesInDir.push(file);
256
+ yield file;
257
+ }
258
+ } else if (entry.isFile() && entry.name.endsWith(".md")) {
259
+ filesInDir.push(fullPath);
260
+ yield fullPath;
261
+ }
232
262
  }
263
+ mdFileCache.set(dir, filesInDir);
233
264
  }
234
- var initialPackages = await listPackageChangelogs();
235
- var packagesListing = initialPackages.length > 0 ? "\n\nAvailable packages: " + initialPackages.map((pkg) => pkg.name).join(", ") : "\n\nNo package changelogs available yet. Run the documentation preparation script first.";
236
- var changesInputSchema = z.object({
237
- package: z.string().optional().describe("Name of the specific package to fetch changelog for. If not provided, lists all available packages.")
238
- });
239
- var changesTool = {
240
- name: "mastraChanges",
241
- description: `Get changelog information for Mastra.ai packages. ${packagesListing}`,
242
- parameters: changesInputSchema,
243
- execute: async (args) => {
244
- void logger.debug("Executing mastraChanges tool", { package: args.package });
265
+ async function searchDocumentContent(keywords, baseDir) {
266
+ if (keywords.length === 0) return [];
267
+ const fileScores = /* @__PURE__ */ new Map();
268
+ for await (const filePath of walkMdFiles(baseDir)) {
269
+ let content;
245
270
  try {
246
- if (!args.package) {
247
- const packages = await listPackageChangelogs();
248
- const content2 = ["Available package changelogs:", "", ...packages.map((pkg) => `- ${pkg.name}`)].join("\n");
249
- return content2;
271
+ content = await fs3.readFile(filePath, "utf-8");
272
+ } catch {
273
+ continue;
274
+ }
275
+ const lines = content.split("\n");
276
+ lines.forEach((lineText) => {
277
+ const lowerLine = lineText.toLowerCase();
278
+ for (const keyword of keywords) {
279
+ if (lowerLine.includes(keyword.toLowerCase())) {
280
+ const relativePath = path5__default.relative(baseDir, filePath).replace(/\\/g, "/");
281
+ if (!fileScores.has(relativePath)) {
282
+ fileScores.set(relativePath, {
283
+ path: relativePath,
284
+ keywordMatches: /* @__PURE__ */ new Set(),
285
+ totalMatches: 0,
286
+ titleMatches: 0,
287
+ pathRelevance: calculatePathRelevance(relativePath, keywords)
288
+ });
289
+ }
290
+ const score = fileScores.get(relativePath);
291
+ score.keywordMatches.add(keyword);
292
+ score.totalMatches++;
293
+ if (lowerLine.includes("#") || lowerLine.includes("title")) {
294
+ score.titleMatches++;
295
+ }
296
+ }
250
297
  }
251
- const content = await readPackageChangelog(args.package);
252
- return content;
253
- } catch (error) {
254
- void logger.error("Failed to execute mastraChanges tool", error);
255
- throw error;
298
+ });
299
+ }
300
+ const validFiles = Array.from(fileScores.values()).sort((a, b) => calculateFinalScore(b, keywords.length) - calculateFinalScore(a, keywords.length)).slice(0, 10);
301
+ return validFiles.map((score) => score.path);
302
+ }
303
+ function calculatePathRelevance(filePath, keywords) {
304
+ let relevance = 0;
305
+ const pathLower = filePath.toLowerCase();
306
+ if (pathLower.startsWith("reference/")) relevance += 2;
307
+ keywords.forEach((keyword) => {
308
+ if (pathLower.includes(keyword.toLowerCase())) relevance += 3;
309
+ });
310
+ const highValueDirs = ["rag", "memory", "agents", "workflows"];
311
+ if (highValueDirs.some((dir) => pathLower.includes(dir))) {
312
+ relevance += 1;
313
+ }
314
+ return relevance;
315
+ }
316
+ function calculateFinalScore(score, totalKeywords) {
317
+ const allKeywordsBonus = score.keywordMatches.size === totalKeywords ? 10 : 0;
318
+ return score.totalMatches * 1 + score.titleMatches * 3 + score.pathRelevance * 2 + score.keywordMatches.size * 5 + allKeywordsBonus;
319
+ }
320
+ function extractKeywordsFromPath(docPath) {
321
+ const cleanPath = docPath.replace(/\.md$/, "");
322
+ const fileName = cleanPath.split("/").pop() || "";
323
+ const keywords = /* @__PURE__ */ new Set();
324
+ const splitParts = fileName.split(/[-_]|(?=[A-Z])/);
325
+ splitParts.forEach((keyword) => {
326
+ if (keyword.length > 2) {
327
+ keywords.add(keyword.toLowerCase());
256
328
  }
329
+ });
330
+ return Array.from(keywords);
331
+ }
332
+ function normalizeKeywords(keywords) {
333
+ return Array.from(new Set(keywords.flatMap((k) => k.split(/\s+/).filter(Boolean)).map((k) => k.toLowerCase())));
334
+ }
335
+ async function getMatchingPaths(path7, queryKeywords, baseDir) {
336
+ const pathKeywords = extractKeywordsFromPath(path7);
337
+ const allKeywords = normalizeKeywords([...pathKeywords, ...queryKeywords || []]);
338
+ if (allKeywords.length === 0) {
339
+ return "";
257
340
  }
258
- };
341
+ const suggestedPaths = await searchDocumentContent(allKeywords, baseDir);
342
+ if (suggestedPaths.length === 0) {
343
+ return "";
344
+ }
345
+ const pathList = suggestedPaths.map((path8) => `- ${path8}`).join("\n");
346
+ return `Here are some paths that might be relevant based on your query:
347
+
348
+ ${pathList}`;
349
+ }
350
+
351
+ // src/tools/course.ts
259
352
  var _courseLessonSchema = z.object({
260
353
  lessonName: z.string().describe("Name of the specific lesson to start. It must match the exact lesson name.")
261
354
  });
262
355
  var _confirmationSchema = z.object({
263
356
  confirm: z.boolean().optional().describe("Set to true to confirm this action")
264
357
  });
265
- var courseDir = fromPackageRoot(".docs/raw/course");
358
+ var courseDir = fromPackageRoot(".docs/course");
266
359
  var introductionPrompt = `
267
- This is a course to help a new user learn about Mastra, the open-source AI Agent framework built in Typescript.
360
+ This is a course to help a new user learn about Mastra, the open-source AI Agent framework built in TypeScript.
268
361
  The following is the introduction content, please provide this text to the user EXACTLY as written below. Do not provide any other text or instructions:
269
362
 
270
363
  # Welcome to the Mastra Course!
@@ -291,14 +384,13 @@ This helps the project grow and reach more developers like you!
291
384
  Type "start mastra course" and let's get started with your first lesson!
292
385
  `;
293
386
  var lessonPrompt = `
294
- This is a course to help a new user learn about Mastra, the open-source AI Agent framework built in Typescript.
387
+ This is a course to help a new user learn about Mastra, the open-source AI Agent framework built in TypeScript.
295
388
  Please help the user through the steps of the course by walking them through the content and following the course
296
389
  to write the initial version of the code for them. The goal is to show them how the code works and explain it as they go
297
390
  as the course goes on. Each lesson is broken up into steps. You should return the content of the step and ask the user
298
391
  to move to the next step when they are ready. If the step contains instructions to write code, you should write the code
299
392
  for the user when possible. You should always briefly explain the step before writing the code. Please ensure to
300
- return any text in markdown blockquotes exactly as written in your response. When the user ask about their course progress or course status,
301
- make sure to include the course status url in your response. This is important.
393
+ return any text in markdown blockquotes exactly as written in your response. When the user ask about their course progress or course status, make sure to include the course status URL in your response. This is important.
302
394
  `;
303
395
  function wrapContentInPrompt(content, _isFirstStep = false) {
304
396
  let wrappedContent = `${lessonPrompt}
@@ -309,11 +401,11 @@ Here is the content for this step: <StepContent>${content}</StepContent>`;
309
401
  When you're ready to continue, use the \`nextMastraCourseStep\` tool to move to the next step.`;
310
402
  }
311
403
  async function getDeviceIdPath() {
312
- const cacheDir = path3__default.join(os2__default.homedir(), ".cache", "mastra");
404
+ const cacheDir = path5__default.join(os2__default.homedir(), ".cache", "mastra");
313
405
  if (!existsSync(cacheDir)) {
314
406
  mkdirSync(cacheDir, { recursive: true });
315
407
  }
316
- return path3__default.join(cacheDir, ".device_id");
408
+ return path5__default.join(cacheDir, ".device_id");
317
409
  }
318
410
  async function getDeviceCredentials() {
319
411
  try {
@@ -363,13 +455,13 @@ async function readCourseStep(lessonName, stepName, _isFirstStep = false) {
363
455
  if (!lessonDir) {
364
456
  throw new Error(`Lesson "${lessonName}" not found.`);
365
457
  }
366
- const lessonPath = path3__default.join(courseDir, lessonDir);
458
+ const lessonPath = path5__default.join(courseDir, lessonDir);
367
459
  const files = await fs3.readdir(lessonPath);
368
460
  const stepFile = files.find((f) => f.endsWith(".md") && f.replace(/^\d+-/, "").replace(".md", "") === stepName);
369
461
  if (!stepFile) {
370
462
  throw new Error(`Step "${stepName}" not found in lesson "${lessonName}".`);
371
463
  }
372
- const filePath = path3__default.join(courseDir, lessonDir, stepFile);
464
+ const filePath = path5__default.join(courseDir, lessonDir, stepFile);
373
465
  try {
374
466
  const content = await fs3.readFile(filePath, "utf-8");
375
467
  return wrapContentInPrompt(content);
@@ -415,11 +507,11 @@ async function saveCourseState(state, deviceId) {
415
507
  }
416
508
  }
417
509
  async function getCourseStatePath() {
418
- const stateDirPath = path3__default.join(os2__default.homedir(), ".cache", "mastra", "course");
510
+ const stateDirPath = path5__default.join(os2__default.homedir(), ".cache", "mastra", "course");
419
511
  if (!existsSync(stateDirPath)) {
420
512
  mkdirSync(stateDirPath, { recursive: true });
421
513
  }
422
- return path3__default.join(stateDirPath, "state.json");
514
+ return path5__default.join(stateDirPath, "state.json");
423
515
  }
424
516
  async function loadCourseState() {
425
517
  const statePath = await getCourseStatePath();
@@ -437,7 +529,7 @@ async function scanCourseContent() {
437
529
  const lessonDirs = await fs3.readdir(courseDir);
438
530
  const lessons = await Promise.all(
439
531
  lessonDirs.filter((dir) => !dir.startsWith(".")).sort((a, b) => a.localeCompare(b)).map(async (lessonDir) => {
440
- const lessonPath = path3__default.join(courseDir, lessonDir);
532
+ const lessonPath = path5__default.join(courseDir, lessonDir);
441
533
  const lessonStats = await fs3.stat(lessonPath);
442
534
  if (!lessonStats.isDirectory()) return null;
443
535
  const lessonName = lessonDir.replace(/^\d+-/, "");
@@ -462,7 +554,7 @@ async function scanCourseContent() {
462
554
  );
463
555
  const validLessons = lessons.filter((lesson) => lesson !== null);
464
556
  return {
465
- currentLesson: validLessons.length > 0 ? validLessons[0].name : "",
557
+ currentLesson: validLessons.length > 0 ? validLessons[0]?.name ?? "" : "",
466
558
  lessons: validLessons
467
559
  };
468
560
  }
@@ -498,7 +590,7 @@ async function mergeCourseStates(currentState, newState) {
498
590
  });
499
591
  let currentLesson = currentState.currentLesson;
500
592
  if (!mergedLessons.some((lesson) => lesson.name === currentLesson) && mergedLessons.length > 0) {
501
- currentLesson = mergedLessons[0].name;
593
+ currentLesson = mergedLessons[0]?.name ?? "";
502
594
  }
503
595
  return {
504
596
  currentLesson,
@@ -507,7 +599,7 @@ async function mergeCourseStates(currentState, newState) {
507
599
  }
508
600
  var startMastraCourse = {
509
601
  name: "startMastraCourse",
510
- description: "Starts the Mastra Course. If the user is not registered, they will be prompted to register first. Otherwise, it will start at the first lesson or pick up where they last left off. ALWAYS ask the user for their email address if they are not registered. DO NOT assume their email address, they must confirm their email and that they want to register.",
602
+ description: "[\u{1F393} COURSE] Starts the Mastra Course. If the user is not registered, they will be prompted to register first. Otherwise, it will start at the first lesson or pick up where they last left off. ALWAYS ask the user for their email address if they are not registered. DO NOT assume their email address, they must confirm their email and that they want to register.",
511
603
  parameters: z.object({
512
604
  email: z.string().email().optional().describe("Email address for registration if not already registered. ")
513
605
  }),
@@ -604,7 +696,7 @@ When you've completed this step, use the \`nextMastraCourseStep\` tool to contin
604
696
  };
605
697
  var getMastraCourseStatus = {
606
698
  name: "getMastraCourseStatus",
607
- description: "Gets the current status of the Mastra Course, including which lessons and steps have been completed",
699
+ description: "[\u{1F393} COURSE] Gets the current status of the Mastra Course, including which lessons and steps have been completed",
608
700
  parameters: z.object({}),
609
701
  execute: async (_args) => {
610
702
  try {
@@ -681,7 +773,7 @@ Course status url: https://mastra.ai/course/${deviceId}`;
681
773
  };
682
774
  var startMastraCourseLesson = {
683
775
  name: "startMastraCourseLesson",
684
- description: "Starts a specific lesson in the Mastra Course. If the lesson has been started before, it will resume from the first incomplete step",
776
+ description: "[\u{1F393} COURSE] Starts a specific lesson in the Mastra Course. If the lesson has been started before, it will resume from the first incomplete step",
685
777
  parameters: _courseLessonSchema,
686
778
  execute: async (args) => {
687
779
  try {
@@ -724,7 +816,7 @@ When you've completed this step, use the \`nextMastraCourseStep\` tool to contin
724
816
  };
725
817
  var nextMastraCourseStep = {
726
818
  name: "nextMastraCourseStep",
727
- description: "Advances to the next step in the current Mastra Course lesson. If all steps in the current lesson are completed, it will move to the next lesson",
819
+ description: "[\u{1F393} COURSE] Advances to the next step in the current Mastra Course lesson. If all steps in the current lesson are completed, it will move to the next lesson",
728
820
  parameters: z.object({}),
729
821
  execute: async (_args) => {
730
822
  try {
@@ -745,19 +837,23 @@ var nextMastraCourseStep = {
745
837
  if (currentStepIndex === -1) {
746
838
  return "No step is currently in progress. Please start a step first using the `startMastraCourse` tool.";
747
839
  }
748
- currentLesson.steps[currentStepIndex].status = 2;
840
+ if (currentLesson.steps[currentStepIndex]?.status) {
841
+ currentLesson.steps[currentStepIndex].status = 2;
842
+ }
749
843
  const nextStepIndex = currentLesson.steps.findIndex(
750
844
  (step, index) => index > currentStepIndex && step.status !== 2
751
845
  );
752
846
  if (nextStepIndex !== -1) {
753
- currentLesson.steps[nextStepIndex].status = 1;
847
+ if (currentLesson.steps[nextStepIndex]) {
848
+ currentLesson.steps[nextStepIndex].status = 1;
849
+ }
754
850
  await saveCourseState(courseState, deviceId);
755
851
  const nextStep = currentLesson.steps[nextStepIndex];
756
- const stepContent = await readCourseStep(currentLessonName, nextStep.name);
757
- return `\u{1F389} Step "${currentLesson.steps[currentStepIndex].name}" completed!
852
+ const stepContent = await readCourseStep(currentLessonName, nextStep?.name ?? "Unknown Step");
853
+ return `\u{1F389} Step "${currentLesson.steps[currentStepIndex]?.name ?? "Unknown Step"}" completed!
758
854
 
759
855
  \u{1F4D8} Continuing Lesson: ${currentLessonName}
760
- \u{1F4DD} Next Step: ${nextStep.name}
856
+ \u{1F4DD} Next Step: ${nextStep?.name ?? "Unknown Step"}
761
857
 
762
858
  ${stepContent}
763
859
 
@@ -768,17 +864,17 @@ When you've completed this step, use the \`nextMastraCourseStep\` tool to contin
768
864
  const nextLesson = courseState.lessons.find((lesson, index) => index > currentLessonIndex && lesson.status !== 2);
769
865
  if (nextLesson) {
770
866
  courseState.currentLesson = nextLesson.name;
771
- if (nextLesson.steps.length > 0) {
867
+ if (nextLesson.steps.length > 0 && nextLesson.steps[0]) {
772
868
  nextLesson.steps[0].status = 1;
773
869
  }
774
870
  nextLesson.status = 1;
775
871
  await saveCourseState(courseState, deviceId);
776
872
  const firstStep = nextLesson.steps[0];
777
- const stepContent = await readCourseStep(nextLesson.name, firstStep.name);
873
+ const stepContent = await readCourseStep(nextLesson.name, firstStep?.name ?? "Unknown Step");
778
874
  return `\u{1F389} Congratulations! You've completed the "${currentLessonName}" lesson!
779
875
 
780
876
  \u{1F4D8} Starting New Lesson: ${nextLesson.name}
781
- \u{1F4DD} First Step: ${firstStep.name}
877
+ \u{1F4DD} First Step: ${firstStep?.name ?? "Unknown Step"}
782
878
 
783
879
  ${stepContent}
784
880
 
@@ -795,7 +891,7 @@ If you'd like to review any lesson, use the \`startMastraCourseLesson\` tool wit
795
891
  };
796
892
  var clearMastraCourseHistory = {
797
893
  name: "clearMastraCourseHistory",
798
- description: "Clears all Mastra Course progress history and starts over from the beginning. This action cannot be undone",
894
+ description: "[\u{1F393} COURSE] Clears all Mastra Course progress history and starts over from the beginning. This action cannot be undone",
799
895
  parameters: _confirmationSchema,
800
896
  execute: async (args) => {
801
897
  try {
@@ -817,7 +913,7 @@ var clearMastraCourseHistory = {
817
913
  }
818
914
  }
819
915
  };
820
- var docsBaseDir = fromPackageRoot(".docs/raw/");
916
+ var docsBaseDir = fromPackageRoot(".docs/");
821
917
  async function listDirContents(dirPath) {
822
918
  try {
823
919
  void logger.debug(`Listing directory contents: ${dirPath}`);
@@ -827,8 +923,8 @@ async function listDirContents(dirPath) {
827
923
  for (const entry of entries) {
828
924
  if (entry.isDirectory()) {
829
925
  dirs.push(entry.name + "/");
830
- } else if (entry.isFile() && entry.name.endsWith(".mdx")) {
831
- files.push(entry.name);
926
+ } else if (entry.isFile() && entry.name.endsWith(".md")) {
927
+ files.push(entry.name.replace(/\.md$/, ""));
832
928
  }
833
929
  }
834
930
  return {
@@ -840,51 +936,52 @@ async function listDirContents(dirPath) {
840
936
  throw error;
841
937
  }
842
938
  }
843
- async function readMdxContent(docPath, queryKeywords) {
844
- const fullPath = path3__default.resolve(path3__default.join(docsBaseDir, docPath));
845
- if (!fullPath.startsWith(path3__default.resolve(docsBaseDir))) {
939
+ async function readDocsContent(docPath, queryKeywords) {
940
+ const fullPath = path5__default.resolve(path5__default.join(docsBaseDir, docPath));
941
+ if (!fullPath.startsWith(path5__default.resolve(docsBaseDir))) {
846
942
  void logger.error(`Path traversal attempt detected`);
847
943
  return { found: false, isSecurityViolation: true };
848
944
  }
849
- void logger.debug(`Reading MDX content from: ${fullPath}`);
945
+ void logger.debug(`Reading docs content from: ${fullPath}`);
850
946
  try {
851
947
  const stats = await fs3.stat(fullPath);
852
948
  if (stats.isDirectory()) {
949
+ const indexMdPath = path5__default.join(fullPath, "index.md");
950
+ try {
951
+ const content2 = await fs3.readFile(indexMdPath, "utf-8");
952
+ return { found: true, content: content2, isSecurityViolation: false };
953
+ } catch {
954
+ }
853
955
  const { dirs, files } = await listDirContents(fullPath);
854
- const dirListing = [
855
- `Directory contents of ${docPath}:`,
856
- "",
857
- dirs.length > 0 ? "Subdirectories:" : "No subdirectories.",
858
- ...dirs.map((d) => `- ${d}`),
859
- "",
860
- files.length > 0 ? "Files in this directory:" : "No files in this directory.",
861
- ...files.map((f) => `- ${f}`),
862
- "",
863
- "---",
864
- "",
865
- "Contents of all files in this directory:",
866
- ""
867
- ].join("\n");
868
- let fileContents = "";
869
- for (const file of files) {
870
- const filePath = path3__default.join(fullPath, file);
871
- const content2 = await fs3.readFile(filePath, "utf-8");
872
- fileContents += `
873
-
874
- # ${file}
875
-
876
- ${content2}`;
956
+ const listing = [`Directory contents of ${docPath || "/"}:`, ""];
957
+ if (dirs.length > 0) {
958
+ listing.push("Subdirectories:");
959
+ listing.push(...dirs.map((d) => `- ${docPath ? `${docPath}/${d}` : d}`));
960
+ listing.push("");
961
+ }
962
+ if (files.length > 0) {
963
+ listing.push("Available documentation paths:");
964
+ listing.push(...files.map((f) => `- ${docPath ? `${docPath}/${f}` : f}`));
965
+ listing.push("");
966
+ }
967
+ if (dirs.length === 0 && files.length === 0) {
968
+ listing.push("No documentation available in this directory.");
877
969
  }
878
970
  const contentBasedSuggestions = await getMatchingPaths(docPath, queryKeywords, docsBaseDir);
879
- const suggestions = ["---", "", contentBasedSuggestions, ""].join("\n");
880
- return { found: true, content: dirListing + fileContents + suggestions, isSecurityViolation: false };
971
+ const suggestions = contentBasedSuggestions ? ["---", "", contentBasedSuggestions, ""].join("\n") : "";
972
+ return { found: true, content: listing.join("\n") + suggestions, isSecurityViolation: false };
881
973
  }
882
974
  const content = await fs3.readFile(fullPath, "utf-8");
883
975
  return { found: true, content, isSecurityViolation: false };
884
976
  } catch (error) {
885
- void logger.error(`Failed to read MDX content: ${fullPath}`, error);
886
977
  if (error.code === "ENOENT") {
887
- return { found: false, isSecurityViolation: false };
978
+ try {
979
+ const mdPath = fullPath + ".md";
980
+ const content = await fs3.readFile(mdPath, "utf-8");
981
+ return { found: true, content, isSecurityViolation: false };
982
+ } catch {
983
+ return { found: false, isSecurityViolation: false };
984
+ }
888
985
  }
889
986
  throw error;
890
987
  }
@@ -895,20 +992,25 @@ async function findNearestDirectory(docPath, availablePaths2) {
895
992
  while (parts.length > 0) {
896
993
  const testPath = parts.join("/");
897
994
  try {
898
- const fullPath = path3__default.join(docsBaseDir, testPath);
995
+ const fullPath = path5__default.join(docsBaseDir, testPath);
899
996
  const stats = await fs3.stat(fullPath);
900
997
  if (stats.isDirectory()) {
901
998
  const { dirs, files } = await listDirContents(fullPath);
902
- return [
999
+ const listing = [
903
1000
  `Path "${docPath}" not found.`,
904
1001
  `Here are the available paths in "${testPath}":`,
905
- "",
906
- dirs.length > 0 ? "Directories:" : "No subdirectories.",
907
- ...dirs.map((d) => `- ${testPath}/${d}`),
908
- "",
909
- files.length > 0 ? "Files:" : "No files.",
910
- ...files.map((f) => `- ${testPath}/${f}`)
911
- ].join("\n");
1002
+ ""
1003
+ ];
1004
+ if (dirs.length > 0) {
1005
+ listing.push("Directories:");
1006
+ listing.push(...dirs.map((d) => `- ${testPath}/${d}`));
1007
+ listing.push("");
1008
+ }
1009
+ if (files.length > 0) {
1010
+ listing.push("Files:");
1011
+ listing.push(...files.map((f) => `- ${testPath}/${f}`));
1012
+ }
1013
+ return listing.join("\n");
912
1014
  }
913
1015
  } catch {
914
1016
  void logger.debug(`Directory not found, trying parent: ${parts.slice(0, -1).join("/")}`);
@@ -921,7 +1023,7 @@ async function getAvailablePaths() {
921
1023
  const { dirs, files } = await listDirContents(docsBaseDir);
922
1024
  let referenceDirs = [];
923
1025
  if (dirs.includes("reference/")) {
924
- const { dirs: refDirs } = await listDirContents(path3__default.join(docsBaseDir, "reference"));
1026
+ const { dirs: refDirs } = await listDirContents(path5__default.join(docsBaseDir, "reference"));
925
1027
  referenceDirs = refDirs.map((d) => `reference/${d}`);
926
1028
  }
927
1029
  return [
@@ -933,7 +1035,7 @@ async function getAvailablePaths() {
933
1035
  referenceDirs.length > 0 ? "Reference subdirectories:" : "",
934
1036
  ...referenceDirs.map((d) => `- ${d}`),
935
1037
  "",
936
- "Files:",
1038
+ files.length > 0 ? "Files:" : "",
937
1039
  ...files.map((f) => `- ${f}`)
938
1040
  ].filter(Boolean).join("\n");
939
1041
  }
@@ -948,55 +1050,53 @@ ${availablePaths}`),
948
1050
  });
949
1051
  var docsTool = {
950
1052
  name: "mastraDocs",
951
- description: `Get Mastra.ai documentation.
952
- Request paths to explore the docs. References contain API docs.
953
- Other paths contain guides. The user doesn't know about files and directories.
954
- You can also use keywords from the user query to find relevant documentation, but prioritize paths.
955
- This is your internal knowledge the user can't read.
956
- If the user asks about a feature check general docs as well as reference docs for that feature.
957
- Ex: with evals check in evals/ and in reference/evals/.
958
- Provide code examples so the user understands.
959
- If you build a URL from the path, only paths ending in .mdx exist.
960
- Note that docs about MCP are currently in reference/tools/.
961
- IMPORTANT: Be concise with your answers. The user will ask for more info.
962
- If packages need to be installed, provide the pnpm command to install them.
963
- Ex. if you see \`import { X } from "@mastra/$PACKAGE_NAME"\` in an example, show an install command.
1053
+ description: `[\u{1F310} REMOTE] Get Mastra documentation.
1054
+ Request paths to explore the docs. References contain API docs.
1055
+ Other paths contain guides. The user doesn't know about files and directories.
1056
+ You can also use keywords from the user query to find relevant documentation, but prioritize paths.
1057
+ This is your internal knowledge the user can't read.
1058
+ If the user asks about a feature check general docs as well as reference docs for that feature.
1059
+ Ex: with workflows check in docs/workflows and in reference/workflows.
1060
+ Provide code examples so the user understands.
1061
+ IMPORTANT: Be concise with your answers. The user will ask for more info.
1062
+ If packages need to be installed, provide the pnpm command to install them.
1063
+ Ex. if you see \`import { X } from "@mastra/$PACKAGE_NAME"\` in an example, show an install command.
964
1064
  Always install latest tag, not alpha unless requested. If you scaffold a new project it may be in a subdir.
965
- When displaying results, always mention which file path contains the information (e.g., 'Found in "path/to/file.mdx"') so users know where this documentation lives.`,
1065
+ When displaying results, always mention which file path contains the information so users know where this documentation lives.`,
966
1066
  parameters: docsInputSchema,
967
1067
  execute: async (args) => {
968
1068
  void logger.debug("Executing mastraDocs tool", { args });
969
1069
  try {
970
1070
  const queryKeywords = args.queryKeywords ?? [];
971
1071
  const results = await Promise.all(
972
- args.paths.map(async (path6) => {
1072
+ args.paths.map(async (docPath) => {
973
1073
  try {
974
- const result = await readMdxContent(path6, queryKeywords);
1074
+ const result = await readDocsContent(docPath, queryKeywords);
975
1075
  if (result.found) {
976
1076
  return {
977
- path: path6,
1077
+ path: docPath,
978
1078
  content: result.content,
979
1079
  error: null
980
1080
  };
981
1081
  }
982
1082
  if (result.isSecurityViolation) {
983
1083
  return {
984
- path: path6,
1084
+ path: docPath,
985
1085
  content: null,
986
1086
  error: "Invalid path"
987
1087
  };
988
1088
  }
989
- const directorySuggestions = await findNearestDirectory(path6, availablePaths);
990
- const contentBasedSuggestions = await getMatchingPaths(path6, queryKeywords, docsBaseDir);
1089
+ const directorySuggestions = await findNearestDirectory(docPath, availablePaths);
1090
+ const contentBasedSuggestions = await getMatchingPaths(docPath, queryKeywords, docsBaseDir);
991
1091
  return {
992
- path: path6,
1092
+ path: docPath,
993
1093
  content: null,
994
1094
  error: [directorySuggestions, contentBasedSuggestions].join("\n\n")
995
1095
  };
996
1096
  } catch (error) {
997
- void logger.warning(`Failed to read content for path: ${path6}`, error);
1097
+ void logger.warning(`Failed to read content for path: ${docPath}`, error);
998
1098
  return {
999
- path: path6,
1099
+ path: docPath,
1000
1100
  content: null,
1001
1101
  error: error instanceof Error ? error.message : "Unknown error"
1002
1102
  };
@@ -1026,66 +1126,914 @@ ${result.content}
1026
1126
  }
1027
1127
  }
1028
1128
  };
1029
- var examplesDir = fromPackageRoot(".docs/organized/code-examples");
1030
- async function listCodeExamples() {
1031
- void logger.debug("Listing code examples");
1129
+ var packageCache = /* @__PURE__ */ new Map();
1130
+ var sourceMapCache = /* @__PURE__ */ new Map();
1131
+ var packageInfoCache = /* @__PURE__ */ new Map();
1132
+ var KNOWN_MASTRA_PACKAGES = [
1133
+ "@mastra/core",
1134
+ "@mastra/cli",
1135
+ "@mastra/memory",
1136
+ "@mastra/rag",
1137
+ "@mastra/evals",
1138
+ "@mastra/mcp",
1139
+ "@mastra/server",
1140
+ "@mastra/deployer",
1141
+ "@mastra/agent-builder",
1142
+ "@mastra/auth",
1143
+ "@mastra/fastembed",
1144
+ "@mastra/loggers",
1145
+ "@mastra/schema-compat",
1146
+ "@mastra/codemod"
1147
+ ];
1148
+ async function getPackageRootPath(packageName, projectPath) {
1149
+ const cacheKey = `${packageName}:${projectPath}`;
1150
+ if (packageInfoCache.has(cacheKey)) {
1151
+ return packageInfoCache.get(cacheKey);
1152
+ }
1153
+ try {
1154
+ const info = await getPackageInfo(packageName, {
1155
+ paths: [path5__default.join(projectPath, "node_modules")]
1156
+ });
1157
+ if (info?.rootPath) {
1158
+ const result = { rootPath: info.rootPath, version: info.version || "unknown" };
1159
+ packageInfoCache.set(cacheKey, result);
1160
+ void logger.debug("Resolved package with local-pkg", { packageName, projectPath, ...result });
1161
+ return result;
1162
+ }
1163
+ } catch (err) {
1164
+ void logger.debug("Package not found or error resolving", {
1165
+ packageName,
1166
+ projectPath,
1167
+ error: err instanceof Error ? err.message : String(err)
1168
+ });
1169
+ }
1170
+ packageInfoCache.set(cacheKey, null);
1171
+ return null;
1172
+ }
1173
+ async function getInstalledMastraPackages(projectPath) {
1174
+ const cacheKey = projectPath;
1175
+ if (packageCache.has(cacheKey)) {
1176
+ void logger.debug("Using cached package list", { count: packageCache.get(cacheKey).length });
1177
+ return packageCache.get(cacheKey);
1178
+ }
1179
+ void logger.debug("Scanning for @mastra packages using local-pkg", { projectPath });
1180
+ const packages = [];
1181
+ const packagesWithoutDocs = [];
1182
+ for (const packageName of KNOWN_MASTRA_PACKAGES) {
1183
+ const packageInfo = await getPackageRootPath(packageName, projectPath);
1184
+ if (packageInfo) {
1185
+ const docsPath = path5__default.join(packageInfo.rootPath, "dist", "docs");
1186
+ try {
1187
+ const stats = await fs3.stat(docsPath);
1188
+ if (stats.isDirectory()) {
1189
+ packages.push(packageName);
1190
+ void logger.debug("Found package with embedded docs", { package: packageName });
1191
+ } else {
1192
+ packagesWithoutDocs.push(packageName);
1193
+ }
1194
+ } catch {
1195
+ packagesWithoutDocs.push(packageName);
1196
+ }
1197
+ }
1198
+ }
1199
+ const result = packages.sort();
1200
+ packageCache.set(cacheKey, result);
1201
+ void logger.info("Package scan complete", {
1202
+ packagesWithDocs: result.length,
1203
+ packagesWithoutDocs: packagesWithoutDocs.length,
1204
+ packages: result
1205
+ });
1206
+ return result;
1207
+ }
1208
+ async function readSourceMap(packageName, projectPath) {
1209
+ const cacheKey = `${packageName}:${projectPath}`;
1210
+ if (sourceMapCache.has(cacheKey)) return sourceMapCache.get(cacheKey);
1032
1211
  try {
1033
- const files = await fs3.readdir(examplesDir);
1034
- return files.filter((f) => f.endsWith(".md")).map((f) => ({
1035
- name: f.replace(".md", ""),
1036
- path: f
1037
- })).sort((a, b) => a.name.localeCompare(b.name));
1212
+ const packageInfo = await getPackageRootPath(packageName, projectPath);
1213
+ if (!packageInfo) {
1214
+ sourceMapCache.set(cacheKey, null);
1215
+ return null;
1216
+ }
1217
+ const sourceMapPath = path5__default.join(packageInfo.rootPath, "dist", "docs", "SOURCE_MAP.json");
1218
+ const content = await fs3.readFile(sourceMapPath, "utf-8");
1219
+ const sourceMap = JSON.parse(content);
1220
+ sourceMapCache.set(cacheKey, sourceMap);
1221
+ return sourceMap;
1038
1222
  } catch {
1039
- return [];
1223
+ sourceMapCache.set(cacheKey, null);
1224
+ return null;
1040
1225
  }
1041
1226
  }
1042
- async function readCodeExample(filename, queryKeywords) {
1043
- const filePath = path3__default.join(examplesDir, filename);
1044
- void logger.debug(`Reading example: ${filename}`);
1227
+ var getMastraHelpTool = {
1228
+ name: "getMastraHelp",
1229
+ description: `\u{1F680} START HERE - Complete guide to Mastra documentation tools.
1230
+
1231
+ This MCP server provides TWO documentation sources:
1232
+
1233
+ ## \u{1F4E6} LOCAL PACKAGE DOCS (Recommended for Development)
1234
+ SOURCE: Your installed @mastra packages in node_modules
1235
+ VERSION: Matches your installed code exactly
1236
+
1237
+ ADVANTAGES:
1238
+ - \u2705 Version-matched to your code
1239
+ - \u2705 Complete TypeScript type definitions
1240
+ - \u2705 Works offline
1241
+ - \u2705 SOURCE_MAP.json with exact exports
1242
+
1243
+ TOOLS: listMastraPackages, getMastraExports, getMastraExportDetails, readMastraDocs, searchMastraDocs
1244
+ USE WHEN: Writing code, implementing features, checking APIs, debugging
1245
+
1246
+ ## \u{1F310} REMOTE WEBSITE DOCS (For Latest Info & Learning)
1247
+ SOURCE: mastra.ai website
1248
+ VERSION: Latest published documentation
1249
+
1250
+ ADVANTAGES:
1251
+ - \u2705 Always up-to-date
1252
+ - \u2705 Blog posts and announcements
1253
+ - \u2705 Migration guides
1254
+ - \u2705 Curated examples
1255
+
1256
+ TOOLS: mastraDocs, mastraBlog, mastraExamples, mastraChanges, mastraMigration
1257
+ USE WHEN: Learning concepts, checking latest features, migration help
1258
+
1259
+ ## \u{1F393} INTERACTIVE COURSE
1260
+ TOOLS: startMastraCourse, getMastraCourseStatus, etc.
1261
+ USE WHEN: User wants guided learning experience
1262
+
1263
+ ---
1264
+
1265
+ RECOMMENDED WORKFLOW:
1266
+ 1. For coding: listMastraPackages \u2192 getMastraExports \u2192 getMastraExportDetails
1267
+ 2. For learning: mastraDocs
1268
+ 3. Version mismatch: mastraChanges \u2192 mastraMigration
1269
+
1270
+ This tool shows you which packages are installed and provides detailed guidance on using all available documentation tools.`,
1271
+ parameters: z.object({
1272
+ projectPath: z.string().describe("Absolute path to your project root (we will search upward for node_modules with Mastra packages)")
1273
+ }),
1274
+ execute: async (args) => {
1275
+ void logger.debug("Executing getMastraHelp tool", { projectPath: args.projectPath });
1276
+ const packages = await getInstalledMastraPackages(args.projectPath);
1277
+ if (packages.length === 0) {
1278
+ return `No Mastra packages with embedded documentation found in your project.
1279
+
1280
+ To use these tools, install Mastra packages like:
1281
+ - npm install @mastra/core
1282
+ - npm install @mastra/memory
1283
+ - npm install @mastra/rag
1284
+
1285
+ Then rebuild/reinstall to generate embedded docs.`;
1286
+ }
1287
+ return `# Mastra Documentation System - Complete Guide
1288
+
1289
+ This MCP server provides **TWO** documentation sources. Choose based on your needs:
1290
+
1291
+ ---
1292
+
1293
+ ## \u{1F4E6} LOCAL PACKAGE DOCS (Your Installed Packages)
1294
+
1295
+ Found ${packages.length} installed package(s) with embedded documentation:
1296
+ ${packages.map((pkg) => `- ${pkg}`).join("\n")}
1297
+
1298
+ **SOURCE**: Your node_modules (matches installed code version)
1299
+ **USE WHEN**: Writing code, implementing features, debugging, checking APIs
1300
+
1301
+ ### Available LOCAL Tools:
1302
+
1303
+ **1. listMastraPackages** - List installed packages
1304
+ Returns: Packages with embedded docs
1305
+
1306
+ **2. getMastraExports** - Explore package API surface
1307
+ Example: See all exports from @mastra/core (Agent, Tool, Workflow, etc.)
1308
+ Returns: List of exports with source file locations
1309
+
1310
+ **3. getMastraExportDetails** - Get type definitions & code
1311
+ Example: Get full TypeScript types for Agent class
1312
+ Returns: Complete type definitions and optionally implementation source
1313
+
1314
+ **4. readMastraDocs** - Read comprehensive guides
1315
+ Example: Read documentation about agents, tools, workflows, memory
1316
+ Returns: Topic-based guides and examples from your installed version
1317
+
1318
+ **5. searchMastraDocs** - Search local documentation
1319
+ Example: Search for "memory processors" or "semantic recall"
1320
+ Returns: Relevant excerpts from your installed docs
1321
+
1322
+ ### Typical LOCAL Workflow:
1323
+ 1. listMastraPackages \u2192 see what's installed
1324
+ 2. getMastraExports \u2192 explore package API
1325
+ 3. getMastraExportDetails \u2192 get type definitions
1326
+ 4. readMastraDocs \u2192 learn concepts
1327
+ 5. searchMastraDocs \u2192 find specific info
1328
+
1329
+ ---
1330
+
1331
+ ## \u{1F310} REMOTE WEBSITE DOCS (mastra.ai)
1332
+
1333
+ **SOURCE**: https://mastra.ai (latest published documentation)
1334
+ **USE WHEN**: Learning new concepts, checking latest features, migration guides
1335
+
1336
+ ### Available REMOTE Tools:
1337
+
1338
+ **mastraDocs** - Browse official documentation
1339
+ Latest guides, references, and tutorials
1340
+
1341
+ **mastraBlog** - Read blog posts and announcements
1342
+ News, features, changelogs
1343
+
1344
+ **mastraExamples** - Get curated code examples
1345
+ Full example applications
1346
+
1347
+ **mastraChanges** - View package changelogs
1348
+ See what's new in each version
1349
+
1350
+ **mastraMigration** - Get migration guides
1351
+ Upgrade between versions
1352
+
1353
+ \u26A0\uFE0F **Version Note**: Remote docs show latest published version. For API reference matching YOUR code, use LOCAL tools above.
1354
+
1355
+ ---
1356
+
1357
+ ## \u{1F393} INTERACTIVE COURSE
1358
+
1359
+ **startMastraCourse**, **getMastraCourseStatus**, **startMastraCourseLesson**, **nextMastraCourseStep**, **clearMastraCourseHistory**
1360
+
1361
+ Guided learning experience with hands-on exercises.
1362
+
1363
+ ---
1364
+
1365
+ ## Quick Start Recommendations
1366
+
1367
+ **If you're writing code**: Use LOCAL tools
1368
+ \u2192 Start with listMastraPackages
1369
+
1370
+ **If you're learning**: Use REMOTE tools
1371
+ \u2192 Start with mastraDocs
1372
+
1373
+ **If version differs**: Check changes
1374
+ \u2192 mastraChanges \u2192 mastraMigration`;
1375
+ }
1376
+ };
1377
+ var listInstalledPackagesTool = {
1378
+ name: "listMastraPackages",
1379
+ description: `[\u{1F4E6} LOCAL PACKAGES] Discover which Mastra packages are installed and have documentation available.
1380
+
1381
+ Use this when you need to:
1382
+ - See what Mastra packages you can work with
1383
+ - Start exploring Mastra documentation
1384
+ - Check if a specific package is available
1385
+
1386
+ Returns: List of @mastra/* packages (core, memory, rag, etc.) with embedded docs.
1387
+ Next step: Use getMastraExports to explore a specific package's API.`,
1388
+ parameters: z.object({
1389
+ projectPath: z.string().describe("Absolute path to your project root (we will search upward for node_modules with Mastra packages)")
1390
+ }),
1391
+ execute: async (args) => {
1392
+ void logger.debug("Executing listInstalledMastraPackages tool", {
1393
+ projectPath: args.projectPath,
1394
+ cwd: process.cwd(),
1395
+ env: {
1396
+ PWD: process.env.PWD,
1397
+ HOME: process.env.HOME
1398
+ }
1399
+ });
1400
+ const packages = await getInstalledMastraPackages(args.projectPath);
1401
+ if (packages.length === 0) {
1402
+ return `No @mastra/* packages with embedded docs found in your project.
1403
+
1404
+ Install Mastra packages to get started:
1405
+ - npm install @mastra/core
1406
+ - npm install @mastra/memory
1407
+ - npm install @mastra/rag`;
1408
+ }
1409
+ return [
1410
+ `# Installed Mastra Packages`,
1411
+ "",
1412
+ `Found ${packages.length} package(s) with embedded documentation:`,
1413
+ "",
1414
+ ...packages.map((pkg) => `- ${pkg}`),
1415
+ "",
1416
+ "## Next Steps",
1417
+ "",
1418
+ "1. Use **getMastraExports** with a package name to see all available APIs",
1419
+ "2. Use **readMastraDocs** with a package name to browse topic guides",
1420
+ "3. Use **searchMastraDocs** to find specific information"
1421
+ ].join("\n");
1422
+ }
1423
+ };
1424
+ var readSourceMapTool = {
1425
+ name: "getMastraExports",
1426
+ description: `[\u{1F4E6} LOCAL PACKAGES] Explore the complete API surface of a Mastra package - see all classes, functions, types, and constants.
1427
+
1428
+ Use this when you need to:
1429
+ - Discover what APIs a Mastra package provides (Agent, Tool, Workflow, etc.)
1430
+ - See all available classes and functions before implementing
1431
+ - Find the right export for your use case
1432
+ - Understand package structure and organization
1433
+
1434
+ Returns: List of all exports with their source file locations.
1435
+ Next step: Use getMastraExportDetails to get full type definitions and code for a specific export.`,
1436
+ parameters: z.object({
1437
+ package: z.string().describe('Package name to explore (e.g., "@mastra/core", "@mastra/memory", "@mastra/rag")'),
1438
+ projectPath: z.string().describe("Absolute path to your project root (we will search upward for node_modules)"),
1439
+ filter: z.string().optional().describe('Optional: filter exports by name (case-insensitive, e.g., "Agent", "create", "Tool")')
1440
+ }),
1441
+ execute: async (args) => {
1442
+ void logger.debug("Executing readMastraSourceMap tool", { args });
1443
+ const sourceMap = await readSourceMap(args.package, args.projectPath);
1444
+ if (!sourceMap) return `No SOURCE_MAP.json found for ${args.package}.`;
1445
+ let exports$1 = Object.entries(sourceMap.exports);
1446
+ if (args.filter) {
1447
+ const filterLower = args.filter.toLowerCase();
1448
+ exports$1 = exports$1.filter(([name]) => name.toLowerCase().includes(filterLower));
1449
+ }
1450
+ if (exports$1.length === 0) {
1451
+ return args.filter ? `No exports matching "${args.filter}" in ${args.package}.
1452
+
1453
+ Try running without a filter to see all available exports.` : `No exports found in ${args.package}.`;
1454
+ }
1455
+ return [
1456
+ `# ${sourceMap.package} v${sourceMap.version} - API Exports`,
1457
+ "",
1458
+ `Found ${exports$1.length} export(s)${args.filter ? ` matching "${args.filter}"` : ""}:`,
1459
+ "",
1460
+ ...exports$1.map(([name, info]) => {
1461
+ const line = info.line ? `:${info.line}` : "";
1462
+ return `- **${name}**: \`${info.implementation}${line}\``;
1463
+ }),
1464
+ "",
1465
+ "## Next Steps",
1466
+ "",
1467
+ "- Use **getMastraExportDetails** with an export name to see full type definitions and code",
1468
+ "- Use **readMastraDocs** to read conceptual guides and examples",
1469
+ "- Use **searchMastraDocs** to find specific topics or patterns"
1470
+ ].join("\n");
1471
+ }
1472
+ };
1473
+ var findExportTool = {
1474
+ name: "getMastraExportDetails",
1475
+ description: `[\u{1F4E6} LOCAL PACKAGES] Get complete API reference for a specific Mastra export - type definitions, interfaces, and optionally source code.
1476
+
1477
+ Use this when you need to:
1478
+ - Understand how to use a specific Mastra class or function (Agent, Tool, Workflow, etc.)
1479
+ - See TypeScript type definitions and interfaces
1480
+ - Look up method signatures and parameters
1481
+ - Read implementation code and examples
1482
+ - Understand constructor options and configuration
1483
+
1484
+ Returns: Full TypeScript type definitions and optionally implementation source code.
1485
+ Example: Get details on the Agent class to see how to create and configure agents.`,
1486
+ parameters: z.object({
1487
+ package: z.string().describe('Package name (e.g., "@mastra/core", "@mastra/memory")'),
1488
+ exportName: z.string().describe('Exact export name to look up (e.g., "Agent", "createTool", "Workflow")'),
1489
+ includeTypes: z.boolean().optional().default(true).describe("Include TypeScript type definitions (recommended: true)"),
1490
+ includeImplementation: z.boolean().optional().default(false).describe("Include source code implementation (useful for understanding internals)"),
1491
+ implementationLines: z.number().optional().default(50).describe("Number of lines of implementation code to show (default: 50)"),
1492
+ projectPath: z.string().describe("Absolute path to your project root (we will search upward for node_modules)")
1493
+ }),
1494
+ execute: async (args) => {
1495
+ void logger.debug("Executing findMastraExport tool", { args });
1496
+ const sourceMap = await readSourceMap(args.package, args.projectPath);
1497
+ if (!sourceMap) return `No SOURCE_MAP.json found for ${args.package}.`;
1498
+ const exportInfo = sourceMap.exports[args.exportName];
1499
+ if (!exportInfo) {
1500
+ const match = Object.entries(sourceMap.exports).find(
1501
+ ([name]) => name.toLowerCase() === args.exportName.toLowerCase()
1502
+ );
1503
+ if (match) {
1504
+ return `Export "${args.exportName}" not found. Did you mean "${match[0]}"?
1505
+
1506
+ Run getMastraExports with package="${args.package}" to see all available exports.`;
1507
+ }
1508
+ return `Export "${args.exportName}" not found in ${args.package}.
1509
+
1510
+ Run getMastraExports with package="${args.package}" to see all available exports.`;
1511
+ }
1512
+ const packageInfo = await getPackageRootPath(args.package, args.projectPath);
1513
+ if (!packageInfo) {
1514
+ return `Package ${args.package} not found. Make sure it's installed.`;
1515
+ }
1516
+ const output = [`# ${args.exportName} (${args.package})`, ""];
1517
+ if (args.includeTypes !== false) {
1518
+ try {
1519
+ const typesPath = path5__default.join(packageInfo.rootPath, exportInfo.types);
1520
+ const typesContent = await fs3.readFile(typesPath, "utf-8");
1521
+ output.push("## Type Definition", "", `\`${exportInfo.types}\``, "", "```typescript");
1522
+ const lines = typesContent.split("\n");
1523
+ let startLine = lines.findIndex((line) => line.includes(args.exportName));
1524
+ if (startLine === -1) {
1525
+ output.push(typesContent.slice(0, 2e3));
1526
+ } else {
1527
+ startLine = Math.max(0, startLine - 2);
1528
+ let endLine = Math.min(lines.length, startLine + 50);
1529
+ output.push(lines.slice(startLine, endLine).join("\n"));
1530
+ }
1531
+ output.push("```", "");
1532
+ } catch {
1533
+ output.push("## Type Definition", "", `Could not read: ${exportInfo.types}`, "");
1534
+ }
1535
+ }
1536
+ if (args.includeImplementation) {
1537
+ try {
1538
+ const implPath = path5__default.join(packageInfo.rootPath, exportInfo.implementation);
1539
+ const implContent = await fs3.readFile(implPath, "utf-8");
1540
+ const lines = implContent.split("\n");
1541
+ const numLines = args.implementationLines || 50;
1542
+ output.push("## Implementation", "");
1543
+ output.push(`\`${exportInfo.implementation}\`${exportInfo.line ? ` (line ${exportInfo.line})` : ""}`);
1544
+ output.push("", "```javascript");
1545
+ const startLine = exportInfo.line ? Math.max(0, exportInfo.line - 1) : 0;
1546
+ const endLine = Math.min(lines.length, startLine + numLines);
1547
+ output.push(lines.slice(startLine, endLine).join("\n"));
1548
+ if (endLine < lines.length) output.push(`// ... ${lines.length - endLine} more lines`);
1549
+ output.push("```", "");
1550
+ } catch {
1551
+ output.push("## Implementation", "", `Could not read: ${exportInfo.implementation}`, "");
1552
+ }
1553
+ }
1554
+ output.push(
1555
+ "## Next Steps",
1556
+ "",
1557
+ "- Use **readMastraDocs** to see practical guides and examples",
1558
+ "- Use **searchMastraDocs** to find usage patterns and best practices",
1559
+ "- Use **getMastraExports** to explore related APIs"
1560
+ );
1561
+ return output.join("\n");
1562
+ }
1563
+ };
1564
+ var readEmbeddedDocsTool = {
1565
+ name: "readMastraDocs",
1566
+ description: `[\u{1F4E6} LOCAL PACKAGES] Read comprehensive guides and documentation on Mastra concepts, patterns, and implementation examples.
1567
+
1568
+ Use this when you need to:
1569
+ - Learn how to implement Mastra features (agents, tools, workflows, memory, RAG, etc.)
1570
+ - Understand Mastra architecture and design patterns
1571
+ - See practical code examples and tutorials
1572
+ - Read getting started guides and best practices
1573
+ - Understand how different components work together
1574
+
1575
+ Returns: Topic-based documentation with explanations, examples, and usage patterns.
1576
+ Available topics: agents, tools, workflows, memory, rag, integrations, deployment, and more.`,
1577
+ parameters: z.object({
1578
+ package: z.string().describe('Package name to read docs from (e.g., "@mastra/core", "@mastra/memory")'),
1579
+ topic: z.string().optional().describe(
1580
+ 'Optional: topic folder to read (e.g., "agents", "tools", "workflows"). Omit to list all available topics.'
1581
+ ),
1582
+ file: z.string().optional().describe('Optional: specific documentation file within the topic (e.g., "01-overview.md")'),
1583
+ projectPath: z.string().describe("Absolute path to your project root (we will search upward for node_modules)")
1584
+ }),
1585
+ execute: async (args) => {
1586
+ void logger.debug("Executing readMastraEmbeddedDocs tool", { args });
1587
+ const packageInfo = await getPackageRootPath(args.package, args.projectPath);
1588
+ if (!packageInfo) {
1589
+ return `Package ${args.package} not found. Make sure it's installed.`;
1590
+ }
1591
+ const docsPath = path5__default.join(packageInfo.rootPath, "dist", "docs");
1592
+ try {
1593
+ await fs3.stat(docsPath);
1594
+ } catch {
1595
+ return `No embedded docs found for ${args.package}.
1596
+
1597
+ Make sure the package is installed and has documentation generated.`;
1598
+ }
1599
+ if (!args.topic) {
1600
+ const entries = await fs3.readdir(docsPath, { withFileTypes: true });
1601
+ const topics = entries.filter((e) => e.isDirectory()).map((e) => e.name);
1602
+ const files = entries.filter((e) => e.isFile()).map((e) => e.name);
1603
+ return [
1604
+ `# ${args.package} - Available Documentation`,
1605
+ "",
1606
+ "## Root Files",
1607
+ ...files.map((f) => `- ${f}`),
1608
+ "",
1609
+ "## Documentation Topics",
1610
+ ...topics.map((t) => `- **${t}/** - Run readMastraDocs with topic="${t}" to read`),
1611
+ "",
1612
+ "## Next Steps",
1613
+ "",
1614
+ "- Choose a topic and run **readMastraDocs** with the topic parameter",
1615
+ "- Use **searchMastraDocs** to search for specific information",
1616
+ "- Use **getMastraExports** to see available APIs"
1617
+ ].join("\n");
1618
+ }
1619
+ const topicPath = path5__default.join(docsPath, args.topic);
1620
+ if (args.file) {
1621
+ try {
1622
+ const content = await fs3.readFile(path5__default.join(topicPath, args.file), "utf-8");
1623
+ return `# ${args.package}/${args.topic}/${args.file}
1624
+
1625
+ ${content}
1626
+
1627
+ ## Next Steps
1628
+
1629
+ - Use **getMastraExportDetails** to see API references for specific classes/functions mentioned
1630
+ - Use **searchMastraDocs** to find related topics
1631
+ - Use **getMastraExports** to explore available APIs`;
1632
+ } catch {
1633
+ return `File not found: ${args.topic}/${args.file}
1634
+
1635
+ Run readMastraDocs with package="${args.package}" and topic="${args.topic}" (without file parameter) to see available files.`;
1636
+ }
1637
+ }
1638
+ try {
1639
+ const entries = await fs3.readdir(topicPath, { withFileTypes: true });
1640
+ const files = entries.filter((e) => e.isFile() && e.name.endsWith(".md")).sort();
1641
+ if (files.length === 0) {
1642
+ return `No markdown files in ${args.topic}/
1643
+
1644
+ Run readMastraDocs with package="${args.package}" (without topic parameter) to see available topics.`;
1645
+ }
1646
+ const contents = [`# ${args.package} - ${args.topic}`, ""];
1647
+ for (const file of files) {
1648
+ const content = await fs3.readFile(path5__default.join(topicPath, file.name), "utf-8");
1649
+ contents.push(`## ${file.name}`, "", content, "", "---", "");
1650
+ }
1651
+ contents.push(
1652
+ "",
1653
+ "## Next Steps",
1654
+ "",
1655
+ "- Use **getMastraExportDetails** to see API references for specific classes/functions mentioned above",
1656
+ "- Use **searchMastraDocs** to find related information",
1657
+ "- Use **getMastraExports** to explore the complete API surface"
1658
+ );
1659
+ return contents.join("\n");
1660
+ } catch {
1661
+ return `Topic not found: ${args.topic}
1662
+
1663
+ Run readMastraDocs with package="${args.package}" (without topic parameter) to see available topics.`;
1664
+ }
1665
+ }
1666
+ };
1667
+ var searchEmbeddedDocsTool = {
1668
+ name: "searchMastraDocs",
1669
+ description: `[\u{1F4E6} LOCAL PACKAGES] Search across all Mastra documentation to find specific information, patterns, or examples.
1670
+
1671
+ Use this when you need to:
1672
+ - Find specific topics or concepts quickly (e.g., "memory processors", "tool composition")
1673
+ - Locate examples of specific features or patterns
1674
+ - Search for error messages or troubleshooting info
1675
+ - Find mentions of specific APIs or configuration options
1676
+ - Discover where a feature is documented
1677
+
1678
+ Returns: Relevant documentation excerpts with file paths, ranked by relevance.
1679
+ Tip: Use specific terms for better results (e.g., "agent memory" vs "memory").`,
1680
+ parameters: z.object({
1681
+ query: z.string().describe('What to search for (case-insensitive, e.g., "workflow steps", "vector store", "authentication")'),
1682
+ package: z.string().optional().describe('Optional: limit search to a specific package (e.g., "@mastra/core"). Omit to search all packages.'),
1683
+ maxResults: z.number().optional().default(10).describe("Optional: maximum number of results to return (default: 10)"),
1684
+ projectPath: z.string().describe("Absolute path to your project root (we will search upward for node_modules)")
1685
+ }),
1686
+ execute: async (args) => {
1687
+ void logger.debug("Executing searchMastraEmbeddedDocs tool", { args });
1688
+ const packages = args.package ? [args.package] : await getInstalledMastraPackages(args.projectPath);
1689
+ if (packages.length === 0) return "No Mastra packages found.";
1690
+ const queryLower = args.query.toLowerCase();
1691
+ const results = [];
1692
+ for (const pkg of packages) {
1693
+ const packageInfo = await getPackageRootPath(pkg, args.projectPath);
1694
+ if (!packageInfo) continue;
1695
+ const docsPath = path5__default.join(packageInfo.rootPath, "dist", "docs");
1696
+ try {
1697
+ const findFiles = async (dir) => {
1698
+ const entries = await fs3.readdir(dir, { withFileTypes: true });
1699
+ const files = [];
1700
+ for (const entry of entries) {
1701
+ const fullPath = path5__default.join(dir, entry.name);
1702
+ if (entry.isDirectory()) files.push(...await findFiles(fullPath));
1703
+ else if (entry.name.endsWith(".md")) files.push(fullPath);
1704
+ }
1705
+ return files;
1706
+ };
1707
+ for (const file of await findFiles(docsPath)) {
1708
+ const content = await fs3.readFile(file, "utf-8");
1709
+ if (!content.toLowerCase().includes(queryLower)) continue;
1710
+ const lines = content.split("\n");
1711
+ for (let i = 0; i < lines.length; i++) {
1712
+ if (lines[i]?.toLowerCase().includes(queryLower)) {
1713
+ const start = Math.max(0, i - 1);
1714
+ const end = Math.min(lines.length, i + 3);
1715
+ const excerpt = lines.slice(start, end).join("\n").slice(0, 300);
1716
+ const contentLower = content.toLowerCase();
1717
+ const occurrences = contentLower.split(queryLower).length - 1;
1718
+ results.push({
1719
+ pkg,
1720
+ file: path5__default.relative(docsPath, file),
1721
+ excerpt,
1722
+ score: occurrences
1723
+ });
1724
+ break;
1725
+ }
1726
+ }
1727
+ }
1728
+ } catch {
1729
+ }
1730
+ }
1731
+ results.sort((a, b) => b.score - a.score);
1732
+ const topResults = results.slice(0, args.maxResults || 10);
1733
+ if (topResults.length === 0) {
1734
+ return `No results found for "${args.query}".
1735
+
1736
+ Try:
1737
+ - Using different search terms
1738
+ - Searching for broader topics
1739
+ - Using **listMastraPackages** to see available packages
1740
+ - Using **readMastraDocs** to browse documentation by topic`;
1741
+ }
1742
+ return [
1743
+ `# Search Results: "${args.query}"`,
1744
+ "",
1745
+ `Found ${results.length} result(s), showing top ${topResults.length}:`,
1746
+ "",
1747
+ ...topResults.map((r, i) => `## ${i + 1}. ${r.pkg} - ${r.file}
1748
+
1749
+ \`\`\`
1750
+ ${r.excerpt}
1751
+ \`\`\`
1752
+ `),
1753
+ "",
1754
+ "## Next Steps",
1755
+ "",
1756
+ "- Use **readMastraDocs** with a package and topic to read full documentation",
1757
+ "- Use **getMastraExportDetails** to see API details for mentioned classes/functions",
1758
+ "- Refine your search with more specific terms if needed"
1759
+ ].join("\n");
1760
+ }
1761
+ };
1762
+ var embeddedDocsTools = {
1763
+ getMastraHelp: getMastraHelpTool,
1764
+ listMastraPackages: listInstalledPackagesTool,
1765
+ getMastraExports: readSourceMapTool,
1766
+ getMastraExportDetails: findExportTool,
1767
+ readMastraDocs: readEmbeddedDocsTool,
1768
+ searchMastraDocs: searchEmbeddedDocsTool
1769
+ };
1770
+ var migrationsBaseDir = fromPackageRoot(".docs/guides/migrations");
1771
+ function parseSections(content) {
1772
+ const lines = content.split("\n");
1773
+ const sections = [];
1774
+ let currentSection = null;
1775
+ let inFrontmatter = false;
1776
+ let contentStarted = false;
1777
+ for (let index = 0; index < lines.length; index++) {
1778
+ const line = lines[index];
1779
+ if (index === 0 && line === "---") {
1780
+ inFrontmatter = true;
1781
+ continue;
1782
+ }
1783
+ if (inFrontmatter && line === "---") {
1784
+ inFrontmatter = false;
1785
+ continue;
1786
+ }
1787
+ if (inFrontmatter) continue;
1788
+ contentStarted = true;
1789
+ const headingMatch = line?.match(/^(#{2,3})\s+(.+)$/);
1790
+ if (headingMatch && contentStarted) {
1791
+ if (currentSection) {
1792
+ currentSection.endLine = index - 1;
1793
+ sections.push(currentSection);
1794
+ }
1795
+ const level = headingMatch[1]?.length ?? 0;
1796
+ currentSection = {
1797
+ title: headingMatch[2] || "Untitled",
1798
+ level,
1799
+ content: line + "\n",
1800
+ startLine: index,
1801
+ endLine: index
1802
+ };
1803
+ } else if (currentSection) {
1804
+ currentSection.content += line + "\n";
1805
+ }
1806
+ }
1807
+ if (currentSection) {
1808
+ currentSection.endLine = lines.length - 1;
1809
+ sections.push(currentSection);
1810
+ }
1811
+ return sections;
1812
+ }
1813
+ async function discoverMigrations(baseDir, relativePath = "") {
1814
+ const migrations = [];
1815
+ const fullPath = path5__default.join(baseDir, relativePath);
1045
1816
  try {
1817
+ const entries = await fs3.readdir(fullPath, { withFileTypes: true });
1818
+ for (const entry of entries) {
1819
+ const entryRelativePath = path5__default.join(relativePath, entry.name);
1820
+ if (entry.isDirectory()) {
1821
+ migrations.push({
1822
+ path: entryRelativePath,
1823
+ type: "directory"
1824
+ });
1825
+ const subMigrations = await discoverMigrations(baseDir, entryRelativePath);
1826
+ migrations.push(...subMigrations);
1827
+ } else if (entry.isFile() && entry.name.endsWith(".md")) {
1828
+ const cleanName = entry.name.replace(/\.md$/, "");
1829
+ migrations.push({
1830
+ path: relativePath ? path5__default.join(relativePath, cleanName) : cleanName,
1831
+ type: "file"
1832
+ });
1833
+ }
1834
+ }
1835
+ } catch (error) {
1836
+ void logger.error(`Failed to discover migrations in ${fullPath}`, error);
1837
+ }
1838
+ return migrations;
1839
+ }
1840
+ async function listDirectoryContents(dirPath = "") {
1841
+ try {
1842
+ const fullPath = path5__default.join(migrationsBaseDir, dirPath);
1843
+ const resolvedPath = path5__default.resolve(fullPath);
1844
+ const resolvedBaseDir = path5__default.resolve(migrationsBaseDir);
1845
+ if (!resolvedPath.startsWith(resolvedBaseDir)) {
1846
+ return "Invalid path";
1847
+ }
1848
+ const entries = await fs3.readdir(fullPath, { withFileTypes: true });
1849
+ const directories = [];
1850
+ const files = [];
1851
+ for (const entry of entries) {
1852
+ if (entry.isDirectory()) {
1853
+ directories.push(entry.name);
1854
+ } else if (entry.isFile() && entry.name.endsWith(".md")) {
1855
+ files.push(entry.name.replace(/\.md$/, ""));
1856
+ }
1857
+ }
1858
+ const output = [];
1859
+ const currentPath = dirPath || "migrations";
1860
+ output.push(`# ${currentPath}`);
1861
+ output.push("");
1862
+ if (directories.length > 0) {
1863
+ output.push("**Directories:**");
1864
+ directories.sort().forEach((dir) => {
1865
+ const nextPath = dirPath ? `${dirPath}/${dir}` : dir;
1866
+ output.push(`- **${dir}/** - Explore with \`{ path: "${nextPath}/" }\``);
1867
+ });
1868
+ output.push("");
1869
+ }
1870
+ if (files.length > 0) {
1871
+ output.push("**Migration Guides:**");
1872
+ files.sort().forEach((file) => {
1873
+ const filePath = dirPath ? `${dirPath}/${file}` : file;
1874
+ output.push(`- **${file}** - Get with \`{ path: "${filePath}" }\``);
1875
+ });
1876
+ output.push("");
1877
+ }
1878
+ if (directories.length === 0 && files.length === 0) {
1879
+ output.push("No migrations found in this directory.");
1880
+ }
1881
+ output.push("---");
1882
+ output.push("");
1883
+ output.push("**Actions:**");
1884
+ output.push("- Navigate to a directory by setting `path` to directory name with trailing `/`");
1885
+ output.push("- View a migration guide by setting `path` to the guide name");
1886
+ output.push("- List sections in a guide with `listSections: true`");
1887
+ output.push("- Search all guides with `queryKeywords`");
1888
+ return output.join("\n");
1889
+ } catch (error) {
1890
+ if (error.code === "ENOENT") {
1891
+ return `Directory "${dirPath}" not found. Use \`{}\` to see top-level migrations.`;
1892
+ }
1893
+ throw error;
1894
+ }
1895
+ }
1896
+ async function readMigrationContent(migrationPath) {
1897
+ try {
1898
+ const cleanPath = migrationPath.replace(/\.(mdx|md)$/, "");
1899
+ const filePath = path5__default.join(migrationsBaseDir, cleanPath + ".md");
1900
+ const resolvedPath = path5__default.resolve(filePath);
1901
+ const resolvedBaseDir = path5__default.resolve(migrationsBaseDir);
1902
+ if (!resolvedPath.startsWith(resolvedBaseDir)) {
1903
+ void logger.error("Path traversal attempt detected");
1904
+ return null;
1905
+ }
1046
1906
  const content = await fs3.readFile(filePath, "utf-8");
1047
1907
  return content;
1048
- } catch {
1049
- const examples = await listCodeExamples();
1050
- const availableExamples = examples.map((ex) => `- ${ex.name}`).join("\n");
1051
- const contentBasedSuggestions = await getMatchingPaths(filename, queryKeywords, examplesDir);
1052
- return `Example "${filename}" not found.
1908
+ } catch (error) {
1909
+ void logger.error(`Failed to read migration: ${migrationPath}`, error);
1910
+ return null;
1911
+ }
1912
+ }
1913
+ async function getSectionHeaders(migrationPath) {
1914
+ const content = await readMigrationContent(migrationPath);
1915
+ if (!content) return [];
1916
+ const sections = parseSections(content);
1917
+ return sections.map((s) => ({ title: s.title, level: s.level }));
1918
+ }
1919
+ async function getSections(migrationPath, sectionTitles) {
1920
+ const content = await readMigrationContent(migrationPath);
1921
+ if (!content) {
1922
+ const availableMigrations = await discoverMigrations(migrationsBaseDir);
1923
+ const paths = availableMigrations.filter((m) => m.type === "file").map((m) => `- ${m.path}`);
1924
+ return `Migration "${migrationPath}" not found.
1053
1925
 
1054
- Available examples:
1055
- ${availableExamples}
1926
+ Available migrations:
1927
+ ${paths.join("\n")}`;
1928
+ }
1929
+ if (!sectionTitles || sectionTitles.length === 0) {
1930
+ return content;
1931
+ }
1932
+ const sections = parseSections(content);
1933
+ const requestedSections = sections.filter(
1934
+ (s) => sectionTitles.some((title) => s.title.toLowerCase().includes(title.toLowerCase()))
1935
+ );
1936
+ if (requestedSections.length === 0) {
1937
+ const availableHeaders = sections.map((s) => `${"#".repeat(s.level)} ${s.title}`).join("\n");
1938
+ return `Requested sections not found in "${migrationPath}".
1056
1939
 
1057
- ${contentBasedSuggestions}`;
1940
+ Available sections:
1941
+ ${availableHeaders}`;
1058
1942
  }
1943
+ return requestedSections.map((s) => s.content).join("\n---\n\n");
1059
1944
  }
1060
- var initialExamples = await listCodeExamples();
1061
- var examplesListing = initialExamples.length > 0 ? "\n\nAvailable examples: " + initialExamples.map((ex) => ex.name).join(", ") : "\n\nNo examples available yet. Run the documentation preparation script first.";
1062
- var examplesInputSchema = z.object({
1063
- example: z.string().optional().describe(
1064
- "Name of the specific example to fetch. If not provided, lists all available examples." + examplesListing
1945
+ var initialMigrations = await discoverMigrations(migrationsBaseDir);
1946
+ var migrationFiles = initialMigrations.filter((m) => m.type === "file");
1947
+ var migrationsListing = migrationFiles.length > 0 ? "\n\nExample migration paths:\n" + migrationFiles.slice(0, 5).map((m) => `- ${m.path}`).join("\n") + "\n..." : "\n\nNo migrations available. Run the documentation preparation script first.";
1948
+ var migrationInputSchema = z.object({
1949
+ path: z.string().optional().describe(
1950
+ 'Path to the migration guide (e.g., "upgrade-to-v1/agent", "agentnetwork"). If not provided, lists all available migrations.' + migrationsListing
1065
1951
  ),
1066
- queryKeywords: z.array(z.string()).optional().describe(
1067
- "Keywords from user query to use for matching examples. Each keyword should be a single word or short phrase; any whitespace-separated keywords will be split automatically."
1068
- )
1952
+ sections: z.array(z.string()).optional().describe(
1953
+ "Specific section titles to fetch from the migration guide. If not provided, returns the entire guide. Use this after exploring section headers."
1954
+ ),
1955
+ listSections: z.boolean().optional().describe("Set to true to list all section headers in a migration guide without fetching full content."),
1956
+ queryKeywords: z.array(z.string()).optional().describe("Keywords to search across all migration guides. Use this to find guides related to specific topics.")
1069
1957
  });
1070
- var examplesTool = {
1071
- name: "mastraExamples",
1072
- description: `Get code examples from the Mastra.ai examples directory.
1073
- Without a specific example name, lists all available examples.
1074
- With an example name, returns the full source code of that example.
1075
- You can also use keywords from the user query to find relevant examples, but prioritize example names.`,
1076
- parameters: examplesInputSchema,
1958
+ var migrationTool = {
1959
+ name: "mastraMigration",
1960
+ description: `[\u{1F310} REMOTE] Get migration guidance for Mastra version upgrades and breaking changes.
1961
+
1962
+ This tool works like a file browser - navigate through directories to find migration guides:
1963
+
1964
+ **Step 1: List top-level migrations**
1965
+ - Call with no parameters: \`{}\`
1966
+ - Shows all top-level migration guides and directories
1967
+
1968
+ **Step 2: Navigate into a directory**
1969
+ - Add trailing slash to explore: \`{ path: "upgrade-to-v1/" }\`
1970
+ - Lists all migration guides in that directory
1971
+
1972
+ **Step 3: View a migration guide**
1973
+ - Without trailing slash: \`{ path: "upgrade-to-v1/agent" }\`
1974
+ - Returns the full migration guide content
1975
+
1976
+ **Step 4: Explore guide sections (optional)**
1977
+ - List sections: \`{ path: "upgrade-to-v1/agent", listSections: true }\`
1978
+ - Get specific sections: \`{ path: "upgrade-to-v1/agent", sections: ["Voice methods"] }\`
1979
+
1980
+ **Alternative: Search by keywords**
1981
+ - \`{ queryKeywords: ["RuntimeContext", "pagination"] }\`
1982
+
1983
+ **Examples:**
1984
+ 1. List top-level: \`{}\`
1985
+ 2. Navigate to upgrade-to-v1: \`{ path: "upgrade-to-v1/" }\`
1986
+ 3. Get agent guide: \`{ path: "upgrade-to-v1/agent" }\`
1987
+ 4. List guide sections: \`{ path: "upgrade-to-v1/agent", listSections: true }\`
1988
+ 5. Search: \`{ queryKeywords: ["RuntimeContext"] }\`
1989
+
1990
+ **Tip:** Paths ending with \`/\` list directory contents. Paths without \`/\` fetch the migration guide.`,
1991
+ parameters: migrationInputSchema,
1077
1992
  execute: async (args) => {
1078
- void logger.debug("Executing mastraExamples tool", { example: args.example });
1993
+ void logger.debug("Executing mastraMigration tool", { args });
1079
1994
  try {
1080
- if (!args.example) {
1081
- const examples = await listCodeExamples();
1082
- return ["Available code examples:", "", ...examples.map((ex) => `- ${ex.name}`)].join("\n");
1995
+ if (args.queryKeywords && args.queryKeywords.length > 0) {
1996
+ const suggestions = await getMatchingPaths("", args.queryKeywords, migrationsBaseDir);
1997
+ return [
1998
+ "# Migration Guide Search Results",
1999
+ "",
2000
+ suggestions || "No migration guides found matching your keywords.",
2001
+ "",
2002
+ "---",
2003
+ "",
2004
+ "To see all available migrations, call with no parameters."
2005
+ ].join("\n");
1083
2006
  }
1084
- const filename = args.example.endsWith(".md") ? args.example : `${args.example}.md`;
1085
- const result = await readCodeExample(filename, args.queryKeywords || []);
1086
- return result;
2007
+ if (args.path) {
2008
+ if (args.path.endsWith("/")) {
2009
+ const dirPath = args.path.slice(0, -1);
2010
+ return await listDirectoryContents(dirPath);
2011
+ }
2012
+ if (args.listSections) {
2013
+ const headers = await getSectionHeaders(args.path);
2014
+ if (headers.length === 0) {
2015
+ return await listDirectoryContents();
2016
+ }
2017
+ return [
2018
+ `# ${args.path} - Section Headers`,
2019
+ "",
2020
+ "Available sections in this migration guide:",
2021
+ "",
2022
+ ...headers.map((h) => `${"#".repeat(h.level)} ${h.title}`),
2023
+ "",
2024
+ "---",
2025
+ "",
2026
+ 'To get specific sections, provide their titles in the "sections" parameter.'
2027
+ ].join("\n");
2028
+ }
2029
+ const content = await getSections(args.path, args.sections);
2030
+ return `# ${args.path}
2031
+
2032
+ ${content}`;
2033
+ }
2034
+ return await listDirectoryContents();
1087
2035
  } catch (error) {
1088
- void logger.error("Failed to execute mastraExamples tool", error);
2036
+ void logger.error("Failed to execute mastraMigration tool", error);
1089
2037
  throw error;
1090
2038
  }
1091
2039
  }
@@ -1093,29 +2041,21 @@ var examplesTool = {
1093
2041
 
1094
2042
  // src/index.ts
1095
2043
  var server;
1096
- if (process.env.REBUILD_DOCS_ON_START === "true") {
1097
- void logger.info("Rebuilding docs on start");
1098
- try {
1099
- await prepare();
1100
- void logger.info("Docs rebuilt successfully");
1101
- } catch (error) {
1102
- void logger.error("Failed to rebuild docs", error);
1103
- }
1104
- }
1105
2044
  server = new MCPServer({
1106
2045
  name: "Mastra Documentation Server",
1107
2046
  version: JSON.parse(await fs3.readFile(fromPackageRoot(`package.json`), "utf8")).version,
1108
2047
  tools: {
1109
- mastraBlog: blogTool,
1110
2048
  mastraDocs: docsTool,
1111
- mastraExamples: examplesTool,
1112
- mastraChanges: changesTool,
2049
+ mastraMigration: migrationTool,
1113
2050
  startMastraCourse,
1114
2051
  getMastraCourseStatus,
1115
2052
  startMastraCourseLesson,
1116
2053
  nextMastraCourseStep,
1117
- clearMastraCourseHistory
1118
- }
2054
+ clearMastraCourseHistory,
2055
+ // Embedded docs tools for reading docs from installed packages
2056
+ ...embeddedDocsTools
2057
+ },
2058
+ prompts: migrationPromptMessages
1119
2059
  });
1120
2060
  Object.assign(logger, createLogger(server));
1121
2061
  async function runServer() {
@@ -1129,6 +2069,24 @@ async function runServer() {
1129
2069
  }
1130
2070
 
1131
2071
  // src/stdio.ts
2072
+ function parseLogLevel() {
2073
+ const args = process.argv.slice(2);
2074
+ const logLevelIndex = args.indexOf("--log-level");
2075
+ if (logLevelIndex === -1 || logLevelIndex === args.length - 1) {
2076
+ return void 0;
2077
+ }
2078
+ const level = args[logLevelIndex + 1];
2079
+ const validLevels = ["debug", "info", "warn", "error", "none"];
2080
+ if (validLevels.includes(level)) {
2081
+ return level;
2082
+ }
2083
+ console.error(`Invalid log level: ${level}. Valid levels: ${validLevels.join(", ")}`);
2084
+ return void 0;
2085
+ }
2086
+ var logLevel = parseLogLevel();
2087
+ if (logLevel) {
2088
+ setLogLevel(logLevel);
2089
+ }
1132
2090
  runServer().catch((error) => {
1133
2091
  const errorMessage = "Fatal error running server";
1134
2092
  console.error(errorMessage, error);
@@ -1141,3 +2099,5 @@ runServer().catch((error) => {
1141
2099
  });
1142
2100
  process.exit(1);
1143
2101
  });
2102
+ //# sourceMappingURL=stdio.js.map
2103
+ //# sourceMappingURL=stdio.js.map