wormclaude 1.0.229 → 1.0.230
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 +26 -12
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -1427,9 +1427,20 @@ export function toolLabel(name, args) {
|
|
|
1427
1427
|
return `${name}(...)`;
|
|
1428
1428
|
}
|
|
1429
1429
|
// ── Yardımcılar ───────────────────────────────────────────────────────────────
|
|
1430
|
-
|
|
1431
|
-
|
|
1430
|
+
// Taranmayacak ağır/cache dizinleri — ev dizini (C:\Users\...) globlanınca .bun/.npm/AppData
|
|
1431
|
+
// gibi on binlerce dosyalı ağaçlar 30dk hang yapıyordu. Bunları atla + zaman bütçesi koy.
|
|
1432
|
+
const _WALK_IGNORE = new Set([
|
|
1433
|
+
'node_modules', '.git', '.bun', '.npm', '.pnpm-store', '.yarn', '.cache', '.cargo', '.rustup',
|
|
1434
|
+
'.gradle', '.m2', '.nuget', '.conda', '.nvm', '.pyenv', 'appdata', 'application data',
|
|
1435
|
+
'.vscode', '.vscode-server', '.idea', 'dist', 'build', '.next', '.nuxt', '.svelte-kit',
|
|
1436
|
+
'venv', '.venv', '__pycache__', '.pytest_cache', '.mypy_cache', '.tox', 'target',
|
|
1437
|
+
'.expo', 'library', '.docker', '.android', '.ollama', '$recycle.bin',
|
|
1438
|
+
]);
|
|
1439
|
+
function walk(dir, out, depth = 0, deadline = 0) {
|
|
1440
|
+
if (depth > 12 || out.length >= 10000)
|
|
1432
1441
|
return;
|
|
1442
|
+
if (deadline && Date.now() > deadline)
|
|
1443
|
+
return; // zaman bütçesi → ev dizini taramasında hang'i önle
|
|
1433
1444
|
let entries;
|
|
1434
1445
|
try {
|
|
1435
1446
|
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
@@ -1438,13 +1449,16 @@ function walk(dir, out, depth = 0) {
|
|
|
1438
1449
|
return;
|
|
1439
1450
|
}
|
|
1440
1451
|
for (const e of entries) {
|
|
1441
|
-
if (
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1452
|
+
if (out.length >= 10000 || (deadline && Date.now() > deadline))
|
|
1453
|
+
return;
|
|
1454
|
+
if (e.isDirectory()) {
|
|
1455
|
+
if (_WALK_IGNORE.has(e.name.toLowerCase()))
|
|
1456
|
+
continue;
|
|
1457
|
+
walk(path.join(dir, e.name), out, depth + 1, deadline);
|
|
1458
|
+
}
|
|
1459
|
+
else {
|
|
1460
|
+
out.push(path.join(dir, e.name));
|
|
1461
|
+
}
|
|
1448
1462
|
}
|
|
1449
1463
|
}
|
|
1450
1464
|
function globToRegex(pattern) {
|
|
@@ -1882,7 +1896,7 @@ export async function executeTool(name, args) {
|
|
|
1882
1896
|
if (name === 'Glob') {
|
|
1883
1897
|
const base = args.path ? resolveWs(args.path) : getBashCwd();
|
|
1884
1898
|
const all = [];
|
|
1885
|
-
walk(base, all);
|
|
1899
|
+
walk(base, all, 0, Date.now() + 8000);
|
|
1886
1900
|
const rx = globToRegex(args.pattern);
|
|
1887
1901
|
let matches = all.filter((f) => rx.test(f.replace(/\\/g, '/')));
|
|
1888
1902
|
// Değiştirilme zamanına göre sırala (yeni → eski), WormClaude gibi
|
|
@@ -1914,7 +1928,7 @@ export async function executeTool(name, args) {
|
|
|
1914
1928
|
if (fs.existsSync(base) && fs.statSync(base).isFile())
|
|
1915
1929
|
files.push(base);
|
|
1916
1930
|
else
|
|
1917
|
-
walk(base, files);
|
|
1931
|
+
walk(base, files, 0, Date.now() + 8000);
|
|
1918
1932
|
// type / glob filtresi
|
|
1919
1933
|
let filtered = files;
|
|
1920
1934
|
if (args.type && TYPE_EXT[args.type]) {
|
|
@@ -2222,7 +2236,7 @@ export async function executeTool(name, args) {
|
|
|
2222
2236
|
const refRe = new RegExp(`\\b${esc}\\b`);
|
|
2223
2237
|
const rx = args.action === 'definition' ? defRe : refRe;
|
|
2224
2238
|
const files = [];
|
|
2225
|
-
walk(base, files);
|
|
2239
|
+
walk(base, files, 0, Date.now() + 8000);
|
|
2226
2240
|
const hits = [];
|
|
2227
2241
|
for (const f of files) {
|
|
2228
2242
|
if (hits.length > 100)
|