@mastra/deployer 1.82.0-alpha.3 → 1.83.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 (63) hide show
  1. package/dist/{analyze-DNnGuzqf.cjs → analyze-DJ-g40iE.cjs} +2 -2
  2. package/dist/{analyze-DNnGuzqf.cjs.map → analyze-DJ-g40iE.cjs.map} +1 -1
  3. package/dist/{analyze-CW9fEusV.js → analyze-fYsu753O.js} +3 -24
  4. package/dist/{analyze-CW9fEusV.js.map → analyze-fYsu753O.js.map} +1 -1
  5. package/dist/build/analyze.cjs +1 -1
  6. package/dist/build/analyze.js +1 -1
  7. package/dist/build/bundlerOptions.d.ts +1 -1
  8. package/dist/build/deployer.d.ts +1 -1
  9. package/dist/build/index.cjs +4 -4
  10. package/dist/build/index.js +4 -4
  11. package/dist/build/shared/extract-mastra-option.d.ts.map +1 -1
  12. package/dist/{build-Cc9X11g7.cjs → build-DJrBURvF.cjs} +5 -5
  13. package/dist/{build-Cc9X11g7.cjs.map → build-DJrBURvF.cjs.map} +1 -1
  14. package/dist/{build-PqRB5M-E.js → build-dIfHk6xF.js} +5 -5
  15. package/dist/{build-PqRB5M-E.js.map → build-dIfHk6xF.js.map} +1 -1
  16. package/dist/bundler/index.cjs +1 -1
  17. package/dist/bundler/index.d.ts +1 -1
  18. package/dist/bundler/index.d.ts.map +1 -1
  19. package/dist/bundler/index.js +1 -1
  20. package/dist/{bundler-DRlNM9-F.js → bundler-DBj7Xv0j.js} +7 -6
  21. package/dist/bundler-DBj7Xv0j.js.map +1 -0
  22. package/dist/{bundler-8GO8sXwa.cjs → bundler-gVxl78M9.cjs} +7 -6
  23. package/dist/bundler-gVxl78M9.cjs.map +1 -0
  24. package/dist/{bundlerOptions-ScfCrul-.js → bundlerOptions-CklrCRoZ.js} +4 -3
  25. package/dist/{bundlerOptions-ScfCrul-.js.map → bundlerOptions-CklrCRoZ.js.map} +1 -1
  26. package/dist/{bundlerOptions-CPMQkWfY.cjs → bundlerOptions-DxMLiEfQ.cjs} +4 -3
  27. package/dist/{bundlerOptions-CPMQkWfY.cjs.map → bundlerOptions-DxMLiEfQ.cjs.map} +1 -1
  28. package/dist/deploy/base.d.ts +1 -1
  29. package/dist/docs/SKILL.md +1 -1
  30. package/dist/docs/assets/SOURCE_MAP.json +33 -2
  31. package/dist/index.cjs +4 -4
  32. package/dist/index.js +4 -4
  33. package/dist/rolldown-runtime-CO0Nlsmt.js +23 -0
  34. package/dist/server/index.cjs +37 -12
  35. package/dist/server/index.cjs.map +1 -1
  36. package/dist/server/index.d.ts +2 -2
  37. package/dist/server/index.js +37 -12
  38. package/dist/server/index.js.map +1 -1
  39. package/dist/services/deps.d.ts +1 -1
  40. package/dist/services/deps.d.ts.map +1 -1
  41. package/dist/services/index.cjs +1 -1
  42. package/dist/services/index.js +1 -1
  43. package/dist/{services-DbgqQ_yI.cjs → services-B8neClCI.cjs} +52 -5
  44. package/dist/services-B8neClCI.cjs.map +1 -0
  45. package/dist/{services-PA2YqqQJ.js → services-BKh9M2E5.js} +51 -5
  46. package/dist/services-BKh9M2E5.js.map +1 -0
  47. package/package.json +13 -10
  48. package/dist/bundler-8GO8sXwa.cjs.map +0 -1
  49. package/dist/bundler-DRlNM9-F.js.map +0 -1
  50. package/dist/services-DbgqQ_yI.cjs.map +0 -1
  51. package/dist/services-PA2YqqQJ.js.map +0 -1
  52. /package/dist/_types/{@hono_node-server@2.1.5 → @hono_node-server@2.1.6}/dist/index.d.mts +0 -0
  53. /package/dist/_types/{@hono_node-server@2.1.5 → @hono_node-server@2.1.6}/package.json +0 -0
  54. /package/dist/_types/{@internal_deployer@0.0.0 → @internal_deployer@0.0.1}/dist/_types/@internal_core@0.1.4/dist/index-Diz1p9N7.d.ts +0 -0
  55. /package/dist/_types/{@internal_deployer@0.0.0 → @internal_deployer@0.0.1}/dist/_types/@internal_core@0.1.4/dist/logger/index.d.ts +0 -0
  56. /package/dist/_types/{@internal_deployer@0.0.0 → @internal_deployer@0.0.1}/dist/bundler.d.ts +0 -0
  57. /package/dist/_types/{@internal_deployer@0.0.0 → @internal_deployer@0.0.1}/dist/deployer.d.ts +0 -0
  58. /package/dist/_types/{@internal_deployer@0.0.0 → @internal_deployer@0.0.1}/dist/index.d.ts +0 -0
  59. /package/dist/_types/{@internal_deployer@0.0.0 → @internal_deployer@0.0.1}/package.json +0 -0
  60. /package/dist/_types/{@mastra_hono@1.7.24-alpha.3 → @mastra_hono@1.7.25-alpha.0}/dist/auth-middleware.d.ts +0 -0
  61. /package/dist/_types/{@mastra_hono@1.7.24-alpha.3 → @mastra_hono@1.7.25-alpha.0}/dist/browser-stream/index.d.ts +0 -0
  62. /package/dist/_types/{@mastra_hono@1.7.24-alpha.3 → @mastra_hono@1.7.25-alpha.0}/dist/index.d.ts +0 -0
  63. /package/dist/_types/{@mastra_hono@1.7.24-alpha.3 → @mastra_hono@1.7.25-alpha.0}/package.json +0 -0
@@ -0,0 +1,23 @@
1
+ // \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ export { __toESM as n, __commonJSMin as t };
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../rolldown-runtime-Bc0pwXKd.cjs");
3
- const require_utils = require("../utils-CDNA_ewa.cjs");
4
3
  require("../index-CLddUTqr-CeV0aeBL.cjs");
4
+ const require_utils = require("../utils-CDNA_ewa.cjs");
5
5
  let fs = require("fs");
6
6
  let fs_promises = require("fs/promises");
7
7
  let path = require("path");
@@ -36,7 +36,7 @@ require("hono/utils/handler");
36
36
  require("hono/utils/url");
37
37
  require("hono/validator");
38
38
  let hono_http_exception = require("hono/http-exception");
39
- // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@hono/node-server/2.1.5/c64acaa22e289f28d8358ed7eb315e04e16f012a2b67390803ba774efd774a1e/node_modules/@hono/node-server/dist/index.mjs
39
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@hono/node-server/2.1.6/fdc2ef0c1fce27248082afaacb1b446b5df0c539a71d22f10b0596ee5aa343f0/node_modules/@hono/node-server/dist/index.mjs
40
40
  var RequestError = class extends Error {
41
41
  constructor(message, options) {
42
42
  super(message, options);
@@ -194,16 +194,27 @@ const newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeader
194
194
  const reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
195
195
  const reDotSegment = /\/\.\.?(?:[/?#]|$)/;
196
196
  const reValidHost = /^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/;
197
+ const validateRequestTarget = (target) => {
198
+ const backslash = target.indexOf("\\");
199
+ if (backslash !== -1) {
200
+ const query = target.indexOf("?");
201
+ if (query === -1 || backslash < query) throw new RequestError("Backslash in request path");
202
+ }
203
+ };
197
204
  const buildUrl = (scheme, host, incomingUrl) => {
198
205
  const url = `${scheme}://${host}${incomingUrl}`;
199
206
  if (!reValidHost.test(host)) {
207
+ validateRequestTarget(incomingUrl);
200
208
  const urlObj = new URL(url);
201
209
  if (urlObj.hostname.length !== host.length && urlObj.hostname !== (host.includes(":") ? host.replace(/:\d+$/, "") : host).toLowerCase()) throw new RequestError("Invalid host header");
202
210
  return urlObj.href;
203
211
  } else if (incomingUrl.length === 0) return url + "/";
204
212
  else {
205
213
  if (incomingUrl.charCodeAt(0) !== 47) throw new RequestError("Invalid URL");
206
- if (!reValidRequestUrl.test(incomingUrl) || reDotSegment.test(incomingUrl)) return new URL(url).href;
214
+ if (!reValidRequestUrl.test(incomingUrl) || reDotSegment.test(incomingUrl)) {
215
+ validateRequestTarget(incomingUrl);
216
+ return new URL(url).href;
217
+ }
207
218
  return url;
208
219
  }
209
220
  };
@@ -612,6 +623,7 @@ const newRequest = (incoming, defaultHostname) => {
612
623
  if (incomingUrl[0] !== "/" && (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
613
624
  if (incoming instanceof http2.Http2ServerRequest) throw new RequestError("Absolute URL for :path is not allowed in HTTP/2");
614
625
  try {
626
+ validateRequestTarget(incomingUrl);
615
627
  req[urlKey] = new URL(incomingUrl).href;
616
628
  } catch (e) {
617
629
  throw new RequestError("Invalid absolute URL", { cause: e });
@@ -1152,6 +1164,7 @@ const appendResponseHeaders = (headers, responseHeaders) => {
1152
1164
  });
1153
1165
  };
1154
1166
  const rejectUpgradeRequest = (socket, status, responseHeaders) => {
1167
+ if (socket.destroyed) return;
1155
1168
  const responseLines = ["Connection: close", "Content-Length: 0"];
1156
1169
  appendResponseHeaders(responseLines, responseHeaders);
1157
1170
  socket.end(`HTTP/1.1 ${status.toString()} ${http.STATUS_CODES[status] ?? ""}\r\n${responseLines.join("\r\n")}\r\n\r
@@ -1159,7 +1172,12 @@ const rejectUpgradeRequest = (socket, status, responseHeaders) => {
1159
1172
  };
1160
1173
  const createUpgradeRequest = (request) => {
1161
1174
  const protocol = request.socket.encrypted ? "https" : "http";
1162
- const url = new URL(request.url ?? "/", `${protocol}://${request.headers.host ?? "localhost"}`);
1175
+ const incomingUrl = request.url ?? "/";
1176
+ let url;
1177
+ if (incomingUrl[0] !== "/" && (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
1178
+ validateRequestTarget(incomingUrl);
1179
+ url = new URL(incomingUrl).href;
1180
+ } else url = buildUrl(protocol, request.headers.host ?? "localhost", incomingUrl);
1163
1181
  const headers = new Headers();
1164
1182
  for (const key in request.headers) {
1165
1183
  const value = request.headers[key];
@@ -1196,6 +1214,10 @@ const setupWebSocket = (options) => {
1196
1214
  };
1197
1215
  server.on("upgrade", async (request, socket, head) => {
1198
1216
  if (request.headers.upgrade?.toLowerCase() !== "websocket") return;
1217
+ const ignoreSocketError = () => {};
1218
+ const reclaimWaiterOnClose = () => rejectWaiter(request);
1219
+ socket.on("error", ignoreSocketError);
1220
+ socket.once("close", reclaimWaiterOnClose);
1199
1221
  const env = {
1200
1222
  incoming: request,
1201
1223
  outgoing: void 0,
@@ -1210,8 +1232,12 @@ const setupWebSocket = (options) => {
1210
1232
  status = response.status;
1211
1233
  responseHeaders = response.headers;
1212
1234
  }
1213
- } catch {
1214
- if (server.listenerCount("upgrade") === 1) rejectUpgradeRequest(socket, 500);
1235
+ } catch (error) {
1236
+ if (server.listenerCount("upgrade") === 1) rejectUpgradeRequest(socket, error instanceof RequestError ? 400 : 500);
1237
+ return;
1238
+ }
1239
+ if (socket.destroyed) {
1240
+ rejectWaiter(request);
1215
1241
  return;
1216
1242
  }
1217
1243
  const waiter = waiterMap.get(request);
@@ -1223,12 +1249,11 @@ const setupWebSocket = (options) => {
1223
1249
  const addResponseHeaders = (headers) => {
1224
1250
  appendResponseHeaders(headers, responseHeaders);
1225
1251
  };
1226
- const reclaimWaiterOnClose = () => rejectWaiter(request);
1227
- socket.once("close", reclaimWaiterOnClose);
1228
1252
  wss.on("headers", addResponseHeaders);
1229
1253
  try {
1230
1254
  wss.handleUpgrade(request, socket, head, (ws) => {
1231
1255
  socket.off("close", reclaimWaiterOnClose);
1256
+ socket.off("error", ignoreSocketError);
1232
1257
  wss.emit("connection", ws, request);
1233
1258
  });
1234
1259
  } finally {
@@ -1337,7 +1362,7 @@ const serve = (options, listeningListener) => {
1337
1362
  });
1338
1363
  return server;
1339
1364
  };
1340
- // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@hono/node-server/2.1.5/c64acaa22e289f28d8358ed7eb315e04e16f012a2b67390803ba774efd774a1e/node_modules/@hono/node-server/dist/utils/stream.mjs
1365
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@hono/node-server/2.1.6/fdc2ef0c1fce27248082afaacb1b446b5df0c539a71d22f10b0596ee5aa343f0/node_modules/@hono/node-server/dist/utils/stream.mjs
1341
1366
  const pr54206Applied = () => {
1342
1367
  const [major, minor] = process$1.versions.node.split(".").map((component) => parseInt(component));
1343
1368
  return major >= 23 || major === 22 && minor >= 7 || major === 20 && minor >= 18;
@@ -1395,7 +1420,7 @@ const createStreamBody = (stream$2, useNativeReadableToWeb = useReadableToWeb) =
1395
1420
  }
1396
1421
  });
1397
1422
  };
1398
- // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@hono/node-server/2.1.5/c64acaa22e289f28d8358ed7eb315e04e16f012a2b67390803ba774efd774a1e/node_modules/@hono/node-server/dist/serve-static.mjs
1423
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@hono/node-server/2.1.6/fdc2ef0c1fce27248082afaacb1b446b5df0c539a71d22f10b0596ee5aa343f0/node_modules/@hono/node-server/dist/serve-static.mjs
1399
1424
  const COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i;
1400
1425
  const ENCODINGS = {
1401
1426
  br: ".br",
@@ -1539,7 +1564,7 @@ const serveStatic = (options = { root: "" }) => {
1539
1564
  return result;
1540
1565
  };
1541
1566
  };
1542
- // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@hono/swagger-ui/0.5.3/fe1b4a78fef400a9bb4ccec4e91cddbbd9b43706afe50dd3266b2297c015e5bf/node_modules/@hono/swagger-ui/dist/index.js
1567
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@hono/swagger-ui/0.5.3/2d64a3444a8e781b9d0909ff286ca728dbe5419d9721688c851938b2e50a9382/node_modules/@hono/swagger-ui/dist/index.js
1543
1568
  const RENDER_TYPE = {
1544
1569
  STRING_ARRAY: "string_array",
1545
1570
  STRING: "string",
@@ -4114,7 +4139,7 @@ var MastraServer = class extends _mastra_server_server_adapter.MastraServer {
4114
4139
  });
4115
4140
  }
4116
4141
  };
4117
- // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono-openapi/1.5.0/aba075f9c000905a9976a3be5624e02cbca659679195a7801fa8cc48a73fcf35/node_modules/hono-openapi/dist/index.js
4142
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono-openapi/1.5.0/6ca93514d06afdfd0d7befe948e629b04e66fbf3f0241f2ac71dd8ec9b8121b7/node_modules/hono-openapi/dist/index.js
4118
4143
  const uniqueSymbol = Symbol.for("hono-openapi");
4119
4144
  function describeRoute(spec) {
4120
4145
  const middleware = async (_c, next) => {