@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.
- package/dist/{analyze-RHscSUJm.cjs → analyze-B4cKPVju.cjs} +77 -26
- package/dist/analyze-B4cKPVju.cjs.map +1 -0
- package/dist/{analyze-CFPQzJ-2.js → analyze-DzJoNBCX.js} +75 -24
- package/dist/analyze-DzJoNBCX.js.map +1 -0
- package/dist/{arktype-aI7TBD0R-cgd8o1cq.js → arktype-aI7TBD0R-CrIkuKY8.js} +2 -2
- package/dist/arktype-aI7TBD0R-CrIkuKY8.js.map +1 -0
- package/dist/{arktype-aI7TBD0R-BP9yJr5x.cjs → arktype-aI7TBD0R-LEyxmA2b.cjs} +2 -2
- package/dist/arktype-aI7TBD0R-LEyxmA2b.cjs.map +1 -0
- package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
- package/dist/build/analyze.cjs +1 -1
- package/dist/build/analyze.js +1 -2
- package/dist/build/bundler.cjs +1 -1
- package/dist/build/bundler.js +1 -2
- package/dist/build/index.cjs +6 -6
- package/dist/build/index.js +5 -5
- package/dist/build/plugins/tsconfig-paths.d.ts +4 -3
- package/dist/build/plugins/tsconfig-paths.d.ts.map +1 -1
- package/dist/{build-dI0V50la.cjs → build-D0odKdrs.cjs} +45 -45
- package/dist/build-D0odKdrs.cjs.map +1 -0
- package/dist/{build-BPErn9z9.js → build-DZuiBxfv.js} +5 -5
- package/dist/{build-BPErn9z9.js.map → build-DZuiBxfv.js.map} +1 -1
- package/dist/bundler/index.cjs +23 -16
- package/dist/bundler/index.cjs.map +1 -1
- package/dist/bundler/index.js +21 -14
- package/dist/bundler/index.js.map +1 -1
- package/dist/bundler/workspaceDependencies.d.ts.map +1 -1
- package/dist/{bundler-B2N9qjjr.js → bundler-BUqyRuGu.js} +63 -67
- package/dist/{bundler-B2N9qjjr.js.map → bundler-BUqyRuGu.js.map} +1 -1
- package/dist/{bundler-DdqMsDyv.cjs → bundler-Dpd5nkcu.cjs} +64 -69
- package/dist/bundler-Dpd5nkcu.cjs.map +1 -0
- package/dist/{bundlerOptions-DoMtLtV1.cjs → bundlerOptions-DHcbcD1a.cjs} +4 -4
- package/dist/bundlerOptions-DHcbcD1a.cjs.map +1 -0
- package/dist/{bundlerOptions-BHgxhzOz.js → bundlerOptions-DMxva0Sp.js} +2 -2
- package/dist/{bundlerOptions-BHgxhzOz.js.map → bundlerOptions-DMxva0Sp.js.map} +1 -1
- package/dist/{core-DPXkjlFR.js → core-75DLMtZL.js} +17 -13
- package/dist/{core-DPXkjlFR.js.map → core-75DLMtZL.js.map} +1 -1
- package/dist/{core-DLXu5DhR.cjs → core-XnTfh3E_.cjs} +17 -13
- package/dist/{core-DLXu5DhR.cjs.map → core-XnTfh3E_.cjs.map} +1 -1
- package/dist/{dist-DYm9bBZO.js → dist-CQdaZ_Cj.js} +202 -48
- package/dist/dist-CQdaZ_Cj.js.map +1 -0
- package/dist/{dist-twPJIvYf.cjs → dist-IbfljCaD.cjs} +202 -48
- package/dist/dist-IbfljCaD.cjs.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{effect-QlVUlMFu-BcDDX4B1.js → effect-QlVUlMFu-CgfR_0ad.js} +3 -3
- package/dist/{effect-QlVUlMFu-BcDDX4B1.js.map → effect-QlVUlMFu-CgfR_0ad.js.map} +1 -1
- package/dist/{effect-QlVUlMFu-DSdymSCI.cjs → effect-QlVUlMFu-D_Bo06-a.cjs} +3 -3
- package/dist/{effect-QlVUlMFu-DSdymSCI.cjs.map → effect-QlVUlMFu-D_Bo06-a.cjs.map} +1 -1
- package/dist/{esm-Bvuc3c9Z.js → esm-ClsnEB2d.js} +67 -69
- package/dist/{esm-Bvuc3c9Z.js.map → esm-ClsnEB2d.js.map} +1 -1
- package/dist/{esm-SvpXPPt6.cjs → esm-D74qc_jV.cjs} +67 -69
- package/dist/{esm-SvpXPPt6.cjs.map → esm-D74qc_jV.cjs.map} +1 -1
- package/dist/{index-CLddUTqr-CAnnFeRJ.js → index-CLddUTqr-73bY0Z8P.js} +8 -8
- package/dist/{index-CLddUTqr-CAnnFeRJ.js.map → index-CLddUTqr-73bY0Z8P.js.map} +1 -1
- package/dist/{index-CLddUTqr-BpIkA9jT.cjs → index-CLddUTqr-CgjYL5XV.cjs} +8 -8
- package/dist/{index-CLddUTqr-BpIkA9jT.cjs.map → index-CLddUTqr-CgjYL5XV.cjs.map} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/{rolldown-runtime-emK7D4bc.cjs → rolldown-runtime-Gi87jfEt.cjs} +2 -2
- package/dist/server/index.cjs +101 -102
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +79 -80
- package/dist/server/index.js.map +1 -1
- package/dist/services/deps.d.ts.map +1 -1
- package/dist/services/index.cjs +1 -1
- package/dist/services/index.js +1 -2
- package/dist/{services-tWHmAszq.cjs → services-CzhmXlRZ.cjs} +57 -28
- package/dist/services-CzhmXlRZ.cjs.map +1 -0
- package/dist/{services-Ce_5qHk2.js → services-Imf20x6f.js} +54 -26
- package/dist/services-Imf20x6f.js.map +1 -0
- package/dist/{sury-CWZTCd75-eYGXWpqb.cjs → sury-CWZTCd75-BmWsp9y9.cjs} +3 -3
- package/dist/{sury-CWZTCd75-eYGXWpqb.cjs.map → sury-CWZTCd75-BmWsp9y9.cjs.map} +1 -1
- package/dist/{sury-CWZTCd75-CdrsvbNi.js → sury-CWZTCd75-DiZVb8bZ.js} +3 -3
- package/dist/{sury-CWZTCd75-CdrsvbNi.js.map → sury-CWZTCd75-DiZVb8bZ.js.map} +1 -1
- package/dist/{typebox-Dei93FPO-BCfJ-0cP.js → typebox-Dei93FPO-CwpAqpd5.js} +2 -2
- package/dist/typebox-Dei93FPO-CwpAqpd5.js.map +1 -0
- package/dist/{typebox-Dei93FPO-B14DOQQD.cjs → typebox-Dei93FPO-Dv_TSG2I.cjs} +2 -2
- package/dist/typebox-Dei93FPO-Dv_TSG2I.cjs.map +1 -0
- package/dist/{utils-Bsr_sEcH.cjs → utils-C-gJcJAo.cjs} +4 -4
- package/dist/utils-C-gJcJAo.cjs.map +1 -0
- package/dist/{valibot--1zFm7rT-CCFD-Qor.js → valibot--1zFm7rT-BfSX2bry.js} +4 -4
- package/dist/{valibot--1zFm7rT-CCFD-Qor.js.map → valibot--1zFm7rT-BfSX2bry.js.map} +1 -1
- package/dist/{valibot--1zFm7rT-aC9oayBT.cjs → valibot--1zFm7rT-YckVXzoz.cjs} +4 -4
- package/dist/{valibot--1zFm7rT-aC9oayBT.cjs.map → valibot--1zFm7rT-YckVXzoz.cjs.map} +1 -1
- package/dist/validator/custom-resolver.cjs +1 -1
- package/dist/validator/custom-resolver.cjs.map +1 -1
- package/dist/validator/loader.cjs.map +1 -1
- package/dist/validator/loader.js.map +1 -1
- package/dist/{zod-Bwrt9trS-D1WWVzpr.js → zod-Bwrt9trS-CO1V3tYt.js} +5 -5
- package/dist/{zod-Bwrt9trS-D1WWVzpr.js.map → zod-Bwrt9trS-CO1V3tYt.js.map} +1 -1
- package/dist/{zod-Bwrt9trS-OBujxXwV.cjs → zod-Bwrt9trS-CdR6J7TM.cjs} +5 -5
- package/dist/{zod-Bwrt9trS-OBujxXwV.cjs.map → zod-Bwrt9trS-CdR6J7TM.cjs.map} +1 -1
- package/package.json +15 -15
- package/dist/analyze-CFPQzJ-2.js.map +0 -1
- package/dist/analyze-RHscSUJm.cjs.map +0 -1
- package/dist/arktype-aI7TBD0R-BP9yJr5x.cjs.map +0 -1
- package/dist/arktype-aI7TBD0R-cgd8o1cq.js.map +0 -1
- package/dist/build-dI0V50la.cjs.map +0 -1
- package/dist/bundler/find-workspaces.d.ts +0 -52
- package/dist/bundler/find-workspaces.d.ts.map +0 -1
- package/dist/bundler-DdqMsDyv.cjs.map +0 -1
- package/dist/bundlerOptions-DoMtLtV1.cjs.map +0 -1
- package/dist/dist-DYm9bBZO.js.map +0 -1
- package/dist/dist-twPJIvYf.cjs.map +0 -1
- package/dist/services-Ce_5qHk2.js.map +0 -1
- package/dist/services-tWHmAszq.cjs.map +0 -1
- package/dist/typebox-Dei93FPO-B14DOQQD.cjs.map +0 -1
- package/dist/typebox-Dei93FPO-BCfJ-0cP.js.map +0 -1
- package/dist/utils-Bsr_sEcH.cjs.map +0 -1
package/dist/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as normalizeStudioBase, n as escapeStudioHtmlValue, o as injectStudioHtmlConfig } from "../utils-Bl3Lm7SI.js";
|
|
2
|
-
import "../index-CLddUTqr-
|
|
2
|
+
import "../index-CLddUTqr-73bY0Z8P.js";
|
|
3
3
|
import { createReadStream, existsSync, statSync } from "fs";
|
|
4
4
|
import { readFile } from "fs/promises";
|
|
5
5
|
import { dirname, join } from "path";
|
|
@@ -13,7 +13,7 @@ import process$1, { versions } from "process";
|
|
|
13
13
|
import { getMimeType } from "hono/utils/mime";
|
|
14
14
|
import { html } from "hono/html";
|
|
15
15
|
import { Tool } from "@mastra/core/tools";
|
|
16
|
-
import { MASTRA_FRAMEWORK_PUBLIC_KEY, MastraServer, applyMcpRequestAuth, checkRouteFGA, getCustomHTTPExceptionResponse, getFGAProvider, isSafeObjectKey, isZodError, normalizeQueryParams, redactStreamChunk, serializeStreamChunk } from "@mastra/server/server-adapter";
|
|
16
|
+
import { MASTRA_FRAMEWORK_PUBLIC_KEY, MastraServer, applyMcpRequestAuth, checkRouteFGA, getCustomHTTPExceptionResponse, getFGAProvider, getHTTPErrorResponse, isSafeObjectKey, isZodError, normalizeQueryParams, propagateRequestAbort, redactStreamChunk, serializeStreamChunk } from "@mastra/server/server-adapter";
|
|
17
17
|
import util from "util";
|
|
18
18
|
import { Buffer as Buffer$1 } from "buffer";
|
|
19
19
|
import { bodyLimit } from "hono/body-limit";
|
|
@@ -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 =
|
|
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)
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
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)
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
else
|
|
1973
|
-
|
|
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 :
|
|
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))
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
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)
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
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")
|
|
2652
|
-
|
|
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)
|
|
2718
|
-
|
|
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)
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
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")
|
|
3015
|
-
|
|
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 =
|
|
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$
|
|
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());
|
|
@@ -3794,6 +3804,7 @@ var MastraServer$1 = class extends MastraServer {
|
|
|
3794
3804
|
}
|
|
3795
3805
|
} catch {}
|
|
3796
3806
|
});
|
|
3807
|
+
propagateRequestAbort(response.req.raw.signal, res);
|
|
3797
3808
|
return propagateClientDisconnect(await toFetchResponse(res), res);
|
|
3798
3809
|
} else if (route.responseType === "mcp-sse") {
|
|
3799
3810
|
const { server, ssePath, messagePath } = result;
|
|
@@ -3966,25 +3977,8 @@ var MastraServer$1 = class extends MastraServer {
|
|
|
3966
3977
|
}
|
|
3967
3978
|
const customResponse = getCustomHTTPExceptionResponse(error);
|
|
3968
3979
|
if (customResponse) return customResponse;
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
const status = error.status;
|
|
3972
|
-
let safeCause;
|
|
3973
|
-
try {
|
|
3974
|
-
const raw = error instanceof Error ? error.cause : void 0;
|
|
3975
|
-
if (raw && typeof raw === "object" && !Array.isArray(raw) && "failingItems" in raw && Array.isArray(raw.failingItems)) safeCause = { failingItems: raw.failingItems };
|
|
3976
|
-
} catch {}
|
|
3977
|
-
return c.json({
|
|
3978
|
-
error: error instanceof Error ? error.message : "Unknown error",
|
|
3979
|
-
...safeCause ? { cause: safeCause } : {}
|
|
3980
|
-
}, status);
|
|
3981
|
-
}
|
|
3982
|
-
if ("details" in error && error.details && typeof error.details === "object" && "status" in error.details) {
|
|
3983
|
-
const status = error.details.status;
|
|
3984
|
-
return c.json({ error: error instanceof Error ? error.message : "Unknown error" }, status);
|
|
3985
|
-
}
|
|
3986
|
-
}
|
|
3987
|
-
return c.json({ error: error instanceof Error ? error.message : "Unknown error" }, 500);
|
|
3980
|
+
const { status, body } = getHTTPErrorResponse(error);
|
|
3981
|
+
return c.json(body, status);
|
|
3988
3982
|
}
|
|
3989
3983
|
});
|
|
3990
3984
|
}
|
|
@@ -4044,9 +4038,9 @@ var MastraServer$1 = class extends MastraServer {
|
|
|
4044
4038
|
}
|
|
4045
4039
|
}
|
|
4046
4040
|
const fgaError = await checkRouteFGA(this.mastra, serverRoute, c.get("requestContext"), {
|
|
4047
|
-
...c.req.param(),
|
|
4048
4041
|
...Object.fromEntries(new URL(c.req.url).searchParams.entries()),
|
|
4049
|
-
...bodyParams
|
|
4042
|
+
...bodyParams,
|
|
4043
|
+
...c.req.param()
|
|
4050
4044
|
});
|
|
4051
4045
|
if (fgaError) return c.json({
|
|
4052
4046
|
error: fgaError.error,
|
|
@@ -4127,7 +4121,7 @@ var MastraServer$1 = class extends MastraServer {
|
|
|
4127
4121
|
}
|
|
4128
4122
|
};
|
|
4129
4123
|
//#endregion
|
|
4130
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono-openapi/1.3.1/
|
|
4124
|
+
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono-openapi/1.3.1/cf5d765ff55e9cdf127dcce292c045e374cf89159a3e1dea76ff89157f82e8d8/node_modules/hono-openapi/dist/index.js
|
|
4131
4125
|
const uniqueSymbol = Symbol("openapi");
|
|
4132
4126
|
function describeRoute(spec) {
|
|
4133
4127
|
const middleware = async (_c, next) => {
|
|
@@ -4828,7 +4822,10 @@ function welcomeHtml(apiPrefix = "/api") {
|
|
|
4828
4822
|
const getStudioPath = () => {
|
|
4829
4823
|
if (process.env.MASTRA_STUDIO_PATH) return process.env.MASTRA_STUDIO_PATH;
|
|
4830
4824
|
let __dirname = ".";
|
|
4831
|
-
if (import.meta.url)
|
|
4825
|
+
if (import.meta.url) {
|
|
4826
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
4827
|
+
__dirname = dirname(__filename);
|
|
4828
|
+
}
|
|
4832
4829
|
return process.env.MASTRA_STUDIO_PATH || join(__dirname, "studio");
|
|
4833
4830
|
};
|
|
4834
4831
|
function isSchemaApiRoute(route) {
|
|
@@ -4914,10 +4911,10 @@ async function createHonoServer(mastra, options = { tools: {} }) {
|
|
|
4914
4911
|
return errorHandler(err, c, options.isDev);
|
|
4915
4912
|
});
|
|
4916
4913
|
const bodyLimitOptions = {
|
|
4917
|
-
maxSize: server?.bodySizeLimit ??
|
|
4914
|
+
maxSize: server?.bodySizeLimit ?? 4718592,
|
|
4918
4915
|
onError: () => ({ error: "Request body too large" })
|
|
4919
4916
|
};
|
|
4920
|
-
const honoServerAdapter = new MastraServer$
|
|
4917
|
+
const honoServerAdapter = new MastraServer$2({
|
|
4921
4918
|
app,
|
|
4922
4919
|
mastra,
|
|
4923
4920
|
tools: options.tools,
|
|
@@ -4962,14 +4959,15 @@ async function createHonoServer(mastra, options = { tools: {} }) {
|
|
|
4962
4959
|
hasSession: false,
|
|
4963
4960
|
screencastAvailable: false
|
|
4964
4961
|
}));
|
|
4965
|
-
if (server?.cors === false) app.use("*", timeout(server?.timeout ??
|
|
4962
|
+
if (server?.cors === false) app.use("*", timeout(server?.timeout ?? 18e4));
|
|
4966
4963
|
else {
|
|
4967
4964
|
const hasAuth = !!server?.auth;
|
|
4968
|
-
app.use("*", timeout(server?.timeout ??
|
|
4965
|
+
app.use("*", timeout(server?.timeout ?? 18e4), async (c, next) => {
|
|
4969
4966
|
const pathname = new URL(c.req.url).pathname;
|
|
4970
4967
|
const method = c.req.method === "OPTIONS" ? c.req.header("Access-Control-Request-Method") ?? c.req.method : c.req.method;
|
|
4971
4968
|
const routeCors = getRouteCorsConfig(processedRoutes, pathname, method);
|
|
4972
|
-
|
|
4969
|
+
const corsOptions = routeCors ? getCorsConfig(routeCors, false) : getCorsConfig(server?.cors, hasAuth);
|
|
4970
|
+
return cors(corsOptions)(c, next);
|
|
4973
4971
|
});
|
|
4974
4972
|
}
|
|
4975
4973
|
app.get("/health", describeRoute({
|
|
@@ -5052,7 +5050,8 @@ async function createHonoServer(mastra, options = { tools: {} }) {
|
|
|
5052
5050
|
if (requestPath.includes(".") && !requestPath.endsWith(".html")) return await next();
|
|
5053
5051
|
const isStudioRoute = studioBasePath === "" || requestPath === studioBasePath || requestPath.startsWith(`${studioBasePath}/`);
|
|
5054
5052
|
if (options?.studio && isStudioRoute) {
|
|
5055
|
-
|
|
5053
|
+
const studioPath = getStudioPath();
|
|
5054
|
+
let indexHtml = await readFile(join(studioPath, "index.html"), "utf-8");
|
|
5056
5055
|
const port = serverOptions?.port ?? (Number(process.env.PORT) || 4111);
|
|
5057
5056
|
const hideCloudCta = process.env.MASTRA_HIDE_CLOUD_CTA === "true";
|
|
5058
5057
|
const host = serverOptions?.host ?? process.env.MASTRA_HOST ?? "localhost";
|