create-mastra 1.0.0-beta.8 → 1.0.0
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 +204 -0
- package/README.md +1 -1
- package/dist/index.js +90 -18
- package/dist/index.js.map +1 -1
- package/dist/templates/dev.entry.js +1 -1
- package/package.json +13 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,209 @@
|
|
|
1
1
|
# create-mastra
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Bump minimum required Node.js version to 22.13.0 ([#9706](https://github.com/mastra-ai/mastra/pull/9706))
|
|
8
|
+
|
|
9
|
+
- Removed old tracing code based on OpenTelemetry ([#9237](https://github.com/mastra-ai/mastra/pull/9237))
|
|
10
|
+
|
|
11
|
+
- Mark as stable ([`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc))
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- Add Antigravity IDE support to create-mastra CLI. Users can now select Antigravity during project initialization and automatically configure the global Mastra MCP server for the IDE, reducing manual setup and enabling immediate use of Mastra agents. ([#11374](https://github.com/mastra-ai/mastra/pull/11374))
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Remove `streamVNext`, `resumeStreamVNext`, and `observeStreamVNext` methods, call `stream`, `resumeStream` and `observeStream` directly ([#11499](https://github.com/mastra-ai/mastra/pull/11499))
|
|
20
|
+
|
|
21
|
+
```diff
|
|
22
|
+
+ const run = await workflow.createRun({ runId: '123' });
|
|
23
|
+
- const stream = await run.streamVNext({ inputData: { ... } });
|
|
24
|
+
+ const stream = await run.stream({ inputData: { ... } });
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- Replace deprecated client.getTraces with a client.listTraces ([#11711](https://github.com/mastra-ai/mastra/pull/11711))
|
|
28
|
+
|
|
29
|
+
- Fix select options overflow when list is long by adding maximum height ([#10813](https://github.com/mastra-ai/mastra/pull/10813))
|
|
30
|
+
|
|
31
|
+
- dependencies updates: ([#10111](https://github.com/mastra-ai/mastra/pull/10111))
|
|
32
|
+
- Updated dependency [`pino@^10.1.0` ↗︎](https://www.npmjs.com/package/pino/v/10.1.0) (from `^9.7.0`, in `dependencies`)
|
|
33
|
+
|
|
34
|
+
- dependencies updates: ([#11642](https://github.com/mastra-ai/mastra/pull/11642))
|
|
35
|
+
- Updated dependency [`fs-extra@^11.3.3` ↗︎](https://www.npmjs.com/package/fs-extra/v/11.3.3) (from `^11.3.2`, in `dependencies`)
|
|
36
|
+
|
|
37
|
+
- dependencies updates: ([#9781](https://github.com/mastra-ai/mastra/pull/9781))
|
|
38
|
+
- Updated dependency [`posthog-node@^5.11.2` ↗︎](https://www.npmjs.com/package/posthog-node/v/5.11.2) (from `^4.18.0`, in `dependencies`)
|
|
39
|
+
|
|
40
|
+
- Update MainSidebar component to fit required changes in Cloud CTA link ([#9318](https://github.com/mastra-ai/mastra/pull/9318))
|
|
41
|
+
|
|
42
|
+
- Fix default value showing on workflow form after user submits ([#10983](https://github.com/mastra-ai/mastra/pull/10983))
|
|
43
|
+
|
|
44
|
+
- Auto resume suspended tools if `autoResumeSuspendedTools: true` ([#11157](https://github.com/mastra-ai/mastra/pull/11157))
|
|
45
|
+
|
|
46
|
+
The flag can be added to `defaultAgentOptions` when creating the agent or to options in `agent.stream` or `agent.generate`
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
const agent = new Agent({
|
|
50
|
+
//...agent information,
|
|
51
|
+
defaultAgentOptions: {
|
|
52
|
+
autoResumeSuspendedTools: true,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- Make MainSidebar toggle button sticky to bottom, always visible ([#9682](https://github.com/mastra-ai/mastra/pull/9682))
|
|
58
|
+
|
|
59
|
+
- Add human-in-the-loop (HITL) support to agent networks ([#11678](https://github.com/mastra-ai/mastra/pull/11678))
|
|
60
|
+
- Add suspend/resume capabilities to agent network
|
|
61
|
+
- Enable auto-resume for suspended network execution via `autoResumeSuspendedTools`
|
|
62
|
+
|
|
63
|
+
`agent.resumeNetwork`, `agent.approveNetworkToolCall`, `agent.declineNetworkToolCall`
|
|
64
|
+
|
|
65
|
+
- 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))
|
|
66
|
+
- Updated `dotenv` from `^17.2.1` to `^16.4.5`
|
|
67
|
+
- Updated `zod` from `^3.25.76` to `^3.25.67`
|
|
68
|
+
|
|
69
|
+
This ensures `npx create-mastra@latest --template browsing-agent` can be installed and run without peer dependency errors.
|
|
70
|
+
|
|
71
|
+
- Detect bun runtime and cleanup on failure ([#10242](https://github.com/mastra-ai/mastra/pull/10242))
|
|
72
|
+
|
|
73
|
+
- Add `Run` instance to client-js. `workflow.createRun` returns the `Run` instance which can be used for the different run methods. ([#11207](https://github.com/mastra-ai/mastra/pull/11207))
|
|
74
|
+
With this change, run methods cannot be called directly on workflow instance anymore
|
|
75
|
+
|
|
76
|
+
```diff
|
|
77
|
+
- const result = await workflow.stream({ runId: '123', inputData: { ... } });
|
|
78
|
+
+ const run = await workflow.createRun({ runId: '123' });
|
|
79
|
+
+ const stream = await run.stream({ inputData: { ... } });
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- Add timeTravel APIs and add timeTravel feature to studio ([#10361](https://github.com/mastra-ai/mastra/pull/10361))
|
|
83
|
+
|
|
84
|
+
- Add debugger-like click-through UI to workflow graph ([#11350](https://github.com/mastra-ai/mastra/pull/11350))
|
|
85
|
+
|
|
86
|
+
- Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
await workflow.deleteWorkflowRunById(runId);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- Add initial state input to workflow form in studio ([#11560](https://github.com/mastra-ai/mastra/pull/11560))
|
|
93
|
+
|
|
94
|
+
- Make initialState optional in studio ([#11744](https://github.com/mastra-ai/mastra/pull/11744))
|
|
95
|
+
|
|
96
|
+
- Fix discriminatedUnion schema information lost when json schema is converted to zod ([#10500](https://github.com/mastra-ai/mastra/pull/10500))
|
|
97
|
+
|
|
98
|
+
- Move useScorers down to trace page to trigger it once for all trace spans ([#10985](https://github.com/mastra-ai/mastra/pull/10985))
|
|
99
|
+
|
|
100
|
+
- Update Observability Trace Spans list UI, so a user can expand/collapse span children/descendants and can filter the list by span type or name ([#10378](https://github.com/mastra-ai/mastra/pull/10378))
|
|
101
|
+
|
|
102
|
+
- Fix workflow trigger form overflow ([#10986](https://github.com/mastra-ai/mastra/pull/10986))
|
|
103
|
+
|
|
104
|
+
- Fix scorer filtering for SpanScoring, add error and info message for user ([#10160](https://github.com/mastra-ai/mastra/pull/10160))
|
|
105
|
+
|
|
106
|
+
- Hide time travel on map steps in Studio ([#10631](https://github.com/mastra-ai/mastra/pull/10631))
|
|
107
|
+
|
|
108
|
+
- Fix double scroll on agent chat container ([#10253](https://github.com/mastra-ai/mastra/pull/10253))
|
|
109
|
+
|
|
110
|
+
- Display network completion validation results and scorer feedback in the Playground when viewing agent network runs, letting users see pass/fail status and actionable feedback from completion scorers ([#11562](https://github.com/mastra-ai/mastra/pull/11562))
|
|
111
|
+
|
|
112
|
+
- 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))
|
|
113
|
+
|
|
114
|
+
## 1.0.0-beta.19
|
|
115
|
+
|
|
116
|
+
## 1.0.0-beta.18
|
|
117
|
+
|
|
118
|
+
## 1.0.0-beta.17
|
|
119
|
+
|
|
120
|
+
## 1.0.0-beta.16
|
|
121
|
+
|
|
122
|
+
## 1.0.0-beta.15
|
|
123
|
+
|
|
124
|
+
### Patch Changes
|
|
125
|
+
|
|
126
|
+
- Add human-in-the-loop (HITL) support to agent networks ([#11678](https://github.com/mastra-ai/mastra/pull/11678))
|
|
127
|
+
- Add suspend/resume capabilities to agent network
|
|
128
|
+
- Enable auto-resume for suspended network execution via `autoResumeSuspendedTools`
|
|
129
|
+
|
|
130
|
+
`agent.resumeNetwork`, `agent.approveNetworkToolCall`, `agent.declineNetworkToolCall`
|
|
131
|
+
|
|
132
|
+
## 1.0.0-beta.14
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- Replace deprecated client.getTraces with a client.listTraces ([#11711](https://github.com/mastra-ai/mastra/pull/11711))
|
|
137
|
+
|
|
138
|
+
- dependencies updates: ([#11642](https://github.com/mastra-ai/mastra/pull/11642))
|
|
139
|
+
- Updated dependency [`fs-extra@^11.3.3` ↗︎](https://www.npmjs.com/package/fs-extra/v/11.3.3) (from `^11.3.2`, in `dependencies`)
|
|
140
|
+
|
|
141
|
+
- Make initialState optional in studio ([#11744](https://github.com/mastra-ai/mastra/pull/11744))
|
|
142
|
+
|
|
143
|
+
## 1.0.0-beta.13
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Remove `streamVNext`, `resumeStreamVNext`, and `observeStreamVNext` methods, call `stream`, `resumeStream` and `observeStream` directly ([#11499](https://github.com/mastra-ai/mastra/pull/11499))
|
|
148
|
+
|
|
149
|
+
```diff
|
|
150
|
+
+ const run = await workflow.createRun({ runId: '123' });
|
|
151
|
+
- const stream = await run.streamVNext({ inputData: { ... } });
|
|
152
|
+
+ const stream = await run.stream({ inputData: { ... } });
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
- 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))
|
|
156
|
+
- Updated `dotenv` from `^17.2.1` to `^16.4.5`
|
|
157
|
+
- Updated `zod` from `^3.25.76` to `^3.25.67`
|
|
158
|
+
|
|
159
|
+
This ensures `npx create-mastra@latest --template browsing-agent` can be installed and run without peer dependency errors.
|
|
160
|
+
|
|
161
|
+
- Add initial state input to workflow form in studio ([#11560](https://github.com/mastra-ai/mastra/pull/11560))
|
|
162
|
+
|
|
163
|
+
- Display network completion validation results and scorer feedback in the Playground when viewing agent network runs, letting users see pass/fail status and actionable feedback from completion scorers ([#11562](https://github.com/mastra-ai/mastra/pull/11562))
|
|
164
|
+
|
|
165
|
+
## 1.0.0-beta.12
|
|
166
|
+
|
|
167
|
+
### Minor Changes
|
|
168
|
+
|
|
169
|
+
- Add Antigravity IDE support to create-mastra CLI. Users can now select Antigravity during project initialization and automatically configure the global Mastra MCP server for the IDE, reducing manual setup and enabling immediate use of Mastra agents. ([#11374](https://github.com/mastra-ai/mastra/pull/11374))
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- Add debugger-like click-through UI to workflow graph ([#11350](https://github.com/mastra-ai/mastra/pull/11350))
|
|
174
|
+
|
|
175
|
+
## 1.0.0-beta.11
|
|
176
|
+
|
|
177
|
+
## 1.0.0-beta.10
|
|
178
|
+
|
|
179
|
+
### Patch Changes
|
|
180
|
+
|
|
181
|
+
- Auto resume suspended tools if `autoResumeSuspendedTools: true` ([#11157](https://github.com/mastra-ai/mastra/pull/11157))
|
|
182
|
+
|
|
183
|
+
The flag can be added to `defaultAgentOptions` when creating the agent or to options in `agent.stream` or `agent.generate`
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
const agent = new Agent({
|
|
187
|
+
//...agent information,
|
|
188
|
+
defaultAgentOptions: {
|
|
189
|
+
autoResumeSuspendedTools: true,
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
- Add `Run` instance to client-js. `workflow.createRun` returns the `Run` instance which can be used for the different run methods. ([#11207](https://github.com/mastra-ai/mastra/pull/11207))
|
|
195
|
+
With this change, run methods cannot be called directly on workflow instance anymore
|
|
196
|
+
|
|
197
|
+
```diff
|
|
198
|
+
- const result = await workflow.stream({ runId: '123', inputData: { ... } });
|
|
199
|
+
+ const run = await workflow.createRun({ runId: '123' });
|
|
200
|
+
+ const stream = await run.stream({ inputData: { ... } });
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
- 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))
|
|
204
|
+
|
|
205
|
+
## 1.0.0-beta.9
|
|
206
|
+
|
|
3
207
|
## 1.0.0-beta.8
|
|
4
208
|
|
|
5
209
|
### 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
|
|
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
|
@@ -105,6 +105,10 @@ var PosthogAnalytics = class {
|
|
|
105
105
|
machine_id: os.hostname()
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
+
getDurationMs(startTime) {
|
|
109
|
+
const [seconds, nanoseconds] = process.hrtime(startTime);
|
|
110
|
+
return seconds * 1e3 + nanoseconds / 1e6;
|
|
111
|
+
}
|
|
108
112
|
captureSessionStart() {
|
|
109
113
|
if (!this.client) {
|
|
110
114
|
return;
|
|
@@ -173,8 +177,7 @@ var PosthogAnalytics = class {
|
|
|
173
177
|
const startTime = process.hrtime();
|
|
174
178
|
try {
|
|
175
179
|
const result = await execution();
|
|
176
|
-
const
|
|
177
|
-
const durationMs = seconds * 1e3 + nanoseconds / 1e6;
|
|
180
|
+
const durationMs = this.getDurationMs(startTime);
|
|
178
181
|
this.trackCommand({
|
|
179
182
|
command,
|
|
180
183
|
args,
|
|
@@ -184,8 +187,7 @@ var PosthogAnalytics = class {
|
|
|
184
187
|
});
|
|
185
188
|
return result;
|
|
186
189
|
} catch (error) {
|
|
187
|
-
const
|
|
188
|
-
const durationMs = seconds * 1e3 + nanoseconds / 1e6;
|
|
190
|
+
const durationMs = this.getDurationMs(startTime);
|
|
189
191
|
this.trackCommand({
|
|
190
192
|
command,
|
|
191
193
|
args,
|
|
@@ -1231,7 +1233,7 @@ var PinoLogger = class _PinoLogger extends MastraLogger {
|
|
|
1231
1233
|
};
|
|
1232
1234
|
|
|
1233
1235
|
var package_default = {
|
|
1234
|
-
version: "1.0.0
|
|
1236
|
+
version: "1.0.0"};
|
|
1235
1237
|
function getPackageManagerAddCommand(pm) {
|
|
1236
1238
|
switch (pm) {
|
|
1237
1239
|
case "npm":
|
|
@@ -1252,7 +1254,7 @@ var DepsService = class {
|
|
|
1252
1254
|
this.packageManager = this.getPackageManager();
|
|
1253
1255
|
}
|
|
1254
1256
|
findLockFile(dir) {
|
|
1255
|
-
const lockFiles = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock", "bun.lock"];
|
|
1257
|
+
const lockFiles = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock", "bun.lock", "bun.lockb"];
|
|
1256
1258
|
for (const file of lockFiles) {
|
|
1257
1259
|
if (fs3__default__default.existsSync(path3.join(dir, file))) {
|
|
1258
1260
|
return file;
|
|
@@ -1274,6 +1276,7 @@ var DepsService = class {
|
|
|
1274
1276
|
case "yarn.lock":
|
|
1275
1277
|
return "yarn";
|
|
1276
1278
|
case "bun.lock":
|
|
1279
|
+
case "bun.lockb":
|
|
1277
1280
|
return "bun";
|
|
1278
1281
|
default:
|
|
1279
1282
|
return "npm";
|
|
@@ -1491,6 +1494,7 @@ async function writeMergedConfig(configPath, editor, versionTag) {
|
|
|
1491
1494
|
});
|
|
1492
1495
|
}
|
|
1493
1496
|
var windsurfGlobalMCPConfigPath = path3.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
1497
|
+
var antigravityGlobalMCPConfigPath = path3.join(os.homedir(), ".gemini", "antigravity", "mcp_config.json");
|
|
1494
1498
|
var cursorGlobalMCPConfigPath = path3.join(os.homedir(), ".cursor", "mcp.json");
|
|
1495
1499
|
path3.join(process.cwd(), ".vscode", "mcp.json");
|
|
1496
1500
|
var vscodeGlobalMCPConfigPath = path3.join(
|
|
@@ -1522,11 +1526,20 @@ async function installMastraDocsMCPServer({
|
|
|
1522
1526
|
}
|
|
1523
1527
|
await writeMergedConfig(windsurfGlobalMCPConfigPath, editor, versionTag);
|
|
1524
1528
|
}
|
|
1529
|
+
if (editor === `antigravity`) {
|
|
1530
|
+
const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);
|
|
1531
|
+
if (alreadyInstalled) {
|
|
1532
|
+
return;
|
|
1533
|
+
}
|
|
1534
|
+
await writeMergedConfig(antigravityGlobalMCPConfigPath, editor, versionTag);
|
|
1535
|
+
}
|
|
1525
1536
|
}
|
|
1526
1537
|
async function globalMCPIsAlreadyInstalled(editor, versionTag) {
|
|
1527
1538
|
let configPath = ``;
|
|
1528
1539
|
if (editor === "windsurf") {
|
|
1529
1540
|
configPath = windsurfGlobalMCPConfigPath;
|
|
1541
|
+
} else if (editor === "antigravity") {
|
|
1542
|
+
configPath = antigravityGlobalMCPConfigPath;
|
|
1530
1543
|
} else if (editor === "cursor-global") {
|
|
1531
1544
|
configPath = cursorGlobalMCPConfigPath;
|
|
1532
1545
|
} else if (editor === "vscode") {
|
|
@@ -1590,7 +1603,6 @@ async function writeAgentSample(llmProvider, destPath, addExampleTool, addScorer
|
|
|
1590
1603
|
const content = `
|
|
1591
1604
|
import { Agent } from '@mastra/core/agent';
|
|
1592
1605
|
import { Memory } from '@mastra/memory';
|
|
1593
|
-
import { LibSQLStore } from '@mastra/libsql';
|
|
1594
1606
|
${addExampleTool ? `import { weatherTool } from '../tools/weather-tool';` : ""}
|
|
1595
1607
|
${addScorers ? `import { scorers } from '../scorers/weather-scorer';` : ""}
|
|
1596
1608
|
|
|
@@ -1623,12 +1635,7 @@ export const weatherAgent = new Agent({
|
|
|
1623
1635
|
},
|
|
1624
1636
|
},
|
|
1625
1637
|
},` : ""}
|
|
1626
|
-
memory: new Memory(
|
|
1627
|
-
storage: new LibSQLStore({
|
|
1628
|
-
id: "memory-storage",
|
|
1629
|
-
url: "file:../mastra.db", // path is relative to the .mastra/output directory
|
|
1630
|
-
})
|
|
1631
|
-
})
|
|
1638
|
+
memory: new Memory()
|
|
1632
1639
|
});
|
|
1633
1640
|
`;
|
|
1634
1641
|
const formattedContent = await prettier.format(content, {
|
|
@@ -1979,7 +1986,7 @@ export const mastra = new Mastra()
|
|
|
1979
1986
|
import { Mastra } from '@mastra/core/mastra';
|
|
1980
1987
|
import { PinoLogger } from '@mastra/loggers';
|
|
1981
1988
|
import { LibSQLStore } from '@mastra/libsql';
|
|
1982
|
-
import { Observability } from '@mastra/observability';
|
|
1989
|
+
import { Observability, DefaultExporter, CloudExporter, SensitiveDataFilter } from '@mastra/observability';
|
|
1983
1990
|
${addWorkflow ? `import { weatherWorkflow } from './workflows/weather-workflow';` : ""}
|
|
1984
1991
|
${addAgent ? `import { weatherAgent } from './agents/weather-agent';` : ""}
|
|
1985
1992
|
${addScorers ? `import { toolCallAppropriatenessScorer, completenessScorer, translationScorer } from './scorers/weather-scorer';` : ""}
|
|
@@ -1996,9 +2003,19 @@ export const mastra = new Mastra({
|
|
|
1996
2003
|
level: 'info',
|
|
1997
2004
|
}),
|
|
1998
2005
|
observability: new Observability({
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2006
|
+
configs: {
|
|
2007
|
+
default: {
|
|
2008
|
+
serviceName: 'mastra',
|
|
2009
|
+
exporters: [
|
|
2010
|
+
new DefaultExporter(), // Persists traces to storage for Mastra Studio
|
|
2011
|
+
new CloudExporter(), // Sends traces to Mastra Cloud (if MASTRA_CLOUD_ACCESS_TOKEN is set)
|
|
2012
|
+
],
|
|
2013
|
+
spanOutputProcessors: [
|
|
2014
|
+
new SensitiveDataFilter(), // Redacts sensitive data like passwords, tokens, keys
|
|
2015
|
+
],
|
|
2016
|
+
},
|
|
2017
|
+
},
|
|
2018
|
+
}),
|
|
2002
2019
|
});
|
|
2003
2020
|
`
|
|
2004
2021
|
);
|
|
@@ -2120,6 +2137,10 @@ var interactivePrompt = async (args = {}) => {
|
|
|
2120
2137
|
{
|
|
2121
2138
|
value: "vscode",
|
|
2122
2139
|
label: "VSCode"
|
|
2140
|
+
},
|
|
2141
|
+
{
|
|
2142
|
+
value: "antigravity",
|
|
2143
|
+
label: "Antigravity"
|
|
2123
2144
|
}
|
|
2124
2145
|
]
|
|
2125
2146
|
});
|
|
@@ -2156,9 +2177,23 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
2156
2177
|
return void 0;
|
|
2157
2178
|
}
|
|
2158
2179
|
}
|
|
2180
|
+
if (editor === `antigravity`) {
|
|
2181
|
+
const confirm3 = await ve({
|
|
2182
|
+
message: `Antigravity only supports a global MCP config (at ${antigravityGlobalMCPConfigPath}). Is it ok to add/update that global config?
|
|
2183
|
+
This will make the Mastra docs MCP server available in all Antigravity projects.`,
|
|
2184
|
+
options: [
|
|
2185
|
+
{ value: "yes", label: "Yes, I understand" },
|
|
2186
|
+
{ value: "skip", label: "No, skip for now" }
|
|
2187
|
+
]
|
|
2188
|
+
});
|
|
2189
|
+
if (confirm3 !== `yes`) {
|
|
2190
|
+
return void 0;
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2159
2193
|
return editor;
|
|
2160
2194
|
},
|
|
2161
2195
|
initGit: async () => {
|
|
2196
|
+
if (skip?.gitInit) return false;
|
|
2162
2197
|
return ye({
|
|
2163
2198
|
message: "Initialize a new git repository?",
|
|
2164
2199
|
initialValue: true
|
|
@@ -2549,6 +2584,42 @@ async function initializePackageJson(pm) {
|
|
|
2549
2584
|
};
|
|
2550
2585
|
await fs4.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
2551
2586
|
}
|
|
2587
|
+
var writeReadmeFile = async ({ dirPath, projectName }) => {
|
|
2588
|
+
const packageManager = getPackageManager();
|
|
2589
|
+
const readmePath = path3.join(dirPath, "README.md");
|
|
2590
|
+
const content = `# ${projectName}
|
|
2591
|
+
|
|
2592
|
+
Welcome to your new [Mastra](https://mastra.ai/) project! We're excited to see what you'll build.
|
|
2593
|
+
|
|
2594
|
+
## Getting Started
|
|
2595
|
+
|
|
2596
|
+
Start the development server:
|
|
2597
|
+
|
|
2598
|
+
\`\`\`shell
|
|
2599
|
+
${packageManager} run dev
|
|
2600
|
+
\`\`\`
|
|
2601
|
+
|
|
2602
|
+
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.
|
|
2603
|
+
|
|
2604
|
+
You can start editing files inside the \`src/mastra\` directory. The development server will automatically reload whenever you make changes.
|
|
2605
|
+
|
|
2606
|
+
## Learn more
|
|
2607
|
+
|
|
2608
|
+
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).
|
|
2609
|
+
|
|
2610
|
+
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.
|
|
2611
|
+
|
|
2612
|
+
## Deploy on Mastra Cloud
|
|
2613
|
+
|
|
2614
|
+
[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.
|
|
2615
|
+
|
|
2616
|
+
Check out the [deployment guide](https://mastra.ai/docs/deployment/overview) for more details.`;
|
|
2617
|
+
const formattedContent = await prettier.format(content, {
|
|
2618
|
+
parser: "markdown",
|
|
2619
|
+
singleQuote: true
|
|
2620
|
+
});
|
|
2621
|
+
await fs4.writeFile(readmePath, formattedContent);
|
|
2622
|
+
};
|
|
2552
2623
|
async function installMastraDependency(pm, dependency, versionTag, isDev, timeout) {
|
|
2553
2624
|
let installCommand = getPackageManagerAddCommand(pm);
|
|
2554
2625
|
if (isDev) {
|
|
@@ -2631,6 +2702,7 @@ var createMastraProject = async ({
|
|
|
2631
2702
|
build: "mastra build",
|
|
2632
2703
|
start: "mastra start"
|
|
2633
2704
|
});
|
|
2705
|
+
await writeReadmeFile({ dirPath: process.cwd(), projectName });
|
|
2634
2706
|
} catch (error) {
|
|
2635
2707
|
throw new Error(
|
|
2636
2708
|
`Failed to initialize project structure: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
@@ -3019,7 +3091,7 @@ program.version(`${version}`, "-v, --version").description(`create-mastra ${vers
|
|
|
3019
3091
|
program.name("create-mastra").description("Create a new Mastra project").argument("[project-name]", "Directory name of the project").option(
|
|
3020
3092
|
"-p, --project-name <string>",
|
|
3021
3093
|
"Project name that will be used in package.json and as the project directory name."
|
|
3022
|
-
).option("--default", "Quick start with defaults (src, OpenAI, examples)").option("-c, --components <components>", "Comma-separated list of components (agents, tools, workflows, scorers)").option("-l, --llm <model-provider>", "Default model provider (openai, anthropic, groq, google, or cerebras)").option("-k, --llm-api-key <api-key>", "API key for the model provider").option("-e, --example", "Include example code").option("-n, --no-example", "Do not include example code").option("-t, --timeout [timeout]", "Configurable timeout for package installation, defaults to 60000 ms").option("-d, --dir <directory>", "Target directory for Mastra source code (default: src/)").option("-m, --mcp <mcp>", "MCP Server for code editor (cursor, cursor-global, windsurf, vscode)").option(
|
|
3094
|
+
).option("--default", "Quick start with defaults (src, OpenAI, examples)").option("-c, --components <components>", "Comma-separated list of components (agents, tools, workflows, scorers)").option("-l, --llm <model-provider>", "Default model provider (openai, anthropic, groq, google, or cerebras)").option("-k, --llm-api-key <api-key>", "API key for the model provider").option("-e, --example", "Include example code").option("-n, --no-example", "Do not include example code").option("-t, --timeout [timeout]", "Configurable timeout for package installation, defaults to 60000 ms").option("-d, --dir <directory>", "Target directory for Mastra source code (default: src/)").option("-m, --mcp <mcp>", "MCP Server for code editor (cursor, cursor-global, windsurf, vscode, antigravity)").option(
|
|
3023
3095
|
"--template [template-name]",
|
|
3024
3096
|
"Create project from a template (use template name, public GitHub URL, or leave blank to select from list)"
|
|
3025
3097
|
).action(async (projectNameArg, args) => {
|