natureco-cli 5.57.0 → 5.59.0

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.
@@ -1,4 +1,6 @@
1
1
  const chalk = require('chalk');
2
+ const { getLang: _gl } = require('../utils/i18n');
3
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
2
4
  const fs = require('fs');
3
5
  const path = require('path');
4
6
  const os = require('os');
@@ -109,7 +111,7 @@ const PROVIDER_PRESETS = {
109
111
  default: 'gemini-2.0-flash',
110
112
  },
111
113
  groq: {
112
- name: 'Groq (hızlı + ücretsiz)',
114
+ name: L('Groq (hızlı + ücretsiz)', 'Groq (fast + free)'),
113
115
  url: 'https://api.groq.com/openai/v1',
114
116
  models: [
115
117
  { id: 'llama-3.3-70b-versatile', label: 'Llama 3.3 70B Versatile', tier: 'flagship', desc: 'En güçlü açık', cost: 'FREE' },
@@ -305,8 +307,8 @@ async function cmdWizard() {
305
307
  // Tam NatureCo logosu — brand kimliği
306
308
  for (const line of FULL_LOGO) console.log(COLORS.primary(line));
307
309
  console.log('');
308
- console.log(COLORS.secondary.bold(' ⚡ Setup Wizard — 60 saniyede hazır'));
309
- console.log(COLORS.muted(' Provider seç, API key gir, hemen başla.\n'));
310
+ console.log(COLORS.secondary.bold(L(' ⚡ Setup Wizard — 60 saniyede hazır', ' ⚡ Setup Wizard — ready in 60 seconds')));
311
+ console.log(COLORS.muted(L(' Provider seç, API key gir, hemen başla.\n', ' Pick a provider, enter an API key, start now.\n')));
310
312
 
311
313
  // Ensure directories
312
314
  if (!fs.existsSync(BASE_DIR)) fs.mkdirSync(BASE_DIR, { recursive: true });
@@ -350,46 +352,46 @@ async function cmdWizard() {
350
352
  const { modelId } = await inquirer.prompt([{
351
353
  type: 'list',
352
354
  name: 'modelId',
353
- message: ` Model sec (${preset.models.length} secenek):`,
355
+ message: ` ${L('Model sec', 'Select model')} (${preset.models.length} ${L('secenek', 'options')}):`,
354
356
  choices: [
355
357
  { name: '─────────────────────', disabled: true },
356
- { name: '🟢 GÜÇLÜ / REASONING (en iyi)', disabled: true },
358
+ { name: L('🟢 GÜÇLÜ / REASONING (en iyi)', '🟢 POWERFUL / REASONING (best)'), disabled: true },
357
359
  ...preset.models.filter(m => m.tier === 'flagship' || m.tier === 'reasoning').map(m => ({
358
360
  name: ` ${m.label} (${m.cost})`,
359
361
  value: m.id,
360
362
  })),
361
363
  { name: '─────────────────────', disabled: true },
362
- { name: '🟡 ORTA (dengeli)', disabled: true },
364
+ { name: L('🟡 ORTA (dengeli)', '🟡 MID (balanced)'), disabled: true },
363
365
  ...preset.models.filter(m => m.tier === 'balanced').map(m => ({
364
366
  name: ` ${m.label} (${m.cost})`,
365
367
  value: m.id,
366
368
  })),
367
369
  { name: '─────────────────────', disabled: true },
368
- { name: '🔵 HIZLI / UCUZ', disabled: true },
370
+ { name: L('🔵 HIZLI / UCUZ', '🔵 FAST / CHEAP'), disabled: true },
369
371
  ...preset.models.filter(m => m.tier === 'fast').map(m => ({
370
372
  name: ` ${m.label} (${m.cost})`,
371
373
  value: m.id,
372
374
  })),
373
375
  { name: '─────────────────────', disabled: true },
374
- { name: '⚪ KLASİK (legacy)', disabled: true },
376
+ { name: L('⚪ KLASİK (legacy)', '⚪ CLASSIC (legacy)'), disabled: true },
375
377
  ...preset.models.filter(m => m.tier === 'classic').map(m => ({
376
378
  name: ` ${m.label} (${m.cost})`,
377
379
  value: m.id,
378
380
  })),
379
381
  { name: '─────────────────────', disabled: true },
380
- { name: '🔊 ÖZEL (audio/vision/embedding)', disabled: true },
382
+ { name: L('🔊 ÖZEL (audio/vision/embedding)', '🔊 SPECIAL (audio/vision/embedding)'), disabled: true },
381
383
  ...preset.models.filter(m => ['audio', 'vision', 'embedding', 'custom'].includes(m.tier)).map(m => ({
382
384
  name: ` ${m.label} (${m.cost})`,
383
385
  value: m.id,
384
386
  })),
385
387
  { name: '─────────────────────', disabled: true },
386
- { name: '✏️ Custom model adı (ileri düzey)', value: '__custom__' },
388
+ { name: L('✏️ Custom model adı (ileri düzey)', '✏️ Custom model name (advanced)'), value: '__custom__' },
387
389
  ],
388
390
  pageSize: 20,
389
391
  }]);
390
392
 
391
393
  if (modelId === '__custom__') {
392
- providerModel = await rlQuestion(` Model adı: `) || preset.default;
394
+ providerModel = await rlQuestion(` ${L('Model adı', 'Model name')}: `) || preset.default;
393
395
  } else {
394
396
  providerModel = modelId;
395
397
  }
@@ -407,11 +409,11 @@ async function cmdWizard() {
407
409
  const currentKey = cfg.providerApiKey || '';
408
410
  if (currentKey) {
409
411
  console.log('');
410
- console.log(chalk.yellow(' ⚠️ Mevcut API key tespit edildi (son 4 karakter: ' + currentKey.slice(-4) + ')'));
412
+ console.log(chalk.yellow(L(' ⚠️ Mevcut API key tespit edildi (son 4 karakter: ', ' ⚠️ Existing API key detected (last 4 chars: ') + currentKey.slice(-4) + ')'));
411
413
  const reset = await inquirer.prompt([{
412
414
  type: 'confirm',
413
415
  name: 'fresh',
414
- message: 'Sıfırdan yeni kurulum mu yapacaksın? (N = mevcut korunur)',
416
+ message: L('Sıfırdan yeni kurulum mu yapacaksın? (N = mevcut korunur)', 'Start a fresh setup? (N = keep existing)'),
415
417
  default: false,
416
418
  }]);
417
419
  if (reset.fresh) {
@@ -424,39 +426,39 @@ async function cmdWizard() {
424
426
  delete cfg.mattermostBot;
425
427
  delete cfg.smsTwilioSid;
426
428
  delete cfg.webhooks;
427
- console.log(chalk.green(' ✓ Eski ayarlar temizlendi'));
429
+ console.log(chalk.green(L(' ✓ Eski ayarlar temizlendi', ' ✓ Old settings cleared')));
428
430
  }
429
431
  }
430
432
  const apiKey = await rlQuestion(` API Key ${currentKey ? '(leave blank to keep current)' : ''}: `);
431
433
  if (apiKey) {
432
434
  cfg.providerApiKey = apiKey;
433
435
  // v5.6.0: API key dogrula
434
- console.log('\n Doğrulanıyor...');
436
+ console.log(L('\n Doğrulanıyor...', '\n Validating...'));
435
437
  const isValid = await validateApiKey(providerUrl, apiKey);
436
438
  if (!isValid) {
437
- console.log(' ❌ API key gecersiz! Lutfen kontrol edin.');
439
+ console.log(L(' ❌ API key gecersiz! Lutfen kontrol edin.', ' ❌ API key invalid! Please check.'));
438
440
  const retry = await inquirer.prompt([{
439
441
  type: 'confirm',
440
442
  name: 'continue',
441
- message: 'Yine de devam etmek istiyor musunuz? (key sonra duzeltilebilir)',
443
+ message: L('Yine de devam etmek istiyor musunuz? (key sonra duzeltilebilir)', 'Continue anyway? (you can fix the key later)'),
442
444
  default: false,
443
445
  }]);
444
446
  if (!retry.continue) {
445
- console.log(' Setup iptal edildi. Tekrar deneyin: natureco setup');
447
+ console.log(L(' Setup iptal edildi. Tekrar deneyin: natureco setup', ' Setup cancelled. Try again: natureco setup'));
446
448
  process.exit(1);
447
449
  }
448
450
  } else {
449
- console.log(' ✓ API key gecerli!');
451
+ console.log(L(' ✓ API key gecerli!', ' ✓ API key valid!'));
450
452
  }
451
453
  }
452
454
 
453
455
  // Step 3: Bot & User identity
454
456
  console.log('');
455
- console.log(chalk.white(' Step 3: Bot & Kullanıcı'));
457
+ console.log(chalk.white(L(' Step 3: Bot & Kullanıcı', ' Step 3: Bot & User')));
456
458
  console.log(chalk.gray(' ─────────────────────────────────────────────'));
457
- const userName = await rlQuestion(` Sizin adınız: `);
459
+ const userName = await rlQuestion(` ${L('Sizin adınız', 'Your name')}: `);
458
460
  if (userName) cfg.userName = userName;
459
- const botName = await rlQuestion(` Bot adı: `);
461
+ const botName = await rlQuestion(` ${L('Bot adı', 'Bot name')}: `);
460
462
  if (botName) cfg.botName = botName;
461
463
 
462
464
  // v5.6.7: Memory dosyasi yoksa olustur, varsa guncelle
@@ -475,43 +477,43 @@ async function cmdWizard() {
475
477
  if (!fs.existsSync(BASE_DIR)) fs.mkdirSync(BASE_DIR, { recursive: true });
476
478
  if (!fs.existsSync(path.dirname(memFile))) fs.mkdirSync(path.dirname(memFile), { recursive: true });
477
479
  fs.writeFileSync(memFile, JSON.stringify(mem, null, 2), 'utf8');
478
- console.log(chalk.gray(' ✓ Memory ' + (memExists ? 'guncellendi' : 'olusturuldu') + ': ' + memFile));
480
+ console.log(chalk.gray(' ✓ Memory ' + (memExists ? L('guncellendi', 'updated') : L('olusturuldu', 'created')) + ': ' + memFile));
479
481
  }
480
482
  } catch (e) {
481
- console.log(chalk.gray(' ! Memory yazilamadi: ' + e.message));
483
+ console.log(chalk.gray(L(' ! Memory yazilamadi: ', ' ! Could not write memory: ') + e.message));
482
484
  }
483
485
 
484
486
  // Step 4: Kanal Entegrasyonları (isteğe bağlı, isteyen atlayabilir)
485
487
  console.log('');
486
- console.log(chalk.white(' Step 4: Kanal Entegrasyonları (opsiyonel)'));
488
+ console.log(chalk.white(L(' Step 4: Kanal Entegrasyonları (opsiyonel)', ' Step 4: Channel Integrations (optional)')));
487
489
  console.log(chalk.gray(' ─────────────────────────────────────────────'));
488
- console.log(chalk.gray(' Telegram, WhatsApp, Discord, Slack bağlamak ister misiniz?'));
489
- console.log(chalk.gray(' Atlamak için hepsini boş bırakın, sonra: natureco <kanal> connect\n'));
490
+ console.log(chalk.gray(L(' Telegram, WhatsApp, Discord, Slack bağlamak ister misiniz?', ' Connect Telegram, WhatsApp, Discord, Slack?')));
491
+ console.log(chalk.gray(L(' Atlamak için hepsini boş bırakın, sonra: natureco <kanal> connect\n', ' To skip, leave all blank, then: natureco <channel> connect\n')));
490
492
 
491
493
  const integrations = [
492
- { key: 'telegramToken', name: 'Telegram', hint: 'BotFather\'dan al (@BotFather → /newbot → token)' },
493
- { key: 'whatsappPhone', name: 'WhatsApp', hint: 'Telefon numaranızı girin (örn: +905422842631)' },
494
+ { key: 'telegramToken', name: 'Telegram', hint: L('BotFather\'dan al (@BotFather → /newbot → token)', 'Get it from BotFather (@BotFather → /newbot → token)') },
495
+ { key: 'whatsappPhone', name: 'WhatsApp', hint: L('Telefon numaranızı girin (örn: +905422842631)', 'Enter your phone number (e.g. +905422842631)') },
494
496
  { key: 'discordToken', name: 'Discord', hint: 'Discord bot token (Discord Developer Portal)' },
495
497
  { key: 'slackToken', name: 'Slack', hint: 'Slack bot token (api.slack.com/apps)' },
496
- { key: 'signalBotId', name: 'Signal', hint: 'Signal bot numarası veya ID' },
497
- { key: 'ircBotId', name: 'IRC', hint: 'IRC bot kullanıcı adı (örn: NatureCoBot)' },
498
- { key: 'mattermostBotId', name: 'Mattermost', hint: 'Mattermost bot kullanıcı adı' },
499
- { key: 'imessageBotId', name: 'iMessage', hint: 'iMessage bridge endpoint veya ad' },
500
- { key: 'smsBotId', name: 'SMS (Twilio)', hint: 'Twilio hesap SID veya bot ID' },
501
- { key: 'webhooks', name: 'Webhooks', hint: 'Webhook URL (veya boş bırakın, sonra: natureco webhooks add)' },
498
+ { key: 'signalBotId', name: 'Signal', hint: L('Signal bot numarası veya ID', 'Signal bot number or ID') },
499
+ { key: 'ircBotId', name: 'IRC', hint: L('IRC bot kullanıcı adı (örn: NatureCoBot)', 'IRC bot username (e.g. NatureCoBot)') },
500
+ { key: 'mattermostBotId', name: 'Mattermost', hint: L('Mattermost bot kullanıcı adı', 'Mattermost bot username') },
501
+ { key: 'imessageBotId', name: 'iMessage', hint: L('iMessage bridge endpoint veya ad', 'iMessage bridge endpoint or name') },
502
+ { key: 'smsBotId', name: 'SMS (Twilio)', hint: L('Twilio hesap SID veya bot ID', 'Twilio account SID or bot ID') },
503
+ { key: 'webhooks', name: 'Webhooks', hint: L('Webhook URL (veya boş bırakın, sonra: natureco webhooks add)', 'Webhook URL (or leave blank, then: natureco webhooks add)') },
502
504
  ];
503
505
 
504
506
  for (const integ of integrations) {
505
507
  const current = cfg[integ.key] || '';
506
508
  if (current) {
507
- console.log(chalk.gray(` ${integ.name}: zaten ayarlı, boş bırakırsanız korunur`));
509
+ console.log(chalk.gray(` ${integ.name}: ${L('zaten ayarlı, boş bırakırsanız korunur', 'already set, leave blank to keep')}`));
508
510
  } else {
509
511
  console.log(chalk.gray(` ${integ.hint}`));
510
512
  }
511
- const val = await rlQuestion(` ${integ.name} ${current ? '(mevcut - boş bırakın)' : '(boş = atla)'}: `);
513
+ const val = await rlQuestion(` ${integ.name} ${current ? L('(mevcut - boş bırakın)', '(current - leave blank)') : L('(boş = atla)', '(blank = skip)')}: `);
512
514
  if (val) {
513
515
  cfg[integ.key] = val;
514
- console.log(chalk.green(` ✓ ${integ.name} ayarlandı`));
516
+ console.log(chalk.green(` ✓ ${integ.name} ${L('ayarlandı', 'set')}`));
515
517
  }
516
518
  }
517
519
 
@@ -533,8 +535,8 @@ async function cmdWizard() {
533
535
  console.log('');
534
536
  console.log(chalk.white(' Next steps:'));
535
537
  console.log(chalk.cyan(' natureco chat Start chatting'));
536
- console.log(chalk.cyan(' natureco repl İnteraktif REPL (persistent memory)'));
537
- console.log(chalk.cyan(' natureco telegram connect Telegram bot bağla (henüz yapılmadıysa)'));
538
+ console.log(chalk.cyan(L(' natureco repl İnteraktif REPL (persistent memory)', ' natureco repl Interactive REPL (persistent memory)')));
539
+ console.log(chalk.cyan(L(' natureco telegram connect Telegram bot bağla (henüz yapılmadıysa)', ' natureco telegram connect Connect Telegram bot (if not done yet)')));
538
540
  console.log(chalk.cyan(' natureco help View all commands'));
539
541
  console.log('');
540
542
  }