create-mastra 1.31.4 → 1.32.0-alpha.1
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/dist/{api-BGKH9pvf-LDY6JwG1.js → api-CVjIOyAz-D4vD-OC_.js} +2 -2
- package/dist/api-DbUBKdi7-BEk9ll7L.js +2 -0
- package/dist/{client-CdJ_HgDO-BKCiJhNz.js → client-BzuP6FOB-C6hwDwJW.js} +2 -2
- package/dist/{credentials-Cgc5DcYQ-Cfe8N7V8.js → credentials-6AY2wEWQ-DCCCg72E.js} +3 -4
- package/dist/{credentials-eVrTJpX5-B_ojx3gd.js → credentials-CWNvAR_H-CFn0Jiq0.js} +1 -1
- package/dist/index.js +10 -11
- package/package.json +2 -2
- package/dist/api-CrE_4oCE-SjPzk-JC.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as throwApiError, r as createApiClient } from "./client-
|
|
2
|
-
//#region ../cli/dist/api-
|
|
1
|
+
import { a as throwApiError, r as createApiClient } from "./client-BzuP6FOB-C6hwDwJW.js";
|
|
2
|
+
//#region ../cli/dist/api-CVjIOyAz.js
|
|
3
3
|
async function fetchOrgs(token) {
|
|
4
4
|
const { data, error, response } = await createApiClient(token).GET("/v1/auth/orgs");
|
|
5
5
|
if (error) throwApiError("Failed to fetch orgs", response.status, error.detail);
|
|
@@ -385,7 +385,7 @@ function removeTrailingSlash(url) {
|
|
|
385
385
|
return url;
|
|
386
386
|
}
|
|
387
387
|
//#endregion
|
|
388
|
-
//#region ../cli/dist/client-
|
|
388
|
+
//#region ../cli/dist/client-BzuP6FOB.js
|
|
389
389
|
const MASTRA_PLATFORM_API_URL = process.env.MASTRA_PLATFORM_API_URL || "https://platform.mastra.ai";
|
|
390
390
|
process.env.MASTRA_PROJECTS_URL;
|
|
391
391
|
/**
|
|
@@ -443,7 +443,7 @@ async function authenticatedFetch(input, init) {
|
|
|
443
443
|
if (response.status !== 401 || !_currentToken) return response;
|
|
444
444
|
if (!_refreshInFlight) _refreshInFlight = (async () => {
|
|
445
445
|
try {
|
|
446
|
-
const { tryRefreshToken, loadCredentials } = await import("./credentials-
|
|
446
|
+
const { tryRefreshToken, loadCredentials } = await import("./credentials-CWNvAR_H-CFn0Jiq0.js");
|
|
447
447
|
const creds = await loadCredentials();
|
|
448
448
|
if (!creds) throw new Error("No credentials");
|
|
449
449
|
const newToken = await tryRefreshToken(creds);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as MASTRA_PLATFORM_API_URL } from "./client-
|
|
1
|
+
import { t as MASTRA_PLATFORM_API_URL } from "./client-BzuP6FOB-C6hwDwJW.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import "node:path";
|
|
4
4
|
import process$1, { stdin, stdout } from "node:process";
|
|
5
|
-
import { randomBytes } from "crypto";
|
|
6
5
|
import { readFileSync as readFileSync$1 } from "fs";
|
|
7
6
|
import { homedir, release } from "os";
|
|
8
7
|
import { join } from "path";
|
|
@@ -1131,7 +1130,7 @@ ${i ? styleText("cyan", S_BAR_END) : ""}
|
|
|
1131
1130
|
}
|
|
1132
1131
|
}).prompt();
|
|
1133
1132
|
//#endregion
|
|
1134
|
-
//#region ../cli/dist/credentials-
|
|
1133
|
+
//#region ../cli/dist/credentials-6AY2wEWQ.js
|
|
1135
1134
|
const CREDENTIALS_DIR = join(homedir(), ".mastra");
|
|
1136
1135
|
const CREDENTIALS_FILE = join(CREDENTIALS_DIR, "credentials.json");
|
|
1137
1136
|
var LoginCancelledError = class extends Error {
|
|
@@ -1306,7 +1305,7 @@ async function loginAttempt(signal, options = {}) {
|
|
|
1306
1305
|
signal?.throwIfAborted();
|
|
1307
1306
|
console.info("\n Logging in to Mastra...\n");
|
|
1308
1307
|
const server = createServer();
|
|
1309
|
-
const state =
|
|
1308
|
+
const state = Buffer.from(globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16))).toString("hex");
|
|
1310
1309
|
const port = await new Promise((resolve) => {
|
|
1311
1310
|
server.listen(0, "127.0.0.1", () => {
|
|
1312
1311
|
const addr = server.address();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as loadCredentials, o as tryRefreshToken } from "./credentials-
|
|
1
|
+
import { i as loadCredentials, o as tryRefreshToken } from "./credentials-6AY2wEWQ-DCCCg72E.js";
|
|
2
2
|
export { loadCredentials, tryRefreshToken };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
import { _ as __require, a as setCurrentOrgId, c as log, d as password, f as select, g as __commonJSMin, h as isCancel, l as note, m as text, n as getCurrentOrgId, p as spinner, r as getToken, s as cancel, t as LoginCancelledError, u as outro, v as __toESM } from "./credentials-
|
|
3
|
-
import { i as platformFetch, n as authHeaders, t as MASTRA_PLATFORM_API_URL } from "./client-
|
|
4
|
-
import { t as fetchOrgs } from "./api-
|
|
2
|
+
import { _ as __require, a as setCurrentOrgId, c as log, d as password, f as select, g as __commonJSMin, h as isCancel, l as note, m as text, n as getCurrentOrgId, p as spinner, r as getToken, s as cancel, t as LoginCancelledError, u as outro, v as __toESM } from "./credentials-6AY2wEWQ-DCCCg72E.js";
|
|
3
|
+
import { i as platformFetch, n as authHeaders, t as MASTRA_PLATFORM_API_URL } from "./client-BzuP6FOB-C6hwDwJW.js";
|
|
4
|
+
import { t as fetchOrgs } from "./api-CVjIOyAz-D4vD-OC_.js";
|
|
5
5
|
import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
|
|
6
6
|
import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
7
7
|
import path, { basename, delimiter, dirname, isAbsolute, normalize, resolve } from "node:path";
|
|
8
8
|
import { appendFileSync, closeSync, constants, createReadStream, createWriteStream, openSync, readFileSync, readSync, statSync, writeFileSync } from "node:fs";
|
|
9
9
|
import process$1, { cwd, execArgv, execPath, hrtime, platform } from "node:process";
|
|
10
|
-
import { randomUUID } from "crypto";
|
|
11
10
|
import fs, { constants as constants$1, existsSync, mkdirSync, readFileSync as readFileSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
12
11
|
import os from "os";
|
|
13
12
|
import path$1, { dirname as dirname$1, isAbsolute as isAbsolute$1, posix, relative, sep } from "path";
|
|
@@ -3039,7 +3038,7 @@ const { program: program$1, createCommand, createArgument, createOption, Command
|
|
|
3039
3038
|
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
3040
3039
|
})))(), 1)).default;
|
|
3041
3040
|
//#endregion
|
|
3042
|
-
//#region ../cli/dist/orgs-
|
|
3041
|
+
//#region ../cli/dist/orgs-o4TfRqWZ.js
|
|
3043
3042
|
var OrgSelectionCancelledError = class extends Error {
|
|
3044
3043
|
constructor() {
|
|
3045
3044
|
super("Organization selection cancelled");
|
|
@@ -15142,7 +15141,7 @@ var require_yocto_spinner = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
15142
15141
|
};
|
|
15143
15142
|
}));
|
|
15144
15143
|
//#endregion
|
|
15145
|
-
//#region ../cli/dist/analytics-
|
|
15144
|
+
//#region ../cli/dist/analytics-CUzu3vA8.js
|
|
15146
15145
|
const CREATE_LLM_PROVIDERS = [
|
|
15147
15146
|
{
|
|
15148
15147
|
value: "openai",
|
|
@@ -15356,7 +15355,7 @@ var PosthogAnalytics = class PosthogAnalytics {
|
|
|
15356
15355
|
if (distinctId && !this.isHostnameDerivedDistinctId(distinctId)) {
|
|
15357
15356
|
const config = {
|
|
15358
15357
|
distinctId,
|
|
15359
|
-
sessionId: sessionId || randomUUID()
|
|
15358
|
+
sessionId: sessionId || globalThis.crypto.randomUUID()
|
|
15360
15359
|
};
|
|
15361
15360
|
if (config.sessionId !== sessionId) this.writeCliConfig(config, configPath);
|
|
15362
15361
|
return config;
|
|
@@ -15365,7 +15364,7 @@ var PosthogAnalytics = class PosthogAnalytics {
|
|
|
15365
15364
|
} catch {}
|
|
15366
15365
|
const config = {
|
|
15367
15366
|
distinctId: this.createDistinctId(),
|
|
15368
|
-
sessionId: randomUUID()
|
|
15367
|
+
sessionId: globalThis.crypto.randomUUID()
|
|
15369
15368
|
};
|
|
15370
15369
|
this.writeCliConfig(config, configPath);
|
|
15371
15370
|
return config;
|
|
@@ -15401,7 +15400,7 @@ var PosthogAnalytics = class PosthogAnalytics {
|
|
|
15401
15400
|
return true;
|
|
15402
15401
|
}
|
|
15403
15402
|
createDistinctId() {
|
|
15404
|
-
return `mastra-${randomUUID()}`;
|
|
15403
|
+
return `mastra-${globalThis.crypto.randomUUID()}`;
|
|
15405
15404
|
}
|
|
15406
15405
|
isHostnameDerivedDistinctId(distinctId) {
|
|
15407
15406
|
return distinctId === `mastra-${os.hostname()}`;
|
|
@@ -16906,7 +16905,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
16906
16905
|
};
|
|
16907
16906
|
}));
|
|
16908
16907
|
//#endregion
|
|
16909
|
-
//#region ../cli/dist/create-
|
|
16908
|
+
//#region ../cli/dist/create-C-potNQz.js
|
|
16910
16909
|
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
16911
16910
|
var import_yocto_spinner = /* @__PURE__ */ __toESM(require_yocto_spinner(), 1);
|
|
16912
16911
|
var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
|
|
@@ -17536,7 +17535,7 @@ function adaptReadme(source, provider, config, projectName, packageManager) {
|
|
|
17536
17535
|
};
|
|
17537
17536
|
}
|
|
17538
17537
|
async function writeSecureEnv(envPath, content) {
|
|
17539
|
-
const tempPath = path$1.join(path$1.dirname(envPath), `.env.mastra-create-${process.pid}-${randomUUID()}.tmp`);
|
|
17538
|
+
const tempPath = path$1.join(path$1.dirname(envPath), `.env.mastra-create-${process.pid}-${globalThis.crypto.randomUUID()}.tmp`);
|
|
17540
17539
|
try {
|
|
17541
17540
|
await fsPromises.writeFile(tempPath, content, {
|
|
17542
17541
|
encoding: "utf8",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mastra",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0-alpha.1",
|
|
4
4
|
"description": "Create Mastra apps with one command",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"typescript": "^7.0.2",
|
|
39
39
|
"vitest": "4.1.11",
|
|
40
40
|
"@internal/lint": "0.0.138",
|
|
41
|
-
"mastra": "^1.
|
|
41
|
+
"mastra": "^1.32.0-alpha.1"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=22.13.0"
|