vantuz 3.3.4 β†’ 3.3.5

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 (3) hide show
  1. package/cli.js +169 -169
  2. package/config.js +38 -38
  3. package/package.json +87 -90
package/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  * πŸ™ VANTUZ CLI v3.2
@@ -72,46 +72,46 @@ function saveConfigJson(config) {
72
72
  }
73
73
  }
74
74
 
75
- function clearScreen() {
76
- process.stdout.write('\x1Bc');
77
- }
78
-
79
- async function promptInput(question) {
80
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
81
- const answer = await new Promise(resolve => rl.question(question, resolve));
82
- rl.close();
83
- return answer.trim();
84
- }
85
-
86
- function normalizePhone(input) {
87
- if (!input) return '';
88
- const cleaned = input.replace(/[\s-]/g, '');
89
- return cleaned.startsWith('+') ? cleaned : `+${cleaned}`;
90
- }
91
-
92
- function loadOpenclawConfig(configPath) {
93
- try {
94
- if (fs.existsSync(configPath)) {
95
- return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
96
- }
97
- } catch (e) {
98
- console.log(c('red', `Gateway config okunamadΔ±: ${e.message}`));
99
- }
100
- return {};
101
- }
102
-
103
- function saveOpenclawConfig(configPath, config) {
104
- try {
105
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
106
- return true;
107
- } catch (e) {
108
- console.log(c('red', `Gateway config yazΔ±lamadΔ±: ${e.message}`));
109
- return false;
110
- }
111
- }
112
-
75
+ function clearScreen() {
76
+ process.stdout.write('\x1Bc');
77
+ }
78
+
79
+ async function promptInput(question) {
80
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
81
+ const answer = await new Promise(resolve => rl.question(question, resolve));
82
+ rl.close();
83
+ return answer.trim();
84
+ }
85
+
86
+ function normalizePhone(input) {
87
+ if (!input) return '';
88
+ const cleaned = input.replace(/[\s-]/g, '');
89
+ return cleaned.startsWith('+') ? cleaned : `+${cleaned}`;
90
+ }
91
+
92
+ function loadOpenclawConfig(configPath) {
93
+ try {
94
+ if (fs.existsSync(configPath)) {
95
+ return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
96
+ }
97
+ } catch (e) {
98
+ console.log(c('red', `Gateway config okunamadΔ±: ${e.message}`));
99
+ }
100
+ return {};
101
+ }
102
+
103
+ function saveOpenclawConfig(configPath, config) {
104
+ try {
105
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
106
+ return true;
107
+ } catch (e) {
108
+ console.log(c('red', `Gateway config yazΔ±lamadΔ±: ${e.message}`));
109
+ return false;
110
+ }
111
+ }
112
+
113
113
  function printHeader() {
114
- const version = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url))).version;
114
+ const version = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf-8')).version;
115
115
  console.log(c('cyan', `
116
116
  β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
117
117
  β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ–ˆβ•”β•
@@ -121,7 +121,7 @@ function printHeader() {
121
121
  β•šβ•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•
122
122
  `));
123
123
  console.log(c('magenta', ` Enterprise E-Commerce Management System v${version}`));
124
- console.log(c('dim', ' Powered by Vantuz Gateway'));
124
+ console.log(c('dim', ' Powered by nca'));
125
125
  console.log(c('dim', ' ----------------------------------------------------------\n'));
126
126
  }
127
127
 
@@ -141,7 +141,7 @@ async function showSpinner(text, duration = 1000) {
141
141
  // COMMANDS
142
142
  // ═══════════════════════════════════════════════════════════════════════════
143
143
 
144
- async function runTUI() {
144
+ async function runTUI() {
145
145
  clearScreen();
146
146
  printHeader();
147
147
 
@@ -161,7 +161,7 @@ async function runTUI() {
161
161
 
162
162
  console.log(`${c('green', '●')} Sistem Aktif ${c('dim', `(${status.connectedCount}/${status.totalPlatforms} Platform BağlΔ±)`)}`);
163
163
  console.log(`${c('blue', 'β„Ή')} AI SağlayΔ±cΔ±: ${c('bold', status.aiProvider || 'Gemini')}`);
164
- console.log(`${c('yellow', '⚑')} Komutlar: ${c('cyan', '/stok, /siparis, /rapor, /analiz, /durum, /temizle, /exit')}\n`);
164
+ console.log(`${c('yellow', '⚑')} Komutlar: ${c('cyan', '/stok, /siparis, /rapor, /analiz, /durum, /temizle, /exit')}\n`);
165
165
 
166
166
  const rl = readline.createInterface({
167
167
  input: process.stdin,
@@ -194,42 +194,42 @@ async function runTUI() {
194
194
  console.log(` ${c('cyan', '/temizle')} - EkranΔ± temizler`);
195
195
  console.log(` ${c('cyan', '/exit')} - Γ‡Δ±kış\n`);
196
196
  break;
197
- case '/stok':
198
- console.log(c('dim', 'Stok verileri Γ§ekiliyor...'));
199
- const stocks = await engine.getStock();
200
- if (stocks.length === 0) console.log(c('yellow', 'Bağlı platform bulunamadı.'));
201
- stocks.forEach(s => {
202
- console.log(`\n${s.icon} ${c('bold', s.platform.toUpperCase())}`);
203
- s.products.slice(0, 5).forEach(p => {
204
- console.log(` - ${p.title}: ${c('green', p.stock)} Adet | ${c('yellow', p.price)} TL`);
205
- });
206
- });
207
- break;
208
- case '/analiz':
209
- process.stdout.write(c('dim', 'Analiz hazΔ±rlanΔ±yor... '));
210
- const analysis = await engine.chat('satış ve stok analiz raporu hazırla');
211
- process.stdout.write('\r' + ' '.repeat(30) + '\r');
212
- console.log(`\n${analysis}\n`);
213
- break;
214
- case '/siparis':
215
- console.log(c('dim', 'Siparişler çekiliyor...'));
216
- const orders = await engine.getOrders({ size: 50, allStatuses: true });
217
- const activeOrders = Array.isArray(orders)
218
- ? orders.filter(o => ['Created', 'Picking', 'UnPacked'].includes(String(o.status || o.shipmentPackageStatus || o.orderStatus)))
219
- : [];
220
- const visible = activeOrders.slice(0, 5);
221
- if (!Array.isArray(orders) || visible.length === 0) {
222
- console.log(c('yellow', 'Son sipariş bulunamadı.'));
223
- break;
224
- }
225
- visible.forEach(o => {
226
- const names = Array.isArray(o.lines)
227
- ? o.lines.map(l => l?.productName || l?.name).filter(Boolean)
228
- : [];
229
- const namePart = names.length > 0 ? ` | ${names.join(', ')}` : '';
230
- console.log(`${o._icon} [#${o.orderNumber || o.id}] ${c('bold', o.customerName || 'Müşteri')}: ${c('green', o.totalPrice ?? o.totalAmount ?? o.total ?? 'β€”')} TL (${o._platform})${namePart}`);
231
- });
232
- break;
197
+ case '/stok':
198
+ console.log(c('dim', 'Stok verileri Γ§ekiliyor...'));
199
+ const stocks = await engine.getStock();
200
+ if (stocks.length === 0) console.log(c('yellow', 'Bağlı platform bulunamadı.'));
201
+ stocks.forEach(s => {
202
+ console.log(`\n${s.icon} ${c('bold', s.platform.toUpperCase())}`);
203
+ s.products.slice(0, 5).forEach(p => {
204
+ console.log(` - ${p.title}: ${c('green', p.stock)} Adet | ${c('yellow', p.price)} TL`);
205
+ });
206
+ });
207
+ break;
208
+ case '/analiz':
209
+ process.stdout.write(c('dim', 'Analiz hazΔ±rlanΔ±yor... '));
210
+ const analysis = await engine.chat('satış ve stok analiz raporu hazırla');
211
+ process.stdout.write('\r' + ' '.repeat(30) + '\r');
212
+ console.log(`\n${analysis}\n`);
213
+ break;
214
+ case '/siparis':
215
+ console.log(c('dim', 'Siparişler çekiliyor...'));
216
+ const orders = await engine.getOrders({ size: 50, allStatuses: true });
217
+ const activeOrders = Array.isArray(orders)
218
+ ? orders.filter(o => ['Created', 'Picking', 'UnPacked'].includes(String(o.status || o.shipmentPackageStatus || o.orderStatus)))
219
+ : [];
220
+ const visible = activeOrders.slice(0, 5);
221
+ if (!Array.isArray(orders) || visible.length === 0) {
222
+ console.log(c('yellow', 'Son sipariş bulunamadı.'));
223
+ break;
224
+ }
225
+ visible.forEach(o => {
226
+ const names = Array.isArray(o.lines)
227
+ ? o.lines.map(l => l?.productName || l?.name).filter(Boolean)
228
+ : [];
229
+ const namePart = names.length > 0 ? ` | ${names.join(', ')}` : '';
230
+ console.log(`${o._icon} [#${o.orderNumber || o.id}] ${c('bold', o.customerName || 'Müşteri')}: ${c('green', o.totalPrice ?? o.totalAmount ?? o.total ?? 'β€”')} TL (${o._platform})${namePart}`);
231
+ });
232
+ break;
233
233
  case '/durum':
234
234
  const s = engine.getStatus();
235
235
  console.log(c('yellow', '\n── Sistem Durumu ──'));
@@ -242,12 +242,12 @@ async function runTUI() {
242
242
  default:
243
243
  console.log(c('red', `[HATA] Bilinmeyen komut: ${cmd}. /help yazΔ±n.`));
244
244
  }
245
- } else {
246
- process.stdout.write(c('dim', 'Düşünüyor... '));
247
- const response = await engine.handleMessage(input, { channel: 'local', from: 'local' });
248
- process.stdout.write('\r' + ' '.repeat(20) + '\r');
249
- console.log(`\n${c('cyan', 'πŸ™ Vantuz:')}\n${response}\n`);
250
- }
245
+ } else {
246
+ process.stdout.write(c('dim', 'Düşünüyor... '));
247
+ const response = await engine.handleMessage(input, { channel: 'local', from: 'local' });
248
+ process.stdout.write('\r' + ' '.repeat(20) + '\r');
249
+ console.log(`\n${c('cyan', 'πŸ™ Vantuz:')}\n${response}\n`);
250
+ }
251
251
  } catch (e) {
252
252
  console.log(c('red', `\n[HATA] ${e.message}`));
253
253
  }
@@ -324,7 +324,7 @@ async function runLogs(args) {
324
324
  console.log(getLogs(n));
325
325
  }
326
326
 
327
- async function runGateway(args) {
327
+ async function runGateway(args) {
328
328
  const sub = args[1]?.toLowerCase();
329
329
  const gw = await getGateway();
330
330
  const info = gw.getInfo();
@@ -340,8 +340,8 @@ async function runGateway(args) {
340
340
  console.log('');
341
341
 
342
342
  if (!info.connected) {
343
- console.log(c('dim', ' Gateway başlatmak için: vantuz gateway run'));
344
- console.log(c('dim', ' Veya: start.bat\n'));
343
+ console.log(c('dim', ' Gateway başlatmak için: vantuz gateway run'));
344
+ console.log(c('dim', ' Veya: start.bat\n'));
345
345
  }
346
346
  return;
347
347
  }
@@ -375,18 +375,18 @@ async function runGateway(args) {
375
375
  return;
376
376
  }
377
377
 
378
- if (sub === 'run' || sub === 'start') {
379
- console.log(c('cyan', 'Gateway başlatılıyor...'));
380
- const result = await gw.start();
381
- if (result.success) {
382
- console.log(c('green', 'βœ” Gateway arka planda başlatΔ±ldΔ±.'));
383
- console.log(c('dim', 'BirkaΓ§ saniye iΓ§inde hazΔ±r olacak.'));
384
- console.log(c('dim', 'Kontrol iΓ§in: vantuz gateway status'));
385
- } else {
386
- console.log(c('red', result.error || 'Gateway başlatılamadı'));
387
- }
388
- return;
389
- }
378
+ if (sub === 'run' || sub === 'start') {
379
+ console.log(c('cyan', 'Gateway başlatılıyor...'));
380
+ const result = await gw.start();
381
+ if (result.success) {
382
+ console.log(c('green', 'βœ” Gateway arka planda başlatΔ±ldΔ±.'));
383
+ console.log(c('dim', 'BirkaΓ§ saniye iΓ§inde hazΔ±r olacak.'));
384
+ console.log(c('dim', 'Kontrol iΓ§in: vantuz gateway status'));
385
+ } else {
386
+ console.log(c('red', result.error || 'Gateway başlatılamadı'));
387
+ }
388
+ return;
389
+ }
390
390
 
391
391
  console.log(c('red', 'KullanΔ±m: vantuz gateway [status|health|models|run]'));
392
392
  }
@@ -436,72 +436,72 @@ async function runDoctor() {
436
436
  console.log('');
437
437
  }
438
438
 
439
- async function runChannels(args) {
440
- const sub = args[1]?.toLowerCase();
441
- if (sub === 'login') {
442
- printHeader();
443
- console.log(c('yellow', '── WhatsApp Login ──\n'));
444
-
445
- const openclawDir = path.join(os.homedir(), '.openclaw');
446
- const configPath = path.join(openclawDir, 'openclaw.json');
447
-
448
- if (!fs.existsSync(openclawDir)) {
449
- fs.mkdirSync(openclawDir, { recursive: true });
450
- }
451
-
452
- const rawPhone = await promptInput('WhatsApp numaranΔ±z (E.164, ΓΆrn: +905551112233): ');
453
- const phone = normalizePhone(rawPhone);
454
- if (!phone || phone === '+') {
455
- console.log(c('red', 'GeΓ§erli bir numara girilmedi.'));
456
- process.exitCode = 2;
457
- return;
458
- }
459
-
460
- const config = loadOpenclawConfig(configPath);
461
- if (!config.channels) config.channels = {};
462
- if (!config.channels.whatsapp) config.channels.whatsapp = {};
463
-
464
- if (!config.channels.whatsapp.dmPolicy) {
465
- config.channels.whatsapp.dmPolicy = 'allowlist';
466
- }
467
-
468
- const allowFrom = Array.isArray(config.channels.whatsapp.allowFrom)
469
- ? config.channels.whatsapp.allowFrom
470
- : [];
471
- if (!allowFrom.includes(phone)) {
472
- allowFrom.push(phone);
473
- }
474
- config.channels.whatsapp.allowFrom = allowFrom;
475
-
476
- const saved = saveOpenclawConfig(configPath, config);
477
- if (!saved) {
478
- process.exitCode = 1;
479
- return;
480
- }
481
-
482
- console.log(c('green', 'βœ” Gateway config gΓΌncellendi.'));
483
- console.log(c('dim', 'Şimdi QR için login başlatılıyor...\n'));
484
-
485
- try {
486
- const { spawn } = await import('child_process');
487
- const child = spawn('openclaw', ['channels', 'login'], {
488
- stdio: 'inherit',
489
- shell: true
490
- });
491
- await new Promise((resolve, reject) => {
492
- child.on('exit', code => (code === 0 ? resolve() : reject(new Error(`gateway exit ${code}`))));
493
- child.on('error', reject);
494
- });
495
- console.log(c('green', '\nβœ” QR eşleştirme tamamlandΔ±.'));
496
- console.log(c('dim', 'Gateway başlatmak için: vantuz gateway run'));
497
- } catch (e) {
498
- console.log(c('red', `Login çalıştırılamadı: ${e.message}`));
499
- }
500
- return;
501
- }
502
-
503
- printHeader();
504
- console.log(c('yellow', '── Δ°letişim KanallarΔ± ──\n'));
439
+ async function runChannels(args) {
440
+ const sub = args[1]?.toLowerCase();
441
+ if (sub === 'login') {
442
+ printHeader();
443
+ console.log(c('yellow', '── WhatsApp Login ──\n'));
444
+
445
+ const openclawDir = path.join(os.homedir(), '.openclaw');
446
+ const configPath = path.join(openclawDir, 'openclaw.json');
447
+
448
+ if (!fs.existsSync(openclawDir)) {
449
+ fs.mkdirSync(openclawDir, { recursive: true });
450
+ }
451
+
452
+ const rawPhone = await promptInput('WhatsApp numaranΔ±z (E.164, ΓΆrn: +905551112233): ');
453
+ const phone = normalizePhone(rawPhone);
454
+ if (!phone || phone === '+') {
455
+ console.log(c('red', 'GeΓ§erli bir numara girilmedi.'));
456
+ process.exitCode = 2;
457
+ return;
458
+ }
459
+
460
+ const config = loadOpenclawConfig(configPath);
461
+ if (!config.channels) config.channels = {};
462
+ if (!config.channels.whatsapp) config.channels.whatsapp = {};
463
+
464
+ if (!config.channels.whatsapp.dmPolicy) {
465
+ config.channels.whatsapp.dmPolicy = 'allowlist';
466
+ }
467
+
468
+ const allowFrom = Array.isArray(config.channels.whatsapp.allowFrom)
469
+ ? config.channels.whatsapp.allowFrom
470
+ : [];
471
+ if (!allowFrom.includes(phone)) {
472
+ allowFrom.push(phone);
473
+ }
474
+ config.channels.whatsapp.allowFrom = allowFrom;
475
+
476
+ const saved = saveOpenclawConfig(configPath, config);
477
+ if (!saved) {
478
+ process.exitCode = 1;
479
+ return;
480
+ }
481
+
482
+ console.log(c('green', 'βœ” Gateway config gΓΌncellendi.'));
483
+ console.log(c('dim', 'Şimdi QR için login başlatılıyor...\n'));
484
+
485
+ try {
486
+ const { spawn } = await import('child_process');
487
+ const child = spawn('openclaw', ['channels', 'login'], {
488
+ stdio: 'inherit',
489
+ shell: true
490
+ });
491
+ await new Promise((resolve, reject) => {
492
+ child.on('exit', code => (code === 0 ? resolve() : reject(new Error(`gateway exit ${code}`))));
493
+ child.on('error', reject);
494
+ });
495
+ console.log(c('green', '\nβœ” QR eşleştirme tamamlandΔ±.'));
496
+ console.log(c('dim', 'Gateway başlatmak için: vantuz gateway run'));
497
+ } catch (e) {
498
+ console.log(c('red', `Login çalıştırılamadı: ${e.message}`));
499
+ }
500
+ return;
501
+ }
502
+
503
+ printHeader();
504
+ console.log(c('yellow', '── Δ°letişim KanallarΔ± ──\n'));
505
505
 
506
506
  const engine = await getEngine();
507
507
  const status = engine.getStatus();
@@ -573,9 +573,9 @@ async function main() {
573
573
  console.log(` ${c('cyan', 'vantuz status')} - Durum kontrolΓΌ`);
574
574
  console.log(` ${c('cyan', 'vantuz gateway')} - Gateway yΓΆnetimi`);
575
575
  console.log(` ${c('cyan', 'vantuz doctor')} - Sistem sağlΔ±k kontrolΓΌ`);
576
- console.log(` ${c('cyan', 'vantuz channels')} - İletişim kanalları`);
577
- console.log(` ${c('cyan', 'vantuz channels login')} - WhatsApp QR login`);
578
- console.log(` ${c('cyan', 'vantuz config')} - AyarlarΔ± gΓΆster/gΓΌncelle`);
576
+ console.log(` ${c('cyan', 'vantuz channels')} - İletişim kanalları`);
577
+ console.log(` ${c('cyan', 'vantuz channels login')} - WhatsApp QR login`);
578
+ console.log(` ${c('cyan', 'vantuz config')} - AyarlarΔ± gΓΆster/gΓΌncelle`);
579
579
  console.log(` ${c('cyan', 'vantuz logs')} - LoglarΔ± gΓΆster`);
580
580
  console.log(`\nKurulum ve başlangΔ±Γ§ ayarlarΔ± iΓ§in: ${c('cyan', 'vantuz config init')}`);
581
581
  process.exitCode = command ? 2 : 0;
package/config.js CHANGED
@@ -1,15 +1,15 @@
1
- #!/usr/bin/env node
1
+
2
2
 
3
3
  /**
4
4
  * VANTUZ - Profesyonel Kurulum SihirbazΔ±
5
- * v3.2.7 - Gateway Entegrasyonlu
5
+ * v3.2.7 - Gateway Entegrasyonlu
6
6
  */
7
7
 
8
8
  import fs from 'fs';
9
9
  import path from 'path';
10
10
  import os from 'os';
11
11
  import readline from 'readline';
12
- import { fileURLToPath, pathToFileURL } from 'url';
12
+ import { fileURLToPath, pathToFileURL } from 'url';
13
13
  import { PROVIDER_CONFIG } from './core/ai-provider.js'; // Import PROVIDER_CONFIG
14
14
 
15
15
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -23,7 +23,7 @@ const colors = {
23
23
  dim: '\x1b[2m',
24
24
  italic: '\x1b[3m',
25
25
  underscore: '\x1b[4m',
26
-
26
+
27
27
  // Foreground colors
28
28
  black: '\x1b[30m',
29
29
  red: '\x1b[31m',
@@ -33,7 +33,7 @@ const colors = {
33
33
  magenta: '\x1b[35m',
34
34
  cyan: '\x1b[36m',
35
35
  white: '\x1b[37m',
36
-
36
+
37
37
  // Bright foreground colors
38
38
  brightBlack: '\x1b[90m',
39
39
  brightRed: '\x1b[91m',
@@ -43,7 +43,7 @@ const colors = {
43
43
  brightMagenta: '\x1b[95m',
44
44
  brightCyan: '\x1b[96m',
45
45
  brightWhite: '\x1b[97m',
46
-
46
+
47
47
  // Background colors
48
48
  bgBlack: '\x1b[40m',
49
49
  bgRed: '\x1b[41m',
@@ -85,21 +85,21 @@ ${colors.brightCyan} Enterprise E-Ticaret YΓΆnetimi${colors.reset}
85
85
  const createBox = (title, content, width = 65) => {
86
86
  const lines = content.split('\n');
87
87
  let result = '';
88
-
88
+
89
89
  // Top border with title
90
90
  result += c('brightCyan', box.topLeft + box.horizontal.repeat(3));
91
91
  result += c('bold', ` ${title} `);
92
92
  result += c('brightCyan', box.horizontal.repeat(width - title.length - 5) + box.topRight) + '\n';
93
-
93
+
94
94
  // Content
95
95
  lines.forEach(line => {
96
96
  const padding = ' '.repeat(Math.max(0, width - line.length - 2));
97
97
  result += c('brightCyan', box.vertical) + ' ' + line + padding + ' ' + c('brightCyan', box.vertical) + '\n';
98
98
  });
99
-
99
+
100
100
  // Bottom border
101
101
  result += c('brightCyan', box.bottomLeft + box.horizontal.repeat(width) + box.bottomRight) + '\n';
102
-
102
+
103
103
  return result;
104
104
  };
105
105
 
@@ -109,7 +109,7 @@ const WELCOME_BOX = createBox('HOŞ GELDİNİZ', `
109
109
  ${c('brightGreen', 'βœ“')} AI Servis SeΓ§imi
110
110
  ${c('brightGreen', 'βœ“')} Pazaryeri BağlantΔ±larΔ±
111
111
  ${c('brightGreen', 'βœ“')} Δ°letişim KanallarΔ±
112
- ${c('brightGreen', 'βœ“')} Gateway YapΔ±landΔ±rmasΔ±
112
+ ${c('brightGreen', 'βœ“')} Gateway YapΔ±landΔ±rmasΔ±
113
113
  `);
114
114
 
115
115
  class Configurator {
@@ -125,17 +125,17 @@ class Configurator {
125
125
  }
126
126
 
127
127
  async _loadPlatformMetadata() {
128
- const platformFiles = await fs.promises.readdir(path.join(__dirname, 'platforms'));
129
- const dynamicPlatforms = [];
130
-
131
- for (const file of platformFiles) {
132
- if (file.endsWith('.js') && !file.startsWith('_')) { // Exclude helper files
133
- const platformPath = path.join(__dirname, 'platforms', file);
134
- try {
135
- // Dynamic import for ES Modules
136
- const platformModule = await import(pathToFileURL(platformPath).href);
128
+ const platformFiles = await fs.promises.readdir(path.join(__dirname, 'platforms'));
129
+ const dynamicPlatforms = [];
130
+
131
+ for (const file of platformFiles) {
132
+ if (file.endsWith('.js') && !file.startsWith('_')) { // Exclude helper files
133
+ const platformPath = path.join(__dirname, 'platforms', file);
134
+ try {
135
+ // Dynamic import for ES Modules
136
+ const platformModule = await import(pathToFileURL(platformPath).href);
137
137
  // Check if module.exports is present (CommonJS) or default export (ESM)
138
- const platform = platformModule.default || platformModule;
138
+ const platform = platformModule.default || platformModule;
139
139
 
140
140
  if (platform.name && platform.requiredFields) {
141
141
  dynamicPlatforms.push({
@@ -170,7 +170,7 @@ class Configurator {
170
170
  }
171
171
  return env;
172
172
  }
173
-
173
+
174
174
  async step_EIAConfig() {
175
175
  this.printHeader('E-TΔ°CARET YΓ–NETΔ°M AJANSI (EIA) YAPILANDIRMASI', 'πŸ“Š');
176
176
 
@@ -178,11 +178,11 @@ class Configurator {
178
178
  console.log(this.infoMessage('Bu bilgiler, EIA\'nΔ±n pazar analizi ve stratejik kararlarΔ±nda kullanΔ±lacaktΔ±r.'));
179
179
 
180
180
  await sleep(200);
181
-
181
+
182
182
  const currentCompetitorUrls = this.envVars.EIA_COMPETITOR_URLS || '';
183
183
  console.log(this.createInputBox('Rakip ÜrΓΌn URL\'leri', 'VirgΓΌlle ayΔ±rarak birden fazla rakip ΓΌrΓΌn veya kategori URL\'si girebilirsiniz. (Γ–rn: https://rakip.com/urun1, https://rakip.com/kategori)'));
184
184
  const competitorUrls = await this.prompt('', currentCompetitorUrls);
185
-
185
+
186
186
  // Basic validation for URLs
187
187
  const urls = competitorUrls.split(',').map(url => url.trim()).filter(url => url !== '');
188
188
  const invalidUrls = urls.filter(url => url && (!url.startsWith('http://') && !url.startsWith('https://')));
@@ -212,7 +212,7 @@ class Configurator {
212
212
  const currentProfitMargin = this.envVars.EIA_TARGET_PROFIT_MARGIN ? String(this.envVars.EIA_TARGET_PROFIT_MARGIN) : '15';
213
213
  console.log(this.createInputBox('Hedef Kar MarjΔ± (%)', 'ÜrΓΌnleriniz iΓ§in ulaşmak istediğiniz ortalama kar marjΔ± hedefi. (Γ–rnek: 15)'));
214
214
  const profitMargin = await this.prompt('', currentProfitMargin);
215
-
215
+
216
216
  if (profitMargin && !isNaN(parseFloat(profitMargin)) && parseFloat(profitMargin) >= 0) {
217
217
  this.envVars.EIA_TARGET_PROFIT_MARGIN = parseFloat(profitMargin);
218
218
  console.log(this.successMessage('Hedef Kar MarjΔ± kaydedildi/gΓΌncellendi. EIA, fiyatlandΔ±rma ΓΆnerilerinde bu marjΔ± dikkate alacaktΔ±r.'));
@@ -265,9 +265,9 @@ class Configurator {
265
265
 
266
266
  while (true) {
267
267
  this.printHeader('VANTUZ YAPILANDIRMA MENÜSÜ', 'βš™οΈ');
268
-
268
+
269
269
  console.log(c('brightWhite', 'LΓΌtfen yapΔ±landΔ±rmak istediğiniz alanΔ± seΓ§in:\n'));
270
-
270
+
271
271
  console.log(this.menuItem('1', 'πŸ€– Yapay Zeka Servisi', 'AI Provider'));
272
272
  console.log(this.menuItem('2', 'πŸ›’ Pazaryeri EntegrasyonlarΔ±', 'Platforms'));
273
273
  console.log(this.menuItem('3', 'πŸ’¬ Δ°letişim KanallarΔ±', 'Channels'));
@@ -334,7 +334,7 @@ class Configurator {
334
334
  const keyStyle = style === 'dim' ? 'dim' : 'brightYellow';
335
335
  const titleStyle = style === 'dim' ? 'dim' : 'brightWhite';
336
336
  const subtitleStyle = 'dim';
337
-
337
+
338
338
  let line = ` ${c(keyStyle, c('bold', key))}. ${c(titleStyle, title)}`;
339
339
  if (subtitle) {
340
340
  line += ` ${c(subtitleStyle, `(${subtitle})`)}`;
@@ -404,7 +404,7 @@ class Configurator {
404
404
  }
405
405
  }
406
406
  if (!currentAIChoice && this.envVars.GEMINI_API_KEY) { // Fallback to Gemini if no other is set but Gemini is.
407
- currentAIChoice = providerOptions.find(opt => opt.envKey === 'GEMINI_API_KEY')?.choice || '';
407
+ currentAIChoice = providerOptions.find(opt => opt.envKey === 'GEMINI_API_KEY')?.choice || '';
408
408
  }
409
409
  if (!currentAIChoice) currentAIChoice = '1'; // Default to first option if nothing is set
410
410
 
@@ -455,7 +455,7 @@ class Configurator {
455
455
  this.printHeader('PAZARYERΔ° ENTEGRASYONLARI', 'πŸ›’');
456
456
 
457
457
  console.log(c('brightWhite', 'Hangi pazaryerini yapΔ±landΔ±rmak istersiniz?\n'));
458
-
458
+
459
459
  // Dynamically generate menu items from this.platforms
460
460
  this.platforms.forEach((platform, index) => {
461
461
  console.log(this.menuItem(String(index + 1), `${platform.icon} ${platform.name}`, platform.description));
@@ -481,7 +481,7 @@ class Configurator {
481
481
 
482
482
  console.log(this.successMessage(`${selectedPlatform.icon} ${selectedPlatform.name} seΓ§ildi`));
483
483
  console.log(c('dim', 'Mevcut değerleri değiştirmek iΓ§in yeni değer girin veya boş bΔ±rakΔ±n\n'));
484
-
484
+
485
485
  let allFieldsProvided = true;
486
486
  for (const field of selectedPlatform.requiredFields) {
487
487
  const currentVal = this.envVars[field.env] || '';
@@ -555,8 +555,8 @@ class Configurator {
555
555
  await sleep(1000);
556
556
  } else if (choice === '2') { // Information about WhatsApp
557
557
  this.printHeader('WhatsApp Kurulum Bilgisi', 'πŸ’¬');
558
- console.log(this.infoMessage('WhatsApp entegrasyonu Vantuz Gateway üzerinden sağlanır.'));
559
- console.log(c('brightWhite', 'Gateway\'inizi yapılandırdıktan ve başlattıktan sonra, Gateway arayüzünden WhatsApp kanalını etkinleştirebilirsiniz.\n'));
558
+ console.log(this.infoMessage('WhatsApp entegrasyonu Vantuz Gateway üzerinden sağlanır.'));
559
+ console.log(c('brightWhite', 'Gateway\'inizi yapılandırdıktan ve başlattıktan sonra, Gateway arayüzünden WhatsApp kanalını etkinleştirebilirsiniz.\n'));
560
560
  console.log(c('dim', ' Gateway durumunu kontrol etmek iΓ§in: ') + c('brightCyan', 'vantuz gateway status'));
561
561
  console.log(c('dim', ' Gateway\'i başlatmak iΓ§in: ') + c('brightCyan', 'start.bat') + '\n');
562
562
  await this.prompt(c('dim', 'β–Ά Devam etmek iΓ§in Enter\'a basΔ±n...'));
@@ -590,7 +590,7 @@ class Configurator {
590
590
  console.log(` URL: ${c('cyan', info.url)}`);
591
591
  console.log(` Durum: ${info.connected ? c('brightGreen', '● BağlΔ±') : c('brightRed', 'β—‹ BağlΔ± Değil')}`);
592
592
  console.log(` Token: ${info.hasToken ? c('brightGreen', 'βœ” YapΔ±landΔ±rΔ±lmış') : c('brightRed', '✘ Eksik/GeΓ§ersiz')}`);
593
- console.log(` Config: ${info.configFound ? c('brightGreen', 'βœ” Bulundu (gateway config)') : c('brightRed', '✘ BulunamadΔ± (gateway config)')}`);
593
+ console.log(` Config: ${info.configFound ? c('brightGreen', 'βœ” Bulundu (gateway config)') : c('brightRed', '✘ BulunamadΔ± (gateway config)')}`);
594
594
  if (info.version) console.log(` SΓΌrΓΌm: ${c('dim', info.version)}`);
595
595
  console.log('');
596
596
 
@@ -640,16 +640,16 @@ class Configurator {
640
640
  async showSuccess() {
641
641
  this.clear();
642
642
  console.log('\n');
643
-
643
+
644
644
  const successBox = `
645
645
  ${colors.brightGreen}${box.topLeft}${box.horizontal.repeat(63)}${box.topRight}
646
646
  ${box.vertical}${' '.repeat(17)}KURULUM BAŞARIYLA TAMAMLANDI${' '.repeat(17)}${box.vertical}
647
647
  ${box.bottomLeft}${box.horizontal.repeat(63)}${box.bottomRight}${colors.reset}
648
648
  `;
649
-
649
+
650
650
  console.log(successBox);
651
651
  console.log(c('brightWhite', '\nVantuz AI kullanΔ±ma hazΔ±rdΔ±r! πŸŽ‰\n'));
652
-
652
+
653
653
  console.log(c('bold', 'Başlamak iΓ§in şu komutlarΔ± kullanabilirsiniz:\n'));
654
654
  console.log(c('brightCyan', ' vantuz tui') + c('dim', ' - Sohbet arayΓΌzΓΌnΓΌ başlatΔ±r'));
655
655
  console.log(c('brightCyan', ' vantuz status') + c('dim', ' - Sistem durumunu gΓΆsterir'));
@@ -683,4 +683,4 @@ ${box.bottomLeft}${box.horizontal.repeat(63)}${box.bottomRight}${colors.reset}
683
683
  }
684
684
  }
685
685
 
686
- export { Configurator };
686
+ export { Configurator };
package/package.json CHANGED
@@ -1,91 +1,88 @@
1
- ο»Ώ{
2
- "name": "vantuz",
3
- "version": "3.3.4",
4
- "description": "Yapay Zeka Destekli E-Ticaret YΓΆnetim Platformu - 7 Pazaryeri + WhatsApp/Telegram",
5
- "type": "module",
6
- "main": "cli.js",
7
- "bin": {
8
- "vantuz": "cli.js",
9
- "vantuz-onboard": "onboard.js"
10
- },
11
- "scripts": {
12
- "start": "node cli.js tui",
13
- "tui": "node cli.js tui",
14
- "config": "node cli.js config",
15
- "status": "node cli.js status",
16
- "postinstall": "echo \u0027Vantuz kuruldu! Baslatmak icin: npx vantuz-onboard\u0027",
17
- "test": "node --test",
18
- "lint": "eslint plugins/"
19
- },
20
- "keywords": [
21
- "ecommerce",
22
- "e-ticaret",
23
- "trendyol",
24
- "hepsiburada",
25
- "amazon",
26
- "n11",
27
- "ciceksepeti",
28
- "pttavm",
29
- "pazarama",
30
- "marketplace",
31
- "pazaryeri",
32
- "ai",
33
- "yapay-zeka",
34
- "repricer",
35
- "fiyatlama",
36
- "whatsapp",
37
- "telegram",
38
- "enterprise",
39
- "gateway",
40
- "management",
41
- "cli"
42
- ],
43
- "author": "Vantuz",
44
- "license": "SEE LICENSE IN LICENSE",
45
- "repository": {
46
- "type": "git",
47
- "url": "git+https://github.com/cokdalazimdegil/vantuz.git"
48
- },
49
- "homepage": "https://nuricanavsar.com/public/vantuz",
50
- "bugs": {
51
- "url": "https://github.com/cokdalazimdegil/vantuz/issues"
52
- },
53
- "dependencies": {
54
- "axios": "^1.13.5",
55
- "cors": "^2.8.6",
56
- "cron": "^4.4.0",
57
- "dotenv": "^16.0.0",
58
- "express": "^5.2.1",
59
- "openclaw": "^0.0.1",
60
- "playwright": "^1.58.2",
61
- "sqlite": "^5.1.1",
62
- "sqlite3": "^5.0.2",
63
- "xml2js": "^0.6.2"
64
- },
65
- "devDependencies": {
66
- "eslint": "^8.0.0"
67
- },
68
- "os": [
69
- "darwin",
70
- "linux",
71
- "win32"
72
- ],
73
- "engines": {
74
- "node": "\u003e=18.0.0"
75
- },
76
- "files": [
77
- "cli.js",
78
- "onboard.js",
1
+ {
2
+ "name": "vantuz",
3
+ "version": "3.3.5",
4
+ "description": "Yapay Zeka Destekli E-Ticaret YΓΆnetim Platformu - 7 Pazaryeri + WhatsApp/Telegram",
5
+ "type": "module",
6
+ "main": "cli.js",
7
+ "bin": {
8
+ "vantuz": "cli.js",
9
+ "vantuz-onboard": "onboard.js"
10
+ },
11
+ "scripts": {
12
+ "start": "node cli.js tui",
13
+ "tui": "node cli.js tui",
14
+ "config": "node cli.js config",
15
+ "status": "node cli.js status",
16
+ "postinstall": "echo \u0027Vantuz kuruldu! Baslatmak icin: npx vantuz-onboard\u0027",
17
+ "test": "node --test",
18
+ "lint": "eslint plugins/"
19
+ },
20
+ "keywords": [
21
+ "ecommerce",
22
+ "e-ticaret",
23
+ "trendyol",
24
+ "hepsiburada",
25
+ "amazon",
26
+ "n11",
27
+ "ciceksepeti",
28
+ "pttavm",
29
+ "pazarama",
30
+ "marketplace",
31
+ "pazaryeri",
32
+ "ai",
33
+ "yapay-zeka",
34
+ "repricer",
35
+ "fiyatlama",
36
+ "whatsapp",
37
+ "telegram",
38
+ "enterprise",
39
+ "gateway",
40
+ "management",
41
+ "cli"
42
+ ],
43
+ "author": "Vantuz",
44
+ "license": "SEE LICENSE IN LICENSE",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/cokdalazimdegil/vantuz.git"
48
+ },
49
+ "homepage": "https://nuricanavsar.com/public/vantuz",
50
+ "bugs": {
51
+ "url": "https://github.com/cokdalazimdegil/vantuz/issues"
52
+ },
53
+ "dependencies": {
54
+ "axios": "^1.13.5",
55
+ "cors": "^2.8.6",
56
+ "cron": "^4.4.0",
57
+ "dotenv": "^16.0.0",
58
+ "express": "^5.2.1",
59
+ "openclaw": "^0.0.1",
60
+ "playwright": "^1.58.2",
61
+ "sqlite": "^5.1.1",
62
+ "sqlite3": "^5.0.2",
63
+ "xml2js": "^0.6.2"
64
+ },
65
+ "devDependencies": {
66
+ "eslint": "^8.0.0"
67
+ },
68
+ "os": [
69
+ "darwin",
70
+ "linux",
71
+ "win32"
72
+ ],
73
+ "engines": {
74
+ "node": "\u003e=18.0.0"
75
+ },
76
+ "files": [
77
+ "cli.js",
78
+ "onboard.js",
79
79
  "config.js",
80
- "core",
81
- "server",
82
- "platforms",
83
- "plugins",
84
- "start.bat",
85
- "LICENSE",
86
- "README.md"
87
- ]
88
- }
89
-
90
-
91
-
80
+ "core",
81
+ "server",
82
+ "platforms",
83
+ "plugins",
84
+ "start.bat",
85
+ "LICENSE",
86
+ "README.md"
87
+ ]
88
+ }