@bunny-agent/daemon 0.9.29-beta.0 → 0.9.29-beta.5
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/bundle.mjs +22 -14
- package/dist/index.js +22 -14
- package/dist/nextjs.js +22 -14
- package/package.json +1 -1
package/dist/bundle.mjs
CHANGED
|
@@ -263528,7 +263528,7 @@ function buildImageGenerateTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263528
263528
|
],
|
|
263529
263529
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
263530
263530
|
parameters: generateImageSchema,
|
|
263531
|
-
async execute(_toolCallId, params,
|
|
263531
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
263532
263532
|
const p = params;
|
|
263533
263533
|
const prompt = p.prompt;
|
|
263534
263534
|
const size = p.size ?? "1024x1024";
|
|
@@ -263552,7 +263552,8 @@ function buildImageGenerateTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263552
263552
|
quality,
|
|
263553
263553
|
response_format: "b64_json",
|
|
263554
263554
|
output_format: "png"
|
|
263555
|
-
})
|
|
263555
|
+
}),
|
|
263556
|
+
signal
|
|
263556
263557
|
});
|
|
263557
263558
|
if (!res.ok) {
|
|
263558
263559
|
throw new Error(`Image generation failed (${res.status}): ${await res.text()}`);
|
|
@@ -263657,7 +263658,7 @@ function buildImageEditTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263657
263658
|
],
|
|
263658
263659
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
263659
263660
|
parameters: editImageSchema,
|
|
263660
|
-
async execute(_toolCallId, params,
|
|
263661
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
263661
263662
|
const { readFileSync: readFileSync24, existsSync: existsSync31 } = await import("node:fs");
|
|
263662
263663
|
const { resolve: resolve14, basename: basename12 } = await import("node:path");
|
|
263663
263664
|
const p = params;
|
|
@@ -263725,7 +263726,8 @@ function buildImageEditTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263725
263726
|
"Content-Type": type,
|
|
263726
263727
|
Authorization: `Bearer ${apiKey}`
|
|
263727
263728
|
},
|
|
263728
|
-
body
|
|
263729
|
+
body,
|
|
263730
|
+
signal
|
|
263729
263731
|
});
|
|
263730
263732
|
if (!res.ok) {
|
|
263731
263733
|
throw new Error(`Image edit failed (${res.status}): ${await res.text()}`);
|
|
@@ -263776,7 +263778,7 @@ var braveProvider = {
|
|
|
263776
263778
|
id: "brave",
|
|
263777
263779
|
label: "Brave Search",
|
|
263778
263780
|
envKeys: ["BRAVE_API_KEY"],
|
|
263779
|
-
async search({ apiKey, query, count, country, freshness }) {
|
|
263781
|
+
async search({ apiKey, query, count, country, freshness, signal }) {
|
|
263780
263782
|
const params = new URLSearchParams({
|
|
263781
263783
|
q: query,
|
|
263782
263784
|
count: String(Math.min(count, 20))
|
|
@@ -263790,7 +263792,8 @@ var braveProvider = {
|
|
|
263790
263792
|
Accept: "application/json",
|
|
263791
263793
|
"Accept-Encoding": "gzip",
|
|
263792
263794
|
"X-Subscription-Token": apiKey
|
|
263793
|
-
}
|
|
263795
|
+
},
|
|
263796
|
+
signal
|
|
263794
263797
|
});
|
|
263795
263798
|
if (!res.ok) {
|
|
263796
263799
|
const body = await res.text().catch(() => "");
|
|
@@ -263818,7 +263821,7 @@ var tavilyProvider = {
|
|
|
263818
263821
|
id: "tavily",
|
|
263819
263822
|
label: "Tavily",
|
|
263820
263823
|
envKeys: ["TAVILY_API_KEY"],
|
|
263821
|
-
async search({ apiKey, query, count }) {
|
|
263824
|
+
async search({ apiKey, query, count, signal }) {
|
|
263822
263825
|
const res = await fetch("https://api.tavily.com/search", {
|
|
263823
263826
|
method: "POST",
|
|
263824
263827
|
headers: { "Content-Type": "application/json" },
|
|
@@ -263827,7 +263830,8 @@ var tavilyProvider = {
|
|
|
263827
263830
|
query,
|
|
263828
263831
|
max_results: Math.min(count, 10),
|
|
263829
263832
|
include_answer: false
|
|
263830
|
-
})
|
|
263833
|
+
}),
|
|
263834
|
+
signal
|
|
263831
263835
|
});
|
|
263832
263836
|
if (!res.ok) {
|
|
263833
263837
|
const body = await res.text().catch(() => "");
|
|
@@ -263880,9 +263884,12 @@ var BROWSER_UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/53
|
|
|
263880
263884
|
function htmlToText(html2) {
|
|
263881
263885
|
return html2.replace(/<(script|style|noscript)[^>]*>[\s\S]*?<\/\1>/gi, "").replace(/<br\s*\/?>/gi, "\n").replace(/<\/(p|div|h[1-6]|li|tr)>/gi, "\n").replace(/<(p|div|h[1-6]|li|tr)[^>]*>/gi, "\n").replace(/<[^>]+>/g, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ").replace(/[ \t]+/g, " ").replace(/\n{3,}/g, "\n\n").trim();
|
|
263882
263886
|
}
|
|
263883
|
-
async function fetchPageContent(url) {
|
|
263887
|
+
async function fetchPageContent(url, externalSignal) {
|
|
263884
263888
|
const controller = new AbortController();
|
|
263885
263889
|
const timeout = setTimeout(() => controller.abort(), 15e3);
|
|
263890
|
+
externalSignal?.addEventListener("abort", () => controller.abort(), {
|
|
263891
|
+
once: true
|
|
263892
|
+
});
|
|
263886
263893
|
try {
|
|
263887
263894
|
const res = await fetch(url, {
|
|
263888
263895
|
headers: {
|
|
@@ -263979,7 +263986,7 @@ function buildWebSearchTool(env2) {
|
|
|
263979
263986
|
],
|
|
263980
263987
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
263981
263988
|
parameters: webSearchSchema,
|
|
263982
|
-
async execute(_toolCallId, params,
|
|
263989
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
263983
263990
|
const p = params;
|
|
263984
263991
|
const query = p.query;
|
|
263985
263992
|
const count = p.count ?? 5;
|
|
@@ -263994,11 +264001,12 @@ function buildWebSearchTool(env2) {
|
|
|
263994
264001
|
query,
|
|
263995
264002
|
count,
|
|
263996
264003
|
country,
|
|
263997
|
-
freshness
|
|
264004
|
+
freshness,
|
|
264005
|
+
signal
|
|
263998
264006
|
});
|
|
263999
264007
|
if (shouldFetchContent) {
|
|
264000
264008
|
for (const r2 of results) {
|
|
264001
|
-
r2.content = await fetchPageContent(r2.link);
|
|
264009
|
+
r2.content = await fetchPageContent(r2.link, signal);
|
|
264002
264010
|
}
|
|
264003
264011
|
}
|
|
264004
264012
|
return {
|
|
@@ -264044,11 +264052,11 @@ function buildWebFetchTool() {
|
|
|
264044
264052
|
],
|
|
264045
264053
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
264046
264054
|
parameters: webFetchSchema,
|
|
264047
|
-
async execute(_toolCallId, params,
|
|
264055
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
264048
264056
|
const p = params;
|
|
264049
264057
|
const url = p.url;
|
|
264050
264058
|
try {
|
|
264051
|
-
const content = await fetchPageContent(url);
|
|
264059
|
+
const content = await fetchPageContent(url, signal);
|
|
264052
264060
|
return {
|
|
264053
264061
|
content: [{ type: "text", text: content }],
|
|
264054
264062
|
details: void 0
|
package/dist/index.js
CHANGED
|
@@ -263524,7 +263524,7 @@ function buildImageGenerateTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263524
263524
|
],
|
|
263525
263525
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
263526
263526
|
parameters: generateImageSchema,
|
|
263527
|
-
async execute(_toolCallId, params,
|
|
263527
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
263528
263528
|
const p = params;
|
|
263529
263529
|
const prompt = p.prompt;
|
|
263530
263530
|
const size = p.size ?? "1024x1024";
|
|
@@ -263548,7 +263548,8 @@ function buildImageGenerateTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263548
263548
|
quality,
|
|
263549
263549
|
response_format: "b64_json",
|
|
263550
263550
|
output_format: "png"
|
|
263551
|
-
})
|
|
263551
|
+
}),
|
|
263552
|
+
signal
|
|
263552
263553
|
});
|
|
263553
263554
|
if (!res.ok) {
|
|
263554
263555
|
throw new Error(`Image generation failed (${res.status}): ${await res.text()}`);
|
|
@@ -263653,7 +263654,7 @@ function buildImageEditTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263653
263654
|
],
|
|
263654
263655
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
263655
263656
|
parameters: editImageSchema,
|
|
263656
|
-
async execute(_toolCallId, params,
|
|
263657
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
263657
263658
|
const { readFileSync: readFileSync24, existsSync: existsSync31 } = await import("node:fs");
|
|
263658
263659
|
const { resolve: resolve14, basename: basename12 } = await import("node:path");
|
|
263659
263660
|
const p = params;
|
|
@@ -263721,7 +263722,8 @@ function buildImageEditTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263721
263722
|
"Content-Type": type,
|
|
263722
263723
|
Authorization: `Bearer ${apiKey}`
|
|
263723
263724
|
},
|
|
263724
|
-
body
|
|
263725
|
+
body,
|
|
263726
|
+
signal
|
|
263725
263727
|
});
|
|
263726
263728
|
if (!res.ok) {
|
|
263727
263729
|
throw new Error(`Image edit failed (${res.status}): ${await res.text()}`);
|
|
@@ -263772,7 +263774,7 @@ var braveProvider = {
|
|
|
263772
263774
|
id: "brave",
|
|
263773
263775
|
label: "Brave Search",
|
|
263774
263776
|
envKeys: ["BRAVE_API_KEY"],
|
|
263775
|
-
async search({ apiKey, query, count, country, freshness }) {
|
|
263777
|
+
async search({ apiKey, query, count, country, freshness, signal }) {
|
|
263776
263778
|
const params = new URLSearchParams({
|
|
263777
263779
|
q: query,
|
|
263778
263780
|
count: String(Math.min(count, 20))
|
|
@@ -263786,7 +263788,8 @@ var braveProvider = {
|
|
|
263786
263788
|
Accept: "application/json",
|
|
263787
263789
|
"Accept-Encoding": "gzip",
|
|
263788
263790
|
"X-Subscription-Token": apiKey
|
|
263789
|
-
}
|
|
263791
|
+
},
|
|
263792
|
+
signal
|
|
263790
263793
|
});
|
|
263791
263794
|
if (!res.ok) {
|
|
263792
263795
|
const body = await res.text().catch(() => "");
|
|
@@ -263814,7 +263817,7 @@ var tavilyProvider = {
|
|
|
263814
263817
|
id: "tavily",
|
|
263815
263818
|
label: "Tavily",
|
|
263816
263819
|
envKeys: ["TAVILY_API_KEY"],
|
|
263817
|
-
async search({ apiKey, query, count }) {
|
|
263820
|
+
async search({ apiKey, query, count, signal }) {
|
|
263818
263821
|
const res = await fetch("https://api.tavily.com/search", {
|
|
263819
263822
|
method: "POST",
|
|
263820
263823
|
headers: { "Content-Type": "application/json" },
|
|
@@ -263823,7 +263826,8 @@ var tavilyProvider = {
|
|
|
263823
263826
|
query,
|
|
263824
263827
|
max_results: Math.min(count, 10),
|
|
263825
263828
|
include_answer: false
|
|
263826
|
-
})
|
|
263829
|
+
}),
|
|
263830
|
+
signal
|
|
263827
263831
|
});
|
|
263828
263832
|
if (!res.ok) {
|
|
263829
263833
|
const body = await res.text().catch(() => "");
|
|
@@ -263876,9 +263880,12 @@ var BROWSER_UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/53
|
|
|
263876
263880
|
function htmlToText(html2) {
|
|
263877
263881
|
return html2.replace(/<(script|style|noscript)[^>]*>[\s\S]*?<\/\1>/gi, "").replace(/<br\s*\/?>/gi, "\n").replace(/<\/(p|div|h[1-6]|li|tr)>/gi, "\n").replace(/<(p|div|h[1-6]|li|tr)[^>]*>/gi, "\n").replace(/<[^>]+>/g, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ").replace(/[ \t]+/g, " ").replace(/\n{3,}/g, "\n\n").trim();
|
|
263878
263882
|
}
|
|
263879
|
-
async function fetchPageContent(url) {
|
|
263883
|
+
async function fetchPageContent(url, externalSignal) {
|
|
263880
263884
|
const controller = new AbortController();
|
|
263881
263885
|
const timeout = setTimeout(() => controller.abort(), 15e3);
|
|
263886
|
+
externalSignal?.addEventListener("abort", () => controller.abort(), {
|
|
263887
|
+
once: true
|
|
263888
|
+
});
|
|
263882
263889
|
try {
|
|
263883
263890
|
const res = await fetch(url, {
|
|
263884
263891
|
headers: {
|
|
@@ -263975,7 +263982,7 @@ function buildWebSearchTool(env2) {
|
|
|
263975
263982
|
],
|
|
263976
263983
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
263977
263984
|
parameters: webSearchSchema,
|
|
263978
|
-
async execute(_toolCallId, params,
|
|
263985
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
263979
263986
|
const p = params;
|
|
263980
263987
|
const query = p.query;
|
|
263981
263988
|
const count = p.count ?? 5;
|
|
@@ -263990,11 +263997,12 @@ function buildWebSearchTool(env2) {
|
|
|
263990
263997
|
query,
|
|
263991
263998
|
count,
|
|
263992
263999
|
country,
|
|
263993
|
-
freshness
|
|
264000
|
+
freshness,
|
|
264001
|
+
signal
|
|
263994
264002
|
});
|
|
263995
264003
|
if (shouldFetchContent) {
|
|
263996
264004
|
for (const r2 of results) {
|
|
263997
|
-
r2.content = await fetchPageContent(r2.link);
|
|
264005
|
+
r2.content = await fetchPageContent(r2.link, signal);
|
|
263998
264006
|
}
|
|
263999
264007
|
}
|
|
264000
264008
|
return {
|
|
@@ -264040,11 +264048,11 @@ function buildWebFetchTool() {
|
|
|
264040
264048
|
],
|
|
264041
264049
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
264042
264050
|
parameters: webFetchSchema,
|
|
264043
|
-
async execute(_toolCallId, params,
|
|
264051
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
264044
264052
|
const p = params;
|
|
264045
264053
|
const url = p.url;
|
|
264046
264054
|
try {
|
|
264047
|
-
const content = await fetchPageContent(url);
|
|
264055
|
+
const content = await fetchPageContent(url, signal);
|
|
264048
264056
|
return {
|
|
264049
264057
|
content: [{ type: "text", text: content }],
|
|
264050
264058
|
details: void 0
|
package/dist/nextjs.js
CHANGED
|
@@ -263520,7 +263520,7 @@ function buildImageGenerateTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263520
263520
|
],
|
|
263521
263521
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
263522
263522
|
parameters: generateImageSchema,
|
|
263523
|
-
async execute(_toolCallId, params,
|
|
263523
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
263524
263524
|
const p = params;
|
|
263525
263525
|
const prompt = p.prompt;
|
|
263526
263526
|
const size = p.size ?? "1024x1024";
|
|
@@ -263544,7 +263544,8 @@ function buildImageGenerateTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263544
263544
|
quality,
|
|
263545
263545
|
response_format: "b64_json",
|
|
263546
263546
|
output_format: "png"
|
|
263547
|
-
})
|
|
263547
|
+
}),
|
|
263548
|
+
signal
|
|
263548
263549
|
});
|
|
263549
263550
|
if (!res.ok) {
|
|
263550
263551
|
throw new Error(`Image generation failed (${res.status}): ${await res.text()}`);
|
|
@@ -263649,7 +263650,7 @@ function buildImageEditTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263649
263650
|
],
|
|
263650
263651
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
263651
263652
|
parameters: editImageSchema,
|
|
263652
|
-
async execute(_toolCallId, params,
|
|
263653
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
263653
263654
|
const { readFileSync: readFileSync24, existsSync: existsSync31 } = await import("node:fs");
|
|
263654
263655
|
const { resolve: resolve14, basename: basename12 } = await import("node:path");
|
|
263655
263656
|
const p = params;
|
|
@@ -263717,7 +263718,8 @@ function buildImageEditTool(cwd, imageModelId, baseUrl, apiKey) {
|
|
|
263717
263718
|
"Content-Type": type,
|
|
263718
263719
|
Authorization: `Bearer ${apiKey}`
|
|
263719
263720
|
},
|
|
263720
|
-
body
|
|
263721
|
+
body,
|
|
263722
|
+
signal
|
|
263721
263723
|
});
|
|
263722
263724
|
if (!res.ok) {
|
|
263723
263725
|
throw new Error(`Image edit failed (${res.status}): ${await res.text()}`);
|
|
@@ -263768,7 +263770,7 @@ var braveProvider = {
|
|
|
263768
263770
|
id: "brave",
|
|
263769
263771
|
label: "Brave Search",
|
|
263770
263772
|
envKeys: ["BRAVE_API_KEY"],
|
|
263771
|
-
async search({ apiKey, query, count, country, freshness }) {
|
|
263773
|
+
async search({ apiKey, query, count, country, freshness, signal }) {
|
|
263772
263774
|
const params = new URLSearchParams({
|
|
263773
263775
|
q: query,
|
|
263774
263776
|
count: String(Math.min(count, 20))
|
|
@@ -263782,7 +263784,8 @@ var braveProvider = {
|
|
|
263782
263784
|
Accept: "application/json",
|
|
263783
263785
|
"Accept-Encoding": "gzip",
|
|
263784
263786
|
"X-Subscription-Token": apiKey
|
|
263785
|
-
}
|
|
263787
|
+
},
|
|
263788
|
+
signal
|
|
263786
263789
|
});
|
|
263787
263790
|
if (!res.ok) {
|
|
263788
263791
|
const body = await res.text().catch(() => "");
|
|
@@ -263810,7 +263813,7 @@ var tavilyProvider = {
|
|
|
263810
263813
|
id: "tavily",
|
|
263811
263814
|
label: "Tavily",
|
|
263812
263815
|
envKeys: ["TAVILY_API_KEY"],
|
|
263813
|
-
async search({ apiKey, query, count }) {
|
|
263816
|
+
async search({ apiKey, query, count, signal }) {
|
|
263814
263817
|
const res = await fetch("https://api.tavily.com/search", {
|
|
263815
263818
|
method: "POST",
|
|
263816
263819
|
headers: { "Content-Type": "application/json" },
|
|
@@ -263819,7 +263822,8 @@ var tavilyProvider = {
|
|
|
263819
263822
|
query,
|
|
263820
263823
|
max_results: Math.min(count, 10),
|
|
263821
263824
|
include_answer: false
|
|
263822
|
-
})
|
|
263825
|
+
}),
|
|
263826
|
+
signal
|
|
263823
263827
|
});
|
|
263824
263828
|
if (!res.ok) {
|
|
263825
263829
|
const body = await res.text().catch(() => "");
|
|
@@ -263872,9 +263876,12 @@ var BROWSER_UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/53
|
|
|
263872
263876
|
function htmlToText(html2) {
|
|
263873
263877
|
return html2.replace(/<(script|style|noscript)[^>]*>[\s\S]*?<\/\1>/gi, "").replace(/<br\s*\/?>/gi, "\n").replace(/<\/(p|div|h[1-6]|li|tr)>/gi, "\n").replace(/<(p|div|h[1-6]|li|tr)[^>]*>/gi, "\n").replace(/<[^>]+>/g, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ").replace(/[ \t]+/g, " ").replace(/\n{3,}/g, "\n\n").trim();
|
|
263874
263878
|
}
|
|
263875
|
-
async function fetchPageContent(url) {
|
|
263879
|
+
async function fetchPageContent(url, externalSignal) {
|
|
263876
263880
|
const controller = new AbortController();
|
|
263877
263881
|
const timeout = setTimeout(() => controller.abort(), 15e3);
|
|
263882
|
+
externalSignal?.addEventListener("abort", () => controller.abort(), {
|
|
263883
|
+
once: true
|
|
263884
|
+
});
|
|
263878
263885
|
try {
|
|
263879
263886
|
const res = await fetch(url, {
|
|
263880
263887
|
headers: {
|
|
@@ -263971,7 +263978,7 @@ function buildWebSearchTool(env2) {
|
|
|
263971
263978
|
],
|
|
263972
263979
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
263973
263980
|
parameters: webSearchSchema,
|
|
263974
|
-
async execute(_toolCallId, params,
|
|
263981
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
263975
263982
|
const p = params;
|
|
263976
263983
|
const query = p.query;
|
|
263977
263984
|
const count = p.count ?? 5;
|
|
@@ -263986,11 +263993,12 @@ function buildWebSearchTool(env2) {
|
|
|
263986
263993
|
query,
|
|
263987
263994
|
count,
|
|
263988
263995
|
country,
|
|
263989
|
-
freshness
|
|
263996
|
+
freshness,
|
|
263997
|
+
signal
|
|
263990
263998
|
});
|
|
263991
263999
|
if (shouldFetchContent) {
|
|
263992
264000
|
for (const r2 of results) {
|
|
263993
|
-
r2.content = await fetchPageContent(r2.link);
|
|
264001
|
+
r2.content = await fetchPageContent(r2.link, signal);
|
|
263994
264002
|
}
|
|
263995
264003
|
}
|
|
263996
264004
|
return {
|
|
@@ -264036,11 +264044,11 @@ function buildWebFetchTool() {
|
|
|
264036
264044
|
],
|
|
264037
264045
|
// biome-ignore lint/suspicious/noExplicitAny: plain JSON Schema compatible with TypeBox TSchema
|
|
264038
264046
|
parameters: webFetchSchema,
|
|
264039
|
-
async execute(_toolCallId, params,
|
|
264047
|
+
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
264040
264048
|
const p = params;
|
|
264041
264049
|
const url = p.url;
|
|
264042
264050
|
try {
|
|
264043
|
-
const content = await fetchPageContent(url);
|
|
264051
|
+
const content = await fetchPageContent(url, signal);
|
|
264044
264052
|
return {
|
|
264045
264053
|
content: [{ type: "text", text: content }],
|
|
264046
264054
|
details: void 0
|