wormclaude 1.0.149 → 1.0.151
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/ansi.js +41 -2
- package/dist/auth.js +33 -0
- package/dist/cli.js +8 -2
- package/dist/theme.js +1 -1
- package/dist/tui.js +1 -0
- package/package.json +50 -50
package/dist/ansi.js
CHANGED
|
@@ -89,6 +89,41 @@ export function bannerAnsi(cols) {
|
|
|
89
89
|
const line = paint(leftPlain, theme.greyDim) + gap + star + paint(' By ' + sign + ' ', theme.greyDim) + star;
|
|
90
90
|
return body + '\n' + line;
|
|
91
91
|
}
|
|
92
|
+
// Kod satırını karakter-bazlı sert sarar (uzun satır terminale taşıp kenarlığı bozmasın).
|
|
93
|
+
function hardChunks(s, width) {
|
|
94
|
+
if (width < 4)
|
|
95
|
+
width = 4;
|
|
96
|
+
if (s.length <= width)
|
|
97
|
+
return [s];
|
|
98
|
+
const out = [];
|
|
99
|
+
for (let i = 0; i < s.length; i += width)
|
|
100
|
+
out.push(s.slice(i, i + width));
|
|
101
|
+
return out;
|
|
102
|
+
}
|
|
103
|
+
// Sözdizimi-vurgulu kod satırını (token'lar) genişliğe göre sarar — renkleri koruyarak.
|
|
104
|
+
function wrapTokens(toks, width) {
|
|
105
|
+
if (width < 4)
|
|
106
|
+
width = 4;
|
|
107
|
+
const lines = [];
|
|
108
|
+
let line = '', col = 0;
|
|
109
|
+
for (const tk of toks) {
|
|
110
|
+
let s = tk.text;
|
|
111
|
+
while (s.length > 0) {
|
|
112
|
+
const take = s.slice(0, Math.max(1, width - col));
|
|
113
|
+
line += paint(take, tk.color);
|
|
114
|
+
col += take.length;
|
|
115
|
+
s = s.slice(take.length);
|
|
116
|
+
if (col >= width) {
|
|
117
|
+
lines.push(line);
|
|
118
|
+
line = '';
|
|
119
|
+
col = 0;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (line || lines.length === 0)
|
|
124
|
+
lines.push(line);
|
|
125
|
+
return lines;
|
|
126
|
+
}
|
|
92
127
|
// ── Markdown bloğu → ANSI (kod blokları sözdizimi-vurgulu) ──
|
|
93
128
|
export function markdownAnsi(text, cols) {
|
|
94
129
|
const W = Math.max(20, cols - 2);
|
|
@@ -97,17 +132,21 @@ export function markdownAnsi(text, cols) {
|
|
|
97
132
|
let inCode = false, fence = '', lang = '', code = [];
|
|
98
133
|
const fenceRe = /^ *(`{3,}|~{3,}) *(\w*)? *$/;
|
|
99
134
|
const flushCode = () => {
|
|
135
|
+
const codeW = Math.max(8, W - 2); // '│ ' kenarlığı 2 sütun → kod genişliği = W-2
|
|
100
136
|
if (lang)
|
|
101
137
|
out.push(paint(' ' + lang, theme.greyDim));
|
|
102
138
|
if (isHighlightable(lang)) {
|
|
103
139
|
for (const toks of highlight(code.join('\n'), lang)) {
|
|
104
|
-
|
|
140
|
+
const segs = toks.length ? wrapTokens(toks, codeW) : [' '];
|
|
141
|
+
for (const sl of segs)
|
|
142
|
+
out.push(paint('│ ', theme.greyDim) + (sl || ' '));
|
|
105
143
|
}
|
|
106
144
|
}
|
|
107
145
|
else {
|
|
108
146
|
// Dilsiz/düz-metin blok: çubuk + nötr renk, sözdizimi-vurgusu YOK (saçma renk olmaz).
|
|
109
147
|
for (const ln of code)
|
|
110
|
-
|
|
148
|
+
for (const sl of hardChunks(ln || ' ', codeW))
|
|
149
|
+
out.push(paint('│ ', theme.greyDim) + paint(sl || ' ', theme.grey));
|
|
111
150
|
}
|
|
112
151
|
code = [];
|
|
113
152
|
lang = '';
|
package/dist/auth.js
CHANGED
|
@@ -31,6 +31,30 @@ export function clearStored() {
|
|
|
31
31
|
}
|
|
32
32
|
catch { }
|
|
33
33
|
}
|
|
34
|
+
// Anahtarı doğrudan yapıştırarak giriş: web Ayarlar → API'den kopyalanan anahtarı kaydet.
|
|
35
|
+
// Anahtar gateway'de doğrulanır (geçersizse kaydetmez). [[api-key-unification]] Faz 3.
|
|
36
|
+
export async function loginWithKey(rawKey) {
|
|
37
|
+
const key = (rawKey || '').trim();
|
|
38
|
+
if (!key) {
|
|
39
|
+
process.stdout.write('\n Anahtar boş. Kullanım: wormclaude login --key <ANAHTAR>\n\n');
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
const base = process.env.WORMCLAUDE_BASE_URL || DEFAULT_BASE_URL;
|
|
43
|
+
process.stdout.write(' Anahtar doğrulanıyor...');
|
|
44
|
+
try {
|
|
45
|
+
const r = await fetch(`${base}/account`, { headers: { Authorization: `Bearer ${key}` } });
|
|
46
|
+
if (!r.ok) {
|
|
47
|
+
process.stdout.write('\n\n \x1b[31m✗ Anahtar geçersiz\x1b[0m (HTTP ' + r.status + '). Web Ayarlar → API\'den doğru anahtarı kopyala.\n\n');
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
process.stdout.write('\n\n Sunucuya ulaşılamadı: ' + (e?.message || e) + '\n\n');
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
saveStored({ baseUrl: base, apiKey: key, model: 'wormclaude-v2' });
|
|
56
|
+
process.stdout.write('\n\n \x1b[32m✓ Giriş başarılı!\x1b[0m Artık `wormclaude` yazarak kullanabilirsiniz.\n\n');
|
|
57
|
+
}
|
|
34
58
|
// baseUrl ".../v1" → device endpoint'leri için kök (".../v1" olmadan)
|
|
35
59
|
function apiOrigin(baseUrl) {
|
|
36
60
|
return baseUrl.replace(/\/v1\/?$/, '');
|
|
@@ -216,6 +240,15 @@ export async function deviceLogin() {
|
|
|
216
240
|
continue; // geçici ağ hatası — tekrar dene
|
|
217
241
|
}
|
|
218
242
|
if (d.status === 'approved') {
|
|
243
|
+
// Tek kalıcı anahtar: yeni oluşturulduysa raw gelir. Zaten varsa (existing) raw
|
|
244
|
+
// verilemez (hash'li saklanır) → kullanıcı Ayarlar'dan anahtarını yapıştırmalı.
|
|
245
|
+
if (d.existing && !d.api_key) {
|
|
246
|
+
process.stdout.write('\n\n \x1b[33mHesabında zaten bir API anahtarı var.\x1b[0m (' + (d.prefix || 'wc_live_…') + '…)\n' +
|
|
247
|
+
' Güvenlik gereği mevcut anahtar tekrar gösterilemez. Şunlardan birini yap:\n' +
|
|
248
|
+
' 1) Anahtarını web Ayarlar → API\'den kopyala, sonra: \x1b[36mwormclaude login --key <ANAHTAR>\x1b[0m\n' +
|
|
249
|
+
' 2) Web Ayarlar → API\'de \x1b[36mSıfırla\x1b[0m de (yeni anahtar üretir; eski geçersiz olur), sonra tekrar gir.\n\n');
|
|
250
|
+
process.exit(1);
|
|
251
|
+
}
|
|
219
252
|
saveStored({
|
|
220
253
|
baseUrl: d.base_url || base,
|
|
221
254
|
apiKey: d.api_key,
|
package/dist/cli.js
CHANGED
|
@@ -74,8 +74,14 @@ if (_arg === '-p' || _arg === '--print') {
|
|
|
74
74
|
}
|
|
75
75
|
if (_arg === 'login' || _arg === 'logout' || _arg === 'whoami' || _arg === '--version' || _arg === '-v' || _arg === 'update') {
|
|
76
76
|
const auth = await import('./auth.js');
|
|
77
|
-
if (_arg === 'login')
|
|
78
|
-
|
|
77
|
+
if (_arg === 'login') {
|
|
78
|
+
// wormclaude login --key <ANAHTAR> → anahtarı doğrudan yapıştır (web Ayarlar'dan kopyalanan).
|
|
79
|
+
const _ki = process.argv.indexOf('--key');
|
|
80
|
+
if (_ki > 0 && process.argv[_ki + 1])
|
|
81
|
+
await auth.loginWithKey(process.argv[_ki + 1]);
|
|
82
|
+
else
|
|
83
|
+
await auth.deviceLogin();
|
|
84
|
+
}
|
|
79
85
|
else if (_arg === 'logout') {
|
|
80
86
|
auth.clearStored();
|
|
81
87
|
console.log('Cikis yapildi.');
|
package/dist/theme.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -246,6 +246,7 @@ export async function runTui() {
|
|
|
246
246
|
}
|
|
247
247
|
// ── Footer'ı rezerve alanın DİBİNE çiz; rezerve alanın geri kalanını boşalt (eski menü kalmaz). ──
|
|
248
248
|
function drawFooter() {
|
|
249
|
+
setRegion(); // scroll-region'ı her çizimde yeniden ata — bazı terminaller (conhost) sıfırlıyor → footer kayıyordu
|
|
249
250
|
const W = Math.max(8, cols());
|
|
250
251
|
const R = rows(), FM = FOOTER_MAX();
|
|
251
252
|
const line = paint('─'.repeat(W), theme.red);
|
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "wormclaude",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"wormclaude": "dist/cli.js"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"dev": "tsx src/cli.tsx",
|
|
11
|
-
"build": "node scripts/sync-version.mjs && tsc && node scripts/copy-skills.mjs && node scripts/copy-extensions.mjs",
|
|
12
|
-
"start": "node dist/cli.js",
|
|
13
|
-
"prepublishOnly": "npm run build"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
17
|
-
"@types/diff": "^7.0.2",
|
|
18
|
-
"diff": "^9.0.0",
|
|
19
|
-
"ink": "^5.0.1",
|
|
20
|
-
"ink-spinner": "^5.0.0",
|
|
21
|
-
"ink-text-input": "^6.0.0",
|
|
22
|
-
"log-update": "^5.0.1",
|
|
23
|
-
"react": "^18.3.1",
|
|
24
|
-
"string-width": "^7.2.0"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@types/node": "^22.10.2",
|
|
28
|
-
"@types/react": "^18.3.18",
|
|
29
|
-
"tsx": "^4.19.2",
|
|
30
|
-
"typescript": "^5.7.2"
|
|
31
|
-
},
|
|
32
|
-
"files": [
|
|
33
|
-
"dist",
|
|
34
|
-
"skills",
|
|
35
|
-
"extensions",
|
|
36
|
-
"README.md"
|
|
37
|
-
],
|
|
38
|
-
"engines": {
|
|
39
|
-
"node": ">=18"
|
|
40
|
-
},
|
|
41
|
-
"license": "UNLICENSED",
|
|
42
|
-
"keywords": [
|
|
43
|
-
"wormclaude",
|
|
44
|
-
"cli",
|
|
45
|
-
"ai",
|
|
46
|
-
"assistant",
|
|
47
|
-
"agent",
|
|
48
|
-
"terminal"
|
|
49
|
-
]
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "wormclaude",
|
|
3
|
+
"version": "1.0.151",
|
|
4
|
+
"description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"wormclaude": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "tsx src/cli.tsx",
|
|
11
|
+
"build": "node scripts/sync-version.mjs && tsc && node scripts/copy-skills.mjs && node scripts/copy-extensions.mjs",
|
|
12
|
+
"start": "node dist/cli.js",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
17
|
+
"@types/diff": "^7.0.2",
|
|
18
|
+
"diff": "^9.0.0",
|
|
19
|
+
"ink": "^5.0.1",
|
|
20
|
+
"ink-spinner": "^5.0.0",
|
|
21
|
+
"ink-text-input": "^6.0.0",
|
|
22
|
+
"log-update": "^5.0.1",
|
|
23
|
+
"react": "^18.3.1",
|
|
24
|
+
"string-width": "^7.2.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.10.2",
|
|
28
|
+
"@types/react": "^18.3.18",
|
|
29
|
+
"tsx": "^4.19.2",
|
|
30
|
+
"typescript": "^5.7.2"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"skills",
|
|
35
|
+
"extensions",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=18"
|
|
40
|
+
},
|
|
41
|
+
"license": "UNLICENSED",
|
|
42
|
+
"keywords": [
|
|
43
|
+
"wormclaude",
|
|
44
|
+
"cli",
|
|
45
|
+
"ai",
|
|
46
|
+
"assistant",
|
|
47
|
+
"agent",
|
|
48
|
+
"terminal"
|
|
49
|
+
]
|
|
50
|
+
}
|