wormclaude 1.0.68 → 1.0.70
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/ansi.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/tools.js +18 -11
- package/package.json +1 -1
package/dist/ansi.js
CHANGED
|
@@ -173,7 +173,7 @@ export function itemAnsi(it, cols) {
|
|
|
173
173
|
const n = (it.result || '').split('\n').length, chars = (it.result || '').length;
|
|
174
174
|
const head = paint('✶ ', theme.redBright, true) + paint(it.label || '', theme.white);
|
|
175
175
|
const sub = paint(' ⎿ ', theme.greyDim) + (it.ok
|
|
176
|
-
? paint(`${n} ${t('common.lines') || 'satır'}
|
|
176
|
+
? paint(`${n} ${t('common.lines') || 'satır'}`, theme.grey)
|
|
177
177
|
: paint('✗ ' + (it.result || '').slice(0, 160), theme.errorRed));
|
|
178
178
|
return '\n' + head + '\n' + sub;
|
|
179
179
|
}
|
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -391,7 +391,7 @@ export const toolSchemas = [
|
|
|
391
391
|
type: 'function',
|
|
392
392
|
function: {
|
|
393
393
|
name: 'WebSearch',
|
|
394
|
-
description: 'Search the web
|
|
394
|
+
description: 'Search the web; returns top results (title, url, snippet). For an EXACT current value (price, exchange rate, score, today date) the snippet often lacks the live number — WebFetch the most relevant result URL to read the real value before answering. NEVER invent or guess a number; if you cannot verify, say so.',
|
|
395
395
|
parameters: {
|
|
396
396
|
type: 'object',
|
|
397
397
|
properties: {
|
|
@@ -791,7 +791,12 @@ export function toolLabel(name, args) {
|
|
|
791
791
|
if (name === 'Grep')
|
|
792
792
|
return `Grep(${args.pattern})`;
|
|
793
793
|
if (name === 'WebFetch')
|
|
794
|
-
return
|
|
794
|
+
return `🌐 ${(() => { try {
|
|
795
|
+
return new URL(args.url).hostname;
|
|
796
|
+
}
|
|
797
|
+
catch {
|
|
798
|
+
return String(args.url).slice(0, 50);
|
|
799
|
+
} })()}`;
|
|
795
800
|
if (name === 'Agent')
|
|
796
801
|
return `Agent(${args.description || ''}${args.subagent_type ? ':' + args.subagent_type : ''}${args.run_in_background ? ', bg' : ''})`;
|
|
797
802
|
if (name === 'TaskOutput')
|
|
@@ -801,7 +806,7 @@ export function toolLabel(name, args) {
|
|
|
801
806
|
if (name === 'Skill')
|
|
802
807
|
return `Skill(${args.name})`;
|
|
803
808
|
if (name === 'WebSearch')
|
|
804
|
-
return
|
|
809
|
+
return `🔍 Web arandı: ${String(args.query).slice(0, 50)}`;
|
|
805
810
|
if (name === 'TodoWrite')
|
|
806
811
|
return `TodoWrite(${(args.todos || []).length} öğe)`;
|
|
807
812
|
if (name === 'PowerShell')
|
|
@@ -1200,21 +1205,23 @@ export async function executeTool(name, args) {
|
|
|
1200
1205
|
const q = encodeURIComponent(String(args.query || ''));
|
|
1201
1206
|
const max = Number(args.max_results) || 5;
|
|
1202
1207
|
const res = await fetch(`https://html.duckduckgo.com/html/?q=${q}`, {
|
|
1203
|
-
headers: { 'User-Agent': 'Mozilla/5.0' }, signal: AbortSignal.timeout(20000),
|
|
1208
|
+
headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0 Safari/537.36' }, signal: AbortSignal.timeout(20000),
|
|
1204
1209
|
});
|
|
1205
1210
|
const html = await res.text();
|
|
1211
|
+
const clean = (s) => s.replace(/<[^>]+>/g, '').replace(/&/g, '&').replace(/'/g, "'").replace(/'/g, "'").replace(/"/g, '"').replace(/\s+/g, ' ').trim();
|
|
1212
|
+
const titles = [...html.matchAll(/<a[^>]*class="result__a"[^>]*href="([^"]+)"[^>]*>([\s\S]*?)<\/a>/g)];
|
|
1213
|
+
const snips = [...html.matchAll(/class="result__snippet"[^>]*>([\s\S]*?)<\/a>/g)];
|
|
1206
1214
|
const out = [];
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
while ((m = re.exec(html)) && out.length < max) {
|
|
1210
|
-
let url = m[1];
|
|
1215
|
+
for (let i = 0; i < titles.length && out.length < max; i++) {
|
|
1216
|
+
let url = titles[i][1];
|
|
1211
1217
|
const ud = url.match(/uddg=([^&]+)/);
|
|
1212
1218
|
if (ud)
|
|
1213
1219
|
url = decodeURIComponent(ud[1]);
|
|
1214
|
-
const title =
|
|
1215
|
-
|
|
1220
|
+
const title = clean(titles[i][2]);
|
|
1221
|
+
const snippet = snips[i] ? clean(snips[i][1]) : '';
|
|
1222
|
+
out.push(`${out.length + 1}. ${title}\n ${url}${snippet ? '\n ' + snippet : ''}`);
|
|
1216
1223
|
}
|
|
1217
|
-
return { ok: true, output: out.length ? out.join('\n') : '(sonuç yok)' };
|
|
1224
|
+
return { ok: true, output: out.length ? out.join('\n\n') : '(sonuç yok)' };
|
|
1218
1225
|
}
|
|
1219
1226
|
if (name === 'TodoWrite') {
|
|
1220
1227
|
todosStore = Array.isArray(args.todos) ? args.todos : [];
|