create-mastra 1.35.0 → 1.36.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.
Files changed (2) hide show
  1. package/dist/index.js +225 -210
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -13174,7 +13174,7 @@ const u = Object.create(a, {
13174
13174
  value: o
13175
13175
  }
13176
13176
  });
13177
- function h$1({ preventCancel: r = !1 } = {}) {
13177
+ function h({ preventCancel: r = !1 } = {}) {
13178
13178
  const t = new c(this.getReader(), r), s = Object.create(u);
13179
13179
  return s[n] = t, s;
13180
13180
  }
@@ -13183,7 +13183,7 @@ function h$1({ preventCancel: r = !1 } = {}) {
13183
13183
  const getAsyncIterable = (stream) => {
13184
13184
  if (isReadableStream$1(stream, { checkOpen: false }) && nodeImports.on !== void 0) return getStreamIterable(stream);
13185
13185
  if (typeof stream?.[Symbol.asyncIterator] === "function") return stream;
13186
- if (toString.call(stream) === "[object ReadableStream]") return h$1.call(stream);
13186
+ if (toString.call(stream) === "[object ReadableStream]") return h.call(stream);
13187
13187
  throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.");
13188
13188
  };
13189
13189
  const { toString } = Object.prototype;
@@ -17267,7 +17267,7 @@ var require_yocto_spinner = /* @__PURE__ */ __commonJSMin(((exports, module) =>
17267
17267
  };
17268
17268
  }));
17269
17269
  //#endregion
17270
- //#region ../cli/dist/analytics-BRXRrY-W.js
17270
+ //#region ../cli/dist/analytics-2-XO4VBq.js
17271
17271
  const CREATE_LLM_PROVIDERS = [
17272
17272
  {
17273
17273
  value: "openai",
@@ -19040,7 +19040,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19040
19040
  };
19041
19041
  }));
19042
19042
  //#endregion
19043
- //#region ../cli/dist/create-BosFY7Vw.js
19043
+ //#region ../cli/dist/create-CS8ImN4Y.js
19044
19044
  var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
19045
19045
  var import_yocto_spinner = /* @__PURE__ */ __toESM(require_yocto_spinner(), 1);
19046
19046
  var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
@@ -19552,20 +19552,20 @@ const MANAGED_PROVIDER_CONFIGS = {
19552
19552
  },
19553
19553
  anthropic: {
19554
19554
  displayName: "Anthropic",
19555
- primaryModel: "anthropic/claude-sonnet-5",
19556
- observationalModel: "anthropic/claude-haiku-4-5",
19555
+ primaryModel: "anthropic/claude-sonnet-5-5",
19556
+ observationalModel: "anthropic/claude-haiku-5-5",
19557
19557
  apiKeyEnv: "ANTHROPIC_API_KEY"
19558
19558
  },
19559
19559
  google: {
19560
19560
  displayName: "Google Gemini",
19561
- primaryModel: "google/gemini-3.5-flash",
19562
- observationalModel: "google/gemini-3.5-flash",
19561
+ primaryModel: "google/gemini-3.8-flash",
19562
+ observationalModel: "google/gemini-3.8-flash",
19563
19563
  apiKeyEnv: "GOOGLE_GENERATIVE_AI_API_KEY"
19564
19564
  },
19565
19565
  xai: {
19566
19566
  displayName: "xAI",
19567
- primaryModel: "xai/grok-4.3",
19568
- observationalModel: "xai/grok-4.3",
19567
+ primaryModel: "xai/grok-4.7",
19568
+ observationalModel: "xai/grok-4.7",
19569
19569
  apiKeyEnv: "XAI_API_KEY"
19570
19570
  }
19571
19571
  };
@@ -20310,201 +20310,213 @@ async function resolveTemplate(mode, template) {
20310
20310
  return found;
20311
20311
  }
20312
20312
  //#endregion
20313
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/tinyexec/1.2.4/c7c56567d9cb007a9fb4207e3f75cd973cebb7f566686f8f871484321104afb1/node_modules/tinyexec/dist/main.mjs
20314
- const h = /^path$/i;
20315
- const g = {
20313
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/tinyexec/1.3.1/50fc88cbc4442f3393090d7d0dba550c64855cf2ab2c02916e6c18035fba2f9e/node_modules/tinyexec/dist/main.mjs
20314
+ const isPathLikePattern = /^path$/i;
20315
+ const defaultEnvPathInfo = {
20316
20316
  key: "PATH",
20317
20317
  value: ""
20318
20318
  };
20319
- function _(e) {
20320
- for (const t in e) {
20321
- if (!Object.prototype.hasOwnProperty.call(e, t) || !h.test(t)) continue;
20322
- const n = e[t];
20323
- if (!n) return g;
20319
+ function getPathFromEnv(env) {
20320
+ for (const key in env) {
20321
+ if (!Object.prototype.hasOwnProperty.call(env, key) || !isPathLikePattern.test(key)) continue;
20322
+ const value = env[key];
20323
+ if (!value) return defaultEnvPathInfo;
20324
20324
  return {
20325
- key: t,
20326
- value: n
20325
+ key,
20326
+ value
20327
20327
  };
20328
20328
  }
20329
- return g;
20329
+ return defaultEnvPathInfo;
20330
20330
  }
20331
- function v(e, t) {
20332
- const n = t.value.split(delimiter);
20333
- const r = [];
20334
- let o = e;
20335
- let c;
20331
+ function addNodeBinToPath(cwd, path) {
20332
+ const parts = path.value.split(delimiter);
20333
+ const nodeBinPaths = [];
20334
+ let currentPath = typeof cwd === "string" ? cwd : fileURLToPath(cwd, { windows: false });
20335
+ let lastPath;
20336
20336
  do {
20337
- r.push(resolve(o, "node_modules", ".bin"));
20338
- c = o;
20339
- o = dirname(o);
20340
- } while (o !== c);
20341
- r.push(dirname(process.execPath));
20342
- const l = r.concat(n).join(delimiter);
20337
+ nodeBinPaths.push(resolve(currentPath, "node_modules", ".bin"));
20338
+ lastPath = currentPath;
20339
+ currentPath = dirname(currentPath);
20340
+ } while (currentPath !== lastPath);
20341
+ nodeBinPaths.push(dirname(process.execPath));
20342
+ const newPath = nodeBinPaths.concat(parts).join(delimiter);
20343
20343
  return {
20344
- key: t.key,
20345
- value: l
20344
+ key: path.key,
20345
+ value: newPath
20346
20346
  };
20347
20347
  }
20348
- function y(e, t, n = true) {
20349
- const r = {
20348
+ function computeEnv(cwd, env, nodePath = true) {
20349
+ const envWithDefault = {
20350
20350
  ...process.env,
20351
- ...t
20351
+ ...env
20352
20352
  };
20353
- if (!n) return r;
20354
- const i = v(e, _(r));
20355
- r[i.key] = i.value;
20356
- return r;
20357
- }
20358
- const b = (e) => {
20359
- let t = e.length;
20360
- const n = new PassThrough();
20361
- const r = () => {
20362
- if (--t === 0) n.end();
20353
+ if (!nodePath) return envWithDefault;
20354
+ const envPathInfo = addNodeBinToPath(cwd, getPathFromEnv(envWithDefault));
20355
+ envWithDefault[envPathInfo.key] = envPathInfo.value;
20356
+ return envWithDefault;
20357
+ }
20358
+ const combineStreams = (streams) => {
20359
+ let streamCount = streams.length;
20360
+ const combined = new PassThrough();
20361
+ const maybeEmitEnd = () => {
20362
+ if (--streamCount === 0) combined.end();
20363
20363
  };
20364
- for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
20365
- return n;
20366
- };
20367
- const x = /([()\][%!^"`<>&|;, *?])/g;
20368
- const S = /^#!\s*(.+)/;
20369
- const C = /\.(?:com|exe)$/i;
20370
- const w = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
20371
- const T = process.platform === "win32";
20372
- const E = [
20364
+ for (const stream of streams) pipeline(stream, combined, { end: false }).then(maybeEmitEnd).catch(maybeEmitEnd);
20365
+ return combined;
20366
+ };
20367
+ const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
20368
+ const shebangRegExp = /^#!\s*(.+)/;
20369
+ const isWindowsExecutableRegExp = /\.(?:com|exe)$/i;
20370
+ const isNodeModulesCmdRegExp = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
20371
+ const isWindows = process.platform === "win32";
20372
+ const defaultPathExt = [
20373
20373
  ".EXE",
20374
20374
  ".CMD",
20375
20375
  ".BAT",
20376
20376
  ".COM"
20377
20377
  ];
20378
+ const noPathExt = [""];
20378
20379
  /**
20379
20380
  * Normalizes the command and arguments to work cross-platform.
20380
20381
  * On Windows, this basically handles things like shebangs, calling
20381
20382
  * `node_modules/.bin` commands, and escaping meta characters.
20382
20383
  * On other platforms, it just returns the command and arguments as-is.
20383
20384
  */
20384
- function D(e, t = [], n = {}) {
20385
- if (n.shell === true || !T) return {
20386
- command: e,
20387
- args: t,
20388
- options: n
20385
+ function normalizeSpawnCommand(command, args = [], options = {}) {
20386
+ if (options.shell === true || !isWindows) return {
20387
+ command,
20388
+ args,
20389
+ options
20389
20390
  };
20390
- let i = O(e, n);
20391
- let a = null;
20392
- if (i !== null) {
20393
- const e = 150;
20394
- const t = Buffer.alloc(e);
20395
- let n = null;
20391
+ let file = resolveCommand(command, options);
20392
+ let shebang = null;
20393
+ if (file !== null) {
20394
+ const size = 150;
20395
+ const buffer = Buffer.alloc(size);
20396
+ let fd = null;
20396
20397
  try {
20397
- n = openSync(i, "r");
20398
- readSync(n, t, 0, e, 0);
20398
+ fd = openSync(file, "r");
20399
+ readSync(fd, buffer, 0, size, 0);
20399
20400
  } catch {} finally {
20400
- if (n !== null) closeSync(n);
20401
- }
20402
- const o = t.toString().match(S);
20403
- if (o !== null) {
20404
- const e = o[1].trim();
20405
- const t = e.indexOf(" ");
20406
- const n = t !== -1 ? e.slice(0, t) : e;
20407
- const i = t !== -1 ? e.slice(t + 1) : "";
20408
- const s = basename(n);
20409
- a = s === "env" ? i || null : s;
20410
- }
20411
- }
20412
- if (a !== null && i !== null) {
20413
- t = [i, ...t];
20414
- e = a;
20415
- i = O(e, n);
20416
- }
20417
- if (i === null || !C.test(i)) {
20418
- const r = i !== null && w.test(i);
20419
- e = normalize(e);
20420
- e = e.replace(x, "^$1");
20421
- t = t.map((e) => {
20422
- e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
20423
- e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
20424
- e = `"${e}"`;
20425
- e = e.replace(x, "^$1");
20426
- if (r) e = e.replace(x, "^$1");
20427
- return e;
20401
+ if (fd !== null) closeSync(fd);
20402
+ }
20403
+ const match = buffer.toString().match(shebangRegExp);
20404
+ if (match !== null) {
20405
+ const line = match[1].trim();
20406
+ const separatorIndex = line.indexOf(" ");
20407
+ const path = separatorIndex !== -1 ? line.slice(0, separatorIndex) : line;
20408
+ const argument = separatorIndex !== -1 ? line.slice(separatorIndex + 1) : "";
20409
+ const binary = basename(path);
20410
+ shebang = binary === "env" ? argument || null : binary;
20411
+ }
20412
+ }
20413
+ if (shebang !== null && file !== null) {
20414
+ args = [file, ...args];
20415
+ command = shebang;
20416
+ file = resolveCommand(command, options);
20417
+ }
20418
+ if (file === null || !isWindowsExecutableRegExp.test(file)) {
20419
+ const needsDoubleEscapeMetaChars = file !== null && isNodeModulesCmdRegExp.test(file);
20420
+ command = normalize(command);
20421
+ command = command.replace(metaCharsRegExp, "^$1");
20422
+ args = args.map((arg) => {
20423
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
20424
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
20425
+ arg = `"${arg}"`;
20426
+ arg = arg.replace(metaCharsRegExp, "^$1");
20427
+ if (needsDoubleEscapeMetaChars) arg = arg.replace(metaCharsRegExp, "^$1");
20428
+ return arg;
20428
20429
  });
20429
- t = [
20430
+ args = [
20430
20431
  "/d",
20431
20432
  "/s",
20432
20433
  "/c",
20433
- `"${[e, ...t].join(" ")}"`
20434
+ `"${[command, ...args].join(" ")}"`
20434
20435
  ];
20435
- e = n.env?.comspec ?? "cmd.exe";
20436
- n = {
20437
- ...n,
20436
+ command = options.env?.comspec ?? "cmd.exe";
20437
+ options = {
20438
+ ...options,
20438
20439
  windowsVerbatimArguments: true
20439
20440
  };
20440
20441
  }
20441
20442
  return {
20442
- command: e,
20443
- args: t,
20444
- options: n
20443
+ command,
20444
+ args,
20445
+ options
20445
20446
  };
20446
20447
  }
20447
20448
  /**
20448
20449
  * Resolves the command to an absolute path if possible.
20449
20450
  * Handles things like traversing PATH and adding extensions from PATHEXT
20450
20451
  */
20451
- function O(e, t) {
20452
- const r = (t.cwd ?? cwd()).toString();
20453
- const a = t.env ?? process.env;
20454
- const o = _(a).value;
20455
- const c = e.includes("/") || e.includes("\\") ? [""] : [r, ...o.split(delimiter)];
20456
- const l = a.PATHEXT ? a.PATHEXT.split(delimiter) : E;
20457
- if (e.includes(".") && l[0] !== "") l.unshift("");
20458
- for (const t of c) {
20459
- const n = resolve(r, t.startsWith("\"") && t.endsWith("\"") && t.length > 1 ? t.slice(1, -1) : t, e);
20460
- for (const e of l) {
20461
- const t = n + e;
20452
+ function resolveCommand(command, options) {
20453
+ const cwd$3 = (options.cwd ?? cwd()).toString();
20454
+ const env = options.env ?? process.env;
20455
+ const PATH = getPathFromEnv(env).value;
20456
+ const pathEnv = command.includes("/") || command.includes("\\") ? [""] : [cwd$3, ...PATH.split(delimiter)];
20457
+ let pathExt = env.PATHEXT ? env.PATHEXT.split(delimiter) : defaultPathExt;
20458
+ if (command.includes(".") && pathExt[0] !== "") pathExt = ["", ...pathExt];
20459
+ for (const extensions of [pathExt, noPathExt]) for (const path of pathEnv) {
20460
+ const unquoted = path.startsWith("\"") && path.endsWith("\"") && path.length > 1 ? path.slice(1, -1) : path;
20461
+ const dest = resolve(cwd$3, unquoted, command);
20462
+ for (const ext of extensions) {
20463
+ const destWithExt = dest + ext;
20462
20464
  try {
20463
- if (statSync(t).isFile()) return t;
20465
+ if (statSync(destWithExt).isFile()) return destWithExt;
20464
20466
  } catch {}
20465
20467
  }
20466
20468
  }
20467
20469
  return null;
20468
20470
  }
20469
- var k = class extends Error {
20471
+ var NonZeroExitError = class extends Error {
20470
20472
  result;
20471
20473
  output;
20472
- get exitCode() {
20473
- if (this.result.exitCode !== null) return this.result.exitCode;
20474
- }
20475
- constructor(e, t) {
20476
- super(`Process exited with non-zero status (${e.exitCode})`);
20477
- this.result = e;
20478
- this.output = t;
20474
+ exitCode;
20475
+ get signalCode() {
20476
+ return this.result.signalCode;
20477
+ }
20478
+ constructor(result, output, command, args) {
20479
+ let target = "The process";
20480
+ if (command) target = `The command \`${args?.length ? `${command} ${args.map((a) => /[ "'`()]/.test(a) ? JSON.stringify(a) : a).join(" ")}` : command}\``;
20481
+ const exitCode = result.exitCode ?? 1;
20482
+ super(result.signalCode !== null ? `${target} was killed by the signal ${result.signalCode}` : `${target} exited with a non-zero status (${exitCode})`);
20483
+ this.result = result;
20484
+ this.output = output;
20485
+ this.exitCode = exitCode;
20486
+ Object.defineProperty(this, "result", {
20487
+ enumerable: false,
20488
+ writable: false,
20489
+ configurable: false
20490
+ });
20479
20491
  }
20480
20492
  };
20481
- const j = {
20493
+ const defaultOptions = {
20482
20494
  timeout: void 0,
20483
20495
  persist: false
20484
20496
  };
20485
- const N = { windowsHide: true };
20486
- function P(e) {
20487
- const t = new AbortController();
20488
- for (const n of e) {
20489
- if (n.aborted) {
20490
- t.abort();
20491
- return n;
20497
+ const defaultNodeOptions = { windowsHide: true };
20498
+ function combineSignals(signals) {
20499
+ const controller = new AbortController();
20500
+ for (const signal of signals) {
20501
+ if (signal.aborted) {
20502
+ controller.abort();
20503
+ return signal;
20492
20504
  }
20493
- const e = () => {
20494
- t.abort(n.reason);
20505
+ const onAbort = () => {
20506
+ controller.abort(signal.reason);
20495
20507
  };
20496
- n.addEventListener("abort", e, { signal: t.signal });
20508
+ signal.addEventListener("abort", onAbort, { signal: controller.signal });
20497
20509
  }
20498
- return t.signal;
20510
+ return controller.signal;
20499
20511
  }
20500
- async function F(e) {
20501
- let t = "";
20512
+ async function readStream(stream) {
20513
+ let output = "";
20502
20514
  try {
20503
- for await (const n of e) t += n.toString();
20515
+ for await (const chunk of stream) output += chunk.toString();
20504
20516
  } catch {}
20505
- return t;
20517
+ return output;
20506
20518
  }
20507
- var I = class {
20519
+ var ExecProcess = class {
20508
20520
  _process;
20509
20521
  _aborted = false;
20510
20522
  _options;
@@ -20522,19 +20534,22 @@ var I = class {
20522
20534
  get exitCode() {
20523
20535
  if (this._process && this._process.exitCode !== null) return this._process.exitCode;
20524
20536
  }
20525
- constructor(e, t, n) {
20537
+ get signalCode() {
20538
+ return this._process?.signalCode ?? null;
20539
+ }
20540
+ constructor(command, args, options) {
20526
20541
  this._options = {
20527
- ...j,
20528
- ...n
20542
+ ...defaultOptions,
20543
+ ...options
20529
20544
  };
20530
- this._command = e;
20531
- this._args = t ?? [];
20532
- this._processClosed = new Promise((e) => {
20533
- this._resolveClose = e;
20545
+ this._command = command;
20546
+ this._args = args ?? [];
20547
+ this._processClosed = new Promise((resolve) => {
20548
+ this._resolveClose = resolve;
20534
20549
  });
20535
20550
  }
20536
- kill(e) {
20537
- return this._process?.kill(e) === true;
20551
+ kill(signal) {
20552
+ return this._process?.kill(signal) === true;
20538
20553
  }
20539
20554
  get aborted() {
20540
20555
  return this._aborted;
@@ -20542,99 +20557,99 @@ var I = class {
20542
20557
  get killed() {
20543
20558
  return this._process?.killed === true;
20544
20559
  }
20545
- pipe(e, t, n) {
20546
- return z(e, t, {
20547
- ...n,
20560
+ pipe(command, args, options) {
20561
+ return exec(command, args, {
20562
+ ...options,
20548
20563
  stdin: this
20549
20564
  });
20550
20565
  }
20551
20566
  async *[Symbol.asyncIterator]() {
20552
- const e = this._process;
20553
- if (!e) return;
20554
- const t = [];
20555
- if (this._streamErr) t.push(this._streamErr);
20556
- if (this._streamOut) t.push(this._streamOut);
20557
- const n = b(t);
20558
- const r = l__default.createInterface({ input: n });
20559
- for await (const e of r) yield e.toString();
20567
+ const proc = this._process;
20568
+ if (!proc) return;
20569
+ const streams = [];
20570
+ if (this._streamErr) streams.push(this._streamErr);
20571
+ if (this._streamOut) streams.push(this._streamOut);
20572
+ const streamCombined = combineStreams(streams);
20573
+ const rl = l__default.createInterface({ input: streamCombined });
20574
+ for await (const chunk of rl) yield chunk.toString();
20560
20575
  await this._processClosed;
20561
- e.removeAllListeners();
20576
+ proc.removeAllListeners();
20562
20577
  if (this._thrownError) throw this._thrownError;
20563
- if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this);
20578
+ if (this._options?.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, void 0, this._command, this._args);
20564
20579
  }
20565
20580
  async _waitForOutput() {
20566
- const e = this._process;
20567
- if (!e) throw new Error("No process was started");
20568
- const [t, n] = await Promise.all([this._streamOut ? F(this._streamOut) : "", this._streamErr ? F(this._streamErr) : ""]);
20581
+ const proc = this._process;
20582
+ if (!proc) throw new Error("No process was started");
20583
+ const [stdout, stderr] = await Promise.all([this._streamOut ? readStream(this._streamOut) : "", this._streamErr ? readStream(this._streamErr) : ""]);
20569
20584
  await this._processClosed;
20570
- const { stdin: r } = this._options;
20571
- if (r && typeof r !== "string") await r;
20572
- e.removeAllListeners();
20585
+ const { stdin } = this._options;
20586
+ if (stdin && typeof stdin !== "string") await stdin;
20587
+ proc.removeAllListeners();
20573
20588
  if (this._thrownError) throw this._thrownError;
20574
- const i = {
20575
- stderr: n,
20576
- stdout: t,
20589
+ const result = {
20590
+ stderr,
20591
+ stdout,
20577
20592
  exitCode: this.exitCode
20578
20593
  };
20579
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this, i);
20580
- return i;
20594
+ if (this._options.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, result, this._command, this._args);
20595
+ return result;
20581
20596
  }
20582
- then(e, t) {
20583
- return this._waitForOutput().then(e, t);
20597
+ then(onfulfilled, onrejected) {
20598
+ return this._waitForOutput().then(onfulfilled, onrejected);
20584
20599
  }
20585
20600
  _streamOut;
20586
20601
  _streamErr;
20587
20602
  spawn() {
20588
- const t = cwd();
20589
- const r = this._options;
20590
- const i = {
20591
- ...N,
20592
- ...r.nodeOptions
20603
+ const options = this._options;
20604
+ const nodeOptions = {
20605
+ ...defaultNodeOptions,
20606
+ ...options.nodeOptions
20593
20607
  };
20594
- const a = [];
20608
+ const cwd$1 = nodeOptions?.cwd ?? cwd();
20609
+ const signals = [];
20595
20610
  this._resetState();
20596
- if (r.timeout !== void 0) a.push(AbortSignal.timeout(r.timeout));
20597
- if (r.signal !== void 0) a.push(r.signal);
20598
- if (r.persist === true) i.detached = true;
20599
- if (a.length > 0) i.signal = P(a);
20600
- i.env = y(t, i.env, r.nodePath);
20601
- const o = D(this._command, this._args, i);
20602
- const s = spawn(o.command, o.args, o.options);
20603
- if (s.stderr) this._streamErr = s.stderr;
20604
- if (s.stdout) this._streamOut = s.stdout;
20605
- this._process = s;
20606
- s.once("error", this._onError);
20607
- s.once("close", this._onClose);
20608
- if (s.stdin) {
20609
- const { stdin: e } = r;
20610
- if (typeof e === "string") s.stdin.end(e);
20611
- else e?.process?.stdout?.pipe(s.stdin);
20611
+ if (options.timeout !== void 0) signals.push(AbortSignal.timeout(options.timeout));
20612
+ if (options.signal !== void 0) signals.push(options.signal);
20613
+ if (options.persist === true) nodeOptions.detached = true;
20614
+ if (signals.length > 0) nodeOptions.signal = combineSignals(signals);
20615
+ nodeOptions.env = computeEnv(cwd$1, nodeOptions.env, options.nodePath);
20616
+ const crossResult = normalizeSpawnCommand(this._command, this._args, nodeOptions);
20617
+ const handle = spawn(crossResult.command, crossResult.args, crossResult.options);
20618
+ if (handle.stderr) this._streamErr = handle.stderr;
20619
+ if (handle.stdout) this._streamOut = handle.stdout;
20620
+ this._process = handle;
20621
+ handle.once("error", this._onError);
20622
+ handle.once("close", this._onClose);
20623
+ if (handle.stdin) {
20624
+ const { stdin } = options;
20625
+ if (typeof stdin === "string") handle.stdin.end(stdin);
20626
+ else stdin?.process?.stdout?.pipe(handle.stdin);
20612
20627
  }
20613
20628
  }
20614
20629
  _resetState() {
20615
20630
  this._aborted = false;
20616
- this._processClosed = new Promise((e) => {
20617
- this._resolveClose = e;
20631
+ this._processClosed = new Promise((resolve) => {
20632
+ this._resolveClose = resolve;
20618
20633
  });
20619
20634
  this._thrownError = void 0;
20620
20635
  }
20621
- _onError = (e) => {
20622
- if (e.name === "AbortError" && (!(e.cause instanceof Error) || e.cause.name !== "TimeoutError")) {
20636
+ _onError = (err) => {
20637
+ if (err.name === "AbortError" && (!(err.cause instanceof Error) || err.cause.name !== "TimeoutError")) {
20623
20638
  this._aborted = true;
20624
20639
  return;
20625
20640
  }
20626
- this._thrownError = e;
20641
+ this._thrownError = err;
20627
20642
  };
20628
20643
  _onClose = () => {
20629
20644
  if (this._resolveClose) this._resolveClose();
20630
20645
  };
20631
20646
  };
20632
- const R = (e, t, n) => {
20633
- const r = new I(e, t, n);
20634
- r.spawn();
20635
- return r;
20647
+ const x = (command, args, userOptions) => {
20648
+ const proc = new ExecProcess(command, args, userOptions);
20649
+ proc.spawn();
20650
+ return proc;
20636
20651
  };
20637
- const z = R;
20652
+ const exec = x;
20638
20653
  //#endregion
20639
20654
  //#region src/utils.ts
20640
20655
  const NUMERIC_IDENTIFIER_PATTERN = /^\d+$/;
@@ -20665,7 +20680,7 @@ function selectMatchingDistTag(version, output) {
20665
20680
  }
20666
20681
  async function getCreateVersionTag(version) {
20667
20682
  try {
20668
- const { stdout } = await R("npm", [
20683
+ const { stdout } = await x("npm", [
20669
20684
  "dist-tag",
20670
20685
  "ls",
20671
20686
  "create-mastra"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mastra",
3
- "version": "1.35.0",
3
+ "version": "1.36.0-alpha.1",
4
4
  "description": "Create Mastra apps with one command",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -29,15 +29,15 @@
29
29
  "project"
30
30
  ],
31
31
  "devDependencies": {
32
- "@types/node": "22.20.1",
32
+ "@types/node": "22.20.5",
33
33
  "commander": "^14.0.3",
34
34
  "posthog-node": "^5.46.1",
35
35
  "tinyexec": "^1.1.1",
36
- "tsdown": "0.22.9",
36
+ "tsdown": "0.23.1",
37
37
  "typescript": "^7.0.2",
38
- "vitest": "4.1.11",
38
+ "vitest": "4.1.12",
39
39
  "@internal/lint": "0.0.145",
40
- "mastra": "^1.35.0"
40
+ "mastra": "^1.36.0-alpha.1"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=22.13.0"