vantuz 3.2.5 β†’ 3.2.6

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,13 +1,22 @@
1
1
  #!/usr/bin/env node
2
+
3
+ /**
4
+ * πŸ™ VANTUZ CLI v3.2
5
+ * Vantuz Gateway entegrasyonlu komut satΔ±rΔ± arayΓΌzΓΌ
6
+ */
7
+
2
8
  import path from 'path';
3
9
  import os from 'os';
4
10
  import fs from 'fs';
5
11
  import readline from 'readline';
6
12
  import { log, getLogs, clearLogs } from './core/ai-provider.js';
7
13
  import { getEngine } from './core/engine.js';
8
- import { LicenseManager } from './plugins/vantuz/services/license.js';
14
+ import { getGateway } from './core/gateway.js';
9
15
 
16
+ // ═══════════════════════════════════════════════════════════════════════════
10
17
  // CONFIG
18
+ // ═══════════════════════════════════════════════════════════════════════════
19
+
11
20
  const VANTUZ_HOME = path.join(os.homedir(), '.vantuz');
12
21
  const CONFIG_PATH = path.join(VANTUZ_HOME, '.env');
13
22
  const CONFIG_JSON = path.join(VANTUZ_HOME, 'config.json');
@@ -16,22 +25,17 @@ if (!fs.existsSync(VANTUZ_HOME)) {
16
25
  fs.mkdirSync(VANTUZ_HOME, { recursive: true });
17
26
  }
18
27
 
19
- // Helpers
28
+ // ═══════════════════════════════════════════════════════════════════════════
29
+ // HELPERS
30
+ // ═══════════════════════════════════════════════════════════════════════════
31
+
20
32
  const colors = {
21
33
  reset: '\x1b[0m', bold: '\x1b[1m', dim: '\x1b[2m',
22
- red: '\x1b[31m', green: '\x1b[32m', yellow: '\x1b[33m', cyan: '\x1b[36m'
34
+ red: '\x1b[31m', green: '\x1b[32m', yellow: '\x1b[33m',
35
+ cyan: '\x1b[36m', blue: '\x1b[34m', magenta: '\x1b[35m'
23
36
  };
24
37
  const c = (color, text) => `${colors[color]}${text}${colors.reset}`;
25
38
 
26
- function clearScreen() { console.clear(); }
27
-
28
- function printHeader() {
29
- console.log(c('cyan', `
30
- VANTUZ AI v3.2.2 - Enterprise E-Ticaret
31
- ---------------------------------------
32
- `));
33
- }
34
-
35
39
  function loadEnv() {
36
40
  const env = {};
37
41
  try {
@@ -46,94 +50,420 @@ function loadEnv() {
46
50
  return env;
47
51
  }
48
52
 
49
- // License Check
50
- async function checkLicense() {
51
- const env = loadEnv();
52
- if (!env.VANTUZ_LICENSE_KEY) return false;
53
+ function loadConfigJson() {
54
+ try {
55
+ if (fs.existsSync(CONFIG_JSON)) {
56
+ return JSON.parse(fs.readFileSync(CONFIG_JSON, 'utf-8'));
57
+ }
58
+ } catch (e) {
59
+ console.log(c('red', `Config okunamadΔ±: ${e.message}`));
60
+ }
61
+ return {};
62
+ }
53
63
 
54
- const manager = new LicenseManager();
55
- const result = await manager.initialize();
56
- return result.success;
64
+ function saveConfigJson(config) {
65
+ try {
66
+ fs.writeFileSync(CONFIG_JSON, JSON.stringify(config, null, 2));
67
+ return true;
68
+ } catch (e) {
69
+ console.log(c('red', `Config yazΔ±lamadΔ±: ${e.message}`));
70
+ return false;
71
+ }
72
+ }
73
+
74
+ function clearScreen() {
75
+ process.stdout.write('\x1Bc');
76
+ }
77
+
78
+ function printHeader() {
79
+ const version = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url))).version;
80
+ console.log(c('cyan', `
81
+ β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
82
+ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ–ˆβ•”β•
83
+ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•”β•
84
+ β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•”β•
85
+ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
86
+ β•šβ•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•
87
+ `));
88
+ console.log(c('magenta', ` Enterprise E-Commerce Management System v${version}`));
89
+ console.log(c('dim', ' Powered by Vantuz AI Gateway'));
90
+ console.log(c('dim', ' ----------------------------------------------------------\n'));
57
91
  }
58
92
 
59
- // Commands
93
+ async function showSpinner(text, duration = 1000) {
94
+ const frames = ['β ‹', 'β ™', 'β Ή', 'β Έ', 'β Ό', 'β ΄', 'β ¦', 'β §', 'β ‡', '⠏'];
95
+ let i = 0;
96
+ const interval = setInterval(() => {
97
+ process.stdout.write(`\r${c('cyan', frames[i])} ${text}...`);
98
+ i = (i + 1) % frames.length;
99
+ }, 80);
100
+ await new Promise(r => setTimeout(r, duration));
101
+ clearInterval(interval);
102
+ process.stdout.write(`\r${c('green', 'βœ”')} ${text} TamamlandΔ±\n`);
103
+ }
104
+
105
+ // ═══════════════════════════════════════════════════════════════════════════
106
+ // COMMANDS
107
+ // ═══════════════════════════════════════════════════════════════════════════
108
+
60
109
  async function runTUI() {
61
110
  clearScreen();
62
111
  printHeader();
63
112
 
64
- // License check disabled for Dev Mode
65
- // const hasLicense = await checkLicense();
66
- // if (!hasLicense) {
67
- // console.log(c('red', '[HATA] GeΓ§erli lisans bulunamadΔ±.'));
68
- // console.log('LΓΌtfen ΓΆnce kurulumu tamamlayΔ±n:\n');
69
- // console.log(' vantuz-onboard\n');
70
- // process.exit(1);
71
- // }
72
-
73
- console.log('Sistem başlatılıyor...\n');
74
- // ... (TUI init simplified for brevity, engine logic assumes valid license)
113
+ await showSpinner('Sistem çekirdeği yükleniyor', 500);
114
+ await showSpinner('Vantuz Gateway kontrol ediliyor', 400);
115
+ await showSpinner('Pazaryeri bağlantıları kontrol ediliyor', 800);
75
116
 
76
117
  const engine = await getEngine();
77
- console.log(c('green', '[OK] Sistem Aktif (Dev Mode)\n'));
78
- console.log('Komutlar: /help, /stok, /siparis, /exit\n');
118
+ const status = engine.getStatus();
119
+
120
+ // Gateway durumu
121
+ if (status.gateway?.connected) {
122
+ console.log(`${c('green', '●')} Vantuz Gateway ${c('green', 'BağlΔ±')} ${c('dim', `(${status.gateway.url})`)}`);
123
+ } else {
124
+ console.log(`${c('yellow', 'β—‹')} Vantuz Gateway ${c('yellow', 'BağlΔ± Değil')} ${c('dim', '(direkt mod)')}`);
125
+ }
79
126
 
80
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
81
- const prompt = () => rl.question(c('cyan', 'Vantuz> '), async (line) => {
127
+ console.log(`${c('green', '●')} Sistem Aktif ${c('dim', `(${status.connectedCount}/${status.totalPlatforms} Platform BağlΔ±)`)}`);
128
+ console.log(`${c('blue', 'β„Ή')} AI SağlayΔ±cΔ±: ${c('bold', status.aiProvider || 'Gemini')}`);
129
+ console.log(`${c('yellow', '⚑')} Komutlar: ${c('cyan', '/stok, /siparis, /rapor, /analiz, /durum, /temizle, /exit')}\n`);
130
+
131
+ const rl = readline.createInterface({
132
+ input: process.stdin,
133
+ output: process.stdout,
134
+ prompt: c('magenta', 'Vantuz> ')
135
+ });
136
+
137
+ rl.prompt();
138
+
139
+ rl.on('line', async (line) => {
82
140
  const input = line.trim();
83
141
  if (input === '/exit') process.exit(0);
142
+ if (input === '/temizle') {
143
+ clearScreen();
144
+ printHeader();
145
+ rl.prompt();
146
+ return;
147
+ }
84
148
 
85
149
  if (input) {
86
150
  try {
87
151
  if (input.startsWith('/')) {
88
- // Simple command handling
89
- if (input === '/stok') console.log('[Bilgi] Stok modΓΌlΓΌ yΓΌkleniyor...');
90
- else if (input === '/help') console.log('Mevcut komutlar: /stok, /siparis, /exit');
91
- else console.log('[HATA] Bilinmeyen komut');
152
+ const [cmd, ...cmdArgs] = input.split(' ');
153
+ switch (cmd) {
154
+ case '/help':
155
+ console.log(c('yellow', '\nKullanΔ±labilir Komutlar:'));
156
+ console.log(` ${c('cyan', '/stok')} - TΓΌm pazaryerlerindeki stok durumunu gΓΆsterir`);
157
+ console.log(` ${c('cyan', '/siparis')} - Son siparişleri listeler`);
158
+ console.log(` ${c('cyan', '/durum')} - Sistem durumunu gΓΆsterir`);
159
+ console.log(` ${c('cyan', '/temizle')} - EkranΔ± temizler`);
160
+ console.log(` ${c('cyan', '/exit')} - Γ‡Δ±kış\n`);
161
+ break;
162
+ case '/stok':
163
+ console.log(c('dim', 'Stok verileri Γ§ekiliyor...'));
164
+ const stocks = await engine.getStock();
165
+ if (stocks.length === 0) console.log(c('yellow', 'Bağlı platform bulunamadı.'));
166
+ stocks.forEach(s => {
167
+ console.log(`\n${s.icon} ${c('bold', s.platform.toUpperCase())}`);
168
+ s.products.slice(0, 5).forEach(p => {
169
+ console.log(` - ${p.title}: ${c('green', p.stock)} Adet | ${c('yellow', p.price)} TL`);
170
+ });
171
+ });
172
+ break;
173
+ case '/siparis':
174
+ console.log(c('dim', 'Siparişler çekiliyor...'));
175
+ const orders = await engine.getOrders({ size: 5 });
176
+ if (orders.length === 0) console.log(c('yellow', 'Son sipariş bulunamadı.'));
177
+ orders.forEach(o => {
178
+ console.log(`${o._icon} [#${o.orderNumber || o.id}] ${c('bold', o.customerName || 'Müşteri')}: ${c('green', o.totalPrice || o.total)} TL (${o._platform})`);
179
+ });
180
+ break;
181
+ case '/durum':
182
+ const s = engine.getStatus();
183
+ console.log(c('yellow', '\n── Sistem Durumu ──'));
184
+ console.log(` Engine: ${s.engine === 'active' ? c('green', '● Aktif') : c('red', 'β—‹ Pasif')}`);
185
+ console.log(` Gateway: ${s.gateway?.connected ? c('green', '● BağlΔ±') : c('yellow', 'β—‹ BağlΔ± Değil')}`);
186
+ console.log(` AI: ${c('cyan', s.aiProvider || 'gemini')}`);
187
+ console.log(` Platformlar: ${c('bold', `${s.connectedCount}/${s.totalPlatforms}`)}`);
188
+ console.log('');
189
+ break;
190
+ default:
191
+ console.log(c('red', `[HATA] Bilinmeyen komut: ${cmd}. /help yazΔ±n.`));
192
+ }
92
193
  } else {
194
+ process.stdout.write(c('dim', 'Düşünüyor... '));
93
195
  const response = await engine.chat(input);
94
- console.log('\n' + response + '\n');
196
+ process.stdout.write('\r' + ' '.repeat(20) + '\r');
197
+ console.log(`\n${c('cyan', 'πŸ™ Vantuz:')}\n${response}\n`);
95
198
  }
96
199
  } catch (e) {
97
- console.log(c('red', `Hata: ${e.message}`));
200
+ console.log(c('red', `\n[HATA] ${e.message}`));
98
201
  }
99
202
  }
100
- prompt();
203
+ rl.prompt();
101
204
  });
102
- prompt();
103
205
  }
104
206
 
105
- // Main
207
+ async function runConfig(args) {
208
+ const sub = args[1]?.toLowerCase();
209
+ const config = loadConfigJson();
210
+
211
+ if (!sub || sub === 'get') {
212
+ printHeader();
213
+ if (sub === 'get' && args[2]) {
214
+ const key = args[2];
215
+ const value = config?.[key];
216
+ console.log(value === undefined ? '' : String(value));
217
+ return;
218
+ }
219
+ console.log(JSON.stringify(config, null, 2));
220
+ return;
221
+ }
222
+
223
+ if (sub === 'set') {
224
+ const key = args[2];
225
+ const value = args.slice(3).join(' ');
226
+ if (!key) {
227
+ console.log(c('red', 'KullanΔ±m: vantuz config set <key> <value>'));
228
+ process.exitCode = 2;
229
+ return;
230
+ }
231
+ config[key] = value;
232
+ const ok = saveConfigJson(config);
233
+ if (ok) {
234
+ console.log(c('green', '[OK] Config gΓΌncellendi'));
235
+ } else {
236
+ process.exitCode = 1;
237
+ }
238
+ return;
239
+ }
240
+
241
+ console.log(c('red', 'GeΓ§ersiz config komutu. KullanΔ±m: vantuz config [get [key] | set <key> <value>]'));
242
+ process.exitCode = 2;
243
+ }
244
+
245
+ async function runLogs(args) {
246
+ const sub = args[1]?.toLowerCase();
247
+ if (sub === 'clear' || sub === 'temizle') {
248
+ const ok = clearLogs();
249
+ if (ok) console.log(c('green', '[OK] Loglar temizlendi'));
250
+ else {
251
+ console.log(c('red', '[HATA] Loglar temizlenemedi'));
252
+ process.exitCode = 1;
253
+ }
254
+ return;
255
+ }
256
+
257
+ const nRaw = args[1];
258
+ const n = nRaw && /^\d+$/.test(nRaw) ? Number(nRaw) : 50;
259
+ printHeader();
260
+ console.log(getLogs(n));
261
+ }
262
+
263
+ async function runGateway(args) {
264
+ const sub = args[1]?.toLowerCase();
265
+ const gw = await getGateway();
266
+ const info = gw.getInfo();
267
+
268
+ if (!sub || sub === 'status') {
269
+ printHeader();
270
+ console.log(c('yellow', '── Vantuz Gateway ──\n'));
271
+ console.log(` URL: ${c('cyan', info.url)}`);
272
+ console.log(` Durum: ${info.connected ? c('green', '● BağlΔ±') : c('red', 'β—‹ BağlΔ± Değil')}`);
273
+ console.log(` Token: ${info.hasToken ? c('green', 'βœ” YapΔ±landΔ±rΔ±lmış') : c('yellow', '✘ Eksik')}`);
274
+ console.log(` Config: ${info.configFound ? c('green', 'βœ” Bulundu') : c('yellow', '✘ BulunamadΔ±')}`);
275
+ if (info.version) console.log(` SΓΌrΓΌm: ${c('dim', info.version)}`);
276
+ console.log('');
277
+
278
+ if (!info.connected) {
279
+ console.log(c('dim', ' Gateway başlatmak için: vantuz gateway run'));
280
+ console.log(c('dim', ' Veya: start.bat\n'));
281
+ }
282
+ return;
283
+ }
284
+
285
+ if (sub === 'health') {
286
+ const result = await gw.health();
287
+ if (result.success) {
288
+ console.log(c('green', 'βœ” Gateway sağlΔ±klΔ±'));
289
+ if (result.data) console.log(JSON.stringify(result.data, null, 2));
290
+ } else {
291
+ console.log(c('red', `✘ Gateway erişilemez: ${result.error}`));
292
+ }
293
+ return;
294
+ }
295
+
296
+ if (sub === 'models') {
297
+ const result = await gw.getModels();
298
+ if (result.success) {
299
+ console.log(c('yellow', '── AI Modelleri ──\n'));
300
+ const models = result.data?.data || result.data || [];
301
+ if (Array.isArray(models)) {
302
+ models.forEach(m => {
303
+ console.log(` ${c('cyan', m.id || m.name)} ${c('dim', m.description || '')}`);
304
+ });
305
+ } else {
306
+ console.log(JSON.stringify(models, null, 2));
307
+ }
308
+ } else {
309
+ console.log(c('red', `Modeller alΔ±namadΔ±: ${result.error}`));
310
+ }
311
+ return;
312
+ }
313
+
314
+ if (sub === 'run' || sub === 'start') {
315
+ console.log(c('cyan', 'Gateway başlatılıyor...'));
316
+ const gatewayCmd = path.join(process.cwd(), '.openclaw', 'gateway.cmd');
317
+
318
+ if (fs.existsSync(gatewayCmd)) {
319
+ try {
320
+ const { spawn } = await import('child_process');
321
+ const child = spawn(gatewayCmd, [], {
322
+ detached: true,
323
+ stdio: 'ignore', // Arka planda sessizce çalışsın
324
+ shell: true // Windows iΓ§in gerekli
325
+ });
326
+ child.unref(); // Parent process'ten ayΔ±r
327
+
328
+ console.log(c('green', 'βœ” Gateway arka planda başlatΔ±ldΔ±.'));
329
+ console.log(c('dim', 'BirkaΓ§ saniye iΓ§inde hazΔ±r olacak.'));
330
+ console.log(c('dim', 'Kontrol iΓ§in: vantuz gateway status'));
331
+ } catch (e) {
332
+ console.log(c('red', `Başlatma hatası: ${e.message}`));
333
+ }
334
+ } else {
335
+ console.log(c('red', 'Gateway başlatma dosyası bulunamadı: .openclaw/gateway.cmd'));
336
+ }
337
+ return;
338
+ }
339
+
340
+ console.log(c('red', 'KullanΔ±m: vantuz gateway [status|health|models|run]'));
341
+ }
342
+
343
+ async function runDoctor() {
344
+ printHeader();
345
+ console.log(c('yellow', '── Sistem SağlΔ±k KontrolΓΌ ──\n'));
346
+
347
+ await showSpinner('Kontroller yapΔ±lΔ±yor', 800);
348
+
349
+ const engine = await getEngine();
350
+ const report = await engine.doctor();
351
+
352
+ // Engine
353
+ console.log(` Engine: ${report.engine ? c('green', '● Aktif') : c('red', 'β—‹ Pasif')}`);
354
+
355
+ // Gateway
356
+ const gw = report.gateway;
357
+ const gwIcon = gw.status === 'healthy' ? c('green', '●') :
358
+ gw.status === 'not_configured' ? c('yellow', 'β—‹') : c('red', 'β—‹');
359
+ console.log(` Gateway: ${gwIcon} ${gw.status === 'healthy' ? 'Sağlıklı' : gw.status === 'not_configured' ? 'Yapılandırılmamış' : 'Erişilemez'}`);
360
+
361
+ // AI
362
+ const ai = report.ai;
363
+ console.log(` AI: ${c('cyan', ai.provider)} ${ai.keyConfigured ? c('green', 'βœ” Key OK') : c('red', '✘ Key Eksik')} ${ai.gatewayFallback ? c('dim', '(gateway fallback var)') : ''}`);
364
+
365
+ // Platformlar
366
+ const platformEntries = Object.entries(report.platforms).filter(([k]) => k !== 'openclaw-gateway');
367
+ if (platformEntries.length > 0) {
368
+ console.log(`\n ${c('bold', 'Platformlar:')}`);
369
+ platformEntries.forEach(([name, connected]) => {
370
+ console.log(` ${connected ? c('green', '●') : c('red', 'β—‹')} ${name}`);
371
+ });
372
+ } else {
373
+ console.log(` Platformlar: ${c('yellow', 'Hiçbiri bağlı değil')}`);
374
+ }
375
+
376
+ // Kanallar
377
+ const ch = report.channels;
378
+ if (ch) {
379
+ console.log(`\n ${c('bold', 'Kanallar:')}`);
380
+ for (const [name, data] of Object.entries(ch)) {
381
+ console.log(` ${data.connected ? c('green', '●') : c('yellow', 'β—‹')} ${name}: ${data.info || ''}`);
382
+ }
383
+ }
384
+
385
+ console.log('');
386
+ }
387
+
388
+ async function runChannels(args) {
389
+ printHeader();
390
+ console.log(c('yellow', '── Δ°letişim KanallarΔ± ──\n'));
391
+
392
+ const engine = await getEngine();
393
+ const status = engine.getStatus();
394
+ const channels = status.channels || {};
395
+
396
+ for (const [name, data] of Object.entries(channels)) {
397
+ const icon = data.connected ? c('green', '●') : c('yellow', 'β—‹');
398
+ const mode = data.mode === 'gateway' ? c('dim', '[gateway]') : c('dim', '[local]');
399
+ console.log(` ${icon} ${c('bold', name.toUpperCase())} ${mode}`);
400
+ if (data.info) console.log(` ${c('dim', data.info)}`);
401
+ console.log('');
402
+ }
403
+
404
+ if (!status.gateway?.connected) {
405
+ console.log(c('dim', ' WhatsApp bağlantısı için gateway gereklidir.'));
406
+ console.log(c('dim', ' Gateway başlatmak için: start.bat\n'));
407
+ }
408
+ }
409
+
410
+ // ═══════════════════════════════════════════════════════════════════════════
411
+ // MAIN
412
+ // ═══════════════════════════════════════════════════════════════════════════
413
+
106
414
  const args = process.argv.slice(2);
107
415
  const command = args[0]?.toLowerCase();
108
416
 
109
417
  async function main() {
110
- const env = loadEnv();
111
-
112
- // Auto-redirect removed
113
- // if (!env.VANTUZ_LICENSE_KEY && command !== 'onboard') {
114
- // console.log(c('yellow', 'Lisans bulunamadı. Kurulum sihirbazı başlatılıyor...\n'));
115
- // import('./onboard.js');
116
- // return;
117
- // }
118
-
119
418
  switch (command) {
120
419
  case 'tui':
121
420
  case 'chat':
122
421
  await runTUI();
123
422
  break;
124
423
 
424
+ case 'config':
425
+ await runConfig(args);
426
+ break;
427
+
428
+ case 'logs':
429
+ await runLogs(args);
430
+ break;
431
+
432
+ case 'gateway':
433
+ case 'gw':
434
+ await runGateway(args);
435
+ break;
436
+
437
+ case 'doctor':
438
+ case 'check':
439
+ await runDoctor();
440
+ break;
441
+
442
+ case 'channels':
443
+ case 'ch':
444
+ await runChannels(args);
445
+ break;
446
+
125
447
  case 'status':
126
448
  printHeader();
127
- // const valid = await checkLicense();
128
449
  console.log(`Lisans Durumu: ${c('green', 'Aktif (Dev Mode)')}`);
450
+ const gw = await getGateway();
451
+ const gwInfo = gw.getInfo();
452
+ console.log(`Vantuz Gateway: ${gwInfo.connected ? c('green', '● BağlΔ±') : c('yellow', 'β—‹ BağlΔ± Değil')}`);
129
453
  break;
130
454
 
131
455
  default:
132
456
  printHeader();
133
457
  console.log('KullanΔ±m:\n');
134
- console.log(' vantuz tui - Sohbet arayΓΌzΓΌ');
135
- console.log(' vantuz status - Durum kontrolΓΌ');
136
- console.log('\nKurulum iΓ§in: vantuz-onboard');
458
+ console.log(` ${c('cyan', 'vantuz tui')} - Sohbet arayΓΌzΓΌ`);
459
+ console.log(` ${c('cyan', 'vantuz status')} - Durum kontrolΓΌ`);
460
+ console.log(` ${c('cyan', 'vantuz gateway')} - Gateway yΓΆnetimi`);
461
+ console.log(` ${c('cyan', 'vantuz doctor')} - Sistem sağlık kontrolü`);
462
+ console.log(` ${c('cyan', 'vantuz channels')} - İletişim kanalları`);
463
+ console.log(` ${c('cyan', 'vantuz config')} - AyarlarΔ± gΓΆster/gΓΌncelle`);
464
+ console.log(` ${c('cyan', 'vantuz logs')} - LoglarΔ± gΓΆster`);
465
+ console.log(`\nKurulum iΓ§in: ${c('cyan', 'vantuz-onboard')}`);
466
+ process.exitCode = command ? 2 : 0;
137
467
  }
138
468
  }
139
469
 
@@ -74,17 +74,18 @@ const VANTUZ_SYSTEM_PROMPT = `Sen Vantuz AI, e-ticaret operasyonlarΔ±nΔ± yΓΆnete
74
74
  - Satış raporlarΔ±
75
75
 
76
76
  ## Γ–nemli Kurallar
77
- 1. Kar marjının altına fiyat düşürme ânerme
78
- 2. Stokta olmayan ürünü satışa açma
79
- 3. Kritik işlemlerden ânce onay iste
80
- 4. KΔ±sa ve ΓΆz yanΔ±t ver
81
- 5. SayΔ±sal verileri dΓΌzgΓΌn formatla
77
+ 1. **ASLA VE ASLA** elindeki "MEVCUT SΔ°STEM DURUMU" verisinde olmayan bir sayΔ±yΔ± uydurma.
78
+ 2. Eğer bağlamda sipariş sayısı 0 gârünüyorsa veya hiç veri yoksa, "Şu an sipariş verisine ulaşamıyorum" de.
79
+ 3. "25 sipariş var" gibi rastgele sayılar verme.
80
+ 4. Kar marjının altına fiyat düşürme ânerme.
81
+ 5. Stokta olmayan ürünü satışa açma.
82
+ 6. Kritik işlemlerden ânce onay iste.
82
83
 
83
84
  ## YanΔ±t FormatΔ±
84
85
  - KΔ±sa ve ΓΆz ol
85
86
  - Emoji kullan ama abartma
86
87
  - SayΔ±sal verileri tablo formatΔ±nda gΓΆster
87
- - Hata durumunda Γ§ΓΆzΓΌm ΓΆner`;
88
+ - Hata durumunda Γ§ΓΆzΓΌm ΓΆner ve hata kodunu analiz et`;
88
89
 
89
90
  // ═══════════════════════════════════════════════════════════════════════════
90
91
  // AI CHAT