@ai-sdk/anthropic 3.0.0-beta.14 → 3.0.0-beta.15
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 +9 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +356 -356
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -13
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +355 -355
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +12 -12
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -41,21 +41,21 @@ var import_provider4 = require("@ai-sdk/provider");
|
|
|
41
41
|
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
42
42
|
|
|
43
43
|
// src/version.ts
|
|
44
|
-
var VERSION = true ? "3.0.0-beta.
|
|
44
|
+
var VERSION = true ? "3.0.0-beta.15" : "0.0.0-test";
|
|
45
45
|
|
|
46
46
|
// src/anthropic-messages-language-model.ts
|
|
47
47
|
var import_provider3 = require("@ai-sdk/provider");
|
|
48
48
|
var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
49
|
-
var
|
|
49
|
+
var z7 = __toESM(require("zod/v4"));
|
|
50
50
|
|
|
51
51
|
// src/anthropic-error.ts
|
|
52
52
|
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
53
|
-
var
|
|
54
|
-
var anthropicErrorDataSchema =
|
|
55
|
-
type:
|
|
56
|
-
error:
|
|
57
|
-
type:
|
|
58
|
-
message:
|
|
53
|
+
var z = __toESM(require("zod/v4"));
|
|
54
|
+
var anthropicErrorDataSchema = z.object({
|
|
55
|
+
type: z.literal("error"),
|
|
56
|
+
error: z.object({
|
|
57
|
+
type: z.string(),
|
|
58
|
+
message: z.string()
|
|
59
59
|
})
|
|
60
60
|
});
|
|
61
61
|
var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
|
|
@@ -64,48 +64,48 @@ var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorRe
|
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
// src/anthropic-messages-options.ts
|
|
67
|
-
var
|
|
68
|
-
var anthropicFilePartProviderOptions =
|
|
67
|
+
var z2 = __toESM(require("zod/v4"));
|
|
68
|
+
var anthropicFilePartProviderOptions = z2.object({
|
|
69
69
|
/**
|
|
70
70
|
* Citation configuration for this document.
|
|
71
71
|
* When enabled, this document will generate citations in the response.
|
|
72
72
|
*/
|
|
73
|
-
citations:
|
|
73
|
+
citations: z2.object({
|
|
74
74
|
/**
|
|
75
75
|
* Enable citations for this document
|
|
76
76
|
*/
|
|
77
|
-
enabled:
|
|
77
|
+
enabled: z2.boolean()
|
|
78
78
|
}).optional(),
|
|
79
79
|
/**
|
|
80
80
|
* Custom title for the document.
|
|
81
81
|
* If not provided, the filename will be used.
|
|
82
82
|
*/
|
|
83
|
-
title:
|
|
83
|
+
title: z2.string().optional(),
|
|
84
84
|
/**
|
|
85
85
|
* Context about the document that will be passed to the model
|
|
86
86
|
* but not used towards cited content.
|
|
87
87
|
* Useful for storing document metadata as text or stringified JSON.
|
|
88
88
|
*/
|
|
89
|
-
context:
|
|
89
|
+
context: z2.string().optional()
|
|
90
90
|
});
|
|
91
|
-
var anthropicProviderOptions =
|
|
92
|
-
sendReasoning:
|
|
93
|
-
thinking:
|
|
94
|
-
type:
|
|
95
|
-
budgetTokens:
|
|
91
|
+
var anthropicProviderOptions = z2.object({
|
|
92
|
+
sendReasoning: z2.boolean().optional(),
|
|
93
|
+
thinking: z2.object({
|
|
94
|
+
type: z2.union([z2.literal("enabled"), z2.literal("disabled")]),
|
|
95
|
+
budgetTokens: z2.number().optional()
|
|
96
96
|
}).optional(),
|
|
97
97
|
/**
|
|
98
98
|
* Whether to disable parallel function calling during tool use. Default is false.
|
|
99
99
|
* When set to true, Claude will use at most one tool per response.
|
|
100
100
|
*/
|
|
101
|
-
disableParallelToolUse:
|
|
101
|
+
disableParallelToolUse: z2.boolean().optional(),
|
|
102
102
|
/**
|
|
103
103
|
* Cache control settings for this message.
|
|
104
104
|
* See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
|
|
105
105
|
*/
|
|
106
|
-
cacheControl:
|
|
107
|
-
type:
|
|
108
|
-
ttl:
|
|
106
|
+
cacheControl: z2.object({
|
|
107
|
+
type: z2.literal("ephemeral"),
|
|
108
|
+
ttl: z2.union([z2.literal("5m"), z2.literal("1h")]).optional()
|
|
109
109
|
}).optional()
|
|
110
110
|
});
|
|
111
111
|
|
|
@@ -122,21 +122,21 @@ function getCacheControl(providerMetadata) {
|
|
|
122
122
|
|
|
123
123
|
// src/tool/text-editor_20250728.ts
|
|
124
124
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
125
|
-
var
|
|
126
|
-
var textEditor_20250728ArgsSchema =
|
|
127
|
-
maxCharacters:
|
|
125
|
+
var z3 = __toESM(require("zod/v4"));
|
|
126
|
+
var textEditor_20250728ArgsSchema = z3.object({
|
|
127
|
+
maxCharacters: z3.number().optional()
|
|
128
128
|
});
|
|
129
129
|
var factory = (0, import_provider_utils2.createProviderDefinedToolFactory)({
|
|
130
130
|
id: "anthropic.text_editor_20250728",
|
|
131
131
|
name: "str_replace_based_edit_tool",
|
|
132
|
-
inputSchema:
|
|
133
|
-
command:
|
|
134
|
-
path:
|
|
135
|
-
file_text:
|
|
136
|
-
insert_line:
|
|
137
|
-
new_str:
|
|
138
|
-
old_str:
|
|
139
|
-
view_range:
|
|
132
|
+
inputSchema: z3.object({
|
|
133
|
+
command: z3.enum(["view", "create", "str_replace", "insert"]),
|
|
134
|
+
path: z3.string(),
|
|
135
|
+
file_text: z3.string().optional(),
|
|
136
|
+
insert_line: z3.number().int().optional(),
|
|
137
|
+
new_str: z3.string().optional(),
|
|
138
|
+
old_str: z3.string().optional(),
|
|
139
|
+
view_range: z3.array(z3.number().int()).optional()
|
|
140
140
|
})
|
|
141
141
|
});
|
|
142
142
|
var textEditor_20250728 = (args = {}) => {
|
|
@@ -145,33 +145,33 @@ var textEditor_20250728 = (args = {}) => {
|
|
|
145
145
|
|
|
146
146
|
// src/tool/web-search_20250305.ts
|
|
147
147
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
148
|
-
var
|
|
149
|
-
var webSearch_20250305ArgsSchema =
|
|
150
|
-
maxUses:
|
|
151
|
-
allowedDomains:
|
|
152
|
-
blockedDomains:
|
|
153
|
-
userLocation:
|
|
154
|
-
type:
|
|
155
|
-
city:
|
|
156
|
-
region:
|
|
157
|
-
country:
|
|
158
|
-
timezone:
|
|
148
|
+
var z4 = __toESM(require("zod/v4"));
|
|
149
|
+
var webSearch_20250305ArgsSchema = z4.object({
|
|
150
|
+
maxUses: z4.number().optional(),
|
|
151
|
+
allowedDomains: z4.array(z4.string()).optional(),
|
|
152
|
+
blockedDomains: z4.array(z4.string()).optional(),
|
|
153
|
+
userLocation: z4.object({
|
|
154
|
+
type: z4.literal("approximate"),
|
|
155
|
+
city: z4.string().optional(),
|
|
156
|
+
region: z4.string().optional(),
|
|
157
|
+
country: z4.string().optional(),
|
|
158
|
+
timezone: z4.string().optional()
|
|
159
159
|
}).optional()
|
|
160
160
|
});
|
|
161
|
-
var webSearch_20250305OutputSchema =
|
|
162
|
-
|
|
163
|
-
url:
|
|
164
|
-
title:
|
|
165
|
-
pageAge:
|
|
166
|
-
encryptedContent:
|
|
167
|
-
type:
|
|
161
|
+
var webSearch_20250305OutputSchema = z4.array(
|
|
162
|
+
z4.object({
|
|
163
|
+
url: z4.string(),
|
|
164
|
+
title: z4.string(),
|
|
165
|
+
pageAge: z4.string().nullable(),
|
|
166
|
+
encryptedContent: z4.string(),
|
|
167
|
+
type: z4.literal("web_search_result")
|
|
168
168
|
})
|
|
169
169
|
);
|
|
170
170
|
var factory2 = (0, import_provider_utils3.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
171
171
|
id: "anthropic.web_search_20250305",
|
|
172
172
|
name: "web_search",
|
|
173
|
-
inputSchema:
|
|
174
|
-
query:
|
|
173
|
+
inputSchema: z4.object({
|
|
174
|
+
query: z4.string()
|
|
175
175
|
}),
|
|
176
176
|
outputSchema: webSearch_20250305OutputSchema
|
|
177
177
|
});
|
|
@@ -181,41 +181,41 @@ var webSearch_20250305 = (args = {}) => {
|
|
|
181
181
|
|
|
182
182
|
// src/tool/web-fetch-20250910.ts
|
|
183
183
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
184
|
-
var
|
|
185
|
-
var webFetch_20250910ArgsSchema =
|
|
186
|
-
maxUses:
|
|
187
|
-
allowedDomains:
|
|
188
|
-
blockedDomains:
|
|
189
|
-
citations:
|
|
190
|
-
maxContentTokens:
|
|
184
|
+
var z5 = __toESM(require("zod/v4"));
|
|
185
|
+
var webFetch_20250910ArgsSchema = z5.object({
|
|
186
|
+
maxUses: z5.number().optional(),
|
|
187
|
+
allowedDomains: z5.array(z5.string()).optional(),
|
|
188
|
+
blockedDomains: z5.array(z5.string()).optional(),
|
|
189
|
+
citations: z5.object({ enabled: z5.boolean() }).optional(),
|
|
190
|
+
maxContentTokens: z5.number().optional()
|
|
191
191
|
});
|
|
192
|
-
var webFetch_20250910OutputSchema =
|
|
193
|
-
type:
|
|
194
|
-
url:
|
|
195
|
-
content:
|
|
196
|
-
type:
|
|
197
|
-
title:
|
|
198
|
-
citations:
|
|
199
|
-
source:
|
|
200
|
-
|
|
201
|
-
type:
|
|
202
|
-
mediaType:
|
|
203
|
-
data:
|
|
192
|
+
var webFetch_20250910OutputSchema = z5.object({
|
|
193
|
+
type: z5.literal("web_fetch_result"),
|
|
194
|
+
url: z5.string(),
|
|
195
|
+
content: z5.object({
|
|
196
|
+
type: z5.literal("document"),
|
|
197
|
+
title: z5.string(),
|
|
198
|
+
citations: z5.object({ enabled: z5.boolean() }).optional(),
|
|
199
|
+
source: z5.union([
|
|
200
|
+
z5.object({
|
|
201
|
+
type: z5.literal("base64"),
|
|
202
|
+
mediaType: z5.literal("application/pdf"),
|
|
203
|
+
data: z5.string()
|
|
204
204
|
}),
|
|
205
|
-
|
|
206
|
-
type:
|
|
207
|
-
mediaType:
|
|
208
|
-
data:
|
|
205
|
+
z5.object({
|
|
206
|
+
type: z5.literal("text"),
|
|
207
|
+
mediaType: z5.literal("text/plain"),
|
|
208
|
+
data: z5.string()
|
|
209
209
|
})
|
|
210
210
|
])
|
|
211
211
|
}),
|
|
212
|
-
retrievedAt:
|
|
212
|
+
retrievedAt: z5.string().nullable()
|
|
213
213
|
});
|
|
214
214
|
var factory3 = (0, import_provider_utils4.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
215
215
|
id: "anthropic.web_fetch_20250910",
|
|
216
216
|
name: "web_fetch",
|
|
217
|
-
inputSchema:
|
|
218
|
-
url:
|
|
217
|
+
inputSchema: z5.object({
|
|
218
|
+
url: z5.string()
|
|
219
219
|
}),
|
|
220
220
|
outputSchema: webFetch_20250910OutputSchema
|
|
221
221
|
});
|
|
@@ -426,18 +426,18 @@ var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
|
426
426
|
|
|
427
427
|
// src/tool/code-execution_20250522.ts
|
|
428
428
|
var import_provider_utils5 = require("@ai-sdk/provider-utils");
|
|
429
|
-
var
|
|
430
|
-
var codeExecution_20250522OutputSchema =
|
|
431
|
-
type:
|
|
432
|
-
stdout:
|
|
433
|
-
stderr:
|
|
434
|
-
return_code:
|
|
429
|
+
var z6 = __toESM(require("zod/v4"));
|
|
430
|
+
var codeExecution_20250522OutputSchema = z6.object({
|
|
431
|
+
type: z6.literal("code_execution_result"),
|
|
432
|
+
stdout: z6.string(),
|
|
433
|
+
stderr: z6.string(),
|
|
434
|
+
return_code: z6.number()
|
|
435
435
|
});
|
|
436
436
|
var factory4 = (0, import_provider_utils5.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
437
437
|
id: "anthropic.code_execution_20250522",
|
|
438
438
|
name: "code_execution",
|
|
439
|
-
inputSchema:
|
|
440
|
-
code:
|
|
439
|
+
inputSchema: z6.object({
|
|
440
|
+
code: z6.string()
|
|
441
441
|
}),
|
|
442
442
|
outputSchema: codeExecution_20250522OutputSchema
|
|
443
443
|
});
|
|
@@ -940,36 +940,36 @@ function mapAnthropicStopReason({
|
|
|
940
940
|
|
|
941
941
|
// src/anthropic-messages-language-model.ts
|
|
942
942
|
var citationSchemas = {
|
|
943
|
-
webSearchResult:
|
|
944
|
-
type:
|
|
945
|
-
cited_text:
|
|
946
|
-
url:
|
|
947
|
-
title:
|
|
948
|
-
encrypted_index:
|
|
943
|
+
webSearchResult: z7.object({
|
|
944
|
+
type: z7.literal("web_search_result_location"),
|
|
945
|
+
cited_text: z7.string(),
|
|
946
|
+
url: z7.string(),
|
|
947
|
+
title: z7.string(),
|
|
948
|
+
encrypted_index: z7.string()
|
|
949
949
|
}),
|
|
950
|
-
pageLocation:
|
|
951
|
-
type:
|
|
952
|
-
cited_text:
|
|
953
|
-
document_index:
|
|
954
|
-
document_title:
|
|
955
|
-
start_page_number:
|
|
956
|
-
end_page_number:
|
|
950
|
+
pageLocation: z7.object({
|
|
951
|
+
type: z7.literal("page_location"),
|
|
952
|
+
cited_text: z7.string(),
|
|
953
|
+
document_index: z7.number(),
|
|
954
|
+
document_title: z7.string().nullable(),
|
|
955
|
+
start_page_number: z7.number(),
|
|
956
|
+
end_page_number: z7.number()
|
|
957
957
|
}),
|
|
958
|
-
charLocation:
|
|
959
|
-
type:
|
|
960
|
-
cited_text:
|
|
961
|
-
document_index:
|
|
962
|
-
document_title:
|
|
963
|
-
start_char_index:
|
|
964
|
-
end_char_index:
|
|
958
|
+
charLocation: z7.object({
|
|
959
|
+
type: z7.literal("char_location"),
|
|
960
|
+
cited_text: z7.string(),
|
|
961
|
+
document_index: z7.number(),
|
|
962
|
+
document_title: z7.string().nullable(),
|
|
963
|
+
start_char_index: z7.number(),
|
|
964
|
+
end_char_index: z7.number()
|
|
965
965
|
})
|
|
966
966
|
};
|
|
967
|
-
var citationSchema =
|
|
967
|
+
var citationSchema = z7.discriminatedUnion("type", [
|
|
968
968
|
citationSchemas.webSearchResult,
|
|
969
969
|
citationSchemas.pageLocation,
|
|
970
970
|
citationSchemas.charLocation
|
|
971
971
|
]);
|
|
972
|
-
var documentCitationSchema =
|
|
972
|
+
var documentCitationSchema = z7.discriminatedUnion("type", [
|
|
973
973
|
citationSchemas.pageLocation,
|
|
974
974
|
citationSchemas.charLocation
|
|
975
975
|
]);
|
|
@@ -1861,303 +1861,303 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1861
1861
|
};
|
|
1862
1862
|
}
|
|
1863
1863
|
};
|
|
1864
|
-
var anthropicMessagesResponseSchema =
|
|
1865
|
-
type:
|
|
1866
|
-
id:
|
|
1867
|
-
model:
|
|
1868
|
-
content:
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
type:
|
|
1872
|
-
text:
|
|
1873
|
-
citations:
|
|
1864
|
+
var anthropicMessagesResponseSchema = z7.object({
|
|
1865
|
+
type: z7.literal("message"),
|
|
1866
|
+
id: z7.string().nullish(),
|
|
1867
|
+
model: z7.string().nullish(),
|
|
1868
|
+
content: z7.array(
|
|
1869
|
+
z7.discriminatedUnion("type", [
|
|
1870
|
+
z7.object({
|
|
1871
|
+
type: z7.literal("text"),
|
|
1872
|
+
text: z7.string(),
|
|
1873
|
+
citations: z7.array(citationSchema).optional()
|
|
1874
1874
|
}),
|
|
1875
|
-
|
|
1876
|
-
type:
|
|
1877
|
-
thinking:
|
|
1878
|
-
signature:
|
|
1875
|
+
z7.object({
|
|
1876
|
+
type: z7.literal("thinking"),
|
|
1877
|
+
thinking: z7.string(),
|
|
1878
|
+
signature: z7.string()
|
|
1879
1879
|
}),
|
|
1880
|
-
|
|
1881
|
-
type:
|
|
1882
|
-
data:
|
|
1880
|
+
z7.object({
|
|
1881
|
+
type: z7.literal("redacted_thinking"),
|
|
1882
|
+
data: z7.string()
|
|
1883
1883
|
}),
|
|
1884
|
-
|
|
1885
|
-
type:
|
|
1886
|
-
id:
|
|
1887
|
-
name:
|
|
1888
|
-
input:
|
|
1884
|
+
z7.object({
|
|
1885
|
+
type: z7.literal("tool_use"),
|
|
1886
|
+
id: z7.string(),
|
|
1887
|
+
name: z7.string(),
|
|
1888
|
+
input: z7.unknown()
|
|
1889
1889
|
}),
|
|
1890
|
-
|
|
1891
|
-
type:
|
|
1892
|
-
id:
|
|
1893
|
-
name:
|
|
1894
|
-
input:
|
|
1890
|
+
z7.object({
|
|
1891
|
+
type: z7.literal("server_tool_use"),
|
|
1892
|
+
id: z7.string(),
|
|
1893
|
+
name: z7.string(),
|
|
1894
|
+
input: z7.record(z7.string(), z7.unknown()).nullish()
|
|
1895
1895
|
}),
|
|
1896
|
-
|
|
1897
|
-
type:
|
|
1898
|
-
tool_use_id:
|
|
1899
|
-
content:
|
|
1900
|
-
|
|
1901
|
-
type:
|
|
1902
|
-
url:
|
|
1903
|
-
retrieved_at:
|
|
1904
|
-
content:
|
|
1905
|
-
type:
|
|
1906
|
-
title:
|
|
1907
|
-
citations:
|
|
1908
|
-
source:
|
|
1909
|
-
type:
|
|
1910
|
-
media_type:
|
|
1911
|
-
data:
|
|
1896
|
+
z7.object({
|
|
1897
|
+
type: z7.literal("web_fetch_tool_result"),
|
|
1898
|
+
tool_use_id: z7.string(),
|
|
1899
|
+
content: z7.union([
|
|
1900
|
+
z7.object({
|
|
1901
|
+
type: z7.literal("web_fetch_result"),
|
|
1902
|
+
url: z7.string(),
|
|
1903
|
+
retrieved_at: z7.string(),
|
|
1904
|
+
content: z7.object({
|
|
1905
|
+
type: z7.literal("document"),
|
|
1906
|
+
title: z7.string().nullable(),
|
|
1907
|
+
citations: z7.object({ enabled: z7.boolean() }).optional(),
|
|
1908
|
+
source: z7.object({
|
|
1909
|
+
type: z7.literal("text"),
|
|
1910
|
+
media_type: z7.string(),
|
|
1911
|
+
data: z7.string()
|
|
1912
1912
|
})
|
|
1913
1913
|
})
|
|
1914
1914
|
}),
|
|
1915
|
-
|
|
1916
|
-
type:
|
|
1917
|
-
error_code:
|
|
1915
|
+
z7.object({
|
|
1916
|
+
type: z7.literal("web_fetch_tool_result_error"),
|
|
1917
|
+
error_code: z7.string()
|
|
1918
1918
|
})
|
|
1919
1919
|
])
|
|
1920
1920
|
}),
|
|
1921
|
-
|
|
1922
|
-
type:
|
|
1923
|
-
tool_use_id:
|
|
1924
|
-
content:
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
type:
|
|
1928
|
-
url:
|
|
1929
|
-
title:
|
|
1930
|
-
encrypted_content:
|
|
1931
|
-
page_age:
|
|
1921
|
+
z7.object({
|
|
1922
|
+
type: z7.literal("web_search_tool_result"),
|
|
1923
|
+
tool_use_id: z7.string(),
|
|
1924
|
+
content: z7.union([
|
|
1925
|
+
z7.array(
|
|
1926
|
+
z7.object({
|
|
1927
|
+
type: z7.literal("web_search_result"),
|
|
1928
|
+
url: z7.string(),
|
|
1929
|
+
title: z7.string(),
|
|
1930
|
+
encrypted_content: z7.string(),
|
|
1931
|
+
page_age: z7.string().nullish()
|
|
1932
1932
|
})
|
|
1933
1933
|
),
|
|
1934
|
-
|
|
1935
|
-
type:
|
|
1936
|
-
error_code:
|
|
1934
|
+
z7.object({
|
|
1935
|
+
type: z7.literal("web_search_tool_result_error"),
|
|
1936
|
+
error_code: z7.string()
|
|
1937
1937
|
})
|
|
1938
1938
|
])
|
|
1939
1939
|
}),
|
|
1940
|
-
|
|
1941
|
-
type:
|
|
1942
|
-
tool_use_id:
|
|
1943
|
-
content:
|
|
1944
|
-
|
|
1945
|
-
type:
|
|
1946
|
-
stdout:
|
|
1947
|
-
stderr:
|
|
1948
|
-
return_code:
|
|
1940
|
+
z7.object({
|
|
1941
|
+
type: z7.literal("code_execution_tool_result"),
|
|
1942
|
+
tool_use_id: z7.string(),
|
|
1943
|
+
content: z7.union([
|
|
1944
|
+
z7.object({
|
|
1945
|
+
type: z7.literal("code_execution_result"),
|
|
1946
|
+
stdout: z7.string(),
|
|
1947
|
+
stderr: z7.string(),
|
|
1948
|
+
return_code: z7.number()
|
|
1949
1949
|
}),
|
|
1950
|
-
|
|
1951
|
-
type:
|
|
1952
|
-
error_code:
|
|
1950
|
+
z7.object({
|
|
1951
|
+
type: z7.literal("code_execution_tool_result_error"),
|
|
1952
|
+
error_code: z7.string()
|
|
1953
1953
|
})
|
|
1954
1954
|
])
|
|
1955
1955
|
})
|
|
1956
1956
|
])
|
|
1957
1957
|
),
|
|
1958
|
-
stop_reason:
|
|
1959
|
-
stop_sequence:
|
|
1960
|
-
usage:
|
|
1961
|
-
input_tokens:
|
|
1962
|
-
output_tokens:
|
|
1963
|
-
cache_creation_input_tokens:
|
|
1964
|
-
cache_read_input_tokens:
|
|
1958
|
+
stop_reason: z7.string().nullish(),
|
|
1959
|
+
stop_sequence: z7.string().nullish(),
|
|
1960
|
+
usage: z7.looseObject({
|
|
1961
|
+
input_tokens: z7.number(),
|
|
1962
|
+
output_tokens: z7.number(),
|
|
1963
|
+
cache_creation_input_tokens: z7.number().nullish(),
|
|
1964
|
+
cache_read_input_tokens: z7.number().nullish()
|
|
1965
1965
|
})
|
|
1966
1966
|
});
|
|
1967
|
-
var anthropicMessagesChunkSchema =
|
|
1968
|
-
|
|
1969
|
-
type:
|
|
1970
|
-
message:
|
|
1971
|
-
id:
|
|
1972
|
-
model:
|
|
1973
|
-
usage:
|
|
1974
|
-
input_tokens:
|
|
1975
|
-
cache_creation_input_tokens:
|
|
1976
|
-
cache_read_input_tokens:
|
|
1967
|
+
var anthropicMessagesChunkSchema = z7.discriminatedUnion("type", [
|
|
1968
|
+
z7.object({
|
|
1969
|
+
type: z7.literal("message_start"),
|
|
1970
|
+
message: z7.object({
|
|
1971
|
+
id: z7.string().nullish(),
|
|
1972
|
+
model: z7.string().nullish(),
|
|
1973
|
+
usage: z7.looseObject({
|
|
1974
|
+
input_tokens: z7.number(),
|
|
1975
|
+
cache_creation_input_tokens: z7.number().nullish(),
|
|
1976
|
+
cache_read_input_tokens: z7.number().nullish()
|
|
1977
1977
|
})
|
|
1978
1978
|
})
|
|
1979
1979
|
}),
|
|
1980
|
-
|
|
1981
|
-
type:
|
|
1982
|
-
index:
|
|
1983
|
-
content_block:
|
|
1984
|
-
|
|
1985
|
-
type:
|
|
1986
|
-
text:
|
|
1980
|
+
z7.object({
|
|
1981
|
+
type: z7.literal("content_block_start"),
|
|
1982
|
+
index: z7.number(),
|
|
1983
|
+
content_block: z7.discriminatedUnion("type", [
|
|
1984
|
+
z7.object({
|
|
1985
|
+
type: z7.literal("text"),
|
|
1986
|
+
text: z7.string()
|
|
1987
1987
|
}),
|
|
1988
|
-
|
|
1989
|
-
type:
|
|
1990
|
-
thinking:
|
|
1988
|
+
z7.object({
|
|
1989
|
+
type: z7.literal("thinking"),
|
|
1990
|
+
thinking: z7.string()
|
|
1991
1991
|
}),
|
|
1992
|
-
|
|
1993
|
-
type:
|
|
1994
|
-
id:
|
|
1995
|
-
name:
|
|
1992
|
+
z7.object({
|
|
1993
|
+
type: z7.literal("tool_use"),
|
|
1994
|
+
id: z7.string(),
|
|
1995
|
+
name: z7.string()
|
|
1996
1996
|
}),
|
|
1997
|
-
|
|
1998
|
-
type:
|
|
1999
|
-
data:
|
|
1997
|
+
z7.object({
|
|
1998
|
+
type: z7.literal("redacted_thinking"),
|
|
1999
|
+
data: z7.string()
|
|
2000
2000
|
}),
|
|
2001
|
-
|
|
2002
|
-
type:
|
|
2003
|
-
id:
|
|
2004
|
-
name:
|
|
2005
|
-
input:
|
|
2001
|
+
z7.object({
|
|
2002
|
+
type: z7.literal("server_tool_use"),
|
|
2003
|
+
id: z7.string(),
|
|
2004
|
+
name: z7.string(),
|
|
2005
|
+
input: z7.record(z7.string(), z7.unknown()).nullish()
|
|
2006
2006
|
}),
|
|
2007
|
-
|
|
2008
|
-
type:
|
|
2009
|
-
tool_use_id:
|
|
2010
|
-
content:
|
|
2011
|
-
|
|
2012
|
-
type:
|
|
2013
|
-
url:
|
|
2014
|
-
retrieved_at:
|
|
2015
|
-
content:
|
|
2016
|
-
type:
|
|
2017
|
-
title:
|
|
2018
|
-
citations:
|
|
2019
|
-
source:
|
|
2020
|
-
type:
|
|
2021
|
-
media_type:
|
|
2022
|
-
data:
|
|
2007
|
+
z7.object({
|
|
2008
|
+
type: z7.literal("web_fetch_tool_result"),
|
|
2009
|
+
tool_use_id: z7.string(),
|
|
2010
|
+
content: z7.union([
|
|
2011
|
+
z7.object({
|
|
2012
|
+
type: z7.literal("web_fetch_result"),
|
|
2013
|
+
url: z7.string(),
|
|
2014
|
+
retrieved_at: z7.string(),
|
|
2015
|
+
content: z7.object({
|
|
2016
|
+
type: z7.literal("document"),
|
|
2017
|
+
title: z7.string().nullable(),
|
|
2018
|
+
citations: z7.object({ enabled: z7.boolean() }).optional(),
|
|
2019
|
+
source: z7.object({
|
|
2020
|
+
type: z7.literal("text"),
|
|
2021
|
+
media_type: z7.string(),
|
|
2022
|
+
data: z7.string()
|
|
2023
2023
|
})
|
|
2024
2024
|
})
|
|
2025
2025
|
}),
|
|
2026
|
-
|
|
2027
|
-
type:
|
|
2028
|
-
error_code:
|
|
2026
|
+
z7.object({
|
|
2027
|
+
type: z7.literal("web_fetch_tool_result_error"),
|
|
2028
|
+
error_code: z7.string()
|
|
2029
2029
|
})
|
|
2030
2030
|
])
|
|
2031
2031
|
}),
|
|
2032
|
-
|
|
2033
|
-
type:
|
|
2034
|
-
tool_use_id:
|
|
2035
|
-
content:
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
type:
|
|
2039
|
-
url:
|
|
2040
|
-
title:
|
|
2041
|
-
encrypted_content:
|
|
2042
|
-
page_age:
|
|
2032
|
+
z7.object({
|
|
2033
|
+
type: z7.literal("web_search_tool_result"),
|
|
2034
|
+
tool_use_id: z7.string(),
|
|
2035
|
+
content: z7.union([
|
|
2036
|
+
z7.array(
|
|
2037
|
+
z7.object({
|
|
2038
|
+
type: z7.literal("web_search_result"),
|
|
2039
|
+
url: z7.string(),
|
|
2040
|
+
title: z7.string(),
|
|
2041
|
+
encrypted_content: z7.string(),
|
|
2042
|
+
page_age: z7.string().nullish()
|
|
2043
2043
|
})
|
|
2044
2044
|
),
|
|
2045
|
-
|
|
2046
|
-
type:
|
|
2047
|
-
error_code:
|
|
2045
|
+
z7.object({
|
|
2046
|
+
type: z7.literal("web_search_tool_result_error"),
|
|
2047
|
+
error_code: z7.string()
|
|
2048
2048
|
})
|
|
2049
2049
|
])
|
|
2050
2050
|
}),
|
|
2051
|
-
|
|
2052
|
-
type:
|
|
2053
|
-
tool_use_id:
|
|
2054
|
-
content:
|
|
2055
|
-
|
|
2056
|
-
type:
|
|
2057
|
-
stdout:
|
|
2058
|
-
stderr:
|
|
2059
|
-
return_code:
|
|
2051
|
+
z7.object({
|
|
2052
|
+
type: z7.literal("code_execution_tool_result"),
|
|
2053
|
+
tool_use_id: z7.string(),
|
|
2054
|
+
content: z7.union([
|
|
2055
|
+
z7.object({
|
|
2056
|
+
type: z7.literal("code_execution_result"),
|
|
2057
|
+
stdout: z7.string(),
|
|
2058
|
+
stderr: z7.string(),
|
|
2059
|
+
return_code: z7.number()
|
|
2060
2060
|
}),
|
|
2061
|
-
|
|
2062
|
-
type:
|
|
2063
|
-
error_code:
|
|
2061
|
+
z7.object({
|
|
2062
|
+
type: z7.literal("code_execution_tool_result_error"),
|
|
2063
|
+
error_code: z7.string()
|
|
2064
2064
|
})
|
|
2065
2065
|
])
|
|
2066
2066
|
})
|
|
2067
2067
|
])
|
|
2068
2068
|
}),
|
|
2069
|
-
|
|
2070
|
-
type:
|
|
2071
|
-
index:
|
|
2072
|
-
delta:
|
|
2073
|
-
|
|
2074
|
-
type:
|
|
2075
|
-
partial_json:
|
|
2069
|
+
z7.object({
|
|
2070
|
+
type: z7.literal("content_block_delta"),
|
|
2071
|
+
index: z7.number(),
|
|
2072
|
+
delta: z7.discriminatedUnion("type", [
|
|
2073
|
+
z7.object({
|
|
2074
|
+
type: z7.literal("input_json_delta"),
|
|
2075
|
+
partial_json: z7.string()
|
|
2076
2076
|
}),
|
|
2077
|
-
|
|
2078
|
-
type:
|
|
2079
|
-
text:
|
|
2077
|
+
z7.object({
|
|
2078
|
+
type: z7.literal("text_delta"),
|
|
2079
|
+
text: z7.string()
|
|
2080
2080
|
}),
|
|
2081
|
-
|
|
2082
|
-
type:
|
|
2083
|
-
thinking:
|
|
2081
|
+
z7.object({
|
|
2082
|
+
type: z7.literal("thinking_delta"),
|
|
2083
|
+
thinking: z7.string()
|
|
2084
2084
|
}),
|
|
2085
|
-
|
|
2086
|
-
type:
|
|
2087
|
-
signature:
|
|
2085
|
+
z7.object({
|
|
2086
|
+
type: z7.literal("signature_delta"),
|
|
2087
|
+
signature: z7.string()
|
|
2088
2088
|
}),
|
|
2089
|
-
|
|
2090
|
-
type:
|
|
2089
|
+
z7.object({
|
|
2090
|
+
type: z7.literal("citations_delta"),
|
|
2091
2091
|
citation: citationSchema
|
|
2092
2092
|
})
|
|
2093
2093
|
])
|
|
2094
2094
|
}),
|
|
2095
|
-
|
|
2096
|
-
type:
|
|
2097
|
-
index:
|
|
2095
|
+
z7.object({
|
|
2096
|
+
type: z7.literal("content_block_stop"),
|
|
2097
|
+
index: z7.number()
|
|
2098
2098
|
}),
|
|
2099
|
-
|
|
2100
|
-
type:
|
|
2101
|
-
error:
|
|
2102
|
-
type:
|
|
2103
|
-
message:
|
|
2099
|
+
z7.object({
|
|
2100
|
+
type: z7.literal("error"),
|
|
2101
|
+
error: z7.object({
|
|
2102
|
+
type: z7.string(),
|
|
2103
|
+
message: z7.string()
|
|
2104
2104
|
})
|
|
2105
2105
|
}),
|
|
2106
|
-
|
|
2107
|
-
type:
|
|
2108
|
-
delta:
|
|
2109
|
-
stop_reason:
|
|
2110
|
-
stop_sequence:
|
|
2106
|
+
z7.object({
|
|
2107
|
+
type: z7.literal("message_delta"),
|
|
2108
|
+
delta: z7.object({
|
|
2109
|
+
stop_reason: z7.string().nullish(),
|
|
2110
|
+
stop_sequence: z7.string().nullish()
|
|
2111
2111
|
}),
|
|
2112
|
-
usage:
|
|
2113
|
-
output_tokens:
|
|
2114
|
-
cache_creation_input_tokens:
|
|
2112
|
+
usage: z7.looseObject({
|
|
2113
|
+
output_tokens: z7.number(),
|
|
2114
|
+
cache_creation_input_tokens: z7.number().nullish()
|
|
2115
2115
|
})
|
|
2116
2116
|
}),
|
|
2117
|
-
|
|
2118
|
-
type:
|
|
2117
|
+
z7.object({
|
|
2118
|
+
type: z7.literal("message_stop")
|
|
2119
2119
|
}),
|
|
2120
|
-
|
|
2121
|
-
type:
|
|
2120
|
+
z7.object({
|
|
2121
|
+
type: z7.literal("ping")
|
|
2122
2122
|
})
|
|
2123
2123
|
]);
|
|
2124
|
-
var anthropicReasoningMetadataSchema =
|
|
2125
|
-
signature:
|
|
2126
|
-
redactedData:
|
|
2124
|
+
var anthropicReasoningMetadataSchema = z7.object({
|
|
2125
|
+
signature: z7.string().optional(),
|
|
2126
|
+
redactedData: z7.string().optional()
|
|
2127
2127
|
});
|
|
2128
2128
|
|
|
2129
2129
|
// src/tool/bash_20241022.ts
|
|
2130
2130
|
var import_provider_utils8 = require("@ai-sdk/provider-utils");
|
|
2131
|
-
var
|
|
2131
|
+
var import_v4 = __toESM(require("zod/v4"));
|
|
2132
2132
|
var bash_20241022 = (0, import_provider_utils8.createProviderDefinedToolFactory)({
|
|
2133
2133
|
id: "anthropic.bash_20241022",
|
|
2134
2134
|
name: "bash",
|
|
2135
|
-
inputSchema:
|
|
2136
|
-
command:
|
|
2137
|
-
restart:
|
|
2135
|
+
inputSchema: import_v4.default.object({
|
|
2136
|
+
command: import_v4.default.string(),
|
|
2137
|
+
restart: import_v4.default.boolean().optional()
|
|
2138
2138
|
})
|
|
2139
2139
|
});
|
|
2140
2140
|
|
|
2141
2141
|
// src/tool/bash_20250124.ts
|
|
2142
2142
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
|
2143
|
-
var
|
|
2143
|
+
var import_v42 = __toESM(require("zod/v4"));
|
|
2144
2144
|
var bash_20250124 = (0, import_provider_utils9.createProviderDefinedToolFactory)({
|
|
2145
2145
|
id: "anthropic.bash_20250124",
|
|
2146
2146
|
name: "bash",
|
|
2147
|
-
inputSchema:
|
|
2148
|
-
command:
|
|
2149
|
-
restart:
|
|
2147
|
+
inputSchema: import_v42.default.object({
|
|
2148
|
+
command: import_v42.default.string(),
|
|
2149
|
+
restart: import_v42.default.boolean().optional()
|
|
2150
2150
|
})
|
|
2151
2151
|
});
|
|
2152
2152
|
|
|
2153
2153
|
// src/tool/computer_20241022.ts
|
|
2154
2154
|
var import_provider_utils10 = require("@ai-sdk/provider-utils");
|
|
2155
|
-
var
|
|
2155
|
+
var z10 = __toESM(require("zod/v4"));
|
|
2156
2156
|
var computer_20241022 = (0, import_provider_utils10.createProviderDefinedToolFactory)({
|
|
2157
2157
|
id: "anthropic.computer_20241022",
|
|
2158
2158
|
name: "computer",
|
|
2159
|
-
inputSchema:
|
|
2160
|
-
action:
|
|
2159
|
+
inputSchema: z10.object({
|
|
2160
|
+
action: z10.enum([
|
|
2161
2161
|
"key",
|
|
2162
2162
|
"type",
|
|
2163
2163
|
"mouse_move",
|
|
@@ -2169,19 +2169,19 @@ var computer_20241022 = (0, import_provider_utils10.createProviderDefinedToolFac
|
|
|
2169
2169
|
"screenshot",
|
|
2170
2170
|
"cursor_position"
|
|
2171
2171
|
]),
|
|
2172
|
-
coordinate:
|
|
2173
|
-
text:
|
|
2172
|
+
coordinate: z10.array(z10.number().int()).optional(),
|
|
2173
|
+
text: z10.string().optional()
|
|
2174
2174
|
})
|
|
2175
2175
|
});
|
|
2176
2176
|
|
|
2177
2177
|
// src/tool/computer_20250124.ts
|
|
2178
2178
|
var import_provider_utils11 = require("@ai-sdk/provider-utils");
|
|
2179
|
-
var
|
|
2179
|
+
var z11 = __toESM(require("zod/v4"));
|
|
2180
2180
|
var computer_20250124 = (0, import_provider_utils11.createProviderDefinedToolFactory)({
|
|
2181
2181
|
id: "anthropic.computer_20250124",
|
|
2182
2182
|
name: "computer",
|
|
2183
|
-
inputSchema:
|
|
2184
|
-
action:
|
|
2183
|
+
inputSchema: z11.object({
|
|
2184
|
+
action: z11.enum([
|
|
2185
2185
|
"key",
|
|
2186
2186
|
"hold_key",
|
|
2187
2187
|
"type",
|
|
@@ -2199,63 +2199,63 @@ var computer_20250124 = (0, import_provider_utils11.createProviderDefinedToolFac
|
|
|
2199
2199
|
"wait",
|
|
2200
2200
|
"screenshot"
|
|
2201
2201
|
]),
|
|
2202
|
-
coordinate:
|
|
2203
|
-
duration:
|
|
2204
|
-
scroll_amount:
|
|
2205
|
-
scroll_direction:
|
|
2206
|
-
start_coordinate:
|
|
2207
|
-
text:
|
|
2202
|
+
coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
|
|
2203
|
+
duration: z11.number().optional(),
|
|
2204
|
+
scroll_amount: z11.number().optional(),
|
|
2205
|
+
scroll_direction: z11.enum(["up", "down", "left", "right"]).optional(),
|
|
2206
|
+
start_coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
|
|
2207
|
+
text: z11.string().optional()
|
|
2208
2208
|
})
|
|
2209
2209
|
});
|
|
2210
2210
|
|
|
2211
2211
|
// src/tool/text-editor_20241022.ts
|
|
2212
2212
|
var import_provider_utils12 = require("@ai-sdk/provider-utils");
|
|
2213
|
-
var
|
|
2213
|
+
var z12 = __toESM(require("zod/v4"));
|
|
2214
2214
|
var textEditor_20241022 = (0, import_provider_utils12.createProviderDefinedToolFactory)({
|
|
2215
2215
|
id: "anthropic.text_editor_20241022",
|
|
2216
2216
|
name: "str_replace_editor",
|
|
2217
|
-
inputSchema:
|
|
2218
|
-
command:
|
|
2219
|
-
path:
|
|
2220
|
-
file_text:
|
|
2221
|
-
insert_line:
|
|
2222
|
-
new_str:
|
|
2223
|
-
old_str:
|
|
2224
|
-
view_range:
|
|
2217
|
+
inputSchema: z12.object({
|
|
2218
|
+
command: z12.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
2219
|
+
path: z12.string(),
|
|
2220
|
+
file_text: z12.string().optional(),
|
|
2221
|
+
insert_line: z12.number().int().optional(),
|
|
2222
|
+
new_str: z12.string().optional(),
|
|
2223
|
+
old_str: z12.string().optional(),
|
|
2224
|
+
view_range: z12.array(z12.number().int()).optional()
|
|
2225
2225
|
})
|
|
2226
2226
|
});
|
|
2227
2227
|
|
|
2228
2228
|
// src/tool/text-editor_20250124.ts
|
|
2229
2229
|
var import_provider_utils13 = require("@ai-sdk/provider-utils");
|
|
2230
|
-
var
|
|
2230
|
+
var z13 = __toESM(require("zod/v4"));
|
|
2231
2231
|
var textEditor_20250124 = (0, import_provider_utils13.createProviderDefinedToolFactory)({
|
|
2232
2232
|
id: "anthropic.text_editor_20250124",
|
|
2233
2233
|
name: "str_replace_editor",
|
|
2234
|
-
inputSchema:
|
|
2235
|
-
command:
|
|
2236
|
-
path:
|
|
2237
|
-
file_text:
|
|
2238
|
-
insert_line:
|
|
2239
|
-
new_str:
|
|
2240
|
-
old_str:
|
|
2241
|
-
view_range:
|
|
2234
|
+
inputSchema: z13.object({
|
|
2235
|
+
command: z13.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
2236
|
+
path: z13.string(),
|
|
2237
|
+
file_text: z13.string().optional(),
|
|
2238
|
+
insert_line: z13.number().int().optional(),
|
|
2239
|
+
new_str: z13.string().optional(),
|
|
2240
|
+
old_str: z13.string().optional(),
|
|
2241
|
+
view_range: z13.array(z13.number().int()).optional()
|
|
2242
2242
|
})
|
|
2243
2243
|
});
|
|
2244
2244
|
|
|
2245
2245
|
// src/tool/text-editor_20250429.ts
|
|
2246
2246
|
var import_provider_utils14 = require("@ai-sdk/provider-utils");
|
|
2247
|
-
var
|
|
2247
|
+
var z14 = __toESM(require("zod/v4"));
|
|
2248
2248
|
var textEditor_20250429 = (0, import_provider_utils14.createProviderDefinedToolFactory)({
|
|
2249
2249
|
id: "anthropic.text_editor_20250429",
|
|
2250
2250
|
name: "str_replace_based_edit_tool",
|
|
2251
|
-
inputSchema:
|
|
2252
|
-
command:
|
|
2253
|
-
path:
|
|
2254
|
-
file_text:
|
|
2255
|
-
insert_line:
|
|
2256
|
-
new_str:
|
|
2257
|
-
old_str:
|
|
2258
|
-
view_range:
|
|
2251
|
+
inputSchema: z14.object({
|
|
2252
|
+
command: z14.enum(["view", "create", "str_replace", "insert"]),
|
|
2253
|
+
path: z14.string(),
|
|
2254
|
+
file_text: z14.string().optional(),
|
|
2255
|
+
insert_line: z14.number().int().optional(),
|
|
2256
|
+
new_str: z14.string().optional(),
|
|
2257
|
+
old_str: z14.string().optional(),
|
|
2258
|
+
view_range: z14.array(z14.number().int()).optional()
|
|
2259
2259
|
})
|
|
2260
2260
|
});
|
|
2261
2261
|
|