mastra 1.0.0-beta.1 → 1.0.0-beta.11
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 +189 -0
- package/dist/analytics/index.js +1 -1
- package/dist/{chunk-NHL3S2MZ.js → chunk-7KQSE34M.js} +541 -262
- package/dist/chunk-7KQSE34M.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 +2 -0
- 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 +10 -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 +19 -1
- package/dist/commands/utils.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +152 -56
- package/dist/index.js.map +1 -1
- package/dist/playground/assets/abap-CJwFGTKJ.js +1 -0
- package/dist/playground/assets/abnf-eFeSOc-x.js +1 -0
- package/dist/playground/assets/actionscript-DoGBpwFx.js +1 -0
- package/dist/playground/assets/ada-CRm4GWU1.js +1 -0
- package/dist/playground/assets/agda-B-c4TZxz.js +1 -0
- package/dist/playground/assets/al-CxY7nOhg.js +1 -0
- package/dist/playground/assets/antlr4-BZKwxeAX.js +1 -0
- package/dist/playground/assets/apacheconf-C5V0rw6Q.js +1 -0
- package/dist/playground/assets/apex-0njeTMa6.js +1 -0
- package/dist/playground/assets/apl-C4DCDMU6.js +1 -0
- package/dist/playground/assets/applescript-CsrYtELE.js +1 -0
- package/dist/playground/assets/aql-eHF3GfT4.js +1 -0
- package/dist/playground/assets/arduino-B5vgT0nE.js +1 -0
- package/dist/playground/assets/arff-BnFuUJLC.js +1 -0
- package/dist/playground/assets/asciidoc-CErEFI0I.js +1 -0
- package/dist/playground/assets/asm6502-mct3H-RS.js +1 -0
- package/dist/playground/assets/asmatmel-C_u8aGL_.js +1 -0
- package/dist/playground/assets/aspnet-DyV3dj5R.js +1 -0
- package/dist/playground/assets/autohotkey-xhVzAbnz.js +1 -0
- package/dist/playground/assets/autoit-DLoKUEWF.js +1 -0
- package/dist/playground/assets/avisynth-TSWI4XjF.js +1 -0
- package/dist/playground/assets/avro-idl-DN4KtQRa.js +1 -0
- package/dist/playground/assets/bash-bg8SxINF.js +1 -0
- package/dist/playground/assets/{bash-DC9ltNCH.js → basic-CdHFID1b.js} +1 -1
- package/dist/playground/assets/batch-PN35Z_q3.js +1 -0
- package/dist/playground/assets/bbcode-Cfj_BGSF.js +1 -0
- package/dist/playground/assets/bicep-DMg2juey.js +1 -0
- package/dist/playground/assets/birb-Bs3kCk7O.js +1 -0
- package/dist/playground/assets/bison-CWFiEETg.js +1 -0
- package/dist/playground/assets/bnf-CK_lwvqD.js +1 -0
- package/dist/playground/assets/brainfuck-X2mI1C9r.js +1 -0
- package/dist/playground/assets/brightscript-C7Vtb5Fp.js +1 -0
- package/dist/playground/assets/bro-BoJLE4PD.js +1 -0
- package/dist/playground/assets/bsl-DyA6wnfN.js +1 -0
- package/dist/playground/assets/c-BFU6ROxR.js +1 -0
- package/dist/playground/assets/cfscript-wyswjGOg.js +1 -0
- package/dist/playground/assets/chaiscript-CKpj-wqw.js +1 -0
- package/dist/playground/assets/chunk-55VPMN3N-C1oeJ23c.js +1 -0
- package/dist/playground/assets/cil-CBpLMuTj.js +1 -0
- package/dist/playground/assets/clike-DZxwlIAs.js +1 -0
- package/dist/playground/assets/clojure-CILFjsHB.js +1 -0
- package/dist/playground/assets/cmake-BqE_b4vJ.js +1 -0
- package/dist/playground/assets/cobol-CweJtlIg.js +1 -0
- package/dist/playground/assets/coffeescript-BaZJW614.js +1 -0
- package/dist/playground/assets/concurnas-BnDv3B2V.js +1 -0
- package/dist/playground/assets/coq-ZuPXEAx5.js +1 -0
- package/dist/playground/assets/core-CUEtPI_q.js +8 -0
- package/dist/playground/assets/cpp-DlJlxXOl.js +1 -0
- package/dist/playground/assets/crystal-Sfc5-fLA.js +1 -0
- package/dist/playground/assets/csharp-B1NYLsc_.js +1 -0
- package/dist/playground/assets/cshtml-Cco4Hkc-.js +1 -0
- package/dist/playground/assets/csp-wty_f-b4.js +1 -0
- package/dist/playground/assets/css-DfztekPW.js +1 -0
- package/dist/playground/assets/css-extras-pLNnG41i.js +1 -0
- package/dist/playground/assets/csv-BQL5sipt.js +1 -0
- package/dist/playground/assets/cypher-DBe-76hY.js +1 -0
- package/dist/playground/assets/d-DXCAO4Rn.js +1 -0
- package/dist/playground/assets/dart-BU0bJvrS.js +1 -0
- package/dist/playground/assets/dataweave-yaeFBEbN.js +1 -0
- package/dist/playground/assets/dax-CTh7dEt1.js +1 -0
- package/dist/playground/assets/dhall-BAuOYHTv.js +1 -0
- package/dist/playground/assets/diff-DhEor1ma.js +3 -0
- package/dist/playground/assets/django-CbqBp4xl.js +1 -0
- package/dist/playground/assets/dns-zone-file-_we63YQA.js +1 -0
- package/dist/playground/assets/docker-CXbYgHQG.js +1 -0
- package/dist/playground/assets/dot-DXETRXuk.js +1 -0
- package/dist/playground/assets/ebnf-CNkdULZ1.js +1 -0
- package/dist/playground/assets/editorconfig-BmdB-qOn.js +1 -0
- package/dist/playground/assets/eiffel-C-ls-tDr.js +1 -0
- package/dist/playground/assets/ejs-D7YwndJr.js +1 -0
- package/dist/playground/assets/elixir-cZrgJKwV.js +1 -0
- package/dist/playground/assets/elm-CzV3RLjK.js +1 -0
- package/dist/playground/assets/erb-DaK0YCWi.js +1 -0
- package/dist/playground/assets/erlang-Dxpchf7W.js +1 -0
- package/dist/playground/assets/etlua-ii7PsKcS.js +1 -0
- package/dist/playground/assets/excel-formula-Bx4LZm3l.js +1 -0
- package/dist/playground/assets/factor-5y1vzMQW.js +1 -0
- package/dist/playground/assets/false-DbtIPtli.js +1 -0
- package/dist/playground/assets/firestore-security-rules-IqujXJmX.js +1 -0
- package/dist/playground/assets/flow-DXMPYIyi.js +1 -0
- package/dist/playground/assets/fortran-Bh5RNOX-.js +1 -0
- package/dist/playground/assets/fsharp-Blognd2Q.js +1 -0
- package/dist/playground/assets/ftl-CGppTBA4.js +1 -0
- package/dist/playground/assets/gap-C85tevss.js +1 -0
- package/dist/playground/assets/gcode-BD5-bSAv.js +1 -0
- package/dist/playground/assets/gdscript-BILcuCfO.js +1 -0
- package/dist/playground/assets/gedcom-DQrzzEWK.js +1 -0
- package/dist/playground/assets/gherkin-wJK_o7r4.js +1 -0
- package/dist/playground/assets/git-B6D-hjLc.js +1 -0
- package/dist/playground/assets/glsl-CMZxxayq.js +1 -0
- package/dist/playground/assets/gml-D9ZMZU4Q.js +1 -0
- package/dist/playground/assets/gn-BEPdF-St.js +1 -0
- package/dist/playground/assets/go-D04C2ZTh.js +1 -0
- package/dist/playground/assets/go-module-51Z_-SkJ.js +1 -0
- package/dist/playground/assets/graphql-Dk_FINZh.js +1 -0
- package/dist/playground/assets/groovy-CdhyTq2a.js +1 -0
- package/dist/playground/assets/haml-D1M5N4na.js +1 -0
- package/dist/playground/assets/handlebars-AzHz4DvV.js +1 -0
- package/dist/playground/assets/haskell-Bo6pP_s3.js +1 -0
- package/dist/playground/assets/haxe-Vd_PAi9i.js +1 -0
- package/dist/playground/assets/hcl-D6c0o6iC.js +1 -0
- package/dist/playground/assets/hlsl-eRfp1aUO.js +1 -0
- package/dist/playground/assets/hoon-DZi3K3H7.js +1 -0
- package/dist/playground/assets/hpkp-CdZarZCF.js +1 -0
- package/dist/playground/assets/hsts-D4BD9YLe.js +1 -0
- package/dist/playground/assets/http-DbaBJkSk.js +1 -0
- package/dist/playground/assets/ichigojam-DAd64XM0.js +1 -0
- package/dist/playground/assets/icon-BHZ0vSKt.js +1 -0
- package/dist/playground/assets/icu-message-format-CZj6pn2p.js +1 -0
- package/dist/playground/assets/idris-5y7SFbWf.js +1 -0
- package/dist/playground/assets/iecst-BCh42SZ5.js +1 -0
- package/dist/playground/assets/ignore-DJ_ljxRN.js +1 -0
- package/dist/playground/assets/index--Xd5_LxW.js +1 -0
- package/dist/playground/assets/{index-CLu0RbtZ.js → index-23_lqRUX.js} +2 -2
- package/dist/playground/assets/index-B_fKlnxR.js +1 -0
- package/dist/playground/assets/index-Bk_V5oPp.js +1 -0
- package/dist/playground/assets/index-BqTF8nWM.js +1 -0
- package/dist/playground/assets/index-CDSmzbvh.js +1 -0
- package/dist/playground/assets/index-CG01XrOQ.js +13 -0
- package/dist/playground/assets/index-CdgQ1vq1.js +1 -0
- package/dist/playground/assets/index-CltxTcY1.js +1 -0
- package/dist/playground/assets/index-Ct-plkrg.js +1 -0
- package/dist/playground/assets/index-Cuh9fR7m.js +1 -0
- package/dist/playground/assets/index-CxV7aUGx.js +1 -0
- package/dist/playground/assets/index-D5i6_fvR.js +1 -0
- package/dist/playground/assets/index-DMtxF8a1.js +3 -0
- package/dist/playground/assets/index-DW8tOucs.js +7 -0
- package/dist/playground/assets/index-DkmbD2Sj.js +1 -0
- package/dist/playground/assets/index-DsYDQQoV.js +1 -0
- package/dist/playground/assets/index-iRsIrQII.js +1 -0
- package/dist/playground/assets/inform7-BJidq6IR.js +1 -0
- package/dist/playground/assets/ini-Bqf0nETe.js +1 -0
- package/dist/playground/assets/io-uaFSsFn1.js +1 -0
- package/dist/playground/assets/j-D_yi-KhX.js +1 -0
- package/dist/playground/assets/{lua-gNMwUQjv.js → java-8cjCfiMg.js} +1 -1
- package/dist/playground/assets/javadoc-DOaMCabB.js +1 -0
- package/dist/playground/assets/javadoclike-BMT9dcby.js +1 -0
- package/dist/playground/assets/javascript-C8tGhSz9.js +1 -0
- package/dist/playground/assets/javastacktrace-C_CkYov7.js +1 -0
- package/dist/playground/assets/jexl-CbQ7Qk45.js +1 -0
- package/dist/playground/assets/jolie-DvhmIUOd.js +1 -0
- package/dist/playground/assets/jq--RYs7ktp.js +1 -0
- package/dist/playground/assets/js-extras-C4oAwhWv.js +1 -0
- package/dist/playground/assets/js-templates-rt6-YP4z.js +1 -0
- package/dist/playground/assets/jsdoc-DdAqblVo.js +1 -0
- package/dist/playground/assets/json-Dza_KfzY.js +1 -0
- package/dist/playground/assets/json5-f8BntBNB.js +1 -0
- package/dist/playground/assets/jsonp-C-MHXva_.js +1 -0
- package/dist/playground/assets/jsstacktrace-Ba9txAO0.js +1 -0
- package/dist/playground/assets/jsx-ZPSFhqMp.js +1 -0
- package/dist/playground/assets/julia-IBRaKRNZ.js +1 -0
- package/dist/playground/assets/keepalived-CY3WKK5F.js +1 -0
- package/dist/playground/assets/keyman-CwRnXFBy.js +1 -0
- package/dist/playground/assets/kotlin-u-oHBm9q.js +1 -0
- package/dist/playground/assets/kumir-U0GRBGYP.js +1 -0
- package/dist/playground/assets/kusto-C8KSAZql.js +1 -0
- package/dist/playground/assets/latex-CgiSon14.js +1 -0
- package/dist/playground/assets/latte-CrnUBWIR.js +1 -0
- package/dist/playground/assets/less-DedHCcHC.js +1 -0
- package/dist/playground/assets/lilypond-BMzUmbnE.js +1 -0
- package/dist/playground/assets/liquid-DTVt5oNx.js +1 -0
- package/dist/playground/assets/lisp-CjjDundB.js +1 -0
- package/dist/playground/assets/livescript-CpzGZUmo.js +1 -0
- package/dist/playground/assets/llvm-CZo-hm8f.js +1 -0
- package/dist/playground/assets/log-rLEQIZO2.js +1 -0
- package/dist/playground/assets/lolcode-CnKhefWC.js +1 -0
- package/dist/playground/assets/lua-DDcS5kh6.js +1 -0
- package/dist/playground/assets/magma-B9H7ET2q.js +1 -0
- package/dist/playground/assets/main-DaP_siXn.js +1189 -0
- package/dist/playground/assets/makefile-CoVWmlWM.js +1 -0
- package/dist/playground/assets/markdown-XJNzj2_L.js +1 -0
- package/dist/playground/assets/markup-CFYYx7VM.js +1 -0
- package/dist/playground/assets/markup-templating--fAtSFK8.js +1 -0
- package/dist/playground/assets/matlab-DPQIo5-2.js +1 -0
- package/dist/playground/assets/maxscript-CTaWOUQ-.js +1 -0
- package/dist/playground/assets/mel-yxVOtXBS.js +1 -0
- package/dist/playground/assets/mermaid-DIYxxifP.js +1 -0
- package/dist/playground/assets/mizar-XZoiwI6o.js +1 -0
- package/dist/playground/assets/mongodb-Bo9Lcd7z.js +1 -0
- package/dist/playground/assets/monkey-qe0WMqdZ.js +1 -0
- package/dist/playground/assets/moonscript-C6RD6LYn.js +1 -0
- package/dist/playground/assets/n1ql-CdgWROrf.js +1 -0
- package/dist/playground/assets/n4js-Dw5l6gtf.js +1 -0
- package/dist/playground/assets/nand2tetris-hdl-CfxaNntP.js +1 -0
- package/dist/playground/assets/naniscript-BP4VsrBB.js +1 -0
- package/dist/playground/assets/nasm-BxdWPxnQ.js +1 -0
- package/dist/playground/assets/neon-tpNj_2Lo.js +1 -0
- package/dist/playground/assets/nevod-T-6CQnBp.js +1 -0
- package/dist/playground/assets/nginx-Adh5CO7U.js +1 -0
- package/dist/playground/assets/nim-DWShgdyW.js +1 -0
- package/dist/playground/assets/nix-Dygd-w1o.js +1 -0
- package/dist/playground/assets/nsis-ZWaj1FEt.js +1 -0
- package/dist/playground/assets/objectivec-C0aGSZcL.js +1 -0
- package/dist/playground/assets/ocaml-GoiyWugR.js +1 -0
- package/dist/playground/assets/opencl-DF_kR7R-.js +1 -0
- package/dist/playground/assets/openqasm-yNIpQYb3.js +1 -0
- package/dist/playground/assets/oz-BlijNVmb.js +1 -0
- package/dist/playground/assets/parigp-CSi1ScnA.js +1 -0
- package/dist/playground/assets/parser-B6AKNPI8.js +1 -0
- package/dist/playground/assets/pascal-BF_BNgEU.js +1 -0
- package/dist/playground/assets/pascaligo-Do_bl0su.js +1 -0
- package/dist/playground/assets/pcaxis-CbOiG2US.js +1 -0
- package/dist/playground/assets/peoplecode-DDHEekER.js +1 -0
- package/dist/playground/assets/perl--Sz8qdsM.js +1 -0
- package/dist/playground/assets/php-BxJDUrM0.js +1 -0
- package/dist/playground/assets/php-extras-CHYGzt8U.js +1 -0
- package/dist/playground/assets/phpdoc-xGmqlQoT.js +1 -0
- package/dist/playground/assets/plsql-DHqhvxM3.js +1 -0
- package/dist/playground/assets/powerquery-BLYviFq1.js +1 -0
- package/dist/playground/assets/powershell-bR0U2Vny.js +1 -0
- package/dist/playground/assets/processing-DFbft-EN.js +1 -0
- package/dist/playground/assets/prolog-9xB-aaIb.js +1 -0
- package/dist/playground/assets/promql-DTSj38JG.js +1 -0
- package/dist/playground/assets/properties-DYqlknS_.js +1 -0
- package/dist/playground/assets/protobuf-BsY74Bqk.js +1 -0
- package/dist/playground/assets/psl-CBNiDwPC.js +1 -0
- package/dist/playground/assets/pug-BbKULGZn.js +1 -0
- package/dist/playground/assets/puppet-CWZ41NwT.js +1 -0
- package/dist/playground/assets/pure-CsZa1I0l.js +1 -0
- package/dist/playground/assets/purebasic-BvubXeL8.js +1 -0
- package/dist/playground/assets/purescript-D9j4R2LH.js +1 -0
- package/dist/playground/assets/python-CNwLUwFt.js +1 -0
- package/dist/playground/assets/q-CvMZIiCu.js +1 -0
- package/dist/playground/assets/qml-DlQgpv3g.js +1 -0
- package/dist/playground/assets/qore-CqZxXZQP.js +1 -0
- package/dist/playground/assets/qsharp-CA9-ymty.js +1 -0
- package/dist/playground/assets/r-LbITMPhp.js +1 -0
- package/dist/playground/assets/racket-DovRs6Rp.js +1 -0
- package/dist/playground/assets/reason-BWgJehx0.js +1 -0
- package/dist/playground/assets/regex-CAauRcAh.js +1 -0
- package/dist/playground/assets/rego-C7WOd43F.js +1 -0
- package/dist/playground/assets/renpy-Cw2sUudt.js +1 -0
- package/dist/playground/assets/rest-Cgh7NBEM.js +1 -0
- package/dist/playground/assets/rip-jSJTZROD.js +1 -0
- package/dist/playground/assets/roboconf-BYj0E8kK.js +1 -0
- package/dist/playground/assets/robotframework-an9P4qf-.js +1 -0
- package/dist/playground/assets/ruby-DwY_FEeV.js +1 -0
- package/dist/playground/assets/rust-UbBPux7T.js +1 -0
- package/dist/playground/assets/sas-CpKZp1XO.js +1 -0
- package/dist/playground/assets/sass-Di0myvrI.js +1 -0
- package/dist/playground/assets/scala-DD522KEE.js +1 -0
- package/dist/playground/assets/scheme-CLoRnFGa.js +1 -0
- package/dist/playground/assets/scss-3kCwBvO_.js +1 -0
- package/dist/playground/assets/shell-session-O9zaamEX.js +1 -0
- package/dist/playground/assets/smali-B0SsT9mx.js +1 -0
- package/dist/playground/assets/smalltalk-DpCSUOht.js +1 -0
- package/dist/playground/assets/smarty-BlPQPXKY.js +1 -0
- package/dist/playground/assets/sml-BPtrIQF2.js +1 -0
- package/dist/playground/assets/solidity-gAiT6qsL.js +1 -0
- package/dist/playground/assets/solution-file-BPaMnu90.js +1 -0
- package/dist/playground/assets/soy-ClpPC9O_.js +1 -0
- package/dist/playground/assets/sparql-CFuF7SRO.js +1 -0
- package/dist/playground/assets/splunk-spl-DrSYWI0x.js +1 -0
- package/dist/playground/assets/sqf-DUZC-YP8.js +1 -0
- package/dist/playground/assets/sql-DzUQfXef.js +1 -0
- package/dist/playground/assets/squirrel-3RGzu6KZ.js +1 -0
- package/dist/playground/assets/stan-bTIDCqoU.js +1 -0
- package/dist/playground/assets/style-DIBTTqA7.css +1 -0
- package/dist/playground/assets/stylus-DaQEPH-F.js +1 -0
- package/dist/playground/assets/swift-DyyyprH4.js +1 -0
- package/dist/playground/assets/systemd-Dli6VHKs.js +2 -0
- package/dist/playground/assets/t4-cs-uq9Hnk1P.js +1 -0
- package/dist/playground/assets/t4-templating-COnjN476.js +1 -0
- package/dist/playground/assets/t4-vb-B6iGsQyc.js +1 -0
- package/dist/playground/assets/tap-Bgh-9E6G.js +1 -0
- package/dist/playground/assets/tcl-Bz2Diu7k.js +1 -0
- package/dist/playground/assets/textile-xMqgqbFX.js +1 -0
- package/dist/playground/assets/token-6GSAFR2W-SPYPLMBM-BmkRDPoJ.js +1 -0
- package/dist/playground/assets/token-util-NEHG7TUY-JRJTGTAB-C4Nnnb2R.js +1 -0
- package/dist/playground/assets/toml-CDTKDMuv.js +1 -0
- package/dist/playground/assets/tremor-Bol0PVGh.js +1 -0
- package/dist/playground/assets/tsx-CeKERMWa.js +1 -0
- package/dist/playground/assets/tt2-DHpMnqBv.js +1 -0
- package/dist/playground/assets/{vbnet-6zkgS3WB.js → turtle-CPXbBkiA.js} +1 -1
- package/dist/playground/assets/twig-DddAkTyK.js +1 -0
- package/dist/playground/assets/typescript-C-9esZRK.js +1 -0
- package/dist/playground/assets/typoscript-DGcghctd.js +1 -0
- package/dist/playground/assets/unrealscript-BRrBk3tL.js +1 -0
- package/dist/playground/assets/uorazor-DIsCqfKa.js +1 -0
- package/dist/playground/assets/uri-Bm1XT2Zr.js +1 -0
- package/dist/playground/assets/v-B0kogPWt.js +1 -0
- package/dist/playground/assets/vala-DhX19c_o.js +1 -0
- package/dist/playground/assets/vbnet-Dr3KdRcu.js +1 -0
- package/dist/playground/assets/velocity-CT9udOsZ.js +1 -0
- package/dist/playground/assets/verilog-CGX8zSpz.js +1 -0
- package/dist/playground/assets/vhdl-CZDDkU56.js +1 -0
- package/dist/playground/assets/vim-DYUFGgqB.js +1 -0
- package/dist/playground/assets/visual-basic-DK54V5Vf.js +1 -0
- package/dist/playground/assets/warpscript-C1nhZ-WG.js +1 -0
- package/dist/playground/assets/wasm-BlxFkr9X.js +1 -0
- package/dist/playground/assets/web-idl-BGi1XQqn.js +1 -0
- package/dist/playground/assets/wiki-BT2QVZJZ.js +1 -0
- package/dist/playground/assets/wolfram-DAwEvJYX.js +1 -0
- package/dist/playground/assets/wren-BIMYjvRu.js +1 -0
- package/dist/playground/assets/xeora-CwhIbmCJ.js +1 -0
- package/dist/playground/assets/xml-doc-BvKa3JAX.js +1 -0
- package/dist/playground/assets/xojo-B1iPKWXl.js +1 -0
- package/dist/playground/assets/xquery-DoaaOPxU.js +1 -0
- package/dist/playground/assets/yaml-6RAu1W9W.js +1 -0
- package/dist/playground/assets/yang-egJ1_X7Q.js +1 -0
- package/dist/playground/assets/zig-B141buGh.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 +23 -23
- 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.11",
|
|
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);
|
|
@@ -390,7 +507,6 @@ async function writeAgentSample(llmProvider, destPath, addExampleTool, addScorer
|
|
|
390
507
|
const content = `
|
|
391
508
|
import { Agent } from '@mastra/core/agent';
|
|
392
509
|
import { Memory } from '@mastra/memory';
|
|
393
|
-
import { LibSQLStore } from '@mastra/libsql';
|
|
394
510
|
${addExampleTool ? `import { weatherTool } from '../tools/weather-tool';` : ""}
|
|
395
511
|
${addScorers ? `import { scorers } from '../scorers/weather-scorer';` : ""}
|
|
396
512
|
|
|
@@ -398,7 +514,7 @@ export const weatherAgent = new Agent({
|
|
|
398
514
|
id: 'weather-agent',
|
|
399
515
|
name: 'Weather Agent',
|
|
400
516
|
instructions: \`${instructions}\`,
|
|
401
|
-
model: ${modelString},
|
|
517
|
+
model: '${modelString}',
|
|
402
518
|
${addExampleTool ? "tools: { weatherTool }," : ""}
|
|
403
519
|
${addScorers ? `scorers: {
|
|
404
520
|
toolCallAppropriateness: {
|
|
@@ -423,12 +539,7 @@ export const weatherAgent = new Agent({
|
|
|
423
539
|
},
|
|
424
540
|
},
|
|
425
541
|
},` : ""}
|
|
426
|
-
memory: new Memory(
|
|
427
|
-
storage: new LibSQLStore({
|
|
428
|
-
id: "memory-storage",
|
|
429
|
-
url: "file:../mastra.db", // path is relative to the .mastra/output directory
|
|
430
|
-
})
|
|
431
|
-
})
|
|
542
|
+
memory: new Memory()
|
|
432
543
|
});
|
|
433
544
|
`;
|
|
434
545
|
const formattedContent = await prettier.format(content, {
|
|
@@ -657,7 +768,7 @@ export const translationScorer = createScorer({
|
|
|
657
768
|
description: 'Checks that non-English location names are translated and used correctly',
|
|
658
769
|
type: 'agent',
|
|
659
770
|
judge: {
|
|
660
|
-
model: ${modelString},
|
|
771
|
+
model: '${modelString}',
|
|
661
772
|
instructions:
|
|
662
773
|
'You are an expert evaluator of translation quality for geographic locations. ' +
|
|
663
774
|
'Determine whether the user text mentions a non-English location and whether the assistant correctly uses an English translation of that location. ' +
|
|
@@ -754,7 +865,7 @@ var writeIndexFile = async ({
|
|
|
754
865
|
addScorers
|
|
755
866
|
}) => {
|
|
756
867
|
const indexPath = dirPath + "/index.ts";
|
|
757
|
-
const destPath =
|
|
868
|
+
const destPath = path3.join(indexPath);
|
|
758
869
|
try {
|
|
759
870
|
await fs4.writeFile(destPath, "");
|
|
760
871
|
const filteredExports = [
|
|
@@ -798,7 +909,7 @@ export const mastra = new Mastra({
|
|
|
798
909
|
observability: new Observability({
|
|
799
910
|
// Enables DefaultExporter and CloudExporter for tracing
|
|
800
911
|
default: { enabled: true },
|
|
801
|
-
|
|
912
|
+
}),
|
|
802
913
|
});
|
|
803
914
|
`
|
|
804
915
|
);
|
|
@@ -806,9 +917,10 @@ export const mastra = new Mastra({
|
|
|
806
917
|
throw err;
|
|
807
918
|
}
|
|
808
919
|
};
|
|
809
|
-
var checkAndInstallCoreDeps = async (addExample) => {
|
|
920
|
+
var checkAndInstallCoreDeps = async (addExample, versionTag) => {
|
|
810
921
|
const spinner4 = yoctoSpinner2({ text: "Installing Mastra core dependencies" });
|
|
811
922
|
let packages = [];
|
|
923
|
+
const mastraVersionTag = versionTag || "latest";
|
|
812
924
|
try {
|
|
813
925
|
const depService = new DepsService();
|
|
814
926
|
spinner4.start();
|
|
@@ -816,10 +928,10 @@ var checkAndInstallCoreDeps = async (addExample) => {
|
|
|
816
928
|
const needsCli = await depService.checkDependencies(["mastra"]) !== `ok`;
|
|
817
929
|
const needsZod = await depService.checkDependencies(["zod"]) !== `ok`;
|
|
818
930
|
if (needsCore) {
|
|
819
|
-
packages.push({ name: "@mastra/core", version:
|
|
931
|
+
packages.push({ name: "@mastra/core", version: mastraVersionTag });
|
|
820
932
|
}
|
|
821
933
|
if (needsCli) {
|
|
822
|
-
packages.push({ name: "mastra", version:
|
|
934
|
+
packages.push({ name: "mastra", version: mastraVersionTag });
|
|
823
935
|
}
|
|
824
936
|
if (needsZod) {
|
|
825
937
|
packages.push({ name: "zod", version: "^4" });
|
|
@@ -827,7 +939,7 @@ var checkAndInstallCoreDeps = async (addExample) => {
|
|
|
827
939
|
if (addExample) {
|
|
828
940
|
const needsLibsql = await depService.checkDependencies(["@mastra/libsql"]) !== `ok`;
|
|
829
941
|
if (needsLibsql) {
|
|
830
|
-
packages.push({ name: "@mastra/libsql", version:
|
|
942
|
+
packages.push({ name: "@mastra/libsql", version: mastraVersionTag });
|
|
831
943
|
}
|
|
832
944
|
}
|
|
833
945
|
if (packages.length > 0) {
|
|
@@ -869,7 +981,7 @@ var writeAPIKey = async ({ provider, apiKey }) => {
|
|
|
869
981
|
};
|
|
870
982
|
var createMastraDir = async (directory) => {
|
|
871
983
|
let dir = directory.trim().split("/").filter((item) => item !== "");
|
|
872
|
-
const dirPath =
|
|
984
|
+
const dirPath = path3.join(process.cwd(), ...dir, "mastra");
|
|
873
985
|
try {
|
|
874
986
|
await fs4.access(dirPath);
|
|
875
987
|
return { ok: false };
|
|
@@ -894,26 +1006,26 @@ var LLM_PROVIDERS = [
|
|
|
894
1006
|
{ value: "cerebras", label: "Cerebras" },
|
|
895
1007
|
{ value: "mistral", label: "Mistral" }
|
|
896
1008
|
];
|
|
897
|
-
var interactivePrompt = async (
|
|
898
|
-
const { skip = {}, options: { showBanner = true } = {} } =
|
|
1009
|
+
var interactivePrompt = async (args = {}) => {
|
|
1010
|
+
const { skip = {}, options: { showBanner = true } = {} } = args;
|
|
899
1011
|
if (showBanner) {
|
|
900
|
-
|
|
1012
|
+
p5.intro(color2.inverse(" Mastra Init "));
|
|
901
1013
|
}
|
|
902
|
-
const mastraProject = await
|
|
1014
|
+
const mastraProject = await p5.group(
|
|
903
1015
|
{
|
|
904
|
-
directory: () =>
|
|
1016
|
+
directory: () => p5.text({
|
|
905
1017
|
message: "Where should we create the Mastra files? (default: src/)",
|
|
906
1018
|
placeholder: "src/",
|
|
907
1019
|
defaultValue: "src/"
|
|
908
1020
|
}),
|
|
909
|
-
llmProvider: () => skip?.llmProvider ? void 0 :
|
|
1021
|
+
llmProvider: () => skip?.llmProvider ? void 0 : p5.select({
|
|
910
1022
|
message: "Select a default provider:",
|
|
911
1023
|
options: LLM_PROVIDERS
|
|
912
1024
|
}),
|
|
913
1025
|
llmApiKey: async ({ results: { llmProvider } }) => {
|
|
914
1026
|
if (skip?.llmApiKey) return void 0;
|
|
915
1027
|
const llmName = LLM_PROVIDERS.find((p6) => p6.value === llmProvider)?.label || "provider";
|
|
916
|
-
const keyChoice = await
|
|
1028
|
+
const keyChoice = await p5.select({
|
|
917
1029
|
message: `Enter your ${llmName} API key?`,
|
|
918
1030
|
options: [
|
|
919
1031
|
{ value: "skip", label: "Skip for now", hint: "default" },
|
|
@@ -922,7 +1034,7 @@ var interactivePrompt = async (args2 = {}) => {
|
|
|
922
1034
|
initialValue: "skip"
|
|
923
1035
|
});
|
|
924
1036
|
if (keyChoice === "enter") {
|
|
925
|
-
return
|
|
1037
|
+
return p5.text({
|
|
926
1038
|
message: "Enter your API key:",
|
|
927
1039
|
placeholder: "sk-...",
|
|
928
1040
|
validate: (value) => {
|
|
@@ -933,67 +1045,50 @@ var interactivePrompt = async (args2 = {}) => {
|
|
|
933
1045
|
return void 0;
|
|
934
1046
|
},
|
|
935
1047
|
configureEditorWithDocsMCP: async () => {
|
|
936
|
-
const
|
|
937
|
-
const cursorIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`cursor`);
|
|
938
|
-
const vscodeIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`vscode`);
|
|
939
|
-
const editor = await p.select({
|
|
1048
|
+
const editor = await p5.select({
|
|
940
1049
|
message: `Make your IDE into a Mastra expert? (Installs Mastra's MCP server)`,
|
|
941
1050
|
options: [
|
|
942
1051
|
{ value: "skip", label: "Skip for now", hint: "default" },
|
|
943
1052
|
{
|
|
944
1053
|
value: "cursor",
|
|
945
|
-
label: "Cursor (project only)"
|
|
946
|
-
hint: cursorIsAlreadyInstalled ? `Already installed globally` : void 0
|
|
1054
|
+
label: "Cursor (project only)"
|
|
947
1055
|
},
|
|
948
1056
|
{
|
|
949
1057
|
value: "cursor-global",
|
|
950
|
-
label: "Cursor (global, all projects)"
|
|
951
|
-
hint: cursorIsAlreadyInstalled ? `Already installed` : void 0
|
|
1058
|
+
label: "Cursor (global, all projects)"
|
|
952
1059
|
},
|
|
953
1060
|
{
|
|
954
1061
|
value: "windsurf",
|
|
955
|
-
label: "Windsurf"
|
|
956
|
-
hint: windsurfIsAlreadyInstalled ? `Already installed` : void 0
|
|
1062
|
+
label: "Windsurf"
|
|
957
1063
|
},
|
|
958
1064
|
{
|
|
959
1065
|
value: "vscode",
|
|
960
|
-
label: "VSCode"
|
|
961
|
-
hint: vscodeIsAlreadyInstalled ? `Already installed` : void 0
|
|
1066
|
+
label: "VSCode"
|
|
962
1067
|
}
|
|
963
1068
|
]
|
|
964
1069
|
});
|
|
965
1070
|
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
1071
|
if (editor === `cursor`) {
|
|
977
|
-
|
|
1072
|
+
p5.log.message(
|
|
978
1073
|
`
|
|
979
1074
|
Note: you will need to go into Cursor Settings -> MCP Settings and manually enable the installed Mastra MCP server.
|
|
980
1075
|
`
|
|
981
1076
|
);
|
|
982
1077
|
}
|
|
983
1078
|
if (editor === `cursor-global`) {
|
|
984
|
-
const
|
|
1079
|
+
const confirm3 = await p5.select({
|
|
985
1080
|
message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
|
|
986
1081
|
options: [
|
|
987
1082
|
{ value: "yes", label: "Yes, I understand" },
|
|
988
1083
|
{ value: "skip", label: "No, skip for now" }
|
|
989
1084
|
]
|
|
990
1085
|
});
|
|
991
|
-
if (
|
|
1086
|
+
if (confirm3 !== `yes`) {
|
|
992
1087
|
return void 0;
|
|
993
1088
|
}
|
|
994
1089
|
}
|
|
995
1090
|
if (editor === `windsurf`) {
|
|
996
|
-
const
|
|
1091
|
+
const confirm3 = await p5.select({
|
|
997
1092
|
message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
|
|
998
1093
|
This means the Mastra docs MCP server will be available in all your Windsurf projects.`,
|
|
999
1094
|
options: [
|
|
@@ -1001,16 +1096,23 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
1001
1096
|
{ value: "skip", label: "No, skip for now" }
|
|
1002
1097
|
]
|
|
1003
1098
|
});
|
|
1004
|
-
if (
|
|
1099
|
+
if (confirm3 !== `yes`) {
|
|
1005
1100
|
return void 0;
|
|
1006
1101
|
}
|
|
1007
1102
|
}
|
|
1008
1103
|
return editor;
|
|
1104
|
+
},
|
|
1105
|
+
initGit: async () => {
|
|
1106
|
+
if (skip?.gitInit) return false;
|
|
1107
|
+
return p5.confirm({
|
|
1108
|
+
message: "Initialize a new git repository?",
|
|
1109
|
+
initialValue: true
|
|
1110
|
+
});
|
|
1009
1111
|
}
|
|
1010
1112
|
},
|
|
1011
1113
|
{
|
|
1012
1114
|
onCancel: () => {
|
|
1013
|
-
|
|
1115
|
+
p5.cancel("Operation cancelled.");
|
|
1014
1116
|
process.exit(0);
|
|
1015
1117
|
}
|
|
1016
1118
|
}
|
|
@@ -1019,21 +1121,22 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
1019
1121
|
};
|
|
1020
1122
|
var checkForPkgJson = async () => {
|
|
1021
1123
|
const cwd = process.cwd();
|
|
1022
|
-
const pkgJsonPath =
|
|
1124
|
+
const pkgJsonPath = path3.join(cwd, "package.json");
|
|
1023
1125
|
try {
|
|
1024
1126
|
await fs4.access(pkgJsonPath);
|
|
1025
1127
|
} catch {
|
|
1026
|
-
|
|
1128
|
+
p5.log.error(
|
|
1027
1129
|
'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
1130
|
);
|
|
1029
1131
|
process.exit(1);
|
|
1030
1132
|
}
|
|
1031
1133
|
};
|
|
1032
|
-
|
|
1033
|
-
// src/commands/utils.ts
|
|
1034
1134
|
function getPackageManager() {
|
|
1035
1135
|
const userAgent = process.env.npm_config_user_agent || "";
|
|
1036
1136
|
const execPath = process.env.npm_execpath || "";
|
|
1137
|
+
if (userAgent.includes("bun")) {
|
|
1138
|
+
return "bun";
|
|
1139
|
+
}
|
|
1037
1140
|
if (userAgent.includes("yarn")) {
|
|
1038
1141
|
return "yarn";
|
|
1039
1142
|
}
|
|
@@ -1043,6 +1146,9 @@ function getPackageManager() {
|
|
|
1043
1146
|
if (userAgent.includes("npm")) {
|
|
1044
1147
|
return "npm";
|
|
1045
1148
|
}
|
|
1149
|
+
if (execPath.includes("bun")) {
|
|
1150
|
+
return "bun";
|
|
1151
|
+
}
|
|
1046
1152
|
if (execPath.includes("yarn")) {
|
|
1047
1153
|
return "yarn";
|
|
1048
1154
|
}
|
|
@@ -1073,6 +1179,44 @@ function parseLlmProvider(value) {
|
|
|
1073
1179
|
}
|
|
1074
1180
|
return value;
|
|
1075
1181
|
}
|
|
1182
|
+
function shouldSkipDotenvLoading() {
|
|
1183
|
+
return process.env.MASTRA_SKIP_DOTENV === "true" || process.env.MASTRA_SKIP_DOTENV === "1";
|
|
1184
|
+
}
|
|
1185
|
+
async function getVersionTag() {
|
|
1186
|
+
try {
|
|
1187
|
+
const pkgPath = fileURLToPath(import.meta.resolve("mastra/package.json"));
|
|
1188
|
+
const json = await fsExtra3.readJSON(pkgPath);
|
|
1189
|
+
const currentVersion = json.version;
|
|
1190
|
+
const { stdout } = await execa("npm", ["dist-tag", "ls", "mastra"]);
|
|
1191
|
+
const tagLine = stdout.split("\n").find((distLine) => distLine.endsWith(`: ${currentVersion}`));
|
|
1192
|
+
const tag = tagLine ? tagLine.split(":")[0]?.trim() : void 0;
|
|
1193
|
+
return tag;
|
|
1194
|
+
} catch {
|
|
1195
|
+
return void 0;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
async function isGitInitialized({ cwd }) {
|
|
1199
|
+
try {
|
|
1200
|
+
await execa("git", ["rev-parse", "--is-inside-work-tree"], { cwd, stdio: "ignore" });
|
|
1201
|
+
return true;
|
|
1202
|
+
} catch {
|
|
1203
|
+
return false;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
async function gitInit({ cwd }) {
|
|
1207
|
+
await execa("git", ["init"], { cwd, stdio: "ignore" });
|
|
1208
|
+
await execa("git", ["add", "-A"], { cwd, stdio: "ignore" });
|
|
1209
|
+
await execa(
|
|
1210
|
+
"git",
|
|
1211
|
+
[
|
|
1212
|
+
"commit",
|
|
1213
|
+
"-m",
|
|
1214
|
+
'"Initial commit from Mastra"',
|
|
1215
|
+
'--author="dane-ai-mastra[bot] <dane-ai-mastra[bot]@users.noreply.github.com>"'
|
|
1216
|
+
],
|
|
1217
|
+
{ cwd, stdio: "ignore" }
|
|
1218
|
+
);
|
|
1219
|
+
}
|
|
1076
1220
|
var logger = createLogger(false);
|
|
1077
1221
|
function createLogger(debug = false) {
|
|
1078
1222
|
return new PinoLogger({
|
|
@@ -1084,19 +1228,23 @@ function createLogger(debug = false) {
|
|
|
1084
1228
|
// src/utils/clone-template.ts
|
|
1085
1229
|
var exec2 = util.promisify(child_process.exec);
|
|
1086
1230
|
async function cloneTemplate(options) {
|
|
1087
|
-
const { template, projectName, targetDir } = options;
|
|
1088
|
-
const projectPath = targetDir ?
|
|
1231
|
+
const { template, projectName, targetDir, branch, llmProvider } = options;
|
|
1232
|
+
const projectPath = targetDir ? path3.resolve(targetDir, projectName) : path3.resolve(projectName);
|
|
1089
1233
|
const spinner4 = yoctoSpinner2({ text: `Cloning template "${template.title}"...` }).start();
|
|
1090
1234
|
try {
|
|
1091
1235
|
if (await directoryExists(projectPath)) {
|
|
1092
1236
|
spinner4.error(`Directory ${projectName} already exists`);
|
|
1093
1237
|
throw new Error(`Directory ${projectName} already exists`);
|
|
1094
1238
|
}
|
|
1095
|
-
await cloneRepositoryWithoutGit(template.githubUrl, projectPath);
|
|
1239
|
+
await cloneRepositoryWithoutGit(template.githubUrl, projectPath, branch);
|
|
1096
1240
|
await updatePackageJson(projectPath, projectName);
|
|
1097
|
-
const envExamplePath =
|
|
1241
|
+
const envExamplePath = path3.join(projectPath, ".env.example");
|
|
1098
1242
|
if (await fileExists(envExamplePath)) {
|
|
1099
|
-
|
|
1243
|
+
const envPath = path3.join(projectPath, ".env");
|
|
1244
|
+
await fs4.copyFile(envExamplePath, envPath);
|
|
1245
|
+
if (llmProvider) {
|
|
1246
|
+
await updateEnvFile(envPath, llmProvider);
|
|
1247
|
+
}
|
|
1100
1248
|
}
|
|
1101
1249
|
spinner4.success(`Template "${template.title}" cloned successfully to ${projectName}`);
|
|
1102
1250
|
return projectPath;
|
|
@@ -1121,21 +1269,27 @@ async function fileExists(filePath) {
|
|
|
1121
1269
|
return false;
|
|
1122
1270
|
}
|
|
1123
1271
|
}
|
|
1124
|
-
async function cloneRepositoryWithoutGit(repoUrl, targetPath) {
|
|
1272
|
+
async function cloneRepositoryWithoutGit(repoUrl, targetPath, branch) {
|
|
1125
1273
|
await fs4.mkdir(targetPath, { recursive: true });
|
|
1126
1274
|
try {
|
|
1127
1275
|
const degitRepo = repoUrl.replace("https://github.com/", "");
|
|
1128
|
-
const
|
|
1276
|
+
const degitRepoWithBranch = branch ? `${degitRepo}#${branch}` : degitRepo;
|
|
1277
|
+
const degitCommand = shellQuote2.quote(["npx", "degit", degitRepoWithBranch, targetPath]);
|
|
1129
1278
|
await exec2(degitCommand, {
|
|
1130
1279
|
cwd: process.cwd()
|
|
1131
1280
|
});
|
|
1132
1281
|
} catch {
|
|
1133
1282
|
try {
|
|
1134
|
-
const
|
|
1283
|
+
const gitArgs = ["git", "clone"];
|
|
1284
|
+
if (branch) {
|
|
1285
|
+
gitArgs.push("--branch", branch);
|
|
1286
|
+
}
|
|
1287
|
+
gitArgs.push(repoUrl, targetPath);
|
|
1288
|
+
const gitCommand = shellQuote2.quote(gitArgs);
|
|
1135
1289
|
await exec2(gitCommand, {
|
|
1136
1290
|
cwd: process.cwd()
|
|
1137
1291
|
});
|
|
1138
|
-
const gitDir =
|
|
1292
|
+
const gitDir = path3.join(targetPath, ".git");
|
|
1139
1293
|
if (await directoryExists(gitDir)) {
|
|
1140
1294
|
await fs4.rm(gitDir, { recursive: true, force: true });
|
|
1141
1295
|
}
|
|
@@ -1145,7 +1299,7 @@ async function cloneRepositoryWithoutGit(repoUrl, targetPath) {
|
|
|
1145
1299
|
}
|
|
1146
1300
|
}
|
|
1147
1301
|
async function updatePackageJson(projectPath, projectName) {
|
|
1148
|
-
const packageJsonPath =
|
|
1302
|
+
const packageJsonPath = path3.join(projectPath, "package.json");
|
|
1149
1303
|
try {
|
|
1150
1304
|
const packageJsonContent = await fs4.readFile(packageJsonPath, "utf-8");
|
|
1151
1305
|
const packageJson = JSON.parse(packageJsonContent);
|
|
@@ -1155,6 +1309,22 @@ async function updatePackageJson(projectPath, projectName) {
|
|
|
1155
1309
|
logger.warn(`Could not update package.json: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1156
1310
|
}
|
|
1157
1311
|
}
|
|
1312
|
+
async function updateEnvFile(envPath, llmProvider) {
|
|
1313
|
+
try {
|
|
1314
|
+
const envContent = await fs4.readFile(envPath, "utf-8");
|
|
1315
|
+
const modelString = getModelIdentifier(llmProvider);
|
|
1316
|
+
if (!modelString) {
|
|
1317
|
+
logger.warn(`Could not get model identifier for provider: ${llmProvider}`);
|
|
1318
|
+
return;
|
|
1319
|
+
}
|
|
1320
|
+
const modelValue = modelString.replace(/'/g, "");
|
|
1321
|
+
const updatedContent = envContent.replace(/^MODEL=.*/m, `MODEL=${modelValue}`);
|
|
1322
|
+
await fs4.writeFile(envPath, updatedContent, "utf-8");
|
|
1323
|
+
logger.info(`Updated MODEL in .env to ${modelValue}`);
|
|
1324
|
+
} catch (error) {
|
|
1325
|
+
logger.warn(`Could not update .env file: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1158
1328
|
async function installDependencies(projectPath, packageManager) {
|
|
1159
1329
|
const spinner4 = yoctoSpinner2({ text: "Installing dependencies..." }).start();
|
|
1160
1330
|
try {
|
|
@@ -1210,11 +1380,11 @@ async function selectTemplate(templates) {
|
|
|
1210
1380
|
hint: parts.join(", ") || "Template components"
|
|
1211
1381
|
};
|
|
1212
1382
|
});
|
|
1213
|
-
const selected = await
|
|
1383
|
+
const selected = await p5.select({
|
|
1214
1384
|
message: "Select a template:",
|
|
1215
1385
|
options: choices
|
|
1216
1386
|
});
|
|
1217
|
-
if (
|
|
1387
|
+
if (p5.isCancel(selected)) {
|
|
1218
1388
|
return null;
|
|
1219
1389
|
}
|
|
1220
1390
|
return selected;
|
|
@@ -1232,7 +1402,7 @@ function findTemplateByName(templates, templateName) {
|
|
|
1232
1402
|
function getDefaultProjectName(template) {
|
|
1233
1403
|
return template.slug.replace(/^template-/, "");
|
|
1234
1404
|
}
|
|
1235
|
-
var s =
|
|
1405
|
+
var s = p5.spinner();
|
|
1236
1406
|
var init = async ({
|
|
1237
1407
|
directory = "src/",
|
|
1238
1408
|
components,
|
|
@@ -1240,7 +1410,8 @@ var init = async ({
|
|
|
1240
1410
|
llmApiKey,
|
|
1241
1411
|
addExample = false,
|
|
1242
1412
|
configureEditorWithDocsMCP,
|
|
1243
|
-
versionTag
|
|
1413
|
+
versionTag,
|
|
1414
|
+
initGit = false
|
|
1244
1415
|
}) => {
|
|
1245
1416
|
s.start("Initializing Mastra");
|
|
1246
1417
|
const packageVersionTag = versionTag ? `@${versionTag}` : "";
|
|
@@ -1294,19 +1465,30 @@ var init = async ({
|
|
|
1294
1465
|
if (configureEditorWithDocsMCP) {
|
|
1295
1466
|
await installMastraDocsMCPServer({
|
|
1296
1467
|
editor: configureEditorWithDocsMCP,
|
|
1297
|
-
directory: process.cwd()
|
|
1468
|
+
directory: process.cwd(),
|
|
1469
|
+
versionTag
|
|
1298
1470
|
});
|
|
1299
1471
|
}
|
|
1300
1472
|
s.stop();
|
|
1473
|
+
if (initGit) {
|
|
1474
|
+
const s2 = p5.spinner();
|
|
1475
|
+
try {
|
|
1476
|
+
s2.start("Initializing git repository");
|
|
1477
|
+
await gitInit({ cwd: process.cwd() });
|
|
1478
|
+
s2.stop("Git repository initialized");
|
|
1479
|
+
} catch {
|
|
1480
|
+
s2.stop();
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1301
1483
|
if (!llmApiKey) {
|
|
1302
|
-
|
|
1484
|
+
p5.note(`
|
|
1303
1485
|
${color2.green("Mastra initialized successfully!")}
|
|
1304
1486
|
|
|
1305
1487
|
Add your ${color2.cyan(key)} as an environment variable
|
|
1306
1488
|
in your ${color2.cyan(".env")} file
|
|
1307
1489
|
`);
|
|
1308
1490
|
} else {
|
|
1309
|
-
|
|
1491
|
+
p5.note(`
|
|
1310
1492
|
${color2.green("Mastra initialized successfully!")}
|
|
1311
1493
|
`);
|
|
1312
1494
|
}
|
|
@@ -1343,6 +1525,32 @@ var execWithTimeout = async (command, timeoutMs) => {
|
|
|
1343
1525
|
throw error;
|
|
1344
1526
|
}
|
|
1345
1527
|
};
|
|
1528
|
+
async function getInitCommand(pm) {
|
|
1529
|
+
switch (pm) {
|
|
1530
|
+
case "npm":
|
|
1531
|
+
return "npm init -y";
|
|
1532
|
+
case "pnpm":
|
|
1533
|
+
return "pnpm init";
|
|
1534
|
+
case "yarn":
|
|
1535
|
+
return "yarn init -y";
|
|
1536
|
+
case "bun":
|
|
1537
|
+
return "bun init -y";
|
|
1538
|
+
default:
|
|
1539
|
+
return "npm init -y";
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
async function initializePackageJson(pm) {
|
|
1543
|
+
const initCommand = await getInitCommand(pm);
|
|
1544
|
+
await exec3(initCommand);
|
|
1545
|
+
const packageJsonPath = path3.join(process.cwd(), "package.json");
|
|
1546
|
+
const packageJson = JSON.parse(await fs4.readFile(packageJsonPath, "utf-8"));
|
|
1547
|
+
packageJson.type = "module";
|
|
1548
|
+
packageJson.engines = {
|
|
1549
|
+
...packageJson.engines,
|
|
1550
|
+
node: ">=22.13.0"
|
|
1551
|
+
};
|
|
1552
|
+
await fs4.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
1553
|
+
}
|
|
1346
1554
|
async function installMastraDependency(pm, dependency, versionTag, isDev, timeout) {
|
|
1347
1555
|
let installCommand = getPackageManagerAddCommand(pm);
|
|
1348
1556
|
if (isDev) {
|
|
@@ -1373,8 +1581,8 @@ var createMastraProject = async ({
|
|
|
1373
1581
|
llmApiKey,
|
|
1374
1582
|
needsInteractive
|
|
1375
1583
|
}) => {
|
|
1376
|
-
|
|
1377
|
-
const projectName = name ?? await
|
|
1584
|
+
p5.intro(color2.inverse(" Mastra Create "));
|
|
1585
|
+
const projectName = name ?? await p5.text({
|
|
1378
1586
|
message: "What do you want to name your project?",
|
|
1379
1587
|
placeholder: "my-mastra-app",
|
|
1380
1588
|
defaultValue: "my-mastra-app",
|
|
@@ -1385,22 +1593,25 @@ var createMastraProject = async ({
|
|
|
1385
1593
|
}
|
|
1386
1594
|
}
|
|
1387
1595
|
});
|
|
1388
|
-
if (
|
|
1389
|
-
|
|
1596
|
+
if (p5.isCancel(projectName)) {
|
|
1597
|
+
p5.cancel("Operation cancelled");
|
|
1390
1598
|
process.exit(0);
|
|
1391
1599
|
}
|
|
1392
|
-
let result;
|
|
1600
|
+
let result = void 0;
|
|
1393
1601
|
if (needsInteractive) {
|
|
1394
1602
|
result = await interactivePrompt({
|
|
1395
1603
|
options: { showBanner: false },
|
|
1396
1604
|
skip: { llmProvider: llmProvider !== void 0, llmApiKey: llmApiKey !== void 0 }
|
|
1397
1605
|
});
|
|
1398
1606
|
}
|
|
1399
|
-
const s2 =
|
|
1607
|
+
const s2 = p5.spinner();
|
|
1608
|
+
const originalCwd = process.cwd();
|
|
1609
|
+
let projectPath = null;
|
|
1400
1610
|
try {
|
|
1401
1611
|
s2.start("Creating project");
|
|
1402
1612
|
try {
|
|
1403
1613
|
await fs4.mkdir(projectName);
|
|
1614
|
+
projectPath = path3.resolve(originalCwd, projectName);
|
|
1404
1615
|
} catch (error) {
|
|
1405
1616
|
if (error instanceof Error && "code" in error && error.code === "EEXIST") {
|
|
1406
1617
|
s2.stop(`A directory named "${projectName}" already exists. Please choose a different name.`);
|
|
@@ -1415,9 +1626,7 @@ var createMastraProject = async ({
|
|
|
1415
1626
|
const installCommand = getPackageManagerAddCommand(pm);
|
|
1416
1627
|
s2.message("Initializing project structure");
|
|
1417
1628
|
try {
|
|
1418
|
-
await
|
|
1419
|
-
await exec3(`npm pkg set type="module"`);
|
|
1420
|
-
await exec3(`npm pkg set engines.node=">=20.9.0"`);
|
|
1629
|
+
await initializePackageJson(pm);
|
|
1421
1630
|
const depsService = new DepsService();
|
|
1422
1631
|
await depsService.addScriptsToPackageJson({
|
|
1423
1632
|
dev: "mastra dev",
|
|
@@ -1489,33 +1698,50 @@ var createMastraProject = async ({
|
|
|
1489
1698
|
throw new Error(`Failed to create .gitignore: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1490
1699
|
}
|
|
1491
1700
|
s2.stop(".gitignore added");
|
|
1492
|
-
|
|
1701
|
+
p5.outro("Project created successfully");
|
|
1493
1702
|
console.info("");
|
|
1494
1703
|
return { projectName, result };
|
|
1495
1704
|
} catch (error) {
|
|
1496
1705
|
s2.stop();
|
|
1497
1706
|
const errorMessage = error instanceof Error ? error.message : "An unexpected error occurred";
|
|
1498
|
-
|
|
1707
|
+
p5.cancel(`Project creation failed: ${errorMessage}`);
|
|
1708
|
+
if (projectPath && fs3__default.existsSync(projectPath)) {
|
|
1709
|
+
try {
|
|
1710
|
+
process.chdir(originalCwd);
|
|
1711
|
+
await fs4.rm(projectPath, { recursive: true, force: true });
|
|
1712
|
+
} catch (cleanupError) {
|
|
1713
|
+
console.error(
|
|
1714
|
+
`Warning: Failed to clean up project directory: ${cleanupError instanceof Error ? cleanupError.message : "Unknown error"}`
|
|
1715
|
+
);
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1499
1718
|
process.exit(1);
|
|
1500
1719
|
}
|
|
1501
1720
|
};
|
|
1502
1721
|
|
|
1503
1722
|
// src/commands/create/create.ts
|
|
1504
|
-
var
|
|
1505
|
-
|
|
1506
|
-
|
|
1723
|
+
var version = package_default.version;
|
|
1724
|
+
var create = async (args) => {
|
|
1725
|
+
if (args.template !== void 0) {
|
|
1726
|
+
await createFromTemplate({
|
|
1727
|
+
projectName: args.projectName,
|
|
1728
|
+
template: args.template,
|
|
1729
|
+
timeout: args.timeout,
|
|
1730
|
+
injectedAnalytics: args.analytics,
|
|
1731
|
+
llmProvider: args.llmProvider
|
|
1732
|
+
});
|
|
1507
1733
|
return;
|
|
1508
1734
|
}
|
|
1509
|
-
const needsInteractive =
|
|
1735
|
+
const needsInteractive = args.components === void 0 || args.llmProvider === void 0 || args.addExample === void 0;
|
|
1510
1736
|
const { projectName, result } = await createMastraProject({
|
|
1511
|
-
projectName:
|
|
1512
|
-
createVersionTag:
|
|
1513
|
-
timeout:
|
|
1514
|
-
llmProvider:
|
|
1515
|
-
llmApiKey:
|
|
1737
|
+
projectName: args?.projectName,
|
|
1738
|
+
createVersionTag: args?.createVersionTag,
|
|
1739
|
+
timeout: args?.timeout,
|
|
1740
|
+
llmProvider: args?.llmProvider,
|
|
1741
|
+
llmApiKey: args?.llmApiKey,
|
|
1516
1742
|
needsInteractive
|
|
1517
1743
|
});
|
|
1518
|
-
const directory =
|
|
1744
|
+
const directory = args.directory || "src/";
|
|
1519
1745
|
if (needsInteractive && result) {
|
|
1520
1746
|
const analytics2 = getAnalytics();
|
|
1521
1747
|
if (analytics2 && result?.llmProvider) {
|
|
@@ -1529,12 +1755,12 @@ var create = async (args2) => {
|
|
|
1529
1755
|
llmApiKey: result?.llmApiKey,
|
|
1530
1756
|
components: ["agents", "tools", "workflows", "scorers"],
|
|
1531
1757
|
addExample: true,
|
|
1532
|
-
versionTag:
|
|
1758
|
+
versionTag: args.createVersionTag
|
|
1533
1759
|
});
|
|
1534
1760
|
postCreate({ projectName });
|
|
1535
1761
|
return;
|
|
1536
1762
|
}
|
|
1537
|
-
const { components = [], llmProvider = "openai", addExample = false, llmApiKey } =
|
|
1763
|
+
const { components = [], llmProvider = "openai", addExample = false, llmApiKey } = args;
|
|
1538
1764
|
const analytics = getAnalytics();
|
|
1539
1765
|
if (analytics) {
|
|
1540
1766
|
analytics.trackEvent("cli_model_provider_selected", {
|
|
@@ -1548,14 +1774,14 @@ var create = async (args2) => {
|
|
|
1548
1774
|
llmProvider,
|
|
1549
1775
|
addExample,
|
|
1550
1776
|
llmApiKey,
|
|
1551
|
-
configureEditorWithDocsMCP:
|
|
1552
|
-
versionTag:
|
|
1777
|
+
configureEditorWithDocsMCP: args.mcpServer,
|
|
1778
|
+
versionTag: args.createVersionTag
|
|
1553
1779
|
});
|
|
1554
1780
|
postCreate({ projectName });
|
|
1555
1781
|
};
|
|
1556
1782
|
var postCreate = ({ projectName }) => {
|
|
1557
1783
|
const packageManager = getPackageManager();
|
|
1558
|
-
|
|
1784
|
+
p5.outro(`
|
|
1559
1785
|
${color2.green("To start your project:")}
|
|
1560
1786
|
|
|
1561
1787
|
${color2.cyan("cd")} ${projectName}
|
|
@@ -1640,36 +1866,36 @@ async function createFromGitHubUrl(url) {
|
|
|
1640
1866
|
workflows: []
|
|
1641
1867
|
};
|
|
1642
1868
|
}
|
|
1643
|
-
async function createFromTemplate(
|
|
1869
|
+
async function createFromTemplate(args) {
|
|
1644
1870
|
let selectedTemplate;
|
|
1645
|
-
if (
|
|
1871
|
+
if (args.template === true) {
|
|
1646
1872
|
const templates = await loadTemplates();
|
|
1647
1873
|
const selected = await selectTemplate(templates);
|
|
1648
1874
|
if (!selected) {
|
|
1649
|
-
|
|
1875
|
+
p5.log.info("No template selected. Exiting.");
|
|
1650
1876
|
return;
|
|
1651
1877
|
}
|
|
1652
1878
|
selectedTemplate = selected;
|
|
1653
|
-
} else if (
|
|
1654
|
-
if (isGitHubUrl(
|
|
1655
|
-
const spinner4 =
|
|
1879
|
+
} else if (args.template && typeof args.template === "string") {
|
|
1880
|
+
if (isGitHubUrl(args.template)) {
|
|
1881
|
+
const spinner4 = p5.spinner();
|
|
1656
1882
|
spinner4.start("Validating GitHub repository...");
|
|
1657
|
-
const validation = await validateGitHubProject(
|
|
1883
|
+
const validation = await validateGitHubProject(args.template);
|
|
1658
1884
|
if (!validation.isValid) {
|
|
1659
1885
|
spinner4.stop("Validation failed");
|
|
1660
|
-
|
|
1661
|
-
validation.errors.forEach((error) =>
|
|
1886
|
+
p5.log.error("This does not appear to be a valid Mastra project:");
|
|
1887
|
+
validation.errors.forEach((error) => p5.log.error(` - ${error}`));
|
|
1662
1888
|
throw new Error("Invalid Mastra project");
|
|
1663
1889
|
}
|
|
1664
1890
|
spinner4.stop("Valid Mastra project \u2713");
|
|
1665
|
-
selectedTemplate = await createFromGitHubUrl(
|
|
1891
|
+
selectedTemplate = await createFromGitHubUrl(args.template);
|
|
1666
1892
|
} else {
|
|
1667
1893
|
const templates = await loadTemplates();
|
|
1668
|
-
const found = findTemplateByName(templates,
|
|
1894
|
+
const found = findTemplateByName(templates, args.template);
|
|
1669
1895
|
if (!found) {
|
|
1670
|
-
|
|
1671
|
-
templates.forEach((t) =>
|
|
1672
|
-
throw new Error(`Template "${
|
|
1896
|
+
p5.log.error(`Template "${args.template}" not found. Available templates:`);
|
|
1897
|
+
templates.forEach((t) => p5.log.info(` - ${t.title} (use: ${t.slug.replace("template-", "")})`));
|
|
1898
|
+
throw new Error(`Template "${args.template}" not found`);
|
|
1673
1899
|
}
|
|
1674
1900
|
selectedTemplate = found;
|
|
1675
1901
|
}
|
|
@@ -1677,34 +1903,76 @@ async function createFromTemplate(args2) {
|
|
|
1677
1903
|
if (!selectedTemplate) {
|
|
1678
1904
|
throw new Error("No template selected");
|
|
1679
1905
|
}
|
|
1680
|
-
let projectName =
|
|
1906
|
+
let projectName = args.projectName;
|
|
1681
1907
|
if (!projectName) {
|
|
1682
1908
|
const defaultName = getDefaultProjectName(selectedTemplate);
|
|
1683
|
-
const response = await
|
|
1909
|
+
const response = await p5.text({
|
|
1684
1910
|
message: "What is your project name?",
|
|
1685
1911
|
defaultValue: defaultName,
|
|
1686
1912
|
placeholder: defaultName
|
|
1687
1913
|
});
|
|
1688
|
-
if (
|
|
1689
|
-
|
|
1914
|
+
if (p5.isCancel(response)) {
|
|
1915
|
+
p5.log.info("Project creation cancelled.");
|
|
1690
1916
|
return;
|
|
1691
1917
|
}
|
|
1692
1918
|
projectName = response;
|
|
1693
1919
|
}
|
|
1920
|
+
let llmProvider = args.llmProvider;
|
|
1921
|
+
if (!llmProvider) {
|
|
1922
|
+
const providerResponse = await p5.select({
|
|
1923
|
+
message: "Select a default provider:",
|
|
1924
|
+
options: LLM_PROVIDERS
|
|
1925
|
+
});
|
|
1926
|
+
if (p5.isCancel(providerResponse)) {
|
|
1927
|
+
p5.log.info("Project creation cancelled.");
|
|
1928
|
+
return;
|
|
1929
|
+
}
|
|
1930
|
+
llmProvider = providerResponse;
|
|
1931
|
+
}
|
|
1932
|
+
let initGit = false;
|
|
1933
|
+
const gitConfirmResult = await p5.confirm({
|
|
1934
|
+
message: "Initialize a new git repository?",
|
|
1935
|
+
initialValue: true
|
|
1936
|
+
});
|
|
1937
|
+
if (!p5.isCancel(gitConfirmResult)) {
|
|
1938
|
+
initGit = gitConfirmResult;
|
|
1939
|
+
}
|
|
1940
|
+
let projectPath = null;
|
|
1694
1941
|
try {
|
|
1695
|
-
const analytics =
|
|
1942
|
+
const analytics = args.injectedAnalytics || getAnalytics();
|
|
1696
1943
|
if (analytics) {
|
|
1697
1944
|
analytics.trackEvent("cli_template_used", {
|
|
1698
1945
|
template_slug: selectedTemplate.slug,
|
|
1699
1946
|
template_title: selectedTemplate.title
|
|
1700
1947
|
});
|
|
1948
|
+
if (llmProvider) {
|
|
1949
|
+
analytics.trackEvent("cli_model_provider_selected", {
|
|
1950
|
+
provider: llmProvider,
|
|
1951
|
+
selection_method: args.llmProvider ? "cli_args" : "interactive"
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1701
1954
|
}
|
|
1702
|
-
const
|
|
1955
|
+
const isBeta = version?.includes("beta") ?? false;
|
|
1956
|
+
const isMastraTemplate = selectedTemplate.githubUrl.includes("github.com/mastra-ai/");
|
|
1957
|
+
const branch = isBeta && isMastraTemplate ? "beta" : void 0;
|
|
1958
|
+
projectPath = await cloneTemplate({
|
|
1703
1959
|
template: selectedTemplate,
|
|
1704
|
-
projectName
|
|
1960
|
+
projectName,
|
|
1961
|
+
branch,
|
|
1962
|
+
llmProvider
|
|
1705
1963
|
});
|
|
1706
1964
|
await installDependencies(projectPath);
|
|
1707
|
-
|
|
1965
|
+
if (initGit) {
|
|
1966
|
+
const s2 = p5.spinner();
|
|
1967
|
+
try {
|
|
1968
|
+
s2.start("Initializing git repository");
|
|
1969
|
+
await gitInit({ cwd: projectPath });
|
|
1970
|
+
s2.stop("Git repository initialized");
|
|
1971
|
+
} catch {
|
|
1972
|
+
s2.stop();
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
p5.note(`
|
|
1708
1976
|
${color2.green("Mastra template installed!")}
|
|
1709
1977
|
|
|
1710
1978
|
Add the necessary environment
|
|
@@ -1712,11 +1980,22 @@ async function createFromTemplate(args2) {
|
|
|
1712
1980
|
`);
|
|
1713
1981
|
postCreate({ projectName });
|
|
1714
1982
|
} catch (error) {
|
|
1715
|
-
|
|
1983
|
+
if (projectPath) {
|
|
1984
|
+
try {
|
|
1985
|
+
if (fs3__default.existsSync(projectPath)) {
|
|
1986
|
+
await fs4.rm(projectPath, { recursive: true, force: true });
|
|
1987
|
+
}
|
|
1988
|
+
} catch (cleanupError) {
|
|
1989
|
+
console.error(
|
|
1990
|
+
`Warning: Failed to clean up project directory: ${cleanupError instanceof Error ? cleanupError.message : "Unknown error"}`
|
|
1991
|
+
);
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
p5.log.error(`Failed to create project from template: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
1716
1995
|
throw error;
|
|
1717
1996
|
}
|
|
1718
1997
|
}
|
|
1719
1998
|
|
|
1720
|
-
export { COMPONENTS, DepsService, FileService, LLMProvider, checkAndInstallCoreDeps, checkForPkgJson, create, createLogger, init, interactivePrompt, logger, parseComponents, parseLlmProvider, parseMcp };
|
|
1721
|
-
//# sourceMappingURL=chunk-
|
|
1722
|
-
//# sourceMappingURL=chunk-
|
|
1999
|
+
export { COMPONENTS, DepsService, FileService, LLMProvider, checkAndInstallCoreDeps, checkForPkgJson, create, createLogger, getVersionTag, init, interactivePrompt, isGitInitialized, logger, package_default, parseComponents, parseLlmProvider, parseMcp, shouldSkipDotenvLoading };
|
|
2000
|
+
//# sourceMappingURL=chunk-7KQSE34M.js.map
|
|
2001
|
+
//# sourceMappingURL=chunk-7KQSE34M.js.map
|