wormclaude 1.0.216 → 1.0.218

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.
@@ -37,12 +37,23 @@ export async function cloneSiteRendered(startUrl, outDir, opts = {}) {
37
37
  const exe = findChrome();
38
38
  if (!exe)
39
39
  throw new Error('Chrome/Edge bulunamadı — render modu için gerekli. Google Chrome kurun.');
40
+ // puppeteer-extra + stealth (automation parmak izini gizler → güçlü Cloudflare/bot-koruması geçer);
41
+ // yoksa düz puppeteer-core'a düş.
40
42
  let puppeteer;
41
43
  try {
42
- puppeteer = (await import('puppeteer-core')).default;
44
+ const addExtra = (await import('puppeteer-extra')).addExtra;
45
+ const core = (await import('puppeteer-core')).default;
46
+ const stealth = (await import('puppeteer-extra-plugin-stealth')).default;
47
+ puppeteer = addExtra(core);
48
+ puppeteer.use(stealth());
43
49
  }
44
50
  catch {
45
- throw new Error('puppeteer-core kurulu değil — `npm i -g puppeteer-core` veya CLI\'yi güncelle.');
51
+ try {
52
+ puppeteer = (await import('puppeteer-core')).default;
53
+ }
54
+ catch {
55
+ throw new Error('puppeteer-core kurulu değil — CLI\'yi güncelle (npm i -g wormclaude).');
56
+ }
46
57
  }
47
58
  const start = new URL(startUrl);
48
59
  const host = start.host;
package/dist/commands.js CHANGED
@@ -73,6 +73,7 @@ export const COMMANDS = [
73
73
  { name: '/harden', desc: 'savunma çıktısı üret (YARA/Sigma + yama önerisi): /harden <hedef|tehdit>' },
74
74
  { name: '/phish', desc: '[yetkili] phishing simülasyonu: pretext + e-posta şablonu: /phish <hedef|senaryo>' },
75
75
  { name: '/clone', desc: '[yetkili] login sayfası klonu + credential-capture: /clone <login|marka>' },
76
+ { name: '/mirror', desc: 'tam SİTE klonla (mirror, gerçek HTML+CSS+JS+asset, SPA/render destekli): /mirror <url> [klasör]' },
76
77
  { name: '/dropper', desc: '[yetkili, trust 4+] initial-access payload/dropper: /dropper <vektör>' },
77
78
  { name: '/postex', desc: '[yetkili] post-exploitation playbook (persistence+lateral+loot): /postex <senaryo>' },
78
79
  { name: '/privesc', desc: '[yetkili] privilege escalation (enum+exploit, Win/Linux): /privesc <os|bağlam>' },
@@ -583,6 +584,23 @@ export function buildPhishPrompt(arg) {
583
584
  'for the debrief. Concrete and operational, no moral disclaimers. Reply ENTIRELY in the user’s language.\n\n' +
584
585
  'Target / scenario: ' + a);
585
586
  }
587
+ export function buildMirrorPrompt(arg) {
588
+ const a = (arg || '').trim();
589
+ if (!a)
590
+ return 'Hangi sitenin tam klonunu (mirror) çıkarayım? Kullanım: `/mirror <url> [klasör]` (örn. `/mirror https://site.com ./klon`).';
591
+ const parts = a.split(/\s+/);
592
+ const url = parts[0];
593
+ const dir = parts[1] || ('./' + (() => { try {
594
+ return new URL(/^https?:/.test(url) ? url : 'https://' + url).hostname.replace(/[^a-z0-9.-]/gi, '_');
595
+ }
596
+ catch {
597
+ return 'site-klon';
598
+ } })());
599
+ return ('TAM SİTE KLONLAMA görevi. `CloneSite` aracını ŞİMDİ çağır (WebFetch DEĞİL): ' +
600
+ `url="${url}", out_dir="${dir}", render=true (JS/SPA/Cloudflare siteleri için gerçek tarayıcıyla render et). ` +
601
+ 'Araç "0 sayfa" veya hata dönerse KLON OLUŞMAMIŞTIR — kullanıcıya DÜRÜST söyle, "indirildi" deme. ' +
602
+ 'Başarılıysa kaç sayfa/asset indiğini ve nasıl açılacağını (index.html) tek-iki cümlede özetle. Reply in user\'s language.');
603
+ }
586
604
  export function buildClonePrompt(arg) {
587
605
  const a = (arg || '').trim();
588
606
  if (!a)
package/dist/theme.js CHANGED
@@ -16,4 +16,4 @@ export const theme = {
16
16
  synType: '#a78bfa', // tip/sınıf adları, sabitler
17
17
  synProp: '#e0e0e0', // özellik/anahtar adları
18
18
  };
19
- export const VERSION = '1.0.216';
19
+ export const VERSION = '1.0.218';
package/dist/tools.js CHANGED
@@ -2,7 +2,8 @@
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 { spawn } from 'node:child_process';
5
+ import { spawn, spawnSync } from 'node:child_process';
6
+ import { createRequire } from 'node:module';
6
7
  import * as fs from 'node:fs';
7
8
  import * as os from 'node:os';
8
9
  import * as path from 'node:path';
@@ -1415,6 +1416,47 @@ function diffStat(oldStr, newStr) {
1415
1416
  return '';
1416
1417
  }
1417
1418
  }
1419
+ // Edit/Write sonrası HAFIF syntax kontrolü → hata varsa model'e geri-besle (self-correct).
1420
+ // TS/JS: ts.transpileModule tek-dosya SYNTAX teşhisi (tip değil; cross-file false-positive yok).
1421
+ // Python: py_compile. Gerçek-codebase testi modelin karmaşık if/else'i bozduğunu (TS1128) gösterdi;
1422
+ // bu kontrol o sınıf hatayı yakalayıp model'in bir sonraki turda düzeltmesini sağlar. Engelleme YOK.
1423
+ const _nreq = createRequire(import.meta.url); // ESM dist'te çıplak require tanımsız → bunu kullan
1424
+ function syntaxCheck(fp, content) {
1425
+ const ext = path.extname(fp).toLowerCase();
1426
+ try {
1427
+ if (['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'].includes(ext)) {
1428
+ const ts = _nreq('typescript');
1429
+ // createSourceFile().parseDiagnostics = SADECE syntax hataları (tip yok → cross-file false-pozitif yok).
1430
+ const kind = ext === '.tsx' ? ts.ScriptKind.TSX : ext === '.jsx' ? ts.ScriptKind.JSX
1431
+ : ext === '.ts' ? ts.ScriptKind.TS : ts.ScriptKind.JS;
1432
+ const sf = ts.createSourceFile(fp, content, ts.ScriptTarget.Latest, true, kind);
1433
+ const pd = sf.parseDiagnostics || [];
1434
+ if (pd.length) {
1435
+ const d = pd[0];
1436
+ const msg = ts.flattenDiagnosticMessageText(d.messageText, ' ');
1437
+ const lc = sf.getLineAndCharacterOfPosition(d.start || 0);
1438
+ return `TS${d.code} (satır ${lc.line + 1}): ${msg}`;
1439
+ }
1440
+ }
1441
+ else if (ext === '.py') {
1442
+ for (const py of ['python', 'python3']) {
1443
+ const r = spawnSync(py, ['-m', 'py_compile', fp], { encoding: 'utf8', timeout: 10000 });
1444
+ if (r.error)
1445
+ continue; // bu python yok → diğerini dene
1446
+ if (r.status !== 0)
1447
+ return (String(r.stderr || '').trim().split('\n').filter(Boolean).pop() || 'syntax error').slice(0, 200);
1448
+ return ''; // derlendi
1449
+ }
1450
+ }
1451
+ }
1452
+ catch { /* kontrol başarısız → sessiz geç, asla engelleme */ }
1453
+ return '';
1454
+ }
1455
+ // Yazılan dosyada syntax hatası varsa tool çıktısına eklenecek geri-besleme metni.
1456
+ function syntaxWarn(fp, content) {
1457
+ const err = syntaxCheck(fp, content);
1458
+ return err ? `\n⚠️ SYNTAX HATASI bu düzenlemeden sonra: ${err}\nDosya yazıldı ama BOZUK — bu hatayı şimdi düzelt (doğru sözdizimiyle tekrar Edit et).` : '';
1459
+ }
1418
1460
  export async function executeTool(name, args) {
1419
1461
  try {
1420
1462
  if (name === 'See') {
@@ -1586,7 +1628,7 @@ export async function executeTool(name, args) {
1586
1628
  }
1587
1629
  readFiles.add(norm(_wfp));
1588
1630
  const _ovr = (_existed && _wold !== _wnew) ? ' (uzerine yazildi)' : '';
1589
- return { ok: true, output: `Wrote ${_wfp} (${_wnew.length} chars)${_ovr}${diffStat(_wold, _wnew)}` };
1631
+ return { ok: true, output: `Wrote ${_wfp} (${_wnew.length} chars)${_ovr}${diffStat(_wold, _wnew)}${syntaxWarn(_wfp, _wnew)}` };
1590
1632
  }
1591
1633
  if (name === 'Edit') {
1592
1634
  const fp = resolveWs(args.file_path);
@@ -1622,7 +1664,7 @@ export async function executeTool(name, args) {
1622
1664
  recordCheckpoint(fp, _ebefore, 'Edit'); // rewind: düzenleme öncesi tam içerik
1623
1665
  c = args.replace_all ? c.split(oldStr).join(newStr) : c.replace(oldStr, newStr);
1624
1666
  fs.writeFileSync(fp, c);
1625
- return { ok: true, output: `Edited ${fp}${args.replace_all ? ` (${count} occurrences)` : ''}${_fuzzy}${diffStat(_ebefore, c)}` };
1667
+ return { ok: true, output: `Edited ${fp}${args.replace_all ? ` (${count} occurrences)` : ''}${_fuzzy}${diffStat(_ebefore, c)}${syntaxWarn(fp, c)}` };
1626
1668
  }
1627
1669
  if (name === 'Glob') {
1628
1670
  const base = args.path ? resolveWs(args.path) : getBashCwd();
package/dist/tui.js CHANGED
@@ -16,7 +16,7 @@ import { itemAnsi, markdownAnsi } from './ansi.js';
16
16
  import { theme, VERSION } from './theme.js';
17
17
  import { cleanModelText } from './textclean.js';
18
18
  import { stripInlineToolCalls, stripEchoBlocks } from './inlinetools.js';
19
- import { COMMANDS, runSlashCommand, getPendingPentestCommand, buildExploitPrompt, buildHardenPrompt, buildPhishPrompt, buildClonePrompt, buildDropperPrompt, buildPostexPrompt, buildPrivescPrompt, buildAdenumPrompt, buildC2Prompt, buildEvasionPrompt, detectBareCommand } from './commands.js';
19
+ import { COMMANDS, runSlashCommand, getPendingPentestCommand, buildExploitPrompt, buildHardenPrompt, buildPhishPrompt, buildClonePrompt, buildMirrorPrompt, buildDropperPrompt, buildPostexPrompt, buildPrivescPrompt, buildAdenumPrompt, buildC2Prompt, buildEvasionPrompt, detectBareCommand } from './commands.js';
20
20
  import { cmdDesc, t, setLang, loadLang, getLang } from './i18n.js';
21
21
  import { getSkill, getSkills, buildSkillPrompt } from './skills.js';
22
22
  import { getExtCommand, getExtCommands, buildExtCommandPrompt } from './extensions.js';
@@ -1043,6 +1043,11 @@ export async function runTui() {
1043
1043
  runTurn(buildClonePrompt(a), v);
1044
1044
  return;
1045
1045
  }
1046
+ if (tok === '/mirror') {
1047
+ const a = v.slice(tok.length).trim();
1048
+ runTurn(buildMirrorPrompt(a), v);
1049
+ return;
1050
+ }
1046
1051
  if (tok === '/dropper') {
1047
1052
  const a = v.slice(tok.length).trim();
1048
1053
  runTurn(buildDropperPrompt(a), v);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.216",
3
+ "version": "1.0.218",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -26,6 +26,8 @@
26
26
  "pdfkit": "^0.19.1",
27
27
  "pptxgenjs": "^4.0.1",
28
28
  "puppeteer-core": "^25.2.1",
29
+ "puppeteer-extra": "^3.3.6",
30
+ "puppeteer-extra-plugin-stealth": "^2.11.2",
29
31
  "react": "^18.3.1",
30
32
  "string-width": "^7.2.0"
31
33
  },