create-mastra 0.0.0-pg-pool-options-20250428183821 → 0.0.0-redis-cloud-transporter-20250508191651
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/README.md +0 -1
- package/dist/index.js +55 -8
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1030,20 +1030,41 @@ async function writeMergedConfig(configPath) {
|
|
|
1030
1030
|
});
|
|
1031
1031
|
}
|
|
1032
1032
|
var windsurfGlobalMCPConfigPath = path.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
1033
|
+
var cursorGlobalMCPConfigPath = path.join(os.homedir(), ".cursor", "mcp.json");
|
|
1033
1034
|
async function installMastraDocsMCPServer({
|
|
1034
1035
|
editor,
|
|
1035
1036
|
directory
|
|
1036
1037
|
}) {
|
|
1037
|
-
if (editor === `cursor`)
|
|
1038
|
-
|
|
1039
|
-
|
|
1038
|
+
if (editor === `cursor`) {
|
|
1039
|
+
await writeMergedConfig(path.join(directory, ".cursor", "mcp.json"));
|
|
1040
|
+
}
|
|
1041
|
+
if (editor === `cursor-global`) {
|
|
1042
|
+
const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor);
|
|
1043
|
+
if (alreadyInstalled) {
|
|
1044
|
+
return;
|
|
1045
|
+
}
|
|
1046
|
+
await writeMergedConfig(cursorGlobalMCPConfigPath);
|
|
1047
|
+
}
|
|
1048
|
+
if (editor === `windsurf`) {
|
|
1049
|
+
const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor);
|
|
1050
|
+
if (alreadyInstalled) {
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
await writeMergedConfig(windsurfGlobalMCPConfigPath);
|
|
1054
|
+
}
|
|
1040
1055
|
}
|
|
1041
|
-
async function
|
|
1042
|
-
|
|
1056
|
+
async function globalMCPIsAlreadyInstalled(editor) {
|
|
1057
|
+
let configPath = ``;
|
|
1058
|
+
if (editor === "windsurf") {
|
|
1059
|
+
configPath = windsurfGlobalMCPConfigPath;
|
|
1060
|
+
} else if (editor === "cursor-global") {
|
|
1061
|
+
configPath = cursorGlobalMCPConfigPath;
|
|
1062
|
+
}
|
|
1063
|
+
if (!configPath || !existsSync(configPath)) {
|
|
1043
1064
|
return false;
|
|
1044
1065
|
}
|
|
1045
1066
|
try {
|
|
1046
|
-
const configContents = await readJSON(
|
|
1067
|
+
const configContents = await readJSON(configPath);
|
|
1047
1068
|
if (!configContents?.mcpServers) return false;
|
|
1048
1069
|
const hasMastraMCP = Object.values(configContents.mcpServers).some(
|
|
1049
1070
|
(server) => server?.args?.find((arg) => arg?.includes(`@mastra/mcp-docs-server`))
|
|
@@ -1220,6 +1241,7 @@ async function writeAgentSample(llmProvider, destPath, addExampleTool) {
|
|
|
1220
1241
|
${providerImport}
|
|
1221
1242
|
import { Agent } from '@mastra/core/agent';
|
|
1222
1243
|
import { Memory } from '@mastra/memory';
|
|
1244
|
+
import { LibSQLStore } from '@mastra/libsql';
|
|
1223
1245
|
${addExampleTool ? `import { weatherTool } from '../tools';` : ""}
|
|
1224
1246
|
|
|
1225
1247
|
export const weatherAgent = new Agent({
|
|
@@ -1228,6 +1250,9 @@ export const weatherAgent = new Agent({
|
|
|
1228
1250
|
model: ${modelItem},
|
|
1229
1251
|
${addExampleTool ? "tools: { weatherTool }," : ""}
|
|
1230
1252
|
memory: new Memory({
|
|
1253
|
+
storage: new LibSQLStore({
|
|
1254
|
+
url: "file:../mastra.db", // path is relative to the .mastra/output directory
|
|
1255
|
+
}),
|
|
1231
1256
|
options: {
|
|
1232
1257
|
lastMessages: 10,
|
|
1233
1258
|
semanticRecall: false,
|
|
@@ -1612,12 +1637,22 @@ var interactivePrompt = async () => {
|
|
|
1612
1637
|
initialValue: false
|
|
1613
1638
|
}),
|
|
1614
1639
|
configureEditorWithDocsMCP: async () => {
|
|
1615
|
-
const windsurfIsAlreadyInstalled = await
|
|
1640
|
+
const windsurfIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`windsurf`);
|
|
1641
|
+
const cursorIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`cursor`);
|
|
1616
1642
|
const editor = await le({
|
|
1617
1643
|
message: `Make your AI IDE into a Mastra expert? (installs Mastra docs MCP server)`,
|
|
1618
1644
|
options: [
|
|
1619
1645
|
{ value: "skip", label: "Skip for now", hint: "default" },
|
|
1620
|
-
{
|
|
1646
|
+
{
|
|
1647
|
+
value: "cursor",
|
|
1648
|
+
label: "Cursor (project only)",
|
|
1649
|
+
hint: cursorIsAlreadyInstalled ? `Already installed globally` : void 0
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
value: "cursor-global",
|
|
1653
|
+
label: "Cursor (global, all projects)",
|
|
1654
|
+
hint: cursorIsAlreadyInstalled ? `Already installed` : void 0
|
|
1655
|
+
},
|
|
1621
1656
|
{
|
|
1622
1657
|
value: "windsurf",
|
|
1623
1658
|
label: "Windsurf",
|
|
@@ -1638,6 +1673,18 @@ Note: you will need to go into Cursor Settings -> MCP Settings and manually enab
|
|
|
1638
1673
|
`
|
|
1639
1674
|
);
|
|
1640
1675
|
}
|
|
1676
|
+
if (editor === `cursor-global`) {
|
|
1677
|
+
const confirm2 = await le({
|
|
1678
|
+
message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
|
|
1679
|
+
options: [
|
|
1680
|
+
{ value: "yes", label: "Yes, I understand" },
|
|
1681
|
+
{ value: "skip", label: "No, skip for now" }
|
|
1682
|
+
]
|
|
1683
|
+
});
|
|
1684
|
+
if (confirm2 !== `yes`) {
|
|
1685
|
+
return void 0;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1641
1688
|
if (editor === `windsurf`) {
|
|
1642
1689
|
const confirm2 = await le({
|
|
1643
1690
|
message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
|