@ai-sdk/anthropic 2.0.102 → 2.0.104

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,26 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 2.0.104
4
+
5
+ ### Patch Changes
6
+
7
+ - dc710c5: fix(amazon-bedrock): avoid forced structured-output tools for incompatible Claude models
8
+ - Updated dependencies [594787e]
9
+ - @ai-sdk/provider@2.0.5
10
+ - @ai-sdk/provider-utils@3.0.38
11
+
12
+ ## 2.0.103
13
+
14
+ ### Patch Changes
15
+
16
+ - 79c34cc: feat(anthropic): add Claude Opus 5.5 support
17
+
18
+ - add the `claude-opus-5-5` model ID to `@ai-sdk/anthropic` and `anthropic/claude-opus-5.5` to `@ai-sdk/gateway`
19
+ - models that always use adaptive thinking (`claude-opus-5-5`, `claude-fable-5`, `claude-fable-5-1`) no longer receive `thinking: { type: 'disabled' }` or budget-based thinking; the provider drops the unsupported setting and emits a warning
20
+ - models that reject forced tool use (`claude-opus-5-5`, `claude-fable-5-1`) fall back to `auto` tool choice for `required` and named tool choices, and to native structured outputs when `structuredOutputMode: 'jsonTool'` is requested, each with a warning
21
+ - add the `computerToolset_20260801` computer use tool (`computer_toolset_20260801`), which is required for computer use on `claude-opus-5-5`
22
+ - use the documented `mid-conversation-output-config-2026-07-01` beta header for per-message effort
23
+
3
24
  ## 2.0.102
4
25
 
5
26
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -169,7 +169,7 @@ interface AnthropicMessageMetadata {
169
169
  } | null;
170
170
  }
171
171
 
172
- type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | (string & {});
172
+ type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | (string & {});
173
173
  /**
174
174
  * Anthropic provider options for system messages.
175
175
  */
@@ -307,6 +307,14 @@ declare const anthropicProviderOptions: z.ZodObject<{
307
307
  }, z.core.$strip>;
308
308
  type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
309
309
 
310
+ /**
311
+ * Member tools of the computer toolset. Each member is returned by the API as
312
+ * its own `tool_use` block; the AI SDK exposes it as the `action` of a single
313
+ * computer tool call.
314
+ */
315
+ declare const computerToolset_20260801Members: readonly ["screenshot", "zoom", "left_click", "right_click", "middle_click", "double_click", "triple_click", "left_click_drag", "mouse_move", "left_mouse_down", "left_mouse_up", "cursor_position", "scroll", "type", "key", "hold_key", "wait"];
316
+ type ComputerToolset_20260801Member = (typeof computerToolset_20260801Members)[number];
317
+
310
318
  declare const anthropicTools: {
311
319
  /**
312
320
  * The bash tool enables Claude to execute shell commands in a persistent bash session,
@@ -653,6 +661,46 @@ declare const anthropicTools: {
653
661
  displayHeightPx: number;
654
662
  displayNumber?: number;
655
663
  }>;
664
+ /**
665
+ * The computer toolset lets Claude control a computer through screenshots,
666
+ * mouse, and keyboard. It replaces the versioned computer tools
667
+ * (`computer_20250124` and earlier) on newer models.
668
+ *
669
+ * The API returns each computer action as its own `tool_use` block with
670
+ * `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
671
+ * and exposes the member name as `action`, so `execute` receives the same
672
+ * input shape as the older computer tools. Claude may return several actions
673
+ * in one turn.
674
+ *
675
+ * Coordinates are always in the pixel space of the screenshots you return;
676
+ * there are no display size parameters. Zoom is enabled by default.
677
+ *
678
+ * Does not require a beta header.
679
+ *
680
+ * Tool name must be `computer`.
681
+ *
682
+ * Supported models: Claude Opus 5.5 (required; older computer tool types
683
+ * are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
684
+ *
685
+ * @param configs - Per-member settings keyed by member name, e.g.
686
+ * `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
687
+ */
688
+ computerToolset_20260801: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
689
+ action: ComputerToolset_20260801Member;
690
+ coordinate?: [number, number];
691
+ duration?: number;
692
+ region?: [number, number, number, number];
693
+ repeat?: number;
694
+ scroll_amount?: number;
695
+ scroll_direction?: "up" | "down" | "left" | "right";
696
+ start_coordinate?: [number, number];
697
+ text?: string;
698
+ }, {
699
+ configs?: Partial<Record<ComputerToolset_20260801Member, {
700
+ enabled?: boolean;
701
+ deferLoading?: boolean;
702
+ }>>;
703
+ }>;
656
704
  /**
657
705
  * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
658
706
  * Claude can create, read, update, and delete files that persist between sessions,
package/dist/index.d.ts CHANGED
@@ -169,7 +169,7 @@ interface AnthropicMessageMetadata {
169
169
  } | null;
170
170
  }
171
171
 
172
- type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | (string & {});
172
+ type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-sonnet-5' | (string & {});
173
173
  /**
174
174
  * Anthropic provider options for system messages.
175
175
  */
@@ -307,6 +307,14 @@ declare const anthropicProviderOptions: z.ZodObject<{
307
307
  }, z.core.$strip>;
308
308
  type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
309
309
 
310
+ /**
311
+ * Member tools of the computer toolset. Each member is returned by the API as
312
+ * its own `tool_use` block; the AI SDK exposes it as the `action` of a single
313
+ * computer tool call.
314
+ */
315
+ declare const computerToolset_20260801Members: readonly ["screenshot", "zoom", "left_click", "right_click", "middle_click", "double_click", "triple_click", "left_click_drag", "mouse_move", "left_mouse_down", "left_mouse_up", "cursor_position", "scroll", "type", "key", "hold_key", "wait"];
316
+ type ComputerToolset_20260801Member = (typeof computerToolset_20260801Members)[number];
317
+
310
318
  declare const anthropicTools: {
311
319
  /**
312
320
  * The bash tool enables Claude to execute shell commands in a persistent bash session,
@@ -653,6 +661,46 @@ declare const anthropicTools: {
653
661
  displayHeightPx: number;
654
662
  displayNumber?: number;
655
663
  }>;
664
+ /**
665
+ * The computer toolset lets Claude control a computer through screenshots,
666
+ * mouse, and keyboard. It replaces the versioned computer tools
667
+ * (`computer_20250124` and earlier) on newer models.
668
+ *
669
+ * The API returns each computer action as its own `tool_use` block with
670
+ * `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
671
+ * and exposes the member name as `action`, so `execute` receives the same
672
+ * input shape as the older computer tools. Claude may return several actions
673
+ * in one turn.
674
+ *
675
+ * Coordinates are always in the pixel space of the screenshots you return;
676
+ * there are no display size parameters. Zoom is enabled by default.
677
+ *
678
+ * Does not require a beta header.
679
+ *
680
+ * Tool name must be `computer`.
681
+ *
682
+ * Supported models: Claude Opus 5.5 (required; older computer tool types
683
+ * are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
684
+ *
685
+ * @param configs - Per-member settings keyed by member name, e.g.
686
+ * `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
687
+ */
688
+ computerToolset_20260801: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
689
+ action: ComputerToolset_20260801Member;
690
+ coordinate?: [number, number];
691
+ duration?: number;
692
+ region?: [number, number, number, number];
693
+ repeat?: number;
694
+ scroll_amount?: number;
695
+ scroll_direction?: "up" | "down" | "left" | "right";
696
+ start_coordinate?: [number, number];
697
+ text?: string;
698
+ }, {
699
+ configs?: Partial<Record<ComputerToolset_20260801Member, {
700
+ enabled?: boolean;
701
+ deferLoading?: boolean;
702
+ }>>;
703
+ }>;
656
704
  /**
657
705
  * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
658
706
  * Claude can create, read, update, and delete files that persist between sessions,