@mastra/deployer 1.13.3-alpha.0 → 1.13.3-alpha.1
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 +16 -0
- package/dist/build/analyze.cjs +2 -2
- package/dist/build/analyze.js +1 -1
- package/dist/build/bundler.cjs +3 -3
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.cjs +15 -15
- package/dist/build/index.js +5 -5
- package/dist/build/utils.d.ts +1 -0
- package/dist/build/utils.d.ts.map +1 -1
- package/dist/bundler/index.cjs +3 -3
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-YKTV7TY3.cjs → chunk-5GQ4KYVA.cjs} +41 -41
- package/dist/{chunk-YKTV7TY3.cjs.map → chunk-5GQ4KYVA.cjs.map} +1 -1
- package/dist/{chunk-G7R456H2.cjs → chunk-A3JIVJHX.cjs} +3 -2
- package/dist/chunk-A3JIVJHX.cjs.map +1 -0
- package/dist/{chunk-XN3FKMO6.js → chunk-CVFIGXXI.js} +3 -2
- package/dist/chunk-CVFIGXXI.js.map +1 -0
- package/dist/{chunk-JNJDIOG2.js → chunk-EIHBOFJ2.js} +7 -7
- package/dist/{chunk-JNJDIOG2.js.map → chunk-EIHBOFJ2.js.map} +1 -1
- package/dist/{chunk-37PC7CXR.cjs → chunk-I4JVB6BK.cjs} +16 -16
- package/dist/{chunk-37PC7CXR.cjs.map → chunk-I4JVB6BK.cjs.map} +1 -1
- package/dist/{chunk-GSO2J4MT.js → chunk-IGXPFW6N.js} +4 -4
- package/dist/{chunk-GSO2J4MT.js.map → chunk-IGXPFW6N.js.map} +1 -1
- package/dist/{chunk-GRC4HK7K.js → chunk-KFHJXZBM.js} +7 -7
- package/dist/{chunk-GRC4HK7K.js.map → chunk-KFHJXZBM.js.map} +1 -1
- package/dist/{chunk-4O7AWOLQ.cjs → chunk-LYJKUXY5.cjs} +17 -17
- package/dist/{chunk-4O7AWOLQ.cjs.map → chunk-LYJKUXY5.cjs.map} +1 -1
- package/dist/{chunk-V245ALKI.cjs → chunk-NNVFGNAO.cjs} +4 -4
- package/dist/{chunk-V245ALKI.cjs.map → chunk-NNVFGNAO.cjs.map} +1 -1
- package/dist/{chunk-IY4RBV63.js → chunk-OOGT37UD.js} +4 -4
- package/dist/{chunk-IY4RBV63.js.map → chunk-OOGT37UD.js.map} +1 -1
- package/dist/{chunk-3Y3N6DCM.cjs → chunk-QT5YQ63Q.cjs} +7 -7
- package/dist/{chunk-3Y3N6DCM.cjs.map → chunk-QT5YQ63Q.cjs.map} +1 -1
- package/dist/{chunk-PM35TGRT.cjs → chunk-QTMOHGMX.cjs} +16 -16
- package/dist/{chunk-PM35TGRT.cjs.map → chunk-QTMOHGMX.cjs.map} +1 -1
- package/dist/{chunk-HXQ27JQX.js → chunk-WQFD37DQ.js} +3 -3
- package/dist/{chunk-HXQ27JQX.js.map → chunk-WQFD37DQ.js.map} +1 -1
- package/dist/{chunk-MPZSAF6V.js → chunk-X3T5NPCG.js} +3 -3
- package/dist/{chunk-MPZSAF6V.js.map → chunk-X3T5NPCG.js.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +15 -10
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +12 -7
- package/dist/server/index.js.map +1 -1
- package/dist/validator/custom-resolver.cjs +3 -3
- package/dist/validator/custom-resolver.js +1 -1
- package/package.json +8 -8
- package/dist/chunk-G7R456H2.cjs.map +0 -1
- package/dist/chunk-XN3FKMO6.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,a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mBAAmC,mDAsDlG"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeStudioBase, injectStudioHtmlConfig } from '../chunk-
|
|
1
|
+
import { normalizeStudioBase, injectStudioHtmlConfig } from '../chunk-CVFIGXXI.js';
|
|
2
2
|
import { readFile } from 'fs/promises';
|
|
3
3
|
import * as https from 'https';
|
|
4
4
|
import { join, dirname } from 'path';
|
|
@@ -3934,6 +3934,7 @@ async function createHonoServer(mastra, options = {
|
|
|
3934
3934
|
}
|
|
3935
3935
|
const app = new Hono();
|
|
3936
3936
|
const server = mastra.getServer();
|
|
3937
|
+
const apiPrefix = server?.apiPrefix ?? "/api";
|
|
3937
3938
|
const a2aTaskStore = new InMemoryTaskStore();
|
|
3938
3939
|
const routes = server?.apiRoutes;
|
|
3939
3940
|
const processedRoutes = routes?.map((route) => {
|
|
@@ -3971,7 +3972,8 @@ async function createHonoServer(mastra, options = {
|
|
|
3971
3972
|
bodyLimitOptions,
|
|
3972
3973
|
openapiPath: options?.isDev || server?.build?.openAPIDocs ? "/openapi.json" : void 0,
|
|
3973
3974
|
customRouteAuthConfig,
|
|
3974
|
-
customApiRoutes: processedRoutes
|
|
3975
|
+
customApiRoutes: processedRoutes,
|
|
3976
|
+
prefix: apiPrefix
|
|
3975
3977
|
});
|
|
3976
3978
|
honoServerAdapter.registerContextMiddleware();
|
|
3977
3979
|
const serverMiddleware = mastra.getServerMiddleware?.();
|
|
@@ -4025,7 +4027,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4025
4027
|
);
|
|
4026
4028
|
if (options?.isDev || server?.build?.swaggerUI) {
|
|
4027
4029
|
app.get(
|
|
4028
|
-
|
|
4030
|
+
apiPrefix,
|
|
4029
4031
|
describeRoute({
|
|
4030
4032
|
description: "API Welcome Page",
|
|
4031
4033
|
tags: ["system"],
|
|
@@ -4072,7 +4074,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4072
4074
|
describeRoute({
|
|
4073
4075
|
hide: true
|
|
4074
4076
|
}),
|
|
4075
|
-
middleware({ url:
|
|
4077
|
+
middleware({ url: `${apiPrefix}/openapi.json` })
|
|
4076
4078
|
);
|
|
4077
4079
|
}
|
|
4078
4080
|
if (options?.isDev) {
|
|
@@ -4134,7 +4136,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4134
4136
|
}
|
|
4135
4137
|
app.get("*", async (c, next) => {
|
|
4136
4138
|
const requestPath = c.req.path;
|
|
4137
|
-
if (requestPath ===
|
|
4139
|
+
if (requestPath === apiPrefix || requestPath.startsWith(`${apiPrefix}/`) || requestPath.startsWith("/swagger-ui") || requestPath.startsWith("/openapi.json")) {
|
|
4138
4140
|
return await next();
|
|
4139
4141
|
}
|
|
4140
4142
|
if (requestPath.includes(".") && !requestPath.endsWith(".html")) {
|
|
@@ -4152,6 +4154,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4152
4154
|
const protocol = key && cert ? "https" : "http";
|
|
4153
4155
|
const cloudApiEndpoint = process.env.MASTRA_CLOUD_API_ENDPOINT || "";
|
|
4154
4156
|
const experimentalFeatures = process.env.EXPERIMENTAL_FEATURES === "true" ? "true" : "false";
|
|
4157
|
+
const templatesEnabled = process.env.MASTRA_TEMPLATES === "true" ? "true" : "false";
|
|
4155
4158
|
const requestContextPresets = process.env.MASTRA_REQUEST_CONTEXT_PRESETS || "";
|
|
4156
4159
|
const escapeForHtml = (json) => {
|
|
4157
4160
|
return json.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
@@ -4161,11 +4164,12 @@ async function createHonoServer(mastra, options = {
|
|
|
4161
4164
|
host: `'${host}'`,
|
|
4162
4165
|
port: `'${port}'`,
|
|
4163
4166
|
protocol: `'${protocol}'`,
|
|
4164
|
-
apiPrefix: `'${
|
|
4167
|
+
apiPrefix: `'${apiPrefix}'`,
|
|
4165
4168
|
basePath: studioBasePath,
|
|
4166
4169
|
hideCloudCta: `'${hideCloudCta}'`,
|
|
4167
4170
|
cloudApiEndpoint: `'${cloudApiEndpoint}'`,
|
|
4168
4171
|
experimentalFeatures: `'${experimentalFeatures}'`,
|
|
4172
|
+
templates: `'${templatesEnabled}'`,
|
|
4169
4173
|
telemetryDisabled: `''`,
|
|
4170
4174
|
requestContextPresets: `'${escapeForHtml(requestContextPresets)}'`,
|
|
4171
4175
|
autoDetectUrl: `'${autoDetectUrl}'`
|
|
@@ -4195,6 +4199,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4195
4199
|
async function createNodeServer(mastra, options = { tools: {} }) {
|
|
4196
4200
|
const app = await createHonoServer(mastra, options);
|
|
4197
4201
|
const serverOptions = mastra.getServer();
|
|
4202
|
+
const apiPrefix = serverOptions?.apiPrefix ?? "/api";
|
|
4198
4203
|
const key = serverOptions?.https?.key ?? (process.env.MASTRA_HTTPS_KEY ? Buffer.from(process.env.MASTRA_HTTPS_KEY, "base64") : void 0);
|
|
4199
4204
|
const cert = serverOptions?.https?.cert ?? (process.env.MASTRA_HTTPS_CERT ? Buffer.from(process.env.MASTRA_HTTPS_CERT, "base64") : void 0);
|
|
4200
4205
|
const isHttpsEnabled = Boolean(key && cert);
|
|
@@ -4216,7 +4221,7 @@ async function createNodeServer(mastra, options = { tools: {} }) {
|
|
|
4216
4221
|
},
|
|
4217
4222
|
() => {
|
|
4218
4223
|
const logger2 = mastra.getLogger();
|
|
4219
|
-
logger2.info(` Mastra API running on ${protocol}://${host}:${port}
|
|
4224
|
+
logger2.info(` Mastra API running on ${protocol}://${host}:${port}${apiPrefix}`);
|
|
4220
4225
|
if (options?.studio) {
|
|
4221
4226
|
const studioBasePath = normalizeStudioBase(serverOptions?.studioBase ?? "/");
|
|
4222
4227
|
const studioUrl = `${protocol}://${host}:${port}${studioBasePath}`;
|