@mastra/client-js 0.0.0-fix-shareable-traces-20250717112558 → 0.0.0-fix-message-list-merge-20250718043058
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +9 -2
- package/package.json +3 -3
- package/src/index.test.ts +11 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/client-js@0.10.15-alpha.
|
|
2
|
+
> @mastra/client-js@0.10.15-alpha.1 build /home/runner/work/mastra/mastra/client-sdks/client-js
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
[34mCLI[39m Cleaning output folder
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
|
-
[34mDTS[39m Build start
|
|
13
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m71.60 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in 2718ms
|
|
15
12
|
[32mESM[39m [1mdist/index.js [22m[32m71.31 KB[39m
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
17
|
-
[
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 1747ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m71.60 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 1750ms
|
|
16
|
+
[34mDTS[39m Build start
|
|
17
|
+
[32mDTS[39m ⚡️ Build success in 16319ms
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m41.95 KB[39m
|
|
19
19
|
[32mDTS[39m [1mdist/index.d.cts [22m[32m41.95 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-message-list-merge-20250718043058
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- 7827943: Handle streaming large data
|
|
8
8
|
- Updated dependencies [7827943]
|
|
9
9
|
- Updated dependencies [bf1e7e7]
|
|
10
|
+
- Updated dependencies [ceaa1a4]
|
|
10
11
|
- Updated dependencies [cbddd18]
|
|
11
|
-
- @mastra/core@0.0.0-fix-
|
|
12
|
+
- @mastra/core@0.0.0-fix-message-list-merge-20250718043058
|
|
13
|
+
|
|
14
|
+
## 0.10.15-alpha.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- @mastra/core@0.11.0-alpha.1
|
|
12
19
|
|
|
13
20
|
## 0.10.15-alpha.0
|
|
14
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/client-js",
|
|
3
|
-
"version": "0.0.0-fix-
|
|
3
|
+
"version": "0.0.0-fix-message-list-merge-20250718043058",
|
|
4
4
|
"description": "The official TypeScript library for the Mastra Client API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"rxjs": "7.8.1",
|
|
35
35
|
"zod": "^3.25.67",
|
|
36
36
|
"zod-to-json-schema": "^3.24.5",
|
|
37
|
-
"@mastra/core": "0.0.0-fix-
|
|
37
|
+
"@mastra/core": "0.0.0-fix-message-list-merge-20250718043058"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"zod": "^3.0.0"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"tsup": "^8.5.0",
|
|
49
49
|
"typescript": "^5.8.3",
|
|
50
50
|
"vitest": "^3.2.4",
|
|
51
|
-
"@internal/lint": "0.0.0-fix-
|
|
51
|
+
"@internal/lint": "0.0.0-fix-message-list-merge-20250718043058"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean --treeshake=smallest --splitting",
|
package/src/index.test.ts
CHANGED
|
@@ -27,7 +27,13 @@ describe('MastraClient Resources', () => {
|
|
|
27
27
|
} else {
|
|
28
28
|
responseBody = new ReadableStream({
|
|
29
29
|
start(controller) {
|
|
30
|
-
|
|
30
|
+
if (typeof data === 'string') {
|
|
31
|
+
controller.enqueue(new TextEncoder().encode(data));
|
|
32
|
+
} else if (typeof data === 'object' && data !== null) {
|
|
33
|
+
controller.enqueue(new TextEncoder().encode(JSON.stringify(data)));
|
|
34
|
+
} else {
|
|
35
|
+
controller.enqueue(new TextEncoder().encode(String(data)));
|
|
36
|
+
}
|
|
31
37
|
controller.close();
|
|
32
38
|
},
|
|
33
39
|
});
|
|
@@ -279,7 +285,7 @@ describe('MastraClient Resources', () => {
|
|
|
279
285
|
});
|
|
280
286
|
|
|
281
287
|
it('should stream responses', async () => {
|
|
282
|
-
const mockChunk =
|
|
288
|
+
const mockChunk = `0:"test response"\n`;
|
|
283
289
|
mockFetchResponse(mockChunk, { isStream: true });
|
|
284
290
|
|
|
285
291
|
const response = await agent.stream({
|
|
@@ -298,7 +304,7 @@ describe('MastraClient Resources', () => {
|
|
|
298
304
|
if (reader) {
|
|
299
305
|
const { value, done } = await reader.read();
|
|
300
306
|
expect(done).toBe(false);
|
|
301
|
-
expect(new TextDecoder().decode(value)).toBe(
|
|
307
|
+
expect(new TextDecoder().decode(value)).toBe(mockChunk);
|
|
302
308
|
}
|
|
303
309
|
});
|
|
304
310
|
|
|
@@ -662,14 +668,14 @@ describe('MastraClient Resources', () => {
|
|
|
662
668
|
};
|
|
663
669
|
mockFetchResponse(mockResponse);
|
|
664
670
|
|
|
665
|
-
const result = await workflow.startAsync({
|
|
671
|
+
const result = await workflow.startAsync({ inputData: { test: 'test' } });
|
|
666
672
|
expect(result).toEqual(mockResponse);
|
|
667
673
|
expect(global.fetch).toHaveBeenCalledWith(
|
|
668
674
|
`${clientOptions.baseUrl}/api/workflows/test-workflow/start-async?`,
|
|
669
675
|
expect.objectContaining({
|
|
670
676
|
method: 'POST',
|
|
671
677
|
headers: expect.objectContaining(clientOptions.headers),
|
|
672
|
-
body: JSON.stringify({ test: 'test' }),
|
|
678
|
+
body: JSON.stringify({ inputData: { test: 'test' } }),
|
|
673
679
|
}),
|
|
674
680
|
);
|
|
675
681
|
});
|