create-mastra 1.0.0-beta.10 → 1.0.0-beta.12
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 +12 -0
- package/dist/index.js +38 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# create-mastra
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.12
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Add debugger-like click-through UI to workflow graph ([#11350](https://github.com/mastra-ai/mastra/pull/11350))
|
|
12
|
+
|
|
13
|
+
## 1.0.0-beta.11
|
|
14
|
+
|
|
3
15
|
## 1.0.0-beta.10
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
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-beta.
|
|
1236
|
+
version: "1.0.0-beta.12"};
|
|
1235
1237
|
function getPackageManagerAddCommand(pm) {
|
|
1236
1238
|
switch (pm) {
|
|
1237
1239
|
case "npm":
|
|
@@ -1491,6 +1493,7 @@ async function writeMergedConfig(configPath, editor, versionTag) {
|
|
|
1491
1493
|
});
|
|
1492
1494
|
}
|
|
1493
1495
|
var windsurfGlobalMCPConfigPath = path3.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
1496
|
+
var antigravityGlobalMCPConfigPath = path3.join(os.homedir(), ".gemini", "antigravity", "mcp_config.json");
|
|
1494
1497
|
var cursorGlobalMCPConfigPath = path3.join(os.homedir(), ".cursor", "mcp.json");
|
|
1495
1498
|
path3.join(process.cwd(), ".vscode", "mcp.json");
|
|
1496
1499
|
var vscodeGlobalMCPConfigPath = path3.join(
|
|
@@ -1522,11 +1525,20 @@ async function installMastraDocsMCPServer({
|
|
|
1522
1525
|
}
|
|
1523
1526
|
await writeMergedConfig(windsurfGlobalMCPConfigPath, editor, versionTag);
|
|
1524
1527
|
}
|
|
1528
|
+
if (editor === `antigravity`) {
|
|
1529
|
+
const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);
|
|
1530
|
+
if (alreadyInstalled) {
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1533
|
+
await writeMergedConfig(antigravityGlobalMCPConfigPath, editor, versionTag);
|
|
1534
|
+
}
|
|
1525
1535
|
}
|
|
1526
1536
|
async function globalMCPIsAlreadyInstalled(editor, versionTag) {
|
|
1527
1537
|
let configPath = ``;
|
|
1528
1538
|
if (editor === "windsurf") {
|
|
1529
1539
|
configPath = windsurfGlobalMCPConfigPath;
|
|
1540
|
+
} else if (editor === "antigravity") {
|
|
1541
|
+
configPath = antigravityGlobalMCPConfigPath;
|
|
1530
1542
|
} else if (editor === "cursor-global") {
|
|
1531
1543
|
configPath = cursorGlobalMCPConfigPath;
|
|
1532
1544
|
} else if (editor === "vscode") {
|
|
@@ -1590,7 +1602,6 @@ async function writeAgentSample(llmProvider, destPath, addExampleTool, addScorer
|
|
|
1590
1602
|
const content = `
|
|
1591
1603
|
import { Agent } from '@mastra/core/agent';
|
|
1592
1604
|
import { Memory } from '@mastra/memory';
|
|
1593
|
-
import { LibSQLStore } from '@mastra/libsql';
|
|
1594
1605
|
${addExampleTool ? `import { weatherTool } from '../tools/weather-tool';` : ""}
|
|
1595
1606
|
${addScorers ? `import { scorers } from '../scorers/weather-scorer';` : ""}
|
|
1596
1607
|
|
|
@@ -1623,12 +1634,7 @@ export const weatherAgent = new Agent({
|
|
|
1623
1634
|
},
|
|
1624
1635
|
},
|
|
1625
1636
|
},` : ""}
|
|
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
|
-
})
|
|
1637
|
+
memory: new Memory()
|
|
1632
1638
|
});
|
|
1633
1639
|
`;
|
|
1634
1640
|
const formattedContent = await prettier.format(content, {
|
|
@@ -1998,7 +2004,7 @@ export const mastra = new Mastra({
|
|
|
1998
2004
|
observability: new Observability({
|
|
1999
2005
|
// Enables DefaultExporter and CloudExporter for tracing
|
|
2000
2006
|
default: { enabled: true },
|
|
2001
|
-
|
|
2007
|
+
}),
|
|
2002
2008
|
});
|
|
2003
2009
|
`
|
|
2004
2010
|
);
|
|
@@ -2120,6 +2126,10 @@ var interactivePrompt = async (args = {}) => {
|
|
|
2120
2126
|
{
|
|
2121
2127
|
value: "vscode",
|
|
2122
2128
|
label: "VSCode"
|
|
2129
|
+
},
|
|
2130
|
+
{
|
|
2131
|
+
value: "antigravity",
|
|
2132
|
+
label: "Antigravity"
|
|
2123
2133
|
}
|
|
2124
2134
|
]
|
|
2125
2135
|
});
|
|
@@ -2156,9 +2166,23 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
2156
2166
|
return void 0;
|
|
2157
2167
|
}
|
|
2158
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?
|
|
2172
|
+
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;
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2159
2182
|
return editor;
|
|
2160
2183
|
},
|
|
2161
2184
|
initGit: async () => {
|
|
2185
|
+
if (skip?.gitInit) return false;
|
|
2162
2186
|
return ye({
|
|
2163
2187
|
message: "Initialize a new git repository?",
|
|
2164
2188
|
initialValue: true
|
|
@@ -3019,7 +3043,7 @@ program.version(`${version}`, "-v, --version").description(`create-mastra ${vers
|
|
|
3019
3043
|
program.name("create-mastra").description("Create a new Mastra project").argument("[project-name]", "Directory name of the project").option(
|
|
3020
3044
|
"-p, --project-name <string>",
|
|
3021
3045
|
"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(
|
|
3046
|
+
).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
3047
|
"--template [template-name]",
|
|
3024
3048
|
"Create project from a template (use template name, public GitHub URL, or leave blank to select from list)"
|
|
3025
3049
|
).action(async (projectNameArg, args) => {
|