@mastra/core 1.87.0-alpha.0 → 1.87.0-alpha.2

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 (389) hide show
  1. package/dist/_types/@ai-sdk_anthropic@3.0.137/dist/index.d.ts +2 -2
  2. package/dist/_types/@ai-sdk_google@3.0.140/dist/index.d.ts +2 -2
  3. package/dist/_types/@ai-sdk_openai@3.0.135/dist/index.d.ts +2 -2
  4. package/dist/a2a/index.cjs +1 -1
  5. package/dist/a2a/index.js +1 -1
  6. package/dist/agent/durable/index.cjs +2 -1
  7. package/dist/agent/durable/index.d.ts +1 -0
  8. package/dist/agent/durable/index.js +2 -2
  9. package/dist/agent/durable/run-registry.d.ts +12 -1
  10. package/dist/agent/durable/types.d.ts +2 -0
  11. package/dist/agent/durable/workflows/finalize-run.d.ts +2 -1
  12. package/dist/agent/index.cjs +3 -3
  13. package/dist/agent/index.js +3 -3
  14. package/dist/agent/message-list/index.cjs +1 -1
  15. package/dist/agent/message-list/index.js +1 -1
  16. package/dist/agent/thread-stream-runtime.d.ts +3 -1
  17. package/dist/agent-builder/ee/index.cjs +1 -1
  18. package/dist/agent-builder/ee/index.js +1 -1
  19. package/dist/agent-controller/index.cjs +1 -1
  20. package/dist/agent-controller/index.js +1 -1
  21. package/dist/{agent-controller-B8LoFdtu.js → agent-controller-Dc58ARqw.js} +6 -6
  22. package/dist/{agent-controller-DSnFynpa.cjs → agent-controller-v64JbuDa.cjs} +6 -6
  23. package/dist/background-tasks/index.cjs +1 -1
  24. package/dist/background-tasks/index.js +1 -1
  25. package/dist/{background-tasks-Ci5h0dhj.cjs → background-tasks-DgiQNKh7.cjs} +1 -1
  26. package/dist/{background-tasks-IW7M4iD2.js → background-tasks-E-Jjxks4.js} +1 -1
  27. package/dist/browser/index.cjs +1 -1
  28. package/dist/browser/index.js +1 -1
  29. package/dist/{builder-14Uptu8y.cjs → builder-Dfp6Ckjr.cjs} +2 -2
  30. package/dist/{builder-DI2c2xjy.js → builder-Dh175HnQ.js} +2 -2
  31. package/dist/capabilities/302ai.json +197 -197
  32. package/dist/capabilities/abliteratedllm.json +27 -27
  33. package/dist/capabilities/abliteration-ai.json +10 -10
  34. package/dist/capabilities/above.json +22 -22
  35. package/dist/capabilities/adaption.json +12 -12
  36. package/dist/capabilities/adzuki.json +29 -29
  37. package/dist/capabilities/agentrouter.json +8 -8
  38. package/dist/capabilities/agnes.json +3 -3
  39. package/dist/capabilities/ai-router.json +5 -5
  40. package/dist/capabilities/aiand.json +23 -23
  41. package/dist/capabilities/aigrow.json +12 -12
  42. package/dist/capabilities/aimlapi.json +151 -152
  43. package/dist/capabilities/aixy.json +23 -23
  44. package/dist/capabilities/aki-io.json +14 -14
  45. package/dist/capabilities/alibaba-cn.json +92 -92
  46. package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
  47. package/dist/capabilities/alibaba-coding-plan.json +5 -5
  48. package/dist/capabilities/alibaba-token-plan-cn.json +53 -53
  49. package/dist/capabilities/alibaba-token-plan.json +51 -51
  50. package/dist/capabilities/alibaba.json +62 -62
  51. package/dist/capabilities/ambient.json +10 -10
  52. package/dist/capabilities/amd.json +8 -8
  53. package/dist/capabilities/anthropic.json +34 -34
  54. package/dist/capabilities/anyapi.json +18 -18
  55. package/dist/capabilities/apiko.json +4 -4
  56. package/dist/capabilities/arcee.json +6 -6
  57. package/dist/capabilities/augure.json +7 -7
  58. package/dist/capabilities/auriko.json +21 -21
  59. package/dist/capabilities/bailing.json +5 -5
  60. package/dist/capabilities/baseten.json +28 -28
  61. package/dist/capabilities/bee.json +2 -2
  62. package/dist/capabilities/berget.json +4 -4
  63. package/dist/capabilities/bothub.json +16 -16
  64. package/dist/capabilities/boundless.json +39 -39
  65. package/dist/capabilities/bumo.json +42 -42
  66. package/dist/capabilities/byteplus.json +29 -29
  67. package/dist/capabilities/cerebras.json +4 -4
  68. package/dist/capabilities/cheapaimodel.json +10 -10
  69. package/dist/capabilities/cheapest-token.json +29 -29
  70. package/dist/capabilities/chutes.json +5 -5
  71. package/dist/capabilities/cline-pass.json +39 -39
  72. package/dist/capabilities/cloudcode.json +8 -8
  73. package/dist/capabilities/cloudflare-workers-ai.json +18 -18
  74. package/dist/capabilities/commandcode.json +154 -154
  75. package/dist/capabilities/concentrate.json +269 -269
  76. package/dist/capabilities/cortecs.json +113 -113
  77. package/dist/capabilities/crossmodel.json +168 -168
  78. package/dist/capabilities/crusoe.json +9 -9
  79. package/dist/capabilities/daoxe.json +9 -9
  80. package/dist/capabilities/databricks.json +128 -128
  81. package/dist/capabilities/deepinfra.json +99 -99
  82. package/dist/capabilities/deepseek.json +4 -4
  83. package/dist/capabilities/digitalocean.json +117 -117
  84. package/dist/capabilities/dothoosh.json +30 -30
  85. package/dist/capabilities/doubleword.json +27 -27
  86. package/dist/capabilities/edenai.json +901 -1734
  87. package/dist/capabilities/empiriolabs.json +175 -175
  88. package/dist/capabilities/engy.json +21 -21
  89. package/dist/capabilities/evroc.json +13 -13
  90. package/dist/capabilities/ezkielyna.json +8 -8
  91. package/dist/capabilities/fastrouter.json +78 -78
  92. package/dist/capabilities/fireworks-ai.json +68 -68
  93. package/dist/capabilities/freemodel.json +21 -21
  94. package/dist/capabilities/frogbot.json +96 -96
  95. package/dist/capabilities/gisoo.json +17 -17
  96. package/dist/capabilities/gmicloud.json +12 -12
  97. package/dist/capabilities/google.json +51 -51
  98. package/dist/capabilities/graphn.json +16 -16
  99. package/dist/capabilities/greenpt.json +35 -35
  100. package/dist/capabilities/groq.json +2 -2
  101. package/dist/capabilities/helicone.json +85 -85
  102. package/dist/capabilities/hopper.json +2 -2
  103. package/dist/capabilities/hostinger-router.json +13 -13
  104. package/dist/capabilities/hpc-ai.json +4 -4
  105. package/dist/capabilities/huawei-maas.json +12 -12
  106. package/dist/capabilities/hubris.json +29 -29
  107. package/dist/capabilities/huggingface.json +89 -89
  108. package/dist/capabilities/humain.json +2 -2
  109. package/dist/capabilities/hyper.json +27 -27
  110. package/dist/capabilities/impossibl.json +149 -149
  111. package/dist/capabilities/inception.json +3 -3
  112. package/dist/capabilities/inco.json +4 -4
  113. package/dist/capabilities/infer.json +12 -12
  114. package/dist/capabilities/inferall.json +10 -10
  115. package/dist/capabilities/inference-coop.json +11 -11
  116. package/dist/capabilities/inferenceapis.json +17 -17
  117. package/dist/capabilities/inferris.json +4 -4
  118. package/dist/capabilities/infersia.json +12 -12
  119. package/dist/capabilities/infomaniak.json +3 -3
  120. package/dist/capabilities/io-net.json +2 -2
  121. package/dist/capabilities/isoquant.json +4 -4
  122. package/dist/capabilities/iteracompute.json +44 -44
  123. package/dist/capabilities/jad-ai.json +2 -2
  124. package/dist/capabilities/jalapeno.json +11 -11
  125. package/dist/capabilities/jiekou.json +68 -68
  126. package/dist/capabilities/jzstoken.json +48 -48
  127. package/dist/capabilities/keln.json +20 -20
  128. package/dist/capabilities/kenari.json +125 -125
  129. package/dist/capabilities/kilo.json +623 -623
  130. package/dist/capabilities/kimi-code-plan-cn.json +4 -4
  131. package/dist/capabilities/kimi-code-plan-global.json +4 -4
  132. package/dist/capabilities/kitani.json +2 -2
  133. package/dist/capabilities/klavo.json +18 -18
  134. package/dist/capabilities/korouter.json +30 -30
  135. package/dist/capabilities/kunavo.json +6 -6
  136. package/dist/capabilities/liquid.json +12 -12
  137. package/dist/capabilities/lithosai.json +2 -2
  138. package/dist/capabilities/llmgateway-providers.json +916 -916
  139. package/dist/capabilities/llmgateway.json +339 -339
  140. package/dist/capabilities/llmtr.json +31 -31
  141. package/dist/capabilities/longcat.json +2 -2
  142. package/dist/capabilities/lowrouter.json +51 -51
  143. package/dist/capabilities/lyceum.json +4 -4
  144. package/dist/capabilities/melious.json +12 -12
  145. package/dist/capabilities/merge-gateway.json +255 -254
  146. package/dist/capabilities/meta.json +7 -7
  147. package/dist/capabilities/minimax-cn-coding-plan.json +2 -2
  148. package/dist/capabilities/minimax-cn.json +5 -5
  149. package/dist/capabilities/minimax-coding-plan.json +2 -2
  150. package/dist/capabilities/minimax.json +5 -5
  151. package/dist/capabilities/mistral.json +18 -18
  152. package/dist/capabilities/mixlayer.json +5 -5
  153. package/dist/capabilities/modal.json +10 -10
  154. package/dist/capabilities/model-oracle-ai.json +21 -21
  155. package/dist/capabilities/modelis.json +19 -19
  156. package/dist/capabilities/modular.json +10 -10
  157. package/dist/capabilities/moneo.json +14 -14
  158. package/dist/capabilities/moonshotai-cn.json +5 -5
  159. package/dist/capabilities/moonshotai.json +5 -5
  160. package/dist/capabilities/morph.json +14 -14
  161. package/dist/capabilities/munito-eu.json +8 -8
  162. package/dist/capabilities/munito.json +9 -9
  163. package/dist/capabilities/nan.json +28 -28
  164. package/dist/capabilities/nano-gpt.json +586 -584
  165. package/dist/capabilities/nearai.json +87 -87
  166. package/dist/capabilities/nebius.json +26 -26
  167. package/dist/capabilities/neon.json +122 -122
  168. package/dist/capabilities/neuralwatt.json +45 -45
  169. package/dist/capabilities/nokeep.json +2 -2
  170. package/dist/capabilities/novita-ai.json +163 -163
  171. package/dist/capabilities/nvidia.json +22 -22
  172. package/dist/capabilities/oathbreaker.json +2 -2
  173. package/dist/capabilities/obscurify.json +25 -25
  174. package/dist/capabilities/oci.json +5 -5
  175. package/dist/capabilities/ofox.json +293 -293
  176. package/dist/capabilities/ollama-cloud.json +58 -58
  177. package/dist/capabilities/openai.json +55 -55
  178. package/dist/capabilities/opencode-go.json +86 -86
  179. package/dist/capabilities/openreason.json +4 -4
  180. package/dist/capabilities/openrouter.json +529 -535
  181. package/dist/capabilities/opper.json +27 -27
  182. package/dist/capabilities/orcarouter.json +192 -192
  183. package/dist/capabilities/outerlabs.json +31 -31
  184. package/dist/capabilities/ovhcloud.json +20 -20
  185. package/dist/capabilities/pareto.json +5 -5
  186. package/dist/capabilities/pendra.json +4 -4
  187. package/dist/capabilities/perplexity-agent.json +64 -64
  188. package/dist/capabilities/perplexity.json +2 -2
  189. package/dist/capabilities/phala.json +22 -22
  190. package/dist/capabilities/pioneer.json +20 -20
  191. package/dist/capabilities/poe.json +113 -113
  192. package/dist/capabilities/poolside.json +3 -3
  193. package/dist/capabilities/powerspring.json +9 -9
  194. package/dist/capabilities/primalabs.json +10 -10
  195. package/dist/capabilities/prime.json +110 -110
  196. package/dist/capabilities/privatemode-ai.json +12 -12
  197. package/dist/capabilities/proxystacks.json +7 -7
  198. package/dist/capabilities/qiniu-ai.json +14 -14
  199. package/dist/capabilities/refuseless.json +7 -7
  200. package/dist/capabilities/regolo-ai.json +8 -8
  201. package/dist/capabilities/requesty.json +172 -172
  202. package/dist/capabilities/ruapi.json +15 -15
  203. package/dist/capabilities/runcrate.json +6 -6
  204. package/dist/capabilities/runinfra.json +13 -13
  205. package/dist/capabilities/sakana.json +7 -7
  206. package/dist/capabilities/sambanova.json +9 -9
  207. package/dist/capabilities/sandbase.json +24 -24
  208. package/dist/capabilities/sarvam.json +12 -12
  209. package/dist/capabilities/scaleway.json +18 -18
  210. package/dist/capabilities/scnet-token-plan.json +9 -9
  211. package/dist/capabilities/scx-ai.json +30 -30
  212. package/dist/capabilities/sensenova.json +12 -12
  213. package/dist/capabilities/siliconflow-cn.json +45 -45
  214. package/dist/capabilities/siliconflow.json +53 -53
  215. package/dist/capabilities/snowflake-cortex.json +22 -22
  216. package/dist/capabilities/sokkan.json +7 -7
  217. package/dist/capabilities/sparrowcodes.json +19 -19
  218. package/dist/capabilities/standardcompute.json +89 -89
  219. package/dist/capabilities/steadyrouter.json +41 -41
  220. package/dist/capabilities/stepfun-ai-step-plan.json +5 -5
  221. package/dist/capabilities/stepfun-ai.json +5 -5
  222. package/dist/capabilities/stepfun-step-plan.json +5 -5
  223. package/dist/capabilities/stepfun.json +5 -5
  224. package/dist/capabilities/stepping-stone.json +11 -11
  225. package/dist/capabilities/subconscious.json +2 -2
  226. package/dist/capabilities/synthetic.json +10 -10
  227. package/dist/capabilities/synthorai.json +23 -23
  228. package/dist/capabilities/teamorouter.json +25 -25
  229. package/dist/capabilities/teapot-router.json +13 -13
  230. package/dist/capabilities/tencent-token-plan.json +40 -40
  231. package/dist/capabilities/tencent-tokenhub.json +45 -45
  232. package/dist/capabilities/tensorx.json +27 -27
  233. package/dist/capabilities/the-grid-ai.json +37 -37
  234. package/dist/capabilities/thinkingmachines.json +74 -74
  235. package/dist/capabilities/tinfoil.json +12 -12
  236. package/dist/capabilities/toapis.json +2 -2
  237. package/dist/capabilities/togetherai.json +53 -53
  238. package/dist/capabilities/tokengo.json +23 -23
  239. package/dist/capabilities/tokenify.json +9 -9
  240. package/dist/capabilities/trustedrouter.json +4 -4
  241. package/dist/capabilities/trustedtokens.json +12 -12
  242. package/dist/capabilities/umans-ai-coding-plan.json +14 -14
  243. package/dist/capabilities/umans-ai.json +10 -10
  244. package/dist/capabilities/unrestricted.json +8 -8
  245. package/dist/capabilities/uplinkswitch.json +23 -23
  246. package/dist/capabilities/upstage.json +7 -7
  247. package/dist/capabilities/vancine.json +26 -26
  248. package/dist/capabilities/vercel.json +576 -576
  249. package/dist/capabilities/vivgrid.json +85 -85
  250. package/dist/capabilities/volcengine-coding-plan.json +36 -27
  251. package/dist/capabilities/volcengine.json +27 -27
  252. package/dist/capabilities/vultr.json +31 -31
  253. package/dist/capabilities/wafer.ai.json +14 -14
  254. package/dist/capabilities/wallaby.json +5 -5
  255. package/dist/capabilities/wally.json +11 -11
  256. package/dist/capabilities/wandb.json +11 -11
  257. package/dist/capabilities/watt.json +24 -24
  258. package/dist/capabilities/xai.json +6 -6
  259. package/dist/capabilities/xpersona.json +12 -12
  260. package/dist/capabilities/xxapi.json +29 -29
  261. package/dist/capabilities/zai-coding-plan.json +6 -6
  262. package/dist/capabilities/zai.json +32 -32
  263. package/dist/capabilities/zenifra.json +27 -27
  264. package/dist/capabilities/zenmux.json +186 -186
  265. package/dist/capabilities/zerogpu.json +14 -14
  266. package/dist/capabilities/zhipuai-coding-plan.json +8 -8
  267. package/dist/capabilities/zhipuai.json +31 -31
  268. package/dist/capabilities/zro.json +6 -6
  269. package/dist/channels/agent-channels.d.ts +7 -0
  270. package/dist/channels/attach-file-tool.d.ts +22 -0
  271. package/dist/channels/index.cjs +11 -2
  272. package/dist/channels/index.d.ts +10 -0
  273. package/dist/channels/index.js +3 -3
  274. package/dist/channels/reply-guidance-processor.d.ts +26 -0
  275. package/dist/channels/reply-mode.d.ts +66 -0
  276. package/dist/channels/reply-reminder-processor.d.ts +23 -0
  277. package/dist/channels/reply-tool.d.ts +43 -0
  278. package/dist/channels/thread-link-processor.d.ts +48 -0
  279. package/dist/channels/thread-lookup.d.ts +16 -0
  280. package/dist/channels/tool-announcement-processor.d.ts +29 -0
  281. package/dist/channels/types.d.ts +25 -0
  282. package/dist/{channels-Wh32drgu.js → channels-0AO7PMJF.js} +99 -2
  283. package/dist/{channels-tVV_de9Q.cjs → channels-BZL9RT2i.cjs} +122 -1
  284. package/dist/coding-agent/index.cjs +1 -1
  285. package/dist/coding-agent/index.js +1 -1
  286. package/dist/datasets/experiment/index.d.ts +1 -1
  287. package/dist/datasets/experiment/item.d.ts +4 -3
  288. package/dist/datasets/experiment/scorer.d.ts +34 -11
  289. package/dist/datasets/index.cjs +3 -2
  290. package/dist/datasets/index.js +3 -3
  291. package/dist/{dist-ByO0vuJJ-BjMue5_p.cjs → dist-CufwpBZM-CwERFaas.cjs} +4 -4
  292. package/dist/{dist-ByO0vuJJ-CCXLBnvJ.js → dist-CufwpBZM-DK14Qe0Z.js} +4 -4
  293. package/dist/docs/SKILL.md +2 -1
  294. package/dist/docs/assets/SOURCE_MAP.json +743 -743
  295. package/dist/docs/references/docs-channels.md +43 -0
  296. package/dist/docs/references/docs-evals-experiments.md +13 -3
  297. package/dist/docs/references/reference-agents-durable-agent.md +2 -0
  298. package/dist/docs/references/reference-channels-thread-link.md +67 -0
  299. package/dist/docs/references/reference-workspace-factory-sandbox.md +2 -1
  300. package/dist/docs/references/reference.md +1 -0
  301. package/dist/evals/index.cjs +1 -1
  302. package/dist/evals/index.js +1 -1
  303. package/dist/evals/scoreTraces/index.cjs +1 -1
  304. package/dist/evals/scoreTraces/index.js +1 -1
  305. package/dist/harness/index.cjs +1 -1
  306. package/dist/harness/index.js +1 -1
  307. package/dist/index.cjs +1 -1
  308. package/dist/index.js +1 -1
  309. package/dist/knowledge/importers/host.d.ts +7 -1
  310. package/dist/knowledge/importers/runner.d.ts +12 -0
  311. package/dist/knowledge/importers/types.d.ts +2 -0
  312. package/dist/knowledge/index.cjs +82 -6
  313. package/dist/knowledge/index.js +82 -6
  314. package/dist/llm/index.cjs +3 -3
  315. package/dist/llm/index.js +3 -3
  316. package/dist/llm/model/provider-types.generated.d.ts +7397 -7534
  317. package/dist/{llm-B1zaFLYZ.js → llm-B46V7Mi7.js} +2 -2
  318. package/dist/{llm-BAiOsNAP.cjs → llm-B4AeSFvV.cjs} +2 -2
  319. package/dist/loop/index.cjs +2 -2
  320. package/dist/loop/index.js +2 -2
  321. package/dist/{manager-ChK9GdGz.js → manager-BRAvwB9b.js} +120 -70
  322. package/dist/{manager-BVX9nVrM.cjs → manager-BwDxA1Nn.cjs} +125 -69
  323. package/dist/mastra/index.cjs +1 -1
  324. package/dist/mastra/index.js +1 -1
  325. package/dist/{mastra-CUGfgEpZ.js → mastra-CIx6qEq2.js} +16 -16
  326. package/dist/{mastra-HSmofHEJ.cjs → mastra-DBhdD172.cjs} +16 -16
  327. package/dist/memory/index.cjs +3 -3
  328. package/dist/memory/index.js +3 -3
  329. package/dist/{message-list-Cj0Sq_JP.cjs → message-list-DfN9mWeN.cjs} +121 -121
  330. package/dist/{message-list-KRbg-TnI.js → message-list-wI71UGxk.js} +1 -1
  331. package/dist/{model-C47BJRtR.js → model-CJMsDU8w.js} +1 -1
  332. package/dist/{model-WahorgzJ.cjs → model-CYhAa5qO.cjs} +1 -1
  333. package/dist/{netlify-D99AnEhW.cjs → netlify-Bw7Vd58y.cjs} +11 -11
  334. package/dist/{netlify-CfDXkuLf.js → netlify-C9aJA6Cv.js} +10 -10
  335. package/dist/notifications/index.cjs +1 -1
  336. package/dist/notifications/index.js +1 -1
  337. package/dist/processor-provider/index.cjs +1 -1
  338. package/dist/processor-provider/index.js +1 -1
  339. package/dist/processors/index.cjs +2 -2
  340. package/dist/processors/index.js +2 -2
  341. package/dist/{provider-registry-CO1NVbO5.cjs → provider-registry-Bn_7VvZ8.cjs} +22046 -22320
  342. package/dist/{provider-registry-CR385GJ4.js → provider-registry-DOfYSEju.js} +22046 -22320
  343. package/dist/provider-registry.json +22352 -22626
  344. package/dist/{registry-generator-Cvp34qcB.cjs → registry-generator-BnK5Npgr.cjs} +1 -1
  345. package/dist/{registry-generator-B3erRqYS.js → registry-generator-Cw594Ttt.js} +1 -1
  346. package/dist/{rehydrate-Da4hNuaK.cjs → rehydrate-BWnd_TEx.cjs} +2 -2
  347. package/dist/{rehydrate-CJBLrZxs.js → rehydrate-Dgqkw7Py.js} +2 -2
  348. package/dist/relevance/index.cjs +2 -2
  349. package/dist/relevance/index.js +2 -2
  350. package/dist/{run-registry-DdeEBsVW.js → run-registry-DhOKJtlb.js} +848 -186
  351. package/dist/{run-registry-TOOfO3hT.cjs → run-registry-lLRc7EE6.cjs} +883 -185
  352. package/dist/storage/index.cjs +2 -2
  353. package/dist/storage/index.js +2 -2
  354. package/dist/stream/index.cjs +2 -2
  355. package/dist/stream/index.js +2 -2
  356. package/dist/{stream-DH7Qgz8l.cjs → stream-BIDts1fZ.cjs} +2 -2
  357. package/dist/{stream-C5PagEDs.js → stream-C8HKG3qC.js} +2 -2
  358. package/dist/test-utils/llm-mock.cjs +1 -1
  359. package/dist/test-utils/llm-mock.js +1 -1
  360. package/dist/tool-loop-agent/index.cjs +1 -1
  361. package/dist/tool-loop-agent/index.js +1 -1
  362. package/dist/{tool-loop-agent-DVYJXlQJ.js → tool-loop-agent-DM5V_0XS.js} +4 -4
  363. package/dist/{tool-loop-agent-CJTs4T8b.cjs → tool-loop-agent-PEY5a1R6.cjs} +4 -4
  364. package/dist/{utils-xJi_N6Tx.cjs → utils-CxMSu_wc.cjs} +1 -1
  365. package/dist/{utils-D8upuTwy.js → utils-DcnKVK34.js} +1 -1
  366. package/dist/utils.cjs +1 -1
  367. package/dist/utils.js +1 -1
  368. package/dist/{validate-DTkW3Vlp.js → validate-Dn750ciE.js} +1 -1
  369. package/dist/{validate-6eZ8Wssn.cjs → validate-RVKgazCf.cjs} +1 -1
  370. package/dist/vector/index.cjs +2 -2
  371. package/dist/vector/index.js +2 -2
  372. package/dist/worker/index.cjs +1 -1
  373. package/dist/worker/index.js +1 -1
  374. package/dist/{worker-24ORi-wV.cjs → worker-CFPu9qwV.cjs} +2 -2
  375. package/dist/{worker-Dqubrnf8.js → worker-DJPAdazC.js} +2 -2
  376. package/dist/{worker-BO3u_WjZ.cjs → worker-Dx0ZHMGX.cjs} +2 -2
  377. package/dist/{worker-DbcFkKJO.js → worker-SDi9jbP5.js} +2 -2
  378. package/dist/{workflow-wXOf72fO.js → workflow-DkBqNn7X.js} +3 -3
  379. package/dist/{workflow-D5Fc5ieC.cjs → workflow-ZFOz_365.cjs} +3 -3
  380. package/dist/workflows/builder/index.cjs +1 -1
  381. package/dist/workflows/builder/index.js +1 -1
  382. package/dist/workflows/evented/index.cjs +1 -1
  383. package/dist/workflows/evented/index.js +1 -1
  384. package/dist/workflows/index.cjs +4 -4
  385. package/dist/workflows/index.js +4 -4
  386. package/package.json +7 -7
  387. package/src/llm/model/provider-types.generated.d.ts +7397 -7534
  388. /package/dist/_types/{@ai-sdk_provider-utils@4.0.66 → @ai-sdk_provider-utils@4.0.67}/dist/index.d.ts +0 -0
  389. /package/dist/_types/{@ai-sdk_provider-utils@4.0.66 → @ai-sdk_provider-utils@4.0.67}/package.json +0 -0
@@ -1,8 +1,8 @@
1
- import { _ as MASTRA_GATEWAY_STREAM_TRANSPORT, a as interpolateUrlTemplate, b as createOpenAICompatible, f as findGatewayForModel, h as shouldEnableGateway, l as MASTRA_USER_AGENT, m as hasAuthCredentials, o as parseModelRouterId, p as getGatewayId, r as ModelsDevGateway, s as createGoogleGenerativeAI, t as NetlifyGateway, v as MastraModelGateway, x as EventSourceParserStream, y as createOpenAI } from "./netlify-CfDXkuLf.js";
1
+ import { _ as MASTRA_GATEWAY_STREAM_TRANSPORT, a as interpolateUrlTemplate, b as createOpenAICompatible, f as findGatewayForModel, h as shouldEnableGateway, l as MASTRA_USER_AGENT, m as hasAuthCredentials, o as parseModelRouterId, p as getGatewayId, r as ModelsDevGateway, s as createGoogleGenerativeAI, t as NetlifyGateway, v as MastraModelGateway, x as EventSourceParserStream, y as createOpenAI } from "./netlify-C9aJA6Cv.js";
2
2
  import { n as prepareAzureStrictToolSchemas, r as createStreamFromGenerateResult, t as AISDKV5LanguageModel } from "./model-DS-b2R-R.js";
3
3
  import { i as aiV5PromptToAIV7Prompt, r as aiV5PromptToAIV6Prompt } from "./to-prompt-BsDtVXrf.js";
4
4
  import { t as convertToDataContent } from "./content-CFBIylxS.js";
5
- import { f as MastraGateway, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, p as gatewayServesObservationalMemory, t as GatewayRegistry } from "./provider-registry-CR385GJ4.js";
5
+ import { f as MastraGateway, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, p as gatewayServesObservationalMemory, t as GatewayRegistry } from "./provider-registry-DOfYSEju.js";
6
6
  import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "./error-oh2DLsP2.js";
7
7
  import { u as RequestContext } from "./request-context-COnZHt2-.js";
8
8
  import { n as resolveDynamicArgument } from "./dynamic-argument-BzPK3qPN.js";
@@ -1,9 +1,9 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-BrhgMLW6.cjs");
2
- const require_netlify = require("./netlify-D99AnEhW.cjs");
2
+ const require_netlify = require("./netlify-Bw7Vd58y.cjs");
3
3
  const require_model = require("./model-jBymoqGa.cjs");
4
4
  const require_to_prompt = require("./to-prompt-B9eZo2U5.cjs");
5
5
  const require_content = require("./content-CC0W1d5p.cjs");
6
- const require_provider_registry = require("./provider-registry-CO1NVbO5.cjs");
6
+ const require_provider_registry = require("./provider-registry-Bn_7VvZ8.cjs");
7
7
  const require_error = require("./error-D90lJ6M7.cjs");
8
8
  const require_request_context = require("./request-context-D9RXYCy8.cjs");
9
9
  const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_run_registry = require("../run-registry-TOOfO3hT.cjs");
3
- const require_stream = require("../stream-DH7Qgz8l.cjs");
2
+ const require_run_registry = require("../run-registry-lLRc7EE6.cjs");
3
+ const require_stream = require("../stream-BIDts1fZ.cjs");
4
4
  exports.MastraTimeoutError = require_stream.MastraTimeoutError;
5
5
  exports.createScorer = require_run_registry.createScorer;
6
6
  exports.createTimeoutAbortSignal = require_stream.createTimeoutAbortSignal;
@@ -1,3 +1,3 @@
1
- import { Gt as generateFinalResult, Ht as formatCompletionFeedback, Jt as runCompletionScorers, Kt as generateStructuredFinalResult, Qt as loop, Ut as formatStreamCompletionFeedback, Vt as formatCheckFeedback, Wt as formatValidationFeedback, Xt as runStreamCompletionScorers, Yt as runDefaultCompletionCheck, Zt as runValidation, qt as runChecks, w as createScorer } from "../run-registry-DdeEBsVW.js";
2
- import { Cn as isMastraTimeoutError, vn as MastraTimeoutError, yn as createTimeoutAbortSignal } from "../stream-C5PagEDs.js";
1
+ import { Bt as formatCompletionFeedback, Gt as runChecks, Ht as formatValidationFeedback, Jt as runStreamCompletionScorers, Kt as runCompletionScorers, T as createScorer, Ut as generateFinalResult, Vt as formatStreamCompletionFeedback, Wt as generateStructuredFinalResult, Xt as loop, Yt as runValidation, qt as runDefaultCompletionCheck, zt as formatCheckFeedback } from "../run-registry-DhOKJtlb.js";
2
+ import { Cn as isMastraTimeoutError, vn as MastraTimeoutError, yn as createTimeoutAbortSignal } from "../stream-C8HKG3qC.js";
3
3
  export { MastraTimeoutError, createScorer, createTimeoutAbortSignal, formatCheckFeedback, formatCompletionFeedback, formatStreamCompletionFeedback, formatValidationFeedback, generateFinalResult, generateStructuredFinalResult, isMastraTimeoutError, loop, runChecks, runCompletionScorers, runDefaultCompletionCheck, runStreamCompletionScorers, runValidation };
@@ -1,8 +1,8 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-tIEjjQTE.js";
2
- import { Bs as createWorkflow, C as ScorerRunError, Qi as assertSupportedPatterns, b as validateAndSaveScore, v as flushBeforeTraceRead, zs as createStep } from "./run-registry-DdeEBsVW.js";
2
+ import { Hs as createStep, Us as createWorkflow, ta as assertSupportedPatterns, w as ScorerRunError, x as validateAndSaveScore, y as flushBeforeTraceRead } from "./run-registry-DhOKJtlb.js";
3
3
  import { S as resolveObservabilityContext } from "./observability-D7RNOAPx.js";
4
4
  import { i as MastraError } from "./error-oh2DLsP2.js";
5
- import { dt as loadStepResults, ln as isSupportedLanguageModel } from "./stream-C5PagEDs.js";
5
+ import { dt as loadStepResults, ln as isSupportedLanguageModel } from "./stream-C8HKG3qC.js";
6
6
  import { o as MASTRA_RESOURCE_ID_KEY, p as withoutLiveRequestKeys, u as RequestContext } from "./request-context-COnZHt2-.js";
7
7
  import { t as EntityType } from "./storage-Cc50aQAp.js";
8
8
  import { a as getOrCreateSpan } from "./utils-DU_pU5SK.js";
@@ -1022,11 +1022,18 @@ function resolveScorers(mastra, scorers) {
1022
1022
  }).filter((s) => s !== null);
1023
1023
  }
1024
1024
  const EXPERIMENT_ITEM_SCORER_NOT_FOUND = "EXPERIMENT_ITEM_SCORER_NOT_FOUND";
1025
+ const EXPERIMENT_SCORER_NOT_FOUND = "EXPERIMENT_SCORER_NOT_FOUND";
1025
1026
  /**
1026
- * Create a run-scoped resolver for item scorer IDs. Resolutions, including misses,
1027
- * are cached so concurrent items hydrate a stored scorer at most once per run.
1027
+ * Create a run-scoped scorer resolver. Instances pass through; string ids are
1028
+ * looked up in Mastra's registry, then loaded as stored scorers through the
1029
+ * editor (which registers them). Resolutions, including misses, are cached so
1030
+ * concurrent items hydrate a stored scorer at most once per run.
1031
+ *
1032
+ * Only a scorer that doesn't exist is reported in `missingIds`. A failed lookup
1033
+ * (for example, storage being unavailable) rejects with its own error and isn't
1034
+ * cached, so it isn't mistaken for a bad scorer ID.
1028
1035
  */
1029
- function createItemScorerResolver(mastra) {
1036
+ function createScorerResolver(mastra) {
1030
1037
  const resolutionCache = /* @__PURE__ */ new Map();
1031
1038
  const resolveById = (scorerId) => {
1032
1039
  const cached = resolutionCache.get(scorerId);
@@ -1036,22 +1043,30 @@ function createItemScorerResolver(mastra) {
1036
1043
  if (scorer) return scorer;
1037
1044
  const editor = mastra.getEditor?.();
1038
1045
  if (editor) {
1039
- try {
1040
- await editor.scorer.getById(scorerId);
1041
- } catch {}
1046
+ await editor.scorer.getById(scorerId);
1042
1047
  scorer = getItemScorerById(mastra, scorerId);
1043
1048
  }
1044
1049
  return scorer;
1045
1050
  })();
1046
1051
  resolutionCache.set(scorerId, resolution);
1052
+ resolution.catch(() => resolutionCache.delete(scorerId));
1047
1053
  return resolution;
1048
1054
  };
1049
- return async (scorerIds) => {
1050
- const uniqueIds = [...new Set(scorerIds)];
1051
- const resolved = await Promise.all(uniqueIds.map(async (id) => ({
1052
- id,
1053
- scorer: await resolveById(id)
1054
- })));
1055
+ return async (entries) => {
1056
+ const seen = /* @__PURE__ */ new Set();
1057
+ const unique = entries.filter((entry) => {
1058
+ if (typeof entry !== "string") return true;
1059
+ if (seen.has(entry)) return false;
1060
+ seen.add(entry);
1061
+ return true;
1062
+ });
1063
+ const resolved = await Promise.all(unique.map(async (entry) => typeof entry === "string" ? {
1064
+ id: entry,
1065
+ scorer: await resolveById(entry)
1066
+ } : {
1067
+ id: entry.id,
1068
+ scorer: entry
1069
+ }));
1055
1070
  return {
1056
1071
  scorers: resolved.flatMap(({ scorer }) => scorer ? [scorer] : []),
1057
1072
  missingIds: resolved.flatMap(({ id, scorer }) => scorer ? [] : [id])
@@ -1059,6 +1074,49 @@ function createItemScorerResolver(mastra) {
1059
1074
  };
1060
1075
  }
1061
1076
  /**
1077
+ * The item error for scorer ids that can't be resolved during a run (e.g. a
1078
+ * stored scorer deleted after the experiment started). `null` when none are missing.
1079
+ */
1080
+ function itemScorerNotFoundError(source, missingIds) {
1081
+ if (missingIds.length === 0) return null;
1082
+ return {
1083
+ code: EXPERIMENT_ITEM_SCORER_NOT_FOUND,
1084
+ message: `${source} scorer configuration references unregistered scorer IDs: ${missingIds.join(", ")}`
1085
+ };
1086
+ }
1087
+ function experimentScorerNotFoundError(missingIds) {
1088
+ return new MastraError({
1089
+ id: EXPERIMENT_SCORER_NOT_FOUND,
1090
+ text: `Experiment scorers not found: ${missingIds.join(", ")}`,
1091
+ domain: "STORAGE",
1092
+ category: "USER"
1093
+ });
1094
+ }
1095
+ /** Split a run-level scorer config (flat array or categorized) into flat scorers and step scorers. */
1096
+ function flattenScorerConfig(scorers) {
1097
+ if (scorers === void 0) return { flat: [] };
1098
+ if (Array.isArray(scorers)) return { flat: scorers };
1099
+ return {
1100
+ flat: [
1101
+ ..."agent" in scorers && scorers.agent || [],
1102
+ ..."workflow" in scorers && scorers.workflow || [],
1103
+ ..."trajectory" in scorers && scorers.trajectory || []
1104
+ ],
1105
+ steps: "steps" in scorers && scorers.steps || void 0
1106
+ };
1107
+ }
1108
+ /**
1109
+ * Throw {@link EXPERIMENT_SCORER_NOT_FOUND} when any run-level scorer id can't
1110
+ * be resolved, so a typo or deleted stored scorer fails before an experiment is created.
1111
+ */
1112
+ async function assertExperimentScorersExist(mastra, scorers) {
1113
+ const { flat, steps } = flattenScorerConfig(scorers);
1114
+ const ids = [...flat, ...Object.values(steps ?? {}).flat()].filter((scorer) => typeof scorer === "string");
1115
+ if (ids.length === 0) return;
1116
+ const { missingIds } = await createScorerResolver(mastra)(ids);
1117
+ if (missingIds.length > 0) throw experimentScorerNotFoundError(missingIds);
1118
+ }
1119
+ /**
1062
1120
  * Attempt to extract a Trajectory from the observability trace store.
1063
1121
  * Falls back to undefined if storage is unavailable or the trace has no spans.
1064
1122
  * Callers flush observability first (see `flushForTrajectoryScorers`).
@@ -1272,20 +1330,6 @@ async function runScorerSafe(scorer, item, output, scorerInput, scorerOutput, ta
1272
1330
  }
1273
1331
  }
1274
1332
  /**
1275
- * Resolve step-scoped scorers from a `Record<stepId, (MastraScorer | string)[]>`.
1276
- * String IDs are looked up from Mastra's scorer registry; missing IDs are skipped
1277
- * with a warning (matching `resolveScorers`).
1278
- */
1279
- function resolveStepScorers(mastra, stepsConfig) {
1280
- if (!stepsConfig) return {};
1281
- const resolved = {};
1282
- for (const [stepId, scorers] of Object.entries(stepsConfig)) {
1283
- const stepScorers = resolveScorers(mastra, scorers);
1284
- if (stepScorers.length > 0) resolved[stepId] = stepScorers;
1285
- }
1286
- return resolved;
1287
- }
1288
- /**
1289
1333
  * Run step-scoped scorers for a single workflow item. Mirrors the per-step
1290
1334
  * dispatch in `runEvals`: each scorer runs against `stepResult.payload` and
1291
1335
  * `stepResult.output`, with `targetScope: 'span'` and
@@ -1704,10 +1748,11 @@ function buildEmptyResult(experimentA, experimentB, versionMismatch, warnings) {
1704
1748
  * Temporal activity) converges on a single row.
1705
1749
  *
1706
1750
  * Scorer precedence mirrors the in-process runner: experiment `scorerIds` →
1707
- * item `scorerIds` → dataset `scorerIds` → none. An item scorer reference to
1708
- * an unregistered scorer is a deterministic preflight failure
1751
+ * item `scorerIds` → dataset `scorerIds` → none. Stored scorers are loaded on
1752
+ * demand at every level. A scorer that can't be resolved (e.g. a stored scorer
1753
+ * deleted after the experiment started) is a deterministic preflight failure
1709
1754
  * ({@link EXPERIMENT_ITEM_SCORER_NOT_FOUND}): the target is not executed and
1710
- * the error is recorded on the row.
1755
+ * the error is recorded on the row; other items are unaffected.
1711
1756
  *
1712
1757
  * Applies the same per-item run options as the in-process runner (model
1713
1758
  * override, tool mocks, timeout, retries) but excludes its loop-level concerns:
@@ -1729,17 +1774,19 @@ async function executeExperimentItem(args) {
1729
1774
  domain: "STORAGE",
1730
1775
  category: "USER"
1731
1776
  });
1732
- let scorers = [];
1777
+ const resolveScorerEntries = createScorerResolver(mastra);
1778
+ let scorers;
1733
1779
  let scorerConfigError = null;
1734
- if (experiment.scorerIds != null) scorers = resolveScorers(mastra, [...new Set(experiment.scorerIds)]);
1735
- else if (item.scorerIds !== void 0) {
1736
- const resolution = await createItemScorerResolver(mastra)(item.scorerIds);
1780
+ if (item.scorerIds !== void 0 && experiment.scorerIds == null) {
1781
+ const resolution = await resolveScorerEntries(item.scorerIds);
1737
1782
  scorers = resolution.scorers;
1738
- if (resolution.missingIds.length > 0) scorerConfigError = {
1739
- code: EXPERIMENT_ITEM_SCORER_NOT_FOUND,
1740
- message: `Item scorer configuration references unregistered scorer IDs: ${resolution.missingIds.join(", ")}`
1741
- };
1742
- } else scorers = resolveScorers(mastra, [...new Set(args.datasetScorerIds ?? [])]);
1783
+ scorerConfigError = itemScorerNotFoundError("Item", resolution.missingIds);
1784
+ } else {
1785
+ const source = experiment.scorerIds != null ? "Experiment" : "Dataset";
1786
+ const resolution = await resolveScorerEntries(experiment.scorerIds ?? args.datasetScorerIds ?? []);
1787
+ scorers = resolution.scorers;
1788
+ scorerConfigError = itemScorerNotFoundError(source, resolution.missingIds);
1789
+ }
1743
1790
  const storage = mastra.getStorage();
1744
1791
  const experimentsStore = await storage?.getStore("experiments");
1745
1792
  if (!experimentsStore) throw new MastraError({
@@ -2014,31 +2061,31 @@ async function runExperiment(mastra, config) {
2014
2061
  const itemsWithToolMocks = items.filter((item) => item.toolMocks?.length).length;
2015
2062
  if (targetType !== "agent" && itemsWithToolMocks > 0) mastra.getLogger()?.warn(`Experiment target is "${config.task ? "task" : targetType}" but ${itemsWithToolMocks} of ${items.length} dataset items declare toolMocks. Tool mocks only apply to agent targets and will be ignored.`);
2016
2063
  const hasRunLevelScorers = scorerInput !== void 0;
2017
- let stepsConfigInput;
2018
- let flatScorerInput;
2019
- if (scorerInput !== void 0) {
2020
- if (Array.isArray(scorerInput)) flatScorerInput = scorerInput;
2021
- else {
2022
- flatScorerInput = [];
2023
- if ("agent" in scorerInput && scorerInput.agent) flatScorerInput.push(...scorerInput.agent);
2024
- if ("workflow" in scorerInput && scorerInput.workflow) flatScorerInput.push(...scorerInput.workflow);
2025
- if ("trajectory" in scorerInput && scorerInput.trajectory) flatScorerInput.push(...scorerInput.trajectory);
2026
- if ("steps" in scorerInput && scorerInput.steps) stepsConfigInput = scorerInput.steps;
2064
+ const { flat: flatScorerInput, steps: stepsConfigInput } = flattenScorerConfig(scorerInput);
2065
+ const resolveScorerEntries = createScorerResolver(mastra);
2066
+ let runLevelScorers = [];
2067
+ let runLevelStepScorers = {};
2068
+ let datasetScorers = [];
2069
+ let runLevelMissingIds = [];
2070
+ let datasetMissingIds = [];
2071
+ try {
2072
+ if (hasRunLevelScorers) {
2073
+ const resolution = await resolveScorerEntries(flatScorerInput);
2074
+ const stepResolutions = await Promise.all(Object.entries(stepsConfigInput ?? {}).map(async ([stepId, entries]) => [stepId, await resolveScorerEntries(entries)]));
2075
+ const missingIds = [.../* @__PURE__ */ new Set([...resolution.missingIds, ...stepResolutions.flatMap(([, step]) => step.missingIds)])];
2076
+ if (missingIds.length > 0 && !providedExperimentId) throw experimentScorerNotFoundError(missingIds);
2077
+ runLevelScorers = resolution.scorers;
2078
+ runLevelMissingIds = missingIds;
2079
+ for (const [stepId, step] of stepResolutions) if (step.scorers.length > 0) runLevelStepScorers[stepId] = step.scorers;
2080
+ } else if (items.some((item) => item.scorerIds === void 0)) {
2081
+ const resolution = await resolveScorerEntries(datasetRecord?.scorerIds ?? []);
2082
+ datasetScorers = resolution.scorers;
2083
+ datasetMissingIds = resolution.missingIds;
2027
2084
  }
2085
+ } catch (err) {
2086
+ await markFailedOnSetupError(err);
2087
+ throw err;
2028
2088
  }
2029
- if (flatScorerInput?.length) {
2030
- const seen = /* @__PURE__ */ new Set();
2031
- flatScorerInput = flatScorerInput.filter((entry) => {
2032
- if (typeof entry !== "string") return true;
2033
- if (seen.has(entry)) return false;
2034
- seen.add(entry);
2035
- return true;
2036
- });
2037
- }
2038
- const runLevelScorers = hasRunLevelScorers ? resolveScorers(mastra, flatScorerInput) : [];
2039
- const runLevelStepScorers = hasRunLevelScorers ? resolveStepScorers(mastra, stepsConfigInput) : {};
2040
- const resolveItemScorers = createItemScorerResolver(mastra);
2041
- const datasetScorers = !hasRunLevelScorers && items.some((item) => item.scorerIds === void 0) ? resolveScorers(mastra, [...new Set(datasetRecord?.scorerIds ?? [])]) : [];
2042
2089
  if (experimentsStore) {
2043
2090
  if (!providedExperimentId) await experimentsStore.createExperiment({
2044
2091
  id: experimentId,
@@ -2114,14 +2161,15 @@ async function runExperiment(mastra, config) {
2114
2161
  if (hasRunLevelScorers) {
2115
2162
  itemScorers = runLevelScorers;
2116
2163
  itemStepScorers = runLevelStepScorers;
2164
+ scorerConfigError = itemScorerNotFoundError("Experiment", runLevelMissingIds);
2117
2165
  } else if (item.scorerIds !== void 0) {
2118
- const resolution = await resolveItemScorers(item.scorerIds);
2166
+ const resolution = await resolveScorerEntries(item.scorerIds);
2119
2167
  itemScorers = resolution.scorers;
2120
- if (resolution.missingIds.length > 0) scorerConfigError = {
2121
- code: EXPERIMENT_ITEM_SCORER_NOT_FOUND,
2122
- message: `Item scorer configuration references unregistered scorer IDs: ${resolution.missingIds.join(", ")}`
2123
- };
2124
- } else itemScorers = datasetScorers;
2168
+ scorerConfigError = itemScorerNotFoundError("Item", resolution.missingIds);
2169
+ } else {
2170
+ itemScorers = datasetScorers;
2171
+ scorerConfigError = itemScorerNotFoundError("Dataset", datasetMissingIds);
2172
+ }
2125
2173
  const timeoutSignal = itemTimeout ? AbortSignal.timeout(itemTimeout) : void 0;
2126
2174
  const itemSignal = executionSignal && timeoutSignal ? AbortSignal.any([executionSignal, timeoutSignal]) : timeoutSignal ?? executionSignal;
2127
2175
  let beforeEachError = null;
@@ -2749,6 +2797,7 @@ var Dataset = class {
2749
2797
  const { durable, ...config } = asyncConfig;
2750
2798
  assertAgentModelTarget(config);
2751
2799
  const durableRun = durable ? durableRunOptions(config) : void 0;
2800
+ await assertExperimentScorersExist(this.#mastra, config.scorers);
2752
2801
  const experimentsStore = config.persistence?.experiments !== "none" ? await this.#getExperimentsStore() : void 0;
2753
2802
  const dataset = await (await this.#getDatasetsStore()).getDatasetById({
2754
2803
  id: this.id,
@@ -3056,6 +3105,7 @@ var Dataset = class {
3056
3105
  };
3057
3106
  }
3058
3107
  }
3108
+ await assertExperimentScorersExist(this.#mastra, args?.scorers);
3059
3109
  const targetVersion = args?.version ?? dataset.version;
3060
3110
  const totalItems = await this.#countItems(targetVersion);
3061
3111
  if (totalItems === 0) throw new MastraError({
@@ -3640,4 +3690,4 @@ var DatasetsManager = class {
3640
3690
  };
3641
3691
  }
3642
3692
  };
3643
- export { ToolMockMatcher as _, executeExperimentItem as a, resolveTarget as b, computeScorerStats as c, resolveScorers as d, runScorersForItem as f, TOOL_MOCK_NOT_DECLARED as g, TOOL_MOCK_MISMATCH as h, runExperiment as i, isRegression as l, TOOL_MOCK_EXHAUSTED as m, Dataset as n, compareExperiments as o, executeTarget as p, EXPERIMENT_ITEM_BEFORE_EACH_FAILED as r, computeMean as s, DatasetsManager as t, EXPERIMENT_ITEM_SCORER_NOT_FOUND as u, EXPERIMENT_NOT_DURABLE as v, EXPERIMENT_WORKFLOW_ID as x, workflow_exports as y };
3693
+ export { EXPERIMENT_WORKFLOW_ID as S, TOOL_MOCK_NOT_DECLARED as _, executeExperimentItem as a, workflow_exports as b, computeScorerStats as c, EXPERIMENT_SCORER_NOT_FOUND as d, resolveScorers as f, TOOL_MOCK_MISMATCH as g, TOOL_MOCK_EXHAUSTED as h, runExperiment as i, isRegression as l, executeTarget as m, Dataset as n, compareExperiments as o, runScorersForItem as p, EXPERIMENT_ITEM_BEFORE_EACH_FAILED as r, computeMean as s, DatasetsManager as t, EXPERIMENT_ITEM_SCORER_NOT_FOUND as u, ToolMockMatcher as v, resolveTarget as x, EXPERIMENT_NOT_DURABLE as y };
@@ -1,8 +1,8 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-BrhgMLW6.cjs");
2
- const require_run_registry = require("./run-registry-TOOfO3hT.cjs");
2
+ const require_run_registry = require("./run-registry-lLRc7EE6.cjs");
3
3
  const require_observability = require("./observability-B0R_D1PZ.cjs");
4
4
  const require_error = require("./error-D90lJ6M7.cjs");
5
- const require_stream = require("./stream-DH7Qgz8l.cjs");
5
+ const require_stream = require("./stream-BIDts1fZ.cjs");
6
6
  const require_request_context = require("./request-context-D9RXYCy8.cjs");
7
7
  const require_storage = require("./storage-CfG0I2aF.cjs");
8
8
  const require_utils = require("./utils-D-eNsgDM.cjs");
@@ -1022,11 +1022,18 @@ function resolveScorers(mastra, scorers) {
1022
1022
  }).filter((s) => s !== null);
1023
1023
  }
1024
1024
  const EXPERIMENT_ITEM_SCORER_NOT_FOUND = "EXPERIMENT_ITEM_SCORER_NOT_FOUND";
1025
+ const EXPERIMENT_SCORER_NOT_FOUND = "EXPERIMENT_SCORER_NOT_FOUND";
1025
1026
  /**
1026
- * Create a run-scoped resolver for item scorer IDs. Resolutions, including misses,
1027
- * are cached so concurrent items hydrate a stored scorer at most once per run.
1027
+ * Create a run-scoped scorer resolver. Instances pass through; string ids are
1028
+ * looked up in Mastra's registry, then loaded as stored scorers through the
1029
+ * editor (which registers them). Resolutions, including misses, are cached so
1030
+ * concurrent items hydrate a stored scorer at most once per run.
1031
+ *
1032
+ * Only a scorer that doesn't exist is reported in `missingIds`. A failed lookup
1033
+ * (for example, storage being unavailable) rejects with its own error and isn't
1034
+ * cached, so it isn't mistaken for a bad scorer ID.
1028
1035
  */
1029
- function createItemScorerResolver(mastra) {
1036
+ function createScorerResolver(mastra) {
1030
1037
  const resolutionCache = /* @__PURE__ */ new Map();
1031
1038
  const resolveById = (scorerId) => {
1032
1039
  const cached = resolutionCache.get(scorerId);
@@ -1036,22 +1043,30 @@ function createItemScorerResolver(mastra) {
1036
1043
  if (scorer) return scorer;
1037
1044
  const editor = mastra.getEditor?.();
1038
1045
  if (editor) {
1039
- try {
1040
- await editor.scorer.getById(scorerId);
1041
- } catch {}
1046
+ await editor.scorer.getById(scorerId);
1042
1047
  scorer = getItemScorerById(mastra, scorerId);
1043
1048
  }
1044
1049
  return scorer;
1045
1050
  })();
1046
1051
  resolutionCache.set(scorerId, resolution);
1052
+ resolution.catch(() => resolutionCache.delete(scorerId));
1047
1053
  return resolution;
1048
1054
  };
1049
- return async (scorerIds) => {
1050
- const uniqueIds = [...new Set(scorerIds)];
1051
- const resolved = await Promise.all(uniqueIds.map(async (id) => ({
1052
- id,
1053
- scorer: await resolveById(id)
1054
- })));
1055
+ return async (entries) => {
1056
+ const seen = /* @__PURE__ */ new Set();
1057
+ const unique = entries.filter((entry) => {
1058
+ if (typeof entry !== "string") return true;
1059
+ if (seen.has(entry)) return false;
1060
+ seen.add(entry);
1061
+ return true;
1062
+ });
1063
+ const resolved = await Promise.all(unique.map(async (entry) => typeof entry === "string" ? {
1064
+ id: entry,
1065
+ scorer: await resolveById(entry)
1066
+ } : {
1067
+ id: entry.id,
1068
+ scorer: entry
1069
+ }));
1055
1070
  return {
1056
1071
  scorers: resolved.flatMap(({ scorer }) => scorer ? [scorer] : []),
1057
1072
  missingIds: resolved.flatMap(({ id, scorer }) => scorer ? [] : [id])
@@ -1059,6 +1074,49 @@ function createItemScorerResolver(mastra) {
1059
1074
  };
1060
1075
  }
1061
1076
  /**
1077
+ * The item error for scorer ids that can't be resolved during a run (e.g. a
1078
+ * stored scorer deleted after the experiment started). `null` when none are missing.
1079
+ */
1080
+ function itemScorerNotFoundError(source, missingIds) {
1081
+ if (missingIds.length === 0) return null;
1082
+ return {
1083
+ code: EXPERIMENT_ITEM_SCORER_NOT_FOUND,
1084
+ message: `${source} scorer configuration references unregistered scorer IDs: ${missingIds.join(", ")}`
1085
+ };
1086
+ }
1087
+ function experimentScorerNotFoundError(missingIds) {
1088
+ return new require_error.MastraError({
1089
+ id: EXPERIMENT_SCORER_NOT_FOUND,
1090
+ text: `Experiment scorers not found: ${missingIds.join(", ")}`,
1091
+ domain: "STORAGE",
1092
+ category: "USER"
1093
+ });
1094
+ }
1095
+ /** Split a run-level scorer config (flat array or categorized) into flat scorers and step scorers. */
1096
+ function flattenScorerConfig(scorers) {
1097
+ if (scorers === void 0) return { flat: [] };
1098
+ if (Array.isArray(scorers)) return { flat: scorers };
1099
+ return {
1100
+ flat: [
1101
+ ..."agent" in scorers && scorers.agent || [],
1102
+ ..."workflow" in scorers && scorers.workflow || [],
1103
+ ..."trajectory" in scorers && scorers.trajectory || []
1104
+ ],
1105
+ steps: "steps" in scorers && scorers.steps || void 0
1106
+ };
1107
+ }
1108
+ /**
1109
+ * Throw {@link EXPERIMENT_SCORER_NOT_FOUND} when any run-level scorer id can't
1110
+ * be resolved, so a typo or deleted stored scorer fails before an experiment is created.
1111
+ */
1112
+ async function assertExperimentScorersExist(mastra, scorers) {
1113
+ const { flat, steps } = flattenScorerConfig(scorers);
1114
+ const ids = [...flat, ...Object.values(steps ?? {}).flat()].filter((scorer) => typeof scorer === "string");
1115
+ if (ids.length === 0) return;
1116
+ const { missingIds } = await createScorerResolver(mastra)(ids);
1117
+ if (missingIds.length > 0) throw experimentScorerNotFoundError(missingIds);
1118
+ }
1119
+ /**
1062
1120
  * Attempt to extract a Trajectory from the observability trace store.
1063
1121
  * Falls back to undefined if storage is unavailable or the trace has no spans.
1064
1122
  * Callers flush observability first (see `flushForTrajectoryScorers`).
@@ -1272,20 +1330,6 @@ async function runScorerSafe(scorer, item, output, scorerInput, scorerOutput, ta
1272
1330
  }
1273
1331
  }
1274
1332
  /**
1275
- * Resolve step-scoped scorers from a `Record<stepId, (MastraScorer | string)[]>`.
1276
- * String IDs are looked up from Mastra's scorer registry; missing IDs are skipped
1277
- * with a warning (matching `resolveScorers`).
1278
- */
1279
- function resolveStepScorers(mastra, stepsConfig) {
1280
- if (!stepsConfig) return {};
1281
- const resolved = {};
1282
- for (const [stepId, scorers] of Object.entries(stepsConfig)) {
1283
- const stepScorers = resolveScorers(mastra, scorers);
1284
- if (stepScorers.length > 0) resolved[stepId] = stepScorers;
1285
- }
1286
- return resolved;
1287
- }
1288
- /**
1289
1333
  * Run step-scoped scorers for a single workflow item. Mirrors the per-step
1290
1334
  * dispatch in `runEvals`: each scorer runs against `stepResult.payload` and
1291
1335
  * `stepResult.output`, with `targetScope: 'span'` and
@@ -1704,10 +1748,11 @@ function buildEmptyResult(experimentA, experimentB, versionMismatch, warnings) {
1704
1748
  * Temporal activity) converges on a single row.
1705
1749
  *
1706
1750
  * Scorer precedence mirrors the in-process runner: experiment `scorerIds` →
1707
- * item `scorerIds` → dataset `scorerIds` → none. An item scorer reference to
1708
- * an unregistered scorer is a deterministic preflight failure
1751
+ * item `scorerIds` → dataset `scorerIds` → none. Stored scorers are loaded on
1752
+ * demand at every level. A scorer that can't be resolved (e.g. a stored scorer
1753
+ * deleted after the experiment started) is a deterministic preflight failure
1709
1754
  * ({@link EXPERIMENT_ITEM_SCORER_NOT_FOUND}): the target is not executed and
1710
- * the error is recorded on the row.
1755
+ * the error is recorded on the row; other items are unaffected.
1711
1756
  *
1712
1757
  * Applies the same per-item run options as the in-process runner (model
1713
1758
  * override, tool mocks, timeout, retries) but excludes its loop-level concerns:
@@ -1729,17 +1774,19 @@ async function executeExperimentItem(args) {
1729
1774
  domain: "STORAGE",
1730
1775
  category: "USER"
1731
1776
  });
1732
- let scorers = [];
1777
+ const resolveScorerEntries = createScorerResolver(mastra);
1778
+ let scorers;
1733
1779
  let scorerConfigError = null;
1734
- if (experiment.scorerIds != null) scorers = resolveScorers(mastra, [...new Set(experiment.scorerIds)]);
1735
- else if (item.scorerIds !== void 0) {
1736
- const resolution = await createItemScorerResolver(mastra)(item.scorerIds);
1780
+ if (item.scorerIds !== void 0 && experiment.scorerIds == null) {
1781
+ const resolution = await resolveScorerEntries(item.scorerIds);
1737
1782
  scorers = resolution.scorers;
1738
- if (resolution.missingIds.length > 0) scorerConfigError = {
1739
- code: EXPERIMENT_ITEM_SCORER_NOT_FOUND,
1740
- message: `Item scorer configuration references unregistered scorer IDs: ${resolution.missingIds.join(", ")}`
1741
- };
1742
- } else scorers = resolveScorers(mastra, [...new Set(args.datasetScorerIds ?? [])]);
1783
+ scorerConfigError = itemScorerNotFoundError("Item", resolution.missingIds);
1784
+ } else {
1785
+ const source = experiment.scorerIds != null ? "Experiment" : "Dataset";
1786
+ const resolution = await resolveScorerEntries(experiment.scorerIds ?? args.datasetScorerIds ?? []);
1787
+ scorers = resolution.scorers;
1788
+ scorerConfigError = itemScorerNotFoundError(source, resolution.missingIds);
1789
+ }
1743
1790
  const storage = mastra.getStorage();
1744
1791
  const experimentsStore = await storage?.getStore("experiments");
1745
1792
  if (!experimentsStore) throw new require_error.MastraError({
@@ -2014,31 +2061,31 @@ async function runExperiment(mastra, config) {
2014
2061
  const itemsWithToolMocks = items.filter((item) => item.toolMocks?.length).length;
2015
2062
  if (targetType !== "agent" && itemsWithToolMocks > 0) mastra.getLogger()?.warn(`Experiment target is "${config.task ? "task" : targetType}" but ${itemsWithToolMocks} of ${items.length} dataset items declare toolMocks. Tool mocks only apply to agent targets and will be ignored.`);
2016
2063
  const hasRunLevelScorers = scorerInput !== void 0;
2017
- let stepsConfigInput;
2018
- let flatScorerInput;
2019
- if (scorerInput !== void 0) {
2020
- if (Array.isArray(scorerInput)) flatScorerInput = scorerInput;
2021
- else {
2022
- flatScorerInput = [];
2023
- if ("agent" in scorerInput && scorerInput.agent) flatScorerInput.push(...scorerInput.agent);
2024
- if ("workflow" in scorerInput && scorerInput.workflow) flatScorerInput.push(...scorerInput.workflow);
2025
- if ("trajectory" in scorerInput && scorerInput.trajectory) flatScorerInput.push(...scorerInput.trajectory);
2026
- if ("steps" in scorerInput && scorerInput.steps) stepsConfigInput = scorerInput.steps;
2064
+ const { flat: flatScorerInput, steps: stepsConfigInput } = flattenScorerConfig(scorerInput);
2065
+ const resolveScorerEntries = createScorerResolver(mastra);
2066
+ let runLevelScorers = [];
2067
+ let runLevelStepScorers = {};
2068
+ let datasetScorers = [];
2069
+ let runLevelMissingIds = [];
2070
+ let datasetMissingIds = [];
2071
+ try {
2072
+ if (hasRunLevelScorers) {
2073
+ const resolution = await resolveScorerEntries(flatScorerInput);
2074
+ const stepResolutions = await Promise.all(Object.entries(stepsConfigInput ?? {}).map(async ([stepId, entries]) => [stepId, await resolveScorerEntries(entries)]));
2075
+ const missingIds = [.../* @__PURE__ */ new Set([...resolution.missingIds, ...stepResolutions.flatMap(([, step]) => step.missingIds)])];
2076
+ if (missingIds.length > 0 && !providedExperimentId) throw experimentScorerNotFoundError(missingIds);
2077
+ runLevelScorers = resolution.scorers;
2078
+ runLevelMissingIds = missingIds;
2079
+ for (const [stepId, step] of stepResolutions) if (step.scorers.length > 0) runLevelStepScorers[stepId] = step.scorers;
2080
+ } else if (items.some((item) => item.scorerIds === void 0)) {
2081
+ const resolution = await resolveScorerEntries(datasetRecord?.scorerIds ?? []);
2082
+ datasetScorers = resolution.scorers;
2083
+ datasetMissingIds = resolution.missingIds;
2027
2084
  }
2085
+ } catch (err) {
2086
+ await markFailedOnSetupError(err);
2087
+ throw err;
2028
2088
  }
2029
- if (flatScorerInput?.length) {
2030
- const seen = /* @__PURE__ */ new Set();
2031
- flatScorerInput = flatScorerInput.filter((entry) => {
2032
- if (typeof entry !== "string") return true;
2033
- if (seen.has(entry)) return false;
2034
- seen.add(entry);
2035
- return true;
2036
- });
2037
- }
2038
- const runLevelScorers = hasRunLevelScorers ? resolveScorers(mastra, flatScorerInput) : [];
2039
- const runLevelStepScorers = hasRunLevelScorers ? resolveStepScorers(mastra, stepsConfigInput) : {};
2040
- const resolveItemScorers = createItemScorerResolver(mastra);
2041
- const datasetScorers = !hasRunLevelScorers && items.some((item) => item.scorerIds === void 0) ? resolveScorers(mastra, [...new Set(datasetRecord?.scorerIds ?? [])]) : [];
2042
2089
  if (experimentsStore) {
2043
2090
  if (!providedExperimentId) await experimentsStore.createExperiment({
2044
2091
  id: experimentId,
@@ -2114,14 +2161,15 @@ async function runExperiment(mastra, config) {
2114
2161
  if (hasRunLevelScorers) {
2115
2162
  itemScorers = runLevelScorers;
2116
2163
  itemStepScorers = runLevelStepScorers;
2164
+ scorerConfigError = itemScorerNotFoundError("Experiment", runLevelMissingIds);
2117
2165
  } else if (item.scorerIds !== void 0) {
2118
- const resolution = await resolveItemScorers(item.scorerIds);
2166
+ const resolution = await resolveScorerEntries(item.scorerIds);
2119
2167
  itemScorers = resolution.scorers;
2120
- if (resolution.missingIds.length > 0) scorerConfigError = {
2121
- code: EXPERIMENT_ITEM_SCORER_NOT_FOUND,
2122
- message: `Item scorer configuration references unregistered scorer IDs: ${resolution.missingIds.join(", ")}`
2123
- };
2124
- } else itemScorers = datasetScorers;
2168
+ scorerConfigError = itemScorerNotFoundError("Item", resolution.missingIds);
2169
+ } else {
2170
+ itemScorers = datasetScorers;
2171
+ scorerConfigError = itemScorerNotFoundError("Dataset", datasetMissingIds);
2172
+ }
2125
2173
  const timeoutSignal = itemTimeout ? AbortSignal.timeout(itemTimeout) : void 0;
2126
2174
  const itemSignal = executionSignal && timeoutSignal ? AbortSignal.any([executionSignal, timeoutSignal]) : timeoutSignal ?? executionSignal;
2127
2175
  let beforeEachError = null;
@@ -2749,6 +2797,7 @@ var Dataset = class {
2749
2797
  const { durable, ...config } = asyncConfig;
2750
2798
  assertAgentModelTarget(config);
2751
2799
  const durableRun = durable ? durableRunOptions(config) : void 0;
2800
+ await assertExperimentScorersExist(this.#mastra, config.scorers);
2752
2801
  const experimentsStore = config.persistence?.experiments !== "none" ? await this.#getExperimentsStore() : void 0;
2753
2802
  const dataset = await (await this.#getDatasetsStore()).getDatasetById({
2754
2803
  id: this.id,
@@ -3056,6 +3105,7 @@ var Dataset = class {
3056
3105
  };
3057
3106
  }
3058
3107
  }
3108
+ await assertExperimentScorersExist(this.#mastra, args?.scorers);
3059
3109
  const targetVersion = args?.version ?? dataset.version;
3060
3110
  const totalItems = await this.#countItems(targetVersion);
3061
3111
  if (totalItems === 0) throw new require_error.MastraError({
@@ -3670,6 +3720,12 @@ Object.defineProperty(exports, "EXPERIMENT_NOT_DURABLE", {
3670
3720
  return EXPERIMENT_NOT_DURABLE;
3671
3721
  }
3672
3722
  });
3723
+ Object.defineProperty(exports, "EXPERIMENT_SCORER_NOT_FOUND", {
3724
+ enumerable: true,
3725
+ get: function() {
3726
+ return EXPERIMENT_SCORER_NOT_FOUND;
3727
+ }
3728
+ });
3673
3729
  Object.defineProperty(exports, "EXPERIMENT_WORKFLOW_ID", {
3674
3730
  enumerable: true,
3675
3731
  get: function() {
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_mastra = require("../mastra-HSmofHEJ.cjs");
2
+ const require_mastra = require("../mastra-DBhdD172.cjs");
3
3
  exports.Mastra = require_mastra.Mastra;
@@ -1 +1 @@
1
- export { t as Mastra } from "../mastra-CUGfgEpZ.js";
1
+ export { t as Mastra } from "../mastra-CIx6qEq2.js";