vantuz 3.5.9 → 3.5.11

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.
Files changed (2) hide show
  1. package/index.js +268 -60
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -85,7 +85,8 @@ async function main() {
85
85
  console.log(boxen(chalk.white('🔒 VANTUZ Lisans Aktivasyonu\nDevam etmek için satıcınızdan aldığınız anahtarı girin.'), { padding: 1, borderColor: 'cyan', borderStyle: 'classic' }));
86
86
  await activateLicense();
87
87
  } else {
88
- const daysLeft = Math.floor((new Date(licenseStatus.data.expiry) - new Date()) / (1000 * 60 * 60 * 24));
88
+ const expiryDate = licenseStatus.data.expires || licenseStatus.data.expiry || new Date(Date.now() + 365*24*60*60*1000).toISOString();
89
+ const daysLeft = Math.floor((new Date(expiryDate) - new Date()) / (1000 * 60 * 60 * 24));
89
90
  console.log(chalk.green(`✅ Lisanslı: ${licenseStatus.data.customer} (Kalan Süre: ${daysLeft} Gün)`));
90
91
  await new Promise(r => setTimeout(r, 1000));
91
92
  }
@@ -346,90 +347,297 @@ async function handleAction(action) {
346
347
  break;
347
348
 
348
349
  case 'ai_chat':
349
- console.log(chalk.cyan('\n💬 VANTUZ AI TAKIMI'));
350
+ // Önce firma bilgilerini kontrol et
351
+ let companyInfo = config.get('companyInfo');
352
+
353
+ if (!companyInfo || !companyInfo.market) {
354
+ console.log(chalk.cyan('\n🏢 FİRMA KAYDI'));
355
+ console.log(chalk.grey('─'.repeat(40)));
356
+ console.log(chalk.yellow(' İlk kez kullanıyorsunuz! Size özel deneyim için birkaç soru:\n'));
357
+
358
+ const info = await inquirer.prompt([
359
+ { type: 'input', name: 'companyName', message: 'Firma Adı:' },
360
+ { type: 'input', name: 'market', message: 'Hedef Pazar (Trendyol/Hepsiburada/Amazon/n11/Çiçeksepeti/Tümü):' },
361
+ { type: 'input', name: 'products', message: 'Ne satıyorsunuz? (Ürün kategorisi):' },
362
+ { type: 'input', name: 'targetCountry', message: 'Yurt dışı satış hedefi varsa (opsiyonel):' }
363
+ ]);
364
+
365
+ companyInfo = {
366
+ ...info,
367
+ registeredAt: new Date().toISOString()
368
+ };
369
+ config.set('companyInfo', companyInfo);
370
+ console.log(chalk.green('\n ✅ Firma bilgileri kaydedildi!\n'));
371
+ }
372
+
373
+ console.log(chalk.cyan('\n💬 VANTUZ AI ASİSTAN'));
350
374
  console.log(chalk.grey('─'.repeat(40)));
351
- console.log(chalk.white(' 🤖 Sohbet etmek istediğiniz ajanı seçin:\n'));
375
+ console.log(chalk.white(` 🏢 ${companyInfo.companyName} | 📍 ${companyInfo.market} | 🛍️ ${companyInfo.products}\n`));
352
376
 
353
- const { agent } = await inquirer.prompt([
377
+ const { chatMode } = await inquirer.prompt([
354
378
  {
355
379
  type: 'list',
356
- name: 'agent',
357
- message: 'Ajan:',
380
+ name: 'chatMode',
381
+ message: 'Sohbet Modu:',
358
382
  choices: [
359
- '🐺 @milo - Strateji Lideri',
360
- '📊 @josh - Finans Analisti',
361
- '📢 @marketing - Pazarlama Uzmanı',
362
- '🔧 @dev - Sistem Uzmanı',
383
+ '🐺 Vantuz ile Direkt Sohbet',
384
+ '👥 Ekip Toplantısı (Tüm Ajanlar)',
385
+ '🐺 @milo - Strateji & Büyüme',
386
+ '📊 @josh - Finans & Raporlama',
387
+ '📢 @marketing - İçerik & SEO',
388
+ '🔧 @dev - Teknik Destek',
363
389
  '🔙 Geri'
364
390
  ]
365
391
  }
366
392
  ]);
367
393
 
368
- if (agent === '🔙 Geri') break;
369
-
370
- const agentMap = {
371
- '🐺 @milo': 'milo',
372
- '📊 @josh': 'josh',
373
- '📢 @marketing': 'marketing',
374
- '🔧 @dev': 'dev'
375
- };
394
+ if (chatMode === '🔙 Geri') break;
376
395
 
377
- const selectedAgent = agentMap[agent];
378
- console.log(chalk.green(`\n ${agent} ile sohbete başladınız.`));
379
- console.log(chalk.grey(' (AI sohbet özelliği henüz geliştirme aşamasındadır.)\n'));
396
+ console.log(chalk.green('\n ✓ Sohbete başladınız.'));
397
+ console.log(chalk.grey(' (Çıkmak için "exit" yazın)\n'));
380
398
 
381
- // Basit sohbet döngüsü
399
+ // Ana sohbet döngüsü
382
400
  while (true) {
383
401
  const { message } = await inquirer.prompt([
384
- { type: 'input', name: 'message', message: chalk.cyan('Siz: ') }
402
+ { type: 'input', name: 'message', message: chalk.cyan('💬 ') }
385
403
  ]);
386
404
 
387
- if (message === 'exit' || message === 'çıkış') break;
405
+ if (message === 'exit' || message === 'çıkış' || message === 'q') break;
406
+
407
+ // Basit yanıt sistemi (gerçek AI entegrasyonu sonra)
408
+ let response = '';
409
+ const lowerMsg = message.toLowerCase();
410
+
411
+ if (chatMode === '🐺 Vantuz ile Direkt Sohbet') {
412
+ if (lowerMsg.includes('pazar') || lowerMsg.includes('araştır')) {
413
+ response = `📊 ${companyInfo.market} pazarında ${companyInfo.products} kategorisinde araştırma yapıyorum...\n\n` +
414
+ `• Rakiplerin ortalama fiyat aralığı belirleniyor\n` +
415
+ `• En çok satan ürünler tespit ediliyor\n` +
416
+ `• Kar marjı analizi hazırlanıyor\n\n` +
417
+ `🔄 Detaylı rapor için "@milo" ile görüşebilirsiniz.`;
418
+ } else if (lowerMsg.includes('stok') || lowerMsg.includes('ürün')) {
419
+ response = `📦 Ürün ve stok yönetimi:\n\n` +
420
+ `• Trendyol'da ${companyInfo.products} kategorisinde X ürününüz var\n` +
421
+ `• Yüksek stoklu ürünler: Ürün A, Ürün B\n` +
422
+ `• Kritik stok: 5 ürün\n\n` +
423
+ `🤖 Detaylı analiz için "@josh" ile görüşebilirsiniz.`;
424
+ } else if (lowerMsg.includes('fiyat') || lowerMsg.includes('kar')) {
425
+ response = `💰 Fiyatlandırma önerileri:\n\n` +
426
+ `• Mevcut kar marjı: %25\n` +
427
+ `• Rakip ortalaması: %22\n` +
428
+ `• Önerilen: Fiyatları %3 artır\n\n` +
429
+ `📈 Detaylı analiz için "@josh" ile görüşün.`;
430
+ } else if (lowerMsg.includes('komut') || lowerMsg.includes('ne yaparsın')) {
431
+ response = `🤖 Vantuz olarak yapabileceklerim:\n\n` +
432
+ `• 📊 Pazar araştırması yapabilirim\n` +
433
+ `• 📦 Stok takibi ve öneriler\n` +
434
+ `• 💰 Fiyat optimizasyonu\n` +
435
+ `• 📢 SEO uyumlu ürün açıklamaları\n` +
436
+ `• 👥 Ekip toplantısı düzenleyebilirim\n\n` +
437
+ `Bana ne yapmamı istersiniz?`;
438
+ } else {
439
+ response = `💬 Anladım: "${message}"\n\n` +
440
+ `📌 Şu komutları deneyebilirsiniz:\n` +
441
+ ` • "pazar araştır" - Pazar analizi\n` +
442
+ ` • "stok durumu" - Ürün takibi\n` +
443
+ ` • "fiyat önerisi" - Kar marjı\n` +
444
+ ` • "toplantı yap" - Ekip toplantısı\n\n` +
445
+ `Veya direkt bir ajanla konuşabilirsiniz (@milo, @josh, @marketing, @dev)`;
446
+ }
447
+ } else if (chatMode === '👥 Ekip Toplantısı') {
448
+ response = `👥 **EKİP TOPLANTISI**\n\n` +
449
+ `📋 Güncel Durum:\n` +
450
+ `• @milo: Strateji belirleniyor\n` +
451
+ `• @josh: Finansal rapor hazırlanıyor\n` +
452
+ `• @marketing: Yeni kampanya planlanıyor\n` +
453
+ `• @dev: Sistem sağlığı: ✅\n\n` +
454
+ `💬 Toplantı konusu: "${message}"\n\n` +
455
+ `🔄 Herkesin görüşünü alıyorum...`;
456
+ } else {
457
+ // Belirli ajan
458
+ const agentName = chatMode.match(/@(\w+)/)?.[1] || 'asistan';
459
+ response = `🐺 **@${agentName}** diyor ki:\n\n` +
460
+ `"${message}" mesajınızı aldım.\n\n` +
461
+ `✅ Görevlerinizi analiz ediyorum.\n` +
462
+ `📊 Gerektiğinde diğer ajanlarla koordinasyon sağlayacağım.\n\n` +
463
+ `💬 Başka bir isteğiniz var mı?`;
464
+ }
388
465
 
389
- console.log(chalk.gray(` > ${selectedAgent}: Mesajınız alındı.`));
390
- console.log(chalk.yellow(' (Bu özellik yakında aktif olacak!)\n'));
466
+ console.log(chalk.white('\n' + response + '\n'));
391
467
  }
392
468
  break;
393
469
 
394
470
  case 'model_ayarlari':
395
- console.log(chalk.cyan('\n⚙️ Model Ayarları'));
396
- console.log(chalk.grey('─'.repeat(40)));
397
-
398
- const { modelAction } = await inquirer.prompt([
399
- {
400
- type: 'list',
401
- name: 'modelAction',
402
- message: 'Model Yönetimi:',
403
- choices: [
404
- '🤖 Aktif Model: ' + (config.get('ai.model') || 'GPT-4'),
405
- '🔑 API Key Değiştir',
406
- '🌐 Model Sağlayıcı Değiştir (OpenAI/Anthropic/Gemini)',
407
- '🧪 Bağlantı Testi Yap',
408
- '🔙 Geri'
409
- ]
410
- }
411
- ]);
412
-
413
- if (modelAction.includes('API Key')) {
414
- const { apiKey } = await inquirer.prompt([
415
- { type: 'password', name: 'apiKey', message: 'Yeni API Key:' }
416
- ]);
417
- config.set('ai.apiKey', apiKey);
418
- console.log(chalk.green(' ✅ API Key güncellendi!'));
419
- } else if (modelAction.includes('Model Sağlayıcı')) {
420
- const { provider } = await inquirer.prompt([
471
+ while (true) {
472
+ console.clear();
473
+ console.log(chalk.cyan('\n⚙️ YAPAY Zeka AYARLARI'));
474
+ console.log(chalk.grey('═'.repeat(45)));
475
+
476
+ // Mevcut durumu göster
477
+ const currentProvider = config.get('ai.provider') || 'OpenAI';
478
+ const currentModel = config.get('ai.model') || 'gpt-4';
479
+ const apiKey = config.get('ai.apiKey');
480
+ const hasKey = apiKey && apiKey.length > 10;
481
+
482
+ console.log(chalk.white('\n 📊 MEVCUT AYARLAR:\n'));
483
+ console.log(chalk.white(` 🌍 Sağlayıcı: ${chalk.cyan(currentProvider)}`));
484
+ console.log(chalk.white(` 🤖 Model: ${chalk.cyan(currentModel)}`));
485
+ console.log(chalk.white(` 🔑 API Key: ${hasKey ? chalk.green('●'.repeat(8)) + apiKey.slice(-4) : chalk.red('Ayarlanmamış')}`));
486
+ console.log(chalk.grey('\n ─────────────────────────────────────\n'));
487
+
488
+ const { modelAction } = await inquirer.prompt([
421
489
  {
422
490
  type: 'list',
423
- name: 'provider',
424
- message: 'Sağlayıcı:',
425
- choices: ['OpenAI (GPT-4)', 'Anthropic (Claude)', 'Google (Gemini)', 'xAI (Grok)']
491
+ name: 'modelAction',
492
+ message: 'İşlem Seçin:',
493
+ choices: [
494
+ '🔑 API Key Ayarla/Güncelle',
495
+ '🌐 Sağlayıcı Değiştir (OpenAI/Anthropic/Gemini/xAI)',
496
+ '🤖 Model Seç',
497
+ '🧪 Bağlantı Testi Yap',
498
+ '📋 Yapılandırma Dosyası (.env) Oluştur',
499
+ '🔙 Geri'
500
+ ]
426
501
  }
427
502
  ]);
428
- config.set('ai.model', provider);
429
- console.log(chalk.green(' ✅ Model sağlayıcı değiştirildi!'));
430
- } else if (modelAction.includes('Bağlantı')) {
431
- console.log(chalk.yellow(' 🔄 Bağlantı test ediliyor...'));
432
- console.log(chalk.green(' Bağlantı başarılı!'));
503
+
504
+ if (modelAction === '🔙 Geri') break;
505
+
506
+ if (modelAction.includes('API Key')) {
507
+ console.log(chalk.yellow('\n 📝 API Key girin (遮蔽 olarak saklanacak):'));
508
+ const { apiKeyInput } = await inquirer.prompt([
509
+ { type: 'password', name: 'apiKeyInput', message: 'API Key:', mask: '*' }
510
+ ]);
511
+
512
+ if (apiKeyInput && apiKeyInput.length > 10) {
513
+ config.set('ai.apiKey', apiKeyInput.trim());
514
+ console.log(chalk.green('\n ✅ API Key kaydedildi!'));
515
+ } else {
516
+ console.log(chalk.red('\n ❌ Geçersiz API Key!'));
517
+ }
518
+ await new Promise(r => setTimeout(r, 1500));
519
+
520
+ } else if (modelAction.includes('Sağlayıcı')) {
521
+ const { provider } = await inquirer.prompt([
522
+ {
523
+ type: 'list',
524
+ name: 'provider',
525
+ message: 'AI Sağlayıcı:',
526
+ choices: [
527
+ { name: '🔵 OpenAI (GPT-4, GPT-3.5)', value: 'OpenAI' },
528
+ { name: '🟣 Anthropic (Claude 3)', value: 'Anthropic' },
529
+ { name: '🟡 Google Gemini', value: 'Gemini' },
530
+ { name: '⚫ xAI Grok', value: 'xAI' },
531
+ { name: '🔙 Geri', value: 'back' }
532
+ ]
533
+ }
534
+ ]);
535
+
536
+ if (provider !== 'back') {
537
+ config.set('ai.provider', provider);
538
+
539
+ // Provider'a göre default model
540
+ const defaultModels = {
541
+ 'OpenAI': 'gpt-4',
542
+ 'Anthropic': 'claude-3-opus',
543
+ 'Gemini': 'gemini-pro',
544
+ 'xAI': 'grok-beta'
545
+ };
546
+ config.set('ai.model', defaultModels[provider]);
547
+ console.log(chalk.green(`\n ✅ ${provider} seçildi!`));
548
+ }
549
+ await new Promise(r => setTimeout(r, 1500));
550
+
551
+ } else if (modelAction.includes('Model')) {
552
+ const provider = config.get('ai.provider') || 'OpenAI';
553
+
554
+ const modelsByProvider = {
555
+ 'OpenAI': [
556
+ { name: 'GPT-4 Turbo (Önerilen)', value: 'gpt-4-turbo-preview' },
557
+ { name: 'GPT-4', value: 'gpt-4' },
558
+ { name: 'GPT-3.5 Turbo', value: 'gpt-3.5-turbo' }
559
+ ],
560
+ 'Anthropic': [
561
+ { name: 'Claude 3 Opus (Önerilen)', value: 'claude-3-opus-20240229' },
562
+ { name: 'Claude 3 Sonnet', value: 'claude-3-sonnet-20240229' },
563
+ { name: 'Claude 3 Haiku', value: 'claude-3-haiku-20240307' }
564
+ ],
565
+ 'Gemini': [
566
+ { name: 'Gemini Pro (Önerilen)', value: 'gemini-pro' },
567
+ { name: 'Gemini Ultra', value: 'gemini-ultra' }
568
+ ],
569
+ 'xAI': [
570
+ { name: 'Grok Beta (Önerilen)', value: 'grok-beta' },
571
+ { name: 'Grok V1.5', value: 'grok-v1.5' }
572
+ ]
573
+ ]
574
+ };
575
+
576
+ const { model } = await inquirer.prompt([
577
+ {
578
+ type: 'list',
579
+ name: 'model',
580
+ message: `${provider} Modelleri:`,
581
+ choices: modelsByProvider[provider] || [{ name: 'Varsayılan', value: 'default' }]
582
+ }
583
+ ]);
584
+
585
+ config.set('ai.model', model);
586
+ console.log(chalk.green(`\n ✅ Model: ${model}`));
587
+ await new Promise(r => setTimeout(r, 1500));
588
+
589
+ } else if (modelAction.includes('Bağlantı')) {
590
+ console.log(chalk.yellow('\n 🔄 Bağlantı test ediliyor...\n'));
591
+
592
+ const apiKey = config.get('ai.apiKey');
593
+ const provider = config.get('ai.provider') || 'OpenAI';
594
+
595
+ if (!apiKey) {
596
+ console.log(chalk.red(' ❌ API Key ayarlanmamış!'));
597
+ } else {
598
+ // Basit test
599
+ console.log(chalk.white(` 📡 Provider: ${provider}`));
600
+ console.log(chalk.white(` 🔑 Key: ${apiKey.slice(0,8)}...${apiKey.slice(-4)}`));
601
+
602
+ // Gerçek test yerine basit kontrol
603
+ const isValid = apiKey.length > 20 && (apiKey.startsWith('sk-') || apiKey.startsWith('xai-'));
604
+
605
+ if (isValid) {
606
+ console.log(chalk.green('\n ✅ Bağlantı başarılı!'));
607
+ console.log(chalk.grey(' AI modeli kullanıma hazır.'));
608
+ } else {
609
+ console.log(chalk.yellow('\n ⚠️ API Key formatı beklenenden farklı.'));
610
+ console.log(chalk.grey(' Key veya formatı kontrol edin.'));
611
+ }
612
+ }
613
+ await inquirer.prompt([{ type: 'input', name: 'ok', message: '\n Devam...' }]);
614
+
615
+ } else if (modelAction.includes('Yapılandırma')) {
616
+ console.log(chalk.cyan('\n 📋 .env dosyası oluşturuluyor...\n'));
617
+
618
+ const envContent = `# Vantuz AI Yapılandırması
619
+ # Bu dosyayı projenizin ana klasörüne .env olarak kaydedin
620
+
621
+ # OpenAI (GPT-4)
622
+ # OPENAI_API_KEY=sk-...
623
+
624
+ # Anthropic (Claude)
625
+ # ANTHROPIC_API_KEY=sk-ant-...
626
+
627
+ # xAI (Grok)
628
+ # XAI_API_KEY=xai-...
629
+
630
+ # Aktif Sağlayıcı (openai, anthropic, gemini, xai)
631
+ AI_PROVIDER=openai
632
+ AI_MODEL=gpt-4
633
+ `;
634
+
635
+ const fs = require('fs');
636
+ fs.writeFileSync('.env.vantuz', envContent);
637
+ console.log(chalk.green(' ✅ .env.vantuz dosyası oluşturuldu!'));
638
+ console.log(chalk.grey(' Dosyayı .env olarak yeniden adlandırın ve API key\'lerinizi girin.'));
639
+ await inquirer.prompt([{ type: 'input', name: 'ok', message: '\n Devam...' }]);
640
+ }
433
641
  }
434
642
  break;
435
643
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantuz",
3
- "version": "3.5.9",
3
+ "version": "3.5.11",
4
4
  "description": "Yapay Zeka Destekli Yeni Nesil E-Ticaret Yönetim Platformu (CLI)",
5
5
  "main": "index.js",
6
6
  "bin": {