mastra 0.10.1-alpha.5 → 0.10.1

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.
@@ -5,7 +5,7 @@ import util from 'node:util';
5
5
  import * as fs3 from 'fs';
6
6
  import fs3__default, { existsSync } from 'fs';
7
7
  import fs4 from 'fs/promises';
8
- import path, { dirname } from 'path';
8
+ import path2, { dirname } from 'path';
9
9
  import { fileURLToPath } from 'url';
10
10
  import { execa } from 'execa';
11
11
  import fsExtra3, { readJSON, ensureFile, writeJSON } from 'fs-extra/esm';
@@ -24,11 +24,11 @@ var DepsService = class {
24
24
  findLockFile(dir) {
25
25
  const lockFiles = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock", "bun.lock"];
26
26
  for (const file of lockFiles) {
27
- if (fs3__default.existsSync(path.join(dir, file))) {
27
+ if (fs3__default.existsSync(path2.join(dir, file))) {
28
28
  return file;
29
29
  }
30
30
  }
31
- const parentDir = path.resolve(dir, "..");
31
+ const parentDir = path2.resolve(dir, "..");
32
32
  if (parentDir !== dir) {
33
33
  return this.findLockFile(parentDir);
34
34
  }
@@ -65,7 +65,7 @@ var DepsService = class {
65
65
  }
66
66
  async checkDependencies(dependencies) {
67
67
  try {
68
- const packageJsonPath = path.join(process.cwd(), "package.json");
68
+ const packageJsonPath = path2.join(process.cwd(), "package.json");
69
69
  try {
70
70
  await fs4.access(packageJsonPath);
71
71
  } catch {
@@ -85,7 +85,7 @@ var DepsService = class {
85
85
  }
86
86
  async getProjectName() {
87
87
  try {
88
- const packageJsonPath = path.join(process.cwd(), "package.json");
88
+ const packageJsonPath = path2.join(process.cwd(), "package.json");
89
89
  const packageJson = await fs4.readFile(packageJsonPath, "utf-8");
90
90
  const pkg = JSON.parse(packageJson);
91
91
  return pkg.name;
@@ -96,7 +96,7 @@ var DepsService = class {
96
96
  async getPackageVersion() {
97
97
  const __filename = fileURLToPath(import.meta.url);
98
98
  const __dirname = dirname(__filename);
99
- const pkgJsonPath = path.join(__dirname, "..", "package.json");
99
+ const pkgJsonPath = path2.join(__dirname, "..", "package.json");
100
100
  const content = await fsExtra3.readJSON(pkgJsonPath);
101
101
  return content.version;
102
102
  }
@@ -211,15 +211,19 @@ async function writeMergedConfig(configPath, editor) {
211
211
  spaces: 2
212
212
  });
213
213
  }
214
- var windsurfGlobalMCPConfigPath = path.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
215
- var cursorGlobalMCPConfigPath = path.join(os.homedir(), ".cursor", "mcp.json");
216
- path.join(process.cwd(), ".vscode", "mcp.json");
214
+ var windsurfGlobalMCPConfigPath = path2.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
215
+ var cursorGlobalMCPConfigPath = path2.join(os.homedir(), ".cursor", "mcp.json");
216
+ path2.join(process.cwd(), ".vscode", "mcp.json");
217
+ var vscodeGlobalMCPConfigPath = path2.join(
218
+ os.homedir(),
219
+ process.platform === "win32" ? path2.join("AppData", "Roaming", "Code", "User", "settings.json") : process.platform === "darwin" ? path2.join("Library", "Application Support", "Code", "User", "settings.json") : path2.join(".config", "Code", "User", "settings.json")
220
+ );
217
221
  async function installMastraDocsMCPServer({ editor, directory }) {
218
222
  if (editor === `cursor`) {
219
- await writeMergedConfig(path.join(directory, ".cursor", "mcp.json"), "cursor");
223
+ await writeMergedConfig(path2.join(directory, ".cursor", "mcp.json"), "cursor");
220
224
  }
221
225
  if (editor === `vscode`) {
222
- await writeMergedConfig(path.join(directory, ".vscode", "mcp.json"), "vscode");
226
+ await writeMergedConfig(path2.join(directory, ".vscode", "mcp.json"), "vscode");
223
227
  }
224
228
  if (editor === `cursor-global`) {
225
229
  const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor);
@@ -242,12 +246,21 @@ async function globalMCPIsAlreadyInstalled(editor) {
242
246
  configPath = windsurfGlobalMCPConfigPath;
243
247
  } else if (editor === "cursor-global") {
244
248
  configPath = cursorGlobalMCPConfigPath;
249
+ } else if (editor === "vscode") {
250
+ configPath = vscodeGlobalMCPConfigPath;
245
251
  }
246
252
  if (!configPath || !existsSync(configPath)) {
247
253
  return false;
248
254
  }
249
255
  try {
250
256
  const configContents = await readJSON(configPath);
257
+ if (editor === "vscode") {
258
+ if (!configContents?.servers) return false;
259
+ const hasMastraMCP2 = Object.values(configContents.servers).some(
260
+ (server) => server?.args?.find((arg) => arg?.includes(`@mastra/mcp-docs-server`))
261
+ );
262
+ return hasMastraMCP2;
263
+ }
251
264
  if (!configContents?.mcpServers) return false;
252
265
  const hasMastraMCP = Object.values(configContents.mcpServers).some(
253
266
  (server) => server?.args?.find((arg) => arg?.includes(`@mastra/mcp-docs-server`))
@@ -335,8 +348,8 @@ var FileService = class {
335
348
  */
336
349
  async copyStarterFile(inputFile, outputFilePath, replaceIfExists) {
337
350
  const __filename = fileURLToPath(import.meta.url);
338
- const __dirname = path.dirname(__filename);
339
- const filePath = path.resolve(__dirname, "starter-files", inputFile);
351
+ const __dirname = path2.dirname(__filename);
352
+ const filePath = path2.resolve(__dirname, "starter-files", inputFile);
340
353
  const fileString = fs3__default.readFileSync(filePath, "utf8");
341
354
  if (fs3__default.existsSync(outputFilePath) && !replaceIfExists) {
342
355
  console.log(`${outputFilePath} already exists`);
@@ -346,7 +359,7 @@ var FileService = class {
346
359
  return true;
347
360
  }
348
361
  async setupEnvFile({ dbUrl }) {
349
- const envPath = path.join(process.cwd(), ".env.development");
362
+ const envPath = path2.join(process.cwd(), ".env.development");
350
363
  await fsExtra3.ensureFile(envPath);
351
364
  const fileEnvService = new FileEnvService(envPath);
352
365
  await fileEnvService.setEnvValue("DB_URL", dbUrl);
@@ -683,7 +696,7 @@ var writeIndexFile = async ({
683
696
  addWorkflow
684
697
  }) => {
685
698
  const indexPath = dirPath + "/index.ts";
686
- const destPath = path.join(indexPath);
699
+ const destPath = path2.join(indexPath);
687
700
  try {
688
701
  await fs4.writeFile(destPath, "");
689
702
  const filteredExports = [
@@ -793,7 +806,7 @@ var writeAPIKey = async ({
793
806
  };
794
807
  var createMastraDir = async (directory) => {
795
808
  let dir = directory.trim().split("/").filter((item) => item !== "");
796
- const dirPath = path.join(process.cwd(), ...dir, "mastra");
809
+ const dirPath = path2.join(process.cwd(), ...dir, "mastra");
797
810
  try {
798
811
  await fs4.access(dirPath);
799
812
  return { ok: false };
@@ -867,6 +880,7 @@ var interactivePrompt = async () => {
867
880
  configureEditorWithDocsMCP: async () => {
868
881
  const windsurfIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`windsurf`);
869
882
  const cursorIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`cursor`);
883
+ const vscodeIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`vscode`);
870
884
  const editor = await p.select({
871
885
  message: `Make your AI IDE into a Mastra expert? (installs Mastra docs MCP server)`,
872
886
  options: [
@@ -885,6 +899,11 @@ var interactivePrompt = async () => {
885
899
  value: "windsurf",
886
900
  label: "Windsurf",
887
901
  hint: windsurfIsAlreadyInstalled ? `Already installed` : void 0
902
+ },
903
+ {
904
+ value: "vscode",
905
+ label: "VSCode",
906
+ hint: vscodeIsAlreadyInstalled ? `Already installed` : void 0
888
907
  }
889
908
  ]
890
909
  });
@@ -894,6 +913,11 @@ var interactivePrompt = async () => {
894
913
  Windsurf is already installed, skipping.`);
895
914
  return void 0;
896
915
  }
916
+ if (editor === `vscode` && vscodeIsAlreadyInstalled) {
917
+ p.log.message(`
918
+ VSCode is already installed, skipping.`);
919
+ return void 0;
920
+ }
897
921
  if (editor === `cursor`) {
898
922
  p.log.message(
899
923
  `
@@ -942,7 +966,7 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
942
966
  };
943
967
  var checkPkgJson = async () => {
944
968
  const cwd = process.cwd();
945
- const pkgJsonPath = path.join(cwd, "package.json");
969
+ const pkgJsonPath = path2.join(cwd, "package.json");
946
970
  let isPkgJsonPresent = false;
947
971
  try {
948
972
  await fsExtra3.readJSON(pkgJsonPath);
@@ -1 +1 @@
1
- export { create } from '../../chunk-AMYIYOXP.js';
1
+ export { create } from '../../chunk-M237JEYB.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, FileService, convertToViteEnvVar } from './chunk-AMYIYOXP.js';
5
- export { create } from './chunk-AMYIYOXP.js';
4
+ import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, FileService, convertToViteEnvVar } from './chunk-M237JEYB.js';
5
+ export { create } from './chunk-M237JEYB.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.10.1-alpha.5",
3
+ "version": "0.10.1",
4
4
  "license": "Elastic-2.0",
5
5
  "description": "cli for mastra",
6
6
  "type": "module",
@@ -56,9 +56,9 @@
56
56
  "yocto-spinner": "^0.1.2",
57
57
  "zod": "^3.24.3",
58
58
  "zod-to-json-schema": "^3.24.5",
59
- "@mastra/deployer": "^0.10.1-alpha.3",
59
+ "@mastra/deployer": "^0.10.1",
60
60
  "@mastra/loggers": "^0.10.0",
61
- "@mastra/mcp": "^0.10.1-alpha.0"
61
+ "@mastra/mcp": "^0.10.1"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@microsoft/api-extractor": "^7.52.5",
@@ -76,10 +76,10 @@
76
76
  "type-fest": "^4.37.0",
77
77
  "typescript": "^5.8.2",
78
78
  "vitest": "^3.1.2",
79
- "@internal/lint": "0.0.6",
80
- "@mastra/client-js": "0.10.1-alpha.3",
81
- "@mastra/core": "0.10.1-alpha.3",
82
- "@mastra/playground-ui": "5.1.1-alpha.5"
79
+ "@mastra/client-js": "0.10.1",
80
+ "@internal/lint": "0.0.7",
81
+ "@mastra/core": "0.10.1",
82
+ "@mastra/playground-ui": "5.1.1"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "@mastra/core": "^0.10.0"