@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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @mastra/client-js@0.10.15-alpha.0 build /home/runner/work/mastra/mastra/client-sdks/client-js
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
  CLI Building entry: src/index.ts
@@ -9,11 +9,11 @@
9
9
  CLI Cleaning output folder
10
10
  ESM Build start
11
11
  CJS Build start
12
- DTS Build start
13
- CJS dist/index.cjs 71.60 KB
14
- CJS ⚡️ Build success in 2718ms
15
12
  ESM dist/index.js 71.31 KB
16
- ESM ⚡️ Build success in 2722ms
17
- DTS ⚡️ Build success in 16956ms
13
+ ESM ⚡️ Build success in 1747ms
14
+ CJS dist/index.cjs 71.60 KB
15
+ CJS ⚡️ Build success in 1750ms
16
+ DTS Build start
17
+ DTS ⚡️ Build success in 16319ms
18
18
  DTS dist/index.d.ts 41.95 KB
19
19
  DTS dist/index.d.cts 41.95 KB
package/CHANGELOG.md CHANGED
@@ -1,14 +1,21 @@
1
1
  # @mastra/client-js
2
2
 
3
- ## 0.0.0-fix-shareable-traces-20250717112558
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-shareable-traces-20250717112558
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-shareable-traces-20250717112558",
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-shareable-traces-20250717112558"
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-shareable-traces-20250717112558"
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
- controller.enqueue(new TextEncoder().encode(JSON.stringify(data)));
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 = { content: 'test response' };
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(JSON.stringify(mockChunk));
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({ triggerData: { test: 'test' } });
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
  });