vantuz 3.0.1 โ†’ 3.1.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.
package/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * ๐Ÿ™ VANTUZ CLI
4
- * Terminal รผzerinden Vantuz AI ile etkileลŸim
3
+ * ๐Ÿ™ VANTUZ CLI v3.1
4
+ * Enterprise e-ticaret yรถnetimi
5
5
  *
6
6
  * Kullanฤฑm:
7
7
  * vantuz tui โ†’ Sohbet modu
@@ -13,19 +13,23 @@ import fs from 'fs';
13
13
  import path from 'path';
14
14
  import os from 'os';
15
15
  import readline from 'readline';
16
+ import { getEngine } from './core/engine.js';
17
+ import { log, getLogs, clearLogs } from './core/ai-provider.js';
18
+
19
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
20
+ // CONFIG
21
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
16
22
 
17
- // Config dosyalarฤฑ kullanฤฑcฤฑnฤฑn home dizininde saklanฤฑr
18
23
  const VANTUZ_HOME = path.join(os.homedir(), '.vantuz');
19
24
  const CONFIG_PATH = path.join(VANTUZ_HOME, '.env');
20
25
  const CONFIG_JSON = path.join(VANTUZ_HOME, 'config.json');
21
26
 
22
- // Dizin yoksa oluลŸtur
23
27
  if (!fs.existsSync(VANTUZ_HOME)) {
24
28
  fs.mkdirSync(VANTUZ_HOME, { recursive: true });
25
29
  }
26
30
 
27
31
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
28
- // RENK KODLARI
32
+ // COLORS
29
33
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
30
34
 
31
35
  const colors = {
@@ -38,25 +42,21 @@ const colors = {
38
42
  blue: '\x1b[34m',
39
43
  magenta: '\x1b[35m',
40
44
  cyan: '\x1b[36m',
41
- white: '\x1b[37m',
42
- bgBlue: '\x1b[44m',
43
- bgMagenta: '\x1b[45m'
45
+ white: '\x1b[37m'
44
46
  };
45
47
 
46
48
  const c = (color, text) => `${colors[color]}${text}${colors.reset}`;
47
49
 
48
50
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
49
- // YARDIMCI FONKSฤฐYONLAR
51
+ // HELPERS
50
52
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
51
53
 
52
- function clearScreen() {
53
- console.clear();
54
- }
54
+ function clearScreen() { console.clear(); }
55
55
 
56
56
  function printHeader() {
57
57
  console.log(c('cyan', `
58
58
  โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
59
- โ•‘ ๐Ÿ™ ${c('bold', 'VANTUZ AI')} - E-Ticaretin Yapay Zeka Beyni โ•‘
59
+ โ•‘ ๐Ÿ™ ${c('bold', 'VANTUZ AI v3.1')} - Enterprise E-Ticaret โ•‘
60
60
  โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
61
61
  `));
62
62
  }
@@ -100,10 +100,6 @@ function hasAnyAIKey(env) {
100
100
  env.DEEPSEEK_API_KEY || env.GROQ_API_KEY || env.GEMINI_API_KEY;
101
101
  }
102
102
 
103
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
104
- // READLINE HELPER
105
- // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
106
-
107
103
  function createRL() {
108
104
  return readline.createInterface({
109
105
  input: process.stdin,
@@ -130,7 +126,7 @@ async function askYesNo(rl, question, defaultYes = true) {
130
126
  }
131
127
 
132
128
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
133
- // CONFIG KOMUTU
129
+ // CONFIG COMMAND
134
130
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
135
131
 
136
132
  async function runConfig() {
@@ -153,10 +149,10 @@ async function runConfig() {
153
149
  console.log(' 5) Gemini');
154
150
  console.log(' 6) Atla (skip)');
155
151
 
156
- const aiChoice = await ask(rl, '\n Seรงim', '1');
152
+ const aiChoice = await ask(rl, '\n Seรงim', '5');
157
153
  if (aiChoice !== '6' && aiChoice.toLowerCase() !== 'skip') {
158
154
  const providers = ['openai', 'anthropic', 'deepseek', 'groq', 'gemini'];
159
- config.aiProvider = providers[parseInt(aiChoice) - 1] || 'openai';
155
+ config.aiProvider = providers[parseInt(aiChoice) - 1] || 'gemini';
160
156
 
161
157
  const keyMap = {
162
158
  openai: 'OPENAI_API_KEY',
@@ -215,7 +211,7 @@ async function runConfig() {
215
211
  }
216
212
 
217
213
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
218
- // TUI (SOHBET MODU)
214
+ // TUI (CHAT MODE)
219
215
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
220
216
 
221
217
  async function runTUI() {
@@ -223,15 +219,30 @@ async function runTUI() {
223
219
  printHeader();
224
220
 
225
221
  const rl = createRL();
226
- const config = loadConfig();
227
222
  const env = loadEnv();
228
223
 
229
- console.log(c('green', ' ๐Ÿ’ฌ Sohbet Modu'));
230
- console.log(c('dim', ' Komutlar: /help, /stok, /fiyat, /rapor, /cikis\n'));
224
+ console.log(c('yellow', ' ๐Ÿ”„ Engine baลŸlatฤฑlฤฑyor...'));
225
+
226
+ let engine;
227
+ try {
228
+ engine = await getEngine();
229
+ const status = engine.getStatus();
230
+ console.log(c('green', ` โœ“ Engine hazฤฑr - ${status.connectedCount} platform baฤŸlฤฑ`));
231
+
232
+ if (status.productCount > 0) {
233
+ console.log(c('dim', ` ๐Ÿ“ฆ ${status.productCount} รผrรผn yรผklendi`));
234
+ }
235
+ } catch (e) {
236
+ console.log(c('red', ` โŒ Engine hatasฤฑ: ${e.message}`));
237
+ console.log(c('dim', ' Temel modda devam ediliyor...\n'));
238
+ engine = null;
239
+ }
240
+
241
+ console.log(c('green', '\n ๐Ÿ’ฌ Sohbet Modu'));
242
+ console.log(c('dim', ' Komutlar: /help, /stok, /siparis, /fiyat, /test, /logs, /cikis\n'));
231
243
 
232
244
  // Check AI config
233
- const hasAI = hasAnyAIKey(env);
234
- if (!hasAI) {
245
+ if (!hasAnyAIKey(env)) {
235
246
  console.log(c('yellow', ' โš ๏ธ AI saฤŸlayฤฑcฤฑ yapฤฑlandฤฑrฤฑlmamฤฑลŸ.'));
236
247
  console.log(c('dim', ' โ†’ vantuz config komutunu รงalฤฑลŸtฤฑrฤฑn\n'));
237
248
  }
@@ -248,13 +259,28 @@ async function runTUI() {
248
259
 
249
260
  // Commands
250
261
  if (input.startsWith('/')) {
251
- await handleCommand(input, config, env);
262
+ await handleCommand(input, engine, env);
252
263
  prompt();
253
264
  return;
254
265
  }
255
266
 
256
- // AI Chat
257
- console.log(c('magenta', '\n Vantuz: ') + await processChat(input, config, env));
267
+ // AI Chat via Engine
268
+ try {
269
+ console.log(c('dim', '\n ๐Ÿง  DรผลŸรผnรผyorum...'));
270
+
271
+ let response;
272
+ if (engine) {
273
+ response = await engine.chat(input);
274
+ } else {
275
+ const { chat } = await import('./core/ai-provider.js');
276
+ response = await chat(input, loadConfig(), env);
277
+ }
278
+
279
+ console.log(c('magenta', '\n Vantuz: ') + response);
280
+ } catch (e) {
281
+ console.log(c('red', `\n โŒ Hata: ${e.message}`));
282
+ }
283
+
258
284
  prompt();
259
285
  });
260
286
  };
@@ -262,7 +288,7 @@ async function runTUI() {
262
288
  prompt();
263
289
  }
264
290
 
265
- async function handleCommand(input, config, env) {
291
+ async function handleCommand(input, engine, env) {
266
292
  const [cmd, ...args] = input.slice(1).split(' ');
267
293
 
268
294
  switch (cmd.toLowerCase()) {
@@ -270,46 +296,140 @@ async function handleCommand(input, config, env) {
270
296
  case 'yardim':
271
297
  console.log(`
272
298
  ${c('cyan', 'Komutlar:')}
273
- /stok [platform] โ†’ Stok durumu
274
- /fiyat <รผrรผn> <tl> โ†’ Fiyat gรผncelle
275
- /rapor [dรถnem] โ†’ SatฤฑลŸ raporu
299
+ /stok [platform] โ†’ Stok durumu (gerรงek veri)
300
+ /siparis [n] โ†’ Son n sipariลŸ
301
+ /fiyat <bkod> <tl> โ†’ Fiyat gรผncelle
302
+ /test โ†’ Platform baฤŸlantฤฑ testi
303
+ /logs [n] โ†’ Son n log satฤฑrฤฑ
304
+ /logs clear โ†’ Loglarฤฑ temizle
276
305
  /platformlar โ†’ BaฤŸlฤฑ platformlar
277
- /config โ†’ Ayarlarฤฑ aรง
278
306
  /cikis โ†’ ร‡ฤฑkฤฑลŸ
279
307
  `);
280
308
  break;
281
309
 
282
310
  case 'stok':
283
- console.log(c('yellow', '\n ๐Ÿ“ฆ Stok kontrolรผ yapฤฑlฤฑyor...'));
284
- console.log(c('dim', ' (Bu รถzellik API baฤŸlantฤฑsฤฑ gerektirir)'));
311
+ if (!engine) {
312
+ console.log(c('red', '\n โŒ Engine yรผklenmedi'));
313
+ return;
314
+ }
315
+ console.log(c('yellow', '\n ๐Ÿ“ฆ Stok รงekiliyor...'));
316
+ try {
317
+ const platform = args[0] || 'all';
318
+ const results = await engine.getStock(platform);
319
+
320
+ if (results.length === 0) {
321
+ console.log(c('dim', ' BaฤŸlฤฑ platform yok veya stok bulunamadฤฑ.'));
322
+ return;
323
+ }
324
+
325
+ for (const r of results) {
326
+ console.log(c('cyan', `\n ${r.icon} ${r.platform.toUpperCase()}`));
327
+ if (r.products.length === 0) {
328
+ console.log(c('dim', ' รœrรผn bulunamadฤฑ'));
329
+ } else {
330
+ r.products.slice(0, 10).forEach(p => {
331
+ const stockColor = p.stock > 10 ? 'green' : p.stock > 0 ? 'yellow' : 'red';
332
+ console.log(` ${p.barcode}: ${c(stockColor, `${p.stock} adet`)} - ${p.price} TL`);
333
+ });
334
+ if (r.products.length > 10) {
335
+ console.log(c('dim', ` ... ve ${r.products.length - 10} รผrรผn daha`));
336
+ }
337
+ }
338
+ }
339
+ } catch (e) {
340
+ console.log(c('red', ` โŒ Hata: ${e.message}`));
341
+ log('ERROR', 'Stok รงekme hatasฤฑ', { error: e.message });
342
+ }
343
+ break;
344
+
345
+ case 'siparis':
346
+ case 'siparisler':
347
+ if (!engine) {
348
+ console.log(c('red', '\n โŒ Engine yรผklenmedi'));
349
+ return;
350
+ }
351
+ console.log(c('yellow', '\n ๐Ÿ“‹ SipariลŸler รงekiliyor...'));
352
+ try {
353
+ const orders = await engine.getOrders();
354
+ const limit = parseInt(args[0]) || 10;
355
+
356
+ if (orders.length === 0) {
357
+ console.log(c('dim', ' SipariลŸ bulunamadฤฑ.'));
358
+ return;
359
+ }
360
+
361
+ console.log(c('cyan', `\n Son ${Math.min(limit, orders.length)} sipariลŸ:`));
362
+ orders.slice(0, limit).forEach((o, i) => {
363
+ console.log(` ${i + 1}. ${o._icon} #${o.orderNumber || o.id} - ${o.totalPrice || 'N/A'} TL`);
364
+ });
365
+ } catch (e) {
366
+ console.log(c('red', ` โŒ Hata: ${e.message}`));
367
+ }
285
368
  break;
286
369
 
287
370
  case 'fiyat':
288
- console.log(c('yellow', '\n ๐Ÿ’ฐ Fiyat gรผncelleme...'));
289
- console.log(c('dim', ` Hedef: ${args.join(' ')}`));
371
+ if (!engine) {
372
+ console.log(c('red', '\n โŒ Engine yรผklenmedi'));
373
+ return;
374
+ }
375
+ const [barcode, priceStr] = args;
376
+ if (!barcode || !priceStr) {
377
+ console.log(c('yellow', ' Kullanฤฑm: /fiyat <barkod> <fiyat>'));
378
+ return;
379
+ }
380
+ console.log(c('yellow', `\n ๐Ÿ’ฐ Fiyat gรผncelleniyor: ${barcode} โ†’ ${priceStr} TL`));
381
+ try {
382
+ const results = await engine.updatePrice(barcode, parseFloat(priceStr));
383
+ for (const [platform, result] of Object.entries(results)) {
384
+ const status = result?.success ? c('green', 'โœ“') : c('red', 'โœ—');
385
+ console.log(` ${status} ${platform}`);
386
+ }
387
+ } catch (e) {
388
+ console.log(c('red', ` โŒ Hata: ${e.message}`));
389
+ }
290
390
  break;
291
391
 
292
- case 'rapor':
293
- console.log(c('yellow', '\n ๐Ÿ“Š Rapor oluลŸturuluyor...'));
294
- const period = args[0] || '7d';
295
- console.log(c('dim', ` Dรถnem: ${period}`));
392
+ case 'test':
393
+ if (!engine) {
394
+ console.log(c('red', '\n โŒ Engine yรผklenmedi'));
395
+ return;
396
+ }
397
+ console.log(c('yellow', '\n ๐Ÿ”Œ BaฤŸlantฤฑlar test ediliyor...'));
398
+ try {
399
+ const results = await engine.testConnections();
400
+ for (const [platform, connected] of Object.entries(results)) {
401
+ const status = connected ? c('green', 'โœ“ BaฤŸlฤฑ') : c('red', 'โœ— BaฤŸlanamadฤฑ');
402
+ console.log(` ${platform}: ${status}`);
403
+ }
404
+ } catch (e) {
405
+ console.log(c('red', ` โŒ Hata: ${e.message}`));
406
+ }
296
407
  break;
297
408
 
298
- case 'platformlar':
299
- console.log(`
300
- ${c('cyan', 'Platform Durumu:')}
301
- ๐ŸŸ  Trendyol: ${env.TRENDYOL_API_KEY ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹ AyarlanmamฤฑลŸ')}
302
- ๐ŸŸฃ Hepsiburada: ${env.HEPSIBURADA_MERCHANT_ID ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹ AyarlanmamฤฑลŸ')}
303
- ๐Ÿ”ต N11: ${env.N11_API_KEY ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹ AyarlanmamฤฑลŸ')}
304
- ๐ŸŸก Amazon: ${env.AMAZON_SELLER_ID ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹ AyarlanmamฤฑลŸ')}
305
- ๐ŸŒธ ร‡iรงeksepeti: ${env.CICEKSEPETI_API_KEY ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹ AyarlanmamฤฑลŸ')}
306
- ๐Ÿ“ฎ PTTavm: ${env.PTTAVM_API_KEY ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹ AyarlanmamฤฑลŸ')}
307
- ๐Ÿ›’ Pazarama: ${env.PAZARAMA_CLIENT_ID ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹ AyarlanmamฤฑลŸ')}
308
- `);
409
+ case 'logs':
410
+ case 'log':
411
+ if (args[0] === 'clear') {
412
+ clearLogs();
413
+ console.log(c('green', '\n โœ“ Loglar temizlendi'));
414
+ } else {
415
+ const lineCount = parseInt(args[0]) || 30;
416
+ console.log(c('cyan', `\n ๐Ÿ“ Son ${lineCount} log:`));
417
+ console.log(c('dim', getLogs(lineCount)));
418
+ }
309
419
  break;
310
420
 
311
- case 'config':
312
- console.log(c('dim', '\n โ†’ Terminalde "vantuz config" yazฤฑn'));
421
+ case 'platformlar':
422
+ if (engine) {
423
+ const status = engine.getStatus();
424
+ console.log(c('cyan', '\n Platform Durumu:'));
425
+ for (const [name, info] of Object.entries(status.platforms)) {
426
+ const connStatus = info.connected ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹');
427
+ console.log(` ${info.icon} ${name}: ${connStatus}`);
428
+ }
429
+ console.log(c('dim', `\n Toplam: ${status.connectedCount}/${status.totalPlatforms} baฤŸlฤฑ`));
430
+ } else {
431
+ console.log(c('dim', ' Engine yรผklenmedi.'));
432
+ }
313
433
  break;
314
434
 
315
435
  case 'cikis':
@@ -324,72 +444,40 @@ async function handleCommand(input, config, env) {
324
444
  }
325
445
  }
326
446
 
327
- async function processChat(input, config, env) {
328
- // Simple NL parsing
329
- const lower = input.toLowerCase();
330
-
331
- if (lower.includes('stok') && (lower.includes('dรผลŸรผk') || lower.includes('az'))) {
332
- return 'DรผลŸรผk stoklu รผrรผnleri kontrol ediyorum... (API baฤŸlantฤฑsฤฑ gerekli)';
333
- }
334
-
335
- if (lower.includes('fiyat') && lower.includes('gรผncelle')) {
336
- return 'Fiyat gรผncellemesi iรงin /fiyat <รผrรผn> <tl> komutunu kullanฤฑn.';
337
- }
338
-
339
- if (lower.includes('sipariลŸ') || lower.includes('order')) {
340
- return 'SipariลŸleri kontrol ediyorum... (API baฤŸlantฤฑsฤฑ gerekli)';
341
- }
342
-
343
- if (lower.includes('rapor')) {
344
- return 'Rapor iรงin /rapor 7d yazabilirsiniz.';
345
- }
346
-
347
- // Default response
348
- if (!hasAnyAIKey(env)) {
349
- return 'AI yanฤฑtฤฑ iรงin API anahtarฤฑ gerekli. "vantuz config" ile ayarlayฤฑn.';
350
- }
351
-
352
- return 'Anladฤฑm! Bu iลŸlem iรงin pazaryeri API baฤŸlantฤฑsฤฑ gerekiyor.';
353
- }
354
-
355
447
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
356
- // STATUS KOMUTU
448
+ // STATUS COMMAND
357
449
  // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
358
450
 
359
451
  async function runStatus() {
360
452
  printHeader();
361
453
 
362
- const config = loadConfig();
363
- const env = loadEnv();
454
+ console.log(c('yellow', ' ๐Ÿ”„ Engine baลŸlatฤฑlฤฑyor...\n'));
364
455
 
365
- console.log(c('cyan', ' ๐Ÿ“Š Sistem Durumu\n'));
456
+ try {
457
+ const engine = await getEngine();
458
+ const status = engine.getStatus();
366
459
 
367
- // AI
368
- const aiProvider = config.aiProvider || 'AyarlanmamฤฑลŸ';
369
- const hasAIKey = hasAnyAIKey(env);
370
- console.log(` AI SaฤŸlayฤฑcฤฑ: ${aiProvider} ${hasAIKey ? c('green', 'โœ“') : c('red', 'โœ—')}`);
460
+ console.log(c('cyan', ' ๐Ÿ“Š Sistem Durumu\n'));
371
461
 
372
- // Platforms
373
- console.log('\n Platformlar:');
374
- const platforms = [
375
- ['Trendyol', 'TRENDYOL_API_KEY'],
376
- ['Hepsiburada', 'HEPSIBURADA_MERCHANT_ID'],
377
- ['N11', 'N11_API_KEY'],
378
- ['Amazon', 'AMAZON_SELLER_ID'],
379
- ['ร‡iรงeksepeti', 'CICEKSEPETI_API_KEY'],
380
- ['PTTavm', 'PTTAVM_API_KEY'],
381
- ['Pazarama', 'PAZARAMA_CLIENT_ID']
382
- ];
462
+ // AI
463
+ console.log(` AI SaฤŸlayฤฑcฤฑ: ${status.aiProvider || 'AyarlanmamฤฑลŸ'} ${hasAnyAIKey(loadEnv()) ? c('green', 'โœ“') : c('red', 'โœ—')}`);
464
+ console.log(` Engine: ${status.engine === 'active' ? c('green', 'โœ“ Aktif') : c('red', 'โœ— Pasif')}`);
465
+ console.log(` รœrรผn Sayฤฑsฤฑ: ${status.productCount}`);
466
+
467
+ // Platforms
468
+ console.log('\n Platformlar:');
469
+ for (const [name, info] of Object.entries(status.platforms)) {
470
+ const connStatus = info.connected ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹');
471
+ console.log(` ${info.icon} ${name}: ${connStatus}`);
472
+ }
383
473
 
384
- let connected = 0;
385
- for (const [name, key] of platforms) {
386
- const status = env[key] ? c('green', 'โœ“ BaฤŸlฤฑ') : c('dim', 'โ—‹');
387
- if (env[key]) connected++;
388
- console.log(` ${name}: ${status}`);
474
+ console.log(`\n Toplam: ${status.connectedCount}/${status.totalPlatforms} platform baฤŸlฤฑ`);
475
+ console.log(c('dim', `\n Config: ${CONFIG_PATH}`));
476
+ } catch (e) {
477
+ console.log(c('red', ` โŒ Engine hatasฤฑ: ${e.message}`));
478
+ console.log(c('dim', ' /logs komutu ile detay gรถrรผn'));
389
479
  }
390
480
 
391
- console.log(`\n Toplam: ${connected}/${platforms.length} platform baฤŸlฤฑ`);
392
- console.log(c('dim', `\n Config: ${CONFIG_PATH}`));
393
481
  console.log();
394
482
  }
395
483