wormclaude 1.0.35 → 1.0.37

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/auth.js CHANGED
@@ -98,8 +98,11 @@ export async function checkForUpdate(current) {
98
98
  export function runUpdate() {
99
99
  return new Promise((resolve) => {
100
100
  process.stdout.write('WormClaude güncelleniyor...\n');
101
- const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
102
- const child = spawn(npm, ['install', '-g', 'wormclaude@latest'], { stdio: 'inherit' });
101
+ // Windows + Node ≥20: `.cmd`/`.bat` spawn'ı shell:true gerektirir (yoksa EINVAL).
102
+ const win = process.platform === 'win32';
103
+ const cmd = win ? 'npm install -g wormclaude@latest' : 'npm';
104
+ const args = win ? [] : ['install', '-g', 'wormclaude@latest'];
105
+ const child = spawn(cmd, args, { stdio: 'inherit', shell: true });
103
106
  child.on('error', (e) => { process.stderr.write('Güncellenemedi: ' + (e?.message || e) + '\n'); resolve(); });
104
107
  child.on('exit', () => resolve());
105
108
  });
package/dist/cli.js CHANGED
@@ -47,6 +47,29 @@ if (_arg === 'login' || _arg === 'logout' || _arg === 'whoami' || _arg === '--ve
47
47
  console.log('wormclaude ' + VERSION);
48
48
  process.exit(0);
49
49
  }
50
+ // Açılışta güncelleme kontrolü — varsa HEMEN güncelle + yeni sürümle yeniden başlat.
51
+ // (WORMCLAUDE_SKIP_UPDATE re-exec'te set edilir → güncelleme başarısızsa sonsuz döngü olmaz.)
52
+ if (!process.env.WORMCLAUDE_SKIP_UPDATE && !process.env.WORMCLAUDE_BASE_URL) {
53
+ try {
54
+ const _au = await import('./auth.js');
55
+ const _latest = await _au.checkForUpdate(VERSION);
56
+ if (_latest) {
57
+ process.stdout.write(`\n ⟳ Güncelleme bulundu: v${VERSION} → v${_latest}. Güncelleniyor...\n`);
58
+ await _au.runUpdate();
59
+ const { spawn } = await import('node:child_process');
60
+ const _cmd = process.platform === 'win32' ? 'wormclaude.cmd' : 'wormclaude';
61
+ process.stdout.write(' ✓ Güncellendi, yeniden başlatılıyor...\n\n');
62
+ const _child = spawn(_cmd, process.argv.slice(2), {
63
+ stdio: 'inherit', shell: true,
64
+ env: { ...process.env, WORMCLAUDE_SKIP_UPDATE: '1' },
65
+ });
66
+ _child.on('exit', (code) => process.exit(code ?? 0));
67
+ _child.on('error', () => { process.stdout.write(' Güncellendi. Lütfen "wormclaude" komutunu tekrar çalıştır.\n'); process.exit(0); });
68
+ await new Promise(() => { }); // çocuk süreci devralana kadar bekle (ana akışa düşme)
69
+ }
70
+ }
71
+ catch { /* güncelleme kontrolü best-effort — başarısızsa normal başla */ }
72
+ }
50
73
  const config = loadConfig();
51
74
  if (!config.apiKey) {
52
75
  const _a = await import('./auth.js');
@@ -61,10 +84,6 @@ if (!config.apiKey) {
61
84
  if (!config.apiKey)
62
85
  process.exit(0);
63
86
  }
64
- let _updateLatest = null;
65
- import('./auth.js').then((a) => a.checkForUpdate(VERSION)).then((v) => { _updateLatest = v; }).catch(() => { });
66
- process.on('exit', () => { if (_updateLatest)
67
- process.stdout.write('\n Yeni surum var: ' + VERSION + ' -> ' + _updateLatest + '. Guncelle: wormclaude update\n'); });
68
87
  setToolConfig(config); // Agent/alt-agent araçları aynı config'i kullanır
69
88
  const MAX_TURNS = Number(process.env.WORMCLAUDE_MAX_TURNS) || 50; // tur limiti
70
89
  setLang(loadLang() ?? 'tr'); // kayıtlı dili yükle (yoksa tr)
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.35';
19
+ export const VERSION = '1.0.37';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {