@ai-sdk/anthropic 3.0.0-beta.29 → 3.0.0-beta.30

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,11 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.0-beta.30
4
+
5
+ ### Patch Changes
6
+
7
+ - 9354297: feat(provider/anthropic): add support for Agent Skills
8
+
3
9
  ## 3.0.0-beta.29
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -6,7 +6,7 @@ The **[Anthropic provider](https://ai-sdk.dev/providers/ai-sdk-providers/anthrop
6
6
 
7
7
  The Anthropic provider is available in the `@ai-sdk/anthropic` module. You can install it with
8
8
 
9
- ```
9
+ ```bash
10
10
  npm i @ai-sdk/anthropic
11
11
  ```
12
12
 
package/dist/index.d.mts CHANGED
@@ -25,6 +25,14 @@ declare const anthropicProviderOptions: z.ZodObject<{
25
25
  allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
26
26
  }, z.core.$strip>>>;
27
27
  }, z.core.$strip>>>;
28
+ container: z.ZodOptional<z.ZodObject<{
29
+ id: z.ZodOptional<z.ZodString>;
30
+ skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
31
+ type: z.ZodUnion<readonly [z.ZodLiteral<"anthropic">, z.ZodLiteral<"custom">]>;
32
+ skillId: z.ZodString;
33
+ version: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strip>>>;
35
+ }, z.core.$strip>>;
28
36
  }, z.core.$strip>;
29
37
  type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
30
38
 
package/dist/index.d.ts CHANGED
@@ -25,6 +25,14 @@ declare const anthropicProviderOptions: z.ZodObject<{
25
25
  allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
26
26
  }, z.core.$strip>>>;
27
27
  }, z.core.$strip>>>;
28
+ container: z.ZodOptional<z.ZodObject<{
29
+ id: z.ZodOptional<z.ZodString>;
30
+ skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
31
+ type: z.ZodUnion<readonly [z.ZodLiteral<"anthropic">, z.ZodLiteral<"custom">]>;
32
+ skillId: z.ZodString;
33
+ version: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strip>>>;
35
+ }, z.core.$strip>>;
28
36
  }, z.core.$strip>;
29
37
  type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
30
38
 
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
31
31
  var import_provider_utils20 = require("@ai-sdk/provider-utils");
32
32
 
33
33
  // src/version.ts
34
- var VERSION = true ? "3.0.0-beta.29" : "0.0.0-test";
34
+ var VERSION = true ? "3.0.0-beta.30" : "0.0.0-test";
35
35
 
36
36
  // src/anthropic-messages-language-model.ts
37
37
  var import_provider3 = require("@ai-sdk/provider");
@@ -591,7 +591,22 @@ var anthropicProviderOptions = import_v43.z.object({
591
591
  allowedTools: import_v43.z.array(import_v43.z.string()).nullish()
592
592
  }).nullish()
593
593
  })
594
- ).optional()
594
+ ).optional(),
595
+ /**
596
+ * Agent Skills configuration. Skills enable Claude to perform specialized tasks
597
+ * like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.
598
+ * Requires code execution tool to be enabled.
599
+ */
600
+ container: import_v43.z.object({
601
+ id: import_v43.z.string().optional(),
602
+ skills: import_v43.z.array(
603
+ import_v43.z.object({
604
+ type: import_v43.z.union([import_v43.z.literal("anthropic"), import_v43.z.literal("custom")]),
605
+ skillId: import_v43.z.string(),
606
+ version: import_v43.z.string().optional()
607
+ })
608
+ ).optional()
609
+ }).optional()
595
610
  });
596
611
 
597
612
  // src/anthropic-prepare-tools.ts
@@ -1748,7 +1763,7 @@ var AnthropicMessagesLanguageModel = class {
1748
1763
  toolChoice,
1749
1764
  providerOptions
1750
1765
  }) {
1751
- var _a, _b, _c;
1766
+ var _a, _b, _c, _d;
1752
1767
  const warnings = [];
1753
1768
  if (frequencyPenalty != null) {
1754
1769
  warnings.push({
@@ -1829,6 +1844,17 @@ var AnthropicMessagesLanguageModel = class {
1829
1844
  } : void 0
1830
1845
  }))
1831
1846
  },
1847
+ // container with agent skills:
1848
+ ...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {
1849
+ container: {
1850
+ id: anthropicOptions.container.id,
1851
+ skills: (_d = anthropicOptions.container.skills) == null ? void 0 : _d.map((skill) => ({
1852
+ type: skill.type,
1853
+ skill_id: skill.skillId,
1854
+ version: skill.version
1855
+ }))
1856
+ }
1857
+ },
1832
1858
  // prompt:
1833
1859
  system: messagesPrompt.system,
1834
1860
  messages: messagesPrompt.messages
@@ -1878,6 +1904,19 @@ var AnthropicMessagesLanguageModel = class {
1878
1904
  if ((anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0) {
1879
1905
  betas.add("mcp-client-2025-04-04");
1880
1906
  }
1907
+ if ((anthropicOptions == null ? void 0 : anthropicOptions.container) && anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0) {
1908
+ betas.add("code-execution-2025-08-25");
1909
+ betas.add("skills-2025-10-02");
1910
+ betas.add("files-api-2025-04-14");
1911
+ if (!(tools == null ? void 0 : tools.some(
1912
+ (tool) => tool.type === "provider-defined" && tool.id === "anthropic.code_execution_20250825"
1913
+ ))) {
1914
+ warnings.push({
1915
+ type: "other",
1916
+ message: "code execution tool is required when using skills"
1917
+ });
1918
+ }
1919
+ }
1881
1920
  const {
1882
1921
  tools: anthropicTools2,
1883
1922
  toolChoice: anthropicToolChoice,