wormclaude 1.0.217 → 1.0.219

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 CHANGED
@@ -213,6 +213,13 @@ const _initHistory = () => {
213
213
  // /kopyala komutu (OSC52 ile panoya) sağlanır. ?1049h alt-screen · ?1007h alternate-scroll.
214
214
  // VARSAYILAN: özel renderer (TUI). Eski ink sürümüne dönmek için WORMCLAUDE_INK=1.
215
215
  const _TUI = process.env.WORMCLAUDE_INK ? false : true;
216
+ // Pencere/sekme başlığı → "WormClaude" (cmd/Windows Terminal'de "C:\WINDOWS\system32\cmd.exe"
217
+ // yerine). OSC 0 = ikon-adı + başlık. Renderer dalı ÖNCESİ → hem TUI hem ink'te geçerli.
218
+ try {
219
+ if (process.stdout.isTTY)
220
+ process.stdout.write('\x1b]0;WormClaude\x07');
221
+ }
222
+ catch { }
216
223
  if (!_TUI) {
217
224
  try {
218
225
  process.stdout.write('\x1b[?1049h\x1b[?1007h\x1b[2J\x1b[H');
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.217';
19
+ export const VERSION = '1.0.219';
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.217",
3
+ "version": "1.0.219",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {