@mastra/core 1.87.0-alpha.18 → 1.87.0-alpha.19

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 (484) hide show
  1. package/dist/_types/@internal_ai-v6@0.0.99/dist/index.d.ts +2075 -123
  2. package/dist/_types/@internal_core@0.1.4/dist/knowledge-compat/index.d.ts +30 -3
  3. package/dist/agent/agent.d.ts +2 -4
  4. package/dist/agent/agent.types.d.ts +1 -0
  5. package/dist/agent/durable/index.cjs +86 -86
  6. package/dist/agent/durable/index.js +2 -2
  7. package/dist/agent/durable/run-registry.d.ts +54 -25
  8. package/dist/agent/index.cjs +16 -16
  9. package/dist/agent/index.d.ts +1 -0
  10. package/dist/agent/index.js +3 -3
  11. package/dist/agent/scopes.d.ts +8 -0
  12. package/dist/agent/types.d.ts +1 -0
  13. package/dist/agent-builder/ee/index.cjs +1 -1
  14. package/dist/agent-builder/ee/index.js +1 -1
  15. package/dist/agent-controller/agent-controller.d.ts +8 -1
  16. package/dist/agent-controller/index.cjs +3 -3
  17. package/dist/agent-controller/index.js +3 -3
  18. package/dist/{agent-controller-D_OKCLUP.cjs → agent-controller-DzOEhUjR.cjs} +39 -35
  19. package/dist/{agent-controller-UZNIM4h-.js → agent-controller-lBdNfcFi.js} +15 -11
  20. package/dist/{agent-skills-resolver-BMoCDoaK.cjs → agent-skills-resolver-2d8k7ioj.cjs} +134 -109
  21. package/dist/{agent-skills-resolver-CUEIMDbx.js → agent-skills-resolver-D2HktP6Y.js} +134 -109
  22. package/dist/background-tasks/index.cjs +1 -1
  23. package/dist/background-tasks/index.js +1 -1
  24. package/dist/{background-tasks-CioDMzgY.js → background-tasks-DAu4WaCb.js} +1 -1
  25. package/dist/{background-tasks-CLWnX7SN.cjs → background-tasks-DOmQdBVn.cjs} +1 -1
  26. package/dist/browser/index.cjs +4 -4
  27. package/dist/browser/index.js +4 -4
  28. package/dist/{builder-BC4l-RN5.cjs → builder-BFcVEbX0.cjs} +3 -3
  29. package/dist/{builder-CQLqpQO_.js → builder-DHFtMW8D.js} +2 -2
  30. package/dist/capabilities/302ai.json +198 -198
  31. package/dist/capabilities/abacus.json +2 -96
  32. package/dist/capabilities/abliteratedllm.json +36 -36
  33. package/dist/capabilities/abliteration-ai.json +11 -11
  34. package/dist/capabilities/above.json +19 -19
  35. package/dist/capabilities/adaption.json +11 -11
  36. package/dist/capabilities/adzuki.json +32 -32
  37. package/dist/capabilities/agentrouter.json +12 -12
  38. package/dist/capabilities/agnes.json +4 -4
  39. package/dist/capabilities/ai-router.json +5 -5
  40. package/dist/capabilities/aiand.json +25 -25
  41. package/dist/capabilities/aigrow.json +13 -13
  42. package/dist/capabilities/aimlapi.json +144 -144
  43. package/dist/capabilities/aipg.json +2 -2
  44. package/dist/capabilities/aixy.json +24 -24
  45. package/dist/capabilities/aki-io.json +12 -12
  46. package/dist/capabilities/alibaba-cn.json +81 -126
  47. package/dist/capabilities/alibaba-coding-plan-cn.json +4 -4
  48. package/dist/capabilities/alibaba-coding-plan.json +4 -4
  49. package/dist/capabilities/alibaba-token-plan-cn.json +57 -53
  50. package/dist/capabilities/alibaba-token-plan.json +57 -53
  51. package/dist/capabilities/alibaba.json +76 -71
  52. package/dist/capabilities/ambient.json +14 -32
  53. package/dist/capabilities/amd-tokenlab.json +41 -0
  54. package/dist/capabilities/amd.json +8 -8
  55. package/dist/capabilities/anthropic.json +32 -56
  56. package/dist/capabilities/anyapi.json +47 -47
  57. package/dist/capabilities/apiko.json +5 -5
  58. package/dist/capabilities/arcee.json +5 -5
  59. package/dist/capabilities/augure.json +4 -4
  60. package/dist/capabilities/auriko.json +15 -15
  61. package/dist/capabilities/bailing.json +3 -3
  62. package/dist/capabilities/baseten.json +35 -35
  63. package/dist/capabilities/bee.json +5 -5
  64. package/dist/capabilities/berget.json +2 -35
  65. package/dist/capabilities/bothub.json +14 -14
  66. package/dist/capabilities/boundless.json +39 -39
  67. package/dist/capabilities/bumo.json +40 -40
  68. package/dist/capabilities/byteplus.json +28 -28
  69. package/dist/capabilities/cheapest-token.json +31 -31
  70. package/dist/capabilities/chutes.json +48 -17
  71. package/dist/capabilities/cline-pass.json +32 -45
  72. package/dist/capabilities/cloudcode.json +8 -8
  73. package/dist/capabilities/cloudferro-sherlock.json +4 -4
  74. package/dist/capabilities/cloudflare-workers-ai.json +17 -17
  75. package/dist/capabilities/commandcode.json +141 -156
  76. package/dist/capabilities/concentrate.json +289 -289
  77. package/dist/capabilities/cortecs.json +103 -103
  78. package/dist/capabilities/crossmodel.json +194 -194
  79. package/dist/capabilities/crusoe.json +18 -18
  80. package/dist/capabilities/daoxe.json +9 -9
  81. package/dist/capabilities/databricks.json +128 -128
  82. package/dist/capabilities/deepinfra.json +98 -94
  83. package/dist/capabilities/deepseek.json +4 -4
  84. package/dist/capabilities/digitalocean.json +114 -114
  85. package/dist/capabilities/dinference.json +1 -2
  86. package/dist/capabilities/dothoosh.json +26 -26
  87. package/dist/capabilities/doubleword.json +23 -23
  88. package/dist/capabilities/edenai.json +285 -285
  89. package/dist/capabilities/empiriolabs.json +176 -167
  90. package/dist/capabilities/engy.json +16 -16
  91. package/dist/capabilities/entrim.json +8 -8
  92. package/dist/capabilities/evroc.json +15 -15
  93. package/dist/capabilities/ezkielyna.json +10 -10
  94. package/dist/capabilities/fastrouter.json +93 -97
  95. package/dist/capabilities/fireworks-ai.json +85 -85
  96. package/dist/capabilities/fortytwo.json +4 -4
  97. package/dist/capabilities/freemodel.json +7 -51
  98. package/dist/capabilities/friendli.json +8 -8
  99. package/dist/capabilities/frogbot.json +95 -103
  100. package/dist/capabilities/gisoo.json +15 -15
  101. package/dist/capabilities/gmicloud.json +21 -21
  102. package/dist/capabilities/google.json +55 -55
  103. package/dist/capabilities/graphn.json +10 -10
  104. package/dist/capabilities/greenpt.json +35 -35
  105. package/dist/capabilities/groq.json +7 -20
  106. package/dist/capabilities/helicone.json +84 -86
  107. package/dist/capabilities/hetzner.json +4 -4
  108. package/dist/capabilities/hopper.json +2 -2
  109. package/dist/capabilities/hostinger-router.json +5 -5
  110. package/dist/capabilities/hpc-ai.json +8 -24
  111. package/dist/capabilities/huawei-maas.json +13 -13
  112. package/dist/capabilities/hubris.json +30 -30
  113. package/dist/capabilities/huggingface.json +86 -101
  114. package/dist/capabilities/hyper.json +24 -24
  115. package/dist/capabilities/impossibl.json +152 -199
  116. package/dist/capabilities/inceptron.json +8 -8
  117. package/dist/capabilities/inco.json +4 -21
  118. package/dist/capabilities/infer.json +16 -16
  119. package/dist/capabilities/inferall.json +2 -18
  120. package/dist/capabilities/inference-coop.json +6 -6
  121. package/dist/capabilities/inference.json +2 -11
  122. package/dist/capabilities/inferenceapis.json +24 -24
  123. package/dist/capabilities/infersia.json +13 -13
  124. package/dist/capabilities/inferx.json +3 -3
  125. package/dist/capabilities/infomaniak.json +3 -3
  126. package/dist/capabilities/io-net.json +6 -16
  127. package/dist/capabilities/isoquant.json +4 -4
  128. package/dist/capabilities/iteracompute.json +42 -80
  129. package/dist/capabilities/jalapeno.json +11 -11
  130. package/dist/capabilities/jiekou.json +19 -167
  131. package/dist/capabilities/joingonka.json +4 -4
  132. package/dist/capabilities/jzstoken.json +54 -54
  133. package/dist/capabilities/keln.json +23 -23
  134. package/dist/capabilities/kenari.json +122 -130
  135. package/dist/capabilities/kilo.json +649 -647
  136. package/dist/capabilities/kimi-code-plan-cn.json +7 -7
  137. package/dist/capabilities/kimi-code-plan-global.json +7 -7
  138. package/dist/capabilities/kitani.json +4 -4
  139. package/dist/capabilities/klavo.json +24 -24
  140. package/dist/capabilities/korouter.json +32 -32
  141. package/dist/capabilities/kunavo.json +7 -7
  142. package/dist/capabilities/liquid.json +8 -8
  143. package/dist/capabilities/lithosai.json +3 -3
  144. package/dist/capabilities/llmgateway-providers.json +885 -893
  145. package/dist/capabilities/llmgateway.json +340 -340
  146. package/dist/capabilities/llmtr.json +16 -54
  147. package/dist/capabilities/lowrouter.json +61 -61
  148. package/dist/capabilities/lyceum.json +14 -14
  149. package/dist/capabilities/meganova.json +0 -1
  150. package/dist/capabilities/melious.json +14 -14
  151. package/dist/capabilities/merge-gateway.json +292 -292
  152. package/dist/capabilities/meta.json +11 -11
  153. package/dist/capabilities/minimax-cn-coding-plan.json +2 -2
  154. package/dist/capabilities/minimax-cn.json +5 -5
  155. package/dist/capabilities/minimax-coding-plan.json +2 -2
  156. package/dist/capabilities/minimax.json +5 -5
  157. package/dist/capabilities/mistral.json +15 -31
  158. package/dist/capabilities/mixlayer.json +5 -5
  159. package/dist/capabilities/moark.json +0 -2
  160. package/dist/capabilities/modal.json +8 -8
  161. package/dist/capabilities/model-oracle-ai.json +19 -27
  162. package/dist/capabilities/modelis.json +14 -14
  163. package/dist/capabilities/modelscope.json +2 -2
  164. package/dist/capabilities/modular.json +11 -11
  165. package/dist/capabilities/moneo.json +7 -38
  166. package/dist/capabilities/moonshotai-cn.json +7 -7
  167. package/dist/capabilities/moonshotai.json +7 -7
  168. package/dist/capabilities/morph.json +13 -13
  169. package/dist/capabilities/munito-eu.json +8 -8
  170. package/dist/capabilities/munito.json +10 -10
  171. package/dist/capabilities/nan.json +31 -31
  172. package/dist/capabilities/nano-gpt.json +581 -603
  173. package/dist/capabilities/nearai.json +119 -119
  174. package/dist/capabilities/nebius.json +30 -31
  175. package/dist/capabilities/neon.json +132 -132
  176. package/dist/capabilities/neuralwatt.json +41 -41
  177. package/dist/capabilities/nokeep.json +5 -5
  178. package/dist/capabilities/novita-ai.json +113 -227
  179. package/dist/capabilities/nvidia.json +14 -82
  180. package/dist/capabilities/oathbreaker.json +2 -2
  181. package/dist/capabilities/obscurify.json +28 -28
  182. package/dist/capabilities/oci.json +4 -4
  183. package/dist/capabilities/ofox.json +270 -270
  184. package/dist/capabilities/ollama-cloud.json +53 -53
  185. package/dist/capabilities/openai.json +57 -57
  186. package/dist/capabilities/opencode-go.json +88 -90
  187. package/dist/capabilities/openreason.json +5 -5
  188. package/dist/capabilities/openrouter.json +574 -563
  189. package/dist/capabilities/opper.json +29 -34
  190. package/dist/capabilities/orcarouter.json +307 -367
  191. package/dist/capabilities/outerlabs.json +30 -30
  192. package/dist/capabilities/ovhcloud.json +19 -19
  193. package/dist/capabilities/pareto.json +2 -7
  194. package/dist/capabilities/perplexity-agent.json +47 -102
  195. package/dist/capabilities/perplexity.json +2 -2
  196. package/dist/capabilities/phala.json +35 -35
  197. package/dist/capabilities/pioneer.json +5 -122
  198. package/dist/capabilities/poe.json +130 -130
  199. package/dist/capabilities/poolside.json +2 -2
  200. package/dist/capabilities/powerspring.json +14 -14
  201. package/dist/capabilities/primalabs.json +12 -12
  202. package/dist/capabilities/prime.json +123 -115
  203. package/dist/capabilities/privatemode-ai.json +8 -36
  204. package/dist/capabilities/proxystacks.json +5 -5
  205. package/dist/capabilities/qihang-ai.json +3 -15
  206. package/dist/capabilities/qiniu-ai.json +13 -87
  207. package/dist/capabilities/refuseless.json +7 -14
  208. package/dist/capabilities/regolo-ai.json +9 -13
  209. package/dist/capabilities/requesty.json +202 -202
  210. package/dist/capabilities/routing-run.json +3 -40
  211. package/dist/capabilities/ruapi.json +21 -21
  212. package/dist/capabilities/runcrate.json +10 -10
  213. package/dist/capabilities/runinfra.json +16 -16
  214. package/dist/capabilities/sakana.json +3 -3
  215. package/dist/capabilities/sambanova.json +9 -9
  216. package/dist/capabilities/sandbase.json +20 -20
  217. package/dist/capabilities/sarvam.json +22 -13
  218. package/dist/capabilities/scaleway.json +18 -18
  219. package/dist/capabilities/scnet-token-plan.json +7 -7
  220. package/dist/capabilities/scx-ai.json +16 -32
  221. package/dist/capabilities/sensenova.json +12 -12
  222. package/dist/capabilities/siliconflow-cn.json +45 -97
  223. package/dist/capabilities/siliconflow.json +53 -53
  224. package/dist/capabilities/snowflake-cortex.json +26 -26
  225. package/dist/capabilities/sokkan.json +8 -20
  226. package/dist/capabilities/sparrowcodes.json +21 -21
  227. package/dist/capabilities/stackit.json +1 -2
  228. package/dist/capabilities/standardcompute.json +84 -120
  229. package/dist/capabilities/steadyrouter.json +41 -41
  230. package/dist/capabilities/stepfun-ai-step-plan.json +8 -8
  231. package/dist/capabilities/stepfun-ai.json +8 -8
  232. package/dist/capabilities/stepfun-step-plan.json +8 -8
  233. package/dist/capabilities/stepfun.json +8 -8
  234. package/dist/capabilities/stepping-stone.json +15 -15
  235. package/dist/capabilities/subconscious.json +2 -2
  236. package/dist/capabilities/superbot-gg.json +4 -4
  237. package/dist/capabilities/synthetic.json +8 -17
  238. package/dist/capabilities/synthorai.json +21 -21
  239. package/dist/capabilities/teamorouter.json +23 -23
  240. package/dist/capabilities/teapot-router.json +10 -10
  241. package/dist/capabilities/tencent-token-plan-intl.json +25 -25
  242. package/dist/capabilities/tencent-token-plan.json +38 -38
  243. package/dist/capabilities/tencent-tokenhub.json +46 -46
  244. package/dist/capabilities/tensorx.json +48 -48
  245. package/dist/capabilities/tenstorrent.json +4 -4
  246. package/dist/capabilities/the-grid-ai.json +29 -29
  247. package/dist/capabilities/thinkingmachines.json +71 -71
  248. package/dist/capabilities/tinfoil.json +8 -8
  249. package/dist/capabilities/toapis.json +3 -3
  250. package/dist/capabilities/togetherai.json +42 -42
  251. package/dist/capabilities/tokengo.json +21 -21
  252. package/dist/capabilities/tokenify.json +2 -2
  253. package/dist/capabilities/trustedrouter.json +5 -5
  254. package/dist/capabilities/trustedtokens.json +15 -15
  255. package/dist/capabilities/umans-ai-coding-plan.json +16 -16
  256. package/dist/capabilities/umans-ai.json +13 -13
  257. package/dist/capabilities/uncensuredai.json +4 -4
  258. package/dist/capabilities/unorouter.json +1 -22
  259. package/dist/capabilities/unrestricted.json +4 -20
  260. package/dist/capabilities/uplinkswitch.json +21 -21
  261. package/dist/capabilities/upstage.json +3 -15
  262. package/dist/capabilities/vancine.json +20 -20
  263. package/dist/capabilities/vercel.json +551 -551
  264. package/dist/capabilities/vivgrid.json +51 -131
  265. package/dist/capabilities/volcengine-coding-plan.json +29 -29
  266. package/dist/capabilities/volcengine.json +27 -27
  267. package/dist/capabilities/vultr.json +14 -67
  268. package/dist/capabilities/wafer.ai.json +17 -17
  269. package/dist/capabilities/wallaby.json +2 -2
  270. package/dist/capabilities/wally.json +12 -12
  271. package/dist/capabilities/wandb.json +21 -21
  272. package/dist/capabilities/watt.json +22 -22
  273. package/dist/capabilities/xai.json +5 -5
  274. package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
  275. package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
  276. package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
  277. package/dist/capabilities/xiaomi.json +2 -2
  278. package/dist/capabilities/xpersona.json +13 -13
  279. package/dist/capabilities/xxapi.json +30 -30
  280. package/dist/capabilities/zai-coding-plan.json +17 -17
  281. package/dist/capabilities/zai.json +31 -31
  282. package/dist/capabilities/zenifra.json +26 -26
  283. package/dist/capabilities/zenmux.json +190 -233
  284. package/dist/capabilities/zerogpu.json +8 -8
  285. package/dist/capabilities/zhipuai-coding-plan.json +3 -14
  286. package/dist/capabilities/zhipuai.json +30 -30
  287. package/dist/capabilities/zro.json +6 -6
  288. package/dist/channels/index.cjs +24 -24
  289. package/dist/channels/index.js +2 -2
  290. package/dist/{channels-Bemsws_d.js → channels-BBwgs50q.js} +2 -2
  291. package/dist/{channels-B7-KI9Ob.cjs → channels-CbhgGgQD.cjs} +6 -6
  292. package/dist/coding-agent/index.cjs +7 -7
  293. package/dist/coding-agent/index.js +4 -4
  294. package/dist/{constants-CFO8w780.cjs → constants-B2FVV_2e.cjs} +1 -1
  295. package/dist/{constants-CUv0mU2y.js → constants-Dro9fuhk.js} +1 -1
  296. package/dist/datasets/index.cjs +9 -9
  297. package/dist/datasets/index.js +2 -2
  298. package/dist/docs/SKILL.md +1 -1
  299. package/dist/docs/assets/SOURCE_MAP.json +1147 -1142
  300. package/dist/docs/references/docs-agents-overview.md +9 -0
  301. package/dist/docs/references/docs-deployment-workers.md +1 -1
  302. package/dist/docs/references/docs-harness-background-tasks.md +8 -5
  303. package/dist/docs/references/docs-harness-durable-agents.md +1 -0
  304. package/dist/docs/references/docs-knowledge-search.md +1 -1
  305. package/dist/docs/references/docs-server-pubsub.md +1 -1
  306. package/dist/docs/references/docs-skills.md +4 -1
  307. package/dist/docs/references/docs-workflows-overview.md +2 -0
  308. package/dist/docs/references/reference-agents-createSkill.md +20 -1
  309. package/dist/docs/references/reference-knowledge-knowledge-tools.md +1 -2
  310. package/dist/docs/references/reference-observability-metrics-metrics-context.md +63 -3
  311. package/dist/docs/references/reference-pubsub-base.md +1 -1
  312. package/dist/docs/references/reference-pubsub-redis-streams.md +3 -5
  313. package/dist/docs/references/reference-pubsub-valkey-streams.md +2 -2
  314. package/dist/docs/references/reference-templates-overview.md +31 -1
  315. package/dist/docs/references/reference-workflows-run-methods-restart.md +2 -0
  316. package/dist/evals/index.cjs +13 -13
  317. package/dist/evals/index.js +2 -2
  318. package/dist/evals/scoreTraces/index.cjs +4 -4
  319. package/dist/evals/scoreTraces/index.js +2 -2
  320. package/dist/events/index.cjs +1 -1
  321. package/dist/events/index.js +1 -1
  322. package/dist/events/pubsub.d.ts +1 -3
  323. package/dist/{run-registry-Cu9CK7AR.js → execution-fence-B8yV_n51.js} +62508 -62052
  324. package/dist/{run-registry-CXeR1Qso.cjs → execution-fence-fqV6FGdV.cjs} +63621 -63153
  325. package/dist/harness/index.cjs +3 -3
  326. package/dist/harness/index.js +3 -3
  327. package/dist/index.cjs +1 -1
  328. package/dist/index.d.ts +1 -0
  329. package/dist/index.js +1 -1
  330. package/dist/integration/index.cjs +1 -1
  331. package/dist/integration/index.js +1 -1
  332. package/dist/knowledge/index.cjs +163 -153
  333. package/dist/knowledge/index.js +18 -8
  334. package/dist/llm/index.cjs +3 -3
  335. package/dist/llm/index.js +3 -3
  336. package/dist/llm/model/gateways/opencode-session-header.d.ts +28 -0
  337. package/dist/llm/model/provider-types.generated.d.ts +7412 -7795
  338. package/dist/llm/model/resolve-model.d.ts +1 -0
  339. package/dist/llm/model/shared.types.d.ts +1 -0
  340. package/dist/{llm-ZA8oIVog.cjs → llm-B7ul27Ay.cjs} +32 -14
  341. package/dist/{llm-DCoDWje0.js → llm-Cy3WZXgA.js} +32 -14
  342. package/dist/loop/index.cjs +15 -15
  343. package/dist/loop/index.js +2 -2
  344. package/dist/loop/server.cjs +1 -1
  345. package/dist/loop/server.js +1 -1
  346. package/dist/{manager-oP6iB_H-.cjs → manager-CY-RzZJL.cjs} +21 -19
  347. package/dist/{manager-DSbR85XK.js → manager-Dsub5fyz.js} +9 -7
  348. package/dist/mastra/index.cjs +1 -1
  349. package/dist/mastra/index.d.ts +33 -4
  350. package/dist/mastra/index.js +1 -1
  351. package/dist/{mastra-FEJ-anIN.cjs → mastra-DXQUuwFl.cjs} +116 -67
  352. package/dist/{mastra-RgFRZ_Az.js → mastra-yjoYfTS5.js} +76 -27
  353. package/dist/memory/index.cjs +24 -24
  354. package/dist/memory/index.js +2 -2
  355. package/dist/memory/mock.d.ts +2 -3
  356. package/dist/{model-opyZwnK3.cjs → model-BARBpXDN.cjs} +2 -2
  357. package/dist/{model-DSBVKOW8.js → model-DauH8JTo.js} +2 -2
  358. package/dist/{netlify-BqMGvc2s.js → netlify-BNBtKR4Q.js} +86 -4
  359. package/dist/{netlify-DzturPW3.cjs → netlify-DGsETiFB.cjs} +97 -3
  360. package/dist/notifications/index.cjs +18 -18
  361. package/dist/notifications/index.js +2 -2
  362. package/dist/observability/index.cjs +1 -1
  363. package/dist/observability/index.js +1 -1
  364. package/dist/{observability-D7RNOAPx.js → observability-DPDWibyH.js} +648 -648
  365. package/dist/{output-helpers-DgsH4aTb.cjs → output-helpers-By5FbLpp.cjs} +71 -73
  366. package/dist/{output-helpers-CVzhy1Y0.js → output-helpers-k2-48ssH.js} +72 -74
  367. package/dist/processor-provider/index.cjs +10 -10
  368. package/dist/processor-provider/index.js +1 -1
  369. package/dist/processors/index.cjs +65 -65
  370. package/dist/processors/index.js +2 -2
  371. package/dist/{provider-registry-BcG2ooFa.js → provider-registry-CfHy4Zhw.js} +21401 -22401
  372. package/dist/{provider-registry-BZw14X9M.cjs → provider-registry-Y6tbfFhH.cjs} +21401 -22401
  373. package/dist/provider-registry.json +21940 -22961
  374. package/dist/{registry-generator-BrzPSCHS.cjs → registry-generator-BEJ0APNc.cjs} +1 -1
  375. package/dist/{registry-generator-CA4YBIHo.js → registry-generator-DJiQAI8V.js} +1 -1
  376. package/dist/{rehydrate-CfS6KkCr.cjs → rehydrate-4Sl7D3kO.cjs} +14 -14
  377. package/dist/{rehydrate-Chuw5IrY.js → rehydrate-Da4_E_N8.js} +2 -2
  378. package/dist/relevance/index.cjs +3 -3
  379. package/dist/relevance/index.js +2 -2
  380. package/dist/{signal-provider-BslnAjWG.js → signal-provider-B_mfW-J4.js} +1 -1
  381. package/dist/{signal-provider-BFAvh_AJ.cjs → signal-provider-D9gbevHN.cjs} +1 -1
  382. package/dist/signals/index.cjs +3 -3
  383. package/dist/signals/index.js +3 -3
  384. package/dist/{signals-CbmgVwL-.cjs → signals-BwDXGqxc.cjs} +2 -2
  385. package/dist/{signals-Clupx3jz.js → signals-TznxWfM3.js} +2 -2
  386. package/dist/skills/create-skill.d.ts +3 -0
  387. package/dist/skills/index.cjs +1 -1
  388. package/dist/skills/index.js +1 -1
  389. package/dist/skills/inline-skill-source.d.ts +5 -1
  390. package/dist/skills/types.d.ts +16 -1
  391. package/dist/{source-DYZMfjv3.js → source-B3He4_mz.js} +1 -1
  392. package/dist/{source-BC8Et5qZ.cjs → source-C_nWbqI0.cjs} +1 -1
  393. package/dist/{state-processor-B9kxpM53.js → state-processor-B_KsS82m.js} +1 -1
  394. package/dist/{state-processor-kRNZ38Nf.cjs → state-processor-DaSmhVUX.cjs} +1 -1
  395. package/dist/storage/constants.cjs +1 -1
  396. package/dist/storage/constants.js +1 -1
  397. package/dist/storage/domains/agents/index.cjs +1 -1
  398. package/dist/storage/domains/agents/index.js +1 -1
  399. package/dist/storage/domains/inmemory-db.d.ts +1 -1
  400. package/dist/storage/domains/knowledge/pages.d.ts +8 -1
  401. package/dist/storage/domains/memory/base.d.ts +19 -9
  402. package/dist/storage/domains/memory/inmemory.d.ts +4 -1
  403. package/dist/storage/domains/memory/queue-thread.d.ts +7 -1
  404. package/dist/storage/domains/workflows/base.d.ts +18 -5
  405. package/dist/storage/domains/workflows/inmemory.d.ts +3 -5
  406. package/dist/storage/domains/workflows/journal.d.ts +16 -1
  407. package/dist/storage/index.cjs +187 -186
  408. package/dist/storage/index.js +6 -6
  409. package/dist/storage/workflow-snapshot.d.ts +4 -0
  410. package/dist/storage/workflow-step-guard.d.ts +5 -0
  411. package/dist/stream/base/output.d.ts +1 -0
  412. package/dist/stream/index.cjs +2 -2
  413. package/dist/stream/index.js +2 -2
  414. package/dist/{stream-DTpp9Tk-.js → stream-BFhCDJvz.js} +18 -8
  415. package/dist/{stream-CiXZtgym.cjs → stream-CZy8XA_q.cjs} +23 -7
  416. package/dist/telemetry/index.cjs +1 -1
  417. package/dist/telemetry/index.js +1 -1
  418. package/dist/test-utils/llm-mock.cjs +1 -1
  419. package/dist/test-utils/llm-mock.js +1 -1
  420. package/dist/{tool-Z3bykc1m.js → tool-DIFduuTw.js} +2 -5
  421. package/dist/{tool-CYlT2UA-.cjs → tool-Dn9WSDVn.cjs} +2 -5
  422. package/dist/tool-loop-agent/index.cjs +1 -1
  423. package/dist/tool-loop-agent/index.js +1 -1
  424. package/dist/{tool-loop-agent-DtEg90Zj.cjs → tool-loop-agent-DifR6VLI.cjs} +4 -4
  425. package/dist/{tool-loop-agent-CqzgY98a.js → tool-loop-agent-SOpIJRws.js} +3 -3
  426. package/dist/{toolchecks-DrsZdc3S.js → toolchecks-CRAfUe9H.js} +1 -1
  427. package/dist/{toolchecks-MFU48cit.cjs → toolchecks-DbBsQGHW.cjs} +1 -1
  428. package/dist/tools/index.cjs +5 -5
  429. package/dist/tools/index.d.ts +1 -0
  430. package/dist/tools/index.js +5 -5
  431. package/dist/tools/is-vercel-tool.cjs +1 -1
  432. package/dist/tools/is-vercel-tool.js +1 -1
  433. package/dist/tools/tool.d.ts +2 -4
  434. package/dist/tools/types.d.ts +1 -0
  435. package/dist/{tools-BEYxowf0.cjs → tools-C2q0ougI.cjs} +1 -1
  436. package/dist/{tools-tPy2FwMI.js → tools-ybbz1YKg.js} +1 -1
  437. package/dist/{utils-B_y5EDSz.cjs → utils-BjFntMW_.cjs} +6 -5
  438. package/dist/{utils-tRzJ8Xfy.js → utils-DN_kWhH6.js} +6 -5
  439. package/dist/utils.cjs +3 -3
  440. package/dist/utils.js +3 -3
  441. package/dist/{validate-DpK_G9aa.cjs → validate-CBQ0dMBb.cjs} +1 -1
  442. package/dist/{validate-hFVBw9Sw.js → validate-KIBMWuyc.js} +1 -1
  443. package/dist/vector/index.cjs +8 -8
  444. package/dist/vector/index.js +1 -1
  445. package/dist/worker/index.cjs +1 -1
  446. package/dist/worker/index.js +1 -1
  447. package/dist/{worker-BFAw0uVe.js → worker-Bqg7bsxX.js} +8 -3
  448. package/dist/{worker-BhaB8pNL.cjs → worker-CJ_JYSy0.cjs} +3 -3
  449. package/dist/{worker-KkDudGwX.cjs → worker-Ct6E5_2p.cjs} +16 -11
  450. package/dist/{worker-m_uyOwiv.js → worker-DVM_pvH7.js} +2 -2
  451. package/dist/{workflow-Uroh6hlJ.js → workflow-BmShpn3p.js} +4 -4
  452. package/dist/{workflow-BwKfyvhR.cjs → workflow-DEAvg0pI.cjs} +8 -8
  453. package/dist/workflows/builder/index.cjs +1 -1
  454. package/dist/workflows/builder/index.js +1 -1
  455. package/dist/workflows/evented/index.cjs +10 -10
  456. package/dist/workflows/evented/index.js +1 -1
  457. package/dist/workflows/evented/workflow-event-processor/index.d.ts +0 -2
  458. package/dist/workflows/evented/workflow.d.ts +2 -1
  459. package/dist/workflows/index.cjs +54 -54
  460. package/dist/workflows/index.js +4 -4
  461. package/dist/workflows/run-storage.d.ts +16 -1
  462. package/dist/workflows/types.d.ts +10 -0
  463. package/dist/workflows/workflow.d.ts +3 -1
  464. package/dist/workspace/index.cjs +1 -1
  465. package/dist/workspace/index.js +1 -1
  466. package/dist/{workspace-CzzrnE6Q.cjs → workspace-BQD4tcQi.cjs} +3 -3
  467. package/dist/{workspace-Ct2kAiDv.js → workspace-sqcfdZRR.js} +2 -2
  468. package/package.json +9 -8
  469. package/skills/mastra/SKILL.md +171 -0
  470. package/skills/mastra/references/common-errors.md +557 -0
  471. package/skills/mastra/references/core-concepts.md +21 -0
  472. package/skills/mastra/references/create-mastra.md +233 -0
  473. package/skills/mastra/references/embedded-docs.md +103 -0
  474. package/skills/mastra/references/feedback.md +69 -0
  475. package/skills/mastra/references/gateway.md +66 -0
  476. package/skills/mastra/references/mastra-api.md +222 -0
  477. package/skills/mastra/references/migration-guide.md +185 -0
  478. package/skills/mastra/references/model-selection.md +29 -0
  479. package/skills/mastra/references/platform.md +164 -0
  480. package/skills/mastra/references/remote-docs.md +193 -0
  481. package/skills/mastra/references/trace-query.md +150 -0
  482. package/skills/mastra/scripts/provider-registry.mjs +271 -0
  483. package/src/llm/model/provider-types.generated.d.ts +7412 -7795
  484. package/dist/{observability-B0R_D1PZ.cjs → observability-VaoaeadK.cjs} +647 -647
@@ -0,0 +1,222 @@
1
+ # Mastra API CLI Reference
2
+
3
+ How to use the `mastra api` CLI to interact with Mastra servers. Prefer fast, focused commands and compact JSON projections. Treat the installed CLI and server schema as the source of truth when discovery is needed.
4
+
5
+ Use this reference when the user asks to inspect or call agents, workflows, tools, MCP servers, memory threads, traces, logs, metrics, scores, datasets, experiments, or to debug/test `mastra api` commands.
6
+
7
+ This reference does not cover the Mastra Platform control plane (projects, environments, deploys, tokens, workspace provisioning); for those, see [`platform.md`](platform.md).
8
+
9
+ ## Setup
10
+
11
+ The CLI can interact with any reachable Mastra server:
12
+
13
+ - Local dev server: `http://localhost:4111` from `npm run dev`
14
+ - Mastra platform deployment: Use the deployment URL
15
+ - Remote/self-hosted server: Use the server URL
16
+ - Hosted Mastra Platform Observability: `https://observability.mastra.ai` (auto-targeted by `trace`, `span`, `log`, `score`, and `metric` commands)
17
+
18
+ For local servers, `mastra api` defaults to `http://localhost:4111`:
19
+
20
+ ```bash
21
+ npx mastra api agent list
22
+ ```
23
+
24
+ For Mastra platform or remote servers, pass `--url`. For the sake of brevity in examples, `$MASTRA_URL` is used as a placeholder for the actual server URL which you need to set yourself:
25
+
26
+ ```bash
27
+ npx mastra api --url $MASTRA_URL agent list
28
+ ```
29
+
30
+ For Factory operations, activate the `mastra-factory` skill first. Use the user's actual Factory instance URL (not the platform API/dashboard URL). Explicit `--url` works from an empty directory. Recognized hosted Factory domains use saved `mastra auth login` credentials; check `mastra auth whoami` and offer login if needed. Custom/self-hosted deployments may use different authentication. Factory discovery uses bundled leaf contracts and root-level `/web/*` routes, not the runtime schema probe below.
31
+
32
+ For an unauthenticated local runtime server, verify the server once with a cheap check before resource calls:
33
+
34
+ ```bash
35
+ MASTRA_URL="${MASTRA_URL:-http://localhost:4111}"
36
+ curl -fsS "$MASTRA_URL/api/system/api-schema" >/dev/null
37
+ ```
38
+
39
+ If `$MASTRA_URL` is not reachable, ask for the correct deployment URL and set `--url` accordingly. For authenticated targets, use a supported read-only CLI call instead of treating an unauthenticated schema-probe failure as unreachability. Let the CLI use saved login on recognized platform hosts; for custom servers, have the user configure the deployment's approved authentication mechanism outside chat. Never request secret values in chat or inspect saved credential files.
40
+
41
+ For authenticated servers, pass repeatable headers:
42
+
43
+ ```bash
44
+ npx mastra api --url "$MASTRA_URL" --header "Authorization: Bearer $TOKEN" agent list
45
+ ```
46
+
47
+ ### Target resolution
48
+
49
+ Runtime commands (`agent`, `workflow`, `tool`, `mcp`, `thread`, `memory`, `dataset`, `experiment`) resolve the target in this order:
50
+
51
+ 1. `--url <url>` for an explicit remote or self-hosted server.
52
+ 2. `http://localhost:4111` for a local `mastra dev` server.
53
+ 3. `.mastra-project.json` for a Mastra platform project.
54
+
55
+ Observability commands (`trace`, `span`, `log`, `score`, `metric`) target `https://observability.mastra.ai` by default instead of a project deployment URL. EU projects use `https://observability.eu.mastra.ai`: the CLI picks it automatically from `mastra@1.34.2`. On older versions, EU requests time out with `REQUEST_TIMEOUT`; pass `--url https://observability.eu.mastra.ai`. The CLI resolves credentials in this order:
56
+
57
+ 1. Explicit `Authorization` and `X-Mastra-Project-Id` headers passed with `--header`.
58
+ 2. `MASTRA_PLATFORM_ACCESS_TOKEN` and `MASTRA_PROJECT_ID` from the environment.
59
+ 3. Project metadata from `.mastra-project.json` for the project ID.
60
+ 4. The Mastra CLI login token as an auth fallback.
61
+
62
+ For observability calls, no `--url` or `--header` is required if `MASTRA_PLATFORM_ACCESS_TOKEN` and `MASTRA_PROJECT_ID` are set, or if `.mastra-project.json` is present and you are logged in with `mastra auth login` (or provide another credential). `.mastra-project.json` only supplies the project ID, not authentication:
63
+
64
+ ```bash
65
+ npx mastra api trace list '{"page":0,"perPage":10}'
66
+ npx mastra api metric names
67
+ ```
68
+
69
+ Pass `--url` and `--header` only when overriding the hosted observability target or credentials.
70
+
71
+ ## Decision flow
72
+
73
+ 1. Clear read-only request (`list X`, `latest X`, `get X`, `summarize recent X`): infer the resource and use the fast path first.
74
+ 2. Mutating request (`create`, `update`, `delete`, `run`, `resume`, `execute`), unclear resource/action, failed fast path, or exact syntax requested: use narrow CLI discovery.
75
+ 3. JSON input uncertain: use command-specific `--schema`.
76
+ 4. Route behavior confusing: inspect `/api/system/api-schema`.
77
+
78
+ Start with these command groups when present; verify with `mastra api --help` if the group fails.
79
+
80
+ ```text
81
+ agent workflow tool mcp thread memory trace span log metric score dataset experiment
82
+ ```
83
+
84
+ ## Fast path for read-only requests
85
+
86
+ Use conventional `list`/`get` commands first. Keep pages small and pipe through `jq` immediately.
87
+
88
+ Latest item:
89
+
90
+ ```bash
91
+ npx mastra api <resource> list '{"page":0,"perPage":1}' \
92
+ | jq '.data[0]'
93
+ ```
94
+
95
+ Recent items:
96
+
97
+ ```bash
98
+ npx mastra api <resource> list '{"page":0,"perPage":10}' \
99
+ | jq '.data[]'
100
+ ```
101
+
102
+ When the shape is known, project only the fields needed for the task:
103
+
104
+ ```bash
105
+ npx mastra api <resource> list '{"page":0,"perPage":10}' \
106
+ | jq '.data[] | {id, name, createdAt, status}'
107
+ ```
108
+
109
+ Get details:
110
+
111
+ ```bash
112
+ npx mastra api <resource> get <id> \
113
+ | jq '.data'
114
+ ```
115
+
116
+ When the shape is known, project only the fields needed for the task:
117
+
118
+ ```bash
119
+ npx mastra api <resource> get <id> \
120
+ | jq '.data | {id, name, createdAt, status}'
121
+ ```
122
+
123
+ If a resource does not support the conventional shape, fall back to narrow `--help` for that resource/action.
124
+
125
+ ## Output control
126
+
127
+ - Do not use unfiltered `--pretty` during exploration.
128
+ - Always project list/get output with `jq` before reading details.
129
+ - Use `perPage:1` for latest and `perPage:10` or less for recent lists.
130
+ - If output is truncated or noisy, rerun with a narrower `jq` projection. Do not increase terminal output just to see more raw JSON.
131
+ - Fetch full JSON only when the user asks for raw output or compact projections are insufficient.
132
+
133
+ ## Fallback discovery
134
+
135
+ Use the narrowest discovery command that can answer the question. Example for traces:
136
+
137
+ ```bash
138
+ npx mastra api trace --help
139
+ npx mastra api trace list --help
140
+ npx mastra api trace list --schema
141
+ npx mastra api trace query --help
142
+ npx mastra api trace query --schema
143
+ npx mastra api trace aggregate --help
144
+ npx mastra api trace aggregate --schema
145
+ npx mastra api span query --help
146
+ npx mastra api span query --schema
147
+ npx mastra api span aggregate --help
148
+ npx mastra api span aggregate --schema
149
+ ```
150
+
151
+ Use `trace query` instead of `trace list` when selection requires recursive predicates, metadata filters, or conditions over related spans. First use `trace query --help` to confirm that the installed CLI exposes the command. The inline JSON query is required, and its cursor-bearing response stays nested under `data`. Read [`trace-query.md`](trace-query.md) for availability checks, the division between CLI schema discovery and canonical documentation, query construction, and pagination.
152
+
153
+ Use `trace aggregate` when the answer is a count or measure (error rate, latency percentiles, tokens, cost) grouped by up to two dimensions or time buckets rather than a list of traces. It takes the same `timeRange` and `where` as `trace query`. See [`trace-query.md`](trace-query.md#aggregate-traces).
154
+
155
+ Use `span query` to list individual spans (including nested agent runs and tool calls) with flat span-field predicates, and `span aggregate` to compute the same measures grouped by span fields. See [`trace-query.md`](trace-query.md#query-spans) and [`trace-query.md`](trace-query.md#aggregate-spans).
156
+
157
+ Use top-level help only when the resource is unknown:
158
+
159
+ ```bash
160
+ npx mastra api --help
161
+ ```
162
+
163
+ Read `--schema` output as the contract:
164
+
165
+ - `command`: usage string
166
+ - `examples`: known-good examples
167
+ - `positionals`: required path/identity arguments
168
+ - `input.required`: whether JSON input is required
169
+ - `input.schema`: accepted CLI JSON input, including query/body fields
170
+ - `schemas`: raw server route schemas for deeper debugging
171
+
172
+ ## JSON and output contract
173
+
174
+ `mastra api` accepts at most one inline JSON object as input. Do not use stdin or files unless the user explicitly asks.
175
+
176
+ For non-GET routes, the CLI splits the one JSON object into query parameters and request body according to the server route schema.
177
+
178
+ Output envelopes:
179
+
180
+ ```json
181
+ { "data": {} }
182
+ { "data": [], "page": { "total": 0, "page": 0, "perPage": 0, "hasMore": false } }
183
+ { "error": { "code": "...", "message": "...", "details": {} } }
184
+ ```
185
+
186
+ ## Error handling
187
+
188
+ - `INVALID_JSON`: fix shell quoting; input must be one JSON object.
189
+ - `MISSING_INPUT`: run the same command with `--schema` and supply required JSON.
190
+ - `MISSING_ARGUMENT`: provide the positional shown by `--help` / `--schema`.
191
+ - `HTTP_ERROR`: inspect `error.details`, then compare against `--schema` or route schema.
192
+ - `REQUEST_TIMEOUT`: retry with larger `--timeout`, especially for workflow execution.
193
+ - `SERVER_UNREACHABLE`: verify the URL and the server check. If localhost is not running, ask whether the user wants to use a Mastra platform deployment or another remote server URL.
194
+
195
+ ## Route-level debugging
196
+
197
+ If CLI behavior seems wrong, inspect the route-derived schema manifest instead of guessing.
198
+
199
+ Find routes by path:
200
+
201
+ ```bash
202
+ curl -fsS "$MASTRA_URL/api/system/api-schema" \
203
+ | jq '.routes[] | select(.path | contains("/memory"))'
204
+ ```
205
+
206
+ Inspect one route:
207
+
208
+ ```bash
209
+ curl -fsS "$MASTRA_URL/api/system/api-schema" \
210
+ | jq '.routes[] | select(.method == "POST" and .path == "/tools/:toolId/execute") | {pathParamSchema, queryParamSchema, bodySchema, responseShape}'
211
+ ```
212
+
213
+ ## Known notes
214
+
215
+ - Tool and MCP tool execution accept raw tool input; explicit `{ "data": ... }` also works.
216
+ - Workflow resume only works for suspended workflow runs.
217
+ - Working memory update requires the agent's memory to have working memory enabled.
218
+ - Empty lists may simply mean the server has no matching stored data yet.
219
+ - `trace list` and `trace get` return lightweight payloads by default (no span input, output, attributes, or metadata). Pass `--verbose` to fetch full span records, or use `trace span <traceId> <spanId>` to fetch one specific span in full.
220
+ - `trace query` requires inline JSON, queries completed traces, and defaults to keyset pagination: pass `data.page.next` unchanged as `page.after` with the same query shape. Numbered pages and delta polling use different response metadata; see [`trace-query.md`](trace-query.md#pagination).
221
+ - `trace aggregate` requires inline JSON and isn't paginated; when `truncated` is `true`, narrow the selection.
222
+ - `span query` requires inline JSON and pages like `trace query`: pass `data.page.next` unchanged as `page.after`. `span aggregate` isn't paginated, like `trace aggregate`.
@@ -0,0 +1,185 @@
1
+ # Migration Guide
2
+
3
+ Guide for upgrading Mastra versions using official documentation and current API verification.
4
+
5
+ ## Migration strategy
6
+
7
+ For version upgrades, follow this process:
8
+
9
+ ### 1. Check official migration docs
10
+
11
+ **Always start with the official migration documentation:** `https://mastra.ai/llms.txt`
12
+
13
+ Look for the **Migrations** or **Guides** section, which will have:
14
+
15
+ - Breaking changes for each version
16
+ - Automated migration tools
17
+ - Step-by-step upgrade instructions
18
+
19
+ **Example sections to look for:**
20
+
21
+ - `/guides/migrations/upgrade-to-v1/`
22
+ - `/guides/migrations/upgrade-to-v2/`
23
+ - Breaking changes lists
24
+
25
+ ### 2. Use embedded docs for current APIs
26
+
27
+ After identifying breaking changes, verify the new APIs:
28
+
29
+ **Check your installed version:**
30
+
31
+ ```bash
32
+ grep -A4 '"ApiName"' node_modules/@mastra/core/dist/docs/assets/SOURCE_MAP.json
33
+ cat node_modules/@mastra/core/[path-from-source-map]
34
+ ```
35
+
36
+ See [`embedded-docs.md`](embedded-docs.md) for detailed lookup instructions.
37
+
38
+ ### 3. Use remote docs for latest info
39
+
40
+ If packages aren't updated yet, check what APIs will look like: `https://mastra.ai/reference/[topic]`
41
+
42
+ See [`remote-docs.md`](remote-docs.md) for detailed lookup instructions.
43
+
44
+ ## Quick migration workflow
45
+
46
+ ```bash
47
+ # 1. Check current version
48
+ npm list @mastra/core
49
+
50
+ # 2. Fetch migration guide from official docs
51
+ # Use WebFetch: https://mastra.ai/llms.txt
52
+ # Find relevant migration section
53
+
54
+ # 3. Update the Mastra packages the project already uses
55
+ npm ls --depth=0 | grep -E "@mastra/|mastra@"
56
+ npm install @mastra/core@latest mastra@latest # plus each installed @mastra/* package, e.g. @mastra/pg@latest
57
+
58
+ # 4. Run automated migration (if available)
59
+ npx @mastra/codemod@latest v1 # or whatever version
60
+
61
+ # 5. Check embedded docs for new APIs
62
+ cat node_modules/@mastra/core/dist/docs/assets/SOURCE_MAP.json
63
+
64
+ # 6. Fix breaking changes using embedded docs lookup
65
+ # See embedded-docs.md for how to look up each API
66
+
67
+ # 7. Test (run tests first; `npm run dev` keeps running)
68
+ npm test
69
+ npm run dev
70
+ ```
71
+
72
+ ## Common migration patterns
73
+
74
+ ### Finding what changed
75
+
76
+ **Check official migration docs:** `https://mastra.ai/guides/migrations/upgrade-to-v1/overview.md`
77
+
78
+ This will list:
79
+
80
+ - Breaking changes
81
+ - Deprecated APIs
82
+ - New features
83
+ - Migration tools
84
+
85
+ ### Updating API usage
86
+
87
+ **For each breaking change:**
88
+
89
+ 1. **Find the old API** in your code
90
+ 2. **Look up the new API** using embedded docs:
91
+ ```bash
92
+ grep -A4 '"NewApi"' node_modules/@mastra/core/dist/docs/assets/SOURCE_MAP.json
93
+ cat node_modules/@mastra/core/[path]
94
+ ```
95
+ 3. **Update your code** based on the type signatures
96
+ 4. **Test** the change
97
+
98
+ ### Example: Tool execute signature change
99
+
100
+ **Official docs say:** "Tool execute signature changed"
101
+
102
+ **Look up current signature:**
103
+
104
+ ```bash
105
+ grep -A4 '"createTool"' node_modules/@mastra/core/dist/docs/assets/SOURCE_MAP.json
106
+ cat node_modules/@mastra/core/dist/tools/tool.d.ts
107
+ ```
108
+
109
+ **Update based on type definition:**
110
+
111
+ ```typescript
112
+ // Old: input nested under `context`
113
+ execute: async ({ context }) => {
114
+ const city = context.location;
115
+ }
116
+
117
+ // New: first argument is the input itself
118
+ execute: async (inputData, context) => {
119
+ const city = inputData.location;
120
+ }
121
+ ```
122
+
123
+ ## Pre-migration checklist
124
+
125
+ - [ ] Backup code (git commit)
126
+ - [ ] Check official migration docs: `https://mastra.ai/llms.txt`
127
+ - [ ] Note current version: `npm list @mastra/core`
128
+ - [ ] Read breaking changes list
129
+ - [ ] Tests are passing
130
+
131
+ ## Post-migration checklist
132
+
133
+ - [ ] All dependencies updated together
134
+ - [ ] TypeScript compiles: `npx tsc --noEmit`
135
+ - [ ] Tests pass: `npm test`
136
+ - [ ] Studio works: `npm run dev`
137
+ - [ ] No console warnings
138
+ - [ ] APIs verified against embedded docs
139
+
140
+ ## Migration resources
141
+
142
+ | Resource | Use For |
143
+ | -------------------------------------- | --------------------------------------------- |
144
+ | `https://mastra.ai/llms.txt` | Finding migration guides and breaking changes |
145
+ | [`embedded-docs.md`](embedded-docs.md) | Looking up new API signatures after updating |
146
+ | [`remote-docs.md`](remote-docs.md) | Checking latest docs before updating |
147
+ | [`common-errors.md`](common-errors.md) | Fixing migration errors |
148
+
149
+ ## Version-specific notes
150
+
151
+ ### General principles
152
+
153
+ 1. **Always update all @mastra packages together**
154
+
155
+ ```bash
156
+ npm install @mastra/core@latest @mastra/memory@latest @mastra/rag@latest mastra@latest
157
+ ```
158
+
159
+ 2. **Check for automated migration tools**
160
+
161
+ ```bash
162
+ npx @mastra/codemod@latest [version]
163
+ ```
164
+
165
+ 3. **Verify Node.js version requirements**
166
+ - Check official migration docs for minimum Node version
167
+
168
+ 4. **Run database migrations if using storage**
169
+ - Follow storage migration guide in official docs
170
+
171
+ ## Getting help
172
+
173
+ 1. **Check official migration docs**: `https://mastra.ai/llms.txt` → Migrations section
174
+ 2. **Look up new APIs**: See [`embedded-docs.md`](embedded-docs.md)
175
+ 3. **Check for errors**: See [`common-errors.md`](common-errors.md)
176
+ 4. **Ask in Discord**: https://discord.gg/BTYqqHKUrf
177
+ 5. **File issues**: https://github.com/mastra-ai/mastra/issues
178
+
179
+ ## Key principles
180
+
181
+ 1. **Official docs are source of truth** - Start with `https://mastra.ai/llms.txt`
182
+ 2. **Verify with embedded docs** - Check installed version APIs
183
+ 3. **Update incrementally** - Don't skip major versions
184
+ 4. **Test thoroughly** - Run tests after each change
185
+ 5. **Use automation** - Use codemods when available
@@ -0,0 +1,29 @@
1
+ # Model Selection Reference
2
+
3
+ Use this reference when choosing or validating Mastra model strings.
4
+
5
+ ## Model format
6
+
7
+ Always use `"provider/model-name"` when defining models with Mastra's model router.
8
+
9
+ ## Verify provider keys and model names
10
+
11
+ Use the provider registry script to look up available providers and models. The `scripts/` path is relative to the `mastra` skill directory, so run these commands from there, or pass the full path (for example `node .agents/skills/mastra/scripts/provider-registry.mjs --list` from your project root):
12
+
13
+ ```bash
14
+ # List all available providers
15
+ node scripts/provider-registry.mjs --list
16
+
17
+ # List all models for a specific provider, sorted newest first
18
+ node scripts/provider-registry.mjs --provider openai
19
+ node scripts/provider-registry.mjs --provider anthropic
20
+
21
+ # List live Mastra Gateway chat models as mastra/<provider>/<model> IDs
22
+ node scripts/provider-registry.mjs --provider mastra
23
+ ```
24
+
25
+ For Mastra Gateway setup, see [`gateway.md`](gateway.md).
26
+
27
+ When the user asks to use a model or provider, run the script first to verify the provider key and model name are valid. Do not guess model names from memory because they change frequently.
28
+
29
+ If you need examples in a new-project scaffold, see [`create-mastra.md`](create-mastra.md), then verify the chosen model with the provider registry script.
@@ -0,0 +1,164 @@
1
+ # Mastra Platform
2
+
3
+ ## When to use
4
+
5
+ Use this reference to create Mastra Platform projects, deploy a Mastra app (new or existing), and use Platform workspaces (`PlatformFilesystem`, `PlatformSandbox`) in generated code. For calls to a running Mastra server (agents, workflows, traces), use [`mastra-api.md`](mastra-api.md); it does not cover the Platform control plane.
6
+
7
+ The Platform API changes often. Treat the live spec `https://platform.mastra.ai/openapi.json` and `mastra <command> --help` as the source of truth, and check them before using anything not listed here.
8
+
9
+ ## Human steps vs agent steps
10
+
11
+ The browser is only for the human: signing up, creating an organization, and `mastra auth login`. Never automate the browser or scrape the dashboard.
12
+
13
+ Everything else is agent work: scaffolding, REST discovery and provisioning, `mastra deploy`, and verification. When credentials are missing, stop and ask the user to do one of:
14
+
15
+ - Run `mastra auth login` in their own terminal (browser sign-in). The CLI saves the session, and later CLI commands reuse it without a TTY.
16
+ - Create an API token themselves (`mastra auth tokens create <name>` in their own terminal, or the dashboard) and put it, with `MASTRA_ORG_ID`, in the environment or an ignored env file.
17
+
18
+ Do not run `mastra auth tokens create` yourself: it prints the secret to stdout. Never ask for secret values in chat, never print or log them, and never commit them.
19
+
20
+ If you need anything you were not given — a credential, a model-provider key, which org or project to use — stop and ask the user. Do not take secrets from your own shell environment, other projects, or files the user did not point you to.
21
+
22
+ ## Credentials
23
+
24
+ Two credential models exist. Do not mix them.
25
+
26
+ | Variable | Used by | Notes |
27
+ | - | - | - |
28
+ | `MASTRA_API_TOKEN` | CLI and control-plane REST | Wins over saved `mastra auth login` credentials. Setting it puts `mastra deploy` in headless mode. |
29
+ | `MASTRA_ORG_ID` | CLI and control-plane REST | Sent as `x-organization-id`. Required with `MASTRA_API_TOKEN`. |
30
+ | `MASTRA_PROJECT_ID` | CLI headless deploy | Must be a project ID (not a slug or name) in headless mode. |
31
+ | `MASTRA_PLATFORM_API_URL` | CLI | Optional override. Default `https://platform.mastra.ai`. |
32
+ | `MASTRA_PLATFORM_ACCESS_TOKEN` | App runtime (workspaces, observability) | Not a deploy credential. Injected on deploy; locally, an org API token the user creates. |
33
+ | `MASTRA_ENVIRONMENT_ID`, `MASTRA_PLATFORM_BUCKET_NAME` | App runtime (workspaces) | Injected on deploy; set manually only for local runs. |
34
+
35
+ Check for a saved session with `mastra auth whoami` before asking for credentials. With a saved session, CLI commands (including `mastra deploy`) work without a TTY and use the current org (`mastra auth orgs`; override with `--org <id>`). Only signing in, or signing in again after the session expires, needs a TTY. Do not read the saved credentials file; in session mode use CLI commands instead of the REST calls below, which need `MASTRA_API_TOKEN`.
36
+
37
+ Keep control-plane credentials (`MASTRA_API_TOKEN`, `MASTRA_ORG_ID`) in the shell environment, not in the app's `.env`: deploy uploads app env files as-is and does not filter them.
38
+
39
+ ## Discover and provision over REST
40
+
41
+ `mastra deploy` and `mastra auth` have no JSON output, so use REST when you need machine-readable state. Every control-plane call uses the same headers:
42
+
43
+ ```bash
44
+ curl -fsS https://platform.mastra.ai/v1/auth/orgs \
45
+ -H "Authorization: Bearer $MASTRA_API_TOKEN" \
46
+ -H "x-organization-id: $MASTRA_ORG_ID"
47
+ ```
48
+
49
+ | Route | Purpose |
50
+ | - | - |
51
+ | `GET /v1/auth/orgs` | `{ organizations: [{ id, slug, name, role, isCurrent }] }`. Pick `MASTRA_ORG_ID` here (or `mastra auth whoami`). Org API keys (`sk_...`) get an empty list; ask the user for the org ID. |
52
+ | `GET /v1/projects` | List projects in the org. |
53
+ | `POST /v1/studio/projects` | Create a project. Body `{"name": "..."}` (1–64 chars); response `{ project: { id, slug, workspacesEnabled, ... } }`. Viewer/read-only roles get 403. |
54
+ | `GET /v1/projects/{id}` | Project details, including `workspacesEnabled`. |
55
+ | `GET /v1/projects/{projectId}/environments` | `{ environments: [{ id, name, slug, type, region, instanceUrl, customServerUrl, ... }] }`. Not in the public spec; called by the CLI. |
56
+ | `POST /v1/projects/{projectId}/environments` | Create an environment. Body `{"name": "production", "type": "production", "region": "us"}` (`region` optional). Not in the public spec; called by the CLI. |
57
+ | `GET /v1/projects/{projectId}/environment-deploys` | `{ deploys: [{ id, environmentName, status, error, errorCode, createdAt, ... }] }`. Not in the public spec; called by the CLI. |
58
+
59
+ `/v1/projects` itself is list-only; project creation is under `/v1/studio/projects`. The spec also lists `POST /v1/auth/orgs` (create organization), but creating or choosing an organization is the user's decision: ask the user, do not create one.
60
+
61
+ Before calling a route not listed here, check it exists with the method you need:
62
+
63
+ ```bash
64
+ curl -fsS https://platform.mastra.ai/openapi.json | jq '.paths["/v1/studio/projects"] | keys'
65
+ ```
66
+
67
+ ## Build with Platform workspaces
68
+
69
+ Use `@mastra/platform-workspace` when the app needs durable file storage or remote command execution on the Platform. New projects have workspaces enabled and get one bucket per environment when the environment is created.
70
+
71
+ ```bash
72
+ npm install @mastra/platform-workspace
73
+ ```
74
+
75
+ ```typescript title="src/mastra/workspace.ts"
76
+ import { Workspace } from '@mastra/core/workspace';
77
+ import { PlatformFilesystem, PlatformSandbox } from '@mastra/platform-workspace';
78
+
79
+ // Reads MASTRA_PLATFORM_ACCESS_TOKEN, MASTRA_PROJECT_ID, MASTRA_ENVIRONMENT_ID,
80
+ // and MASTRA_PLATFORM_BUCKET_NAME from the environment. The Platform injects them on deploy.
81
+ export const workspace = new Workspace({
82
+ filesystem: new PlatformFilesystem(),
83
+ sandbox: new PlatformSandbox(),
84
+ });
85
+ ```
86
+
87
+ ```typescript title="src/mastra/index.ts"
88
+ import { Mastra } from '@mastra/core';
89
+ import { workspace } from './workspace';
90
+
91
+ export const mastra = new Mastra({
92
+ // TODO: register your agents, workflows, and storage
93
+ workspace,
94
+ });
95
+ ```
96
+
97
+ The bucket is shared by every request in the environment. A statically configured `PlatformSandbox` is one shared sandbox; construct a new `PlatformSandbox()` (call `start()`, then `destroy()`) for per-task isolation. The sandbox does not mount the bucket. Check the installed package's types or embedded docs for sandbox options before using them.
98
+
99
+ Local runs need all four runtime variables in the app's `.env`. Get `MASTRA_ENVIRONMENT_ID` from the environments route and the bucket name from `GET /v1/server/projects/{id}/environments/{envId}/bucket` (`envId` is the environment ID; response includes `status`: `provisioning`, `ready`, `failed`, or `destroyed`). The user creates the local `MASTRA_PLATFORM_ACCESS_TOKEN` (an org API token from the dashboard). For an offline loop, swap in `LocalFilesystem` and `LocalSandbox`.
100
+
101
+ Projects created before workspaces were on by default may have `workspacesEnabled: false`. Enable with `POST /v1/server/projects/{id}/workspaces/enable`: it requires an admin role (an org API key may not qualify), returns 409 when the project has no environment yet, is idempotent, and cannot be undone. Ask the user before calling it.
102
+
103
+ ## Deploy
104
+
105
+ `mastra deploy` builds the app, runs preflight checks, uploads `.mastra/output`, and follows the deploy until it is running or fails. The first deploy creates the environment (`--env`, default `production`) and writes `.mastra-project.json` (`projectId`, `projectName`, `projectSlug`, `organizationId`, optional `disablePlatformObservability`). It holds no secrets and links the directory to the project for later deploys.
106
+
107
+ | Situation | Command |
108
+ | - | - |
109
+ | Saved `mastra auth login` session (no `MASTRA_API_TOKEN` set) | `mastra deploy --project <name> --yes` (creates the project in the current org if not found) |
110
+ | Headless, token in env | Export `MASTRA_API_TOKEN`, `MASTRA_ORG_ID`, `MASTRA_PROJECT_ID`, then `mastra deploy --yes` |
111
+ | Directory already linked | `mastra deploy --yes` (reads `.mastra-project.json`) |
112
+
113
+ `--project <value>` deploys into an existing project whose ID, slug, or name matches, replacing whatever is running there; it creates a project only when nothing matches. When the directory is not linked yet, check for an existing project with that name first (`GET /v1/projects` with a token; otherwise ask the user). If one exists and you did not create it in this session, ask the user whether to deploy into it or pick a different name.
114
+
115
+ In headless mode the project must already exist and `MASTRA_PROJECT_ID` must be its ID. For a new app, create it first with `POST /v1/studio/projects`, read `project.id`, and export it. Headless mode auto-accepts prompts.
116
+
117
+ Other useful flags: `--env <name>`, `--region us|eu` (new environments only), `--env-file <file>`, `--workers dedicated|in-process`, `--skip-build`. Avoid `--skip-preflight`; it skips the checks that prevent broken deploys.
118
+
119
+ **App environment variables.** Variables stored on the Platform environment are used at deploy time. `--env-file <file>` layers a local file on top (overriding stored keys); with several `.env*` files present, headless mode requires an explicit `--env-file`. A missing model-provider key fails at runtime, not at deploy. Before deploying, check which keys the app needs (for example `OPENAI_API_KEY`); if they are not already stored on the environment, ask the user to put them in a gitignored env file in the project (for example `.env.production`) and deploy with `--env-file <file>` (path relative to the project). Deploy saves those variables on the environment, so later deploys reuse them. Never fill that file from your own shell (for example `printf 'KEY=%s' "$KEY" > .env.production`): the value persists on the Platform environment. If a key was deployed that the user did not provide, tell the user so they can remove or rotate it; do not change stored environment credentials yourself.
120
+
121
+ **Storage.** Preflight blocks file-backed storage (`file:./mastra.db`) because the Platform filesystem is ephemeral. Guard the path with an environment variable:
122
+
123
+ ```typescript
124
+ import { LibSQLStore } from '@mastra/libsql';
125
+
126
+ export const storage = new LibSQLStore({
127
+ id: 'mastra-storage',
128
+ // Hosted database when deployed, local file during development
129
+ url: process.env.TURSO_DATABASE_URL ?? 'file:./mastra.db',
130
+ authToken: process.env.TURSO_AUTH_TOKEN,
131
+ });
132
+ ```
133
+
134
+ The deploy-time offer to create a managed database is interactive only; in headless or `--yes` runs the CLI prints the command instead. Provision it explicitly once the environment exists (create the environment first with `mastra env create production --type production --project "$MASTRA_PROJECT_ID"` or the REST route above):
135
+
136
+ ```bash
137
+ mastra env db create production --kind turso --project "$MASTRA_PROJECT_ID"
138
+ ```
139
+
140
+ The database's connection variables are injected into deploys automatically.
141
+
142
+ ## Verify
143
+
144
+ 1. `mastra deploy` exits non-zero on failure and prints the Server URL on success. The CLI waits until the deploy status is `running` (success), `failed`, or `stopped`; any other status is still in progress.
145
+ 2. For machine-readable status, read the newest entry from `GET /v1/projects/{projectId}/environment-deploys`, or poll `GET /v1/projects/{projectId}/environments/{environmentId}/deploys/{deployId}`.
146
+ 3. On failure, run `mastra env diagnosis <deploy-id>` for fix suggestions.
147
+ 4. Call the deployed server with `mastra api --url <server-url> agent list` (see [`mastra-api.md`](mastra-api.md)), then exercise one agent, including a workspace tool if the app uses one.
148
+
149
+ ## Clean up
150
+
151
+ Only delete resources you created in this session, and only with the user's consent. `DELETE /v1/projects/{id}` is a soft delete: `GET /v1/projects/recently-deleted` lists deleted projects and `POST /v1/projects/{id}/undelete` restores one. `mastra env delete <environment>` removes an environment.
152
+
153
+ ## Failures
154
+
155
+ | Symptom | Cause and fix |
156
+ | - | - |
157
+ | 401 | Missing, expired, or wrong credential type. `MASTRA_PLATFORM_ACCESS_TOKEN` cannot replace `MASTRA_API_TOKEN`. Ask the user for a new token. |
158
+ | 403 | Role lacks permission (viewer on project create, non-admin on workspace enable). Ask the user for a token with a sufficient role. |
159
+ | Headless deploy asks for `MASTRA_ORG_ID` / `MASTRA_PROJECT_ID` | Both are required with `MASTRA_API_TOKEN`; create the project over REST first. |
160
+ | `No organizations found` from `mastra env ...` with `MASTRA_API_TOKEN` | Known CLI issue: org resolution can fail before `MASTRA_ORG_ID` is read. Use the REST route with `x-organization-id` instead. |
161
+ | 409 on workspace enable | The project has no environment; deploy or create one first. |
162
+ | Generic 500 from `PlatformFilesystem` / `PlatformSandbox` | Upstream storage or sandbox error, not auth. Capture the request ID and report it; do not retry in a loop. |
163
+ | Preflight blocks a local storage path | Guard the path with an env var and attach a managed database (see Storage). |
164
+ | Deploy succeeds but agent calls fail | Model-provider key missing from the environment. Ask the user to add it to a gitignored env file, then redeploy with `--env-file <file>`. |