@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.
@@ -570,7 +570,22 @@ var anthropicProviderOptions = z3.object({
570
570
  allowedTools: z3.array(z3.string()).nullish()
571
571
  }).nullish()
572
572
  })
573
- ).optional()
573
+ ).optional(),
574
+ /**
575
+ * Agent Skills configuration. Skills enable Claude to perform specialized tasks
576
+ * like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.
577
+ * Requires code execution tool to be enabled.
578
+ */
579
+ container: z3.object({
580
+ id: z3.string().optional(),
581
+ skills: z3.array(
582
+ z3.object({
583
+ type: z3.union([z3.literal("anthropic"), z3.literal("custom")]),
584
+ skillId: z3.string(),
585
+ version: z3.string().optional()
586
+ })
587
+ ).optional()
588
+ }).optional()
574
589
  });
575
590
 
576
591
  // src/anthropic-prepare-tools.ts
@@ -1752,7 +1767,7 @@ var AnthropicMessagesLanguageModel = class {
1752
1767
  toolChoice,
1753
1768
  providerOptions
1754
1769
  }) {
1755
- var _a, _b, _c;
1770
+ var _a, _b, _c, _d;
1756
1771
  const warnings = [];
1757
1772
  if (frequencyPenalty != null) {
1758
1773
  warnings.push({
@@ -1833,6 +1848,17 @@ var AnthropicMessagesLanguageModel = class {
1833
1848
  } : void 0
1834
1849
  }))
1835
1850
  },
1851
+ // container with agent skills:
1852
+ ...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {
1853
+ container: {
1854
+ id: anthropicOptions.container.id,
1855
+ skills: (_d = anthropicOptions.container.skills) == null ? void 0 : _d.map((skill) => ({
1856
+ type: skill.type,
1857
+ skill_id: skill.skillId,
1858
+ version: skill.version
1859
+ }))
1860
+ }
1861
+ },
1836
1862
  // prompt:
1837
1863
  system: messagesPrompt.system,
1838
1864
  messages: messagesPrompt.messages
@@ -1882,6 +1908,19 @@ var AnthropicMessagesLanguageModel = class {
1882
1908
  if ((anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0) {
1883
1909
  betas.add("mcp-client-2025-04-04");
1884
1910
  }
1911
+ if ((anthropicOptions == null ? void 0 : anthropicOptions.container) && anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0) {
1912
+ betas.add("code-execution-2025-08-25");
1913
+ betas.add("skills-2025-10-02");
1914
+ betas.add("files-api-2025-04-14");
1915
+ if (!(tools == null ? void 0 : tools.some(
1916
+ (tool) => tool.type === "provider-defined" && tool.id === "anthropic.code_execution_20250825"
1917
+ ))) {
1918
+ warnings.push({
1919
+ type: "other",
1920
+ message: "code execution tool is required when using skills"
1921
+ });
1922
+ }
1923
+ }
1885
1924
  const {
1886
1925
  tools: anthropicTools2,
1887
1926
  toolChoice: anthropicToolChoice,