@ai-sdk/anthropic 2.0.28 → 2.0.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 +12 -0
- package/dist/index.d.mts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.js +95 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -25
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +40 -1
- package/dist/internal/index.d.ts +40 -1
- package/dist/internal/index.js +89 -24
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +93 -24
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -803,6 +803,14 @@ async function prepareTools({
|
|
|
803
803
|
});
|
|
804
804
|
break;
|
|
805
805
|
}
|
|
806
|
+
case "anthropic.memory_20250818": {
|
|
807
|
+
betas.add("context-management-2025-06-27");
|
|
808
|
+
anthropicTools2.push({
|
|
809
|
+
name: "memory",
|
|
810
|
+
type: "memory_20250818"
|
|
811
|
+
});
|
|
812
|
+
break;
|
|
813
|
+
}
|
|
806
814
|
case "anthropic.web_fetch_20250910": {
|
|
807
815
|
betas.add("web-fetch-2025-09-10");
|
|
808
816
|
const args = await validateTypes({
|
|
@@ -2644,40 +2652,64 @@ var computer_20250124 = createProviderDefinedToolFactory5({
|
|
|
2644
2652
|
inputSchema: computer_20250124InputSchema
|
|
2645
2653
|
});
|
|
2646
2654
|
|
|
2647
|
-
// src/tool/
|
|
2655
|
+
// src/tool/memory_20250818.ts
|
|
2648
2656
|
import {
|
|
2649
2657
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
|
|
2650
2658
|
lazySchema as lazySchema12,
|
|
2651
2659
|
zodSchema as zodSchema12
|
|
2652
2660
|
} from "@ai-sdk/provider-utils";
|
|
2653
2661
|
import { z as z13 } from "zod/v4";
|
|
2654
|
-
var
|
|
2662
|
+
var memory_20250818InputSchema = lazySchema12(
|
|
2655
2663
|
() => zodSchema12(
|
|
2656
|
-
z13.
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2664
|
+
z13.discriminatedUnion("command", [
|
|
2665
|
+
z13.object({
|
|
2666
|
+
command: z13.literal("view"),
|
|
2667
|
+
path: z13.string(),
|
|
2668
|
+
view_range: z13.tuple([z13.number(), z13.number()]).optional()
|
|
2669
|
+
}),
|
|
2670
|
+
z13.object({
|
|
2671
|
+
command: z13.literal("create"),
|
|
2672
|
+
path: z13.string(),
|
|
2673
|
+
file_text: z13.string()
|
|
2674
|
+
}),
|
|
2675
|
+
z13.object({
|
|
2676
|
+
command: z13.literal("str_replace"),
|
|
2677
|
+
path: z13.string(),
|
|
2678
|
+
old_str: z13.string(),
|
|
2679
|
+
new_str: z13.string()
|
|
2680
|
+
}),
|
|
2681
|
+
z13.object({
|
|
2682
|
+
command: z13.literal("insert"),
|
|
2683
|
+
path: z13.string(),
|
|
2684
|
+
insert_line: z13.number(),
|
|
2685
|
+
insert_text: z13.string()
|
|
2686
|
+
}),
|
|
2687
|
+
z13.object({
|
|
2688
|
+
command: z13.literal("delete"),
|
|
2689
|
+
path: z13.string()
|
|
2690
|
+
}),
|
|
2691
|
+
z13.object({
|
|
2692
|
+
command: z13.literal("rename"),
|
|
2693
|
+
old_path: z13.string(),
|
|
2694
|
+
new_path: z13.string()
|
|
2695
|
+
})
|
|
2696
|
+
])
|
|
2665
2697
|
)
|
|
2666
2698
|
);
|
|
2667
|
-
var
|
|
2668
|
-
id: "anthropic.
|
|
2669
|
-
name: "
|
|
2670
|
-
inputSchema:
|
|
2699
|
+
var memory_20250818 = createProviderDefinedToolFactory6({
|
|
2700
|
+
id: "anthropic.memory_20250818",
|
|
2701
|
+
name: "memory",
|
|
2702
|
+
inputSchema: memory_20250818InputSchema
|
|
2671
2703
|
});
|
|
2672
2704
|
|
|
2673
|
-
// src/tool/text-
|
|
2705
|
+
// src/tool/text-editor_20241022.ts
|
|
2674
2706
|
import {
|
|
2675
2707
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
|
|
2676
2708
|
lazySchema as lazySchema13,
|
|
2677
2709
|
zodSchema as zodSchema13
|
|
2678
2710
|
} from "@ai-sdk/provider-utils";
|
|
2679
2711
|
import { z as z14 } from "zod/v4";
|
|
2680
|
-
var
|
|
2712
|
+
var textEditor_20241022InputSchema = lazySchema13(
|
|
2681
2713
|
() => zodSchema13(
|
|
2682
2714
|
z14.object({
|
|
2683
2715
|
command: z14.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -2690,23 +2722,23 @@ var textEditor_20250124InputSchema = lazySchema13(
|
|
|
2690
2722
|
})
|
|
2691
2723
|
)
|
|
2692
2724
|
);
|
|
2693
|
-
var
|
|
2694
|
-
id: "anthropic.
|
|
2725
|
+
var textEditor_20241022 = createProviderDefinedToolFactory7({
|
|
2726
|
+
id: "anthropic.text_editor_20241022",
|
|
2695
2727
|
name: "str_replace_editor",
|
|
2696
|
-
inputSchema:
|
|
2728
|
+
inputSchema: textEditor_20241022InputSchema
|
|
2697
2729
|
});
|
|
2698
2730
|
|
|
2699
|
-
// src/tool/text-
|
|
2731
|
+
// src/tool/text-editor_20250124.ts
|
|
2700
2732
|
import {
|
|
2701
2733
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
2702
2734
|
lazySchema as lazySchema14,
|
|
2703
2735
|
zodSchema as zodSchema14
|
|
2704
2736
|
} from "@ai-sdk/provider-utils";
|
|
2705
2737
|
import { z as z15 } from "zod/v4";
|
|
2706
|
-
var
|
|
2738
|
+
var textEditor_20250124InputSchema = lazySchema14(
|
|
2707
2739
|
() => zodSchema14(
|
|
2708
2740
|
z15.object({
|
|
2709
|
-
command: z15.enum(["view", "create", "str_replace", "insert"]),
|
|
2741
|
+
command: z15.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
2710
2742
|
path: z15.string(),
|
|
2711
2743
|
file_text: z15.string().optional(),
|
|
2712
2744
|
insert_line: z15.number().int().optional(),
|
|
@@ -2716,7 +2748,33 @@ var textEditor_20250429InputSchema = lazySchema14(
|
|
|
2716
2748
|
})
|
|
2717
2749
|
)
|
|
2718
2750
|
);
|
|
2719
|
-
var
|
|
2751
|
+
var textEditor_20250124 = createProviderDefinedToolFactory8({
|
|
2752
|
+
id: "anthropic.text_editor_20250124",
|
|
2753
|
+
name: "str_replace_editor",
|
|
2754
|
+
inputSchema: textEditor_20250124InputSchema
|
|
2755
|
+
});
|
|
2756
|
+
|
|
2757
|
+
// src/tool/text-editor_20250429.ts
|
|
2758
|
+
import {
|
|
2759
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
|
|
2760
|
+
lazySchema as lazySchema15,
|
|
2761
|
+
zodSchema as zodSchema15
|
|
2762
|
+
} from "@ai-sdk/provider-utils";
|
|
2763
|
+
import { z as z16 } from "zod/v4";
|
|
2764
|
+
var textEditor_20250429InputSchema = lazySchema15(
|
|
2765
|
+
() => zodSchema15(
|
|
2766
|
+
z16.object({
|
|
2767
|
+
command: z16.enum(["view", "create", "str_replace", "insert"]),
|
|
2768
|
+
path: z16.string(),
|
|
2769
|
+
file_text: z16.string().optional(),
|
|
2770
|
+
insert_line: z16.number().int().optional(),
|
|
2771
|
+
new_str: z16.string().optional(),
|
|
2772
|
+
old_str: z16.string().optional(),
|
|
2773
|
+
view_range: z16.array(z16.number().int()).optional()
|
|
2774
|
+
})
|
|
2775
|
+
)
|
|
2776
|
+
);
|
|
2777
|
+
var textEditor_20250429 = createProviderDefinedToolFactory9({
|
|
2720
2778
|
id: "anthropic.text_editor_20250429",
|
|
2721
2779
|
name: "str_replace_based_edit_tool",
|
|
2722
2780
|
inputSchema: textEditor_20250429InputSchema
|
|
@@ -2792,6 +2850,17 @@ var anthropicTools = {
|
|
|
2792
2850
|
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
2793
2851
|
*/
|
|
2794
2852
|
computer_20250124,
|
|
2853
|
+
/**
|
|
2854
|
+
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
2855
|
+
* Claude can create, read, update, and delete files that persist between sessions,
|
|
2856
|
+
* allowing it to build knowledge over time without keeping everything in the context window.
|
|
2857
|
+
* The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
|
|
2858
|
+
*
|
|
2859
|
+
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
2860
|
+
*
|
|
2861
|
+
* Tool name must be `memory`.
|
|
2862
|
+
*/
|
|
2863
|
+
memory_20250818,
|
|
2795
2864
|
/**
|
|
2796
2865
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2797
2866
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|