@mastra/deployer 1.79.0-alpha.9 → 1.80.0-alpha.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 (109) hide show
  1. package/dist/{analyze-RHscSUJm.cjs → analyze-B4cKPVju.cjs} +77 -26
  2. package/dist/analyze-B4cKPVju.cjs.map +1 -0
  3. package/dist/{analyze-CFPQzJ-2.js → analyze-DzJoNBCX.js} +75 -24
  4. package/dist/analyze-DzJoNBCX.js.map +1 -0
  5. package/dist/{arktype-aI7TBD0R-cgd8o1cq.js → arktype-aI7TBD0R-CrIkuKY8.js} +2 -2
  6. package/dist/arktype-aI7TBD0R-CrIkuKY8.js.map +1 -0
  7. package/dist/{arktype-aI7TBD0R-BP9yJr5x.cjs → arktype-aI7TBD0R-LEyxmA2b.cjs} +2 -2
  8. package/dist/arktype-aI7TBD0R-LEyxmA2b.cjs.map +1 -0
  9. package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
  10. package/dist/build/analyze.cjs +1 -1
  11. package/dist/build/analyze.js +1 -2
  12. package/dist/build/bundler.cjs +1 -1
  13. package/dist/build/bundler.js +1 -2
  14. package/dist/build/index.cjs +6 -6
  15. package/dist/build/index.js +5 -5
  16. package/dist/build/plugins/tsconfig-paths.d.ts +4 -3
  17. package/dist/build/plugins/tsconfig-paths.d.ts.map +1 -1
  18. package/dist/{build-dI0V50la.cjs → build-D0odKdrs.cjs} +45 -45
  19. package/dist/build-D0odKdrs.cjs.map +1 -0
  20. package/dist/{build-BPErn9z9.js → build-DZuiBxfv.js} +5 -5
  21. package/dist/{build-BPErn9z9.js.map → build-DZuiBxfv.js.map} +1 -1
  22. package/dist/bundler/index.cjs +23 -16
  23. package/dist/bundler/index.cjs.map +1 -1
  24. package/dist/bundler/index.js +21 -14
  25. package/dist/bundler/index.js.map +1 -1
  26. package/dist/bundler/workspaceDependencies.d.ts.map +1 -1
  27. package/dist/{bundler-B2N9qjjr.js → bundler-BUqyRuGu.js} +63 -67
  28. package/dist/{bundler-B2N9qjjr.js.map → bundler-BUqyRuGu.js.map} +1 -1
  29. package/dist/{bundler-DdqMsDyv.cjs → bundler-Dpd5nkcu.cjs} +64 -69
  30. package/dist/bundler-Dpd5nkcu.cjs.map +1 -0
  31. package/dist/{bundlerOptions-DoMtLtV1.cjs → bundlerOptions-DHcbcD1a.cjs} +4 -4
  32. package/dist/bundlerOptions-DHcbcD1a.cjs.map +1 -0
  33. package/dist/{bundlerOptions-BHgxhzOz.js → bundlerOptions-DMxva0Sp.js} +2 -2
  34. package/dist/{bundlerOptions-BHgxhzOz.js.map → bundlerOptions-DMxva0Sp.js.map} +1 -1
  35. package/dist/{core-DPXkjlFR.js → core-75DLMtZL.js} +17 -13
  36. package/dist/{core-DPXkjlFR.js.map → core-75DLMtZL.js.map} +1 -1
  37. package/dist/{core-DLXu5DhR.cjs → core-XnTfh3E_.cjs} +17 -13
  38. package/dist/{core-DLXu5DhR.cjs.map → core-XnTfh3E_.cjs.map} +1 -1
  39. package/dist/{dist-DYm9bBZO.js → dist-CQdaZ_Cj.js} +202 -48
  40. package/dist/dist-CQdaZ_Cj.js.map +1 -0
  41. package/dist/{dist-twPJIvYf.cjs → dist-IbfljCaD.cjs} +202 -48
  42. package/dist/dist-IbfljCaD.cjs.map +1 -0
  43. package/dist/docs/SKILL.md +1 -1
  44. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  45. package/dist/{effect-QlVUlMFu-BcDDX4B1.js → effect-QlVUlMFu-CgfR_0ad.js} +3 -3
  46. package/dist/{effect-QlVUlMFu-BcDDX4B1.js.map → effect-QlVUlMFu-CgfR_0ad.js.map} +1 -1
  47. package/dist/{effect-QlVUlMFu-DSdymSCI.cjs → effect-QlVUlMFu-D_Bo06-a.cjs} +3 -3
  48. package/dist/{effect-QlVUlMFu-DSdymSCI.cjs.map → effect-QlVUlMFu-D_Bo06-a.cjs.map} +1 -1
  49. package/dist/{esm-Bvuc3c9Z.js → esm-ClsnEB2d.js} +67 -69
  50. package/dist/{esm-Bvuc3c9Z.js.map → esm-ClsnEB2d.js.map} +1 -1
  51. package/dist/{esm-SvpXPPt6.cjs → esm-D74qc_jV.cjs} +67 -69
  52. package/dist/{esm-SvpXPPt6.cjs.map → esm-D74qc_jV.cjs.map} +1 -1
  53. package/dist/{index-CLddUTqr-CAnnFeRJ.js → index-CLddUTqr-73bY0Z8P.js} +8 -8
  54. package/dist/{index-CLddUTqr-CAnnFeRJ.js.map → index-CLddUTqr-73bY0Z8P.js.map} +1 -1
  55. package/dist/{index-CLddUTqr-BpIkA9jT.cjs → index-CLddUTqr-CgjYL5XV.cjs} +8 -8
  56. package/dist/{index-CLddUTqr-BpIkA9jT.cjs.map → index-CLddUTqr-CgjYL5XV.cjs.map} +1 -1
  57. package/dist/index.cjs +3 -3
  58. package/dist/index.js +3 -3
  59. package/dist/{rolldown-runtime-emK7D4bc.cjs → rolldown-runtime-Gi87jfEt.cjs} +2 -2
  60. package/dist/server/index.cjs +101 -102
  61. package/dist/server/index.cjs.map +1 -1
  62. package/dist/server/index.js +79 -80
  63. package/dist/server/index.js.map +1 -1
  64. package/dist/services/deps.d.ts.map +1 -1
  65. package/dist/services/index.cjs +1 -1
  66. package/dist/services/index.js +1 -2
  67. package/dist/{services-tWHmAszq.cjs → services-CzhmXlRZ.cjs} +57 -28
  68. package/dist/services-CzhmXlRZ.cjs.map +1 -0
  69. package/dist/{services-Ce_5qHk2.js → services-Imf20x6f.js} +54 -26
  70. package/dist/services-Imf20x6f.js.map +1 -0
  71. package/dist/{sury-CWZTCd75-eYGXWpqb.cjs → sury-CWZTCd75-BmWsp9y9.cjs} +3 -3
  72. package/dist/{sury-CWZTCd75-eYGXWpqb.cjs.map → sury-CWZTCd75-BmWsp9y9.cjs.map} +1 -1
  73. package/dist/{sury-CWZTCd75-CdrsvbNi.js → sury-CWZTCd75-DiZVb8bZ.js} +3 -3
  74. package/dist/{sury-CWZTCd75-CdrsvbNi.js.map → sury-CWZTCd75-DiZVb8bZ.js.map} +1 -1
  75. package/dist/{typebox-Dei93FPO-BCfJ-0cP.js → typebox-Dei93FPO-CwpAqpd5.js} +2 -2
  76. package/dist/typebox-Dei93FPO-CwpAqpd5.js.map +1 -0
  77. package/dist/{typebox-Dei93FPO-B14DOQQD.cjs → typebox-Dei93FPO-Dv_TSG2I.cjs} +2 -2
  78. package/dist/typebox-Dei93FPO-Dv_TSG2I.cjs.map +1 -0
  79. package/dist/{utils-Bsr_sEcH.cjs → utils-C-gJcJAo.cjs} +4 -4
  80. package/dist/utils-C-gJcJAo.cjs.map +1 -0
  81. package/dist/{valibot--1zFm7rT-CCFD-Qor.js → valibot--1zFm7rT-BfSX2bry.js} +4 -4
  82. package/dist/{valibot--1zFm7rT-CCFD-Qor.js.map → valibot--1zFm7rT-BfSX2bry.js.map} +1 -1
  83. package/dist/{valibot--1zFm7rT-aC9oayBT.cjs → valibot--1zFm7rT-YckVXzoz.cjs} +4 -4
  84. package/dist/{valibot--1zFm7rT-aC9oayBT.cjs.map → valibot--1zFm7rT-YckVXzoz.cjs.map} +1 -1
  85. package/dist/validator/custom-resolver.cjs +1 -1
  86. package/dist/validator/custom-resolver.cjs.map +1 -1
  87. package/dist/validator/loader.cjs.map +1 -1
  88. package/dist/validator/loader.js.map +1 -1
  89. package/dist/{zod-Bwrt9trS-D1WWVzpr.js → zod-Bwrt9trS-CO1V3tYt.js} +5 -5
  90. package/dist/{zod-Bwrt9trS-D1WWVzpr.js.map → zod-Bwrt9trS-CO1V3tYt.js.map} +1 -1
  91. package/dist/{zod-Bwrt9trS-OBujxXwV.cjs → zod-Bwrt9trS-CdR6J7TM.cjs} +5 -5
  92. package/dist/{zod-Bwrt9trS-OBujxXwV.cjs.map → zod-Bwrt9trS-CdR6J7TM.cjs.map} +1 -1
  93. package/package.json +15 -15
  94. package/dist/analyze-CFPQzJ-2.js.map +0 -1
  95. package/dist/analyze-RHscSUJm.cjs.map +0 -1
  96. package/dist/arktype-aI7TBD0R-BP9yJr5x.cjs.map +0 -1
  97. package/dist/arktype-aI7TBD0R-cgd8o1cq.js.map +0 -1
  98. package/dist/build-dI0V50la.cjs.map +0 -1
  99. package/dist/bundler/find-workspaces.d.ts +0 -52
  100. package/dist/bundler/find-workspaces.d.ts.map +0 -1
  101. package/dist/bundler-DdqMsDyv.cjs.map +0 -1
  102. package/dist/bundlerOptions-DoMtLtV1.cjs.map +0 -1
  103. package/dist/dist-DYm9bBZO.js.map +0 -1
  104. package/dist/dist-twPJIvYf.cjs.map +0 -1
  105. package/dist/services-Ce_5qHk2.js.map +0 -1
  106. package/dist/services-tWHmAszq.cjs.map +0 -1
  107. package/dist/typebox-Dei93FPO-B14DOQQD.cjs.map +0 -1
  108. package/dist/typebox-Dei93FPO-BCfJ-0cP.js.map +0 -1
  109. package/dist/utils-Bsr_sEcH.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("../rolldown-runtime-emK7D4bc.cjs");
3
- const require_utils = require("../utils-Bsr_sEcH.cjs");
4
- require("../index-CLddUTqr-BpIkA9jT.cjs");
2
+ const require_rolldown_runtime = require("../rolldown-runtime-Gi87jfEt.cjs");
3
+ const require_utils = require("../utils-C-gJcJAo.cjs");
4
+ require("../index-CLddUTqr-CgjYL5XV.cjs");
5
5
  let fs = require("fs");
6
6
  let fs_promises = require("fs/promises");
7
7
  let path = require("path");
@@ -797,10 +797,10 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
797
797
  }
798
798
  }
799
799
  }
800
- function writeFromReadableStream(stream$3, writable) {
801
- if (stream$3.locked) throw new TypeError("ReadableStream is locked.");
800
+ function writeFromReadableStream(stream, writable) {
801
+ if (stream.locked) throw new TypeError("ReadableStream is locked.");
802
802
  else if (writable.destroyed) return;
803
- return writeFromReadableStreamDefaultReader(stream$3.getReader(), writable);
803
+ return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
804
804
  }
805
805
  const buildOutgoingHttpHeaders = (headers, defaultContentType) => {
806
806
  const res = {};
@@ -817,7 +817,7 @@ const buildOutgoingHttpHeaders = (headers, defaultContentType) => {
817
817
  const outgoingEnded = Symbol("outgoingEnded");
818
818
  const incomingDraining = Symbol("incomingDraining");
819
819
  const DRAIN_TIMEOUT_MS = 500;
820
- const MAX_DRAIN_BYTES = 64 * 1024 * 1024;
820
+ const MAX_DRAIN_BYTES = 67108864;
821
821
  const drainIncoming = (incoming) => {
822
822
  const incomingWithDrainState = incoming;
823
823
  if (incoming.destroyed || incomingWithDrainState[incomingDraining]) return;
@@ -1405,10 +1405,10 @@ const ENCODINGS = {
1405
1405
  gzip: ".gz"
1406
1406
  };
1407
1407
  const ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS);
1408
- const getStats = (path$3) => {
1408
+ const getStats = (path) => {
1409
1409
  let stats;
1410
1410
  try {
1411
- stats = (0, fs.statSync)(path$3);
1411
+ stats = (0, fs.statSync)(path);
1412
1412
  } catch {}
1413
1413
  return stats;
1414
1414
  };
@@ -1477,29 +1477,29 @@ const serveStatic = (options = { root: "" }) => {
1477
1477
  await options.onNotFound?.(c.req.path, c);
1478
1478
  return next();
1479
1479
  }
1480
- let path$4 = (0, path.join)(root, !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename, c) : filename);
1481
- let stats = getStats(path$4);
1480
+ let path$1 = (0, path.join)(root, !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename, c) : filename);
1481
+ let stats = getStats(path$1);
1482
1482
  if (stats && stats.isDirectory()) {
1483
1483
  const indexFile = options.index ?? "index.html";
1484
- path$4 = (0, path.join)(path$4, indexFile);
1485
- stats = getStats(path$4);
1484
+ path$1 = (0, path.join)(path$1, indexFile);
1485
+ stats = getStats(path$1);
1486
1486
  }
1487
1487
  if (!stats) {
1488
- await options.onNotFound?.(path$4, c);
1488
+ await options.onNotFound?.(path$1, c);
1489
1489
  return next();
1490
1490
  }
1491
- const mimeType = (0, hono_utils_mime.getMimeType)(path$4);
1491
+ const mimeType = (0, hono_utils_mime.getMimeType)(path$1);
1492
1492
  c.header("Content-Type", mimeType || "application/octet-stream");
1493
1493
  if (options.precompressed && (!mimeType || mimeType === "application/octet-stream" || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
1494
1494
  const acceptEncodingSet = new Set(c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()));
1495
1495
  for (const encoding of ENCODINGS_ORDERED_KEYS) {
1496
1496
  if (!acceptEncodingSet.has(encoding)) continue;
1497
- const precompressedStats = getStats(path$4 + ENCODINGS[encoding]);
1497
+ const precompressedStats = getStats(path$1 + ENCODINGS[encoding]);
1498
1498
  if (precompressedStats) {
1499
1499
  c.header("Content-Encoding", encoding);
1500
1500
  c.header("Vary", "Accept-Encoding", { append: true });
1501
1501
  stats = precompressedStats;
1502
- path$4 = path$4 + ENCODINGS[encoding];
1502
+ path$1 = path$1 + ENCODINGS[encoding];
1503
1503
  break;
1504
1504
  }
1505
1505
  }
@@ -1514,7 +1514,7 @@ const serveStatic = (options = { root: "" }) => {
1514
1514
  result = c.body(null);
1515
1515
  } else if (!range) {
1516
1516
  c.header("Content-Length", size.toString());
1517
- result = c.body(createStreamBody((0, fs.createReadStream)(path$4)), 200);
1517
+ result = c.body(createStreamBody((0, fs.createReadStream)(path$1)), 200);
1518
1518
  } else {
1519
1519
  c.header("Accept-Ranges", "bytes");
1520
1520
  const resolvedRange = resolveByteRange(parseByteRange(range) ?? {
@@ -1527,7 +1527,7 @@ const serveStatic = (options = { root: "" }) => {
1527
1527
  } else {
1528
1528
  const { start, end } = resolvedRange;
1529
1529
  const chunkSize = end - start + 1;
1530
- const stream = (0, fs.createReadStream)(path$4, {
1530
+ const stream = (0, fs.createReadStream)(path$1, {
1531
1531
  start,
1532
1532
  end
1533
1533
  });
@@ -1536,7 +1536,7 @@ const serveStatic = (options = { root: "" }) => {
1536
1536
  result = c.body(createStreamBody(stream), 206);
1537
1537
  }
1538
1538
  }
1539
- await options.onFound?.(path$4, c);
1539
+ await options.onFound?.(path$1, c);
1540
1540
  return result;
1541
1541
  };
1542
1542
  };
@@ -1764,13 +1764,15 @@ var ERR_INVALID_ARG_TYPE = class extends TypeError {
1764
1764
  }
1765
1765
  if (other.length > 0) msg += " or ";
1766
1766
  }
1767
- if (other.length > 0) if (other.length > 2) {
1768
- const last = other.pop();
1769
- msg += `one of ${other.join(", ")}, or ${last}`;
1770
- } else if (other.length === 2) msg += `one of ${other[0]} or ${other[1]}`;
1771
- else {
1772
- if (other[0].toLowerCase() !== other[0]) msg += "an ";
1773
- msg += `${other[0]}`;
1767
+ if (other.length > 0) {
1768
+ if (other.length > 2) {
1769
+ const last = other.pop();
1770
+ msg += `one of ${other.join(", ")}, or ${last}`;
1771
+ } else if (other.length === 2) msg += `one of ${other[0]} or ${other[1]}`;
1772
+ else {
1773
+ if (other[0].toLowerCase() !== other[0]) msg += "an ";
1774
+ msg += `${other[0]}`;
1775
+ }
1774
1776
  }
1775
1777
  msg += `. Received ${determineSpecificType(actual)}`;
1776
1778
  super(msg);
@@ -1971,11 +1973,13 @@ var FetchIncomingMessage = class extends stream.Readable {
1971
1973
  field = field.slice(1);
1972
1974
  if (typeof dest[field] === "string") dest[field] += (flag === 0 ? ", " : "; ") + value;
1973
1975
  else dest[field] = value;
1974
- } else if (flag === 1) if (dest["set-cookie"] !== void 0) dest["set-cookie"].push(value);
1975
- else dest["set-cookie"] = [value];
1976
- else if (this.joinDuplicateHeaders) if (dest[field] === void 0) dest[field] = value;
1977
- else dest[field] += ", " + value;
1978
- else if (dest[field] === void 0) dest[field] = value;
1976
+ } else if (flag === 1) {
1977
+ if (dest["set-cookie"] !== void 0) dest["set-cookie"].push(value);
1978
+ else dest["set-cookie"] = [value];
1979
+ } else if (this.joinDuplicateHeaders) {
1980
+ if (dest[field] === void 0) dest[field] = value;
1981
+ else dest[field] += ", " + value;
1982
+ } else if (dest[field] === void 0) dest[field] = value;
1979
1983
  }
1980
1984
  _addHeaderLineDistinct(field, value, dest) {
1981
1985
  field = field.toLowerCase();
@@ -2056,7 +2060,6 @@ function matchKnownFields(field, lowercased = false) {
2056
2060
  case 19:
2057
2061
  if (field === "Proxy-Authorization" || field === "proxy-authorization") return "proxy-authorization";
2058
2062
  if (field === "If-Unmodified-Since" || field === "if-unmodified-since") return "if-unmodified-since";
2059
- break;
2060
2063
  }
2061
2064
  if (lowercased) return "\0" + field;
2062
2065
  return matchKnownFields(field.toLowerCase(), true);
@@ -2105,7 +2108,7 @@ function utcDate() {
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/internal-streams-state.js
2107
2110
  function getDefaultHighWaterMark(objectMode) {
2108
- return objectMode ? 16 : 64 * 1024;
2111
+ return objectMode ? 16 : 65536;
2109
2112
  }
2110
2113
  //#endregion
2111
2114
  //#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
@@ -2393,15 +2396,16 @@ var FetchOutgoingMessage = class extends stream.Writable {
2393
2396
  const entry = headers[key];
2394
2397
  processHeader(this, state, entry[0], entry[1], false);
2395
2398
  }
2396
- else if (Array.isArray(headers)) if (headers.length && Array.isArray(headers[0])) for (let i = 0; i < headers.length; i++) {
2397
- const entry = headers[i];
2398
- processHeader(this, state, entry[0], entry[1], true);
2399
- }
2400
- else {
2401
- if (headers.length % 2 !== 0) throw new ERR_INVALID_ARG_VALUE("headers", headers);
2402
- for (let n = 0; n < headers.length; n += 2) processHeader(this, state, headers[n], headers[n + 1], true);
2403
- }
2404
- else for (const key in headers) if (headers.hasOwnProperty(key)) {
2399
+ else if (Array.isArray(headers)) {
2400
+ if (headers.length && Array.isArray(headers[0])) for (let i = 0; i < headers.length; i++) {
2401
+ const entry = headers[i];
2402
+ processHeader(this, state, entry[0], entry[1], true);
2403
+ }
2404
+ else {
2405
+ if (headers.length % 2 !== 0) throw new ERR_INVALID_ARG_VALUE("headers", headers);
2406
+ for (let n = 0; n < headers.length; n += 2) processHeader(this, state, headers[n], headers[n + 1], true);
2407
+ }
2408
+ } else for (const key in headers) if (headers.hasOwnProperty(key)) {
2405
2409
  const _headers = headers;
2406
2410
  processHeader(this, state, key, _headers[key], true);
2407
2411
  }
@@ -2430,13 +2434,15 @@ var FetchOutgoingMessage = class extends stream.Writable {
2430
2434
  header += "Connection: close\r\n";
2431
2435
  }
2432
2436
  }
2433
- if (!state.contLen && !state.te) 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;
2437
+ if (!state.contLen && !state.te) {
2438
+ if (!this._hasBody) this.chunkedEncoding = false;
2439
+ else if (!this.useChunkedEncodingByDefault) this._last = true;
2440
+ else if (!state.trailer && !this._removedContLen && typeof this._contentLength === "number") header += "Content-Length: " + this._contentLength + "\r\n";
2441
+ else if (!this._removedTE) {
2442
+ header += "Transfer-Encoding: chunked\r\n";
2443
+ this.chunkedEncoding = true;
2444
+ } else this._last = true;
2445
+ }
2440
2446
  if (this.chunkedEncoding !== true && state.trailer) throw new ERR_HTTP_TRAILER_INVALID();
2441
2447
  this._header = header + "\r\n";
2442
2448
  this._headerSent = false;
@@ -2580,9 +2586,7 @@ var FetchOutgoingMessage = class extends stream.Writable {
2580
2586
  case "transfer-encoding":
2581
2587
  this._removedTE = true;
2582
2588
  break;
2583
- case "date":
2584
- this.sendDate = false;
2585
- break;
2589
+ case "date": this.sendDate = false;
2586
2590
  }
2587
2591
  if (this[kOutHeaders] !== null) delete this[kOutHeaders][key];
2588
2592
  }
@@ -2653,8 +2657,10 @@ var FetchOutgoingMessage = class extends stream.Writable {
2653
2657
  if (this._writtenDataBuffer != null) this._writtenDataBuffer.cork();
2654
2658
  write_(this, chunk, encoding, null, true);
2655
2659
  } else if (this.finished) {
2656
- if (typeof callback === "function") if (!this.writableFinished) this.on("finish", callback);
2657
- else callback(new ERR_STREAM_ALREADY_FINISHED("end"));
2660
+ if (typeof callback === "function") {
2661
+ if (!this.writableFinished) this.on("finish", callback);
2662
+ else callback(new ERR_STREAM_ALREADY_FINISHED("end"));
2663
+ }
2658
2664
  return this;
2659
2665
  } else if (!this._header) {
2660
2666
  if (this._writtenDataBuffer != null) this._writtenDataBuffer.cork();
@@ -2719,8 +2725,10 @@ var FetchOutgoingMessage = class extends stream.Writable {
2719
2725
  };
2720
2726
  function processHeader(self, state, key, value, validate) {
2721
2727
  if (validate) validateHeaderName(key);
2722
- if (isContentDispositionField(key) && self._contentLength) if (Array.isArray(value)) for (let i = 0; i < value.length; i++) value[i] = String(buffer.Buffer.from(String(value[i]), "latin1"));
2723
- else value = String(buffer.Buffer.from(String(value), "latin1"));
2728
+ if (isContentDispositionField(key) && self._contentLength) {
2729
+ if (Array.isArray(value)) for (let i = 0; i < value.length; i++) value[i] = String(buffer.Buffer.from(String(value[i]), "latin1"));
2730
+ else value = String(buffer.Buffer.from(String(value), "latin1"));
2731
+ }
2724
2732
  if (Array.isArray(value)) {
2725
2733
  if ((value.length < 2 || !isCookieField(key)) && (!self[kUniqueHeaders] || !self[kUniqueHeaders].has(key.toLowerCase()))) {
2726
2734
  for (let i = 0; i < value.length; i++) storeHeader(self, state, key, value[i], validate);
@@ -2770,9 +2778,7 @@ function matchHeader(self, state, field, value) {
2770
2778
  case "trailer":
2771
2779
  state[field] = true;
2772
2780
  break;
2773
- case "keep-alive":
2774
- self._defaultKeepAlive = false;
2775
- break;
2781
+ case "keep-alive": self._defaultKeepAlive = false;
2776
2782
  }
2777
2783
  }
2778
2784
  function onError(msg, err, callback) {
@@ -2815,10 +2821,12 @@ function write_(msg, chunk, encoding, callback, fromEnd) {
2815
2821
  }
2816
2822
  msg._implicitHeader();
2817
2823
  }
2818
- if (!msg._hasBody) if (msg[kRejectNonStandardBodyWrites]) throw new ERR_HTTP_BODY_NOT_ALLOWED();
2819
- else {
2820
- setTimeout(callback, 0);
2821
- return true;
2824
+ if (!msg._hasBody) {
2825
+ if (msg[kRejectNonStandardBodyWrites]) throw new ERR_HTTP_BODY_NOT_ALLOWED();
2826
+ else {
2827
+ setTimeout(callback, 0);
2828
+ return true;
2829
+ }
2822
2830
  }
2823
2831
  if (!fromEnd && msg._writtenDataBuffer != null && !msg._writtenDataBuffer.writableCorked) {
2824
2832
  msg._writtenDataBuffer.cork();
@@ -3016,8 +3024,10 @@ var FetchServerResponse = class FetchServerResponse extends FetchOutgoingMessage
3016
3024
  }
3017
3025
  data = data.slice(this.writtenHeaderBytes);
3018
3026
  }
3019
- if (typeof data === "string") if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") data = FetchServerResponse.encoder.encode(data);
3020
- else data = buffer.Buffer.from(data, encoding ?? void 0);
3027
+ if (typeof data === "string") {
3028
+ if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") data = FetchServerResponse.encoder.encode(data);
3029
+ else data = buffer.Buffer.from(data, encoding ?? void 0);
3030
+ }
3021
3031
  return data ?? buffer.Buffer.from([]);
3022
3032
  }
3023
3033
  _finish() {
@@ -3349,7 +3359,7 @@ var UpgradeTicketStore = class {
3349
3359
  }
3350
3360
  }
3351
3361
  };
3352
- const TICKET_BODY_MAX_BYTES = 4 * 1024;
3362
+ const TICKET_BODY_MAX_BYTES = 4096;
3353
3363
  /**
3354
3364
  * Resolve an `allowedOrigins` value against the request's `Origin` header.
3355
3365
  *
@@ -3799,6 +3809,7 @@ var MastraServer = class extends _mastra_server_server_adapter.MastraServer {
3799
3809
  }
3800
3810
  } catch {}
3801
3811
  });
3812
+ (0, _mastra_server_server_adapter.propagateRequestAbort)(response.req.raw.signal, res);
3802
3813
  return propagateClientDisconnect(await toFetchResponse(res), res);
3803
3814
  } else if (route.responseType === "mcp-sse") {
3804
3815
  const { server, ssePath, messagePath } = result;
@@ -3971,25 +3982,8 @@ var MastraServer = class extends _mastra_server_server_adapter.MastraServer {
3971
3982
  }
3972
3983
  const customResponse = (0, _mastra_server_server_adapter.getCustomHTTPExceptionResponse)(error);
3973
3984
  if (customResponse) return customResponse;
3974
- if (error && typeof error === "object") {
3975
- if ("status" in error) {
3976
- const status = error.status;
3977
- let safeCause;
3978
- try {
3979
- const raw = error instanceof Error ? error.cause : void 0;
3980
- if (raw && typeof raw === "object" && !Array.isArray(raw) && "failingItems" in raw && Array.isArray(raw.failingItems)) safeCause = { failingItems: raw.failingItems };
3981
- } catch {}
3982
- return c.json({
3983
- error: error instanceof Error ? error.message : "Unknown error",
3984
- ...safeCause ? { cause: safeCause } : {}
3985
- }, status);
3986
- }
3987
- if ("details" in error && error.details && typeof error.details === "object" && "status" in error.details) {
3988
- const status = error.details.status;
3989
- return c.json({ error: error instanceof Error ? error.message : "Unknown error" }, status);
3990
- }
3991
- }
3992
- return c.json({ error: error instanceof Error ? error.message : "Unknown error" }, 500);
3985
+ const { status, body } = (0, _mastra_server_server_adapter.getHTTPErrorResponse)(error);
3986
+ return c.json(body, status);
3993
3987
  }
3994
3988
  });
3995
3989
  }
@@ -4049,9 +4043,9 @@ var MastraServer = class extends _mastra_server_server_adapter.MastraServer {
4049
4043
  }
4050
4044
  }
4051
4045
  const fgaError = await (0, _mastra_server_server_adapter.checkRouteFGA)(this.mastra, serverRoute, c.get("requestContext"), {
4052
- ...c.req.param(),
4053
4046
  ...Object.fromEntries(new URL(c.req.url).searchParams.entries()),
4054
- ...bodyParams
4047
+ ...bodyParams,
4048
+ ...c.req.param()
4055
4049
  });
4056
4050
  if (fgaError) return c.json({
4057
4051
  error: fgaError.error,
@@ -4132,7 +4126,7 @@ var MastraServer = class extends _mastra_server_server_adapter.MastraServer {
4132
4126
  }
4133
4127
  };
4134
4128
  //#endregion
4135
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono-openapi/1.3.1/158235e7235efea6160a30c3ca102ac021a6d2f9183c16a3ddab0c84f82188b4/node_modules/hono-openapi/dist/index.js
4129
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono-openapi/1.3.1/cf5d765ff55e9cdf127dcce292c045e374cf89159a3e1dea76ff89157f82e8d8/node_modules/hono-openapi/dist/index.js
4136
4130
  const uniqueSymbol = Symbol("openapi");
4137
4131
  function describeRoute(spec) {
4138
4132
  const middleware = async (_c, next) => {
@@ -4832,9 +4826,12 @@ function welcomeHtml(apiPrefix = "/api") {
4832
4826
  //#region src/server/index.ts
4833
4827
  const getStudioPath = () => {
4834
4828
  if (process.env.MASTRA_STUDIO_PATH) return process.env.MASTRA_STUDIO_PATH;
4835
- let __dirname = ".";
4836
- if (require("url").pathToFileURL(__filename).href) __dirname = (0, path.dirname)((0, url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
4837
- return process.env.MASTRA_STUDIO_PATH || (0, path.join)(__dirname, "studio");
4829
+ let __dirname$1 = ".";
4830
+ if (require("url").pathToFileURL(__filename).href) {
4831
+ const __filename$1 = (0, url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
4832
+ __dirname$1 = (0, path.dirname)(__filename$1);
4833
+ }
4834
+ return process.env.MASTRA_STUDIO_PATH || (0, path.join)(__dirname$1, "studio");
4838
4835
  };
4839
4836
  function isSchemaApiRoute(route) {
4840
4837
  return "_mastraSchemaRoute" in route && route._mastraSchemaRoute === true;
@@ -4919,7 +4916,7 @@ async function createHonoServer(mastra, options = { tools: {} }) {
4919
4916
  return errorHandler(err, c, options.isDev);
4920
4917
  });
4921
4918
  const bodyLimitOptions = {
4922
- maxSize: server?.bodySizeLimit ?? 4.5 * 1024 * 1024,
4919
+ maxSize: server?.bodySizeLimit ?? 4718592,
4923
4920
  onError: () => ({ error: "Request body too large" })
4924
4921
  };
4925
4922
  const honoServerAdapter = new MastraServer({
@@ -4967,14 +4964,15 @@ async function createHonoServer(mastra, options = { tools: {} }) {
4967
4964
  hasSession: false,
4968
4965
  screencastAvailable: false
4969
4966
  }));
4970
- if (server?.cors === false) app.use("*", (0, hono_timeout.timeout)(server?.timeout ?? 180 * 1e3));
4967
+ if (server?.cors === false) app.use("*", (0, hono_timeout.timeout)(server?.timeout ?? 18e4));
4971
4968
  else {
4972
4969
  const hasAuth = !!server?.auth;
4973
- app.use("*", (0, hono_timeout.timeout)(server?.timeout ?? 180 * 1e3), async (c, next) => {
4970
+ app.use("*", (0, hono_timeout.timeout)(server?.timeout ?? 18e4), async (c, next) => {
4974
4971
  const pathname = new URL(c.req.url).pathname;
4975
4972
  const method = c.req.method === "OPTIONS" ? c.req.header("Access-Control-Request-Method") ?? c.req.method : c.req.method;
4976
4973
  const routeCors = getRouteCorsConfig(processedRoutes, pathname, method);
4977
- return (0, hono_cors.cors)(routeCors ? getCorsConfig(routeCors, false) : getCorsConfig(server?.cors, hasAuth))(c, next);
4974
+ const corsOptions = routeCors ? getCorsConfig(routeCors, false) : getCorsConfig(server?.cors, hasAuth);
4975
+ return (0, hono_cors.cors)(corsOptions)(c, next);
4978
4976
  });
4979
4977
  }
4980
4978
  app.get("/health", describeRoute({
@@ -5043,8 +5041,8 @@ async function createHonoServer(mastra, options = { tools: {} }) {
5043
5041
  const studioPath = getStudioPath();
5044
5042
  app.use(`${studioBasePath}/assets/*`, serveStatic({
5045
5043
  root: (0, path.join)(studioPath, "assets"),
5046
- rewriteRequestPath: (path$1) => {
5047
- let rewritten = path$1;
5044
+ rewriteRequestPath: (path) => {
5045
+ let rewritten = path;
5048
5046
  if (studioBasePath && rewritten.startsWith(studioBasePath)) rewritten = rewritten.slice(studioBasePath.length);
5049
5047
  if (rewritten.startsWith("/assets")) rewritten = rewritten.slice(7);
5050
5048
  return rewritten;
@@ -5057,7 +5055,8 @@ async function createHonoServer(mastra, options = { tools: {} }) {
5057
5055
  if (requestPath.includes(".") && !requestPath.endsWith(".html")) return await next();
5058
5056
  const isStudioRoute = studioBasePath === "" || requestPath === studioBasePath || requestPath.startsWith(`${studioBasePath}/`);
5059
5057
  if (options?.studio && isStudioRoute) {
5060
- let indexHtml = await (0, fs_promises.readFile)((0, path.join)(getStudioPath(), "index.html"), "utf-8");
5058
+ const studioPath = getStudioPath();
5059
+ let indexHtml = await (0, fs_promises.readFile)((0, path.join)(studioPath, "index.html"), "utf-8");
5061
5060
  const port = serverOptions?.port ?? (Number(process.env.PORT) || 4111);
5062
5061
  const hideCloudCta = process.env.MASTRA_HIDE_CLOUD_CTA === "true";
5063
5062
  const host = serverOptions?.host ?? process.env.MASTRA_HOST ?? "localhost";
@@ -5108,9 +5107,9 @@ async function createHonoServer(mastra, options = { tools: {} }) {
5108
5107
  const studioPath = studioBasePath ? `${studioBasePath}/*` : "*";
5109
5108
  app.use(studioPath, serveStatic({
5110
5109
  root: studioRootPath,
5111
- rewriteRequestPath: (path$2) => {
5112
- if (studioBasePath && path$2.startsWith(studioBasePath)) return path$2.slice(studioBasePath.length);
5113
- return path$2;
5110
+ rewriteRequestPath: (path) => {
5111
+ if (studioBasePath && path.startsWith(studioBasePath)) return path.slice(studioBasePath.length);
5112
+ return path;
5114
5113
  }
5115
5114
  }));
5116
5115
  }