wormclaude 1.0.16 → 1.0.17

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/api.js CHANGED
@@ -12,6 +12,26 @@ export function loadConfig() {
12
12
  model: process.env.WORMCLAUDE_MODEL || stored.model || 'wormclaude',
13
13
  };
14
14
  }
15
+ // Giriş yapan kullanıcının hesabı (plan + kalan token + güven seviyesi). Hata olursa null.
16
+ export async function fetchAccount(config) {
17
+ try {
18
+ const r = await fetch(`${config.baseUrl}/account`, {
19
+ headers: { ...(config.apiKey ? { Authorization: `Bearer ${config.apiKey}` } : {}) },
20
+ signal: AbortSignal.timeout(8000),
21
+ });
22
+ if (!r.ok)
23
+ return null;
24
+ const d = await r.json();
25
+ return {
26
+ plan: String(d.plan ?? 'free'),
27
+ tokenBalance: Number(d.token_balance ?? 0),
28
+ trustLevel: Number(d.trust_level ?? 0),
29
+ };
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
15
35
  // ── Retry/backoff (api/withRetry.ts'den uyarlandı) ────────────────────────────
16
36
  const MAX_RETRIES = Number(process.env.WORMCLAUDE_MAX_RETRIES) || 5;
17
37
  const BASE_DELAY_MS = 500;
package/dist/cli.js CHANGED
@@ -4,7 +4,8 @@ import { render, Box, Text, useApp, useInput } from 'ink';
4
4
  import TextInput from 'ink-text-input';
5
5
  import * as path from 'node:path';
6
6
  import { theme, VERSION } from './theme.js';
7
- import { loadConfig, streamChat } from './api.js';
7
+ import { loadConfig, streamChat, fetchAccount } from './api.js';
8
+ import { tier } from './program.js';
8
9
  import { allToolSchemas, executeToolCalls, executeTool, toolLabel, setToolConfig } from './tools.js';
9
10
  import { sanitizeError, sanitizeOutput } from './errorsan.js';
10
11
  import { cleanModelText } from './textclean.js';
@@ -267,13 +268,14 @@ function WormSpinner({ label, tokens }) {
267
268
  tokens,
268
269
  " tokens") : null));
269
270
  }
270
- function StatusLine({ model, ctxTokens }) {
271
+ function StatusLine({ model, ctxTokens, trust = 0 }) {
271
272
  const max = Number(process.env.WORMCLAUDE_CTX) || 12288;
272
273
  const pct = Math.min(100, Math.round((ctxTokens / max) * 100));
273
274
  const filled = Math.round(pct / 10);
274
275
  const bar = '█'.repeat(filled) + '░'.repeat(10 - filled);
275
276
  const barColor = pct > 85 ? theme.errorRed : pct > 60 ? theme.redBright : theme.grey;
276
277
  const cwd = path.basename(process.cwd()) || process.cwd();
278
+ const badge = tier(trust).badge;
277
279
  return (React.createElement(Box, null,
278
280
  React.createElement(Text, { color: theme.greyDim },
279
281
  ' ',
@@ -281,6 +283,9 @@ function StatusLine({ model, ctxTokens }) {
281
283
  React.createElement(Text, { color: theme.red, bold: true },
282
284
  "v",
283
285
  VERSION),
286
+ badge ? React.createElement(Text, { color: trust >= 3 ? theme.green : theme.redBright, bold: true },
287
+ " \u25C6 ",
288
+ badge) : null,
284
289
  React.createElement(Text, { color: theme.greyDim },
285
290
  " \u00B7 ",
286
291
  model,
@@ -315,6 +320,7 @@ function App() {
315
320
  const [tipId] = useState(() => pickTipId()); // oturum ipucu (dile göre çözülür)
316
321
  const [cmdSel, setCmdSel] = useState(0); // slash menüsü seçili satır
317
322
  const [scroll, setScroll] = useState(0); // alttan kaç öğe yukarı kaydırıldı (0 = en alt)
323
+ const [trustLevel, setTrustLevel] = useState(0); // Doğrulanmış Araştırmacı Programı seviyesi
318
324
  const [perm, setPerm] = useState(null);
319
325
  const [permSel, setPermSel] = useState(0); // 0=Evet 1=Evet(hep) 2=Hayır+yönlendir
320
326
  const [permMode, setPermMode] = useState('select');
@@ -460,6 +466,15 @@ function App() {
460
466
  });
461
467
  // Yeni mesaj gelince en alta dön
462
468
  useEffect(() => { setScroll(0); }, [items.length]);
469
+ // Başlangıçta güven seviyesini (Doğrulanmış Araştırmacı Programı) çek → StatusLine rozeti
470
+ useEffect(() => {
471
+ if (!started)
472
+ return;
473
+ let alive = true;
474
+ fetchAccount(config).then((a) => { if (alive && a)
475
+ setTrustLevel(a.trustLevel); }).catch(() => { });
476
+ return () => { alive = false; };
477
+ }, [started]);
463
478
  const push = (it) => setItems((prev) => [...prev, it]);
464
479
  // Arka plan görevlerini izle → footer pill
465
480
  useEffect(() => {
@@ -938,6 +953,6 @@ function App() {
938
953
  })() : (React.createElement(Text, { color: theme.greyDim },
939
954
  " \uD83D\uDCA1 ",
940
955
  tipText(tipId))),
941
- React.createElement(StatusLine, { model: config.model, ctxTokens: ctxTokens }))) : null));
956
+ React.createElement(StatusLine, { model: config.model, ctxTokens: ctxTokens, trust: trustLevel }))) : null));
942
957
  }
943
958
  render(React.createElement(App, null));
package/dist/commands.js CHANGED
@@ -13,6 +13,8 @@ import { loadSkills, getSkills, getSkillsDir, installSkill, updateSkill, removeS
13
13
  import { getApprovedCommands, approveCommands, unapproveCommands, clearApproved } from './cmdsec.js';
14
14
  import { isLearnEnabled, setLearnEnabled, getLearnFile, getLearnCount } from './learn.js';
15
15
  import { saveMemoryFact, getMemoryPath, loadMemoryContext } from './memory.js';
16
+ import { fetchAccount } from './api.js';
17
+ import { programText } from './program.js';
16
18
  export const COMMANDS = [
17
19
  { name: '/help', desc: 'komutları ve ipuçlarını göster' },
18
20
  { name: '/clear', desc: 'sohbeti ve geçmişi temizle' },
@@ -39,6 +41,7 @@ export const COMMANDS = [
39
41
  { name: '/learn', desc: 'web-öğrenme datasını göster / aç-kapa (eğitim için)' },
40
42
  { name: '/copy', desc: 'son yaniti panoya kopyala (/copy all = tum sohbet)' },
41
43
  { name: '/izinler', desc: 'onayli shell komutlarini yonet (list/add/remove/clear)' },
44
+ { name: '/program', desc: 'Doğrulanmış Araştırmacı Programı — güven seviyeni göster' },
42
45
  { name: '/export', desc: 'sohbeti dosyaya kaydet' },
43
46
  { name: '/resume', desc: 'en son kaydedilen oturumu yükle' },
44
47
  { name: '/quit', desc: 'çıkış' },
@@ -599,6 +602,11 @@ export async function runSlashCommand(input, ctx) {
599
602
  }
600
603
  return true;
601
604
  }
605
+ case '/program': {
606
+ const acc = await fetchAccount(ctx.config);
607
+ ctx.note(programText(acc ? acc.trustLevel : 0));
608
+ return true;
609
+ }
602
610
  case '/export': {
603
611
  fs.mkdirSync(SESSION_DIR, { recursive: true });
604
612
  const file = path.join(SESSION_DIR, `session-${tsStamp()}.json`);
@@ -0,0 +1,36 @@
1
+ // WormClaude Doğrulanmış Araştırmacı Programı — güven seviyesi (trust_level) meta verisi.
2
+ // Backend (gateway) min_trust'lı prompt modüllerini/araçları/bütçeyi bu seviyeye göre açar.
3
+ export const TIERS = [
4
+ { level: 0, name: 'Normal Kullanıcı', badge: '', desc: 'Temel erişim. Yetkili bağlamda güvenlik+kod yardımı.' },
5
+ { level: 1, name: 'Doğrulanmış Kullanıcı', badge: 'Doğrulanmış', desc: 'E-posta/kimlik doğrulandı. Artırılmış bütçe.' },
6
+ { level: 2, name: 'Araştırmacı', badge: 'Araştırmacı', desc: 'Güvenlik skill/extension erişimi.' },
7
+ { level: 3, name: 'Doğrulanmış Güvenlik Araştırmacısı', badge: 'Güvenlik Arş.', desc: 'Tam saldırgan güvenlik modülü + gelişmiş araçlar + yüksek bütçe.' },
8
+ { level: 4, name: 'Kurumsal Müşteri', badge: 'Kurumsal', desc: 'Çok-koltuk, denetim günlüğü, özel extension.' },
9
+ { level: 5, name: 'Dahili Ekip', badge: 'Dahili', desc: 'Sınırsız erişim.' },
10
+ ];
11
+ export function tier(level) {
12
+ return TIERS[Math.max(0, Math.min(5, level | 0))];
13
+ }
14
+ /** /program komutunun gösterdiği açıklama (mevcut seviye işaretli). */
15
+ export function programText(current) {
16
+ const lines = [];
17
+ lines.push('WormClaude Doğrulanmış Araştırmacı Programı');
18
+ lines.push('');
19
+ lines.push('Sansürsüz güvenlik yetenekleri anonim herkese değil, kimliği doğrulanmış');
20
+ lines.push('ve hesap verebilir araştırmacılara açılır. Seviyeler:');
21
+ lines.push('');
22
+ for (const t of TIERS) {
23
+ const mark = t.level === current ? '❯' : ' ';
24
+ lines.push(`${mark} Seviye ${t.level} — ${t.name}`);
25
+ lines.push(` ${t.desc}`);
26
+ }
27
+ lines.push('');
28
+ lines.push(`Şu anki seviyen: ${current} (${tier(current).name}).`);
29
+ if (current < 3) {
30
+ lines.push('');
31
+ lines.push('Yükselmek için: HackerOne/Bugcrowd profilin, şirket/kurum bilgin veya');
32
+ lines.push('kimlik doğrulaman ile başvur → admin incelemesi sonrası seviyen atanır.');
33
+ lines.push('Başvuru: sezaiyilmaz6060@gmail.com (veya panel üzerinden).');
34
+ }
35
+ return lines.join('\n');
36
+ }
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.16';
11
+ export const VERSION = '1.0.17';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {