@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/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "@ai-sdk/provider-utils";
|
|
11
11
|
|
|
12
12
|
// src/version.ts
|
|
13
|
-
var VERSION = true ? "2.0.
|
|
13
|
+
var VERSION = true ? "2.0.30" : "0.0.0-test";
|
|
14
14
|
|
|
15
15
|
// src/anthropic-messages-language-model.ts
|
|
16
16
|
import {
|
|
@@ -817,6 +817,14 @@ async function prepareTools({
|
|
|
817
817
|
});
|
|
818
818
|
break;
|
|
819
819
|
}
|
|
820
|
+
case "anthropic.memory_20250818": {
|
|
821
|
+
betas.add("context-management-2025-06-27");
|
|
822
|
+
anthropicTools2.push({
|
|
823
|
+
name: "memory",
|
|
824
|
+
type: "memory_20250818"
|
|
825
|
+
});
|
|
826
|
+
break;
|
|
827
|
+
}
|
|
820
828
|
case "anthropic.web_fetch_20250910": {
|
|
821
829
|
betas.add("web-fetch-2025-09-10");
|
|
822
830
|
const args = await validateTypes({
|
|
@@ -2658,40 +2666,64 @@ var computer_20250124 = createProviderDefinedToolFactory5({
|
|
|
2658
2666
|
inputSchema: computer_20250124InputSchema
|
|
2659
2667
|
});
|
|
2660
2668
|
|
|
2661
|
-
// src/tool/
|
|
2669
|
+
// src/tool/memory_20250818.ts
|
|
2662
2670
|
import {
|
|
2663
2671
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
|
|
2664
2672
|
lazySchema as lazySchema12,
|
|
2665
2673
|
zodSchema as zodSchema12
|
|
2666
2674
|
} from "@ai-sdk/provider-utils";
|
|
2667
2675
|
import { z as z13 } from "zod/v4";
|
|
2668
|
-
var
|
|
2676
|
+
var memory_20250818InputSchema = lazySchema12(
|
|
2669
2677
|
() => zodSchema12(
|
|
2670
|
-
z13.
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2678
|
+
z13.discriminatedUnion("command", [
|
|
2679
|
+
z13.object({
|
|
2680
|
+
command: z13.literal("view"),
|
|
2681
|
+
path: z13.string(),
|
|
2682
|
+
view_range: z13.tuple([z13.number(), z13.number()]).optional()
|
|
2683
|
+
}),
|
|
2684
|
+
z13.object({
|
|
2685
|
+
command: z13.literal("create"),
|
|
2686
|
+
path: z13.string(),
|
|
2687
|
+
file_text: z13.string()
|
|
2688
|
+
}),
|
|
2689
|
+
z13.object({
|
|
2690
|
+
command: z13.literal("str_replace"),
|
|
2691
|
+
path: z13.string(),
|
|
2692
|
+
old_str: z13.string(),
|
|
2693
|
+
new_str: z13.string()
|
|
2694
|
+
}),
|
|
2695
|
+
z13.object({
|
|
2696
|
+
command: z13.literal("insert"),
|
|
2697
|
+
path: z13.string(),
|
|
2698
|
+
insert_line: z13.number(),
|
|
2699
|
+
insert_text: z13.string()
|
|
2700
|
+
}),
|
|
2701
|
+
z13.object({
|
|
2702
|
+
command: z13.literal("delete"),
|
|
2703
|
+
path: z13.string()
|
|
2704
|
+
}),
|
|
2705
|
+
z13.object({
|
|
2706
|
+
command: z13.literal("rename"),
|
|
2707
|
+
old_path: z13.string(),
|
|
2708
|
+
new_path: z13.string()
|
|
2709
|
+
})
|
|
2710
|
+
])
|
|
2679
2711
|
)
|
|
2680
2712
|
);
|
|
2681
|
-
var
|
|
2682
|
-
id: "anthropic.
|
|
2683
|
-
name: "
|
|
2684
|
-
inputSchema:
|
|
2713
|
+
var memory_20250818 = createProviderDefinedToolFactory6({
|
|
2714
|
+
id: "anthropic.memory_20250818",
|
|
2715
|
+
name: "memory",
|
|
2716
|
+
inputSchema: memory_20250818InputSchema
|
|
2685
2717
|
});
|
|
2686
2718
|
|
|
2687
|
-
// src/tool/text-
|
|
2719
|
+
// src/tool/text-editor_20241022.ts
|
|
2688
2720
|
import {
|
|
2689
2721
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
|
|
2690
2722
|
lazySchema as lazySchema13,
|
|
2691
2723
|
zodSchema as zodSchema13
|
|
2692
2724
|
} from "@ai-sdk/provider-utils";
|
|
2693
2725
|
import { z as z14 } from "zod/v4";
|
|
2694
|
-
var
|
|
2726
|
+
var textEditor_20241022InputSchema = lazySchema13(
|
|
2695
2727
|
() => zodSchema13(
|
|
2696
2728
|
z14.object({
|
|
2697
2729
|
command: z14.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -2704,23 +2736,23 @@ var textEditor_20250124InputSchema = lazySchema13(
|
|
|
2704
2736
|
})
|
|
2705
2737
|
)
|
|
2706
2738
|
);
|
|
2707
|
-
var
|
|
2708
|
-
id: "anthropic.
|
|
2739
|
+
var textEditor_20241022 = createProviderDefinedToolFactory7({
|
|
2740
|
+
id: "anthropic.text_editor_20241022",
|
|
2709
2741
|
name: "str_replace_editor",
|
|
2710
|
-
inputSchema:
|
|
2742
|
+
inputSchema: textEditor_20241022InputSchema
|
|
2711
2743
|
});
|
|
2712
2744
|
|
|
2713
|
-
// src/tool/text-
|
|
2745
|
+
// src/tool/text-editor_20250124.ts
|
|
2714
2746
|
import {
|
|
2715
2747
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
2716
2748
|
lazySchema as lazySchema14,
|
|
2717
2749
|
zodSchema as zodSchema14
|
|
2718
2750
|
} from "@ai-sdk/provider-utils";
|
|
2719
2751
|
import { z as z15 } from "zod/v4";
|
|
2720
|
-
var
|
|
2752
|
+
var textEditor_20250124InputSchema = lazySchema14(
|
|
2721
2753
|
() => zodSchema14(
|
|
2722
2754
|
z15.object({
|
|
2723
|
-
command: z15.enum(["view", "create", "str_replace", "insert"]),
|
|
2755
|
+
command: z15.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
2724
2756
|
path: z15.string(),
|
|
2725
2757
|
file_text: z15.string().optional(),
|
|
2726
2758
|
insert_line: z15.number().int().optional(),
|
|
@@ -2730,7 +2762,33 @@ var textEditor_20250429InputSchema = lazySchema14(
|
|
|
2730
2762
|
})
|
|
2731
2763
|
)
|
|
2732
2764
|
);
|
|
2733
|
-
var
|
|
2765
|
+
var textEditor_20250124 = createProviderDefinedToolFactory8({
|
|
2766
|
+
id: "anthropic.text_editor_20250124",
|
|
2767
|
+
name: "str_replace_editor",
|
|
2768
|
+
inputSchema: textEditor_20250124InputSchema
|
|
2769
|
+
});
|
|
2770
|
+
|
|
2771
|
+
// src/tool/text-editor_20250429.ts
|
|
2772
|
+
import {
|
|
2773
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
|
|
2774
|
+
lazySchema as lazySchema15,
|
|
2775
|
+
zodSchema as zodSchema15
|
|
2776
|
+
} from "@ai-sdk/provider-utils";
|
|
2777
|
+
import { z as z16 } from "zod/v4";
|
|
2778
|
+
var textEditor_20250429InputSchema = lazySchema15(
|
|
2779
|
+
() => zodSchema15(
|
|
2780
|
+
z16.object({
|
|
2781
|
+
command: z16.enum(["view", "create", "str_replace", "insert"]),
|
|
2782
|
+
path: z16.string(),
|
|
2783
|
+
file_text: z16.string().optional(),
|
|
2784
|
+
insert_line: z16.number().int().optional(),
|
|
2785
|
+
new_str: z16.string().optional(),
|
|
2786
|
+
old_str: z16.string().optional(),
|
|
2787
|
+
view_range: z16.array(z16.number().int()).optional()
|
|
2788
|
+
})
|
|
2789
|
+
)
|
|
2790
|
+
);
|
|
2791
|
+
var textEditor_20250429 = createProviderDefinedToolFactory9({
|
|
2734
2792
|
id: "anthropic.text_editor_20250429",
|
|
2735
2793
|
name: "str_replace_based_edit_tool",
|
|
2736
2794
|
inputSchema: textEditor_20250429InputSchema
|
|
@@ -2806,6 +2864,17 @@ var anthropicTools = {
|
|
|
2806
2864
|
* @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.
|
|
2807
2865
|
*/
|
|
2808
2866
|
computer_20250124,
|
|
2867
|
+
/**
|
|
2868
|
+
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
2869
|
+
* Claude can create, read, update, and delete files that persist between sessions,
|
|
2870
|
+
* allowing it to build knowledge over time without keeping everything in the context window.
|
|
2871
|
+
* The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
|
|
2872
|
+
*
|
|
2873
|
+
* Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
|
|
2874
|
+
*
|
|
2875
|
+
* Tool name must be `memory`.
|
|
2876
|
+
*/
|
|
2877
|
+
memory_20250818,
|
|
2809
2878
|
/**
|
|
2810
2879
|
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
2811
2880
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|