@ai-sdk/anthropic 3.0.88 → 3.0.90

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/anthropic",
3
- "version": "3.0.88",
3
+ "version": "3.0.90",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@ai-sdk/provider": "3.0.12",
40
- "@ai-sdk/provider-utils": "4.0.32"
40
+ "@ai-sdk/provider-utils": "4.0.33"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -1442,6 +1442,7 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
1442
1442
  providerExecuted?: boolean;
1443
1443
  firstDelta: boolean;
1444
1444
  providerToolName?: string;
1445
+ providerToolInputType?: string;
1445
1446
  caller?: {
1446
1447
  type:
1447
1448
  | 'code_execution_20250825'
@@ -1647,6 +1648,13 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
1647
1648
  part.name === 'bash_code_execution'
1648
1649
  ? 'code_execution'
1649
1650
  : part.name;
1651
+ const providerToolInputType =
1652
+ part.name === 'text_editor_code_execution' ||
1653
+ part.name === 'bash_code_execution'
1654
+ ? part.name
1655
+ : part.name === 'code_execution'
1656
+ ? 'programmatic-tool-call'
1657
+ : undefined;
1650
1658
 
1651
1659
  const customToolName =
1652
1660
  toolNameMapping.toCustomToolName(providerToolName);
@@ -1675,8 +1683,9 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
1675
1683
  providerToolName === 'code_execution'
1676
1684
  ? { dynamic: true }
1677
1685
  : {}),
1678
- firstDelta: true,
1686
+ firstDelta: finalInput.length === 0,
1679
1687
  providerToolName,
1688
+ providerToolInputType,
1680
1689
  };
1681
1690
 
1682
1691
  controller.enqueue({
@@ -2205,9 +2214,9 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
2205
2214
  // the type to the delta and change the tool name.
2206
2215
  if (
2207
2216
  contentBlock.firstDelta &&
2208
- contentBlock.providerToolName === 'code_execution'
2217
+ contentBlock.providerToolInputType != null
2209
2218
  ) {
2210
- delta = `{"type": "programmatic-tool-call",${delta.substring(1)}`;
2219
+ delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
2211
2220
  }
2212
2221
 
2213
2222
  controller.enqueue({