wormclaude 1.0.206 → 1.0.208
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 +31 -0
- package/package.json +2 -1
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -51,6 +51,18 @@ export function setBashCwd(dir) { bashCwd = dir; }
|
|
|
51
51
|
// çağırıp döngüye giriyordu. Aynı (tool,target) 2 dk içinde tekrar gelirse YENİDEN tarama yok —
|
|
52
52
|
// önceki sonucu + "yeniden tarama, bulgularla yanıtla" notunu dön.
|
|
53
53
|
const _scanCache = new Map();
|
|
54
|
+
// Yerel analiz araçları (JwtAudit/CodeAudit) döngü-kırıcı: model sonucu raporlamak yerine aynı
|
|
55
|
+
// aracı tekrar çağırıyordu (gerçek-kullanıcı testinde JwtAudit 6 kez). Aynı çağrı 2 dk içinde
|
|
56
|
+
// tekrarlanırsa "zaten yapıldı, metinle özetle" döndür.
|
|
57
|
+
const _localCallCache = new Map();
|
|
58
|
+
function _localRecall(name, keyArg) {
|
|
59
|
+
const k = name + '|' + keyArg.slice(0, 200);
|
|
60
|
+
const prev = _localCallCache.get(k);
|
|
61
|
+
if (prev && Date.now() - prev < 120000)
|
|
62
|
+
return true;
|
|
63
|
+
_localCallCache.set(k, Date.now());
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
54
66
|
// Göreli dosya yollarını AKTİF workspace'e (bashCwd) çözer; mutlak yol aynen kalır.
|
|
55
67
|
// Böylece model "index.html" gibi göreli yol verse bile dosya bilinen klasöre yazılır.
|
|
56
68
|
export function resolveWs(fp) {
|
|
@@ -1005,6 +1017,9 @@ async function execOne(call, hooks) {
|
|
|
1005
1017
|
}
|
|
1006
1018
|
// 3.45) SAST — kaynak kod güvenlik denetimi (YEREL; kod sunucuya gitmez)
|
|
1007
1019
|
if (call.name === 'CodeAudit') {
|
|
1020
|
+
if (_localRecall('CodeAudit', String(args?.path || '.'))) {
|
|
1021
|
+
return { ok: false, args, output: '[ALREADY-DONE] Bu klasör zaten denetlendi (sonuç yukarıda). TEKRAR CodeAudit çağırma — bulguları ŞİMDİ metinle özetle.' };
|
|
1022
|
+
}
|
|
1008
1023
|
try {
|
|
1009
1024
|
const { auditCode } = await import('./codeaudit.js');
|
|
1010
1025
|
const fsMod = await import('node:fs');
|
|
@@ -1040,6 +1055,9 @@ async function execOne(call, hooks) {
|
|
|
1040
1055
|
}
|
|
1041
1056
|
// 3.46) JWT güvenlik analizi (YEREL; token sunucuya gitmez)
|
|
1042
1057
|
if (call.name === 'JwtAudit') {
|
|
1058
|
+
if (_localRecall('JwtAudit', String(args?.token || ''))) {
|
|
1059
|
+
return { ok: false, args, output: '[ALREADY-DONE] Bu JWT zaten analiz edildi (sonuç yukarıda). TEKRAR JwtAudit çağırma — bulguları ŞİMDİ metinle özetle.' };
|
|
1060
|
+
}
|
|
1043
1061
|
try {
|
|
1044
1062
|
const { analyzeJwt } = await import('./jwt.js');
|
|
1045
1063
|
const r = analyzeJwt(String(args?.token || ''));
|
|
@@ -1476,6 +1494,19 @@ export async function executeTool(name, args) {
|
|
|
1476
1494
|
return { ok: false, output: `Error: file does not exist: ${fp}` };
|
|
1477
1495
|
if (fs.statSync(fp).isDirectory())
|
|
1478
1496
|
return { ok: false, output: 'Error: path is a directory. Use an ls command via Bash to read a directory.' };
|
|
1497
|
+
// PDF → metin çıkar (native, kütüphane gömülü). Ham bayt yerine sayfaların metni.
|
|
1498
|
+
if (/\.pdf$/i.test(fp)) {
|
|
1499
|
+
try {
|
|
1500
|
+
const { PDFParse } = await import('pdf-parse');
|
|
1501
|
+
const r = await new PDFParse({ data: fs.readFileSync(fp) }).getText();
|
|
1502
|
+
readFiles.add(norm(fp));
|
|
1503
|
+
const txt = String(r?.text || '').trim();
|
|
1504
|
+
return { ok: true, output: txt ? `[PDF metni — ${fp}]\n${txt.slice(0, 60000)}` : '<system-reminder>PDF açıldı ama metin çıkmadı (taranmış/görsel PDF olabilir).</system-reminder>' };
|
|
1505
|
+
}
|
|
1506
|
+
catch (e) {
|
|
1507
|
+
return { ok: false, output: 'PDF okuma hatası: ' + (e?.message || e) };
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1479
1510
|
const raw = fs.readFileSync(fp, 'utf8');
|
|
1480
1511
|
readFiles.add(norm(fp));
|
|
1481
1512
|
if (raw.length === 0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wormclaude",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.208",
|
|
4
4
|
"description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"ink-spinner": "^5.0.0",
|
|
23
23
|
"ink-text-input": "^6.0.0",
|
|
24
24
|
"log-update": "^5.0.1",
|
|
25
|
+
"pdf-parse": "^2.4.5",
|
|
25
26
|
"pdfkit": "^0.19.1",
|
|
26
27
|
"pptxgenjs": "^4.0.1",
|
|
27
28
|
"react": "^18.3.1",
|