wormclaude 1.0.70 → 1.0.71
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 -1
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -1221,7 +1221,30 @@ export async function executeTool(name, args) {
|
|
|
1221
1221
|
const snippet = snips[i] ? clean(snips[i][1]) : '';
|
|
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 de cek (model snippet'e baglanip uydurmasin)
|
|
1226
|
+
if (titles.length > 0) {
|
|
1227
|
+
try {
|
|
1228
|
+
let topUrl = titles[0][1];
|
|
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' } });
|
|
1235
|
+
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
|
+
let host = topUrl;
|
|
1238
|
+
try {
|
|
1239
|
+
host = new URL(topUrl).hostname;
|
|
1240
|
+
}
|
|
1241
|
+
catch { }
|
|
1242
|
+
output += '\n\n--- ' + host + ' (icerik) ---\n' + ftxt.slice(0, 4000);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
catch { }
|
|
1246
|
+
}
|
|
1247
|
+
return { ok: true, output };
|
|
1225
1248
|
}
|
|
1226
1249
|
if (name === 'TodoWrite') {
|
|
1227
1250
|
todosStore = Array.isArray(args.todos) ? args.todos : [];
|