@mastra/deployer 1.79.0-alpha.9 → 1.79.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.
Files changed (90) hide show
  1. package/dist/{analyze-RHscSUJm.cjs → analyze-Cb5JJp7Y.cjs} +14 -10
  2. package/dist/analyze-Cb5JJp7Y.cjs.map +1 -0
  3. package/dist/{analyze-CFPQzJ-2.js → analyze-CbVhoukh.js} +14 -10
  4. package/dist/{analyze-CFPQzJ-2.js.map → analyze-CbVhoukh.js.map} +1 -1
  5. package/dist/arktype-aI7TBD0R-BP9yJr5x.cjs.map +1 -1
  6. package/dist/arktype-aI7TBD0R-cgd8o1cq.js.map +1 -1
  7. package/dist/build/analyze.cjs +1 -1
  8. package/dist/build/analyze.js +1 -2
  9. package/dist/build/bundler.cjs +1 -1
  10. package/dist/build/bundler.js +1 -2
  11. package/dist/build/index.cjs +6 -6
  12. package/dist/build/index.js +5 -5
  13. package/dist/build/plugins/tsconfig-paths.d.ts +4 -3
  14. package/dist/build/plugins/tsconfig-paths.d.ts.map +1 -1
  15. package/dist/{build-dI0V50la.cjs → build-DGwrw0dD.cjs} +45 -45
  16. package/dist/build-DGwrw0dD.cjs.map +1 -0
  17. package/dist/{build-BPErn9z9.js → build-qnakIZAs.js} +5 -5
  18. package/dist/{build-BPErn9z9.js.map → build-qnakIZAs.js.map} +1 -1
  19. package/dist/bundler/index.cjs +23 -16
  20. package/dist/bundler/index.cjs.map +1 -1
  21. package/dist/bundler/index.js +21 -14
  22. package/dist/bundler/index.js.map +1 -1
  23. package/dist/{bundler-B2N9qjjr.js → bundler-BUqyRuGu.js} +63 -67
  24. package/dist/{bundler-B2N9qjjr.js.map → bundler-BUqyRuGu.js.map} +1 -1
  25. package/dist/{bundler-DdqMsDyv.cjs → bundler-Dpd5nkcu.cjs} +64 -69
  26. package/dist/bundler-Dpd5nkcu.cjs.map +1 -0
  27. package/dist/{bundlerOptions-DoMtLtV1.cjs → bundlerOptions-DHcbcD1a.cjs} +4 -4
  28. package/dist/bundlerOptions-DHcbcD1a.cjs.map +1 -0
  29. package/dist/{bundlerOptions-BHgxhzOz.js → bundlerOptions-DMxva0Sp.js} +2 -2
  30. package/dist/{bundlerOptions-BHgxhzOz.js.map → bundlerOptions-DMxva0Sp.js.map} +1 -1
  31. package/dist/{core-DPXkjlFR.js → core-75DLMtZL.js} +17 -13
  32. package/dist/{core-DPXkjlFR.js.map → core-75DLMtZL.js.map} +1 -1
  33. package/dist/{core-DLXu5DhR.cjs → core-XnTfh3E_.cjs} +17 -13
  34. package/dist/{core-DLXu5DhR.cjs.map → core-XnTfh3E_.cjs.map} +1 -1
  35. package/dist/dist-DYm9bBZO.js.map +1 -1
  36. package/dist/dist-twPJIvYf.cjs.map +1 -1
  37. package/dist/docs/SKILL.md +1 -1
  38. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  39. package/dist/{effect-QlVUlMFu-DSdymSCI.cjs → effect-QlVUlMFu-CC0Mpf1v.cjs} +2 -2
  40. package/dist/{effect-QlVUlMFu-DSdymSCI.cjs.map → effect-QlVUlMFu-CC0Mpf1v.cjs.map} +1 -1
  41. package/dist/{effect-QlVUlMFu-BcDDX4B1.js → effect-QlVUlMFu-Cvay38Oi.js} +2 -2
  42. package/dist/{effect-QlVUlMFu-BcDDX4B1.js.map → effect-QlVUlMFu-Cvay38Oi.js.map} +1 -1
  43. package/dist/{esm-Bvuc3c9Z.js → esm-ClsnEB2d.js} +67 -69
  44. package/dist/{esm-Bvuc3c9Z.js.map → esm-ClsnEB2d.js.map} +1 -1
  45. package/dist/{esm-SvpXPPt6.cjs → esm-D74qc_jV.cjs} +67 -69
  46. package/dist/{esm-SvpXPPt6.cjs.map → esm-D74qc_jV.cjs.map} +1 -1
  47. package/dist/{index-CLddUTqr-CAnnFeRJ.js → index-CLddUTqr-86A1rnBL.js} +5 -5
  48. package/dist/{index-CLddUTqr-CAnnFeRJ.js.map → index-CLddUTqr-86A1rnBL.js.map} +1 -1
  49. package/dist/{index-CLddUTqr-BpIkA9jT.cjs → index-CLddUTqr-D0GzVJyg.cjs} +5 -5
  50. package/dist/{index-CLddUTqr-BpIkA9jT.cjs.map → index-CLddUTqr-D0GzVJyg.cjs.map} +1 -1
  51. package/dist/index.cjs +3 -3
  52. package/dist/index.js +3 -3
  53. package/dist/{rolldown-runtime-emK7D4bc.cjs → rolldown-runtime-Gi87jfEt.cjs} +2 -2
  54. package/dist/server/index.cjs +95 -80
  55. package/dist/server/index.cjs.map +1 -1
  56. package/dist/server/index.js +72 -57
  57. package/dist/server/index.js.map +1 -1
  58. package/dist/services/index.cjs +1 -1
  59. package/dist/services/index.js +1 -2
  60. package/dist/{services-Ce_5qHk2.js → services-183Omg3U.js} +28 -25
  61. package/dist/{services-Ce_5qHk2.js.map → services-183Omg3U.js.map} +1 -1
  62. package/dist/{services-tWHmAszq.cjs → services-C1jM_6ta.cjs} +31 -27
  63. package/dist/services-C1jM_6ta.cjs.map +1 -0
  64. package/dist/{sury-CWZTCd75-eYGXWpqb.cjs → sury-CWZTCd75-TIJwZAOz.cjs} +2 -2
  65. package/dist/{sury-CWZTCd75-eYGXWpqb.cjs.map → sury-CWZTCd75-TIJwZAOz.cjs.map} +1 -1
  66. package/dist/{sury-CWZTCd75-CdrsvbNi.js → sury-CWZTCd75-r5hgAI0o.js} +2 -2
  67. package/dist/{sury-CWZTCd75-CdrsvbNi.js.map → sury-CWZTCd75-r5hgAI0o.js.map} +1 -1
  68. package/dist/typebox-Dei93FPO-B14DOQQD.cjs.map +1 -1
  69. package/dist/typebox-Dei93FPO-BCfJ-0cP.js.map +1 -1
  70. package/dist/{utils-Bsr_sEcH.cjs → utils-C-gJcJAo.cjs} +4 -4
  71. package/dist/utils-C-gJcJAo.cjs.map +1 -0
  72. package/dist/{valibot--1zFm7rT-aC9oayBT.cjs → valibot--1zFm7rT-BiQdCU9y.cjs} +2 -2
  73. package/dist/{valibot--1zFm7rT-aC9oayBT.cjs.map → valibot--1zFm7rT-BiQdCU9y.cjs.map} +1 -1
  74. package/dist/{valibot--1zFm7rT-CCFD-Qor.js → valibot--1zFm7rT-CU_2XLpq.js} +2 -2
  75. package/dist/{valibot--1zFm7rT-CCFD-Qor.js.map → valibot--1zFm7rT-CU_2XLpq.js.map} +1 -1
  76. package/dist/validator/custom-resolver.cjs +1 -1
  77. package/dist/validator/custom-resolver.cjs.map +1 -1
  78. package/dist/validator/loader.cjs.map +1 -1
  79. package/dist/validator/loader.js.map +1 -1
  80. package/dist/{zod-Bwrt9trS-D1WWVzpr.js → zod-Bwrt9trS-BurSNK0g.js} +4 -4
  81. package/dist/{zod-Bwrt9trS-D1WWVzpr.js.map → zod-Bwrt9trS-BurSNK0g.js.map} +1 -1
  82. package/dist/{zod-Bwrt9trS-OBujxXwV.cjs → zod-Bwrt9trS-Kv0hKWrV.cjs} +4 -4
  83. package/dist/{zod-Bwrt9trS-OBujxXwV.cjs.map → zod-Bwrt9trS-Kv0hKWrV.cjs.map} +1 -1
  84. package/package.json +11 -12
  85. package/dist/analyze-RHscSUJm.cjs.map +0 -1
  86. package/dist/build-dI0V50la.cjs.map +0 -1
  87. package/dist/bundler-DdqMsDyv.cjs.map +0 -1
  88. package/dist/bundlerOptions-DoMtLtV1.cjs.map +0 -1
  89. package/dist/services-tWHmAszq.cjs.map +0 -1
  90. package/dist/utils-Bsr_sEcH.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { d as normalizeStudioBase, n as escapeStudioHtmlValue, o as injectStudioHtmlConfig } from "../utils-Bl3Lm7SI.js";
2
- import "../index-CLddUTqr-CAnnFeRJ.js";
2
+ import "../index-CLddUTqr-86A1rnBL.js";
3
3
  import { createReadStream, existsSync, statSync } from "fs";
4
4
  import { readFile } from "fs/promises";
5
5
  import { dirname, join } from "path";
@@ -812,7 +812,7 @@ const buildOutgoingHttpHeaders = (headers, defaultContentType) => {
812
812
  const outgoingEnded = Symbol("outgoingEnded");
813
813
  const incomingDraining = Symbol("incomingDraining");
814
814
  const DRAIN_TIMEOUT_MS = 500;
815
- const MAX_DRAIN_BYTES = 64 * 1024 * 1024;
815
+ const MAX_DRAIN_BYTES = 67108864;
816
816
  const drainIncoming = (incoming) => {
817
817
  const incomingWithDrainState = incoming;
818
818
  if (incoming.destroyed || incomingWithDrainState[incomingDraining]) return;
@@ -1759,13 +1759,15 @@ var ERR_INVALID_ARG_TYPE = class extends TypeError {
1759
1759
  }
1760
1760
  if (other.length > 0) msg += " or ";
1761
1761
  }
1762
- if (other.length > 0) if (other.length > 2) {
1763
- const last = other.pop();
1764
- msg += `one of ${other.join(", ")}, or ${last}`;
1765
- } else if (other.length === 2) msg += `one of ${other[0]} or ${other[1]}`;
1766
- else {
1767
- if (other[0].toLowerCase() !== other[0]) msg += "an ";
1768
- msg += `${other[0]}`;
1762
+ if (other.length > 0) {
1763
+ if (other.length > 2) {
1764
+ const last = other.pop();
1765
+ msg += `one of ${other.join(", ")}, or ${last}`;
1766
+ } else if (other.length === 2) msg += `one of ${other[0]} or ${other[1]}`;
1767
+ else {
1768
+ if (other[0].toLowerCase() !== other[0]) msg += "an ";
1769
+ msg += `${other[0]}`;
1770
+ }
1769
1771
  }
1770
1772
  msg += `. Received ${determineSpecificType(actual)}`;
1771
1773
  super(msg);
@@ -1966,11 +1968,13 @@ var FetchIncomingMessage = class extends Readable {
1966
1968
  field = field.slice(1);
1967
1969
  if (typeof dest[field] === "string") dest[field] += (flag === 0 ? ", " : "; ") + value;
1968
1970
  else dest[field] = value;
1969
- } else if (flag === 1) if (dest["set-cookie"] !== void 0) dest["set-cookie"].push(value);
1970
- else dest["set-cookie"] = [value];
1971
- else if (this.joinDuplicateHeaders) if (dest[field] === void 0) dest[field] = value;
1972
- else dest[field] += ", " + value;
1973
- else if (dest[field] === void 0) dest[field] = value;
1971
+ } else if (flag === 1) {
1972
+ if (dest["set-cookie"] !== void 0) dest["set-cookie"].push(value);
1973
+ else dest["set-cookie"] = [value];
1974
+ } else if (this.joinDuplicateHeaders) {
1975
+ if (dest[field] === void 0) dest[field] = value;
1976
+ else dest[field] += ", " + value;
1977
+ } else if (dest[field] === void 0) dest[field] = value;
1974
1978
  }
1975
1979
  _addHeaderLineDistinct(field, value, dest) {
1976
1980
  field = field.toLowerCase();
@@ -2051,7 +2055,6 @@ function matchKnownFields(field, lowercased = false) {
2051
2055
  case 19:
2052
2056
  if (field === "Proxy-Authorization" || field === "proxy-authorization") return "proxy-authorization";
2053
2057
  if (field === "If-Unmodified-Since" || field === "if-unmodified-since") return "if-unmodified-since";
2054
- break;
2055
2058
  }
2056
2059
  if (lowercased) return "\0" + field;
2057
2060
  return matchKnownFields(field.toLowerCase(), true);
@@ -2100,7 +2103,7 @@ function utcDate() {
2100
2103
  //#endregion
2101
2104
  //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fetch-to-node/2.1.0/75a085586b95f3a18a440f8655a7cb5c851846ab2c5e6ad2c4ae036e3bbaa05c/node_modules/fetch-to-node/dist/fetch-to-node/internal-streams-state.js
2102
2105
  function getDefaultHighWaterMark(objectMode) {
2103
- return objectMode ? 16 : 64 * 1024;
2106
+ return objectMode ? 16 : 65536;
2104
2107
  }
2105
2108
  //#endregion
2106
2109
  //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/fetch-to-node/2.1.0/75a085586b95f3a18a440f8655a7cb5c851846ab2c5e6ad2c4ae036e3bbaa05c/node_modules/fetch-to-node/dist/fetch-to-node/http-common.js
@@ -2388,15 +2391,16 @@ var FetchOutgoingMessage = class extends Writable {
2388
2391
  const entry = headers[key];
2389
2392
  processHeader(this, state, entry[0], entry[1], false);
2390
2393
  }
2391
- else if (Array.isArray(headers)) if (headers.length && Array.isArray(headers[0])) for (let i = 0; i < headers.length; i++) {
2392
- const entry = headers[i];
2393
- processHeader(this, state, entry[0], entry[1], true);
2394
- }
2395
- else {
2396
- if (headers.length % 2 !== 0) throw new ERR_INVALID_ARG_VALUE("headers", headers);
2397
- for (let n = 0; n < headers.length; n += 2) processHeader(this, state, headers[n], headers[n + 1], true);
2398
- }
2399
- else for (const key in headers) if (headers.hasOwnProperty(key)) {
2394
+ else if (Array.isArray(headers)) {
2395
+ if (headers.length && Array.isArray(headers[0])) for (let i = 0; i < headers.length; i++) {
2396
+ const entry = headers[i];
2397
+ processHeader(this, state, entry[0], entry[1], true);
2398
+ }
2399
+ else {
2400
+ if (headers.length % 2 !== 0) throw new ERR_INVALID_ARG_VALUE("headers", headers);
2401
+ for (let n = 0; n < headers.length; n += 2) processHeader(this, state, headers[n], headers[n + 1], true);
2402
+ }
2403
+ } else for (const key in headers) if (headers.hasOwnProperty(key)) {
2400
2404
  const _headers = headers;
2401
2405
  processHeader(this, state, key, _headers[key], true);
2402
2406
  }
@@ -2425,13 +2429,15 @@ var FetchOutgoingMessage = class extends Writable {
2425
2429
  header += "Connection: close\r\n";
2426
2430
  }
2427
2431
  }
2428
- if (!state.contLen && !state.te) if (!this._hasBody) this.chunkedEncoding = false;
2429
- else if (!this.useChunkedEncodingByDefault) this._last = true;
2430
- else if (!state.trailer && !this._removedContLen && typeof this._contentLength === "number") header += "Content-Length: " + this._contentLength + "\r\n";
2431
- else if (!this._removedTE) {
2432
- header += "Transfer-Encoding: chunked\r\n";
2433
- this.chunkedEncoding = true;
2434
- } else this._last = true;
2432
+ if (!state.contLen && !state.te) {
2433
+ if (!this._hasBody) this.chunkedEncoding = false;
2434
+ else if (!this.useChunkedEncodingByDefault) this._last = true;
2435
+ else if (!state.trailer && !this._removedContLen && typeof this._contentLength === "number") header += "Content-Length: " + this._contentLength + "\r\n";
2436
+ else if (!this._removedTE) {
2437
+ header += "Transfer-Encoding: chunked\r\n";
2438
+ this.chunkedEncoding = true;
2439
+ } else this._last = true;
2440
+ }
2435
2441
  if (this.chunkedEncoding !== true && state.trailer) throw new ERR_HTTP_TRAILER_INVALID();
2436
2442
  this._header = header + "\r\n";
2437
2443
  this._headerSent = false;
@@ -2575,9 +2581,7 @@ var FetchOutgoingMessage = class extends Writable {
2575
2581
  case "transfer-encoding":
2576
2582
  this._removedTE = true;
2577
2583
  break;
2578
- case "date":
2579
- this.sendDate = false;
2580
- break;
2584
+ case "date": this.sendDate = false;
2581
2585
  }
2582
2586
  if (this[kOutHeaders] !== null) delete this[kOutHeaders][key];
2583
2587
  }
@@ -2648,8 +2652,10 @@ var FetchOutgoingMessage = class extends Writable {
2648
2652
  if (this._writtenDataBuffer != null) this._writtenDataBuffer.cork();
2649
2653
  write_(this, chunk, encoding, null, true);
2650
2654
  } else if (this.finished) {
2651
- if (typeof callback === "function") if (!this.writableFinished) this.on("finish", callback);
2652
- else callback(new ERR_STREAM_ALREADY_FINISHED("end"));
2655
+ if (typeof callback === "function") {
2656
+ if (!this.writableFinished) this.on("finish", callback);
2657
+ else callback(new ERR_STREAM_ALREADY_FINISHED("end"));
2658
+ }
2653
2659
  return this;
2654
2660
  } else if (!this._header) {
2655
2661
  if (this._writtenDataBuffer != null) this._writtenDataBuffer.cork();
@@ -2714,8 +2720,10 @@ var FetchOutgoingMessage = class extends Writable {
2714
2720
  };
2715
2721
  function processHeader(self, state, key, value, validate) {
2716
2722
  if (validate) validateHeaderName(key);
2717
- if (isContentDispositionField(key) && self._contentLength) if (Array.isArray(value)) for (let i = 0; i < value.length; i++) value[i] = String(Buffer$1.from(String(value[i]), "latin1"));
2718
- else value = String(Buffer$1.from(String(value), "latin1"));
2723
+ if (isContentDispositionField(key) && self._contentLength) {
2724
+ if (Array.isArray(value)) for (let i = 0; i < value.length; i++) value[i] = String(Buffer$1.from(String(value[i]), "latin1"));
2725
+ else value = String(Buffer$1.from(String(value), "latin1"));
2726
+ }
2719
2727
  if (Array.isArray(value)) {
2720
2728
  if ((value.length < 2 || !isCookieField(key)) && (!self[kUniqueHeaders] || !self[kUniqueHeaders].has(key.toLowerCase()))) {
2721
2729
  for (let i = 0; i < value.length; i++) storeHeader(self, state, key, value[i], validate);
@@ -2765,9 +2773,7 @@ function matchHeader(self, state, field, value) {
2765
2773
  case "trailer":
2766
2774
  state[field] = true;
2767
2775
  break;
2768
- case "keep-alive":
2769
- self._defaultKeepAlive = false;
2770
- break;
2776
+ case "keep-alive": self._defaultKeepAlive = false;
2771
2777
  }
2772
2778
  }
2773
2779
  function onError(msg, err, callback) {
@@ -2810,10 +2816,12 @@ function write_(msg, chunk, encoding, callback, fromEnd) {
2810
2816
  }
2811
2817
  msg._implicitHeader();
2812
2818
  }
2813
- if (!msg._hasBody) if (msg[kRejectNonStandardBodyWrites]) throw new ERR_HTTP_BODY_NOT_ALLOWED();
2814
- else {
2815
- setTimeout(callback, 0);
2816
- return true;
2819
+ if (!msg._hasBody) {
2820
+ if (msg[kRejectNonStandardBodyWrites]) throw new ERR_HTTP_BODY_NOT_ALLOWED();
2821
+ else {
2822
+ setTimeout(callback, 0);
2823
+ return true;
2824
+ }
2817
2825
  }
2818
2826
  if (!fromEnd && msg._writtenDataBuffer != null && !msg._writtenDataBuffer.writableCorked) {
2819
2827
  msg._writtenDataBuffer.cork();
@@ -3011,8 +3019,10 @@ var FetchServerResponse = class FetchServerResponse extends FetchOutgoingMessage
3011
3019
  }
3012
3020
  data = data.slice(this.writtenHeaderBytes);
3013
3021
  }
3014
- if (typeof data === "string") if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") data = FetchServerResponse.encoder.encode(data);
3015
- else data = Buffer$1.from(data, encoding ?? void 0);
3022
+ if (typeof data === "string") {
3023
+ if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") data = FetchServerResponse.encoder.encode(data);
3024
+ else data = Buffer$1.from(data, encoding ?? void 0);
3025
+ }
3016
3026
  return data ?? Buffer$1.from([]);
3017
3027
  }
3018
3028
  _finish() {
@@ -3344,7 +3354,7 @@ var UpgradeTicketStore = class {
3344
3354
  }
3345
3355
  }
3346
3356
  };
3347
- const TICKET_BODY_MAX_BYTES = 4 * 1024;
3357
+ const TICKET_BODY_MAX_BYTES = 4096;
3348
3358
  /**
3349
3359
  * Resolve an `allowedOrigins` value against the request's `Origin` header.
3350
3360
  *
@@ -3585,7 +3595,7 @@ const BODY_METHODS = /* @__PURE__ */ new Set([
3585
3595
  "PATCH",
3586
3596
  "DELETE"
3587
3597
  ]);
3588
- var MastraServer$1 = class extends MastraServer {
3598
+ var MastraServer$2 = class extends MastraServer {
3589
3599
  createContextMiddleware() {
3590
3600
  return async (c, next) => {
3591
3601
  if (this.hasCustomRouteHandler && BODY_METHODS.has(c.req.method) && c.req.raw.body) c.set(MASTRA_PRISTINE_REQUEST_KEY, c.req.raw.clone());
@@ -4828,7 +4838,10 @@ function welcomeHtml(apiPrefix = "/api") {
4828
4838
  const getStudioPath = () => {
4829
4839
  if (process.env.MASTRA_STUDIO_PATH) return process.env.MASTRA_STUDIO_PATH;
4830
4840
  let __dirname = ".";
4831
- if (import.meta.url) __dirname = dirname(fileURLToPath(import.meta.url));
4841
+ if (import.meta.url) {
4842
+ const __filename = fileURLToPath(import.meta.url);
4843
+ __dirname = dirname(__filename);
4844
+ }
4832
4845
  return process.env.MASTRA_STUDIO_PATH || join(__dirname, "studio");
4833
4846
  };
4834
4847
  function isSchemaApiRoute(route) {
@@ -4914,10 +4927,10 @@ async function createHonoServer(mastra, options = { tools: {} }) {
4914
4927
  return errorHandler(err, c, options.isDev);
4915
4928
  });
4916
4929
  const bodyLimitOptions = {
4917
- maxSize: server?.bodySizeLimit ?? 4.5 * 1024 * 1024,
4930
+ maxSize: server?.bodySizeLimit ?? 4718592,
4918
4931
  onError: () => ({ error: "Request body too large" })
4919
4932
  };
4920
- const honoServerAdapter = new MastraServer$1({
4933
+ const honoServerAdapter = new MastraServer$2({
4921
4934
  app,
4922
4935
  mastra,
4923
4936
  tools: options.tools,
@@ -4962,14 +4975,15 @@ async function createHonoServer(mastra, options = { tools: {} }) {
4962
4975
  hasSession: false,
4963
4976
  screencastAvailable: false
4964
4977
  }));
4965
- if (server?.cors === false) app.use("*", timeout(server?.timeout ?? 180 * 1e3));
4978
+ if (server?.cors === false) app.use("*", timeout(server?.timeout ?? 18e4));
4966
4979
  else {
4967
4980
  const hasAuth = !!server?.auth;
4968
- app.use("*", timeout(server?.timeout ?? 180 * 1e3), async (c, next) => {
4981
+ app.use("*", timeout(server?.timeout ?? 18e4), async (c, next) => {
4969
4982
  const pathname = new URL(c.req.url).pathname;
4970
4983
  const method = c.req.method === "OPTIONS" ? c.req.header("Access-Control-Request-Method") ?? c.req.method : c.req.method;
4971
4984
  const routeCors = getRouteCorsConfig(processedRoutes, pathname, method);
4972
- return cors(routeCors ? getCorsConfig(routeCors, false) : getCorsConfig(server?.cors, hasAuth))(c, next);
4985
+ const corsOptions = routeCors ? getCorsConfig(routeCors, false) : getCorsConfig(server?.cors, hasAuth);
4986
+ return cors(corsOptions)(c, next);
4973
4987
  });
4974
4988
  }
4975
4989
  app.get("/health", describeRoute({
@@ -5052,7 +5066,8 @@ async function createHonoServer(mastra, options = { tools: {} }) {
5052
5066
  if (requestPath.includes(".") && !requestPath.endsWith(".html")) return await next();
5053
5067
  const isStudioRoute = studioBasePath === "" || requestPath === studioBasePath || requestPath.startsWith(`${studioBasePath}/`);
5054
5068
  if (options?.studio && isStudioRoute) {
5055
- let indexHtml = await readFile(join(getStudioPath(), "index.html"), "utf-8");
5069
+ const studioPath = getStudioPath();
5070
+ let indexHtml = await readFile(join(studioPath, "index.html"), "utf-8");
5056
5071
  const port = serverOptions?.port ?? (Number(process.env.PORT) || 4111);
5057
5072
  const hideCloudCta = process.env.MASTRA_HIDE_CLOUD_CTA === "true";
5058
5073
  const host = serverOptions?.host ?? process.env.MASTRA_HOST ?? "localhost";