mastra 0.10.16-alpha.1 → 0.10.16-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 +30 -10
- package/package.json +8 -8
- package/src/playground/dist/assets/{index-DTfb97Wt.js → index-C4nPwuEf.js} +7 -7
- package/src/playground/dist/assets/{index-Bqx-ss35.js → index-C5Xy8MTy.js} +1 -1
- package/src/playground/dist/assets/{index-CorTdbVi.js → index-DRWiYHRt.js} +1 -1
- package/src/playground/dist/assets/style-gKBOpMos.css +1 -0
- package/src/playground/dist/index.html +2 -2
- package/src/playground/dist/assets/style-CGkV6fg8.css +0 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { PosthogAnalytics } from './chunk-US7IPLZ2.js';
|
|
|
6
6
|
import { Command } from 'commander';
|
|
7
7
|
import { config } from 'dotenv';
|
|
8
8
|
import { join, dirname } from 'path';
|
|
9
|
-
import { getServerOptions, FileService as FileService$2, getWatcherInputOptions, writeTelemetryConfig, createWatcher } from '@mastra/deployer/build';
|
|
9
|
+
import { getServerOptions, FileService as FileService$2, getBundlerOptions, getWatcherInputOptions, writeTelemetryConfig, createWatcher } from '@mastra/deployer/build';
|
|
10
10
|
import { Bundler } from '@mastra/deployer/bundler';
|
|
11
11
|
import { getDeployer, FileService as FileService$1 } from '@mastra/deployer';
|
|
12
12
|
import process2 from 'process';
|
|
@@ -207,15 +207,27 @@ var DevBundler = class extends Bundler {
|
|
|
207
207
|
const __filename = fileURLToPath(import.meta.url);
|
|
208
208
|
const __dirname = dirname(__filename);
|
|
209
209
|
const envFiles = await this.getEnvFiles();
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
let sourcemapEnabled = false;
|
|
211
|
+
try {
|
|
212
|
+
const bundlerOptions = await getBundlerOptions(entryFile, outputDirectory);
|
|
213
|
+
sourcemapEnabled = !!bundlerOptions?.sourcemap;
|
|
214
|
+
} catch (error) {
|
|
215
|
+
this.logger.debug("Failed to get bundler options, sourcemap will be disabled", { error });
|
|
216
|
+
}
|
|
217
|
+
const inputOptions = await getWatcherInputOptions(
|
|
218
|
+
entryFile,
|
|
219
|
+
"node",
|
|
220
|
+
{
|
|
221
|
+
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || "development")
|
|
222
|
+
},
|
|
223
|
+
{ sourcemap: sourcemapEnabled }
|
|
224
|
+
);
|
|
213
225
|
const toolsInputOptions = await this.getToolsInputOptions(toolsPaths);
|
|
214
226
|
const outputDir = join(outputDirectory, this.outputDir);
|
|
215
227
|
await writeTelemetryConfig({
|
|
216
228
|
entryFile,
|
|
217
229
|
outputDir,
|
|
218
|
-
options: {},
|
|
230
|
+
options: { sourcemap: sourcemapEnabled },
|
|
219
231
|
logger: this.logger
|
|
220
232
|
});
|
|
221
233
|
const mastraFolder = dirname(entryFile);
|
|
@@ -288,7 +300,7 @@ var DevBundler = class extends Bundler {
|
|
|
288
300
|
},
|
|
289
301
|
{
|
|
290
302
|
dir: outputDir,
|
|
291
|
-
sourcemap:
|
|
303
|
+
sourcemap: sourcemapEnabled
|
|
292
304
|
}
|
|
293
305
|
);
|
|
294
306
|
this.logger.info("Starting watcher...");
|
|
@@ -328,6 +340,9 @@ var startServer = async (dotMastraPath, port, env, startOptions = {}, errorResta
|
|
|
328
340
|
if (startOptions.inspectBrk) {
|
|
329
341
|
commands.push("--inspect-brk");
|
|
330
342
|
}
|
|
343
|
+
if (startOptions.customArgs) {
|
|
344
|
+
commands.push(...startOptions.customArgs);
|
|
345
|
+
}
|
|
331
346
|
if (!isWebContainer()) {
|
|
332
347
|
const instrumentation = import.meta.resolve("@opentelemetry/instrumentation/hook.mjs");
|
|
333
348
|
commands.push(
|
|
@@ -426,14 +441,15 @@ async function dev({
|
|
|
426
441
|
tools,
|
|
427
442
|
env,
|
|
428
443
|
inspect,
|
|
429
|
-
inspectBrk
|
|
444
|
+
inspectBrk,
|
|
445
|
+
customArgs
|
|
430
446
|
}) {
|
|
431
447
|
const rootDir = root || process2.cwd();
|
|
432
448
|
const mastraDir = dir2 ? dir2.startsWith("/") ? dir2 : join(process2.cwd(), dir2) : join(process2.cwd(), "src", "mastra");
|
|
433
449
|
const dotMastraPath = join(rootDir, ".mastra");
|
|
434
450
|
const defaultToolsPath = join(mastraDir, "tools/**/*.{js,ts}");
|
|
435
451
|
const discoveredTools = [defaultToolsPath, ...tools || []];
|
|
436
|
-
const startOptions = { inspect, inspectBrk };
|
|
452
|
+
const startOptions = { inspect, inspectBrk, customArgs };
|
|
437
453
|
const fileService = new FileService$1();
|
|
438
454
|
const entryFile = fileService.getFirstExistingFile([join(mastraDir, "index.ts"), join(mastraDir, "index.js")]);
|
|
439
455
|
const bundler = new DevBundler(env);
|
|
@@ -796,7 +812,10 @@ program.command("lint").description("Lint your Mastra project").option("-d, --di
|
|
|
796
812
|
origin
|
|
797
813
|
});
|
|
798
814
|
});
|
|
799
|
-
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").
|
|
815
|
+
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").option(
|
|
816
|
+
"-c, --custom-args <args>",
|
|
817
|
+
"Comma-separated list of custom arguments to pass to the dev server. IE: --experimental-transform-types"
|
|
818
|
+
).action((args) => {
|
|
800
819
|
analytics.trackCommand({
|
|
801
820
|
command: "dev",
|
|
802
821
|
origin
|
|
@@ -811,7 +830,8 @@ program.command("dev").description("Start mastra server").option("-d, --dir <dir
|
|
|
811
830
|
tools: args?.tools ? args.tools.split(",") : [],
|
|
812
831
|
env: args?.env,
|
|
813
832
|
inspect: args?.inspect && !args?.inspectBrk,
|
|
814
|
-
inspectBrk: args?.inspectBrk
|
|
833
|
+
inspectBrk: args?.inspectBrk,
|
|
834
|
+
customArgs: args?.customArgs ? args.customArgs.split(",") : []
|
|
815
835
|
}).catch((err) => {
|
|
816
836
|
logger.error(err.message);
|
|
817
837
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mastra",
|
|
3
|
-
"version": "0.10.16-alpha.
|
|
3
|
+
"version": "0.10.16-alpha.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "cli for mastra",
|
|
6
6
|
"type": "module",
|
|
@@ -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.12.0-alpha.
|
|
79
|
-
"@mastra/loggers": "^0.10.
|
|
80
|
-
"@mastra/mcp": "^0.10.
|
|
78
|
+
"@mastra/deployer": "^0.12.0-alpha.5",
|
|
79
|
+
"@mastra/loggers": "^0.10.5-alpha.0",
|
|
80
|
+
"@mastra/mcp": "^0.10.8-alpha.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@microsoft/api-extractor": "^7.52.8",
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
"typescript": "^5.8.3",
|
|
97
97
|
"vitest": "^3.2.4",
|
|
98
98
|
"@internal/lint": "0.0.23",
|
|
99
|
-
"@mastra/
|
|
100
|
-
"@mastra/
|
|
101
|
-
"@mastra/
|
|
99
|
+
"@mastra/client-js": "0.10.17-alpha.5",
|
|
100
|
+
"@mastra/core": "0.12.0-alpha.5",
|
|
101
|
+
"@mastra/playground-ui": "5.1.16-alpha.2"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@mastra/core": ">=0.10.2-0 <0.
|
|
104
|
+
"@mastra/core": ">=0.10.2-0 <0.13.0-0"
|
|
105
105
|
},
|
|
106
106
|
"scripts": {
|
|
107
107
|
"build": "npm-run-all --serial build:lib copy-starter-files copy-templates build:playground",
|