create-mastra 1.9.2-alpha.2 → 1.9.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # create-mastra
2
2
 
3
+ ## 1.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Improve `npm create mastra` telemetry delivery so command completion events are tracked and flushed before the process exits. ([#16582](https://github.com/mastra-ai/mastra/pull/16582))
8
+
9
+ ## 1.9.2-alpha.3
10
+
3
11
  ## 1.9.2-alpha.2
4
12
 
5
13
  ## 1.9.2-alpha.1
package/dist/index.js CHANGED
@@ -14508,7 +14508,7 @@ var FileService = class {
14508
14508
  }
14509
14509
  };
14510
14510
  var exec$1 = util.promisify(child_process.exec);
14511
- async function promptForObservability() {
14511
+ async function promptForObservability(command, onObservabilitySelected) {
14512
14512
  while (true) {
14513
14513
  const choice = await Ee({
14514
14514
  message: "Enable Mastra Observability? (will open auth flow)",
@@ -14519,7 +14519,15 @@ async function promptForObservability() {
14519
14519
  initialValue: "yes"
14520
14520
  });
14521
14521
  if (q(choice)) return {};
14522
- if (choice !== "yes") return { enabled: false };
14522
+ const answer = choice === "yes" ? "yes" : "no";
14523
+ const enabled = answer === "yes";
14524
+ onObservabilitySelected?.({
14525
+ command,
14526
+ enabled,
14527
+ answer,
14528
+ selection_method: "interactive"
14529
+ });
14530
+ if (!enabled) return { enabled: false };
14523
14531
  const hadCachedCreds = await loadCredentials() !== null;
14524
14532
  try {
14525
14533
  const token = await getToken();
@@ -15058,7 +15066,7 @@ var LLM_PROVIDERS = [
15058
15066
  { value: "mistral", label: "Mistral" }
15059
15067
  ];
15060
15068
  var interactivePrompt = async (args = {}) => {
15061
- const { skip = {}, options: { showBanner = true } = {} } = args;
15069
+ const { skip = {}, options: { command, showBanner = true, onObservabilitySelected } = {} } = args;
15062
15070
  if (showBanner) {
15063
15071
  ge(color.inverse(" Mastra Init "));
15064
15072
  }
@@ -15097,7 +15105,7 @@ var interactivePrompt = async (args = {}) => {
15097
15105
  },
15098
15106
  observability: async () => {
15099
15107
  if (skip?.observability) return void 0;
15100
- return promptForObservability();
15108
+ return promptForObservability(command, onObservabilitySelected);
15101
15109
  },
15102
15110
  configureMastraToolingForAgents: async () => {
15103
15111
  if (skip?.skills && skip?.mcpServer) return { skills: void 0, mcpServer: void 0 };
@@ -15781,7 +15789,7 @@ var PinoLogger = class _PinoLogger extends MastraLogger {
15781
15789
  };
15782
15790
 
15783
15791
  var package_default = {
15784
- version: "1.9.2-alpha.2"};
15792
+ version: "1.9.2"};
15785
15793
  var logger = createLogger(false);
15786
15794
  function createLogger(debug = false) {
15787
15795
  return new PinoLogger({
@@ -16447,7 +16455,8 @@ var createMastraProject = async ({
16447
16455
  skills,
16448
16456
  mcpServer,
16449
16457
  observability,
16450
- needsInteractive
16458
+ needsInteractive,
16459
+ onObservabilitySelected
16451
16460
  }) => {
16452
16461
  ge(color.inverse(" Mastra Create "));
16453
16462
  const projectName = name ?? await Re({
@@ -16468,7 +16477,7 @@ var createMastraProject = async ({
16468
16477
  if (needsInteractive) {
16469
16478
  const skipGitInit = await isGitInitialized({ cwd: process.cwd() });
16470
16479
  result = await interactivePrompt({
16471
- options: { showBanner: false },
16480
+ options: { command: "create", showBanner: false, onObservabilitySelected },
16472
16481
  skip: {
16473
16482
  llmProvider: llmProvider !== void 0,
16474
16483
  llmApiKey: llmApiKey !== void 0,
@@ -16624,7 +16633,8 @@ var create = async (args) => {
16624
16633
  skills: args?.skills,
16625
16634
  mcpServer: args?.mcpServer,
16626
16635
  observability: args?.observability,
16627
- needsInteractive
16636
+ needsInteractive,
16637
+ onObservabilitySelected: (event) => getAnalytics()?.trackEvent("cli_observability_selected", event)
16628
16638
  });
16629
16639
  if (needsInteractive && result) {
16630
16640
  const analytics = getAnalytics();