@mastra/deployer 1.14.0-alpha.3 → 1.15.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/CHANGELOG.md +50 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/server/index.cjs +30 -13
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +30 -13
- package/dist/server/index.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @mastra/deployer
|
|
2
2
|
|
|
3
|
+
## 1.15.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `server.studioHost`, `server.studioProtocol`, and `server.studioPort` options for Studio in cloud deployments ([#12899](https://github.com/mastra-ai/mastra/pull/12899))
|
|
8
|
+
|
|
9
|
+
When deploying to cloud environments (e.g., Google Cloud Run), `server.host` must be `0.0.0.0` for the container to accept traffic, and the internal port often differs from the external one (e.g., 8080 internally vs 443 externally). Studio needs the actual public domain, protocol, and port to make API calls from the browser. These new options decouple the server bind configuration from the Studio API URL.
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export const mastra = new Mastra({
|
|
13
|
+
server: {
|
|
14
|
+
host: '0.0.0.0',
|
|
15
|
+
port: 8080,
|
|
16
|
+
studioHost: 'my-app.run.app',
|
|
17
|
+
studioProtocol: 'https',
|
|
18
|
+
studioPort: 443,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
All three options are optional and fall back to existing behavior when not set.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- dependencies updates: ([#14084](https://github.com/mastra-ai/mastra/pull/14084))
|
|
28
|
+
- Updated dependency [`@rollup/plugin-commonjs@29.0.2` ↗︎](https://www.npmjs.com/package/@rollup/plugin-commonjs/v/29.0.2) (from `29.0.0`, in `dependencies`)
|
|
29
|
+
- Updated dependencies [[`cb611a1`](https://github.com/mastra-ai/mastra/commit/cb611a1e89a4f4cf74c97b57e0c27bb56f2eceb5), [`62d1d3c`](https://github.com/mastra-ai/mastra/commit/62d1d3cc08fe8182e7080237fd975de862ec8c91), [`8681ecb`](https://github.com/mastra-ai/mastra/commit/8681ecb86184d5907267000e4576cc442a9a83fc), [`28d0249`](https://github.com/mastra-ai/mastra/commit/28d0249295782277040ad1e0d243e695b7ab1ce4), [`bb0f09d`](https://github.com/mastra-ai/mastra/commit/bb0f09dbac58401b36069f483acf5673202db5b5), [`5f7e9d0`](https://github.com/mastra-ai/mastra/commit/5f7e9d0db664020e1f3d97d7d18c6b0b9d4843d0), [`8ccbd39`](https://github.com/mastra-ai/mastra/commit/8ccbd39f7b1e76b0894db5ac4faa398ab885cedf)]:
|
|
30
|
+
- @mastra/core@1.15.0-alpha.0
|
|
31
|
+
- @mastra/server@1.15.0-alpha.0
|
|
32
|
+
|
|
33
|
+
## 1.14.0
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Added `MASTRA_HOST` environment variable support for configuring the server bind address. Previously, the host could only be set via `server.host` in the Mastra config. Now it follows the same pattern as `PORT`: config value takes precedence, then env var, then defaults to `localhost`. ([#14313](https://github.com/mastra-ai/mastra/pull/14313))
|
|
38
|
+
|
|
39
|
+
- Added a new `MASTRA_TEMPLATES` Studio runtime flag to control whether the **Templates** section appears in the sidebar. ([#14309](https://github.com/mastra-ai/mastra/pull/14309))
|
|
40
|
+
- `MASTRA_TEMPLATES=true` now enables Templates navigation in Studio.
|
|
41
|
+
- By default (`false` or unset), Templates is hidden.
|
|
42
|
+
- Studio HTML injection now propagates this value in both CLI-hosted and deployer-hosted Studio builds.
|
|
43
|
+
- Added tests covering environment variable injection for both paths.
|
|
44
|
+
|
|
45
|
+
- Fixed tsconfig path aliases during build when imports use .js-style module specifiers. ([#13998](https://github.com/mastra-ai/mastra/pull/13998))
|
|
46
|
+
|
|
47
|
+
- Fixed `apiPrefix` server option not being applied to the underlying Hono server instance. Routes, welcome page, Swagger UI, and studio HTML handler now all respect the configured `apiPrefix` instead of hardcoding `/api`. ([#14325](https://github.com/mastra-ai/mastra/pull/14325))
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [[`51970b3`](https://github.com/mastra-ai/mastra/commit/51970b3828494d59a8dd4df143b194d37d31e3f5), [`4444280`](https://github.com/mastra-ai/mastra/commit/444428094253e916ec077e66284e685fde67021e), [`085e371`](https://github.com/mastra-ai/mastra/commit/085e3718a7d0fe9a210fe7dd1c867b9bdfe8d16b), [`b77aa19`](https://github.com/mastra-ai/mastra/commit/b77aa1981361c021f2c881bee8f0c703687f00da), [`dbb879a`](https://github.com/mastra-ai/mastra/commit/dbb879af0b809c668e9b3a9d8bac97d806caa267), [`8b4ce84`](https://github.com/mastra-ai/mastra/commit/8b4ce84aed0808b9805cc4fd7147c1f8a2ef7a36), [`8d4cfe6`](https://github.com/mastra-ai/mastra/commit/8d4cfe6b9a7157d3876206227ec9f04cde6dbc4a), [`dd6ca1c`](https://github.com/mastra-ai/mastra/commit/dd6ca1cdea3b8b6182f4cf61df41070ba0cc0deb), [`ce26fe2`](https://github.com/mastra-ai/mastra/commit/ce26fe2166dd90254f8bee5776e55977143e97de), [`68a019d`](https://github.com/mastra-ai/mastra/commit/68a019d30d22251ddd628a2947d60215c03c350a), [`4cb4edf`](https://github.com/mastra-ai/mastra/commit/4cb4edf3c909d197ec356c1790d13270514ffef6), [`8de3555`](https://github.com/mastra-ai/mastra/commit/8de355572c6fd838f863a3e7e6fe24d0947b774f), [`b26307f`](https://github.com/mastra-ai/mastra/commit/b26307f050df39629511b0e831b8fc26973ce8b1), [`68a019d`](https://github.com/mastra-ai/mastra/commit/68a019d30d22251ddd628a2947d60215c03c350a), [`8de3555`](https://github.com/mastra-ai/mastra/commit/8de355572c6fd838f863a3e7e6fe24d0947b774f), [`a1b3a48`](https://github.com/mastra-ai/mastra/commit/a1b3a48a92473177b80b843b515d6054b7817724)]:
|
|
50
|
+
- @mastra/core@1.14.0
|
|
51
|
+
- @mastra/server@1.14.0
|
|
52
|
+
|
|
3
53
|
## 1.14.0-alpha.3
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -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.
|
|
6
|
+
version: "1.15.0-alpha.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/dist/server/index.cjs
CHANGED
|
@@ -1049,7 +1049,7 @@ var ERR_STREAM_WRITE_AFTER_END = class extends Error {
|
|
|
1049
1049
|
}
|
|
1050
1050
|
};
|
|
1051
1051
|
|
|
1052
|
-
// ../../node_modules/.pnpm/fetch-to-node@2.1.
|
|
1052
|
+
// ../../node_modules/.pnpm/fetch-to-node@2.1.0_patch_hash=42949ba7834aab28b47574e6989b8f3203c3ef91ee1ca866baf4dc8b151d34ae/node_modules/fetch-to-node/dist/fetch-to-node/http-incoming.js
|
|
1053
1053
|
var kHeaders = /* @__PURE__ */ Symbol("kHeaders");
|
|
1054
1054
|
var kHeadersDistinct = /* @__PURE__ */ Symbol("kHeadersDistinct");
|
|
1055
1055
|
var kHeadersCount = /* @__PURE__ */ Symbol("kHeadersCount");
|
|
@@ -1383,7 +1383,7 @@ function onError(self, error, cb) {
|
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
1385
1385
|
|
|
1386
|
-
// ../../node_modules/.pnpm/fetch-to-node@2.1.
|
|
1386
|
+
// ../../node_modules/.pnpm/fetch-to-node@2.1.0_patch_hash=42949ba7834aab28b47574e6989b8f3203c3ef91ee1ca866baf4dc8b151d34ae/node_modules/fetch-to-node/dist/utils/types.js
|
|
1387
1387
|
function validateString(value, name) {
|
|
1388
1388
|
if (typeof value !== "string")
|
|
1389
1389
|
throw new ERR_INVALID_ARG_TYPE(name, "string", value);
|
|
@@ -1420,19 +1420,19 @@ function isUint8Array(value) {
|
|
|
1420
1420
|
return value != null && value[Symbol.toStringTag] === "Uint8Array";
|
|
1421
1421
|
}
|
|
1422
1422
|
|
|
1423
|
-
// ../../node_modules/.pnpm/fetch-to-node@2.1.
|
|
1423
|
+
// ../../node_modules/.pnpm/fetch-to-node@2.1.0_patch_hash=42949ba7834aab28b47574e6989b8f3203c3ef91ee1ca866baf4dc8b151d34ae/node_modules/fetch-to-node/dist/fetch-to-node/internal-http.js
|
|
1424
1424
|
var kNeedDrain = /* @__PURE__ */ Symbol("kNeedDrain");
|
|
1425
1425
|
var kOutHeaders = /* @__PURE__ */ Symbol("kOutHeaders");
|
|
1426
1426
|
function utcDate() {
|
|
1427
1427
|
return (/* @__PURE__ */ new Date()).toUTCString();
|
|
1428
1428
|
}
|
|
1429
1429
|
|
|
1430
|
-
// ../../node_modules/.pnpm/fetch-to-node@2.1.
|
|
1430
|
+
// ../../node_modules/.pnpm/fetch-to-node@2.1.0_patch_hash=42949ba7834aab28b47574e6989b8f3203c3ef91ee1ca866baf4dc8b151d34ae/node_modules/fetch-to-node/dist/fetch-to-node/internal-streams-state.js
|
|
1431
1431
|
function getDefaultHighWaterMark(objectMode) {
|
|
1432
1432
|
return objectMode ? 16 : 64 * 1024;
|
|
1433
1433
|
}
|
|
1434
1434
|
|
|
1435
|
-
// ../../node_modules/.pnpm/fetch-to-node@2.1.
|
|
1435
|
+
// ../../node_modules/.pnpm/fetch-to-node@2.1.0_patch_hash=42949ba7834aab28b47574e6989b8f3203c3ef91ee1ca866baf4dc8b151d34ae/node_modules/fetch-to-node/dist/fetch-to-node/http-common.js
|
|
1436
1436
|
var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
|
|
1437
1437
|
function checkIsHttpToken(val) {
|
|
1438
1438
|
return tokenRegExp.test(val);
|
|
@@ -2647,6 +2647,7 @@ var FetchServerResponse = class _FetchServerResponse extends FetchOutgoingMessag
|
|
|
2647
2647
|
headers.append(header, value);
|
|
2648
2648
|
}
|
|
2649
2649
|
const _this = this;
|
|
2650
|
+
let cancelled = false;
|
|
2650
2651
|
let body = this._hasBody ? new ReadableStream({
|
|
2651
2652
|
start(controller) {
|
|
2652
2653
|
for (const dataChunk of initialDataChunks) {
|
|
@@ -2656,17 +2657,27 @@ var FetchServerResponse = class _FetchServerResponse extends FetchOutgoingMessag
|
|
|
2656
2657
|
controller.close();
|
|
2657
2658
|
} else {
|
|
2658
2659
|
_this.on("finish", () => {
|
|
2660
|
+
if (cancelled) return;
|
|
2659
2661
|
finished = true;
|
|
2660
|
-
|
|
2662
|
+
try {
|
|
2663
|
+
controller.close();
|
|
2664
|
+
} catch (_) {
|
|
2665
|
+
}
|
|
2661
2666
|
});
|
|
2662
2667
|
_this.on("_dataWritten", (e) => {
|
|
2663
|
-
if (finished) {
|
|
2668
|
+
if (finished || cancelled) {
|
|
2664
2669
|
return;
|
|
2665
2670
|
}
|
|
2666
2671
|
const data = _this.dataFromDataWrittenEvent(e);
|
|
2667
|
-
|
|
2672
|
+
try {
|
|
2673
|
+
controller.enqueue(data);
|
|
2674
|
+
} catch (_) {
|
|
2675
|
+
}
|
|
2668
2676
|
});
|
|
2669
2677
|
}
|
|
2678
|
+
},
|
|
2679
|
+
cancel() {
|
|
2680
|
+
cancelled = true;
|
|
2670
2681
|
}
|
|
2671
2682
|
}) : null;
|
|
2672
2683
|
if (body != null && typeof FixedLengthStream !== "undefined") {
|
|
@@ -4179,6 +4190,9 @@ async function createHonoServer(mastra, options = {
|
|
|
4179
4190
|
const key = serverOptions?.https?.key ?? (process.env.MASTRA_HTTPS_KEY ? Buffer.from(process.env.MASTRA_HTTPS_KEY, "base64") : void 0);
|
|
4180
4191
|
const cert = serverOptions?.https?.cert ?? (process.env.MASTRA_HTTPS_CERT ? Buffer.from(process.env.MASTRA_HTTPS_CERT, "base64") : void 0);
|
|
4181
4192
|
const protocol = key && cert ? "https" : "http";
|
|
4193
|
+
const studioHost = serverOptions?.studioHost ?? host;
|
|
4194
|
+
const studioProtocol = serverOptions?.studioProtocol ?? protocol;
|
|
4195
|
+
const studioPort = serverOptions?.studioPort ?? port;
|
|
4182
4196
|
const cloudApiEndpoint = process.env.MASTRA_CLOUD_API_ENDPOINT || "";
|
|
4183
4197
|
const experimentalFeatures = process.env.EXPERIMENTAL_FEATURES === "true" ? "true" : "false";
|
|
4184
4198
|
const templatesEnabled = process.env.MASTRA_TEMPLATES === "true" ? "true" : "false";
|
|
@@ -4189,10 +4203,10 @@ async function createHonoServer(mastra, options = {
|
|
|
4189
4203
|
};
|
|
4190
4204
|
const autoDetectUrl = process.env.MASTRA_AUTO_DETECT_URL === "true";
|
|
4191
4205
|
indexHtml = chunkQ57SABM6_cjs.injectStudioHtmlConfig(indexHtml, {
|
|
4192
|
-
host: `'${
|
|
4193
|
-
port: `'${
|
|
4194
|
-
protocol: `'${
|
|
4195
|
-
apiPrefix: `'${apiPrefix}'`,
|
|
4206
|
+
host: `'${studioHost}'`,
|
|
4207
|
+
port: `'${studioPort}'`,
|
|
4208
|
+
protocol: `'${studioProtocol}'`,
|
|
4209
|
+
apiPrefix: `'${serverOptions?.apiPrefix ?? "/api"}'`,
|
|
4196
4210
|
basePath: studioBasePath,
|
|
4197
4211
|
hideCloudCta: `'${hideCloudCta}'`,
|
|
4198
4212
|
cloudApiEndpoint: `'${cloudApiEndpoint}'`,
|
|
@@ -4235,6 +4249,9 @@ async function createNodeServer(mastra, options = { tools: {} }) {
|
|
|
4235
4249
|
const host = serverOptions?.host ?? process.env.MASTRA_HOST ?? "localhost";
|
|
4236
4250
|
const port = serverOptions?.port ?? (Number(process.env.PORT) || 4111);
|
|
4237
4251
|
const protocol = isHttpsEnabled ? "https" : "http";
|
|
4252
|
+
const studioHost = serverOptions?.studioHost ?? host;
|
|
4253
|
+
const studioProtocol = serverOptions?.studioProtocol ?? protocol;
|
|
4254
|
+
const studioPort = serverOptions?.studioPort ?? port;
|
|
4238
4255
|
const server = serve(
|
|
4239
4256
|
{
|
|
4240
4257
|
fetch: app.fetch,
|
|
@@ -4253,7 +4270,7 @@ async function createNodeServer(mastra, options = { tools: {} }) {
|
|
|
4253
4270
|
logger2.info(` Mastra API running on ${protocol}://${host}:${port}${apiPrefix}`);
|
|
4254
4271
|
if (options?.studio) {
|
|
4255
4272
|
const studioBasePath = chunkQ57SABM6_cjs.normalizeStudioBase(serverOptions?.studioBase ?? "/");
|
|
4256
|
-
const studioUrl = `${
|
|
4273
|
+
const studioUrl = `${studioProtocol}://${studioHost}:${studioPort}${studioBasePath}`;
|
|
4257
4274
|
logger2.info(`\u{1F468}\u200D\u{1F4BB} Studio available at ${studioUrl}`);
|
|
4258
4275
|
}
|
|
4259
4276
|
if (process.send) {
|