vantuz 3.0.0 → 3.0.1

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/cli.js +19 -7
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -11,12 +11,18 @@
11
11
 
12
12
  import fs from 'fs';
13
13
  import path from 'path';
14
- import { fileURLToPath } from 'url';
14
+ import os from 'os';
15
15
  import readline from 'readline';
16
16
 
17
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
18
- const CONFIG_PATH = path.join(__dirname, '.env');
19
- const CONFIG_JSON = path.join(__dirname, 'vantuz.config.json');
17
+ // Config dosyaları kullanıcının home dizininde saklanır
18
+ const VANTUZ_HOME = path.join(os.homedir(), '.vantuz');
19
+ const CONFIG_PATH = path.join(VANTUZ_HOME, '.env');
20
+ const CONFIG_JSON = path.join(VANTUZ_HOME, 'config.json');
21
+
22
+ // Dizin yoksa oluştur
23
+ if (!fs.existsSync(VANTUZ_HOME)) {
24
+ fs.mkdirSync(VANTUZ_HOME, { recursive: true });
25
+ }
20
26
 
21
27
  // ═══════════════════════════════════════════════════════════════════════════
22
28
  // RENK KODLARI
@@ -89,6 +95,11 @@ function saveEnv(env) {
89
95
  fs.writeFileSync(CONFIG_PATH, lines.join('\n'));
90
96
  }
91
97
 
98
+ function hasAnyAIKey(env) {
99
+ return env.OPENAI_API_KEY || env.ANTHROPIC_API_KEY ||
100
+ env.DEEPSEEK_API_KEY || env.GROQ_API_KEY || env.GEMINI_API_KEY;
101
+ }
102
+
92
103
  // ═══════════════════════════════════════════════════════════════════════════
93
104
  // READLINE HELPER
94
105
  // ═══════════════════════════════════════════════════════════════════════════
@@ -219,7 +230,7 @@ async function runTUI() {
219
230
  console.log(c('dim', ' Komutlar: /help, /stok, /fiyat, /rapor, /cikis\n'));
220
231
 
221
232
  // Check AI config
222
- const hasAI = env.OPENAI_API_KEY || env.ANTHROPIC_API_KEY || env.DEEPSEEK_API_KEY;
233
+ const hasAI = hasAnyAIKey(env);
223
234
  if (!hasAI) {
224
235
  console.log(c('yellow', ' ⚠️ AI sağlayıcı yapılandırılmamış.'));
225
236
  console.log(c('dim', ' → vantuz config komutunu çalıştırın\n'));
@@ -334,7 +345,7 @@ async function processChat(input, config, env) {
334
345
  }
335
346
 
336
347
  // Default response
337
- if (!env.OPENAI_API_KEY && !env.ANTHROPIC_API_KEY) {
348
+ if (!hasAnyAIKey(env)) {
338
349
  return 'AI yanıtı için API anahtarı gerekli. "vantuz config" ile ayarlayın.';
339
350
  }
340
351
 
@@ -355,7 +366,7 @@ async function runStatus() {
355
366
 
356
367
  // AI
357
368
  const aiProvider = config.aiProvider || 'Ayarlanmamış';
358
- const hasAIKey = env.OPENAI_API_KEY || env.ANTHROPIC_API_KEY;
369
+ const hasAIKey = hasAnyAIKey(env);
359
370
  console.log(` AI Sağlayıcı: ${aiProvider} ${hasAIKey ? c('green', '✓') : c('red', '✗')}`);
360
371
 
361
372
  // Platforms
@@ -378,6 +389,7 @@ async function runStatus() {
378
389
  }
379
390
 
380
391
  console.log(`\n Toplam: ${connected}/${platforms.length} platform bağlı`);
392
+ console.log(c('dim', `\n Config: ${CONFIG_PATH}`));
381
393
  console.log();
382
394
  }
383
395
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantuz",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Yapay Zeka Destekli E-Ticaret Yönetim Platformu - 7 Pazaryeri Entegrasyonu",
5
5
  "type": "module",
6
6
  "main": "cli.js",