mastra 0.10.11-alpha.1 → 0.10.11-alpha.3

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/index.js CHANGED
@@ -304,11 +304,17 @@ var DevBundler = class extends Bundler {
304
304
  var currentServerProcess;
305
305
  var isRestarting = false;
306
306
  var ON_ERROR_MAX_RESTARTS = 3;
307
- var startServer = async (dotMastraPath, port, env, errorRestartCount = 0) => {
307
+ var startServer = async (dotMastraPath, port, env, startOptions = {}, errorRestartCount = 0) => {
308
308
  let serverIsReady = false;
309
309
  try {
310
310
  logger.info("[Mastra Dev] - Starting server...");
311
311
  const commands = [];
312
+ if (startOptions.inspect) {
313
+ commands.push("--inspect");
314
+ }
315
+ if (startOptions.inspectBrk) {
316
+ commands.push("--inspect-brk");
317
+ }
312
318
  if (!isWebContainer()) {
313
319
  const instrumentation = import.meta.resolve("@opentelemetry/instrumentation/hook.mjs");
314
320
  commands.push(
@@ -379,12 +385,12 @@ var startServer = async (dotMastraPath, port, env, errorRestartCount = 0) => {
379
385
  logger.error(
380
386
  `Attempting to restart server after error... (Attempt ${errorRestartCount}/${ON_ERROR_MAX_RESTARTS})`
381
387
  );
382
- startServer(dotMastraPath, port, env, errorRestartCount);
388
+ startServer(dotMastraPath, port, env, startOptions, errorRestartCount);
383
389
  }
384
390
  }, 1e3);
385
391
  }
386
392
  };
387
- async function rebundleAndRestart(dotMastraPath, port, bundler) {
393
+ async function rebundleAndRestart(dotMastraPath, port, bundler, startOptions = {}) {
388
394
  if (isRestarting) {
389
395
  return;
390
396
  }
@@ -395,7 +401,7 @@ async function rebundleAndRestart(dotMastraPath, port, bundler) {
395
401
  currentServerProcess.kill("SIGINT");
396
402
  }
397
403
  const env = await bundler.loadEnvVars();
398
- await startServer(join(dotMastraPath, "output"), port, env);
404
+ await startServer(join(dotMastraPath, "output"), port, env, startOptions);
399
405
  } finally {
400
406
  isRestarting = false;
401
407
  }
@@ -405,13 +411,16 @@ async function dev({
405
411
  dir: dir2,
406
412
  root,
407
413
  tools,
408
- env
414
+ env,
415
+ inspect,
416
+ inspectBrk
409
417
  }) {
410
418
  const rootDir = root || process2.cwd();
411
419
  const mastraDir = dir2 ? dir2.startsWith("/") ? dir2 : join(process2.cwd(), dir2) : join(process2.cwd(), "src", "mastra");
412
420
  const dotMastraPath = join(rootDir, ".mastra");
413
421
  const defaultToolsPath = join(mastraDir, "tools/**/*.{js,ts}");
414
422
  const discoveredTools = [defaultToolsPath, ...tools || []];
423
+ const startOptions = { inspect, inspectBrk };
415
424
  const fileService = new FileService$1();
416
425
  const entryFile = fileService.getFirstExistingFile([join(mastraDir, "index.ts"), join(mastraDir, "index.js")]);
417
426
  const bundler = new DevBundler(env);
@@ -429,11 +438,11 @@ async function dev({
429
438
  })
430
439
  );
431
440
  }
432
- await startServer(join(dotMastraPath, "output"), Number(portToUse), loadedEnv);
441
+ await startServer(join(dotMastraPath, "output"), Number(portToUse), loadedEnv, startOptions);
433
442
  watcher.on("event", (event) => {
434
443
  if (event.code === "BUNDLE_END") {
435
444
  logger.info("[Mastra Dev] - Bundling finished, restarting server...");
436
- rebundleAndRestart(dotMastraPath, Number(portToUse), bundler);
445
+ rebundleAndRestart(dotMastraPath, Number(portToUse), bundler, startOptions);
437
446
  }
438
447
  });
439
448
  process2.on("SIGINT", () => {
@@ -765,7 +774,7 @@ program.command("lint").description("Lint your Mastra project").option("-d, --di
765
774
  origin
766
775
  });
767
776
  });
768
- program.command("dev").description("Start mastra server").option("-d, --dir <dir>", "Path to your mastra folder").option("-r, --root <root>", "Path to your root folder").option("-t, --tools <toolsDirs>", "Comma-separated list of paths to tool files to include").option("-p, --port <port>", "deprecated: Port number for the development server (defaults to 4111)").option("-e, --env <env>", "Custom env file to include in the dev server").action((args) => {
777
+ program.command("dev").description("Start mastra server").option("-d, --dir <dir>", "Path to your mastra folder").option("-r, --root <root>", "Path to your root folder").option("-t, --tools <toolsDirs>", "Comma-separated list of paths to tool files to include").option("-p, --port <port>", "deprecated: Port number for the development server (defaults to 4111)").option("-e, --env <env>", "Custom env file to include in the dev server").option("-i, --inspect", "Start the dev server in inspect mode").option("-b, --inspect-brk", "Start the dev server in inspect mode and break at the beginning of the script").action((args) => {
769
778
  analytics.trackCommand({
770
779
  command: "dev",
771
780
  origin
@@ -778,7 +787,9 @@ program.command("dev").description("Start mastra server").option("-d, --dir <dir
778
787
  dir: args?.dir,
779
788
  root: args?.root,
780
789
  tools: args?.tools ? args.tools.split(",") : [],
781
- env: args?.env
790
+ env: args?.env,
791
+ inspect: args?.inspect && !args?.inspectBrk,
792
+ inspectBrk: args?.inspectBrk
782
793
  }).catch((err) => {
783
794
  logger.error(err.message);
784
795
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mastra",
3
- "version": "0.10.11-alpha.1",
3
+ "version": "0.10.11-alpha.3",
4
4
  "license": "Elastic-2.0",
5
5
  "description": "cli for mastra",
6
6
  "type": "module",
@@ -56,7 +56,7 @@
56
56
  "@opentelemetry/semantic-conventions": "^1.34.0",
57
57
  "@webcontainer/env": "^1.1.1",
58
58
  "commander": "^12.1.0",
59
- "dotenv": "^16.5.0",
59
+ "dotenv": "^16.6.1",
60
60
  "execa": "^9.6.0",
61
61
  "fs-extra": "^11.3.0",
62
62
  "get-port": "^7.1.0",
@@ -75,9 +75,9 @@
75
75
  "yocto-spinner": "^0.2.3",
76
76
  "zod": "^3.25.67",
77
77
  "zod-to-json-schema": "^3.24.5",
78
- "@mastra/deployer": "^0.10.11-alpha.1",
79
78
  "@mastra/loggers": "^0.10.3",
80
- "@mastra/mcp": "^0.10.5"
79
+ "@mastra/deployer": "^0.10.11-alpha.3",
80
+ "@mastra/mcp": "^0.10.6-alpha.1"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@microsoft/api-extractor": "^7.52.8",
@@ -96,9 +96,9 @@
96
96
  "typescript": "^5.8.3",
97
97
  "vitest": "^3.2.4",
98
98
  "@internal/lint": "0.0.17",
99
- "@mastra/client-js": "0.10.10-alpha.1",
100
- "@mastra/core": "0.10.11-alpha.1",
101
- "@mastra/playground-ui": "5.1.11-alpha.1"
99
+ "@mastra/client-js": "0.10.10-alpha.3",
100
+ "@mastra/playground-ui": "5.1.11-alpha.3",
101
+ "@mastra/core": "0.10.11-alpha.3"
102
102
  },
103
103
  "peerDependencies": {
104
104
  "@mastra/core": "^0.10.2-alpha.0"