@ai-sdk/anthropic 4.0.0-beta.19 → 4.0.0-beta.21

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.
@@ -13,7 +13,8 @@ import {
13
13
  mapReasoningToProviderEffort,
14
14
  parseProviderOptions as parseProviderOptions2,
15
15
  postJsonToApi,
16
- resolve
16
+ resolve,
17
+ resolveProviderReference as resolveProviderReference2
17
18
  } from "@ai-sdk/provider-utils";
18
19
 
19
20
  // src/anthropic-error.ts
@@ -888,11 +889,18 @@ var anthropicLanguageModelOptions = z3.object({
888
889
  container: z3.object({
889
890
  id: z3.string().optional(),
890
891
  skills: z3.array(
891
- z3.object({
892
- type: z3.union([z3.literal("anthropic"), z3.literal("custom")]),
893
- skillId: z3.string(),
894
- version: z3.string().optional()
895
- })
892
+ z3.discriminatedUnion("type", [
893
+ z3.object({
894
+ type: z3.literal("anthropic"),
895
+ skillId: z3.string(),
896
+ version: z3.string().optional()
897
+ }),
898
+ z3.object({
899
+ type: z3.literal("custom"),
900
+ providerReference: z3.record(z3.string(), z3.string()),
901
+ version: z3.string().optional()
902
+ })
903
+ ])
896
904
  ).optional()
897
905
  }).optional(),
898
906
  /**
@@ -3116,7 +3124,10 @@ var AnthropicMessagesLanguageModel = class {
3116
3124
  id: anthropicOptions.container.id,
3117
3125
  skills: anthropicOptions.container.skills.map((skill) => ({
3118
3126
  type: skill.type,
3119
- skill_id: skill.skillId,
3127
+ skill_id: skill.type === "custom" ? resolveProviderReference2({
3128
+ reference: skill.providerReference,
3129
+ provider: "anthropic"
3130
+ }) : skill.skillId,
3120
3131
  version: skill.version
3121
3132
  }))
3122
3133
  }