wormclaude 1.0.118 → 1.0.119
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 +14 -5
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// OpenAI function şemaları + Node executor'ları. Açıklamalar ve davranışlar
|
|
3
3
|
// WormClaude'un gerçek prompt.ts/şemalarından alınmıştır; sadece marka adı ve
|
|
4
4
|
// WormClaude'da bulunmayan araç referansları (Agent tool, sandbox) uyarlandı.
|
|
5
|
-
import { execSync, spawn } from 'node:child_process';
|
|
5
|
+
import { execSync, spawn, spawnSync } from 'node:child_process';
|
|
6
6
|
import * as fs from 'node:fs';
|
|
7
7
|
import * as os from 'node:os';
|
|
8
8
|
import * as path from 'node:path';
|
|
@@ -50,10 +50,13 @@ function runBashCapturingCwd(command, timeout) {
|
|
|
50
50
|
const cwd = getBashCwd();
|
|
51
51
|
const opts = { encoding: 'utf8', timeout, maxBuffer: 10 * 1024 * 1024, windowsHide: true, cwd };
|
|
52
52
|
if (process.platform === 'win32') {
|
|
53
|
-
// stderr'i
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
const
|
|
53
|
+
// spawnSync: stdout+stderr'i AYRI yakalar (komutu DEĞİŞTİRMEDEN) → curl'ün "% Total" progress
|
|
54
|
+
// meter'ı terminale sızmaz. execSync stderr'i inherit ederdi; `2>&1` ise zincirli (A && B)
|
|
55
|
+
// komutlarda yalnız SON komutun stderr'ini yakalıyordu (ilkininki sızıyordu).
|
|
56
|
+
const r = spawnSync(command, { ...opts, shell: true });
|
|
57
|
+
if (r.error)
|
|
58
|
+
throw r.error;
|
|
59
|
+
const out = (r.stdout || '') + (r.stderr || '');
|
|
57
60
|
// best-effort: "cd <hedef>" / "cd /d <hedef>" (zincirsiz tek komut)
|
|
58
61
|
const m = /^\s*cd\s+(?:\/d\s+)?"?([^"&|<>]+?)"?\s*$/i.exec(command);
|
|
59
62
|
if (m) {
|
|
@@ -64,6 +67,12 @@ function runBashCapturingCwd(command, timeout) {
|
|
|
64
67
|
}
|
|
65
68
|
catch { /* yok say */ }
|
|
66
69
|
}
|
|
70
|
+
if (typeof r.status === 'number' && r.status !== 0) {
|
|
71
|
+
const e = new Error(out || `Command failed (exit ${r.status})`);
|
|
72
|
+
e.stdout = out;
|
|
73
|
+
e.status = r.status;
|
|
74
|
+
throw e;
|
|
75
|
+
}
|
|
67
76
|
return out;
|
|
68
77
|
}
|
|
69
78
|
// POSIX
|