@ai-sdk/anthropic 4.0.61 → 4.0.62

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,15 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 4.0.62
4
+
5
+ ### Patch Changes
6
+
7
+ - 771e74b: chore: enable dead code lint rules
8
+ - Updated dependencies [fe07867]
9
+ - Updated dependencies [a4b0940]
10
+ - Updated dependencies [771e74b]
11
+ - @ai-sdk/provider-utils@5.0.47
12
+
3
13
  ## 4.0.61
4
14
 
5
15
  ### Patch Changes
package/dist/index.js CHANGED
@@ -7114,7 +7114,7 @@ async function parseAnthropicBatchResponse(message) {
7114
7114
  return recovered.success ? recovered.value : void 0;
7115
7115
  }
7116
7116
  function convertAnthropicBatchResponse(response, generateId4) {
7117
- var _a, _b, _c, _d, _e, _f, _g, _h;
7117
+ var _a, _b, _c, _d, _e, _f, _g;
7118
7118
  const content = [];
7119
7119
  const mcpToolCalls = {};
7120
7120
  const serverToolCalls = {};
@@ -7198,7 +7198,7 @@ function convertAnthropicBatchResponse(response, generateId4) {
7198
7198
  toolCallId: part.id,
7199
7199
  toolName,
7200
7200
  input: JSON.stringify(
7201
- isCodeExecutionAlias ? { type: part.name, ...(_b = part.input) != null ? _b : {} } : part.name === "code_execution" && part.input != null && "code" in part.input && !("type" in part.input) ? { type: "programmatic-tool-call", ...part.input } : part.input
7201
+ isCodeExecutionAlias ? { type: part.name, ...part.input } : part.name === "code_execution" && part.input != null && "code" in part.input && !("type" in part.input) ? { type: "programmatic-tool-call", ...part.input } : part.input
7202
7202
  ),
7203
7203
  providerExecuted: true,
7204
7204
  // Batch results are retrieved without the original request tools, so
@@ -7232,7 +7232,7 @@ function convertAnthropicBatchResponse(response, generateId4) {
7232
7232
  content.push({
7233
7233
  type: "tool-result",
7234
7234
  toolCallId: part.tool_use_id,
7235
- toolName: (_c = toolCall == null ? void 0 : toolCall.toolName) != null ? _c : "mcp",
7235
+ toolName: (_b = toolCall == null ? void 0 : toolCall.toolName) != null ? _b : "mcp",
7236
7236
  isError: part.is_error,
7237
7237
  result: part.content,
7238
7238
  dynamic: true,
@@ -7308,7 +7308,7 @@ function convertAnthropicBatchResponse(response, generateId4) {
7308
7308
  ...result.title != null ? { title: result.title } : {},
7309
7309
  providerMetadata: {
7310
7310
  anthropic: {
7311
- pageAge: (_d = result.page_age) != null ? _d : null
7311
+ pageAge: (_c = result.page_age) != null ? _c : null
7312
7312
  }
7313
7313
  }
7314
7314
  });
@@ -7339,7 +7339,7 @@ function convertAnthropicBatchResponse(response, generateId4) {
7339
7339
  });
7340
7340
  break;
7341
7341
  case "tool_search_tool_result": {
7342
- const toolName = (_e = serverToolCalls[part.tool_use_id]) != null ? _e : "tool_search_tool_regex";
7342
+ const toolName = (_d = serverToolCalls[part.tool_use_id]) != null ? _d : "tool_search_tool_regex";
7343
7343
  content.push({
7344
7344
  type: "tool-result",
7345
7345
  toolCallId: part.tool_use_id,
@@ -7405,12 +7405,12 @@ function convertAnthropicBatchResponse(response, generateId4) {
7405
7405
  unified: mapAnthropicStopReason({
7406
7406
  finishReason: response.stop_reason
7407
7407
  }),
7408
- raw: (_f = response.stop_reason) != null ? _f : void 0
7408
+ raw: (_e = response.stop_reason) != null ? _e : void 0
7409
7409
  },
7410
7410
  usage: convertAnthropicUsage({ usage: response.usage }),
7411
7411
  response: {
7412
- id: (_g = response.id) != null ? _g : void 0,
7413
- modelId: (_h = response.model) != null ? _h : void 0
7412
+ id: (_f = response.id) != null ? _f : void 0,
7413
+ modelId: (_g = response.model) != null ? _g : void 0
7414
7414
  },
7415
7415
  warnings: [],
7416
7416
  providerMetadata: {
@@ -8286,7 +8286,7 @@ var AnthropicSkills = class {
8286
8286
  };
8287
8287
 
8288
8288
  // src/version.ts
8289
- var VERSION = true ? "4.0.61" : "0.0.0-test";
8289
+ var VERSION = true ? "4.0.62" : "0.0.0-test";
8290
8290
 
8291
8291
  // src/anthropic-provider.ts
8292
8292
  var ANTHROPIC_API_URL = "https://api.anthropic.com";
@@ -8406,7 +8406,6 @@ function forwardAnthropicContainerIdFromLastStep({
8406
8406
  };
8407
8407
  }
8408
8408
  }
8409
- return void 0;
8410
8409
  }
8411
8410
  export {
8412
8411
  VERSION,