@mastra/server-adapters-test-suite 0.3.0-alpha.2 → 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 +53 -0
- package/dist/custom-route-disconnect-test-suite.d.ts +24 -0
- package/dist/custom-route-disconnect-test-suite.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +741 -6
- package/dist/index.js.map +1 -1
- package/dist/observability-signal-write-test-suite.d.ts.map +1 -1
- package/dist/route-test-utils.d.ts.map +1 -1
- package/dist/stream-disconnect-test-suite.d.ts +2 -0
- package/dist/stream-disconnect-test-suite.d.ts.map +1 -1
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
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
|
+
|
|
45
|
+
## 0.3.0-alpha.3
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Added stream disconnect cases that check a stream failing partway still delivers what was sent before the failure and ends the response. Adapters that still drop the connection for `datastream-response` routes can pin those cases with the `datastreamUpstreamErrorDropsConnection` option. ([#29944](https://github.com/mastra-ai/mastra/pull/29944))
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [[`749c09c`](https://github.com/mastra-ai/mastra/commit/749c09cf9120ff36cfa965444e2f0472b37c00ee), [`931c2bb`](https://github.com/mastra-ai/mastra/commit/931c2bb605a2a924844a4b75b2b8319673cc911b), [`22b24cc`](https://github.com/mastra-ai/mastra/commit/22b24cc40ad2923b22e11cfa2b5264b4ae0f1ffc), [`5810337`](https://github.com/mastra-ai/mastra/commit/5810337c710fdba9f3e1c3fe982eec8907f2f444), [`ec60314`](https://github.com/mastra-ai/mastra/commit/ec603149745f7592d3d559447f69c65277580c31), [`c3ef10e`](https://github.com/mastra-ai/mastra/commit/c3ef10ee3094f9d30d2aca6d59ef224b0340d6ba), [`df4b70b`](https://github.com/mastra-ai/mastra/commit/df4b70bd4185ce7c56699aac76321e64e59d7cdd), [`6ef0741`](https://github.com/mastra-ai/mastra/commit/6ef07410a40f69ebe316db2bd3190cd43177a46a), [`c3ef10e`](https://github.com/mastra-ai/mastra/commit/c3ef10ee3094f9d30d2aca6d59ef224b0340d6ba), [`01b2b95`](https://github.com/mastra-ai/mastra/commit/01b2b958af4a2a609e20ae2e39c0201383631760), [`e344f15`](https://github.com/mastra-ai/mastra/commit/e344f157171c02d43c41bd6f4a4487e0215726af), [`5de12fc`](https://github.com/mastra-ai/mastra/commit/5de12fce63626abb87fcb09d7628951e7ad96b4a), [`94bf876`](https://github.com/mastra-ai/mastra/commit/94bf8761f4db6650c95f59fc51481e662c0d3436), [`6b8f215`](https://github.com/mastra-ai/mastra/commit/6b8f215e1fadcba2d0e3ad6a1a9222f8f2c6da79), [`ab4c3fa`](https://github.com/mastra-ai/mastra/commit/ab4c3fafdbd5ff84dde97fa936e1e55d70ef3e4b), [`223204c`](https://github.com/mastra-ai/mastra/commit/223204cd3eb1b9e54a7be0130d2bf2e6c957b9cf), [`e349d05`](https://github.com/mastra-ai/mastra/commit/e349d05edd35a1889a4122f296693a15a8125a27)]:
|
|
52
|
+
- @mastra/core@1.83.0-alpha.6
|
|
53
|
+
- @mastra/mcp@2.9.0-alpha.3
|
|
54
|
+
- @mastra/server@1.83.0-alpha.6
|
|
55
|
+
|
|
3
56
|
## 0.3.0-alpha.2
|
|
4
57
|
|
|
5
58
|
### 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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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":"AA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