wormclaude 1.0.17 → 1.0.18
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 +34 -0
- package/dist/commands.js +36 -2
- package/dist/theme.js +1 -1
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -12,6 +12,40 @@ export function loadConfig() {
|
|
|
12
12
|
model: process.env.WORMCLAUDE_MODEL || stored.model || 'wormclaude',
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
+
// Kullanıcının doğrulama başvuru durumu (GET /v1/verify).
|
|
16
|
+
export async function getVerifyStatus(config) {
|
|
17
|
+
try {
|
|
18
|
+
const r = await fetch(`${config.baseUrl}/verify`, {
|
|
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 { trustLevel: Number(d.trust_level ?? 0), request: d.request ?? null };
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Doğrulama başvurusu gönder (POST /v1/verify). Döner: {ok, status?} veya {error}.
|
|
32
|
+
export async function submitVerification(config, payload, requestedLevel = 3) {
|
|
33
|
+
try {
|
|
34
|
+
const r = await fetch(`${config.baseUrl}/verify`, {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
headers: { 'Content-Type': 'application/json', ...(config.apiKey ? { Authorization: `Bearer ${config.apiKey}` } : {}) },
|
|
37
|
+
body: JSON.stringify({ payload, requested_level: requestedLevel }),
|
|
38
|
+
signal: AbortSignal.timeout(10000),
|
|
39
|
+
});
|
|
40
|
+
const d = await r.json().catch(() => ({}));
|
|
41
|
+
if (!r.ok)
|
|
42
|
+
return { ok: false, error: d.detail || `HTTP ${r.status}` };
|
|
43
|
+
return { ok: true, status: d.status };
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
return { ok: false, error: e?.message || String(e) };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
15
49
|
// Giriş yapan kullanıcının hesabı (plan + kalan token + güven seviyesi). Hata olursa null.
|
|
16
50
|
export async function fetchAccount(config) {
|
|
17
51
|
try {
|
package/dist/commands.js
CHANGED
|
@@ -13,8 +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
|
+
import { fetchAccount, getVerifyStatus, submitVerification } from './api.js';
|
|
17
|
+
import { programText, tier } from './program.js';
|
|
18
18
|
export const COMMANDS = [
|
|
19
19
|
{ name: '/help', desc: 'komutları ve ipuçlarını göster' },
|
|
20
20
|
{ name: '/clear', desc: 'sohbeti ve geçmişi temizle' },
|
|
@@ -42,6 +42,7 @@ export const COMMANDS = [
|
|
|
42
42
|
{ name: '/copy', desc: 'son yaniti panoya kopyala (/copy all = tum sohbet)' },
|
|
43
43
|
{ name: '/izinler', desc: 'onayli shell komutlarini yonet (list/add/remove/clear)' },
|
|
44
44
|
{ name: '/program', desc: 'Doğrulanmış Araştırmacı Programı — güven seviyeni göster' },
|
|
45
|
+
{ name: '/dogrula', desc: 'Doğrulanmış Araştırmacı başvurusu gönder: /dogrula <profil/şirket/gerekçe>' },
|
|
45
46
|
{ name: '/export', desc: 'sohbeti dosyaya kaydet' },
|
|
46
47
|
{ name: '/resume', desc: 'en son kaydedilen oturumu yükle' },
|
|
47
48
|
{ name: '/quit', desc: 'çıkış' },
|
|
@@ -607,6 +608,39 @@ export async function runSlashCommand(input, ctx) {
|
|
|
607
608
|
ctx.note(programText(acc ? acc.trustLevel : 0));
|
|
608
609
|
return true;
|
|
609
610
|
}
|
|
611
|
+
case '/dogrula': {
|
|
612
|
+
const justification = (arg || '').trim();
|
|
613
|
+
// Argsız → mevcut durum + talimat
|
|
614
|
+
if (!justification) {
|
|
615
|
+
const st = await getVerifyStatus(ctx.config);
|
|
616
|
+
const lvl = st ? st.trustLevel : 0;
|
|
617
|
+
const lines = [];
|
|
618
|
+
lines.push(`Mevcut seviyen: ${lvl} (${tier(lvl).name}).`);
|
|
619
|
+
if (st?.request) {
|
|
620
|
+
const r = st.request;
|
|
621
|
+
const dur = r.status === 'pending' ? 'inceleniyor' : r.status === 'approved' ? 'ONAYLANDI' : 'reddedildi';
|
|
622
|
+
lines.push(`Son başvurun: seviye ${r.requested_level} talebi — ${dur}.` + (r.note ? `\nAdmin notu: ${r.note}` : ''));
|
|
623
|
+
}
|
|
624
|
+
if (lvl < 3) {
|
|
625
|
+
lines.push('');
|
|
626
|
+
lines.push('Doğrulanmış Güvenlik Araştırmacısı (seviye 3) başvurusu için:');
|
|
627
|
+
lines.push(' /dogrula HackerOne/Bugcrowd profilin · şirket/kurum · rolün · yetki bağlamın');
|
|
628
|
+
lines.push('Örnek: /dogrula h1.com/kullaniciadi, AcmeSec pentester, yetkili angajmanlar');
|
|
629
|
+
}
|
|
630
|
+
ctx.note(lines.join('\n'));
|
|
631
|
+
return true;
|
|
632
|
+
}
|
|
633
|
+
if (justification.length < 10) {
|
|
634
|
+
ctx.note('Gerekçe çok kısa. Profil/şirket/yetki bilgini ekle.');
|
|
635
|
+
return true;
|
|
636
|
+
}
|
|
637
|
+
ctx.note('Başvuru gönderiliyor…');
|
|
638
|
+
const res = await submitVerification(ctx.config, justification, 3);
|
|
639
|
+
ctx.note(res.ok
|
|
640
|
+
? '✓ Başvurun alındı (seviye 3 talebi). Admin incelemesi sonrası seviyen güncellenecek. Durum: /dogrula'
|
|
641
|
+
: `Başvuru gönderilemedi: ${res.error}`);
|
|
642
|
+
return true;
|
|
643
|
+
}
|
|
610
644
|
case '/export': {
|
|
611
645
|
fs.mkdirSync(SESSION_DIR, { recursive: true });
|
|
612
646
|
const file = path.join(SESSION_DIR, `session-${tsStamp()}.json`);
|
package/dist/theme.js
CHANGED