create-mastra 0.10.2-alpha.5 → 0.10.3-alpha.0

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
@@ -432,8 +432,8 @@ function requireQuote () {
432
432
  if (s && typeof s === 'object') {
433
433
  return s.op.replace(/(.)/g, '\\$1');
434
434
  }
435
- if ((/["\s]/).test(s) && !(/'/).test(s)) {
436
- return "'" + s.replace(/(['\\])/g, '\\$1') + "'";
435
+ if ((/["\s\\]/).test(s) && !(/'/).test(s)) {
436
+ return "'" + s.replace(/(['])/g, '\\$1') + "'";
437
437
  }
438
438
  if ((/["'\s]/).test(s)) {
439
439
  return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
@@ -1079,17 +1079,40 @@ var MastraLogger = class {
1079
1079
  getTransports() {
1080
1080
  return this.transports;
1081
1081
  }
1082
- async getLogs(transportId) {
1082
+ trackException(_error) {
1083
+ }
1084
+ async getLogs(transportId, params) {
1083
1085
  if (!transportId || !this.transports.has(transportId)) {
1084
- return [];
1086
+ return { logs: [], total: 0, page: params?.page ?? 1, perPage: params?.perPage ?? 100, hasMore: false };
1085
1087
  }
1086
- return this.transports.get(transportId).getLogs() ?? [];
1088
+ return this.transports.get(transportId).getLogs(params) ?? {
1089
+ logs: [],
1090
+ total: 0,
1091
+ page: params?.page ?? 1,
1092
+ perPage: params?.perPage ?? 100,
1093
+ hasMore: false
1094
+ };
1087
1095
  }
1088
- async getLogsByRunId({ transportId, runId }) {
1096
+ async getLogsByRunId({
1097
+ transportId,
1098
+ runId,
1099
+ fromDate,
1100
+ toDate,
1101
+ logLevel,
1102
+ filters,
1103
+ page,
1104
+ perPage
1105
+ }) {
1089
1106
  if (!transportId || !this.transports.has(transportId) || !runId) {
1090
- return [];
1107
+ return { logs: [], total: 0, page: page ?? 1, perPage: perPage ?? 100, hasMore: false };
1091
1108
  }
1092
- return this.transports.get(transportId).getLogsByRunId({ runId }) ?? [];
1109
+ return this.transports.get(transportId).getLogsByRunId({ runId, fromDate, toDate, logLevel, filters, page, perPage }) ?? {
1110
+ logs: [],
1111
+ total: 0,
1112
+ page: page ?? 1,
1113
+ perPage: perPage ?? 100,
1114
+ hasMore: false
1115
+ };
1093
1116
  }
1094
1117
  };
1095
1118
 
@@ -2164,7 +2187,7 @@ var createMastraProject = async ({
2164
2187
  createVersionTag,
2165
2188
  timeout
2166
2189
  }) => {
2167
- pe(color2.inverse("Mastra Create"));
2190
+ pe(color2.inverse(" Mastra Create "));
2168
2191
  const projectName = name ?? await ae({
2169
2192
  message: "What do you want to name your project?",
2170
2193
  placeholder: "my-mastra-app",
@@ -2322,7 +2345,7 @@ program.version(`${version}`, "-v, --version").description(`create-mastra ${vers
2322
2345
  program.name("create-mastra").description("Create a new Mastra project").argument("[project-name]", "Directory name of the project").option(
2323
2346
  "-p, --project-name <string>",
2324
2347
  "Project name that will be used in package.json and as the project directory name."
2325
- ).option("--default", "Quick start with defaults(src, OpenAI, no examples)").option("-c, --components <components>", "Comma-separated list of components (agents, tools, workflows)").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)").action(async (projectNameArg, args) => {
2348
+ ).option("--default", "Quick start with defaults(src, OpenAI, examples)").option("-c, --components <components>", "Comma-separated list of components (agents, tools, workflows)").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)").action(async (projectNameArg, args) => {
2326
2349
  const projectName = projectNameArg || args.projectName;
2327
2350
  const timeout = args?.timeout ? args?.timeout === true ? 6e4 : parseInt(args?.timeout, 10) : void 0;
2328
2351
  if (args.default) {
@@ -2332,7 +2355,8 @@ program.name("create-mastra").description("Create a new Mastra project").argumen
2332
2355
  addExample: true,
2333
2356
  createVersionTag,
2334
2357
  timeout,
2335
- mcpServer: args.mcp
2358
+ mcpServer: args.mcp,
2359
+ directory: "src/"
2336
2360
  });
2337
2361
  return;
2338
2362
  }