@mastra/deployer 1.13.3-alpha.0 → 1.14.0-alpha.2

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 (53) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/build/analyze.cjs +2 -2
  3. package/dist/build/analyze.js +1 -1
  4. package/dist/build/bundler.cjs +3 -3
  5. package/dist/build/bundler.js +1 -1
  6. package/dist/build/index.cjs +15 -15
  7. package/dist/build/index.js +5 -5
  8. package/dist/build/utils.d.ts +2 -0
  9. package/dist/build/utils.d.ts.map +1 -1
  10. package/dist/bundler/index.cjs +3 -3
  11. package/dist/bundler/index.js +1 -1
  12. package/dist/{chunk-HXQ27JQX.js → chunk-4OVBCW4T.js} +3 -3
  13. package/dist/{chunk-HXQ27JQX.js.map → chunk-4OVBCW4T.js.map} +1 -1
  14. package/dist/{chunk-IY4RBV63.js → chunk-CKCUMDQY.js} +4 -4
  15. package/dist/{chunk-IY4RBV63.js.map → chunk-CKCUMDQY.js.map} +1 -1
  16. package/dist/{chunk-YKTV7TY3.cjs → chunk-FMHCK2VO.cjs} +41 -41
  17. package/dist/{chunk-YKTV7TY3.cjs.map → chunk-FMHCK2VO.cjs.map} +1 -1
  18. package/dist/{chunk-MPZSAF6V.js → chunk-GMDZEJJ4.js} +3 -3
  19. package/dist/{chunk-MPZSAF6V.js.map → chunk-GMDZEJJ4.js.map} +1 -1
  20. package/dist/{chunk-GSO2J4MT.js → chunk-H57LFQ6F.js} +4 -4
  21. package/dist/{chunk-GSO2J4MT.js.map → chunk-H57LFQ6F.js.map} +1 -1
  22. package/dist/{chunk-PM35TGRT.cjs → chunk-HA2RK6ES.cjs} +16 -16
  23. package/dist/{chunk-PM35TGRT.cjs.map → chunk-HA2RK6ES.cjs.map} +1 -1
  24. package/dist/{chunk-37PC7CXR.cjs → chunk-HRFQEG5Y.cjs} +16 -16
  25. package/dist/{chunk-37PC7CXR.cjs.map → chunk-HRFQEG5Y.cjs.map} +1 -1
  26. package/dist/{chunk-GRC4HK7K.js → chunk-J2HRFC3X.js} +7 -7
  27. package/dist/{chunk-GRC4HK7K.js.map → chunk-J2HRFC3X.js.map} +1 -1
  28. package/dist/{chunk-JNJDIOG2.js → chunk-K4SOPFMG.js} +7 -7
  29. package/dist/{chunk-JNJDIOG2.js.map → chunk-K4SOPFMG.js.map} +1 -1
  30. package/dist/{chunk-XN3FKMO6.js → chunk-KVARA33X.js} +4 -2
  31. package/dist/chunk-KVARA33X.js.map +1 -0
  32. package/dist/{chunk-4O7AWOLQ.cjs → chunk-LPMM6HII.cjs} +17 -17
  33. package/dist/{chunk-4O7AWOLQ.cjs.map → chunk-LPMM6HII.cjs.map} +1 -1
  34. package/dist/{chunk-3Y3N6DCM.cjs → chunk-OY3LBAOC.cjs} +7 -7
  35. package/dist/{chunk-3Y3N6DCM.cjs.map → chunk-OY3LBAOC.cjs.map} +1 -1
  36. package/dist/{chunk-G7R456H2.cjs → chunk-Q57SABM6.cjs} +4 -2
  37. package/dist/chunk-Q57SABM6.cjs.map +1 -0
  38. package/dist/{chunk-V245ALKI.cjs → chunk-UUMAFVGW.cjs} +4 -4
  39. package/dist/{chunk-V245ALKI.cjs.map → chunk-UUMAFVGW.cjs.map} +1 -1
  40. package/dist/docs/SKILL.md +1 -1
  41. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  42. package/dist/index.cjs +4 -4
  43. package/dist/index.js +2 -2
  44. package/dist/server/index.cjs +17 -10
  45. package/dist/server/index.cjs.map +1 -1
  46. package/dist/server/index.d.ts.map +1 -1
  47. package/dist/server/index.js +14 -7
  48. package/dist/server/index.js.map +1 -1
  49. package/dist/validator/custom-resolver.cjs +3 -3
  50. package/dist/validator/custom-resolver.js +1 -1
  51. package/package.json +8 -8
  52. package/dist/chunk-G7R456H2.cjs.map +0 -1
  53. package/dist/chunk-XN3FKMO6.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/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,EAAE,QAAQ,CAAC,EAAE,wCAmB/D;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAER;cAegC,QAAQ;eAAa,SAAS;2CAyXhE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmC,mDAsDlG"}
@@ -1,4 +1,4 @@
1
- import { normalizeStudioBase, injectStudioHtmlConfig } from '../chunk-XN3FKMO6.js';
1
+ import { normalizeStudioBase, injectStudioHtmlConfig } from '../chunk-KVARA33X.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
- "/api",
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: "/api/openapi.json" })
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 === "/api" || requestPath.startsWith("/api/") || requestPath.startsWith("/swagger-ui") || requestPath.startsWith("/openapi.json")) {
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,7 +4154,9 @@ 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 || "";
4159
+ const themeToggle = process.env.MASTRA_THEME_TOGGLE === "true" ? "true" : "false";
4156
4160
  const escapeForHtml = (json) => {
4157
4161
  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");
4158
4162
  };
@@ -4161,13 +4165,15 @@ async function createHonoServer(mastra, options = {
4161
4165
  host: `'${host}'`,
4162
4166
  port: `'${port}'`,
4163
4167
  protocol: `'${protocol}'`,
4164
- apiPrefix: `'${serverOptions?.apiPrefix ?? "/api"}'`,
4168
+ apiPrefix: `'${apiPrefix}'`,
4165
4169
  basePath: studioBasePath,
4166
4170
  hideCloudCta: `'${hideCloudCta}'`,
4167
4171
  cloudApiEndpoint: `'${cloudApiEndpoint}'`,
4168
4172
  experimentalFeatures: `'${experimentalFeatures}'`,
4173
+ templates: `'${templatesEnabled}'`,
4169
4174
  telemetryDisabled: `''`,
4170
4175
  requestContextPresets: `'${escapeForHtml(requestContextPresets)}'`,
4176
+ themeToggle: `'${themeToggle}'`,
4171
4177
  autoDetectUrl: `'${autoDetectUrl}'`
4172
4178
  });
4173
4179
  return c.newResponse(indexHtml, 200, { "Content-Type": "text/html" });
@@ -4195,6 +4201,7 @@ async function createHonoServer(mastra, options = {
4195
4201
  async function createNodeServer(mastra, options = { tools: {} }) {
4196
4202
  const app = await createHonoServer(mastra, options);
4197
4203
  const serverOptions = mastra.getServer();
4204
+ const apiPrefix = serverOptions?.apiPrefix ?? "/api";
4198
4205
  const key = serverOptions?.https?.key ?? (process.env.MASTRA_HTTPS_KEY ? Buffer.from(process.env.MASTRA_HTTPS_KEY, "base64") : void 0);
4199
4206
  const cert = serverOptions?.https?.cert ?? (process.env.MASTRA_HTTPS_CERT ? Buffer.from(process.env.MASTRA_HTTPS_CERT, "base64") : void 0);
4200
4207
  const isHttpsEnabled = Boolean(key && cert);
@@ -4216,7 +4223,7 @@ async function createNodeServer(mastra, options = { tools: {} }) {
4216
4223
  },
4217
4224
  () => {
4218
4225
  const logger2 = mastra.getLogger();
4219
- logger2.info(` Mastra API running on ${protocol}://${host}:${port}/api`);
4226
+ logger2.info(` Mastra API running on ${protocol}://${host}:${port}${apiPrefix}`);
4220
4227
  if (options?.studio) {
4221
4228
  const studioBasePath = normalizeStudioBase(serverOptions?.studioBase ?? "/");
4222
4229
  const studioUrl = `${protocol}://${host}:${port}${studioBasePath}`;