mastra 1.2.0-alpha.0 → 1.2.0
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 +37 -0
- package/dist/{chunk-DL5M5FW4.js → chunk-QJU74G5T.js} +163 -6
- package/dist/chunk-QJU74G5T.js.map +1 -0
- package/dist/commands/create/create.js +1 -1
- package/dist/commands/init/init.d.ts.map +1 -1
- package/dist/commands/init/utils.d.ts +27 -0
- package/dist/commands/init/utils.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/studio/assets/{chunk-REDZDNFN-B1h1ZDj2.js → chunk-REDZDNFN-Cr7xlPG_.js} +1 -1
- package/dist/studio/assets/{chunk-REDZDNFN-DEIWVTdL-LySG-R9N.js → chunk-REDZDNFN-KUvJSx-S-BG-LxUq_.js} +1 -1
- package/dist/studio/assets/{index-BbcPkqqG.js → index--riPlyqE.js} +1 -1
- package/dist/studio/assets/{index-DCex8gek.js → index-B1Qtw4Lj.js} +1 -1
- package/dist/studio/assets/{index-dVgy6ip_.js → index-BW4-uLEI.js} +1 -1
- package/dist/studio/assets/{index-u0MYjYam.js → index-BceWItRu.js} +1 -1
- package/dist/studio/assets/{index-C-5dy6Qq.js → index-Bv0RkQNw.js} +1 -1
- package/dist/studio/assets/{index-CSs-4m0p.js → index-C0AURa5c.js} +1 -1
- package/dist/studio/assets/{index-BaP41C_M.js → index-C69KpY5X.js} +1 -1
- package/dist/studio/assets/{index-Bb0_7deK.js → index-C9ZwK38q.js} +1 -1
- package/dist/studio/assets/{index-gDKdgR9I.js → index-CQEYP2RS.js} +1 -1
- package/dist/studio/assets/{index-Brmwje1P.js → index-CQPrZsle.js} +1 -1
- package/dist/studio/assets/{index-vfs-GrkG.js → index-CikqFwBO.js} +1 -1
- package/dist/studio/assets/{index-CnU7qRRh.js → index-DKp3jcP0.js} +1 -1
- package/dist/studio/assets/{index-CJyUGMMI.js → index-DOqGjpNO.js} +1 -1
- package/dist/studio/assets/{index-BU6-V5-H.js → index-DPafMKjV.js} +1 -1
- package/dist/studio/assets/{index-BJpgwAGp.js → index-DcT1YIno.js} +1 -1
- package/dist/studio/assets/{index-D-TLz1Eb.js → index-eexUQSlS.js} +1 -1
- package/dist/studio/assets/{index-Dph5IXDn.js → index-jRz9XLMK.js} +1 -1
- package/dist/studio/assets/{index-B3nQYWEG.js → index-tVehqBsq.js} +1 -1
- package/dist/studio/assets/{main-DCSw5iri.js → main-Sp1WAZ1t.js} +320 -312
- package/dist/studio/assets/style-DzVBZqmb.css +1 -0
- package/dist/studio/assets/{token-6GSAFR2W-XRCSVUPZ-JdBnAp2N-BrwCf0cv.js → token-6GSAFR2W-XRCSVUPZ-CDj_xl7O-VTKn_yTk.js} +1 -1
- package/dist/studio/assets/{token-6GSAFR2W-XRCSVUPZ-D7fJytFD.js → token-6GSAFR2W-XRCSVUPZ-k3nryV4h.js} +1 -1
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-DFtrw2uQ.js +1 -0
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-OABXDW2K-BH3AU3Ec.js +1 -0
- package/dist/studio/index.html +2 -2
- package/package.json +6 -6
- package/dist/chunk-DL5M5FW4.js.map +0 -1
- package/dist/studio/assets/style-9tNEqKIZ.css +0 -1
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-C_zdtskZ.js +0 -1
- package/dist/studio/assets/token-util-NEHG7TUY-U7CX7GS4-DhQqQpmz-9agnERDb.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# mastra
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **New feature:** You can install the Mastra skill during the `create-mastra` wizard. ([#12582](https://github.com/mastra-ai/mastra/pull/12582))
|
|
8
|
+
|
|
9
|
+
The wizard now asks you to install the official Mastra skill. Choose your favorite agent and your newly created project is set up.
|
|
10
|
+
For non-interactive setup, use the `--skills` flag that accepts comma-separated agent names (e.g. `--skills claude-code`).
|
|
11
|
+
|
|
12
|
+
- Pre-select Claude Code, Codex, OpenCode, and Cursor as default agents when users choose to install Mastra skills during project creation. Codex has been promoted to the popular agents list for better visibility. ([#12626](https://github.com/mastra-ai/mastra/pull/12626))
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Fixed peer dependency checker fix command to suggest the correct package to upgrade: ([#12529](https://github.com/mastra-ai/mastra/pull/12529))
|
|
17
|
+
- If peer dep is too old (below range) → suggests upgrading the peer dep (e.g., `@mastra/core`)
|
|
18
|
+
- If peer dep is too new (above range) → suggests upgrading the package requiring it (e.g., `@mastra/libsql`)
|
|
19
|
+
|
|
20
|
+
- Add `AGENTS.md` file (and optionally `CLAUDE.md`) during `create mastra` creation ([#12658](https://github.com/mastra-ai/mastra/pull/12658))
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`e6fc281`](https://github.com/mastra-ai/mastra/commit/e6fc281896a3584e9e06465b356a44fe7faade65), [`97be6c8`](https://github.com/mastra-ai/mastra/commit/97be6c8963130fca8a664fcf99d7b3a38e463595), [`2770921`](https://github.com/mastra-ai/mastra/commit/2770921eec4d55a36b278d15c3a83f694e462ee5), [`b1695db`](https://github.com/mastra-ai/mastra/commit/b1695db2d7be0c329d499619c7881899649188d0), [`5fe1fe0`](https://github.com/mastra-ai/mastra/commit/5fe1fe0109faf2c87db34b725d8a4571a594f80e), [`4133d48`](https://github.com/mastra-ai/mastra/commit/4133d48eaa354cdb45920dc6265732ffbc96788d), [`5dd01cc`](https://github.com/mastra-ai/mastra/commit/5dd01cce68d61874aa3ecbd91ee17884cfd5aca2), [`13e0a2a`](https://github.com/mastra-ai/mastra/commit/13e0a2a2bcec01ff4d701274b3727d5e907a6a01), [`f6673b8`](https://github.com/mastra-ai/mastra/commit/f6673b893b65b7d273ad25ead42e990704cc1e17), [`cd6be8a`](https://github.com/mastra-ai/mastra/commit/cd6be8ad32741cd41cabf508355bb31b71e8a5bd), [`9eb4e8e`](https://github.com/mastra-ai/mastra/commit/9eb4e8e39efbdcfff7a40ff2ce07ce2714c65fa8), [`c987384`](https://github.com/mastra-ai/mastra/commit/c987384d6c8ca844a9701d7778f09f5a88da7f9f), [`cb8cc12`](https://github.com/mastra-ai/mastra/commit/cb8cc12bfadd526aa95a01125076f1da44e4afa7), [`aa37c84`](https://github.com/mastra-ai/mastra/commit/aa37c84d29b7db68c72517337932ef486c316275), [`62f5d50`](https://github.com/mastra-ai/mastra/commit/62f5d5043debbba497dacb7ab008fe86b38b8de3), [`47eba72`](https://github.com/mastra-ai/mastra/commit/47eba72f0397d0d14fbe324b97940c3d55e5a525)]:
|
|
23
|
+
- @mastra/core@1.2.0
|
|
24
|
+
- @mastra/deployer@1.2.0
|
|
25
|
+
|
|
26
|
+
## 1.2.0-alpha.1
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- Pre-select Claude Code, Codex, OpenCode, and Cursor as default agents when users choose to install Mastra skills during project creation. Codex has been promoted to the popular agents list for better visibility. ([#12626](https://github.com/mastra-ai/mastra/pull/12626))
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Add `AGENTS.md` file (and optionally `CLAUDE.md`) during `create mastra` creation ([#12658](https://github.com/mastra-ai/mastra/pull/12658))
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [[`2770921`](https://github.com/mastra-ai/mastra/commit/2770921eec4d55a36b278d15c3a83f694e462ee5), [`b1695db`](https://github.com/mastra-ai/mastra/commit/b1695db2d7be0c329d499619c7881899649188d0), [`4133d48`](https://github.com/mastra-ai/mastra/commit/4133d48eaa354cdb45920dc6265732ffbc96788d), [`5dd01cc`](https://github.com/mastra-ai/mastra/commit/5dd01cce68d61874aa3ecbd91ee17884cfd5aca2), [`13e0a2a`](https://github.com/mastra-ai/mastra/commit/13e0a2a2bcec01ff4d701274b3727d5e907a6a01), [`c987384`](https://github.com/mastra-ai/mastra/commit/c987384d6c8ca844a9701d7778f09f5a88da7f9f), [`cb8cc12`](https://github.com/mastra-ai/mastra/commit/cb8cc12bfadd526aa95a01125076f1da44e4afa7), [`62f5d50`](https://github.com/mastra-ai/mastra/commit/62f5d5043debbba497dacb7ab008fe86b38b8de3)]:
|
|
37
|
+
- @mastra/core@1.2.0-alpha.1
|
|
38
|
+
- @mastra/deployer@1.2.0-alpha.1
|
|
39
|
+
|
|
3
40
|
## 1.2.0-alpha.0
|
|
4
41
|
|
|
5
42
|
### Minor Changes
|
|
@@ -21,7 +21,7 @@ import { PinoLogger } from '@mastra/loggers';
|
|
|
21
21
|
// package.json
|
|
22
22
|
var package_default = {
|
|
23
23
|
name: "mastra",
|
|
24
|
-
version: "1.2.0
|
|
24
|
+
version: "1.2.0",
|
|
25
25
|
license: "Apache-2.0",
|
|
26
26
|
description: "cli for mastra",
|
|
27
27
|
type: "module",
|
|
@@ -1085,12 +1085,13 @@ var interactivePrompt = async (args = {}) => {
|
|
|
1085
1085
|
const POPULAR_AGENTS = [
|
|
1086
1086
|
{ value: "claude-code", label: "Claude Code" },
|
|
1087
1087
|
{ value: "cursor", label: "Cursor" },
|
|
1088
|
+
{ value: "codex", label: "Codex" },
|
|
1089
|
+
{ value: "opencode", label: "OpenCode" },
|
|
1088
1090
|
{ value: "windsurf", label: "Windsurf" },
|
|
1089
1091
|
{ value: "github-copilot", label: "GitHub Copilot" },
|
|
1090
1092
|
{ value: "cline", label: "Cline" },
|
|
1091
1093
|
{ value: "continue", label: "Continue" },
|
|
1092
1094
|
{ value: "gemini-cli", label: "Gemini CLI" },
|
|
1093
|
-
{ value: "opencode", label: "OpenCode" },
|
|
1094
1095
|
{ value: "replit", label: "Replit" },
|
|
1095
1096
|
{ value: "roo", label: "Roo Code" }
|
|
1096
1097
|
];
|
|
@@ -1101,7 +1102,6 @@ var interactivePrompt = async (args = {}) => {
|
|
|
1101
1102
|
{ value: "antigravity", label: "Antigravity" },
|
|
1102
1103
|
{ value: "augment", label: "Augment" },
|
|
1103
1104
|
{ value: "codebuddy", label: "CodeBuddy" },
|
|
1104
|
-
{ value: "codex", label: "Codex" },
|
|
1105
1105
|
{ value: "command-code", label: "Command Code" },
|
|
1106
1106
|
{ value: "crush", label: "Crush" },
|
|
1107
1107
|
{ value: "droid", label: "Droid" },
|
|
@@ -1129,7 +1129,8 @@ var interactivePrompt = async (args = {}) => {
|
|
|
1129
1129
|
];
|
|
1130
1130
|
const initialSelection = await p.multiselect({
|
|
1131
1131
|
message: "Select agent(s) to install skills for:",
|
|
1132
|
-
options: [...POPULAR_AGENTS, { value: "__show_all__", label: "+ Show all agents (
|
|
1132
|
+
options: [...POPULAR_AGENTS, { value: "__show_all__", label: "+ Show all agents (29 more)" }],
|
|
1133
|
+
initialValues: ["claude-code", "codex", "opencode", "cursor"],
|
|
1133
1134
|
required: true
|
|
1134
1135
|
});
|
|
1135
1136
|
if (p.isCancel(initialSelection)) {
|
|
@@ -1263,6 +1264,146 @@ var checkForPkgJson = async () => {
|
|
|
1263
1264
|
process.exit(1);
|
|
1264
1265
|
}
|
|
1265
1266
|
};
|
|
1267
|
+
function generateAgentsMarkdown({ skills, mcpServer }) {
|
|
1268
|
+
const hasSkills = skills && skills.length > 0;
|
|
1269
|
+
const hasMcp = !!mcpServer;
|
|
1270
|
+
let content = `# AGENTS.md
|
|
1271
|
+
|
|
1272
|
+
This document provides guidance for AI coding agents working in this repository.
|
|
1273
|
+
|
|
1274
|
+
## Project Overview
|
|
1275
|
+
|
|
1276
|
+
This is a **Mastra** project written in TypeScript. Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
|
|
1277
|
+
|
|
1278
|
+
## Commands
|
|
1279
|
+
|
|
1280
|
+
Use these commands to interact with the project.
|
|
1281
|
+
|
|
1282
|
+
### Installation
|
|
1283
|
+
|
|
1284
|
+
\`\`\`bash
|
|
1285
|
+
npm install
|
|
1286
|
+
\`\`\`
|
|
1287
|
+
|
|
1288
|
+
### Development
|
|
1289
|
+
|
|
1290
|
+
Start the Mastra Studio at localhost:4111 by running the \`dev\` script:
|
|
1291
|
+
|
|
1292
|
+
\`\`\`bash
|
|
1293
|
+
npm run dev
|
|
1294
|
+
\`\`\`
|
|
1295
|
+
|
|
1296
|
+
### Build
|
|
1297
|
+
|
|
1298
|
+
In order to build a production-ready server, run the \`build\` script:
|
|
1299
|
+
|
|
1300
|
+
\`\`\`bash
|
|
1301
|
+
npm run build
|
|
1302
|
+
\`\`\`
|
|
1303
|
+
|
|
1304
|
+
## Project Structure
|
|
1305
|
+
|
|
1306
|
+
Folders organize your agent's resources, like agents, tools, and workflows.
|
|
1307
|
+
|
|
1308
|
+
| Folder | Description |
|
|
1309
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1310
|
+
| \`src/mastra\` | Entry point for all Mastra-related code and configuration. |
|
|
1311
|
+
| \`src/mastra/agents\` | Define and configure your agents - their behavior, goals, and tools. |
|
|
1312
|
+
| \`src/mastra/workflows\` | Define multi-step workflows that orchestrate agents and tools together. |
|
|
1313
|
+
| \`src/mastra/tools\` | Create reusable tools that your agents can call |
|
|
1314
|
+
| \`src/mastra/mcp\` | (Optional) Implement custom MCP servers to share your tools with external agents |
|
|
1315
|
+
| \`src/mastra/scorers\` | (Optional) Define scorers for evaluating agent performance over time |
|
|
1316
|
+
| \`src/mastra/public\` | (Optional) Contents are copied into the \`.build/output\` directory during the build process, making them available for serving at runtime |
|
|
1317
|
+
|
|
1318
|
+
### Top-level files
|
|
1319
|
+
|
|
1320
|
+
Top-level files define how your Mastra project is configured, built, and connected to its environment.
|
|
1321
|
+
|
|
1322
|
+
| File | Description |
|
|
1323
|
+
| --------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
1324
|
+
| \`src/mastra/index.ts\` | Central entry point where you configure and initialize Mastra. |
|
|
1325
|
+
| \`.env.example\` | Template for environment variables - copy and rename to \`.env\` to add your secret [model provider](/models) keys. |
|
|
1326
|
+
| \`package.json\` | Defines project metadata, dependencies, and available npm scripts. |
|
|
1327
|
+
| \`tsconfig.json\` | Configures TypeScript options such as path aliases, compiler settings, and build output. |
|
|
1328
|
+
|
|
1329
|
+
`;
|
|
1330
|
+
if (hasSkills) {
|
|
1331
|
+
content += `## Mastra Skills
|
|
1332
|
+
|
|
1333
|
+
Skills are modular capabilities that extend agent functionalities. They provide pre-built tools, integrations, and workflows that agents can leverage to accomplish tasks more effectively.
|
|
1334
|
+
|
|
1335
|
+
This project has skills installed for the following agents:
|
|
1336
|
+
|
|
1337
|
+
${skills.map(
|
|
1338
|
+
(agent) => `- ${agent.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ")}`
|
|
1339
|
+
).join("\n")}
|
|
1340
|
+
|
|
1341
|
+
### Using Skills
|
|
1342
|
+
|
|
1343
|
+
Skills are automatically available to agents in your project once installed. Agents can access and use these skills without additional configuration.
|
|
1344
|
+
|
|
1345
|
+
`;
|
|
1346
|
+
}
|
|
1347
|
+
if (hasMcp) {
|
|
1348
|
+
const editorName = mcpServer === "cursor-global" ? "Cursor (global)" : mcpServer.charAt(0).toUpperCase() + mcpServer.slice(1);
|
|
1349
|
+
content += `## MCP Docs Server
|
|
1350
|
+
|
|
1351
|
+
This project has the Mastra MCP Docs Server configured for ${editorName}.
|
|
1352
|
+
|
|
1353
|
+
### Using MCP Docs
|
|
1354
|
+
|
|
1355
|
+
The MCP server provides embedded documentation access within your editor:
|
|
1356
|
+
|
|
1357
|
+
1. The server was automatically configured during project creation
|
|
1358
|
+
2. Restart your editor to load the MCP server
|
|
1359
|
+
3. Use the Mastra docs tools in your editor to access:
|
|
1360
|
+
- API references
|
|
1361
|
+
- Code examples
|
|
1362
|
+
- Integration guides
|
|
1363
|
+
|
|
1364
|
+
Learn more in the [MCP Documentation](https://mastra.ai/docs/mcp/overview).
|
|
1365
|
+
|
|
1366
|
+
`;
|
|
1367
|
+
}
|
|
1368
|
+
content += `## Resources
|
|
1369
|
+
|
|
1370
|
+
- [Mastra Documentation](https://mastra.ai/llms.txt)
|
|
1371
|
+
- [Mastra .well-known skills discovery](https://mastra.ai/.well-known/skills/index.json)
|
|
1372
|
+
`;
|
|
1373
|
+
return content;
|
|
1374
|
+
}
|
|
1375
|
+
function generateClaudeMarkdown({ mcpServer }) {
|
|
1376
|
+
return `# CLAUDE.md
|
|
1377
|
+
|
|
1378
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
1379
|
+
|
|
1380
|
+
This is a Mastra project - an AI framework for building agents, workflows, and tools. The project structure follows Mastra conventions with agents, tools, and workflows organized in the \`src/mastra/\` directory.
|
|
1381
|
+
|
|
1382
|
+
For complete setup and usage instructions, see [AGENTS.md](./AGENTS.md), which includes:
|
|
1383
|
+
- Quick start commands
|
|
1384
|
+
- Project structure details
|
|
1385
|
+
- Mastra skills usage${mcpServer ? "\n- MCP Docs Server configuration" : ""}
|
|
1386
|
+
- Links to relevant documentation
|
|
1387
|
+
`;
|
|
1388
|
+
}
|
|
1389
|
+
async function writeAgentsMarkdown(options) {
|
|
1390
|
+
const content = generateAgentsMarkdown(options);
|
|
1391
|
+
const formattedContent = await prettier.format(content, {
|
|
1392
|
+
parser: "markdown",
|
|
1393
|
+
singleQuote: true
|
|
1394
|
+
});
|
|
1395
|
+
const filePath = path3.join(process.cwd(), "AGENTS.md");
|
|
1396
|
+
await fs4.writeFile(filePath, formattedContent);
|
|
1397
|
+
}
|
|
1398
|
+
async function writeClaudeMarkdown(options) {
|
|
1399
|
+
const content = generateClaudeMarkdown(options);
|
|
1400
|
+
const formattedContent = await prettier.format(content, {
|
|
1401
|
+
parser: "markdown",
|
|
1402
|
+
singleQuote: true
|
|
1403
|
+
});
|
|
1404
|
+
const filePath = path3.join(process.cwd(), "CLAUDE.md");
|
|
1405
|
+
await fs4.writeFile(filePath, formattedContent);
|
|
1406
|
+
}
|
|
1266
1407
|
function getPackageManager() {
|
|
1267
1408
|
const userAgent = process.env.npm_config_user_agent || "";
|
|
1268
1409
|
const execPath = process.env.npm_execpath || "";
|
|
@@ -1651,6 +1792,22 @@ Warning: ${error instanceof Error ? error.message : "Unknown error"}`));
|
|
|
1651
1792
|
versionTag
|
|
1652
1793
|
});
|
|
1653
1794
|
}
|
|
1795
|
+
if (skills && skills.length > 0 || mcpServer) {
|
|
1796
|
+
try {
|
|
1797
|
+
await writeAgentsMarkdown({ skills, mcpServer });
|
|
1798
|
+
const shouldWriteClaudeMd = skills?.includes("claude-code");
|
|
1799
|
+
if (shouldWriteClaudeMd) {
|
|
1800
|
+
await writeClaudeMarkdown({ skills, mcpServer });
|
|
1801
|
+
}
|
|
1802
|
+
} catch (error) {
|
|
1803
|
+
console.warn(
|
|
1804
|
+
color2.yellow(
|
|
1805
|
+
`
|
|
1806
|
+
Warning: Failed to create agent guide files: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
1807
|
+
)
|
|
1808
|
+
);
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1654
1811
|
if (initGit) {
|
|
1655
1812
|
s.start("Initializing git repository");
|
|
1656
1813
|
try {
|
|
@@ -2226,5 +2383,5 @@ async function createFromTemplate(args) {
|
|
|
2226
2383
|
}
|
|
2227
2384
|
|
|
2228
2385
|
export { COMPONENTS, DepsService, FileService, LLMProvider, checkAndInstallCoreDeps, checkForPkgJson, create, createLogger, getVersionTag, init, interactivePrompt, isGitInitialized, logger, package_default, parseComponents, parseLlmProvider, parseMcp, parseSkills, shouldSkipDotenvLoading };
|
|
2229
|
-
//# sourceMappingURL=chunk-
|
|
2230
|
-
//# sourceMappingURL=chunk-
|
|
2386
|
+
//# sourceMappingURL=chunk-QJU74G5T.js.map
|
|
2387
|
+
//# sourceMappingURL=chunk-QJU74G5T.js.map
|