@mastra/core 1.2.1-alpha.0 → 1.3.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 (403) hide show
  1. package/CHANGELOG.md +341 -0
  2. package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +2093 -262
  3. package/dist/agent/agent-legacy.d.ts.map +1 -1
  4. package/dist/agent/agent.d.ts +12 -3
  5. package/dist/agent/agent.d.ts.map +1 -1
  6. package/dist/agent/index.cjs +13 -13
  7. package/dist/agent/index.js +2 -2
  8. package/dist/agent/message-list/index.cjs +18 -18
  9. package/dist/agent/message-list/index.js +1 -1
  10. package/dist/agent/message-list/message-list.d.ts.map +1 -1
  11. package/dist/agent/types.d.ts +6 -1
  12. package/dist/agent/types.d.ts.map +1 -1
  13. package/dist/agent/workflows/prepare-stream/index.d.ts +3 -1
  14. package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
  15. package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
  16. package/dist/agent/workflows/prepare-stream/stream-step.d.ts +3 -1
  17. package/dist/agent/workflows/prepare-stream/stream-step.d.ts.map +1 -1
  18. package/dist/base.cjs +2 -2
  19. package/dist/base.d.ts +13 -1
  20. package/dist/base.d.ts.map +1 -1
  21. package/dist/base.js +1 -1
  22. package/dist/bundler/index.cjs +2 -2
  23. package/dist/bundler/index.js +1 -1
  24. package/dist/cache/index.cjs +3 -3
  25. package/dist/cache/index.js +1 -1
  26. package/dist/{chunk-ENCTSDWC.js → chunk-2GWTJFVM.js} +2410 -1402
  27. package/dist/chunk-2GWTJFVM.js.map +1 -0
  28. package/dist/{chunk-OB4V67IX.cjs → chunk-2K5PNW2U.cjs} +4 -4
  29. package/dist/{chunk-OB4V67IX.cjs.map → chunk-2K5PNW2U.cjs.map} +1 -1
  30. package/dist/{chunk-VZXYBFCX.cjs → chunk-2P6DD7M5.cjs} +10 -10
  31. package/dist/{chunk-VZXYBFCX.cjs.map → chunk-2P6DD7M5.cjs.map} +1 -1
  32. package/dist/{chunk-Q2D7LERO.cjs → chunk-2VD5OGOT.cjs} +4 -4
  33. package/dist/{chunk-Q2D7LERO.cjs.map → chunk-2VD5OGOT.cjs.map} +1 -1
  34. package/dist/{chunk-2DMSFLJY.cjs → chunk-6TZKQI4R.cjs} +8 -8
  35. package/dist/chunk-6TZKQI4R.cjs.map +1 -0
  36. package/dist/{chunk-4NG7CKEG.js → chunk-6VGCVSP4.js} +3 -3
  37. package/dist/{chunk-4NG7CKEG.js.map → chunk-6VGCVSP4.js.map} +1 -1
  38. package/dist/{chunk-IIZF4W7B.cjs → chunk-7UWHFWST.cjs} +52 -5
  39. package/dist/chunk-7UWHFWST.cjs.map +1 -0
  40. package/dist/{chunk-VW7YQWDW.cjs → chunk-BFIOQFGF.cjs} +28 -2
  41. package/dist/chunk-BFIOQFGF.cjs.map +1 -0
  42. package/dist/{chunk-E3VFKTIA.js → chunk-BXLLXTT4.js} +2245 -179
  43. package/dist/chunk-BXLLXTT4.js.map +1 -0
  44. package/dist/{chunk-HMCXNOF6.cjs → chunk-CGPH7CMG.cjs} +2431 -1417
  45. package/dist/chunk-CGPH7CMG.cjs.map +1 -0
  46. package/dist/{chunk-GVLPTDJA.cjs → chunk-D5JZT6EK.cjs} +236 -63
  47. package/dist/chunk-D5JZT6EK.cjs.map +1 -0
  48. package/dist/{chunk-5SOS47PH.cjs → chunk-FLHFB23E.cjs} +454 -222
  49. package/dist/chunk-FLHFB23E.cjs.map +1 -0
  50. package/dist/{chunk-XCPEEIHI.cjs → chunk-GCTAD6B7.cjs} +3012 -927
  51. package/dist/chunk-GCTAD6B7.cjs.map +1 -0
  52. package/dist/{chunk-W3AQUG66.js → chunk-GIY5BINT.js} +4 -4
  53. package/dist/{chunk-W3AQUG66.js.map → chunk-GIY5BINT.js.map} +1 -1
  54. package/dist/{chunk-M6VFJX5A.js → chunk-GMSAGYTB.js} +3 -3
  55. package/dist/{chunk-M6VFJX5A.js.map → chunk-GMSAGYTB.js.map} +1 -1
  56. package/dist/{chunk-JRJJ5VQE.cjs → chunk-GZD6443M.cjs} +99 -55
  57. package/dist/chunk-GZD6443M.cjs.map +1 -0
  58. package/dist/{chunk-Z6NRYYOH.js → chunk-ILQXPZCD.js} +9 -4
  59. package/dist/chunk-ILQXPZCD.js.map +1 -0
  60. package/dist/{chunk-5YVR7B4R.js → chunk-JQNREL64.js} +29 -9
  61. package/dist/chunk-JQNREL64.js.map +1 -0
  62. package/dist/{chunk-QOFI2WBM.cjs → chunk-JU6K7UDX.cjs} +991 -229
  63. package/dist/chunk-JU6K7UDX.cjs.map +1 -0
  64. package/dist/{chunk-HN2MSTR6.cjs → chunk-KAJNBNWP.cjs} +283 -38
  65. package/dist/chunk-KAJNBNWP.cjs.map +1 -0
  66. package/dist/{chunk-MSWXEOZC.js → chunk-KL2JPSRX.js} +5 -5
  67. package/dist/chunk-KL2JPSRX.js.map +1 -0
  68. package/dist/{chunk-MQB7XFXP.js → chunk-LHRHOPUC.js} +3 -3
  69. package/dist/{chunk-MQB7XFXP.js.map → chunk-LHRHOPUC.js.map} +1 -1
  70. package/dist/{chunk-VX7UA3SO.js → chunk-MOOJ3H3C.js} +974 -217
  71. package/dist/chunk-MOOJ3H3C.js.map +1 -0
  72. package/dist/{chunk-HU2ONA2W.cjs → chunk-ON2KVIUJ.cjs} +17 -17
  73. package/dist/{chunk-HU2ONA2W.cjs.map → chunk-ON2KVIUJ.cjs.map} +1 -1
  74. package/dist/{chunk-I66TMZJ3.cjs → chunk-OOCEAC6U.cjs} +21 -18
  75. package/dist/chunk-OOCEAC6U.cjs.map +1 -0
  76. package/dist/{chunk-MNWW2R3U.js → chunk-OV7OOUUR.js} +90 -54
  77. package/dist/chunk-OV7OOUUR.js.map +1 -0
  78. package/dist/{chunk-C4WWWQHT.cjs → chunk-RO47SMI7.cjs} +23 -3
  79. package/dist/chunk-RO47SMI7.cjs.map +1 -0
  80. package/dist/{chunk-6FG6FU5Y.cjs → chunk-RQ56ZSIR.cjs} +4 -4
  81. package/dist/{chunk-6FG6FU5Y.cjs.map → chunk-RQ56ZSIR.cjs.map} +1 -1
  82. package/dist/{chunk-IW3BNL7A.js → chunk-RS6CZXGA.js} +50 -3
  83. package/dist/chunk-RS6CZXGA.js.map +1 -0
  84. package/dist/{chunk-AIJLACR2.js → chunk-S53FKKVL.js} +27 -3
  85. package/dist/chunk-S53FKKVL.js.map +1 -0
  86. package/dist/{chunk-G6E3QNJC.js → chunk-SBPPGJL6.js} +4078 -4333
  87. package/dist/chunk-SBPPGJL6.js.map +1 -0
  88. package/dist/{chunk-UZL4H5P2.cjs → chunk-SH4PCZ3X.cjs} +5375 -5648
  89. package/dist/chunk-SH4PCZ3X.cjs.map +1 -0
  90. package/dist/{chunk-ZWM2CAIM.js → chunk-STKNQDVA.js} +4 -4
  91. package/dist/{chunk-ZWM2CAIM.js.map → chunk-STKNQDVA.js.map} +1 -1
  92. package/dist/{chunk-A5QFWX67.cjs → chunk-U2CABSMC.cjs} +79 -59
  93. package/dist/chunk-U2CABSMC.cjs.map +1 -0
  94. package/dist/{chunk-7MDVYPWX.cjs → chunk-UE2G2LRP.cjs} +9 -4
  95. package/dist/chunk-UE2G2LRP.cjs.map +1 -0
  96. package/dist/{chunk-AUF6U2BL.js → chunk-VM25PDSW.js} +5 -5
  97. package/dist/{chunk-AUF6U2BL.js.map → chunk-VM25PDSW.js.map} +1 -1
  98. package/dist/{chunk-RXD5EGQF.js → chunk-VVD56FI4.js} +228 -55
  99. package/dist/chunk-VVD56FI4.js.map +1 -0
  100. package/dist/{chunk-JIT2OY3X.js → chunk-WCAFTXGK.js} +23 -3
  101. package/dist/chunk-WCAFTXGK.js.map +1 -0
  102. package/dist/{chunk-P62OJXQ4.js → chunk-WL3AW3YA.js} +282 -37
  103. package/dist/chunk-WL3AW3YA.js.map +1 -0
  104. package/dist/{chunk-YLODOPYM.cjs → chunk-XDD5V446.cjs} +4163 -5352
  105. package/dist/chunk-XDD5V446.cjs.map +1 -0
  106. package/dist/{chunk-B4M33FCS.cjs → chunk-XQVYEOI7.cjs} +7 -7
  107. package/dist/{chunk-B4M33FCS.cjs.map → chunk-XQVYEOI7.cjs.map} +1 -1
  108. package/dist/{chunk-BP2TSCBW.js → chunk-ZATLLPIH.js} +4391 -5561
  109. package/dist/chunk-ZATLLPIH.js.map +1 -0
  110. package/dist/{chunk-T6PRRKMW.js → chunk-ZHFM7HCQ.js} +9 -6
  111. package/dist/chunk-ZHFM7HCQ.js.map +1 -0
  112. package/dist/{chunk-WFUNLRQX.js → chunk-ZRUTE56J.js} +366 -134
  113. package/dist/chunk-ZRUTE56J.js.map +1 -0
  114. package/dist/deployer/index.cjs +2 -2
  115. package/dist/deployer/index.js +1 -1
  116. package/dist/docs/SKILL.md +2 -9
  117. package/dist/docs/assets/SOURCE_MAP.json +399 -342
  118. package/dist/docs/references/docs-agents-agent-memory.md +45 -1
  119. package/dist/docs/references/docs-agents-network-approval.md +1 -1
  120. package/dist/docs/references/docs-agents-networks.md +3 -3
  121. package/dist/docs/references/docs-agents-overview.md +8 -0
  122. package/dist/docs/references/docs-agents-using-tools.md +82 -72
  123. package/dist/docs/references/docs-memory-observational-memory.md +11 -8
  124. package/dist/docs/references/docs-observability-overview.md +1 -1
  125. package/dist/docs/references/docs-observability-tracing-exporters-langsmith.md +70 -0
  126. package/dist/docs/references/docs-observability-tracing-overview.md +1 -1
  127. package/dist/docs/references/docs-server-middleware.md +0 -2
  128. package/dist/docs/references/docs-server-request-context.md +17 -0
  129. package/dist/docs/references/docs-workflows-agents-and-tools.md +2 -2
  130. package/dist/docs/references/docs-workflows-overview.md +1 -1
  131. package/dist/docs/references/docs-workspace-filesystem.md +2 -0
  132. package/dist/docs/references/docs-workspace-overview.md +3 -1
  133. package/dist/docs/references/docs-workspace-sandbox.md +2 -0
  134. package/dist/docs/references/docs-workspace-search.md +2 -0
  135. package/dist/docs/references/docs-workspace-skills.md +3 -1
  136. package/dist/docs/references/reference-agents-getTools.md +1 -6
  137. package/dist/docs/references/reference-agents-listAgents.md +1 -1
  138. package/dist/docs/references/reference-agents-network.md +0 -2
  139. package/dist/docs/references/reference-cli-mastra.md +29 -4
  140. package/dist/docs/references/reference-client-js-agents.md +1 -1
  141. package/dist/docs/references/reference-configuration.md +1 -1
  142. package/dist/docs/references/reference-core-getStoredAgentById.md +2 -2
  143. package/dist/docs/references/reference-core-listStoredAgents.md +1 -1
  144. package/dist/docs/references/reference-memory-observational-memory.md +2 -0
  145. package/dist/docs/references/reference-tools-mcp-client.md +0 -2
  146. package/dist/docs/references/reference-workflows-step.md +2 -0
  147. package/dist/docs/references/reference-workflows-workflow-methods-map.md +2 -2
  148. package/dist/docs/references/reference-workspace-filesystem.md +2 -0
  149. package/dist/docs/references/reference-workspace-local-filesystem.md +2 -0
  150. package/dist/docs/references/reference-workspace-local-sandbox.md +2 -0
  151. package/dist/docs/references/reference-workspace-sandbox.md +2 -0
  152. package/dist/docs/references/reference-workspace-workspace-class.md +2 -0
  153. package/dist/docs/references/reference.md +7 -2
  154. package/dist/editor/index.d.ts +1 -1
  155. package/dist/editor/index.d.ts.map +1 -1
  156. package/dist/editor/types.d.ts +53 -48
  157. package/dist/editor/types.d.ts.map +1 -1
  158. package/dist/evals/base.d.ts +15 -0
  159. package/dist/evals/base.d.ts.map +1 -1
  160. package/dist/evals/index.cjs +20 -20
  161. package/dist/evals/index.js +3 -3
  162. package/dist/evals/run/index.d.ts +3 -3
  163. package/dist/evals/run/index.d.ts.map +1 -1
  164. package/dist/evals/scoreTraces/index.cjs +5 -5
  165. package/dist/evals/scoreTraces/index.js +2 -2
  166. package/dist/features/index.cjs +1 -1
  167. package/dist/features/index.cjs.map +1 -1
  168. package/dist/features/index.d.ts.map +1 -1
  169. package/dist/features/index.js +1 -1
  170. package/dist/features/index.js.map +1 -1
  171. package/dist/index.cjs +4 -4
  172. package/dist/index.d.ts +3 -3
  173. package/dist/index.d.ts.map +1 -1
  174. package/dist/index.js +2 -2
  175. package/dist/integration/index.cjs +2 -2
  176. package/dist/integration/index.js +1 -1
  177. package/dist/llm/index.cjs +16 -16
  178. package/dist/llm/index.js +5 -5
  179. package/dist/llm/model/gateways/constants.d.ts.map +1 -1
  180. package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
  181. package/dist/llm/model/model.loop.d.ts +1 -1
  182. package/dist/llm/model/model.loop.d.ts.map +1 -1
  183. package/dist/llm/model/provider-types.generated.d.ts +128 -10
  184. package/dist/llm/model/resolve-model.d.ts.map +1 -1
  185. package/dist/loop/index.cjs +12 -12
  186. package/dist/loop/index.js +1 -1
  187. package/dist/loop/network/index.d.ts +3 -3
  188. package/dist/loop/network/index.d.ts.map +1 -1
  189. package/dist/loop/network/run-command-tool.d.ts +1 -1
  190. package/dist/loop/types.d.ts +13 -0
  191. package/dist/loop/types.d.ts.map +1 -1
  192. package/dist/loop/workflows/agentic-execution/index.d.ts +9 -9
  193. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +7 -7
  194. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
  195. package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +3 -3
  196. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
  197. package/dist/loop/workflows/agentic-loop/index.d.ts +9 -9
  198. package/dist/loop/workflows/schema.d.ts +12 -12
  199. package/dist/mastra/index.cjs +2 -2
  200. package/dist/mastra/index.d.ts +91 -5
  201. package/dist/mastra/index.d.ts.map +1 -1
  202. package/dist/mastra/index.js +1 -1
  203. package/dist/mcp/index.cjs +2 -2
  204. package/dist/mcp/index.js +1 -1
  205. package/dist/memory/index.cjs +14 -14
  206. package/dist/memory/index.js +1 -1
  207. package/dist/memory/mock.d.ts.map +1 -1
  208. package/dist/memory/types.d.ts +128 -0
  209. package/dist/memory/types.d.ts.map +1 -1
  210. package/dist/models-dev-FQVUTQ7L.js +3 -0
  211. package/dist/{models-dev-Z45JSLWD.js.map → models-dev-FQVUTQ7L.js.map} +1 -1
  212. package/dist/models-dev-PPIXUUCU.cjs +12 -0
  213. package/dist/{models-dev-OQKVMEIT.cjs.map → models-dev-PPIXUUCU.cjs.map} +1 -1
  214. package/dist/netlify-4RIKF7Y3.js +3 -0
  215. package/dist/{netlify-SSWMYSAX.js.map → netlify-4RIKF7Y3.js.map} +1 -1
  216. package/dist/netlify-V5F7JEJH.cjs +12 -0
  217. package/dist/{netlify-TXZZCT6N.cjs.map → netlify-V5F7JEJH.cjs.map} +1 -1
  218. package/dist/processors/index.cjs +41 -41
  219. package/dist/processors/index.js +1 -1
  220. package/dist/processors/step-schema.d.ts +44 -44
  221. package/dist/provider-registry-C6XCYX44.cjs +40 -0
  222. package/dist/{provider-registry-NR7FXV2Q.cjs.map → provider-registry-C6XCYX44.cjs.map} +1 -1
  223. package/dist/provider-registry-NWU4YFQW.js +3 -0
  224. package/dist/{provider-registry-RPOTQNHI.js.map → provider-registry-NWU4YFQW.js.map} +1 -1
  225. package/dist/provider-registry.json +278 -33
  226. package/dist/relevance/index.cjs +3 -3
  227. package/dist/relevance/index.js +1 -1
  228. package/dist/server/index.cjs +3 -3
  229. package/dist/server/index.js +1 -1
  230. package/dist/storage/base.d.ts +3 -1
  231. package/dist/storage/base.d.ts.map +1 -1
  232. package/dist/storage/constants.cjs +51 -19
  233. package/dist/storage/constants.d.ts +10 -2
  234. package/dist/storage/constants.d.ts.map +1 -1
  235. package/dist/storage/constants.js +1 -1
  236. package/dist/storage/domains/agents/base.d.ts +13 -164
  237. package/dist/storage/domains/agents/base.d.ts.map +1 -1
  238. package/dist/storage/domains/agents/index.d.ts +0 -1
  239. package/dist/storage/domains/agents/index.d.ts.map +1 -1
  240. package/dist/storage/domains/agents/inmemory.d.ts +6 -10
  241. package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
  242. package/dist/storage/domains/index.d.ts +3 -0
  243. package/dist/storage/domains/index.d.ts.map +1 -1
  244. package/dist/storage/domains/inmemory-db.d.ts +7 -1
  245. package/dist/storage/domains/inmemory-db.d.ts.map +1 -1
  246. package/dist/storage/domains/memory/base.d.ts +45 -5
  247. package/dist/storage/domains/memory/base.d.ts.map +1 -1
  248. package/dist/storage/domains/memory/inmemory.d.ts +7 -7
  249. package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
  250. package/dist/storage/domains/observability/types.d.ts +62 -62
  251. package/dist/storage/domains/operations/inmemory.d.ts.map +1 -1
  252. package/dist/storage/domains/prompt-blocks/base.d.ts +47 -0
  253. package/dist/storage/domains/prompt-blocks/base.d.ts.map +1 -0
  254. package/dist/storage/domains/prompt-blocks/index.d.ts +3 -0
  255. package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -0
  256. package/dist/storage/domains/prompt-blocks/inmemory.d.ts +31 -0
  257. package/dist/storage/domains/prompt-blocks/inmemory.d.ts.map +1 -0
  258. package/dist/storage/domains/scorer-definitions/base.d.ts +47 -0
  259. package/dist/storage/domains/scorer-definitions/base.d.ts.map +1 -0
  260. package/dist/storage/domains/scorer-definitions/index.d.ts +3 -0
  261. package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -0
  262. package/dist/storage/domains/scorer-definitions/inmemory.d.ts +31 -0
  263. package/dist/storage/domains/scorer-definitions/inmemory.d.ts.map +1 -0
  264. package/dist/storage/domains/versioned.d.ts +136 -0
  265. package/dist/storage/domains/versioned.d.ts.map +1 -0
  266. package/dist/storage/index.cjs +156 -104
  267. package/dist/storage/index.js +2 -2
  268. package/dist/storage/mock.d.ts.map +1 -1
  269. package/dist/storage/types.d.ts +481 -27
  270. package/dist/storage/types.d.ts.map +1 -1
  271. package/dist/stream/MastraAgentNetworkStream.d.ts +1 -1
  272. package/dist/stream/MastraWorkflowStream.d.ts +1 -1
  273. package/dist/stream/RunOutput.d.ts +1 -1
  274. package/dist/stream/RunOutput.d.ts.map +1 -1
  275. package/dist/stream/base/output.d.ts +4 -0
  276. package/dist/stream/base/output.d.ts.map +1 -1
  277. package/dist/stream/index.cjs +11 -11
  278. package/dist/stream/index.js +2 -2
  279. package/dist/test-utils/llm-mock.cjs +4 -4
  280. package/dist/test-utils/llm-mock.js +1 -1
  281. package/dist/tool-loop-agent/index.cjs +4 -4
  282. package/dist/tool-loop-agent/index.js +1 -1
  283. package/dist/tools/index.cjs +4 -4
  284. package/dist/tools/index.js +1 -1
  285. package/dist/tools/is-vercel-tool.cjs +2 -2
  286. package/dist/tools/is-vercel-tool.js +1 -1
  287. package/dist/tools/tool-builder/builder.d.ts.map +1 -1
  288. package/dist/tools/types.d.ts +15 -0
  289. package/dist/tools/types.d.ts.map +1 -1
  290. package/dist/tools/validation.d.ts.map +1 -1
  291. package/dist/tts/index.cjs +2 -2
  292. package/dist/tts/index.js +1 -1
  293. package/dist/types/zod-compat.d.ts +2 -2
  294. package/dist/types/zod-compat.d.ts.map +1 -1
  295. package/dist/utils/zod-utils.d.ts +19 -0
  296. package/dist/utils/zod-utils.d.ts.map +1 -1
  297. package/dist/utils.cjs +28 -28
  298. package/dist/utils.d.ts +7 -1
  299. package/dist/utils.d.ts.map +1 -1
  300. package/dist/utils.js +2 -2
  301. package/dist/vector/index.cjs +9 -9
  302. package/dist/vector/index.js +2 -2
  303. package/dist/voice/index.cjs +6 -6
  304. package/dist/voice/index.js +1 -1
  305. package/dist/workflows/evented/index.cjs +10 -10
  306. package/dist/workflows/evented/index.js +1 -1
  307. package/dist/workflows/evented/step-executor.d.ts.map +1 -1
  308. package/dist/workflows/evented/workflow.d.ts +3 -1
  309. package/dist/workflows/evented/workflow.d.ts.map +1 -1
  310. package/dist/workflows/execution-engine.d.ts.map +1 -1
  311. package/dist/workflows/index.cjs +25 -25
  312. package/dist/workflows/index.js +1 -1
  313. package/dist/workflows/step.d.ts +4 -3
  314. package/dist/workflows/step.d.ts.map +1 -1
  315. package/dist/workflows/types.d.ts +2 -1
  316. package/dist/workflows/types.d.ts.map +1 -1
  317. package/dist/workflows/workflow.d.ts +12 -4
  318. package/dist/workflows/workflow.d.ts.map +1 -1
  319. package/dist/workspace/errors.d.ts +6 -0
  320. package/dist/workspace/errors.d.ts.map +1 -1
  321. package/dist/workspace/filesystem/composite-filesystem.d.ts +93 -0
  322. package/dist/workspace/filesystem/composite-filesystem.d.ts.map +1 -0
  323. package/dist/workspace/filesystem/filesystem.d.ts +35 -0
  324. package/dist/workspace/filesystem/filesystem.d.ts.map +1 -1
  325. package/dist/workspace/filesystem/index.d.ts +2 -0
  326. package/dist/workspace/filesystem/index.d.ts.map +1 -1
  327. package/dist/workspace/filesystem/local-filesystem.d.ts +9 -1
  328. package/dist/workspace/filesystem/local-filesystem.d.ts.map +1 -1
  329. package/dist/workspace/filesystem/mastra-filesystem.d.ts +92 -3
  330. package/dist/workspace/filesystem/mastra-filesystem.d.ts.map +1 -1
  331. package/dist/workspace/filesystem/mount.d.ts +34 -0
  332. package/dist/workspace/filesystem/mount.d.ts.map +1 -0
  333. package/dist/workspace/index.cjs +62 -34
  334. package/dist/workspace/index.d.ts +6 -2
  335. package/dist/workspace/index.d.ts.map +1 -1
  336. package/dist/workspace/index.js +1 -1
  337. package/dist/workspace/lifecycle.d.ts +29 -0
  338. package/dist/workspace/lifecycle.d.ts.map +1 -1
  339. package/dist/workspace/sandbox/errors.d.ts +50 -0
  340. package/dist/workspace/sandbox/errors.d.ts.map +1 -0
  341. package/dist/workspace/sandbox/index.d.ts +3 -0
  342. package/dist/workspace/sandbox/index.d.ts.map +1 -1
  343. package/dist/workspace/sandbox/local-sandbox.d.ts +17 -2
  344. package/dist/workspace/sandbox/local-sandbox.d.ts.map +1 -1
  345. package/dist/workspace/sandbox/mastra-sandbox.d.ts +153 -6
  346. package/dist/workspace/sandbox/mastra-sandbox.d.ts.map +1 -1
  347. package/dist/workspace/sandbox/mount-manager.d.ts +195 -0
  348. package/dist/workspace/sandbox/mount-manager.d.ts.map +1 -0
  349. package/dist/workspace/sandbox/sandbox.d.ts +37 -84
  350. package/dist/workspace/sandbox/sandbox.d.ts.map +1 -1
  351. package/dist/workspace/sandbox/types.d.ts +92 -0
  352. package/dist/workspace/sandbox/types.d.ts.map +1 -0
  353. package/dist/workspace/tools/tools.d.ts.map +1 -1
  354. package/dist/workspace/tools/tree-formatter.d.ts.map +1 -1
  355. package/dist/workspace/workspace.d.ts +73 -3
  356. package/dist/workspace/workspace.d.ts.map +1 -1
  357. package/package.json +16 -16
  358. package/src/llm/model/provider-types.generated.d.ts +128 -10
  359. package/dist/chunk-2DMSFLJY.cjs.map +0 -1
  360. package/dist/chunk-5SOS47PH.cjs.map +0 -1
  361. package/dist/chunk-5YVR7B4R.js.map +0 -1
  362. package/dist/chunk-7MDVYPWX.cjs.map +0 -1
  363. package/dist/chunk-A5QFWX67.cjs.map +0 -1
  364. package/dist/chunk-AIJLACR2.js.map +0 -1
  365. package/dist/chunk-BP2TSCBW.js.map +0 -1
  366. package/dist/chunk-C4WWWQHT.cjs.map +0 -1
  367. package/dist/chunk-E3VFKTIA.js.map +0 -1
  368. package/dist/chunk-ENCTSDWC.js.map +0 -1
  369. package/dist/chunk-G6E3QNJC.js.map +0 -1
  370. package/dist/chunk-GVLPTDJA.cjs.map +0 -1
  371. package/dist/chunk-HMCXNOF6.cjs.map +0 -1
  372. package/dist/chunk-HN2MSTR6.cjs.map +0 -1
  373. package/dist/chunk-I66TMZJ3.cjs.map +0 -1
  374. package/dist/chunk-IIZF4W7B.cjs.map +0 -1
  375. package/dist/chunk-IW3BNL7A.js.map +0 -1
  376. package/dist/chunk-JIT2OY3X.js.map +0 -1
  377. package/dist/chunk-JRJJ5VQE.cjs.map +0 -1
  378. package/dist/chunk-MNWW2R3U.js.map +0 -1
  379. package/dist/chunk-MSWXEOZC.js.map +0 -1
  380. package/dist/chunk-P62OJXQ4.js.map +0 -1
  381. package/dist/chunk-QOFI2WBM.cjs.map +0 -1
  382. package/dist/chunk-RXD5EGQF.js.map +0 -1
  383. package/dist/chunk-T6PRRKMW.js.map +0 -1
  384. package/dist/chunk-UZL4H5P2.cjs.map +0 -1
  385. package/dist/chunk-VW7YQWDW.cjs.map +0 -1
  386. package/dist/chunk-VX7UA3SO.js.map +0 -1
  387. package/dist/chunk-WFUNLRQX.js.map +0 -1
  388. package/dist/chunk-XCPEEIHI.cjs.map +0 -1
  389. package/dist/chunk-YLODOPYM.cjs.map +0 -1
  390. package/dist/chunk-Z6NRYYOH.js.map +0 -1
  391. package/dist/docs/references/docs-tools-mcp-advanced-usage.md +0 -143
  392. package/dist/docs/references/docs-tools-mcp-mcp-overview.md +0 -383
  393. package/dist/docs/references/docs-tools-mcp-overview.md +0 -78
  394. package/dist/docs/references/docs-workflows-input-data-mapping.md +0 -102
  395. package/dist/docs/references/reference-deployer-netlify.md +0 -14
  396. package/dist/docs/references/reference-deployer-vercel.md +0 -39
  397. package/dist/docs/references/reference-tools-client.md +0 -228
  398. package/dist/models-dev-OQKVMEIT.cjs +0 -12
  399. package/dist/models-dev-Z45JSLWD.js +0 -3
  400. package/dist/netlify-SSWMYSAX.js +0 -3
  401. package/dist/netlify-TXZZCT6N.cjs +0 -12
  402. package/dist/provider-registry-NR7FXV2Q.cjs +0 -40
  403. package/dist/provider-registry-RPOTQNHI.js +0 -3
@@ -1,9 +1,21 @@
1
1
  /**
2
2
  * MastraFilesystem Base Class
3
3
  *
4
- * Abstract base class for filesystem providers that want automatic logger integration.
4
+ * Abstract base class for filesystem providers that want automatic logger integration
5
+ * and lifecycle management.
6
+ *
5
7
  * Extends MastraBase to receive the Mastra logger when registered with a Mastra instance.
6
8
  *
9
+ * ## Lifecycle Management
10
+ *
11
+ * The base class provides race-condition-safe lifecycle wrappers:
12
+ * - `_init()` - Handles concurrent calls, status management
13
+ * - `_destroy()` - Handles concurrent calls and status management
14
+ *
15
+ * Subclasses override the plain `init()` and `destroy()` methods to provide
16
+ * their implementation. Callers use the `_`-prefixed wrappers (or `callLifecycle()`)
17
+ * which add status tracking and race-condition safety.
18
+ *
7
19
  * External providers can extend this class to get logger support, or implement
8
20
  * the WorkspaceFilesystem interface directly if they don't need logging.
9
21
  */
@@ -11,7 +23,7 @@ import { MastraBase } from '../../base.js';
11
23
  import type { ProviderStatus } from '../lifecycle.js';
12
24
  import type { WorkspaceFilesystem, FileContent, FileStat, FileEntry, ReadOptions, WriteOptions, ListOptions, RemoveOptions, CopyOptions } from './filesystem.js';
13
25
  /**
14
- * Abstract base class for filesystem providers with logger support.
26
+ * Abstract base class for filesystem providers with logger support and lifecycle management.
15
27
  *
16
28
  * Providers that extend this class automatically receive the Mastra logger
17
29
  * when the filesystem is used with a Mastra instance.
@@ -22,13 +34,19 @@ import type { WorkspaceFilesystem, FileContent, FileStat, FileEntry, ReadOptions
22
34
  * readonly id = 'my-fs';
23
35
  * readonly name = 'MyCustomFilesystem';
24
36
  * readonly provider = 'custom';
25
- * status: ProviderStatus = 'stopped';
37
+ * status: ProviderStatus = 'pending';
26
38
  *
27
39
  * constructor() {
28
40
  * super({ name: 'MyCustomFilesystem' });
29
41
  * }
30
42
  *
43
+ * // Override init() to provide initialization logic
44
+ * async init(): Promise<void> {
45
+ * // Your initialization logic here
46
+ * }
47
+ *
31
48
  * async readFile(path: string): Promise<string | Buffer> {
49
+ * await this.ensureReady();
32
50
  * this.logger.debug('Reading file', { path });
33
51
  * // Implementation...
34
52
  * }
@@ -45,9 +63,80 @@ export declare abstract class MastraFilesystem extends MastraBase implements Wor
45
63
  abstract readonly provider: string;
46
64
  /** Current status of the filesystem */
47
65
  abstract status: ProviderStatus;
66
+ /** Error message when status is 'error' */
67
+ error?: string;
68
+ /** Promise for _init() to prevent race conditions from concurrent calls */
69
+ private _initPromise?;
70
+ /** Promise for _destroy() to prevent race conditions from concurrent calls */
71
+ private _destroyPromise?;
48
72
  constructor(options: {
49
73
  name: string;
50
74
  });
75
+ /**
76
+ * Initialize the filesystem (wrapper with status management and race-condition safety).
77
+ *
78
+ * This method is race-condition-safe - concurrent calls will return the same promise.
79
+ * Handles status management automatically.
80
+ *
81
+ * Subclasses override `init()` to provide their initialization logic.
82
+ */
83
+ _init(): Promise<void>;
84
+ /**
85
+ * Internal init execution - handles status.
86
+ */
87
+ private _executeInit;
88
+ /**
89
+ * Override this method to implement filesystem initialization logic.
90
+ *
91
+ * Called by `_init()` after status is set to 'initializing'.
92
+ * Status will be set to 'ready' on success, 'error' on failure.
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * async init(): Promise<void> {
97
+ * this._client = new StorageClient({ ... });
98
+ * await this._client.connect();
99
+ * }
100
+ * ```
101
+ */
102
+ init(): Promise<void>;
103
+ /**
104
+ * Ensure the filesystem is ready.
105
+ *
106
+ * Calls `_init()` if status is not 'ready'. Useful for lazy initialization
107
+ * where operations should automatically initialize the filesystem if needed.
108
+ *
109
+ * @throws {FilesystemNotReadyError} if the filesystem fails to reach 'ready' status
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * async readFile(path: string): Promise<string | Buffer> {
114
+ * await this.ensureReady();
115
+ * // Now safe to use the filesystem
116
+ * }
117
+ * ```
118
+ */
119
+ protected ensureReady(): Promise<void>;
120
+ /**
121
+ * Destroy the filesystem and clean up all resources (wrapper with status management).
122
+ *
123
+ * This method is race-condition-safe - concurrent calls will return the same promise.
124
+ * Handles status management.
125
+ *
126
+ * Subclasses override `destroy()` to provide their destroy logic.
127
+ */
128
+ _destroy(): Promise<void>;
129
+ /**
130
+ * Internal destroy execution - handles status.
131
+ */
132
+ private _executeDestroy;
133
+ /**
134
+ * Override this method to implement filesystem destroy logic.
135
+ *
136
+ * Called by `_destroy()` after status is set to 'destroying'.
137
+ * Status will be set to 'destroyed' on success, 'error' on failure.
138
+ */
139
+ destroy(): Promise<void>;
51
140
  abstract readFile(path: string, options?: ReadOptions): Promise<string | Buffer>;
52
141
  abstract writeFile(path: string, content: FileContent, options?: WriteOptions): Promise<void>;
53
142
  abstract appendFile(path: string, content: FileContent): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"mastra-filesystem.d.ts","sourceRoot":"","sources":["../../../src/workspace/filesystem/mastra-filesystem.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,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I,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IACzE,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAClF,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAClF,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAC9E,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IACpE,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAC3E,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAC/C,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAC/C"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Mount Types for Workspace Filesystems
3
+ *
4
+ * Base types for filesystem mounts. Provider-specific mount configs
5
+ * are defined in their respective packages (e.g., @mastra/s3, @mastra/e2b).
6
+ */
7
+ /**
8
+ * Base configuration for filesystem mounts.
9
+ * Extended by specific packages (e.g., @mastra/s3 defines S3MountConfig).
10
+ *
11
+ * Filesystem packages implement getMountConfig() returning their specific config.
12
+ * Sandbox packages define what mount configs they support.
13
+ */
14
+ export interface FilesystemMountConfig {
15
+ /** Mount type identifier (e.g., 's3', 'gcs', 'r2') */
16
+ type: string;
17
+ }
18
+ /**
19
+ * Result of a mount operation.
20
+ */
21
+ export interface MountResult {
22
+ /** Whether the mount was successful */
23
+ success: boolean;
24
+ /** Path where the filesystem was mounted */
25
+ mountPath: string;
26
+ /** Error message if mount failed */
27
+ error?: string;
28
+ }
29
+ /**
30
+ * Icon identifiers for filesystem providers.
31
+ * Used in UI to display appropriate icons.
32
+ */
33
+ export type FilesystemIcon = 's3' | 'aws-s3' | 'gcs' | 'google-cloud' | 'google-cloud-storage' | 'r2' | 'cloudflare' | 'cloudflare-r2' | 'azure' | 'azure-blob' | 'minio' | 'local' | 'folder' | 'database' | 'hard-drive' | 'cloud' | string;
34
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/workspace/filesystem/mount.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;CACd;AAMD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,IAAI,GACJ,QAAQ,GACR,KAAK,GACL,cAAc,GACd,sBAAsB,GACtB,IAAI,GACJ,YAAY,GACZ,eAAe,GACf,OAAO,GACP,YAAY,GACZ,OAAO,GACP,OAAO,GACP,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,OAAO,GACP,MAAM,CAAC"}
@@ -1,140 +1,168 @@
1
1
  'use strict';
2
2
 
3
- var chunkHMCXNOF6_cjs = require('../chunk-HMCXNOF6.cjs');
3
+ var chunkCGPH7CMG_cjs = require('../chunk-CGPH7CMG.cjs');
4
4
 
5
5
 
6
6
 
7
+ Object.defineProperty(exports, "CompositeFilesystem", {
8
+ enumerable: true,
9
+ get: function () { return chunkCGPH7CMG_cjs.CompositeFilesystem; }
10
+ });
7
11
  Object.defineProperty(exports, "DirectoryNotEmptyError", {
8
12
  enumerable: true,
9
- get: function () { return chunkHMCXNOF6_cjs.DirectoryNotEmptyError; }
13
+ get: function () { return chunkCGPH7CMG_cjs.DirectoryNotEmptyError; }
10
14
  });
11
15
  Object.defineProperty(exports, "DirectoryNotFoundError", {
12
16
  enumerable: true,
13
- get: function () { return chunkHMCXNOF6_cjs.DirectoryNotFoundError; }
17
+ get: function () { return chunkCGPH7CMG_cjs.DirectoryNotFoundError; }
14
18
  });
15
19
  Object.defineProperty(exports, "FileExistsError", {
16
20
  enumerable: true,
17
- get: function () { return chunkHMCXNOF6_cjs.FileExistsError; }
21
+ get: function () { return chunkCGPH7CMG_cjs.FileExistsError; }
18
22
  });
19
23
  Object.defineProperty(exports, "FileNotFoundError", {
20
24
  enumerable: true,
21
- get: function () { return chunkHMCXNOF6_cjs.FileNotFoundError; }
25
+ get: function () { return chunkCGPH7CMG_cjs.FileNotFoundError; }
22
26
  });
23
27
  Object.defineProperty(exports, "FileReadRequiredError", {
24
28
  enumerable: true,
25
- get: function () { return chunkHMCXNOF6_cjs.FileReadRequiredError; }
29
+ get: function () { return chunkCGPH7CMG_cjs.FileReadRequiredError; }
26
30
  });
27
31
  Object.defineProperty(exports, "FilesystemError", {
28
32
  enumerable: true,
29
- get: function () { return chunkHMCXNOF6_cjs.FilesystemError; }
33
+ get: function () { return chunkCGPH7CMG_cjs.FilesystemError; }
30
34
  });
31
35
  Object.defineProperty(exports, "FilesystemNotAvailableError", {
32
36
  enumerable: true,
33
- get: function () { return chunkHMCXNOF6_cjs.FilesystemNotAvailableError; }
37
+ get: function () { return chunkCGPH7CMG_cjs.FilesystemNotAvailableError; }
38
+ });
39
+ Object.defineProperty(exports, "FilesystemNotMountableError", {
40
+ enumerable: true,
41
+ get: function () { return chunkCGPH7CMG_cjs.FilesystemNotMountableError; }
42
+ });
43
+ Object.defineProperty(exports, "FilesystemNotReadyError", {
44
+ enumerable: true,
45
+ get: function () { return chunkCGPH7CMG_cjs.FilesystemNotReadyError; }
34
46
  });
35
47
  Object.defineProperty(exports, "IsDirectoryError", {
36
48
  enumerable: true,
37
- get: function () { return chunkHMCXNOF6_cjs.IsDirectoryError; }
49
+ get: function () { return chunkCGPH7CMG_cjs.IsDirectoryError; }
38
50
  });
39
51
  Object.defineProperty(exports, "IsolationUnavailableError", {
40
52
  enumerable: true,
41
- get: function () { return chunkHMCXNOF6_cjs.IsolationUnavailableError; }
53
+ get: function () { return chunkCGPH7CMG_cjs.IsolationUnavailableError; }
42
54
  });
43
55
  Object.defineProperty(exports, "LocalFilesystem", {
44
56
  enumerable: true,
45
- get: function () { return chunkHMCXNOF6_cjs.LocalFilesystem; }
57
+ get: function () { return chunkCGPH7CMG_cjs.LocalFilesystem; }
46
58
  });
47
59
  Object.defineProperty(exports, "LocalSandbox", {
48
60
  enumerable: true,
49
- get: function () { return chunkHMCXNOF6_cjs.LocalSandbox; }
61
+ get: function () { return chunkCGPH7CMG_cjs.LocalSandbox; }
50
62
  });
51
63
  Object.defineProperty(exports, "MastraFilesystem", {
52
64
  enumerable: true,
53
- get: function () { return chunkHMCXNOF6_cjs.MastraFilesystem; }
65
+ get: function () { return chunkCGPH7CMG_cjs.MastraFilesystem; }
54
66
  });
55
67
  Object.defineProperty(exports, "MastraSandbox", {
56
68
  enumerable: true,
57
- get: function () { return chunkHMCXNOF6_cjs.MastraSandbox; }
69
+ get: function () { return chunkCGPH7CMG_cjs.MastraSandbox; }
70
+ });
71
+ Object.defineProperty(exports, "MountError", {
72
+ enumerable: true,
73
+ get: function () { return chunkCGPH7CMG_cjs.MountError; }
74
+ });
75
+ Object.defineProperty(exports, "MountManager", {
76
+ enumerable: true,
77
+ get: function () { return chunkCGPH7CMG_cjs.MountManager; }
78
+ });
79
+ Object.defineProperty(exports, "MountNotSupportedError", {
80
+ enumerable: true,
81
+ get: function () { return chunkCGPH7CMG_cjs.MountNotSupportedError; }
58
82
  });
59
83
  Object.defineProperty(exports, "NotDirectoryError", {
60
84
  enumerable: true,
61
- get: function () { return chunkHMCXNOF6_cjs.NotDirectoryError; }
85
+ get: function () { return chunkCGPH7CMG_cjs.NotDirectoryError; }
62
86
  });
63
87
  Object.defineProperty(exports, "PermissionError", {
64
88
  enumerable: true,
65
- get: function () { return chunkHMCXNOF6_cjs.PermissionError; }
89
+ get: function () { return chunkCGPH7CMG_cjs.PermissionError; }
66
90
  });
67
91
  Object.defineProperty(exports, "SandboxError", {
68
92
  enumerable: true,
69
- get: function () { return chunkHMCXNOF6_cjs.SandboxError; }
93
+ get: function () { return chunkCGPH7CMG_cjs.SandboxError; }
70
94
  });
71
95
  Object.defineProperty(exports, "SandboxExecutionError", {
72
96
  enumerable: true,
73
- get: function () { return chunkHMCXNOF6_cjs.SandboxExecutionError; }
97
+ get: function () { return chunkCGPH7CMG_cjs.SandboxExecutionError; }
74
98
  });
75
99
  Object.defineProperty(exports, "SandboxFeatureNotSupportedError", {
76
100
  enumerable: true,
77
- get: function () { return chunkHMCXNOF6_cjs.SandboxFeatureNotSupportedError; }
101
+ get: function () { return chunkCGPH7CMG_cjs.SandboxFeatureNotSupportedError; }
78
102
  });
79
103
  Object.defineProperty(exports, "SandboxNotAvailableError", {
80
104
  enumerable: true,
81
- get: function () { return chunkHMCXNOF6_cjs.SandboxNotAvailableError; }
105
+ get: function () { return chunkCGPH7CMG_cjs.SandboxNotAvailableError; }
82
106
  });
83
107
  Object.defineProperty(exports, "SandboxNotReadyError", {
84
108
  enumerable: true,
85
- get: function () { return chunkHMCXNOF6_cjs.SandboxNotReadyError; }
109
+ get: function () { return chunkCGPH7CMG_cjs.SandboxNotReadyError; }
86
110
  });
87
111
  Object.defineProperty(exports, "SandboxTimeoutError", {
88
112
  enumerable: true,
89
- get: function () { return chunkHMCXNOF6_cjs.SandboxTimeoutError; }
113
+ get: function () { return chunkCGPH7CMG_cjs.SandboxTimeoutError; }
90
114
  });
91
115
  Object.defineProperty(exports, "SearchNotAvailableError", {
92
116
  enumerable: true,
93
- get: function () { return chunkHMCXNOF6_cjs.SearchNotAvailableError; }
117
+ get: function () { return chunkCGPH7CMG_cjs.SearchNotAvailableError; }
94
118
  });
95
119
  Object.defineProperty(exports, "WORKSPACE_TOOLS", {
96
120
  enumerable: true,
97
- get: function () { return chunkHMCXNOF6_cjs.WORKSPACE_TOOLS; }
121
+ get: function () { return chunkCGPH7CMG_cjs.WORKSPACE_TOOLS; }
98
122
  });
99
123
  Object.defineProperty(exports, "WORKSPACE_TOOLS_PREFIX", {
100
124
  enumerable: true,
101
- get: function () { return chunkHMCXNOF6_cjs.WORKSPACE_TOOLS_PREFIX; }
125
+ get: function () { return chunkCGPH7CMG_cjs.WORKSPACE_TOOLS_PREFIX; }
102
126
  });
103
127
  Object.defineProperty(exports, "Workspace", {
104
128
  enumerable: true,
105
- get: function () { return chunkHMCXNOF6_cjs.Workspace; }
129
+ get: function () { return chunkCGPH7CMG_cjs.Workspace; }
106
130
  });
107
131
  Object.defineProperty(exports, "WorkspaceError", {
108
132
  enumerable: true,
109
- get: function () { return chunkHMCXNOF6_cjs.WorkspaceError; }
133
+ get: function () { return chunkCGPH7CMG_cjs.WorkspaceError; }
110
134
  });
111
135
  Object.defineProperty(exports, "WorkspaceNotReadyError", {
112
136
  enumerable: true,
113
- get: function () { return chunkHMCXNOF6_cjs.WorkspaceNotReadyError; }
137
+ get: function () { return chunkCGPH7CMG_cjs.WorkspaceNotReadyError; }
114
138
  });
115
139
  Object.defineProperty(exports, "WorkspaceReadOnlyError", {
116
140
  enumerable: true,
117
- get: function () { return chunkHMCXNOF6_cjs.WorkspaceReadOnlyError; }
141
+ get: function () { return chunkCGPH7CMG_cjs.WorkspaceReadOnlyError; }
142
+ });
143
+ Object.defineProperty(exports, "callLifecycle", {
144
+ enumerable: true,
145
+ get: function () { return chunkCGPH7CMG_cjs.callLifecycle; }
118
146
  });
119
147
  Object.defineProperty(exports, "createWorkspaceTools", {
120
148
  enumerable: true,
121
- get: function () { return chunkHMCXNOF6_cjs.createWorkspaceTools; }
149
+ get: function () { return chunkCGPH7CMG_cjs.createWorkspaceTools; }
122
150
  });
123
151
  Object.defineProperty(exports, "detectIsolation", {
124
152
  enumerable: true,
125
- get: function () { return chunkHMCXNOF6_cjs.detectIsolation; }
153
+ get: function () { return chunkCGPH7CMG_cjs.detectIsolation; }
126
154
  });
127
155
  Object.defineProperty(exports, "getRecommendedIsolation", {
128
156
  enumerable: true,
129
- get: function () { return chunkHMCXNOF6_cjs.getRecommendedIsolation; }
157
+ get: function () { return chunkCGPH7CMG_cjs.getRecommendedIsolation; }
130
158
  });
131
159
  Object.defineProperty(exports, "isIsolationAvailable", {
132
160
  enumerable: true,
133
- get: function () { return chunkHMCXNOF6_cjs.isIsolationAvailable; }
161
+ get: function () { return chunkCGPH7CMG_cjs.isIsolationAvailable; }
134
162
  });
135
163
  Object.defineProperty(exports, "resolveToolConfig", {
136
164
  enumerable: true,
137
- get: function () { return chunkHMCXNOF6_cjs.resolveToolConfig; }
165
+ get: function () { return chunkCGPH7CMG_cjs.resolveToolConfig; }
138
166
  });
139
167
  //# sourceMappingURL=index.cjs.map
140
168
  //# sourceMappingURL=index.cjs.map
@@ -1,14 +1,18 @@
1
1
  export * from './workspace.js';
2
2
  export { LocalFilesystem, type LocalFilesystemOptions } from './filesystem/index.js';
3
+ export { CompositeFilesystem, type CompositeFilesystemConfig } from './filesystem/index.js';
3
4
  export { LocalSandbox, type LocalSandboxOptions } from './sandbox/index.js';
4
5
  export { MastraFilesystem } from './filesystem/index.js';
5
6
  export { MastraSandbox } from './sandbox/index.js';
6
7
  export * from './errors.js';
7
- export { SandboxError, SandboxExecutionError, SandboxTimeoutError, SandboxNotReadyError, IsolationUnavailableError, type SandboxOperation, } from './sandbox/index.js';
8
+ export { SandboxError, SandboxExecutionError, SandboxTimeoutError, SandboxNotReadyError, IsolationUnavailableError, MountError, MountNotSupportedError, FilesystemNotMountableError, type SandboxOperation, } from './sandbox/index.js';
8
9
  export { createWorkspaceTools, resolveToolConfig, type WorkspaceToolConfig, type WorkspaceToolsConfig } from './tools/index.js';
9
10
  export * from './lifecycle.js';
10
11
  export type { WorkspaceFilesystem, FileContent, FileStat, FileEntry, FilesystemInfo, ReadOptions, WriteOptions, ListOptions, RemoveOptions, CopyOptions, } from './filesystem/index.js';
11
- export type { WorkspaceSandbox, ExecutionResult, CommandResult, ExecuteCommandOptions, SandboxInfo } from './sandbox/index.js';
12
+ export type { FilesystemMountConfig, MountResult, FilesystemIcon } from './filesystem/index.js';
13
+ export { MountManager } from './sandbox/index.js';
14
+ export type { WorkspaceSandbox, ExecutionResult, CommandResult, ExecuteCommandOptions, SandboxInfo, SandboxLifecycleHook, MastraSandboxOptions, } from './sandbox/index.js';
15
+ export type { MountManagerConfig, MountFn, OnMountHook, OnMountArgs, OnMountResult } from './sandbox/index.js';
12
16
  export type { IsolationBackend, NativeSandboxConfig, SandboxDetectionResult } from './sandbox/index.js';
13
17
  export { detectIsolation, isIsolationAvailable, getRecommendedIsolation } from './sandbox/index.js';
14
18
  export { WORKSPACE_TOOLS_PREFIX, WORKSPACE_TOOLS, type WorkspaceToolName } from './constants/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,YAAY,EACZ,qBAAqB,EACr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 @@
1
- export { DirectoryNotEmptyError, DirectoryNotFoundError, FileExistsError, FileNotFoundError, FileReadRequiredError, FilesystemError, FilesystemNotAvailableError, IsDirectoryError, IsolationUnavailableError, LocalFilesystem, LocalSandbox, MastraFilesystem, MastraSandbox, NotDirectoryError, PermissionError, SandboxError, SandboxExecutionError, SandboxFeatureNotSupportedError, SandboxNotAvailableError, SandboxNotReadyError, SandboxTimeoutError, SearchNotAvailableError, WORKSPACE_TOOLS, WORKSPACE_TOOLS_PREFIX, Workspace, WorkspaceError, WorkspaceNotReadyError, WorkspaceReadOnlyError, createWorkspaceTools, detectIsolation, getRecommendedIsolation, isIsolationAvailable, resolveToolConfig } from '../chunk-ENCTSDWC.js';
1
+ export { CompositeFilesystem, DirectoryNotEmptyError, DirectoryNotFoundError, FileExistsError, FileNotFoundError, FileReadRequiredError, FilesystemError, FilesystemNotAvailableError, FilesystemNotMountableError, FilesystemNotReadyError, IsDirectoryError, IsolationUnavailableError, LocalFilesystem, LocalSandbox, MastraFilesystem, MastraSandbox, MountError, MountManager, MountNotSupportedError, NotDirectoryError, PermissionError, SandboxError, SandboxExecutionError, SandboxFeatureNotSupportedError, SandboxNotAvailableError, SandboxNotReadyError, SandboxTimeoutError, SearchNotAvailableError, WORKSPACE_TOOLS, WORKSPACE_TOOLS_PREFIX, Workspace, WorkspaceError, WorkspaceNotReadyError, WorkspaceReadOnlyError, callLifecycle, createWorkspaceTools, detectIsolation, getRecommendedIsolation, isIsolationAvailable, resolveToolConfig } from '../chunk-2GWTJFVM.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -36,6 +36,8 @@
36
36
  export interface Lifecycle<TInfo = unknown> {
37
37
  /** Current status */
38
38
  status: ProviderStatus;
39
+ /** Error message when status is 'error' */
40
+ error?: string;
39
41
  /**
40
42
  * One-time setup operations.
41
43
  *
@@ -103,4 +105,31 @@ export interface Lifecycle<TInfo = unknown> {
103
105
  * instances can use these states.
104
106
  */
105
107
  export type ProviderStatus = 'pending' | 'initializing' | 'ready' | 'starting' | 'running' | 'stopping' | 'stopped' | 'destroying' | 'destroyed' | 'error';
108
+ /**
109
+ * Provider that may have lifecycle methods.
110
+ * Used by `callLifecycle` to dispatch to the correct method.
111
+ */
112
+ interface LifecycleProvider {
113
+ _init?(): void | Promise<void>;
114
+ _start?(): void | Promise<void>;
115
+ _stop?(): void | Promise<void>;
116
+ _destroy?(): void | Promise<void>;
117
+ init?(): void | Promise<void>;
118
+ start?(): void | Promise<void>;
119
+ stop?(): void | Promise<void>;
120
+ destroy?(): void | Promise<void>;
121
+ }
122
+ /**
123
+ * Call a lifecycle method on a provider, preferring the `_`-prefixed wrapper
124
+ * (which adds status tracking & race-condition safety) when available,
125
+ * falling back to the plain method for interface-only implementations.
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * await callLifecycle(sandbox, 'start'); // calls sandbox._start() ?? sandbox.start()
130
+ * await callLifecycle(filesystem, 'init'); // calls filesystem._init() ?? filesystem.init()
131
+ * ```
132
+ */
133
+ export declare function callLifecycle(provider: LifecycleProvider, method: 'init' | 'start' | 'stop' | 'destroy'): Promise<void>;
134
+ export {};
106
135
  //# sourceMappingURL=lifecycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/workspace/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,SAAS,CAAC,KAAK,GAAG,OAAO;IACxC,qBAAqB;IACrB,MAAM,EAAE,cAAc,CAAC;IAEvB;;;;;;;;;OASG;IACH,IAAI,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9B;;;;;;;;;OASG;IACH,KAAK,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/B;;;;;;;;OAQG;IACH,IAAI,CAAC,IAAI,IAAI,GAAG,O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,KAAK,CAAC,CAAC;CACpC;AAMD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,cAAc,GACd,OAAO,GACP,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,YAAY,GACZ,WAAW,GACX,OAAO,CAAC;AAMZ;;;GAGG;AACH,UAAU,iBAAiB;IACzB,KAAK,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,QAAQ,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,KAAK,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAC5C,OAAO,CAAC,IAAI,CAAC,CAWf"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Sandbox Errors
3
+ *
4
+ * Error classes for sandbox operations including execution and mounting.
5
+ */
6
+ import type { SandboxOperation } from './types.js';
7
+ export declare class SandboxError extends Error {
8
+ readonly code: string;
9
+ readonly details?: Record<string, unknown> | undefined;
10
+ constructor(message: string, code: string, details?: Record<string, unknown> | undefined);
11
+ }
12
+ export declare class SandboxExecutionError extends SandboxError {
13
+ readonly exitCode: number;
14
+ readonly stdout: string;
15
+ readonly stderr: string;
16
+ constructor(message: string, exitCode: number, stdout: string, stderr: string);
17
+ }
18
+ export declare class SandboxTimeoutError extends SandboxError {
19
+ readonly timeoutMs: number;
20
+ readonly operation: SandboxOperation;
21
+ constructor(timeoutMs: number, operation: SandboxOperation);
22
+ }
23
+ export declare class SandboxNotReadyError extends SandboxError {
24
+ constructor(idOrStatus: string);
25
+ }
26
+ export declare class IsolationUnavailableError extends SandboxError {
27
+ readonly backend: string;
28
+ readonly reason: string;
29
+ constructor(backend: string, reason: string);
30
+ }
31
+ /**
32
+ * Base error for mount operations.
33
+ */
34
+ export declare class MountError extends SandboxError {
35
+ readonly mountPath: string;
36
+ constructor(message: string, mountPath: string, details?: Record<string, unknown>);
37
+ }
38
+ /**
39
+ * Error thrown when sandbox doesn't support mounting.
40
+ */
41
+ export declare class MountNotSupportedError extends SandboxError {
42
+ constructor(sandboxProvider: string);
43
+ }
44
+ /**
45
+ * Error thrown when a filesystem cannot be mounted.
46
+ */
47
+ export declare class FilesystemNotMountableError extends SandboxError {
48
+ constructor(filesystemProvider: string, reason?: string);
49
+ }
50
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMhD,qBAAa,YAAa,SAAQ,KAAK;aAGnB,IAAI,EAAE,MAAM;aACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAFjD,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;CAKpD;AAMD,qBAAa,qBAAsB,SAAQ,YAAY;aAGnC,QAAQ,EAAE,MAAM;aAChB,MAAM,EAAE,MAAM;aACd,MAAM,EAAE,MAAM;gBAH9B,OAAO,EAAE,MAAM,EACC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM;CAKjC;AAED,qBAAa,mBAAoB,SAAQ,YAAY;aAEjC,SAAS,EAAE,MAAM;aACjB,SAAS,EAAE,gBAAgB;gBAD3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,gBAAgB;CAK9C;AAED,qBAAa,oBAAqB,SAAQ,YAAY;gBACxC,UAAU,EAAE,MAAM;CAI/B;AAED,qBAAa,yBAA0B,SAAQ,YAAY;aAEvC,OAAO,EAAE,MAAM;aACf,MAAM,EAAE,MAAM;gBADd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM;CAKjC;AAMD;;GAEG;AACH,qBAAa,UAAW,SAAQ,YAAY;aAGxB,SAAS,EAAE,MAAM;gBADjC,OAAO,EAAE,MAAM,EACC,SAAS,EAAE,MAAM,EACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAKpC;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,YAAY;gBAC1C,eAAe,EAAE,MAAM;CAMpC;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,YAAY;gBAC/C,kBAAkB,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAOxD"}
@@ -1,3 +1,6 @@
1
+ export * from './types.js';
2
+ export * from './errors.js';
3
+ export * from './mount-manager.js';
1
4
  export * from './sandbox.js';
2
5
  export * from './mastra-sandbox.js';
3
6
  export * from './local-sandbox.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
@@ -10,12 +10,13 @@
10
10
  */
11
11
  import type { ProviderStatus } from '../lifecycle.js';
12
12
  import { MastraSandbox } from './mastra-sandbox.js';
13
+ import type { MastraSandboxOptions } from './mastra-sandbox.js';
13
14
  import type { IsolationBackend, NativeSandboxConfig } from './native-sandbox/index.js';
14
- import type { SandboxInfo, ExecuteCommandOptions, CommandResult } from './sandbox.js';
15
+ import type { SandboxInfo, ExecuteCommandOptions, CommandResult } from './types.js';
15
16
  /**
16
17
  * Local sandbox provider configuration.
17
18
  */
18
- export interface LocalSandboxOptions {
19
+ export interface LocalSandboxOptions extends Pick<MastraSandboxOptions, 'onStart' | 'onStop' | 'onDestroy'> {
19
20
  /** Unique identifier for this sandbox instance */
20
21
  id?: string;
21
22
  /** Working directory for command execution */
@@ -119,8 +120,22 @@ export declare class LocalSandbox extends MastraSandbox {
119
120
  * Merges the sandbox's configured env with any additional env from the command.
120
121
  */
121
122
  private buildEnv;
123
+ /**
124
+ * Start the local sandbox.
125
+ * Creates working directory and sets up seatbelt profile if using macOS isolation.
126
+ * Status management is handled by the base class.
127
+ */
122
128
  start(): Promise<void>;
129
+ /**
130
+ * Stop the local sandbox.
131
+ * Status management is handled by the base class.
132
+ */
123
133
  stop(): Promise<void>;
134
+ /**
135
+ * Destroy the local sandbox and clean up resources.
136
+ * Cleans up seatbelt profile if auto-generated.
137
+ * Status management is handled by the base class.
138
+ */
124
139
  destroy(): Promise<void>;
125
140
  isReady(): Promise<boolean>;
126
141
  getInfo(): Promise<SandboxInfo>;
@@ -1 +1 @@
1
- {"version":3,"file":"local-sandbox.d.ts","sourceRoot":"","sources":["../../../src/workspace/sandbox/local-sandbox.ts"],"names":[],"mapp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