mastra 1.0.0-beta.1 → 1.0.0-beta.10
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 +173 -0
- package/dist/analytics/index.js +1 -1
- package/dist/{chunk-NHL3S2MZ.js → chunk-THUIZ4X5.js} +530 -254
- package/dist/chunk-THUIZ4X5.js.map +1 -0
- package/dist/{chunk-OQQFOUQW.js → chunk-TL3K64EI.js} +2 -2
- package/dist/chunk-TL3K64EI.js.map +1 -0
- package/dist/commands/actions/init-project.d.ts.map +1 -1
- 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 +2 -2
- package/dist/commands/create/utils.d.ts +1 -0
- 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 +2 -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 +9 -2
- package/dist/commands/init/utils.d.ts.map +1 -1
- package/dist/commands/start/start.d.ts.map +1 -1
- package/dist/commands/studio/index.d.ts +2 -0
- package/dist/commands/studio/index.d.ts.map +1 -0
- package/dist/commands/studio/studio.d.ts +7 -0
- package/dist/commands/studio/studio.d.ts.map +1 -0
- package/dist/commands/utils.d.ts +13 -1
- package/dist/commands/utils.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +137 -47
- package/dist/index.js.map +1 -1
- package/dist/playground/assets/abap-FIXVzycL.js +1 -0
- package/dist/playground/assets/abnf-By4-uL43.js +1 -0
- package/dist/playground/assets/actionscript-9f4cLMp1.js +1 -0
- package/dist/playground/assets/ada-HkG7d5Qx.js +1 -0
- package/dist/playground/assets/agda-NVUGKSBX.js +1 -0
- package/dist/playground/assets/al-B1SY5f_t.js +1 -0
- package/dist/playground/assets/antlr4-CwEy4TSJ.js +1 -0
- package/dist/playground/assets/apacheconf-DbL_4DCB.js +1 -0
- package/dist/playground/assets/apex-4a8yF-pY.js +1 -0
- package/dist/playground/assets/apl-Dv69rce6.js +1 -0
- package/dist/playground/assets/applescript-CEJtb6gc.js +1 -0
- package/dist/playground/assets/aql-BHV5TqzT.js +1 -0
- package/dist/playground/assets/arduino-CPHnVaLq.js +1 -0
- package/dist/playground/assets/arff-CBv-0Dr0.js +1 -0
- package/dist/playground/assets/asciidoc-BcbhqDMd.js +1 -0
- package/dist/playground/assets/asm6502-DR7DA_kd.js +1 -0
- package/dist/playground/assets/asmatmel-CUyodlOr.js +1 -0
- package/dist/playground/assets/aspnet-CIEFyrfT.js +1 -0
- package/dist/playground/assets/autohotkey-Bph4eoZz.js +1 -0
- package/dist/playground/assets/autoit-C9go9SrR.js +1 -0
- package/dist/playground/assets/avisynth-DmV3YHH-.js +1 -0
- package/dist/playground/assets/avro-idl-DFfE3que.js +1 -0
- package/dist/playground/assets/bash-jmeqaWHv.js +1 -0
- package/dist/playground/assets/{bash-DC9ltNCH.js → basic-Bd0Xvv0J.js} +1 -1
- package/dist/playground/assets/batch-BuRRqR93.js +1 -0
- package/dist/playground/assets/bbcode-Bj1xDsRH.js +1 -0
- package/dist/playground/assets/bicep-sGbUQydi.js +1 -0
- package/dist/playground/assets/birb-Jvsj8R5K.js +1 -0
- package/dist/playground/assets/bison-CvpRrxL5.js +1 -0
- package/dist/playground/assets/bnf-D4J_7g2u.js +1 -0
- package/dist/playground/assets/brainfuck-B8AoObrn.js +1 -0
- package/dist/playground/assets/brightscript-BAsP5KY7.js +1 -0
- package/dist/playground/assets/bro-D3dpujDL.js +1 -0
- package/dist/playground/assets/bsl-B8C16WaG.js +1 -0
- package/dist/playground/assets/c-DhcBTJYa.js +1 -0
- package/dist/playground/assets/cfscript-hJ_jcmxb.js +1 -0
- package/dist/playground/assets/chaiscript-BewoSnZY.js +1 -0
- package/dist/playground/assets/chunk-55VPMN3N-Dhe3ufQx.js +1 -0
- package/dist/playground/assets/cil-BFlkBlAA.js +1 -0
- package/dist/playground/assets/clike-BVgoTod2.js +1 -0
- package/dist/playground/assets/clojure-DKF4IG7_.js +1 -0
- package/dist/playground/assets/cmake-f4bHlxfx.js +1 -0
- package/dist/playground/assets/cobol-b6YzEyDG.js +1 -0
- package/dist/playground/assets/coffeescript-CKcbXY2Y.js +1 -0
- package/dist/playground/assets/concurnas-CDvC9TA8.js +1 -0
- package/dist/playground/assets/coq-DMsew7Ej.js +1 -0
- package/dist/playground/assets/core-CDJBBCPO.js +8 -0
- package/dist/playground/assets/cpp-XJRt1avb.js +1 -0
- package/dist/playground/assets/crystal-D9QO3tZT.js +1 -0
- package/dist/playground/assets/csharp-Bc6Ynmxy.js +1 -0
- package/dist/playground/assets/cshtml-D9djiSYy.js +1 -0
- package/dist/playground/assets/csp-CRBEH-GS.js +1 -0
- package/dist/playground/assets/css-Dx6HjU9u.js +1 -0
- package/dist/playground/assets/css-extras-wjWeiD_E.js +1 -0
- package/dist/playground/assets/csv-DyxK3wmT.js +1 -0
- package/dist/playground/assets/cypher-Cc4XfOy_.js +1 -0
- package/dist/playground/assets/d-CsrhlVR-.js +1 -0
- package/dist/playground/assets/dart-sJXfdvpC.js +1 -0
- package/dist/playground/assets/dataweave-wF6LdyMy.js +1 -0
- package/dist/playground/assets/dax-SZe2SxBb.js +1 -0
- package/dist/playground/assets/dhall-C-ZT_se_.js +1 -0
- package/dist/playground/assets/diff-XkG0B6dy.js +3 -0
- package/dist/playground/assets/django-CNVE53kn.js +1 -0
- package/dist/playground/assets/dns-zone-file-DyHwwn2-.js +1 -0
- package/dist/playground/assets/docker-CtPL61Su.js +1 -0
- package/dist/playground/assets/dot-bT1rIhkX.js +1 -0
- package/dist/playground/assets/ebnf-BBQkb-4j.js +1 -0
- package/dist/playground/assets/editorconfig-bZGzi58w.js +1 -0
- package/dist/playground/assets/eiffel-DdiSXgQa.js +1 -0
- package/dist/playground/assets/ejs-BZ6XIneR.js +1 -0
- package/dist/playground/assets/elixir-zMJsNcjN.js +1 -0
- package/dist/playground/assets/elm-lbmKP8Yv.js +1 -0
- package/dist/playground/assets/erb-CU_MBiRT.js +1 -0
- package/dist/playground/assets/erlang-DkHZ8fiG.js +1 -0
- package/dist/playground/assets/etlua-MlIeAg7x.js +1 -0
- package/dist/playground/assets/excel-formula-D6MkfBk0.js +1 -0
- package/dist/playground/assets/factor-DpxrPjE8.js +1 -0
- package/dist/playground/assets/false-DU0s4ntm.js +1 -0
- package/dist/playground/assets/firestore-security-rules-BZSFJQaQ.js +1 -0
- package/dist/playground/assets/flow-D3a2LgHE.js +1 -0
- package/dist/playground/assets/fortran-iBT8UWOX.js +1 -0
- package/dist/playground/assets/fsharp-DXXWRguP.js +1 -0
- package/dist/playground/assets/ftl-DovPr19-.js +1 -0
- package/dist/playground/assets/gap-PZRisdYB.js +1 -0
- package/dist/playground/assets/gcode-ChgV_KCF.js +1 -0
- package/dist/playground/assets/gdscript-Cy8Xk01F.js +1 -0
- package/dist/playground/assets/gedcom-oQpcZB2I.js +1 -0
- package/dist/playground/assets/gherkin-KCacYXwp.js +1 -0
- package/dist/playground/assets/git-CG8SgFBW.js +1 -0
- package/dist/playground/assets/glsl-B1Qtewh3.js +1 -0
- package/dist/playground/assets/gml-CZv1TPN3.js +1 -0
- package/dist/playground/assets/gn-CFD0oOaJ.js +1 -0
- package/dist/playground/assets/go-BDhbzzZQ.js +1 -0
- package/dist/playground/assets/go-module-TQV2JXyL.js +1 -0
- package/dist/playground/assets/graphql-C8FTbJQM.js +1 -0
- package/dist/playground/assets/groovy-vFnsC5L9.js +1 -0
- package/dist/playground/assets/haml-BldrZnyA.js +1 -0
- package/dist/playground/assets/handlebars-Cl4d1OSC.js +1 -0
- package/dist/playground/assets/haskell-k5R857Zs.js +1 -0
- package/dist/playground/assets/haxe-x5eoD49s.js +1 -0
- package/dist/playground/assets/hcl-mSl8xedx.js +1 -0
- package/dist/playground/assets/hlsl-9lMa_1xq.js +1 -0
- package/dist/playground/assets/hoon-YYkqqes1.js +1 -0
- package/dist/playground/assets/hpkp-CUrVQJor.js +1 -0
- package/dist/playground/assets/hsts-DwVBB0lW.js +1 -0
- package/dist/playground/assets/http-DglbIM32.js +1 -0
- package/dist/playground/assets/ichigojam-DWa0cNxX.js +1 -0
- package/dist/playground/assets/icon-DW8v1-dE.js +1 -0
- package/dist/playground/assets/icu-message-format-CIk1tr7R.js +1 -0
- package/dist/playground/assets/idris-CsroogRC.js +1 -0
- package/dist/playground/assets/iecst-Co3M2_Yi.js +1 -0
- package/dist/playground/assets/ignore-oLK-8Ahh.js +1 -0
- package/dist/playground/assets/index-8uXMhpQm.js +7 -0
- package/dist/playground/assets/{index-CLu0RbtZ.js → index-B3K3E7lh.js} +2 -2
- package/dist/playground/assets/index-BBzWmVlV.js +1 -0
- package/dist/playground/assets/index-Bn0E-nQM.js +1 -0
- package/dist/playground/assets/index-CL31sTuI.js +1 -0
- package/dist/playground/assets/index-CbIcfWVl.js +1 -0
- package/dist/playground/assets/index-CdMDwMv2.js +1 -0
- package/dist/playground/assets/index-D1KvEziA.js +1 -0
- package/dist/playground/assets/index-DD-4x9Lc.js +13 -0
- package/dist/playground/assets/index-DKux1Dny.js +1 -0
- package/dist/playground/assets/index-DRjE9_iO.js +1 -0
- package/dist/playground/assets/index-DSR-RUmF.js +1 -0
- package/dist/playground/assets/index-DWf13Ibp.js +1 -0
- package/dist/playground/assets/index-DbrLwC0Y.js +3 -0
- package/dist/playground/assets/index-DrTrdtE8.js +1 -0
- package/dist/playground/assets/index-TeIAN1tr.js +1 -0
- package/dist/playground/assets/index-l0uyD7k6.js +1 -0
- package/dist/playground/assets/index-q01yofCI.js +1 -0
- package/dist/playground/assets/inform7-CbjNwYtR.js +1 -0
- package/dist/playground/assets/ini-3heMRyW6.js +1 -0
- package/dist/playground/assets/io-CvfxPic_.js +1 -0
- package/dist/playground/assets/j-C98YOhah.js +1 -0
- package/dist/playground/assets/{lua-gNMwUQjv.js → java-DhQhApxl.js} +1 -1
- package/dist/playground/assets/javadoc-Cnp8Sbaz.js +1 -0
- package/dist/playground/assets/javadoclike-zr3NJLJi.js +1 -0
- package/dist/playground/assets/javascript-PUcqH7ZS.js +1 -0
- package/dist/playground/assets/javastacktrace-C6l4ub9L.js +1 -0
- package/dist/playground/assets/jexl-DNeXcm49.js +1 -0
- package/dist/playground/assets/jolie-zoTOW02A.js +1 -0
- package/dist/playground/assets/jq-Ca0CrUyy.js +1 -0
- package/dist/playground/assets/js-extras-B4r4kSxG.js +1 -0
- package/dist/playground/assets/js-templates-DAlwvA0o.js +1 -0
- package/dist/playground/assets/jsdoc-DjsiXAM4.js +1 -0
- package/dist/playground/assets/json-CLk2Yhfg.js +1 -0
- package/dist/playground/assets/json5-DcU7maja.js +1 -0
- package/dist/playground/assets/jsonp-DpVFheql.js +1 -0
- package/dist/playground/assets/jsstacktrace-DgyGl8Rf.js +1 -0
- package/dist/playground/assets/jsx-BTbGatd0.js +1 -0
- package/dist/playground/assets/julia--GYy8oeg.js +1 -0
- package/dist/playground/assets/keepalived-5vf1JhH_.js +1 -0
- package/dist/playground/assets/keyman-IFl0jfnx.js +1 -0
- package/dist/playground/assets/kotlin-9LEEP8JX.js +1 -0
- package/dist/playground/assets/kumir-DWRlydVK.js +1 -0
- package/dist/playground/assets/kusto-BFXdehEL.js +1 -0
- package/dist/playground/assets/latex-Di49YGCi.js +1 -0
- package/dist/playground/assets/latte-Dvhdt96y.js +1 -0
- package/dist/playground/assets/less-D0HobN9c.js +1 -0
- package/dist/playground/assets/lilypond-B6-c7NJu.js +1 -0
- package/dist/playground/assets/liquid-DchZzf2C.js +1 -0
- package/dist/playground/assets/lisp-CYvk8xUV.js +1 -0
- package/dist/playground/assets/livescript-DnXQ3Cts.js +1 -0
- package/dist/playground/assets/llvm-DnSbNag3.js +1 -0
- package/dist/playground/assets/log-27FalpNh.js +1 -0
- package/dist/playground/assets/lolcode-dtWdLdKK.js +1 -0
- package/dist/playground/assets/lua-DOG-z0SQ.js +1 -0
- package/dist/playground/assets/magma-tgLSM-Bu.js +1 -0
- package/dist/playground/assets/main-B4eMybNm.js +1193 -0
- package/dist/playground/assets/makefile-2tBsxb4I.js +1 -0
- package/dist/playground/assets/markdown-Cq6fg4gF.js +1 -0
- package/dist/playground/assets/markup-CB5PvA0c.js +1 -0
- package/dist/playground/assets/markup-templating-2yvSgZUf.js +1 -0
- package/dist/playground/assets/matlab-6PZ6jdlZ.js +1 -0
- package/dist/playground/assets/maxscript-Bw9FpgtC.js +1 -0
- package/dist/playground/assets/mel-CDFYe0Vs.js +1 -0
- package/dist/playground/assets/mermaid-DWIhjMoS.js +1 -0
- package/dist/playground/assets/mizar-C9oC8urs.js +1 -0
- package/dist/playground/assets/mongodb-CmAe8j6w.js +1 -0
- package/dist/playground/assets/monkey-CJlsplfV.js +1 -0
- package/dist/playground/assets/moonscript-D_MHIf4p.js +1 -0
- package/dist/playground/assets/n1ql-Dx5j-v-O.js +1 -0
- package/dist/playground/assets/n4js-BMJanWSU.js +1 -0
- package/dist/playground/assets/nand2tetris-hdl-B2HwHziQ.js +1 -0
- package/dist/playground/assets/naniscript-ZwQpPjaD.js +1 -0
- package/dist/playground/assets/nasm-tWtetAV-.js +1 -0
- package/dist/playground/assets/neon-CoiFX-XW.js +1 -0
- package/dist/playground/assets/nevod-_iJ0mW3A.js +1 -0
- package/dist/playground/assets/nginx-Bbr-hTPn.js +1 -0
- package/dist/playground/assets/nim-B-Oqihq4.js +1 -0
- package/dist/playground/assets/nix-DYFkGjrM.js +1 -0
- package/dist/playground/assets/nsis-BXCKQAg-.js +1 -0
- package/dist/playground/assets/objectivec-BM9MCIgp.js +1 -0
- package/dist/playground/assets/ocaml-BZ7ViprC.js +1 -0
- package/dist/playground/assets/opencl-CLRlnGe-.js +1 -0
- package/dist/playground/assets/openqasm-ZQJUmoDa.js +1 -0
- package/dist/playground/assets/oz-CxqsczrJ.js +1 -0
- package/dist/playground/assets/parigp-BvJTqxyQ.js +1 -0
- package/dist/playground/assets/parser-Wb4mb5NI.js +1 -0
- package/dist/playground/assets/pascal-B78HJWo9.js +1 -0
- package/dist/playground/assets/pascaligo-E1N1zv0Y.js +1 -0
- package/dist/playground/assets/pcaxis-CtiHhjSC.js +1 -0
- package/dist/playground/assets/peoplecode-BsFFgrRe.js +1 -0
- package/dist/playground/assets/perl-Bf5_xcTP.js +1 -0
- package/dist/playground/assets/php-DucPl4ZV.js +1 -0
- package/dist/playground/assets/php-extras-CxNKxOX3.js +1 -0
- package/dist/playground/assets/phpdoc-DZlZiD7X.js +1 -0
- package/dist/playground/assets/plsql-C34RXOPs.js +1 -0
- package/dist/playground/assets/powerquery-CkFGJ_Xy.js +1 -0
- package/dist/playground/assets/powershell-CW7Onzic.js +1 -0
- package/dist/playground/assets/processing-B5UbloLN.js +1 -0
- package/dist/playground/assets/prolog-BlU-_0Ir.js +1 -0
- package/dist/playground/assets/promql-BNn9i8LV.js +1 -0
- package/dist/playground/assets/properties-D6sdR9gz.js +1 -0
- package/dist/playground/assets/protobuf-CkctDIie.js +1 -0
- package/dist/playground/assets/psl-BfjoDuWR.js +1 -0
- package/dist/playground/assets/pug-Ds_BIC0j.js +1 -0
- package/dist/playground/assets/puppet-CVAY__pZ.js +1 -0
- package/dist/playground/assets/pure-BJ6TJ6pB.js +1 -0
- package/dist/playground/assets/purebasic-BZMQJyyx.js +1 -0
- package/dist/playground/assets/purescript-DY8jG8kM.js +1 -0
- package/dist/playground/assets/python-BDC05EBX.js +1 -0
- package/dist/playground/assets/q-CnIRln_4.js +1 -0
- package/dist/playground/assets/qml-DhOQ6jdV.js +1 -0
- package/dist/playground/assets/qore-CbVQy-Xl.js +1 -0
- package/dist/playground/assets/qsharp-CeNOc743.js +1 -0
- package/dist/playground/assets/r-mtj5Kfyc.js +1 -0
- package/dist/playground/assets/racket-sXoSfApN.js +1 -0
- package/dist/playground/assets/reason-CP0LK2VB.js +1 -0
- package/dist/playground/assets/regex-BIe5JmZ5.js +1 -0
- package/dist/playground/assets/rego-DI-dPGn1.js +1 -0
- package/dist/playground/assets/renpy-0aB_GxON.js +1 -0
- package/dist/playground/assets/rest-BqX_yJ5N.js +1 -0
- package/dist/playground/assets/rip-BWUheBfE.js +1 -0
- package/dist/playground/assets/roboconf-D_Nq9tpb.js +1 -0
- package/dist/playground/assets/robotframework-CM_pBRFH.js +1 -0
- package/dist/playground/assets/ruby-D1XmI6_f.js +1 -0
- package/dist/playground/assets/rust-CQQcVvjq.js +1 -0
- package/dist/playground/assets/sas-yhHbUu0b.js +1 -0
- package/dist/playground/assets/sass-IHUHXnBn.js +1 -0
- package/dist/playground/assets/scala-DlE7FbQL.js +1 -0
- package/dist/playground/assets/scheme-V99S768C.js +1 -0
- package/dist/playground/assets/scss-CMOzQllk.js +1 -0
- package/dist/playground/assets/shell-session-DxzihzM-.js +1 -0
- package/dist/playground/assets/smali-DAEt8bec.js +1 -0
- package/dist/playground/assets/smalltalk-CTObSEWd.js +1 -0
- package/dist/playground/assets/smarty-CfrSd2id.js +1 -0
- package/dist/playground/assets/sml-lAZR79St.js +1 -0
- package/dist/playground/assets/solidity-CsqwN1f1.js +1 -0
- package/dist/playground/assets/solution-file-GAIntbKz.js +1 -0
- package/dist/playground/assets/soy-0bHJr-e8.js +1 -0
- package/dist/playground/assets/sparql-bdcwXcaQ.js +1 -0
- package/dist/playground/assets/splunk-spl-D0e-xejf.js +1 -0
- package/dist/playground/assets/sqf-B0erNtrK.js +1 -0
- package/dist/playground/assets/sql-D9Qnx9_3.js +1 -0
- package/dist/playground/assets/squirrel-1FSuXxet.js +1 -0
- package/dist/playground/assets/stan-B-MoRzf6.js +1 -0
- package/dist/playground/assets/style-DIBTTqA7.css +1 -0
- package/dist/playground/assets/stylus-CQP9rzko.js +1 -0
- package/dist/playground/assets/swift-Dl6I7uWH.js +1 -0
- package/dist/playground/assets/systemd-DvLH6rd8.js +2 -0
- package/dist/playground/assets/t4-cs-BTK0fk6g.js +1 -0
- package/dist/playground/assets/t4-templating-C7ULougy.js +1 -0
- package/dist/playground/assets/t4-vb-kZjJPFOO.js +1 -0
- package/dist/playground/assets/tap-CxGzIlqW.js +1 -0
- package/dist/playground/assets/tcl-y-C4lMKp.js +1 -0
- package/dist/playground/assets/textile-da1depoN.js +1 -0
- package/dist/playground/assets/token-6GSAFR2W-SPYPLMBM-Ds6s4YQD.js +1 -0
- package/dist/playground/assets/token-util-NEHG7TUY-JRJTGTAB-BozatJbH.js +1 -0
- package/dist/playground/assets/toml-bQAJCiNJ.js +1 -0
- package/dist/playground/assets/tremor-eEDkuhPQ.js +1 -0
- package/dist/playground/assets/tsx-B0tIOpOU.js +1 -0
- package/dist/playground/assets/tt2-CqM9haCV.js +1 -0
- package/dist/playground/assets/{vbnet-6zkgS3WB.js → turtle-BKc3Sf5q.js} +1 -1
- package/dist/playground/assets/twig-B0LxUrLL.js +1 -0
- package/dist/playground/assets/typescript-BM_333WK.js +1 -0
- package/dist/playground/assets/typoscript-CIc4zY_B.js +1 -0
- package/dist/playground/assets/unrealscript-DIrJirtK.js +1 -0
- package/dist/playground/assets/uorazor-DiZbcDAj.js +1 -0
- package/dist/playground/assets/uri-pIRqtHEB.js +1 -0
- package/dist/playground/assets/v-CfFnr08V.js +1 -0
- package/dist/playground/assets/vala-BOIwfEot.js +1 -0
- package/dist/playground/assets/vbnet-D-8FKekT.js +1 -0
- package/dist/playground/assets/velocity-DTbiRxBl.js +1 -0
- package/dist/playground/assets/verilog-B5ezP9T7.js +1 -0
- package/dist/playground/assets/vhdl-C-VZtwiM.js +1 -0
- package/dist/playground/assets/vim-CnbEfD9Z.js +1 -0
- package/dist/playground/assets/visual-basic-CJH-fs4J.js +1 -0
- package/dist/playground/assets/warpscript-TYUMDd6T.js +1 -0
- package/dist/playground/assets/wasm-CKyxOEiI.js +1 -0
- package/dist/playground/assets/web-idl-BLIDy5vW.js +1 -0
- package/dist/playground/assets/wiki-YtaIm40z.js +1 -0
- package/dist/playground/assets/wolfram-CkEmmh5H.js +1 -0
- package/dist/playground/assets/wren-Cz6qOcN3.js +1 -0
- package/dist/playground/assets/xeora--XacNV5b.js +1 -0
- package/dist/playground/assets/xml-doc-B9r6ZOIY.js +1 -0
- package/dist/playground/assets/xojo-VGGevHLq.js +1 -0
- package/dist/playground/assets/xquery-W1TekyQh.js +1 -0
- package/dist/playground/assets/yaml-DaIUFbAU.js +1 -0
- package/dist/playground/assets/yang-Br9OlhBh.js +1 -0
- package/dist/playground/assets/zig-CZnqCBRG.js +1 -0
- package/dist/playground/index.html +13 -10
- package/dist/utils/clone-template.d.ts +3 -0
- package/dist/utils/clone-template.d.ts.map +1 -1
- package/dist/utils/dev-logger.d.ts +1 -1
- package/dist/utils/dev-logger.d.ts.map +1 -1
- package/package.json +24 -24
- package/dist/chunk-NHL3S2MZ.js.map +0 -1
- package/dist/chunk-OQQFOUQW.js.map +0 -1
- package/dist/playground/assets/abap-1CzS1sOj.js +0 -1
- package/dist/playground/assets/abnf-DGOvXig-.js +0 -1
- package/dist/playground/assets/actionscript-Ckam20DI.js +0 -1
- package/dist/playground/assets/ada-BFBuxkjJ.js +0 -1
- package/dist/playground/assets/agda-Tq5ut5V8.js +0 -1
- package/dist/playground/assets/al-DGhsGLAq.js +0 -1
- package/dist/playground/assets/antlr4-BFV6m952.js +0 -1
- package/dist/playground/assets/apacheconf-CbuLdkuI.js +0 -1
- package/dist/playground/assets/apex-HFdqHYhh.js +0 -1
- package/dist/playground/assets/apl-DFVCf5n0.js +0 -1
- package/dist/playground/assets/applescript-DBgTu4l9.js +0 -1
- package/dist/playground/assets/aql-gZpNcV2Z.js +0 -1
- package/dist/playground/assets/arduino-fHUI01vu.js +0 -1
- package/dist/playground/assets/arff-CGHPsxEa.js +0 -1
- package/dist/playground/assets/asciidoc-BLL0AFhH.js +0 -1
- package/dist/playground/assets/asm6502-gHMXkX3O.js +0 -1
- package/dist/playground/assets/asmatmel-Djar7TVY.js +0 -1
- package/dist/playground/assets/aspnet-CT-3fxZA.js +0 -1
- package/dist/playground/assets/autohotkey-C2LuJtTY.js +0 -1
- package/dist/playground/assets/autoit-D7z9Oj0a.js +0 -1
- package/dist/playground/assets/avisynth-DH-1joIy.js +0 -1
- package/dist/playground/assets/avro-idl-CwMmBvL0.js +0 -1
- package/dist/playground/assets/basic-BvNdNPPC.js +0 -1
- package/dist/playground/assets/batch-B2A0-lrO.js +0 -1
- package/dist/playground/assets/bbcode-C-cdSQU1.js +0 -1
- package/dist/playground/assets/bicep-wR2S1QWa.js +0 -1
- package/dist/playground/assets/birb-DxKsEIRC.js +0 -1
- package/dist/playground/assets/bison-BrtjR4_0.js +0 -1
- package/dist/playground/assets/bnf-DZXJcNWs.js +0 -1
- package/dist/playground/assets/brainfuck-GsQ3r7ZS.js +0 -1
- package/dist/playground/assets/brightscript-Cm5JZVO7.js +0 -1
- package/dist/playground/assets/bro-ofyQMWa0.js +0 -1
- package/dist/playground/assets/bsl-BA39c2V2.js +0 -1
- package/dist/playground/assets/c-w4TQc2DV.js +0 -1
- package/dist/playground/assets/cfscript-DB2UdqrI.js +0 -1
- package/dist/playground/assets/chaiscript-DKw0DBKq.js +0 -1
- package/dist/playground/assets/cil-B1Aij6Ac.js +0 -1
- package/dist/playground/assets/clike-PYh2Df1m.js +0 -1
- package/dist/playground/assets/clojure-C3Kzfbxr.js +0 -1
- package/dist/playground/assets/cmake-B5lEWe4v.js +0 -1
- package/dist/playground/assets/cobol-DV2v69DZ.js +0 -1
- package/dist/playground/assets/coffeescript-DPMm0h67.js +0 -1
- package/dist/playground/assets/concurnas-5ceC2vtu.js +0 -1
- package/dist/playground/assets/coq-CJx3sS2Y.js +0 -1
- package/dist/playground/assets/core-awL-mrqC.js +0 -8
- package/dist/playground/assets/cpp-Dqtv01mn.js +0 -1
- package/dist/playground/assets/crystal-YmylMN4k.js +0 -1
- package/dist/playground/assets/csharp-6LRLb3wj.js +0 -1
- package/dist/playground/assets/cshtml-Cx2gpcdc.js +0 -1
- package/dist/playground/assets/csp-JoKz2eQf.js +0 -1
- package/dist/playground/assets/css-Dn_Nm8K5.js +0 -1
- package/dist/playground/assets/css-extras-CCuLtFJx.js +0 -1
- package/dist/playground/assets/csv-BOqfDvgc.js +0 -1
- package/dist/playground/assets/cypher-B8lcZcX-.js +0 -1
- package/dist/playground/assets/d-C7p5_QW4.js +0 -1
- package/dist/playground/assets/dart-DHVKj4dD.js +0 -1
- package/dist/playground/assets/dataweave-BLVaR6RS.js +0 -1
- package/dist/playground/assets/dax-CAuQA-pw.js +0 -1
- package/dist/playground/assets/dhall-6-srnnFP.js +0 -1
- package/dist/playground/assets/diff-yP5aAuhk.js +0 -3
- package/dist/playground/assets/django-Bc3LGca8.js +0 -1
- package/dist/playground/assets/dns-zone-file-DuMFp9AD.js +0 -1
- package/dist/playground/assets/docker-qGjcWmeQ.js +0 -1
- package/dist/playground/assets/dot-Nng7Jq-1.js +0 -1
- package/dist/playground/assets/ebnf-DGw7D5FO.js +0 -1
- package/dist/playground/assets/editorconfig-DdNdUHyk.js +0 -1
- package/dist/playground/assets/eiffel-Djs2lIA5.js +0 -1
- package/dist/playground/assets/ejs-BgckZXji.js +0 -1
- package/dist/playground/assets/elixir-DxPbR3j9.js +0 -1
- package/dist/playground/assets/elm-CQjhvMG4.js +0 -1
- package/dist/playground/assets/erb-BkC_lhzH.js +0 -1
- package/dist/playground/assets/erlang-DI8fwDZA.js +0 -1
- package/dist/playground/assets/etlua-W0w0A9i7.js +0 -1
- package/dist/playground/assets/excel-formula-DJC3DTW2.js +0 -1
- package/dist/playground/assets/factor-p_aKOy3O.js +0 -1
- package/dist/playground/assets/false-C0slWFk4.js +0 -1
- package/dist/playground/assets/firestore-security-rules-D6b3ZM9O.js +0 -1
- package/dist/playground/assets/flow-B97Z5M5g.js +0 -1
- package/dist/playground/assets/fortran-yTOeV9tz.js +0 -1
- package/dist/playground/assets/fsharp-Clw45DHR.js +0 -1
- package/dist/playground/assets/ftl-C2xVUBxP.js +0 -1
- package/dist/playground/assets/gap-CEo3Gc7J.js +0 -1
- package/dist/playground/assets/gcode-BVO5YHmP.js +0 -1
- package/dist/playground/assets/gdscript-o3sqxne-.js +0 -1
- package/dist/playground/assets/gedcom-94FHn7C-.js +0 -1
- package/dist/playground/assets/gherkin-BcHPeTR7.js +0 -1
- package/dist/playground/assets/git-CX4wgYVJ.js +0 -1
- package/dist/playground/assets/glsl-xGVEgQY-.js +0 -1
- package/dist/playground/assets/gml-O85a0Qq7.js +0 -1
- package/dist/playground/assets/gn-Gkh_ZE4p.js +0 -1
- package/dist/playground/assets/go-RKuHUD8p.js +0 -1
- package/dist/playground/assets/go-module-Cd5B1mIJ.js +0 -1
- package/dist/playground/assets/graphql-Dw7AAUz0.js +0 -1
- package/dist/playground/assets/groovy-DGB_T7dF.js +0 -1
- package/dist/playground/assets/haml-DvClPB1G.js +0 -1
- package/dist/playground/assets/handlebars-Cl-GBNZQ.js +0 -1
- package/dist/playground/assets/haskell-wM0n-rcH.js +0 -1
- package/dist/playground/assets/haxe-iDkJJGVM.js +0 -1
- package/dist/playground/assets/hcl-Cn0S_wf6.js +0 -1
- package/dist/playground/assets/hlsl-BjE4WxqQ.js +0 -1
- package/dist/playground/assets/hoon-rUOUCZ3W.js +0 -1
- package/dist/playground/assets/hpkp-DP_4F80b.js +0 -1
- package/dist/playground/assets/hsts-DVvdi9ar.js +0 -1
- package/dist/playground/assets/http-Bwcz59ub.js +0 -1
- package/dist/playground/assets/ichigojam-DZffFFD5.js +0 -1
- package/dist/playground/assets/icon-C0b7nx0h.js +0 -1
- package/dist/playground/assets/icu-message-format-DjVkXpEj.js +0 -1
- package/dist/playground/assets/idris-0jwu3qTZ.js +0 -1
- package/dist/playground/assets/iecst-CKOHCzS7.js +0 -1
- package/dist/playground/assets/ignore-CUsnJVxM.js +0 -1
- package/dist/playground/assets/index-5430GCVb.js +0 -1
- package/dist/playground/assets/index-BIPLi07j.js +0 -1
- package/dist/playground/assets/index-BMPzBpdy.js +0 -7
- package/dist/playground/assets/index-BUieIqcC.js +0 -13
- package/dist/playground/assets/index-Bh7AT5zU.js +0 -1
- package/dist/playground/assets/index-BqjMKSph.js +0 -1
- package/dist/playground/assets/index-C4U2p1Ac.js +0 -1090
- package/dist/playground/assets/index-CWl7KBtZ.js +0 -1
- package/dist/playground/assets/index-CgMSb0ib.js +0 -3
- package/dist/playground/assets/index-Ct2mUODZ.js +0 -1
- package/dist/playground/assets/index-DSHLyy0s.js +0 -1
- package/dist/playground/assets/index-DaDsg3iZ.js +0 -1
- package/dist/playground/assets/index-Dal4mcJQ.js +0 -1
- package/dist/playground/assets/index-Dhm4G7YM.js +0 -1
- package/dist/playground/assets/index-Dvbs85st.js +0 -1
- package/dist/playground/assets/index-PrsQv3Q5.js +0 -1
- package/dist/playground/assets/index-mnBv4IDG.js +0 -1
- package/dist/playground/assets/inform7-BE_oO7eR.js +0 -1
- package/dist/playground/assets/ini-DRJ1Lb58.js +0 -1
- package/dist/playground/assets/io-DD1DLPfJ.js +0 -1
- package/dist/playground/assets/j-BO_N_FDB.js +0 -1
- package/dist/playground/assets/java-BzZsqQhG.js +0 -1
- package/dist/playground/assets/javadoc-BwxdkkEO.js +0 -1
- package/dist/playground/assets/javadoclike-CBDKG3Kl.js +0 -1
- package/dist/playground/assets/javascript-hTZuOaC5.js +0 -1
- package/dist/playground/assets/javastacktrace-ZOpfCGh5.js +0 -1
- package/dist/playground/assets/jexl-CoQAfDY-.js +0 -1
- package/dist/playground/assets/jolie-BXuheID5.js +0 -1
- package/dist/playground/assets/jq-D2V9LUqd.js +0 -1
- package/dist/playground/assets/js-extras-Bdsx2AmN.js +0 -1
- package/dist/playground/assets/js-templates-CVWBbSad.js +0 -1
- package/dist/playground/assets/jsdoc-xVA9Cj-w.js +0 -1
- package/dist/playground/assets/json-v46bxzze.js +0 -1
- package/dist/playground/assets/json5-DwTC9_aM.js +0 -1
- package/dist/playground/assets/jsonp-DtwmHxcv.js +0 -1
- package/dist/playground/assets/jsstacktrace-D7MUpJmS.js +0 -1
- package/dist/playground/assets/jsx-B2ZPu_sF.js +0 -1
- package/dist/playground/assets/julia-C-4dl-Eh.js +0 -1
- package/dist/playground/assets/keepalived-9r2MYVcY.js +0 -1
- package/dist/playground/assets/keyman-DvHNjcz5.js +0 -1
- package/dist/playground/assets/kotlin-B49JjNRF.js +0 -1
- package/dist/playground/assets/kumir-BubygEYF.js +0 -1
- package/dist/playground/assets/kusto-CH_AKVN6.js +0 -1
- package/dist/playground/assets/latex-C9qtRxyR.js +0 -1
- package/dist/playground/assets/latte-eaSds21J.js +0 -1
- package/dist/playground/assets/less-Ciq7oCWk.js +0 -1
- package/dist/playground/assets/lilypond-ezW_FBa7.js +0 -1
- package/dist/playground/assets/liquid-Di97Zow5.js +0 -1
- package/dist/playground/assets/lisp-BND5IUUb.js +0 -1
- package/dist/playground/assets/livescript-CNdmDR9k.js +0 -1
- package/dist/playground/assets/llvm-Diu5vE-_.js +0 -1
- package/dist/playground/assets/log-l74ZIo2G.js +0 -1
- package/dist/playground/assets/lolcode-D8E_zNUr.js +0 -1
- package/dist/playground/assets/magma-BZndnK4u.js +0 -1
- package/dist/playground/assets/makefile-2KtWvl9M.js +0 -1
- package/dist/playground/assets/markdown-QVr2WZ7A.js +0 -1
- package/dist/playground/assets/markup-CGjosiRG.js +0 -1
- package/dist/playground/assets/markup-templating--J8lNA65.js +0 -1
- package/dist/playground/assets/matlab-BzWR4u9J.js +0 -1
- package/dist/playground/assets/maxscript-DqL8aTwi.js +0 -1
- package/dist/playground/assets/mel-gxTOI7Bn.js +0 -1
- package/dist/playground/assets/mermaid-CRoOZITP.js +0 -1
- package/dist/playground/assets/mizar-D4dkpyeN.js +0 -1
- package/dist/playground/assets/mongodb-BQlStzRx.js +0 -1
- package/dist/playground/assets/monkey-BkVftKMt.js +0 -1
- package/dist/playground/assets/moonscript-gBNEqU73.js +0 -1
- package/dist/playground/assets/n1ql-Bal9wV3M.js +0 -1
- package/dist/playground/assets/n4js-DJDqWInO.js +0 -1
- package/dist/playground/assets/nand2tetris-hdl-DVYcQs0u.js +0 -1
- package/dist/playground/assets/naniscript-D-DQWSz5.js +0 -1
- package/dist/playground/assets/nasm-CoydG39X.js +0 -1
- package/dist/playground/assets/neon-CFqbCk9q.js +0 -1
- package/dist/playground/assets/nevod-BWVaWL8G.js +0 -1
- package/dist/playground/assets/nginx-CJ8KhEzw.js +0 -1
- package/dist/playground/assets/nim-CTjZnGAK.js +0 -1
- package/dist/playground/assets/nix-D59oAN6v.js +0 -1
- package/dist/playground/assets/nsis-C4QOvtRp.js +0 -1
- package/dist/playground/assets/objectivec-CNwgVx15.js +0 -1
- package/dist/playground/assets/ocaml-Cbt3VSbK.js +0 -1
- package/dist/playground/assets/opencl-BvLZSbML.js +0 -1
- package/dist/playground/assets/openqasm-CGOnCwmJ.js +0 -1
- package/dist/playground/assets/oz-DVsjFoJo.js +0 -1
- package/dist/playground/assets/parigp-D5xSjAKr.js +0 -1
- package/dist/playground/assets/parser-d13CKhZm.js +0 -1
- package/dist/playground/assets/pascal-BvUbXOhW.js +0 -1
- package/dist/playground/assets/pascaligo-pwdQOiyr.js +0 -1
- package/dist/playground/assets/pcaxis-BPo6ZVCF.js +0 -1
- package/dist/playground/assets/peoplecode-BPwq91WF.js +0 -1
- package/dist/playground/assets/perl-WtWUuCP3.js +0 -1
- package/dist/playground/assets/php-CMJK3UPB.js +0 -1
- package/dist/playground/assets/php-extras-_VGCd9xg.js +0 -1
- package/dist/playground/assets/phpdoc-WkHZUPUM.js +0 -1
- package/dist/playground/assets/plsql-Cq6eEoN9.js +0 -1
- package/dist/playground/assets/powerquery-BXYY2Vg4.js +0 -1
- package/dist/playground/assets/powershell-fY0zLuCN.js +0 -1
- package/dist/playground/assets/processing-DvXSIH2o.js +0 -1
- package/dist/playground/assets/prolog-B-7DRt0Q.js +0 -1
- package/dist/playground/assets/promql-yRPFscBJ.js +0 -1
- package/dist/playground/assets/properties-DOrVgnsn.js +0 -1
- package/dist/playground/assets/protobuf-BPMQlYO_.js +0 -1
- package/dist/playground/assets/psl-BytgMlVA.js +0 -1
- package/dist/playground/assets/pug-BrQQZMXX.js +0 -1
- package/dist/playground/assets/puppet-D0rWAMpi.js +0 -1
- package/dist/playground/assets/pure-D3akdLNP.js +0 -1
- package/dist/playground/assets/purebasic-BvyRZ4e2.js +0 -1
- package/dist/playground/assets/purescript-CJVS0asd.js +0 -1
- package/dist/playground/assets/python-DFf0sF2h.js +0 -1
- package/dist/playground/assets/q-Dx0gyvWB.js +0 -1
- package/dist/playground/assets/qml-DgfQDN4B.js +0 -1
- package/dist/playground/assets/qore-BWwh2dOA.js +0 -1
- package/dist/playground/assets/qsharp-BSuwYsvS.js +0 -1
- package/dist/playground/assets/r-B-fIj4Vl.js +0 -1
- package/dist/playground/assets/racket-C1cWOkSS.js +0 -1
- package/dist/playground/assets/reason-Bvp1giaD.js +0 -1
- package/dist/playground/assets/regex-CC3lEw_I.js +0 -1
- package/dist/playground/assets/rego-0uWqA6B_.js +0 -1
- package/dist/playground/assets/renpy-BLav3ImN.js +0 -1
- package/dist/playground/assets/rest-VO18yH-j.js +0 -1
- package/dist/playground/assets/rip-dpWJBk9i.js +0 -1
- package/dist/playground/assets/roboconf-B1MwI3f8.js +0 -1
- package/dist/playground/assets/robotframework-Bdb-jPYB.js +0 -1
- package/dist/playground/assets/ruby-CA7NsUfQ.js +0 -1
- package/dist/playground/assets/rust-PzI1cHWc.js +0 -1
- package/dist/playground/assets/sas-D8-wUxbX.js +0 -1
- package/dist/playground/assets/sass-Ddx9r_xg.js +0 -1
- package/dist/playground/assets/scala-CKFoLkY1.js +0 -1
- package/dist/playground/assets/scheme-BKOYV7g3.js +0 -1
- package/dist/playground/assets/scss-C7diewNB.js +0 -1
- package/dist/playground/assets/shell-session-DAVIwm6r.js +0 -1
- package/dist/playground/assets/smali-CxEhs8yC.js +0 -1
- package/dist/playground/assets/smalltalk-D1bda1js.js +0 -1
- package/dist/playground/assets/smarty-D86XLDAD.js +0 -1
- package/dist/playground/assets/sml-DhRzV0Yd.js +0 -1
- package/dist/playground/assets/solidity-DZzAYKne.js +0 -1
- package/dist/playground/assets/solution-file-DcWsdOsE.js +0 -1
- package/dist/playground/assets/soy-CJzcp0Rd.js +0 -1
- package/dist/playground/assets/sparql-Bza39uP1.js +0 -1
- package/dist/playground/assets/splunk-spl-pgc5xbr1.js +0 -1
- package/dist/playground/assets/sqf-zaxjPIcX.js +0 -1
- package/dist/playground/assets/sql-BDxJqV_A.js +0 -1
- package/dist/playground/assets/squirrel-fBNLZRcl.js +0 -1
- package/dist/playground/assets/stan-CJSTRlqV.js +0 -1
- package/dist/playground/assets/style-IJXhmGBf.css +0 -1
- package/dist/playground/assets/stylus-DcowwZLM.js +0 -1
- package/dist/playground/assets/swift-BvR6KTou.js +0 -1
- package/dist/playground/assets/systemd-Bm9dfnfC.js +0 -2
- package/dist/playground/assets/t4-cs-DBS3SuTn.js +0 -1
- package/dist/playground/assets/t4-templating-BUpklocH.js +0 -1
- package/dist/playground/assets/t4-vb-8Kx8FrJn.js +0 -1
- package/dist/playground/assets/tap-BffWxfOo.js +0 -1
- package/dist/playground/assets/tcl-C0r6haIO.js +0 -1
- package/dist/playground/assets/textile-B-BdvKXq.js +0 -1
- package/dist/playground/assets/toml-CsDsK2f9.js +0 -1
- package/dist/playground/assets/tremor-CctEbCng.js +0 -1
- package/dist/playground/assets/tsx-D4cMQx4D.js +0 -1
- package/dist/playground/assets/tt2-BWVqfxra.js +0 -1
- package/dist/playground/assets/turtle-DCRLY1Qq.js +0 -1
- package/dist/playground/assets/twig-CmagNSa3.js +0 -1
- package/dist/playground/assets/typescript-BwUK_myp.js +0 -1
- package/dist/playground/assets/typoscript-Brs6KLZ4.js +0 -1
- package/dist/playground/assets/unrealscript-DzAjWmdp.js +0 -1
- package/dist/playground/assets/uorazor-w1hD9SND.js +0 -1
- package/dist/playground/assets/uri-DF5-DT9w.js +0 -1
- package/dist/playground/assets/v-BavoKhXR.js +0 -1
- package/dist/playground/assets/vala-1eVOQj5_.js +0 -1
- package/dist/playground/assets/velocity-x-6OTDFN.js +0 -1
- package/dist/playground/assets/verilog-C4yzM5oQ.js +0 -1
- package/dist/playground/assets/vhdl-Dh0L03yv.js +0 -1
- package/dist/playground/assets/vim-Dc3QQ6M0.js +0 -1
- package/dist/playground/assets/visual-basic-6taNRfml.js +0 -1
- package/dist/playground/assets/warpscript-SGwIx-pb.js +0 -1
- package/dist/playground/assets/wasm-KlR0o1yG.js +0 -1
- package/dist/playground/assets/web-idl-r-M67RT-.js +0 -1
- package/dist/playground/assets/wiki-oiupc9yq.js +0 -1
- package/dist/playground/assets/wolfram-C35GZ5NN.js +0 -1
- package/dist/playground/assets/wren-D2ELJujn.js +0 -1
- package/dist/playground/assets/xeora-BYbZIIur.js +0 -1
- package/dist/playground/assets/xml-doc-bciQqQY7.js +0 -1
- package/dist/playground/assets/xojo-JXmhLMmX.js +0 -1
- package/dist/playground/assets/xquery-OdhlQiGj.js +0 -1
- package/dist/playground/assets/yaml-BegI5l2n.js +0 -1
- package/dist/playground/assets/yang-Dhd5AEiH.js +0 -1
- package/dist/playground/assets/zig-Caf1sO7t.js +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,130 @@
|
|
|
1
|
-
import { getAnalytics } from './chunk-
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
1
|
+
import { getAnalytics } from './chunk-TL3K64EI.js';
|
|
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';
|
|
8
|
+
import path3 from 'path';
|
|
6
9
|
import util from 'util';
|
|
7
|
-
import path 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
|
+
import fsExtra3 from 'fs-extra';
|
|
18
19
|
import { PinoLogger } from '@mastra/loggers';
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
// package.json
|
|
22
|
+
var package_default = {
|
|
23
|
+
name: "mastra",
|
|
24
|
+
version: "1.0.0-beta.10",
|
|
25
|
+
license: "Apache-2.0",
|
|
26
|
+
description: "cli for mastra",
|
|
27
|
+
type: "module",
|
|
28
|
+
main: "dist/index.js",
|
|
29
|
+
types: "dist/index.d.ts",
|
|
30
|
+
bin: {
|
|
31
|
+
mastra: "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
exports: {
|
|
34
|
+
".": "./dist/index.js",
|
|
35
|
+
"./package.json": "./package.json",
|
|
36
|
+
"./telemetry-loader": "./dist/commands/dev/telemetry-loader.js",
|
|
37
|
+
"./dist/*": [
|
|
38
|
+
"./dist/*",
|
|
39
|
+
"./dist/*.js"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
files: [
|
|
43
|
+
"dist",
|
|
44
|
+
"CHANGELOG.md"
|
|
45
|
+
],
|
|
46
|
+
scripts: {
|
|
47
|
+
"build:lib": "tsup --silent --config tsup.config.ts",
|
|
48
|
+
test: "vitest run",
|
|
49
|
+
"test:watch": "vitest watch",
|
|
50
|
+
clean: "rm -rf dist && rm -rf node_modules",
|
|
51
|
+
typecheck: "tsc --noEmit --incremental",
|
|
52
|
+
lint: "eslint ."
|
|
53
|
+
},
|
|
54
|
+
keywords: [
|
|
55
|
+
"mastra",
|
|
56
|
+
"cli",
|
|
57
|
+
"ai",
|
|
58
|
+
"llm",
|
|
59
|
+
"llms",
|
|
60
|
+
"agent",
|
|
61
|
+
"agents",
|
|
62
|
+
"dev",
|
|
63
|
+
"development",
|
|
64
|
+
"deploy",
|
|
65
|
+
"deployment",
|
|
66
|
+
"build",
|
|
67
|
+
"workflow",
|
|
68
|
+
"typescript",
|
|
69
|
+
"command-line",
|
|
70
|
+
"devtools"
|
|
71
|
+
],
|
|
72
|
+
dependencies: {
|
|
73
|
+
"@clack/prompts": "^0.11.0",
|
|
74
|
+
"@expo/devcert": "^1.2.1",
|
|
75
|
+
"@mastra/deployer": "workspace:^",
|
|
76
|
+
"@mastra/loggers": "workspace:^",
|
|
77
|
+
commander: "^14.0.2",
|
|
78
|
+
dotenv: "^17.2.3",
|
|
79
|
+
execa: "^9.6.1",
|
|
80
|
+
"fs-extra": "^11.3.2",
|
|
81
|
+
"get-port": "^7.1.0",
|
|
82
|
+
picocolors: "^1.1.1",
|
|
83
|
+
"posthog-node": "5.17.2",
|
|
84
|
+
prettier: "^3.7.4",
|
|
85
|
+
serve: "^14.2.5",
|
|
86
|
+
"serve-handler": "^6.1.6",
|
|
87
|
+
"shell-quote": "^1.8.3",
|
|
88
|
+
"strip-json-comments": "^5.0.3",
|
|
89
|
+
"yocto-spinner": "^1.0.0"
|
|
90
|
+
},
|
|
91
|
+
devDependencies: {
|
|
92
|
+
"@commander-js/extra-typings": "^14.0.0",
|
|
93
|
+
"@internal/lint": "workspace:*",
|
|
94
|
+
"@internal/playground": "workspace:*",
|
|
95
|
+
"@internal/types-builder": "workspace:*",
|
|
96
|
+
"@mastra/core": "workspace:*",
|
|
97
|
+
"@types/fs-extra": "^11.0.4",
|
|
98
|
+
"@types/node": "22.13.17",
|
|
99
|
+
"@types/serve-handler": "^6.1.4",
|
|
100
|
+
"@types/shell-quote": "^1.7.5",
|
|
101
|
+
"@vitest/coverage-v8": "catalog:",
|
|
102
|
+
"@vitest/ui": "catalog:",
|
|
103
|
+
eslint: "^9.37.0",
|
|
104
|
+
memfs: "^4.51.1",
|
|
105
|
+
rollup: "^4.50.2",
|
|
106
|
+
tsup: "^8.5.1",
|
|
107
|
+
"type-fest": "^5.3.1",
|
|
108
|
+
typescript: "^5.9.3",
|
|
109
|
+
vitest: "catalog:"
|
|
110
|
+
},
|
|
111
|
+
peerDependencies: {
|
|
112
|
+
"@mastra/core": ">=1.0.0-0 <2.0.0-0",
|
|
113
|
+
zod: "^3.25.0 || ^4.0.0"
|
|
114
|
+
},
|
|
115
|
+
homepage: "https://mastra.ai",
|
|
116
|
+
repository: {
|
|
117
|
+
type: "git",
|
|
118
|
+
url: "git+https://github.com/mastra-ai/mastra.git",
|
|
119
|
+
directory: "packages/cli"
|
|
120
|
+
},
|
|
121
|
+
bugs: {
|
|
122
|
+
url: "https://github.com/mastra-ai/mastra/issues"
|
|
123
|
+
},
|
|
124
|
+
engines: {
|
|
125
|
+
node: ">=22.13.0"
|
|
36
126
|
}
|
|
37
|
-
return {
|
|
38
|
-
mcpServers: {
|
|
39
|
-
mastra: {
|
|
40
|
-
command: "npx",
|
|
41
|
-
args
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
127
|
};
|
|
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
128
|
|
|
137
129
|
// src/utils/package-manager.ts
|
|
138
130
|
function getPackageManagerAddCommand(pm) {
|
|
@@ -159,11 +151,11 @@ var DepsService = class {
|
|
|
159
151
|
findLockFile(dir) {
|
|
160
152
|
const lockFiles = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock", "bun.lock"];
|
|
161
153
|
for (const file of lockFiles) {
|
|
162
|
-
if (fs3__default.existsSync(
|
|
154
|
+
if (fs3__default.existsSync(path3.join(dir, file))) {
|
|
163
155
|
return file;
|
|
164
156
|
}
|
|
165
157
|
}
|
|
166
|
-
const parentDir =
|
|
158
|
+
const parentDir = path3.resolve(dir, "..");
|
|
167
159
|
if (parentDir !== dir) {
|
|
168
160
|
return this.findLockFile(parentDir);
|
|
169
161
|
}
|
|
@@ -196,7 +188,7 @@ var DepsService = class {
|
|
|
196
188
|
}
|
|
197
189
|
async checkDependencies(dependencies) {
|
|
198
190
|
try {
|
|
199
|
-
const packageJsonPath =
|
|
191
|
+
const packageJsonPath = path3.join(process.cwd(), "package.json");
|
|
200
192
|
try {
|
|
201
193
|
await fs4.access(packageJsonPath);
|
|
202
194
|
} catch {
|
|
@@ -216,7 +208,7 @@ var DepsService = class {
|
|
|
216
208
|
}
|
|
217
209
|
async getProjectName() {
|
|
218
210
|
try {
|
|
219
|
-
const packageJsonPath =
|
|
211
|
+
const packageJsonPath = path3.join(process.cwd(), "package.json");
|
|
220
212
|
const packageJson = await fs4.readFile(packageJsonPath, "utf-8");
|
|
221
213
|
const pkg = JSON.parse(packageJson);
|
|
222
214
|
return pkg.name;
|
|
@@ -310,8 +302,8 @@ var FileService = class {
|
|
|
310
302
|
*/
|
|
311
303
|
async copyStarterFile(inputFile, outputFilePath, replaceIfExists) {
|
|
312
304
|
const __filename = fileURLToPath(import.meta.url);
|
|
313
|
-
const __dirname =
|
|
314
|
-
const filePath =
|
|
305
|
+
const __dirname = path3.dirname(__filename);
|
|
306
|
+
const filePath = path3.resolve(__dirname, "starter-files", inputFile);
|
|
315
307
|
const fileString = fs3__default.readFileSync(filePath, "utf8");
|
|
316
308
|
if (fs3__default.existsSync(outputFilePath) && !replaceIfExists) {
|
|
317
309
|
console.info(`${outputFilePath} already exists`);
|
|
@@ -321,7 +313,7 @@ var FileService = class {
|
|
|
321
313
|
return true;
|
|
322
314
|
}
|
|
323
315
|
async setupEnvFile({ dbUrl }) {
|
|
324
|
-
const envPath =
|
|
316
|
+
const envPath = path3.join(process.cwd(), ".env.development");
|
|
325
317
|
await fsExtra.ensureFile(envPath);
|
|
326
318
|
const fileEnvService = new FileEnvService(envPath);
|
|
327
319
|
await fileEnvService.setEnvValue("DB_URL", dbUrl);
|
|
@@ -345,6 +337,131 @@ var FileService = class {
|
|
|
345
337
|
fs3__default.writeFileSync(filePath, fileContent);
|
|
346
338
|
}
|
|
347
339
|
};
|
|
340
|
+
var createArgs = (versionTag) => {
|
|
341
|
+
const packageName = versionTag ? `@mastra/mcp-docs-server@${versionTag}` : "@mastra/mcp-docs-server";
|
|
342
|
+
return ["-y", packageName];
|
|
343
|
+
};
|
|
344
|
+
var createMcpConfig = (editor, versionTag) => {
|
|
345
|
+
const args = createArgs(versionTag);
|
|
346
|
+
if (editor === "vscode") {
|
|
347
|
+
return {
|
|
348
|
+
servers: {
|
|
349
|
+
mastra: process.platform === `win32` ? {
|
|
350
|
+
command: "cmd",
|
|
351
|
+
args: ["/c", "npx", ...args],
|
|
352
|
+
type: "stdio"
|
|
353
|
+
} : {
|
|
354
|
+
command: "npx",
|
|
355
|
+
args,
|
|
356
|
+
type: "stdio"
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
return {
|
|
362
|
+
mcpServers: {
|
|
363
|
+
mastra: {
|
|
364
|
+
command: "npx",
|
|
365
|
+
args
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
function makeConfig(original, editor, versionTag) {
|
|
371
|
+
if (editor === "vscode") {
|
|
372
|
+
return {
|
|
373
|
+
...original,
|
|
374
|
+
servers: {
|
|
375
|
+
...original?.servers || {},
|
|
376
|
+
...createMcpConfig(editor, versionTag).servers
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
return {
|
|
381
|
+
...original,
|
|
382
|
+
mcpServers: {
|
|
383
|
+
...original?.mcpServers || {},
|
|
384
|
+
...createMcpConfig(editor, versionTag).mcpServers
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
async function writeMergedConfig(configPath, editor, versionTag) {
|
|
389
|
+
const configExists = existsSync(configPath);
|
|
390
|
+
const config = makeConfig(configExists ? await readJSON(configPath) : {}, editor, versionTag);
|
|
391
|
+
await ensureFile(configPath);
|
|
392
|
+
await writeJSON(configPath, config, {
|
|
393
|
+
spaces: 2
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
var windsurfGlobalMCPConfigPath = path3.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
397
|
+
var cursorGlobalMCPConfigPath = path3.join(os.homedir(), ".cursor", "mcp.json");
|
|
398
|
+
path3.join(process.cwd(), ".vscode", "mcp.json");
|
|
399
|
+
var vscodeGlobalMCPConfigPath = path3.join(
|
|
400
|
+
os.homedir(),
|
|
401
|
+
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")
|
|
402
|
+
);
|
|
403
|
+
var EDITOR = ["cursor", "cursor-global", "windsurf", "vscode"];
|
|
404
|
+
function isValidEditor(value) {
|
|
405
|
+
return EDITOR.includes(value);
|
|
406
|
+
}
|
|
407
|
+
async function installMastraDocsMCPServer({
|
|
408
|
+
editor,
|
|
409
|
+
directory,
|
|
410
|
+
versionTag
|
|
411
|
+
}) {
|
|
412
|
+
if (editor === `cursor`) {
|
|
413
|
+
await writeMergedConfig(path3.join(directory, ".cursor", "mcp.json"), "cursor", versionTag);
|
|
414
|
+
}
|
|
415
|
+
if (editor === `vscode`) {
|
|
416
|
+
await writeMergedConfig(path3.join(directory, ".vscode", "mcp.json"), "vscode", versionTag);
|
|
417
|
+
}
|
|
418
|
+
if (editor === `cursor-global`) {
|
|
419
|
+
const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);
|
|
420
|
+
if (alreadyInstalled) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
await writeMergedConfig(cursorGlobalMCPConfigPath, "cursor-global", versionTag);
|
|
424
|
+
}
|
|
425
|
+
if (editor === `windsurf`) {
|
|
426
|
+
const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);
|
|
427
|
+
if (alreadyInstalled) {
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
await writeMergedConfig(windsurfGlobalMCPConfigPath, editor, versionTag);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
async function globalMCPIsAlreadyInstalled(editor, versionTag) {
|
|
434
|
+
let configPath = ``;
|
|
435
|
+
if (editor === "windsurf") {
|
|
436
|
+
configPath = windsurfGlobalMCPConfigPath;
|
|
437
|
+
} else if (editor === "cursor-global") {
|
|
438
|
+
configPath = cursorGlobalMCPConfigPath;
|
|
439
|
+
} else if (editor === "vscode") {
|
|
440
|
+
configPath = vscodeGlobalMCPConfigPath;
|
|
441
|
+
}
|
|
442
|
+
if (!configPath || !existsSync(configPath)) {
|
|
443
|
+
return false;
|
|
444
|
+
}
|
|
445
|
+
try {
|
|
446
|
+
const configContents = await readJSON(configPath);
|
|
447
|
+
if (!configContents) return false;
|
|
448
|
+
const expectedPackage = versionTag ? `@mastra/mcp-docs-server@${versionTag}` : "@mastra/mcp-docs-server";
|
|
449
|
+
if (editor === "vscode") {
|
|
450
|
+
if (!configContents.servers) return false;
|
|
451
|
+
const hasMastraMCP2 = Object.values(configContents.servers).some(
|
|
452
|
+
(server) => server?.args?.find((arg) => arg === expectedPackage)
|
|
453
|
+
);
|
|
454
|
+
return hasMastraMCP2;
|
|
455
|
+
}
|
|
456
|
+
if (!configContents?.mcpServers) return false;
|
|
457
|
+
const hasMastraMCP = Object.values(configContents.mcpServers).some(
|
|
458
|
+
(server) => server?.args?.find((arg) => arg === expectedPackage)
|
|
459
|
+
);
|
|
460
|
+
return hasMastraMCP;
|
|
461
|
+
} catch {
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
348
465
|
|
|
349
466
|
// src/commands/init/utils.ts
|
|
350
467
|
var exec = util.promisify(child_process.exec);
|
|
@@ -357,19 +474,19 @@ function areValidComponents(values) {
|
|
|
357
474
|
return values.every((value) => COMPONENTS.includes(value));
|
|
358
475
|
}
|
|
359
476
|
var getModelIdentifier = (llmProvider) => {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
return `'anthropic/claude-sonnet-4-5-20250929'`;
|
|
477
|
+
let model = "openai/gpt-4o";
|
|
478
|
+
if (llmProvider === "anthropic") {
|
|
479
|
+
model = "anthropic/claude-sonnet-4-5";
|
|
364
480
|
} else if (llmProvider === "groq") {
|
|
365
|
-
|
|
481
|
+
model = "groq/llama-3.3-70b-versatile";
|
|
366
482
|
} else if (llmProvider === "google") {
|
|
367
|
-
|
|
483
|
+
model = "google/gemini-2.5-pro";
|
|
368
484
|
} else if (llmProvider === "cerebras") {
|
|
369
|
-
|
|
485
|
+
model = "cerebras/llama-3.3-70b";
|
|
370
486
|
} else if (llmProvider === "mistral") {
|
|
371
|
-
|
|
487
|
+
model = "mistral/mistral-medium-2508";
|
|
372
488
|
}
|
|
489
|
+
return model;
|
|
373
490
|
};
|
|
374
491
|
async function writeAgentSample(llmProvider, destPath, addExampleTool, addScorers) {
|
|
375
492
|
const modelString = getModelIdentifier(llmProvider);
|
|
@@ -398,7 +515,7 @@ export const weatherAgent = new Agent({
|
|
|
398
515
|
id: 'weather-agent',
|
|
399
516
|
name: 'Weather Agent',
|
|
400
517
|
instructions: \`${instructions}\`,
|
|
401
|
-
model: ${modelString},
|
|
518
|
+
model: '${modelString}',
|
|
402
519
|
${addExampleTool ? "tools: { weatherTool }," : ""}
|
|
403
520
|
${addScorers ? `scorers: {
|
|
404
521
|
toolCallAppropriateness: {
|
|
@@ -657,7 +774,7 @@ export const translationScorer = createScorer({
|
|
|
657
774
|
description: 'Checks that non-English location names are translated and used correctly',
|
|
658
775
|
type: 'agent',
|
|
659
776
|
judge: {
|
|
660
|
-
model: ${modelString},
|
|
777
|
+
model: '${modelString}',
|
|
661
778
|
instructions:
|
|
662
779
|
'You are an expert evaluator of translation quality for geographic locations. ' +
|
|
663
780
|
'Determine whether the user text mentions a non-English location and whether the assistant correctly uses an English translation of that location. ' +
|
|
@@ -754,7 +871,7 @@ var writeIndexFile = async ({
|
|
|
754
871
|
addScorers
|
|
755
872
|
}) => {
|
|
756
873
|
const indexPath = dirPath + "/index.ts";
|
|
757
|
-
const destPath =
|
|
874
|
+
const destPath = path3.join(indexPath);
|
|
758
875
|
try {
|
|
759
876
|
await fs4.writeFile(destPath, "");
|
|
760
877
|
const filteredExports = [
|
|
@@ -806,9 +923,10 @@ export const mastra = new Mastra({
|
|
|
806
923
|
throw err;
|
|
807
924
|
}
|
|
808
925
|
};
|
|
809
|
-
var checkAndInstallCoreDeps = async (addExample) => {
|
|
926
|
+
var checkAndInstallCoreDeps = async (addExample, versionTag) => {
|
|
810
927
|
const spinner4 = yoctoSpinner2({ text: "Installing Mastra core dependencies" });
|
|
811
928
|
let packages = [];
|
|
929
|
+
const mastraVersionTag = versionTag || "latest";
|
|
812
930
|
try {
|
|
813
931
|
const depService = new DepsService();
|
|
814
932
|
spinner4.start();
|
|
@@ -816,10 +934,10 @@ var checkAndInstallCoreDeps = async (addExample) => {
|
|
|
816
934
|
const needsCli = await depService.checkDependencies(["mastra"]) !== `ok`;
|
|
817
935
|
const needsZod = await depService.checkDependencies(["zod"]) !== `ok`;
|
|
818
936
|
if (needsCore) {
|
|
819
|
-
packages.push({ name: "@mastra/core", version:
|
|
937
|
+
packages.push({ name: "@mastra/core", version: mastraVersionTag });
|
|
820
938
|
}
|
|
821
939
|
if (needsCli) {
|
|
822
|
-
packages.push({ name: "mastra", version:
|
|
940
|
+
packages.push({ name: "mastra", version: mastraVersionTag });
|
|
823
941
|
}
|
|
824
942
|
if (needsZod) {
|
|
825
943
|
packages.push({ name: "zod", version: "^4" });
|
|
@@ -827,7 +945,7 @@ var checkAndInstallCoreDeps = async (addExample) => {
|
|
|
827
945
|
if (addExample) {
|
|
828
946
|
const needsLibsql = await depService.checkDependencies(["@mastra/libsql"]) !== `ok`;
|
|
829
947
|
if (needsLibsql) {
|
|
830
|
-
packages.push({ name: "@mastra/libsql", version:
|
|
948
|
+
packages.push({ name: "@mastra/libsql", version: mastraVersionTag });
|
|
831
949
|
}
|
|
832
950
|
}
|
|
833
951
|
if (packages.length > 0) {
|
|
@@ -869,7 +987,7 @@ var writeAPIKey = async ({ provider, apiKey }) => {
|
|
|
869
987
|
};
|
|
870
988
|
var createMastraDir = async (directory) => {
|
|
871
989
|
let dir = directory.trim().split("/").filter((item) => item !== "");
|
|
872
|
-
const dirPath =
|
|
990
|
+
const dirPath = path3.join(process.cwd(), ...dir, "mastra");
|
|
873
991
|
try {
|
|
874
992
|
await fs4.access(dirPath);
|
|
875
993
|
return { ok: false };
|
|
@@ -894,26 +1012,26 @@ var LLM_PROVIDERS = [
|
|
|
894
1012
|
{ value: "cerebras", label: "Cerebras" },
|
|
895
1013
|
{ value: "mistral", label: "Mistral" }
|
|
896
1014
|
];
|
|
897
|
-
var interactivePrompt = async (
|
|
898
|
-
const { skip = {}, options: { showBanner = true } = {} } =
|
|
1015
|
+
var interactivePrompt = async (args = {}) => {
|
|
1016
|
+
const { skip = {}, options: { showBanner = true } = {} } = args;
|
|
899
1017
|
if (showBanner) {
|
|
900
|
-
|
|
1018
|
+
p5.intro(color2.inverse(" Mastra Init "));
|
|
901
1019
|
}
|
|
902
|
-
const mastraProject = await
|
|
1020
|
+
const mastraProject = await p5.group(
|
|
903
1021
|
{
|
|
904
|
-
directory: () =>
|
|
1022
|
+
directory: () => p5.text({
|
|
905
1023
|
message: "Where should we create the Mastra files? (default: src/)",
|
|
906
1024
|
placeholder: "src/",
|
|
907
1025
|
defaultValue: "src/"
|
|
908
1026
|
}),
|
|
909
|
-
llmProvider: () => skip?.llmProvider ? void 0 :
|
|
1027
|
+
llmProvider: () => skip?.llmProvider ? void 0 : p5.select({
|
|
910
1028
|
message: "Select a default provider:",
|
|
911
1029
|
options: LLM_PROVIDERS
|
|
912
1030
|
}),
|
|
913
1031
|
llmApiKey: async ({ results: { llmProvider } }) => {
|
|
914
1032
|
if (skip?.llmApiKey) return void 0;
|
|
915
1033
|
const llmName = LLM_PROVIDERS.find((p6) => p6.value === llmProvider)?.label || "provider";
|
|
916
|
-
const keyChoice = await
|
|
1034
|
+
const keyChoice = await p5.select({
|
|
917
1035
|
message: `Enter your ${llmName} API key?`,
|
|
918
1036
|
options: [
|
|
919
1037
|
{ value: "skip", label: "Skip for now", hint: "default" },
|
|
@@ -922,7 +1040,7 @@ var interactivePrompt = async (args2 = {}) => {
|
|
|
922
1040
|
initialValue: "skip"
|
|
923
1041
|
});
|
|
924
1042
|
if (keyChoice === "enter") {
|
|
925
|
-
return
|
|
1043
|
+
return p5.text({
|
|
926
1044
|
message: "Enter your API key:",
|
|
927
1045
|
placeholder: "sk-...",
|
|
928
1046
|
validate: (value) => {
|
|
@@ -933,67 +1051,50 @@ var interactivePrompt = async (args2 = {}) => {
|
|
|
933
1051
|
return void 0;
|
|
934
1052
|
},
|
|
935
1053
|
configureEditorWithDocsMCP: async () => {
|
|
936
|
-
const
|
|
937
|
-
const cursorIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`cursor`);
|
|
938
|
-
const vscodeIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`vscode`);
|
|
939
|
-
const editor = await p.select({
|
|
1054
|
+
const editor = await p5.select({
|
|
940
1055
|
message: `Make your IDE into a Mastra expert? (Installs Mastra's MCP server)`,
|
|
941
1056
|
options: [
|
|
942
1057
|
{ value: "skip", label: "Skip for now", hint: "default" },
|
|
943
1058
|
{
|
|
944
1059
|
value: "cursor",
|
|
945
|
-
label: "Cursor (project only)"
|
|
946
|
-
hint: cursorIsAlreadyInstalled ? `Already installed globally` : void 0
|
|
1060
|
+
label: "Cursor (project only)"
|
|
947
1061
|
},
|
|
948
1062
|
{
|
|
949
1063
|
value: "cursor-global",
|
|
950
|
-
label: "Cursor (global, all projects)"
|
|
951
|
-
hint: cursorIsAlreadyInstalled ? `Already installed` : void 0
|
|
1064
|
+
label: "Cursor (global, all projects)"
|
|
952
1065
|
},
|
|
953
1066
|
{
|
|
954
1067
|
value: "windsurf",
|
|
955
|
-
label: "Windsurf"
|
|
956
|
-
hint: windsurfIsAlreadyInstalled ? `Already installed` : void 0
|
|
1068
|
+
label: "Windsurf"
|
|
957
1069
|
},
|
|
958
1070
|
{
|
|
959
1071
|
value: "vscode",
|
|
960
|
-
label: "VSCode"
|
|
961
|
-
hint: vscodeIsAlreadyInstalled ? `Already installed` : void 0
|
|
1072
|
+
label: "VSCode"
|
|
962
1073
|
}
|
|
963
1074
|
]
|
|
964
1075
|
});
|
|
965
1076
|
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
1077
|
if (editor === `cursor`) {
|
|
977
|
-
|
|
1078
|
+
p5.log.message(
|
|
978
1079
|
`
|
|
979
1080
|
Note: you will need to go into Cursor Settings -> MCP Settings and manually enable the installed Mastra MCP server.
|
|
980
1081
|
`
|
|
981
1082
|
);
|
|
982
1083
|
}
|
|
983
1084
|
if (editor === `cursor-global`) {
|
|
984
|
-
const
|
|
1085
|
+
const confirm3 = await p5.select({
|
|
985
1086
|
message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
|
|
986
1087
|
options: [
|
|
987
1088
|
{ value: "yes", label: "Yes, I understand" },
|
|
988
1089
|
{ value: "skip", label: "No, skip for now" }
|
|
989
1090
|
]
|
|
990
1091
|
});
|
|
991
|
-
if (
|
|
1092
|
+
if (confirm3 !== `yes`) {
|
|
992
1093
|
return void 0;
|
|
993
1094
|
}
|
|
994
1095
|
}
|
|
995
1096
|
if (editor === `windsurf`) {
|
|
996
|
-
const
|
|
1097
|
+
const confirm3 = await p5.select({
|
|
997
1098
|
message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
|
|
998
1099
|
This means the Mastra docs MCP server will be available in all your Windsurf projects.`,
|
|
999
1100
|
options: [
|
|
@@ -1001,16 +1102,22 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
1001
1102
|
{ value: "skip", label: "No, skip for now" }
|
|
1002
1103
|
]
|
|
1003
1104
|
});
|
|
1004
|
-
if (
|
|
1105
|
+
if (confirm3 !== `yes`) {
|
|
1005
1106
|
return void 0;
|
|
1006
1107
|
}
|
|
1007
1108
|
}
|
|
1008
1109
|
return editor;
|
|
1110
|
+
},
|
|
1111
|
+
initGit: async () => {
|
|
1112
|
+
return p5.confirm({
|
|
1113
|
+
message: "Initialize a new git repository?",
|
|
1114
|
+
initialValue: true
|
|
1115
|
+
});
|
|
1009
1116
|
}
|
|
1010
1117
|
},
|
|
1011
1118
|
{
|
|
1012
1119
|
onCancel: () => {
|
|
1013
|
-
|
|
1120
|
+
p5.cancel("Operation cancelled.");
|
|
1014
1121
|
process.exit(0);
|
|
1015
1122
|
}
|
|
1016
1123
|
}
|
|
@@ -1019,21 +1126,22 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
1019
1126
|
};
|
|
1020
1127
|
var checkForPkgJson = async () => {
|
|
1021
1128
|
const cwd = process.cwd();
|
|
1022
|
-
const pkgJsonPath =
|
|
1129
|
+
const pkgJsonPath = path3.join(cwd, "package.json");
|
|
1023
1130
|
try {
|
|
1024
1131
|
await fs4.access(pkgJsonPath);
|
|
1025
1132
|
} catch {
|
|
1026
|
-
|
|
1133
|
+
p5.log.error(
|
|
1027
1134
|
'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
1135
|
);
|
|
1029
1136
|
process.exit(1);
|
|
1030
1137
|
}
|
|
1031
1138
|
};
|
|
1032
|
-
|
|
1033
|
-
// src/commands/utils.ts
|
|
1034
1139
|
function getPackageManager() {
|
|
1035
1140
|
const userAgent = process.env.npm_config_user_agent || "";
|
|
1036
1141
|
const execPath = process.env.npm_execpath || "";
|
|
1142
|
+
if (userAgent.includes("bun")) {
|
|
1143
|
+
return "bun";
|
|
1144
|
+
}
|
|
1037
1145
|
if (userAgent.includes("yarn")) {
|
|
1038
1146
|
return "yarn";
|
|
1039
1147
|
}
|
|
@@ -1043,6 +1151,9 @@ function getPackageManager() {
|
|
|
1043
1151
|
if (userAgent.includes("npm")) {
|
|
1044
1152
|
return "npm";
|
|
1045
1153
|
}
|
|
1154
|
+
if (execPath.includes("bun")) {
|
|
1155
|
+
return "bun";
|
|
1156
|
+
}
|
|
1046
1157
|
if (execPath.includes("yarn")) {
|
|
1047
1158
|
return "yarn";
|
|
1048
1159
|
}
|
|
@@ -1073,6 +1184,36 @@ function parseLlmProvider(value) {
|
|
|
1073
1184
|
}
|
|
1074
1185
|
return value;
|
|
1075
1186
|
}
|
|
1187
|
+
function shouldSkipDotenvLoading() {
|
|
1188
|
+
return process.env.MASTRA_SKIP_DOTENV === "true" || process.env.MASTRA_SKIP_DOTENV === "1";
|
|
1189
|
+
}
|
|
1190
|
+
async function getVersionTag() {
|
|
1191
|
+
try {
|
|
1192
|
+
const pkgPath = fileURLToPath(import.meta.resolve("mastra/package.json"));
|
|
1193
|
+
const json = await fsExtra3.readJSON(pkgPath);
|
|
1194
|
+
const currentVersion = json.version;
|
|
1195
|
+
const { stdout } = await execa("npm", ["dist-tag", "ls", "mastra"]);
|
|
1196
|
+
const tagLine = stdout.split("\n").find((distLine) => distLine.endsWith(`: ${currentVersion}`));
|
|
1197
|
+
const tag = tagLine ? tagLine.split(":")[0]?.trim() : void 0;
|
|
1198
|
+
return tag;
|
|
1199
|
+
} catch {
|
|
1200
|
+
return void 0;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
async function gitInit({ cwd }) {
|
|
1204
|
+
await execa("git", ["init"], { cwd, stdio: "ignore" });
|
|
1205
|
+
await execa("git", ["add", "-A"], { cwd, stdio: "ignore" });
|
|
1206
|
+
await execa(
|
|
1207
|
+
"git",
|
|
1208
|
+
[
|
|
1209
|
+
"commit",
|
|
1210
|
+
"-m",
|
|
1211
|
+
'"Initial commit from Mastra"',
|
|
1212
|
+
'--author="dane-ai-mastra[bot] <dane-ai-mastra[bot]@users.noreply.github.com>"'
|
|
1213
|
+
],
|
|
1214
|
+
{ cwd, stdio: "ignore" }
|
|
1215
|
+
);
|
|
1216
|
+
}
|
|
1076
1217
|
var logger = createLogger(false);
|
|
1077
1218
|
function createLogger(debug = false) {
|
|
1078
1219
|
return new PinoLogger({
|
|
@@ -1084,19 +1225,23 @@ function createLogger(debug = false) {
|
|
|
1084
1225
|
// src/utils/clone-template.ts
|
|
1085
1226
|
var exec2 = util.promisify(child_process.exec);
|
|
1086
1227
|
async function cloneTemplate(options) {
|
|
1087
|
-
const { template, projectName, targetDir } = options;
|
|
1088
|
-
const projectPath = targetDir ?
|
|
1228
|
+
const { template, projectName, targetDir, branch, llmProvider } = options;
|
|
1229
|
+
const projectPath = targetDir ? path3.resolve(targetDir, projectName) : path3.resolve(projectName);
|
|
1089
1230
|
const spinner4 = yoctoSpinner2({ text: `Cloning template "${template.title}"...` }).start();
|
|
1090
1231
|
try {
|
|
1091
1232
|
if (await directoryExists(projectPath)) {
|
|
1092
1233
|
spinner4.error(`Directory ${projectName} already exists`);
|
|
1093
1234
|
throw new Error(`Directory ${projectName} already exists`);
|
|
1094
1235
|
}
|
|
1095
|
-
await cloneRepositoryWithoutGit(template.githubUrl, projectPath);
|
|
1236
|
+
await cloneRepositoryWithoutGit(template.githubUrl, projectPath, branch);
|
|
1096
1237
|
await updatePackageJson(projectPath, projectName);
|
|
1097
|
-
const envExamplePath =
|
|
1238
|
+
const envExamplePath = path3.join(projectPath, ".env.example");
|
|
1098
1239
|
if (await fileExists(envExamplePath)) {
|
|
1099
|
-
|
|
1240
|
+
const envPath = path3.join(projectPath, ".env");
|
|
1241
|
+
await fs4.copyFile(envExamplePath, envPath);
|
|
1242
|
+
if (llmProvider) {
|
|
1243
|
+
await updateEnvFile(envPath, llmProvider);
|
|
1244
|
+
}
|
|
1100
1245
|
}
|
|
1101
1246
|
spinner4.success(`Template "${template.title}" cloned successfully to ${projectName}`);
|
|
1102
1247
|
return projectPath;
|
|
@@ -1121,21 +1266,27 @@ async function fileExists(filePath) {
|
|
|
1121
1266
|
return false;
|
|
1122
1267
|
}
|
|
1123
1268
|
}
|
|
1124
|
-
async function cloneRepositoryWithoutGit(repoUrl, targetPath) {
|
|
1269
|
+
async function cloneRepositoryWithoutGit(repoUrl, targetPath, branch) {
|
|
1125
1270
|
await fs4.mkdir(targetPath, { recursive: true });
|
|
1126
1271
|
try {
|
|
1127
1272
|
const degitRepo = repoUrl.replace("https://github.com/", "");
|
|
1128
|
-
const
|
|
1273
|
+
const degitRepoWithBranch = branch ? `${degitRepo}#${branch}` : degitRepo;
|
|
1274
|
+
const degitCommand = shellQuote2.quote(["npx", "degit", degitRepoWithBranch, targetPath]);
|
|
1129
1275
|
await exec2(degitCommand, {
|
|
1130
1276
|
cwd: process.cwd()
|
|
1131
1277
|
});
|
|
1132
1278
|
} catch {
|
|
1133
1279
|
try {
|
|
1134
|
-
const
|
|
1280
|
+
const gitArgs = ["git", "clone"];
|
|
1281
|
+
if (branch) {
|
|
1282
|
+
gitArgs.push("--branch", branch);
|
|
1283
|
+
}
|
|
1284
|
+
gitArgs.push(repoUrl, targetPath);
|
|
1285
|
+
const gitCommand = shellQuote2.quote(gitArgs);
|
|
1135
1286
|
await exec2(gitCommand, {
|
|
1136
1287
|
cwd: process.cwd()
|
|
1137
1288
|
});
|
|
1138
|
-
const gitDir =
|
|
1289
|
+
const gitDir = path3.join(targetPath, ".git");
|
|
1139
1290
|
if (await directoryExists(gitDir)) {
|
|
1140
1291
|
await fs4.rm(gitDir, { recursive: true, force: true });
|
|
1141
1292
|
}
|
|
@@ -1145,7 +1296,7 @@ async function cloneRepositoryWithoutGit(repoUrl, targetPath) {
|
|
|
1145
1296
|
}
|
|
1146
1297
|
}
|
|
1147
1298
|
async function updatePackageJson(projectPath, projectName) {
|
|
1148
|
-
const packageJsonPath =
|
|
1299
|
+
const packageJsonPath = path3.join(projectPath, "package.json");
|
|
1149
1300
|
try {
|
|
1150
1301
|
const packageJsonContent = await fs4.readFile(packageJsonPath, "utf-8");
|
|
1151
1302
|
const packageJson = JSON.parse(packageJsonContent);
|
|
@@ -1155,6 +1306,22 @@ async function updatePackageJson(projectPath, projectName) {
|
|
|
1155
1306
|
logger.warn(`Could not update package.json: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1156
1307
|
}
|
|
1157
1308
|
}
|
|
1309
|
+
async function updateEnvFile(envPath, llmProvider) {
|
|
1310
|
+
try {
|
|
1311
|
+
const envContent = await fs4.readFile(envPath, "utf-8");
|
|
1312
|
+
const modelString = getModelIdentifier(llmProvider);
|
|
1313
|
+
if (!modelString) {
|
|
1314
|
+
logger.warn(`Could not get model identifier for provider: ${llmProvider}`);
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
const modelValue = modelString.replace(/'/g, "");
|
|
1318
|
+
const updatedContent = envContent.replace(/^MODEL=.*/m, `MODEL=${modelValue}`);
|
|
1319
|
+
await fs4.writeFile(envPath, updatedContent, "utf-8");
|
|
1320
|
+
logger.info(`Updated MODEL in .env to ${modelValue}`);
|
|
1321
|
+
} catch (error) {
|
|
1322
|
+
logger.warn(`Could not update .env file: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1158
1325
|
async function installDependencies(projectPath, packageManager) {
|
|
1159
1326
|
const spinner4 = yoctoSpinner2({ text: "Installing dependencies..." }).start();
|
|
1160
1327
|
try {
|
|
@@ -1210,11 +1377,11 @@ async function selectTemplate(templates) {
|
|
|
1210
1377
|
hint: parts.join(", ") || "Template components"
|
|
1211
1378
|
};
|
|
1212
1379
|
});
|
|
1213
|
-
const selected = await
|
|
1380
|
+
const selected = await p5.select({
|
|
1214
1381
|
message: "Select a template:",
|
|
1215
1382
|
options: choices
|
|
1216
1383
|
});
|
|
1217
|
-
if (
|
|
1384
|
+
if (p5.isCancel(selected)) {
|
|
1218
1385
|
return null;
|
|
1219
1386
|
}
|
|
1220
1387
|
return selected;
|
|
@@ -1232,7 +1399,7 @@ function findTemplateByName(templates, templateName) {
|
|
|
1232
1399
|
function getDefaultProjectName(template) {
|
|
1233
1400
|
return template.slug.replace(/^template-/, "");
|
|
1234
1401
|
}
|
|
1235
|
-
var s =
|
|
1402
|
+
var s = p5.spinner();
|
|
1236
1403
|
var init = async ({
|
|
1237
1404
|
directory = "src/",
|
|
1238
1405
|
components,
|
|
@@ -1240,7 +1407,8 @@ var init = async ({
|
|
|
1240
1407
|
llmApiKey,
|
|
1241
1408
|
addExample = false,
|
|
1242
1409
|
configureEditorWithDocsMCP,
|
|
1243
|
-
versionTag
|
|
1410
|
+
versionTag,
|
|
1411
|
+
initGit = false
|
|
1244
1412
|
}) => {
|
|
1245
1413
|
s.start("Initializing Mastra");
|
|
1246
1414
|
const packageVersionTag = versionTag ? `@${versionTag}` : "";
|
|
@@ -1294,19 +1462,30 @@ var init = async ({
|
|
|
1294
1462
|
if (configureEditorWithDocsMCP) {
|
|
1295
1463
|
await installMastraDocsMCPServer({
|
|
1296
1464
|
editor: configureEditorWithDocsMCP,
|
|
1297
|
-
directory: process.cwd()
|
|
1465
|
+
directory: process.cwd(),
|
|
1466
|
+
versionTag
|
|
1298
1467
|
});
|
|
1299
1468
|
}
|
|
1300
1469
|
s.stop();
|
|
1470
|
+
if (initGit) {
|
|
1471
|
+
const s2 = p5.spinner();
|
|
1472
|
+
try {
|
|
1473
|
+
s2.start("Initializing git repository");
|
|
1474
|
+
await gitInit({ cwd: process.cwd() });
|
|
1475
|
+
s2.stop("Git repository initialized");
|
|
1476
|
+
} catch {
|
|
1477
|
+
s2.stop();
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1301
1480
|
if (!llmApiKey) {
|
|
1302
|
-
|
|
1481
|
+
p5.note(`
|
|
1303
1482
|
${color2.green("Mastra initialized successfully!")}
|
|
1304
1483
|
|
|
1305
1484
|
Add your ${color2.cyan(key)} as an environment variable
|
|
1306
1485
|
in your ${color2.cyan(".env")} file
|
|
1307
1486
|
`);
|
|
1308
1487
|
} else {
|
|
1309
|
-
|
|
1488
|
+
p5.note(`
|
|
1310
1489
|
${color2.green("Mastra initialized successfully!")}
|
|
1311
1490
|
`);
|
|
1312
1491
|
}
|
|
@@ -1343,6 +1522,32 @@ var execWithTimeout = async (command, timeoutMs) => {
|
|
|
1343
1522
|
throw error;
|
|
1344
1523
|
}
|
|
1345
1524
|
};
|
|
1525
|
+
async function getInitCommand(pm) {
|
|
1526
|
+
switch (pm) {
|
|
1527
|
+
case "npm":
|
|
1528
|
+
return "npm init -y";
|
|
1529
|
+
case "pnpm":
|
|
1530
|
+
return "pnpm init";
|
|
1531
|
+
case "yarn":
|
|
1532
|
+
return "yarn init -y";
|
|
1533
|
+
case "bun":
|
|
1534
|
+
return "bun init -y";
|
|
1535
|
+
default:
|
|
1536
|
+
return "npm init -y";
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
async function initializePackageJson(pm) {
|
|
1540
|
+
const initCommand = await getInitCommand(pm);
|
|
1541
|
+
await exec3(initCommand);
|
|
1542
|
+
const packageJsonPath = path3.join(process.cwd(), "package.json");
|
|
1543
|
+
const packageJson = JSON.parse(await fs4.readFile(packageJsonPath, "utf-8"));
|
|
1544
|
+
packageJson.type = "module";
|
|
1545
|
+
packageJson.engines = {
|
|
1546
|
+
...packageJson.engines,
|
|
1547
|
+
node: ">=22.13.0"
|
|
1548
|
+
};
|
|
1549
|
+
await fs4.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
1550
|
+
}
|
|
1346
1551
|
async function installMastraDependency(pm, dependency, versionTag, isDev, timeout) {
|
|
1347
1552
|
let installCommand = getPackageManagerAddCommand(pm);
|
|
1348
1553
|
if (isDev) {
|
|
@@ -1373,8 +1578,8 @@ var createMastraProject = async ({
|
|
|
1373
1578
|
llmApiKey,
|
|
1374
1579
|
needsInteractive
|
|
1375
1580
|
}) => {
|
|
1376
|
-
|
|
1377
|
-
const projectName = name ?? await
|
|
1581
|
+
p5.intro(color2.inverse(" Mastra Create "));
|
|
1582
|
+
const projectName = name ?? await p5.text({
|
|
1378
1583
|
message: "What do you want to name your project?",
|
|
1379
1584
|
placeholder: "my-mastra-app",
|
|
1380
1585
|
defaultValue: "my-mastra-app",
|
|
@@ -1385,22 +1590,25 @@ var createMastraProject = async ({
|
|
|
1385
1590
|
}
|
|
1386
1591
|
}
|
|
1387
1592
|
});
|
|
1388
|
-
if (
|
|
1389
|
-
|
|
1593
|
+
if (p5.isCancel(projectName)) {
|
|
1594
|
+
p5.cancel("Operation cancelled");
|
|
1390
1595
|
process.exit(0);
|
|
1391
1596
|
}
|
|
1392
|
-
let result;
|
|
1597
|
+
let result = void 0;
|
|
1393
1598
|
if (needsInteractive) {
|
|
1394
1599
|
result = await interactivePrompt({
|
|
1395
1600
|
options: { showBanner: false },
|
|
1396
1601
|
skip: { llmProvider: llmProvider !== void 0, llmApiKey: llmApiKey !== void 0 }
|
|
1397
1602
|
});
|
|
1398
1603
|
}
|
|
1399
|
-
const s2 =
|
|
1604
|
+
const s2 = p5.spinner();
|
|
1605
|
+
const originalCwd = process.cwd();
|
|
1606
|
+
let projectPath = null;
|
|
1400
1607
|
try {
|
|
1401
1608
|
s2.start("Creating project");
|
|
1402
1609
|
try {
|
|
1403
1610
|
await fs4.mkdir(projectName);
|
|
1611
|
+
projectPath = path3.resolve(originalCwd, projectName);
|
|
1404
1612
|
} catch (error) {
|
|
1405
1613
|
if (error instanceof Error && "code" in error && error.code === "EEXIST") {
|
|
1406
1614
|
s2.stop(`A directory named "${projectName}" already exists. Please choose a different name.`);
|
|
@@ -1415,9 +1623,7 @@ var createMastraProject = async ({
|
|
|
1415
1623
|
const installCommand = getPackageManagerAddCommand(pm);
|
|
1416
1624
|
s2.message("Initializing project structure");
|
|
1417
1625
|
try {
|
|
1418
|
-
await
|
|
1419
|
-
await exec3(`npm pkg set type="module"`);
|
|
1420
|
-
await exec3(`npm pkg set engines.node=">=20.9.0"`);
|
|
1626
|
+
await initializePackageJson(pm);
|
|
1421
1627
|
const depsService = new DepsService();
|
|
1422
1628
|
await depsService.addScriptsToPackageJson({
|
|
1423
1629
|
dev: "mastra dev",
|
|
@@ -1489,33 +1695,50 @@ var createMastraProject = async ({
|
|
|
1489
1695
|
throw new Error(`Failed to create .gitignore: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1490
1696
|
}
|
|
1491
1697
|
s2.stop(".gitignore added");
|
|
1492
|
-
|
|
1698
|
+
p5.outro("Project created successfully");
|
|
1493
1699
|
console.info("");
|
|
1494
1700
|
return { projectName, result };
|
|
1495
1701
|
} catch (error) {
|
|
1496
1702
|
s2.stop();
|
|
1497
1703
|
const errorMessage = error instanceof Error ? error.message : "An unexpected error occurred";
|
|
1498
|
-
|
|
1704
|
+
p5.cancel(`Project creation failed: ${errorMessage}`);
|
|
1705
|
+
if (projectPath && fs3__default.existsSync(projectPath)) {
|
|
1706
|
+
try {
|
|
1707
|
+
process.chdir(originalCwd);
|
|
1708
|
+
await fs4.rm(projectPath, { recursive: true, force: true });
|
|
1709
|
+
} catch (cleanupError) {
|
|
1710
|
+
console.error(
|
|
1711
|
+
`Warning: Failed to clean up project directory: ${cleanupError instanceof Error ? cleanupError.message : "Unknown error"}`
|
|
1712
|
+
);
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1499
1715
|
process.exit(1);
|
|
1500
1716
|
}
|
|
1501
1717
|
};
|
|
1502
1718
|
|
|
1503
1719
|
// src/commands/create/create.ts
|
|
1504
|
-
var
|
|
1505
|
-
|
|
1506
|
-
|
|
1720
|
+
var version = package_default.version;
|
|
1721
|
+
var create = async (args) => {
|
|
1722
|
+
if (args.template !== void 0) {
|
|
1723
|
+
await createFromTemplate({
|
|
1724
|
+
projectName: args.projectName,
|
|
1725
|
+
template: args.template,
|
|
1726
|
+
timeout: args.timeout,
|
|
1727
|
+
injectedAnalytics: args.analytics,
|
|
1728
|
+
llmProvider: args.llmProvider
|
|
1729
|
+
});
|
|
1507
1730
|
return;
|
|
1508
1731
|
}
|
|
1509
|
-
const needsInteractive =
|
|
1732
|
+
const needsInteractive = args.components === void 0 || args.llmProvider === void 0 || args.addExample === void 0;
|
|
1510
1733
|
const { projectName, result } = await createMastraProject({
|
|
1511
|
-
projectName:
|
|
1512
|
-
createVersionTag:
|
|
1513
|
-
timeout:
|
|
1514
|
-
llmProvider:
|
|
1515
|
-
llmApiKey:
|
|
1734
|
+
projectName: args?.projectName,
|
|
1735
|
+
createVersionTag: args?.createVersionTag,
|
|
1736
|
+
timeout: args?.timeout,
|
|
1737
|
+
llmProvider: args?.llmProvider,
|
|
1738
|
+
llmApiKey: args?.llmApiKey,
|
|
1516
1739
|
needsInteractive
|
|
1517
1740
|
});
|
|
1518
|
-
const directory =
|
|
1741
|
+
const directory = args.directory || "src/";
|
|
1519
1742
|
if (needsInteractive && result) {
|
|
1520
1743
|
const analytics2 = getAnalytics();
|
|
1521
1744
|
if (analytics2 && result?.llmProvider) {
|
|
@@ -1529,12 +1752,12 @@ var create = async (args2) => {
|
|
|
1529
1752
|
llmApiKey: result?.llmApiKey,
|
|
1530
1753
|
components: ["agents", "tools", "workflows", "scorers"],
|
|
1531
1754
|
addExample: true,
|
|
1532
|
-
versionTag:
|
|
1755
|
+
versionTag: args.createVersionTag
|
|
1533
1756
|
});
|
|
1534
1757
|
postCreate({ projectName });
|
|
1535
1758
|
return;
|
|
1536
1759
|
}
|
|
1537
|
-
const { components = [], llmProvider = "openai", addExample = false, llmApiKey } =
|
|
1760
|
+
const { components = [], llmProvider = "openai", addExample = false, llmApiKey } = args;
|
|
1538
1761
|
const analytics = getAnalytics();
|
|
1539
1762
|
if (analytics) {
|
|
1540
1763
|
analytics.trackEvent("cli_model_provider_selected", {
|
|
@@ -1548,14 +1771,14 @@ var create = async (args2) => {
|
|
|
1548
1771
|
llmProvider,
|
|
1549
1772
|
addExample,
|
|
1550
1773
|
llmApiKey,
|
|
1551
|
-
configureEditorWithDocsMCP:
|
|
1552
|
-
versionTag:
|
|
1774
|
+
configureEditorWithDocsMCP: args.mcpServer,
|
|
1775
|
+
versionTag: args.createVersionTag
|
|
1553
1776
|
});
|
|
1554
1777
|
postCreate({ projectName });
|
|
1555
1778
|
};
|
|
1556
1779
|
var postCreate = ({ projectName }) => {
|
|
1557
1780
|
const packageManager = getPackageManager();
|
|
1558
|
-
|
|
1781
|
+
p5.outro(`
|
|
1559
1782
|
${color2.green("To start your project:")}
|
|
1560
1783
|
|
|
1561
1784
|
${color2.cyan("cd")} ${projectName}
|
|
@@ -1640,36 +1863,36 @@ async function createFromGitHubUrl(url) {
|
|
|
1640
1863
|
workflows: []
|
|
1641
1864
|
};
|
|
1642
1865
|
}
|
|
1643
|
-
async function createFromTemplate(
|
|
1866
|
+
async function createFromTemplate(args) {
|
|
1644
1867
|
let selectedTemplate;
|
|
1645
|
-
if (
|
|
1868
|
+
if (args.template === true) {
|
|
1646
1869
|
const templates = await loadTemplates();
|
|
1647
1870
|
const selected = await selectTemplate(templates);
|
|
1648
1871
|
if (!selected) {
|
|
1649
|
-
|
|
1872
|
+
p5.log.info("No template selected. Exiting.");
|
|
1650
1873
|
return;
|
|
1651
1874
|
}
|
|
1652
1875
|
selectedTemplate = selected;
|
|
1653
|
-
} else if (
|
|
1654
|
-
if (isGitHubUrl(
|
|
1655
|
-
const spinner4 =
|
|
1876
|
+
} else if (args.template && typeof args.template === "string") {
|
|
1877
|
+
if (isGitHubUrl(args.template)) {
|
|
1878
|
+
const spinner4 = p5.spinner();
|
|
1656
1879
|
spinner4.start("Validating GitHub repository...");
|
|
1657
|
-
const validation = await validateGitHubProject(
|
|
1880
|
+
const validation = await validateGitHubProject(args.template);
|
|
1658
1881
|
if (!validation.isValid) {
|
|
1659
1882
|
spinner4.stop("Validation failed");
|
|
1660
|
-
|
|
1661
|
-
validation.errors.forEach((error) =>
|
|
1883
|
+
p5.log.error("This does not appear to be a valid Mastra project:");
|
|
1884
|
+
validation.errors.forEach((error) => p5.log.error(` - ${error}`));
|
|
1662
1885
|
throw new Error("Invalid Mastra project");
|
|
1663
1886
|
}
|
|
1664
1887
|
spinner4.stop("Valid Mastra project \u2713");
|
|
1665
|
-
selectedTemplate = await createFromGitHubUrl(
|
|
1888
|
+
selectedTemplate = await createFromGitHubUrl(args.template);
|
|
1666
1889
|
} else {
|
|
1667
1890
|
const templates = await loadTemplates();
|
|
1668
|
-
const found = findTemplateByName(templates,
|
|
1891
|
+
const found = findTemplateByName(templates, args.template);
|
|
1669
1892
|
if (!found) {
|
|
1670
|
-
|
|
1671
|
-
templates.forEach((t) =>
|
|
1672
|
-
throw new Error(`Template "${
|
|
1893
|
+
p5.log.error(`Template "${args.template}" not found. Available templates:`);
|
|
1894
|
+
templates.forEach((t) => p5.log.info(` - ${t.title} (use: ${t.slug.replace("template-", "")})`));
|
|
1895
|
+
throw new Error(`Template "${args.template}" not found`);
|
|
1673
1896
|
}
|
|
1674
1897
|
selectedTemplate = found;
|
|
1675
1898
|
}
|
|
@@ -1677,34 +1900,76 @@ async function createFromTemplate(args2) {
|
|
|
1677
1900
|
if (!selectedTemplate) {
|
|
1678
1901
|
throw new Error("No template selected");
|
|
1679
1902
|
}
|
|
1680
|
-
let projectName =
|
|
1903
|
+
let projectName = args.projectName;
|
|
1681
1904
|
if (!projectName) {
|
|
1682
1905
|
const defaultName = getDefaultProjectName(selectedTemplate);
|
|
1683
|
-
const response = await
|
|
1906
|
+
const response = await p5.text({
|
|
1684
1907
|
message: "What is your project name?",
|
|
1685
1908
|
defaultValue: defaultName,
|
|
1686
1909
|
placeholder: defaultName
|
|
1687
1910
|
});
|
|
1688
|
-
if (
|
|
1689
|
-
|
|
1911
|
+
if (p5.isCancel(response)) {
|
|
1912
|
+
p5.log.info("Project creation cancelled.");
|
|
1690
1913
|
return;
|
|
1691
1914
|
}
|
|
1692
1915
|
projectName = response;
|
|
1693
1916
|
}
|
|
1917
|
+
let llmProvider = args.llmProvider;
|
|
1918
|
+
if (!llmProvider) {
|
|
1919
|
+
const providerResponse = await p5.select({
|
|
1920
|
+
message: "Select a default provider:",
|
|
1921
|
+
options: LLM_PROVIDERS
|
|
1922
|
+
});
|
|
1923
|
+
if (p5.isCancel(providerResponse)) {
|
|
1924
|
+
p5.log.info("Project creation cancelled.");
|
|
1925
|
+
return;
|
|
1926
|
+
}
|
|
1927
|
+
llmProvider = providerResponse;
|
|
1928
|
+
}
|
|
1929
|
+
let initGit = false;
|
|
1930
|
+
const gitConfirmResult = await p5.confirm({
|
|
1931
|
+
message: "Initialize a new git repository?",
|
|
1932
|
+
initialValue: true
|
|
1933
|
+
});
|
|
1934
|
+
if (!p5.isCancel(gitConfirmResult)) {
|
|
1935
|
+
initGit = gitConfirmResult;
|
|
1936
|
+
}
|
|
1937
|
+
let projectPath = null;
|
|
1694
1938
|
try {
|
|
1695
|
-
const analytics =
|
|
1939
|
+
const analytics = args.injectedAnalytics || getAnalytics();
|
|
1696
1940
|
if (analytics) {
|
|
1697
1941
|
analytics.trackEvent("cli_template_used", {
|
|
1698
1942
|
template_slug: selectedTemplate.slug,
|
|
1699
1943
|
template_title: selectedTemplate.title
|
|
1700
1944
|
});
|
|
1945
|
+
if (llmProvider) {
|
|
1946
|
+
analytics.trackEvent("cli_model_provider_selected", {
|
|
1947
|
+
provider: llmProvider,
|
|
1948
|
+
selection_method: args.llmProvider ? "cli_args" : "interactive"
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1701
1951
|
}
|
|
1702
|
-
const
|
|
1952
|
+
const isBeta = version?.includes("beta") ?? false;
|
|
1953
|
+
const isMastraTemplate = selectedTemplate.githubUrl.includes("github.com/mastra-ai/");
|
|
1954
|
+
const branch = isBeta && isMastraTemplate ? "beta" : void 0;
|
|
1955
|
+
projectPath = await cloneTemplate({
|
|
1703
1956
|
template: selectedTemplate,
|
|
1704
|
-
projectName
|
|
1957
|
+
projectName,
|
|
1958
|
+
branch,
|
|
1959
|
+
llmProvider
|
|
1705
1960
|
});
|
|
1706
1961
|
await installDependencies(projectPath);
|
|
1707
|
-
|
|
1962
|
+
if (initGit) {
|
|
1963
|
+
const s2 = p5.spinner();
|
|
1964
|
+
try {
|
|
1965
|
+
s2.start("Initializing git repository");
|
|
1966
|
+
await gitInit({ cwd: projectPath });
|
|
1967
|
+
s2.stop("Git repository initialized");
|
|
1968
|
+
} catch {
|
|
1969
|
+
s2.stop();
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
p5.note(`
|
|
1708
1973
|
${color2.green("Mastra template installed!")}
|
|
1709
1974
|
|
|
1710
1975
|
Add the necessary environment
|
|
@@ -1712,11 +1977,22 @@ async function createFromTemplate(args2) {
|
|
|
1712
1977
|
`);
|
|
1713
1978
|
postCreate({ projectName });
|
|
1714
1979
|
} catch (error) {
|
|
1715
|
-
|
|
1980
|
+
if (projectPath) {
|
|
1981
|
+
try {
|
|
1982
|
+
if (fs3__default.existsSync(projectPath)) {
|
|
1983
|
+
await fs4.rm(projectPath, { recursive: true, force: true });
|
|
1984
|
+
}
|
|
1985
|
+
} catch (cleanupError) {
|
|
1986
|
+
console.error(
|
|
1987
|
+
`Warning: Failed to clean up project directory: ${cleanupError instanceof Error ? cleanupError.message : "Unknown error"}`
|
|
1988
|
+
);
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
p5.log.error(`Failed to create project from template: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1716
1992
|
throw error;
|
|
1717
1993
|
}
|
|
1718
1994
|
}
|
|
1719
1995
|
|
|
1720
|
-
export { COMPONENTS, DepsService, FileService, LLMProvider, checkAndInstallCoreDeps, checkForPkgJson, create, createLogger, init, interactivePrompt, logger, parseComponents, parseLlmProvider, parseMcp };
|
|
1721
|
-
//# sourceMappingURL=chunk-
|
|
1722
|
-
//# sourceMappingURL=chunk-
|
|
1996
|
+
export { COMPONENTS, DepsService, FileService, LLMProvider, checkAndInstallCoreDeps, checkForPkgJson, create, createLogger, getVersionTag, init, interactivePrompt, logger, package_default, parseComponents, parseLlmProvider, parseMcp, shouldSkipDotenvLoading };
|
|
1997
|
+
//# sourceMappingURL=chunk-THUIZ4X5.js.map
|
|
1998
|
+
//# sourceMappingURL=chunk-THUIZ4X5.js.map
|