@mastra/deployer 1.25.0-alpha.2 → 1.25.0-alpha.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.25.0-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - dependencies updates: ([#15210](https://github.com/mastra-ai/mastra/pull/15210))
8
+ - Updated dependency [`tinyglobby@^0.2.16` ↗︎](https://www.npmjs.com/package/tinyglobby/v/0.2.16) (from `^0.2.15`, in `dependencies`)
9
+ - Updated dependencies [[`cbdf3e1`](https://github.com/mastra-ai/mastra/commit/cbdf3e12b3d0c30a6e5347be658e2009648c130a), [`8fe46d3`](https://github.com/mastra-ai/mastra/commit/8fe46d354027f3f0f0846e64219772348de106dd), [`18c67db`](https://github.com/mastra-ai/mastra/commit/18c67dbb9c9ebc26f26f65f7d3ff836e5691ef46), [`8dcc77e`](https://github.com/mastra-ai/mastra/commit/8dcc77e78a5340f5848f74b9e9f1b3da3513c1f5), [`aa67fc5`](https://github.com/mastra-ai/mastra/commit/aa67fc59ee8a5eeff1f23eb05970b8d7a536c8ff), [`fa8140b`](https://github.com/mastra-ai/mastra/commit/fa8140bcd4251d2e3ac85fdc5547dfc4f372b5be), [`190f452`](https://github.com/mastra-ai/mastra/commit/190f45258b0640e2adfc8219fa3258cdc5b8f071), [`7e7bf60`](https://github.com/mastra-ai/mastra/commit/7e7bf606886bf374a6f9d4ca9b09dd83d0533372), [`184907d`](https://github.com/mastra-ai/mastra/commit/184907d775d8609c03c26e78ccaf37315f3aa287), [`0c4cd13`](https://github.com/mastra-ai/mastra/commit/0c4cd131931c04ac5405373c932a242dbe88edd6), [`b16a753`](https://github.com/mastra-ai/mastra/commit/b16a753d5748440248d7df82e29bb987a9c8386c)]:
10
+ - @mastra/core@1.25.0-alpha.3
11
+ - @mastra/server@1.25.0-alpha.3
12
+
3
13
  ## 1.25.0-alpha.2
4
14
 
5
15
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-deployer
3
3
  description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/deployer"
6
- version: "1.25.0-alpha.2"
6
+ version: "1.25.0-alpha.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.25.0-alpha.2",
2
+ "version": "1.25.0-alpha.3",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {
5
5
  "Deps": {
@@ -194,6 +194,17 @@ var requestPrototype = {
194
194
  }
195
195
  });
196
196
  });
197
+ Object.defineProperty(requestPrototype, /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), {
198
+ value: function(depth, options, inspectFn) {
199
+ const props = {
200
+ method: this.method,
201
+ url: this.url,
202
+ headers: this.headers,
203
+ nativeRequest: this[requestCache]
204
+ };
205
+ return `Request (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
206
+ }
207
+ });
197
208
  Object.setPrototypeOf(requestPrototype, Request2.prototype);
198
209
  var newRequest = (incoming, defaultHostname) => {
199
210
  const req = Object.create(requestPrototype);
@@ -297,6 +308,17 @@ var Response2 = class _Response {
297
308
  }
298
309
  });
299
310
  });
311
+ Object.defineProperty(Response2.prototype, /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"), {
312
+ value: function(depth, options, inspectFn) {
313
+ const props = {
314
+ status: this.status,
315
+ headers: this.headers,
316
+ ok: this.ok,
317
+ nativeResponse: this[responseCache]
318
+ };
319
+ return `Response (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
320
+ }
321
+ });
300
322
  Object.setPrototypeOf(Response2, GlobalResponse);
301
323
  Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);
302
324
  async function readWithoutBlocking(readPromise) {
@@ -368,6 +390,49 @@ if (typeof global.crypto === "undefined") {
368
390
  global.crypto = crypto__default.default;
369
391
  }
370
392
  var outgoingEnded = /* @__PURE__ */ Symbol("outgoingEnded");
393
+ var incomingDraining = /* @__PURE__ */ Symbol("incomingDraining");
394
+ var DRAIN_TIMEOUT_MS = 500;
395
+ var MAX_DRAIN_BYTES = 64 * 1024 * 1024;
396
+ var drainIncoming = (incoming) => {
397
+ const incomingWithDrainState = incoming;
398
+ if (incoming.destroyed || incomingWithDrainState[incomingDraining]) {
399
+ return;
400
+ }
401
+ incomingWithDrainState[incomingDraining] = true;
402
+ if (incoming instanceof http2.Http2ServerRequest) {
403
+ try {
404
+ incoming.stream?.close?.(http2.constants.NGHTTP2_NO_ERROR);
405
+ } catch {
406
+ }
407
+ return;
408
+ }
409
+ let bytesRead = 0;
410
+ const cleanup = () => {
411
+ clearTimeout(timer);
412
+ incoming.off("data", onData);
413
+ incoming.off("end", cleanup);
414
+ incoming.off("error", cleanup);
415
+ };
416
+ const forceClose = () => {
417
+ cleanup();
418
+ const socket = incoming.socket;
419
+ if (socket && !socket.destroyed) {
420
+ socket.destroySoon();
421
+ }
422
+ };
423
+ const timer = setTimeout(forceClose, DRAIN_TIMEOUT_MS);
424
+ timer.unref?.();
425
+ const onData = (chunk) => {
426
+ bytesRead += chunk.length;
427
+ if (bytesRead > MAX_DRAIN_BYTES) {
428
+ forceClose();
429
+ }
430
+ };
431
+ incoming.on("data", onData);
432
+ incoming.on("end", cleanup);
433
+ incoming.on("error", cleanup);
434
+ incoming.resume();
435
+ };
371
436
  var handleRequestError = () => new Response(null, {
372
437
  status: 400
373
438
  });
@@ -533,14 +598,18 @@ var getRequestListener = (fetchCallback, options = {}) => {
533
598
  setTimeout(() => {
534
599
  if (!incomingEnded) {
535
600
  setTimeout(() => {
536
- incoming.destroy();
537
- outgoing.destroy();
601
+ drainIncoming(incoming);
538
602
  });
539
603
  }
540
604
  });
541
605
  }
542
606
  };
543
607
  }
608
+ outgoing.on("finish", () => {
609
+ if (!incomingEnded) {
610
+ drainIncoming(incoming);
611
+ }
612
+ });
544
613
  }
545
614
  outgoing.on("close", () => {
546
615
  const abortController = req[abortControllerKey];
@@ -555,7 +624,7 @@ var getRequestListener = (fetchCallback, options = {}) => {
555
624
  setTimeout(() => {
556
625
  if (!incomingEnded) {
557
626
  setTimeout(() => {
558
- incoming.destroy();
627
+ drainIncoming(incoming);
559
628
  });
560
629
  }
561
630
  });
@@ -679,7 +748,7 @@ var serveStatic = (options = { root: "" }) => {
679
748
  } else {
680
749
  try {
681
750
  filename = tryDecodeURI(c.req.path);
682
- if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) {
751
+ if (/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}/.test(filename)) {
683
752
  throw new Error();
684
753
  }
685
754
  } catch {
@@ -3695,7 +3764,7 @@ var MastraServer = class extends serverAdapter.MastraServer {
3695
3764
  }
3696
3765
  };
3697
3766
 
3698
- // ../../node_modules/.pnpm/hono-openapi@1.3.0_@hono+standard-validator@0.2.2_@standard-schema+spec@1.1.0_hono@4.12_3cea370b44be5a00a417afcc8ad0e5f2/node_modules/hono-openapi/dist/index.js
3767
+ // ../../node_modules/.pnpm/hono-openapi@1.3.0_@hono+standard-validator@0.2.2_@standard-schema+spec@1.1.0_hono@4.12_7583f8b2d2d3db741ec7b85bcfad020d/node_modules/hono-openapi/dist/index.js
3699
3768
  var uniqueSymbol = /* @__PURE__ */ Symbol("openapi");
3700
3769
  function describeRoute(spec) {
3701
3770
  const middleware2 = async (_c, next) => {