@mastra/ai-sdk 1.9.1 → 1.10.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.
@@ -1,8 +1,14 @@
1
1
  /** Throws when an enabled heartbeat interval cannot be scheduled with a timer. */
2
2
  export declare function assertValidHeartbeatMs(heartbeatMs?: number): void;
3
3
  /**
4
- * Adds periodic SSE comment heartbeats to an AI SDK response body.
5
- * AI SDK serialization uses LF-delimited frames, which this private wrapper preserves and relies on.
4
+ * Wraps an SSE `Response` so it emits periodic `: heartbeat` comments while the source is idle,
5
+ * keeping connections alive through proxies that close idle streams.
6
+ *
7
+ * Heartbeats are only inserted between complete SSE frames. AI SDK serialization uses LF-delimited
8
+ * frames, which this wrapper preserves and relies on.
9
+ *
10
+ * Returns the input response unchanged when `heartbeatMs` is omitted, is `<= 0`, or the response has
11
+ * no body. Throws a `RangeError` when `heartbeatMs` is enabled but cannot be scheduled with a timer.
6
12
  */
7
13
  export declare function withSseHeartbeat(response: Response, heartbeatMs?: number): Response;
8
14
  //# sourceMappingURL=sse-heartbeat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sse-heartbeat.d.ts","sourceRoot":"","sources":["../src/sse-heartbeat.ts"],"names":[],"mappings":"AAOA,kFAAkF;AAClF,wBAAgB,sBAAsB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAQjE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,CAwInF"}
1
+ {"version":3,"file":"sse-heartbeat.d.ts","sourceRoot":"","sources":["../src/sse-heartbeat.ts"],"names":[],"mappings":"AAOA,kFAAkF;AAClF,wBAAgB,sBAAsB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAQjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,CAwInF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/ai-sdk",
3
- "version": "1.9.1",
3
+ "version": "1.10.0",
4
4
  "description": "Adds custom API routes to be compatible with the AI SDK UI parts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -47,17 +47,17 @@
47
47
  "typescript": "^6.0.3",
48
48
  "vitest": "4.1.10",
49
49
  "zod": "^4.4.3",
50
- "@internal/ai-sdk-v4": "0.0.72",
51
- "@internal/ai-v6": "0.0.72",
52
- "@internal/ai-sdk-v5": "0.0.72",
53
- "@internal/lint": "0.0.125",
54
- "@internal/llm-recorder": "0.0.61",
55
- "@internal/test-utils": "0.0.61",
56
- "@internal/ai-v7": "0.0.72",
57
- "@mastra/libsql": "1.21.1",
58
- "@mastra/core": "1.61.0",
59
- "@internal/types-builder": "0.0.100",
60
- "@mastra/memory": "1.27.0"
50
+ "@internal/ai-sdk-v4": "0.0.73",
51
+ "@internal/ai-v7": "0.0.73",
52
+ "@internal/ai-sdk-v5": "0.0.73",
53
+ "@internal/lint": "0.0.126",
54
+ "@internal/llm-recorder": "0.0.62",
55
+ "@internal/ai-v6": "0.0.73",
56
+ "@internal/test-utils": "0.0.62",
57
+ "@mastra/core": "1.62.0",
58
+ "@mastra/libsql": "1.22.0",
59
+ "@mastra/memory": "1.28.0",
60
+ "@internal/types-builder": "0.0.101"
61
61
  },
62
62
  "keywords": [
63
63
  "mastra",