create-mastra 1.0.0-beta.3 → 1.0.0-beta.5
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 +14 -0
- package/dist/index.js +63 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# create-mastra
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix discriminatedUnion schema information lost when json schema is converted to zod ([#10500](https://github.com/mastra-ai/mastra/pull/10500))
|
|
8
|
+
|
|
9
|
+
- Hide time travel on map steps in Studio ([#10631](https://github.com/mastra-ai/mastra/pull/10631))
|
|
10
|
+
|
|
11
|
+
## 1.0.0-beta.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Add timeTravel APIs and add timeTravel feature to studio ([#10361](https://github.com/mastra-ai/mastra/pull/10361))
|
|
16
|
+
|
|
3
17
|
## 1.0.0-beta.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -382,7 +382,7 @@ function DD({onlyFirst:e=false}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:
|
|
|
382
382
|
`).length-1;this.output.write(srcExports.cursor.move(-999,u*-1));}render(){const u=Y$1(this._render(this)??"",process.stdout.columns,{hard:true});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(srcExports.cursor.hide);else {const t=BD(this._prevFrame,u);if(this.restoreCursor(),t&&t?.length===1){const F=t[0];this.output.write(srcExports.cursor.move(0,F)),this.output.write(srcExports.erase.lines(1));const s=u.split(`
|
|
383
383
|
`);this.output.write(s[F]),this._prevFrame=u,this.output.write(srcExports.cursor.move(0,s.length-F-1));return}if(t&&t?.length>1){const F=t[0];this.output.write(srcExports.cursor.move(0,F)),this.output.write(srcExports.erase.down());const s=u.split(`
|
|
384
384
|
`).slice(F);this.output.write(s.join(`
|
|
385
|
-
`)),this._prevFrame=u;return}this.output.write(srcExports.erase.down());}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u;}}}var OD=Object.defineProperty,PD=(e,u,t)=>u in e?OD(e,u,{enumerable:true,configurable:true,writable:true,value:t}):e[u]=t,J=(e,u,t)=>(PD(e,typeof u!="symbol"?u+"":u,t),t);class LD extends x{constructor(u){super(u,false),J(this,"options"),J(this,"cursor",0),this.options=u.options,this.cursor=this.options.findIndex(({value:t})=>t===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){case "left":case "up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case "down":case "right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue();});}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value;}}class RD extends x{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return `${this.value}\u2588`;const u=this.value.slice(0,this.cursor),[t,...F]=this.value.slice(this.cursor);return `${u}${color2.inverse(t)}${F.join("")}`}get cursor(){return this._cursor}constructor(u){super(u),this.on("finalize",()=>{this.value||(this.value=u.defaultValue);});}}
|
|
385
|
+
`)),this._prevFrame=u;return}this.output.write(srcExports.erase.down());}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u;}}}class dD extends x{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,false),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value;}),this.on("confirm",t=>{this.output.write(srcExports.cursor.move(0,-1)),this.value=t,this.state="submit",this.close();}),this.on("cursor",()=>{this.value=!this.value;});}}var OD=Object.defineProperty,PD=(e,u,t)=>u in e?OD(e,u,{enumerable:true,configurable:true,writable:true,value:t}):e[u]=t,J=(e,u,t)=>(PD(e,typeof u!="symbol"?u+"":u,t),t);class LD extends x{constructor(u){super(u,false),J(this,"options"),J(this,"cursor",0),this.options=u.options,this.cursor=this.options.findIndex(({value:t})=>t===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){case "left":case "up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case "down":case "right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue();});}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value;}}class RD extends x{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return `${this.value}\u2588`;const u=this.value.slice(0,this.cursor),[t,...F]=this.value.slice(this.cursor);return `${u}${color2.inverse(t)}${F.join("")}`}get cursor(){return this._cursor}constructor(u){super(u),this.on("finalize",()=>{this.value||(this.value=u.defaultValue);});}}
|
|
386
386
|
|
|
387
387
|
function ce(){return y$1.platform!=="win32"?y$1.env.TERM!=="linux":!!y$1.env.CI||!!y$1.env.WT_SESSION||!!y$1.env.TERMINUS_SUBLIME||y$1.env.ConEmuTask==="{cmd::Cmder}"||y$1.env.TERM_PROGRAM==="Terminus-Sublime"||y$1.env.TERM_PROGRAM==="vscode"||y$1.env.TERM==="xterm-256color"||y$1.env.TERM==="alacritty"||y$1.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const V=ce(),u=(t,n)=>V?t:n,le=u("\u25C6","*"),L=u("\u25A0","x"),W=u("\u25B2","x"),C=u("\u25C7","o"),ue=u("\u250C","T"),o=u("\u2502","|"),d=u("\u2514","\u2014"),k=u("\u25CF",">"),P=u("\u25CB"," "),_=u("\u2500","-"),me=u("\u256E","+"),de=u("\u251C","+"),pe=u("\u256F","+"),q=u("\u25CF","\u2022"),D=u("\u25C6","*"),U=u("\u25B2","!"),K=u("\u25A0","x"),b=t=>{switch(t){case "initial":case "active":return color2.cyan(le);case "cancel":return color2.red(L);case "error":return color2.yellow(W);case "submit":return color2.green(C)}},G=t=>{const{cursor:n,options:r,style:i}=t,s=t.maxItems??Number.POSITIVE_INFINITY,c=Math.max(process.stdout.rows-4,0),a=Math.min(c,Math.max(s,5));let l=0;n>=l+a-3?l=Math.max(Math.min(n-a+3,r.length-a),0):n<l+2&&(l=Math.max(n-2,0));const $=a<r.length&&l>0,g=a<r.length&&l+a<r.length;return r.slice(l,l+a).map((p,v,f)=>{const j=v===0&&$,E=v===f.length-1&&g;return j||E?color2.dim("..."):i(p,v+l===n)})},he=t=>new RD({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const n=`${color2.gray(o)}
|
|
388
388
|
${b(this.state)} ${t.message}
|
|
@@ -392,7 +392,12 @@ ${color2.yellow(d)} ${color2.yellow(this.error)}
|
|
|
392
392
|
`;case "submit":return `${n}${color2.gray(o)} ${color2.dim(this.value||t.placeholder)}`;case "cancel":return `${n}${color2.gray(o)} ${color2.strikethrough(color2.dim(this.value??""))}${this.value?.trim()?`
|
|
393
393
|
${color2.gray(o)}`:""}`;default:return `${n}${color2.cyan(o)} ${i}
|
|
394
394
|
${color2.cyan(d)}
|
|
395
|
-
`}}}).prompt(),
|
|
395
|
+
`}}}).prompt(),ye=t=>{const n=t.active??"Yes",r=t.inactive??"No";return new dD({active:n,inactive:r,initialValue:t.initialValue??true,render(){const i=`${color2.gray(o)}
|
|
396
|
+
${b(this.state)} ${t.message}
|
|
397
|
+
`,s=this.value?n:r;switch(this.state){case "submit":return `${i}${color2.gray(o)} ${color2.dim(s)}`;case "cancel":return `${i}${color2.gray(o)} ${color2.strikethrough(color2.dim(s))}
|
|
398
|
+
${color2.gray(o)}`;default:return `${i}${color2.cyan(o)} ${this.value?`${color2.green(k)} ${n}`:`${color2.dim(P)} ${color2.dim(n)}`} ${color2.dim("/")} ${this.value?`${color2.dim(P)} ${color2.dim(r)}`:`${color2.green(k)} ${r}`}
|
|
399
|
+
${color2.cyan(d)}
|
|
400
|
+
`}}}).prompt()},ve=t=>{const n=(r,i)=>{const s=r.label??String(r.value);switch(i){case "selected":return `${color2.dim(s)}`;case "active":return `${color2.green(k)} ${s} ${r.hint?color2.dim(`(${r.hint})`):""}`;case "cancelled":return `${color2.strikethrough(color2.dim(s))}`;default:return `${color2.dim(P)} ${color2.dim(s)}`}};return new LD({options:t.options,initialValue:t.initialValue,render(){const r=`${color2.gray(o)}
|
|
396
401
|
${b(this.state)} ${t.message}
|
|
397
402
|
`;switch(this.state){case "submit":return `${r}${color2.gray(o)} ${n(this.options[this.cursor],"selected")}`;case "cancel":return `${r}${color2.gray(o)} ${n(this.options[this.cursor],"cancelled")}
|
|
398
403
|
${color2.gray(o)}`;default:return `${r}${color2.cyan(o)} ${G({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(i,s)=>n(i,s?"active":"inactive")}).join(`
|
|
@@ -1188,7 +1193,7 @@ var PinoLogger = class extends MastraLogger {
|
|
|
1188
1193
|
};
|
|
1189
1194
|
|
|
1190
1195
|
var package_default = {
|
|
1191
|
-
version: "1.0.0-beta.
|
|
1196
|
+
version: "1.0.0-beta.5"};
|
|
1192
1197
|
function getPackageManagerAddCommand(pm) {
|
|
1193
1198
|
switch (pm) {
|
|
1194
1199
|
case "npm":
|
|
@@ -2089,19 +2094,19 @@ Note: you will need to go into Cursor Settings -> MCP Settings and manually enab
|
|
|
2089
2094
|
);
|
|
2090
2095
|
}
|
|
2091
2096
|
if (editor === `cursor-global`) {
|
|
2092
|
-
const
|
|
2097
|
+
const confirm3 = await ve({
|
|
2093
2098
|
message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
|
|
2094
2099
|
options: [
|
|
2095
2100
|
{ value: "yes", label: "Yes, I understand" },
|
|
2096
2101
|
{ value: "skip", label: "No, skip for now" }
|
|
2097
2102
|
]
|
|
2098
2103
|
});
|
|
2099
|
-
if (
|
|
2104
|
+
if (confirm3 !== `yes`) {
|
|
2100
2105
|
return void 0;
|
|
2101
2106
|
}
|
|
2102
2107
|
}
|
|
2103
2108
|
if (editor === `windsurf`) {
|
|
2104
|
-
const
|
|
2109
|
+
const confirm3 = await ve({
|
|
2105
2110
|
message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
|
|
2106
2111
|
This means the Mastra docs MCP server will be available in all your Windsurf projects.`,
|
|
2107
2112
|
options: [
|
|
@@ -2109,11 +2114,17 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
2109
2114
|
{ value: "skip", label: "No, skip for now" }
|
|
2110
2115
|
]
|
|
2111
2116
|
});
|
|
2112
|
-
if (
|
|
2117
|
+
if (confirm3 !== `yes`) {
|
|
2113
2118
|
return void 0;
|
|
2114
2119
|
}
|
|
2115
2120
|
}
|
|
2116
2121
|
return editor;
|
|
2122
|
+
},
|
|
2123
|
+
initGit: async () => {
|
|
2124
|
+
return ye({
|
|
2125
|
+
message: "Initialize a new git repository?",
|
|
2126
|
+
initialValue: true
|
|
2127
|
+
});
|
|
2117
2128
|
}
|
|
2118
2129
|
},
|
|
2119
2130
|
{
|
|
@@ -2154,6 +2165,20 @@ function getPackageManager() {
|
|
|
2154
2165
|
}
|
|
2155
2166
|
return "npm";
|
|
2156
2167
|
}
|
|
2168
|
+
async function gitInit({ cwd }) {
|
|
2169
|
+
await execa("git", ["init"], { cwd, stdio: "ignore" });
|
|
2170
|
+
await execa("git", ["add", "-A"], { cwd, stdio: "ignore" });
|
|
2171
|
+
await execa(
|
|
2172
|
+
"git",
|
|
2173
|
+
[
|
|
2174
|
+
"commit",
|
|
2175
|
+
"-m",
|
|
2176
|
+
'"Initial commit from Mastra"',
|
|
2177
|
+
'--author="dane-ai-mastra[bot] <dane-ai-mastra[bot]@users.noreply.github.com>"'
|
|
2178
|
+
],
|
|
2179
|
+
{ cwd, stdio: "ignore" }
|
|
2180
|
+
);
|
|
2181
|
+
}
|
|
2157
2182
|
var logger = createLogger(false);
|
|
2158
2183
|
function createLogger(debug = false) {
|
|
2159
2184
|
return new PinoLogger({
|
|
@@ -2345,7 +2370,8 @@ var init = async ({
|
|
|
2345
2370
|
llmApiKey,
|
|
2346
2371
|
addExample = false,
|
|
2347
2372
|
configureEditorWithDocsMCP,
|
|
2348
|
-
versionTag
|
|
2373
|
+
versionTag,
|
|
2374
|
+
initGit = false
|
|
2349
2375
|
}) => {
|
|
2350
2376
|
s.start("Initializing Mastra");
|
|
2351
2377
|
const packageVersionTag = versionTag ? `@${versionTag}` : "";
|
|
@@ -2404,6 +2430,16 @@ var init = async ({
|
|
|
2404
2430
|
});
|
|
2405
2431
|
}
|
|
2406
2432
|
s.stop();
|
|
2433
|
+
if (initGit) {
|
|
2434
|
+
const s2 = Y();
|
|
2435
|
+
try {
|
|
2436
|
+
s2.start("Initializing git repository");
|
|
2437
|
+
await gitInit({ cwd: process.cwd() });
|
|
2438
|
+
s2.stop("Git repository initialized");
|
|
2439
|
+
} catch {
|
|
2440
|
+
s2.stop();
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2407
2443
|
if (!llmApiKey) {
|
|
2408
2444
|
Me(`
|
|
2409
2445
|
${color2.green("Mastra initialized successfully!")}
|
|
@@ -2521,7 +2557,7 @@ var createMastraProject = async ({
|
|
|
2521
2557
|
xe("Operation cancelled");
|
|
2522
2558
|
process.exit(0);
|
|
2523
2559
|
}
|
|
2524
|
-
let result;
|
|
2560
|
+
let result = void 0;
|
|
2525
2561
|
if (needsInteractive) {
|
|
2526
2562
|
result = await interactivePrompt({
|
|
2527
2563
|
options: { showBanner: false },
|
|
@@ -2837,6 +2873,14 @@ async function createFromTemplate(args) {
|
|
|
2837
2873
|
}
|
|
2838
2874
|
llmProvider = providerResponse;
|
|
2839
2875
|
}
|
|
2876
|
+
let initGit = false;
|
|
2877
|
+
const gitConfirmResult = await ye({
|
|
2878
|
+
message: "Initialize a new git repository?",
|
|
2879
|
+
initialValue: true
|
|
2880
|
+
});
|
|
2881
|
+
if (!pD(gitConfirmResult)) {
|
|
2882
|
+
initGit = gitConfirmResult;
|
|
2883
|
+
}
|
|
2840
2884
|
let projectPath = null;
|
|
2841
2885
|
try {
|
|
2842
2886
|
const analytics = args.injectedAnalytics || getAnalytics();
|
|
@@ -2862,6 +2906,16 @@ async function createFromTemplate(args) {
|
|
|
2862
2906
|
llmProvider
|
|
2863
2907
|
});
|
|
2864
2908
|
await installDependencies(projectPath);
|
|
2909
|
+
if (initGit) {
|
|
2910
|
+
const s2 = Y();
|
|
2911
|
+
try {
|
|
2912
|
+
s2.start("Initializing git repository");
|
|
2913
|
+
await gitInit({ cwd: projectPath });
|
|
2914
|
+
s2.stop("Git repository initialized");
|
|
2915
|
+
} catch {
|
|
2916
|
+
s2.stop();
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2865
2919
|
Me(`
|
|
2866
2920
|
${color2.green("Mastra template installed!")}
|
|
2867
2921
|
|