create-mastra 0.0.0-fix-network-silence-20250930164151 → 0.0.0-fix-maxSteps-modelsetting-playground-20251008194458

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,6 +1,186 @@
1
1
  # create-mastra
2
2
 
3
- ## 0.0.0-fix-network-silence-20250930164151
3
+ ## 0.0.0-fix-maxSteps-modelsetting-playground-20251008194458
4
+
5
+ ### Patch Changes
6
+
7
+ - Improve the overall flow of the `create-mastra` CLI by first asking all questions and then creating the project structure. If you skip entering an API key during the wizard, the `your-api-key` placeholder will now be added to an `.env.example` file instead of `.env`. ([#8603](https://github.com/mastra-ai/mastra/pull/8603))
8
+
9
+ ## 0.15.1-alpha.1
10
+
11
+ ## 0.15.1-alpha.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Improve the overall flow of the `create-mastra` CLI by first asking all questions and then creating the project structure. If you skip entering an API key during the wizard, the `your-api-key` placeholder will now be added to an `.env.example` file instead of `.env`. ([#8603](https://github.com/mastra-ai/mastra/pull/8603))
16
+
17
+ ## 0.15.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Mutable shared workflow run state ([#8545](https://github.com/mastra-ai/mastra/pull/8545))
22
+
23
+ - streamLegacy/generateLegacy clarification in playground ([#8468](https://github.com/mastra-ai/mastra/pull/8468))
24
+
25
+ - avoid refetching memory threads and messages on window focus ([#8519](https://github.com/mastra-ai/mastra/pull/8519))
26
+
27
+ - add tripwire reason in playground ([#8568](https://github.com/mastra-ai/mastra/pull/8568))
28
+
29
+ - Save waiting step status in snapshot ([#8576](https://github.com/mastra-ai/mastra/pull/8576))
30
+
31
+ - Added AI SDK provider packages to model router for anthropic/google/openai/openrouter/xai ([#8559](https://github.com/mastra-ai/mastra/pull/8559))
32
+
33
+ - Convert WorkflowWatchResult to WorkflowResult in workflow graph ([#8541](https://github.com/mastra-ai/mastra/pull/8541))
34
+
35
+ - Fixed an issue where model router was adding /chat/completions to API urls when it shouldn't. ([#8589](https://github.com/mastra-ai/mastra/pull/8589))
36
+ fixed an issue with provider ID rendering in playground UI
37
+
38
+ - Fix useStreamWorkflow unmounting breaking stream call ([#8449](https://github.com/mastra-ai/mastra/pull/8449))
39
+
40
+ ## 0.15.0-alpha.3
41
+
42
+ ### Patch Changes
43
+
44
+ - Fixed an issue where model router was adding /chat/completions to API urls when it shouldn't. ([#8589](https://github.com/mastra-ai/mastra/pull/8589))
45
+ fixed an issue with provider ID rendering in playground UI
46
+
47
+ ## 0.14.2-alpha.2
48
+
49
+ ### Patch Changes
50
+
51
+ - Added AI SDK provider packages to model router for anthropic/google/openai/openrouter/xai ([#8559](https://github.com/mastra-ai/mastra/pull/8559))
52
+
53
+ ## 0.14.2-alpha.1
54
+
55
+ ### Patch Changes
56
+
57
+ - Mutable shared workflow run state ([#8545](https://github.com/mastra-ai/mastra/pull/8545))
58
+
59
+ - avoid refetching memory threads and messages on window focus ([#8519](https://github.com/mastra-ai/mastra/pull/8519))
60
+
61
+ - add tripwire reason in playground ([#8568](https://github.com/mastra-ai/mastra/pull/8568))
62
+
63
+ - Save waiting step status in snapshot ([#8576](https://github.com/mastra-ai/mastra/pull/8576))
64
+
65
+ - Convert WorkflowWatchResult to WorkflowResult in workflow graph ([#8541](https://github.com/mastra-ai/mastra/pull/8541))
66
+
67
+ ## 0.14.2-alpha.0
68
+
69
+ ### Patch Changes
70
+
71
+ - streamLegacy/generateLegacy clarification in playground ([#8468](https://github.com/mastra-ai/mastra/pull/8468))
72
+
73
+ - Fix useStreamWorkflow unmounting breaking stream call ([#8449](https://github.com/mastra-ai/mastra/pull/8449))
74
+
75
+ ## 0.14.1
76
+
77
+ ### Patch Changes
78
+
79
+ - Make init versions latest pkgs ([#8434](https://github.com/mastra-ai/mastra/pull/8434))
80
+
81
+ ## 0.14.1-alpha.0
82
+
83
+ ### Patch Changes
84
+
85
+ - Make init versions latest pkgs ([#8434](https://github.com/mastra-ai/mastra/pull/8434))
86
+
87
+ ## 0.14.0
88
+
89
+ ### Minor Changes
90
+
91
+ - Breaking change to move the agent.streamVNext/generateVNext implementation to the default stream/generate. The old stream/generate have now been moved to streamLegacy and generateLegacy ([#8097](https://github.com/mastra-ai/mastra/pull/8097))
92
+
93
+ ### Patch Changes
94
+
95
+ - Remove log drains UI from the playground ([#8379](https://github.com/mastra-ai/mastra/pull/8379))
96
+
97
+ - add refetch interval to traces to make it feel "instant" ([#8386](https://github.com/mastra-ai/mastra/pull/8386))
98
+
99
+ - better memory message ([#8382](https://github.com/mastra-ai/mastra/pull/8382))
100
+
101
+ - fix codeblock line number color contrast for legacy traces ([#8385](https://github.com/mastra-ai/mastra/pull/8385))
102
+
103
+ - Model router documentation and playground UI improvements ([#8372](https://github.com/mastra-ai/mastra/pull/8372))
104
+
105
+ **Documentation generation (`@mastra/core`):**
106
+ - Fixed inverted dynamic model selection logic in provider examples
107
+ - Improved copy: replaced marketing language with action-oriented descriptions
108
+ - Added generated file comments with timestamps to all MDX outputs so maintainers know not to directly edit generated files
109
+
110
+ **Playground UI model picker (`@mastra/playground-ui`):**
111
+ - Fixed provider field clearing when typing in model input
112
+ - Added responsive layout (stacks on mobile, side-by-side on desktop)
113
+ - Improved general styling of provider/model pickers
114
+
115
+ **Environment variables (`@mastra/deployer`):**
116
+ - Properly handle array of env vars (e.g., NETLIFY_TOKEN, NETLIFY_SITE_ID)
117
+ - Added correct singular/plural handling for "environment variable(s)"
118
+
119
+ - show thread list in desc order ([#8381](https://github.com/mastra-ai/mastra/pull/8381))
120
+
121
+ - Fix an issue preventing showing working memory and semantic recall in the playground ([#8358](https://github.com/mastra-ai/mastra/pull/8358))
122
+
123
+ - Add observe strean to get streans after workflow has been interrupted ([#8318](https://github.com/mastra-ai/mastra/pull/8318))
124
+
125
+ ## 0.14.0-alpha.0
126
+
127
+ ### Minor Changes
128
+
129
+ - Breaking change to move the agent.streamVNext/generateVNext implementation to the default stream/generate. The old stream/generate have now been moved to streamLegacy and generateLegacy ([#8097](https://github.com/mastra-ai/mastra/pull/8097))
130
+
131
+ ### Patch Changes
132
+
133
+ - Remove log drains UI from the playground ([#8379](https://github.com/mastra-ai/mastra/pull/8379))
134
+
135
+ - add refetch interval to traces to make it feel "instant" ([#8386](https://github.com/mastra-ai/mastra/pull/8386))
136
+
137
+ - better memory message ([#8382](https://github.com/mastra-ai/mastra/pull/8382))
138
+
139
+ - fix codeblock line number color contrast for legacy traces ([#8385](https://github.com/mastra-ai/mastra/pull/8385))
140
+
141
+ - Model router documentation and playground UI improvements ([#8372](https://github.com/mastra-ai/mastra/pull/8372))
142
+
143
+ **Documentation generation (`@mastra/core`):**
144
+ - Fixed inverted dynamic model selection logic in provider examples
145
+ - Improved copy: replaced marketing language with action-oriented descriptions
146
+ - Added generated file comments with timestamps to all MDX outputs so maintainers know not to directly edit generated files
147
+
148
+ **Playground UI model picker (`@mastra/playground-ui`):**
149
+ - Fixed provider field clearing when typing in model input
150
+ - Added responsive layout (stacks on mobile, side-by-side on desktop)
151
+ - Improved general styling of provider/model pickers
152
+
153
+ **Environment variables (`@mastra/deployer`):**
154
+ - Properly handle array of env vars (e.g., NETLIFY_TOKEN, NETLIFY_SITE_ID)
155
+ - Added correct singular/plural handling for "environment variable(s)"
156
+
157
+ - show thread list in desc order ([#8381](https://github.com/mastra-ai/mastra/pull/8381))
158
+
159
+ - Fix an issue preventing showing working memory and semantic recall in the playground ([#8358](https://github.com/mastra-ai/mastra/pull/8358))
160
+
161
+ - Add observe strean to get streans after workflow has been interrupted ([#8318](https://github.com/mastra-ai/mastra/pull/8318))
162
+
163
+ ## 0.13.4
164
+
165
+ ### Patch Changes
166
+
167
+ - disable network label when memory is not enabled OR the agent has no subagents ([#8341](https://github.com/mastra-ai/mastra/pull/8341))
168
+
169
+ - Added Mastra model router to Playground UI ([#8332](https://github.com/mastra-ai/mastra/pull/8332))
170
+
171
+ ## 0.13.4-alpha.1
172
+
173
+ ### Patch Changes
174
+
175
+ - disable network label when memory is not enabled OR the agent has no subagents ([#8341](https://github.com/mastra-ai/mastra/pull/8341))
176
+
177
+ ## 0.13.4-alpha.0
178
+
179
+ ### Patch Changes
180
+
181
+ - Added Mastra model router to Playground UI ([#8332](https://github.com/mastra-ai/mastra/pull/8332))
182
+
183
+ ## 0.13.3
4
184
 
5
185
  ### Patch Changes
6
186
 
@@ -8,10 +188,22 @@
8
188
 
9
189
  - Add conditional chaining to scorer.agentNames return ([#8199](https://github.com/mastra-ai/mastra/pull/8199))
10
190
 
191
+ - Show model that worked when there are model fallbacks ([#8167](https://github.com/mastra-ai/mastra/pull/8167))
192
+
11
193
  - Add types in the streamVNext codepath, fixes for various issues across multiple packages surfaced from type issues, align return types. ([#8010](https://github.com/mastra-ai/mastra/pull/8010))
12
194
 
13
195
  - Add model fallbacks to playground ([#7427](https://github.com/mastra-ai/mastra/pull/7427))
14
196
 
197
+ ## 0.13.3-alpha.1
198
+
199
+ ### Patch Changes
200
+
201
+ - Fixed an issue in playground where text-start/end parts were ignored in handleStreamChunk and tool ordering vs text wasn't retained ([#8234](https://github.com/mastra-ai/mastra/pull/8234))
202
+
203
+ - Add conditional chaining to scorer.agentNames return ([#8199](https://github.com/mastra-ai/mastra/pull/8199))
204
+
205
+ - Show model that worked when there are model fallbacks ([#8167](https://github.com/mastra-ai/mastra/pull/8167))
206
+
15
207
  ## 0.13.3-alpha.0
16
208
 
17
209
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1667,10 +1667,8 @@ var FileService = class {
1667
1667
  var exec2 = util.promisify(child_process.exec);
1668
1668
  var getAISDKPackageVersion = (llmProvider) => {
1669
1669
  switch (llmProvider) {
1670
- case "cerebras":
1671
- return "^0.2.14";
1672
1670
  default:
1673
- return "^1.0.0";
1671
+ return "latest";
1674
1672
  }
1675
1673
  };
1676
1674
  var getAISDKPackage = (llmProvider) => {
@@ -2007,13 +2005,21 @@ ${addAgent ? `import { weatherAgent } from './agents/weather-agent';` : ""}
2007
2005
  export const mastra = new Mastra({
2008
2006
  ${filteredExports.join("\n ")}
2009
2007
  storage: new LibSQLStore({
2010
- // stores telemetry, evals, ... into memory storage, if it needs to persist, change to file:../mastra.db
2008
+ // stores observability, scores, ... into memory storage, if it needs to persist, change to file:../mastra.db
2011
2009
  url: ":memory:",
2012
2010
  }),
2013
2011
  logger: new PinoLogger({
2014
2012
  name: 'Mastra',
2015
2013
  level: 'info',
2016
2014
  }),
2015
+ telemetry: {
2016
+ // Telemetry is deprecated and will be removed in the Nov 4th release
2017
+ enabled: false,
2018
+ },
2019
+ observability: {
2020
+ // Enables DefaultExporter and CloudExporter for AI tracing
2021
+ default: { enabled: true },
2022
+ },
2017
2023
  });
2018
2024
  `
2019
2025
  );
@@ -2044,14 +2050,12 @@ var getAPIKey = async (provider) => {
2044
2050
  return key;
2045
2051
  }
2046
2052
  };
2047
- var writeAPIKey = async ({
2048
- provider,
2049
- apiKey = "your-api-key"
2050
- }) => {
2053
+ var writeAPIKey = async ({ provider, apiKey }) => {
2054
+ const envFileName = apiKey ? ".env" : ".env.example";
2051
2055
  const key = await getAPIKey(provider);
2052
2056
  const escapedKey = shellQuote.quote([key]);
2053
- const escapedApiKey = shellQuote.quote([apiKey]);
2054
- await exec2(`echo ${escapedKey}=${escapedApiKey} >> .env`);
2057
+ const escapedApiKey = shellQuote.quote([apiKey ? apiKey : "your-api-key"]);
2058
+ await exec2(`echo ${escapedKey}=${escapedApiKey} >> ${envFileName}`);
2055
2059
  };
2056
2060
  var createMastraDir = async (directory) => {
2057
2061
  let dir = directory.trim().split("/").filter((item) => item !== "");
@@ -2072,8 +2076,19 @@ var writeCodeSample = async (dirPath, component, llmProvider, importComponents)
2072
2076
  throw err;
2073
2077
  }
2074
2078
  };
2075
- var interactivePrompt = async () => {
2076
- Ie(color2.inverse(" Mastra Init "));
2079
+ var LLM_PROVIDERS = [
2080
+ { value: "openai", label: "OpenAI", hint: "recommended" },
2081
+ { value: "anthropic", label: "Anthropic" },
2082
+ { value: "groq", label: "Groq" },
2083
+ { value: "google", label: "Google" },
2084
+ { value: "cerebras", label: "Cerebras" },
2085
+ { value: "mistral", label: "Mistral" }
2086
+ ];
2087
+ var interactivePrompt = async (args2 = {}) => {
2088
+ const { skip = {}, options: { showBanner = true } = {} } = args2;
2089
+ if (showBanner) {
2090
+ Ie(color2.inverse(" Mastra Init "));
2091
+ }
2077
2092
  const mastraProject = await Ce(
2078
2093
  {
2079
2094
  directory: () => he({
@@ -2081,20 +2096,15 @@ var interactivePrompt = async () => {
2081
2096
  placeholder: "src/",
2082
2097
  defaultValue: "src/"
2083
2098
  }),
2084
- llmProvider: () => ve({
2085
- message: "Select default provider:",
2086
- options: [
2087
- { value: "openai", label: "OpenAI", hint: "recommended" },
2088
- { value: "anthropic", label: "Anthropic" },
2089
- { value: "groq", label: "Groq" },
2090
- { value: "google", label: "Google" },
2091
- { value: "cerebras", label: "Cerebras" },
2092
- { value: "mistral", label: "Mistral" }
2093
- ]
2099
+ llmProvider: () => skip?.llmProvider ? void 0 : ve({
2100
+ message: "Select a default provider:",
2101
+ options: LLM_PROVIDERS
2094
2102
  }),
2095
2103
  llmApiKey: async ({ results: { llmProvider } }) => {
2104
+ if (skip?.llmApiKey) return void 0;
2105
+ const llmName = LLM_PROVIDERS.find((p6) => p6.value === llmProvider)?.label || "provider";
2096
2106
  const keyChoice = await ve({
2097
- message: `Enter your ${llmProvider} API key?`,
2107
+ message: `Enter your ${llmName} API key?`,
2098
2108
  options: [
2099
2109
  { value: "skip", label: "Skip for now", hint: "default" },
2100
2110
  { value: "enter", label: "Enter API key" }
@@ -2104,7 +2114,10 @@ var interactivePrompt = async () => {
2104
2114
  if (keyChoice === "enter") {
2105
2115
  return he({
2106
2116
  message: "Enter your API key:",
2107
- placeholder: "sk-..."
2117
+ placeholder: "sk-...",
2118
+ validate: (value) => {
2119
+ if (value.length === 0) return "API key cannot be empty";
2120
+ }
2108
2121
  });
2109
2122
  }
2110
2123
  return void 0;
@@ -2114,7 +2127,7 @@ var interactivePrompt = async () => {
2114
2127
  const cursorIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`cursor`);
2115
2128
  const vscodeIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`vscode`);
2116
2129
  const editor = await ve({
2117
- message: `Make your AI IDE into a Mastra expert? (installs Mastra docs MCP server)`,
2130
+ message: `Make your IDE into a Mastra expert? (Installs Mastra's MCP server)`,
2118
2131
  options: [
2119
2132
  { value: "skip", label: "Skip for now", hint: "default" },
2120
2133
  {
@@ -2326,18 +2339,34 @@ async function installMastraDependency(pm, dependency, versionTag, isDev, timeou
2326
2339
  var createMastraProject = async ({
2327
2340
  projectName: name,
2328
2341
  createVersionTag,
2329
- timeout
2342
+ timeout,
2343
+ llmProvider,
2344
+ llmApiKey,
2345
+ needsInteractive
2330
2346
  }) => {
2331
2347
  Ie(color2.inverse(" Mastra Create "));
2332
2348
  const projectName = name ?? await he({
2333
2349
  message: "What do you want to name your project?",
2334
2350
  placeholder: "my-mastra-app",
2335
- defaultValue: "my-mastra-app"
2351
+ defaultValue: "my-mastra-app",
2352
+ validate: (value) => {
2353
+ if (value.length === 0) return "Project name cannot be empty";
2354
+ if (fs4__default__default.existsSync(value)) {
2355
+ return `A directory named "${value}" already exists. Please choose a different name.`;
2356
+ }
2357
+ }
2336
2358
  });
2337
2359
  if (pD(projectName)) {
2338
2360
  xe("Operation cancelled");
2339
2361
  process.exit(0);
2340
2362
  }
2363
+ let result;
2364
+ if (needsInteractive) {
2365
+ result = await interactivePrompt({
2366
+ options: { showBanner: false },
2367
+ skip: { llmProvider: llmProvider !== void 0, llmApiKey: llmApiKey !== void 0 }
2368
+ });
2369
+ }
2341
2370
  const s2 = Y();
2342
2371
  try {
2343
2372
  s2.start("Creating project");
@@ -2398,15 +2427,15 @@ var createMastraProject = async ({
2398
2427
  );
2399
2428
  }
2400
2429
  s2.stop(`${pm} dependencies installed`);
2401
- s2.start("Installing mastra");
2430
+ s2.start("Installing Mastra CLI");
2402
2431
  const versionTag = createVersionTag ? `@${createVersionTag}` : "@latest";
2403
2432
  try {
2404
2433
  await installMastraDependency(pm, "mastra", versionTag, true, timeout);
2405
2434
  } catch (error) {
2406
2435
  throw new Error(`Failed to install Mastra CLI: ${error instanceof Error ? error.message : "Unknown error"}`);
2407
2436
  }
2408
- s2.stop("mastra installed");
2409
- s2.start("Installing dependencies");
2437
+ s2.stop("Mastra CLI installed");
2438
+ s2.start("Installing Mastra dependencies");
2410
2439
  try {
2411
2440
  await installMastraDependency(pm, "@mastra/core", versionTag, false, timeout);
2412
2441
  await installMastraDependency(pm, "@mastra/libsql", versionTag, false, timeout);
@@ -2433,7 +2462,7 @@ var createMastraProject = async ({
2433
2462
  s2.stop(".gitignore added");
2434
2463
  Se("Project created successfully");
2435
2464
  console.info("");
2436
- return { projectName };
2465
+ return { projectName, result };
2437
2466
  } catch (error) {
2438
2467
  s2.stop();
2439
2468
  const errorMessage = error instanceof Error ? error.message : "An unexpected error occurred";
@@ -2446,14 +2475,17 @@ var create = async (args2) => {
2446
2475
  await createFromTemplate({ ...args2, injectedAnalytics: args2.analytics });
2447
2476
  return;
2448
2477
  }
2449
- const { projectName } = await createMastraProject({
2478
+ const needsInteractive = args2.components === void 0 || args2.llmProvider === void 0 || args2.addExample === void 0;
2479
+ const { projectName, result } = await createMastraProject({
2450
2480
  projectName: args2?.projectName,
2451
2481
  createVersionTag: args2?.createVersionTag,
2452
- timeout: args2?.timeout
2482
+ timeout: args2?.timeout,
2483
+ llmProvider: args2?.llmProvider,
2484
+ llmApiKey: args2?.llmApiKey,
2485
+ needsInteractive
2453
2486
  });
2454
2487
  const directory = args2.directory || "src/";
2455
- if (args2.components === void 0 || args2.llmProvider === void 0 || args2.addExample === void 0) {
2456
- const result = await interactivePrompt();
2488
+ if (needsInteractive && result) {
2457
2489
  await init({
2458
2490
  ...result,
2459
2491
  llmApiKey: result?.llmApiKey,
@@ -2679,7 +2711,7 @@ program.version(`${version}`, "-v, --version").description(`create-mastra ${vers
2679
2711
  program.name("create-mastra").description("Create a new Mastra project").argument("[project-name]", "Directory name of the project").option(
2680
2712
  "-p, --project-name <string>",
2681
2713
  "Project name that will be used in package.json and as the project directory name."
2682
- ).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)").option(
2714
+ ).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)").option(
2683
2715
  "--template [template-name]",
2684
2716
  "Create project from a template (use template name, public GitHub URL, or leave blank to select from list)"
2685
2717
  ).action(async (projectNameArg, args) => {
@@ -2703,7 +2735,7 @@ program.name("create-mastra").description("Create a new Mastra project").argumen
2703
2735
  components: args.components ? args.components.split(",") : [],
2704
2736
  llmProvider: args.llm,
2705
2737
  addExample: args.example,
2706
- llmApiKey: args["llm-api-key"],
2738
+ llmApiKey: args.llmApiKey,
2707
2739
  createVersionTag,
2708
2740
  timeout,
2709
2741
  projectName,