create-mastra 1.34.3-alpha.1 → 1.34.3-alpha.2

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.
@@ -1,5 +1,5 @@
1
- import { a as throwApiError, r as createApiClient } from "./client-AynAmeED-Ch8TO6_R.js";
2
- //#region ../cli/dist/api-DtWqdbfc.js
1
+ import { a as throwApiError, r as createApiClient } from "./client-CjwEyp8q-BKiCNR2M.js";
2
+ //#region ../cli/dist/api-C943QZP2.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);
@@ -0,0 +1,2 @@
1
+ import { t as fetchOrgs } from "./api-C943QZP2-DFG4x1Vg.js";
2
+ export { fetchOrgs };
@@ -385,7 +385,7 @@ function removeTrailingSlash(url) {
385
385
  return url;
386
386
  }
387
387
  //#endregion
388
- //#region ../cli/dist/client-AynAmeED.js
388
+ //#region ../cli/dist/client-CjwEyp8q.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-B1OFICch-DYVepl2B.js");
446
+ const { tryRefreshToken, loadCredentials } = await import("./credentials-DOGNs6Oq-BZEdZ4jK.js");
447
447
  const creds = await loadCredentials();
448
448
  if (!creds) throw new Error("No credentials");
449
449
  const newToken = await tryRefreshToken(creds);
@@ -1,2 +1,2 @@
1
- import { i as loadCredentials, o as tryRefreshToken } from "./credentials-CK0wp32m-CJMPAZxG.js";
1
+ import { i as loadCredentials, o as tryRefreshToken } from "./credentials-DSp55v-D-Cp45w0Gg.js";
2
2
  export { loadCredentials, tryRefreshToken };
@@ -1,4 +1,4 @@
1
- import { t as MASTRA_PLATFORM_API_URL } from "./client-AynAmeED-Ch8TO6_R.js";
1
+ import { t as MASTRA_PLATFORM_API_URL } from "./client-CjwEyp8q-BKiCNR2M.js";
2
2
  import { createRequire } from "node:module";
3
3
  import "node:path";
4
4
  import process$1, { stdin, stdout } from "node:process";
@@ -1130,7 +1130,7 @@ ${i ? styleText("cyan", S_BAR_END) : ""}
1130
1130
  }
1131
1131
  }).prompt();
1132
1132
  //#endregion
1133
- //#region ../cli/dist/credentials-CK0wp32m.js
1133
+ //#region ../cli/dist/credentials-DSp55v-D.js
1134
1134
  const CREDENTIALS_DIR = join(homedir(), ".mastra");
1135
1135
  const CREDENTIALS_FILE = join(CREDENTIALS_DIR, "credentials.json");
1136
1136
  var LoginCancelledError = class extends Error {
@@ -1312,7 +1312,7 @@ async function loginAttempt(signal, options = {}) {
1312
1312
  if (typeof addr === "object" && addr) resolve(addr.port);
1313
1313
  });
1314
1314
  });
1315
- const loginUrl = `${MASTRA_PLATFORM_API_URL}/v1/auth/login?product=cli&cli_port=${port}&state=${state}`;
1315
+ const loginUrl = `${MASTRA_PLATFORM_API_URL}/v1/auth/login?product=cli&cli_port=${port}&state=${state}&source=${options.source ?? "mastra-cli"}`;
1316
1316
  console.info(` Opening browser...\n`);
1317
1317
  console.info(options.skipOnInput ? ` Waiting for browser sign-in. Press any key to skip this step.\n` : ` Waiting for browser sign-in...\n`);
1318
1318
  try {
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
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-CK0wp32m-CJMPAZxG.js";
3
- import { i as platformFetch, n as authHeaders, t as MASTRA_PLATFORM_API_URL } from "./client-AynAmeED-Ch8TO6_R.js";
4
- import { t as fetchOrgs } from "./api-DtWqdbfc-CcBd-aTg.js";
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-DSp55v-D-Cp45w0Gg.js";
3
+ import { i as platformFetch, n as authHeaders, t as MASTRA_PLATFORM_API_URL } from "./client-CjwEyp8q-BKiCNR2M.js";
4
+ import { t as fetchOrgs } from "./api-C943QZP2-DFG4x1Vg.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";
@@ -3038,7 +3038,7 @@ const { program: program$1, createCommand, createArgument, createOption, Command
3038
3038
  exports.InvalidOptionArgumentError = InvalidArgumentError;
3039
3039
  })))(), 1)).default;
3040
3040
  //#endregion
3041
- //#region ../cli/dist/orgs-D7Y6tQrs.js
3041
+ //#region ../cli/dist/orgs-CmpPEv7u.js
3042
3042
  var OrgSelectionCancelledError = class extends Error {
3043
3043
  constructor() {
3044
3044
  super("Organization selection cancelled");
@@ -15141,7 +15141,7 @@ var require_yocto_spinner = /* @__PURE__ */ __commonJSMin(((exports, module) =>
15141
15141
  };
15142
15142
  }));
15143
15143
  //#endregion
15144
- //#region ../cli/dist/analytics-DWpjWO54.js
15144
+ //#region ../cli/dist/analytics-CymFkXqr.js
15145
15145
  const CREATE_LLM_PROVIDERS = [
15146
15146
  {
15147
15147
  value: "openai",
@@ -16905,7 +16905,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16905
16905
  };
16906
16906
  }));
16907
16907
  //#endregion
16908
- //#region ../cli/dist/create-BHu_ChVJ.js
16908
+ //#region ../cli/dist/create-DfNx2en7.js
16909
16909
  var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
16910
16910
  var import_yocto_spinner = /* @__PURE__ */ __toESM(require_yocto_spinner(), 1);
16911
16911
  var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
@@ -17801,7 +17801,10 @@ const create = async (args) => {
17801
17801
  platformSetupController = new AbortController();
17802
17802
  platformSetupPromise = (async () => {
17803
17803
  try {
17804
- const token = await getToken(platformSetupController.signal, { skipOnInput: true });
17804
+ const token = await getToken(platformSetupController.signal, {
17805
+ skipOnInput: true,
17806
+ source: args.loginSource
17807
+ });
17805
17808
  return {
17806
17809
  status: "ready",
17807
17810
  token,
@@ -18548,7 +18551,8 @@ program.action(async (projectName, args) => {
18548
18551
  try {
18549
18552
  await runCreateCommand(projectName, args, {
18550
18553
  analytics,
18551
- resolveVersionTag: () => getCreateVersionTag(version)
18554
+ resolveVersionTag: () => getCreateVersionTag(version),
18555
+ loginSource: "create-mastra"
18552
18556
  });
18553
18557
  } catch (error) {
18554
18558
  if (isCreateCancelledError(error)) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mastra",
3
- "version": "1.34.3-alpha.1",
3
+ "version": "1.34.3-alpha.2",
4
4
  "description": "Create Mastra apps with one command",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -37,8 +37,8 @@
37
37
  "tsdown": "0.22.9",
38
38
  "typescript": "^7.0.2",
39
39
  "vitest": "4.1.11",
40
- "@internal/lint": "0.0.144",
41
- "mastra": "^1.34.3-alpha.1"
40
+ "mastra": "^1.34.3-alpha.2",
41
+ "@internal/lint": "0.0.144"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=22.13.0"
@@ -1,2 +0,0 @@
1
- import { t as fetchOrgs } from "./api-DtWqdbfc-CcBd-aTg.js";
2
- export { fetchOrgs };