@ai-sdk/anthropic 4.0.23 → 4.0.25

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.
@@ -314,7 +314,7 @@ declare const anthropicTools: {
314
314
  new_start: number | null;
315
315
  old_lines: number | null;
316
316
  old_start: number | null;
317
- }, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
317
+ }, {}, {}>>[0]) => _ai_sdk_provider_utils.Experimental_ToolCallerTool<_ai_sdk_provider_utils.ProviderExecutedTool<{
318
318
  type: "programmatic-tool-call";
319
319
  code: string;
320
320
  } | {
@@ -376,7 +376,7 @@ declare const anthropicTools: {
376
376
  new_start: number | null;
377
377
  old_lines: number | null;
378
378
  old_start: number | null;
379
- }, {}>;
379
+ }, {}>>;
380
380
  /**
381
381
  * Claude can analyze data, create visualizations, perform complex calculations,
382
382
  * run system commands, create and edit files, and process uploaded files directly within
@@ -460,7 +460,7 @@ declare const anthropicTools: {
460
460
  new_start: number | null;
461
461
  old_lines: number | null;
462
462
  old_start: number | null;
463
- }, {}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{
463
+ }, {}, {}>>[0]) => _ai_sdk_provider_utils.Experimental_ToolCallerTool<_ai_sdk_provider_utils.ProviderExecutedTool<{
464
464
  type: "programmatic-tool-call";
465
465
  code: string;
466
466
  } | {
@@ -531,7 +531,7 @@ declare const anthropicTools: {
531
531
  new_start: number | null;
532
532
  old_lines: number | null;
533
533
  old_start: number | null;
534
- }, {}>;
534
+ }, {}>>;
535
535
  /**
536
536
  * Claude can interact with computer environments through the computer use tool, which
537
537
  * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
@@ -2060,6 +2060,7 @@ var codeExecution_20250522 = (args = {}) => {
2060
2060
  // src/tool/code-execution_20250825.ts
2061
2061
  import {
2062
2062
  createProviderExecutedToolFactory as createProviderExecutedToolFactory7,
2063
+ experimental_toolCaller,
2063
2064
  lazySchema as lazySchema11,
2064
2065
  zodSchema as zodSchema11
2065
2066
  } from "@ai-sdk/provider-utils";
@@ -2167,12 +2168,31 @@ var factory8 = createProviderExecutedToolFactory7({
2167
2168
  supportsDeferredResults: true
2168
2169
  });
2169
2170
  var codeExecution_20250825 = (args = {}) => {
2170
- return factory8(args);
2171
+ return experimental_toolCaller(factory8(args), {
2172
+ type: "provider",
2173
+ prepareProviderOptions: (providerOptions) => {
2174
+ var _a;
2175
+ const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
2176
+ return {
2177
+ ...providerOptions,
2178
+ anthropic: {
2179
+ ...anthropicOptions,
2180
+ allowedCallers: [
2181
+ .../* @__PURE__ */ new Set([
2182
+ ...(_a = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers) != null ? _a : [],
2183
+ "code_execution_20250825"
2184
+ ])
2185
+ ]
2186
+ }
2187
+ };
2188
+ }
2189
+ });
2171
2190
  };
2172
2191
 
2173
2192
  // src/tool/code-execution_20260120.ts
2174
2193
  import {
2175
2194
  createProviderExecutedToolFactory as createProviderExecutedToolFactory8,
2195
+ experimental_toolCaller as experimental_toolCaller2,
2176
2196
  lazySchema as lazySchema12,
2177
2197
  zodSchema as zodSchema12
2178
2198
  } from "@ai-sdk/provider-utils";
@@ -2288,7 +2308,25 @@ var factory9 = createProviderExecutedToolFactory8({
2288
2308
  supportsDeferredResults: true
2289
2309
  });
2290
2310
  var codeExecution_20260120 = (args = {}) => {
2291
- return factory9(args);
2311
+ return experimental_toolCaller2(factory9(args), {
2312
+ type: "provider",
2313
+ prepareProviderOptions: (providerOptions) => {
2314
+ var _a;
2315
+ const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
2316
+ return {
2317
+ ...providerOptions,
2318
+ anthropic: {
2319
+ ...anthropicOptions,
2320
+ allowedCallers: [
2321
+ .../* @__PURE__ */ new Set([
2322
+ ...(_a = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers) != null ? _a : [],
2323
+ "code_execution_20260120"
2324
+ ])
2325
+ ]
2326
+ }
2327
+ };
2328
+ }
2329
+ });
2292
2330
  };
2293
2331
 
2294
2332
  // src/tool/tool-search-regex_20251119.ts
@@ -3383,6 +3421,7 @@ function mapAnthropicStopReason({
3383
3421
  }
3384
3422
 
3385
3423
  // src/sanitize-json-schema.ts
3424
+ import { isRecord } from "@ai-sdk/provider-utils";
3386
3425
  var SUPPORTED_STRING_FORMATS = /* @__PURE__ */ new Set([
3387
3426
  "date-time",
3388
3427
  "time",
@@ -3415,7 +3454,7 @@ function sanitizeJsonSchema(schema) {
3415
3454
  return sanitizeSchema(schema);
3416
3455
  }
3417
3456
  function sanitizeDefinition(definition) {
3418
- if (typeof definition === "boolean" || !isPlainObject(definition)) {
3457
+ if (typeof definition === "boolean" || !isRecord(definition)) {
3419
3458
  return definition;
3420
3459
  }
3421
3460
  return sanitizeSchema(definition);
@@ -3524,9 +3563,6 @@ function formatConstraintValue(value) {
3524
3563
  }
3525
3564
  return JSON.stringify(value);
3526
3565
  }
3527
- function isPlainObject(value) {
3528
- return typeof value === "object" && value !== null && !Array.isArray(value);
3529
- }
3530
3566
 
3531
3567
  // src/anthropic-language-model.ts
3532
3568
  function createCitationSource(citation, citationDocuments, generateId2) {