wormclaude 1.0.73 → 1.0.74
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/theme.js +1 -1
- package/dist/tools.js +19 -0
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -1202,6 +1202,25 @@ export async function executeTool(name, args) {
|
|
|
1202
1202
|
return { ok: true, output: header + (txt || '(empty)').slice(0, 15000) };
|
|
1203
1203
|
}
|
|
1204
1204
|
if (name === 'WebSearch') {
|
|
1205
|
+
// Once gateway arama proxy'sini dene (Tavily anahtari sunucuda ayarliysa onu kullanir; anahtar istemciye gelmez)
|
|
1206
|
+
try {
|
|
1207
|
+
const C = cfg();
|
|
1208
|
+
if (C.baseUrl && C.apiKey) {
|
|
1209
|
+
const sres = await fetch(`${C.baseUrl.replace(/\/$/, '')}/search`, {
|
|
1210
|
+
method: 'POST',
|
|
1211
|
+
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${C.apiKey}` },
|
|
1212
|
+
body: JSON.stringify({ query: String(args.query || ''), max_results: Number(args.max_results) || 5 }),
|
|
1213
|
+
signal: AbortSignal.timeout(25000),
|
|
1214
|
+
});
|
|
1215
|
+
if (sres.ok) {
|
|
1216
|
+
const sj = await sres.json();
|
|
1217
|
+
if (sj && sj.ok && sj.output)
|
|
1218
|
+
return { ok: true, output: sj.output };
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
catch { }
|
|
1223
|
+
// Yedek: yerel ucretsiz DuckDuckGo + otomatik fetch
|
|
1205
1224
|
const q = encodeURIComponent(String(args.query || ''));
|
|
1206
1225
|
const max = Number(args.max_results) || 5;
|
|
1207
1226
|
const res = await fetch(`https://html.duckduckgo.com/html/?q=${q}`, {
|