wormclaude 1.0.71 → 1.0.72
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 +24 -18
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -1222,28 +1222,34 @@ export async function executeTool(name, args) {
|
|
|
1222
1222
|
out.push(`${out.length + 1}. ${title}\n ${url}${snippet ? '\n ' + snippet : ''}`);
|
|
1223
1223
|
}
|
|
1224
1224
|
let output = out.length ? out.join('\n\n') : '(sonuç yok)';
|
|
1225
|
-
// OTOMATIK FETCH: en alakali ilk sonucun gercek icerigini
|
|
1226
|
-
|
|
1225
|
+
// OTOMATIK FETCH: en alakali ilk 3 sonucun gercek icerigini PARALEL cek (model coklu kaynaktan dogrulayip coklu kaynak gostersin, Claude gibi)
|
|
1226
|
+
const topUrls = titles.slice(0, 3).map((tt) => {
|
|
1227
|
+
let u = tt[1];
|
|
1228
|
+
const ud0 = u.match(/uddg=([^&]+)/);
|
|
1229
|
+
if (ud0)
|
|
1230
|
+
u = decodeURIComponent(ud0[1]);
|
|
1231
|
+
if (u.startsWith('http://'))
|
|
1232
|
+
u = 'https://' + u.slice(7);
|
|
1233
|
+
return u;
|
|
1234
|
+
});
|
|
1235
|
+
const fetched = await Promise.all(topUrls.map(async (u) => {
|
|
1227
1236
|
try {
|
|
1228
|
-
|
|
1229
|
-
const ud0 = topUrl.match(/uddg=([^&]+)/);
|
|
1230
|
-
if (ud0)
|
|
1231
|
-
topUrl = decodeURIComponent(ud0[1]);
|
|
1232
|
-
if (topUrl.startsWith('http://'))
|
|
1233
|
-
topUrl = 'https://' + topUrl.slice(7);
|
|
1234
|
-
const fres = await fetch(topUrl, { signal: AbortSignal.timeout(12000), headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0 Safari/537.36' } });
|
|
1237
|
+
const fres = await fetch(u, { signal: AbortSignal.timeout(12000), headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0 Safari/537.36' } });
|
|
1235
1238
|
let ftxt = (await fres.text()).replace(/<script[\s\S]*?<\/script>/gi, '').replace(/<style[\s\S]*?<\/style>/gi, '').replace(/<[^>]+>/g, ' ').replace(/ /g, ' ').replace(/\s+/g, ' ').trim();
|
|
1236
|
-
if (ftxt)
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
catch { }
|
|
1242
|
-
output += '\n\n--- ' + host + ' (icerik) ---\n' + ftxt.slice(0, 4000);
|
|
1239
|
+
if (!ftxt)
|
|
1240
|
+
return '';
|
|
1241
|
+
let host = u;
|
|
1242
|
+
try {
|
|
1243
|
+
host = new URL(u).hostname;
|
|
1243
1244
|
}
|
|
1245
|
+
catch { }
|
|
1246
|
+
return '\n\n--- ' + host + ' (' + u + ') ---\n' + ftxt.slice(0, 2800);
|
|
1244
1247
|
}
|
|
1245
|
-
catch {
|
|
1246
|
-
|
|
1248
|
+
catch {
|
|
1249
|
+
return '';
|
|
1250
|
+
}
|
|
1251
|
+
}));
|
|
1252
|
+
output += fetched.join('');
|
|
1247
1253
|
return { ok: true, output };
|
|
1248
1254
|
}
|
|
1249
1255
|
if (name === 'TodoWrite') {
|