@mastra/deployer 1.38.0-alpha.4 → 1.38.0-alpha.6

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,30 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.38.0-alpha.6
4
+
5
+ ### Patch Changes
6
+
7
+ - dependencies updates: ([#17146](https://github.com/mastra-ai/mastra/pull/17146))
8
+ - Updated dependency [`@babel/core@^7.29.7` ↗︎](https://www.npmjs.com/package/@babel/core/v/7.29.7) (from `^7.29.0`, in `dependencies`)
9
+ - Updated dependency [`@babel/preset-typescript@^7.29.7` ↗︎](https://www.npmjs.com/package/@babel/preset-typescript/v/7.29.7) (from `^7.28.5`, in `dependencies`)
10
+ - Updated dependency [`@babel/traverse@^7.29.7` ↗︎](https://www.npmjs.com/package/@babel/traverse/v/7.29.7) (from `^7.29.0`, in `dependencies`)
11
+
12
+ - Enabled Studio via the CLI and deployers to use agent signal subscriptions by default while preserving `MASTRA_AGENT_SIGNALS=false`, `enableThreadSignals: false`, and explicit legacy Stream as opt-outs. The React `useChat()` hook remains opt-in for SDK consumers via `enableThreadSignals: true`. ([#17313](https://github.com/mastra-ai/mastra/pull/17313))
13
+
14
+ - Updated dependencies [[`bb3fce8`](https://github.com/mastra-ai/mastra/commit/bb3fce8f8d80079170c0f98cb2efbb29ae34375d), [`19a8658`](https://github.com/mastra-ai/mastra/commit/19a86589c788ef48bb6c1b0612cc82a201857379), [`1a97509`](https://github.com/mastra-ai/mastra/commit/1a975099596faf8c3d7e19f6235d5b2969cc39a9), [`1fad344`](https://github.com/mastra-ai/mastra/commit/1fad344c6554142b2061f480ae0b336164ab5efb), [`a659a77`](https://github.com/mastra-ai/mastra/commit/a659a779bdebe3a52a518c56d2260592d0240fe0), [`3332be9`](https://github.com/mastra-ai/mastra/commit/3332be9701ecd77aba840959d9a1d1ce7aef02d3)]:
15
+ - @mastra/server@1.38.0-alpha.6
16
+ - @mastra/core@1.38.0-alpha.6
17
+
18
+ ## 1.38.0-alpha.5
19
+
20
+ ### Patch Changes
21
+
22
+ - The server now installs SIGINT/SIGTERM handlers and runs `mastra.shutdown()` before exiting, allowing storage backends to release resources cleanly instead of being terminated mid-flight. ([#17413](https://github.com/mastra-ai/mastra/pull/17413))
23
+
24
+ - Updated dependencies [[`a18775a`](https://github.com/mastra-ai/mastra/commit/a18775a693172546ee2378d39b67d4e32895b251), [`1baf2d1`](https://github.com/mastra-ai/mastra/commit/1baf2d152c6881338ff8f114633d5316fe13dd15), [`309f7c9`](https://github.com/mastra-ai/mastra/commit/309f7c9899ee6870a07a16690a091c6ba7af4e1e), [`66d65f5`](https://github.com/mastra-ai/mastra/commit/66d65f58e4b1f862c7f7928866a4426f8de9d583)]:
25
+ - @mastra/core@1.38.0-alpha.5
26
+ - @mastra/server@1.38.0-alpha.5
27
+
3
28
  ## 1.38.0-alpha.4
4
29
 
5
30
  ### 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.38.0-alpha.4"
6
+ version: "1.38.0-alpha.6"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.38.0-alpha.4",
2
+ "version": "1.38.0-alpha.6",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {
5
5
  "Deps": {
@@ -4375,7 +4375,7 @@ async function createHonoServer(mastra, options = {
4375
4375
  const experimentalFeatures = process.env.EXPERIMENTAL_FEATURES === "true" ? "true" : "false";
4376
4376
  const experimentalUI = process.env.MASTRA_EXPERIMENTAL_UI === "true" ? "true" : "false";
4377
4377
  const templatesEnabled = process.env.MASTRA_TEMPLATES === "true" ? "true" : "false";
4378
- const agentSignals = process.env.MASTRA_AGENT_SIGNALS === "true" ? "true" : "false";
4378
+ const agentSignals = process.env.MASTRA_AGENT_SIGNALS === "false" ? "false" : "true";
4379
4379
  const requestContextPresets = process.env.MASTRA_REQUEST_CONTEXT_PRESETS || "";
4380
4380
  const escapeForHtml = (json) => {
4381
4381
  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");
@@ -4472,6 +4472,38 @@ async function createNodeServer(mastra, options = { tools: {} }) {
4472
4472
  } else {
4473
4473
  await workerLifecycle.startEventEngine();
4474
4474
  }
4475
+ const SHUTDOWN_TIMEOUT_MS = 5e3;
4476
+ let shuttingDown = false;
4477
+ const shutdown = async (signal) => {
4478
+ if (shuttingDown) {
4479
+ return;
4480
+ }
4481
+ shuttingDown = true;
4482
+ const logger2 = mastra.getLogger();
4483
+ logger2.info("Shutting down Mastra server", { signal });
4484
+ server.close();
4485
+ const lifecycle = mastra;
4486
+ if (typeof lifecycle.shutdown === "function") {
4487
+ let timeout2;
4488
+ const timedOut = /* @__PURE__ */ Symbol("shutdown-timeout");
4489
+ const timeoutPromise = new Promise((resolve) => {
4490
+ timeout2 = setTimeout(() => resolve(timedOut), SHUTDOWN_TIMEOUT_MS);
4491
+ });
4492
+ try {
4493
+ const result = await Promise.race([lifecycle.shutdown(), timeoutPromise]);
4494
+ if (result === timedOut) {
4495
+ logger2.warn("Mastra shutdown timed out; forcing exit", { timeoutMs: SHUTDOWN_TIMEOUT_MS });
4496
+ }
4497
+ } catch (error) {
4498
+ logger2.error("Error during Mastra shutdown", { error });
4499
+ } finally {
4500
+ clearTimeout(timeout2);
4501
+ }
4502
+ }
4503
+ process.exit(0);
4504
+ };
4505
+ process.once("SIGINT", () => void shutdown("SIGINT"));
4506
+ process.once("SIGTERM", () => void shutdown("SIGTERM"));
4475
4507
  return server;
4476
4508
  }
4477
4509