@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
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_run_registry = require("../run-registry-CXeR1Qso.cjs");
3
- const require_stream = require("../stream-CiXZtgym.cjs");
2
+ const require_execution_fence = require("../execution-fence-fqV6FGdV.cjs");
3
+ const require_stream = require("../stream-CZy8XA_q.cjs");
4
4
  const require_predicate_index = require("../predicate/index.cjs");
5
5
  const require_schedules = require("../schedules-BZS8McF7.cjs");
6
6
  const require_scheduler = require("../scheduler-CMjK0LoQ.cjs");
7
- const require_validate = require("../validate-DpK_G9aa.cjs");
8
- const require_rehydrate = require("../rehydrate-CfS6KkCr.cjs");
7
+ const require_validate = require("../validate-CBQ0dMBb.cjs");
8
+ const require_rehydrate = require("../rehydrate-4Sl7D3kO.cjs");
9
9
  // src/workflows/state-reader.ts
10
10
  const getStep = (state, stepId) => state.steps?.[stepId];
11
11
  const getFirstStepResult = (step) => {
@@ -71,50 +71,50 @@ function createWorkflowStateReader(state) {
71
71
  getResumeLabels: () => getWorkflowResumeLabels(state)
72
72
  };
73
73
  }
74
- exports.DefaultExecutionEngine = require_run_registry.DefaultExecutionEngine;
75
- exports.ExecutionEngine = require_run_registry.ExecutionEngine;
76
- exports.RESUME_SNAPSHOT_POLL_INTERVAL_MS = require_run_registry.RESUME_SNAPSHOT_POLL_INTERVAL_MS;
77
- exports.RESUME_SNAPSHOT_WAIT_STATUSES = require_run_registry.RESUME_SNAPSHOT_WAIT_STATUSES;
78
- exports.Run = require_run_registry.Run;
74
+ exports.DefaultExecutionEngine = require_execution_fence.DefaultExecutionEngine;
75
+ exports.ExecutionEngine = require_execution_fence.ExecutionEngine;
76
+ exports.RESUME_SNAPSHOT_POLL_INTERVAL_MS = require_execution_fence.RESUME_SNAPSHOT_POLL_INTERVAL_MS;
77
+ exports.RESUME_SNAPSHOT_WAIT_STATUSES = require_execution_fence.RESUME_SNAPSHOT_WAIT_STATUSES;
78
+ exports.Run = require_execution_fence.Run;
79
79
  exports.Scheduler = require_scheduler.Scheduler;
80
- exports.Workflow = require_run_registry.Workflow;
80
+ exports.Workflow = require_execution_fence.Workflow;
81
81
  exports.WorkflowScheduler = require_scheduler.WorkflowScheduler;
82
- exports.abortableSleep = require_run_registry.abortableSleep;
82
+ exports.abortableSleep = require_execution_fence.abortableSleep;
83
83
  exports.analyzeMapConfig = require_validate.analyzeMapConfig;
84
- exports.applyStateDelta = require_run_registry.applyStateDelta;
85
- exports.assertTimeTravelGraphMatchesSnapshot = require_run_registry.assertTimeTravelGraphMatchesSnapshot;
84
+ exports.applyStateDelta = require_execution_fence.applyStateDelta;
85
+ exports.assertTimeTravelGraphMatchesSnapshot = require_execution_fence.assertTimeTravelGraphMatchesSnapshot;
86
86
  exports.assertValidDynamicWorkflow = require_validate.assertValidDynamicWorkflow;
87
87
  exports.claimScheduleFire = require_scheduler.claimScheduleFire;
88
- exports.cleanStepResult = require_run_registry.cleanStepResult;
89
- exports.cloneStep = require_run_registry.cloneStep$1;
90
- exports.cloneWorkflow = require_run_registry.cloneWorkflow;
88
+ exports.cleanStepResult = require_execution_fence.cleanStepResult;
89
+ exports.cloneStep = require_execution_fence.cloneStep$1;
90
+ exports.cloneWorkflow = require_execution_fence.cloneWorkflow;
91
91
  exports.collectNestedWorkflowIds = require_validate.collectNestedWorkflowIds;
92
92
  exports.computeNextFireAt = require_schedules.computeNextFireAt;
93
- exports.computeScheduleDefinitionHash = require_run_registry.computeScheduleDefinitionHash;
94
- exports.createDeprecationProxy = require_run_registry.createDeprecationProxy;
95
- exports.createEventedWorkflow = require_run_registry.createEventedWorkflow;
96
- exports.createMappingStep = require_run_registry.createMappingStep;
97
- exports.createRestartExecutionParams = require_run_registry.createRestartExecutionParams;
98
- exports.createStep = require_run_registry.createStep$1;
99
- exports.createStepFromAgent = require_run_registry.createStepFromAgent;
100
- exports.createStepFromClassifier = require_run_registry.createStepFromClassifier;
101
- exports.createStepFromTool = require_run_registry.createStepFromTool;
102
- exports.createTimeTravelExecutionParams = require_run_registry.createTimeTravelExecutionParams;
103
- exports.createWorkflow = require_run_registry.createWorkflow;
93
+ exports.computeScheduleDefinitionHash = require_execution_fence.computeScheduleDefinitionHash;
94
+ exports.createDeprecationProxy = require_execution_fence.createDeprecationProxy;
95
+ exports.createEventedWorkflow = require_execution_fence.createEventedWorkflow;
96
+ exports.createMappingStep = require_execution_fence.createMappingStep;
97
+ exports.createRestartExecutionParams = require_execution_fence.createRestartExecutionParams;
98
+ exports.createStep = require_execution_fence.createStep$1;
99
+ exports.createStepFromAgent = require_execution_fence.createStepFromAgent;
100
+ exports.createStepFromClassifier = require_execution_fence.createStepFromClassifier;
101
+ exports.createStepFromTool = require_execution_fence.createStepFromTool;
102
+ exports.createTimeTravelExecutionParams = require_execution_fence.createTimeTravelExecutionParams;
103
+ exports.createWorkflow = require_execution_fence.createWorkflow;
104
104
  exports.createWorkflowStateReader = createWorkflowStateReader;
105
- exports.defineLazyWriter = require_run_registry.defineLazyWriter;
106
- exports.defineStateAccessors = require_run_registry.defineStateAccessors;
105
+ exports.defineLazyWriter = require_execution_fence.defineLazyWriter;
106
+ exports.defineStateAccessors = require_execution_fence.defineStateAccessors;
107
107
  exports.derivePredicateLabel = require_predicate_index.derivePredicateLabel;
108
108
  exports.entryOptionFields = require_rehydrate.entryOptionFields;
109
- exports.evaluatePredicate = require_run_registry.evaluatePredicate;
109
+ exports.evaluatePredicate = require_execution_fence.evaluatePredicate;
110
110
  exports.forEachSingleStepEntry = require_validate.forEachSingleStepEntry;
111
111
  exports.forEachSingleStepEntryWithPath = require_validate.forEachSingleStepEntryWithPath;
112
- exports.getEntryId = require_run_registry.getEntryId;
113
- exports.getEntryWorkflow = require_run_registry.getEntryWorkflow;
114
- exports.getRestartStartIndex = require_run_registry.getRestartStartIndex;
115
- exports.getResumeLabelsByStepId = require_run_registry.getResumeLabelsByStepId;
116
- exports.getSingleStepEntryId = require_run_registry.getSingleStepEntryId;
117
- exports.getStepIds = require_run_registry.getStepIds;
112
+ exports.getEntryId = require_execution_fence.getEntryId;
113
+ exports.getEntryWorkflow = require_execution_fence.getEntryWorkflow;
114
+ exports.getRestartStartIndex = require_execution_fence.getRestartStartIndex;
115
+ exports.getResumeLabelsByStepId = require_execution_fence.getResumeLabelsByStepId;
116
+ exports.getSingleStepEntryId = require_execution_fence.getSingleStepEntryId;
117
+ exports.getStepIds = require_execution_fence.getStepIds;
118
118
  exports.getStepResult = require_stream.getStepResult;
119
119
  exports.getStepResultAsync = require_stream.getStepResultAsync;
120
120
  exports.getWorkflowResumeLabel = getWorkflowResumeLabel;
@@ -123,36 +123,36 @@ exports.getWorkflowStepOutput = getWorkflowStepOutput;
123
123
  exports.getWorkflowStepPayload = getWorkflowStepPayload;
124
124
  exports.getWorkflowSuspendedStep = getWorkflowSuspendedStep;
125
125
  exports.getWorkflowSuspendedSteps = getWorkflowSuspendedSteps;
126
- exports.hydrateSerializedStepErrors = require_run_registry.hydrateSerializedStepErrors;
126
+ exports.hydrateSerializedStepErrors = require_execution_fence.hydrateSerializedStepErrors;
127
127
  exports.inferGraphSchemas = require_validate.inferGraphSchemas;
128
- exports.isEntryFinished = require_run_registry.isEntryFinished;
129
- exports.isProcessor = require_run_registry.isProcessor;
130
- exports.isSingleStepEntry = require_run_registry.isSingleStepEntry;
128
+ exports.isEntryFinished = require_execution_fence.isEntryFinished;
129
+ exports.isProcessor = require_execution_fence.isProcessor;
130
+ exports.isSingleStepEntry = require_execution_fence.isSingleStepEntry;
131
131
  exports.jsonSchemaToZod = require_validate.jsonSchemaToZod;
132
- exports.mapVariable = require_run_registry.mapVariable;
133
- exports.omitPriorCompletionFields = require_run_registry.omitPriorCompletionFields;
134
- exports.omitPriorSuspensionFields = require_run_registry.omitPriorSuspensionFields;
132
+ exports.mapVariable = require_execution_fence.mapVariable;
133
+ exports.omitPriorCompletionFields = require_execution_fence.omitPriorCompletionFields;
134
+ exports.omitPriorSuspensionFields = require_execution_fence.omitPriorSuspensionFields;
135
135
  exports.parseMapConfig = require_validate.parseMapConfig;
136
136
  exports.predicateSchema = require_predicate_index.predicateSchema;
137
- exports.predicateToCondition = require_run_registry.predicateToCondition;
137
+ exports.predicateToCondition = require_execution_fence.predicateToCondition;
138
138
  exports.rehydrateWorkflow = require_rehydrate.rehydrateWorkflow;
139
- exports.resolveForeachConcurrency = require_run_registry.resolveForeachConcurrency;
140
- exports.runCountDeprecationMessage = require_run_registry.runCountDeprecationMessage;
139
+ exports.resolveForeachConcurrency = require_execution_fence.resolveForeachConcurrency;
140
+ exports.runCountDeprecationMessage = require_execution_fence.runCountDeprecationMessage;
141
141
  exports.runScheduleTick = require_scheduler.runScheduleTick;
142
142
  exports.schemaCompatibility = require_validate.schemaCompatibility;
143
- exports.setLongTimeout = require_run_registry.setLongTimeout;
143
+ exports.setLongTimeout = require_execution_fence.setLongTimeout;
144
144
  exports.toJsonSchemaOrUndefined = require_validate.toJsonSchemaOrUndefined;
145
145
  exports.toStorableGraph = require_rehydrate.toStorableGraph;
146
146
  exports.validateCron = require_schedules.validateCron;
147
147
  exports.validateDynamicWorkflow = require_validate.validateDynamicWorkflow;
148
- exports.validateStepInput = require_run_registry.validateStepInput;
149
- exports.validateStepRequestContext = require_run_registry.validateStepRequestContext;
150
- exports.validateStepResumeData = require_run_registry.validateStepResumeData;
151
- exports.validateStepStateData = require_run_registry.validateStepStateData;
152
- exports.validateStepSuspendData = require_run_registry.validateStepSuspendData;
148
+ exports.validateStepInput = require_execution_fence.validateStepInput;
149
+ exports.validateStepRequestContext = require_execution_fence.validateStepRequestContext;
150
+ exports.validateStepResumeData = require_execution_fence.validateStepResumeData;
151
+ exports.validateStepStateData = require_execution_fence.validateStepStateData;
152
+ exports.validateStepSuspendData = require_execution_fence.validateStepSuspendData;
153
153
  exports.validateStorableJsonSchema = require_validate.validateStorableJsonSchema;
154
154
  exports.validateWorkflowRefs = require_validate.validateWorkflowRefs;
155
155
  exports.validateWorkflowSchemas = require_validate.validateWorkflowSchemas;
156
156
  exports.validateWorkflowStructure = require_validate.validateWorkflowStructure;
157
- exports.waitForSuspendedSnapshot = require_run_registry.waitForSuspendedSnapshot;
158
- exports.workflowTermination = require_run_registry.workflowTermination;
157
+ exports.waitForSuspendedSnapshot = require_execution_fence.waitForSuspendedSnapshot;
158
+ exports.workflowTermination = require_execution_fence.workflowTermination;
@@ -1,10 +1,10 @@
1
- import { $c as createMappingStep, Ac as cloneStep, Al as validateStepSuspendData, Cl as resolveForeachConcurrency, Dl as validateStepRequestContext, El as validateStepInput, Fc as evaluatePredicate, Gs as createEventedWorkflow, Il as workflowTermination, Ks as createWorkflow, Mc as isProcessor, Ml as getEntryId, Nc as mapVariable, Nl as getEntryWorkflow, Oc as Run, Ol as validateStepResumeData, Pc as predicateToCondition, Sl as omitPriorSuspensionFields, Tl as setLongTimeout, Vc as DefaultExecutionEngine, Ws as cloneWorkflow, Yc as ExecutionEngine, _l as getStepIds, al as abortableSleep, bl as isSingleStepEntry, cl as cleanStepResult, dl as createTimeTravelExecutionParams, el as createStepFromAgent, fl as defineLazyWriter, gl as getSingleStepEntryId, hl as getResumeLabelsByStepId, il as RESUME_SNAPSHOT_WAIT_STATUSES, jc as createStep, jl as waitForSuspendedSnapshot, kc as Workflow, kl as validateStepStateData, ll as createDeprecationProxy, ml as getRestartStartIndex, nl as createStepFromTool, ol as applyStateDelta, pl as defineStateAccessors, rl as RESUME_SNAPSHOT_POLL_INTERVAL_MS, sl as assertTimeTravelGraphMatchesSnapshot, tc as computeScheduleDefinitionHash, tl as createStepFromClassifier, ul as createRestartExecutionParams, vl as hydrateSerializedStepErrors, wl as runCountDeprecationMessage, xl as omitPriorCompletionFields, yl as isEntryFinished } from "../run-registry-Cu9CK7AR.js";
2
- import { Ot as getStepResult, kt as getStepResultAsync } from "../stream-DTpp9Tk-.js";
1
+ import { Al as validateStepRequestContext, Cl as isSingleStepEntry, Dl as runCountDeprecationMessage, Ds as createEventedWorkflow, El as resolveForeachConcurrency, Es as cloneWorkflow, Fc as isProcessor, Fl as getEntryId, Ic as mapVariable, Il as getEntryWorkflow, Lc as predicateToCondition, Ls as computeScheduleDefinitionHash, Mc as Workflow, Ml as validateStepStateData, Nc as cloneStep, Nl as validateStepSuspendData, Ol as setLongTimeout, Os as createWorkflow, Pc as createStep, Pl as waitForSuspendedSnapshot, Qc as ExecutionEngine, Rc as evaluatePredicate, Sl as isEntryFinished, Tl as omitPriorSuspensionFields, Wc as DefaultExecutionEngine, _l as getRestartStartIndex, al as createStepFromTool, bl as getStepIds, cl as abortableSleep, dl as cleanStepResult, fl as createDeprecationProxy, gl as defineStateAccessors, hl as defineLazyWriter, il as createStepFromClassifier, jc as Run, jl as validateStepResumeData, kl as validateStepInput, ll as applyStateDelta, ml as createTimeTravelExecutionParams, nl as createMappingStep, ol as RESUME_SNAPSHOT_POLL_INTERVAL_MS, pl as createRestartExecutionParams, rl as createStepFromAgent, sl as RESUME_SNAPSHOT_WAIT_STATUSES, ul as assertTimeTravelGraphMatchesSnapshot, vl as getResumeLabelsByStepId, wl as omitPriorCompletionFields, xl as hydrateSerializedStepErrors, yl as getSingleStepEntryId, zl as workflowTermination } from "../execution-fence-B8yV_n51.js";
2
+ import { Ot as getStepResult, kt as getStepResultAsync } from "../stream-BFhCDJvz.js";
3
3
  import { derivePredicateLabel, predicateSchema } from "../predicate/index.js";
4
4
  import { _ as validateCron, h as computeNextFireAt } from "../schedules-DZfSx-7P.js";
5
5
  import { i as runScheduleTick, n as WorkflowScheduler, r as claimScheduleFire, t as Scheduler } from "../scheduler-0ShtMM1I.js";
6
- import { a as jsonSchemaToZod, c as analyzeMapConfig, d as toJsonSchemaOrUndefined, f as validateWorkflowRefs, h as forEachSingleStepEntryWithPath, i as validateWorkflowSchemas, l as parseMapConfig, m as forEachSingleStepEntry, n as validateDynamicWorkflow, o as validateStorableJsonSchema, p as collectNestedWorkflowIds, r as validateWorkflowStructure, s as inferGraphSchemas, t as assertValidDynamicWorkflow, u as schemaCompatibility } from "../validate-hFVBw9Sw.js";
7
- import { n as entryOptionFields, r as toStorableGraph, t as rehydrateWorkflow } from "../rehydrate-Chuw5IrY.js";
6
+ import { a as jsonSchemaToZod, c as analyzeMapConfig, d as toJsonSchemaOrUndefined, f as validateWorkflowRefs, h as forEachSingleStepEntryWithPath, i as validateWorkflowSchemas, l as parseMapConfig, m as forEachSingleStepEntry, n as validateDynamicWorkflow, o as validateStorableJsonSchema, p as collectNestedWorkflowIds, r as validateWorkflowStructure, s as inferGraphSchemas, t as assertValidDynamicWorkflow, u as schemaCompatibility } from "../validate-KIBMWuyc.js";
7
+ import { n as entryOptionFields, r as toStorableGraph, t as rehydrateWorkflow } from "../rehydrate-Da4_E_N8.js";
8
8
  // src/workflows/state-reader.ts
9
9
  const getStep = (state, stepId) => state.steps?.[stepId];
10
10
  const getFirstStepResult = (step) => {
@@ -95,15 +95,30 @@ type StepResultWrite = StateWrite & {
95
95
  startGuard?: WorkflowStepStartGuard;
96
96
  /** The store rejects the write unless this delivery owns the running step (not on v2's `mergeStepResult`). */
97
97
  completionGuard?: WorkflowStepCompletionGuard;
98
+ /**
99
+ * An `updateHeader` to make once the step is written (not on `mergeStepResult`). v2 makes it in
100
+ * the same store write where the store supports it; v1, and v2 on other stores, make the two
101
+ * calls. A write the store rejects by throwing (a guard, the fence) makes neither. When the step
102
+ * write finds no stored run, the one-write path writes nothing, and the two-call paths still make
103
+ * the `updateHeader`, which finds no run either.
104
+ */
105
+ headerPatch?: UpdateWorkflowStateOptions;
98
106
  };
99
107
  /**
100
108
  * After a step write: v1 returns every step's result, v2 the written step's (merged, for
101
109
  * `mergeStepResult`) and the run's `lastSeq`. `results` is `{}` when the run isn't stored; the
102
- * whole result is undefined without a store.
110
+ * whole result is undefined without a store. With `headerPatch`, `header` says whether the patch was
111
+ * applied and holds the run's header as stored after it (null when the run isn't stored).
103
112
  */
104
113
  type StepWriteResult = {
105
114
  results: StepResults;
106
115
  seq?: number;
116
+ header?: HeaderPatchResult;
117
+ };
118
+ /** @internal */
119
+ export type HeaderPatchResult = {
120
+ applied: boolean;
121
+ stored: WorkflowRunHeader | null;
107
122
  };
108
123
  type RunStorageArgs = {
109
124
  workflowName: string;
@@ -352,6 +352,16 @@ export interface WorkflowRunState {
352
352
  * the same run id is kept.
353
353
  */
354
354
  guardedOnlySnapshotId?: string;
355
+ /**
356
+ * @internal Every resume or time travel event the evented start handler applied to this run, in
357
+ * order, so a repeated delivery of any of them does not rewrite the run again.
358
+ */
359
+ appliedTriggerEventIds?: string[];
360
+ /**
361
+ * @internal The occurrence the latest applied event expected on the step it targets. A resume event
362
+ * on storage v2 carries no step results, so a repeated delivery compares the stored step against this.
363
+ */
364
+ appliedTriggerTargetStartedBy?: string;
355
365
  /** Tripwire data when status is 'tripwire' */
356
366
  tripwire?: StepTripwireInfo;
357
367
  stepExecutionPath?: string[];
@@ -811,6 +811,7 @@ export declare class Run<TEngineType = DefaultEngineType, TSteps extends Step<st
811
811
  protected _validateResumeData<TResume>(resumeData: TResume, suspendedStep?: StepWithComponent): Promise<any>;
812
812
  protected _validateTimetravelInputData<TInput>(inputData: TInput, step: Step<string, any, TInput, any, any, any, TEngineType, any>): Promise<TInput>;
813
813
  protected _resolveTimetravelInputData(inputData: unknown, steps: string[]): Promise<any>;
814
+ protected _resolveTimetravelSnapshotState(_snapshot: WorkflowRunState): Record<string, unknown> | undefined;
814
815
  protected _start(params: (TInput extends unknown ? {
815
816
  inputData?: TInput;
816
817
  } : {
@@ -1019,7 +1020,8 @@ export declare class Run<TEngineType = DefaultEngineType, TSteps extends Step<st
1019
1020
  runId: string;
1020
1021
  }>;
1021
1022
  /**
1022
- * Restarts the workflow execution that was previously active
1023
+ * Restarts the workflow execution that was previously active.
1024
+ * Deprecated for evented workflows on a pubsub that redelivers unacknowledged events, where it logs a warning.
1023
1025
  * @returns A promise that resolves to the workflow output
1024
1026
  */
1025
1027
  restart(args?: {
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_workspace = require("../workspace-CzzrnE6Q.cjs");
2
+ const require_workspace = require("../workspace-BQD4tcQi.cjs");
3
3
  const require_errors = require("../errors-D5kMB1FQ.cjs");
4
4
  const require_workspace_skills = require("../workspace-skills-BcquhPDn.cjs");
5
5
  exports.CompositeFilesystem = require_workspace.CompositeFilesystem;
@@ -1,4 +1,4 @@
1
- import { $ as SandboxAbortError, A as deleteFileTool, B as MastraSandbox, C as fileStatTool, E as truncateOutput, F as LocalSandbox, G as supportsComputer, H as UnsupportedStdinCloseError, I as detectIsolation, J as MountManager, K as supportsNetworking, L as getRecommendedIsolation, M as requireFilesystem, N as requireSandbox, P as requireWorkspace, Q as MountNotSupportedError, R as isIsolationAvailable, S as indexContentTool, T as DEFAULT_TAIL_LINES, U as MAX_SANDBOX_FILE_MODE, V as ProcessHandle, W as assertModesUnsupported, X as IsolationUnavailableError, Y as FilesystemNotMountableError, Z as MountError, _ as writeFileTool, a as describeFactorySandbox, b as mkdirTool, c as Workspace, ct as MastraFilesystem, d as collectSkillForPublish, dt as WORKSPACE_TOOLS, et as SandboxError, f as publishSkillFromSource, ft as WORKSPACE_TOOLS_PREFIX, g as resolveToolConfig, h as createWorkspaceTools, i as FactorySandbox, it as SandboxUnsupportedFeatureError, j as applyPatchTool, k as editFileTool, l as createSkillTools, lt as CompositeFilesystem, m as VersionedSkillSource, n as createRecreateSandboxTool, nt as SandboxNotReadyError, o as isFactorySandbox, p as CompositeVersionedSkillSource, q as validateSandboxFileMode, r as FACTORY_SANDBOX_BRAND, rt as SandboxTimeoutError, s as normalizeFactorySandboxSettings, st as LocalFilesystem, t as RECREATE_SANDBOX_TOOL_ID, tt as SandboxExecutionError, u as formatSkillActivation, ut as callLifecycle, v as searchTool, w as executeCommandTool, x as listFilesTool, y as readFileTool, z as SandboxProcessManager } from "../workspace-Ct2kAiDv.js";
1
+ import { $ as SandboxAbortError, A as deleteFileTool, B as MastraSandbox, C as fileStatTool, E as truncateOutput, F as LocalSandbox, G as supportsComputer, H as UnsupportedStdinCloseError, I as detectIsolation, J as MountManager, K as supportsNetworking, L as getRecommendedIsolation, M as requireFilesystem, N as requireSandbox, P as requireWorkspace, Q as MountNotSupportedError, R as isIsolationAvailable, S as indexContentTool, T as DEFAULT_TAIL_LINES, U as MAX_SANDBOX_FILE_MODE, V as ProcessHandle, W as assertModesUnsupported, X as IsolationUnavailableError, Y as FilesystemNotMountableError, Z as MountError, _ as writeFileTool, a as describeFactorySandbox, b as mkdirTool, c as Workspace, ct as MastraFilesystem, d as collectSkillForPublish, dt as WORKSPACE_TOOLS, et as SandboxError, f as publishSkillFromSource, ft as WORKSPACE_TOOLS_PREFIX, g as resolveToolConfig, h as createWorkspaceTools, i as FactorySandbox, it as SandboxUnsupportedFeatureError, j as applyPatchTool, k as editFileTool, l as createSkillTools, lt as CompositeFilesystem, m as VersionedSkillSource, n as createRecreateSandboxTool, nt as SandboxNotReadyError, o as isFactorySandbox, p as CompositeVersionedSkillSource, q as validateSandboxFileMode, r as FACTORY_SANDBOX_BRAND, rt as SandboxTimeoutError, s as normalizeFactorySandboxSettings, st as LocalFilesystem, t as RECREATE_SANDBOX_TOOL_ID, tt as SandboxExecutionError, u as formatSkillActivation, ut as callLifecycle, v as searchTool, w as executeCommandTool, x as listFilesTool, y as readFileTool, z as SandboxProcessManager } from "../workspace-sqcfdZRR.js";
2
2
  import { _ as WorkspaceError, a as FileReadRequiredError, b as WorkspaceReadOnlyError, c as FilesystemNotReadyError, d as PermissionError, f as SandboxFeatureNotSupportedError, g as UnsupportedGrepPatternError, h as StaleFileError, i as FileNotFoundError, l as IsDirectoryError, m as SearchNotAvailableError, n as DirectoryNotFoundError, o as FilesystemError, p as SandboxNotAvailableError, r as FileExistsError, s as FilesystemNotAvailableError, t as DirectoryNotEmptyError, u as NotDirectoryError, v as WorkspaceNotAvailableError, y as WorkspaceNotReadyError } from "../errors-CzFYpCHw.js";
3
3
  import { b as getMimeType, f as createGlobMatcher, h as matchGlob, l as LocalSkillSource, m as isGlobPattern, p as extractGlobBase } from "../workspace-skills-38OY32_b.js";
4
4
  export { CompositeFilesystem, CompositeVersionedSkillSource, DEFAULT_TAIL_LINES, DirectoryNotEmptyError, DirectoryNotFoundError, FACTORY_SANDBOX_BRAND, FactorySandbox, FileExistsError, FileNotFoundError, FileReadRequiredError, FilesystemError, FilesystemNotAvailableError, FilesystemNotMountableError, FilesystemNotReadyError, IsDirectoryError, IsolationUnavailableError, LocalFilesystem, LocalSandbox, LocalSkillSource, MAX_SANDBOX_FILE_MODE, MastraFilesystem, MastraSandbox, MountError, MountManager, MountNotSupportedError, NotDirectoryError, PermissionError, ProcessHandle, RECREATE_SANDBOX_TOOL_ID, SandboxAbortError, SandboxError, SandboxExecutionError, SandboxFeatureNotSupportedError, SandboxNotAvailableError, SandboxNotReadyError, SandboxProcessManager, SandboxTimeoutError, SandboxUnsupportedFeatureError, SearchNotAvailableError, StaleFileError, UnsupportedGrepPatternError, UnsupportedStdinCloseError, VersionedSkillSource, WORKSPACE_TOOLS, WORKSPACE_TOOLS_PREFIX, Workspace, WorkspaceError, WorkspaceNotAvailableError, WorkspaceNotReadyError, WorkspaceReadOnlyError, applyPatchTool, assertModesUnsupported, callLifecycle, collectSkillForPublish, createGlobMatcher, createRecreateSandboxTool, createSkillTools, createWorkspaceTools, deleteFileTool, describeFactorySandbox, detectIsolation, editFileTool, executeCommandTool, extractGlobBase, fileStatTool, formatSkillActivation, getMimeType, getRecommendedIsolation, indexContentTool, isFactorySandbox, isGlobPattern, isIsolationAvailable, listFilesTool, matchGlob, mkdirTool, normalizeFactorySandboxSettings, publishSkillFromSource, readFileTool, requireFilesystem, requireSandbox, requireWorkspace, resolveToolConfig, searchTool, supportsComputer, supportsNetworking, truncateOutput, validateSandboxFileMode, writeFileTool };
@@ -4,15 +4,15 @@ const require_errors = require("./errors-D5kMB1FQ.cjs");
4
4
  const require_workspace_skills = require("./workspace-skills-BcquhPDn.cjs");
5
5
  const require_base = require("./base-BIzR1D3_.cjs");
6
6
  const require_logger = require("./logger-CvzZYuJd.cjs");
7
- const require_tool = require("./tool-CYlT2UA-.cjs");
7
+ const require_tool = require("./tool-Dn9WSDVn.cjs");
8
8
  require("./utils-D-eNsgDM.cjs");
9
9
  let stream = require("stream");
10
10
  let zod_v4 = require("zod/v4");
11
11
  let crypto = require("crypto");
12
- let fs = require("fs");
13
- let module$1 = require("module");
14
12
  let os = require("os");
15
13
  os = require_rolldown_runtime.__toESM(os, 1);
14
+ let fs = require("fs");
15
+ let module$1 = require("module");
16
16
  let path = require("path");
17
17
  path = require_rolldown_runtime.__toESM(path, 1);
18
18
  let fs_promises = require("fs/promises");
@@ -4,14 +4,14 @@ import { t as MastraBase } from "./base-CKLWBhDo.js";
4
4
  import { a as RegisteredLogger } from "./logger-BwbmRqfc.js";
5
5
  import { u as RequestContext } from "./request-context-COnZHt2-.js";
6
6
  import { standardSchemaToJSONSchema, toStandardSchema } from "./schema/index.js";
7
- import { r as createTool, s as isValidationError } from "./tool-Z3bykc1m.js";
7
+ import { r as createTool, s as isValidationError } from "./tool-DIFduuTw.js";
8
8
  import "./utils-DU_pU5SK.js";
9
9
  import { createRequire } from "module";
10
10
  import { Readable, Writable } from "stream";
11
11
  import { z } from "zod/v4";
12
12
  import { createHash } from "crypto";
13
- import { constants, existsSync, lstatSync, readFileSync, readlinkSync, realpathSync } from "fs";
14
13
  import os, * as os$1 from "os";
14
+ import { constants, existsSync, lstatSync, readFileSync, readlinkSync, realpathSync } from "fs";
15
15
  import * as nodePath from "path";
16
16
  import path, { dirname, join, parse, posix } from "path";
17
17
  import fs$1, * as fs$2 from "fs/promises";
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "1.87.0-alpha.18",
3
+ "version": "1.87.0-alpha.19",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "files": [
9
9
  "dist",
10
+ "skills",
10
11
  "!dist/**/*.d.*ts.map",
11
12
  "./**/*.d.ts"
12
13
  ],
@@ -924,7 +925,7 @@
924
925
  "ws": "^8.23.0",
925
926
  "xxhash-wasm": "^1.1.0",
926
927
  "yaml": "^2.9.1",
927
- "@mastra/schema-compat": "1.4.1"
928
+ "@mastra/schema-compat": "1.4.2-alpha.0"
928
929
  },
929
930
  "peerDependencies": {
930
931
  "@json-render/chat": "^0.22.0",
@@ -986,19 +987,19 @@
986
987
  "vscode-languageserver-protocol": "^3.18.5",
987
988
  "zod": "^4.6.7",
988
989
  "zod-v3": "npm:zod@3.25.76",
989
- "@internal/ai-sdk-v5": "0.0.99",
990
- "@internal/ai-v6": "0.0.99",
991
- "@internal/ai-v7": "0.0.99",
992
990
  "@internal/ai-sdk-v4": "0.0.99",
991
+ "@internal/ai-sdk-v5": "0.0.99",
993
992
  "@internal/auth": "0.0.40",
994
993
  "@internal/core": "0.1.4",
994
+ "@internal/ai-v6": "0.0.99",
995
995
  "@internal/deployer": "0.0.5",
996
+ "@internal/external-types": "0.0.102",
996
997
  "@internal/lint": "0.0.152",
997
998
  "@internal/llm-recorder": "0.0.88",
999
+ "@internal/test-utils": "0.0.88",
998
1000
  "@internal/types-builder": "0.0.127",
999
- "@internal/external-types": "0.0.102",
1000
- "@internal/voice": "0.0.48",
1001
- "@internal/test-utils": "0.0.88"
1001
+ "@internal/ai-v7": "0.0.99",
1002
+ "@internal/voice": "0.0.48"
1002
1003
  },
1003
1004
  "engines": {
1004
1005
  "node": ">=22.13.0"
@@ -0,0 +1,171 @@
1
+ ---
2
+ name: mastra
3
+ description: "Comprehensive Mastra framework guide for building agents, workflows, tools, memory, workspaces, and storage with current APIs. Use for native capability discovery, logging, tracing, metrics/cost estimates, dataset experiments, documentation lookup, API verification, TypeScript setup, common errors, migrations, building and deploying apps to Mastra Platform via Platform APIs and `mastra deploy`, Mastra Gateway model setup, and `mastra api` CLI tasks: inspect or call resources on local, Mastra platform, or remote servers. For Mastra Factory operations, discover and activate the companion mastra-factory skill. Also report verified bugs and concrete documentation defects to the Mastra team automatically via the feedback endpoint."
4
+ license: Apache-2.0
5
+ metadata:
6
+ author: Mastra
7
+ version: "2.6.0"
8
+ repository: https://github.com/mastra-ai/skills
9
+ ---
10
+
11
+ # Mastra Framework Guide
12
+
13
+ Build AI applications with Mastra. This skill teaches you how to find current documentation and build agents and workflows.
14
+
15
+ ## Critical: Do not trust internal knowledge
16
+
17
+ Everything you know about Mastra is likely outdated or wrong. Never rely on memory. Always verify against current documentation.
18
+
19
+ Your training data contains obsolete APIs, deprecated patterns, and incorrect usage. Mastra evolves rapidly - APIs change between versions, constructor signatures shift, and patterns get refactored.
20
+
21
+ ## Prerequisites
22
+
23
+ Before writing any Mastra code, check if packages are installed:
24
+
25
+ ```bash
26
+ ls node_modules/@mastra/
27
+ ```
28
+
29
+ - If packages exist: Use embedded docs first (most reliable)
30
+ - If no packages: Install first or use remote docs
31
+
32
+ ## Resources
33
+
34
+ ### References
35
+
36
+ | User Question | First Check | How To |
37
+ | ----------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------- |
38
+ | Create/install Mastra project | [`references/create-mastra.md`](references/create-mastra.md) | Setup guide with CLI and manual steps |
39
+ | Choose Agent/Workflow/Tool/Memory/Storage | [`references/core-concepts.md`](references/core-concepts.md) | Core concepts and when to use each primitive |
40
+ | Add logging or set up tracing | [`references/embedded-docs.md`](references/embedded-docs.md) | Look up PinoLogger and observability configuration before custom instrumentation |
41
+ | Track automatic metrics or estimated model cost | [`references/embedded-docs.md`](references/embedded-docs.md) | Look up span-derived metrics, storage support, and pricing coverage |
42
+ | Evaluate quality or compare prompts/models | [`references/embedded-docs.md`](references/embedded-docs.md) | Look up datasets, experiments, and scorers |
43
+ | How do I use Agent/Workflow/Tool? | [`references/embedded-docs.md`](references/embedded-docs.md) | Look up in `node_modules/@mastra/*/dist/docs/` |
44
+ | How do I use X? (no packages) | [`references/remote-docs.md`](references/remote-docs.md) | Fetch from `https://mastra.ai/llms.txt` |
45
+ | Choose or validate a model | [`references/model-selection.md`](references/model-selection.md) | Model format and provider registry lookup |
46
+ | Call models from several providers with one key, add provider failover, or track model spend | [`references/gateway.md`](references/gateway.md) | Mastra Gateway setup and `mastra/` model IDs |
47
+ | I'm getting an error... | [`references/common-errors.md`](references/common-errors.md) | Common errors and solutions |
48
+ | Upgrade from v0.x to v1.x | [`references/migration-guide.md`](references/migration-guide.md) | Version upgrade workflows |
49
+ | Inspect/call server resources via CLI | [`references/mastra-api.md`](references/mastra-api.md) | `mastra api` CLI for local, Mastra platform, or remote servers |
50
+ | Deploy to Mastra Platform, provision projects, or use Platform sandbox/filesystem | [`references/platform.md`](references/platform.md) | Platform REST APIs, credentials, and `mastra deploy` without browser automation |
51
+ | Find exact traces with complex predicates | [`references/trace-query.md`](references/trace-query.md) | Query completed traces by trace fields or related spans |
52
+ | Count traces or compute grouped measures (error rate, latency, tokens, cost) | [`references/trace-query.md`](references/trace-query.md#aggregate-traces) | Aggregate completed traces with `mastra api trace aggregate` over the same selection |
53
+ | List individual spans (failed tool calls, nested agent runs) | [`references/trace-query.md`](references/trace-query.md#query-spans) | Query completed spans with `mastra api span query` and span-field predicates |
54
+ | Compute measures per span (tool error rates, nested agent runs, model tokens) | [`references/trace-query.md`](references/trace-query.md#aggregate-spans) | Aggregate spans with `mastra api span aggregate`, grouped by span fields |
55
+ | Report a bug / documentation defect to Mastra | [`references/feedback.md`](references/feedback.md) | Report eligible findings autonomously to the Mastra team |
56
+
57
+ ### Scripts
58
+
59
+ - `scripts/provider-registry.mjs`: Look up current providers and models available in the model router. Always run this before using a model to verify provider keys and model names. Use `--provider mastra` for the live Mastra Gateway catalog.
60
+
61
+ ## Priority order for writing code
62
+
63
+ Never write code without checking current docs first.
64
+
65
+ 1. Embedded docs first (if packages installed)
66
+
67
+ Look up current docs in `node_modules` for a package. This matches the exact installed version and is the most reliable source of truth. See [`references/embedded-docs.md`](references/embedded-docs.md).
68
+
69
+ 2. Source code second (if packages installed)
70
+
71
+ If embedded docs don't cover the question, inspect the installed source and type definitions. This is the source of truth when docs are missing or unclear. See [`references/embedded-docs.md`](references/embedded-docs.md).
72
+
73
+ 3. Remote docs third (if packages not installed)
74
+
75
+ Use the latest published docs when packages are not installed or when exploring new features. Remote docs may be ahead of the user's installed version. See [`references/remote-docs.md`](references/remote-docs.md).
76
+
77
+ ## Core concepts
78
+
79
+ Use [`references/core-concepts.md`](references/core-concepts.md) when choosing between agents, workflows, tools, memory, and storage.
80
+
81
+ - Agent: Use for open-ended tasks that make decisions and use tools.
82
+ - Workflow: Use for defined multi-step processes.
83
+
84
+ ## Mastra Studio
85
+
86
+ Studio is the interactive UI for building, testing, and managing agents, workflows, and tools. Use Studio when advising a human to inspect or debug visually.
87
+
88
+ Inside a Mastra project, run:
89
+
90
+ ```bash
91
+ npm run dev
92
+ ```
93
+
94
+ Then open `http://localhost:4111` in a browser to show Mastra Studio to your human user.
95
+
96
+ ## Mastra API CLI
97
+
98
+ Use `mastra api` to inspect or call resources on local dev servers, Mastra platform deployments, or remote Mastra endpoints. It is useful for agent-readable state, execution, traces, logs, scores, threads, and workflow operations. See [`references/mastra-api.md`](references/mastra-api.md) for usage patterns.
99
+
100
+ For exact trace selection that needs recursive predicates or conditions over related spans, read [`references/trace-query.md`](references/trace-query.md). Before using `mastra api trace query`, confirm that the installed CLI exposes the command. Use `--schema` for the target's request/response shape and structural constraints, and use the canonical documentation found through [`references/remote-docs.md`](references/remote-docs.md) for supported fields, operators, and semantics. Preserve opaque pagination cursors and fetch trace or span details only after selecting candidates.
101
+
102
+ ## Deploy to Mastra Platform
103
+
104
+ When the user asks to deploy to Mastra, whether to build a new app and deploy it or to deploy an existing Mastra project, read [`references/platform.md`](references/platform.md) before running any deploy or Platform API command. It covers which steps need the human (sign-up and sign-in only), credentials, REST discovery and project creation, `PlatformFilesystem` and `PlatformSandbox`, `mastra deploy`, and verification. Build or locate the app first with the references above, then follow `platform.md` to deploy.
105
+
106
+ ## Mastra Factory
107
+
108
+ For Factory projects, work items, queue health, decisions, session history, memory inspection, or authorized operations, activate the **`mastra-factory`** skill. Factory is an operational control plane, not a reason to scaffold or deploy a new Mastra app.
109
+
110
+ If the skill is missing, offer to install it from this repository:
111
+
112
+ ```bash
113
+ npx skills add mastra-ai/skills --skill mastra-factory
114
+ ```
115
+
116
+ Choose the user's intended agent and scope interactively. For global installation, target a supported agent explicitly with `--agent <agent> -g`; PromptScript does not support global installs. Verify installation and referenced files for the intended agent even if another agent target fails.
117
+
118
+ The Factory skill covers CLI checks, `mastra auth whoami` / authorized `mastra auth login`, and connecting via the user's actual instance URL from any directory. A deployed repository or `.mastra-project.json` is not required with `--url`. Never guess a shared Factory host or project IDs. Its connection and session-inspection references cover deployment-specific authentication, project discovery, threads, and observational memory limitations.
119
+
120
+ ## Reporting feedback
121
+
122
+ Report verified Mastra bugs and concrete documentation defects autonomously when the criteria in [`references/feedback.md`](references/feedback.md) are met, without asking permission per report. Leave feature requests to humans; do not submit them or reclassify them as defects. Do not report the same issue again within the current task or conversation. Capture only anonymized facts for feedback while solving the task. Skip automatic reporting when a finding remains unverified or its relevance is unclear; do not interrupt the user merely to classify it. Respect any user instruction not to report something.
123
+
124
+ ## Critical requirements
125
+
126
+ ### TypeScript config
127
+
128
+ Mastra requires ES2022 modules. CommonJS will fail. See [`references/create-mastra.md`](references/create-mastra.md) for setup and [`references/common-errors.md`](references/common-errors.md) for troubleshooting.
129
+
130
+ ### Model format
131
+
132
+ Always use `"provider/model-name"` when defining models using Mastra's model router.
133
+
134
+ When the user asks to use a model or provider, always run `scripts/provider-registry.mjs` first to verify the provider key and model name are valid. Do not guess model names from memory as they change frequently. See [`references/model-selection.md`](references/model-selection.md).
135
+
136
+ Mastra Gateway is a managed model API. With one Gateway key and a `mastra/<provider>/<model>` ID it gives:
137
+
138
+ - Models from OpenAI, Anthropic, Google, and other providers without separate provider keys
139
+ - Failover: eligible failures retry on another route before any output reaches the client
140
+ - Recorded attempts and cost for every request, and keys limited to specific models
141
+ - Web search for tool-capable chat models
142
+
143
+ For setup, see [`references/gateway.md`](references/gateway.md), and validate Gateway model IDs with `scripts/provider-registry.mjs --provider mastra`.
144
+
145
+ ## When you see errors
146
+
147
+ Type errors often mean your knowledge is outdated.
148
+
149
+ Common signs of outdated knowledge:
150
+
151
+ - `Property X does not exist on type Y`
152
+ - `Cannot find module`
153
+ - `Type mismatch` errors
154
+ - Constructor parameter errors
155
+
156
+ What to do:
157
+
158
+ 1. Check [`references/common-errors.md`](references/common-errors.md)
159
+ 2. Verify current API in embedded docs
160
+ 3. Don't assume the error is a user mistake - it might be your outdated knowledge
161
+
162
+ ## Development workflow
163
+
164
+ Always verify before writing code:
165
+
166
+ 1. Identify whether Mastra already provides the requested behavior using [`references/core-concepts.md`](references/core-concepts.md#discover-native-capabilities-first), before designing custom infrastructure.
167
+ 2. Check installed packages and versions, then verify the capability's APIs, configuration, and limits.
168
+ - If installed: Use embedded docs [`references/embedded-docs.md`](references/embedded-docs.md) and installed types/source.
169
+ - If not: Use remote docs [`references/remote-docs.md`](references/remote-docs.md); verify compatibility before adopting newer features.
170
+ 3. Use the native capability where it fits; implement custom logic only for the identified gap or application-owned requirements.
171
+ 4. Test with the project scripts or Studio when available.