mastra 1.0.0-beta.1 → 1.0.0-beta.3
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.
- package/CHANGELOG.md +46 -0
- package/dist/{chunk-NHL3S2MZ.js → chunk-EAX43UYP.js} +455 -245
- package/dist/chunk-EAX43UYP.js.map +1 -0
- package/dist/commands/actions/start-dev-server.d.ts +2 -2
- package/dist/commands/actions/start-dev-server.d.ts.map +1 -1
- package/dist/commands/build/BuildBundler.d.ts.map +1 -1
- package/dist/commands/create/create.d.ts.map +1 -1
- package/dist/commands/create/create.js +1 -1
- package/dist/commands/create/utils.d.ts.map +1 -1
- package/dist/commands/dev/DevBundler.d.ts.map +1 -1
- package/dist/commands/dev/dev.d.ts +2 -2
- package/dist/commands/dev/dev.d.ts.map +1 -1
- package/dist/commands/init/init.d.ts.map +1 -1
- package/dist/commands/init/mcp-docs-server-install.d.ts +3 -2
- package/dist/commands/init/mcp-docs-server-install.d.ts.map +1 -1
- package/dist/commands/init/utils.d.ts +7 -1
- package/dist/commands/init/utils.d.ts.map +1 -1
- package/dist/commands/start/start.d.ts.map +1 -1
- package/dist/commands/utils.d.ts +2 -1
- package/dist/commands/utils.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -15
- package/dist/index.js.map +1 -1
- package/dist/playground/assets/{abap-1CzS1sOj.js → abap-hi5xR-f3.js} +1 -1
- package/dist/playground/assets/{abnf-DGOvXig-.js → abnf-7v7Gfd-h.js} +1 -1
- package/dist/playground/assets/{actionscript-Ckam20DI.js → actionscript-xz2N2DGS.js} +1 -1
- package/dist/playground/assets/{ada-BFBuxkjJ.js → ada-rBMBqKg8.js} +1 -1
- package/dist/playground/assets/{agda-Tq5ut5V8.js → agda-mZDmzN_0.js} +1 -1
- package/dist/playground/assets/{al-DGhsGLAq.js → al-0bEZPs8Q.js} +1 -1
- package/dist/playground/assets/{antlr4-BFV6m952.js → antlr4-CHZ8E9Jr.js} +1 -1
- package/dist/playground/assets/{apacheconf-CbuLdkuI.js → apacheconf-B8we8I__.js} +1 -1
- package/dist/playground/assets/{apex-HFdqHYhh.js → apex-B0sHxdce.js} +1 -1
- package/dist/playground/assets/{apl-DFVCf5n0.js → apl-DEqj1Qov.js} +1 -1
- package/dist/playground/assets/{applescript-DBgTu4l9.js → applescript-BB5BBhVX.js} +1 -1
- package/dist/playground/assets/{aql-gZpNcV2Z.js → aql-D5QI0LhF.js} +1 -1
- package/dist/playground/assets/{arduino-fHUI01vu.js → arduino-DiqCoVKg.js} +1 -1
- package/dist/playground/assets/{arff-CGHPsxEa.js → arff-GlmYJqfq.js} +1 -1
- package/dist/playground/assets/{asciidoc-BLL0AFhH.js → asciidoc-CufXbovb.js} +1 -1
- package/dist/playground/assets/{asm6502-gHMXkX3O.js → asm6502-Cm4ffo8h.js} +1 -1
- package/dist/playground/assets/{asmatmel-Djar7TVY.js → asmatmel-BDSD6xsq.js} +1 -1
- package/dist/playground/assets/{aspnet-CT-3fxZA.js → aspnet-CvhXTgj6.js} +1 -1
- package/dist/playground/assets/{autohotkey-C2LuJtTY.js → autohotkey-CKMwD4Gz.js} +1 -1
- package/dist/playground/assets/{autoit-D7z9Oj0a.js → autoit-AChephto.js} +1 -1
- package/dist/playground/assets/{avisynth-DH-1joIy.js → avisynth-BOyOwA1o.js} +1 -1
- package/dist/playground/assets/{avro-idl-CwMmBvL0.js → avro-idl-C0yWYX81.js} +1 -1
- package/dist/playground/assets/{bash-DC9ltNCH.js → bash-XWoFsRzd.js} +1 -1
- package/dist/playground/assets/{basic-BvNdNPPC.js → basic-Mnw_ux53.js} +1 -1
- package/dist/playground/assets/{batch-B2A0-lrO.js → batch-B9MlvRE2.js} +1 -1
- package/dist/playground/assets/{bbcode-C-cdSQU1.js → bbcode-Ciji8ByP.js} +1 -1
- package/dist/playground/assets/{bicep-wR2S1QWa.js → bicep-D1EdIBPn.js} +1 -1
- package/dist/playground/assets/{birb-DxKsEIRC.js → birb-BRpJckg9.js} +1 -1
- package/dist/playground/assets/{bison-BrtjR4_0.js → bison-C6YVcPw1.js} +1 -1
- package/dist/playground/assets/{bnf-DZXJcNWs.js → bnf-DDUPjETt.js} +1 -1
- package/dist/playground/assets/{brainfuck-GsQ3r7ZS.js → brainfuck-Db4XiXWB.js} +1 -1
- package/dist/playground/assets/{brightscript-Cm5JZVO7.js → brightscript-7dqNWp7x.js} +1 -1
- package/dist/playground/assets/{bro-ofyQMWa0.js → bro-Ddi_DwqI.js} +1 -1
- package/dist/playground/assets/{bsl-BA39c2V2.js → bsl-I3GAPh-u.js} +1 -1
- package/dist/playground/assets/{c-w4TQc2DV.js → c-Bx3nE9c7.js} +1 -1
- package/dist/playground/assets/{cfscript-DB2UdqrI.js → cfscript-IPNo9uDu.js} +1 -1
- package/dist/playground/assets/{chaiscript-DKw0DBKq.js → chaiscript-xbCu56-s.js} +1 -1
- package/dist/playground/assets/{cil-B1Aij6Ac.js → cil-CKMYAmL6.js} +1 -1
- package/dist/playground/assets/{clike-PYh2Df1m.js → clike-DN-9P0sY.js} +1 -1
- package/dist/playground/assets/{clojure-C3Kzfbxr.js → clojure-CNUzMdwP.js} +1 -1
- package/dist/playground/assets/{cmake-B5lEWe4v.js → cmake-Ci-Vwty2.js} +1 -1
- package/dist/playground/assets/{cobol-DV2v69DZ.js → cobol-3e5P9psv.js} +1 -1
- package/dist/playground/assets/{coffeescript-DPMm0h67.js → coffeescript-Bw9Bra84.js} +1 -1
- package/dist/playground/assets/{concurnas-5ceC2vtu.js → concurnas-DMwulBga.js} +1 -1
- package/dist/playground/assets/{coq-CJx3sS2Y.js → coq-CQhtObjk.js} +1 -1
- package/dist/playground/assets/{core-awL-mrqC.js → core-CaEfaHU-.js} +1 -1
- package/dist/playground/assets/{cpp-Dqtv01mn.js → cpp-BeV4DkTh.js} +1 -1
- package/dist/playground/assets/{crystal-YmylMN4k.js → crystal-DbQnd3d7.js} +1 -1
- package/dist/playground/assets/{csharp-6LRLb3wj.js → csharp-CdF675XK.js} +1 -1
- package/dist/playground/assets/{cshtml-Cx2gpcdc.js → cshtml-Be3cWtSO.js} +1 -1
- package/dist/playground/assets/{csp-JoKz2eQf.js → csp-Cxn6Wl22.js} +1 -1
- package/dist/playground/assets/{css-extras-CCuLtFJx.js → css-extras-tG6D_Zlh.js} +1 -1
- package/dist/playground/assets/{css-Dn_Nm8K5.js → css-nijfQzQe.js} +1 -1
- package/dist/playground/assets/{csv-BOqfDvgc.js → csv-yObzk9H3.js} +1 -1
- package/dist/playground/assets/{cypher-B8lcZcX-.js → cypher-D6Oofnhx.js} +1 -1
- package/dist/playground/assets/{d-C7p5_QW4.js → d-DZTehyj0.js} +1 -1
- package/dist/playground/assets/{dart-DHVKj4dD.js → dart-D-nt0PO4.js} +1 -1
- package/dist/playground/assets/{dataweave-BLVaR6RS.js → dataweave-DhkC0oWt.js} +1 -1
- package/dist/playground/assets/{dax-CAuQA-pw.js → dax-B3WUvjxH.js} +1 -1
- package/dist/playground/assets/{dhall-6-srnnFP.js → dhall-DV4YijyL.js} +1 -1
- package/dist/playground/assets/{diff-yP5aAuhk.js → diff-ZuEV80Tk.js} +1 -1
- package/dist/playground/assets/{django-Bc3LGca8.js → django-CYp1KUqS.js} +1 -1
- package/dist/playground/assets/{dns-zone-file-DuMFp9AD.js → dns-zone-file-Bm2PZbl5.js} +1 -1
- package/dist/playground/assets/{docker-qGjcWmeQ.js → docker-BCoh7LzU.js} +1 -1
- package/dist/playground/assets/{dot-Nng7Jq-1.js → dot-lXkbyhSR.js} +1 -1
- package/dist/playground/assets/{ebnf-DGw7D5FO.js → ebnf-DbZ4GbQS.js} +1 -1
- package/dist/playground/assets/{editorconfig-DdNdUHyk.js → editorconfig-Boo3p0jH.js} +1 -1
- package/dist/playground/assets/{eiffel-Djs2lIA5.js → eiffel-BjmcwQpy.js} +1 -1
- package/dist/playground/assets/{ejs-BgckZXji.js → ejs-cw9Ctd78.js} +1 -1
- package/dist/playground/assets/{elixir-DxPbR3j9.js → elixir-18HryfIz.js} +1 -1
- package/dist/playground/assets/{elm-CQjhvMG4.js → elm-BW70B5Fv.js} +1 -1
- package/dist/playground/assets/{erb-BkC_lhzH.js → erb-DMH0eV55.js} +1 -1
- package/dist/playground/assets/{erlang-DI8fwDZA.js → erlang-B9-sDWb9.js} +1 -1
- package/dist/playground/assets/{etlua-W0w0A9i7.js → etlua-sghqRDJp.js} +1 -1
- package/dist/playground/assets/{excel-formula-DJC3DTW2.js → excel-formula-iYjdy8J6.js} +1 -1
- package/dist/playground/assets/{factor-p_aKOy3O.js → factor-Bq6jfUlO.js} +1 -1
- package/dist/playground/assets/{false-C0slWFk4.js → false--NGcaTmV.js} +1 -1
- package/dist/playground/assets/{firestore-security-rules-D6b3ZM9O.js → firestore-security-rules-DkYeQNqU.js} +1 -1
- package/dist/playground/assets/{flow-B97Z5M5g.js → flow-CbqkaA-y.js} +1 -1
- package/dist/playground/assets/{fortran-yTOeV9tz.js → fortran-RETSUdfV.js} +1 -1
- package/dist/playground/assets/{fsharp-Clw45DHR.js → fsharp-4K_DkGtS.js} +1 -1
- package/dist/playground/assets/{ftl-C2xVUBxP.js → ftl-Dd__vhkf.js} +1 -1
- package/dist/playground/assets/{gap-CEo3Gc7J.js → gap-BVJNDI6Z.js} +1 -1
- package/dist/playground/assets/{gcode-BVO5YHmP.js → gcode-Zw94bxd8.js} +1 -1
- package/dist/playground/assets/{gdscript-o3sqxne-.js → gdscript-BPjkpAGk.js} +1 -1
- package/dist/playground/assets/{gedcom-94FHn7C-.js → gedcom-U9m2gP_H.js} +1 -1
- package/dist/playground/assets/{gherkin-BcHPeTR7.js → gherkin-BAlaHKLO.js} +1 -1
- package/dist/playground/assets/{git-CX4wgYVJ.js → git-6KQSEwZQ.js} +1 -1
- package/dist/playground/assets/{glsl-xGVEgQY-.js → glsl-D-UIScxz.js} +1 -1
- package/dist/playground/assets/{gml-O85a0Qq7.js → gml-7kpFTtBx.js} +1 -1
- package/dist/playground/assets/{gn-Gkh_ZE4p.js → gn-CfqTfMtW.js} +1 -1
- package/dist/playground/assets/{go-RKuHUD8p.js → go-DbM_Zrgy.js} +1 -1
- package/dist/playground/assets/{go-module-Cd5B1mIJ.js → go-module-Bdm6W8wZ.js} +1 -1
- package/dist/playground/assets/{graphql-Dw7AAUz0.js → graphql-D1tlp2_5.js} +1 -1
- package/dist/playground/assets/{groovy-DGB_T7dF.js → groovy-kF5mPP_h.js} +1 -1
- package/dist/playground/assets/{haml-DvClPB1G.js → haml-guYTWnwQ.js} +1 -1
- package/dist/playground/assets/{handlebars-Cl-GBNZQ.js → handlebars-BOSLKyrD.js} +1 -1
- package/dist/playground/assets/{haskell-wM0n-rcH.js → haskell-DH_AYQpm.js} +1 -1
- package/dist/playground/assets/{haxe-iDkJJGVM.js → haxe-CyaLxrne.js} +1 -1
- package/dist/playground/assets/{hcl-Cn0S_wf6.js → hcl-DbWAEmWr.js} +1 -1
- package/dist/playground/assets/{hlsl-BjE4WxqQ.js → hlsl-CZOYeEwX.js} +1 -1
- package/dist/playground/assets/{hoon-rUOUCZ3W.js → hoon-By1ubi4u.js} +1 -1
- package/dist/playground/assets/{hpkp-DP_4F80b.js → hpkp-VhsORUOQ.js} +1 -1
- package/dist/playground/assets/{hsts-DVvdi9ar.js → hsts-CEAl3dey.js} +1 -1
- package/dist/playground/assets/{http-Bwcz59ub.js → http-ClDe-iSz.js} +1 -1
- package/dist/playground/assets/{ichigojam-DZffFFD5.js → ichigojam-0Z5sTchy.js} +1 -1
- package/dist/playground/assets/{icon-C0b7nx0h.js → icon-ByyjMM3V.js} +1 -1
- package/dist/playground/assets/{icu-message-format-DjVkXpEj.js → icu-message-format-Bq6WVBns.js} +1 -1
- package/dist/playground/assets/{idris-0jwu3qTZ.js → idris-Dvatgydq.js} +1 -1
- package/dist/playground/assets/{iecst-CKOHCzS7.js → iecst-DQGuIq-8.js} +1 -1
- package/dist/playground/assets/{ignore-CUsnJVxM.js → ignore-DFKp0Aya.js} +1 -1
- package/dist/playground/assets/{index-BMPzBpdy.js → index-5XzugkzT.js} +1 -1
- package/dist/playground/assets/{index-DaDsg3iZ.js → index-B5QHQPcc.js} +1 -1
- package/dist/playground/assets/{index-BqjMKSph.js → index-BKkDlIuC.js} +1 -1
- package/dist/playground/assets/{index-PrsQv3Q5.js → index-BQIf8xtB.js} +1 -1
- package/dist/playground/assets/{index-CWl7KBtZ.js → index-BS3QaOqH.js} +1 -1
- package/dist/playground/assets/{index-Ct2mUODZ.js → index-BmwDYRVW.js} +1 -1
- package/dist/playground/assets/{index-DSHLyy0s.js → index-Bt6xYZXC.js} +1 -1
- package/dist/playground/assets/{index-Dal4mcJQ.js → index-CE7Hg13c.js} +1 -1
- package/dist/playground/assets/{index-BUieIqcC.js → index-CFGtTuHW.js} +1 -1
- package/dist/playground/assets/{index-mnBv4IDG.js → index-CfLIvHJK.js} +1 -1
- package/dist/playground/assets/{index-CgMSb0ib.js → index-CxEBtMsF.js} +1 -1
- package/dist/playground/assets/{index-Dhm4G7YM.js → index-DZ1aIzNa.js} +1 -1
- package/dist/playground/assets/{index-5430GCVb.js → index-DbsebLxg.js} +1 -1
- package/dist/playground/assets/{index-Dvbs85st.js → index-DoBntcDL.js} +1 -1
- package/dist/playground/assets/{index-C4U2p1Ac.js → index-DwBFE1sF.js} +316 -312
- package/dist/playground/assets/{index-BIPLi07j.js → index-FCdUmrLj.js} +1 -1
- package/dist/playground/assets/{index-CLu0RbtZ.js → index-YrQGTP8f.js} +1 -1
- package/dist/playground/assets/{index-Bh7AT5zU.js → index-qPUVOvcP.js} +1 -1
- package/dist/playground/assets/{inform7-BE_oO7eR.js → inform7-6nkB6n0R.js} +1 -1
- package/dist/playground/assets/{ini-DRJ1Lb58.js → ini-PtGpr3h6.js} +1 -1
- package/dist/playground/assets/{io-DD1DLPfJ.js → io-vsP6cn2d.js} +1 -1
- package/dist/playground/assets/{j-BO_N_FDB.js → j-B6ERsBat.js} +1 -1
- package/dist/playground/assets/{java-BzZsqQhG.js → java-BScGIydW.js} +1 -1
- package/dist/playground/assets/{javadoc-BwxdkkEO.js → javadoc--Nh-wUIu.js} +1 -1
- package/dist/playground/assets/{javadoclike-CBDKG3Kl.js → javadoclike-B3YTqv0Q.js} +1 -1
- package/dist/playground/assets/{javascript-hTZuOaC5.js → javascript-DGsxv-rl.js} +1 -1
- package/dist/playground/assets/{javastacktrace-ZOpfCGh5.js → javastacktrace-DA4GS92f.js} +1 -1
- package/dist/playground/assets/{jexl-CoQAfDY-.js → jexl-D_FTsIkb.js} +1 -1
- package/dist/playground/assets/{jolie-BXuheID5.js → jolie-95JAx9qj.js} +1 -1
- package/dist/playground/assets/{jq-D2V9LUqd.js → jq-U10jHoOg.js} +1 -1
- package/dist/playground/assets/{js-extras-Bdsx2AmN.js → js-extras-BGj6w4Dv.js} +1 -1
- package/dist/playground/assets/{js-templates-CVWBbSad.js → js-templates-imJ80BSZ.js} +1 -1
- package/dist/playground/assets/{jsdoc-xVA9Cj-w.js → jsdoc-Dus_j7vS.js} +1 -1
- package/dist/playground/assets/{json-v46bxzze.js → json-DhxzJR52.js} +1 -1
- package/dist/playground/assets/{json5-DwTC9_aM.js → json5-DgQOZAHi.js} +1 -1
- package/dist/playground/assets/{jsonp-DtwmHxcv.js → jsonp-C_ysyfZI.js} +1 -1
- package/dist/playground/assets/{jsstacktrace-D7MUpJmS.js → jsstacktrace-BlX98tzu.js} +1 -1
- package/dist/playground/assets/{jsx-B2ZPu_sF.js → jsx-neHBUq08.js} +1 -1
- package/dist/playground/assets/{julia-C-4dl-Eh.js → julia-BdiRK3iK.js} +1 -1
- package/dist/playground/assets/{keepalived-9r2MYVcY.js → keepalived-BKpIsPIY.js} +1 -1
- package/dist/playground/assets/{keyman-DvHNjcz5.js → keyman-D9I2Y9OA.js} +1 -1
- package/dist/playground/assets/{kotlin-B49JjNRF.js → kotlin-B1tcYUs_.js} +1 -1
- package/dist/playground/assets/{kumir-BubygEYF.js → kumir-CMxSbLlX.js} +1 -1
- package/dist/playground/assets/{kusto-CH_AKVN6.js → kusto-gAnRlB1Y.js} +1 -1
- package/dist/playground/assets/{latex-C9qtRxyR.js → latex-C1SBIz9f.js} +1 -1
- package/dist/playground/assets/{latte-eaSds21J.js → latte-Cuao_K4h.js} +1 -1
- package/dist/playground/assets/{less-Ciq7oCWk.js → less-CDbVKNvv.js} +1 -1
- package/dist/playground/assets/{lilypond-ezW_FBa7.js → lilypond-BSUl5iXX.js} +1 -1
- package/dist/playground/assets/{liquid-Di97Zow5.js → liquid-C-oro8hh.js} +1 -1
- package/dist/playground/assets/{lisp-BND5IUUb.js → lisp-nNIjYTOI.js} +1 -1
- package/dist/playground/assets/{livescript-CNdmDR9k.js → livescript-DZazFWFd.js} +1 -1
- package/dist/playground/assets/{llvm-Diu5vE-_.js → llvm-BQnSpTFA.js} +1 -1
- package/dist/playground/assets/{log-l74ZIo2G.js → log-DiwLcAg5.js} +1 -1
- package/dist/playground/assets/{lolcode-D8E_zNUr.js → lolcode-CYkwEl6b.js} +1 -1
- package/dist/playground/assets/{lua-gNMwUQjv.js → lua-C5OS3cNI.js} +1 -1
- package/dist/playground/assets/{magma-BZndnK4u.js → magma-iVIlkPMM.js} +1 -1
- package/dist/playground/assets/{makefile-2KtWvl9M.js → makefile-BiRZX91R.js} +1 -1
- package/dist/playground/assets/{markdown-QVr2WZ7A.js → markdown-Csbt4eSK.js} +1 -1
- package/dist/playground/assets/{markup-CGjosiRG.js → markup-DFLT05BR.js} +1 -1
- package/dist/playground/assets/{markup-templating--J8lNA65.js → markup-templating-RMhqJnW3.js} +1 -1
- package/dist/playground/assets/{matlab-BzWR4u9J.js → matlab-UZBSgaWv.js} +1 -1
- package/dist/playground/assets/{maxscript-DqL8aTwi.js → maxscript-DaXZPSBW.js} +1 -1
- package/dist/playground/assets/{mel-gxTOI7Bn.js → mel-CU3__y5h.js} +1 -1
- package/dist/playground/assets/{mermaid-CRoOZITP.js → mermaid-BpuyONQk.js} +1 -1
- package/dist/playground/assets/{mizar-D4dkpyeN.js → mizar-DFkGsKu5.js} +1 -1
- package/dist/playground/assets/{mongodb-BQlStzRx.js → mongodb-5E98wPzI.js} +1 -1
- package/dist/playground/assets/{monkey-BkVftKMt.js → monkey-dbLgBLZo.js} +1 -1
- package/dist/playground/assets/{moonscript-gBNEqU73.js → moonscript-BMFK9yW6.js} +1 -1
- package/dist/playground/assets/{n1ql-Bal9wV3M.js → n1ql-2H83XDYf.js} +1 -1
- package/dist/playground/assets/{n4js-DJDqWInO.js → n4js-C5mxyFyR.js} +1 -1
- package/dist/playground/assets/{nand2tetris-hdl-DVYcQs0u.js → nand2tetris-hdl-CeY6vXOn.js} +1 -1
- package/dist/playground/assets/{naniscript-D-DQWSz5.js → naniscript-wlW6nqau.js} +1 -1
- package/dist/playground/assets/{nasm-CoydG39X.js → nasm-jaqvPlfe.js} +1 -1
- package/dist/playground/assets/{neon-CFqbCk9q.js → neon-DZJpQLPJ.js} +1 -1
- package/dist/playground/assets/{nevod-BWVaWL8G.js → nevod-DM6y-ht0.js} +1 -1
- package/dist/playground/assets/{nginx-CJ8KhEzw.js → nginx-CJj_EcmX.js} +1 -1
- package/dist/playground/assets/{nim-CTjZnGAK.js → nim-BAOYE2nv.js} +1 -1
- package/dist/playground/assets/{nix-D59oAN6v.js → nix-C_qOOD5p.js} +1 -1
- package/dist/playground/assets/{nsis-C4QOvtRp.js → nsis-BPyWJLZZ.js} +1 -1
- package/dist/playground/assets/{objectivec-CNwgVx15.js → objectivec-B6c2DM9e.js} +1 -1
- package/dist/playground/assets/{ocaml-Cbt3VSbK.js → ocaml-DdbajZiL.js} +1 -1
- package/dist/playground/assets/{opencl-BvLZSbML.js → opencl-CbcZK5O9.js} +1 -1
- package/dist/playground/assets/{openqasm-CGOnCwmJ.js → openqasm-BlK4mWpF.js} +1 -1
- package/dist/playground/assets/{oz-DVsjFoJo.js → oz-CYosrTQv.js} +1 -1
- package/dist/playground/assets/{parigp-D5xSjAKr.js → parigp-DCzC9sbx.js} +1 -1
- package/dist/playground/assets/{parser-d13CKhZm.js → parser-BcKOdXV6.js} +1 -1
- package/dist/playground/assets/{pascal-BvUbXOhW.js → pascal-lS4GFSHZ.js} +1 -1
- package/dist/playground/assets/{pascaligo-pwdQOiyr.js → pascaligo-B8-k8i1k.js} +1 -1
- package/dist/playground/assets/{pcaxis-BPo6ZVCF.js → pcaxis-CKbm3k6r.js} +1 -1
- package/dist/playground/assets/{peoplecode-BPwq91WF.js → peoplecode-BI5htzWp.js} +1 -1
- package/dist/playground/assets/{perl-WtWUuCP3.js → perl-QM64yJYL.js} +1 -1
- package/dist/playground/assets/{php-extras-_VGCd9xg.js → php-extras-GmPrUudo.js} +1 -1
- package/dist/playground/assets/{php-CMJK3UPB.js → php-vClUH7Ho.js} +1 -1
- package/dist/playground/assets/{phpdoc-WkHZUPUM.js → phpdoc-B6BF3Szx.js} +1 -1
- package/dist/playground/assets/{plsql-Cq6eEoN9.js → plsql-DttFljdq.js} +1 -1
- package/dist/playground/assets/{powerquery-BXYY2Vg4.js → powerquery-B1Xb4-K0.js} +1 -1
- package/dist/playground/assets/{powershell-fY0zLuCN.js → powershell-D-B7kvAT.js} +1 -1
- package/dist/playground/assets/{processing-DvXSIH2o.js → processing-D6fC0guL.js} +1 -1
- package/dist/playground/assets/{prolog-B-7DRt0Q.js → prolog-kWr-CqPK.js} +1 -1
- package/dist/playground/assets/{promql-yRPFscBJ.js → promql-PXZm5M8f.js} +1 -1
- package/dist/playground/assets/{properties-DOrVgnsn.js → properties-BY0nXuNQ.js} +1 -1
- package/dist/playground/assets/{protobuf-BPMQlYO_.js → protobuf-CT6juWDL.js} +1 -1
- package/dist/playground/assets/{psl-BytgMlVA.js → psl-3kEbIr81.js} +1 -1
- package/dist/playground/assets/{pug-BrQQZMXX.js → pug-BkZ8PJ6L.js} +1 -1
- package/dist/playground/assets/{puppet-D0rWAMpi.js → puppet-BRmK5z1A.js} +1 -1
- package/dist/playground/assets/{pure-D3akdLNP.js → pure-BMibaKRT.js} +1 -1
- package/dist/playground/assets/{purebasic-BvyRZ4e2.js → purebasic-yXJxB96y.js} +1 -1
- package/dist/playground/assets/{purescript-CJVS0asd.js → purescript-DD_r_UF4.js} +1 -1
- package/dist/playground/assets/{python-DFf0sF2h.js → python-BMUssyL_.js} +1 -1
- package/dist/playground/assets/{q-Dx0gyvWB.js → q-CIUPp4al.js} +1 -1
- package/dist/playground/assets/{qml-DgfQDN4B.js → qml-B4fSzN7J.js} +1 -1
- package/dist/playground/assets/{qore-BWwh2dOA.js → qore-CdHZ7uVG.js} +1 -1
- package/dist/playground/assets/{qsharp-BSuwYsvS.js → qsharp-BIcGmai5.js} +1 -1
- package/dist/playground/assets/{r-B-fIj4Vl.js → r-BkiXHUSG.js} +1 -1
- package/dist/playground/assets/{racket-C1cWOkSS.js → racket-BQkfARq-.js} +1 -1
- package/dist/playground/assets/{reason-Bvp1giaD.js → reason-eT2cgi2d.js} +1 -1
- package/dist/playground/assets/{regex-CC3lEw_I.js → regex-CxWwBMeU.js} +1 -1
- package/dist/playground/assets/{rego-0uWqA6B_.js → rego-CNknGPUE.js} +1 -1
- package/dist/playground/assets/{renpy-BLav3ImN.js → renpy-DgIMK7W_.js} +1 -1
- package/dist/playground/assets/{rest-VO18yH-j.js → rest-uhJrm9Yw.js} +1 -1
- package/dist/playground/assets/{rip-dpWJBk9i.js → rip-CMfNKkuv.js} +1 -1
- package/dist/playground/assets/{roboconf-B1MwI3f8.js → roboconf-ClIO7-q1.js} +1 -1
- package/dist/playground/assets/{robotframework-Bdb-jPYB.js → robotframework-BbXNM3wr.js} +1 -1
- package/dist/playground/assets/{ruby-CA7NsUfQ.js → ruby-C-BeNqqu.js} +1 -1
- package/dist/playground/assets/{rust-PzI1cHWc.js → rust-D7HlDjtf.js} +1 -1
- package/dist/playground/assets/{sas-D8-wUxbX.js → sas-DaJKA9hL.js} +1 -1
- package/dist/playground/assets/{sass-Ddx9r_xg.js → sass-e4DUuBIE.js} +1 -1
- package/dist/playground/assets/{scala-CKFoLkY1.js → scala-BG9C8Cn4.js} +1 -1
- package/dist/playground/assets/{scheme-BKOYV7g3.js → scheme-DZ3xuban.js} +1 -1
- package/dist/playground/assets/{scss-C7diewNB.js → scss-CKyTa6JG.js} +1 -1
- package/dist/playground/assets/{shell-session-DAVIwm6r.js → shell-session-CC0LA7Q3.js} +1 -1
- package/dist/playground/assets/{smali-CxEhs8yC.js → smali-D628uhxS.js} +1 -1
- package/dist/playground/assets/{smalltalk-D1bda1js.js → smalltalk-BTEiFqoR.js} +1 -1
- package/dist/playground/assets/{smarty-D86XLDAD.js → smarty-DV7g5bgQ.js} +1 -1
- package/dist/playground/assets/{sml-DhRzV0Yd.js → sml-BxJvxfGo.js} +1 -1
- package/dist/playground/assets/{solidity-DZzAYKne.js → solidity-JgLK6Vg1.js} +1 -1
- package/dist/playground/assets/{solution-file-DcWsdOsE.js → solution-file-B5a62Oc0.js} +1 -1
- package/dist/playground/assets/{soy-CJzcp0Rd.js → soy-eDdiv1qf.js} +1 -1
- package/dist/playground/assets/{sparql-Bza39uP1.js → sparql-kZcrDGC2.js} +1 -1
- package/dist/playground/assets/{splunk-spl-pgc5xbr1.js → splunk-spl-Bz-lO4ky.js} +1 -1
- package/dist/playground/assets/{sqf-zaxjPIcX.js → sqf-MF9dZOnj.js} +1 -1
- package/dist/playground/assets/{sql-BDxJqV_A.js → sql-Dgp3eeTl.js} +1 -1
- package/dist/playground/assets/{squirrel-fBNLZRcl.js → squirrel-CbufH-LV.js} +1 -1
- package/dist/playground/assets/{stan-CJSTRlqV.js → stan-NxtKiimO.js} +1 -1
- package/dist/playground/assets/style-DkRpX1cz.css +1 -0
- package/dist/playground/assets/{stylus-DcowwZLM.js → stylus-BQBNcdSo.js} +1 -1
- package/dist/playground/assets/{swift-BvR6KTou.js → swift-ah3gBVTO.js} +1 -1
- package/dist/playground/assets/{systemd-Bm9dfnfC.js → systemd-vKQ5cwha.js} +1 -1
- package/dist/playground/assets/{t4-cs-DBS3SuTn.js → t4-cs-Dvi1M4ji.js} +1 -1
- package/dist/playground/assets/{t4-templating-BUpklocH.js → t4-templating-DjzvdHAe.js} +1 -1
- package/dist/playground/assets/{t4-vb-8Kx8FrJn.js → t4-vb-CYt3Ngyj.js} +1 -1
- package/dist/playground/assets/{tap-BffWxfOo.js → tap-C4RxxNie.js} +1 -1
- package/dist/playground/assets/{tcl-C0r6haIO.js → tcl-BPg0Cu_S.js} +1 -1
- package/dist/playground/assets/{textile-B-BdvKXq.js → textile-3ZR-wyvv.js} +1 -1
- package/dist/playground/assets/{toml-CsDsK2f9.js → toml-CS4E5Zu_.js} +1 -1
- package/dist/playground/assets/{tremor-CctEbCng.js → tremor-Bo7m4C6Q.js} +1 -1
- package/dist/playground/assets/{tsx-D4cMQx4D.js → tsx-21W1FyVB.js} +1 -1
- package/dist/playground/assets/{tt2-BWVqfxra.js → tt2-81Q8I6CJ.js} +1 -1
- package/dist/playground/assets/{turtle-DCRLY1Qq.js → turtle-DVv9uKDA.js} +1 -1
- package/dist/playground/assets/{twig-CmagNSa3.js → twig-Bv5GxlI6.js} +1 -1
- package/dist/playground/assets/{typescript-BwUK_myp.js → typescript-CT6MeItO.js} +1 -1
- package/dist/playground/assets/{typoscript-Brs6KLZ4.js → typoscript-BvSrbUaP.js} +1 -1
- package/dist/playground/assets/{unrealscript-DzAjWmdp.js → unrealscript-Cgx32PJC.js} +1 -1
- package/dist/playground/assets/{uorazor-w1hD9SND.js → uorazor-CJbChqAi.js} +1 -1
- package/dist/playground/assets/{uri-DF5-DT9w.js → uri-BgoAck_-.js} +1 -1
- package/dist/playground/assets/{v-BavoKhXR.js → v-biu85SVD.js} +1 -1
- package/dist/playground/assets/{vala-1eVOQj5_.js → vala-BtJoUvdO.js} +1 -1
- package/dist/playground/assets/{vbnet-6zkgS3WB.js → vbnet-DgIdoBfp.js} +1 -1
- package/dist/playground/assets/{velocity-x-6OTDFN.js → velocity-Rt30Lbiv.js} +1 -1
- package/dist/playground/assets/{verilog-C4yzM5oQ.js → verilog-CCQiOZ9i.js} +1 -1
- package/dist/playground/assets/{vhdl-Dh0L03yv.js → vhdl-V3KHNR1k.js} +1 -1
- package/dist/playground/assets/{vim-Dc3QQ6M0.js → vim-C55MXNJR.js} +1 -1
- package/dist/playground/assets/{visual-basic-6taNRfml.js → visual-basic-BcZ5gRgE.js} +1 -1
- package/dist/playground/assets/{warpscript-SGwIx-pb.js → warpscript-DUUcZpXO.js} +1 -1
- package/dist/playground/assets/{wasm-KlR0o1yG.js → wasm-Cgl7ln8a.js} +1 -1
- package/dist/playground/assets/{web-idl-r-M67RT-.js → web-idl-D6-kTbmS.js} +1 -1
- package/dist/playground/assets/{wiki-oiupc9yq.js → wiki-DihswnGe.js} +1 -1
- package/dist/playground/assets/{wolfram-C35GZ5NN.js → wolfram-_3RVD0YZ.js} +1 -1
- package/dist/playground/assets/{wren-D2ELJujn.js → wren-BbncSZkv.js} +1 -1
- package/dist/playground/assets/{xeora-BYbZIIur.js → xeora-BgVpi39u.js} +1 -1
- package/dist/playground/assets/{xml-doc-bciQqQY7.js → xml-doc-CXNYCSBK.js} +1 -1
- package/dist/playground/assets/{xojo-JXmhLMmX.js → xojo-C3Ii0zSq.js} +1 -1
- package/dist/playground/assets/{xquery-OdhlQiGj.js → xquery-CwhuGIxb.js} +1 -1
- package/dist/playground/assets/{yaml-BegI5l2n.js → yaml-CLyTFu_8.js} +1 -1
- package/dist/playground/assets/{yang-Dhd5AEiH.js → yang-CnOMIF21.js} +1 -1
- package/dist/playground/assets/{zig-Caf1sO7t.js → zig-BDTkDyo2.js} +1 -1
- package/dist/playground/index.html +2 -2
- package/dist/utils/clone-template.d.ts +3 -0
- package/dist/utils/clone-template.d.ts.map +1 -1
- package/package.json +16 -18
- package/dist/chunk-NHL3S2MZ.js.map +0 -1
- package/dist/playground/assets/style-IJXhmGBf.css +0 -1
- package/dist/services/browser.d.ts +0 -13
- package/dist/services/browser.d.ts.map +0 -1
- package/dist/services/service.docker.d.ts +0 -27
- package/dist/services/service.docker.d.ts.map +0 -1
- package/dist/utils/string.d.ts +0 -2
- package/dist/utils/string.d.ts.map +0 -1
|
@@ -1,138 +1,127 @@
|
|
|
1
1
|
import { getAnalytics } from './chunk-OQQFOUQW.js';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as fs3 from 'fs';
|
|
3
|
+
import fs3__default, { existsSync } from 'fs';
|
|
4
4
|
import fs4 from 'fs/promises';
|
|
5
|
+
import * as p5 from '@clack/prompts';
|
|
6
|
+
import color2 from 'picocolors';
|
|
5
7
|
import child_process from 'child_process';
|
|
6
8
|
import util from 'util';
|
|
7
|
-
import
|
|
9
|
+
import path3 from 'path';
|
|
8
10
|
import shellQuote2 from 'shell-quote';
|
|
9
11
|
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
12
|
import fsExtra, { readJSON, ensureFile, writeJSON } from 'fs-extra/esm';
|
|
15
13
|
import prettier from 'prettier';
|
|
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
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
// package.json
|
|
21
|
+
var package_default = {
|
|
22
|
+
name: "mastra",
|
|
23
|
+
version: "1.0.0-beta.3",
|
|
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(
|
|
151
|
+
if (fs3__default.existsSync(path3.join(dir, file))) {
|
|
163
152
|
return file;
|
|
164
153
|
}
|
|
165
154
|
}
|
|
166
|
-
const parentDir =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
314
|
-
const filePath =
|
|
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 =
|
|
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
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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
|
-
|
|
478
|
+
model = "groq/llama-3.3-70b-versatile";
|
|
366
479
|
} else if (llmProvider === "google") {
|
|
367
|
-
|
|
480
|
+
model = "google/gemini-2.5-pro";
|
|
368
481
|
} else if (llmProvider === "cerebras") {
|
|
369
|
-
|
|
482
|
+
model = "cerebras/llama-3.3-70b";
|
|
370
483
|
} else if (llmProvider === "mistral") {
|
|
371
|
-
|
|
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 =
|
|
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 =
|
|
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 (
|
|
898
|
-
const { skip = {}, options: { showBanner = true } = {} } =
|
|
1011
|
+
var interactivePrompt = async (args = {}) => {
|
|
1012
|
+
const { skip = {}, options: { showBanner = true } = {} } = args;
|
|
899
1013
|
if (showBanner) {
|
|
900
|
-
|
|
1014
|
+
p5.intro(color2.inverse(" Mastra Init "));
|
|
901
1015
|
}
|
|
902
|
-
const mastraProject = await
|
|
1016
|
+
const mastraProject = await p5.group(
|
|
903
1017
|
{
|
|
904
|
-
directory: () =>
|
|
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 :
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
1110
|
+
p5.cancel("Operation cancelled.");
|
|
1014
1111
|
process.exit(0);
|
|
1015
1112
|
}
|
|
1016
1113
|
}
|
|
@@ -1019,21 +1116,22 @@ 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 =
|
|
1119
|
+
const pkgJsonPath = path3.join(cwd, "package.json");
|
|
1023
1120
|
try {
|
|
1024
1121
|
await fs4.access(pkgJsonPath);
|
|
1025
1122
|
} catch {
|
|
1026
|
-
|
|
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 || "";
|
|
1132
|
+
if (userAgent.includes("bun")) {
|
|
1133
|
+
return "bun";
|
|
1134
|
+
}
|
|
1037
1135
|
if (userAgent.includes("yarn")) {
|
|
1038
1136
|
return "yarn";
|
|
1039
1137
|
}
|
|
@@ -1043,6 +1141,9 @@ function getPackageManager() {
|
|
|
1043
1141
|
if (userAgent.includes("npm")) {
|
|
1044
1142
|
return "npm";
|
|
1045
1143
|
}
|
|
1144
|
+
if (execPath.includes("bun")) {
|
|
1145
|
+
return "bun";
|
|
1146
|
+
}
|
|
1046
1147
|
if (execPath.includes("yarn")) {
|
|
1047
1148
|
return "yarn";
|
|
1048
1149
|
}
|
|
@@ -1073,6 +1174,9 @@ function parseLlmProvider(value) {
|
|
|
1073
1174
|
}
|
|
1074
1175
|
return value;
|
|
1075
1176
|
}
|
|
1177
|
+
function shouldSkipDotenvLoading() {
|
|
1178
|
+
return process.env.MASTRA_SKIP_DOTENV === "true" || process.env.MASTRA_SKIP_DOTENV === "1";
|
|
1179
|
+
}
|
|
1076
1180
|
var logger = createLogger(false);
|
|
1077
1181
|
function createLogger(debug = false) {
|
|
1078
1182
|
return new PinoLogger({
|
|
@@ -1084,19 +1188,23 @@ function createLogger(debug = false) {
|
|
|
1084
1188
|
// src/utils/clone-template.ts
|
|
1085
1189
|
var exec2 = util.promisify(child_process.exec);
|
|
1086
1190
|
async function cloneTemplate(options) {
|
|
1087
|
-
const { template, projectName, targetDir } = options;
|
|
1088
|
-
const projectPath = targetDir ?
|
|
1191
|
+
const { template, projectName, targetDir, branch, llmProvider } = options;
|
|
1192
|
+
const projectPath = targetDir ? path3.resolve(targetDir, projectName) : path3.resolve(projectName);
|
|
1089
1193
|
const spinner4 = yoctoSpinner2({ text: `Cloning template "${template.title}"...` }).start();
|
|
1090
1194
|
try {
|
|
1091
1195
|
if (await directoryExists(projectPath)) {
|
|
1092
1196
|
spinner4.error(`Directory ${projectName} already exists`);
|
|
1093
1197
|
throw new Error(`Directory ${projectName} already exists`);
|
|
1094
1198
|
}
|
|
1095
|
-
await cloneRepositoryWithoutGit(template.githubUrl, projectPath);
|
|
1199
|
+
await cloneRepositoryWithoutGit(template.githubUrl, projectPath, branch);
|
|
1096
1200
|
await updatePackageJson(projectPath, projectName);
|
|
1097
|
-
const envExamplePath =
|
|
1201
|
+
const envExamplePath = path3.join(projectPath, ".env.example");
|
|
1098
1202
|
if (await fileExists(envExamplePath)) {
|
|
1099
|
-
|
|
1203
|
+
const envPath = path3.join(projectPath, ".env");
|
|
1204
|
+
await fs4.copyFile(envExamplePath, envPath);
|
|
1205
|
+
if (llmProvider) {
|
|
1206
|
+
await updateEnvFile(envPath, llmProvider);
|
|
1207
|
+
}
|
|
1100
1208
|
}
|
|
1101
1209
|
spinner4.success(`Template "${template.title}" cloned successfully to ${projectName}`);
|
|
1102
1210
|
return projectPath;
|
|
@@ -1121,21 +1229,27 @@ async function fileExists(filePath) {
|
|
|
1121
1229
|
return false;
|
|
1122
1230
|
}
|
|
1123
1231
|
}
|
|
1124
|
-
async function cloneRepositoryWithoutGit(repoUrl, targetPath) {
|
|
1232
|
+
async function cloneRepositoryWithoutGit(repoUrl, targetPath, branch) {
|
|
1125
1233
|
await fs4.mkdir(targetPath, { recursive: true });
|
|
1126
1234
|
try {
|
|
1127
1235
|
const degitRepo = repoUrl.replace("https://github.com/", "");
|
|
1128
|
-
const
|
|
1236
|
+
const degitRepoWithBranch = branch ? `${degitRepo}#${branch}` : degitRepo;
|
|
1237
|
+
const degitCommand = shellQuote2.quote(["npx", "degit", degitRepoWithBranch, targetPath]);
|
|
1129
1238
|
await exec2(degitCommand, {
|
|
1130
1239
|
cwd: process.cwd()
|
|
1131
1240
|
});
|
|
1132
1241
|
} catch {
|
|
1133
1242
|
try {
|
|
1134
|
-
const
|
|
1243
|
+
const gitArgs = ["git", "clone"];
|
|
1244
|
+
if (branch) {
|
|
1245
|
+
gitArgs.push("--branch", branch);
|
|
1246
|
+
}
|
|
1247
|
+
gitArgs.push(repoUrl, targetPath);
|
|
1248
|
+
const gitCommand = shellQuote2.quote(gitArgs);
|
|
1135
1249
|
await exec2(gitCommand, {
|
|
1136
1250
|
cwd: process.cwd()
|
|
1137
1251
|
});
|
|
1138
|
-
const gitDir =
|
|
1252
|
+
const gitDir = path3.join(targetPath, ".git");
|
|
1139
1253
|
if (await directoryExists(gitDir)) {
|
|
1140
1254
|
await fs4.rm(gitDir, { recursive: true, force: true });
|
|
1141
1255
|
}
|
|
@@ -1145,7 +1259,7 @@ async function cloneRepositoryWithoutGit(repoUrl, targetPath) {
|
|
|
1145
1259
|
}
|
|
1146
1260
|
}
|
|
1147
1261
|
async function updatePackageJson(projectPath, projectName) {
|
|
1148
|
-
const packageJsonPath =
|
|
1262
|
+
const packageJsonPath = path3.join(projectPath, "package.json");
|
|
1149
1263
|
try {
|
|
1150
1264
|
const packageJsonContent = await fs4.readFile(packageJsonPath, "utf-8");
|
|
1151
1265
|
const packageJson = JSON.parse(packageJsonContent);
|
|
@@ -1155,6 +1269,22 @@ async function updatePackageJson(projectPath, projectName) {
|
|
|
1155
1269
|
logger.warn(`Could not update package.json: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1156
1270
|
}
|
|
1157
1271
|
}
|
|
1272
|
+
async function updateEnvFile(envPath, llmProvider) {
|
|
1273
|
+
try {
|
|
1274
|
+
const envContent = await fs4.readFile(envPath, "utf-8");
|
|
1275
|
+
const modelString = getModelIdentifier(llmProvider);
|
|
1276
|
+
if (!modelString) {
|
|
1277
|
+
logger.warn(`Could not get model identifier for provider: ${llmProvider}`);
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
const modelValue = modelString.replace(/'/g, "");
|
|
1281
|
+
const updatedContent = envContent.replace(/^MODEL=.*/m, `MODEL=${modelValue}`);
|
|
1282
|
+
await fs4.writeFile(envPath, updatedContent, "utf-8");
|
|
1283
|
+
logger.info(`Updated MODEL in .env to ${modelValue}`);
|
|
1284
|
+
} catch (error) {
|
|
1285
|
+
logger.warn(`Could not update .env file: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1158
1288
|
async function installDependencies(projectPath, packageManager) {
|
|
1159
1289
|
const spinner4 = yoctoSpinner2({ text: "Installing dependencies..." }).start();
|
|
1160
1290
|
try {
|
|
@@ -1210,11 +1340,11 @@ async function selectTemplate(templates) {
|
|
|
1210
1340
|
hint: parts.join(", ") || "Template components"
|
|
1211
1341
|
};
|
|
1212
1342
|
});
|
|
1213
|
-
const selected = await
|
|
1343
|
+
const selected = await p5.select({
|
|
1214
1344
|
message: "Select a template:",
|
|
1215
1345
|
options: choices
|
|
1216
1346
|
});
|
|
1217
|
-
if (
|
|
1347
|
+
if (p5.isCancel(selected)) {
|
|
1218
1348
|
return null;
|
|
1219
1349
|
}
|
|
1220
1350
|
return selected;
|
|
@@ -1232,7 +1362,7 @@ function findTemplateByName(templates, templateName) {
|
|
|
1232
1362
|
function getDefaultProjectName(template) {
|
|
1233
1363
|
return template.slug.replace(/^template-/, "");
|
|
1234
1364
|
}
|
|
1235
|
-
var s =
|
|
1365
|
+
var s = p5.spinner();
|
|
1236
1366
|
var init = async ({
|
|
1237
1367
|
directory = "src/",
|
|
1238
1368
|
components,
|
|
@@ -1294,19 +1424,20 @@ var init = async ({
|
|
|
1294
1424
|
if (configureEditorWithDocsMCP) {
|
|
1295
1425
|
await installMastraDocsMCPServer({
|
|
1296
1426
|
editor: configureEditorWithDocsMCP,
|
|
1297
|
-
directory: process.cwd()
|
|
1427
|
+
directory: process.cwd(),
|
|
1428
|
+
versionTag
|
|
1298
1429
|
});
|
|
1299
1430
|
}
|
|
1300
1431
|
s.stop();
|
|
1301
1432
|
if (!llmApiKey) {
|
|
1302
|
-
|
|
1433
|
+
p5.note(`
|
|
1303
1434
|
${color2.green("Mastra initialized successfully!")}
|
|
1304
1435
|
|
|
1305
1436
|
Add your ${color2.cyan(key)} as an environment variable
|
|
1306
1437
|
in your ${color2.cyan(".env")} file
|
|
1307
1438
|
`);
|
|
1308
1439
|
} else {
|
|
1309
|
-
|
|
1440
|
+
p5.note(`
|
|
1310
1441
|
${color2.green("Mastra initialized successfully!")}
|
|
1311
1442
|
`);
|
|
1312
1443
|
}
|
|
@@ -1343,6 +1474,32 @@ var execWithTimeout = async (command, timeoutMs) => {
|
|
|
1343
1474
|
throw error;
|
|
1344
1475
|
}
|
|
1345
1476
|
};
|
|
1477
|
+
async function getInitCommand(pm) {
|
|
1478
|
+
switch (pm) {
|
|
1479
|
+
case "npm":
|
|
1480
|
+
return "npm init -y";
|
|
1481
|
+
case "pnpm":
|
|
1482
|
+
return "pnpm init";
|
|
1483
|
+
case "yarn":
|
|
1484
|
+
return "yarn init -y";
|
|
1485
|
+
case "bun":
|
|
1486
|
+
return "bun init -y";
|
|
1487
|
+
default:
|
|
1488
|
+
return "npm init -y";
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
async function initializePackageJson(pm) {
|
|
1492
|
+
const initCommand = await getInitCommand(pm);
|
|
1493
|
+
await exec3(initCommand);
|
|
1494
|
+
const packageJsonPath = path3.join(process.cwd(), "package.json");
|
|
1495
|
+
const packageJson = JSON.parse(await fs4.readFile(packageJsonPath, "utf-8"));
|
|
1496
|
+
packageJson.type = "module";
|
|
1497
|
+
packageJson.engines = {
|
|
1498
|
+
...packageJson.engines,
|
|
1499
|
+
node: ">=22.13.0"
|
|
1500
|
+
};
|
|
1501
|
+
await fs4.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
1502
|
+
}
|
|
1346
1503
|
async function installMastraDependency(pm, dependency, versionTag, isDev, timeout) {
|
|
1347
1504
|
let installCommand = getPackageManagerAddCommand(pm);
|
|
1348
1505
|
if (isDev) {
|
|
@@ -1373,8 +1530,8 @@ var createMastraProject = async ({
|
|
|
1373
1530
|
llmApiKey,
|
|
1374
1531
|
needsInteractive
|
|
1375
1532
|
}) => {
|
|
1376
|
-
|
|
1377
|
-
const projectName = name ?? await
|
|
1533
|
+
p5.intro(color2.inverse(" Mastra Create "));
|
|
1534
|
+
const projectName = name ?? await p5.text({
|
|
1378
1535
|
message: "What do you want to name your project?",
|
|
1379
1536
|
placeholder: "my-mastra-app",
|
|
1380
1537
|
defaultValue: "my-mastra-app",
|
|
@@ -1385,8 +1542,8 @@ var createMastraProject = async ({
|
|
|
1385
1542
|
}
|
|
1386
1543
|
}
|
|
1387
1544
|
});
|
|
1388
|
-
if (
|
|
1389
|
-
|
|
1545
|
+
if (p5.isCancel(projectName)) {
|
|
1546
|
+
p5.cancel("Operation cancelled");
|
|
1390
1547
|
process.exit(0);
|
|
1391
1548
|
}
|
|
1392
1549
|
let result;
|
|
@@ -1396,11 +1553,14 @@ var createMastraProject = async ({
|
|
|
1396
1553
|
skip: { llmProvider: llmProvider !== void 0, llmApiKey: llmApiKey !== void 0 }
|
|
1397
1554
|
});
|
|
1398
1555
|
}
|
|
1399
|
-
const s2 =
|
|
1556
|
+
const s2 = p5.spinner();
|
|
1557
|
+
const originalCwd = process.cwd();
|
|
1558
|
+
let projectPath = null;
|
|
1400
1559
|
try {
|
|
1401
1560
|
s2.start("Creating project");
|
|
1402
1561
|
try {
|
|
1403
1562
|
await fs4.mkdir(projectName);
|
|
1563
|
+
projectPath = path3.resolve(originalCwd, projectName);
|
|
1404
1564
|
} catch (error) {
|
|
1405
1565
|
if (error instanceof Error && "code" in error && error.code === "EEXIST") {
|
|
1406
1566
|
s2.stop(`A directory named "${projectName}" already exists. Please choose a different name.`);
|
|
@@ -1415,9 +1575,7 @@ var createMastraProject = async ({
|
|
|
1415
1575
|
const installCommand = getPackageManagerAddCommand(pm);
|
|
1416
1576
|
s2.message("Initializing project structure");
|
|
1417
1577
|
try {
|
|
1418
|
-
await
|
|
1419
|
-
await exec3(`npm pkg set type="module"`);
|
|
1420
|
-
await exec3(`npm pkg set engines.node=">=20.9.0"`);
|
|
1578
|
+
await initializePackageJson(pm);
|
|
1421
1579
|
const depsService = new DepsService();
|
|
1422
1580
|
await depsService.addScriptsToPackageJson({
|
|
1423
1581
|
dev: "mastra dev",
|
|
@@ -1489,33 +1647,50 @@ var createMastraProject = async ({
|
|
|
1489
1647
|
throw new Error(`Failed to create .gitignore: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1490
1648
|
}
|
|
1491
1649
|
s2.stop(".gitignore added");
|
|
1492
|
-
|
|
1650
|
+
p5.outro("Project created successfully");
|
|
1493
1651
|
console.info("");
|
|
1494
1652
|
return { projectName, result };
|
|
1495
1653
|
} catch (error) {
|
|
1496
1654
|
s2.stop();
|
|
1497
1655
|
const errorMessage = error instanceof Error ? error.message : "An unexpected error occurred";
|
|
1498
|
-
|
|
1656
|
+
p5.cancel(`Project creation failed: ${errorMessage}`);
|
|
1657
|
+
if (projectPath && fs3__default.existsSync(projectPath)) {
|
|
1658
|
+
try {
|
|
1659
|
+
process.chdir(originalCwd);
|
|
1660
|
+
await fs4.rm(projectPath, { recursive: true, force: true });
|
|
1661
|
+
} catch (cleanupError) {
|
|
1662
|
+
console.error(
|
|
1663
|
+
`Warning: Failed to clean up project directory: ${cleanupError instanceof Error ? cleanupError.message : "Unknown error"}`
|
|
1664
|
+
);
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1499
1667
|
process.exit(1);
|
|
1500
1668
|
}
|
|
1501
1669
|
};
|
|
1502
1670
|
|
|
1503
1671
|
// src/commands/create/create.ts
|
|
1504
|
-
var
|
|
1505
|
-
|
|
1506
|
-
|
|
1672
|
+
var version = package_default.version;
|
|
1673
|
+
var create = async (args) => {
|
|
1674
|
+
if (args.template !== void 0) {
|
|
1675
|
+
await createFromTemplate({
|
|
1676
|
+
projectName: args.projectName,
|
|
1677
|
+
template: args.template,
|
|
1678
|
+
timeout: args.timeout,
|
|
1679
|
+
injectedAnalytics: args.analytics,
|
|
1680
|
+
llmProvider: args.llmProvider
|
|
1681
|
+
});
|
|
1507
1682
|
return;
|
|
1508
1683
|
}
|
|
1509
|
-
const needsInteractive =
|
|
1684
|
+
const needsInteractive = args.components === void 0 || args.llmProvider === void 0 || args.addExample === void 0;
|
|
1510
1685
|
const { projectName, result } = await createMastraProject({
|
|
1511
|
-
projectName:
|
|
1512
|
-
createVersionTag:
|
|
1513
|
-
timeout:
|
|
1514
|
-
llmProvider:
|
|
1515
|
-
llmApiKey:
|
|
1686
|
+
projectName: args?.projectName,
|
|
1687
|
+
createVersionTag: args?.createVersionTag,
|
|
1688
|
+
timeout: args?.timeout,
|
|
1689
|
+
llmProvider: args?.llmProvider,
|
|
1690
|
+
llmApiKey: args?.llmApiKey,
|
|
1516
1691
|
needsInteractive
|
|
1517
1692
|
});
|
|
1518
|
-
const directory =
|
|
1693
|
+
const directory = args.directory || "src/";
|
|
1519
1694
|
if (needsInteractive && result) {
|
|
1520
1695
|
const analytics2 = getAnalytics();
|
|
1521
1696
|
if (analytics2 && result?.llmProvider) {
|
|
@@ -1529,12 +1704,12 @@ var create = async (args2) => {
|
|
|
1529
1704
|
llmApiKey: result?.llmApiKey,
|
|
1530
1705
|
components: ["agents", "tools", "workflows", "scorers"],
|
|
1531
1706
|
addExample: true,
|
|
1532
|
-
versionTag:
|
|
1707
|
+
versionTag: args.createVersionTag
|
|
1533
1708
|
});
|
|
1534
1709
|
postCreate({ projectName });
|
|
1535
1710
|
return;
|
|
1536
1711
|
}
|
|
1537
|
-
const { components = [], llmProvider = "openai", addExample = false, llmApiKey } =
|
|
1712
|
+
const { components = [], llmProvider = "openai", addExample = false, llmApiKey } = args;
|
|
1538
1713
|
const analytics = getAnalytics();
|
|
1539
1714
|
if (analytics) {
|
|
1540
1715
|
analytics.trackEvent("cli_model_provider_selected", {
|
|
@@ -1548,14 +1723,14 @@ var create = async (args2) => {
|
|
|
1548
1723
|
llmProvider,
|
|
1549
1724
|
addExample,
|
|
1550
1725
|
llmApiKey,
|
|
1551
|
-
configureEditorWithDocsMCP:
|
|
1552
|
-
versionTag:
|
|
1726
|
+
configureEditorWithDocsMCP: args.mcpServer,
|
|
1727
|
+
versionTag: args.createVersionTag
|
|
1553
1728
|
});
|
|
1554
1729
|
postCreate({ projectName });
|
|
1555
1730
|
};
|
|
1556
1731
|
var postCreate = ({ projectName }) => {
|
|
1557
1732
|
const packageManager = getPackageManager();
|
|
1558
|
-
|
|
1733
|
+
p5.outro(`
|
|
1559
1734
|
${color2.green("To start your project:")}
|
|
1560
1735
|
|
|
1561
1736
|
${color2.cyan("cd")} ${projectName}
|
|
@@ -1640,36 +1815,36 @@ async function createFromGitHubUrl(url) {
|
|
|
1640
1815
|
workflows: []
|
|
1641
1816
|
};
|
|
1642
1817
|
}
|
|
1643
|
-
async function createFromTemplate(
|
|
1818
|
+
async function createFromTemplate(args) {
|
|
1644
1819
|
let selectedTemplate;
|
|
1645
|
-
if (
|
|
1820
|
+
if (args.template === true) {
|
|
1646
1821
|
const templates = await loadTemplates();
|
|
1647
1822
|
const selected = await selectTemplate(templates);
|
|
1648
1823
|
if (!selected) {
|
|
1649
|
-
|
|
1824
|
+
p5.log.info("No template selected. Exiting.");
|
|
1650
1825
|
return;
|
|
1651
1826
|
}
|
|
1652
1827
|
selectedTemplate = selected;
|
|
1653
|
-
} else if (
|
|
1654
|
-
if (isGitHubUrl(
|
|
1655
|
-
const spinner4 =
|
|
1828
|
+
} else if (args.template && typeof args.template === "string") {
|
|
1829
|
+
if (isGitHubUrl(args.template)) {
|
|
1830
|
+
const spinner4 = p5.spinner();
|
|
1656
1831
|
spinner4.start("Validating GitHub repository...");
|
|
1657
|
-
const validation = await validateGitHubProject(
|
|
1832
|
+
const validation = await validateGitHubProject(args.template);
|
|
1658
1833
|
if (!validation.isValid) {
|
|
1659
1834
|
spinner4.stop("Validation failed");
|
|
1660
|
-
|
|
1661
|
-
validation.errors.forEach((error) =>
|
|
1835
|
+
p5.log.error("This does not appear to be a valid Mastra project:");
|
|
1836
|
+
validation.errors.forEach((error) => p5.log.error(` - ${error}`));
|
|
1662
1837
|
throw new Error("Invalid Mastra project");
|
|
1663
1838
|
}
|
|
1664
1839
|
spinner4.stop("Valid Mastra project \u2713");
|
|
1665
|
-
selectedTemplate = await createFromGitHubUrl(
|
|
1840
|
+
selectedTemplate = await createFromGitHubUrl(args.template);
|
|
1666
1841
|
} else {
|
|
1667
1842
|
const templates = await loadTemplates();
|
|
1668
|
-
const found = findTemplateByName(templates,
|
|
1843
|
+
const found = findTemplateByName(templates, args.template);
|
|
1669
1844
|
if (!found) {
|
|
1670
|
-
|
|
1671
|
-
templates.forEach((t) =>
|
|
1672
|
-
throw new Error(`Template "${
|
|
1845
|
+
p5.log.error(`Template "${args.template}" not found. Available templates:`);
|
|
1846
|
+
templates.forEach((t) => p5.log.info(` - ${t.title} (use: ${t.slug.replace("template-", "")})`));
|
|
1847
|
+
throw new Error(`Template "${args.template}" not found`);
|
|
1673
1848
|
}
|
|
1674
1849
|
selectedTemplate = found;
|
|
1675
1850
|
}
|
|
@@ -1677,34 +1852,58 @@ async function createFromTemplate(args2) {
|
|
|
1677
1852
|
if (!selectedTemplate) {
|
|
1678
1853
|
throw new Error("No template selected");
|
|
1679
1854
|
}
|
|
1680
|
-
let projectName =
|
|
1855
|
+
let projectName = args.projectName;
|
|
1681
1856
|
if (!projectName) {
|
|
1682
1857
|
const defaultName = getDefaultProjectName(selectedTemplate);
|
|
1683
|
-
const response = await
|
|
1858
|
+
const response = await p5.text({
|
|
1684
1859
|
message: "What is your project name?",
|
|
1685
1860
|
defaultValue: defaultName,
|
|
1686
1861
|
placeholder: defaultName
|
|
1687
1862
|
});
|
|
1688
|
-
if (
|
|
1689
|
-
|
|
1863
|
+
if (p5.isCancel(response)) {
|
|
1864
|
+
p5.log.info("Project creation cancelled.");
|
|
1690
1865
|
return;
|
|
1691
1866
|
}
|
|
1692
1867
|
projectName = response;
|
|
1693
1868
|
}
|
|
1869
|
+
let llmProvider = args.llmProvider;
|
|
1870
|
+
if (!llmProvider) {
|
|
1871
|
+
const providerResponse = await p5.select({
|
|
1872
|
+
message: "Select a default provider:",
|
|
1873
|
+
options: LLM_PROVIDERS
|
|
1874
|
+
});
|
|
1875
|
+
if (p5.isCancel(providerResponse)) {
|
|
1876
|
+
p5.log.info("Project creation cancelled.");
|
|
1877
|
+
return;
|
|
1878
|
+
}
|
|
1879
|
+
llmProvider = providerResponse;
|
|
1880
|
+
}
|
|
1881
|
+
let projectPath = null;
|
|
1694
1882
|
try {
|
|
1695
|
-
const analytics =
|
|
1883
|
+
const analytics = args.injectedAnalytics || getAnalytics();
|
|
1696
1884
|
if (analytics) {
|
|
1697
1885
|
analytics.trackEvent("cli_template_used", {
|
|
1698
1886
|
template_slug: selectedTemplate.slug,
|
|
1699
1887
|
template_title: selectedTemplate.title
|
|
1700
1888
|
});
|
|
1889
|
+
if (llmProvider) {
|
|
1890
|
+
analytics.trackEvent("cli_model_provider_selected", {
|
|
1891
|
+
provider: llmProvider,
|
|
1892
|
+
selection_method: args.llmProvider ? "cli_args" : "interactive"
|
|
1893
|
+
});
|
|
1894
|
+
}
|
|
1701
1895
|
}
|
|
1702
|
-
const
|
|
1896
|
+
const isBeta = version?.includes("beta") ?? false;
|
|
1897
|
+
const isMastraTemplate = selectedTemplate.githubUrl.includes("github.com/mastra-ai/");
|
|
1898
|
+
const branch = isBeta && isMastraTemplate ? "beta" : void 0;
|
|
1899
|
+
projectPath = await cloneTemplate({
|
|
1703
1900
|
template: selectedTemplate,
|
|
1704
|
-
projectName
|
|
1901
|
+
projectName,
|
|
1902
|
+
branch,
|
|
1903
|
+
llmProvider
|
|
1705
1904
|
});
|
|
1706
1905
|
await installDependencies(projectPath);
|
|
1707
|
-
|
|
1906
|
+
p5.note(`
|
|
1708
1907
|
${color2.green("Mastra template installed!")}
|
|
1709
1908
|
|
|
1710
1909
|
Add the necessary environment
|
|
@@ -1712,11 +1911,22 @@ async function createFromTemplate(args2) {
|
|
|
1712
1911
|
`);
|
|
1713
1912
|
postCreate({ projectName });
|
|
1714
1913
|
} catch (error) {
|
|
1715
|
-
|
|
1914
|
+
if (projectPath) {
|
|
1915
|
+
try {
|
|
1916
|
+
if (fs3__default.existsSync(projectPath)) {
|
|
1917
|
+
await fs4.rm(projectPath, { recursive: true, force: true });
|
|
1918
|
+
}
|
|
1919
|
+
} catch (cleanupError) {
|
|
1920
|
+
console.error(
|
|
1921
|
+
`Warning: Failed to clean up project directory: ${cleanupError instanceof Error ? cleanupError.message : "Unknown error"}`
|
|
1922
|
+
);
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
p5.log.error(`Failed to create project from template: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1716
1926
|
throw error;
|
|
1717
1927
|
}
|
|
1718
1928
|
}
|
|
1719
1929
|
|
|
1720
|
-
export { COMPONENTS, DepsService, FileService, LLMProvider, checkAndInstallCoreDeps, checkForPkgJson, create, createLogger, init, interactivePrompt, logger, parseComponents, parseLlmProvider, parseMcp };
|
|
1721
|
-
//# sourceMappingURL=chunk-
|
|
1722
|
-
//# sourceMappingURL=chunk-
|
|
1930
|
+
export { COMPONENTS, DepsService, FileService, LLMProvider, checkAndInstallCoreDeps, checkForPkgJson, create, createLogger, init, interactivePrompt, logger, package_default, parseComponents, parseLlmProvider, parseMcp, shouldSkipDotenvLoading };
|
|
1931
|
+
//# sourceMappingURL=chunk-EAX43UYP.js.map
|
|
1932
|
+
//# sourceMappingURL=chunk-EAX43UYP.js.map
|