wormclaude 1.0.76 → 1.0.77

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
@@ -71,8 +71,25 @@ if (!process.env.WORMCLAUDE_SKIP_UPDATE && !process.env.WORMCLAUDE_BASE_URL) {
71
71
  catch { /* güncelleme kontrolü best-effort — başarısızsa normal başla */ }
72
72
  }
73
73
  const config = loadConfig();
74
- if (!config.apiKey) {
74
+ // Giriş gerekli mi? Anahtar YOKSA veya VARSA ama gateway'de GEÇERSİZSE (401) → login.
75
+ let _needLogin = !config.apiKey;
76
+ if (config.apiKey && !process.env.WORMCLAUDE_BASE_URL) {
77
+ // Açılışta anahtarı doğrula: geçersiz/iptal edilmişse kullanıcıyı 401 duvarına çarptırma.
78
+ try {
79
+ const _base = config.baseUrl || 'https://api.wormclaude.ai/v1';
80
+ const _ac = new AbortController();
81
+ const _to = setTimeout(() => _ac.abort(), 8000);
82
+ const _r = await fetch(`${_base}/account`, { headers: { Authorization: `Bearer ${config.apiKey}` }, signal: _ac.signal });
83
+ clearTimeout(_to);
84
+ if (_r.status === 401 || _r.status === 403)
85
+ _needLogin = true;
86
+ }
87
+ catch { /* ağ hatası → çevrimdışı toleransı: mevcut anahtarla devam et */ }
88
+ }
89
+ if (_needLogin) {
75
90
  const _a = await import('./auth.js');
91
+ if (config.apiKey)
92
+ _a.clearStored(); // eski/geçersiz anahtarı temizle
76
93
  const _choice = await _a.promptLoginMenu();
77
94
  if (_choice !== 'login')
78
95
  process.exit(0);
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.76';
19
+ export const VERSION = '1.0.77';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {