@opentiny/next-sdk 0.2.2 → 0.2.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.
@@ -18934,7 +18934,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18934
18934
  }
18935
18935
  return taskValidationResult.data;
18936
18936
  }
18937
- const validationResult = safeParse(CreateMessageResultSchema, result);
18937
+ const hasTools = params.tools || params.toolChoice;
18938
+ const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
18939
+ const validationResult = safeParse(resultSchema, result);
18938
18940
  if (!validationResult.success) {
18939
18941
  const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
18940
18942
  throw new McpError(exports2.ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`);
@@ -18930,7 +18930,9 @@ class Client extends Protocol {
18930
18930
  }
18931
18931
  return taskValidationResult.data;
18932
18932
  }
18933
- const validationResult = safeParse(CreateMessageResultSchema, result);
18933
+ const hasTools = params.tools || params.toolChoice;
18934
+ const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
18935
+ const validationResult = safeParse(resultSchema, result);
18934
18936
  if (!validationResult.success) {
18935
18937
  const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
18936
18938
  throw new McpError(ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`);