@mastra/nestjs 0.1.8 → 0.1.10-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 CHANGED
@@ -1,5 +1,33 @@
1
1
  # @mastra/nestjs
2
2
 
3
+ ## 0.1.10-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Added sseFlushOnConnect route option to scope the SSE connected comment to subscribe endpoints only ([#17158](https://github.com/mastra-ai/mastra/pull/17158))
8
+
9
+ - Scoped the SSE connected comment to subscribe routes only and added SSE comment passthrough for Fastify and NestJS adapters ([#17158](https://github.com/mastra-ai/mastra/pull/17158))
10
+
11
+ - Updated dependencies [[`9d87d68`](https://github.com/mastra-ai/mastra/commit/9d87d688371f5d1252ebb18d96890b51ade7de7c), [`49f8abc`](https://github.com/mastra-ai/mastra/commit/49f8abce8258e4f2f87bd326acfbdb641264a47c), [`9d87d68`](https://github.com/mastra-ai/mastra/commit/9d87d688371f5d1252ebb18d96890b51ade7de7c)]:
12
+ - @mastra/server@1.37.2-alpha.1
13
+ - @mastra/core@1.37.2-alpha.1
14
+
15
+ ## 0.1.10-alpha.0
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`07c3de7`](https://github.com/mastra-ai/mastra/commit/07c3de7f7bc418beccaea3b5e6b7f7cdda79d492)]:
20
+ - @mastra/core@1.37.2-alpha.0
21
+ - @mastra/server@1.37.2-alpha.0
22
+
23
+ ## 0.1.9
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [[`21db1a4`](https://github.com/mastra-ai/mastra/commit/21db1a4b8ac058d5a4fbe38b516cc1b81e526915)]:
28
+ - @mastra/core@1.37.1
29
+ - @mastra/server@1.37.1
30
+
3
31
  ## 0.1.8
4
32
 
5
33
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -11838,7 +11838,8 @@ exports.RouteHandlerService = class _RouteHandlerService {
11838
11838
  return {
11839
11839
  data,
11840
11840
  responseType: route.responseType,
11841
- streamFormat: route.streamFormat
11841
+ streamFormat: route.streamFormat,
11842
+ sseFlushOnConnect: route.sseFlushOnConnect
11842
11843
  };
11843
11844
  }
11844
11845
  getRouteKey(method, path) {
@@ -12984,6 +12985,9 @@ exports.StreamingInterceptor = class _StreamingInterceptor {
12984
12985
  if (streamFormat === "sse") {
12985
12986
  response.setHeader("X-Accel-Buffering", "no");
12986
12987
  }
12988
+ if (streamFormat === "sse" && result.sseFlushOnConnect) {
12989
+ response.write(": connected\n\n");
12990
+ }
12987
12991
  const data = result.data;
12988
12992
  const hasFullStream = data !== null && typeof data === "object" && "fullStream" in data;
12989
12993
  const stream = hasFullStream ? data.fullStream : data;
@@ -13004,6 +13008,10 @@ exports.StreamingInterceptor = class _StreamingInterceptor {
13004
13008
  break;
13005
13009
  }
13006
13010
  if (value) {
13011
+ if (streamFormat === "sse" && typeof value === "string" && value.startsWith(":")) {
13012
+ response.write(value);
13013
+ continue;
13014
+ }
13007
13015
  const outputValue = shouldRedact ? serverAdapter.redactStreamChunk(value) : value;
13008
13016
  if (streamFormat === "sse") {
13009
13017
  response.write(`data: ${JSON.stringify(outputValue)}