@ai-sdk/anthropic 3.0.0-beta.92 → 3.0.0-beta.94

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,21 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.0-beta.94
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9549c9e]
8
+ - @ai-sdk/provider@3.0.0-beta.29
9
+ - @ai-sdk/provider-utils@4.0.0-beta.56
10
+
11
+ ## 3.0.0-beta.93
12
+
13
+ ### Patch Changes
14
+
15
+ - 50b70d6: feat(anthropic): add programmatic tool calling
16
+ - Updated dependencies [50b70d6]
17
+ - @ai-sdk/provider-utils@4.0.0-beta.55
18
+
3
19
  ## 3.0.0-beta.92
4
20
 
5
21
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -168,6 +168,7 @@ type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
168
168
 
169
169
  interface AnthropicToolOptions {
170
170
  deferLoading?: boolean;
171
+ allowedCallers?: Array<'code_execution_20250825'>;
171
172
  }
172
173
 
173
174
  declare const anthropicTools: {
@@ -206,6 +207,10 @@ declare const anthropicTools: {
206
207
  stdout: string;
207
208
  stderr: string;
208
209
  return_code: number;
210
+ content: Array<{
211
+ type: "code_execution_output";
212
+ file_id: string;
213
+ }>;
209
214
  }, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
210
215
  code: string;
211
216
  }, {
@@ -213,6 +218,10 @@ declare const anthropicTools: {
213
218
  stdout: string;
214
219
  stderr: string;
215
220
  return_code: number;
221
+ content: Array<{
222
+ type: "code_execution_output";
223
+ file_id: string;
224
+ }>;
216
225
  }>;
217
226
  /**
218
227
  * Claude can analyze data, create visualizations, perform complex calculations,
@@ -225,6 +234,9 @@ declare const anthropicTools: {
225
234
  * This is the latest version with enhanced Bash support and file operations.
226
235
  */
227
236
  codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
237
+ type: "programmatic-tool-call";
238
+ code: string;
239
+ } | {
228
240
  type: "bash_code_execution";
229
241
  command: string;
230
242
  } | {
@@ -243,6 +255,15 @@ declare const anthropicTools: {
243
255
  old_str: string;
244
256
  new_str: string;
245
257
  }, {
258
+ type: "code_execution_result";
259
+ stdout: string;
260
+ stderr: string;
261
+ return_code: number;
262
+ content: Array<{
263
+ type: "code_execution_output";
264
+ file_id: string;
265
+ }>;
266
+ } | {
246
267
  type: "bash_code_execution_result";
247
268
  content: Array<{
248
269
  type: "bash_code_execution_output";
@@ -275,6 +296,9 @@ declare const anthropicTools: {
275
296
  old_lines: number | null;
276
297
  old_start: number | null;
277
298
  }, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
299
+ type: "programmatic-tool-call";
300
+ code: string;
301
+ } | {
278
302
  type: "bash_code_execution";
279
303
  command: string;
280
304
  } | {
@@ -293,6 +317,15 @@ declare const anthropicTools: {
293
317
  old_str: string;
294
318
  new_str: string;
295
319
  }, {
320
+ type: "code_execution_result";
321
+ stdout: string;
322
+ stderr: string;
323
+ return_code: number;
324
+ content: Array<{
325
+ type: "code_execution_output";
326
+ file_id: string;
327
+ }>;
328
+ } | {
296
329
  type: "bash_code_execution_result";
297
330
  content: Array<{
298
331
  type: "bash_code_execution_output";
@@ -709,6 +742,21 @@ Default Anthropic provider instance.
709
742
  */
710
743
  declare const anthropic: AnthropicProvider;
711
744
 
745
+ /**
746
+ * Sets the Anthropic container ID in the provider options based on
747
+ * any previous step's provider metadata.
748
+ *
749
+ * Searches backwards through steps to find the most recent container ID.
750
+ * You can use this function in `prepareStep` to forward the container ID between steps.
751
+ */
752
+ declare function forwardAnthropicContainerIdFromLastStep({ steps, }: {
753
+ steps: Array<{
754
+ providerMetadata?: Record<string, JSONObject>;
755
+ }>;
756
+ }): undefined | {
757
+ providerOptions?: Record<string, JSONObject>;
758
+ };
759
+
712
760
  declare const VERSION: string;
713
761
 
714
- export { type AnthropicMessageMetadata, type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, type AnthropicToolOptions, VERSION, anthropic, createAnthropic };
762
+ export { type AnthropicMessageMetadata, type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, type AnthropicToolOptions, VERSION, anthropic, createAnthropic, forwardAnthropicContainerIdFromLastStep };
package/dist/index.d.ts CHANGED
@@ -168,6 +168,7 @@ type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
168
168
 
169
169
  interface AnthropicToolOptions {
170
170
  deferLoading?: boolean;
171
+ allowedCallers?: Array<'code_execution_20250825'>;
171
172
  }
172
173
 
173
174
  declare const anthropicTools: {
@@ -206,6 +207,10 @@ declare const anthropicTools: {
206
207
  stdout: string;
207
208
  stderr: string;
208
209
  return_code: number;
210
+ content: Array<{
211
+ type: "code_execution_output";
212
+ file_id: string;
213
+ }>;
209
214
  }, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
210
215
  code: string;
211
216
  }, {
@@ -213,6 +218,10 @@ declare const anthropicTools: {
213
218
  stdout: string;
214
219
  stderr: string;
215
220
  return_code: number;
221
+ content: Array<{
222
+ type: "code_execution_output";
223
+ file_id: string;
224
+ }>;
216
225
  }>;
217
226
  /**
218
227
  * Claude can analyze data, create visualizations, perform complex calculations,
@@ -225,6 +234,9 @@ declare const anthropicTools: {
225
234
  * This is the latest version with enhanced Bash support and file operations.
226
235
  */
227
236
  codeExecution_20250825: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
237
+ type: "programmatic-tool-call";
238
+ code: string;
239
+ } | {
228
240
  type: "bash_code_execution";
229
241
  command: string;
230
242
  } | {
@@ -243,6 +255,15 @@ declare const anthropicTools: {
243
255
  old_str: string;
244
256
  new_str: string;
245
257
  }, {
258
+ type: "code_execution_result";
259
+ stdout: string;
260
+ stderr: string;
261
+ return_code: number;
262
+ content: Array<{
263
+ type: "code_execution_output";
264
+ file_id: string;
265
+ }>;
266
+ } | {
246
267
  type: "bash_code_execution_result";
247
268
  content: Array<{
248
269
  type: "bash_code_execution_output";
@@ -275,6 +296,9 @@ declare const anthropicTools: {
275
296
  old_lines: number | null;
276
297
  old_start: number | null;
277
298
  }, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
299
+ type: "programmatic-tool-call";
300
+ code: string;
301
+ } | {
278
302
  type: "bash_code_execution";
279
303
  command: string;
280
304
  } | {
@@ -293,6 +317,15 @@ declare const anthropicTools: {
293
317
  old_str: string;
294
318
  new_str: string;
295
319
  }, {
320
+ type: "code_execution_result";
321
+ stdout: string;
322
+ stderr: string;
323
+ return_code: number;
324
+ content: Array<{
325
+ type: "code_execution_output";
326
+ file_id: string;
327
+ }>;
328
+ } | {
296
329
  type: "bash_code_execution_result";
297
330
  content: Array<{
298
331
  type: "bash_code_execution_output";
@@ -709,6 +742,21 @@ Default Anthropic provider instance.
709
742
  */
710
743
  declare const anthropic: AnthropicProvider;
711
744
 
745
+ /**
746
+ * Sets the Anthropic container ID in the provider options based on
747
+ * any previous step's provider metadata.
748
+ *
749
+ * Searches backwards through steps to find the most recent container ID.
750
+ * You can use this function in `prepareStep` to forward the container ID between steps.
751
+ */
752
+ declare function forwardAnthropicContainerIdFromLastStep({ steps, }: {
753
+ steps: Array<{
754
+ providerMetadata?: Record<string, JSONObject>;
755
+ }>;
756
+ }): undefined | {
757
+ providerOptions?: Record<string, JSONObject>;
758
+ };
759
+
712
760
  declare const VERSION: string;
713
761
 
714
- export { type AnthropicMessageMetadata, type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, type AnthropicToolOptions, VERSION, anthropic, createAnthropic };
762
+ export { type AnthropicMessageMetadata, type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, type AnthropicToolOptions, VERSION, anthropic, createAnthropic, forwardAnthropicContainerIdFromLastStep };