mastra 0.10.13-alpha.0 → 0.10.13-alpha.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.
@@ -8,6 +8,13 @@ import { PostHog } from 'posthog-node';
8
8
  // src/analytics/index.ts
9
9
  var __filename = fileURLToPath(import.meta.url);
10
10
  var __dirname = path.dirname(__filename);
11
+ var analyticsInstance = null;
12
+ function getAnalytics() {
13
+ return analyticsInstance;
14
+ }
15
+ function setAnalytics(instance) {
16
+ analyticsInstance = instance;
17
+ }
11
18
  var PosthogAnalytics = class {
12
19
  sessionId;
13
20
  client;
@@ -97,6 +104,22 @@ var PosthogAnalytics = class {
97
104
  }
98
105
  });
99
106
  }
107
+ trackEvent(eventName, properties) {
108
+ try {
109
+ if (!this.client) {
110
+ return;
111
+ }
112
+ this.client.capture({
113
+ distinctId: this.distinctId,
114
+ event: eventName,
115
+ properties: {
116
+ ...this.getSystemProperties(),
117
+ ...properties
118
+ }
119
+ });
120
+ } catch {
121
+ }
122
+ }
100
123
  trackCommand(options) {
101
124
  try {
102
125
  if (!this.client) {
@@ -173,4 +196,4 @@ var PosthogAnalytics = class {
173
196
  }
174
197
  };
175
198
 
176
- export { PosthogAnalytics };
199
+ export { PosthogAnalytics, getAnalytics, setAnalytics };
@@ -10,6 +10,7 @@ declare const create: (args: {
10
10
  timeout?: number;
11
11
  directory?: string;
12
12
  mcpServer?: "windsurf" | "cursor" | "cursor-global";
13
+ template?: string | boolean;
13
14
  }) => Promise<void>;
14
15
 
15
16
  export { create };
@@ -1 +1,2 @@
1
- export { create } from '../../chunk-SLWIYYJN.js';
1
+ export { create } from '../../chunk-C56DSM55.js';
2
+ import '../../chunk-US7IPLZ2.js';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #! /usr/bin/env node
2
- import { PosthogAnalytics } from './chunk-7OXWUU2Q.js';
3
- export { PosthogAnalytics } from './chunk-7OXWUU2Q.js';
4
- import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, FileService } from './chunk-SLWIYYJN.js';
5
- export { create } from './chunk-SLWIYYJN.js';
2
+ import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, FileService } from './chunk-C56DSM55.js';
3
+ export { create } from './chunk-C56DSM55.js';
4
+ import { PosthogAnalytics, setAnalytics } from './chunk-US7IPLZ2.js';
5
+ 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';
@@ -684,6 +684,7 @@ var analytics = new PosthogAnalytics({
684
684
  host: "https://us.posthog.com",
685
685
  version
686
686
  });
687
+ setAnalytics(analytics);
687
688
  var program = new Command();
688
689
  var origin = process.env.MASTRA_ANALYTICS_ORIGIN;
689
690
  program.version(`${version}`, "-v, --version").description(`Mastra CLI ${version}`).action(() => {
@@ -699,7 +700,10 @@ program.version(`${version}`, "-v, --version").description(`Mastra CLI ${version
699
700
  program.command("create [project-name]").description("Create a new Mastra project").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(
700
701
  "-p, --project-name <string>",
701
702
  "Project name that will be used in package.json and as the project directory name."
702
- ).option("-m, --mcp <editor>", "MCP Server for code editor (cursor, cursor-global, windsurf, vscode)").action(async (projectNameArg, args) => {
703
+ ).option("-m, --mcp <editor>", "MCP Server for code editor (cursor, cursor-global, windsurf, vscode)").option(
704
+ "--template [template-name]",
705
+ "Create project from a template (use template name or leave blank to select from list)"
706
+ ).action(async (projectNameArg, args) => {
703
707
  const projectName = projectNameArg || args.projectName;
704
708
  await analytics.trackCommandExecution({
705
709
  command: "create",
@@ -712,7 +716,8 @@ program.command("create [project-name]").description("Create a new Mastra projec
712
716
  llmProvider: "openai",
713
717
  addExample: true,
714
718
  timeout,
715
- mcpServer: args.mcp
719
+ mcpServer: args.mcp,
720
+ template: args.template
716
721
  });
717
722
  return;
718
723
  }
@@ -724,7 +729,8 @@ program.command("create [project-name]").description("Create a new Mastra projec
724
729
  timeout,
725
730
  projectName,
726
731
  directory: args.dir,
727
- mcpServer: args.mcp
732
+ mcpServer: args.mcp,
733
+ template: args.template
728
734
  });
729
735
  },
730
736
  origin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mastra",
3
- "version": "0.10.13-alpha.0",
3
+ "version": "0.10.13-alpha.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "cli for mastra",
6
6
  "type": "module",
@@ -75,8 +75,8 @@
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.15-alpha.1",
78
79
  "@mastra/mcp": "^0.10.6",
79
- "@mastra/deployer": "^0.10.15-alpha.0",
80
80
  "@mastra/loggers": "^0.10.3"
81
81
  },
82
82
  "devDependencies": {
@@ -96,9 +96,9 @@
96
96
  "typescript": "^5.8.3",
97
97
  "vitest": "^3.2.4",
98
98
  "@internal/lint": "0.0.19",
99
- "@mastra/client-js": "0.10.14-alpha.0",
100
- "@mastra/core": "0.10.15-alpha.0",
101
- "@mastra/playground-ui": "5.1.13-alpha.0"
99
+ "@mastra/core": "0.10.15-alpha.1",
100
+ "@mastra/playground-ui": "5.1.13-alpha.2",
101
+ "@mastra/client-js": "0.10.14-alpha.1"
102
102
  },
103
103
  "peerDependencies": {
104
104
  "@mastra/core": "^0.10.2-alpha.0"