wormclaude 1.0.8 → 1.0.10

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
@@ -2,6 +2,7 @@
2
2
  import React, { useState, useRef, useEffect } from 'react';
3
3
  import { render, Box, Text, useApp, useInput } from 'ink';
4
4
  import TextInput from 'ink-text-input';
5
+ import * as path from 'node:path';
5
6
  import { theme, VERSION } from './theme.js';
6
7
  import { loadConfig, streamChat } from './api.js';
7
8
  import { allToolSchemas, executeToolCalls, executeTool, toolLabel, setToolConfig } from './tools.js';
@@ -16,7 +17,7 @@ import { tasks } from './tasks.js';
16
17
  import { connectMcpServers } from './mcp.js';
17
18
  import * as usage from './usage.js';
18
19
  import { shouldAutoCompact, runCompact, isContextError } from './compact.js';
19
- import { shouldExtract, triggerMemory } from './memory.js';
20
+ import { shouldExtract, triggerMemory, loadMemoryContext } from './memory.js';
20
21
  // --- WORMCLAUDE SUBCOMMANDS (TUI oncesi) ---
21
22
  const _arg = (process.argv[2] || '').toLowerCase();
22
23
  if (_arg === 'login' || _arg === 'logout' || _arg === 'whoami' || _arg === '--version' || _arg === '-v' || _arg === 'update') {
@@ -60,6 +61,9 @@ setToolConfig(config); // Agent/alt-agent araçları aynı config'i kullanır
60
61
  const MAX_TURNS = Number(process.env.WORMCLAUDE_MAX_TURNS) || 50; // tur limiti
61
62
  setLang(loadLang() ?? 'tr'); // kayıtlı dili yükle (yoksa tr)
62
63
  loadSkills(); // .wormclaude/skills/*.md yükle
64
+ // Kalıcı hafıza: açılışta .wormclaude/memory.md + WORMCLAUDE.md'yi context'e yükle
65
+ const _memCtx = loadMemoryContext();
66
+ const _initHistory = () => (_memCtx ? [{ role: 'system', content: _memCtx }] : []);
63
67
  // FULLSCREEN (alternate screen) — WormClaude'un yöntemi: tüm ekranı ink yönetir,
64
68
  // scrollback YOK, resize'da HER ŞEY yeniden çizilir → sarmalanma/kaskad olmaz.
65
69
  // ?1049h alt-screen · ?1007h alternate-scroll (fare tekerleği → ok tuşu; seçim bozulmaz)
@@ -250,6 +254,7 @@ function StatusLine({ model, ctxTokens }) {
250
254
  const filled = Math.round(pct / 10);
251
255
  const bar = '█'.repeat(filled) + '░'.repeat(10 - filled);
252
256
  const barColor = pct > 85 ? theme.errorRed : pct > 60 ? theme.redBright : theme.grey;
257
+ const cwd = path.basename(process.cwd()) || process.cwd();
253
258
  return (React.createElement(Box, null,
254
259
  React.createElement(Text, { color: theme.greyDim },
255
260
  ' ',
@@ -261,6 +266,8 @@ function StatusLine({ model, ctxTokens }) {
261
266
  " \u00B7 ",
262
267
  model,
263
268
  " \u00B7 "),
269
+ React.createElement(Text, { color: theme.grey }, cwd),
270
+ React.createElement(Text, { color: theme.greyDim }, " \u00B7 "),
264
271
  React.createElement(Text, { color: barColor }, bar),
265
272
  React.createElement(Text, { color: theme.greyDim },
266
273
  " ",
@@ -297,7 +304,7 @@ function App() {
297
304
  const allowedToolsRef = useRef(new Set()); // oturum boyu izinli araçlar
298
305
  const [ask, setAsk] = useState(null);
299
306
  const [askSel, setAskSel] = useState(0); // AskUserQuestion seçimi
300
- const historyRef = useRef([]);
307
+ const historyRef = useRef(_initHistory());
301
308
  // Acilis: klasore guven sorusu (WormClaude tarzi) — yon tuslari/1-2 sec, Enter onay
302
309
  // Dil seçimi (ilk açılış)
303
310
  useInput((inp, key) => {
@@ -710,7 +717,7 @@ function App() {
710
717
  setHistory: (h) => { historyRef.current = h; setCtxTokens(Math.round(JSON.stringify(h).length / 4)); },
711
718
  note: (text) => push({ kind: 'note', text }),
712
719
  assistant: (text) => push({ kind: 'assistant', text }),
713
- clearConv: () => { setItems([{ kind: 'banner' }]); historyRef.current = []; },
720
+ clearConv: () => { setItems([{ kind: 'banner' }]); historyRef.current = _initHistory(); },
714
721
  exit,
715
722
  };
716
723
  setBusy(true);
package/dist/memory.js CHANGED
@@ -133,3 +133,22 @@ export function dreamTimeGatePassed() {
133
133
  }
134
134
  }
135
135
  export function getMemoryPath() { return MEM_FILE; }
136
+ // Kalıcı hafızayı başlangıçta context'e yüklemek için oku.
137
+ // .wormclaude/memory.md (oturumlar arası hafıza) + WORMCLAUDE.md (proje notu).
138
+ export function loadMemoryContext() {
139
+ const parts = [];
140
+ try {
141
+ const proj = path.join(process.cwd(), 'WORMCLAUDE.md');
142
+ const c = fs.readFileSync(proj, 'utf8').trim();
143
+ if (c)
144
+ parts.push('# Proje notu (WORMCLAUDE.md)\n' + c.slice(0, 6000));
145
+ }
146
+ catch { }
147
+ try {
148
+ const c = fs.readFileSync(MEM_FILE, 'utf8').trim();
149
+ if (c)
150
+ parts.push('# Hatırlanan bilgiler — önceki oturumlardan\n' + c.slice(0, 6000));
151
+ }
152
+ catch { }
153
+ return parts.join('\n\n');
154
+ }
package/dist/skills.js CHANGED
@@ -11,9 +11,12 @@ import { execSync } from 'node:child_process';
11
11
  import * as fs from 'node:fs';
12
12
  import * as os from 'node:os';
13
13
  import * as path from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
14
15
  import { getLang } from './i18n.js';
15
16
  let SKILLS = [];
16
17
  const SKILLS_DIR = path.join(process.cwd(), '.wormclaude', 'skills');
18
+ // Pakete gomulu skill'ler (npm paketiyle gelir): <pkg>/skills (dist'in bir ust dizini)
19
+ const BUNDLED_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'skills');
17
20
  export function getSkillsDir() { return SKILLS_DIR; }
18
21
  function parseFrontmatter(raw) {
19
22
  if (!raw.startsWith('---'))
@@ -40,15 +43,28 @@ function readFirst(dir, names) {
40
43
  }
41
44
  export function loadSkills() {
42
45
  SKILLS = [];
46
+ // Once gomulu (paket) skill'ler, sonra proje (.wormclaude/skills) — proje ayni adi override eder.
47
+ scanSkillDir(BUNDLED_DIR);
48
+ scanSkillDir(SKILLS_DIR);
49
+ return SKILLS;
50
+ }
51
+ function pushSkill(sk) {
52
+ const i = SKILLS.findIndex((x) => x.name === sk.name);
53
+ if (i >= 0)
54
+ SKILLS[i] = sk;
55
+ else
56
+ SKILLS.push(sk);
57
+ }
58
+ function scanSkillDir(dir) {
43
59
  let entries = [];
44
60
  try {
45
- entries = fs.readdirSync(SKILLS_DIR, { withFileTypes: true });
61
+ entries = fs.readdirSync(dir, { withFileTypes: true });
46
62
  }
47
63
  catch {
48
- return SKILLS;
64
+ return;
49
65
  }
50
66
  for (const e of entries) {
51
- const full = path.join(SKILLS_DIR, e.name);
67
+ const full = path.join(dir, e.name);
52
68
  if (e.isDirectory()) {
53
69
  // Klasör skill'i: skill.json + prompt.md
54
70
  let manifest = {};
@@ -60,7 +76,7 @@ export function loadSkills() {
60
76
  if (!body && !manifest.name)
61
77
  continue; // skill değil
62
78
  const name = (manifest.name || e.name).trim().replace(/[^a-zA-Z0-9_-]/g, '-');
63
- SKILLS.push({
79
+ pushSkill({
64
80
  name,
65
81
  description: manifest.description || body.split('\n').find((l) => l.trim())?.slice(0, 80) || name,
66
82
  whenToUse: manifest.whenToUse,
@@ -84,7 +100,7 @@ export function loadSkills() {
84
100
  const name = (fm.name || e.name.replace(/\.md$/, '')).trim().replace(/[^a-zA-Z0-9_-]/g, '-');
85
101
  if (!name)
86
102
  continue;
87
- SKILLS.push({
103
+ pushSkill({
88
104
  name,
89
105
  description: fm.description || body.split('\n').find((l) => l.trim())?.slice(0, 80) || name,
90
106
  whenToUse: fm.whenToUse,
@@ -95,7 +111,6 @@ export function loadSkills() {
95
111
  });
96
112
  }
97
113
  }
98
- return SKILLS;
99
114
  }
100
115
  export function getSkills() { return SKILLS; }
101
116
  export function getSkill(name) { return SKILLS.find((s) => s.name === name); }
package/dist/theme.js CHANGED
@@ -8,4 +8,4 @@ export const theme = {
8
8
  green: '#4ade80',
9
9
  errorRed: '#ff6b6b',
10
10
  };
11
- export const VERSION = '1.0.8';
11
+ export const VERSION = '1.0.10';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "scripts": {
10
10
  "dev": "tsx src/cli.tsx",
11
- "build": "tsc",
11
+ "build": "tsc && node scripts/copy-skills.mjs",
12
12
  "start": "node dist/cli.js",
13
13
  "prepublishOnly": "npm run build"
14
14
  },
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "files": [
29
29
  "dist",
30
+ "skills",
30
31
  "README.md"
31
32
  ],
32
33
  "engines": {
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: explain
3
+ description: kodu satir satir acikla
4
+ context: inline
5
+ ---
6
+ Verilen kodu net ve adim adim acikla.
7
+
8
+ - Once bir cumleyle kodun GENEL amacini soyle (ne ise yariyor).
9
+ - Sonra mantiksal bloklari sirayla ele al; her bloğun ne yaptigini ve NEDEN orada oldugunu acikla.
10
+ - Onemli satirlarda: degisken/fonksiyonun rolu, akis (donguler, kosullar), girdi/cikti.
11
+ - Dilin/cerceve'nin onemli kavramlarini (kapanis, async, pointer, decorator vb.) kisa kenar notuyla acikla.
12
+ - Varsa gizli tuzaklari, kenar durumlari, performans veya guvenlik etkilerini belirt.
13
+ - Gereksiz teori anlatma; kodun gercekten yaptigina bagli kal. Seviyeyi kullanicinin sorusuna gore ayarla (yeni baslayan ise daha sade).
14
+ - Sonunda 1-2 satirla ozetle: "kisaca bu kod ...".
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: recon
3
+ description: hedefte pasif kesif yap
4
+ context: fork
5
+ ---
6
+ Verilen hedef uzerinde SADECE pasif kesif (OSINT) yap — hedefe dogrudan saldirgan trafik gonderme. Yetkili bir degerlendirme baglaminda calistigini varsay.
7
+
8
+ Toplanacaklar:
9
+ - **Alan adi / DNS**: whois (sahip, kayit tarihi, ad sunuculari), A/AAAA/MX/TXT/NS kayitlari, SPF/DMARC.
10
+ - **Subdomain'ler**: pasif kaynaklardan (sertifika seffafligi/crt.sh, public DNS veri setleri). Brute-force YAPMA.
11
+ - **IP / ASN**: hangi blok, hosting/CDN saglayicisi, acik kaynaklardaki gecmis kayitlar.
12
+ - **Teknoloji izleri**: pasif parmak izi (HTTP basliklari acik kaynaklarda, builtwith tarzi veriler, public JS).
13
+ - **Maruz kalan varliklar**: public kod depolari, sizan kimlik bilgileri, pastebin/leak, dizinler, eski/arsiv sayfalar (wayback).
14
+ - **Insan/organizasyon**: public calisan/e-posta formatlari (yalnizca acik kaynaklardan, sosyal muhendislik icin degil).
15
+
16
+ Cikti: bulgulari kategorize edilmis, kaynagiyla birlikte ozetle. Saldiri yuzeyi acisindan one cikan noktalari ve bir sonraki (yetkili, aktif) adimda nereye bakilmasi gerektigini belirt. Pasif sinirin disina cikma.
@@ -0,0 +1,18 @@
1
+ Bir kod tabaninda guvenlik denetimi (audit) yap. Yetkili bir inceleme baglamindasin; amac zafiyetleri bulup somut duzeltme onermek.
2
+
3
+ Yontem:
4
+ 1. **Kapsami cikar**: Glob/Read ile dilleri, cerceveleri, giris noktalarini (HTTP route'lari, CLI, job'lar), dis baglantilari (DB, dosya, ag, shell, deserialization) belirle.
5
+ 2. **Guven sinirlarini izle**: kullanici/dis girdinin nereye aktigini Grep ile ara — SQL, HTML/render, OS komutu, dosya yolu, redirect, template, eval.
6
+ 3. **Sinif sinif tara** ve her bulguyu kanitla (dosya:satir):
7
+ - Injection: SQLi, komut enjeksiyonu, SSTI, LDAP/NoSQL.
8
+ - XSS / cikti kodlama eksikligi, tehlikeli `innerHTML`/`render`.
9
+ - Erisim kontrolu: IDOR, eksik authz, guvenlik-belirsizlikle (security by obscurity).
10
+ - Auth/oturum: zayif token, JWT dogrulama hatasi, parola saklama (duz/ MD5).
11
+ - Sirlar: kodda gomulu API key/parola/.env sizintisi.
12
+ - Path traversal / guvensiz dosya islemleri / guvensiz deserialization.
13
+ - SSRF, acik redirect, CORS yanlis yapilandirmasi.
14
+ - Bagimlilik: bilinen zafiyetli/eski paketler.
15
+ 4. **Onceliklendir**: her bulgu icin Kritik/Yuksek/Orta/Dusuk + gercek etki (saldirgan ne kazanir).
16
+ 5. **Duzeltme ver**: her bulgu icin somut, guvenli kod ornegi.
17
+
18
+ Cikti: kisa ozet + bulgu listesi (konum, sinif, siddet, etki, duzeltme). Tahminde bulunma; iddiani kodla destekle. Yikici komut calistirma — sadece oku/ara/analiz et.
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "security-audit",
3
+ "description": "Pentest ve kod guvenlik analizi",
4
+ "autoInvoke": true,
5
+ "context": "fork",
6
+ "tools": ["Read", "Grep", "Bash"],
7
+ "whenToUse": "kod guvenligi, zafiyet taramasi veya pentest istendiginde"
8
+ }