wormclaude 1.0.195 → 1.0.197

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/commands.js CHANGED
@@ -48,6 +48,8 @@ export const COMMANDS = [
48
48
  { name: '/kill', desc: 'bir arka plan görevini durdur: /kill <id>' },
49
49
  { name: '/dream', desc: 'arka planda hafızayı konsolide et (.wormclaude/memory.md)' },
50
50
  { name: '/learn', desc: 'web-öğrenme datasını göster / aç-kapa (eğitim için)' },
51
+ { name: '/iyi', desc: '👍 son cevabı beğen → fine-tune kalite verisi (iyi örnek)' },
52
+ { name: '/kötü', desc: '👎 son cevabı kötü işaretle → fine-tune\'dan elenir' },
51
53
  { name: '/copy', desc: 'son yaniti panoya kopyala (/copy all = tum sohbet)' },
52
54
  { name: '/izinler', desc: 'onayli shell komutlarini yonet (list/add/remove/clear)' },
53
55
  { name: '/program', desc: 'Doğrulanmış Araştırmacı Programı — güven seviyeni göster' },
package/dist/learn.js CHANGED
@@ -45,3 +45,23 @@ export function recordLearned(instruction, response, sources = [], config) {
45
45
  }
46
46
  return true;
47
47
  }
48
+ // Beğeni sinyali (👍/👎): kullanıcı son cevabı işaretler → merkezi feedback.jsonl (fine-tune kalite filtresi).
49
+ export async function recordFeedback(instruction, response, rating, config) {
50
+ const instr = (instruction || '').trim();
51
+ const resp = (response || '').trim();
52
+ if (instr.length < 3 || resp.length < 20)
53
+ return false;
54
+ try {
55
+ const r = await fetch(`${config.baseUrl}/feedback`, {
56
+ method: 'POST',
57
+ headers: { 'Content-Type': 'application/json', ...(config.apiKey ? { Authorization: `Bearer ${config.apiKey}` } : {}) },
58
+ body: JSON.stringify({ instruction: instr, response: resp, rating, kat: 'chat' }),
59
+ signal: AbortSignal.timeout(8000),
60
+ });
61
+ const j = await r.json().catch(() => ({}));
62
+ return !!j?.ok;
63
+ }
64
+ catch {
65
+ return false;
66
+ }
67
+ }
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.195';
19
+ export const VERSION = '1.0.197';
package/dist/tui.js CHANGED
@@ -22,7 +22,7 @@ import { getExtCommand, getExtCommands, buildExtCommandPrompt } from './extensio
22
22
  import { resolveAtMentions } from './atmention.js';
23
23
  import { loadMemoryContext, shouldExtract, triggerMemory } from './memory.js';
24
24
  import { shouldAutoCompact, runCompact, isContextError } from './compact.js';
25
- import { recordLearned } from './learn.js';
25
+ import { recordLearned, recordFeedback } from './learn.js';
26
26
  import { connectMcpServers } from './mcp.js';
27
27
  // Komut çıktılarını context'e eklerken KIS: curl/scan gürültüsü (handshake, tüm header'lar)
28
28
  // 32k pencereyi hızla doldurur → baş+son tut, ortayı at. Az token = uzun tarama. Read geniş kalır.
@@ -110,6 +110,7 @@ export async function runTui() {
110
110
  ...(_memCtx ? [{ role: 'system', content: _memCtx }] : []),
111
111
  ];
112
112
  const displayItems = [{ kind: 'banner' }];
113
+ let lastFbQ = '', lastFbA = ''; // son soru+cevap (👍/👎 beğeni sinyali için — /iyi /kötü)
113
114
  let inputBuf = '', inputCur = 0, busy = false, streamChars = 0, spin = 0;
114
115
  let turnAbort = null; // ESC ile çalışan turu durdurma
115
116
  let taskStart = 0; // görev başlangıç zamanı (spinner'da geçen süre için)
@@ -522,14 +523,24 @@ export async function runTui() {
522
523
  printItem({ kind: 'tool', label: toolLabel(c.name, res.args), result, ok: res.ok });
523
524
  },
524
525
  });
525
- for (let i = 0; i < toolCalls.length; i++)
526
- history.push({ role: 'tool', tool_call_id: toolCalls[i].id, content: capToolOut(toolCalls[i].name, results[i].output || '') });
527
526
  // Devre-kesici: olmayan araç/Unix sözdizimini (grep/openssl/hydra) tekrar deneyip
528
527
  // döngüye girmesin. Üst üste hepsi fail (2 tur) VEYA toplam 4 başarısız → dur+özetle.
529
528
  const _failed = results.filter((r) => !r.ok).length;
530
529
  totalFails += _failed;
531
530
  consecFail = (results.length > 0 && _failed === results.length) ? consecFail + 1 : 0;
532
- if (consecFail >= 2 || totalFails >= 4) {
531
+ const _willStop = consecFail >= 2 || totalFails >= 4;
532
+ // REFLECT-AFTER: bir araç başarısızsa (ve henüz sert-dur eşiğine gelmediysek) modele
533
+ // teşhis+adapte dayat — körlemesine tekrar/pes etmesin, benim gibi "neden + başka yol" düşünsün.
534
+ for (let i = 0; i < toolCalls.length; i++) {
535
+ let _content = capToolOut(toolCalls[i].name, results[i].output || '');
536
+ if (!results[i].ok && !_willStop) {
537
+ _content += getLang() === 'en'
538
+ ? '\n\n[REFLECT] This call failed. Before continuing, think briefly: (1) WHY did it fail? (2) Do NOT repeat the same call verbatim — fix the arguments or try a DIFFERENT approach/tool. (3) If it cannot be solved, tell the user plainly. Never give up silently or loop.'
539
+ : '\n\n[DÜŞÜN] Bu çağrı başarısız oldu. Devam etmeden kısaca düşün: (1) NEDEN başarısız oldu? (2) Aynı çağrıyı AYNEN tekrarlama — parametreyi düzelt ya da BAŞKA bir yol/araç dene. (3) Çözülemiyorsa kullanıcıya açıkça söyle. Asla sessizce pes etme, döngüye girme.';
540
+ }
541
+ history.push({ role: 'tool', tool_call_id: toolCalls[i].id, content: _content });
542
+ }
543
+ if (_willStop) {
533
544
  history.push({ role: 'user', content: getLang() === 'en'
534
545
  ? 'Several commands failed — required tools/syntax are not available here (e.g. grep/openssl/hydra on Windows). STOP running commands now and give a SHORT summary of what you found so far. Do NOT call more tools, do NOT use grep/sed/awk.'
535
546
  : 'Komutlar başarısız oldu — bu ortamda gerekli araç/sözdizim yok (Windows\'ta grep/openssl/hydra gibi). Komut çalıştırmayı ŞİMDİ BIRAK, şu ana kadarki bulguları KISA özetle. Başka araç çağırma, grep/sed/awk kullanma.' });
@@ -554,6 +565,11 @@ export async function runTui() {
554
565
  if (recordLearned(userText, lastAnswer, sources, config))
555
566
  printItem({ kind: 'note', text: t('tui.learned') });
556
567
  }
568
+ // Son Q&A'yı sakla — /iyi /kötü beğeni sinyali bunları gönderir (fine-tune kalite filtresi)
569
+ if (userText && lastAnswer) {
570
+ lastFbQ = userText;
571
+ lastFbA = lastAnswer;
572
+ }
557
573
  // Oto-hafıza: eşik geçildiyse arka planda hafızayı güncelle
558
574
  if (shouldExtract(history))
559
575
  triggerMemory(history, config);
@@ -836,6 +852,20 @@ export async function runTui() {
836
852
  quit();
837
853
  return;
838
854
  }
855
+ // /iyi · /kötü — son cevaba beğeni sinyali (👍/👎) → fine-tune kalite filtresi
856
+ if (tok === '/iyi' || tok === '/kötü' || tok === '/kotu' || tok === '/good' || tok === '/bad') {
857
+ const _up = (tok === '/iyi' || tok === '/good');
858
+ if (!lastFbQ || !lastFbA) {
859
+ printItem({ kind: 'note', text: getLang() === 'en' ? 'No recent answer to rate yet.' : 'Henüz işaretlenecek bir cevap yok.' });
860
+ return;
861
+ }
862
+ const _q = lastFbQ, _a = lastFbA;
863
+ lastFbQ = '';
864
+ lastFbA = ''; // çift-oyu önle
865
+ printItem({ kind: 'note', text: _up ? (getLang() === 'en' ? '👍 Thanks — saved as a good example (helps fine-tuning).' : '👍 Teşekkürler — iyi örnek olarak kaydedildi (fine-tune\'u besler).') : (getLang() === 'en' ? '👎 Noted — flagged as a poor answer.' : '👎 Not edildi — kötü cevap olarak işaretlendi.') });
866
+ recordFeedback(_q, _a, _up ? 1 : -1, config).catch(() => { });
867
+ return;
868
+ }
839
869
  // /pentest — OTONOM çoklu-yüzey pentest (web+network+OSINT+cloud); SecurityScan tool=auto
840
870
  if (tok === '/pentest') {
841
871
  const a = v.slice(tok.length).trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.195",
3
+ "version": "1.0.197",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {