@mastra/client-js 1.8.3 → 1.8.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,27 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 1.8.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed `@mastra/client-js` so client-side tools with Zod `inputSchema`, `parameters`, or `outputSchema` are serialized to JSON Schema before requests are sent. ([#13673](https://github.com/mastra-ai/mastra/pull/13673))
8
+
9
+ Client tools with `execute` functions no longer trigger OpenAI `"Invalid schema for function"` errors when they include Zod schemas.
10
+
11
+ Fixes #11668. Alternative to #11787.
12
+
13
+ - Updated dependencies [[`0ce6035`](https://github.com/mastra-ai/mastra/commit/0ce603591189f547397704e53f23c77bc5630071), [`1978bc4`](https://github.com/mastra-ai/mastra/commit/1978bc424dbb04f5f7c5d8522f07f1166006fa3f)]:
14
+ - @mastra/core@1.13.2
15
+ - @mastra/schema-compat@1.2.4
16
+
17
+ ## 1.8.4-alpha.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [[`0ce6035`](https://github.com/mastra-ai/mastra/commit/0ce603591189f547397704e53f23c77bc5630071), [`1978bc4`](https://github.com/mastra-ai/mastra/commit/1978bc424dbb04f5f7c5d8522f07f1166006fa3f)]:
22
+ - @mastra/core@1.13.2-alpha.0
23
+ - @mastra/schema-compat@1.2.4-alpha.0
24
+
3
25
  ## 1.8.3
4
26
 
5
27
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-client-js
3
3
  description: Documentation for @mastra/client-js. Use when working with @mastra/client-js APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/client-js"
6
- version: "1.8.3"
6
+ version: "1.8.4"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.8.3",
2
+ "version": "1.8.4",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -4,7 +4,6 @@ var uuid = require('@lukeed/uuid');
4
4
  var error = require('@mastra/core/error');
5
5
  var schema = require('@mastra/schema-compat/schema');
6
6
  var requestContext = require('@mastra/core/request-context');
7
- var isVercelTool = require('@mastra/core/tools/is-vercel-tool');
8
7
  var zodToJson = require('@mastra/schema-compat/zod-to-json');
9
8
 
10
9
  var __create = Object.create;
@@ -1164,24 +1163,19 @@ function processClientTools(clientTools) {
1164
1163
  }
1165
1164
  return Object.fromEntries(
1166
1165
  Object.entries(clientTools).map(([key, value]) => {
1167
- if (isVercelTool.isVercelTool(value)) {
1168
- return [
1169
- key,
1170
- {
1171
- ...value,
1172
- parameters: value.parameters ? zodToJsonSchema2(value.parameters) : void 0
1173
- }
1174
- ];
1175
- } else {
1176
- return [
1177
- key,
1178
- {
1179
- ...value,
1180
- inputSchema: value.inputSchema ? zodToJsonSchema2(value.inputSchema) : void 0,
1181
- outputSchema: value.outputSchema ? zodToJsonSchema2(value.outputSchema) : void 0
1182
- }
1183
- ];
1184
- }
1166
+ const tool = value;
1167
+ return [
1168
+ key,
1169
+ {
1170
+ ...value,
1171
+ // Serialize parameters (Vercel v4 tool format)
1172
+ ...tool.parameters !== void 0 ? { parameters: zodToJsonSchema2(tool.parameters) } : {},
1173
+ // Serialize inputSchema (Mastra tool, ClientTool, or Vercel v5 tool format)
1174
+ ...tool.inputSchema !== void 0 ? { inputSchema: zodToJsonSchema2(tool.inputSchema) } : {},
1175
+ // Serialize outputSchema
1176
+ ...tool.outputSchema !== void 0 ? { outputSchema: zodToJsonSchema2(tool.outputSchema) } : {}
1177
+ }
1178
+ ];
1185
1179
  })
1186
1180
  );
1187
1181
  }