mastra 0.6.0-alpha.3 → 0.6.0-alpha.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/dist/{chunk-A5NF2IHE.js → chunk-YW5YUAZU.js} +51 -8
- package/dist/commands/create/create.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +8 -8
- package/src/playground/dist/assets/{index-D4hBgr2X.js → index-B2CC8cnf.js} +134 -134
- package/src/playground/dist/assets/{index-BfLOMQRu.js → index-CKYrVAtT.js} +1 -1
- package/src/playground/dist/assets/{index-RS5aw-dw.js → index-fwFn3zNW.js} +1 -1
- package/src/playground/dist/index.html +1 -1
|
@@ -185,20 +185,41 @@ async function writeMergedConfig(configPath) {
|
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
var windsurfGlobalMCPConfigPath = path.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
188
|
+
var cursorGlobalMCPConfigPath = path.join(os.homedir(), ".cursor", "mcp.json");
|
|
188
189
|
async function installMastraDocsMCPServer({
|
|
189
190
|
editor,
|
|
190
191
|
directory
|
|
191
192
|
}) {
|
|
192
|
-
if (editor === `cursor`)
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
if (editor === `cursor`) {
|
|
194
|
+
await writeMergedConfig(path.join(directory, ".cursor", "mcp.json"));
|
|
195
|
+
}
|
|
196
|
+
if (editor === `cursor-global`) {
|
|
197
|
+
const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor);
|
|
198
|
+
if (alreadyInstalled) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
await writeMergedConfig(cursorGlobalMCPConfigPath);
|
|
202
|
+
}
|
|
203
|
+
if (editor === `windsurf`) {
|
|
204
|
+
const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor);
|
|
205
|
+
if (alreadyInstalled) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
await writeMergedConfig(windsurfGlobalMCPConfigPath);
|
|
209
|
+
}
|
|
195
210
|
}
|
|
196
|
-
async function
|
|
197
|
-
|
|
211
|
+
async function globalMCPIsAlreadyInstalled(editor) {
|
|
212
|
+
let configPath = ``;
|
|
213
|
+
if (editor === "windsurf") {
|
|
214
|
+
configPath = windsurfGlobalMCPConfigPath;
|
|
215
|
+
} else if (editor === "cursor-global") {
|
|
216
|
+
configPath = cursorGlobalMCPConfigPath;
|
|
217
|
+
}
|
|
218
|
+
if (!configPath || !existsSync(configPath)) {
|
|
198
219
|
return false;
|
|
199
220
|
}
|
|
200
221
|
try {
|
|
201
|
-
const configContents = await readJSON(
|
|
222
|
+
const configContents = await readJSON(configPath);
|
|
202
223
|
if (!configContents?.mcpServers) return false;
|
|
203
224
|
const hasMastraMCP = Object.values(configContents.mcpServers).some(
|
|
204
225
|
(server) => server?.args?.find((arg) => arg?.includes(`@mastra/mcp-docs-server`))
|
|
@@ -810,12 +831,22 @@ var interactivePrompt = async () => {
|
|
|
810
831
|
initialValue: false
|
|
811
832
|
}),
|
|
812
833
|
configureEditorWithDocsMCP: async () => {
|
|
813
|
-
const windsurfIsAlreadyInstalled = await
|
|
834
|
+
const windsurfIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`windsurf`);
|
|
835
|
+
const cursorIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`cursor`);
|
|
814
836
|
const editor = await p.select({
|
|
815
837
|
message: `Make your AI IDE into a Mastra expert? (installs Mastra docs MCP server)`,
|
|
816
838
|
options: [
|
|
817
839
|
{ value: "skip", label: "Skip for now", hint: "default" },
|
|
818
|
-
{
|
|
840
|
+
{
|
|
841
|
+
value: "cursor",
|
|
842
|
+
label: "Cursor (project only)",
|
|
843
|
+
hint: cursorIsAlreadyInstalled ? `Already installed globally` : void 0
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
value: "cursor-global",
|
|
847
|
+
label: "Cursor (global, all projects)",
|
|
848
|
+
hint: cursorIsAlreadyInstalled ? `Already installed` : void 0
|
|
849
|
+
},
|
|
819
850
|
{
|
|
820
851
|
value: "windsurf",
|
|
821
852
|
label: "Windsurf",
|
|
@@ -836,6 +867,18 @@ Note: you will need to go into Cursor Settings -> MCP Settings and manually enab
|
|
|
836
867
|
`
|
|
837
868
|
);
|
|
838
869
|
}
|
|
870
|
+
if (editor === `cursor-global`) {
|
|
871
|
+
const confirm2 = await p.select({
|
|
872
|
+
message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
|
|
873
|
+
options: [
|
|
874
|
+
{ value: "yes", label: "Yes, I understand" },
|
|
875
|
+
{ value: "skip", label: "No, skip for now" }
|
|
876
|
+
]
|
|
877
|
+
});
|
|
878
|
+
if (confirm2 !== `yes`) {
|
|
879
|
+
return void 0;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
839
882
|
if (editor === `windsurf`) {
|
|
840
883
|
const confirm2 = await p.select({
|
|
841
884
|
message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { create } from '../../chunk-
|
|
1
|
+
export { create } from '../../chunk-YW5YUAZU.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
import { PosthogAnalytics } from './chunk-7OXWUU2Q.js';
|
|
3
3
|
export { PosthogAnalytics } from './chunk-7OXWUU2Q.js';
|
|
4
|
-
import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, convertToViteEnvVar, FileService as FileService$1 } from './chunk-
|
|
5
|
-
export { create } from './chunk-
|
|
4
|
+
import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, convertToViteEnvVar, FileService as FileService$1 } from './chunk-YW5YUAZU.js';
|
|
5
|
+
export { create } from './chunk-YW5YUAZU.js';
|
|
6
6
|
import { Command } from 'commander';
|
|
7
7
|
import { config } from 'dotenv';
|
|
8
8
|
import { join as join$1, dirname } from 'node:path';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mastra",
|
|
3
|
-
"version": "0.6.0-alpha.
|
|
3
|
+
"version": "0.6.0-alpha.5",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"description": "cli for mastra",
|
|
6
6
|
"type": "module",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"yocto-spinner": "^0.1.2",
|
|
55
55
|
"zod": "^3.24.2",
|
|
56
56
|
"zod-to-json-schema": "^3.24.3",
|
|
57
|
-
"@mastra/
|
|
58
|
-
"@mastra/
|
|
57
|
+
"@mastra/core": "^0.9.1-alpha.4",
|
|
58
|
+
"@mastra/deployer": "^0.3.1-alpha.4"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@microsoft/api-extractor": "^7.52.
|
|
61
|
+
"@microsoft/api-extractor": "^7.52.5",
|
|
62
62
|
"@types/fs-extra": "^11.0.4",
|
|
63
63
|
"@types/node": "^20.17.27",
|
|
64
64
|
"@types/prompt": "^1.1.9",
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"eslint": "^9.23.0",
|
|
68
68
|
"memfs": "^4.17.0",
|
|
69
69
|
"npm-run-all2": "^7.0.2",
|
|
70
|
-
"rollup": "^4.
|
|
70
|
+
"rollup": "^4.40.1",
|
|
71
71
|
"tsup": "^8.4.0",
|
|
72
72
|
"type-fest": "^4.37.0",
|
|
73
73
|
"typescript": "^5.8.2",
|
|
74
|
-
"vitest": "^3.
|
|
74
|
+
"vitest": "^3.1.2",
|
|
75
|
+
"@mastra/client-js": "0.1.19-alpha.4",
|
|
75
76
|
"@internal/lint": "0.0.2",
|
|
76
|
-
"@mastra/
|
|
77
|
-
"@mastra/playground-ui": "5.0.1-alpha.3"
|
|
77
|
+
"@mastra/playground-ui": "5.0.1-alpha.4"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"build": "npm-run-all --serial build:lib copy-starter-files copy-templates build:playground",
|