create-mastra 1.40.2-alpha.7 → 1.40.2-alpha.9

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.
Files changed (2) hide show
  1. package/dist/index.js +59 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -18331,7 +18331,7 @@ var require_yocto_spinner = /* @__PURE__ */ __commonJSMin(((exports, module) =>
18331
18331
  return new YoctoSpinner(options);
18332
18332
  };
18333
18333
  }));
18334
- // ../cli/dist/analytics-DcvNOF6c.js
18334
+ // ../cli/dist/analytics-CLQaMGC3.js
18335
18335
  const CREATE_LLM_PROVIDERS = [
18336
18336
  {
18337
18337
  value: "mastra",
@@ -18521,6 +18521,61 @@ async function gitInit({ cwd }) {
18521
18521
  });
18522
18522
  }
18523
18523
  const ANALYTICS_CONFIG_PATH = path$1.join(os.homedir(), ".mastra", "analytics.json");
18524
+ /**
18525
+ * The only command options that are ever sent. Add an option here only if its value can't contain
18526
+ * a secret: no keys, tokens, env values, or free-form arguments.
18527
+ */
18528
+ const COMMAND_ARG_KEYS = [
18529
+ "components",
18530
+ "debug",
18531
+ "default",
18532
+ "default_template",
18533
+ "dir",
18534
+ "env",
18535
+ "envFile",
18536
+ "example",
18537
+ "force",
18538
+ "git",
18539
+ "hasConfig",
18540
+ "hasEnvFile",
18541
+ "hasInput",
18542
+ "hasOrg",
18543
+ "hasProject",
18544
+ "has_org",
18545
+ "headless",
18546
+ "json",
18547
+ "llm",
18548
+ "mcp",
18549
+ "mode",
18550
+ "no_platform",
18551
+ "observability",
18552
+ "positionalCount",
18553
+ "positionalPresent",
18554
+ "preflight",
18555
+ "region",
18556
+ "root",
18557
+ "scorerName",
18558
+ "skills",
18559
+ "skipBuild",
18560
+ "skipPreflight",
18561
+ "strict",
18562
+ "studio",
18563
+ "targetApi",
18564
+ "tools",
18565
+ "version_tag",
18566
+ "workers",
18567
+ "yes"
18568
+ ];
18569
+ function pickCommandArgs(args) {
18570
+ return Object.fromEntries(Object.entries(args).filter(([key]) => COMMAND_ARG_KEYS.includes(key)));
18571
+ }
18572
+ /**
18573
+ * Errors can quote a URL the user passed, so drop its query string, or all of it when it may hold
18574
+ * credentials. Where those end is ambiguous: passwords can contain `/` or `?`, and queries `@`.
18575
+ */
18576
+ function stripUrlSecrets(message) {
18577
+ return message.replace(/:\/\/\S+/g, (url) => url.includes("@") ? "://[redacted]" : url.replace(/[?#].*/, ""));
18578
+ }
18524
18579
  let analyticsInstance = null;
18525
18580
  function getAnalytics() {
18526
18581
  return analyticsInstance;
@@ -18647,9 +18702,9 @@ var PosthogAnalytics = class PosthogAnalytics {
18647
18702
  command: options.command,
18648
18703
  status: options.status || "success"
18649
18704
  };
18650
- if (options.args) commandData.args = options.args;
18705
+ if (options.args) commandData.args = pickCommandArgs(options.args);
18651
18706
  if (options.durationMs) commandData.durationMs = options.durationMs;
18652
- if (options.error) commandData.error = options.error;
18707
+ if (options.error) commandData.error = stripUrlSecrets(options.error);
18653
18708
  this.client.capture({
18654
18709
  distinctId: this.distinctId,
18655
18710
  event: "cli_command",
@@ -20427,7 +20482,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20427
20482
  rcompareIdentifiers: identifiers.rcompareIdentifiers
20428
20483
  };
20429
20484
  }));
20430
- // ../cli/dist/create-DlrSzNAx.js
20485
+ // ../cli/dist/create-CDcMfsm7.js
20431
20486
  var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
20432
20487
  var import_yocto_spinner = /* @__PURE__ */ __toESM(require_yocto_spinner(), 1);
20433
20488
  var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mastra",
3
- "version": "1.40.2-alpha.7",
3
+ "version": "1.40.2-alpha.9",
4
4
  "description": "Create Mastra apps with one command",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -37,8 +37,8 @@
37
37
  "tsdown": "0.23.1",
38
38
  "typescript": "^7.0.2",
39
39
  "vitest": "5.1.0",
40
- "mastra": "^1.40.2-alpha.7",
41
- "@internal/lint": "0.0.151"
40
+ "@internal/lint": "0.0.151",
41
+ "mastra": "^1.40.2-alpha.9"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=22.13.0"