mastra 1.0.0-beta.1 → 1.0.0-beta.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 (331) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/{chunk-NHL3S2MZ.js → chunk-LC24FTF4.js} +395 -240
  3. package/dist/chunk-LC24FTF4.js.map +1 -0
  4. package/dist/commands/actions/start-dev-server.d.ts +2 -2
  5. package/dist/commands/actions/start-dev-server.d.ts.map +1 -1
  6. package/dist/commands/build/BuildBundler.d.ts.map +1 -1
  7. package/dist/commands/create/create.d.ts.map +1 -1
  8. package/dist/commands/create/create.js +1 -1
  9. package/dist/commands/dev/DevBundler.d.ts.map +1 -1
  10. package/dist/commands/dev/dev.d.ts +2 -2
  11. package/dist/commands/dev/dev.d.ts.map +1 -1
  12. package/dist/commands/init/init.d.ts.map +1 -1
  13. package/dist/commands/init/mcp-docs-server-install.d.ts +3 -2
  14. package/dist/commands/init/mcp-docs-server-install.d.ts.map +1 -1
  15. package/dist/commands/init/utils.d.ts +7 -1
  16. package/dist/commands/init/utils.d.ts.map +1 -1
  17. package/dist/commands/start/start.d.ts.map +1 -1
  18. package/dist/commands/utils.d.ts +2 -1
  19. package/dist/commands/utils.d.ts.map +1 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +46 -15
  22. package/dist/index.js.map +1 -1
  23. package/dist/playground/assets/{abap-1CzS1sOj.js → abap-6DOLzTwj.js} +1 -1
  24. package/dist/playground/assets/{abnf-DGOvXig-.js → abnf-CfZklBkp.js} +1 -1
  25. package/dist/playground/assets/{actionscript-Ckam20DI.js → actionscript-AKAbTTS9.js} +1 -1
  26. package/dist/playground/assets/{ada-BFBuxkjJ.js → ada-CCyCCZQc.js} +1 -1
  27. package/dist/playground/assets/{agda-Tq5ut5V8.js → agda-BJdmxjDx.js} +1 -1
  28. package/dist/playground/assets/{al-DGhsGLAq.js → al-Ct9Ryay7.js} +1 -1
  29. package/dist/playground/assets/{antlr4-BFV6m952.js → antlr4-DSMpmcmV.js} +1 -1
  30. package/dist/playground/assets/{apacheconf-CbuLdkuI.js → apacheconf-BeqOavCJ.js} +1 -1
  31. package/dist/playground/assets/{apex-HFdqHYhh.js → apex-1_6mi69r.js} +1 -1
  32. package/dist/playground/assets/{apl-DFVCf5n0.js → apl-DC48MxBB.js} +1 -1
  33. package/dist/playground/assets/{applescript-DBgTu4l9.js → applescript-DiL8hMiv.js} +1 -1
  34. package/dist/playground/assets/{aql-gZpNcV2Z.js → aql-DyNBc7fs.js} +1 -1
  35. package/dist/playground/assets/{arduino-fHUI01vu.js → arduino-gwy9r-YX.js} +1 -1
  36. package/dist/playground/assets/{arff-CGHPsxEa.js → arff-DNFG93L3.js} +1 -1
  37. package/dist/playground/assets/{asciidoc-BLL0AFhH.js → asciidoc-CTxOFUVL.js} +1 -1
  38. package/dist/playground/assets/{asm6502-gHMXkX3O.js → asm6502-BzZ19HcF.js} +1 -1
  39. package/dist/playground/assets/{asmatmel-Djar7TVY.js → asmatmel-CLbZhuh4.js} +1 -1
  40. package/dist/playground/assets/{aspnet-CT-3fxZA.js → aspnet-CNeCVQc2.js} +1 -1
  41. package/dist/playground/assets/{autohotkey-C2LuJtTY.js → autohotkey-CXQ3guY7.js} +1 -1
  42. package/dist/playground/assets/{autoit-D7z9Oj0a.js → autoit-BXB8-6g2.js} +1 -1
  43. package/dist/playground/assets/{avisynth-DH-1joIy.js → avisynth-DYmoRGo8.js} +1 -1
  44. package/dist/playground/assets/{avro-idl-CwMmBvL0.js → avro-idl-tYnrSjX3.js} +1 -1
  45. package/dist/playground/assets/{bash-DC9ltNCH.js → bash-C42XeCrr.js} +1 -1
  46. package/dist/playground/assets/{basic-BvNdNPPC.js → basic-BMMgfTME.js} +1 -1
  47. package/dist/playground/assets/{batch-B2A0-lrO.js → batch-B3P3xJG5.js} +1 -1
  48. package/dist/playground/assets/{bbcode-C-cdSQU1.js → bbcode-CnuB3NAz.js} +1 -1
  49. package/dist/playground/assets/{bicep-wR2S1QWa.js → bicep-CFE-cvbx.js} +1 -1
  50. package/dist/playground/assets/{birb-DxKsEIRC.js → birb-CFS7CYKM.js} +1 -1
  51. package/dist/playground/assets/{bison-BrtjR4_0.js → bison-DO7Cwt0_.js} +1 -1
  52. package/dist/playground/assets/{bnf-DZXJcNWs.js → bnf-DG2ekAVI.js} +1 -1
  53. package/dist/playground/assets/{brainfuck-GsQ3r7ZS.js → brainfuck-CNhtua6e.js} +1 -1
  54. package/dist/playground/assets/{brightscript-Cm5JZVO7.js → brightscript-JOyyTqE2.js} +1 -1
  55. package/dist/playground/assets/{bro-ofyQMWa0.js → bro-K6FdV75Z.js} +1 -1
  56. package/dist/playground/assets/{bsl-BA39c2V2.js → bsl-Cco4i-C9.js} +1 -1
  57. package/dist/playground/assets/{c-w4TQc2DV.js → c-B9sfFRGF.js} +1 -1
  58. package/dist/playground/assets/{cfscript-DB2UdqrI.js → cfscript-uHH56TvL.js} +1 -1
  59. package/dist/playground/assets/{chaiscript-DKw0DBKq.js → chaiscript-CTwEBi0k.js} +1 -1
  60. package/dist/playground/assets/{cil-B1Aij6Ac.js → cil-YW8GIRkY.js} +1 -1
  61. package/dist/playground/assets/{clike-PYh2Df1m.js → clike-DFFiP88_.js} +1 -1
  62. package/dist/playground/assets/{clojure-C3Kzfbxr.js → clojure-D0KzK__-.js} +1 -1
  63. package/dist/playground/assets/{cmake-B5lEWe4v.js → cmake-BpepAc-I.js} +1 -1
  64. package/dist/playground/assets/{cobol-DV2v69DZ.js → cobol-D1xQIb8e.js} +1 -1
  65. package/dist/playground/assets/{coffeescript-DPMm0h67.js → coffeescript-DPgAWugh.js} +1 -1
  66. package/dist/playground/assets/{concurnas-5ceC2vtu.js → concurnas-CUKNpOla.js} +1 -1
  67. package/dist/playground/assets/{coq-CJx3sS2Y.js → coq-CTX51mGs.js} +1 -1
  68. package/dist/playground/assets/{core-awL-mrqC.js → core-DQkupPXu.js} +1 -1
  69. package/dist/playground/assets/{cpp-Dqtv01mn.js → cpp-C1tXJDTh.js} +1 -1
  70. package/dist/playground/assets/{crystal-YmylMN4k.js → crystal-oUuEa2es.js} +1 -1
  71. package/dist/playground/assets/{csharp-6LRLb3wj.js → csharp-BBpHwwTR.js} +1 -1
  72. package/dist/playground/assets/{cshtml-Cx2gpcdc.js → cshtml-BGr3_B1M.js} +1 -1
  73. package/dist/playground/assets/{csp-JoKz2eQf.js → csp-GltQGe54.js} +1 -1
  74. package/dist/playground/assets/{css-Dn_Nm8K5.js → css-BDxYD9rq.js} +1 -1
  75. package/dist/playground/assets/{css-extras-CCuLtFJx.js → css-extras-BkXe59-L.js} +1 -1
  76. package/dist/playground/assets/{csv-BOqfDvgc.js → csv-C8D8HIlr.js} +1 -1
  77. package/dist/playground/assets/{cypher-B8lcZcX-.js → cypher-CYU7DwZN.js} +1 -1
  78. package/dist/playground/assets/{d-C7p5_QW4.js → d-AC8YNNya.js} +1 -1
  79. package/dist/playground/assets/{dart-DHVKj4dD.js → dart-1eVjARaB.js} +1 -1
  80. package/dist/playground/assets/{dataweave-BLVaR6RS.js → dataweave-Cy9KX0sH.js} +1 -1
  81. package/dist/playground/assets/{dax-CAuQA-pw.js → dax-BJGnfVAi.js} +1 -1
  82. package/dist/playground/assets/{dhall-6-srnnFP.js → dhall-BpUv16pM.js} +1 -1
  83. package/dist/playground/assets/{diff-yP5aAuhk.js → diff-Bd-AlygM.js} +1 -1
  84. package/dist/playground/assets/{django-Bc3LGca8.js → django-sTqyCMUn.js} +1 -1
  85. package/dist/playground/assets/{dns-zone-file-DuMFp9AD.js → dns-zone-file-1GhXEXKO.js} +1 -1
  86. package/dist/playground/assets/{docker-qGjcWmeQ.js → docker-BZTwqywV.js} +1 -1
  87. package/dist/playground/assets/{dot-Nng7Jq-1.js → dot-CN_l2Zbx.js} +1 -1
  88. package/dist/playground/assets/{ebnf-DGw7D5FO.js → ebnf-Cao6g6M8.js} +1 -1
  89. package/dist/playground/assets/{editorconfig-DdNdUHyk.js → editorconfig-C65v4TTe.js} +1 -1
  90. package/dist/playground/assets/{eiffel-Djs2lIA5.js → eiffel-BY1wPrdH.js} +1 -1
  91. package/dist/playground/assets/{ejs-BgckZXji.js → ejs-BYJUnSPa.js} +1 -1
  92. package/dist/playground/assets/{elixir-DxPbR3j9.js → elixir-DUcA1CQ7.js} +1 -1
  93. package/dist/playground/assets/{elm-CQjhvMG4.js → elm-B_iWR6D7.js} +1 -1
  94. package/dist/playground/assets/{erb-BkC_lhzH.js → erb-VZ17IOos.js} +1 -1
  95. package/dist/playground/assets/{erlang-DI8fwDZA.js → erlang-BmfJbSZw.js} +1 -1
  96. package/dist/playground/assets/{etlua-W0w0A9i7.js → etlua-Cr74nwq1.js} +1 -1
  97. package/dist/playground/assets/{excel-formula-DJC3DTW2.js → excel-formula-BV_N5tyK.js} +1 -1
  98. package/dist/playground/assets/{factor-p_aKOy3O.js → factor-H6KYHMvj.js} +1 -1
  99. package/dist/playground/assets/{false-C0slWFk4.js → false-Cx7AvnUc.js} +1 -1
  100. package/dist/playground/assets/{firestore-security-rules-D6b3ZM9O.js → firestore-security-rules-DxjvvkVI.js} +1 -1
  101. package/dist/playground/assets/{flow-B97Z5M5g.js → flow-CaafkKZh.js} +1 -1
  102. package/dist/playground/assets/{fortran-yTOeV9tz.js → fortran-BTAT0lHU.js} +1 -1
  103. package/dist/playground/assets/{fsharp-Clw45DHR.js → fsharp-SdPV6MoS.js} +1 -1
  104. package/dist/playground/assets/{ftl-C2xVUBxP.js → ftl-CdaMxLBX.js} +1 -1
  105. package/dist/playground/assets/{gap-CEo3Gc7J.js → gap-lw7_MoyR.js} +1 -1
  106. package/dist/playground/assets/{gcode-BVO5YHmP.js → gcode-Bi78vwuX.js} +1 -1
  107. package/dist/playground/assets/{gdscript-o3sqxne-.js → gdscript-01IdRjfA.js} +1 -1
  108. package/dist/playground/assets/{gedcom-94FHn7C-.js → gedcom-qa5VGNbi.js} +1 -1
  109. package/dist/playground/assets/{gherkin-BcHPeTR7.js → gherkin-DrJrC98t.js} +1 -1
  110. package/dist/playground/assets/{git-CX4wgYVJ.js → git-BheEAvZB.js} +1 -1
  111. package/dist/playground/assets/{glsl-xGVEgQY-.js → glsl-CQMHWm2x.js} +1 -1
  112. package/dist/playground/assets/{gml-O85a0Qq7.js → gml-Bjtos3JR.js} +1 -1
  113. package/dist/playground/assets/{gn-Gkh_ZE4p.js → gn-BUdAGxdU.js} +1 -1
  114. package/dist/playground/assets/{go-RKuHUD8p.js → go-DpOz20_U.js} +1 -1
  115. package/dist/playground/assets/{go-module-Cd5B1mIJ.js → go-module-B2Bo8Inl.js} +1 -1
  116. package/dist/playground/assets/{graphql-Dw7AAUz0.js → graphql-Bz8kQLri.js} +1 -1
  117. package/dist/playground/assets/{groovy-DGB_T7dF.js → groovy-Brz1yCEq.js} +1 -1
  118. package/dist/playground/assets/{haml-DvClPB1G.js → haml-Bb-I3-i5.js} +1 -1
  119. package/dist/playground/assets/{handlebars-Cl-GBNZQ.js → handlebars-CUM7hfw1.js} +1 -1
  120. package/dist/playground/assets/{haskell-wM0n-rcH.js → haskell-yU_5dHIQ.js} +1 -1
  121. package/dist/playground/assets/{haxe-iDkJJGVM.js → haxe-ClW7_VqX.js} +1 -1
  122. package/dist/playground/assets/{hcl-Cn0S_wf6.js → hcl-A3M7U6sx.js} +1 -1
  123. package/dist/playground/assets/{hlsl-BjE4WxqQ.js → hlsl-CV8p6SHi.js} +1 -1
  124. package/dist/playground/assets/{hoon-rUOUCZ3W.js → hoon-DOfZY8Wb.js} +1 -1
  125. package/dist/playground/assets/{hpkp-DP_4F80b.js → hpkp-BXwyhVni.js} +1 -1
  126. package/dist/playground/assets/{hsts-DVvdi9ar.js → hsts-59AquukD.js} +1 -1
  127. package/dist/playground/assets/{http-Bwcz59ub.js → http-DEbn8sMc.js} +1 -1
  128. package/dist/playground/assets/{ichigojam-DZffFFD5.js → ichigojam-CQJdDSjc.js} +1 -1
  129. package/dist/playground/assets/{icon-C0b7nx0h.js → icon-ARicuwT2.js} +1 -1
  130. package/dist/playground/assets/{icu-message-format-DjVkXpEj.js → icu-message-format-D91P0nOv.js} +1 -1
  131. package/dist/playground/assets/{idris-0jwu3qTZ.js → idris-DBiCaeI0.js} +1 -1
  132. package/dist/playground/assets/{iecst-CKOHCzS7.js → iecst-DS-EtSFF.js} +1 -1
  133. package/dist/playground/assets/{ignore-CUsnJVxM.js → ignore-BgVksdLk.js} +1 -1
  134. package/dist/playground/assets/{index-Bh7AT5zU.js → index-B2FEsEX8.js} +1 -1
  135. package/dist/playground/assets/{index-Dhm4G7YM.js → index-B972m2Un.js} +1 -1
  136. package/dist/playground/assets/{index-mnBv4IDG.js → index-BJGEpHU4.js} +1 -1
  137. package/dist/playground/assets/{index-Dvbs85st.js → index-BSmKrXcj.js} +1 -1
  138. package/dist/playground/assets/{index-BqjMKSph.js → index-BbatZigt.js} +1 -1
  139. package/dist/playground/assets/{index-BUieIqcC.js → index-BbpTW3Xm.js} +1 -1
  140. package/dist/playground/assets/{index-BMPzBpdy.js → index-BfKQQ_lf.js} +1 -1
  141. package/dist/playground/assets/{index-Ct2mUODZ.js → index-C6V-ctyk.js} +1 -1
  142. package/dist/playground/assets/{index-Dal4mcJQ.js → index-CbMh4TbE.js} +1 -1
  143. package/dist/playground/assets/{index-DaDsg3iZ.js → index-Cf-FgNXk.js} +1 -1
  144. package/dist/playground/assets/{index-CWl7KBtZ.js → index-Cy7GC-ju.js} +1 -1
  145. package/dist/playground/assets/{index-CgMSb0ib.js → index-D16xRHPb.js} +1 -1
  146. package/dist/playground/assets/{index-5430GCVb.js → index-D2fyGZNc.js} +1 -1
  147. package/dist/playground/assets/{index-PrsQv3Q5.js → index-DHv_dSkz.js} +1 -1
  148. package/dist/playground/assets/{index-BIPLi07j.js → index-GOtNWXGx.js} +1 -1
  149. package/dist/playground/assets/{index-DSHLyy0s.js → index-Rmc5O_oR.js} +1 -1
  150. package/dist/playground/assets/{index-C4U2p1Ac.js → index-XAu1AvNW.js} +310 -306
  151. package/dist/playground/assets/{index-CLu0RbtZ.js → index-eCXjJDLv.js} +1 -1
  152. package/dist/playground/assets/{inform7-BE_oO7eR.js → inform7-DjNR4sAs.js} +1 -1
  153. package/dist/playground/assets/{ini-DRJ1Lb58.js → ini-CCqkUhJi.js} +1 -1
  154. package/dist/playground/assets/{io-DD1DLPfJ.js → io-HQQqcCvC.js} +1 -1
  155. package/dist/playground/assets/{j-BO_N_FDB.js → j-DZp5i3jL.js} +1 -1
  156. package/dist/playground/assets/{java-BzZsqQhG.js → java-D_oPCdNs.js} +1 -1
  157. package/dist/playground/assets/{javadoc-BwxdkkEO.js → javadoc-DyZBjvWB.js} +1 -1
  158. package/dist/playground/assets/{javadoclike-CBDKG3Kl.js → javadoclike-Chnj_N5F.js} +1 -1
  159. package/dist/playground/assets/{javascript-hTZuOaC5.js → javascript-B9jfLhz3.js} +1 -1
  160. package/dist/playground/assets/{javastacktrace-ZOpfCGh5.js → javastacktrace-BVemymJw.js} +1 -1
  161. package/dist/playground/assets/{jexl-CoQAfDY-.js → jexl-CU-RBOR4.js} +1 -1
  162. package/dist/playground/assets/{jolie-BXuheID5.js → jolie-Cha-OFlZ.js} +1 -1
  163. package/dist/playground/assets/{jq-D2V9LUqd.js → jq-CMjkNh5d.js} +1 -1
  164. package/dist/playground/assets/{js-extras-Bdsx2AmN.js → js-extras-BniKZI6e.js} +1 -1
  165. package/dist/playground/assets/{js-templates-CVWBbSad.js → js-templates-ClVKo2BT.js} +1 -1
  166. package/dist/playground/assets/{jsdoc-xVA9Cj-w.js → jsdoc-BrMzvzDK.js} +1 -1
  167. package/dist/playground/assets/{json-v46bxzze.js → json-DF34A1D_.js} +1 -1
  168. package/dist/playground/assets/{json5-DwTC9_aM.js → json5-D6ETg0VD.js} +1 -1
  169. package/dist/playground/assets/{jsonp-DtwmHxcv.js → jsonp-DuHV9mxH.js} +1 -1
  170. package/dist/playground/assets/{jsstacktrace-D7MUpJmS.js → jsstacktrace-BO3isI6a.js} +1 -1
  171. package/dist/playground/assets/{jsx-B2ZPu_sF.js → jsx-oUXQNPCz.js} +1 -1
  172. package/dist/playground/assets/{julia-C-4dl-Eh.js → julia-D_Cef320.js} +1 -1
  173. package/dist/playground/assets/{keepalived-9r2MYVcY.js → keepalived-yzpayF3c.js} +1 -1
  174. package/dist/playground/assets/{keyman-DvHNjcz5.js → keyman-Cha-G3cn.js} +1 -1
  175. package/dist/playground/assets/{kotlin-B49JjNRF.js → kotlin-Bulm8EmN.js} +1 -1
  176. package/dist/playground/assets/{kumir-BubygEYF.js → kumir-BwN0v8oh.js} +1 -1
  177. package/dist/playground/assets/{kusto-CH_AKVN6.js → kusto-BX-aX_jq.js} +1 -1
  178. package/dist/playground/assets/{latex-C9qtRxyR.js → latex-DEqyL2ut.js} +1 -1
  179. package/dist/playground/assets/{latte-eaSds21J.js → latte-B2q0JAy4.js} +1 -1
  180. package/dist/playground/assets/{less-Ciq7oCWk.js → less-CRBwIMl2.js} +1 -1
  181. package/dist/playground/assets/{lilypond-ezW_FBa7.js → lilypond-C2bAZMak.js} +1 -1
  182. package/dist/playground/assets/{liquid-Di97Zow5.js → liquid-D3QPbKWb.js} +1 -1
  183. package/dist/playground/assets/{lisp-BND5IUUb.js → lisp-KbCeZg3n.js} +1 -1
  184. package/dist/playground/assets/{livescript-CNdmDR9k.js → livescript-j8ItPi2b.js} +1 -1
  185. package/dist/playground/assets/{llvm-Diu5vE-_.js → llvm-BdT72xcB.js} +1 -1
  186. package/dist/playground/assets/{log-l74ZIo2G.js → log-Ca8hWhgq.js} +1 -1
  187. package/dist/playground/assets/{lolcode-D8E_zNUr.js → lolcode-CK9jHhIe.js} +1 -1
  188. package/dist/playground/assets/{lua-gNMwUQjv.js → lua-CQ7zG3QO.js} +1 -1
  189. package/dist/playground/assets/{magma-BZndnK4u.js → magma-B4WoDAdb.js} +1 -1
  190. package/dist/playground/assets/{makefile-2KtWvl9M.js → makefile-DRCtk6Nx.js} +1 -1
  191. package/dist/playground/assets/{markdown-QVr2WZ7A.js → markdown-1iGCGzQ7.js} +1 -1
  192. package/dist/playground/assets/{markup-CGjosiRG.js → markup-DTO9t2KR.js} +1 -1
  193. package/dist/playground/assets/{markup-templating--J8lNA65.js → markup-templating-DZdRBL6R.js} +1 -1
  194. package/dist/playground/assets/{matlab-BzWR4u9J.js → matlab-GlI9xSnO.js} +1 -1
  195. package/dist/playground/assets/{maxscript-DqL8aTwi.js → maxscript-DkHlSJGz.js} +1 -1
  196. package/dist/playground/assets/{mel-gxTOI7Bn.js → mel-BDRS7as7.js} +1 -1
  197. package/dist/playground/assets/{mermaid-CRoOZITP.js → mermaid-DUBxIqDz.js} +1 -1
  198. package/dist/playground/assets/{mizar-D4dkpyeN.js → mizar-TMjQkH6t.js} +1 -1
  199. package/dist/playground/assets/{mongodb-BQlStzRx.js → mongodb-D17D-z3x.js} +1 -1
  200. package/dist/playground/assets/{monkey-BkVftKMt.js → monkey-DKzQWXew.js} +1 -1
  201. package/dist/playground/assets/{moonscript-gBNEqU73.js → moonscript-YvirLEB6.js} +1 -1
  202. package/dist/playground/assets/{n1ql-Bal9wV3M.js → n1ql-D7EBrk76.js} +1 -1
  203. package/dist/playground/assets/{n4js-DJDqWInO.js → n4js-AGysbVKZ.js} +1 -1
  204. package/dist/playground/assets/{nand2tetris-hdl-DVYcQs0u.js → nand2tetris-hdl-RSq1smoT.js} +1 -1
  205. package/dist/playground/assets/{naniscript-D-DQWSz5.js → naniscript-CFQz6cin.js} +1 -1
  206. package/dist/playground/assets/{nasm-CoydG39X.js → nasm-Gv21rRiH.js} +1 -1
  207. package/dist/playground/assets/{neon-CFqbCk9q.js → neon-C-4a_p-6.js} +1 -1
  208. package/dist/playground/assets/{nevod-BWVaWL8G.js → nevod-BE-Zgm0A.js} +1 -1
  209. package/dist/playground/assets/{nginx-CJ8KhEzw.js → nginx-B3BsPDqE.js} +1 -1
  210. package/dist/playground/assets/{nim-CTjZnGAK.js → nim-BLmUHkKj.js} +1 -1
  211. package/dist/playground/assets/{nix-D59oAN6v.js → nix-BU0zddII.js} +1 -1
  212. package/dist/playground/assets/{nsis-C4QOvtRp.js → nsis-Ddm92SWN.js} +1 -1
  213. package/dist/playground/assets/{objectivec-CNwgVx15.js → objectivec-ABq8Mm5k.js} +1 -1
  214. package/dist/playground/assets/{ocaml-Cbt3VSbK.js → ocaml-Ixj21G4g.js} +1 -1
  215. package/dist/playground/assets/{opencl-BvLZSbML.js → opencl-zdUUY9XM.js} +1 -1
  216. package/dist/playground/assets/{openqasm-CGOnCwmJ.js → openqasm-CriPwmlK.js} +1 -1
  217. package/dist/playground/assets/{oz-DVsjFoJo.js → oz-B2HWkTCM.js} +1 -1
  218. package/dist/playground/assets/{parigp-D5xSjAKr.js → parigp-C8RqgeOv.js} +1 -1
  219. package/dist/playground/assets/{parser-d13CKhZm.js → parser-CPKYBPtd.js} +1 -1
  220. package/dist/playground/assets/{pascal-BvUbXOhW.js → pascal-BfHplbpc.js} +1 -1
  221. package/dist/playground/assets/{pascaligo-pwdQOiyr.js → pascaligo-9cOdgpmV.js} +1 -1
  222. package/dist/playground/assets/{pcaxis-BPo6ZVCF.js → pcaxis-BuSx_kfh.js} +1 -1
  223. package/dist/playground/assets/{peoplecode-BPwq91WF.js → peoplecode-D89486CG.js} +1 -1
  224. package/dist/playground/assets/{perl-WtWUuCP3.js → perl-b802VC1E.js} +1 -1
  225. package/dist/playground/assets/{php-CMJK3UPB.js → php-Jpy-nMIG.js} +1 -1
  226. package/dist/playground/assets/{php-extras-_VGCd9xg.js → php-extras-Bn4dJWx9.js} +1 -1
  227. package/dist/playground/assets/{phpdoc-WkHZUPUM.js → phpdoc-PpQbYbqz.js} +1 -1
  228. package/dist/playground/assets/{plsql-Cq6eEoN9.js → plsql-Dt_SppOk.js} +1 -1
  229. package/dist/playground/assets/{powerquery-BXYY2Vg4.js → powerquery-Bc7eEze8.js} +1 -1
  230. package/dist/playground/assets/{powershell-fY0zLuCN.js → powershell-CStj08Hx.js} +1 -1
  231. package/dist/playground/assets/{processing-DvXSIH2o.js → processing-C1JTlqFd.js} +1 -1
  232. package/dist/playground/assets/{prolog-B-7DRt0Q.js → prolog-B-GNUuOV.js} +1 -1
  233. package/dist/playground/assets/{promql-yRPFscBJ.js → promql-Bap2ofnb.js} +1 -1
  234. package/dist/playground/assets/{properties-DOrVgnsn.js → properties-Bmb0L3K-.js} +1 -1
  235. package/dist/playground/assets/{protobuf-BPMQlYO_.js → protobuf-Dn-X1DDq.js} +1 -1
  236. package/dist/playground/assets/{psl-BytgMlVA.js → psl-BWf_Fpl0.js} +1 -1
  237. package/dist/playground/assets/{pug-BrQQZMXX.js → pug-JI4oVNTh.js} +1 -1
  238. package/dist/playground/assets/{puppet-D0rWAMpi.js → puppet-DmG70djG.js} +1 -1
  239. package/dist/playground/assets/{pure-D3akdLNP.js → pure-hzlgIe3s.js} +1 -1
  240. package/dist/playground/assets/{purebasic-BvyRZ4e2.js → purebasic-BFFIHatU.js} +1 -1
  241. package/dist/playground/assets/{purescript-CJVS0asd.js → purescript-3RaTWJxq.js} +1 -1
  242. package/dist/playground/assets/{python-DFf0sF2h.js → python-CgLsgfE0.js} +1 -1
  243. package/dist/playground/assets/{q-Dx0gyvWB.js → q-CFZaCybp.js} +1 -1
  244. package/dist/playground/assets/{qml-DgfQDN4B.js → qml-BGPA50aO.js} +1 -1
  245. package/dist/playground/assets/{qore-BWwh2dOA.js → qore-B75zX4vH.js} +1 -1
  246. package/dist/playground/assets/{qsharp-BSuwYsvS.js → qsharp-BgTsWLZU.js} +1 -1
  247. package/dist/playground/assets/{r-B-fIj4Vl.js → r-j4HR_0nG.js} +1 -1
  248. package/dist/playground/assets/{racket-C1cWOkSS.js → racket-Csb45ted.js} +1 -1
  249. package/dist/playground/assets/{reason-Bvp1giaD.js → reason-BEizlYQ-.js} +1 -1
  250. package/dist/playground/assets/{regex-CC3lEw_I.js → regex-Tfc8lT5t.js} +1 -1
  251. package/dist/playground/assets/{rego-0uWqA6B_.js → rego-CgKzf-U8.js} +1 -1
  252. package/dist/playground/assets/{renpy-BLav3ImN.js → renpy-Dv0QTYsE.js} +1 -1
  253. package/dist/playground/assets/{rest-VO18yH-j.js → rest-CDkxO0Xp.js} +1 -1
  254. package/dist/playground/assets/{rip-dpWJBk9i.js → rip-Bz5eznLE.js} +1 -1
  255. package/dist/playground/assets/{roboconf-B1MwI3f8.js → roboconf-C0NCywBn.js} +1 -1
  256. package/dist/playground/assets/{robotframework-Bdb-jPYB.js → robotframework-B4lDNhZj.js} +1 -1
  257. package/dist/playground/assets/{ruby-CA7NsUfQ.js → ruby-BbMtl6N3.js} +1 -1
  258. package/dist/playground/assets/{rust-PzI1cHWc.js → rust-DKf5uPU0.js} +1 -1
  259. package/dist/playground/assets/{sas-D8-wUxbX.js → sas-DmbaK6em.js} +1 -1
  260. package/dist/playground/assets/{sass-Ddx9r_xg.js → sass-u2a8N2ib.js} +1 -1
  261. package/dist/playground/assets/{scala-CKFoLkY1.js → scala-CsG0vHa8.js} +1 -1
  262. package/dist/playground/assets/{scheme-BKOYV7g3.js → scheme-C0wMT8OY.js} +1 -1
  263. package/dist/playground/assets/{scss-C7diewNB.js → scss-CIsRQIbS.js} +1 -1
  264. package/dist/playground/assets/{shell-session-DAVIwm6r.js → shell-session-DLmGaXkR.js} +1 -1
  265. package/dist/playground/assets/{smali-CxEhs8yC.js → smali-B-UvTauF.js} +1 -1
  266. package/dist/playground/assets/{smalltalk-D1bda1js.js → smalltalk-Cyzqf2CY.js} +1 -1
  267. package/dist/playground/assets/{smarty-D86XLDAD.js → smarty-DIBhWhES.js} +1 -1
  268. package/dist/playground/assets/{sml-DhRzV0Yd.js → sml-Dk7WR2eO.js} +1 -1
  269. package/dist/playground/assets/{solidity-DZzAYKne.js → solidity-DzM-klHb.js} +1 -1
  270. package/dist/playground/assets/{solution-file-DcWsdOsE.js → solution-file-BGdLAmZb.js} +1 -1
  271. package/dist/playground/assets/{soy-CJzcp0Rd.js → soy-WWtMoZWm.js} +1 -1
  272. package/dist/playground/assets/{sparql-Bza39uP1.js → sparql-BytMoUPr.js} +1 -1
  273. package/dist/playground/assets/{splunk-spl-pgc5xbr1.js → splunk-spl-CIIWXkg9.js} +1 -1
  274. package/dist/playground/assets/{sqf-zaxjPIcX.js → sqf-DZKuZoNS.js} +1 -1
  275. package/dist/playground/assets/{sql-BDxJqV_A.js → sql-CV2EgD-X.js} +1 -1
  276. package/dist/playground/assets/{squirrel-fBNLZRcl.js → squirrel-D5G4yDQE.js} +1 -1
  277. package/dist/playground/assets/{stan-CJSTRlqV.js → stan-CIwrbYLM.js} +1 -1
  278. package/dist/playground/assets/style-DkRpX1cz.css +1 -0
  279. package/dist/playground/assets/{stylus-DcowwZLM.js → stylus-DosQ3wEK.js} +1 -1
  280. package/dist/playground/assets/{swift-BvR6KTou.js → swift-DVoTXlNm.js} +1 -1
  281. package/dist/playground/assets/{systemd-Bm9dfnfC.js → systemd-BrHuacWE.js} +1 -1
  282. package/dist/playground/assets/{t4-cs-DBS3SuTn.js → t4-cs-CJVPzG8j.js} +1 -1
  283. package/dist/playground/assets/{t4-templating-BUpklocH.js → t4-templating-DCKB-xxa.js} +1 -1
  284. package/dist/playground/assets/{t4-vb-8Kx8FrJn.js → t4-vb-CCVlmq_p.js} +1 -1
  285. package/dist/playground/assets/{tap-BffWxfOo.js → tap-K1StiBHZ.js} +1 -1
  286. package/dist/playground/assets/{tcl-C0r6haIO.js → tcl-CTS-UJhx.js} +1 -1
  287. package/dist/playground/assets/{textile-B-BdvKXq.js → textile-PGtWbNbI.js} +1 -1
  288. package/dist/playground/assets/{toml-CsDsK2f9.js → toml-C32_QmpW.js} +1 -1
  289. package/dist/playground/assets/{tremor-CctEbCng.js → tremor-C6GQZcaF.js} +1 -1
  290. package/dist/playground/assets/{tsx-D4cMQx4D.js → tsx-CNGXfHf5.js} +1 -1
  291. package/dist/playground/assets/{tt2-BWVqfxra.js → tt2-D2asEIIA.js} +1 -1
  292. package/dist/playground/assets/{turtle-DCRLY1Qq.js → turtle-BeOAps6D.js} +1 -1
  293. package/dist/playground/assets/{twig-CmagNSa3.js → twig-DnRA8b_c.js} +1 -1
  294. package/dist/playground/assets/{typescript-BwUK_myp.js → typescript-DwZ0aAIr.js} +1 -1
  295. package/dist/playground/assets/{typoscript-Brs6KLZ4.js → typoscript-C1Abfy3p.js} +1 -1
  296. package/dist/playground/assets/{unrealscript-DzAjWmdp.js → unrealscript-CUanXpl-.js} +1 -1
  297. package/dist/playground/assets/{uorazor-w1hD9SND.js → uorazor-Dir8pmuF.js} +1 -1
  298. package/dist/playground/assets/{uri-DF5-DT9w.js → uri-WdtVq9EY.js} +1 -1
  299. package/dist/playground/assets/{v-BavoKhXR.js → v-B9uv8nIm.js} +1 -1
  300. package/dist/playground/assets/{vala-1eVOQj5_.js → vala-BpYuFBFh.js} +1 -1
  301. package/dist/playground/assets/{vbnet-6zkgS3WB.js → vbnet-CrTrisqD.js} +1 -1
  302. package/dist/playground/assets/{velocity-x-6OTDFN.js → velocity-DLpAzI7w.js} +1 -1
  303. package/dist/playground/assets/{verilog-C4yzM5oQ.js → verilog-UvKx9aG_.js} +1 -1
  304. package/dist/playground/assets/{vhdl-Dh0L03yv.js → vhdl-DEwVTiBO.js} +1 -1
  305. package/dist/playground/assets/{vim-Dc3QQ6M0.js → vim-Dx6r37LX.js} +1 -1
  306. package/dist/playground/assets/{visual-basic-6taNRfml.js → visual-basic-BslyvNgr.js} +1 -1
  307. package/dist/playground/assets/{warpscript-SGwIx-pb.js → warpscript-UQCVJq5J.js} +1 -1
  308. package/dist/playground/assets/{wasm-KlR0o1yG.js → wasm-DRKP4B39.js} +1 -1
  309. package/dist/playground/assets/{web-idl-r-M67RT-.js → web-idl-W8E7Nc1m.js} +1 -1
  310. package/dist/playground/assets/{wiki-oiupc9yq.js → wiki-DJs1TIsO.js} +1 -1
  311. package/dist/playground/assets/{wolfram-C35GZ5NN.js → wolfram-DDsub-da.js} +1 -1
  312. package/dist/playground/assets/{wren-D2ELJujn.js → wren-Ci4dgNa6.js} +1 -1
  313. package/dist/playground/assets/{xeora-BYbZIIur.js → xeora-Tml5mLJD.js} +1 -1
  314. package/dist/playground/assets/{xml-doc-bciQqQY7.js → xml-doc-CXJ_BnoP.js} +1 -1
  315. package/dist/playground/assets/{xojo-JXmhLMmX.js → xojo-Vi3sVffH.js} +1 -1
  316. package/dist/playground/assets/{xquery-OdhlQiGj.js → xquery-CyNLUs-0.js} +1 -1
  317. package/dist/playground/assets/{yaml-BegI5l2n.js → yaml-BDdOPn1D.js} +1 -1
  318. package/dist/playground/assets/{yang-Dhd5AEiH.js → yang-lz56y8cI.js} +1 -1
  319. package/dist/playground/assets/{zig-Caf1sO7t.js → zig-egkOq0yY.js} +1 -1
  320. package/dist/playground/index.html +2 -2
  321. package/dist/utils/clone-template.d.ts +3 -0
  322. package/dist/utils/clone-template.d.ts.map +1 -1
  323. package/package.json +16 -18
  324. package/dist/chunk-NHL3S2MZ.js.map +0 -1
  325. package/dist/playground/assets/style-IJXhmGBf.css +0 -1
  326. package/dist/services/browser.d.ts +0 -13
  327. package/dist/services/browser.d.ts.map +0 -1
  328. package/dist/services/service.docker.d.ts +0 -27
  329. package/dist/services/service.docker.d.ts.map +0 -1
  330. package/dist/utils/string.d.ts +0 -2
  331. package/dist/utils/string.d.ts.map +0 -1
@@ -1,138 +1,127 @@
1
1
  import { getAnalytics } from './chunk-OQQFOUQW.js';
2
- import * as p from '@clack/prompts';
2
+ import * as p5 from '@clack/prompts';
3
3
  import color2 from 'picocolors';
4
4
  import fs4 from 'fs/promises';
5
5
  import child_process from 'child_process';
6
6
  import util from 'util';
7
- import path from 'path';
7
+ import path3 from 'path';
8
8
  import shellQuote2 from 'shell-quote';
9
9
  import yoctoSpinner2 from 'yocto-spinner';
10
- import { InvalidArgumentError } from 'commander';
11
- import * as fs3 from 'fs';
12
- import fs3__default, { existsSync } from 'fs';
13
- import os from 'os';
14
10
  import fsExtra, { readJSON, ensureFile, writeJSON } from 'fs-extra/esm';
15
11
  import prettier from 'prettier';
12
+ import * as fs3 from 'fs';
13
+ import fs3__default, { existsSync } from 'fs';
16
14
  import { execa } from 'execa';
17
15
  import { fileURLToPath } from 'url';
16
+ import os from 'os';
17
+ import { InvalidArgumentError } from 'commander';
18
18
  import { PinoLogger } from '@mastra/loggers';
19
19
 
20
- var args = ["-y", "@mastra/mcp-docs-server"];
21
- var createMcpConfig = (editor) => {
22
- if (editor === "vscode") {
23
- return {
24
- servers: {
25
- mastra: process.platform === `win32` ? {
26
- command: "cmd",
27
- args: ["/c", "npx", ...args],
28
- type: "stdio"
29
- } : {
30
- command: "npx",
31
- args,
32
- type: "stdio"
33
- }
34
- }
35
- };
20
+ // package.json
21
+ var package_default = {
22
+ name: "mastra",
23
+ version: "1.0.0-beta.2",
24
+ license: "Apache-2.0",
25
+ description: "cli for mastra",
26
+ type: "module",
27
+ main: "dist/index.js",
28
+ types: "dist/index.d.ts",
29
+ bin: {
30
+ mastra: "./dist/index.js"
31
+ },
32
+ exports: {
33
+ ".": "./dist/index.js",
34
+ "./package.json": "./package.json",
35
+ "./telemetry-loader": "./dist/commands/dev/telemetry-loader.js",
36
+ "./dist/*": [
37
+ "./dist/*",
38
+ "./dist/*.js"
39
+ ]
40
+ },
41
+ files: [
42
+ "dist",
43
+ "CHANGELOG.md"
44
+ ],
45
+ scripts: {
46
+ "build:lib": "tsup --silent --config tsup.config.ts",
47
+ test: "vitest run",
48
+ "test:watch": "vitest watch",
49
+ clean: "rm -rf dist && rm -rf node_modules",
50
+ typecheck: "tsc --noEmit --incremental",
51
+ lint: "eslint ."
52
+ },
53
+ keywords: [
54
+ "mastra",
55
+ "cli",
56
+ "ai",
57
+ "llm",
58
+ "llms",
59
+ "agent",
60
+ "agents",
61
+ "dev",
62
+ "development",
63
+ "deploy",
64
+ "deployment",
65
+ "build",
66
+ "workflow",
67
+ "typescript",
68
+ "command-line",
69
+ "devtools"
70
+ ],
71
+ dependencies: {
72
+ "@clack/prompts": "^0.11.0",
73
+ "@expo/devcert": "^1.2.0",
74
+ "@mastra/deployer": "workspace:^",
75
+ "@mastra/loggers": "workspace:^",
76
+ commander: "^14.0.2",
77
+ dotenv: "^17.2.3",
78
+ execa: "^9.6.0",
79
+ "fs-extra": "^11.3.2",
80
+ "get-port": "^7.1.0",
81
+ picocolors: "^1.1.1",
82
+ "posthog-node": "5.11.2",
83
+ prettier: "^3.6.2",
84
+ "shell-quote": "^1.8.3",
85
+ "strip-json-comments": "^5.0.3",
86
+ "yocto-spinner": "^1.0.0"
87
+ },
88
+ devDependencies: {
89
+ "@commander-js/extra-typings": "^14.0.0",
90
+ "@internal/lint": "workspace:*",
91
+ "@internal/playground": "workspace:*",
92
+ "@internal/types-builder": "workspace:*",
93
+ "@mastra/core": "workspace:*",
94
+ "@microsoft/api-extractor": "^7.55.0",
95
+ "@types/fs-extra": "^11.0.4",
96
+ "@types/node": "22.13.17",
97
+ "@types/shell-quote": "^1.7.5",
98
+ "@vitest/coverage-v8": "catalog:",
99
+ "@vitest/ui": "catalog:",
100
+ eslint: "^9.37.0",
101
+ memfs: "^4.50.0",
102
+ rollup: "^4.50.2",
103
+ tsup: "^8.5.0",
104
+ "type-fest": "^5.2.0",
105
+ typescript: "^5.8.3",
106
+ vitest: "catalog:"
107
+ },
108
+ peerDependencies: {
109
+ "@mastra/core": ">=1.0.0-0 <2.0.0-0",
110
+ zod: "^3.25.0 || ^4.0.0"
111
+ },
112
+ homepage: "https://mastra.ai",
113
+ repository: {
114
+ type: "git",
115
+ url: "git+https://github.com/mastra-ai/mastra.git",
116
+ directory: "packages/cli"
117
+ },
118
+ bugs: {
119
+ url: "https://github.com/mastra-ai/mastra/issues"
120
+ },
121
+ engines: {
122
+ node: ">=22.13.0"
36
123
  }
37
- return {
38
- mcpServers: {
39
- mastra: {
40
- command: "npx",
41
- args
42
- }
43
- }
44
- };
45
124
  };
46
- function makeConfig(original, editor) {
47
- if (editor === "vscode") {
48
- return {
49
- ...original,
50
- servers: {
51
- ...original?.servers || {},
52
- ...createMcpConfig(editor).servers
53
- }
54
- };
55
- }
56
- return {
57
- ...original,
58
- mcpServers: {
59
- ...original?.mcpServers || {},
60
- ...createMcpConfig(editor).mcpServers
61
- }
62
- };
63
- }
64
- async function writeMergedConfig(configPath, editor) {
65
- const configExists = existsSync(configPath);
66
- const config = makeConfig(configExists ? await readJSON(configPath) : {}, editor);
67
- await ensureFile(configPath);
68
- await writeJSON(configPath, config, {
69
- spaces: 2
70
- });
71
- }
72
- var windsurfGlobalMCPConfigPath = path.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
73
- var cursorGlobalMCPConfigPath = path.join(os.homedir(), ".cursor", "mcp.json");
74
- path.join(process.cwd(), ".vscode", "mcp.json");
75
- var vscodeGlobalMCPConfigPath = path.join(
76
- os.homedir(),
77
- process.platform === "win32" ? path.join("AppData", "Roaming", "Code", "User", "settings.json") : process.platform === "darwin" ? path.join("Library", "Application Support", "Code", "User", "settings.json") : path.join(".config", "Code", "User", "settings.json")
78
- );
79
- var EDITOR = ["cursor", "cursor-global", "windsurf", "vscode"];
80
- function isValidEditor(value) {
81
- return EDITOR.includes(value);
82
- }
83
- async function installMastraDocsMCPServer({ editor, directory }) {
84
- if (editor === `cursor`) {
85
- await writeMergedConfig(path.join(directory, ".cursor", "mcp.json"), "cursor");
86
- }
87
- if (editor === `vscode`) {
88
- await writeMergedConfig(path.join(directory, ".vscode", "mcp.json"), "vscode");
89
- }
90
- if (editor === `cursor-global`) {
91
- const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor);
92
- if (alreadyInstalled) {
93
- return;
94
- }
95
- await writeMergedConfig(cursorGlobalMCPConfigPath, "cursor-global");
96
- }
97
- if (editor === `windsurf`) {
98
- const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor);
99
- if (alreadyInstalled) {
100
- return;
101
- }
102
- await writeMergedConfig(windsurfGlobalMCPConfigPath, editor);
103
- }
104
- }
105
- async function globalMCPIsAlreadyInstalled(editor) {
106
- let configPath = ``;
107
- if (editor === "windsurf") {
108
- configPath = windsurfGlobalMCPConfigPath;
109
- } else if (editor === "cursor-global") {
110
- configPath = cursorGlobalMCPConfigPath;
111
- } else if (editor === "vscode") {
112
- configPath = vscodeGlobalMCPConfigPath;
113
- }
114
- if (!configPath || !existsSync(configPath)) {
115
- return false;
116
- }
117
- try {
118
- const configContents = await readJSON(configPath);
119
- if (!configContents) return false;
120
- if (editor === "vscode") {
121
- if (!configContents.servers) return false;
122
- const hasMastraMCP2 = Object.values(configContents.servers).some(
123
- (server) => server?.args?.find((arg) => arg?.includes(`@mastra/mcp-docs-server`))
124
- );
125
- return hasMastraMCP2;
126
- }
127
- if (!configContents?.mcpServers) return false;
128
- const hasMastraMCP = Object.values(configContents.mcpServers).some(
129
- (server) => server?.args?.find((arg) => arg?.includes(`@mastra/mcp-docs-server`))
130
- );
131
- return hasMastraMCP;
132
- } catch {
133
- return false;
134
- }
135
- }
136
125
 
137
126
  // src/utils/package-manager.ts
138
127
  function getPackageManagerAddCommand(pm) {
@@ -159,11 +148,11 @@ var DepsService = class {
159
148
  findLockFile(dir) {
160
149
  const lockFiles = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock", "bun.lock"];
161
150
  for (const file of lockFiles) {
162
- if (fs3__default.existsSync(path.join(dir, file))) {
151
+ if (fs3__default.existsSync(path3.join(dir, file))) {
163
152
  return file;
164
153
  }
165
154
  }
166
- const parentDir = path.resolve(dir, "..");
155
+ const parentDir = path3.resolve(dir, "..");
167
156
  if (parentDir !== dir) {
168
157
  return this.findLockFile(parentDir);
169
158
  }
@@ -196,7 +185,7 @@ var DepsService = class {
196
185
  }
197
186
  async checkDependencies(dependencies) {
198
187
  try {
199
- const packageJsonPath = path.join(process.cwd(), "package.json");
188
+ const packageJsonPath = path3.join(process.cwd(), "package.json");
200
189
  try {
201
190
  await fs4.access(packageJsonPath);
202
191
  } catch {
@@ -216,7 +205,7 @@ var DepsService = class {
216
205
  }
217
206
  async getProjectName() {
218
207
  try {
219
- const packageJsonPath = path.join(process.cwd(), "package.json");
208
+ const packageJsonPath = path3.join(process.cwd(), "package.json");
220
209
  const packageJson = await fs4.readFile(packageJsonPath, "utf-8");
221
210
  const pkg = JSON.parse(packageJson);
222
211
  return pkg.name;
@@ -310,8 +299,8 @@ var FileService = class {
310
299
  */
311
300
  async copyStarterFile(inputFile, outputFilePath, replaceIfExists) {
312
301
  const __filename = fileURLToPath(import.meta.url);
313
- const __dirname = path.dirname(__filename);
314
- const filePath = path.resolve(__dirname, "starter-files", inputFile);
302
+ const __dirname = path3.dirname(__filename);
303
+ const filePath = path3.resolve(__dirname, "starter-files", inputFile);
315
304
  const fileString = fs3__default.readFileSync(filePath, "utf8");
316
305
  if (fs3__default.existsSync(outputFilePath) && !replaceIfExists) {
317
306
  console.info(`${outputFilePath} already exists`);
@@ -321,7 +310,7 @@ var FileService = class {
321
310
  return true;
322
311
  }
323
312
  async setupEnvFile({ dbUrl }) {
324
- const envPath = path.join(process.cwd(), ".env.development");
313
+ const envPath = path3.join(process.cwd(), ".env.development");
325
314
  await fsExtra.ensureFile(envPath);
326
315
  const fileEnvService = new FileEnvService(envPath);
327
316
  await fileEnvService.setEnvValue("DB_URL", dbUrl);
@@ -345,6 +334,131 @@ var FileService = class {
345
334
  fs3__default.writeFileSync(filePath, fileContent);
346
335
  }
347
336
  };
337
+ var createArgs = (versionTag) => {
338
+ const packageName = versionTag ? `@mastra/mcp-docs-server@${versionTag}` : "@mastra/mcp-docs-server";
339
+ return ["-y", packageName];
340
+ };
341
+ var createMcpConfig = (editor, versionTag) => {
342
+ const args = createArgs(versionTag);
343
+ if (editor === "vscode") {
344
+ return {
345
+ servers: {
346
+ mastra: process.platform === `win32` ? {
347
+ command: "cmd",
348
+ args: ["/c", "npx", ...args],
349
+ type: "stdio"
350
+ } : {
351
+ command: "npx",
352
+ args,
353
+ type: "stdio"
354
+ }
355
+ }
356
+ };
357
+ }
358
+ return {
359
+ mcpServers: {
360
+ mastra: {
361
+ command: "npx",
362
+ args
363
+ }
364
+ }
365
+ };
366
+ };
367
+ function makeConfig(original, editor, versionTag) {
368
+ if (editor === "vscode") {
369
+ return {
370
+ ...original,
371
+ servers: {
372
+ ...original?.servers || {},
373
+ ...createMcpConfig(editor, versionTag).servers
374
+ }
375
+ };
376
+ }
377
+ return {
378
+ ...original,
379
+ mcpServers: {
380
+ ...original?.mcpServers || {},
381
+ ...createMcpConfig(editor, versionTag).mcpServers
382
+ }
383
+ };
384
+ }
385
+ async function writeMergedConfig(configPath, editor, versionTag) {
386
+ const configExists = existsSync(configPath);
387
+ const config = makeConfig(configExists ? await readJSON(configPath) : {}, editor, versionTag);
388
+ await ensureFile(configPath);
389
+ await writeJSON(configPath, config, {
390
+ spaces: 2
391
+ });
392
+ }
393
+ var windsurfGlobalMCPConfigPath = path3.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
394
+ var cursorGlobalMCPConfigPath = path3.join(os.homedir(), ".cursor", "mcp.json");
395
+ path3.join(process.cwd(), ".vscode", "mcp.json");
396
+ var vscodeGlobalMCPConfigPath = path3.join(
397
+ os.homedir(),
398
+ process.platform === "win32" ? path3.join("AppData", "Roaming", "Code", "User", "settings.json") : process.platform === "darwin" ? path3.join("Library", "Application Support", "Code", "User", "settings.json") : path3.join(".config", "Code", "User", "settings.json")
399
+ );
400
+ var EDITOR = ["cursor", "cursor-global", "windsurf", "vscode"];
401
+ function isValidEditor(value) {
402
+ return EDITOR.includes(value);
403
+ }
404
+ async function installMastraDocsMCPServer({
405
+ editor,
406
+ directory,
407
+ versionTag
408
+ }) {
409
+ if (editor === `cursor`) {
410
+ await writeMergedConfig(path3.join(directory, ".cursor", "mcp.json"), "cursor", versionTag);
411
+ }
412
+ if (editor === `vscode`) {
413
+ await writeMergedConfig(path3.join(directory, ".vscode", "mcp.json"), "vscode", versionTag);
414
+ }
415
+ if (editor === `cursor-global`) {
416
+ const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);
417
+ if (alreadyInstalled) {
418
+ return;
419
+ }
420
+ await writeMergedConfig(cursorGlobalMCPConfigPath, "cursor-global", versionTag);
421
+ }
422
+ if (editor === `windsurf`) {
423
+ const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);
424
+ if (alreadyInstalled) {
425
+ return;
426
+ }
427
+ await writeMergedConfig(windsurfGlobalMCPConfigPath, editor, versionTag);
428
+ }
429
+ }
430
+ async function globalMCPIsAlreadyInstalled(editor, versionTag) {
431
+ let configPath = ``;
432
+ if (editor === "windsurf") {
433
+ configPath = windsurfGlobalMCPConfigPath;
434
+ } else if (editor === "cursor-global") {
435
+ configPath = cursorGlobalMCPConfigPath;
436
+ } else if (editor === "vscode") {
437
+ configPath = vscodeGlobalMCPConfigPath;
438
+ }
439
+ if (!configPath || !existsSync(configPath)) {
440
+ return false;
441
+ }
442
+ try {
443
+ const configContents = await readJSON(configPath);
444
+ if (!configContents) return false;
445
+ const expectedPackage = versionTag ? `@mastra/mcp-docs-server@${versionTag}` : "@mastra/mcp-docs-server";
446
+ if (editor === "vscode") {
447
+ if (!configContents.servers) return false;
448
+ const hasMastraMCP2 = Object.values(configContents.servers).some(
449
+ (server) => server?.args?.find((arg) => arg === expectedPackage)
450
+ );
451
+ return hasMastraMCP2;
452
+ }
453
+ if (!configContents?.mcpServers) return false;
454
+ const hasMastraMCP = Object.values(configContents.mcpServers).some(
455
+ (server) => server?.args?.find((arg) => arg === expectedPackage)
456
+ );
457
+ return hasMastraMCP;
458
+ } catch {
459
+ return false;
460
+ }
461
+ }
348
462
 
349
463
  // src/commands/init/utils.ts
350
464
  var exec = util.promisify(child_process.exec);
@@ -357,19 +471,19 @@ function areValidComponents(values) {
357
471
  return values.every((value) => COMPONENTS.includes(value));
358
472
  }
359
473
  var getModelIdentifier = (llmProvider) => {
360
- if (llmProvider === "openai") {
361
- return `'openai/gpt-4o-mini'`;
362
- } else if (llmProvider === "anthropic") {
363
- return `'anthropic/claude-sonnet-4-5-20250929'`;
474
+ let model = "openai/gpt-4o";
475
+ if (llmProvider === "anthropic") {
476
+ model = "anthropic/claude-sonnet-4-5";
364
477
  } else if (llmProvider === "groq") {
365
- return `'groq/llama-3.3-70b-versatile'`;
478
+ model = "groq/llama-3.3-70b-versatile";
366
479
  } else if (llmProvider === "google") {
367
- return `'google/gemini-2.5-pro'`;
480
+ model = "google/gemini-2.5-pro";
368
481
  } else if (llmProvider === "cerebras") {
369
- return `'cerebras/llama-3.3-70b'`;
482
+ model = "cerebras/llama-3.3-70b";
370
483
  } else if (llmProvider === "mistral") {
371
- return `'mistral/mistral-medium-2508'`;
484
+ model = "mistral/mistral-medium-2508";
372
485
  }
486
+ return model;
373
487
  };
374
488
  async function writeAgentSample(llmProvider, destPath, addExampleTool, addScorers) {
375
489
  const modelString = getModelIdentifier(llmProvider);
@@ -398,7 +512,7 @@ export const weatherAgent = new Agent({
398
512
  id: 'weather-agent',
399
513
  name: 'Weather Agent',
400
514
  instructions: \`${instructions}\`,
401
- model: ${modelString},
515
+ model: '${modelString}',
402
516
  ${addExampleTool ? "tools: { weatherTool }," : ""}
403
517
  ${addScorers ? `scorers: {
404
518
  toolCallAppropriateness: {
@@ -657,7 +771,7 @@ export const translationScorer = createScorer({
657
771
  description: 'Checks that non-English location names are translated and used correctly',
658
772
  type: 'agent',
659
773
  judge: {
660
- model: ${modelString},
774
+ model: '${modelString}',
661
775
  instructions:
662
776
  'You are an expert evaluator of translation quality for geographic locations. ' +
663
777
  'Determine whether the user text mentions a non-English location and whether the assistant correctly uses an English translation of that location. ' +
@@ -754,7 +868,7 @@ var writeIndexFile = async ({
754
868
  addScorers
755
869
  }) => {
756
870
  const indexPath = dirPath + "/index.ts";
757
- const destPath = path.join(indexPath);
871
+ const destPath = path3.join(indexPath);
758
872
  try {
759
873
  await fs4.writeFile(destPath, "");
760
874
  const filteredExports = [
@@ -869,7 +983,7 @@ var writeAPIKey = async ({ provider, apiKey }) => {
869
983
  };
870
984
  var createMastraDir = async (directory) => {
871
985
  let dir = directory.trim().split("/").filter((item) => item !== "");
872
- const dirPath = path.join(process.cwd(), ...dir, "mastra");
986
+ const dirPath = path3.join(process.cwd(), ...dir, "mastra");
873
987
  try {
874
988
  await fs4.access(dirPath);
875
989
  return { ok: false };
@@ -894,26 +1008,26 @@ var LLM_PROVIDERS = [
894
1008
  { value: "cerebras", label: "Cerebras" },
895
1009
  { value: "mistral", label: "Mistral" }
896
1010
  ];
897
- var interactivePrompt = async (args2 = {}) => {
898
- const { skip = {}, options: { showBanner = true } = {} } = args2;
1011
+ var interactivePrompt = async (args = {}) => {
1012
+ const { skip = {}, options: { showBanner = true } = {} } = args;
899
1013
  if (showBanner) {
900
- p.intro(color2.inverse(" Mastra Init "));
1014
+ p5.intro(color2.inverse(" Mastra Init "));
901
1015
  }
902
- const mastraProject = await p.group(
1016
+ const mastraProject = await p5.group(
903
1017
  {
904
- directory: () => p.text({
1018
+ directory: () => p5.text({
905
1019
  message: "Where should we create the Mastra files? (default: src/)",
906
1020
  placeholder: "src/",
907
1021
  defaultValue: "src/"
908
1022
  }),
909
- llmProvider: () => skip?.llmProvider ? void 0 : p.select({
1023
+ llmProvider: () => skip?.llmProvider ? void 0 : p5.select({
910
1024
  message: "Select a default provider:",
911
1025
  options: LLM_PROVIDERS
912
1026
  }),
913
1027
  llmApiKey: async ({ results: { llmProvider } }) => {
914
1028
  if (skip?.llmApiKey) return void 0;
915
1029
  const llmName = LLM_PROVIDERS.find((p6) => p6.value === llmProvider)?.label || "provider";
916
- const keyChoice = await p.select({
1030
+ const keyChoice = await p5.select({
917
1031
  message: `Enter your ${llmName} API key?`,
918
1032
  options: [
919
1033
  { value: "skip", label: "Skip for now", hint: "default" },
@@ -922,7 +1036,7 @@ var interactivePrompt = async (args2 = {}) => {
922
1036
  initialValue: "skip"
923
1037
  });
924
1038
  if (keyChoice === "enter") {
925
- return p.text({
1039
+ return p5.text({
926
1040
  message: "Enter your API key:",
927
1041
  placeholder: "sk-...",
928
1042
  validate: (value) => {
@@ -933,55 +1047,38 @@ var interactivePrompt = async (args2 = {}) => {
933
1047
  return void 0;
934
1048
  },
935
1049
  configureEditorWithDocsMCP: async () => {
936
- const windsurfIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`windsurf`);
937
- const cursorIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`cursor`);
938
- const vscodeIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`vscode`);
939
- const editor = await p.select({
1050
+ const editor = await p5.select({
940
1051
  message: `Make your IDE into a Mastra expert? (Installs Mastra's MCP server)`,
941
1052
  options: [
942
1053
  { value: "skip", label: "Skip for now", hint: "default" },
943
1054
  {
944
1055
  value: "cursor",
945
- label: "Cursor (project only)",
946
- hint: cursorIsAlreadyInstalled ? `Already installed globally` : void 0
1056
+ label: "Cursor (project only)"
947
1057
  },
948
1058
  {
949
1059
  value: "cursor-global",
950
- label: "Cursor (global, all projects)",
951
- hint: cursorIsAlreadyInstalled ? `Already installed` : void 0
1060
+ label: "Cursor (global, all projects)"
952
1061
  },
953
1062
  {
954
1063
  value: "windsurf",
955
- label: "Windsurf",
956
- hint: windsurfIsAlreadyInstalled ? `Already installed` : void 0
1064
+ label: "Windsurf"
957
1065
  },
958
1066
  {
959
1067
  value: "vscode",
960
- label: "VSCode",
961
- hint: vscodeIsAlreadyInstalled ? `Already installed` : void 0
1068
+ label: "VSCode"
962
1069
  }
963
1070
  ]
964
1071
  });
965
1072
  if (editor === `skip`) return void 0;
966
- if (editor === `windsurf` && windsurfIsAlreadyInstalled) {
967
- p.log.message(`
968
- Windsurf is already installed, skipping.`);
969
- return void 0;
970
- }
971
- if (editor === `vscode` && vscodeIsAlreadyInstalled) {
972
- p.log.message(`
973
- VSCode is already installed, skipping.`);
974
- return void 0;
975
- }
976
1073
  if (editor === `cursor`) {
977
- p.log.message(
1074
+ p5.log.message(
978
1075
  `
979
1076
  Note: you will need to go into Cursor Settings -> MCP Settings and manually enable the installed Mastra MCP server.
980
1077
  `
981
1078
  );
982
1079
  }
983
1080
  if (editor === `cursor-global`) {
984
- const confirm = await p.select({
1081
+ const confirm = await p5.select({
985
1082
  message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
986
1083
  options: [
987
1084
  { value: "yes", label: "Yes, I understand" },
@@ -993,7 +1090,7 @@ Note: you will need to go into Cursor Settings -> MCP Settings and manually enab
993
1090
  }
994
1091
  }
995
1092
  if (editor === `windsurf`) {
996
- const confirm = await p.select({
1093
+ const confirm = await p5.select({
997
1094
  message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
998
1095
  This means the Mastra docs MCP server will be available in all your Windsurf projects.`,
999
1096
  options: [
@@ -1010,7 +1107,7 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
1010
1107
  },
1011
1108
  {
1012
1109
  onCancel: () => {
1013
- p.cancel("Operation cancelled.");
1110
+ p5.cancel("Operation cancelled.");
1014
1111
  process.exit(0);
1015
1112
  }
1016
1113
  }
@@ -1019,18 +1116,16 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
1019
1116
  };
1020
1117
  var checkForPkgJson = async () => {
1021
1118
  const cwd = process.cwd();
1022
- const pkgJsonPath = path.join(cwd, "package.json");
1119
+ const pkgJsonPath = path3.join(cwd, "package.json");
1023
1120
  try {
1024
1121
  await fs4.access(pkgJsonPath);
1025
1122
  } catch {
1026
- p.log.error(
1123
+ p5.log.error(
1027
1124
  'No package.json file found in the current directory. Please run "npm init -y" to create one, or run "npx create-mastra@latest" to create a new Mastra project.'
1028
1125
  );
1029
1126
  process.exit(1);
1030
1127
  }
1031
1128
  };
1032
-
1033
- // src/commands/utils.ts
1034
1129
  function getPackageManager() {
1035
1130
  const userAgent = process.env.npm_config_user_agent || "";
1036
1131
  const execPath = process.env.npm_execpath || "";
@@ -1073,6 +1168,9 @@ function parseLlmProvider(value) {
1073
1168
  }
1074
1169
  return value;
1075
1170
  }
1171
+ function shouldSkipDotenvLoading() {
1172
+ return process.env.MASTRA_SKIP_DOTENV === "true" || process.env.MASTRA_SKIP_DOTENV === "1";
1173
+ }
1076
1174
  var logger = createLogger(false);
1077
1175
  function createLogger(debug = false) {
1078
1176
  return new PinoLogger({
@@ -1084,19 +1182,23 @@ function createLogger(debug = false) {
1084
1182
  // src/utils/clone-template.ts
1085
1183
  var exec2 = util.promisify(child_process.exec);
1086
1184
  async function cloneTemplate(options) {
1087
- const { template, projectName, targetDir } = options;
1088
- const projectPath = targetDir ? path.resolve(targetDir, projectName) : path.resolve(projectName);
1185
+ const { template, projectName, targetDir, branch, llmProvider } = options;
1186
+ const projectPath = targetDir ? path3.resolve(targetDir, projectName) : path3.resolve(projectName);
1089
1187
  const spinner4 = yoctoSpinner2({ text: `Cloning template "${template.title}"...` }).start();
1090
1188
  try {
1091
1189
  if (await directoryExists(projectPath)) {
1092
1190
  spinner4.error(`Directory ${projectName} already exists`);
1093
1191
  throw new Error(`Directory ${projectName} already exists`);
1094
1192
  }
1095
- await cloneRepositoryWithoutGit(template.githubUrl, projectPath);
1193
+ await cloneRepositoryWithoutGit(template.githubUrl, projectPath, branch);
1096
1194
  await updatePackageJson(projectPath, projectName);
1097
- const envExamplePath = path.join(projectPath, ".env.example");
1195
+ const envExamplePath = path3.join(projectPath, ".env.example");
1098
1196
  if (await fileExists(envExamplePath)) {
1099
- await fs4.copyFile(envExamplePath, path.join(projectPath, ".env"));
1197
+ const envPath = path3.join(projectPath, ".env");
1198
+ await fs4.copyFile(envExamplePath, envPath);
1199
+ if (llmProvider) {
1200
+ await updateEnvFile(envPath, llmProvider);
1201
+ }
1100
1202
  }
1101
1203
  spinner4.success(`Template "${template.title}" cloned successfully to ${projectName}`);
1102
1204
  return projectPath;
@@ -1121,21 +1223,27 @@ async function fileExists(filePath) {
1121
1223
  return false;
1122
1224
  }
1123
1225
  }
1124
- async function cloneRepositoryWithoutGit(repoUrl, targetPath) {
1226
+ async function cloneRepositoryWithoutGit(repoUrl, targetPath, branch) {
1125
1227
  await fs4.mkdir(targetPath, { recursive: true });
1126
1228
  try {
1127
1229
  const degitRepo = repoUrl.replace("https://github.com/", "");
1128
- const degitCommand = shellQuote2.quote(["npx", "degit", degitRepo, targetPath]);
1230
+ const degitRepoWithBranch = branch ? `${degitRepo}#${branch}` : degitRepo;
1231
+ const degitCommand = shellQuote2.quote(["npx", "degit", degitRepoWithBranch, targetPath]);
1129
1232
  await exec2(degitCommand, {
1130
1233
  cwd: process.cwd()
1131
1234
  });
1132
1235
  } catch {
1133
1236
  try {
1134
- const gitCommand = shellQuote2.quote(["git", "clone", repoUrl, targetPath]);
1237
+ const gitArgs = ["git", "clone"];
1238
+ if (branch) {
1239
+ gitArgs.push("--branch", branch);
1240
+ }
1241
+ gitArgs.push(repoUrl, targetPath);
1242
+ const gitCommand = shellQuote2.quote(gitArgs);
1135
1243
  await exec2(gitCommand, {
1136
1244
  cwd: process.cwd()
1137
1245
  });
1138
- const gitDir = path.join(targetPath, ".git");
1246
+ const gitDir = path3.join(targetPath, ".git");
1139
1247
  if (await directoryExists(gitDir)) {
1140
1248
  await fs4.rm(gitDir, { recursive: true, force: true });
1141
1249
  }
@@ -1145,7 +1253,7 @@ async function cloneRepositoryWithoutGit(repoUrl, targetPath) {
1145
1253
  }
1146
1254
  }
1147
1255
  async function updatePackageJson(projectPath, projectName) {
1148
- const packageJsonPath = path.join(projectPath, "package.json");
1256
+ const packageJsonPath = path3.join(projectPath, "package.json");
1149
1257
  try {
1150
1258
  const packageJsonContent = await fs4.readFile(packageJsonPath, "utf-8");
1151
1259
  const packageJson = JSON.parse(packageJsonContent);
@@ -1155,6 +1263,22 @@ async function updatePackageJson(projectPath, projectName) {
1155
1263
  logger.warn(`Could not update package.json: ${error instanceof Error ? error.message : "Unknown error"}`);
1156
1264
  }
1157
1265
  }
1266
+ async function updateEnvFile(envPath, llmProvider) {
1267
+ try {
1268
+ const envContent = await fs4.readFile(envPath, "utf-8");
1269
+ const modelString = getModelIdentifier(llmProvider);
1270
+ if (!modelString) {
1271
+ logger.warn(`Could not get model identifier for provider: ${llmProvider}`);
1272
+ return;
1273
+ }
1274
+ const modelValue = modelString.replace(/'/g, "");
1275
+ const updatedContent = envContent.replace(/^MODEL=.*/m, `MODEL=${modelValue}`);
1276
+ await fs4.writeFile(envPath, updatedContent, "utf-8");
1277
+ logger.info(`Updated MODEL in .env to ${modelValue}`);
1278
+ } catch (error) {
1279
+ logger.warn(`Could not update .env file: ${error instanceof Error ? error.message : "Unknown error"}`);
1280
+ }
1281
+ }
1158
1282
  async function installDependencies(projectPath, packageManager) {
1159
1283
  const spinner4 = yoctoSpinner2({ text: "Installing dependencies..." }).start();
1160
1284
  try {
@@ -1210,11 +1334,11 @@ async function selectTemplate(templates) {
1210
1334
  hint: parts.join(", ") || "Template components"
1211
1335
  };
1212
1336
  });
1213
- const selected = await p.select({
1337
+ const selected = await p5.select({
1214
1338
  message: "Select a template:",
1215
1339
  options: choices
1216
1340
  });
1217
- if (p.isCancel(selected)) {
1341
+ if (p5.isCancel(selected)) {
1218
1342
  return null;
1219
1343
  }
1220
1344
  return selected;
@@ -1232,7 +1356,7 @@ function findTemplateByName(templates, templateName) {
1232
1356
  function getDefaultProjectName(template) {
1233
1357
  return template.slug.replace(/^template-/, "");
1234
1358
  }
1235
- var s = p.spinner();
1359
+ var s = p5.spinner();
1236
1360
  var init = async ({
1237
1361
  directory = "src/",
1238
1362
  components,
@@ -1294,19 +1418,20 @@ var init = async ({
1294
1418
  if (configureEditorWithDocsMCP) {
1295
1419
  await installMastraDocsMCPServer({
1296
1420
  editor: configureEditorWithDocsMCP,
1297
- directory: process.cwd()
1421
+ directory: process.cwd(),
1422
+ versionTag
1298
1423
  });
1299
1424
  }
1300
1425
  s.stop();
1301
1426
  if (!llmApiKey) {
1302
- p.note(`
1427
+ p5.note(`
1303
1428
  ${color2.green("Mastra initialized successfully!")}
1304
1429
 
1305
1430
  Add your ${color2.cyan(key)} as an environment variable
1306
1431
  in your ${color2.cyan(".env")} file
1307
1432
  `);
1308
1433
  } else {
1309
- p.note(`
1434
+ p5.note(`
1310
1435
  ${color2.green("Mastra initialized successfully!")}
1311
1436
  `);
1312
1437
  }
@@ -1373,8 +1498,8 @@ var createMastraProject = async ({
1373
1498
  llmApiKey,
1374
1499
  needsInteractive
1375
1500
  }) => {
1376
- p.intro(color2.inverse(" Mastra Create "));
1377
- const projectName = name ?? await p.text({
1501
+ p5.intro(color2.inverse(" Mastra Create "));
1502
+ const projectName = name ?? await p5.text({
1378
1503
  message: "What do you want to name your project?",
1379
1504
  placeholder: "my-mastra-app",
1380
1505
  defaultValue: "my-mastra-app",
@@ -1385,8 +1510,8 @@ var createMastraProject = async ({
1385
1510
  }
1386
1511
  }
1387
1512
  });
1388
- if (p.isCancel(projectName)) {
1389
- p.cancel("Operation cancelled");
1513
+ if (p5.isCancel(projectName)) {
1514
+ p5.cancel("Operation cancelled");
1390
1515
  process.exit(0);
1391
1516
  }
1392
1517
  let result;
@@ -1396,7 +1521,7 @@ var createMastraProject = async ({
1396
1521
  skip: { llmProvider: llmProvider !== void 0, llmApiKey: llmApiKey !== void 0 }
1397
1522
  });
1398
1523
  }
1399
- const s2 = p.spinner();
1524
+ const s2 = p5.spinner();
1400
1525
  try {
1401
1526
  s2.start("Creating project");
1402
1527
  try {
@@ -1489,33 +1614,40 @@ var createMastraProject = async ({
1489
1614
  throw new Error(`Failed to create .gitignore: ${error instanceof Error ? error.message : "Unknown error"}`);
1490
1615
  }
1491
1616
  s2.stop(".gitignore added");
1492
- p.outro("Project created successfully");
1617
+ p5.outro("Project created successfully");
1493
1618
  console.info("");
1494
1619
  return { projectName, result };
1495
1620
  } catch (error) {
1496
1621
  s2.stop();
1497
1622
  const errorMessage = error instanceof Error ? error.message : "An unexpected error occurred";
1498
- p.cancel(`Project creation failed: ${errorMessage}`);
1623
+ p5.cancel(`Project creation failed: ${errorMessage}`);
1499
1624
  process.exit(1);
1500
1625
  }
1501
1626
  };
1502
1627
 
1503
1628
  // src/commands/create/create.ts
1504
- var create = async (args2) => {
1505
- if (args2.template !== void 0) {
1506
- await createFromTemplate({ ...args2, injectedAnalytics: args2.analytics });
1629
+ var version = package_default.version;
1630
+ var create = async (args) => {
1631
+ if (args.template !== void 0) {
1632
+ await createFromTemplate({
1633
+ projectName: args.projectName,
1634
+ template: args.template,
1635
+ timeout: args.timeout,
1636
+ injectedAnalytics: args.analytics,
1637
+ llmProvider: args.llmProvider
1638
+ });
1507
1639
  return;
1508
1640
  }
1509
- const needsInteractive = args2.components === void 0 || args2.llmProvider === void 0 || args2.addExample === void 0;
1641
+ const needsInteractive = args.components === void 0 || args.llmProvider === void 0 || args.addExample === void 0;
1510
1642
  const { projectName, result } = await createMastraProject({
1511
- projectName: args2?.projectName,
1512
- createVersionTag: args2?.createVersionTag,
1513
- timeout: args2?.timeout,
1514
- llmProvider: args2?.llmProvider,
1515
- llmApiKey: args2?.llmApiKey,
1643
+ projectName: args?.projectName,
1644
+ createVersionTag: args?.createVersionTag,
1645
+ timeout: args?.timeout,
1646
+ llmProvider: args?.llmProvider,
1647
+ llmApiKey: args?.llmApiKey,
1516
1648
  needsInteractive
1517
1649
  });
1518
- const directory = args2.directory || "src/";
1650
+ const directory = args.directory || "src/";
1519
1651
  if (needsInteractive && result) {
1520
1652
  const analytics2 = getAnalytics();
1521
1653
  if (analytics2 && result?.llmProvider) {
@@ -1529,12 +1661,12 @@ var create = async (args2) => {
1529
1661
  llmApiKey: result?.llmApiKey,
1530
1662
  components: ["agents", "tools", "workflows", "scorers"],
1531
1663
  addExample: true,
1532
- versionTag: args2.createVersionTag
1664
+ versionTag: args.createVersionTag
1533
1665
  });
1534
1666
  postCreate({ projectName });
1535
1667
  return;
1536
1668
  }
1537
- const { components = [], llmProvider = "openai", addExample = false, llmApiKey } = args2;
1669
+ const { components = [], llmProvider = "openai", addExample = false, llmApiKey } = args;
1538
1670
  const analytics = getAnalytics();
1539
1671
  if (analytics) {
1540
1672
  analytics.trackEvent("cli_model_provider_selected", {
@@ -1548,14 +1680,14 @@ var create = async (args2) => {
1548
1680
  llmProvider,
1549
1681
  addExample,
1550
1682
  llmApiKey,
1551
- configureEditorWithDocsMCP: args2.mcpServer,
1552
- versionTag: args2.createVersionTag
1683
+ configureEditorWithDocsMCP: args.mcpServer,
1684
+ versionTag: args.createVersionTag
1553
1685
  });
1554
1686
  postCreate({ projectName });
1555
1687
  };
1556
1688
  var postCreate = ({ projectName }) => {
1557
1689
  const packageManager = getPackageManager();
1558
- p.outro(`
1690
+ p5.outro(`
1559
1691
  ${color2.green("To start your project:")}
1560
1692
 
1561
1693
  ${color2.cyan("cd")} ${projectName}
@@ -1640,36 +1772,36 @@ async function createFromGitHubUrl(url) {
1640
1772
  workflows: []
1641
1773
  };
1642
1774
  }
1643
- async function createFromTemplate(args2) {
1775
+ async function createFromTemplate(args) {
1644
1776
  let selectedTemplate;
1645
- if (args2.template === true) {
1777
+ if (args.template === true) {
1646
1778
  const templates = await loadTemplates();
1647
1779
  const selected = await selectTemplate(templates);
1648
1780
  if (!selected) {
1649
- p.log.info("No template selected. Exiting.");
1781
+ p5.log.info("No template selected. Exiting.");
1650
1782
  return;
1651
1783
  }
1652
1784
  selectedTemplate = selected;
1653
- } else if (args2.template && typeof args2.template === "string") {
1654
- if (isGitHubUrl(args2.template)) {
1655
- const spinner4 = p.spinner();
1785
+ } else if (args.template && typeof args.template === "string") {
1786
+ if (isGitHubUrl(args.template)) {
1787
+ const spinner4 = p5.spinner();
1656
1788
  spinner4.start("Validating GitHub repository...");
1657
- const validation = await validateGitHubProject(args2.template);
1789
+ const validation = await validateGitHubProject(args.template);
1658
1790
  if (!validation.isValid) {
1659
1791
  spinner4.stop("Validation failed");
1660
- p.log.error("This does not appear to be a valid Mastra project:");
1661
- validation.errors.forEach((error) => p.log.error(` - ${error}`));
1792
+ p5.log.error("This does not appear to be a valid Mastra project:");
1793
+ validation.errors.forEach((error) => p5.log.error(` - ${error}`));
1662
1794
  throw new Error("Invalid Mastra project");
1663
1795
  }
1664
1796
  spinner4.stop("Valid Mastra project \u2713");
1665
- selectedTemplate = await createFromGitHubUrl(args2.template);
1797
+ selectedTemplate = await createFromGitHubUrl(args.template);
1666
1798
  } else {
1667
1799
  const templates = await loadTemplates();
1668
- const found = findTemplateByName(templates, args2.template);
1800
+ const found = findTemplateByName(templates, args.template);
1669
1801
  if (!found) {
1670
- p.log.error(`Template "${args2.template}" not found. Available templates:`);
1671
- templates.forEach((t) => p.log.info(` - ${t.title} (use: ${t.slug.replace("template-", "")})`));
1672
- throw new Error(`Template "${args2.template}" not found`);
1802
+ p5.log.error(`Template "${args.template}" not found. Available templates:`);
1803
+ templates.forEach((t) => p5.log.info(` - ${t.title} (use: ${t.slug.replace("template-", "")})`));
1804
+ throw new Error(`Template "${args.template}" not found`);
1673
1805
  }
1674
1806
  selectedTemplate = found;
1675
1807
  }
@@ -1677,34 +1809,57 @@ async function createFromTemplate(args2) {
1677
1809
  if (!selectedTemplate) {
1678
1810
  throw new Error("No template selected");
1679
1811
  }
1680
- let projectName = args2.projectName;
1812
+ let projectName = args.projectName;
1681
1813
  if (!projectName) {
1682
1814
  const defaultName = getDefaultProjectName(selectedTemplate);
1683
- const response = await p.text({
1815
+ const response = await p5.text({
1684
1816
  message: "What is your project name?",
1685
1817
  defaultValue: defaultName,
1686
1818
  placeholder: defaultName
1687
1819
  });
1688
- if (p.isCancel(response)) {
1689
- p.log.info("Project creation cancelled.");
1820
+ if (p5.isCancel(response)) {
1821
+ p5.log.info("Project creation cancelled.");
1690
1822
  return;
1691
1823
  }
1692
1824
  projectName = response;
1693
1825
  }
1826
+ let llmProvider = args.llmProvider;
1827
+ if (!llmProvider) {
1828
+ const providerResponse = await p5.select({
1829
+ message: "Select a default provider:",
1830
+ options: LLM_PROVIDERS
1831
+ });
1832
+ if (p5.isCancel(providerResponse)) {
1833
+ p5.log.info("Project creation cancelled.");
1834
+ return;
1835
+ }
1836
+ llmProvider = providerResponse;
1837
+ }
1694
1838
  try {
1695
- const analytics = args2.injectedAnalytics || getAnalytics();
1839
+ const analytics = args.injectedAnalytics || getAnalytics();
1696
1840
  if (analytics) {
1697
1841
  analytics.trackEvent("cli_template_used", {
1698
1842
  template_slug: selectedTemplate.slug,
1699
1843
  template_title: selectedTemplate.title
1700
1844
  });
1845
+ if (llmProvider) {
1846
+ analytics.trackEvent("cli_model_provider_selected", {
1847
+ provider: llmProvider,
1848
+ selection_method: args.llmProvider ? "cli_args" : "interactive"
1849
+ });
1850
+ }
1701
1851
  }
1852
+ const isBeta = version?.includes("beta") ?? false;
1853
+ const isMastraTemplate = selectedTemplate.githubUrl.includes("github.com/mastra-ai/");
1854
+ const branch = isBeta && isMastraTemplate ? "beta" : void 0;
1702
1855
  const projectPath = await cloneTemplate({
1703
1856
  template: selectedTemplate,
1704
- projectName
1857
+ projectName,
1858
+ branch,
1859
+ llmProvider
1705
1860
  });
1706
1861
  await installDependencies(projectPath);
1707
- p.note(`
1862
+ p5.note(`
1708
1863
  ${color2.green("Mastra template installed!")}
1709
1864
 
1710
1865
  Add the necessary environment
@@ -1712,11 +1867,11 @@ async function createFromTemplate(args2) {
1712
1867
  `);
1713
1868
  postCreate({ projectName });
1714
1869
  } catch (error) {
1715
- p.log.error(`Failed to create project from template: ${error instanceof Error ? error.message : "Unknown error"}`);
1870
+ p5.log.error(`Failed to create project from template: ${error instanceof Error ? error.message : "Unknown error"}`);
1716
1871
  throw error;
1717
1872
  }
1718
1873
  }
1719
1874
 
1720
- export { COMPONENTS, DepsService, FileService, LLMProvider, checkAndInstallCoreDeps, checkForPkgJson, create, createLogger, init, interactivePrompt, logger, parseComponents, parseLlmProvider, parseMcp };
1721
- //# sourceMappingURL=chunk-NHL3S2MZ.js.map
1722
- //# sourceMappingURL=chunk-NHL3S2MZ.js.map
1875
+ export { COMPONENTS, DepsService, FileService, LLMProvider, checkAndInstallCoreDeps, checkForPkgJson, create, createLogger, init, interactivePrompt, logger, package_default, parseComponents, parseLlmProvider, parseMcp, shouldSkipDotenvLoading };
1876
+ //# sourceMappingURL=chunk-LC24FTF4.js.map
1877
+ //# sourceMappingURL=chunk-LC24FTF4.js.map