@ai-sdk/anthropic 2.1.0-beta.9 → 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 +51 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +370 -359
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -20
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +369 -358
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +30 -19
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/internal/index.js
CHANGED
|
@@ -39,16 +39,16 @@ module.exports = __toCommonJS(internal_exports);
|
|
|
39
39
|
// src/anthropic-messages-language-model.ts
|
|
40
40
|
var import_provider3 = require("@ai-sdk/provider");
|
|
41
41
|
var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
42
|
-
var
|
|
42
|
+
var z7 = __toESM(require("zod/v4"));
|
|
43
43
|
|
|
44
44
|
// src/anthropic-error.ts
|
|
45
45
|
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
46
|
-
var
|
|
47
|
-
var anthropicErrorDataSchema =
|
|
48
|
-
type:
|
|
49
|
-
error:
|
|
50
|
-
type:
|
|
51
|
-
message:
|
|
46
|
+
var z = __toESM(require("zod/v4"));
|
|
47
|
+
var anthropicErrorDataSchema = z.object({
|
|
48
|
+
type: z.literal("error"),
|
|
49
|
+
error: z.object({
|
|
50
|
+
type: z.string(),
|
|
51
|
+
message: z.string()
|
|
52
52
|
})
|
|
53
53
|
});
|
|
54
54
|
var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
|
|
@@ -57,48 +57,48 @@ var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorRe
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
// src/anthropic-messages-options.ts
|
|
60
|
-
var
|
|
61
|
-
var anthropicFilePartProviderOptions =
|
|
60
|
+
var z2 = __toESM(require("zod/v4"));
|
|
61
|
+
var anthropicFilePartProviderOptions = z2.object({
|
|
62
62
|
/**
|
|
63
63
|
* Citation configuration for this document.
|
|
64
64
|
* When enabled, this document will generate citations in the response.
|
|
65
65
|
*/
|
|
66
|
-
citations:
|
|
66
|
+
citations: z2.object({
|
|
67
67
|
/**
|
|
68
68
|
* Enable citations for this document
|
|
69
69
|
*/
|
|
70
|
-
enabled:
|
|
70
|
+
enabled: z2.boolean()
|
|
71
71
|
}).optional(),
|
|
72
72
|
/**
|
|
73
73
|
* Custom title for the document.
|
|
74
74
|
* If not provided, the filename will be used.
|
|
75
75
|
*/
|
|
76
|
-
title:
|
|
76
|
+
title: z2.string().optional(),
|
|
77
77
|
/**
|
|
78
78
|
* Context about the document that will be passed to the model
|
|
79
79
|
* but not used towards cited content.
|
|
80
80
|
* Useful for storing document metadata as text or stringified JSON.
|
|
81
81
|
*/
|
|
82
|
-
context:
|
|
82
|
+
context: z2.string().optional()
|
|
83
83
|
});
|
|
84
|
-
var anthropicProviderOptions =
|
|
85
|
-
sendReasoning:
|
|
86
|
-
thinking:
|
|
87
|
-
type:
|
|
88
|
-
budgetTokens:
|
|
84
|
+
var anthropicProviderOptions = z2.object({
|
|
85
|
+
sendReasoning: z2.boolean().optional(),
|
|
86
|
+
thinking: z2.object({
|
|
87
|
+
type: z2.union([z2.literal("enabled"), z2.literal("disabled")]),
|
|
88
|
+
budgetTokens: z2.number().optional()
|
|
89
89
|
}).optional(),
|
|
90
90
|
/**
|
|
91
91
|
* Whether to disable parallel function calling during tool use. Default is false.
|
|
92
92
|
* When set to true, Claude will use at most one tool per response.
|
|
93
93
|
*/
|
|
94
|
-
disableParallelToolUse:
|
|
94
|
+
disableParallelToolUse: z2.boolean().optional(),
|
|
95
95
|
/**
|
|
96
96
|
* Cache control settings for this message.
|
|
97
97
|
* See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
|
|
98
98
|
*/
|
|
99
|
-
cacheControl:
|
|
100
|
-
type:
|
|
101
|
-
ttl:
|
|
99
|
+
cacheControl: z2.object({
|
|
100
|
+
type: z2.literal("ephemeral"),
|
|
101
|
+
ttl: z2.union([z2.literal("5m"), z2.literal("1h")]).optional()
|
|
102
102
|
}).optional()
|
|
103
103
|
});
|
|
104
104
|
|
|
@@ -115,21 +115,21 @@ function getCacheControl(providerMetadata) {
|
|
|
115
115
|
|
|
116
116
|
// src/tool/text-editor_20250728.ts
|
|
117
117
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
118
|
-
var
|
|
119
|
-
var textEditor_20250728ArgsSchema =
|
|
120
|
-
maxCharacters:
|
|
118
|
+
var z3 = __toESM(require("zod/v4"));
|
|
119
|
+
var textEditor_20250728ArgsSchema = z3.object({
|
|
120
|
+
maxCharacters: z3.number().optional()
|
|
121
121
|
});
|
|
122
122
|
var factory = (0, import_provider_utils2.createProviderDefinedToolFactory)({
|
|
123
123
|
id: "anthropic.text_editor_20250728",
|
|
124
124
|
name: "str_replace_based_edit_tool",
|
|
125
|
-
inputSchema:
|
|
126
|
-
command:
|
|
127
|
-
path:
|
|
128
|
-
file_text:
|
|
129
|
-
insert_line:
|
|
130
|
-
new_str:
|
|
131
|
-
old_str:
|
|
132
|
-
view_range:
|
|
125
|
+
inputSchema: z3.object({
|
|
126
|
+
command: z3.enum(["view", "create", "str_replace", "insert"]),
|
|
127
|
+
path: z3.string(),
|
|
128
|
+
file_text: z3.string().optional(),
|
|
129
|
+
insert_line: z3.number().int().optional(),
|
|
130
|
+
new_str: z3.string().optional(),
|
|
131
|
+
old_str: z3.string().optional(),
|
|
132
|
+
view_range: z3.array(z3.number().int()).optional()
|
|
133
133
|
})
|
|
134
134
|
});
|
|
135
135
|
var textEditor_20250728 = (args = {}) => {
|
|
@@ -138,33 +138,33 @@ var textEditor_20250728 = (args = {}) => {
|
|
|
138
138
|
|
|
139
139
|
// src/tool/web-search_20250305.ts
|
|
140
140
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
141
|
-
var
|
|
142
|
-
var webSearch_20250305ArgsSchema =
|
|
143
|
-
maxUses:
|
|
144
|
-
allowedDomains:
|
|
145
|
-
blockedDomains:
|
|
146
|
-
userLocation:
|
|
147
|
-
type:
|
|
148
|
-
city:
|
|
149
|
-
region:
|
|
150
|
-
country:
|
|
151
|
-
timezone:
|
|
141
|
+
var z4 = __toESM(require("zod/v4"));
|
|
142
|
+
var webSearch_20250305ArgsSchema = z4.object({
|
|
143
|
+
maxUses: z4.number().optional(),
|
|
144
|
+
allowedDomains: z4.array(z4.string()).optional(),
|
|
145
|
+
blockedDomains: z4.array(z4.string()).optional(),
|
|
146
|
+
userLocation: z4.object({
|
|
147
|
+
type: z4.literal("approximate"),
|
|
148
|
+
city: z4.string().optional(),
|
|
149
|
+
region: z4.string().optional(),
|
|
150
|
+
country: z4.string().optional(),
|
|
151
|
+
timezone: z4.string().optional()
|
|
152
152
|
}).optional()
|
|
153
153
|
});
|
|
154
|
-
var webSearch_20250305OutputSchema =
|
|
155
|
-
|
|
156
|
-
url:
|
|
157
|
-
title:
|
|
158
|
-
pageAge:
|
|
159
|
-
encryptedContent:
|
|
160
|
-
type:
|
|
154
|
+
var webSearch_20250305OutputSchema = z4.array(
|
|
155
|
+
z4.object({
|
|
156
|
+
url: z4.string(),
|
|
157
|
+
title: z4.string(),
|
|
158
|
+
pageAge: z4.string().nullable(),
|
|
159
|
+
encryptedContent: z4.string(),
|
|
160
|
+
type: z4.literal("web_search_result")
|
|
161
161
|
})
|
|
162
162
|
);
|
|
163
163
|
var factory2 = (0, import_provider_utils3.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
164
164
|
id: "anthropic.web_search_20250305",
|
|
165
165
|
name: "web_search",
|
|
166
|
-
inputSchema:
|
|
167
|
-
query:
|
|
166
|
+
inputSchema: z4.object({
|
|
167
|
+
query: z4.string()
|
|
168
168
|
}),
|
|
169
169
|
outputSchema: webSearch_20250305OutputSchema
|
|
170
170
|
});
|
|
@@ -174,41 +174,41 @@ var webSearch_20250305 = (args = {}) => {
|
|
|
174
174
|
|
|
175
175
|
// src/tool/web-fetch-20250910.ts
|
|
176
176
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
177
|
-
var
|
|
178
|
-
var webFetch_20250910ArgsSchema =
|
|
179
|
-
maxUses:
|
|
180
|
-
allowedDomains:
|
|
181
|
-
blockedDomains:
|
|
182
|
-
citations:
|
|
183
|
-
maxContentTokens:
|
|
177
|
+
var z5 = __toESM(require("zod/v4"));
|
|
178
|
+
var webFetch_20250910ArgsSchema = z5.object({
|
|
179
|
+
maxUses: z5.number().optional(),
|
|
180
|
+
allowedDomains: z5.array(z5.string()).optional(),
|
|
181
|
+
blockedDomains: z5.array(z5.string()).optional(),
|
|
182
|
+
citations: z5.object({ enabled: z5.boolean() }).optional(),
|
|
183
|
+
maxContentTokens: z5.number().optional()
|
|
184
184
|
});
|
|
185
|
-
var webFetch_20250910OutputSchema =
|
|
186
|
-
type:
|
|
187
|
-
url:
|
|
188
|
-
content:
|
|
189
|
-
type:
|
|
190
|
-
title:
|
|
191
|
-
citations:
|
|
192
|
-
source:
|
|
193
|
-
|
|
194
|
-
type:
|
|
195
|
-
mediaType:
|
|
196
|
-
data:
|
|
185
|
+
var webFetch_20250910OutputSchema = z5.object({
|
|
186
|
+
type: z5.literal("web_fetch_result"),
|
|
187
|
+
url: z5.string(),
|
|
188
|
+
content: z5.object({
|
|
189
|
+
type: z5.literal("document"),
|
|
190
|
+
title: z5.string(),
|
|
191
|
+
citations: z5.object({ enabled: z5.boolean() }).optional(),
|
|
192
|
+
source: z5.union([
|
|
193
|
+
z5.object({
|
|
194
|
+
type: z5.literal("base64"),
|
|
195
|
+
mediaType: z5.literal("application/pdf"),
|
|
196
|
+
data: z5.string()
|
|
197
197
|
}),
|
|
198
|
-
|
|
199
|
-
type:
|
|
200
|
-
mediaType:
|
|
201
|
-
data:
|
|
198
|
+
z5.object({
|
|
199
|
+
type: z5.literal("text"),
|
|
200
|
+
mediaType: z5.literal("text/plain"),
|
|
201
|
+
data: z5.string()
|
|
202
202
|
})
|
|
203
203
|
])
|
|
204
204
|
}),
|
|
205
|
-
retrievedAt:
|
|
205
|
+
retrievedAt: z5.string().nullable()
|
|
206
206
|
});
|
|
207
207
|
var factory3 = (0, import_provider_utils4.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
208
208
|
id: "anthropic.web_fetch_20250910",
|
|
209
209
|
name: "web_fetch",
|
|
210
|
-
inputSchema:
|
|
211
|
-
url:
|
|
210
|
+
inputSchema: z5.object({
|
|
211
|
+
url: z5.string()
|
|
212
212
|
}),
|
|
213
213
|
outputSchema: webFetch_20250910OutputSchema
|
|
214
214
|
});
|
|
@@ -419,18 +419,18 @@ var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
|
419
419
|
|
|
420
420
|
// src/tool/code-execution_20250522.ts
|
|
421
421
|
var import_provider_utils5 = require("@ai-sdk/provider-utils");
|
|
422
|
-
var
|
|
423
|
-
var codeExecution_20250522OutputSchema =
|
|
424
|
-
type:
|
|
425
|
-
stdout:
|
|
426
|
-
stderr:
|
|
427
|
-
return_code:
|
|
422
|
+
var z6 = __toESM(require("zod/v4"));
|
|
423
|
+
var codeExecution_20250522OutputSchema = z6.object({
|
|
424
|
+
type: z6.literal("code_execution_result"),
|
|
425
|
+
stdout: z6.string(),
|
|
426
|
+
stderr: z6.string(),
|
|
427
|
+
return_code: z6.number()
|
|
428
428
|
});
|
|
429
429
|
var factory4 = (0, import_provider_utils5.createProviderDefinedToolFactoryWithOutputSchema)({
|
|
430
430
|
id: "anthropic.code_execution_20250522",
|
|
431
431
|
name: "code_execution",
|
|
432
|
-
inputSchema:
|
|
433
|
-
code:
|
|
432
|
+
inputSchema: z6.object({
|
|
433
|
+
code: z6.string()
|
|
434
434
|
}),
|
|
435
435
|
outputSchema: codeExecution_20250522OutputSchema
|
|
436
436
|
});
|
|
@@ -460,7 +460,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
460
460
|
sendReasoning,
|
|
461
461
|
warnings
|
|
462
462
|
}) {
|
|
463
|
-
var _a, _b, _c, _d, _e;
|
|
463
|
+
var _a, _b, _c, _d, _e, _f;
|
|
464
464
|
const betas = /* @__PURE__ */ new Set();
|
|
465
465
|
const blocks = groupIntoBlocks(prompt);
|
|
466
466
|
let system = void 0;
|
|
@@ -636,6 +636,9 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
636
636
|
case "error-text":
|
|
637
637
|
contentValue = output.value;
|
|
638
638
|
break;
|
|
639
|
+
case "execution-denied":
|
|
640
|
+
contentValue = (_e = output.reason) != null ? _e : "Tool execution denied.";
|
|
641
|
+
break;
|
|
639
642
|
case "json":
|
|
640
643
|
case "error-json":
|
|
641
644
|
default:
|
|
@@ -670,7 +673,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
670
673
|
for (let k = 0; k < content.length; k++) {
|
|
671
674
|
const part = content[k];
|
|
672
675
|
const isLastContentPart = k === content.length - 1;
|
|
673
|
-
const cacheControl = (
|
|
676
|
+
const cacheControl = (_f = getCacheControl(part.providerOptions)) != null ? _f : isLastContentPart ? getCacheControl(message.providerOptions) : void 0;
|
|
674
677
|
switch (part.type) {
|
|
675
678
|
case "text": {
|
|
676
679
|
anthropicContent.push({
|
|
@@ -930,36 +933,36 @@ function mapAnthropicStopReason({
|
|
|
930
933
|
|
|
931
934
|
// src/anthropic-messages-language-model.ts
|
|
932
935
|
var citationSchemas = {
|
|
933
|
-
webSearchResult:
|
|
934
|
-
type:
|
|
935
|
-
cited_text:
|
|
936
|
-
url:
|
|
937
|
-
title:
|
|
938
|
-
encrypted_index:
|
|
936
|
+
webSearchResult: z7.object({
|
|
937
|
+
type: z7.literal("web_search_result_location"),
|
|
938
|
+
cited_text: z7.string(),
|
|
939
|
+
url: z7.string(),
|
|
940
|
+
title: z7.string(),
|
|
941
|
+
encrypted_index: z7.string()
|
|
939
942
|
}),
|
|
940
|
-
pageLocation:
|
|
941
|
-
type:
|
|
942
|
-
cited_text:
|
|
943
|
-
document_index:
|
|
944
|
-
document_title:
|
|
945
|
-
start_page_number:
|
|
946
|
-
end_page_number:
|
|
943
|
+
pageLocation: z7.object({
|
|
944
|
+
type: z7.literal("page_location"),
|
|
945
|
+
cited_text: z7.string(),
|
|
946
|
+
document_index: z7.number(),
|
|
947
|
+
document_title: z7.string().nullable(),
|
|
948
|
+
start_page_number: z7.number(),
|
|
949
|
+
end_page_number: z7.number()
|
|
947
950
|
}),
|
|
948
|
-
charLocation:
|
|
949
|
-
type:
|
|
950
|
-
cited_text:
|
|
951
|
-
document_index:
|
|
952
|
-
document_title:
|
|
953
|
-
start_char_index:
|
|
954
|
-
end_char_index:
|
|
951
|
+
charLocation: z7.object({
|
|
952
|
+
type: z7.literal("char_location"),
|
|
953
|
+
cited_text: z7.string(),
|
|
954
|
+
document_index: z7.number(),
|
|
955
|
+
document_title: z7.string().nullable(),
|
|
956
|
+
start_char_index: z7.number(),
|
|
957
|
+
end_char_index: z7.number()
|
|
955
958
|
})
|
|
956
959
|
};
|
|
957
|
-
var citationSchema =
|
|
960
|
+
var citationSchema = z7.discriminatedUnion("type", [
|
|
958
961
|
citationSchemas.webSearchResult,
|
|
959
962
|
citationSchemas.pageLocation,
|
|
960
963
|
citationSchemas.charLocation
|
|
961
964
|
]);
|
|
962
|
-
var documentCitationSchema =
|
|
965
|
+
var documentCitationSchema = z7.discriminatedUnion("type", [
|
|
963
966
|
citationSchemas.pageLocation,
|
|
964
967
|
citationSchemas.charLocation
|
|
965
968
|
]);
|
|
@@ -1207,7 +1210,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1207
1210
|
});
|
|
1208
1211
|
}
|
|
1209
1212
|
async doGenerate(options) {
|
|
1210
|
-
var _a, _b, _c, _d, _e;
|
|
1213
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1211
1214
|
const { args, warnings, betas, usesJsonResponseTool } = await this.getArgs(options);
|
|
1212
1215
|
const citationDocuments = this.extractCitationDocuments(options.prompt);
|
|
1213
1216
|
const {
|
|
@@ -1434,7 +1437,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1434
1437
|
providerMetadata: {
|
|
1435
1438
|
anthropic: {
|
|
1436
1439
|
usage: response.usage,
|
|
1437
|
-
cacheCreationInputTokens: (_e = response.usage.cache_creation_input_tokens) != null ? _e : null
|
|
1440
|
+
cacheCreationInputTokens: (_e = response.usage.cache_creation_input_tokens) != null ? _e : null,
|
|
1441
|
+
stopSequence: (_f = response.stop_sequence) != null ? _f : null
|
|
1438
1442
|
}
|
|
1439
1443
|
}
|
|
1440
1444
|
};
|
|
@@ -1463,6 +1467,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1463
1467
|
const contentBlocks = {};
|
|
1464
1468
|
let rawUsage = void 0;
|
|
1465
1469
|
let cacheCreationInputTokens = null;
|
|
1470
|
+
let stopSequence = null;
|
|
1466
1471
|
let blockType = void 0;
|
|
1467
1472
|
const generateId2 = this.generateId;
|
|
1468
1473
|
return {
|
|
@@ -1472,7 +1477,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1472
1477
|
controller.enqueue({ type: "stream-start", warnings });
|
|
1473
1478
|
},
|
|
1474
1479
|
transform(chunk, controller) {
|
|
1475
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1480
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1476
1481
|
if (options.includeRawChunks) {
|
|
1477
1482
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
1478
1483
|
}
|
|
@@ -1810,6 +1815,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1810
1815
|
finishReason: value.delta.stop_reason,
|
|
1811
1816
|
isJsonResponseFromTool: usesJsonResponseTool
|
|
1812
1817
|
});
|
|
1818
|
+
stopSequence = (_h = value.delta.stop_sequence) != null ? _h : null;
|
|
1813
1819
|
rawUsage = {
|
|
1814
1820
|
...rawUsage,
|
|
1815
1821
|
...value.usage
|
|
@@ -1824,7 +1830,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1824
1830
|
providerMetadata: {
|
|
1825
1831
|
anthropic: {
|
|
1826
1832
|
usage: rawUsage != null ? rawUsage : null,
|
|
1827
|
-
cacheCreationInputTokens
|
|
1833
|
+
cacheCreationInputTokens,
|
|
1834
|
+
stopSequence
|
|
1828
1835
|
}
|
|
1829
1836
|
}
|
|
1830
1837
|
});
|
|
@@ -1847,299 +1854,303 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1847
1854
|
};
|
|
1848
1855
|
}
|
|
1849
1856
|
};
|
|
1850
|
-
var anthropicMessagesResponseSchema =
|
|
1851
|
-
type:
|
|
1852
|
-
id:
|
|
1853
|
-
model:
|
|
1854
|
-
content:
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
type:
|
|
1858
|
-
text:
|
|
1859
|
-
citations:
|
|
1857
|
+
var anthropicMessagesResponseSchema = z7.object({
|
|
1858
|
+
type: z7.literal("message"),
|
|
1859
|
+
id: z7.string().nullish(),
|
|
1860
|
+
model: z7.string().nullish(),
|
|
1861
|
+
content: z7.array(
|
|
1862
|
+
z7.discriminatedUnion("type", [
|
|
1863
|
+
z7.object({
|
|
1864
|
+
type: z7.literal("text"),
|
|
1865
|
+
text: z7.string(),
|
|
1866
|
+
citations: z7.array(citationSchema).optional()
|
|
1860
1867
|
}),
|
|
1861
|
-
|
|
1862
|
-
type:
|
|
1863
|
-
thinking:
|
|
1864
|
-
signature:
|
|
1868
|
+
z7.object({
|
|
1869
|
+
type: z7.literal("thinking"),
|
|
1870
|
+
thinking: z7.string(),
|
|
1871
|
+
signature: z7.string()
|
|
1865
1872
|
}),
|
|
1866
|
-
|
|
1867
|
-
type:
|
|
1868
|
-
data:
|
|
1873
|
+
z7.object({
|
|
1874
|
+
type: z7.literal("redacted_thinking"),
|
|
1875
|
+
data: z7.string()
|
|
1869
1876
|
}),
|
|
1870
|
-
|
|
1871
|
-
type:
|
|
1872
|
-
id:
|
|
1873
|
-
name:
|
|
1874
|
-
input:
|
|
1877
|
+
z7.object({
|
|
1878
|
+
type: z7.literal("tool_use"),
|
|
1879
|
+
id: z7.string(),
|
|
1880
|
+
name: z7.string(),
|
|
1881
|
+
input: z7.unknown()
|
|
1875
1882
|
}),
|
|
1876
|
-
|
|
1877
|
-
type:
|
|
1878
|
-
id:
|
|
1879
|
-
name:
|
|
1880
|
-
input:
|
|
1883
|
+
z7.object({
|
|
1884
|
+
type: z7.literal("server_tool_use"),
|
|
1885
|
+
id: z7.string(),
|
|
1886
|
+
name: z7.string(),
|
|
1887
|
+
input: z7.record(z7.string(), z7.unknown()).nullish()
|
|
1881
1888
|
}),
|
|
1882
|
-
|
|
1883
|
-
type:
|
|
1884
|
-
tool_use_id:
|
|
1885
|
-
content:
|
|
1886
|
-
|
|
1887
|
-
type:
|
|
1888
|
-
url:
|
|
1889
|
-
retrieved_at:
|
|
1890
|
-
content:
|
|
1891
|
-
type:
|
|
1892
|
-
title:
|
|
1893
|
-
citations:
|
|
1894
|
-
source:
|
|
1895
|
-
type:
|
|
1896
|
-
media_type:
|
|
1897
|
-
data:
|
|
1889
|
+
z7.object({
|
|
1890
|
+
type: z7.literal("web_fetch_tool_result"),
|
|
1891
|
+
tool_use_id: z7.string(),
|
|
1892
|
+
content: z7.union([
|
|
1893
|
+
z7.object({
|
|
1894
|
+
type: z7.literal("web_fetch_result"),
|
|
1895
|
+
url: z7.string(),
|
|
1896
|
+
retrieved_at: z7.string(),
|
|
1897
|
+
content: z7.object({
|
|
1898
|
+
type: z7.literal("document"),
|
|
1899
|
+
title: z7.string().nullable(),
|
|
1900
|
+
citations: z7.object({ enabled: z7.boolean() }).optional(),
|
|
1901
|
+
source: z7.object({
|
|
1902
|
+
type: z7.literal("text"),
|
|
1903
|
+
media_type: z7.string(),
|
|
1904
|
+
data: z7.string()
|
|
1898
1905
|
})
|
|
1899
1906
|
})
|
|
1900
1907
|
}),
|
|
1901
|
-
|
|
1902
|
-
type:
|
|
1903
|
-
error_code:
|
|
1908
|
+
z7.object({
|
|
1909
|
+
type: z7.literal("web_fetch_tool_result_error"),
|
|
1910
|
+
error_code: z7.string()
|
|
1904
1911
|
})
|
|
1905
1912
|
])
|
|
1906
1913
|
}),
|
|
1907
|
-
|
|
1908
|
-
type:
|
|
1909
|
-
tool_use_id:
|
|
1910
|
-
content:
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
type:
|
|
1914
|
-
url:
|
|
1915
|
-
title:
|
|
1916
|
-
encrypted_content:
|
|
1917
|
-
page_age:
|
|
1914
|
+
z7.object({
|
|
1915
|
+
type: z7.literal("web_search_tool_result"),
|
|
1916
|
+
tool_use_id: z7.string(),
|
|
1917
|
+
content: z7.union([
|
|
1918
|
+
z7.array(
|
|
1919
|
+
z7.object({
|
|
1920
|
+
type: z7.literal("web_search_result"),
|
|
1921
|
+
url: z7.string(),
|
|
1922
|
+
title: z7.string(),
|
|
1923
|
+
encrypted_content: z7.string(),
|
|
1924
|
+
page_age: z7.string().nullish()
|
|
1918
1925
|
})
|
|
1919
1926
|
),
|
|
1920
|
-
|
|
1921
|
-
type:
|
|
1922
|
-
error_code:
|
|
1927
|
+
z7.object({
|
|
1928
|
+
type: z7.literal("web_search_tool_result_error"),
|
|
1929
|
+
error_code: z7.string()
|
|
1923
1930
|
})
|
|
1924
1931
|
])
|
|
1925
1932
|
}),
|
|
1926
|
-
|
|
1927
|
-
type:
|
|
1928
|
-
tool_use_id:
|
|
1929
|
-
content:
|
|
1930
|
-
|
|
1931
|
-
type:
|
|
1932
|
-
stdout:
|
|
1933
|
-
stderr:
|
|
1934
|
-
return_code:
|
|
1933
|
+
z7.object({
|
|
1934
|
+
type: z7.literal("code_execution_tool_result"),
|
|
1935
|
+
tool_use_id: z7.string(),
|
|
1936
|
+
content: z7.union([
|
|
1937
|
+
z7.object({
|
|
1938
|
+
type: z7.literal("code_execution_result"),
|
|
1939
|
+
stdout: z7.string(),
|
|
1940
|
+
stderr: z7.string(),
|
|
1941
|
+
return_code: z7.number()
|
|
1935
1942
|
}),
|
|
1936
|
-
|
|
1937
|
-
type:
|
|
1938
|
-
error_code:
|
|
1943
|
+
z7.object({
|
|
1944
|
+
type: z7.literal("code_execution_tool_result_error"),
|
|
1945
|
+
error_code: z7.string()
|
|
1939
1946
|
})
|
|
1940
1947
|
])
|
|
1941
1948
|
})
|
|
1942
1949
|
])
|
|
1943
1950
|
),
|
|
1944
|
-
stop_reason:
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1951
|
+
stop_reason: z7.string().nullish(),
|
|
1952
|
+
stop_sequence: z7.string().nullish(),
|
|
1953
|
+
usage: z7.looseObject({
|
|
1954
|
+
input_tokens: z7.number(),
|
|
1955
|
+
output_tokens: z7.number(),
|
|
1956
|
+
cache_creation_input_tokens: z7.number().nullish(),
|
|
1957
|
+
cache_read_input_tokens: z7.number().nullish()
|
|
1950
1958
|
})
|
|
1951
1959
|
});
|
|
1952
|
-
var anthropicMessagesChunkSchema =
|
|
1953
|
-
|
|
1954
|
-
type:
|
|
1955
|
-
message:
|
|
1956
|
-
id:
|
|
1957
|
-
model:
|
|
1958
|
-
usage:
|
|
1959
|
-
input_tokens:
|
|
1960
|
-
cache_creation_input_tokens:
|
|
1961
|
-
cache_read_input_tokens:
|
|
1960
|
+
var anthropicMessagesChunkSchema = z7.discriminatedUnion("type", [
|
|
1961
|
+
z7.object({
|
|
1962
|
+
type: z7.literal("message_start"),
|
|
1963
|
+
message: z7.object({
|
|
1964
|
+
id: z7.string().nullish(),
|
|
1965
|
+
model: z7.string().nullish(),
|
|
1966
|
+
usage: z7.looseObject({
|
|
1967
|
+
input_tokens: z7.number(),
|
|
1968
|
+
cache_creation_input_tokens: z7.number().nullish(),
|
|
1969
|
+
cache_read_input_tokens: z7.number().nullish()
|
|
1962
1970
|
})
|
|
1963
1971
|
})
|
|
1964
1972
|
}),
|
|
1965
|
-
|
|
1966
|
-
type:
|
|
1967
|
-
index:
|
|
1968
|
-
content_block:
|
|
1969
|
-
|
|
1970
|
-
type:
|
|
1971
|
-
text:
|
|
1973
|
+
z7.object({
|
|
1974
|
+
type: z7.literal("content_block_start"),
|
|
1975
|
+
index: z7.number(),
|
|
1976
|
+
content_block: z7.discriminatedUnion("type", [
|
|
1977
|
+
z7.object({
|
|
1978
|
+
type: z7.literal("text"),
|
|
1979
|
+
text: z7.string()
|
|
1972
1980
|
}),
|
|
1973
|
-
|
|
1974
|
-
type:
|
|
1975
|
-
thinking:
|
|
1981
|
+
z7.object({
|
|
1982
|
+
type: z7.literal("thinking"),
|
|
1983
|
+
thinking: z7.string()
|
|
1976
1984
|
}),
|
|
1977
|
-
|
|
1978
|
-
type:
|
|
1979
|
-
id:
|
|
1980
|
-
name:
|
|
1985
|
+
z7.object({
|
|
1986
|
+
type: z7.literal("tool_use"),
|
|
1987
|
+
id: z7.string(),
|
|
1988
|
+
name: z7.string()
|
|
1981
1989
|
}),
|
|
1982
|
-
|
|
1983
|
-
type:
|
|
1984
|
-
data:
|
|
1990
|
+
z7.object({
|
|
1991
|
+
type: z7.literal("redacted_thinking"),
|
|
1992
|
+
data: z7.string()
|
|
1985
1993
|
}),
|
|
1986
|
-
|
|
1987
|
-
type:
|
|
1988
|
-
id:
|
|
1989
|
-
name:
|
|
1990
|
-
input:
|
|
1994
|
+
z7.object({
|
|
1995
|
+
type: z7.literal("server_tool_use"),
|
|
1996
|
+
id: z7.string(),
|
|
1997
|
+
name: z7.string(),
|
|
1998
|
+
input: z7.record(z7.string(), z7.unknown()).nullish()
|
|
1991
1999
|
}),
|
|
1992
|
-
|
|
1993
|
-
type:
|
|
1994
|
-
tool_use_id:
|
|
1995
|
-
content:
|
|
1996
|
-
|
|
1997
|
-
type:
|
|
1998
|
-
url:
|
|
1999
|
-
retrieved_at:
|
|
2000
|
-
content:
|
|
2001
|
-
type:
|
|
2002
|
-
title:
|
|
2003
|
-
citations:
|
|
2004
|
-
source:
|
|
2005
|
-
type:
|
|
2006
|
-
media_type:
|
|
2007
|
-
data:
|
|
2000
|
+
z7.object({
|
|
2001
|
+
type: z7.literal("web_fetch_tool_result"),
|
|
2002
|
+
tool_use_id: z7.string(),
|
|
2003
|
+
content: z7.union([
|
|
2004
|
+
z7.object({
|
|
2005
|
+
type: z7.literal("web_fetch_result"),
|
|
2006
|
+
url: z7.string(),
|
|
2007
|
+
retrieved_at: z7.string(),
|
|
2008
|
+
content: z7.object({
|
|
2009
|
+
type: z7.literal("document"),
|
|
2010
|
+
title: z7.string().nullable(),
|
|
2011
|
+
citations: z7.object({ enabled: z7.boolean() }).optional(),
|
|
2012
|
+
source: z7.object({
|
|
2013
|
+
type: z7.literal("text"),
|
|
2014
|
+
media_type: z7.string(),
|
|
2015
|
+
data: z7.string()
|
|
2008
2016
|
})
|
|
2009
2017
|
})
|
|
2010
2018
|
}),
|
|
2011
|
-
|
|
2012
|
-
type:
|
|
2013
|
-
error_code:
|
|
2019
|
+
z7.object({
|
|
2020
|
+
type: z7.literal("web_fetch_tool_result_error"),
|
|
2021
|
+
error_code: z7.string()
|
|
2014
2022
|
})
|
|
2015
2023
|
])
|
|
2016
2024
|
}),
|
|
2017
|
-
|
|
2018
|
-
type:
|
|
2019
|
-
tool_use_id:
|
|
2020
|
-
content:
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
type:
|
|
2024
|
-
url:
|
|
2025
|
-
title:
|
|
2026
|
-
encrypted_content:
|
|
2027
|
-
page_age:
|
|
2025
|
+
z7.object({
|
|
2026
|
+
type: z7.literal("web_search_tool_result"),
|
|
2027
|
+
tool_use_id: z7.string(),
|
|
2028
|
+
content: z7.union([
|
|
2029
|
+
z7.array(
|
|
2030
|
+
z7.object({
|
|
2031
|
+
type: z7.literal("web_search_result"),
|
|
2032
|
+
url: z7.string(),
|
|
2033
|
+
title: z7.string(),
|
|
2034
|
+
encrypted_content: z7.string(),
|
|
2035
|
+
page_age: z7.string().nullish()
|
|
2028
2036
|
})
|
|
2029
2037
|
),
|
|
2030
|
-
|
|
2031
|
-
type:
|
|
2032
|
-
error_code:
|
|
2038
|
+
z7.object({
|
|
2039
|
+
type: z7.literal("web_search_tool_result_error"),
|
|
2040
|
+
error_code: z7.string()
|
|
2033
2041
|
})
|
|
2034
2042
|
])
|
|
2035
2043
|
}),
|
|
2036
|
-
|
|
2037
|
-
type:
|
|
2038
|
-
tool_use_id:
|
|
2039
|
-
content:
|
|
2040
|
-
|
|
2041
|
-
type:
|
|
2042
|
-
stdout:
|
|
2043
|
-
stderr:
|
|
2044
|
-
return_code:
|
|
2044
|
+
z7.object({
|
|
2045
|
+
type: z7.literal("code_execution_tool_result"),
|
|
2046
|
+
tool_use_id: z7.string(),
|
|
2047
|
+
content: z7.union([
|
|
2048
|
+
z7.object({
|
|
2049
|
+
type: z7.literal("code_execution_result"),
|
|
2050
|
+
stdout: z7.string(),
|
|
2051
|
+
stderr: z7.string(),
|
|
2052
|
+
return_code: z7.number()
|
|
2045
2053
|
}),
|
|
2046
|
-
|
|
2047
|
-
type:
|
|
2048
|
-
error_code:
|
|
2054
|
+
z7.object({
|
|
2055
|
+
type: z7.literal("code_execution_tool_result_error"),
|
|
2056
|
+
error_code: z7.string()
|
|
2049
2057
|
})
|
|
2050
2058
|
])
|
|
2051
2059
|
})
|
|
2052
2060
|
])
|
|
2053
2061
|
}),
|
|
2054
|
-
|
|
2055
|
-
type:
|
|
2056
|
-
index:
|
|
2057
|
-
delta:
|
|
2058
|
-
|
|
2059
|
-
type:
|
|
2060
|
-
partial_json:
|
|
2062
|
+
z7.object({
|
|
2063
|
+
type: z7.literal("content_block_delta"),
|
|
2064
|
+
index: z7.number(),
|
|
2065
|
+
delta: z7.discriminatedUnion("type", [
|
|
2066
|
+
z7.object({
|
|
2067
|
+
type: z7.literal("input_json_delta"),
|
|
2068
|
+
partial_json: z7.string()
|
|
2061
2069
|
}),
|
|
2062
|
-
|
|
2063
|
-
type:
|
|
2064
|
-
text:
|
|
2070
|
+
z7.object({
|
|
2071
|
+
type: z7.literal("text_delta"),
|
|
2072
|
+
text: z7.string()
|
|
2065
2073
|
}),
|
|
2066
|
-
|
|
2067
|
-
type:
|
|
2068
|
-
thinking:
|
|
2074
|
+
z7.object({
|
|
2075
|
+
type: z7.literal("thinking_delta"),
|
|
2076
|
+
thinking: z7.string()
|
|
2069
2077
|
}),
|
|
2070
|
-
|
|
2071
|
-
type:
|
|
2072
|
-
signature:
|
|
2078
|
+
z7.object({
|
|
2079
|
+
type: z7.literal("signature_delta"),
|
|
2080
|
+
signature: z7.string()
|
|
2073
2081
|
}),
|
|
2074
|
-
|
|
2075
|
-
type:
|
|
2082
|
+
z7.object({
|
|
2083
|
+
type: z7.literal("citations_delta"),
|
|
2076
2084
|
citation: citationSchema
|
|
2077
2085
|
})
|
|
2078
2086
|
])
|
|
2079
2087
|
}),
|
|
2080
|
-
|
|
2081
|
-
type:
|
|
2082
|
-
index:
|
|
2088
|
+
z7.object({
|
|
2089
|
+
type: z7.literal("content_block_stop"),
|
|
2090
|
+
index: z7.number()
|
|
2083
2091
|
}),
|
|
2084
|
-
|
|
2085
|
-
type:
|
|
2086
|
-
error:
|
|
2087
|
-
type:
|
|
2088
|
-
message:
|
|
2092
|
+
z7.object({
|
|
2093
|
+
type: z7.literal("error"),
|
|
2094
|
+
error: z7.object({
|
|
2095
|
+
type: z7.string(),
|
|
2096
|
+
message: z7.string()
|
|
2089
2097
|
})
|
|
2090
2098
|
}),
|
|
2091
|
-
|
|
2092
|
-
type:
|
|
2093
|
-
delta:
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2099
|
+
z7.object({
|
|
2100
|
+
type: z7.literal("message_delta"),
|
|
2101
|
+
delta: z7.object({
|
|
2102
|
+
stop_reason: z7.string().nullish(),
|
|
2103
|
+
stop_sequence: z7.string().nullish()
|
|
2104
|
+
}),
|
|
2105
|
+
usage: z7.looseObject({
|
|
2106
|
+
output_tokens: z7.number(),
|
|
2107
|
+
cache_creation_input_tokens: z7.number().nullish()
|
|
2097
2108
|
})
|
|
2098
2109
|
}),
|
|
2099
|
-
|
|
2100
|
-
type:
|
|
2110
|
+
z7.object({
|
|
2111
|
+
type: z7.literal("message_stop")
|
|
2101
2112
|
}),
|
|
2102
|
-
|
|
2103
|
-
type:
|
|
2113
|
+
z7.object({
|
|
2114
|
+
type: z7.literal("ping")
|
|
2104
2115
|
})
|
|
2105
2116
|
]);
|
|
2106
|
-
var anthropicReasoningMetadataSchema =
|
|
2107
|
-
signature:
|
|
2108
|
-
redactedData:
|
|
2117
|
+
var anthropicReasoningMetadataSchema = z7.object({
|
|
2118
|
+
signature: z7.string().optional(),
|
|
2119
|
+
redactedData: z7.string().optional()
|
|
2109
2120
|
});
|
|
2110
2121
|
|
|
2111
2122
|
// src/tool/bash_20241022.ts
|
|
2112
2123
|
var import_provider_utils8 = require("@ai-sdk/provider-utils");
|
|
2113
|
-
var
|
|
2124
|
+
var import_v4 = __toESM(require("zod/v4"));
|
|
2114
2125
|
var bash_20241022 = (0, import_provider_utils8.createProviderDefinedToolFactory)({
|
|
2115
2126
|
id: "anthropic.bash_20241022",
|
|
2116
2127
|
name: "bash",
|
|
2117
|
-
inputSchema:
|
|
2118
|
-
command:
|
|
2119
|
-
restart:
|
|
2128
|
+
inputSchema: import_v4.default.object({
|
|
2129
|
+
command: import_v4.default.string(),
|
|
2130
|
+
restart: import_v4.default.boolean().optional()
|
|
2120
2131
|
})
|
|
2121
2132
|
});
|
|
2122
2133
|
|
|
2123
2134
|
// src/tool/bash_20250124.ts
|
|
2124
2135
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
|
2125
|
-
var
|
|
2136
|
+
var import_v42 = __toESM(require("zod/v4"));
|
|
2126
2137
|
var bash_20250124 = (0, import_provider_utils9.createProviderDefinedToolFactory)({
|
|
2127
2138
|
id: "anthropic.bash_20250124",
|
|
2128
2139
|
name: "bash",
|
|
2129
|
-
inputSchema:
|
|
2130
|
-
command:
|
|
2131
|
-
restart:
|
|
2140
|
+
inputSchema: import_v42.default.object({
|
|
2141
|
+
command: import_v42.default.string(),
|
|
2142
|
+
restart: import_v42.default.boolean().optional()
|
|
2132
2143
|
})
|
|
2133
2144
|
});
|
|
2134
2145
|
|
|
2135
2146
|
// src/tool/computer_20241022.ts
|
|
2136
2147
|
var import_provider_utils10 = require("@ai-sdk/provider-utils");
|
|
2137
|
-
var
|
|
2148
|
+
var z10 = __toESM(require("zod/v4"));
|
|
2138
2149
|
var computer_20241022 = (0, import_provider_utils10.createProviderDefinedToolFactory)({
|
|
2139
2150
|
id: "anthropic.computer_20241022",
|
|
2140
2151
|
name: "computer",
|
|
2141
|
-
inputSchema:
|
|
2142
|
-
action:
|
|
2152
|
+
inputSchema: z10.object({
|
|
2153
|
+
action: z10.enum([
|
|
2143
2154
|
"key",
|
|
2144
2155
|
"type",
|
|
2145
2156
|
"mouse_move",
|
|
@@ -2151,19 +2162,19 @@ var computer_20241022 = (0, import_provider_utils10.createProviderDefinedToolFac
|
|
|
2151
2162
|
"screenshot",
|
|
2152
2163
|
"cursor_position"
|
|
2153
2164
|
]),
|
|
2154
|
-
coordinate:
|
|
2155
|
-
text:
|
|
2165
|
+
coordinate: z10.array(z10.number().int()).optional(),
|
|
2166
|
+
text: z10.string().optional()
|
|
2156
2167
|
})
|
|
2157
2168
|
});
|
|
2158
2169
|
|
|
2159
2170
|
// src/tool/computer_20250124.ts
|
|
2160
2171
|
var import_provider_utils11 = require("@ai-sdk/provider-utils");
|
|
2161
|
-
var
|
|
2172
|
+
var z11 = __toESM(require("zod/v4"));
|
|
2162
2173
|
var computer_20250124 = (0, import_provider_utils11.createProviderDefinedToolFactory)({
|
|
2163
2174
|
id: "anthropic.computer_20250124",
|
|
2164
2175
|
name: "computer",
|
|
2165
|
-
inputSchema:
|
|
2166
|
-
action:
|
|
2176
|
+
inputSchema: z11.object({
|
|
2177
|
+
action: z11.enum([
|
|
2167
2178
|
"key",
|
|
2168
2179
|
"hold_key",
|
|
2169
2180
|
"type",
|
|
@@ -2181,63 +2192,63 @@ var computer_20250124 = (0, import_provider_utils11.createProviderDefinedToolFac
|
|
|
2181
2192
|
"wait",
|
|
2182
2193
|
"screenshot"
|
|
2183
2194
|
]),
|
|
2184
|
-
coordinate:
|
|
2185
|
-
duration:
|
|
2186
|
-
scroll_amount:
|
|
2187
|
-
scroll_direction:
|
|
2188
|
-
start_coordinate:
|
|
2189
|
-
text:
|
|
2195
|
+
coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
|
|
2196
|
+
duration: z11.number().optional(),
|
|
2197
|
+
scroll_amount: z11.number().optional(),
|
|
2198
|
+
scroll_direction: z11.enum(["up", "down", "left", "right"]).optional(),
|
|
2199
|
+
start_coordinate: z11.tuple([z11.number().int(), z11.number().int()]).optional(),
|
|
2200
|
+
text: z11.string().optional()
|
|
2190
2201
|
})
|
|
2191
2202
|
});
|
|
2192
2203
|
|
|
2193
2204
|
// src/tool/text-editor_20241022.ts
|
|
2194
2205
|
var import_provider_utils12 = require("@ai-sdk/provider-utils");
|
|
2195
|
-
var
|
|
2206
|
+
var z12 = __toESM(require("zod/v4"));
|
|
2196
2207
|
var textEditor_20241022 = (0, import_provider_utils12.createProviderDefinedToolFactory)({
|
|
2197
2208
|
id: "anthropic.text_editor_20241022",
|
|
2198
2209
|
name: "str_replace_editor",
|
|
2199
|
-
inputSchema:
|
|
2200
|
-
command:
|
|
2201
|
-
path:
|
|
2202
|
-
file_text:
|
|
2203
|
-
insert_line:
|
|
2204
|
-
new_str:
|
|
2205
|
-
old_str:
|
|
2206
|
-
view_range:
|
|
2210
|
+
inputSchema: z12.object({
|
|
2211
|
+
command: z12.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
2212
|
+
path: z12.string(),
|
|
2213
|
+
file_text: z12.string().optional(),
|
|
2214
|
+
insert_line: z12.number().int().optional(),
|
|
2215
|
+
new_str: z12.string().optional(),
|
|
2216
|
+
old_str: z12.string().optional(),
|
|
2217
|
+
view_range: z12.array(z12.number().int()).optional()
|
|
2207
2218
|
})
|
|
2208
2219
|
});
|
|
2209
2220
|
|
|
2210
2221
|
// src/tool/text-editor_20250124.ts
|
|
2211
2222
|
var import_provider_utils13 = require("@ai-sdk/provider-utils");
|
|
2212
|
-
var
|
|
2223
|
+
var z13 = __toESM(require("zod/v4"));
|
|
2213
2224
|
var textEditor_20250124 = (0, import_provider_utils13.createProviderDefinedToolFactory)({
|
|
2214
2225
|
id: "anthropic.text_editor_20250124",
|
|
2215
2226
|
name: "str_replace_editor",
|
|
2216
|
-
inputSchema:
|
|
2217
|
-
command:
|
|
2218
|
-
path:
|
|
2219
|
-
file_text:
|
|
2220
|
-
insert_line:
|
|
2221
|
-
new_str:
|
|
2222
|
-
old_str:
|
|
2223
|
-
view_range:
|
|
2227
|
+
inputSchema: z13.object({
|
|
2228
|
+
command: z13.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
2229
|
+
path: z13.string(),
|
|
2230
|
+
file_text: z13.string().optional(),
|
|
2231
|
+
insert_line: z13.number().int().optional(),
|
|
2232
|
+
new_str: z13.string().optional(),
|
|
2233
|
+
old_str: z13.string().optional(),
|
|
2234
|
+
view_range: z13.array(z13.number().int()).optional()
|
|
2224
2235
|
})
|
|
2225
2236
|
});
|
|
2226
2237
|
|
|
2227
2238
|
// src/tool/text-editor_20250429.ts
|
|
2228
2239
|
var import_provider_utils14 = require("@ai-sdk/provider-utils");
|
|
2229
|
-
var
|
|
2240
|
+
var z14 = __toESM(require("zod/v4"));
|
|
2230
2241
|
var textEditor_20250429 = (0, import_provider_utils14.createProviderDefinedToolFactory)({
|
|
2231
2242
|
id: "anthropic.text_editor_20250429",
|
|
2232
2243
|
name: "str_replace_based_edit_tool",
|
|
2233
|
-
inputSchema:
|
|
2234
|
-
command:
|
|
2235
|
-
path:
|
|
2236
|
-
file_text:
|
|
2237
|
-
insert_line:
|
|
2238
|
-
new_str:
|
|
2239
|
-
old_str:
|
|
2240
|
-
view_range:
|
|
2244
|
+
inputSchema: z14.object({
|
|
2245
|
+
command: z14.enum(["view", "create", "str_replace", "insert"]),
|
|
2246
|
+
path: z14.string(),
|
|
2247
|
+
file_text: z14.string().optional(),
|
|
2248
|
+
insert_line: z14.number().int().optional(),
|
|
2249
|
+
new_str: z14.string().optional(),
|
|
2250
|
+
old_str: z14.string().optional(),
|
|
2251
|
+
view_range: z14.array(z14.number().int()).optional()
|
|
2241
2252
|
})
|
|
2242
2253
|
});
|
|
2243
2254
|
|