@mastra/server-adapters-test-suite 0.3.0-alpha.3 → 0.3.0-alpha.4

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,47 @@
1
1
  # @mastra/server-adapters-test-suite
2
2
 
3
+ ## 0.3.0-alpha.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Add `PUT /api/observability/feedback/:feedbackId` for complete feedback replacement. Preserve the original ID, trace ID, and timestamp, and include every field to retain. Delayed POST retries keep existing feedback. Unsupported storage versions return 501. ([#30059](https://github.com/mastra-ai/mastra/pull/30059))
8
+
9
+ ```json
10
+ {
11
+ "feedback": {
12
+ "feedbackId": "feedback-1",
13
+ "traceId": "trace-123",
14
+ "timestamp": "2026-11-11T12:00:00.123Z",
15
+ "feedbackType": "thumbs",
16
+ "value": -1
17
+ }
18
+ }
19
+ ```
20
+
21
+ - Cover feedback and score export delivery in the shared HTTP adapter tests. ([#30052](https://github.com/mastra-ai/mastra/pull/30052))
22
+
23
+ Declare `@mastra/observability` as a peer dependency for these tests.
24
+
25
+ - Added shared tests for server adapters. They check that when a client disconnects, a custom route's agent run stops, even after garbage collection, and that a custom route's request is freed once its streamed response ends or fails. ([#29617](https://github.com/mastra-ai/mastra/pull/29617))
26
+
27
+ ```ts
28
+ import { createCustomRouteDisconnectTestSuite } from '@mastra/server-adapters-test-suite';
29
+
30
+ createCustomRouteDisconnectTestSuite({
31
+ suiteName: 'My adapter: custom route disconnect',
32
+ startServer: async mastra => {
33
+ const { baseUrl, close } = await serveMyAdapter(mastra);
34
+ return { baseUrl, close };
35
+ },
36
+ });
37
+ ```
38
+
39
+ - Updated dependencies [[`c860b9b`](https://github.com/mastra-ai/mastra/commit/c860b9bb438d16fc8dcd81dbfabf1e481725cb6f), [`166ad37`](https://github.com/mastra-ai/mastra/commit/166ad37debf0266fad6121c2f939f8575aba1512), [`d0cc2fd`](https://github.com/mastra-ai/mastra/commit/d0cc2fdc13d09179e9747d8067e8e23ed1c5a2a2), [`b621401`](https://github.com/mastra-ai/mastra/commit/b62140115989dc564709a5f94c41357eb26bc778), [`59a60e4`](https://github.com/mastra-ai/mastra/commit/59a60e42d5985980d1a36cf0bcddeead09283703), [`9751742`](https://github.com/mastra-ai/mastra/commit/9751742c445864f42c400d235310bfc160342e44), [`7082623`](https://github.com/mastra-ai/mastra/commit/708262393a15c45a03bf2f58ea8c14b42aa1a2a4), [`166ad37`](https://github.com/mastra-ai/mastra/commit/166ad37debf0266fad6121c2f939f8575aba1512), [`c860b9b`](https://github.com/mastra-ai/mastra/commit/c860b9bb438d16fc8dcd81dbfabf1e481725cb6f), [`afa19de`](https://github.com/mastra-ai/mastra/commit/afa19de57d0c578cb01ddc648baacddb6a5a87ae), [`166ad37`](https://github.com/mastra-ai/mastra/commit/166ad37debf0266fad6121c2f939f8575aba1512), [`c860b9b`](https://github.com/mastra-ai/mastra/commit/c860b9bb438d16fc8dcd81dbfabf1e481725cb6f), [`4473677`](https://github.com/mastra-ai/mastra/commit/447367781ce5127a4945dcce95b6372d54d728ff), [`8896651`](https://github.com/mastra-ai/mastra/commit/8896651bd1191a30f0b4247ad8f865d31ed7cc2c)]:
40
+ - @mastra/core@1.83.0-alpha.8
41
+ - @mastra/observability@1.24.0-alpha.5
42
+ - @mastra/server@1.83.0-alpha.8
43
+ - @mastra/mcp@2.9.0-alpha.3
44
+
3
45
  ## 0.3.0-alpha.3
4
46
 
5
47
  ### Patch Changes
@@ -0,0 +1,24 @@
1
+ import { Mastra } from '@mastra/core/mastra';
2
+ /**
3
+ * Configuration for the custom-route client-disconnect test suite
4
+ */
5
+ export interface CustomRouteDisconnectTestSuiteConfig {
6
+ /** Name for the test suite */
7
+ suiteName?: string;
8
+ /**
9
+ * Build an app for the given Mastra instance, run the adapter's `init()`, and
10
+ * serve it over real HTTP. Client disconnects must reach the adapter as they
11
+ * do in production.
12
+ */
13
+ startServer: (mastra: Mastra) => Promise<{
14
+ baseUrl: string;
15
+ close: () => Promise<void>;
16
+ }>;
17
+ }
18
+ /**
19
+ * A custom route that streams an agent run must stop that run, and its model
20
+ * request, when the client disconnects. Adapters re-dispatch custom routes
21
+ * through an inner `Request` whose signal follows the client connection.
22
+ */
23
+ export declare function createCustomRouteDisconnectTestSuite(config: CustomRouteDisconnectTestSuiteConfig): void;
24
+ //# sourceMappingURL=custom-route-disconnect-test-suite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-route-disconnect-test-suite.d.ts","sourceRoot":"","sources":["../src/custom-route-disconnect-test-suite.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACnD,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;QACvC,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5B,CAAC,CAAC;CACJ;AA+FD;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,MAAM,EAAE,oCAAoC,QAmLhG"}
package/dist/index.d.ts CHANGED
@@ -12,4 +12,5 @@ export { createCustomRouteFGATestSuite, type CustomRouteFGATestSuiteConfig } fro
12
12
  export { createDefaultTestContext, createStreamWithSensitiveData, createStreamWithUnserializableChunk, expectSerializedStreamChunks, consumeSSEStream, } from './test-helpers.js';
13
13
  export { createKnowledgeRoutesTestSuite, type KnowledgeRoutesTestSuiteConfig } from './knowledge-routes-test-suite.js';
14
14
  export { createObservabilitySignalWriteTestSuite, type ObservabilitySignalWriteTestConfig, } from './observability-signal-write-test-suite.js';
15
+ export { createCustomRouteDisconnectTestSuite, type CustomRouteDisconnectTestSuiteConfig, } from './custom-route-disconnect-test-suite.js';
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,KAAK,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC5G,OAAO,EAAE,gCAAgC,EAAE,KAAK,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACrH,OAAO,EAAE,+BAA+B,EAAE,KAAK,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAClH,YAAY,EACV,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAAE,0BAA0B,EAAE,KAAK,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACxG,OAAO,EAAE,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EAAE,6BAA6B,EAAE,KAAK,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAElH,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,mCAAmC,EACnC,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,KAAK,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAEpH,OAAO,EACL,uCAAuC,EACvC,KAAK,kCAAkC,GACxC,MAAM,yCAAyC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM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