@hongymagic/q 2026.304.0 → 2026.305.0-next.7c76bd5
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/dist/q.js +743 -237
- package/package.json +5 -5
package/dist/q.js
CHANGED
|
@@ -82,16 +82,16 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
82
82
|
var __addDisposableResource;
|
|
83
83
|
var __disposeResources;
|
|
84
84
|
var __rewriteRelativeImportExtension;
|
|
85
|
-
(function(
|
|
85
|
+
(function(factory12) {
|
|
86
86
|
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
|
|
87
87
|
if (typeof define === "function" && define.amd) {
|
|
88
88
|
define("tslib", ["exports"], function(exports2) {
|
|
89
|
-
|
|
89
|
+
factory12(createExporter(root, createExporter(exports2)));
|
|
90
90
|
});
|
|
91
91
|
} else if (typeof module === "object" && typeof exports === "object") {
|
|
92
|
-
|
|
92
|
+
factory12(createExporter(root, createExporter(exports)));
|
|
93
93
|
} else {
|
|
94
|
-
|
|
94
|
+
factory12(createExporter(root));
|
|
95
95
|
}
|
|
96
96
|
function createExporter(exports2, previous) {
|
|
97
97
|
if (exports2 !== root) {
|
|
@@ -14641,7 +14641,7 @@ import { parseArgs } from "node:util";
|
|
|
14641
14641
|
// package.json
|
|
14642
14642
|
var package_default = {
|
|
14643
14643
|
name: "@hongymagic/q",
|
|
14644
|
-
version: "2026.
|
|
14644
|
+
version: "2026.305.0-next.7c76bd5",
|
|
14645
14645
|
description: "Quick AI answers from the command line",
|
|
14646
14646
|
main: "dist/q.js",
|
|
14647
14647
|
type: "module",
|
|
@@ -14691,15 +14691,15 @@ var package_default = {
|
|
|
14691
14691
|
"release:dry": "bun run scripts/release.ts --dry-run"
|
|
14692
14692
|
},
|
|
14693
14693
|
dependencies: {
|
|
14694
|
-
"@ai-sdk/amazon-bedrock": "4.0.
|
|
14695
|
-
"@ai-sdk/anthropic": "3.0.
|
|
14694
|
+
"@ai-sdk/amazon-bedrock": "4.0.75",
|
|
14695
|
+
"@ai-sdk/anthropic": "3.0.56",
|
|
14696
14696
|
"@ai-sdk/azure": "3.0.40",
|
|
14697
|
-
"@ai-sdk/google": "3.0.
|
|
14697
|
+
"@ai-sdk/google": "3.0.40",
|
|
14698
14698
|
"@ai-sdk/groq": "3.0.27",
|
|
14699
14699
|
"@ai-sdk/openai": "3.0.39",
|
|
14700
14700
|
"@ai-sdk/openai-compatible": "2.0.33",
|
|
14701
14701
|
"@t3-oss/env-core": "0.13.10",
|
|
14702
|
-
ai: "6.0.
|
|
14702
|
+
ai: "6.0.114",
|
|
14703
14703
|
clipboardy: "5.3.1",
|
|
14704
14704
|
"ollama-ai-provider-v2": "3.3.1",
|
|
14705
14705
|
zod: "4.3.6"
|
|
@@ -35499,7 +35499,7 @@ async function* executeTool({
|
|
|
35499
35499
|
}
|
|
35500
35500
|
|
|
35501
35501
|
// node_modules/@ai-sdk/anthropic/dist/index.mjs
|
|
35502
|
-
var VERSION3 = "3.0.
|
|
35502
|
+
var VERSION3 = "3.0.56";
|
|
35503
35503
|
var anthropicErrorDataSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
35504
35504
|
type: exports_external.literal("error"),
|
|
35505
35505
|
error: exports_external.object({
|
|
@@ -35581,7 +35581,16 @@ var anthropicMessagesResponseSchema = lazySchema(() => zodSchema(exports_externa
|
|
|
35581
35581
|
type: exports_external.literal("server_tool_use"),
|
|
35582
35582
|
id: exports_external.string(),
|
|
35583
35583
|
name: exports_external.string(),
|
|
35584
|
-
input: exports_external.record(exports_external.string(), exports_external.unknown()).nullish()
|
|
35584
|
+
input: exports_external.record(exports_external.string(), exports_external.unknown()).nullish(),
|
|
35585
|
+
caller: exports_external.union([
|
|
35586
|
+
exports_external.object({
|
|
35587
|
+
type: exports_external.literal("code_execution_20260120"),
|
|
35588
|
+
tool_id: exports_external.string()
|
|
35589
|
+
}),
|
|
35590
|
+
exports_external.object({
|
|
35591
|
+
type: exports_external.literal("direct")
|
|
35592
|
+
})
|
|
35593
|
+
]).optional()
|
|
35585
35594
|
}),
|
|
35586
35595
|
exports_external.object({
|
|
35587
35596
|
type: exports_external.literal("mcp_tool_use"),
|
|
@@ -35662,6 +35671,16 @@ var anthropicMessagesResponseSchema = lazySchema(() => zodSchema(exports_externa
|
|
|
35662
35671
|
file_id: exports_external.string()
|
|
35663
35672
|
})).optional().default([])
|
|
35664
35673
|
}),
|
|
35674
|
+
exports_external.object({
|
|
35675
|
+
type: exports_external.literal("encrypted_code_execution_result"),
|
|
35676
|
+
encrypted_stdout: exports_external.string(),
|
|
35677
|
+
stderr: exports_external.string(),
|
|
35678
|
+
return_code: exports_external.number(),
|
|
35679
|
+
content: exports_external.array(exports_external.object({
|
|
35680
|
+
type: exports_external.literal("code_execution_output"),
|
|
35681
|
+
file_id: exports_external.string()
|
|
35682
|
+
})).optional().default([])
|
|
35683
|
+
}),
|
|
35665
35684
|
exports_external.object({
|
|
35666
35685
|
type: exports_external.literal("code_execution_tool_result_error"),
|
|
35667
35686
|
error_code: exports_external.string()
|
|
@@ -35859,7 +35878,16 @@ var anthropicMessagesChunkSchema = lazySchema(() => zodSchema(exports_external.d
|
|
|
35859
35878
|
type: exports_external.literal("server_tool_use"),
|
|
35860
35879
|
id: exports_external.string(),
|
|
35861
35880
|
name: exports_external.string(),
|
|
35862
|
-
input: exports_external.record(exports_external.string(), exports_external.unknown()).nullish()
|
|
35881
|
+
input: exports_external.record(exports_external.string(), exports_external.unknown()).nullish(),
|
|
35882
|
+
caller: exports_external.union([
|
|
35883
|
+
exports_external.object({
|
|
35884
|
+
type: exports_external.literal("code_execution_20260120"),
|
|
35885
|
+
tool_id: exports_external.string()
|
|
35886
|
+
}),
|
|
35887
|
+
exports_external.object({
|
|
35888
|
+
type: exports_external.literal("direct")
|
|
35889
|
+
})
|
|
35890
|
+
]).optional()
|
|
35863
35891
|
}),
|
|
35864
35892
|
exports_external.object({
|
|
35865
35893
|
type: exports_external.literal("mcp_tool_use"),
|
|
@@ -35940,6 +35968,16 @@ var anthropicMessagesChunkSchema = lazySchema(() => zodSchema(exports_external.d
|
|
|
35940
35968
|
file_id: exports_external.string()
|
|
35941
35969
|
})).optional().default([])
|
|
35942
35970
|
}),
|
|
35971
|
+
exports_external.object({
|
|
35972
|
+
type: exports_external.literal("encrypted_code_execution_result"),
|
|
35973
|
+
encrypted_stdout: exports_external.string(),
|
|
35974
|
+
stderr: exports_external.string(),
|
|
35975
|
+
return_code: exports_external.number(),
|
|
35976
|
+
content: exports_external.array(exports_external.object({
|
|
35977
|
+
type: exports_external.literal("code_execution_output"),
|
|
35978
|
+
file_id: exports_external.string()
|
|
35979
|
+
})).optional().default([])
|
|
35980
|
+
}),
|
|
35943
35981
|
exports_external.object({
|
|
35944
35982
|
type: exports_external.literal("code_execution_tool_result_error"),
|
|
35945
35983
|
error_code: exports_external.string()
|
|
@@ -36186,6 +36224,7 @@ var anthropicLanguageModelOptions = exports_external.object({
|
|
|
36186
36224
|
toolStreaming: exports_external.boolean().optional(),
|
|
36187
36225
|
effort: exports_external.enum(["low", "medium", "high", "max"]).optional(),
|
|
36188
36226
|
speed: exports_external.enum(["fast", "standard"]).optional(),
|
|
36227
|
+
anthropicBeta: exports_external.array(exports_external.string()).optional(),
|
|
36189
36228
|
contextManagement: exports_external.object({
|
|
36190
36229
|
edits: exports_external.array(exports_external.discriminatedUnion("type", [
|
|
36191
36230
|
exports_external.object({
|
|
@@ -36293,6 +36332,37 @@ var factory = createProviderToolFactory({
|
|
|
36293
36332
|
var textEditor_20250728 = (args = {}) => {
|
|
36294
36333
|
return factory(args);
|
|
36295
36334
|
};
|
|
36335
|
+
var webSearch_20260209ArgsSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36336
|
+
maxUses: exports_external.number().optional(),
|
|
36337
|
+
allowedDomains: exports_external.array(exports_external.string()).optional(),
|
|
36338
|
+
blockedDomains: exports_external.array(exports_external.string()).optional(),
|
|
36339
|
+
userLocation: exports_external.object({
|
|
36340
|
+
type: exports_external.literal("approximate"),
|
|
36341
|
+
city: exports_external.string().optional(),
|
|
36342
|
+
region: exports_external.string().optional(),
|
|
36343
|
+
country: exports_external.string().optional(),
|
|
36344
|
+
timezone: exports_external.string().optional()
|
|
36345
|
+
}).optional()
|
|
36346
|
+
})));
|
|
36347
|
+
var webSearch_20260209OutputSchema = lazySchema(() => zodSchema(exports_external.array(exports_external.object({
|
|
36348
|
+
url: exports_external.string(),
|
|
36349
|
+
title: exports_external.string().nullable(),
|
|
36350
|
+
pageAge: exports_external.string().nullable(),
|
|
36351
|
+
encryptedContent: exports_external.string(),
|
|
36352
|
+
type: exports_external.literal("web_search_result")
|
|
36353
|
+
}))));
|
|
36354
|
+
var webSearch_20260209InputSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36355
|
+
query: exports_external.string()
|
|
36356
|
+
})));
|
|
36357
|
+
var factory2 = createProviderToolFactoryWithOutputSchema({
|
|
36358
|
+
id: "anthropic.web_search_20260209",
|
|
36359
|
+
inputSchema: webSearch_20260209InputSchema,
|
|
36360
|
+
outputSchema: webSearch_20260209OutputSchema,
|
|
36361
|
+
supportsDeferredResults: true
|
|
36362
|
+
});
|
|
36363
|
+
var webSearch_20260209 = (args = {}) => {
|
|
36364
|
+
return factory2(args);
|
|
36365
|
+
};
|
|
36296
36366
|
var webSearch_20250305ArgsSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36297
36367
|
maxUses: exports_external.number().optional(),
|
|
36298
36368
|
allowedDomains: exports_external.array(exports_external.string()).optional(),
|
|
@@ -36315,14 +36385,55 @@ var webSearch_20250305OutputSchema = lazySchema(() => zodSchema(exports_external
|
|
|
36315
36385
|
var webSearch_20250305InputSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36316
36386
|
query: exports_external.string()
|
|
36317
36387
|
})));
|
|
36318
|
-
var
|
|
36388
|
+
var factory3 = createProviderToolFactoryWithOutputSchema({
|
|
36319
36389
|
id: "anthropic.web_search_20250305",
|
|
36320
36390
|
inputSchema: webSearch_20250305InputSchema,
|
|
36321
36391
|
outputSchema: webSearch_20250305OutputSchema,
|
|
36322
36392
|
supportsDeferredResults: true
|
|
36323
36393
|
});
|
|
36324
36394
|
var webSearch_20250305 = (args = {}) => {
|
|
36325
|
-
return
|
|
36395
|
+
return factory3(args);
|
|
36396
|
+
};
|
|
36397
|
+
var webFetch_20260209ArgsSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36398
|
+
maxUses: exports_external.number().optional(),
|
|
36399
|
+
allowedDomains: exports_external.array(exports_external.string()).optional(),
|
|
36400
|
+
blockedDomains: exports_external.array(exports_external.string()).optional(),
|
|
36401
|
+
citations: exports_external.object({ enabled: exports_external.boolean() }).optional(),
|
|
36402
|
+
maxContentTokens: exports_external.number().optional()
|
|
36403
|
+
})));
|
|
36404
|
+
var webFetch_20260209OutputSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36405
|
+
type: exports_external.literal("web_fetch_result"),
|
|
36406
|
+
url: exports_external.string(),
|
|
36407
|
+
content: exports_external.object({
|
|
36408
|
+
type: exports_external.literal("document"),
|
|
36409
|
+
title: exports_external.string().nullable(),
|
|
36410
|
+
citations: exports_external.object({ enabled: exports_external.boolean() }).optional(),
|
|
36411
|
+
source: exports_external.union([
|
|
36412
|
+
exports_external.object({
|
|
36413
|
+
type: exports_external.literal("base64"),
|
|
36414
|
+
mediaType: exports_external.literal("application/pdf"),
|
|
36415
|
+
data: exports_external.string()
|
|
36416
|
+
}),
|
|
36417
|
+
exports_external.object({
|
|
36418
|
+
type: exports_external.literal("text"),
|
|
36419
|
+
mediaType: exports_external.literal("text/plain"),
|
|
36420
|
+
data: exports_external.string()
|
|
36421
|
+
})
|
|
36422
|
+
])
|
|
36423
|
+
}),
|
|
36424
|
+
retrievedAt: exports_external.string().nullable()
|
|
36425
|
+
})));
|
|
36426
|
+
var webFetch_20260209InputSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36427
|
+
url: exports_external.string()
|
|
36428
|
+
})));
|
|
36429
|
+
var factory4 = createProviderToolFactoryWithOutputSchema({
|
|
36430
|
+
id: "anthropic.web_fetch_20260209",
|
|
36431
|
+
inputSchema: webFetch_20260209InputSchema,
|
|
36432
|
+
outputSchema: webFetch_20260209OutputSchema,
|
|
36433
|
+
supportsDeferredResults: true
|
|
36434
|
+
});
|
|
36435
|
+
var webFetch_20260209 = (args = {}) => {
|
|
36436
|
+
return factory4(args);
|
|
36326
36437
|
};
|
|
36327
36438
|
var webFetch_20250910ArgsSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36328
36439
|
maxUses: exports_external.number().optional(),
|
|
@@ -36356,14 +36467,14 @@ var webFetch_20250910OutputSchema = lazySchema(() => zodSchema(exports_external.
|
|
|
36356
36467
|
var webFetch_20250910InputSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36357
36468
|
url: exports_external.string()
|
|
36358
36469
|
})));
|
|
36359
|
-
var
|
|
36470
|
+
var factory5 = createProviderToolFactoryWithOutputSchema({
|
|
36360
36471
|
id: "anthropic.web_fetch_20250910",
|
|
36361
36472
|
inputSchema: webFetch_20250910InputSchema,
|
|
36362
36473
|
outputSchema: webFetch_20250910OutputSchema,
|
|
36363
36474
|
supportsDeferredResults: true
|
|
36364
36475
|
});
|
|
36365
36476
|
var webFetch_20250910 = (args = {}) => {
|
|
36366
|
-
return
|
|
36477
|
+
return factory5(args);
|
|
36367
36478
|
};
|
|
36368
36479
|
async function prepareTools({
|
|
36369
36480
|
tools,
|
|
@@ -36558,6 +36669,24 @@ async function prepareTools({
|
|
|
36558
36669
|
});
|
|
36559
36670
|
break;
|
|
36560
36671
|
}
|
|
36672
|
+
case "anthropic.web_fetch_20260209": {
|
|
36673
|
+
betas.add("code-execution-web-tools-2026-02-09");
|
|
36674
|
+
const args = await validateTypes({
|
|
36675
|
+
value: tool2.args,
|
|
36676
|
+
schema: webFetch_20260209ArgsSchema
|
|
36677
|
+
});
|
|
36678
|
+
anthropicTools2.push({
|
|
36679
|
+
type: "web_fetch_20260209",
|
|
36680
|
+
name: "web_fetch",
|
|
36681
|
+
max_uses: args.maxUses,
|
|
36682
|
+
allowed_domains: args.allowedDomains,
|
|
36683
|
+
blocked_domains: args.blockedDomains,
|
|
36684
|
+
citations: args.citations,
|
|
36685
|
+
max_content_tokens: args.maxContentTokens,
|
|
36686
|
+
cache_control: undefined
|
|
36687
|
+
});
|
|
36688
|
+
break;
|
|
36689
|
+
}
|
|
36561
36690
|
case "anthropic.web_search_20250305": {
|
|
36562
36691
|
const args = await validateTypes({
|
|
36563
36692
|
value: tool2.args,
|
|
@@ -36574,6 +36703,23 @@ async function prepareTools({
|
|
|
36574
36703
|
});
|
|
36575
36704
|
break;
|
|
36576
36705
|
}
|
|
36706
|
+
case "anthropic.web_search_20260209": {
|
|
36707
|
+
betas.add("code-execution-web-tools-2026-02-09");
|
|
36708
|
+
const args = await validateTypes({
|
|
36709
|
+
value: tool2.args,
|
|
36710
|
+
schema: webSearch_20260209ArgsSchema
|
|
36711
|
+
});
|
|
36712
|
+
anthropicTools2.push({
|
|
36713
|
+
type: "web_search_20260209",
|
|
36714
|
+
name: "web_search",
|
|
36715
|
+
max_uses: args.maxUses,
|
|
36716
|
+
allowed_domains: args.allowedDomains,
|
|
36717
|
+
blocked_domains: args.blockedDomains,
|
|
36718
|
+
user_location: args.userLocation,
|
|
36719
|
+
cache_control: undefined
|
|
36720
|
+
});
|
|
36721
|
+
break;
|
|
36722
|
+
}
|
|
36577
36723
|
case "anthropic.tool_search_regex_20251119": {
|
|
36578
36724
|
betas.add("advanced-tool-use-2025-11-20");
|
|
36579
36725
|
anthropicTools2.push({
|
|
@@ -36708,13 +36854,13 @@ var codeExecution_20250522OutputSchema = lazySchema(() => zodSchema(exports_exte
|
|
|
36708
36854
|
var codeExecution_20250522InputSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
36709
36855
|
code: exports_external.string()
|
|
36710
36856
|
})));
|
|
36711
|
-
var
|
|
36857
|
+
var factory6 = createProviderToolFactoryWithOutputSchema({
|
|
36712
36858
|
id: "anthropic.code_execution_20250522",
|
|
36713
36859
|
inputSchema: codeExecution_20250522InputSchema,
|
|
36714
36860
|
outputSchema: codeExecution_20250522OutputSchema
|
|
36715
36861
|
});
|
|
36716
36862
|
var codeExecution_20250522 = (args = {}) => {
|
|
36717
|
-
return
|
|
36863
|
+
return factory6(args);
|
|
36718
36864
|
};
|
|
36719
36865
|
var codeExecution_20250825OutputSchema = lazySchema(() => zodSchema(exports_external.discriminatedUnion("type", [
|
|
36720
36866
|
exports_external.object({
|
|
@@ -36796,14 +36942,113 @@ var codeExecution_20250825InputSchema = lazySchema(() => zodSchema(exports_exter
|
|
|
36796
36942
|
})
|
|
36797
36943
|
])
|
|
36798
36944
|
])));
|
|
36799
|
-
var
|
|
36945
|
+
var factory7 = createProviderToolFactoryWithOutputSchema({
|
|
36800
36946
|
id: "anthropic.code_execution_20250825",
|
|
36801
36947
|
inputSchema: codeExecution_20250825InputSchema,
|
|
36802
36948
|
outputSchema: codeExecution_20250825OutputSchema,
|
|
36803
36949
|
supportsDeferredResults: true
|
|
36804
36950
|
});
|
|
36805
36951
|
var codeExecution_20250825 = (args = {}) => {
|
|
36806
|
-
return
|
|
36952
|
+
return factory7(args);
|
|
36953
|
+
};
|
|
36954
|
+
var codeExecution_20260120OutputSchema = lazySchema(() => zodSchema(exports_external.discriminatedUnion("type", [
|
|
36955
|
+
exports_external.object({
|
|
36956
|
+
type: exports_external.literal("code_execution_result"),
|
|
36957
|
+
stdout: exports_external.string(),
|
|
36958
|
+
stderr: exports_external.string(),
|
|
36959
|
+
return_code: exports_external.number(),
|
|
36960
|
+
content: exports_external.array(exports_external.object({
|
|
36961
|
+
type: exports_external.literal("code_execution_output"),
|
|
36962
|
+
file_id: exports_external.string()
|
|
36963
|
+
})).optional().default([])
|
|
36964
|
+
}),
|
|
36965
|
+
exports_external.object({
|
|
36966
|
+
type: exports_external.literal("encrypted_code_execution_result"),
|
|
36967
|
+
encrypted_stdout: exports_external.string(),
|
|
36968
|
+
stderr: exports_external.string(),
|
|
36969
|
+
return_code: exports_external.number(),
|
|
36970
|
+
content: exports_external.array(exports_external.object({
|
|
36971
|
+
type: exports_external.literal("code_execution_output"),
|
|
36972
|
+
file_id: exports_external.string()
|
|
36973
|
+
})).optional().default([])
|
|
36974
|
+
}),
|
|
36975
|
+
exports_external.object({
|
|
36976
|
+
type: exports_external.literal("bash_code_execution_result"),
|
|
36977
|
+
content: exports_external.array(exports_external.object({
|
|
36978
|
+
type: exports_external.literal("bash_code_execution_output"),
|
|
36979
|
+
file_id: exports_external.string()
|
|
36980
|
+
})),
|
|
36981
|
+
stdout: exports_external.string(),
|
|
36982
|
+
stderr: exports_external.string(),
|
|
36983
|
+
return_code: exports_external.number()
|
|
36984
|
+
}),
|
|
36985
|
+
exports_external.object({
|
|
36986
|
+
type: exports_external.literal("bash_code_execution_tool_result_error"),
|
|
36987
|
+
error_code: exports_external.string()
|
|
36988
|
+
}),
|
|
36989
|
+
exports_external.object({
|
|
36990
|
+
type: exports_external.literal("text_editor_code_execution_tool_result_error"),
|
|
36991
|
+
error_code: exports_external.string()
|
|
36992
|
+
}),
|
|
36993
|
+
exports_external.object({
|
|
36994
|
+
type: exports_external.literal("text_editor_code_execution_view_result"),
|
|
36995
|
+
content: exports_external.string(),
|
|
36996
|
+
file_type: exports_external.string(),
|
|
36997
|
+
num_lines: exports_external.number().nullable(),
|
|
36998
|
+
start_line: exports_external.number().nullable(),
|
|
36999
|
+
total_lines: exports_external.number().nullable()
|
|
37000
|
+
}),
|
|
37001
|
+
exports_external.object({
|
|
37002
|
+
type: exports_external.literal("text_editor_code_execution_create_result"),
|
|
37003
|
+
is_file_update: exports_external.boolean()
|
|
37004
|
+
}),
|
|
37005
|
+
exports_external.object({
|
|
37006
|
+
type: exports_external.literal("text_editor_code_execution_str_replace_result"),
|
|
37007
|
+
lines: exports_external.array(exports_external.string()).nullable(),
|
|
37008
|
+
new_lines: exports_external.number().nullable(),
|
|
37009
|
+
new_start: exports_external.number().nullable(),
|
|
37010
|
+
old_lines: exports_external.number().nullable(),
|
|
37011
|
+
old_start: exports_external.number().nullable()
|
|
37012
|
+
})
|
|
37013
|
+
])));
|
|
37014
|
+
var codeExecution_20260120InputSchema = lazySchema(() => zodSchema(exports_external.discriminatedUnion("type", [
|
|
37015
|
+
exports_external.object({
|
|
37016
|
+
type: exports_external.literal("programmatic-tool-call"),
|
|
37017
|
+
code: exports_external.string()
|
|
37018
|
+
}),
|
|
37019
|
+
exports_external.object({
|
|
37020
|
+
type: exports_external.literal("bash_code_execution"),
|
|
37021
|
+
command: exports_external.string()
|
|
37022
|
+
}),
|
|
37023
|
+
exports_external.discriminatedUnion("command", [
|
|
37024
|
+
exports_external.object({
|
|
37025
|
+
type: exports_external.literal("text_editor_code_execution"),
|
|
37026
|
+
command: exports_external.literal("view"),
|
|
37027
|
+
path: exports_external.string()
|
|
37028
|
+
}),
|
|
37029
|
+
exports_external.object({
|
|
37030
|
+
type: exports_external.literal("text_editor_code_execution"),
|
|
37031
|
+
command: exports_external.literal("create"),
|
|
37032
|
+
path: exports_external.string(),
|
|
37033
|
+
file_text: exports_external.string().nullish()
|
|
37034
|
+
}),
|
|
37035
|
+
exports_external.object({
|
|
37036
|
+
type: exports_external.literal("text_editor_code_execution"),
|
|
37037
|
+
command: exports_external.literal("str_replace"),
|
|
37038
|
+
path: exports_external.string(),
|
|
37039
|
+
old_str: exports_external.string(),
|
|
37040
|
+
new_str: exports_external.string()
|
|
37041
|
+
})
|
|
37042
|
+
])
|
|
37043
|
+
])));
|
|
37044
|
+
var factory8 = createProviderToolFactoryWithOutputSchema({
|
|
37045
|
+
id: "anthropic.code_execution_20260120",
|
|
37046
|
+
inputSchema: codeExecution_20260120InputSchema,
|
|
37047
|
+
outputSchema: codeExecution_20260120OutputSchema,
|
|
37048
|
+
supportsDeferredResults: true
|
|
37049
|
+
});
|
|
37050
|
+
var codeExecution_20260120 = (args = {}) => {
|
|
37051
|
+
return factory8(args);
|
|
36807
37052
|
};
|
|
36808
37053
|
var toolSearchRegex_20251119OutputSchema = lazySchema(() => zodSchema(exports_external.array(exports_external.object({
|
|
36809
37054
|
type: exports_external.literal("tool_reference"),
|
|
@@ -36813,14 +37058,14 @@ var toolSearchRegex_20251119InputSchema = lazySchema(() => zodSchema(exports_ext
|
|
|
36813
37058
|
pattern: exports_external.string(),
|
|
36814
37059
|
limit: exports_external.number().optional()
|
|
36815
37060
|
})));
|
|
36816
|
-
var
|
|
37061
|
+
var factory9 = createProviderToolFactoryWithOutputSchema({
|
|
36817
37062
|
id: "anthropic.tool_search_regex_20251119",
|
|
36818
37063
|
inputSchema: toolSearchRegex_20251119InputSchema,
|
|
36819
37064
|
outputSchema: toolSearchRegex_20251119OutputSchema,
|
|
36820
37065
|
supportsDeferredResults: true
|
|
36821
37066
|
});
|
|
36822
37067
|
var toolSearchRegex_20251119 = (args = {}) => {
|
|
36823
|
-
return
|
|
37068
|
+
return factory9(args);
|
|
36824
37069
|
};
|
|
36825
37070
|
function convertToString(data) {
|
|
36826
37071
|
if (typeof data === "string") {
|
|
@@ -36854,7 +37099,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
36854
37099
|
cacheControlValidator,
|
|
36855
37100
|
toolNameMapping
|
|
36856
37101
|
}) {
|
|
36857
|
-
var _a16, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
37102
|
+
var _a16, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
36858
37103
|
const betas = /* @__PURE__ */ new Set;
|
|
36859
37104
|
const blocks = groupIntoBlocks(prompt);
|
|
36860
37105
|
const validator = cacheControlValidator || new CacheControlValidator;
|
|
@@ -37365,6 +37610,25 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
37365
37610
|
},
|
|
37366
37611
|
cache_control: cacheControl
|
|
37367
37612
|
});
|
|
37613
|
+
} else if (output.value.type === "encrypted_code_execution_result") {
|
|
37614
|
+
const codeExecutionOutput = await validateTypes({
|
|
37615
|
+
value: output.value,
|
|
37616
|
+
schema: codeExecution_20260120OutputSchema
|
|
37617
|
+
});
|
|
37618
|
+
if (codeExecutionOutput.type === "encrypted_code_execution_result") {
|
|
37619
|
+
anthropicContent.push({
|
|
37620
|
+
type: "code_execution_tool_result",
|
|
37621
|
+
tool_use_id: part.toolCallId,
|
|
37622
|
+
content: {
|
|
37623
|
+
type: codeExecutionOutput.type,
|
|
37624
|
+
encrypted_stdout: codeExecutionOutput.encrypted_stdout,
|
|
37625
|
+
stderr: codeExecutionOutput.stderr,
|
|
37626
|
+
return_code: codeExecutionOutput.return_code,
|
|
37627
|
+
content: (_p = codeExecutionOutput.content) != null ? _p : []
|
|
37628
|
+
},
|
|
37629
|
+
cache_control: cacheControl
|
|
37630
|
+
});
|
|
37631
|
+
}
|
|
37368
37632
|
} else {
|
|
37369
37633
|
const codeExecutionOutput = await validateTypes({
|
|
37370
37634
|
value: output.value,
|
|
@@ -37379,7 +37643,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
37379
37643
|
stdout: codeExecutionOutput.stdout,
|
|
37380
37644
|
stderr: codeExecutionOutput.stderr,
|
|
37381
37645
|
return_code: codeExecutionOutput.return_code,
|
|
37382
|
-
content: (
|
|
37646
|
+
content: (_q = codeExecutionOutput.content) != null ? _q : []
|
|
37383
37647
|
},
|
|
37384
37648
|
cache_control: cacheControl
|
|
37385
37649
|
});
|
|
@@ -37412,7 +37676,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
37412
37676
|
errorValue = output.value;
|
|
37413
37677
|
}
|
|
37414
37678
|
} catch (e) {
|
|
37415
|
-
const extractedErrorCode = (
|
|
37679
|
+
const extractedErrorCode = (_r = output.value) == null ? undefined : _r.errorCode;
|
|
37416
37680
|
errorValue = {
|
|
37417
37681
|
errorCode: typeof extractedErrorCode === "string" ? extractedErrorCode : "unknown"
|
|
37418
37682
|
};
|
|
@@ -37422,7 +37686,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
37422
37686
|
tool_use_id: part.toolCallId,
|
|
37423
37687
|
content: {
|
|
37424
37688
|
type: "web_fetch_tool_result_error",
|
|
37425
|
-
error_code: (
|
|
37689
|
+
error_code: (_s = errorValue.errorCode) != null ? _s : "unknown"
|
|
37426
37690
|
},
|
|
37427
37691
|
cache_control: cacheControl
|
|
37428
37692
|
});
|
|
@@ -37691,7 +37955,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
37691
37955
|
providerOptions,
|
|
37692
37956
|
stream
|
|
37693
37957
|
}) {
|
|
37694
|
-
var _a16, _b16, _c, _d, _e, _f;
|
|
37958
|
+
var _a16, _b16, _c, _d, _e, _f, _g;
|
|
37695
37959
|
const warnings = [];
|
|
37696
37960
|
if (frequencyPenalty != null) {
|
|
37697
37961
|
warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
|
|
@@ -37771,7 +38035,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
37771
38035
|
"anthropic.bash_20250124": "bash",
|
|
37772
38036
|
"anthropic.memory_20250818": "memory",
|
|
37773
38037
|
"anthropic.web_search_20250305": "web_search",
|
|
38038
|
+
"anthropic.web_search_20260209": "web_search",
|
|
37774
38039
|
"anthropic.web_fetch_20250910": "web_fetch",
|
|
38040
|
+
"anthropic.web_fetch_20260209": "web_fetch",
|
|
37775
38041
|
"anthropic.tool_search_regex_20251119": "tool_search_tool_regex",
|
|
37776
38042
|
"anthropic.tool_search_bm25_20251119": "tool_search_tool_bm25"
|
|
37777
38043
|
}
|
|
@@ -38008,7 +38274,12 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38008
38274
|
stream: stream === true ? true : undefined
|
|
38009
38275
|
},
|
|
38010
38276
|
warnings: [...warnings, ...toolWarnings, ...cacheWarnings],
|
|
38011
|
-
betas: /* @__PURE__ */ new Set([
|
|
38277
|
+
betas: /* @__PURE__ */ new Set([
|
|
38278
|
+
...betas,
|
|
38279
|
+
...toolsBetas,
|
|
38280
|
+
...userSuppliedBetas,
|
|
38281
|
+
...(_g = anthropicOptions == null ? undefined : anthropicOptions.anthropicBeta) != null ? _g : []
|
|
38282
|
+
]),
|
|
38012
38283
|
usesJsonResponseTool: jsonResponseTool != null,
|
|
38013
38284
|
toolNameMapping,
|
|
38014
38285
|
providerOptionsName,
|
|
@@ -38035,9 +38306,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38035
38306
|
var _a16, _b16, _c;
|
|
38036
38307
|
return (_c = (_b16 = (_a16 = this.config).buildRequestUrl) == null ? undefined : _b16.call(_a16, this.config.baseURL, isStreaming)) != null ? _c : `${this.config.baseURL}/messages`;
|
|
38037
38308
|
}
|
|
38038
|
-
transformRequestBody(args) {
|
|
38309
|
+
transformRequestBody(args, betas) {
|
|
38039
38310
|
var _a16, _b16, _c;
|
|
38040
|
-
return (_c = (_b16 = (_a16 = this.config).transformRequestBody) == null ? undefined : _b16.call(_a16, args)) != null ? _c : args;
|
|
38311
|
+
return (_c = (_b16 = (_a16 = this.config).transformRequestBody) == null ? undefined : _b16.call(_a16, args, betas)) != null ? _c : args;
|
|
38041
38312
|
}
|
|
38042
38313
|
extractCitationDocuments(prompt) {
|
|
38043
38314
|
const isCitationPart = (part) => {
|
|
@@ -38063,7 +38334,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38063
38334
|
});
|
|
38064
38335
|
}
|
|
38065
38336
|
async doGenerate(options) {
|
|
38066
|
-
var _a16, _b16, _c, _d, _e, _f;
|
|
38337
|
+
var _a16, _b16, _c, _d, _e, _f, _g;
|
|
38067
38338
|
const {
|
|
38068
38339
|
args,
|
|
38069
38340
|
warnings,
|
|
@@ -38080,6 +38351,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38080
38351
|
const citationDocuments = [
|
|
38081
38352
|
...this.extractCitationDocuments(options.prompt)
|
|
38082
38353
|
];
|
|
38354
|
+
const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(args.tools);
|
|
38083
38355
|
const {
|
|
38084
38356
|
responseHeaders,
|
|
38085
38357
|
value: response,
|
|
@@ -38087,7 +38359,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38087
38359
|
} = await postJsonToApi({
|
|
38088
38360
|
url: this.buildRequestUrl(false),
|
|
38089
38361
|
headers: await this.getHeaders({ betas, headers: options.headers }),
|
|
38090
|
-
body: this.transformRequestBody(args),
|
|
38362
|
+
body: this.transformRequestBody(args, betas),
|
|
38091
38363
|
failedResponseHandler: anthropicFailedResponseHandler,
|
|
38092
38364
|
successfulResponseHandler: createJsonResponseHandler(anthropicMessagesResponseSchema),
|
|
38093
38365
|
abortSignal: options.abortSignal,
|
|
@@ -38195,7 +38467,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38195
38467
|
toolCallId: part.id,
|
|
38196
38468
|
toolName: toolNameMapping.toCustomToolName(part.name),
|
|
38197
38469
|
input: JSON.stringify(inputToSerialize),
|
|
38198
|
-
providerExecuted: true
|
|
38470
|
+
providerExecuted: true,
|
|
38471
|
+
...markCodeExecutionDynamic && part.name === "code_execution" ? { dynamic: true } : {}
|
|
38199
38472
|
});
|
|
38200
38473
|
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
38201
38474
|
serverToolCalls[part.id] = part.name;
|
|
@@ -38338,6 +38611,19 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38338
38611
|
content: (_c = part.content.content) != null ? _c : []
|
|
38339
38612
|
}
|
|
38340
38613
|
});
|
|
38614
|
+
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
38615
|
+
content.push({
|
|
38616
|
+
type: "tool-result",
|
|
38617
|
+
toolCallId: part.tool_use_id,
|
|
38618
|
+
toolName: toolNameMapping.toCustomToolName("code_execution"),
|
|
38619
|
+
result: {
|
|
38620
|
+
type: part.content.type,
|
|
38621
|
+
encrypted_stdout: part.content.encrypted_stdout,
|
|
38622
|
+
stderr: part.content.stderr,
|
|
38623
|
+
return_code: part.content.return_code,
|
|
38624
|
+
content: (_d = part.content.content) != null ? _d : []
|
|
38625
|
+
}
|
|
38626
|
+
});
|
|
38341
38627
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
38342
38628
|
content.push({
|
|
38343
38629
|
type: "tool-result",
|
|
@@ -38408,13 +38694,13 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38408
38694
|
finishReason: response.stop_reason,
|
|
38409
38695
|
isJsonResponseFromTool
|
|
38410
38696
|
}),
|
|
38411
|
-
raw: (
|
|
38697
|
+
raw: (_e = response.stop_reason) != null ? _e : undefined
|
|
38412
38698
|
},
|
|
38413
38699
|
usage: convertAnthropicMessagesUsage({ usage: response.usage }),
|
|
38414
38700
|
request: { body: args },
|
|
38415
38701
|
response: {
|
|
38416
|
-
id: (
|
|
38417
|
-
modelId: (
|
|
38702
|
+
id: (_f = response.id) != null ? _f : undefined,
|
|
38703
|
+
modelId: (_g = response.model) != null ? _g : undefined,
|
|
38418
38704
|
headers: responseHeaders,
|
|
38419
38705
|
body: rawResponse
|
|
38420
38706
|
},
|
|
@@ -38469,11 +38755,12 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38469
38755
|
const citationDocuments = [
|
|
38470
38756
|
...this.extractCitationDocuments(options.prompt)
|
|
38471
38757
|
];
|
|
38758
|
+
const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(body.tools);
|
|
38472
38759
|
const url2 = this.buildRequestUrl(true);
|
|
38473
38760
|
const { responseHeaders, value: response } = await postJsonToApi({
|
|
38474
38761
|
url: url2,
|
|
38475
38762
|
headers: await this.getHeaders({ betas, headers: options.headers }),
|
|
38476
|
-
body: this.transformRequestBody(body),
|
|
38763
|
+
body: this.transformRequestBody(body, betas),
|
|
38477
38764
|
failedResponseHandler: anthropicFailedResponseHandler,
|
|
38478
38765
|
successfulResponseHandler: createEventSourceResponseHandler(anthropicMessagesChunkSchema),
|
|
38479
38766
|
abortSignal: options.abortSignal,
|
|
@@ -38506,7 +38793,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38506
38793
|
controller.enqueue({ type: "stream-start", warnings });
|
|
38507
38794
|
},
|
|
38508
38795
|
transform(chunk, controller) {
|
|
38509
|
-
var _a23, _b22, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
38796
|
+
var _a23, _b22, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
38510
38797
|
if (options.includeRawChunks) {
|
|
38511
38798
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
38512
38799
|
}
|
|
@@ -38612,12 +38899,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38612
38899
|
].includes(part.name)) {
|
|
38613
38900
|
const providerToolName = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? "code_execution" : part.name;
|
|
38614
38901
|
const customToolName = toolNameMapping.toCustomToolName(providerToolName);
|
|
38902
|
+
const finalInput = part.input != null && typeof part.input === "object" && Object.keys(part.input).length > 0 ? JSON.stringify(part.input) : "";
|
|
38615
38903
|
contentBlocks[value.index] = {
|
|
38616
38904
|
type: "tool-call",
|
|
38617
38905
|
toolCallId: part.id,
|
|
38618
38906
|
toolName: customToolName,
|
|
38619
|
-
input:
|
|
38907
|
+
input: finalInput,
|
|
38620
38908
|
providerExecuted: true,
|
|
38909
|
+
...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
38621
38910
|
firstDelta: true,
|
|
38622
38911
|
providerToolName: part.name
|
|
38623
38912
|
};
|
|
@@ -38625,7 +38914,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38625
38914
|
type: "tool-input-start",
|
|
38626
38915
|
id: part.id,
|
|
38627
38916
|
toolName: customToolName,
|
|
38628
|
-
providerExecuted: true
|
|
38917
|
+
providerExecuted: true,
|
|
38918
|
+
...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {}
|
|
38629
38919
|
});
|
|
38630
38920
|
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
38631
38921
|
serverToolCalls[part.id] = part.name;
|
|
@@ -38747,6 +39037,19 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38747
39037
|
content: (_c = part.content.content) != null ? _c : []
|
|
38748
39038
|
}
|
|
38749
39039
|
});
|
|
39040
|
+
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
39041
|
+
controller.enqueue({
|
|
39042
|
+
type: "tool-result",
|
|
39043
|
+
toolCallId: part.tool_use_id,
|
|
39044
|
+
toolName: toolNameMapping.toCustomToolName("code_execution"),
|
|
39045
|
+
result: {
|
|
39046
|
+
type: part.content.type,
|
|
39047
|
+
encrypted_stdout: part.content.encrypted_stdout,
|
|
39048
|
+
stderr: part.content.stderr,
|
|
39049
|
+
return_code: part.content.return_code,
|
|
39050
|
+
content: (_d = part.content.content) != null ? _d : []
|
|
39051
|
+
}
|
|
39052
|
+
});
|
|
38750
39053
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
38751
39054
|
controller.enqueue({
|
|
38752
39055
|
type: "tool-result",
|
|
@@ -38887,6 +39190,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38887
39190
|
toolName: contentBlock.toolName,
|
|
38888
39191
|
input: finalInput,
|
|
38889
39192
|
providerExecuted: contentBlock.providerExecuted,
|
|
39193
|
+
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
38890
39194
|
...contentBlock.caller && {
|
|
38891
39195
|
providerMetadata: {
|
|
38892
39196
|
anthropic: {
|
|
@@ -38998,12 +39302,12 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
38998
39302
|
}
|
|
38999
39303
|
case "message_start": {
|
|
39000
39304
|
usage.input_tokens = value.message.usage.input_tokens;
|
|
39001
|
-
usage.cache_read_input_tokens = (
|
|
39002
|
-
usage.cache_creation_input_tokens = (
|
|
39305
|
+
usage.cache_read_input_tokens = (_e = value.message.usage.cache_read_input_tokens) != null ? _e : 0;
|
|
39306
|
+
usage.cache_creation_input_tokens = (_f = value.message.usage.cache_creation_input_tokens) != null ? _f : 0;
|
|
39003
39307
|
rawUsage = {
|
|
39004
39308
|
...value.message.usage
|
|
39005
39309
|
};
|
|
39006
|
-
cacheCreationInputTokens = (
|
|
39310
|
+
cacheCreationInputTokens = (_g = value.message.usage.cache_creation_input_tokens) != null ? _g : null;
|
|
39007
39311
|
if (value.message.container != null) {
|
|
39008
39312
|
container = {
|
|
39009
39313
|
expiresAt: value.message.container.expires_at,
|
|
@@ -39022,8 +39326,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
39022
39326
|
}
|
|
39023
39327
|
controller.enqueue({
|
|
39024
39328
|
type: "response-metadata",
|
|
39025
|
-
id: (
|
|
39026
|
-
modelId: (
|
|
39329
|
+
id: (_h = value.message.id) != null ? _h : undefined,
|
|
39330
|
+
modelId: (_i = value.message.model) != null ? _i : undefined
|
|
39027
39331
|
});
|
|
39028
39332
|
if (value.message.content != null) {
|
|
39029
39333
|
for (let contentIndex = 0;contentIndex < value.message.content.length; contentIndex++) {
|
|
@@ -39039,7 +39343,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
39039
39343
|
id: part.id,
|
|
39040
39344
|
toolName: part.name
|
|
39041
39345
|
});
|
|
39042
|
-
const inputStr = JSON.stringify((
|
|
39346
|
+
const inputStr = JSON.stringify((_j = part.input) != null ? _j : {});
|
|
39043
39347
|
controller.enqueue({
|
|
39044
39348
|
type: "tool-input-delta",
|
|
39045
39349
|
id: part.id,
|
|
@@ -39087,17 +39391,17 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
39087
39391
|
finishReason: value.delta.stop_reason,
|
|
39088
39392
|
isJsonResponseFromTool
|
|
39089
39393
|
}),
|
|
39090
|
-
raw: (
|
|
39394
|
+
raw: (_k = value.delta.stop_reason) != null ? _k : undefined
|
|
39091
39395
|
};
|
|
39092
|
-
stopSequence = (
|
|
39396
|
+
stopSequence = (_l = value.delta.stop_sequence) != null ? _l : null;
|
|
39093
39397
|
container = value.delta.container != null ? {
|
|
39094
39398
|
expiresAt: value.delta.container.expires_at,
|
|
39095
39399
|
id: value.delta.container.id,
|
|
39096
|
-
skills: (
|
|
39400
|
+
skills: (_n = (_m = value.delta.container.skills) == null ? undefined : _m.map((skill) => ({
|
|
39097
39401
|
type: skill.type,
|
|
39098
39402
|
skillId: skill.skill_id,
|
|
39099
39403
|
version: skill.version
|
|
39100
|
-
}))) != null ?
|
|
39404
|
+
}))) != null ? _n : null
|
|
39101
39405
|
} : null;
|
|
39102
39406
|
if (value.context_management) {
|
|
39103
39407
|
contextManagement = mapAnthropicResponseContextManagement(value.context_management);
|
|
@@ -39222,6 +39526,24 @@ function getModelCapabilities(modelId) {
|
|
|
39222
39526
|
};
|
|
39223
39527
|
}
|
|
39224
39528
|
}
|
|
39529
|
+
function hasWebTool20260209WithoutCodeExecution(tools) {
|
|
39530
|
+
if (!tools) {
|
|
39531
|
+
return false;
|
|
39532
|
+
}
|
|
39533
|
+
let hasWebTool20260209 = false;
|
|
39534
|
+
let hasCodeExecutionTool = false;
|
|
39535
|
+
for (const tool2 of tools) {
|
|
39536
|
+
if ("type" in tool2 && (tool2.type === "web_fetch_20260209" || tool2.type === "web_search_20260209")) {
|
|
39537
|
+
hasWebTool20260209 = true;
|
|
39538
|
+
continue;
|
|
39539
|
+
}
|
|
39540
|
+
if (tool2.name === "code_execution") {
|
|
39541
|
+
hasCodeExecutionTool = true;
|
|
39542
|
+
break;
|
|
39543
|
+
}
|
|
39544
|
+
}
|
|
39545
|
+
return hasWebTool20260209 && !hasCodeExecutionTool;
|
|
39546
|
+
}
|
|
39225
39547
|
function mapAnthropicResponseContextManagement(contextManagement) {
|
|
39226
39548
|
return contextManagement ? {
|
|
39227
39549
|
appliedEdits: contextManagement.applied_edits.map((edit) => {
|
|
@@ -39263,95 +39585,6 @@ var bash_20250124 = createProviderToolFactory({
|
|
|
39263
39585
|
id: "anthropic.bash_20250124",
|
|
39264
39586
|
inputSchema: bash_20250124InputSchema
|
|
39265
39587
|
});
|
|
39266
|
-
var codeExecution_20260120OutputSchema = lazySchema(() => zodSchema(exports_external.discriminatedUnion("type", [
|
|
39267
|
-
exports_external.object({
|
|
39268
|
-
type: exports_external.literal("code_execution_result"),
|
|
39269
|
-
stdout: exports_external.string(),
|
|
39270
|
-
stderr: exports_external.string(),
|
|
39271
|
-
return_code: exports_external.number(),
|
|
39272
|
-
content: exports_external.array(exports_external.object({
|
|
39273
|
-
type: exports_external.literal("code_execution_output"),
|
|
39274
|
-
file_id: exports_external.string()
|
|
39275
|
-
})).optional().default([])
|
|
39276
|
-
}),
|
|
39277
|
-
exports_external.object({
|
|
39278
|
-
type: exports_external.literal("bash_code_execution_result"),
|
|
39279
|
-
content: exports_external.array(exports_external.object({
|
|
39280
|
-
type: exports_external.literal("bash_code_execution_output"),
|
|
39281
|
-
file_id: exports_external.string()
|
|
39282
|
-
})),
|
|
39283
|
-
stdout: exports_external.string(),
|
|
39284
|
-
stderr: exports_external.string(),
|
|
39285
|
-
return_code: exports_external.number()
|
|
39286
|
-
}),
|
|
39287
|
-
exports_external.object({
|
|
39288
|
-
type: exports_external.literal("bash_code_execution_tool_result_error"),
|
|
39289
|
-
error_code: exports_external.string()
|
|
39290
|
-
}),
|
|
39291
|
-
exports_external.object({
|
|
39292
|
-
type: exports_external.literal("text_editor_code_execution_tool_result_error"),
|
|
39293
|
-
error_code: exports_external.string()
|
|
39294
|
-
}),
|
|
39295
|
-
exports_external.object({
|
|
39296
|
-
type: exports_external.literal("text_editor_code_execution_view_result"),
|
|
39297
|
-
content: exports_external.string(),
|
|
39298
|
-
file_type: exports_external.string(),
|
|
39299
|
-
num_lines: exports_external.number().nullable(),
|
|
39300
|
-
start_line: exports_external.number().nullable(),
|
|
39301
|
-
total_lines: exports_external.number().nullable()
|
|
39302
|
-
}),
|
|
39303
|
-
exports_external.object({
|
|
39304
|
-
type: exports_external.literal("text_editor_code_execution_create_result"),
|
|
39305
|
-
is_file_update: exports_external.boolean()
|
|
39306
|
-
}),
|
|
39307
|
-
exports_external.object({
|
|
39308
|
-
type: exports_external.literal("text_editor_code_execution_str_replace_result"),
|
|
39309
|
-
lines: exports_external.array(exports_external.string()).nullable(),
|
|
39310
|
-
new_lines: exports_external.number().nullable(),
|
|
39311
|
-
new_start: exports_external.number().nullable(),
|
|
39312
|
-
old_lines: exports_external.number().nullable(),
|
|
39313
|
-
old_start: exports_external.number().nullable()
|
|
39314
|
-
})
|
|
39315
|
-
])));
|
|
39316
|
-
var codeExecution_20260120InputSchema = lazySchema(() => zodSchema(exports_external.discriminatedUnion("type", [
|
|
39317
|
-
exports_external.object({
|
|
39318
|
-
type: exports_external.literal("programmatic-tool-call"),
|
|
39319
|
-
code: exports_external.string()
|
|
39320
|
-
}),
|
|
39321
|
-
exports_external.object({
|
|
39322
|
-
type: exports_external.literal("bash_code_execution"),
|
|
39323
|
-
command: exports_external.string()
|
|
39324
|
-
}),
|
|
39325
|
-
exports_external.discriminatedUnion("command", [
|
|
39326
|
-
exports_external.object({
|
|
39327
|
-
type: exports_external.literal("text_editor_code_execution"),
|
|
39328
|
-
command: exports_external.literal("view"),
|
|
39329
|
-
path: exports_external.string()
|
|
39330
|
-
}),
|
|
39331
|
-
exports_external.object({
|
|
39332
|
-
type: exports_external.literal("text_editor_code_execution"),
|
|
39333
|
-
command: exports_external.literal("create"),
|
|
39334
|
-
path: exports_external.string(),
|
|
39335
|
-
file_text: exports_external.string().nullish()
|
|
39336
|
-
}),
|
|
39337
|
-
exports_external.object({
|
|
39338
|
-
type: exports_external.literal("text_editor_code_execution"),
|
|
39339
|
-
command: exports_external.literal("str_replace"),
|
|
39340
|
-
path: exports_external.string(),
|
|
39341
|
-
old_str: exports_external.string(),
|
|
39342
|
-
new_str: exports_external.string()
|
|
39343
|
-
})
|
|
39344
|
-
])
|
|
39345
|
-
])));
|
|
39346
|
-
var factory7 = createProviderToolFactoryWithOutputSchema({
|
|
39347
|
-
id: "anthropic.code_execution_20260120",
|
|
39348
|
-
inputSchema: codeExecution_20260120InputSchema,
|
|
39349
|
-
outputSchema: codeExecution_20260120OutputSchema,
|
|
39350
|
-
supportsDeferredResults: true
|
|
39351
|
-
});
|
|
39352
|
-
var codeExecution_20260120 = (args = {}) => {
|
|
39353
|
-
return factory7(args);
|
|
39354
|
-
};
|
|
39355
39588
|
var computer_20241022InputSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
39356
39589
|
action: exports_external.enum([
|
|
39357
39590
|
"key",
|
|
@@ -39526,14 +39759,14 @@ var toolSearchBm25_20251119InputSchema = lazySchema(() => zodSchema(exports_exte
|
|
|
39526
39759
|
query: exports_external.string(),
|
|
39527
39760
|
limit: exports_external.number().optional()
|
|
39528
39761
|
})));
|
|
39529
|
-
var
|
|
39762
|
+
var factory10 = createProviderToolFactoryWithOutputSchema({
|
|
39530
39763
|
id: "anthropic.tool_search_bm25_20251119",
|
|
39531
39764
|
inputSchema: toolSearchBm25_20251119InputSchema,
|
|
39532
39765
|
outputSchema: toolSearchBm25_20251119OutputSchema,
|
|
39533
39766
|
supportsDeferredResults: true
|
|
39534
39767
|
});
|
|
39535
39768
|
var toolSearchBm25_20251119 = (args = {}) => {
|
|
39536
|
-
return
|
|
39769
|
+
return factory10(args);
|
|
39537
39770
|
};
|
|
39538
39771
|
var anthropicTools = {
|
|
39539
39772
|
bash_20241022,
|
|
@@ -39550,7 +39783,9 @@ var anthropicTools = {
|
|
|
39550
39783
|
textEditor_20250429,
|
|
39551
39784
|
textEditor_20250728,
|
|
39552
39785
|
webFetch_20250910,
|
|
39786
|
+
webFetch_20260209,
|
|
39553
39787
|
webSearch_20250305,
|
|
39788
|
+
webSearch_20260209,
|
|
39554
39789
|
toolSearchRegex_20251119,
|
|
39555
39790
|
toolSearchBm25_20251119
|
|
39556
39791
|
};
|
|
@@ -45178,7 +45413,16 @@ var anthropicMessagesResponseSchema2 = lazySchema(() => zodSchema(exports_extern
|
|
|
45178
45413
|
type: exports_external.literal("server_tool_use"),
|
|
45179
45414
|
id: exports_external.string(),
|
|
45180
45415
|
name: exports_external.string(),
|
|
45181
|
-
input: exports_external.record(exports_external.string(), exports_external.unknown()).nullish()
|
|
45416
|
+
input: exports_external.record(exports_external.string(), exports_external.unknown()).nullish(),
|
|
45417
|
+
caller: exports_external.union([
|
|
45418
|
+
exports_external.object({
|
|
45419
|
+
type: exports_external.literal("code_execution_20260120"),
|
|
45420
|
+
tool_id: exports_external.string()
|
|
45421
|
+
}),
|
|
45422
|
+
exports_external.object({
|
|
45423
|
+
type: exports_external.literal("direct")
|
|
45424
|
+
})
|
|
45425
|
+
]).optional()
|
|
45182
45426
|
}),
|
|
45183
45427
|
exports_external.object({
|
|
45184
45428
|
type: exports_external.literal("mcp_tool_use"),
|
|
@@ -45259,6 +45503,16 @@ var anthropicMessagesResponseSchema2 = lazySchema(() => zodSchema(exports_extern
|
|
|
45259
45503
|
file_id: exports_external.string()
|
|
45260
45504
|
})).optional().default([])
|
|
45261
45505
|
}),
|
|
45506
|
+
exports_external.object({
|
|
45507
|
+
type: exports_external.literal("encrypted_code_execution_result"),
|
|
45508
|
+
encrypted_stdout: exports_external.string(),
|
|
45509
|
+
stderr: exports_external.string(),
|
|
45510
|
+
return_code: exports_external.number(),
|
|
45511
|
+
content: exports_external.array(exports_external.object({
|
|
45512
|
+
type: exports_external.literal("code_execution_output"),
|
|
45513
|
+
file_id: exports_external.string()
|
|
45514
|
+
})).optional().default([])
|
|
45515
|
+
}),
|
|
45262
45516
|
exports_external.object({
|
|
45263
45517
|
type: exports_external.literal("code_execution_tool_result_error"),
|
|
45264
45518
|
error_code: exports_external.string()
|
|
@@ -45456,7 +45710,16 @@ var anthropicMessagesChunkSchema2 = lazySchema(() => zodSchema(exports_external.
|
|
|
45456
45710
|
type: exports_external.literal("server_tool_use"),
|
|
45457
45711
|
id: exports_external.string(),
|
|
45458
45712
|
name: exports_external.string(),
|
|
45459
|
-
input: exports_external.record(exports_external.string(), exports_external.unknown()).nullish()
|
|
45713
|
+
input: exports_external.record(exports_external.string(), exports_external.unknown()).nullish(),
|
|
45714
|
+
caller: exports_external.union([
|
|
45715
|
+
exports_external.object({
|
|
45716
|
+
type: exports_external.literal("code_execution_20260120"),
|
|
45717
|
+
tool_id: exports_external.string()
|
|
45718
|
+
}),
|
|
45719
|
+
exports_external.object({
|
|
45720
|
+
type: exports_external.literal("direct")
|
|
45721
|
+
})
|
|
45722
|
+
]).optional()
|
|
45460
45723
|
}),
|
|
45461
45724
|
exports_external.object({
|
|
45462
45725
|
type: exports_external.literal("mcp_tool_use"),
|
|
@@ -45537,6 +45800,16 @@ var anthropicMessagesChunkSchema2 = lazySchema(() => zodSchema(exports_external.
|
|
|
45537
45800
|
file_id: exports_external.string()
|
|
45538
45801
|
})).optional().default([])
|
|
45539
45802
|
}),
|
|
45803
|
+
exports_external.object({
|
|
45804
|
+
type: exports_external.literal("encrypted_code_execution_result"),
|
|
45805
|
+
encrypted_stdout: exports_external.string(),
|
|
45806
|
+
stderr: exports_external.string(),
|
|
45807
|
+
return_code: exports_external.number(),
|
|
45808
|
+
content: exports_external.array(exports_external.object({
|
|
45809
|
+
type: exports_external.literal("code_execution_output"),
|
|
45810
|
+
file_id: exports_external.string()
|
|
45811
|
+
})).optional().default([])
|
|
45812
|
+
}),
|
|
45540
45813
|
exports_external.object({
|
|
45541
45814
|
type: exports_external.literal("code_execution_tool_result_error"),
|
|
45542
45815
|
error_code: exports_external.string()
|
|
@@ -45783,6 +46056,7 @@ var anthropicLanguageModelOptions2 = exports_external.object({
|
|
|
45783
46056
|
toolStreaming: exports_external.boolean().optional(),
|
|
45784
46057
|
effort: exports_external.enum(["low", "medium", "high", "max"]).optional(),
|
|
45785
46058
|
speed: exports_external.enum(["fast", "standard"]).optional(),
|
|
46059
|
+
anthropicBeta: exports_external.array(exports_external.string()).optional(),
|
|
45786
46060
|
contextManagement: exports_external.object({
|
|
45787
46061
|
edits: exports_external.array(exports_external.discriminatedUnion("type", [
|
|
45788
46062
|
exports_external.object({
|
|
@@ -45883,12 +46157,43 @@ var textEditor_20250728InputSchema2 = lazySchema(() => zodSchema(exports_externa
|
|
|
45883
46157
|
old_str: exports_external.string().optional(),
|
|
45884
46158
|
view_range: exports_external.array(exports_external.number().int()).optional()
|
|
45885
46159
|
})));
|
|
45886
|
-
var
|
|
46160
|
+
var factory11 = createProviderToolFactory({
|
|
45887
46161
|
id: "anthropic.text_editor_20250728",
|
|
45888
46162
|
inputSchema: textEditor_20250728InputSchema2
|
|
45889
46163
|
});
|
|
45890
46164
|
var textEditor_202507282 = (args = {}) => {
|
|
45891
|
-
return
|
|
46165
|
+
return factory11(args);
|
|
46166
|
+
};
|
|
46167
|
+
var webSearch_20260209ArgsSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46168
|
+
maxUses: exports_external.number().optional(),
|
|
46169
|
+
allowedDomains: exports_external.array(exports_external.string()).optional(),
|
|
46170
|
+
blockedDomains: exports_external.array(exports_external.string()).optional(),
|
|
46171
|
+
userLocation: exports_external.object({
|
|
46172
|
+
type: exports_external.literal("approximate"),
|
|
46173
|
+
city: exports_external.string().optional(),
|
|
46174
|
+
region: exports_external.string().optional(),
|
|
46175
|
+
country: exports_external.string().optional(),
|
|
46176
|
+
timezone: exports_external.string().optional()
|
|
46177
|
+
}).optional()
|
|
46178
|
+
})));
|
|
46179
|
+
var webSearch_20260209OutputSchema2 = lazySchema(() => zodSchema(exports_external.array(exports_external.object({
|
|
46180
|
+
url: exports_external.string(),
|
|
46181
|
+
title: exports_external.string().nullable(),
|
|
46182
|
+
pageAge: exports_external.string().nullable(),
|
|
46183
|
+
encryptedContent: exports_external.string(),
|
|
46184
|
+
type: exports_external.literal("web_search_result")
|
|
46185
|
+
}))));
|
|
46186
|
+
var webSearch_20260209InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46187
|
+
query: exports_external.string()
|
|
46188
|
+
})));
|
|
46189
|
+
var factory22 = createProviderToolFactoryWithOutputSchema({
|
|
46190
|
+
id: "anthropic.web_search_20260209",
|
|
46191
|
+
inputSchema: webSearch_20260209InputSchema2,
|
|
46192
|
+
outputSchema: webSearch_20260209OutputSchema2,
|
|
46193
|
+
supportsDeferredResults: true
|
|
46194
|
+
});
|
|
46195
|
+
var webSearch_202602092 = (args = {}) => {
|
|
46196
|
+
return factory22(args);
|
|
45892
46197
|
};
|
|
45893
46198
|
var webSearch_20250305ArgsSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
45894
46199
|
maxUses: exports_external.number().optional(),
|
|
@@ -45912,14 +46217,55 @@ var webSearch_20250305OutputSchema2 = lazySchema(() => zodSchema(exports_externa
|
|
|
45912
46217
|
var webSearch_20250305InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
45913
46218
|
query: exports_external.string()
|
|
45914
46219
|
})));
|
|
45915
|
-
var
|
|
46220
|
+
var factory32 = createProviderToolFactoryWithOutputSchema({
|
|
45916
46221
|
id: "anthropic.web_search_20250305",
|
|
45917
46222
|
inputSchema: webSearch_20250305InputSchema2,
|
|
45918
46223
|
outputSchema: webSearch_20250305OutputSchema2,
|
|
45919
46224
|
supportsDeferredResults: true
|
|
45920
46225
|
});
|
|
45921
46226
|
var webSearch_202503052 = (args = {}) => {
|
|
45922
|
-
return
|
|
46227
|
+
return factory32(args);
|
|
46228
|
+
};
|
|
46229
|
+
var webFetch_20260209ArgsSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46230
|
+
maxUses: exports_external.number().optional(),
|
|
46231
|
+
allowedDomains: exports_external.array(exports_external.string()).optional(),
|
|
46232
|
+
blockedDomains: exports_external.array(exports_external.string()).optional(),
|
|
46233
|
+
citations: exports_external.object({ enabled: exports_external.boolean() }).optional(),
|
|
46234
|
+
maxContentTokens: exports_external.number().optional()
|
|
46235
|
+
})));
|
|
46236
|
+
var webFetch_20260209OutputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46237
|
+
type: exports_external.literal("web_fetch_result"),
|
|
46238
|
+
url: exports_external.string(),
|
|
46239
|
+
content: exports_external.object({
|
|
46240
|
+
type: exports_external.literal("document"),
|
|
46241
|
+
title: exports_external.string().nullable(),
|
|
46242
|
+
citations: exports_external.object({ enabled: exports_external.boolean() }).optional(),
|
|
46243
|
+
source: exports_external.union([
|
|
46244
|
+
exports_external.object({
|
|
46245
|
+
type: exports_external.literal("base64"),
|
|
46246
|
+
mediaType: exports_external.literal("application/pdf"),
|
|
46247
|
+
data: exports_external.string()
|
|
46248
|
+
}),
|
|
46249
|
+
exports_external.object({
|
|
46250
|
+
type: exports_external.literal("text"),
|
|
46251
|
+
mediaType: exports_external.literal("text/plain"),
|
|
46252
|
+
data: exports_external.string()
|
|
46253
|
+
})
|
|
46254
|
+
])
|
|
46255
|
+
}),
|
|
46256
|
+
retrievedAt: exports_external.string().nullable()
|
|
46257
|
+
})));
|
|
46258
|
+
var webFetch_20260209InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46259
|
+
url: exports_external.string()
|
|
46260
|
+
})));
|
|
46261
|
+
var factory42 = createProviderToolFactoryWithOutputSchema({
|
|
46262
|
+
id: "anthropic.web_fetch_20260209",
|
|
46263
|
+
inputSchema: webFetch_20260209InputSchema2,
|
|
46264
|
+
outputSchema: webFetch_20260209OutputSchema2,
|
|
46265
|
+
supportsDeferredResults: true
|
|
46266
|
+
});
|
|
46267
|
+
var webFetch_202602092 = (args = {}) => {
|
|
46268
|
+
return factory42(args);
|
|
45923
46269
|
};
|
|
45924
46270
|
var webFetch_20250910ArgsSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
45925
46271
|
maxUses: exports_external.number().optional(),
|
|
@@ -45953,14 +46299,14 @@ var webFetch_20250910OutputSchema2 = lazySchema(() => zodSchema(exports_external
|
|
|
45953
46299
|
var webFetch_20250910InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
45954
46300
|
url: exports_external.string()
|
|
45955
46301
|
})));
|
|
45956
|
-
var
|
|
46302
|
+
var factory52 = createProviderToolFactoryWithOutputSchema({
|
|
45957
46303
|
id: "anthropic.web_fetch_20250910",
|
|
45958
46304
|
inputSchema: webFetch_20250910InputSchema2,
|
|
45959
46305
|
outputSchema: webFetch_20250910OutputSchema2,
|
|
45960
46306
|
supportsDeferredResults: true
|
|
45961
46307
|
});
|
|
45962
46308
|
var webFetch_202509102 = (args = {}) => {
|
|
45963
|
-
return
|
|
46309
|
+
return factory52(args);
|
|
45964
46310
|
};
|
|
45965
46311
|
async function prepareTools2({
|
|
45966
46312
|
tools,
|
|
@@ -46155,6 +46501,24 @@ async function prepareTools2({
|
|
|
46155
46501
|
});
|
|
46156
46502
|
break;
|
|
46157
46503
|
}
|
|
46504
|
+
case "anthropic.web_fetch_20260209": {
|
|
46505
|
+
betas.add("code-execution-web-tools-2026-02-09");
|
|
46506
|
+
const args = await validateTypes({
|
|
46507
|
+
value: tool2.args,
|
|
46508
|
+
schema: webFetch_20260209ArgsSchema2
|
|
46509
|
+
});
|
|
46510
|
+
anthropicTools2.push({
|
|
46511
|
+
type: "web_fetch_20260209",
|
|
46512
|
+
name: "web_fetch",
|
|
46513
|
+
max_uses: args.maxUses,
|
|
46514
|
+
allowed_domains: args.allowedDomains,
|
|
46515
|
+
blocked_domains: args.blockedDomains,
|
|
46516
|
+
citations: args.citations,
|
|
46517
|
+
max_content_tokens: args.maxContentTokens,
|
|
46518
|
+
cache_control: undefined
|
|
46519
|
+
});
|
|
46520
|
+
break;
|
|
46521
|
+
}
|
|
46158
46522
|
case "anthropic.web_search_20250305": {
|
|
46159
46523
|
const args = await validateTypes({
|
|
46160
46524
|
value: tool2.args,
|
|
@@ -46171,6 +46535,23 @@ async function prepareTools2({
|
|
|
46171
46535
|
});
|
|
46172
46536
|
break;
|
|
46173
46537
|
}
|
|
46538
|
+
case "anthropic.web_search_20260209": {
|
|
46539
|
+
betas.add("code-execution-web-tools-2026-02-09");
|
|
46540
|
+
const args = await validateTypes({
|
|
46541
|
+
value: tool2.args,
|
|
46542
|
+
schema: webSearch_20260209ArgsSchema2
|
|
46543
|
+
});
|
|
46544
|
+
anthropicTools2.push({
|
|
46545
|
+
type: "web_search_20260209",
|
|
46546
|
+
name: "web_search",
|
|
46547
|
+
max_uses: args.maxUses,
|
|
46548
|
+
allowed_domains: args.allowedDomains,
|
|
46549
|
+
blocked_domains: args.blockedDomains,
|
|
46550
|
+
user_location: args.userLocation,
|
|
46551
|
+
cache_control: undefined
|
|
46552
|
+
});
|
|
46553
|
+
break;
|
|
46554
|
+
}
|
|
46174
46555
|
case "anthropic.tool_search_regex_20251119": {
|
|
46175
46556
|
betas.add("advanced-tool-use-2025-11-20");
|
|
46176
46557
|
anthropicTools2.push({
|
|
@@ -46270,13 +46651,13 @@ var codeExecution_20250522OutputSchema2 = lazySchema(() => zodSchema(exports_ext
|
|
|
46270
46651
|
var codeExecution_20250522InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46271
46652
|
code: exports_external.string()
|
|
46272
46653
|
})));
|
|
46273
|
-
var
|
|
46654
|
+
var factory62 = createProviderToolFactoryWithOutputSchema({
|
|
46274
46655
|
id: "anthropic.code_execution_20250522",
|
|
46275
46656
|
inputSchema: codeExecution_20250522InputSchema2,
|
|
46276
46657
|
outputSchema: codeExecution_20250522OutputSchema2
|
|
46277
46658
|
});
|
|
46278
46659
|
var codeExecution_202505222 = (args = {}) => {
|
|
46279
|
-
return
|
|
46660
|
+
return factory62(args);
|
|
46280
46661
|
};
|
|
46281
46662
|
var codeExecution_20250825OutputSchema2 = lazySchema(() => zodSchema(exports_external.discriminatedUnion("type", [
|
|
46282
46663
|
exports_external.object({
|
|
@@ -46358,48 +46739,15 @@ var codeExecution_20250825InputSchema2 = lazySchema(() => zodSchema(exports_exte
|
|
|
46358
46739
|
})
|
|
46359
46740
|
])
|
|
46360
46741
|
])));
|
|
46361
|
-
var
|
|
46742
|
+
var factory72 = createProviderToolFactoryWithOutputSchema({
|
|
46362
46743
|
id: "anthropic.code_execution_20250825",
|
|
46363
46744
|
inputSchema: codeExecution_20250825InputSchema2,
|
|
46364
46745
|
outputSchema: codeExecution_20250825OutputSchema2,
|
|
46365
46746
|
supportsDeferredResults: true
|
|
46366
46747
|
});
|
|
46367
46748
|
var codeExecution_202508252 = (args = {}) => {
|
|
46368
|
-
return
|
|
46369
|
-
};
|
|
46370
|
-
var toolSearchRegex_20251119OutputSchema2 = lazySchema(() => zodSchema(exports_external.array(exports_external.object({
|
|
46371
|
-
type: exports_external.literal("tool_reference"),
|
|
46372
|
-
toolName: exports_external.string()
|
|
46373
|
-
}))));
|
|
46374
|
-
var toolSearchRegex_20251119InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46375
|
-
pattern: exports_external.string(),
|
|
46376
|
-
limit: exports_external.number().optional()
|
|
46377
|
-
})));
|
|
46378
|
-
var factory62 = createProviderToolFactoryWithOutputSchema({
|
|
46379
|
-
id: "anthropic.tool_search_regex_20251119",
|
|
46380
|
-
inputSchema: toolSearchRegex_20251119InputSchema2,
|
|
46381
|
-
outputSchema: toolSearchRegex_20251119OutputSchema2,
|
|
46382
|
-
supportsDeferredResults: true
|
|
46383
|
-
});
|
|
46384
|
-
var toolSearchRegex_202511192 = (args = {}) => {
|
|
46385
|
-
return factory62(args);
|
|
46749
|
+
return factory72(args);
|
|
46386
46750
|
};
|
|
46387
|
-
var bash_20241022InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46388
|
-
command: exports_external.string(),
|
|
46389
|
-
restart: exports_external.boolean().optional()
|
|
46390
|
-
})));
|
|
46391
|
-
var bash_202410222 = createProviderToolFactory({
|
|
46392
|
-
id: "anthropic.bash_20241022",
|
|
46393
|
-
inputSchema: bash_20241022InputSchema2
|
|
46394
|
-
});
|
|
46395
|
-
var bash_20250124InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46396
|
-
command: exports_external.string(),
|
|
46397
|
-
restart: exports_external.boolean().optional()
|
|
46398
|
-
})));
|
|
46399
|
-
var bash_202501242 = createProviderToolFactory({
|
|
46400
|
-
id: "anthropic.bash_20250124",
|
|
46401
|
-
inputSchema: bash_20250124InputSchema2
|
|
46402
|
-
});
|
|
46403
46751
|
var codeExecution_20260120OutputSchema2 = lazySchema(() => zodSchema(exports_external.discriminatedUnion("type", [
|
|
46404
46752
|
exports_external.object({
|
|
46405
46753
|
type: exports_external.literal("code_execution_result"),
|
|
@@ -46411,6 +46759,16 @@ var codeExecution_20260120OutputSchema2 = lazySchema(() => zodSchema(exports_ext
|
|
|
46411
46759
|
file_id: exports_external.string()
|
|
46412
46760
|
})).optional().default([])
|
|
46413
46761
|
}),
|
|
46762
|
+
exports_external.object({
|
|
46763
|
+
type: exports_external.literal("encrypted_code_execution_result"),
|
|
46764
|
+
encrypted_stdout: exports_external.string(),
|
|
46765
|
+
stderr: exports_external.string(),
|
|
46766
|
+
return_code: exports_external.number(),
|
|
46767
|
+
content: exports_external.array(exports_external.object({
|
|
46768
|
+
type: exports_external.literal("code_execution_output"),
|
|
46769
|
+
file_id: exports_external.string()
|
|
46770
|
+
})).optional().default([])
|
|
46771
|
+
}),
|
|
46414
46772
|
exports_external.object({
|
|
46415
46773
|
type: exports_external.literal("bash_code_execution_result"),
|
|
46416
46774
|
content: exports_external.array(exports_external.object({
|
|
@@ -46480,15 +46838,48 @@ var codeExecution_20260120InputSchema2 = lazySchema(() => zodSchema(exports_exte
|
|
|
46480
46838
|
})
|
|
46481
46839
|
])
|
|
46482
46840
|
])));
|
|
46483
|
-
var
|
|
46841
|
+
var factory82 = createProviderToolFactoryWithOutputSchema({
|
|
46484
46842
|
id: "anthropic.code_execution_20260120",
|
|
46485
46843
|
inputSchema: codeExecution_20260120InputSchema2,
|
|
46486
46844
|
outputSchema: codeExecution_20260120OutputSchema2,
|
|
46487
46845
|
supportsDeferredResults: true
|
|
46488
46846
|
});
|
|
46489
46847
|
var codeExecution_202601202 = (args = {}) => {
|
|
46490
|
-
return
|
|
46848
|
+
return factory82(args);
|
|
46849
|
+
};
|
|
46850
|
+
var toolSearchRegex_20251119OutputSchema2 = lazySchema(() => zodSchema(exports_external.array(exports_external.object({
|
|
46851
|
+
type: exports_external.literal("tool_reference"),
|
|
46852
|
+
toolName: exports_external.string()
|
|
46853
|
+
}))));
|
|
46854
|
+
var toolSearchRegex_20251119InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46855
|
+
pattern: exports_external.string(),
|
|
46856
|
+
limit: exports_external.number().optional()
|
|
46857
|
+
})));
|
|
46858
|
+
var factory92 = createProviderToolFactoryWithOutputSchema({
|
|
46859
|
+
id: "anthropic.tool_search_regex_20251119",
|
|
46860
|
+
inputSchema: toolSearchRegex_20251119InputSchema2,
|
|
46861
|
+
outputSchema: toolSearchRegex_20251119OutputSchema2,
|
|
46862
|
+
supportsDeferredResults: true
|
|
46863
|
+
});
|
|
46864
|
+
var toolSearchRegex_202511192 = (args = {}) => {
|
|
46865
|
+
return factory92(args);
|
|
46491
46866
|
};
|
|
46867
|
+
var bash_20241022InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46868
|
+
command: exports_external.string(),
|
|
46869
|
+
restart: exports_external.boolean().optional()
|
|
46870
|
+
})));
|
|
46871
|
+
var bash_202410222 = createProviderToolFactory({
|
|
46872
|
+
id: "anthropic.bash_20241022",
|
|
46873
|
+
inputSchema: bash_20241022InputSchema2
|
|
46874
|
+
});
|
|
46875
|
+
var bash_20250124InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46876
|
+
command: exports_external.string(),
|
|
46877
|
+
restart: exports_external.boolean().optional()
|
|
46878
|
+
})));
|
|
46879
|
+
var bash_202501242 = createProviderToolFactory({
|
|
46880
|
+
id: "anthropic.bash_20250124",
|
|
46881
|
+
inputSchema: bash_20250124InputSchema2
|
|
46882
|
+
});
|
|
46492
46883
|
var computer_20241022InputSchema2 = lazySchema(() => zodSchema(exports_external.object({
|
|
46493
46884
|
action: exports_external.enum([
|
|
46494
46885
|
"key",
|
|
@@ -46663,14 +47054,14 @@ var toolSearchBm25_20251119InputSchema2 = lazySchema(() => zodSchema(exports_ext
|
|
|
46663
47054
|
query: exports_external.string(),
|
|
46664
47055
|
limit: exports_external.number().optional()
|
|
46665
47056
|
})));
|
|
46666
|
-
var
|
|
47057
|
+
var factory102 = createProviderToolFactoryWithOutputSchema({
|
|
46667
47058
|
id: "anthropic.tool_search_bm25_20251119",
|
|
46668
47059
|
inputSchema: toolSearchBm25_20251119InputSchema2,
|
|
46669
47060
|
outputSchema: toolSearchBm25_20251119OutputSchema2,
|
|
46670
47061
|
supportsDeferredResults: true
|
|
46671
47062
|
});
|
|
46672
47063
|
var toolSearchBm25_202511192 = (args = {}) => {
|
|
46673
|
-
return
|
|
47064
|
+
return factory102(args);
|
|
46674
47065
|
};
|
|
46675
47066
|
var anthropicTools2 = {
|
|
46676
47067
|
bash_20241022: bash_202410222,
|
|
@@ -46687,7 +47078,9 @@ var anthropicTools2 = {
|
|
|
46687
47078
|
textEditor_20250429: textEditor_202504292,
|
|
46688
47079
|
textEditor_20250728: textEditor_202507282,
|
|
46689
47080
|
webFetch_20250910: webFetch_202509102,
|
|
47081
|
+
webFetch_20260209: webFetch_202602092,
|
|
46690
47082
|
webSearch_20250305: webSearch_202503052,
|
|
47083
|
+
webSearch_20260209: webSearch_202602092,
|
|
46691
47084
|
toolSearchRegex_20251119: toolSearchRegex_202511192,
|
|
46692
47085
|
toolSearchBm25_20251119: toolSearchBm25_202511192
|
|
46693
47086
|
};
|
|
@@ -47431,8 +47824,8 @@ async function prepareTools3({
|
|
|
47431
47824
|
};
|
|
47432
47825
|
}
|
|
47433
47826
|
for (const tool2 of ProviderTools) {
|
|
47434
|
-
const toolFactory = Object.values(anthropicTools2).find((
|
|
47435
|
-
const instance =
|
|
47827
|
+
const toolFactory = Object.values(anthropicTools2).find((factory12) => {
|
|
47828
|
+
const instance = factory12({});
|
|
47436
47829
|
return instance.id === tool2.id;
|
|
47437
47830
|
});
|
|
47438
47831
|
if (toolFactory != null) {
|
|
@@ -48978,7 +49371,7 @@ var bedrockImageResponseSchema = exports_external.object({
|
|
|
48978
49371
|
details: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
48979
49372
|
preview: exports_external.unknown().optional()
|
|
48980
49373
|
});
|
|
48981
|
-
var VERSION5 = "4.0.
|
|
49374
|
+
var VERSION5 = "4.0.75";
|
|
48982
49375
|
function createSigV4FetchFunction(getCredentials, fetch2 = globalThis.fetch) {
|
|
48983
49376
|
return async (input, init) => {
|
|
48984
49377
|
var _a16, _b16;
|
|
@@ -49274,7 +49667,7 @@ function createBedrockProvider(config2, providerName) {
|
|
|
49274
49667
|
}
|
|
49275
49668
|
|
|
49276
49669
|
// node_modules/@ai-sdk/google/dist/index.mjs
|
|
49277
|
-
var VERSION6 = "3.0.
|
|
49670
|
+
var VERSION6 = "3.0.40";
|
|
49278
49671
|
var googleErrorDataSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
49279
49672
|
error: exports_external.object({
|
|
49280
49673
|
code: exports_external.number().nullable(),
|
|
@@ -49780,8 +50173,7 @@ function prepareTools4({
|
|
|
49780
50173
|
"gemini-flash-lite-latest",
|
|
49781
50174
|
"gemini-pro-latest"
|
|
49782
50175
|
].some((id) => id === modelId);
|
|
49783
|
-
const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
|
|
49784
|
-
const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
|
|
50176
|
+
const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || modelId.includes("nano-banana") || isLatest;
|
|
49785
50177
|
const supportsFileSearch = modelId.includes("gemini-2.5") || modelId.includes("gemini-3");
|
|
49786
50178
|
if (tools == null) {
|
|
49787
50179
|
return { tools: undefined, toolConfig: undefined, toolWarnings };
|
|
@@ -49801,18 +50193,13 @@ function prepareTools4({
|
|
|
49801
50193
|
switch (tool2.id) {
|
|
49802
50194
|
case "google.google_search":
|
|
49803
50195
|
if (isGemini2orNewer) {
|
|
49804
|
-
googleTools2.push({ googleSearch: {} });
|
|
49805
|
-
} else if (supportsDynamicRetrieval) {
|
|
49806
|
-
googleTools2.push({
|
|
49807
|
-
googleSearchRetrieval: {
|
|
49808
|
-
dynamicRetrievalConfig: {
|
|
49809
|
-
mode: tool2.args.mode,
|
|
49810
|
-
dynamicThreshold: tool2.args.dynamicThreshold
|
|
49811
|
-
}
|
|
49812
|
-
}
|
|
49813
|
-
});
|
|
50196
|
+
googleTools2.push({ googleSearch: { ...tool2.args } });
|
|
49814
50197
|
} else {
|
|
49815
|
-
|
|
50198
|
+
toolWarnings.push({
|
|
50199
|
+
type: "unsupported",
|
|
50200
|
+
feature: `provider-defined tool ${tool2.id}`,
|
|
50201
|
+
details: "Google Search requires Gemini 2.0 or newer."
|
|
50202
|
+
});
|
|
49816
50203
|
}
|
|
49817
50204
|
break;
|
|
49818
50205
|
case "google.enterprise_web_search":
|
|
@@ -50364,10 +50751,30 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
50364
50751
|
});
|
|
50365
50752
|
}
|
|
50366
50753
|
} else if ("inlineData" in part) {
|
|
50754
|
+
if (currentTextBlockId !== null) {
|
|
50755
|
+
controller.enqueue({
|
|
50756
|
+
type: "text-end",
|
|
50757
|
+
id: currentTextBlockId
|
|
50758
|
+
});
|
|
50759
|
+
currentTextBlockId = null;
|
|
50760
|
+
}
|
|
50761
|
+
if (currentReasoningBlockId !== null) {
|
|
50762
|
+
controller.enqueue({
|
|
50763
|
+
type: "reasoning-end",
|
|
50764
|
+
id: currentReasoningBlockId
|
|
50765
|
+
});
|
|
50766
|
+
currentReasoningBlockId = null;
|
|
50767
|
+
}
|
|
50768
|
+
const thoughtSignatureMetadata = part.thoughtSignature ? {
|
|
50769
|
+
[providerOptionsName]: {
|
|
50770
|
+
thoughtSignature: part.thoughtSignature
|
|
50771
|
+
}
|
|
50772
|
+
} : undefined;
|
|
50367
50773
|
controller.enqueue({
|
|
50368
50774
|
type: "file",
|
|
50369
50775
|
mediaType: part.inlineData.mimeType,
|
|
50370
|
-
data: part.inlineData.data
|
|
50776
|
+
data: part.inlineData.data,
|
|
50777
|
+
providerMetadata: thoughtSignatureMetadata
|
|
50371
50778
|
});
|
|
50372
50779
|
}
|
|
50373
50780
|
}
|
|
@@ -50475,7 +50882,7 @@ function extractSources({
|
|
|
50475
50882
|
groundingMetadata,
|
|
50476
50883
|
generateId: generateId3
|
|
50477
50884
|
}) {
|
|
50478
|
-
var _a16, _b16, _c, _d, _e;
|
|
50885
|
+
var _a16, _b16, _c, _d, _e, _f;
|
|
50479
50886
|
if (!(groundingMetadata == null ? undefined : groundingMetadata.groundingChunks)) {
|
|
50480
50887
|
return;
|
|
50481
50888
|
}
|
|
@@ -50489,6 +50896,14 @@ function extractSources({
|
|
|
50489
50896
|
url: chunk.web.uri,
|
|
50490
50897
|
title: (_a16 = chunk.web.title) != null ? _a16 : undefined
|
|
50491
50898
|
});
|
|
50899
|
+
} else if (chunk.image != null) {
|
|
50900
|
+
sources.push({
|
|
50901
|
+
type: "source",
|
|
50902
|
+
sourceType: "url",
|
|
50903
|
+
id: generateId3(),
|
|
50904
|
+
url: chunk.image.sourceUri,
|
|
50905
|
+
title: (_b16 = chunk.image.title) != null ? _b16 : undefined
|
|
50906
|
+
});
|
|
50492
50907
|
} else if (chunk.retrievedContext != null) {
|
|
50493
50908
|
const uri = chunk.retrievedContext.uri;
|
|
50494
50909
|
const fileSearchStore = chunk.retrievedContext.fileSearchStore;
|
|
@@ -50498,10 +50913,10 @@ function extractSources({
|
|
|
50498
50913
|
sourceType: "url",
|
|
50499
50914
|
id: generateId3(),
|
|
50500
50915
|
url: uri,
|
|
50501
|
-
title: (
|
|
50916
|
+
title: (_c = chunk.retrievedContext.title) != null ? _c : undefined
|
|
50502
50917
|
});
|
|
50503
50918
|
} else if (uri) {
|
|
50504
|
-
const title = (
|
|
50919
|
+
const title = (_d = chunk.retrievedContext.title) != null ? _d : "Unknown Document";
|
|
50505
50920
|
let mediaType = "application/octet-stream";
|
|
50506
50921
|
let filename = undefined;
|
|
50507
50922
|
if (uri.endsWith(".pdf")) {
|
|
@@ -50531,7 +50946,7 @@ function extractSources({
|
|
|
50531
50946
|
filename
|
|
50532
50947
|
});
|
|
50533
50948
|
} else if (fileSearchStore) {
|
|
50534
|
-
const title = (
|
|
50949
|
+
const title = (_e = chunk.retrievedContext.title) != null ? _e : "Unknown Document";
|
|
50535
50950
|
sources.push({
|
|
50536
50951
|
type: "source",
|
|
50537
50952
|
sourceType: "document",
|
|
@@ -50548,7 +50963,7 @@ function extractSources({
|
|
|
50548
50963
|
sourceType: "url",
|
|
50549
50964
|
id: generateId3(),
|
|
50550
50965
|
url: chunk.maps.uri,
|
|
50551
|
-
title: (
|
|
50966
|
+
title: (_f = chunk.maps.title) != null ? _f : undefined
|
|
50552
50967
|
});
|
|
50553
50968
|
}
|
|
50554
50969
|
}
|
|
@@ -50557,10 +50972,17 @@ function extractSources({
|
|
|
50557
50972
|
}
|
|
50558
50973
|
var getGroundingMetadataSchema = () => exports_external.object({
|
|
50559
50974
|
webSearchQueries: exports_external.array(exports_external.string()).nullish(),
|
|
50975
|
+
imageSearchQueries: exports_external.array(exports_external.string()).nullish(),
|
|
50560
50976
|
retrievalQueries: exports_external.array(exports_external.string()).nullish(),
|
|
50561
50977
|
searchEntryPoint: exports_external.object({ renderedContent: exports_external.string() }).nullish(),
|
|
50562
50978
|
groundingChunks: exports_external.array(exports_external.object({
|
|
50563
50979
|
web: exports_external.object({ uri: exports_external.string(), title: exports_external.string().nullish() }).nullish(),
|
|
50980
|
+
image: exports_external.object({
|
|
50981
|
+
sourceUri: exports_external.string(),
|
|
50982
|
+
imageUri: exports_external.string(),
|
|
50983
|
+
title: exports_external.string().nullish(),
|
|
50984
|
+
domain: exports_external.string().nullish()
|
|
50985
|
+
}).nullish(),
|
|
50564
50986
|
retrievedContext: exports_external.object({
|
|
50565
50987
|
uri: exports_external.string().nullish(),
|
|
50566
50988
|
title: exports_external.string().nullish(),
|
|
@@ -50644,7 +51066,7 @@ var getUrlContextMetadataSchema = () => exports_external.object({
|
|
|
50644
51066
|
urlMetadata: exports_external.array(exports_external.object({
|
|
50645
51067
|
retrievedUrl: exports_external.string(),
|
|
50646
51068
|
urlRetrievalStatus: exports_external.string()
|
|
50647
|
-
}))
|
|
51069
|
+
})).nullish()
|
|
50648
51070
|
});
|
|
50649
51071
|
var responseSchema = lazySchema(() => zodSchema(exports_external.object({
|
|
50650
51072
|
candidates: exports_external.array(exports_external.object({
|
|
@@ -50703,12 +51125,20 @@ var googleMaps = createProviderToolFactory({
|
|
|
50703
51125
|
id: "google.google_maps",
|
|
50704
51126
|
inputSchema: lazySchema(() => zodSchema(exports_external.object({})))
|
|
50705
51127
|
});
|
|
51128
|
+
var googleSearchToolArgsBaseSchema = exports_external.object({
|
|
51129
|
+
searchTypes: exports_external.object({
|
|
51130
|
+
webSearch: exports_external.object({}).optional(),
|
|
51131
|
+
imageSearch: exports_external.object({}).optional()
|
|
51132
|
+
}).optional(),
|
|
51133
|
+
timeRangeFilter: exports_external.object({
|
|
51134
|
+
startTime: exports_external.string(),
|
|
51135
|
+
endTime: exports_external.string()
|
|
51136
|
+
}).optional()
|
|
51137
|
+
}).passthrough();
|
|
51138
|
+
var googleSearchToolArgsSchema = lazySchema(() => zodSchema(googleSearchToolArgsBaseSchema));
|
|
50706
51139
|
var googleSearch = createProviderToolFactory({
|
|
50707
51140
|
id: "google.google_search",
|
|
50708
|
-
inputSchema:
|
|
50709
|
-
mode: exports_external.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
|
|
50710
|
-
dynamicThreshold: exports_external.number().default(1)
|
|
50711
|
-
})))
|
|
51141
|
+
inputSchema: googleSearchToolArgsSchema
|
|
50712
51142
|
});
|
|
50713
51143
|
var urlContext = createProviderToolFactory({
|
|
50714
51144
|
id: "google.url_context",
|
|
@@ -62170,11 +62600,23 @@ var SENSITIVE_FIELD_PATTERNS = [
|
|
|
62170
62600
|
"auth",
|
|
62171
62601
|
"credential"
|
|
62172
62602
|
];
|
|
62603
|
+
function isSensitiveKey(key) {
|
|
62604
|
+
const lowerKey = key.toLowerCase();
|
|
62605
|
+
return SENSITIVE_FIELD_PATTERNS.some((pattern) => lowerKey.includes(pattern));
|
|
62606
|
+
}
|
|
62173
62607
|
function filterSensitiveFields(config2) {
|
|
62174
|
-
|
|
62175
|
-
|
|
62176
|
-
|
|
62177
|
-
|
|
62608
|
+
const result = {};
|
|
62609
|
+
for (const [key, value] of Object.entries(config2)) {
|
|
62610
|
+
if (isSensitiveKey(key)) {
|
|
62611
|
+
continue;
|
|
62612
|
+
}
|
|
62613
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
62614
|
+
result[key] = filterSensitiveFields(value);
|
|
62615
|
+
} else {
|
|
62616
|
+
result[key] = value;
|
|
62617
|
+
}
|
|
62618
|
+
}
|
|
62619
|
+
return result;
|
|
62178
62620
|
}
|
|
62179
62621
|
function resolveProvider(config2, providerOverride, modelOverride, debug = false) {
|
|
62180
62622
|
const providerName = providerOverride ?? config2.default.provider;
|
|
@@ -63318,7 +63760,7 @@ async function getVercelRequestId() {
|
|
|
63318
63760
|
var _a92;
|
|
63319
63761
|
return (_a92 = import_oidc.getContext().headers) == null ? undefined : _a92["x-vercel-id"];
|
|
63320
63762
|
}
|
|
63321
|
-
var VERSION11 = "3.0.
|
|
63763
|
+
var VERSION11 = "3.0.64";
|
|
63322
63764
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
63323
63765
|
function createGatewayProvider(options = {}) {
|
|
63324
63766
|
var _a92, _b92;
|
|
@@ -63775,6 +64217,8 @@ function asArray(value) {
|
|
|
63775
64217
|
}
|
|
63776
64218
|
async function notify(options) {
|
|
63777
64219
|
for (const callback of asArray(options.callbacks)) {
|
|
64220
|
+
if (callback == null)
|
|
64221
|
+
continue;
|
|
63778
64222
|
try {
|
|
63779
64223
|
await callback(options.event);
|
|
63780
64224
|
} catch (_ignored) {}
|
|
@@ -64064,7 +64508,7 @@ function detectMediaType({
|
|
|
64064
64508
|
}
|
|
64065
64509
|
return;
|
|
64066
64510
|
}
|
|
64067
|
-
var VERSION12 = "6.0.
|
|
64511
|
+
var VERSION12 = "6.0.114";
|
|
64068
64512
|
var download = async ({
|
|
64069
64513
|
url: url2,
|
|
64070
64514
|
maxBytes,
|
|
@@ -65086,6 +65530,35 @@ function stringifyForTelemetry(prompt) {
|
|
|
65086
65530
|
} : part)
|
|
65087
65531
|
})));
|
|
65088
65532
|
}
|
|
65533
|
+
function getGlobalTelemetryIntegrations() {
|
|
65534
|
+
var _a21;
|
|
65535
|
+
return (_a21 = globalThis.AI_SDK_TELEMETRY_INTEGRATIONS) != null ? _a21 : [];
|
|
65536
|
+
}
|
|
65537
|
+
function getGlobalTelemetryIntegration() {
|
|
65538
|
+
const globalIntegrations = getGlobalTelemetryIntegrations();
|
|
65539
|
+
return (integrations) => {
|
|
65540
|
+
const localIntegrations = asArray(integrations);
|
|
65541
|
+
const allIntegrations = [...globalIntegrations, ...localIntegrations];
|
|
65542
|
+
function createTelemetryComposite(getListenerFromIntegration) {
|
|
65543
|
+
const listeners = allIntegrations.map(getListenerFromIntegration).filter(Boolean);
|
|
65544
|
+
return async (event) => {
|
|
65545
|
+
for (const listener of listeners) {
|
|
65546
|
+
try {
|
|
65547
|
+
await listener(event);
|
|
65548
|
+
} catch (_ignored) {}
|
|
65549
|
+
}
|
|
65550
|
+
};
|
|
65551
|
+
}
|
|
65552
|
+
return {
|
|
65553
|
+
onStart: createTelemetryComposite((integration) => integration.onStart),
|
|
65554
|
+
onStepStart: createTelemetryComposite((integration) => integration.onStepStart),
|
|
65555
|
+
onToolCallStart: createTelemetryComposite((integration) => integration.onToolCallStart),
|
|
65556
|
+
onToolCallFinish: createTelemetryComposite((integration) => integration.onToolCallFinish),
|
|
65557
|
+
onStepFinish: createTelemetryComposite((integration) => integration.onStepFinish),
|
|
65558
|
+
onFinish: createTelemetryComposite((integration) => integration.onFinish)
|
|
65559
|
+
};
|
|
65560
|
+
};
|
|
65561
|
+
}
|
|
65089
65562
|
function asLanguageModelUsage(usage) {
|
|
65090
65563
|
return {
|
|
65091
65564
|
inputTokens: usage.inputTokens.total,
|
|
@@ -67039,7 +67512,8 @@ function processUIMessageStream({
|
|
|
67039
67512
|
state.message.parts.push({
|
|
67040
67513
|
type: "file",
|
|
67041
67514
|
mediaType: chunk.mediaType,
|
|
67042
|
-
url: chunk.url
|
|
67515
|
+
url: chunk.url,
|
|
67516
|
+
...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {}
|
|
67043
67517
|
});
|
|
67044
67518
|
write();
|
|
67045
67519
|
break;
|
|
@@ -67656,7 +68130,8 @@ function runToolsTransformation({
|
|
|
67656
68130
|
file: new DefaultGeneratedFileWithType({
|
|
67657
68131
|
data: chunk.data,
|
|
67658
68132
|
mediaType: chunk.mediaType
|
|
67659
|
-
})
|
|
68133
|
+
}),
|
|
68134
|
+
...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {}
|
|
67660
68135
|
});
|
|
67661
68136
|
break;
|
|
67662
68137
|
}
|
|
@@ -68034,6 +68509,8 @@ var DefaultStreamTextResult = class {
|
|
|
68034
68509
|
this.outputSpecification = output;
|
|
68035
68510
|
this.includeRawChunks = includeRawChunks;
|
|
68036
68511
|
this.tools = tools;
|
|
68512
|
+
const createGlobalTelemetry = getGlobalTelemetryIntegration();
|
|
68513
|
+
const globalTelemetry = createGlobalTelemetry(telemetry == null ? undefined : telemetry.integrations);
|
|
68037
68514
|
let stepFinish;
|
|
68038
68515
|
let recordedContent = [];
|
|
68039
68516
|
const recordedResponseMessages = [];
|
|
@@ -68135,7 +68612,11 @@ var DefaultStreamTextResult = class {
|
|
|
68135
68612
|
delete activeReasoningContent[part.id];
|
|
68136
68613
|
}
|
|
68137
68614
|
if (part.type === "file") {
|
|
68138
|
-
recordedContent.push({
|
|
68615
|
+
recordedContent.push({
|
|
68616
|
+
type: "file",
|
|
68617
|
+
file: part.file,
|
|
68618
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}
|
|
68619
|
+
});
|
|
68139
68620
|
}
|
|
68140
68621
|
if (part.type === "source") {
|
|
68141
68622
|
recordedContent.push(part);
|
|
@@ -68181,7 +68662,10 @@ var DefaultStreamTextResult = class {
|
|
|
68181
68662
|
},
|
|
68182
68663
|
providerMetadata: part.providerMetadata
|
|
68183
68664
|
});
|
|
68184
|
-
await notify({
|
|
68665
|
+
await notify({
|
|
68666
|
+
event: currentStepResult,
|
|
68667
|
+
callbacks: [onStepFinish, globalTelemetry.onStepFinish]
|
|
68668
|
+
});
|
|
68185
68669
|
logWarnings({
|
|
68186
68670
|
warnings: recordedWarnings,
|
|
68187
68671
|
provider: modelInfo.provider,
|
|
@@ -68245,7 +68729,10 @@ var DefaultStreamTextResult = class {
|
|
|
68245
68729
|
providerMetadata: finalStep.providerMetadata,
|
|
68246
68730
|
steps: recordedSteps
|
|
68247
68731
|
},
|
|
68248
|
-
callbacks:
|
|
68732
|
+
callbacks: [
|
|
68733
|
+
onFinish,
|
|
68734
|
+
globalTelemetry.onFinish
|
|
68735
|
+
]
|
|
68249
68736
|
});
|
|
68250
68737
|
rootSpan.setAttributes(await selectTelemetryAttributes({
|
|
68251
68738
|
telemetry,
|
|
@@ -68392,7 +68879,10 @@ var DefaultStreamTextResult = class {
|
|
|
68392
68879
|
...callbackTelemetryProps,
|
|
68393
68880
|
experimental_context
|
|
68394
68881
|
},
|
|
68395
|
-
callbacks:
|
|
68882
|
+
callbacks: [
|
|
68883
|
+
onStart,
|
|
68884
|
+
globalTelemetry.onStart
|
|
68885
|
+
]
|
|
68396
68886
|
});
|
|
68397
68887
|
const initialMessages = initialPrompt.messages;
|
|
68398
68888
|
const initialResponseMessages = [];
|
|
@@ -68435,8 +68925,14 @@ var DefaultStreamTextResult = class {
|
|
|
68435
68925
|
experimental_context,
|
|
68436
68926
|
stepNumber: recordedSteps.length,
|
|
68437
68927
|
model: modelInfo,
|
|
68438
|
-
onToolCallStart
|
|
68439
|
-
|
|
68928
|
+
onToolCallStart: [
|
|
68929
|
+
onToolCallStart,
|
|
68930
|
+
globalTelemetry.onToolCallStart
|
|
68931
|
+
],
|
|
68932
|
+
onToolCallFinish: [
|
|
68933
|
+
onToolCallFinish,
|
|
68934
|
+
globalTelemetry.onToolCallFinish
|
|
68935
|
+
],
|
|
68440
68936
|
onPreliminaryToolResult: (result2) => {
|
|
68441
68937
|
toolExecutionStepStreamController == null || toolExecutionStepStreamController.enqueue(result2);
|
|
68442
68938
|
}
|
|
@@ -68470,7 +68966,7 @@ var DefaultStreamTextResult = class {
|
|
|
68470
68966
|
input: output2.input,
|
|
68471
68967
|
tool: tools == null ? undefined : tools[output2.toolName],
|
|
68472
68968
|
output: output2.type === "tool-result" ? output2.output : output2.error,
|
|
68473
|
-
errorMode: output2.type === "tool-error" ? "
|
|
68969
|
+
errorMode: output2.type === "tool-error" ? "text" : "none"
|
|
68474
68970
|
})
|
|
68475
68971
|
});
|
|
68476
68972
|
}
|
|
@@ -68576,7 +69072,10 @@ var DefaultStreamTextResult = class {
|
|
|
68576
69072
|
...callbackTelemetryProps,
|
|
68577
69073
|
experimental_context
|
|
68578
69074
|
},
|
|
68579
|
-
callbacks:
|
|
69075
|
+
callbacks: [
|
|
69076
|
+
onStepStart,
|
|
69077
|
+
globalTelemetry.onStepStart
|
|
69078
|
+
]
|
|
68580
69079
|
});
|
|
68581
69080
|
const {
|
|
68582
69081
|
result: { stream: stream2, response, request },
|
|
@@ -68645,8 +69144,14 @@ var DefaultStreamTextResult = class {
|
|
|
68645
69144
|
generateId: generateId22,
|
|
68646
69145
|
stepNumber: recordedSteps.length,
|
|
68647
69146
|
model: stepModelInfo,
|
|
68648
|
-
onToolCallStart
|
|
68649
|
-
|
|
69147
|
+
onToolCallStart: [
|
|
69148
|
+
onToolCallStart,
|
|
69149
|
+
globalTelemetry.onToolCallStart
|
|
69150
|
+
],
|
|
69151
|
+
onToolCallFinish: [
|
|
69152
|
+
onToolCallFinish,
|
|
69153
|
+
globalTelemetry.onToolCallFinish
|
|
69154
|
+
]
|
|
68650
69155
|
});
|
|
68651
69156
|
const stepRequest = ((_i = include == null ? undefined : include.requestBody) != null ? _i : true) ? request != null ? request : {} : { ...request, body: undefined };
|
|
68652
69157
|
const stepToolCalls = [];
|
|
@@ -69170,7 +69675,8 @@ var DefaultStreamTextResult = class {
|
|
|
69170
69675
|
controller.enqueue({
|
|
69171
69676
|
type: "file",
|
|
69172
69677
|
mediaType: part.file.mediaType,
|
|
69173
|
-
url: `data:${part.file.mediaType};base64,${part.file.base64}
|
|
69678
|
+
url: `data:${part.file.mediaType};base64,${part.file.base64}`,
|
|
69679
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}
|
|
69174
69680
|
});
|
|
69175
69681
|
break;
|
|
69176
69682
|
}
|