@mastra/core 1.86.0-alpha.8 → 1.86.0-alpha.9

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 (459) hide show
  1. package/dist/_types/@internal_core@0.1.4/dist/knowledge-compat/index.d.ts +363 -0
  2. package/dist/a2a/index.cjs +1 -1
  3. package/dist/a2a/index.js +1 -1
  4. package/dist/agent/agent.d.ts +12 -0
  5. package/dist/agent/durable/index.cjs +1 -13
  6. package/dist/agent/durable/index.js +1 -13
  7. package/dist/agent/durable/preparation.d.ts +2 -0
  8. package/dist/agent/durable/utils/resolve-runtime.d.ts +9 -0
  9. package/dist/agent/durable/workflows/durable-loop-builder.d.ts +4 -0
  10. package/dist/agent/durable/workflows/finalize-run.d.ts +3 -1
  11. package/dist/agent/durable/workflows/steps/llm-execution.d.ts +1 -0
  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/message-list/message-list.d.ts +11 -0
  17. package/dist/agent/message-list/utils/provider-compat.d.ts +1 -0
  18. package/dist/agent/request-context-snapshot.d.ts +1 -1
  19. package/dist/agent/streams/types.d.ts +10 -0
  20. package/dist/agent/thread-stream-runtime.d.ts +5 -0
  21. package/dist/agent-builder/ee/index.cjs +1 -1
  22. package/dist/agent-builder/ee/index.js +1 -1
  23. package/dist/agent-controller/index.cjs +1 -1
  24. package/dist/agent-controller/index.js +1 -1
  25. package/dist/{agent-controller-DEPayioq.cjs → agent-controller-CrQ9OF80.cjs} +7 -7
  26. package/dist/{agent-controller-B7POPub5.js → agent-controller-SSlKzE6A.js} +7 -7
  27. package/dist/background-tasks/index.cjs +1 -1
  28. package/dist/background-tasks/index.js +1 -1
  29. package/dist/{background-tasks-7iftnRK_.cjs → background-tasks-BDrYBis-.cjs} +5 -3
  30. package/dist/{background-tasks-Cv1ecD6S.js → background-tasks-BnJfNLFo.js} +5 -3
  31. package/dist/browser/index.cjs +2 -2
  32. package/dist/browser/index.js +2 -2
  33. package/dist/{builder-Gg-xnX_E.js → builder-Cl-0BWkh.js} +2 -2
  34. package/dist/{builder-DuJBbQDH.cjs → builder-Cw8u3pPl.cjs} +2 -2
  35. package/dist/capabilities/302ai.json +204 -204
  36. package/dist/capabilities/abliteratedllm.json +30 -30
  37. package/dist/capabilities/above.json +21 -21
  38. package/dist/capabilities/adaption.json +15 -15
  39. package/dist/capabilities/adzuki.json +24 -24
  40. package/dist/capabilities/agentrouter.json +9 -9
  41. package/dist/capabilities/agnes.json +3 -3
  42. package/dist/capabilities/ai-router.json +8 -8
  43. package/dist/capabilities/aiand.json +31 -23
  44. package/dist/capabilities/aigrow.json +14 -14
  45. package/dist/capabilities/aimlapi.json +144 -147
  46. package/dist/capabilities/aipg.json +2 -2
  47. package/dist/capabilities/aixy.json +21 -21
  48. package/dist/capabilities/aki-io.json +10 -10
  49. package/dist/capabilities/alibaba-cn.json +136 -117
  50. package/dist/capabilities/alibaba-coding-plan-cn.json +7 -19
  51. package/dist/capabilities/alibaba-coding-plan.json +7 -19
  52. package/dist/capabilities/alibaba-token-plan-cn.json +49 -67
  53. package/dist/capabilities/alibaba-token-plan.json +50 -68
  54. package/dist/capabilities/alibaba.json +72 -119
  55. package/dist/capabilities/ambient.json +8 -8
  56. package/dist/capabilities/amd.json +10 -10
  57. package/dist/capabilities/anthropic.json +47 -47
  58. package/dist/capabilities/anyapi.json +19 -19
  59. package/dist/capabilities/apiko.json +5 -5
  60. package/dist/capabilities/arcee.json +11 -11
  61. package/dist/capabilities/augure.json +2 -2
  62. package/dist/capabilities/auriko.json +23 -23
  63. package/dist/capabilities/bailing.json +4 -4
  64. package/dist/capabilities/baseten.json +55 -25
  65. package/dist/capabilities/bee.json +4 -4
  66. package/dist/capabilities/berget.json +5 -5
  67. package/dist/capabilities/bothub.json +17 -17
  68. package/dist/capabilities/boundless.json +37 -37
  69. package/dist/capabilities/bumo.json +41 -41
  70. package/dist/capabilities/byteplus.json +26 -26
  71. package/dist/capabilities/cerebras.json +4 -4
  72. package/dist/capabilities/cheapaimodel.json +3 -3
  73. package/dist/capabilities/cheapest-token.json +30 -30
  74. package/dist/capabilities/chutes.json +10 -10
  75. package/dist/capabilities/cline-pass.json +39 -39
  76. package/dist/capabilities/cloudcode.json +9 -9
  77. package/dist/capabilities/cloudferro-sherlock.json +4 -4
  78. package/dist/capabilities/cloudflare-workers-ai.json +33 -33
  79. package/dist/capabilities/commandcode.json +139 -139
  80. package/dist/capabilities/concentrate.json +274 -274
  81. package/dist/capabilities/cortecs.json +108 -108
  82. package/dist/capabilities/crossmodel.json +189 -189
  83. package/dist/capabilities/crusoe.json +10 -10
  84. package/dist/capabilities/daoxe.json +9 -9
  85. package/dist/capabilities/databricks.json +315 -59
  86. package/dist/capabilities/deepinfra.json +90 -155
  87. package/dist/capabilities/deepseek.json +2 -2
  88. package/dist/capabilities/digitalocean.json +114 -114
  89. package/dist/capabilities/dothoosh.json +34 -34
  90. package/dist/capabilities/doubleword.json +28 -28
  91. package/dist/capabilities/edenai.json +433 -433
  92. package/dist/capabilities/empiriolabs.json +176 -176
  93. package/dist/capabilities/engy.json +17 -17
  94. package/dist/capabilities/entrim.json +6 -6
  95. package/dist/capabilities/evroc.json +13 -13
  96. package/dist/capabilities/ezkielyna.json +12 -12
  97. package/dist/capabilities/fastrouter.json +88 -88
  98. package/dist/capabilities/fireworks-ai.json +104 -41
  99. package/dist/capabilities/freemodel.json +20 -20
  100. package/dist/capabilities/friendli.json +9 -9
  101. package/dist/capabilities/frogbot.json +93 -93
  102. package/dist/capabilities/gisoo.json +19 -19
  103. package/dist/capabilities/gmicloud.json +21 -21
  104. package/dist/capabilities/google.json +55 -55
  105. package/dist/capabilities/graphn.json +11 -11
  106. package/dist/capabilities/greenpt.json +36 -36
  107. package/dist/capabilities/groq.json +9 -9
  108. package/dist/capabilities/helicone.json +83 -83
  109. package/dist/capabilities/hostinger-router.json +13 -13
  110. package/dist/capabilities/hpc-ai.json +8 -8
  111. package/dist/capabilities/huawei-maas.json +17 -17
  112. package/dist/capabilities/hubris.json +28 -28
  113. package/dist/capabilities/huggingface.json +200 -53
  114. package/dist/capabilities/humain.json +2 -2
  115. package/dist/capabilities/hyper.json +26 -26
  116. package/dist/capabilities/impossibl.json +127 -127
  117. package/dist/capabilities/inception.json +2 -2
  118. package/dist/capabilities/inceptron.json +8 -8
  119. package/dist/capabilities/inco.json +4 -4
  120. package/dist/capabilities/infer.json +14 -14
  121. package/dist/capabilities/inference-coop.json +15 -15
  122. package/dist/capabilities/inferenceapis.json +22 -22
  123. package/dist/capabilities/inferris.json +3 -3
  124. package/dist/capabilities/infersia.json +9 -9
  125. package/dist/capabilities/inferx.json +3 -3
  126. package/dist/capabilities/infomaniak.json +4 -4
  127. package/dist/capabilities/io-net.json +5 -5
  128. package/dist/capabilities/isoquant.json +4 -4
  129. package/dist/capabilities/iteracompute.json +51 -51
  130. package/dist/capabilities/jalapeno.json +12 -12
  131. package/dist/capabilities/jiekou.json +65 -65
  132. package/dist/capabilities/joingonka.json +4 -4
  133. package/dist/capabilities/jzstoken.json +54 -54
  134. package/dist/capabilities/keln.json +21 -28
  135. package/dist/capabilities/kenari.json +124 -121
  136. package/dist/capabilities/kilo.json +635 -636
  137. package/dist/capabilities/kimi-code-plan-cn.json +6 -6
  138. package/dist/capabilities/kimi-code-plan-global.json +6 -6
  139. package/dist/capabilities/kitani.json +4 -4
  140. package/dist/capabilities/klavo.json +13 -13
  141. package/dist/capabilities/korouter.json +31 -31
  142. package/dist/capabilities/kunavo.json +9 -9
  143. package/dist/capabilities/liquid.json +10 -10
  144. package/dist/capabilities/llmgateway-providers.json +909 -909
  145. package/dist/capabilities/llmgateway.json +333 -333
  146. package/dist/capabilities/llmtr.json +19 -19
  147. package/dist/capabilities/logits.json +2 -2
  148. package/dist/capabilities/longcat.json +1 -6
  149. package/dist/capabilities/lowrouter.json +52 -52
  150. package/dist/capabilities/lyceum.json +7 -7
  151. package/dist/capabilities/melious.json +16 -16
  152. package/dist/capabilities/merge-gateway.json +275 -275
  153. package/dist/capabilities/meta.json +9 -9
  154. package/dist/capabilities/minimax-cn-coding-plan.json +6 -6
  155. package/dist/capabilities/minimax-coding-plan.json +6 -6
  156. package/dist/capabilities/mistral.json +18 -18
  157. package/dist/capabilities/mixlayer.json +5 -5
  158. package/dist/capabilities/modal.json +13 -13
  159. package/dist/capabilities/model-oracle-ai.json +26 -26
  160. package/dist/capabilities/modelis.json +24 -24
  161. package/dist/capabilities/modelscope.json +2 -2
  162. package/dist/capabilities/modular.json +9 -9
  163. package/dist/capabilities/moneo.json +14 -14
  164. package/dist/capabilities/moonshotai-cn.json +6 -6
  165. package/dist/capabilities/moonshotai.json +6 -6
  166. package/dist/capabilities/morph.json +13 -13
  167. package/dist/capabilities/munito-eu.json +6 -6
  168. package/dist/capabilities/munito.json +10 -10
  169. package/dist/capabilities/nan.json +24 -24
  170. package/dist/capabilities/nano-gpt.json +577 -577
  171. package/dist/capabilities/nearai.json +82 -82
  172. package/dist/capabilities/nebius.json +29 -29
  173. package/dist/capabilities/neon.json +134 -134
  174. package/dist/capabilities/neuralwatt.json +43 -43
  175. package/dist/capabilities/nokeep.json +4 -4
  176. package/dist/capabilities/novita-ai.json +135 -135
  177. package/dist/capabilities/nvidia.json +38 -38
  178. package/dist/capabilities/oathbreaker.json +2 -2
  179. package/dist/capabilities/obscurify.json +26 -26
  180. package/dist/capabilities/oci.json +5 -5
  181. package/dist/capabilities/ofox.json +338 -338
  182. package/dist/capabilities/ollama-cloud.json +55 -55
  183. package/dist/capabilities/openai.json +48 -48
  184. package/dist/capabilities/opencode-go.json +81 -81
  185. package/dist/capabilities/openreason.json +5 -5
  186. package/dist/capabilities/openrouter.json +548 -563
  187. package/dist/capabilities/opper.json +23 -23
  188. package/dist/capabilities/orcarouter.json +212 -212
  189. package/dist/capabilities/outerlabs.json +30 -30
  190. package/dist/capabilities/ovhcloud.json +8 -8
  191. package/dist/capabilities/pareto.json +5 -5
  192. package/dist/capabilities/pendra.json +4 -4
  193. package/dist/capabilities/perplexity-agent.json +59 -59
  194. package/dist/capabilities/perplexity.json +2 -2
  195. package/dist/capabilities/phala.json +27 -27
  196. package/dist/capabilities/pioneer.json +24 -24
  197. package/dist/capabilities/poe.json +136 -136
  198. package/dist/capabilities/powerspring.json +14 -14
  199. package/dist/capabilities/primalabs.json +7 -7
  200. package/dist/capabilities/prime.json +108 -108
  201. package/dist/capabilities/privatemode-ai.json +12 -12
  202. package/dist/capabilities/proxystacks.json +6 -6
  203. package/dist/capabilities/qiniu-ai.json +15 -15
  204. package/dist/capabilities/refuseless.json +9 -9
  205. package/dist/capabilities/regolo-ai.json +6 -6
  206. package/dist/capabilities/requesty.json +171 -171
  207. package/dist/capabilities/ruapi.json +20 -20
  208. package/dist/capabilities/runcrate.json +16 -16
  209. package/dist/capabilities/runinfra.json +17 -17
  210. package/dist/capabilities/sakana.json +6 -6
  211. package/dist/capabilities/sambanova.json +6 -6
  212. package/dist/capabilities/sandbase.json +16 -16
  213. package/dist/capabilities/sarvam.json +12 -12
  214. package/dist/capabilities/scaleway.json +17 -17
  215. package/dist/capabilities/scnet-token-plan.json +8 -8
  216. package/dist/capabilities/scx-ai.json +29 -29
  217. package/dist/capabilities/sensenova.json +14 -14
  218. package/dist/capabilities/siliconflow-cn.json +61 -61
  219. package/dist/capabilities/siliconflow.json +57 -57
  220. package/dist/capabilities/snowflake-cortex.json +24 -24
  221. package/dist/capabilities/sokkan.json +10 -10
  222. package/dist/capabilities/sparrowcodes.json +24 -24
  223. package/dist/capabilities/standardcompute.json +89 -89
  224. package/dist/capabilities/steadyrouter.json +38 -38
  225. package/dist/capabilities/stepfun-ai-step-plan.json +7 -7
  226. package/dist/capabilities/stepfun-ai.json +16 -9
  227. package/dist/capabilities/stepfun-step-plan.json +16 -9
  228. package/dist/capabilities/stepfun.json +16 -9
  229. package/dist/capabilities/stepping-stone.json +18 -18
  230. package/dist/capabilities/subconscious.json +2 -2
  231. package/dist/capabilities/synthetic.json +12 -12
  232. package/dist/capabilities/synthorai.json +26 -26
  233. package/dist/capabilities/teamorouter.json +21 -21
  234. package/dist/capabilities/teapot-router.json +9 -9
  235. package/dist/capabilities/tencent-coding-plan.json +1 -23
  236. package/dist/capabilities/tencent-token-plan.json +57 -20
  237. package/dist/capabilities/tencent-tokenhub.json +182 -7
  238. package/dist/capabilities/tensorx.json +36 -36
  239. package/dist/capabilities/the-grid-ai.json +29 -29
  240. package/dist/capabilities/thinkingmachines.json +73 -56
  241. package/dist/capabilities/tinfoil.json +9 -9
  242. package/dist/capabilities/toapis.json +3 -3
  243. package/dist/capabilities/togetherai.json +61 -90
  244. package/dist/capabilities/tokengo.json +21 -21
  245. package/dist/capabilities/tokenify.json +9 -9
  246. package/dist/capabilities/trustedrouter.json +7 -7
  247. package/dist/capabilities/trustedtokens.json +14 -14
  248. package/dist/capabilities/umans-ai-coding-plan.json +13 -13
  249. package/dist/capabilities/umans-ai.json +10 -10
  250. package/dist/capabilities/uncensuredai.json +4 -4
  251. package/dist/capabilities/unrestricted.json +4 -4
  252. package/dist/capabilities/uplinkswitch.json +19 -19
  253. package/dist/capabilities/upstage.json +6 -6
  254. package/dist/capabilities/vancine.json +19 -19
  255. package/dist/capabilities/vercel.json +558 -537
  256. package/dist/capabilities/vivgrid.json +78 -78
  257. package/dist/capabilities/volcengine-coding-plan.json +26 -56
  258. package/dist/capabilities/volcengine.json +57 -62
  259. package/dist/capabilities/vultr.json +28 -28
  260. package/dist/capabilities/wafer.ai.json +18 -18
  261. package/dist/capabilities/wallaby.json +5 -5
  262. package/dist/capabilities/wally.json +14 -14
  263. package/dist/capabilities/wandb.json +20 -20
  264. package/dist/capabilities/watt.json +22 -22
  265. package/dist/capabilities/xai.json +4 -4
  266. package/dist/capabilities/xiaomi-token-plan-ams.json +2 -12
  267. package/dist/capabilities/xiaomi-token-plan-cn.json +2 -12
  268. package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -12
  269. package/dist/capabilities/xiaomi.json +3 -25
  270. package/dist/capabilities/xpersona.json +11 -11
  271. package/dist/capabilities/xxapi.json +27 -27
  272. package/dist/capabilities/zai-coding-plan.json +14 -14
  273. package/dist/capabilities/zai.json +47 -24
  274. package/dist/capabilities/zenifra.json +24 -24
  275. package/dist/capabilities/zenmux.json +185 -185
  276. package/dist/capabilities/zerogpu.json +12 -12
  277. package/dist/capabilities/zhipuai-coding-plan.json +8 -8
  278. package/dist/capabilities/zhipuai.json +35 -20
  279. package/dist/capabilities/zro.json +7 -7
  280. package/dist/channels/index.cjs +2 -2
  281. package/dist/channels/index.js +2 -2
  282. package/dist/{channels-BRVCOutx.js → channels-Cz1y3W6u.js} +1 -1
  283. package/dist/{channels-MjTA9bFp.cjs → channels-DQg4v_gm.cjs} +1 -1
  284. package/dist/coding-agent/index.cjs +2 -2
  285. package/dist/coding-agent/index.js +2 -2
  286. package/dist/datasets/index.cjs +2 -2
  287. package/dist/datasets/index.js +2 -2
  288. package/dist/docs/SKILL.md +3 -2
  289. package/dist/docs/assets/SOURCE_MAP.json +895 -870
  290. package/dist/docs/references/docs-harness-background-tasks.md +4 -1
  291. package/dist/docs/references/docs-knowledge-importers.md +195 -0
  292. package/dist/docs/references/docs-knowledge-load-your-content.md +1 -1
  293. package/dist/docs/references/docs-knowledge-overview.md +1 -1
  294. package/dist/docs/references/docs-sandbox-filesystem.md +1 -1
  295. package/dist/docs/references/docs-signals-thread-streams.md +1 -1
  296. package/dist/docs/references/docs-studio-auth.md +54 -7
  297. package/dist/docs/references/integrations-auth-clerk.md +48 -4
  298. package/dist/docs/references/reference-agents-agent.md +1 -1
  299. package/dist/docs/references/reference-agents-durable-agent.md +10 -4
  300. package/dist/docs/references/reference-auth-clerk.md +21 -1
  301. package/dist/docs/references/reference-knowledge-knowledge-class.md +11 -4
  302. package/dist/docs/references/reference-memory-observational-memory.md +2 -2
  303. package/dist/docs/references/reference-streaming-ChunkType.md +2 -2
  304. package/dist/docs/references/reference-workspace-local-sandbox.md +2 -0
  305. package/dist/error/index.cjs +1 -1
  306. package/dist/error/index.js +1 -1
  307. package/dist/{error-C9d_24w-.js → error-BLwEXqOK.js} +2 -2
  308. package/dist/{error-BRQf2ku0.cjs → error-BdEvO8za.cjs} +2 -2
  309. package/dist/evals/index.cjs +1 -1
  310. package/dist/evals/index.js +1 -1
  311. package/dist/evals/scoreTraces/index.cjs +1 -1
  312. package/dist/evals/scoreTraces/index.js +1 -1
  313. package/dist/features/index.cjs +1 -0
  314. package/dist/features/index.js +1 -0
  315. package/dist/{filesystem-B5X-5G0x.js → filesystem-B8ad6kAW.js} +1 -1
  316. package/dist/{filesystem-BDSpwBke.cjs → filesystem-BB5YWXH-.cjs} +1 -1
  317. package/dist/{filesystem-DzM9pcQ8.js → filesystem-BDHUxbHn.js} +1 -1
  318. package/dist/{filesystem-B0AZrbj8.cjs → filesystem-BP5yz5LG.cjs} +1 -1
  319. package/dist/{filesystem-BsdkC311.js → filesystem-B_afSgYk.js} +1 -1
  320. package/dist/{filesystem-C-cyJfi1.cjs → filesystem-BaOJOc-V.cjs} +1 -1
  321. package/dist/{filesystem-B3s0WRud.js → filesystem-BhYgU8qg.js} +1 -1
  322. package/dist/{filesystem-DzfqVTO_.js → filesystem-CLBVmR5j.js} +1 -1
  323. package/dist/{filesystem-CEbD_77-.cjs → filesystem-Cgxc2a_-.cjs} +1 -1
  324. package/dist/{filesystem-Cv79mHRk.js → filesystem-ClBOBoDc.js} +1 -1
  325. package/dist/{filesystem-DsCQiBl2.cjs → filesystem-DVVecqZt.cjs} +1 -1
  326. package/dist/{filesystem-CUAgLugE.cjs → filesystem-Fpsu7e24.cjs} +1 -1
  327. package/dist/{filesystem-versioned-Bijb_p9l.js → filesystem-versioned-BL1ojJLo.js} +1 -1
  328. package/dist/{filesystem-versioned-DZGyPbNC.cjs → filesystem-versioned-BavRtYWJ.cjs} +1 -1
  329. package/dist/harness/index.cjs +1 -1
  330. package/dist/harness/index.js +1 -1
  331. package/dist/index.cjs +1 -1
  332. package/dist/index.js +1 -1
  333. package/dist/knowledge/config.d.ts +10 -0
  334. package/dist/knowledge/host-writes.d.ts +10 -0
  335. package/dist/knowledge/importers/conformance.d.ts +25 -0
  336. package/dist/knowledge/importers/define.d.ts +204 -0
  337. package/dist/knowledge/importers/host.d.ts +143 -0
  338. package/dist/knowledge/importers/index.d.ts +12 -0
  339. package/dist/knowledge/importers/local-host.d.ts +106 -0
  340. package/dist/knowledge/importers/manifest.d.ts +25 -0
  341. package/dist/knowledge/importers/runner.d.ts +61 -0
  342. package/dist/knowledge/importers/sink.d.ts +105 -0
  343. package/dist/knowledge/importers/types.d.ts +144 -0
  344. package/dist/knowledge/index.cjs +2715 -8
  345. package/dist/knowledge/index.d.ts +54 -4
  346. package/dist/knowledge/index.js +2692 -9
  347. package/dist/knowledge/instructions.d.ts +1 -1
  348. package/dist/knowledge/links.d.ts +8 -0
  349. package/dist/knowledge/pinned-state-processor.d.ts +5 -0
  350. package/dist/knowledge/pinned.d.ts +4 -1
  351. package/dist/knowledge/scope-runtime.d.ts +10 -0
  352. package/dist/llm/index.cjs +3 -3
  353. package/dist/llm/index.js +3 -3
  354. package/dist/llm/model/provider-types.generated.d.ts +7705 -7727
  355. package/dist/{llm-DmUucguC.cjs → llm-8Av3mSjD.cjs} +2 -2
  356. package/dist/{llm-Djd8Qzi0.js → llm-B5A5cwJr.js} +2 -2
  357. package/dist/loop/index.cjs +2 -2
  358. package/dist/loop/index.js +2 -2
  359. package/dist/{manager-CO_Xz2zR.js → manager-DfWQCJUK.js} +2 -2
  360. package/dist/{manager-D27PkIPo.cjs → manager-sv35JY-z.cjs} +2 -2
  361. package/dist/mastra/index.cjs +1 -1
  362. package/dist/mastra/index.js +1 -1
  363. package/dist/mastra/resolve-agent.d.ts +3 -1
  364. package/dist/{mastra-Ch00nEAJ.js → mastra-CigBrT7X.js} +17 -23
  365. package/dist/{mastra-qsVWpOTi.cjs → mastra-D4hvfuxX.cjs} +19 -25
  366. package/dist/memory/index.cjs +3 -3
  367. package/dist/memory/index.js +3 -3
  368. package/dist/{message-list-DPXPXvin.cjs → message-list-Cj0Sq_JP.cjs} +63 -8
  369. package/dist/{message-list-DEuRl82K.js → message-list-KRbg-TnI.js} +63 -8
  370. package/dist/{model-Do6DTJoj.cjs → model-BK93CMtl.cjs} +1 -1
  371. package/dist/{model-CW-mfGYA.js → model-CYtXw861.js} +1 -1
  372. package/dist/{netlify-DU32SDT6.cjs → netlify-BAnn3ouY.cjs} +1 -1
  373. package/dist/{netlify-DZSAbdve.js → netlify-CuI1ZrwR.js} +1 -1
  374. package/dist/notifications/index.cjs +1 -1
  375. package/dist/notifications/index.js +1 -1
  376. package/dist/processor-provider/index.cjs +1 -1
  377. package/dist/processor-provider/index.js +1 -1
  378. package/dist/processors/abort-signal-scope.d.ts +6 -0
  379. package/dist/processors/index.cjs +2 -2
  380. package/dist/processors/index.js +2 -2
  381. package/dist/{provider-registry-zGezZVsL.cjs → provider-registry-BwuI_IpT.cjs} +21696 -21828
  382. package/dist/{provider-registry-deA0x-Gd.js → provider-registry-CmQLzLF_.js} +21696 -21828
  383. package/dist/provider-registry.json +22300 -22417
  384. package/dist/{registry-generator-VvBfOKAD.js → registry-generator-C17V4WfG.js} +1 -1
  385. package/dist/{registry-generator-BkQ1AxZn.cjs → registry-generator-C_0ae7Ce.cjs} +1 -1
  386. package/dist/{rehydrate-DDYFpQsV.cjs → rehydrate-CDQ4dOYj.cjs} +2 -2
  387. package/dist/{rehydrate-BjLV643n.js → rehydrate-PnaVawGX.js} +2 -2
  388. package/dist/relevance/index.cjs +2 -2
  389. package/dist/relevance/index.js +2 -2
  390. package/dist/{run-registry-5Suldxz3.cjs → run-registry-BmckDVBk.cjs} +1156 -403
  391. package/dist/{run-registry-CGRPldLH.js → run-registry-BwEcwYlU.js} +1103 -404
  392. package/dist/{source-DDwx-87N.cjs → source-BVOi8Xhp.cjs} +1 -1
  393. package/dist/{source-Did_2XQc.js → source-fNa6u1kH.js} +1 -1
  394. package/dist/storage/domains/agents/index.cjs +1 -1
  395. package/dist/storage/domains/agents/index.js +1 -1
  396. package/dist/storage/domains/knowledge/base.d.ts +67 -0
  397. package/dist/storage/domains/knowledge/importers-inmemory.d.ts +146 -0
  398. package/dist/storage/domains/knowledge/importers.d.ts +287 -0
  399. package/dist/storage/domains/knowledge/index.d.ts +1 -0
  400. package/dist/storage/domains/knowledge/inmemory.d.ts +11 -0
  401. package/dist/storage/domains/knowledge/pages-inmemory.d.ts +12 -1
  402. package/dist/storage/domains/knowledge/pages.d.ts +1 -0
  403. package/dist/storage/domains/mcp-clients/index.cjs +1 -1
  404. package/dist/storage/domains/mcp-clients/index.js +1 -1
  405. package/dist/storage/domains/mcp-servers/index.cjs +1 -1
  406. package/dist/storage/domains/mcp-servers/index.js +1 -1
  407. package/dist/storage/domains/prompt-blocks/index.cjs +1 -1
  408. package/dist/storage/domains/prompt-blocks/index.js +1 -1
  409. package/dist/storage/domains/scorer-definitions/index.cjs +1 -1
  410. package/dist/storage/domains/scorer-definitions/index.js +1 -1
  411. package/dist/storage/domains/skills/index.cjs +1 -1
  412. package/dist/storage/domains/skills/index.js +1 -1
  413. package/dist/storage/domains/workspaces/index.cjs +1 -1
  414. package/dist/storage/domains/workspaces/index.js +1 -1
  415. package/dist/storage/index.cjs +15 -10
  416. package/dist/storage/index.js +11 -11
  417. package/dist/stream/base/output.d.ts +17 -0
  418. package/dist/stream/index.cjs +2 -2
  419. package/dist/stream/index.js +2 -2
  420. package/dist/stream/types.d.ts +5 -2
  421. package/dist/{stream-Dvy_0o14.cjs → stream-0kdqBOOn.cjs} +64 -9
  422. package/dist/{stream-Dpwx0whf.js → stream-D1y9GzoD.js} +29 -10
  423. package/dist/test-utils/llm-mock.cjs +1 -1
  424. package/dist/test-utils/llm-mock.js +1 -1
  425. package/dist/tool-loop-agent/index.cjs +1 -1
  426. package/dist/tool-loop-agent/index.js +1 -1
  427. package/dist/{tool-loop-agent-PbWrEj1k.js → tool-loop-agent-BdjWGVIb.js} +4 -4
  428. package/dist/{tool-loop-agent-UxOv3FoK.cjs → tool-loop-agent-kWaZAT6Q.cjs} +4 -4
  429. package/dist/{utils-BbMTlyBO.cjs → utils-BKUCaZ12.cjs} +1 -1
  430. package/dist/{utils-BnNi1BYM.js → utils-GHY3hmLx.js} +1 -1
  431. package/dist/utils.cjs +1 -1
  432. package/dist/utils.js +1 -1
  433. package/dist/{validate-HSBcm96b.js → validate-CB-q-R2F.js} +1 -1
  434. package/dist/{validate-Skps-cM3.cjs → validate-De92squ7.cjs} +1 -1
  435. package/dist/vector/index.cjs +2 -2
  436. package/dist/vector/index.js +2 -2
  437. package/dist/worker/index.cjs +1 -1
  438. package/dist/worker/index.js +1 -1
  439. package/dist/{worker-BNS5A3qP.cjs → worker-BbWPQuPR.cjs} +2 -2
  440. package/dist/{worker-DehaD4qD.js → worker-C3u_xzY2.js} +2 -2
  441. package/dist/{worker-BE-0DyKL.cjs → worker-CAKvQj9_.cjs} +2 -2
  442. package/dist/{worker-BKrKHZzU.js → worker-Kwm8EKcj.js} +2 -2
  443. package/dist/{workflow-BjUTwaK9.cjs → workflow-CSjXeNcR.cjs} +3 -3
  444. package/dist/{workflow-Bvw6yDjc.js → workflow-CVmI1Sw-.js} +3 -3
  445. package/dist/workflows/builder/index.cjs +1 -1
  446. package/dist/workflows/builder/index.js +1 -1
  447. package/dist/workflows/evented/index.cjs +1 -1
  448. package/dist/workflows/evented/index.js +1 -1
  449. package/dist/workflows/index.cjs +4 -4
  450. package/dist/workflows/index.js +4 -4
  451. package/dist/workspace/filesystem/filesystem.d.ts +5 -0
  452. package/dist/workspace/index.cjs +1 -1
  453. package/dist/workspace/index.js +1 -1
  454. package/dist/workspace/sandbox/local-sandbox.d.ts +16 -7
  455. package/dist/workspace/sandbox/native-sandbox/types.d.ts +11 -1
  456. package/dist/{workspace-C05xDH60.js → workspace-DY2Nxiyi.js} +75 -27
  457. package/dist/{workspace-D1OzzlLw.cjs → workspace-X2RHJZU9.cjs} +75 -27
  458. package/package.json +3 -3
  459. package/src/llm/model/provider-types.generated.d.ts +7705 -7727
@@ -3834,6 +3834,7 @@ function generateSeatbeltProfile(workspacePath, config) {
3834
3834
  ]) if (config.readOnly) lines.push(`(allow file-write* (require-all (subpath ${escapePath(tempPath)}) (require-not (subpath ${escapePath(canonicalWorkspacePath)}))))`);
3835
3835
  else lines.push(`(allow file-write* (subpath ${escapePath(tempPath)}))`);
3836
3836
  for (const p of config.readWritePaths ?? []) lines.push(`(allow file-write* (subpath ${escapePath(canonicalizePath(p))}))`);
3837
+ for (const p of config.denyWritePaths ?? []) lines.push(`(deny file-write* (subpath ${escapePath(canonicalizePath(p))}))`);
3837
3838
  lines.push("");
3838
3839
  lines.push("; Network");
3839
3840
  if (config.allowNetwork) lines.push("(allow network*)");
@@ -3928,6 +3929,7 @@ function buildBwrapCommand(command, workspacePath, config) {
3928
3929
  if (config.readOnly) bwrapArgs.push("--ro-bind", workspacePath, workspacePath);
3929
3930
  else bwrapArgs.push("--bind", workspacePath, workspacePath);
3930
3931
  for (const path of config.readWritePaths ?? []) bwrapArgs.push("--bind", path, path);
3932
+ for (const path of config.denyWritePaths ?? []) bwrapArgs.push("--ro-bind", path, path);
3931
3933
  bwrapArgs.push("--dev", "/dev");
3932
3934
  bwrapArgs.push("--chdir", workspacePath);
3933
3935
  bwrapArgs.push("--die-with-parent");
@@ -4052,9 +4054,11 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4052
4054
  _activeMountPaths = /* @__PURE__ */ new Set();
4053
4055
  /** Snapshot of `readWritePaths` from ctor; entries here are never removed on unmount. */
4054
4056
  _initialReadWritePaths;
4055
- /** Refcount for isolation paths added by mounts (not present in `_initialReadWritePaths`). */
4057
+ /** Snapshot of `denyWritePaths` from ctor; entries here are never removed on unmount. */
4058
+ _initialDenyWritePaths;
4059
+ /** Refcount for isolation paths added by mounts, keyed by `<list>:<path>`. */
4056
4060
  _mountIsolationRefCount = /* @__PURE__ */ new Map();
4057
- /** Normalized mount path → canonical isolation path recorded for that mount. */
4061
+ /** Normalized mount path → canonical isolation path and the list it was added to. */
4058
4062
  _mountPathToIsolationPath = /* @__PURE__ */ new Map();
4059
4063
  /** Named checkpoint to seed from on start and persist to on snapshot. */
4060
4064
  _checkpointName;
@@ -4094,9 +4098,11 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4094
4098
  this._nativeSandboxConfig = {
4095
4099
  ...options.nativeSandbox,
4096
4100
  readWritePaths: [...options.nativeSandbox?.readWritePaths ?? []],
4097
- readOnlyPaths: [...options.nativeSandbox?.readOnlyPaths ?? []]
4101
+ readOnlyPaths: [...options.nativeSandbox?.readOnlyPaths ?? []],
4102
+ denyWritePaths: [...options.nativeSandbox?.denyWritePaths ?? []]
4098
4103
  };
4099
4104
  this._initialReadWritePaths = new Set(this._nativeSandboxConfig.readWritePaths ?? []);
4105
+ this._initialDenyWritePaths = new Set(this._nativeSandboxConfig.denyWritePaths ?? []);
4100
4106
  this.isolation = requestedIsolation;
4101
4107
  this._instructionsOverride = options.instructions;
4102
4108
  this._checkpointName = options.checkpointName;
@@ -4124,7 +4130,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4124
4130
  nativeSandbox: {
4125
4131
  ...this._nativeSandboxConfig,
4126
4132
  readWritePaths: [...this._initialReadWritePaths],
4127
- readOnlyPaths: [...this._nativeSandboxConfig.readOnlyPaths ?? []]
4133
+ readOnlyPaths: [...this._nativeSandboxConfig.readOnlyPaths ?? []],
4134
+ denyWritePaths: [...this._initialDenyWritePaths]
4128
4135
  },
4129
4136
  ...this._instructionsOverride !== void 0 && { instructions: this._instructionsOverride },
4130
4137
  ...(options.checkpointName ?? this._checkpointName) !== void 0 && { checkpointName: options.checkpointName ?? this._checkpointName },
@@ -4362,7 +4369,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4362
4369
  isolationConfig: this.isolation !== "none" ? {
4363
4370
  allowNetwork: this._nativeSandboxConfig.allowNetwork ?? false,
4364
4371
  readOnlyPaths: this._nativeSandboxConfig.readOnlyPaths,
4365
- readWritePaths: this._nativeSandboxConfig.readWritePaths
4372
+ readWritePaths: this._nativeSandboxConfig.readWritePaths,
4373
+ denyWritePaths: this._nativeSandboxConfig.denyWritePaths
4366
4374
  } : void 0
4367
4375
  }
4368
4376
  };
@@ -4433,7 +4441,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4433
4441
  config
4434
4442
  });
4435
4443
  this._activeMountPaths.add(mountPath);
4436
- this.addMountPathToIsolation(mountPath, hostPath);
4444
+ const isolationError = this.addMountPathToIsolation(mountPath, hostPath, filesystem.readOnly === true);
4445
+ if (isolationError) return this.failMountIsolation(filesystem, mountPath, config, isolationError);
4437
4446
  return {
4438
4447
  success: true,
4439
4448
  mountPath
@@ -4544,7 +4553,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4544
4553
  });
4545
4554
  this._activeMountPaths.add(mountPath);
4546
4555
  await this.writeMarkerFile(mountPath, hostPath);
4547
- this.addMountPathToIsolation(mountPath, hostPath);
4556
+ const isolationError = this.addMountPathToIsolation(mountPath, hostPath, filesystem.readOnly === true);
4557
+ if (isolationError) return this.failMountIsolation(filesystem, mountPath, config, isolationError);
4548
4558
  this.logger.debug("Mounted", {
4549
4559
  mountPath,
4550
4560
  hostPath
@@ -4657,53 +4667,91 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4657
4667
  }
4658
4668
  }
4659
4669
  /**
4660
- * Dynamically add a mount path to the sandbox isolation allowlist.
4670
+ * Dynamically add a mount path to the sandbox isolation config.
4661
4671
  *
4662
- * - Seatbelt: pushes to readWritePaths (wrapCommand reads config each call)
4663
- * - Bwrap: pushes to readWritePaths (buildBwrapCommand reads config each call)
4672
+ * Read-write mounts go to `readWritePaths`; mounts whose filesystem is
4673
+ * `readOnly` go to `denyWritePaths` so subprocesses can read but never write
4674
+ * them, matching what file tools enforce. Both backends read the config on
4675
+ * every wrapCommand() call, so the change takes effect immediately.
4664
4676
  *
4665
4677
  * Local mounts are symlinks under `workingDirectory`. Bubblewrap cannot
4666
4678
  * `--bind` a symlink (it fails with "Unable to mount source on destination"),
4667
4679
  * so we store the canonical path (`realpath`) of the mount point — the same
4668
4680
  * directory the symlink refers to.
4681
+ *
4682
+ * Returns an error when a read-only mount can't be resolved: a write denial on
4683
+ * the unresolved symlink wouldn't cover the directory writes actually land in.
4669
4684
  */
4670
- addMountPathToIsolation(mountPath, hostPath) {
4685
+ addMountPathToIsolation(mountPath, hostPath, readOnly) {
4671
4686
  if (this.isolation === "none") return;
4672
4687
  const normMount = normalizeMountPath(mountPath);
4673
- if (this._mountPathToIsolationPath.has(normMount)) return;
4688
+ const list = readOnly ? "denyWritePaths" : "readWritePaths";
4689
+ const existing = this._mountPathToIsolationPath.get(normMount);
4690
+ if (existing?.list === list) return;
4691
+ if (existing) this.removeMountIsolationForPath(normMount);
4674
4692
  let isolationPath = hostPath;
4675
4693
  try {
4676
4694
  isolationPath = realpathSync(hostPath);
4677
- } catch {}
4678
- if (!this._nativeSandboxConfig.readWritePaths) this._nativeSandboxConfig = {
4695
+ } catch {
4696
+ if (readOnly) return `Cannot mount read-only filesystem at ${hostPath}: its source could not be resolved, so writes to it can't be denied to sandboxed commands.`;
4697
+ this.logger.warn("Could not resolve mount path for isolation; using unresolved path", { hostPath });
4698
+ }
4699
+ if (!this._nativeSandboxConfig[list]) this._nativeSandboxConfig = {
4679
4700
  ...this._nativeSandboxConfig,
4680
- readWritePaths: []
4701
+ [list]: []
4681
4702
  };
4682
- const paths = this._nativeSandboxConfig.readWritePaths;
4703
+ const paths = this._nativeSandboxConfig[list];
4683
4704
  if (!paths.includes(isolationPath)) paths.push(isolationPath);
4684
- if (!this._initialReadWritePaths.has(isolationPath)) this._mountIsolationRefCount.set(isolationPath, (this._mountIsolationRefCount.get(isolationPath) ?? 0) + 1);
4685
- this._mountPathToIsolationPath.set(normMount, isolationPath);
4705
+ if (!(readOnly ? this._initialDenyWritePaths : this._initialReadWritePaths).has(isolationPath)) {
4706
+ const key = `${list}:${isolationPath}`;
4707
+ this._mountIsolationRefCount.set(key, (this._mountIsolationRefCount.get(key) ?? 0) + 1);
4708
+ }
4709
+ this._mountPathToIsolationPath.set(normMount, {
4710
+ path: isolationPath,
4711
+ list
4712
+ });
4713
+ }
4714
+ /** Undo a mount whose isolation couldn't be applied and record it as failed. */
4715
+ async failMountIsolation(filesystem, mountPath, config, error) {
4716
+ this.logger.error("Could not apply mount isolation", {
4717
+ mountPath,
4718
+ error
4719
+ });
4720
+ await this.unmount(mountPath);
4721
+ this.mounts.set(mountPath, {
4722
+ filesystem,
4723
+ state: "error",
4724
+ config,
4725
+ error
4726
+ });
4727
+ return {
4728
+ success: false,
4729
+ mountPath,
4730
+ error
4731
+ };
4686
4732
  }
4687
4733
  /**
4688
- * Reverse {@link addMountPathToIsolation}: drop refcounted paths from the allowlist on unmount
4689
- * while preserving user-provided `readWritePaths` from construction.
4734
+ * Reverse {@link addMountPathToIsolation}: drop refcounted paths from the isolation
4735
+ * config on unmount while preserving user-provided paths from construction.
4690
4736
  */
4691
4737
  removeMountIsolationForPath(mountPath) {
4692
4738
  if (this.isolation === "none") return;
4693
4739
  const normMount = normalizeMountPath(mountPath);
4694
- const isolationPath = this._mountPathToIsolationPath.get(normMount);
4695
- if (isolationPath === void 0) return;
4740
+ const entry = this._mountPathToIsolationPath.get(normMount);
4741
+ if (entry === void 0) return;
4696
4742
  this._mountPathToIsolationPath.delete(normMount);
4697
- if (this._initialReadWritePaths.has(isolationPath)) return;
4698
- const next = (this._mountIsolationRefCount.get(isolationPath) ?? 0) - 1;
4743
+ const { path: isolationPath, list } = entry;
4744
+ if ((list === "denyWritePaths" ? this._initialDenyWritePaths : this._initialReadWritePaths).has(isolationPath)) return;
4745
+ const key = `${list}:${isolationPath}`;
4746
+ const next = (this._mountIsolationRefCount.get(key) ?? 0) - 1;
4699
4747
  if (next <= 0) {
4700
- this._mountIsolationRefCount.delete(isolationPath);
4701
- const paths = this._nativeSandboxConfig.readWritePaths;
4748
+ this._mountIsolationRefCount.delete(key);
4749
+ const paths = this._nativeSandboxConfig[list];
4702
4750
  if (paths) {
4703
4751
  const idx = paths.indexOf(isolationPath);
4704
4752
  if (idx !== -1) paths.splice(idx, 1);
4705
4753
  }
4706
- } else this._mountIsolationRefCount.set(isolationPath, next);
4754
+ } else this._mountIsolationRefCount.set(key, next);
4707
4755
  }
4708
4756
  /**
4709
4757
  * Resolve a virtual mount path to a host filesystem path.
@@ -3839,6 +3839,7 @@ function generateSeatbeltProfile(workspacePath, config) {
3839
3839
  ]) if (config.readOnly) lines.push(`(allow file-write* (require-all (subpath ${escapePath(tempPath)}) (require-not (subpath ${escapePath(canonicalWorkspacePath)}))))`);
3840
3840
  else lines.push(`(allow file-write* (subpath ${escapePath(tempPath)}))`);
3841
3841
  for (const p of config.readWritePaths ?? []) lines.push(`(allow file-write* (subpath ${escapePath(canonicalizePath(p))}))`);
3842
+ for (const p of config.denyWritePaths ?? []) lines.push(`(deny file-write* (subpath ${escapePath(canonicalizePath(p))}))`);
3842
3843
  lines.push("");
3843
3844
  lines.push("; Network");
3844
3845
  if (config.allowNetwork) lines.push("(allow network*)");
@@ -3933,6 +3934,7 @@ function buildBwrapCommand(command, workspacePath, config) {
3933
3934
  if (config.readOnly) bwrapArgs.push("--ro-bind", workspacePath, workspacePath);
3934
3935
  else bwrapArgs.push("--bind", workspacePath, workspacePath);
3935
3936
  for (const path of config.readWritePaths ?? []) bwrapArgs.push("--bind", path, path);
3937
+ for (const path of config.denyWritePaths ?? []) bwrapArgs.push("--ro-bind", path, path);
3936
3938
  bwrapArgs.push("--dev", "/dev");
3937
3939
  bwrapArgs.push("--chdir", workspacePath);
3938
3940
  bwrapArgs.push("--die-with-parent");
@@ -4057,9 +4059,11 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4057
4059
  _activeMountPaths = /* @__PURE__ */ new Set();
4058
4060
  /** Snapshot of `readWritePaths` from ctor; entries here are never removed on unmount. */
4059
4061
  _initialReadWritePaths;
4060
- /** Refcount for isolation paths added by mounts (not present in `_initialReadWritePaths`). */
4062
+ /** Snapshot of `denyWritePaths` from ctor; entries here are never removed on unmount. */
4063
+ _initialDenyWritePaths;
4064
+ /** Refcount for isolation paths added by mounts, keyed by `<list>:<path>`. */
4061
4065
  _mountIsolationRefCount = /* @__PURE__ */ new Map();
4062
- /** Normalized mount path → canonical isolation path recorded for that mount. */
4066
+ /** Normalized mount path → canonical isolation path and the list it was added to. */
4063
4067
  _mountPathToIsolationPath = /* @__PURE__ */ new Map();
4064
4068
  /** Named checkpoint to seed from on start and persist to on snapshot. */
4065
4069
  _checkpointName;
@@ -4099,9 +4103,11 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4099
4103
  this._nativeSandboxConfig = {
4100
4104
  ...options.nativeSandbox,
4101
4105
  readWritePaths: [...options.nativeSandbox?.readWritePaths ?? []],
4102
- readOnlyPaths: [...options.nativeSandbox?.readOnlyPaths ?? []]
4106
+ readOnlyPaths: [...options.nativeSandbox?.readOnlyPaths ?? []],
4107
+ denyWritePaths: [...options.nativeSandbox?.denyWritePaths ?? []]
4103
4108
  };
4104
4109
  this._initialReadWritePaths = new Set(this._nativeSandboxConfig.readWritePaths ?? []);
4110
+ this._initialDenyWritePaths = new Set(this._nativeSandboxConfig.denyWritePaths ?? []);
4105
4111
  this.isolation = requestedIsolation;
4106
4112
  this._instructionsOverride = options.instructions;
4107
4113
  this._checkpointName = options.checkpointName;
@@ -4129,7 +4135,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4129
4135
  nativeSandbox: {
4130
4136
  ...this._nativeSandboxConfig,
4131
4137
  readWritePaths: [...this._initialReadWritePaths],
4132
- readOnlyPaths: [...this._nativeSandboxConfig.readOnlyPaths ?? []]
4138
+ readOnlyPaths: [...this._nativeSandboxConfig.readOnlyPaths ?? []],
4139
+ denyWritePaths: [...this._initialDenyWritePaths]
4133
4140
  },
4134
4141
  ...this._instructionsOverride !== void 0 && { instructions: this._instructionsOverride },
4135
4142
  ...(options.checkpointName ?? this._checkpointName) !== void 0 && { checkpointName: options.checkpointName ?? this._checkpointName },
@@ -4367,7 +4374,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4367
4374
  isolationConfig: this.isolation !== "none" ? {
4368
4375
  allowNetwork: this._nativeSandboxConfig.allowNetwork ?? false,
4369
4376
  readOnlyPaths: this._nativeSandboxConfig.readOnlyPaths,
4370
- readWritePaths: this._nativeSandboxConfig.readWritePaths
4377
+ readWritePaths: this._nativeSandboxConfig.readWritePaths,
4378
+ denyWritePaths: this._nativeSandboxConfig.denyWritePaths
4371
4379
  } : void 0
4372
4380
  }
4373
4381
  };
@@ -4438,7 +4446,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4438
4446
  config
4439
4447
  });
4440
4448
  this._activeMountPaths.add(mountPath);
4441
- this.addMountPathToIsolation(mountPath, hostPath);
4449
+ const isolationError = this.addMountPathToIsolation(mountPath, hostPath, filesystem.readOnly === true);
4450
+ if (isolationError) return this.failMountIsolation(filesystem, mountPath, config, isolationError);
4442
4451
  return {
4443
4452
  success: true,
4444
4453
  mountPath
@@ -4549,7 +4558,8 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4549
4558
  });
4550
4559
  this._activeMountPaths.add(mountPath);
4551
4560
  await this.writeMarkerFile(mountPath, hostPath);
4552
- this.addMountPathToIsolation(mountPath, hostPath);
4561
+ const isolationError = this.addMountPathToIsolation(mountPath, hostPath, filesystem.readOnly === true);
4562
+ if (isolationError) return this.failMountIsolation(filesystem, mountPath, config, isolationError);
4553
4563
  this.logger.debug("Mounted", {
4554
4564
  mountPath,
4555
4565
  hostPath
@@ -4662,53 +4672,91 @@ var LocalSandbox = class LocalSandbox extends MastraSandbox {
4662
4672
  }
4663
4673
  }
4664
4674
  /**
4665
- * Dynamically add a mount path to the sandbox isolation allowlist.
4675
+ * Dynamically add a mount path to the sandbox isolation config.
4666
4676
  *
4667
- * - Seatbelt: pushes to readWritePaths (wrapCommand reads config each call)
4668
- * - Bwrap: pushes to readWritePaths (buildBwrapCommand reads config each call)
4677
+ * Read-write mounts go to `readWritePaths`; mounts whose filesystem is
4678
+ * `readOnly` go to `denyWritePaths` so subprocesses can read but never write
4679
+ * them, matching what file tools enforce. Both backends read the config on
4680
+ * every wrapCommand() call, so the change takes effect immediately.
4669
4681
  *
4670
4682
  * Local mounts are symlinks under `workingDirectory`. Bubblewrap cannot
4671
4683
  * `--bind` a symlink (it fails with "Unable to mount source on destination"),
4672
4684
  * so we store the canonical path (`realpath`) of the mount point — the same
4673
4685
  * directory the symlink refers to.
4686
+ *
4687
+ * Returns an error when a read-only mount can't be resolved: a write denial on
4688
+ * the unresolved symlink wouldn't cover the directory writes actually land in.
4674
4689
  */
4675
- addMountPathToIsolation(mountPath, hostPath) {
4690
+ addMountPathToIsolation(mountPath, hostPath, readOnly) {
4676
4691
  if (this.isolation === "none") return;
4677
4692
  const normMount = normalizeMountPath(mountPath);
4678
- if (this._mountPathToIsolationPath.has(normMount)) return;
4693
+ const list = readOnly ? "denyWritePaths" : "readWritePaths";
4694
+ const existing = this._mountPathToIsolationPath.get(normMount);
4695
+ if (existing?.list === list) return;
4696
+ if (existing) this.removeMountIsolationForPath(normMount);
4679
4697
  let isolationPath = hostPath;
4680
4698
  try {
4681
4699
  isolationPath = (0, fs.realpathSync)(hostPath);
4682
- } catch {}
4683
- if (!this._nativeSandboxConfig.readWritePaths) this._nativeSandboxConfig = {
4700
+ } catch {
4701
+ if (readOnly) return `Cannot mount read-only filesystem at ${hostPath}: its source could not be resolved, so writes to it can't be denied to sandboxed commands.`;
4702
+ this.logger.warn("Could not resolve mount path for isolation; using unresolved path", { hostPath });
4703
+ }
4704
+ if (!this._nativeSandboxConfig[list]) this._nativeSandboxConfig = {
4684
4705
  ...this._nativeSandboxConfig,
4685
- readWritePaths: []
4706
+ [list]: []
4686
4707
  };
4687
- const paths = this._nativeSandboxConfig.readWritePaths;
4708
+ const paths = this._nativeSandboxConfig[list];
4688
4709
  if (!paths.includes(isolationPath)) paths.push(isolationPath);
4689
- if (!this._initialReadWritePaths.has(isolationPath)) this._mountIsolationRefCount.set(isolationPath, (this._mountIsolationRefCount.get(isolationPath) ?? 0) + 1);
4690
- this._mountPathToIsolationPath.set(normMount, isolationPath);
4710
+ if (!(readOnly ? this._initialDenyWritePaths : this._initialReadWritePaths).has(isolationPath)) {
4711
+ const key = `${list}:${isolationPath}`;
4712
+ this._mountIsolationRefCount.set(key, (this._mountIsolationRefCount.get(key) ?? 0) + 1);
4713
+ }
4714
+ this._mountPathToIsolationPath.set(normMount, {
4715
+ path: isolationPath,
4716
+ list
4717
+ });
4718
+ }
4719
+ /** Undo a mount whose isolation couldn't be applied and record it as failed. */
4720
+ async failMountIsolation(filesystem, mountPath, config, error) {
4721
+ this.logger.error("Could not apply mount isolation", {
4722
+ mountPath,
4723
+ error
4724
+ });
4725
+ await this.unmount(mountPath);
4726
+ this.mounts.set(mountPath, {
4727
+ filesystem,
4728
+ state: "error",
4729
+ config,
4730
+ error
4731
+ });
4732
+ return {
4733
+ success: false,
4734
+ mountPath,
4735
+ error
4736
+ };
4691
4737
  }
4692
4738
  /**
4693
- * Reverse {@link addMountPathToIsolation}: drop refcounted paths from the allowlist on unmount
4694
- * while preserving user-provided `readWritePaths` from construction.
4739
+ * Reverse {@link addMountPathToIsolation}: drop refcounted paths from the isolation
4740
+ * config on unmount while preserving user-provided paths from construction.
4695
4741
  */
4696
4742
  removeMountIsolationForPath(mountPath) {
4697
4743
  if (this.isolation === "none") return;
4698
4744
  const normMount = normalizeMountPath(mountPath);
4699
- const isolationPath = this._mountPathToIsolationPath.get(normMount);
4700
- if (isolationPath === void 0) return;
4745
+ const entry = this._mountPathToIsolationPath.get(normMount);
4746
+ if (entry === void 0) return;
4701
4747
  this._mountPathToIsolationPath.delete(normMount);
4702
- if (this._initialReadWritePaths.has(isolationPath)) return;
4703
- const next = (this._mountIsolationRefCount.get(isolationPath) ?? 0) - 1;
4748
+ const { path: isolationPath, list } = entry;
4749
+ if ((list === "denyWritePaths" ? this._initialDenyWritePaths : this._initialReadWritePaths).has(isolationPath)) return;
4750
+ const key = `${list}:${isolationPath}`;
4751
+ const next = (this._mountIsolationRefCount.get(key) ?? 0) - 1;
4704
4752
  if (next <= 0) {
4705
- this._mountIsolationRefCount.delete(isolationPath);
4706
- const paths = this._nativeSandboxConfig.readWritePaths;
4753
+ this._mountIsolationRefCount.delete(key);
4754
+ const paths = this._nativeSandboxConfig[list];
4707
4755
  if (paths) {
4708
4756
  const idx = paths.indexOf(isolationPath);
4709
4757
  if (idx !== -1) paths.splice(idx, 1);
4710
4758
  }
4711
- } else this._mountIsolationRefCount.set(isolationPath, next);
4759
+ } else this._mountIsolationRefCount.set(key, next);
4712
4760
  }
4713
4761
  /**
4714
4762
  * Resolve a virtual mount path to a host filesystem path.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "1.86.0-alpha.8",
3
+ "version": "1.86.0-alpha.9",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -968,12 +968,12 @@
968
968
  "zod-v3": "npm:zod@3.25.76",
969
969
  "@internal/ai-sdk-v4": "0.0.98",
970
970
  "@internal/ai-sdk-v5": "0.0.98",
971
- "@internal/ai-v7": "0.0.98",
972
971
  "@internal/ai-v6": "0.0.98",
972
+ "@internal/ai-v7": "0.0.98",
973
973
  "@internal/auth": "0.0.39",
974
974
  "@internal/core": "0.1.4",
975
- "@internal/deployer": "0.0.4",
976
975
  "@internal/external-types": "0.0.101",
976
+ "@internal/deployer": "0.0.4",
977
977
  "@internal/lint": "0.0.151",
978
978
  "@internal/llm-recorder": "0.0.87",
979
979
  "@internal/test-utils": "0.0.87",