@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/dist/index.js CHANGED
@@ -2,7 +2,6 @@ import { v4 } from '@lukeed/uuid';
2
2
  import { getErrorFromUnknown } from '@mastra/core/error';
3
3
  import { standardSchemaToJSONSchema, toStandardSchema } from '@mastra/schema-compat/schema';
4
4
  import { RequestContext } from '@mastra/core/request-context';
5
- import { isVercelTool } from '@mastra/core/tools/is-vercel-tool';
6
5
  import { zodToJsonSchema } from '@mastra/schema-compat/zod-to-json';
7
6
 
8
7
  var __create = Object.create;
@@ -1162,24 +1161,19 @@ function processClientTools(clientTools) {
1162
1161
  }
1163
1162
  return Object.fromEntries(
1164
1163
  Object.entries(clientTools).map(([key, value]) => {
1165
- if (isVercelTool(value)) {
1166
- return [
1167
- key,
1168
- {
1169
- ...value,
1170
- parameters: value.parameters ? zodToJsonSchema2(value.parameters) : void 0
1171
- }
1172
- ];
1173
- } else {
1174
- return [
1175
- key,
1176
- {
1177
- ...value,
1178
- inputSchema: value.inputSchema ? zodToJsonSchema2(value.inputSchema) : void 0,
1179
- outputSchema: value.outputSchema ? zodToJsonSchema2(value.outputSchema) : void 0
1180
- }
1181
- ];
1182
- }
1164
+ const tool = value;
1165
+ return [
1166
+ key,
1167
+ {
1168
+ ...value,
1169
+ // Serialize parameters (Vercel v4 tool format)
1170
+ ...tool.parameters !== void 0 ? { parameters: zodToJsonSchema2(tool.parameters) } : {},
1171
+ // Serialize inputSchema (Mastra tool, ClientTool, or Vercel v5 tool format)
1172
+ ...tool.inputSchema !== void 0 ? { inputSchema: zodToJsonSchema2(tool.inputSchema) } : {},
1173
+ // Serialize outputSchema
1174
+ ...tool.outputSchema !== void 0 ? { outputSchema: zodToJsonSchema2(tool.outputSchema) } : {}
1175
+ }
1176
+ ];
1183
1177
  })
1184
1178
  );
1185
1179
  }