@mcp-use/agent 2.0.0-beta.13 → 2.0.0-beta.14

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
@@ -1941,14 +1941,21 @@ function appendToolOutputsToInput(input, callId, toolName, result) {
1941
1941
  });
1942
1942
  }
1943
1943
  }
1944
+ function responsesReasoningFields(config) {
1945
+ const effort = config.reasoningEffort;
1946
+ if (!effort || effort === "none") return {};
1947
+ return {
1948
+ include: ["reasoning.encrypted_content"],
1949
+ reasoning: { effort }
1950
+ };
1951
+ }
1944
1952
  function buildResponsesBody(params, stream) {
1945
1953
  const body = {
1946
1954
  model: params.config.model,
1947
1955
  input: params.input,
1948
1956
  store: false,
1949
- include: ["reasoning.encrypted_content"],
1950
- reasoning: { effort: params.config.reasoningEffort ?? "low" },
1951
- stream
1957
+ stream,
1958
+ ...responsesReasoningFields(params.config)
1952
1959
  };
1953
1960
  if (params.instructions) body.instructions = params.instructions;
1954
1961
  if (params.tools && params.tools.length > 0) {
@@ -2567,7 +2574,7 @@ function providerConfigFromOptions(provider, model, config) {
2567
2574
  }
2568
2575
 
2569
2576
  // src/version.ts
2570
- var VERSION = "2.0.0-beta.12";
2577
+ var VERSION = "2.0.0-beta.14";
2571
2578
  function getPackageVersion() {
2572
2579
  return VERSION;
2573
2580
  }
@@ -2959,11 +2966,6 @@ var MCPAgent = class {
2959
2966
  }
2960
2967
  if (this.initialized) return;
2961
2968
  if (this.isSimplifiedMode) {
2962
- if (!this.client && this.mcpServersConfig) {
2963
- const { MCPClient } = await import("@mcp-use/client");
2964
- this.client = new MCPClient({ mcpServers: this.mcpServersConfig });
2965
- this.clientOwnedByAgent = true;
2966
- }
2967
2969
  if (this.llmString) {
2968
2970
  this.driver = createLlmDriver(
2969
2971
  parseLLMStringToProviderConfig(this.llmString, this.llmConfig)
@@ -2972,6 +2974,11 @@ var MCPAgent = class {
2972
2974
  } else if (this.explicitProviderConfig) {
2973
2975
  this.driver = createLlmDriver(this.explicitProviderConfig);
2974
2976
  }
2977
+ if (!this.client && this.mcpServersConfig && !this.hasLiveConnections()) {
2978
+ const { MCPClient } = await import("@mcp-use/client");
2979
+ this.client = new MCPClient({ mcpServers: this.mcpServersConfig });
2980
+ this.clientOwnedByAgent = true;
2981
+ }
2975
2982
  if (!this.driver) {
2976
2983
  throw new Error("LLM driver not configured.");
2977
2984
  }