wormclaude 1.0.158 → 1.0.160
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/cli.js +6 -2
- package/dist/theme.js +1 -1
- package/dist/tools.js +16 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -948,9 +948,13 @@ function App() {
|
|
|
948
948
|
// başarısızlıklar birikir) toplam eşiği aşınca dur+özetle.
|
|
949
949
|
const _failed = results.filter((r) => !r.ok).length;
|
|
950
950
|
totalFails += _failed;
|
|
951
|
+
// Kurulum turu: model eksik aracı kuruyor (winget/choco/pip/apt/brew/npm -g…). Bu normal
|
|
952
|
+
// KURTARMA, "başarısızlık döngüsü" değil → ardışık-fail sayacını SIFIRLA ki uzun install
|
|
953
|
+
// (ya da install öncesi 'komut yok' hatası) devre-kesiciyi erken tetikleyip taramayı kesmesin.
|
|
954
|
+
const _installTurn = results.some((r) => /\b(?:winget|choco|scoop|apt(?:-get)?|dnf|yum|zypper|pacman|brew|pip3?|pipx|gem|cargo|go)\b[^|&;]*\b(?:install|-S|in)\b/i.test(String(r?.args?.command || '')));
|
|
951
955
|
const _allFailed = results.length > 0 && _failed === results.length;
|
|
952
|
-
consecFailTurns = _allFailed ? consecFailTurns + 1 : 0;
|
|
953
|
-
if (consecFailTurns >= 2 || totalFails >=
|
|
956
|
+
consecFailTurns = (_allFailed && !_installTurn) ? consecFailTurns + 1 : 0;
|
|
957
|
+
if (consecFailTurns >= 2 || totalFails >= 5) {
|
|
954
958
|
historyRef.current = [...historyRef.current, {
|
|
955
959
|
role: 'user',
|
|
956
960
|
content: getLang() === 'en'
|
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -32,6 +32,16 @@ const DEFAULT_BASH_TIMEOUT_MS = 120000;
|
|
|
32
32
|
// Bunları run_in_background istenmese bile OTOMATİK arka plana alıyoruz → CLI asla donmaz.
|
|
33
33
|
const _DEV_SERVER_RE = /\b(?:npm|pnpm|yarn)\s+(?:run\s+)?(?:dev|start|serve|preview)\b|\b(?:next|nuxt|vite|gatsby)\s+(?:dev|develop|start)\b|\bng\s+serve\b|\breact-scripts\s+start\b|\bnodemon\b|\bhttp-server\b|(?:^|\s)serve(?:\s|$)|\bpython3?\s+-m\s+http\.server\b|\bflask\s+run\b|\buvicorn\b|\bgunicorn\b|\bphp\s+-S\b|\brails\s+s(?:erver)?\b|\bwebpack(?:-dev-server)?\s+serve\b/i;
|
|
34
34
|
const MAX_BASH_TIMEOUT_MS = 600000;
|
|
35
|
+
// Paket KURULUM komutları (winget/choco/pip/apt/brew/npm -g …) yavaştır (indirme+derleme):
|
|
36
|
+
// 2 dk default timeout'u aşıp ÖLDÜRÜLÜYORLARDI → "install yarım kaldı" + devre-kesici tetikleniyordu.
|
|
37
|
+
// Bunlara otomatik MAX timeout (10 dk) verilir; model ayrıca süre belirtirse o kullanılır.
|
|
38
|
+
const _LONG_INSTALL_RE = /\b(?:winget\s+install|choco\s+install|scoop\s+install|apt(?:-get)?\s+install|dnf\s+install|yum\s+install|zypper\s+(?:in|install)|pacman\s+-S|brew\s+install|pip3?\s+install|pipx\s+install|gem\s+install|cargo\s+install|go\s+install|npm\s+(?:i|install)\b[^|&;]*-g)\b/i;
|
|
39
|
+
function _cmdTimeout(cmd, explicit) {
|
|
40
|
+
let t = Number(explicit) || (_LONG_INSTALL_RE.test(cmd) ? MAX_BASH_TIMEOUT_MS : DEFAULT_BASH_TIMEOUT_MS);
|
|
41
|
+
if (t > MAX_BASH_TIMEOUT_MS)
|
|
42
|
+
t = MAX_BASH_TIMEOUT_MS;
|
|
43
|
+
return t;
|
|
44
|
+
}
|
|
35
45
|
// Bash çalışma dizini — oturum boyunca kalıcı. execSync her çağrıda taze shell açtığı için
|
|
36
46
|
// `cd` normalde kaybolur; burada cwd'yi takip edip her komuta geçiriyoruz.
|
|
37
47
|
let bashCwd;
|
|
@@ -740,8 +750,10 @@ async function execOne(call, hooks) {
|
|
|
740
750
|
// HYBRID: bu gömülü ilk-geçiştir. Modele, kullanıcıya derin taramayı TEKLİF ettir.
|
|
741
751
|
txt += '\n\n[hybrid-note] This was WormClaude\'s fast embedded first-pass scan. After reporting these'
|
|
742
752
|
+ ' findings, OFFER the user (in their language) a deeper full scan with real tools'
|
|
743
|
-
+ ' (nmap, nuclei, sqlmap, dalfox, ffuf)
|
|
744
|
-
+ ' target
|
|
753
|
+
+ ' (nmap, nuclei, sqlmap, dalfox, ffuf), paired with the authorization reminder: for'
|
|
754
|
+
+ ' educational/authorized use only — run it only if the user owns the target or holds a written'
|
|
755
|
+
+ ' authorization document. Escalate ONLY if the user accepts AND has confirmed ownership/written'
|
|
756
|
+
+ ' authorization (ask once if unstated).';
|
|
745
757
|
return { ok: true, output: txt, args };
|
|
746
758
|
}
|
|
747
759
|
catch (e) {
|
|
@@ -1031,9 +1043,7 @@ export async function executeTool(name, args) {
|
|
|
1031
1043
|
: '';
|
|
1032
1044
|
return { ok: true, output: `Background task started: ${task.id}.${_note} Read output later with TaskOutput("${task.id}").` };
|
|
1033
1045
|
}
|
|
1034
|
-
|
|
1035
|
-
if (timeout > MAX_BASH_TIMEOUT_MS)
|
|
1036
|
-
timeout = MAX_BASH_TIMEOUT_MS;
|
|
1046
|
+
const timeout = _cmdTimeout(_cmd, args.timeout);
|
|
1037
1047
|
const out = await runBashCapturingCwd(String(args.command), timeout);
|
|
1038
1048
|
return { ok: true, output: (out || '(no output)').slice(0, 20000) };
|
|
1039
1049
|
}
|
|
@@ -1387,9 +1397,7 @@ export async function executeTool(name, args) {
|
|
|
1387
1397
|
return { ok: true, output: txt || '(boş)' };
|
|
1388
1398
|
}
|
|
1389
1399
|
if (name === 'PowerShell') {
|
|
1390
|
-
|
|
1391
|
-
if (timeout > MAX_BASH_TIMEOUT_MS)
|
|
1392
|
-
timeout = MAX_BASH_TIMEOUT_MS;
|
|
1400
|
+
const timeout = _cmdTimeout(String(args.command), args.timeout);
|
|
1393
1401
|
const cmd = String(args.command).replace(/"/g, '\\"');
|
|
1394
1402
|
// ASYNC — event-loop'u bloklamaz (eski execSync donmaya sebep oluyordu).
|
|
1395
1403
|
const { out, code, killed } = await _spawnAsync(`powershell -NoProfile -NonInteractive -Command "${cmd}"`, timeout, { shell: true, windowsHide: true, cwd: getBashCwd() });
|