create-mastra 0.0.0-feat-mcp-embedded-docs-tools-clean-20260108124346 → 0.0.0-feat-cli-skills-installation-20260202141803

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 CHANGED
@@ -1,6 +1,30 @@
1
1
  # create-mastra
2
2
 
3
- ## 0.0.0-feat-mcp-embedded-docs-tools-clean-20260108124346
3
+ ## 0.0.0-feat-cli-skills-installation-20260202141803
4
+
5
+ ## 1.1.0
6
+
7
+ ### Patch Changes
8
+
9
+ - fix workflow run input caching bug in studio UI ([#11784](https://github.com/mastra-ai/mastra/pull/11784))
10
+
11
+ ## 1.1.0-alpha.3
12
+
13
+ ## 1.1.0-alpha.2
14
+
15
+ ## 1.1.0-alpha.1
16
+
17
+ ## 1.1.0-alpha.0
18
+
19
+ ### Patch Changes
20
+
21
+ - fix workflow run input caching bug in studio UI ([#11784](https://github.com/mastra-ai/mastra/pull/11784))
22
+
23
+ ## 1.0.1
24
+
25
+ ## 1.0.1-alpha.0
26
+
27
+ ## 1.0.0
4
28
 
5
29
  ### Major Changes
6
30
 
@@ -24,11 +48,16 @@
24
48
  + const stream = await run.stream({ inputData: { ... } });
25
49
  ```
26
50
 
51
+ - Replace deprecated client.getTraces with a client.listTraces ([#11711](https://github.com/mastra-ai/mastra/pull/11711))
52
+
27
53
  - Fix select options overflow when list is long by adding maximum height ([#10813](https://github.com/mastra-ai/mastra/pull/10813))
28
54
 
29
55
  - dependencies updates: ([#10111](https://github.com/mastra-ai/mastra/pull/10111))
30
56
  - Updated dependency [`pino@^10.1.0` ↗︎](https://www.npmjs.com/package/pino/v/10.1.0) (from `^9.7.0`, in `dependencies`)
31
57
 
58
+ - dependencies updates: ([#11642](https://github.com/mastra-ai/mastra/pull/11642))
59
+ - Updated dependency [`fs-extra@^11.3.3` ↗︎](https://www.npmjs.com/package/fs-extra/v/11.3.3) (from `^11.3.2`, in `dependencies`)
60
+
32
61
  - dependencies updates: ([#9781](https://github.com/mastra-ai/mastra/pull/9781))
33
62
  - Updated dependency [`posthog-node@^5.11.2` ↗︎](https://www.npmjs.com/package/posthog-node/v/5.11.2) (from `^4.18.0`, in `dependencies`)
34
63
 
@@ -51,6 +80,12 @@
51
80
 
52
81
  - Make MainSidebar toggle button sticky to bottom, always visible ([#9682](https://github.com/mastra-ai/mastra/pull/9682))
53
82
 
83
+ - Add human-in-the-loop (HITL) support to agent networks ([#11678](https://github.com/mastra-ai/mastra/pull/11678))
84
+ - Add suspend/resume capabilities to agent network
85
+ - Enable auto-resume for suspended network execution via `autoResumeSuspendedTools`
86
+
87
+ `agent.resumeNetwork`, `agent.approveNetworkToolCall`, `agent.declineNetworkToolCall`
88
+
54
89
  - Fix peer dependency conflicts in browsing-agent template. Updated template dependencies to align with @browserbasehq/stagehand@2.5.6 requirements: ([#11346](https://github.com/mastra-ai/mastra/pull/11346))
55
90
  - Updated `dotenv` from `^17.2.1` to `^16.4.5`
56
91
  - Updated `zod` from `^3.25.76` to `^3.25.67`
@@ -80,6 +115,8 @@
80
115
 
81
116
  - Add initial state input to workflow form in studio ([#11560](https://github.com/mastra-ai/mastra/pull/11560))
82
117
 
118
+ - Make initialState optional in studio ([#11744](https://github.com/mastra-ai/mastra/pull/11744))
119
+
83
120
  - Fix discriminatedUnion schema information lost when json schema is converted to zod ([#10500](https://github.com/mastra-ai/mastra/pull/10500))
84
121
 
85
122
  - Move useScorers down to trace page to trigger it once for all trace spans ([#10985](https://github.com/mastra-ai/mastra/pull/10985))
@@ -98,6 +135,35 @@
98
135
 
99
136
  - fix isTopLevelSpan value definition on SpanScoring to properly recognize lack of span?.parentSpanId value (null or empty string) ([#11083](https://github.com/mastra-ai/mastra/pull/11083))
100
137
 
138
+ ## 1.0.0-beta.19
139
+
140
+ ## 1.0.0-beta.18
141
+
142
+ ## 1.0.0-beta.17
143
+
144
+ ## 1.0.0-beta.16
145
+
146
+ ## 1.0.0-beta.15
147
+
148
+ ### Patch Changes
149
+
150
+ - Add human-in-the-loop (HITL) support to agent networks ([#11678](https://github.com/mastra-ai/mastra/pull/11678))
151
+ - Add suspend/resume capabilities to agent network
152
+ - Enable auto-resume for suspended network execution via `autoResumeSuspendedTools`
153
+
154
+ `agent.resumeNetwork`, `agent.approveNetworkToolCall`, `agent.declineNetworkToolCall`
155
+
156
+ ## 1.0.0-beta.14
157
+
158
+ ### Patch Changes
159
+
160
+ - Replace deprecated client.getTraces with a client.listTraces ([#11711](https://github.com/mastra-ai/mastra/pull/11711))
161
+
162
+ - dependencies updates: ([#11642](https://github.com/mastra-ai/mastra/pull/11642))
163
+ - Updated dependency [`fs-extra@^11.3.3` ↗︎](https://www.npmjs.com/package/fs-extra/v/11.3.3) (from `^11.3.2`, in `dependencies`)
164
+
165
+ - Make initialState optional in studio ([#11744](https://github.com/mastra-ai/mastra/pull/11744))
166
+
101
167
  ## 1.0.0-beta.13
102
168
 
103
169
  ### Patch Changes
package/README.md CHANGED
@@ -9,7 +9,7 @@ It includes everything you need to go from early prototypes to production-ready
9
9
  ## Usage
10
10
 
11
11
  > [!IMPORTANT]
12
- > Make sure that you have Node.js 20 or later installed on your system.
12
+ > Make sure that you have Node.js 22.13.0 or later installed on your system.
13
13
 
14
14
  Using npm:
15
15
 
package/dist/index.js CHANGED
@@ -22,8 +22,8 @@ import fsExtra$1 from 'fs-extra';
22
22
  import pino from 'pino';
23
23
  import pretty from 'pino-pretty';
24
24
 
25
- var __filename = fileURLToPath(import.meta.url);
26
- var __dirname = path3.dirname(__filename);
25
+ var __filename$1 = fileURLToPath(import.meta.url);
26
+ var __dirname$1 = path3.dirname(__filename$1);
27
27
  var analyticsInstance = null;
28
28
  function getAnalytics() {
29
29
  return analyticsInstance;
@@ -39,7 +39,7 @@ var PosthogAnalytics = class {
39
39
  host = "https://app.posthog.com"
40
40
  }) {
41
41
  this.version = version;
42
- const cliConfigPath = path3.join(__dirname, "mastra-cli.json");
42
+ const cliConfigPath = path3.join(__dirname$1, "mastra-cli.json");
43
43
  if (existsSync(cliConfigPath)) {
44
44
  try {
45
45
  const { distinctId, sessionId } = JSON.parse(readFileSync(cliConfigPath, "utf-8"));
@@ -67,7 +67,7 @@ var PosthogAnalytics = class {
67
67
  }
68
68
  writeCliConfig({ distinctId, sessionId }) {
69
69
  try {
70
- writeFileSync(path3.join(__dirname, "mastra-cli.json"), JSON.stringify({ distinctId, sessionId }));
70
+ writeFileSync(path3.join(__dirname$1, "mastra-cli.json"), JSON.stringify({ distinctId, sessionId }));
71
71
  } catch {
72
72
  }
73
73
  }
@@ -384,9 +384,9 @@ function DD({onlyFirst:e=false}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:
384
384
  `).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(`
385
385
  `);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(`
386
386
  `).slice(F);this.output.write(s.join(`
387
- `)),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);});}}
387
+ `)),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 kD=Object.defineProperty,$D=(e,u,t)=>u in e?kD(e,u,{enumerable:true,configurable:true,writable:true,value:t}):e[u]=t,H=(e,u,t)=>($D(e,typeof u!="symbol"?u+"":u,t),t);let SD=class extends x{constructor(u){super(u,false),H(this,"options"),H(this,"cursor",0),this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===u.cursorAt),0),this.on("key",t=>{t==="a"&&this.toggleAll();}),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;case "space":this.toggleValue();break}});}get _value(){return this.options[this.cursor].value}toggleAll(){const u=this.value.length===this.options.length;this.value=u?[]:this.options.map(t=>t.value);}toggleValue(){const u=this.value.includes(this._value);this.value=u?this.value.filter(t=>t!==this._value):[...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);});}}
388
388
 
389
- 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)}
389
+ 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"," "),A=u("\u25FB","[\u2022]"),T=u("\u25FC","[+]"),F=u("\u25FB","[ ]"),_=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)}
390
390
  ${b(this.state)} ${t.message}
391
391
  `,r=t.placeholder?color2.inverse(t.placeholder[0])+color2.dim(t.placeholder.slice(1)):color2.inverse(color2.hidden("_")),i=this.value?this.valueWithCursor:r;switch(this.state){case "error":return `${n.trim()}
392
392
  ${color2.yellow(o)} ${i}
@@ -405,6 +405,18 @@ ${b(this.state)} ${t.message}
405
405
  ${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(`
406
406
  ${color2.cyan(o)} `)}
407
407
  ${color2.cyan(d)}
408
+ `}}}).prompt()},fe=t=>{const n=(r,i)=>{const s=r.label??String(r.value);return i==="active"?`${color2.cyan(A)} ${s} ${r.hint?color2.dim(`(${r.hint})`):""}`:i==="selected"?`${color2.green(T)} ${color2.dim(s)} ${r.hint?color2.dim(`(${r.hint})`):""}`:i==="cancelled"?`${color2.strikethrough(color2.dim(s))}`:i==="active-selected"?`${color2.green(T)} ${s} ${r.hint?color2.dim(`(${r.hint})`):""}`:i==="submitted"?`${color2.dim(s)}`:`${color2.dim(F)} ${color2.dim(s)}`};return new SD({options:t.options,initialValues:t.initialValues,required:t.required??true,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return `Please select at least one option.
409
+ ${color2.reset(color2.dim(`Press ${color2.gray(color2.bgWhite(color2.inverse(" space ")))} to select, ${color2.gray(color2.bgWhite(color2.inverse(" enter ")))} to submit`))}`},render(){const r=`${color2.gray(o)}
410
+ ${b(this.state)} ${t.message}
411
+ `,i=(s,c)=>{const a=this.value.includes(s.value);return c&&a?n(s,"active-selected"):a?n(s,"selected"):n(s,c?"active":"inactive")};switch(this.state){case "submit":return `${r}${color2.gray(o)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>n(s,"submitted")).join(color2.dim(", "))||color2.dim("none")}`;case "cancel":{const s=this.options.filter(({value:c})=>this.value.includes(c)).map(c=>n(c,"cancelled")).join(color2.dim(", "));return `${r}${color2.gray(o)} ${s.trim()?`${s}
412
+ ${color2.gray(o)}`:""}`}case "error":{const s=this.error.split(`
413
+ `).map((c,a)=>a===0?`${color2.yellow(d)} ${color2.yellow(c)}`:` ${c}`).join(`
414
+ `);return `${r+color2.yellow(o)} ${G({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
415
+ ${color2.yellow(o)} `)}
416
+ ${s}
417
+ `}default:return `${r}${color2.cyan(o)} ${G({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
418
+ ${color2.cyan(o)} `)}
419
+ ${color2.cyan(d)}
408
420
  `}}}).prompt()},Me=(t="",n="")=>{const r=`
409
421
  ${t}
410
422
  `.split(`
@@ -1233,7 +1245,7 @@ var PinoLogger = class _PinoLogger extends MastraLogger {
1233
1245
  };
1234
1246
 
1235
1247
  var package_default = {
1236
- version: "1.0.0-beta.13"};
1248
+ version: "1.1.0"};
1237
1249
  function getPackageManagerAddCommand(pm) {
1238
1250
  switch (pm) {
1239
1251
  case "npm":
@@ -1254,7 +1266,7 @@ var DepsService = class {
1254
1266
  this.packageManager = this.getPackageManager();
1255
1267
  }
1256
1268
  findLockFile(dir) {
1257
- const lockFiles = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock", "bun.lock"];
1269
+ const lockFiles = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock", "bun.lock", "bun.lockb"];
1258
1270
  for (const file of lockFiles) {
1259
1271
  if (fs3__default__default.existsSync(path3.join(dir, file))) {
1260
1272
  return file;
@@ -1276,6 +1288,7 @@ var DepsService = class {
1276
1288
  case "yarn.lock":
1277
1289
  return "yarn";
1278
1290
  case "bun.lock":
1291
+ case "bun.lockb":
1279
1292
  return "bun";
1280
1293
  default:
1281
1294
  return "npm";
@@ -1288,7 +1301,7 @@ var DepsService = class {
1288
1301
  return execa(`${pm} ${installCommand} ${packageList}`, {
1289
1302
  all: true,
1290
1303
  shell: true,
1291
- stdio: "inherit"
1304
+ stdio: "pipe"
1292
1305
  });
1293
1306
  }
1294
1307
  async checkDependencies(dependencies) {
@@ -1985,7 +1998,7 @@ export const mastra = new Mastra()
1985
1998
  import { Mastra } from '@mastra/core/mastra';
1986
1999
  import { PinoLogger } from '@mastra/loggers';
1987
2000
  import { LibSQLStore } from '@mastra/libsql';
1988
- import { Observability } from '@mastra/observability';
2001
+ import { Observability, DefaultExporter, CloudExporter, SensitiveDataFilter } from '@mastra/observability';
1989
2002
  ${addWorkflow ? `import { weatherWorkflow } from './workflows/weather-workflow';` : ""}
1990
2003
  ${addAgent ? `import { weatherAgent } from './agents/weather-agent';` : ""}
1991
2004
  ${addScorers ? `import { toolCallAppropriatenessScorer, completenessScorer, translationScorer } from './scorers/weather-scorer';` : ""}
@@ -1994,16 +2007,26 @@ export const mastra = new Mastra({
1994
2007
  ${filteredExports.join("\n ")}
1995
2008
  storage: new LibSQLStore({
1996
2009
  id: "mastra-storage",
1997
- // stores observability, scores, ... into memory storage, if it needs to persist, change to file:../mastra.db
1998
- url: ":memory:",
2010
+ // stores observability, scores, ... into persistent file storage
2011
+ url: "file:./mastra.db",
1999
2012
  }),
2000
2013
  logger: new PinoLogger({
2001
2014
  name: 'Mastra',
2002
2015
  level: 'info',
2003
2016
  }),
2004
2017
  observability: new Observability({
2005
- // Enables DefaultExporter and CloudExporter for tracing
2006
- default: { enabled: true },
2018
+ configs: {
2019
+ default: {
2020
+ serviceName: 'mastra',
2021
+ exporters: [
2022
+ new DefaultExporter(), // Persists traces to storage for Mastra Studio
2023
+ new CloudExporter(), // Sends traces to Mastra Cloud (if MASTRA_CLOUD_ACCESS_TOKEN is set)
2024
+ ],
2025
+ spanOutputProcessors: [
2026
+ new SensitiveDataFilter(), // Redacts sensitive data like passwords, tokens, keys
2027
+ ],
2028
+ },
2029
+ },
2007
2030
  }),
2008
2031
  });
2009
2032
  `
@@ -2106,80 +2129,160 @@ var interactivePrompt = async (args = {}) => {
2106
2129
  }
2107
2130
  return void 0;
2108
2131
  },
2109
- configureEditorWithDocsMCP: async () => {
2110
- const editor = await ve({
2111
- message: `Make your IDE into a Mastra expert? (Installs Mastra's MCP server)`,
2132
+ configureMastraToolingForCodingAgents: async () => {
2133
+ if (skip?.configureMastraToolingForCodingAgents) return void 0;
2134
+ const choice = await ve({
2135
+ message: `Configure Mastra tooling for coding agents?`,
2112
2136
  options: [
2113
- { value: "skip", label: "Skip for now", hint: "default" },
2114
- {
2115
- value: "cursor",
2116
- label: "Cursor (project only)"
2117
- },
2118
- {
2119
- value: "cursor-global",
2120
- label: "Cursor (global, all projects)"
2121
- },
2122
- {
2123
- value: "windsurf",
2124
- label: "Windsurf"
2125
- },
2126
- {
2127
- value: "vscode",
2128
- label: "VSCode"
2129
- },
2130
- {
2131
- value: "antigravity",
2132
- label: "Antigravity"
2133
- }
2134
- ]
2137
+ { value: "skills", label: "Skills - Mastra agent skills", hint: "recommended" },
2138
+ { value: "mcp", label: "MCP Docs - IDE integration" }
2139
+ ],
2140
+ initialValue: "skills"
2135
2141
  });
2136
- if (editor === `skip`) return void 0;
2137
- if (editor === `cursor`) {
2138
- M.message(
2139
- `
2140
- Note: you will need to go into Cursor Settings -> MCP Settings and manually enable the installed Mastra MCP server.
2141
- `
2142
- );
2143
- }
2144
- if (editor === `cursor-global`) {
2145
- const confirm3 = await ve({
2146
- message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
2147
- options: [
2148
- { value: "yes", label: "Yes, I understand" },
2149
- { value: "skip", label: "No, skip for now" }
2150
- ]
2142
+ if (choice === "skills") {
2143
+ const POPULAR_AGENTS = [
2144
+ { value: "claude-code", label: "Claude Code" },
2145
+ { value: "cursor", label: "Cursor" },
2146
+ { value: "windsurf", label: "Windsurf" },
2147
+ { value: "github-copilot", label: "GitHub Copilot" },
2148
+ { value: "cline", label: "Cline" },
2149
+ { value: "continue", label: "Continue" },
2150
+ { value: "gemini-cli", label: "Gemini CLI" },
2151
+ { value: "opencode", label: "OpenCode" },
2152
+ { value: "replit", label: "Replit" },
2153
+ { value: "roo", label: "Roo Code" }
2154
+ ];
2155
+ const ALL_AGENTS = [
2156
+ ...POPULAR_AGENTS,
2157
+ { value: "adal", label: "AdaL" },
2158
+ { value: "amp", label: "Amp" },
2159
+ { value: "antigravity", label: "Antigravity" },
2160
+ { value: "augment", label: "Augment" },
2161
+ { value: "codebuddy", label: "CodeBuddy" },
2162
+ { value: "codex", label: "Codex" },
2163
+ { value: "command-code", label: "Command Code" },
2164
+ { value: "crush", label: "Crush" },
2165
+ { value: "droid", label: "Droid" },
2166
+ { value: "goose", label: "Goose" },
2167
+ { value: "iflow-cli", label: "iFlow CLI" },
2168
+ { value: "junie", label: "Junie" },
2169
+ { value: "kilo", label: "Kilo Code" },
2170
+ { value: "kimi-cli", label: "Kimi Code CLI" },
2171
+ { value: "kiro-cli", label: "Kiro CLI" },
2172
+ { value: "kode", label: "Kode" },
2173
+ { value: "mcpjam", label: "MCPJam" },
2174
+ { value: "mistral-vibe", label: "Mistral Vibe" },
2175
+ { value: "mux", label: "Mux" },
2176
+ { value: "neovate", label: "Neovate" },
2177
+ { value: "openclaude", label: "OpenClaude IDE" },
2178
+ { value: "openclaw", label: "OpenClaw" },
2179
+ { value: "openhands", label: "OpenHands" },
2180
+ { value: "pi", label: "Pi" },
2181
+ { value: "pochi", label: "Pochi" },
2182
+ { value: "qoder", label: "Qoder" },
2183
+ { value: "qwen-code", label: "Qwen Code" },
2184
+ { value: "trae", label: "Trae" },
2185
+ { value: "trae-cn", label: "Trae CN" },
2186
+ { value: "zencoder", label: "Zencoder" }
2187
+ ];
2188
+ const initialSelection = await fe({
2189
+ message: "Select agent(s) to install skills for:",
2190
+ options: [...POPULAR_AGENTS, { value: "__show_all__", label: "+ Show all agents (30 more)" }],
2191
+ required: true
2151
2192
  });
2152
- if (confirm3 !== `yes`) {
2193
+ if (pD(initialSelection)) {
2153
2194
  return void 0;
2154
2195
  }
2196
+ let selectedAgents = initialSelection;
2197
+ if (selectedAgents.includes("__show_all__")) {
2198
+ const preSelected = selectedAgents.filter((a) => a !== "__show_all__");
2199
+ const fullSelection = await fe({
2200
+ message: "Select agent(s) to install skills for:",
2201
+ options: ALL_AGENTS,
2202
+ initialValues: preSelected,
2203
+ required: true
2204
+ });
2205
+ if (pD(fullSelection)) {
2206
+ return void 0;
2207
+ }
2208
+ selectedAgents = fullSelection;
2209
+ }
2210
+ return { type: "skills", agents: selectedAgents };
2155
2211
  }
2156
- if (editor === `windsurf`) {
2157
- const confirm3 = await ve({
2158
- message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
2159
- This means the Mastra docs MCP server will be available in all your Windsurf projects.`,
2212
+ if (choice === "mcp") {
2213
+ const editor = await ve({
2214
+ message: `Which editor?`,
2160
2215
  options: [
2161
- { value: "yes", label: "Yes, I understand" },
2162
- { value: "skip", label: "No, skip for now" }
2216
+ {
2217
+ value: "cursor",
2218
+ label: "Cursor (project only)"
2219
+ },
2220
+ {
2221
+ value: "cursor-global",
2222
+ label: "Cursor (global, all projects)"
2223
+ },
2224
+ {
2225
+ value: "windsurf",
2226
+ label: "Windsurf"
2227
+ },
2228
+ {
2229
+ value: "vscode",
2230
+ label: "VSCode"
2231
+ },
2232
+ {
2233
+ value: "antigravity",
2234
+ label: "Antigravity"
2235
+ }
2163
2236
  ]
2164
2237
  });
2165
- if (confirm3 !== `yes`) {
2166
- return void 0;
2238
+ if (editor === `cursor`) {
2239
+ M.message(
2240
+ `
2241
+ Note: you will need to go into Cursor Settings -> MCP Settings and manually enable the installed Mastra MCP server.
2242
+ `
2243
+ );
2167
2244
  }
2168
- }
2169
- if (editor === `antigravity`) {
2170
- const confirm3 = await ve({
2171
- message: `Antigravity only supports a global MCP config (at ${antigravityGlobalMCPConfigPath}). Is it ok to add/update that global config?
2245
+ if (editor === `cursor-global`) {
2246
+ const confirm3 = await ve({
2247
+ message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
2248
+ options: [
2249
+ { value: "yes", label: "Yes, I understand" },
2250
+ { value: "no", label: "No, cancel" }
2251
+ ]
2252
+ });
2253
+ if (confirm3 !== `yes`) {
2254
+ return void 0;
2255
+ }
2256
+ }
2257
+ if (editor === `windsurf`) {
2258
+ const confirm3 = await ve({
2259
+ message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
2260
+ This means the Mastra docs MCP server will be available in all your Windsurf projects.`,
2261
+ options: [
2262
+ { value: "yes", label: "Yes, I understand" },
2263
+ { value: "no", label: "No, cancel" }
2264
+ ]
2265
+ });
2266
+ if (confirm3 !== `yes`) {
2267
+ return void 0;
2268
+ }
2269
+ }
2270
+ if (editor === `antigravity`) {
2271
+ const confirm3 = await ve({
2272
+ message: `Antigravity only supports a global MCP config (at ${antigravityGlobalMCPConfigPath}). Is it ok to add/update that global config?
2172
2273
  This will make the Mastra docs MCP server available in all Antigravity projects.`,
2173
- options: [
2174
- { value: "yes", label: "Yes, I understand" },
2175
- { value: "skip", label: "No, skip for now" }
2176
- ]
2177
- });
2178
- if (confirm3 !== `yes`) {
2179
- return void 0;
2274
+ options: [
2275
+ { value: "yes", label: "Yes, I understand" },
2276
+ { value: "no", label: "No, cancel" }
2277
+ ]
2278
+ });
2279
+ if (confirm3 !== `yes`) {
2280
+ return void 0;
2281
+ }
2180
2282
  }
2283
+ return editor;
2181
2284
  }
2182
- return editor;
2285
+ return void 0;
2183
2286
  },
2184
2287
  initGit: async () => {
2185
2288
  if (skip?.gitInit) return false;
@@ -2424,6 +2527,26 @@ function findTemplateByName(templates, templateName) {
2424
2527
  function getDefaultProjectName(template) {
2425
2528
  return template.slug.replace(/^template-/, "");
2426
2529
  }
2530
+ async function installMastraSkills({
2531
+ directory,
2532
+ agents
2533
+ }) {
2534
+ try {
2535
+ const args = ["skills", "add", "mastra-ai/skills", "--agent", ...agents, "-y"];
2536
+ await execa("npx", args, {
2537
+ cwd: directory,
2538
+ stdio: "pipe"
2539
+ // Hide verbose output
2540
+ });
2541
+ return { success: true, agents };
2542
+ } catch (error) {
2543
+ return {
2544
+ success: false,
2545
+ error: error instanceof Error ? error.message : "Unknown error",
2546
+ agents
2547
+ };
2548
+ }
2549
+ }
2427
2550
  var s = Y();
2428
2551
  var init = async ({
2429
2552
  directory = "src/",
@@ -2432,6 +2555,7 @@ var init = async ({
2432
2555
  llmApiKey,
2433
2556
  addExample = false,
2434
2557
  configureEditorWithDocsMCP,
2558
+ configureMastraToolingForCodingAgents,
2435
2559
  versionTag,
2436
2560
  initGit = false
2437
2561
  }) => {
@@ -2484,22 +2608,39 @@ var init = async ({
2484
2608
  }
2485
2609
  }
2486
2610
  const key = await getAPIKey(llmProvider || "openai");
2487
- if (configureEditorWithDocsMCP) {
2611
+ s.stop("Mastra initialized");
2612
+ if (configureMastraToolingForCodingAgents && typeof configureMastraToolingForCodingAgents === "object" && "type" in configureMastraToolingForCodingAgents && configureMastraToolingForCodingAgents.type === "skills") {
2613
+ s.start("Installing Mastra agent skills");
2614
+ const skillsResult = await installMastraSkills({
2615
+ directory: process.cwd(),
2616
+ agents: configureMastraToolingForCodingAgents.agents
2617
+ });
2618
+ if (skillsResult.success) {
2619
+ const agentNames = skillsResult.agents.map((agent) => {
2620
+ return agent.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
2621
+ }).join(", ");
2622
+ s.stop(`Mastra agent skills installed (in ${agentNames})`);
2623
+ } else {
2624
+ s.stop("Skills installation failed");
2625
+ console.warn(color2.yellow(`
2626
+ Warning: ${skillsResult.error}`));
2627
+ }
2628
+ }
2629
+ const mcpEditor = configureMastraToolingForCodingAgents && typeof configureMastraToolingForCodingAgents === "string" && ["cursor", "cursor-global", "windsurf", "vscode", "antigravity"].includes(configureMastraToolingForCodingAgents) ? configureMastraToolingForCodingAgents : configureEditorWithDocsMCP;
2630
+ if (mcpEditor) {
2488
2631
  await installMastraDocsMCPServer({
2489
- editor: configureEditorWithDocsMCP,
2632
+ editor: mcpEditor,
2490
2633
  directory: process.cwd(),
2491
2634
  versionTag
2492
2635
  });
2493
2636
  }
2494
- s.stop();
2495
2637
  if (initGit) {
2496
- const s2 = Y();
2638
+ s.start("Initializing git repository");
2497
2639
  try {
2498
- s2.start("Initializing git repository");
2499
2640
  await gitInit({ cwd: process.cwd() });
2500
- s2.stop("Git repository initialized");
2641
+ s.stop("Git repository initialized");
2501
2642
  } catch {
2502
- s2.stop();
2643
+ s.stop();
2503
2644
  }
2504
2645
  }
2505
2646
  if (!llmApiKey) {
@@ -2573,6 +2714,42 @@ async function initializePackageJson(pm) {
2573
2714
  };
2574
2715
  await fs4.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
2575
2716
  }
2717
+ var writeReadmeFile = async ({ dirPath, projectName }) => {
2718
+ const packageManager = getPackageManager();
2719
+ const readmePath = path3.join(dirPath, "README.md");
2720
+ const content = `# ${projectName}
2721
+
2722
+ Welcome to your new [Mastra](https://mastra.ai/) project! We're excited to see what you'll build.
2723
+
2724
+ ## Getting Started
2725
+
2726
+ Start the development server:
2727
+
2728
+ \`\`\`shell
2729
+ ${packageManager} run dev
2730
+ \`\`\`
2731
+
2732
+ Open [http://localhost:4111](http://localhost:4111) in your browser to access [Mastra Studio](https://mastra.ai/docs/getting-started/studio). It provides an interactive UI for building and testing your agents, along with a REST API that exposes your Mastra application as a local service. This lets you start building without worrying about integration right away.
2733
+
2734
+ You can start editing files inside the \`src/mastra\` directory. The development server will automatically reload whenever you make changes.
2735
+
2736
+ ## Learn more
2737
+
2738
+ To learn more about Mastra, visit our [documentation](https://mastra.ai/docs/). Your bootstrapped project includes example code for [agents](https://mastra.ai/docs/agents/overview), [tools](https://mastra.ai/docs/agents/using-tools), [workflows](https://mastra.ai/docs/workflows/overview), [scorers](https://mastra.ai/docs/evals/overview), and [observability](https://mastra.ai/docs/observability/overview).
2739
+
2740
+ If you're new to AI agents, check out our [course](https://mastra.ai/course) and [YouTube videos](https://youtube.com/@mastra-ai). You can also join our [Discord](https://discord.gg/BTYqqHKUrf) community to get help and share your projects.
2741
+
2742
+ ## Deploy on Mastra Cloud
2743
+
2744
+ [Mastra Cloud](https://cloud.mastra.ai/) gives you a serverless agent environment with atomic deployments. Access your agents from anywhere and monitor performance. Make sure they don't go off the rails with evals and tracing.
2745
+
2746
+ Check out the [deployment guide](https://mastra.ai/docs/deployment/overview) for more details.`;
2747
+ const formattedContent = await prettier.format(content, {
2748
+ parser: "markdown",
2749
+ singleQuote: true
2750
+ });
2751
+ await fs4.writeFile(readmePath, formattedContent);
2752
+ };
2576
2753
  async function installMastraDependency(pm, dependency, versionTag, isDev, timeout) {
2577
2754
  let installCommand = getPackageManagerAddCommand(pm);
2578
2755
  if (isDev) {
@@ -2601,6 +2778,7 @@ var createMastraProject = async ({
2601
2778
  timeout,
2602
2779
  llmProvider,
2603
2780
  llmApiKey,
2781
+ skills,
2604
2782
  needsInteractive
2605
2783
  }) => {
2606
2784
  Ie(color2.inverse(" Mastra Create "));
@@ -2623,7 +2801,11 @@ var createMastraProject = async ({
2623
2801
  if (needsInteractive) {
2624
2802
  result = await interactivePrompt({
2625
2803
  options: { showBanner: false },
2626
- skip: { llmProvider: llmProvider !== void 0, llmApiKey: llmApiKey !== void 0 }
2804
+ skip: {
2805
+ llmProvider: llmProvider !== void 0,
2806
+ llmApiKey: llmApiKey !== void 0,
2807
+ configureMastraToolingForCodingAgents: skills !== void 0 && skills.length > 0
2808
+ }
2627
2809
  });
2628
2810
  }
2629
2811
  const s2 = Y();
@@ -2655,6 +2837,7 @@ var createMastraProject = async ({
2655
2837
  build: "mastra build",
2656
2838
  start: "mastra start"
2657
2839
  });
2840
+ await writeReadmeFile({ dirPath: process.cwd(), projectName });
2658
2841
  } catch (error) {
2659
2842
  throw new Error(
2660
2843
  `Failed to initialize project structure: ${error instanceof Error ? error.message : "Unknown error"}`
@@ -2759,6 +2942,7 @@ var create = async (args) => {
2759
2942
  timeout: args?.timeout,
2760
2943
  llmProvider: args?.llmProvider,
2761
2944
  llmApiKey: args?.llmApiKey,
2945
+ skills: args?.skills,
2762
2946
  needsInteractive
2763
2947
  });
2764
2948
  const directory = args.directory || "src/";
@@ -2768,6 +2952,8 @@ var create = async (args) => {
2768
2952
  llmApiKey: result?.llmApiKey,
2769
2953
  components: ["agents", "tools", "workflows", "scorers"],
2770
2954
  addExample: true,
2955
+ configureMastraToolingForCodingAgents: result?.configureMastraToolingForCodingAgents || (args.skills && args.skills.length > 0 ? { type: "skills", agents: args.skills } : void 0),
2956
+ configureEditorWithDocsMCP: void 0,
2771
2957
  versionTag: args.createVersionTag
2772
2958
  });
2773
2959
  postCreate({ projectName });
@@ -2780,6 +2966,7 @@ var create = async (args) => {
2780
2966
  llmProvider,
2781
2967
  addExample,
2782
2968
  llmApiKey,
2969
+ configureMastraToolingForCodingAgents: args.skills && args.skills.length > 0 ? { type: "skills", agents: args.skills } : void 0,
2783
2970
  configureEditorWithDocsMCP: args.mcpServer,
2784
2971
  versionTag: args.createVersionTag
2785
2972
  });