create-mastra 0.0.0-fix-maxSteps-modelsetting-playground-20251008194458 → 0.0.0-fix-read-json-esm-20251009172143
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 +11 -1
- package/dist/index.js +25 -66
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# create-mastra
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-read-json-esm-20251009172143
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Use model-router in create-mastra starter template ([#8631](https://github.com/mastra-ai/mastra/pull/8631))
|
|
8
|
+
|
|
9
|
+
- Adds reset button to model picker to reset to original model set on the agent. ([#8633](https://github.com/mastra-ai/mastra/pull/8633))
|
|
10
|
+
|
|
11
|
+
- Refactor EntryList component and Scorer and Observability pages ([#8652](https://github.com/mastra-ai/mastra/pull/8652))
|
|
12
|
+
|
|
13
|
+
## 0.15.1
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
6
16
|
|
package/dist/index.js
CHANGED
|
@@ -1665,56 +1665,23 @@ var FileService = class {
|
|
|
1665
1665
|
}
|
|
1666
1666
|
};
|
|
1667
1667
|
var exec2 = util.promisify(child_process.exec);
|
|
1668
|
-
var
|
|
1669
|
-
switch (llmProvider) {
|
|
1670
|
-
default:
|
|
1671
|
-
return "latest";
|
|
1672
|
-
}
|
|
1673
|
-
};
|
|
1674
|
-
var getAISDKPackage = (llmProvider) => {
|
|
1675
|
-
switch (llmProvider) {
|
|
1676
|
-
case "openai":
|
|
1677
|
-
return "@ai-sdk/openai";
|
|
1678
|
-
case "anthropic":
|
|
1679
|
-
return "@ai-sdk/anthropic";
|
|
1680
|
-
case "groq":
|
|
1681
|
-
return "@ai-sdk/groq";
|
|
1682
|
-
case "google":
|
|
1683
|
-
return "@ai-sdk/google";
|
|
1684
|
-
case "cerebras":
|
|
1685
|
-
return "@ai-sdk/cerebras";
|
|
1686
|
-
case "mistral":
|
|
1687
|
-
return "@ai-sdk/mistral";
|
|
1688
|
-
default:
|
|
1689
|
-
return "@ai-sdk/openai";
|
|
1690
|
-
}
|
|
1691
|
-
};
|
|
1692
|
-
var getProviderImportAndModelItem = (llmProvider) => {
|
|
1693
|
-
let providerImport = "";
|
|
1694
|
-
let modelItem = "";
|
|
1668
|
+
var getModelIdentifier = (llmProvider) => {
|
|
1695
1669
|
if (llmProvider === "openai") {
|
|
1696
|
-
|
|
1697
|
-
modelItem = `openai('gpt-4o-mini')`;
|
|
1670
|
+
return `'openai/gpt-4o-mini'`;
|
|
1698
1671
|
} else if (llmProvider === "anthropic") {
|
|
1699
|
-
|
|
1700
|
-
modelItem = `anthropic('claude-3-5-sonnet-20241022')`;
|
|
1672
|
+
return `'anthropic/claude-3-5-sonnet-20241022'`;
|
|
1701
1673
|
} else if (llmProvider === "groq") {
|
|
1702
|
-
|
|
1703
|
-
modelItem = `groq('llama-3.3-70b-versatile')`;
|
|
1674
|
+
return `'groq/llama-3.3-70b-versatile'`;
|
|
1704
1675
|
} else if (llmProvider === "google") {
|
|
1705
|
-
|
|
1706
|
-
modelItem = `google('gemini-2.5-pro')`;
|
|
1676
|
+
return `'google/gemini-2.5-pro'`;
|
|
1707
1677
|
} else if (llmProvider === "cerebras") {
|
|
1708
|
-
|
|
1709
|
-
modelItem = `cerebras('llama-3.3-70b')`;
|
|
1678
|
+
return `'cerebras/llama-3.3-70b'`;
|
|
1710
1679
|
} else if (llmProvider === "mistral") {
|
|
1711
|
-
|
|
1712
|
-
modelItem = `mistral('mistral-medium-2508')`;
|
|
1680
|
+
return `'mistral/mistral-medium-2508'`;
|
|
1713
1681
|
}
|
|
1714
|
-
return { providerImport, modelItem };
|
|
1715
1682
|
};
|
|
1716
1683
|
async function writeAgentSample(llmProvider, destPath, addExampleTool) {
|
|
1717
|
-
const
|
|
1684
|
+
const modelString = getModelIdentifier(llmProvider);
|
|
1718
1685
|
const instructions = `
|
|
1719
1686
|
You are a helpful weather assistant that provides accurate weather information and can help planning activities based on the weather.
|
|
1720
1687
|
|
|
@@ -1730,7 +1697,6 @@ async function writeAgentSample(llmProvider, destPath, addExampleTool) {
|
|
|
1730
1697
|
${addExampleTool ? "Use the weatherTool to fetch current weather data." : ""}
|
|
1731
1698
|
`;
|
|
1732
1699
|
const content = `
|
|
1733
|
-
${providerImport}
|
|
1734
1700
|
import { Agent } from '@mastra/core/agent';
|
|
1735
1701
|
import { Memory } from '@mastra/memory';
|
|
1736
1702
|
import { LibSQLStore } from '@mastra/libsql';
|
|
@@ -1739,7 +1705,7 @@ ${addExampleTool ? `import { weatherTool } from '../tools/weather-tool';` : ""}
|
|
|
1739
1705
|
export const weatherAgent = new Agent({
|
|
1740
1706
|
name: 'Weather Agent',
|
|
1741
1707
|
instructions: \`${instructions}\`,
|
|
1742
|
-
model: ${
|
|
1708
|
+
model: ${modelString},
|
|
1743
1709
|
${addExampleTool ? "tools: { weatherTool }," : ""}
|
|
1744
1710
|
memory: new Memory({
|
|
1745
1711
|
storage: new LibSQLStore({
|
|
@@ -2208,7 +2174,6 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
2208
2174
|
return mastraProject;
|
|
2209
2175
|
};
|
|
2210
2176
|
var s = Y();
|
|
2211
|
-
var exec3 = util.promisify(child_process.exec);
|
|
2212
2177
|
var init = async ({
|
|
2213
2178
|
directory,
|
|
2214
2179
|
addExample = false,
|
|
@@ -2256,12 +2221,6 @@ var init = async ({
|
|
|
2256
2221
|
}
|
|
2257
2222
|
}
|
|
2258
2223
|
const key = await getAPIKey(llmProvider || "openai");
|
|
2259
|
-
const aiSdkPackage = getAISDKPackage(llmProvider);
|
|
2260
|
-
const aiSdkPackageVersion = getAISDKPackageVersion(llmProvider);
|
|
2261
|
-
const depsService = new DepsService();
|
|
2262
|
-
const pm = depsService.packageManager;
|
|
2263
|
-
const installCommand = getPackageManagerAddCommand(pm);
|
|
2264
|
-
await exec3(`${pm} ${installCommand} ${aiSdkPackage}@${aiSdkPackageVersion}`);
|
|
2265
2224
|
if (configureEditorWithDocsMCP) {
|
|
2266
2225
|
await installMastraDocsMCPServer({
|
|
2267
2226
|
editor: configureEditorWithDocsMCP,
|
|
@@ -2288,10 +2247,10 @@ var init = async ({
|
|
|
2288
2247
|
return { success: false };
|
|
2289
2248
|
}
|
|
2290
2249
|
};
|
|
2291
|
-
var
|
|
2250
|
+
var exec3 = util.promisify(child_process.exec);
|
|
2292
2251
|
var execWithTimeout = async (command, timeoutMs) => {
|
|
2293
2252
|
try {
|
|
2294
|
-
const promise =
|
|
2253
|
+
const promise = exec3(command, { killSignal: "SIGTERM" });
|
|
2295
2254
|
if (!timeoutMs) {
|
|
2296
2255
|
return await promise;
|
|
2297
2256
|
}
|
|
@@ -2386,9 +2345,9 @@ var createMastraProject = async ({
|
|
|
2386
2345
|
const installCommand = getPackageManagerAddCommand(pm);
|
|
2387
2346
|
s2.message("Initializing project structure");
|
|
2388
2347
|
try {
|
|
2389
|
-
await
|
|
2390
|
-
await
|
|
2391
|
-
await
|
|
2348
|
+
await exec3(`npm init -y`);
|
|
2349
|
+
await exec3(`npm pkg set type="module"`);
|
|
2350
|
+
await exec3(`npm pkg set engines.node=">=20.9.0"`);
|
|
2392
2351
|
const depsService = new DepsService();
|
|
2393
2352
|
await depsService.addScriptsToPackageJson({
|
|
2394
2353
|
dev: "mastra dev",
|
|
@@ -2403,9 +2362,9 @@ var createMastraProject = async ({
|
|
|
2403
2362
|
s2.stop("Project structure created");
|
|
2404
2363
|
s2.start(`Installing ${pm} dependencies`);
|
|
2405
2364
|
try {
|
|
2406
|
-
await
|
|
2407
|
-
await
|
|
2408
|
-
await
|
|
2365
|
+
await exec3(`${pm} ${installCommand} zod@^3`);
|
|
2366
|
+
await exec3(`${pm} ${installCommand} typescript @types/node --save-dev`);
|
|
2367
|
+
await exec3(`echo '{
|
|
2409
2368
|
"compilerOptions": {
|
|
2410
2369
|
"target": "ES2022",
|
|
2411
2370
|
"module": "ES2022",
|
|
@@ -2448,14 +2407,14 @@ var createMastraProject = async ({
|
|
|
2448
2407
|
s2.stop("Mastra dependencies installed");
|
|
2449
2408
|
s2.start("Adding .gitignore");
|
|
2450
2409
|
try {
|
|
2451
|
-
await
|
|
2452
|
-
await
|
|
2453
|
-
await
|
|
2454
|
-
await
|
|
2455
|
-
await
|
|
2456
|
-
await
|
|
2457
|
-
await
|
|
2458
|
-
await
|
|
2410
|
+
await exec3(`echo output.txt >> .gitignore`);
|
|
2411
|
+
await exec3(`echo node_modules >> .gitignore`);
|
|
2412
|
+
await exec3(`echo dist >> .gitignore`);
|
|
2413
|
+
await exec3(`echo .mastra >> .gitignore`);
|
|
2414
|
+
await exec3(`echo .env.development >> .gitignore`);
|
|
2415
|
+
await exec3(`echo .env >> .gitignore`);
|
|
2416
|
+
await exec3(`echo *.db >> .gitignore`);
|
|
2417
|
+
await exec3(`echo *.db-* >> .gitignore`);
|
|
2459
2418
|
} catch (error) {
|
|
2460
2419
|
throw new Error(`Failed to create .gitignore: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
2461
2420
|
}
|