mastra 1.0.0-beta.0 → 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.
- package/CHANGELOG.md +48 -0
- package/dist/{chunk-D6NRTVVY.js → chunk-LC24FTF4.js} +396 -241
- package/dist/chunk-LC24FTF4.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/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-BVU-lJUW.js → abap-6DOLzTwj.js} +1 -1
- package/dist/playground/assets/{abnf-6UqDXZoZ.js → abnf-CfZklBkp.js} +1 -1
- package/dist/playground/assets/{actionscript-Cf8lYdXa.js → actionscript-AKAbTTS9.js} +1 -1
- package/dist/playground/assets/{ada-hWd-J5T2.js → ada-CCyCCZQc.js} +1 -1
- package/dist/playground/assets/{agda-s9mq_rw7.js → agda-BJdmxjDx.js} +1 -1
- package/dist/playground/assets/{al-xAaytfXU.js → al-Ct9Ryay7.js} +1 -1
- package/dist/playground/assets/{antlr4-BALprcg2.js → antlr4-DSMpmcmV.js} +1 -1
- package/dist/playground/assets/{apacheconf-DOQ8HHlK.js → apacheconf-BeqOavCJ.js} +1 -1
- package/dist/playground/assets/{apex-Vcvg9OGb.js → apex-1_6mi69r.js} +1 -1
- package/dist/playground/assets/{apl-DzaU-2QT.js → apl-DC48MxBB.js} +1 -1
- package/dist/playground/assets/{applescript-CNEmaTlw.js → applescript-DiL8hMiv.js} +1 -1
- package/dist/playground/assets/{aql-CsRSKgIO.js → aql-DyNBc7fs.js} +1 -1
- package/dist/playground/assets/{arduino-BY-cJnAG.js → arduino-gwy9r-YX.js} +1 -1
- package/dist/playground/assets/{arff-DokkxD3G.js → arff-DNFG93L3.js} +1 -1
- package/dist/playground/assets/{asciidoc-7GdGhWka.js → asciidoc-CTxOFUVL.js} +1 -1
- package/dist/playground/assets/{asm6502-GRMku7p-.js → asm6502-BzZ19HcF.js} +1 -1
- package/dist/playground/assets/{asmatmel-BvdE-Rmh.js → asmatmel-CLbZhuh4.js} +1 -1
- package/dist/playground/assets/{aspnet-BsWvUH1-.js → aspnet-CNeCVQc2.js} +1 -1
- package/dist/playground/assets/{autohotkey-n9yS-km2.js → autohotkey-CXQ3guY7.js} +1 -1
- package/dist/playground/assets/{autoit-Dl-mdu07.js → autoit-BXB8-6g2.js} +1 -1
- package/dist/playground/assets/{avisynth-BGGSXV1b.js → avisynth-DYmoRGo8.js} +1 -1
- package/dist/playground/assets/{avro-idl-hfoARngC.js → avro-idl-tYnrSjX3.js} +1 -1
- package/dist/playground/assets/{bash-BX9bZCEQ.js → bash-C42XeCrr.js} +1 -1
- package/dist/playground/assets/{basic-BeEicy0W.js → basic-BMMgfTME.js} +1 -1
- package/dist/playground/assets/{batch-B-QD6jXn.js → batch-B3P3xJG5.js} +1 -1
- package/dist/playground/assets/{bbcode-D1UeG_Ha.js → bbcode-CnuB3NAz.js} +1 -1
- package/dist/playground/assets/{bicep-efKkExHD.js → bicep-CFE-cvbx.js} +1 -1
- package/dist/playground/assets/{birb-Bs-zi5x3.js → birb-CFS7CYKM.js} +1 -1
- package/dist/playground/assets/{bison-BV5Xf6co.js → bison-DO7Cwt0_.js} +1 -1
- package/dist/playground/assets/{bnf-DFUz9h2B.js → bnf-DG2ekAVI.js} +1 -1
- package/dist/playground/assets/{brainfuck-BnKlY_gc.js → brainfuck-CNhtua6e.js} +1 -1
- package/dist/playground/assets/{brightscript-C1gsrJm7.js → brightscript-JOyyTqE2.js} +1 -1
- package/dist/playground/assets/{bro-B3UhGNwj.js → bro-K6FdV75Z.js} +1 -1
- package/dist/playground/assets/{bsl-Dz7OJ8Ci.js → bsl-Cco4i-C9.js} +1 -1
- package/dist/playground/assets/{c-B5YyudQk.js → c-B9sfFRGF.js} +1 -1
- package/dist/playground/assets/{cfscript-B7Ith1so.js → cfscript-uHH56TvL.js} +1 -1
- package/dist/playground/assets/{chaiscript-DXRsO6vM.js → chaiscript-CTwEBi0k.js} +1 -1
- package/dist/playground/assets/{cil-CqCfS8cX.js → cil-YW8GIRkY.js} +1 -1
- package/dist/playground/assets/{clike-Bdu0RZKE.js → clike-DFFiP88_.js} +1 -1
- package/dist/playground/assets/{clojure-BalrzFEE.js → clojure-D0KzK__-.js} +1 -1
- package/dist/playground/assets/{cmake-Ju964aPT.js → cmake-BpepAc-I.js} +1 -1
- package/dist/playground/assets/{cobol-DB3mXIrj.js → cobol-D1xQIb8e.js} +1 -1
- package/dist/playground/assets/{coffeescript-DocPu-ht.js → coffeescript-DPgAWugh.js} +1 -1
- package/dist/playground/assets/{concurnas-C-9xbipX.js → concurnas-CUKNpOla.js} +1 -1
- package/dist/playground/assets/{coq-DAreSd_C.js → coq-CTX51mGs.js} +1 -1
- package/dist/playground/assets/{core-Y42MJhSP.js → core-DQkupPXu.js} +1 -1
- package/dist/playground/assets/{cpp-dvQd7XVa.js → cpp-C1tXJDTh.js} +1 -1
- package/dist/playground/assets/{crystal-BzSJ7kg-.js → crystal-oUuEa2es.js} +1 -1
- package/dist/playground/assets/{csharp-Bl0DNtTi.js → csharp-BBpHwwTR.js} +1 -1
- package/dist/playground/assets/{cshtml-DaQBDDSj.js → cshtml-BGr3_B1M.js} +1 -1
- package/dist/playground/assets/{csp-CBSLToGg.js → csp-GltQGe54.js} +1 -1
- package/dist/playground/assets/{css-X7GKk4nd.js → css-BDxYD9rq.js} +1 -1
- package/dist/playground/assets/{css-extras-6tDxuRPg.js → css-extras-BkXe59-L.js} +1 -1
- package/dist/playground/assets/{csv-C666JHKv.js → csv-C8D8HIlr.js} +1 -1
- package/dist/playground/assets/{cypher-CI59yD-Y.js → cypher-CYU7DwZN.js} +1 -1
- package/dist/playground/assets/{d-NHu2ggck.js → d-AC8YNNya.js} +1 -1
- package/dist/playground/assets/{dart-C4OO9c7H.js → dart-1eVjARaB.js} +1 -1
- package/dist/playground/assets/{dataweave-CIQtCC16.js → dataweave-Cy9KX0sH.js} +1 -1
- package/dist/playground/assets/{dax-C7IJf7L3.js → dax-BJGnfVAi.js} +1 -1
- package/dist/playground/assets/{dhall-4kgCwAd6.js → dhall-BpUv16pM.js} +1 -1
- package/dist/playground/assets/{diff-C_qsBeKM.js → diff-Bd-AlygM.js} +1 -1
- package/dist/playground/assets/{django-DPTTlhRR.js → django-sTqyCMUn.js} +1 -1
- package/dist/playground/assets/{dns-zone-file-DO1jKGSk.js → dns-zone-file-1GhXEXKO.js} +1 -1
- package/dist/playground/assets/{docker-uCrrSsIS.js → docker-BZTwqywV.js} +1 -1
- package/dist/playground/assets/{dot-CnkPmspf.js → dot-CN_l2Zbx.js} +1 -1
- package/dist/playground/assets/{ebnf-CZvJ9HDv.js → ebnf-Cao6g6M8.js} +1 -1
- package/dist/playground/assets/{editorconfig-5YAoIZHN.js → editorconfig-C65v4TTe.js} +1 -1
- package/dist/playground/assets/{eiffel-YChsFLUL.js → eiffel-BY1wPrdH.js} +1 -1
- package/dist/playground/assets/{ejs-DEaypqcg.js → ejs-BYJUnSPa.js} +1 -1
- package/dist/playground/assets/{elixir-Bua3f50n.js → elixir-DUcA1CQ7.js} +1 -1
- package/dist/playground/assets/{elm-CzrYTz84.js → elm-B_iWR6D7.js} +1 -1
- package/dist/playground/assets/{erb-DHlAzH4y.js → erb-VZ17IOos.js} +1 -1
- package/dist/playground/assets/{erlang-CN8eHtjB.js → erlang-BmfJbSZw.js} +1 -1
- package/dist/playground/assets/{etlua-CSad5tkI.js → etlua-Cr74nwq1.js} +1 -1
- package/dist/playground/assets/{excel-formula-Bjsg9dDb.js → excel-formula-BV_N5tyK.js} +1 -1
- package/dist/playground/assets/{factor-T4ODCZmS.js → factor-H6KYHMvj.js} +1 -1
- package/dist/playground/assets/{false-CDRB7B4G.js → false-Cx7AvnUc.js} +1 -1
- package/dist/playground/assets/{firestore-security-rules-CQEuSOjD.js → firestore-security-rules-DxjvvkVI.js} +1 -1
- package/dist/playground/assets/{flow-7QPaHOeo.js → flow-CaafkKZh.js} +1 -1
- package/dist/playground/assets/{fortran-tBLRd-S7.js → fortran-BTAT0lHU.js} +1 -1
- package/dist/playground/assets/{fsharp-gbvf4zmj.js → fsharp-SdPV6MoS.js} +1 -1
- package/dist/playground/assets/{ftl-BrBeJf--.js → ftl-CdaMxLBX.js} +1 -1
- package/dist/playground/assets/{gap-Bdquam6O.js → gap-lw7_MoyR.js} +1 -1
- package/dist/playground/assets/{gcode-DV3U82Ps.js → gcode-Bi78vwuX.js} +1 -1
- package/dist/playground/assets/{gdscript-D5bLVfDf.js → gdscript-01IdRjfA.js} +1 -1
- package/dist/playground/assets/{gedcom-BSZlyAM3.js → gedcom-qa5VGNbi.js} +1 -1
- package/dist/playground/assets/{gherkin-C_cPWstd.js → gherkin-DrJrC98t.js} +1 -1
- package/dist/playground/assets/{git-DjiAiMhU.js → git-BheEAvZB.js} +1 -1
- package/dist/playground/assets/{glsl-DjkCcw_I.js → glsl-CQMHWm2x.js} +1 -1
- package/dist/playground/assets/{gml-D2ApWvNv.js → gml-Bjtos3JR.js} +1 -1
- package/dist/playground/assets/{gn-CXslRvIS.js → gn-BUdAGxdU.js} +1 -1
- package/dist/playground/assets/{go-D--DeI0b.js → go-DpOz20_U.js} +1 -1
- package/dist/playground/assets/{go-module-vtVu50me.js → go-module-B2Bo8Inl.js} +1 -1
- package/dist/playground/assets/{graphql-CXkxvj8v.js → graphql-Bz8kQLri.js} +1 -1
- package/dist/playground/assets/{groovy-CUKxzzqz.js → groovy-Brz1yCEq.js} +1 -1
- package/dist/playground/assets/{haml-oEw5AOTI.js → haml-Bb-I3-i5.js} +1 -1
- package/dist/playground/assets/{handlebars-v40GawBJ.js → handlebars-CUM7hfw1.js} +1 -1
- package/dist/playground/assets/{haskell-B598wJez.js → haskell-yU_5dHIQ.js} +1 -1
- package/dist/playground/assets/{haxe-DMtagSy5.js → haxe-ClW7_VqX.js} +1 -1
- package/dist/playground/assets/{hcl-CFzrJD2V.js → hcl-A3M7U6sx.js} +1 -1
- package/dist/playground/assets/{hlsl-At1hAO_w.js → hlsl-CV8p6SHi.js} +1 -1
- package/dist/playground/assets/{hoon-CsEQUkGS.js → hoon-DOfZY8Wb.js} +1 -1
- package/dist/playground/assets/{hpkp-YUgBwxI_.js → hpkp-BXwyhVni.js} +1 -1
- package/dist/playground/assets/{hsts-TTXygGiR.js → hsts-59AquukD.js} +1 -1
- package/dist/playground/assets/{http-DYtgsWjV.js → http-DEbn8sMc.js} +1 -1
- package/dist/playground/assets/{ichigojam-Dbu4wg_F.js → ichigojam-CQJdDSjc.js} +1 -1
- package/dist/playground/assets/{icon-CZAcBrz2.js → icon-ARicuwT2.js} +1 -1
- package/dist/playground/assets/{icu-message-format-CW0zz52S.js → icu-message-format-D91P0nOv.js} +1 -1
- package/dist/playground/assets/{idris-1wpzU0F3.js → idris-DBiCaeI0.js} +1 -1
- package/dist/playground/assets/{iecst-at64YdTh.js → iecst-DS-EtSFF.js} +1 -1
- package/dist/playground/assets/{ignore-BNvWO4Fc.js → ignore-BgVksdLk.js} +1 -1
- package/dist/playground/assets/{index-BJyBzvq0.js → index-B2FEsEX8.js} +1 -1
- package/dist/playground/assets/{index-DQzrlDOl.js → index-B972m2Un.js} +1 -1
- package/dist/playground/assets/{index-C5RYRmef.js → index-BJGEpHU4.js} +1 -1
- package/dist/playground/assets/{index-DpNBlqih.js → index-BSmKrXcj.js} +1 -1
- package/dist/playground/assets/{index-pITeUvcT.js → index-BbatZigt.js} +1 -1
- package/dist/playground/assets/{index-DW8mdAuC.js → index-BbpTW3Xm.js} +1 -1
- package/dist/playground/assets/{index-DqAGVYSm.js → index-BfKQQ_lf.js} +1 -1
- package/dist/playground/assets/{index-BACOlCIs.js → index-C6V-ctyk.js} +1 -1
- package/dist/playground/assets/{index-Cp633hMk.js → index-CbMh4TbE.js} +1 -1
- package/dist/playground/assets/{index-CTzEmwzR.js → index-Cf-FgNXk.js} +1 -1
- package/dist/playground/assets/{index-Bk9GDtuh.js → index-Cy7GC-ju.js} +1 -1
- package/dist/playground/assets/{index-KshUWIsU.js → index-D16xRHPb.js} +1 -1
- package/dist/playground/assets/{index-Blz-YgXR.js → index-D2fyGZNc.js} +1 -1
- package/dist/playground/assets/{index-CVbRXSYB.js → index-DHv_dSkz.js} +1 -1
- package/dist/playground/assets/{index-BKv1e9UQ.js → index-GOtNWXGx.js} +1 -1
- package/dist/playground/assets/{index-DE4AQpFw.js → index-Rmc5O_oR.js} +1 -1
- package/dist/playground/assets/{index-D9tsldG8.js → index-XAu1AvNW.js} +349 -305
- package/dist/playground/assets/{index-B5ih8vgp.js → index-eCXjJDLv.js} +1 -1
- package/dist/playground/assets/{inform7-jxssRELU.js → inform7-DjNR4sAs.js} +1 -1
- package/dist/playground/assets/{ini-AaVDJc0w.js → ini-CCqkUhJi.js} +1 -1
- package/dist/playground/assets/{io-CImlhAA_.js → io-HQQqcCvC.js} +1 -1
- package/dist/playground/assets/{j-DWcfx09a.js → j-DZp5i3jL.js} +1 -1
- package/dist/playground/assets/{java-CZIGU-EE.js → java-D_oPCdNs.js} +1 -1
- package/dist/playground/assets/{javadoc-CDJfaieT.js → javadoc-DyZBjvWB.js} +1 -1
- package/dist/playground/assets/{javadoclike-DCit1dOx.js → javadoclike-Chnj_N5F.js} +1 -1
- package/dist/playground/assets/{javascript-BYp0hrW9.js → javascript-B9jfLhz3.js} +1 -1
- package/dist/playground/assets/{javastacktrace-B71w34-1.js → javastacktrace-BVemymJw.js} +1 -1
- package/dist/playground/assets/{jexl-BAl7PN7d.js → jexl-CU-RBOR4.js} +1 -1
- package/dist/playground/assets/{jolie-CXcNL9Ex.js → jolie-Cha-OFlZ.js} +1 -1
- package/dist/playground/assets/{jq-C6at8Ldd.js → jq-CMjkNh5d.js} +1 -1
- package/dist/playground/assets/{js-extras--33vsqn1.js → js-extras-BniKZI6e.js} +1 -1
- package/dist/playground/assets/{js-templates-qYT_0Vs8.js → js-templates-ClVKo2BT.js} +1 -1
- package/dist/playground/assets/{jsdoc-DgyjAI-X.js → jsdoc-BrMzvzDK.js} +1 -1
- package/dist/playground/assets/{json-CpKFtMmt.js → json-DF34A1D_.js} +1 -1
- package/dist/playground/assets/{json5-KlhZyQUA.js → json5-D6ETg0VD.js} +1 -1
- package/dist/playground/assets/{jsonp-CYx2Q41r.js → jsonp-DuHV9mxH.js} +1 -1
- package/dist/playground/assets/{jsstacktrace-YonMqrLi.js → jsstacktrace-BO3isI6a.js} +1 -1
- package/dist/playground/assets/{jsx-BETV1iOi.js → jsx-oUXQNPCz.js} +1 -1
- package/dist/playground/assets/{julia-z_rc2VE_.js → julia-D_Cef320.js} +1 -1
- package/dist/playground/assets/{keepalived-B5RddHHz.js → keepalived-yzpayF3c.js} +1 -1
- package/dist/playground/assets/{keyman-DJbl0ZHg.js → keyman-Cha-G3cn.js} +1 -1
- package/dist/playground/assets/{kotlin-s3FLObLD.js → kotlin-Bulm8EmN.js} +1 -1
- package/dist/playground/assets/{kumir-B7NZGF2U.js → kumir-BwN0v8oh.js} +1 -1
- package/dist/playground/assets/{kusto-DTpgscnB.js → kusto-BX-aX_jq.js} +1 -1
- package/dist/playground/assets/{latex-DbuVOvjS.js → latex-DEqyL2ut.js} +1 -1
- package/dist/playground/assets/{latte-C2ECvt3D.js → latte-B2q0JAy4.js} +1 -1
- package/dist/playground/assets/{less-St0NKuRC.js → less-CRBwIMl2.js} +1 -1
- package/dist/playground/assets/{lilypond-Dn1SAEg2.js → lilypond-C2bAZMak.js} +1 -1
- package/dist/playground/assets/{liquid-YZVopELC.js → liquid-D3QPbKWb.js} +1 -1
- package/dist/playground/assets/{lisp-q6RrEW7w.js → lisp-KbCeZg3n.js} +1 -1
- package/dist/playground/assets/{livescript-BNIkJR1Q.js → livescript-j8ItPi2b.js} +1 -1
- package/dist/playground/assets/{llvm-in50JjW3.js → llvm-BdT72xcB.js} +1 -1
- package/dist/playground/assets/{log-CKRTCVDT.js → log-Ca8hWhgq.js} +1 -1
- package/dist/playground/assets/{lolcode-BIrTwhMT.js → lolcode-CK9jHhIe.js} +1 -1
- package/dist/playground/assets/{lua-vZL8oDzk.js → lua-CQ7zG3QO.js} +1 -1
- package/dist/playground/assets/{magma-Dj0h8OKy.js → magma-B4WoDAdb.js} +1 -1
- package/dist/playground/assets/{makefile-PiKHyPYK.js → makefile-DRCtk6Nx.js} +1 -1
- package/dist/playground/assets/{markdown-DVd-o5Uk.js → markdown-1iGCGzQ7.js} +1 -1
- package/dist/playground/assets/{markup-PlSstWoq.js → markup-DTO9t2KR.js} +1 -1
- package/dist/playground/assets/{markup-templating-JgJykuvD.js → markup-templating-DZdRBL6R.js} +1 -1
- package/dist/playground/assets/{matlab-BnWas09R.js → matlab-GlI9xSnO.js} +1 -1
- package/dist/playground/assets/{maxscript-Bi9gYmwI.js → maxscript-DkHlSJGz.js} +1 -1
- package/dist/playground/assets/{mel-Bx503q60.js → mel-BDRS7as7.js} +1 -1
- package/dist/playground/assets/{mermaid-BBY2Veah.js → mermaid-DUBxIqDz.js} +1 -1
- package/dist/playground/assets/{mizar-CbfPTWsi.js → mizar-TMjQkH6t.js} +1 -1
- package/dist/playground/assets/{mongodb-BrZoCPf6.js → mongodb-D17D-z3x.js} +1 -1
- package/dist/playground/assets/{monkey-DrSj3bQP.js → monkey-DKzQWXew.js} +1 -1
- package/dist/playground/assets/{moonscript-CXrLB_sP.js → moonscript-YvirLEB6.js} +1 -1
- package/dist/playground/assets/{n1ql-IXf-_rD6.js → n1ql-D7EBrk76.js} +1 -1
- package/dist/playground/assets/{n4js-Dm_aAo1q.js → n4js-AGysbVKZ.js} +1 -1
- package/dist/playground/assets/{nand2tetris-hdl-Ctw7lAR1.js → nand2tetris-hdl-RSq1smoT.js} +1 -1
- package/dist/playground/assets/{naniscript-DnEVNZWI.js → naniscript-CFQz6cin.js} +1 -1
- package/dist/playground/assets/{nasm-C9KZQGtg.js → nasm-Gv21rRiH.js} +1 -1
- package/dist/playground/assets/{neon-CHk4gRLd.js → neon-C-4a_p-6.js} +1 -1
- package/dist/playground/assets/{nevod-CYGoG76S.js → nevod-BE-Zgm0A.js} +1 -1
- package/dist/playground/assets/{nginx-DCbjBtvT.js → nginx-B3BsPDqE.js} +1 -1
- package/dist/playground/assets/{nim-CTeNWzMe.js → nim-BLmUHkKj.js} +1 -1
- package/dist/playground/assets/{nix-BUoatC9F.js → nix-BU0zddII.js} +1 -1
- package/dist/playground/assets/{nsis-BVo5BwWQ.js → nsis-Ddm92SWN.js} +1 -1
- package/dist/playground/assets/{objectivec-DQPI4Ik8.js → objectivec-ABq8Mm5k.js} +1 -1
- package/dist/playground/assets/{ocaml-Dzo3oFAI.js → ocaml-Ixj21G4g.js} +1 -1
- package/dist/playground/assets/{opencl-BA-UZawg.js → opencl-zdUUY9XM.js} +1 -1
- package/dist/playground/assets/{openqasm-3eTOQMpn.js → openqasm-CriPwmlK.js} +1 -1
- package/dist/playground/assets/{oz-BUfQm9QM.js → oz-B2HWkTCM.js} +1 -1
- package/dist/playground/assets/{parigp-DLMB9Yy7.js → parigp-C8RqgeOv.js} +1 -1
- package/dist/playground/assets/{parser-bNipfYQI.js → parser-CPKYBPtd.js} +1 -1
- package/dist/playground/assets/{pascal-eOX_61Ye.js → pascal-BfHplbpc.js} +1 -1
- package/dist/playground/assets/{pascaligo-QccLOuSm.js → pascaligo-9cOdgpmV.js} +1 -1
- package/dist/playground/assets/{pcaxis-CCsi4Cdl.js → pcaxis-BuSx_kfh.js} +1 -1
- package/dist/playground/assets/{peoplecode-BqL_EsnZ.js → peoplecode-D89486CG.js} +1 -1
- package/dist/playground/assets/{perl-FlRlqKMK.js → perl-b802VC1E.js} +1 -1
- package/dist/playground/assets/{php-Oj-eFRae.js → php-Jpy-nMIG.js} +1 -1
- package/dist/playground/assets/{php-extras-BkThMOQG.js → php-extras-Bn4dJWx9.js} +1 -1
- package/dist/playground/assets/{phpdoc-UZ0tnEFb.js → phpdoc-PpQbYbqz.js} +1 -1
- package/dist/playground/assets/{plsql-DspmX3yk.js → plsql-Dt_SppOk.js} +1 -1
- package/dist/playground/assets/{powerquery-BFSj7jZG.js → powerquery-Bc7eEze8.js} +1 -1
- package/dist/playground/assets/{powershell-CMHTtY3O.js → powershell-CStj08Hx.js} +1 -1
- package/dist/playground/assets/{processing-BY3oOdHW.js → processing-C1JTlqFd.js} +1 -1
- package/dist/playground/assets/{prolog-DKtbAm_1.js → prolog-B-GNUuOV.js} +1 -1
- package/dist/playground/assets/{promql-B2VeNPOl.js → promql-Bap2ofnb.js} +1 -1
- package/dist/playground/assets/{properties-IgKuI3jR.js → properties-Bmb0L3K-.js} +1 -1
- package/dist/playground/assets/{protobuf-DST_oL78.js → protobuf-Dn-X1DDq.js} +1 -1
- package/dist/playground/assets/{psl-YdQc77En.js → psl-BWf_Fpl0.js} +1 -1
- package/dist/playground/assets/{pug-DC2wmi1i.js → pug-JI4oVNTh.js} +1 -1
- package/dist/playground/assets/{puppet-BKl3e7n6.js → puppet-DmG70djG.js} +1 -1
- package/dist/playground/assets/{pure-CNL5Pvvs.js → pure-hzlgIe3s.js} +1 -1
- package/dist/playground/assets/{purebasic-BqKwQpF-.js → purebasic-BFFIHatU.js} +1 -1
- package/dist/playground/assets/{purescript-Hj2l0ELm.js → purescript-3RaTWJxq.js} +1 -1
- package/dist/playground/assets/{python-nvRgPhpi.js → python-CgLsgfE0.js} +1 -1
- package/dist/playground/assets/{q-DbQ994zM.js → q-CFZaCybp.js} +1 -1
- package/dist/playground/assets/{qml-CggQfWah.js → qml-BGPA50aO.js} +1 -1
- package/dist/playground/assets/{qore-BRQII8uz.js → qore-B75zX4vH.js} +1 -1
- package/dist/playground/assets/{qsharp-BIaoV9bS.js → qsharp-BgTsWLZU.js} +1 -1
- package/dist/playground/assets/{r-BTd-9uy5.js → r-j4HR_0nG.js} +1 -1
- package/dist/playground/assets/{racket-Ek2lOXun.js → racket-Csb45ted.js} +1 -1
- package/dist/playground/assets/{reason-BSON80OJ.js → reason-BEizlYQ-.js} +1 -1
- package/dist/playground/assets/{regex-C4YPoQHw.js → regex-Tfc8lT5t.js} +1 -1
- package/dist/playground/assets/{rego-B-wnvXsQ.js → rego-CgKzf-U8.js} +1 -1
- package/dist/playground/assets/{renpy-BNhAL0UW.js → renpy-Dv0QTYsE.js} +1 -1
- package/dist/playground/assets/{rest-BbG27K1x.js → rest-CDkxO0Xp.js} +1 -1
- package/dist/playground/assets/{rip-DC5QAuJO.js → rip-Bz5eznLE.js} +1 -1
- package/dist/playground/assets/{roboconf-Svon_Rhh.js → roboconf-C0NCywBn.js} +1 -1
- package/dist/playground/assets/{robotframework-Bs2hNsWy.js → robotframework-B4lDNhZj.js} +1 -1
- package/dist/playground/assets/{ruby-DTGHQP7e.js → ruby-BbMtl6N3.js} +1 -1
- package/dist/playground/assets/{rust-DH_tP2GS.js → rust-DKf5uPU0.js} +1 -1
- package/dist/playground/assets/{sas-Dcbq9F7Y.js → sas-DmbaK6em.js} +1 -1
- package/dist/playground/assets/{sass-CAC1LkOo.js → sass-u2a8N2ib.js} +1 -1
- package/dist/playground/assets/{scala-CdIfwg3b.js → scala-CsG0vHa8.js} +1 -1
- package/dist/playground/assets/{scheme-fKF3CFlW.js → scheme-C0wMT8OY.js} +1 -1
- package/dist/playground/assets/{scss-kIXiJE90.js → scss-CIsRQIbS.js} +1 -1
- package/dist/playground/assets/{shell-session-w--rEEtT.js → shell-session-DLmGaXkR.js} +1 -1
- package/dist/playground/assets/{smali-DCfahoCo.js → smali-B-UvTauF.js} +1 -1
- package/dist/playground/assets/{smalltalk-CpOPF3mv.js → smalltalk-Cyzqf2CY.js} +1 -1
- package/dist/playground/assets/{smarty-CN9o9u-J.js → smarty-DIBhWhES.js} +1 -1
- package/dist/playground/assets/{sml-D9MDwkty.js → sml-Dk7WR2eO.js} +1 -1
- package/dist/playground/assets/{solidity-Kpw3IWQL.js → solidity-DzM-klHb.js} +1 -1
- package/dist/playground/assets/{solution-file-B2U2tBjI.js → solution-file-BGdLAmZb.js} +1 -1
- package/dist/playground/assets/{soy-CRAL_mXk.js → soy-WWtMoZWm.js} +1 -1
- package/dist/playground/assets/{sparql-CxUgdNvl.js → sparql-BytMoUPr.js} +1 -1
- package/dist/playground/assets/{splunk-spl-DHmHXWus.js → splunk-spl-CIIWXkg9.js} +1 -1
- package/dist/playground/assets/{sqf-O_m0LsHG.js → sqf-DZKuZoNS.js} +1 -1
- package/dist/playground/assets/{sql-DeIvDdac.js → sql-CV2EgD-X.js} +1 -1
- package/dist/playground/assets/{squirrel-BX42uwAc.js → squirrel-D5G4yDQE.js} +1 -1
- package/dist/playground/assets/{stan-kt76k905.js → stan-CIwrbYLM.js} +1 -1
- package/dist/playground/assets/style-DkRpX1cz.css +1 -0
- package/dist/playground/assets/{stylus-CP8LaAU_.js → stylus-DosQ3wEK.js} +1 -1
- package/dist/playground/assets/{swift-DSWaws21.js → swift-DVoTXlNm.js} +1 -1
- package/dist/playground/assets/{systemd-B0aSnDJI.js → systemd-BrHuacWE.js} +1 -1
- package/dist/playground/assets/{t4-cs-BB3rAiMZ.js → t4-cs-CJVPzG8j.js} +1 -1
- package/dist/playground/assets/{t4-templating-oWy3Wqfy.js → t4-templating-DCKB-xxa.js} +1 -1
- package/dist/playground/assets/{t4-vb-Dy5JdxHS.js → t4-vb-CCVlmq_p.js} +1 -1
- package/dist/playground/assets/{tap-Bmdsuv1i.js → tap-K1StiBHZ.js} +1 -1
- package/dist/playground/assets/{tcl-Drcru4Vj.js → tcl-CTS-UJhx.js} +1 -1
- package/dist/playground/assets/{textile-C9EocdUf.js → textile-PGtWbNbI.js} +1 -1
- package/dist/playground/assets/{toml-BQ0OcXHR.js → toml-C32_QmpW.js} +1 -1
- package/dist/playground/assets/{tremor-B1gwzB2z.js → tremor-C6GQZcaF.js} +1 -1
- package/dist/playground/assets/{tsx-Ba5tyWgS.js → tsx-CNGXfHf5.js} +1 -1
- package/dist/playground/assets/{tt2-_ZkTiupH.js → tt2-D2asEIIA.js} +1 -1
- package/dist/playground/assets/{turtle-C9lCkaU-.js → turtle-BeOAps6D.js} +1 -1
- package/dist/playground/assets/{twig-DSL6_k46.js → twig-DnRA8b_c.js} +1 -1
- package/dist/playground/assets/{typescript-Dmtt5uxH.js → typescript-DwZ0aAIr.js} +1 -1
- package/dist/playground/assets/{typoscript-Cyi8laM1.js → typoscript-C1Abfy3p.js} +1 -1
- package/dist/playground/assets/{unrealscript-DvOfnwH_.js → unrealscript-CUanXpl-.js} +1 -1
- package/dist/playground/assets/{uorazor-hhQUIS1I.js → uorazor-Dir8pmuF.js} +1 -1
- package/dist/playground/assets/{uri-zPhSFyzs.js → uri-WdtVq9EY.js} +1 -1
- package/dist/playground/assets/{v-BCS4GYRb.js → v-B9uv8nIm.js} +1 -1
- package/dist/playground/assets/{vala-BFsZtDjj.js → vala-BpYuFBFh.js} +1 -1
- package/dist/playground/assets/{vbnet-pAD-CnX8.js → vbnet-CrTrisqD.js} +1 -1
- package/dist/playground/assets/{velocity-BR62bLlx.js → velocity-DLpAzI7w.js} +1 -1
- package/dist/playground/assets/{verilog-DeMqcTMT.js → verilog-UvKx9aG_.js} +1 -1
- package/dist/playground/assets/{vhdl-sLg9PFwQ.js → vhdl-DEwVTiBO.js} +1 -1
- package/dist/playground/assets/{vim-D1srTEhx.js → vim-Dx6r37LX.js} +1 -1
- package/dist/playground/assets/{visual-basic-DbMx4RYs.js → visual-basic-BslyvNgr.js} +1 -1
- package/dist/playground/assets/{warpscript-DL2cr1i4.js → warpscript-UQCVJq5J.js} +1 -1
- package/dist/playground/assets/{wasm-B4KKxRe0.js → wasm-DRKP4B39.js} +1 -1
- package/dist/playground/assets/{web-idl-CxpS6gw2.js → web-idl-W8E7Nc1m.js} +1 -1
- package/dist/playground/assets/{wiki-CFAQ3xOY.js → wiki-DJs1TIsO.js} +1 -1
- package/dist/playground/assets/{wolfram-CJz4xslT.js → wolfram-DDsub-da.js} +1 -1
- package/dist/playground/assets/{wren-Dl38ONdP.js → wren-Ci4dgNa6.js} +1 -1
- package/dist/playground/assets/{xeora-D0BzMZr-.js → xeora-Tml5mLJD.js} +1 -1
- package/dist/playground/assets/{xml-doc-DzJZrHzW.js → xml-doc-CXJ_BnoP.js} +1 -1
- package/dist/playground/assets/{xojo-CALH1OZZ.js → xojo-Vi3sVffH.js} +1 -1
- package/dist/playground/assets/{xquery-BWp5HQs0.js → xquery-CyNLUs-0.js} +1 -1
- package/dist/playground/assets/{yaml-DJXdlQxk.js → yaml-BDdOPn1D.js} +1 -1
- package/dist/playground/assets/{yang-CVZlC3Or.js → yang-lz56y8cI.js} +1 -1
- package/dist/playground/assets/{zig-uddugz-6.js → zig-egkOq0yY.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-D6NRTVVY.js.map +0 -1
- package/dist/playground/assets/style-B0ga_rpf.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
|
|
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
|
|
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
|
-
|
|
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.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(
|
|
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,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 =
|
|
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 || "";
|
|
@@ -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 ?
|
|
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 =
|
|
1195
|
+
const envExamplePath = path3.join(projectPath, ".env.example");
|
|
1098
1196
|
if (await fileExists(envExamplePath)) {
|
|
1099
|
-
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
|
1337
|
+
const selected = await p5.select({
|
|
1214
1338
|
message: "Select a template:",
|
|
1215
1339
|
options: choices
|
|
1216
1340
|
});
|
|
1217
|
-
if (
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1377
|
-
const projectName = name ?? await
|
|
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 (
|
|
1389
|
-
|
|
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 =
|
|
1524
|
+
const s2 = p5.spinner();
|
|
1400
1525
|
try {
|
|
1401
1526
|
s2.start("Creating project");
|
|
1402
1527
|
try {
|
|
@@ -1433,7 +1558,7 @@ var createMastraProject = async ({
|
|
|
1433
1558
|
s2.start(`Installing ${pm} dependencies`);
|
|
1434
1559
|
try {
|
|
1435
1560
|
await exec3(`${pm} ${installCommand} zod@^4`);
|
|
1436
|
-
await exec3(`${pm} ${installCommand} typescript @types/node
|
|
1561
|
+
await exec3(`${pm} ${installCommand} -D typescript @types/node`);
|
|
1437
1562
|
await exec3(`echo '{
|
|
1438
1563
|
"compilerOptions": {
|
|
1439
1564
|
"target": "ES2022",
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
1505
|
-
|
|
1506
|
-
|
|
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 =
|
|
1641
|
+
const needsInteractive = args.components === void 0 || args.llmProvider === void 0 || args.addExample === void 0;
|
|
1510
1642
|
const { projectName, result } = await createMastraProject({
|
|
1511
|
-
projectName:
|
|
1512
|
-
createVersionTag:
|
|
1513
|
-
timeout:
|
|
1514
|
-
llmProvider:
|
|
1515
|
-
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 =
|
|
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:
|
|
1664
|
+
versionTag: args.createVersionTag
|
|
1533
1665
|
});
|
|
1534
1666
|
postCreate({ projectName });
|
|
1535
1667
|
return;
|
|
1536
1668
|
}
|
|
1537
|
-
const { components = [], llmProvider = "openai", addExample = false, llmApiKey } =
|
|
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:
|
|
1552
|
-
versionTag:
|
|
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
|
-
|
|
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(
|
|
1775
|
+
async function createFromTemplate(args) {
|
|
1644
1776
|
let selectedTemplate;
|
|
1645
|
-
if (
|
|
1777
|
+
if (args.template === true) {
|
|
1646
1778
|
const templates = await loadTemplates();
|
|
1647
1779
|
const selected = await selectTemplate(templates);
|
|
1648
1780
|
if (!selected) {
|
|
1649
|
-
|
|
1781
|
+
p5.log.info("No template selected. Exiting.");
|
|
1650
1782
|
return;
|
|
1651
1783
|
}
|
|
1652
1784
|
selectedTemplate = selected;
|
|
1653
|
-
} else if (
|
|
1654
|
-
if (isGitHubUrl(
|
|
1655
|
-
const spinner4 =
|
|
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(
|
|
1789
|
+
const validation = await validateGitHubProject(args.template);
|
|
1658
1790
|
if (!validation.isValid) {
|
|
1659
1791
|
spinner4.stop("Validation failed");
|
|
1660
|
-
|
|
1661
|
-
validation.errors.forEach((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(
|
|
1797
|
+
selectedTemplate = await createFromGitHubUrl(args.template);
|
|
1666
1798
|
} else {
|
|
1667
1799
|
const templates = await loadTemplates();
|
|
1668
|
-
const found = findTemplateByName(templates,
|
|
1800
|
+
const found = findTemplateByName(templates, args.template);
|
|
1669
1801
|
if (!found) {
|
|
1670
|
-
|
|
1671
|
-
templates.forEach((t) =>
|
|
1672
|
-
throw new Error(`Template "${
|
|
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 =
|
|
1812
|
+
let projectName = args.projectName;
|
|
1681
1813
|
if (!projectName) {
|
|
1682
1814
|
const defaultName = getDefaultProjectName(selectedTemplate);
|
|
1683
|
-
const response = await
|
|
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 (
|
|
1689
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
1722
|
-
//# sourceMappingURL=chunk-
|
|
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
|