@ai-sdk/anthropic 3.0.32 → 3.0.33

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.32",
3
+ "version": "3.0.33",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -1142,24 +1142,6 @@ export const anthropicMessagesChunkSchema = lazySchema(() =>
1142
1142
  .nullish(),
1143
1143
  })
1144
1144
  .nullish(),
1145
- context_management: z
1146
- .object({
1147
- applied_edits: z.array(
1148
- z.union([
1149
- z.object({
1150
- type: z.literal('clear_tool_uses_20250919'),
1151
- cleared_tool_uses: z.number(),
1152
- cleared_input_tokens: z.number(),
1153
- }),
1154
- z.object({
1155
- type: z.literal('clear_thinking_20251015'),
1156
- cleared_thinking_turns: z.number(),
1157
- cleared_input_tokens: z.number(),
1158
- }),
1159
- ]),
1160
- ),
1161
- })
1162
- .nullish(),
1163
1145
  }),
1164
1146
  usage: z.looseObject({
1165
1147
  input_tokens: z.number().nullish(),
@@ -1167,6 +1149,24 @@ export const anthropicMessagesChunkSchema = lazySchema(() =>
1167
1149
  cache_creation_input_tokens: z.number().nullish(),
1168
1150
  cache_read_input_tokens: z.number().nullish(),
1169
1151
  }),
1152
+ context_management: z
1153
+ .object({
1154
+ applied_edits: z.array(
1155
+ z.union([
1156
+ z.object({
1157
+ type: z.literal('clear_tool_uses_20250919'),
1158
+ cleared_tool_uses: z.number(),
1159
+ cleared_input_tokens: z.number(),
1160
+ }),
1161
+ z.object({
1162
+ type: z.literal('clear_thinking_20251015'),
1163
+ cleared_thinking_turns: z.number(),
1164
+ cleared_input_tokens: z.number(),
1165
+ }),
1166
+ ]),
1167
+ ),
1168
+ })
1169
+ .nullish(),
1170
1170
  }),
1171
1171
  z.object({
1172
1172
  type: z.literal('message_stop'),
@@ -1981,9 +1981,9 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
1981
1981
  }
1982
1982
  : null;
1983
1983
 
1984
- if (value.delta.context_management) {
1984
+ if (value.context_management) {
1985
1985
  contextManagement = mapAnthropicResponseContextManagement(
1986
- value.delta.context_management,
1986
+ value.context_management,
1987
1987
  );
1988
1988
  }
1989
1989