vantuz 3.2.5 β 3.2.7
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/.openclaw/completions/openclaw.bash +227 -0
- package/.openclaw/completions/openclaw.fish +1552 -0
- package/.openclaw/completions/openclaw.ps1 +1966 -0
- package/.openclaw/completions/openclaw.zsh +3571 -0
- package/.openclaw/gateway.cmd +10 -0
- package/.openclaw/identity/device.json +7 -0
- package/.openclaw/openclaw.json +32 -0
- package/DOCS_TR.md +298 -0
- package/cli.js +387 -57
- package/core/ai-provider.js +7 -6
- package/core/channels.js +107 -12
- package/core/database.js +24 -25
- package/core/engine.js +123 -133
- package/core/gateway.js +340 -0
- package/onboard.js +58 -67
- package/package.json +15 -7
- package/platforms/amazon.js +11 -0
- package/platforms/ciceksepeti.js +10 -0
- package/platforms/hepsiburada.js +15 -0
- package/platforms/n11.js +11 -0
- package/platforms/pazarama.js +10 -0
- package/platforms/trendyol.js +61 -0
- package/plugins/vantuz/index.js +1 -1
- package/plugins/vantuz/platforms/_template.js +118 -0
- package/plugins/vantuz/platforms/trendyol.js +23 -5
- package/plugins/vantuz/services/scheduler.js +1 -1
- package/server/app.js +130 -0
- package/server/public/index.html +516 -0
package/core/gateway.js
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* π VANTUZ GATEWAY BRIDGE v1.0
|
|
3
|
+
* Vantuz β Vantuz Gateway iletiΕim katmanΔ±
|
|
4
|
+
*
|
|
5
|
+
* Gateway ΓΌzerinden:
|
|
6
|
+
* - AI model yΓΆnlendirmesi
|
|
7
|
+
* - Kanal yΓΆnetimi (WhatsApp, Telegram)
|
|
8
|
+
* - Plugin RPC Γ§aΔrΔ±larΔ±
|
|
9
|
+
* - Sistem durumu sorgulama
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import axios from 'axios';
|
|
13
|
+
import fs from 'fs';
|
|
14
|
+
import path from 'path';
|
|
15
|
+
import os from 'os';
|
|
16
|
+
import { log } from './ai-provider.js';
|
|
17
|
+
|
|
18
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
19
|
+
// CONFIG - Gateway ayarlarΔ±
|
|
20
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
21
|
+
|
|
22
|
+
const OPENCLAW_HOME = path.join(process.cwd(), '.openclaw');
|
|
23
|
+
const OPENCLAW_CONFIG = path.join(OPENCLAW_HOME, 'openclaw.json');
|
|
24
|
+
const VANTUZ_HOME = path.join(os.homedir(), '.vantuz');
|
|
25
|
+
|
|
26
|
+
function loadGatewayConfig() {
|
|
27
|
+
try {
|
|
28
|
+
if (fs.existsSync(OPENCLAW_CONFIG)) {
|
|
29
|
+
return JSON.parse(fs.readFileSync(OPENCLAW_CONFIG, 'utf-8'));
|
|
30
|
+
}
|
|
31
|
+
} catch (e) {
|
|
32
|
+
log('WARN', 'Gateway config okunamadΔ±', { error: e.message });
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getGatewayUrl() {
|
|
38
|
+
// Gateway cmd dosyasΔ±ndan port oku
|
|
39
|
+
const gatewayCmd = path.join(OPENCLAW_HOME, 'gateway.cmd');
|
|
40
|
+
let port = 18789; // VarsayΔ±lan
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
if (fs.existsSync(gatewayCmd)) {
|
|
44
|
+
const content = fs.readFileSync(gatewayCmd, 'utf-8');
|
|
45
|
+
const portMatch = content.match(/OPENCLAW_GATEWAY_PORT=(\d+)/);
|
|
46
|
+
if (portMatch) port = parseInt(portMatch[1]);
|
|
47
|
+
}
|
|
48
|
+
} catch (e) { }
|
|
49
|
+
|
|
50
|
+
return `http://localhost:${port}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function getGatewayToken() {
|
|
54
|
+
const config = loadGatewayConfig();
|
|
55
|
+
return config?.gateway?.auth?.token || null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
59
|
+
// GATEWAY CLIENT
|
|
60
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
61
|
+
|
|
62
|
+
export class VantuzGateway {
|
|
63
|
+
constructor() {
|
|
64
|
+
this.baseUrl = getGatewayUrl();
|
|
65
|
+
this.token = getGatewayToken();
|
|
66
|
+
this.connected = false;
|
|
67
|
+
this.version = null;
|
|
68
|
+
this.config = loadGatewayConfig();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* HTTP Headers (token auth)
|
|
73
|
+
*/
|
|
74
|
+
_headers() {
|
|
75
|
+
const headers = { 'Content-Type': 'application/json' };
|
|
76
|
+
if (this.token) {
|
|
77
|
+
headers['Authorization'] = `Bearer ${this.token}`;
|
|
78
|
+
}
|
|
79
|
+
return headers;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Gateway'e HTTP isteΔi gΓΆnder
|
|
84
|
+
*/
|
|
85
|
+
async _request(method, endpoint, data = null, timeout = 10000) {
|
|
86
|
+
try {
|
|
87
|
+
const config = {
|
|
88
|
+
method,
|
|
89
|
+
url: `${this.baseUrl}${endpoint}`,
|
|
90
|
+
headers: this._headers(),
|
|
91
|
+
timeout
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
if (data) config.data = data;
|
|
95
|
+
|
|
96
|
+
const response = await axios(config);
|
|
97
|
+
return { success: true, data: response.data };
|
|
98
|
+
} catch (error) {
|
|
99
|
+
if (error.code === 'ECONNREFUSED') {
|
|
100
|
+
return { success: false, error: 'Gateway Γ§alΔ±ΕmΔ±yor', code: 'NOT_RUNNING' };
|
|
101
|
+
}
|
|
102
|
+
if (error.response?.status === 401) {
|
|
103
|
+
return { success: false, error: 'Token geΓ§ersiz', code: 'AUTH_FAILED' };
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
success: false,
|
|
107
|
+
error: error.message,
|
|
108
|
+
code: error.code || 'UNKNOWN'
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
114
|
+
// SAΔLIK & DURUM
|
|
115
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Gateway saΔlΔ±k kontrolΓΌ
|
|
119
|
+
*/
|
|
120
|
+
async health() {
|
|
121
|
+
const result = await this._request('GET', '/health');
|
|
122
|
+
this.connected = result.success;
|
|
123
|
+
if (result.success) {
|
|
124
|
+
this.version = result.data?.version || 'unknown';
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* DetaylΔ± sistem durumu
|
|
131
|
+
*/
|
|
132
|
+
async status() {
|
|
133
|
+
const result = await this._request('GET', '/status');
|
|
134
|
+
if (result.success) {
|
|
135
|
+
this.connected = true;
|
|
136
|
+
}
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Gateway baΔlΔ± mΔ±?
|
|
142
|
+
*/
|
|
143
|
+
isConnected() {
|
|
144
|
+
return this.connected;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Gateway bilgileri
|
|
149
|
+
*/
|
|
150
|
+
getInfo() {
|
|
151
|
+
return {
|
|
152
|
+
url: this.baseUrl,
|
|
153
|
+
connected: this.connected,
|
|
154
|
+
version: this.version,
|
|
155
|
+
hasToken: !!this.token,
|
|
156
|
+
configFound: !!this.config
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
161
|
+
// AI MODEL YΓNLENDΔ°RME
|
|
162
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Gateway ΓΌzerinden AI chat
|
|
166
|
+
* Gateway AI model routing saΔlΔ±yorsa kullan
|
|
167
|
+
*/
|
|
168
|
+
async chat(message, options = {}) {
|
|
169
|
+
const result = await this._request('POST', '/v1/chat/completions', {
|
|
170
|
+
messages: [
|
|
171
|
+
...(options.systemPrompt ? [{ role: 'system', content: options.systemPrompt }] : []),
|
|
172
|
+
{ role: 'user', content: message }
|
|
173
|
+
],
|
|
174
|
+
model: options.model || 'default',
|
|
175
|
+
max_tokens: options.maxTokens || 1000,
|
|
176
|
+
temperature: options.temperature || 0.7
|
|
177
|
+
}, 30000);
|
|
178
|
+
|
|
179
|
+
if (result.success) {
|
|
180
|
+
const text = result.data?.choices?.[0]?.message?.content;
|
|
181
|
+
return { success: true, response: text };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return { success: false, error: result.error };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* KullanΔ±labilir AI modelleri
|
|
189
|
+
*/
|
|
190
|
+
async getModels() {
|
|
191
|
+
return await this._request('GET', '/v1/models');
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
195
|
+
// KANAL YΓNETΔ°MΔ°
|
|
196
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Kanal listesi ve durumlarΔ±
|
|
200
|
+
*/
|
|
201
|
+
async getChannels() {
|
|
202
|
+
return await this._request('GET', '/channels');
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Kanal baΔlantΔ± durumu
|
|
207
|
+
*/
|
|
208
|
+
async getChannelStatus(channelName) {
|
|
209
|
+
return await this._request('GET', `/channels/${channelName}/status`);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Kanal ΓΌzerinden mesaj gΓΆnder
|
|
214
|
+
*/
|
|
215
|
+
async sendMessage(channel, to, message) {
|
|
216
|
+
return await this._request('POST', `/channels/${channel}/send`, {
|
|
217
|
+
to,
|
|
218
|
+
message,
|
|
219
|
+
type: 'text'
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
224
|
+
// RPC - Plugin Gateway MethodlarΔ±
|
|
225
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Gateway RPC Γ§aΔrΔ±sΔ±
|
|
229
|
+
*/
|
|
230
|
+
async call(method, params = {}) {
|
|
231
|
+
return await this._request('POST', '/rpc', {
|
|
232
|
+
method,
|
|
233
|
+
params
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Vantuz plugin durumu
|
|
239
|
+
*/
|
|
240
|
+
async getPluginStatus() {
|
|
241
|
+
return await this.call('vantuz.status');
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Vantuz plugin config
|
|
246
|
+
*/
|
|
247
|
+
async getPluginConfig() {
|
|
248
|
+
return await this.call('vantuz.config', { action: 'get' });
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
252
|
+
// CRON & ZAMANLAMA
|
|
253
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* ZamanlanmΔ±Ε gΓΆrev listesi
|
|
257
|
+
*/
|
|
258
|
+
async getCronJobs() {
|
|
259
|
+
return await this._request('GET', '/cron');
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* ZamanlanmΔ±Ε gΓΆrev ekle
|
|
264
|
+
*/
|
|
265
|
+
async addCronJob(schedule, command, description) {
|
|
266
|
+
return await this._request('POST', '/cron', {
|
|
267
|
+
schedule,
|
|
268
|
+
command,
|
|
269
|
+
description
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
274
|
+
// HAFIZA (Memory)
|
|
275
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Gateway hafΔ±za durumu
|
|
279
|
+
*/
|
|
280
|
+
async getMemoryStatus() {
|
|
281
|
+
return await this._request('GET', '/memory/status');
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* HafΔ±za aramasΔ±
|
|
286
|
+
*/
|
|
287
|
+
async searchMemory(query) {
|
|
288
|
+
return await this._request('POST', '/memory/search', { query });
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
292
|
+
// LOGLAR
|
|
293
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Gateway loglarΔ±
|
|
297
|
+
*/
|
|
298
|
+
async getLogs(limit = 50) {
|
|
299
|
+
return await this._request('GET', `/logs?limit=${limit}`);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
304
|
+
// SINGLETON & FACTORY
|
|
305
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
306
|
+
|
|
307
|
+
let gatewayInstance = null;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Vantuz Gateway singleton instance
|
|
311
|
+
* Otomatik baΔlantΔ± kontrolΓΌ yapar
|
|
312
|
+
*/
|
|
313
|
+
export async function getGateway() {
|
|
314
|
+
if (!gatewayInstance) {
|
|
315
|
+
gatewayInstance = new VantuzGateway();
|
|
316
|
+
|
|
317
|
+
// Δ°lk baΔlantΔ± denemesi
|
|
318
|
+
const health = await gatewayInstance.health();
|
|
319
|
+
if (health.success) {
|
|
320
|
+
log('INFO', 'Vantuz Gateway baΔlantΔ±sΔ± baΕarΔ±lΔ±', {
|
|
321
|
+
url: gatewayInstance.baseUrl,
|
|
322
|
+
version: gatewayInstance.version
|
|
323
|
+
});
|
|
324
|
+
} else {
|
|
325
|
+
log('WARN', 'Vantuz Gateway eriΕilemez, direkt mod kullanΔ±lacak', {
|
|
326
|
+
error: health.error
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return gatewayInstance;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Gateway durumunu sΔ±fΔ±rla (reconnect iΓ§in)
|
|
335
|
+
*/
|
|
336
|
+
export function resetGateway() {
|
|
337
|
+
gatewayInstance = null;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export default VantuzGateway;
|
package/onboard.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* VANTUZ - Profesyonel Kurulum SihirbazΔ±
|
|
5
|
-
* v3.2.
|
|
5
|
+
* v3.2.7 - OpenClaw Gateway Entegrasyonlu
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import fs from 'fs';
|
|
@@ -10,7 +10,6 @@ import path from 'path';
|
|
|
10
10
|
import os from 'os';
|
|
11
11
|
import readline from 'readline';
|
|
12
12
|
import { fileURLToPath } from 'url';
|
|
13
|
-
import { LicenseManager } from './plugins/vantuz/services/license.js';
|
|
14
13
|
|
|
15
14
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
16
15
|
const VANTUZ_HOME = path.join(os.homedir(), '.vantuz');
|
|
@@ -39,10 +38,10 @@ const WELCOME_BOX = `
|
|
|
39
38
|
|
|
40
39
|
Bu sihirbaz kurulumu tamamlamanΔ±za yardΔ±mcΔ± olacak:
|
|
41
40
|
|
|
42
|
-
[ ] Lisans Aktivasyonu (Zorunlu)
|
|
43
41
|
[ ] AI Servis SeΓ§imi
|
|
44
42
|
[ ] Pazaryeri BaΔlantΔ±larΔ±
|
|
45
43
|
[ ] Δ°letiΕim KanallarΔ±
|
|
44
|
+
[ ] OpenClaw Gateway YapΔ±landΔ±rmasΔ±
|
|
46
45
|
|
|
47
46
|
-----------------------------------------------------------------
|
|
48
47
|
`;
|
|
@@ -51,8 +50,7 @@ class OnboardingWizard {
|
|
|
51
50
|
constructor() {
|
|
52
51
|
this.envVars = {};
|
|
53
52
|
this.step = 0;
|
|
54
|
-
this.totalSteps =
|
|
55
|
-
this.licenseManager = new LicenseManager();
|
|
53
|
+
this.totalSteps = 5;
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
clear() { console.clear(); }
|
|
@@ -67,11 +65,11 @@ class OnboardingWizard {
|
|
|
67
65
|
try {
|
|
68
66
|
await this.showLogo();
|
|
69
67
|
await this.showWelcome();
|
|
70
|
-
// await this.step1_License(); // Lisans adΔ±mΔ± kaldΔ±rΔ±ldΔ±
|
|
71
68
|
console.log(c('green', 'β‘ GeliΕtirici Modu: Lisans kontrolΓΌ atlandΔ±.\n'));
|
|
72
|
-
await this.
|
|
73
|
-
await this.
|
|
74
|
-
await this.
|
|
69
|
+
await this.step1_AIProvider();
|
|
70
|
+
await this.step2_Platforms();
|
|
71
|
+
await this.step3_Channels();
|
|
72
|
+
await this.step4_Gateway();
|
|
75
73
|
await this.step5_Save();
|
|
76
74
|
await this.showSuccess();
|
|
77
75
|
} catch (error) {
|
|
@@ -92,41 +90,9 @@ class OnboardingWizard {
|
|
|
92
90
|
await this.prompt(c('dim', 'Devam etmek iΓ§in Enter\'a basΔ±n...'));
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
// ADIM 1:
|
|
96
|
-
async
|
|
93
|
+
// ADIM 1: AI PROVIDER
|
|
94
|
+
async step1_AIProvider() {
|
|
97
95
|
this.step = 1;
|
|
98
|
-
this.printHeader('LΔ°SANS AKTΔ°VASYONU');
|
|
99
|
-
|
|
100
|
-
console.log('Vantuz AI kullanΔ±mΔ± iΓ§in geΓ§erli bir lisans anahtarΔ± gereklidir.');
|
|
101
|
-
console.log(c('dim', 'Size verilen KullanΔ±cΔ± Modu anahtarΔ±nΔ± girin.\n'));
|
|
102
|
-
|
|
103
|
-
while (true) {
|
|
104
|
-
const key = await this.prompt('Lisans AnahtarΔ±: '); // Changed from promptSecret to avoid issues
|
|
105
|
-
|
|
106
|
-
if (!key) {
|
|
107
|
-
console.log(c('red', '\n[HATA] Lisans anahtarΔ± boΕ olamaz.'));
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
console.log(c('dim', '\nKontrol ediliyor...'));
|
|
112
|
-
const formatCheck = this.licenseManager.validateFormat(key);
|
|
113
|
-
|
|
114
|
-
if (!formatCheck.valid) {
|
|
115
|
-
console.log(c('red', `\n[HATA] GeΓ§ersiz format: ${formatCheck.error}`));
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Valid
|
|
120
|
-
this.envVars.VANTUZ_LICENSE_KEY = key;
|
|
121
|
-
console.log(c('green', '\n[OK] Lisans formatΔ± geΓ§erli.\n'));
|
|
122
|
-
await sleep(800);
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// ADIM 2: AI PROVIDER
|
|
128
|
-
async step2_AIProvider() {
|
|
129
|
-
this.step = 2;
|
|
130
96
|
this.printHeader('YAPAY ZEKA SERVΔ°SΔ°');
|
|
131
97
|
|
|
132
98
|
console.log('KullanΔ±lacak AI modelini seΓ§in:\n');
|
|
@@ -156,8 +122,7 @@ class OnboardingWizard {
|
|
|
156
122
|
const selected = providers[choice] || providers['1'];
|
|
157
123
|
console.log(c('green', `\n[SEΓΔ°LDΔ°] ${selected.label}\n`));
|
|
158
124
|
|
|
159
|
-
|
|
160
|
-
const key = await this.prompt(`${selected.label} API Key (gΓΆrΓΌnΓΌr giriΕ): `);
|
|
125
|
+
const key = await this.prompt(`${selected.label} API Key: `);
|
|
161
126
|
|
|
162
127
|
if (key && key.trim()) {
|
|
163
128
|
this.envVars[selected.env] = key.trim();
|
|
@@ -168,9 +133,9 @@ class OnboardingWizard {
|
|
|
168
133
|
await sleep(1000);
|
|
169
134
|
}
|
|
170
135
|
|
|
171
|
-
// ADIM
|
|
172
|
-
async
|
|
173
|
-
this.step =
|
|
136
|
+
// ADIM 2: PAZARYERLERΔ°
|
|
137
|
+
async step2_Platforms() {
|
|
138
|
+
this.step = 2;
|
|
174
139
|
this.printHeader('PAZARYERΔ° ENTEGRASYONLARI');
|
|
175
140
|
|
|
176
141
|
console.log('Hangi pazaryerini yapΔ±landΔ±rmak istersiniz?\n');
|
|
@@ -182,13 +147,10 @@ class OnboardingWizard {
|
|
|
182
147
|
|
|
183
148
|
const choice = await this.prompt('SeΓ§iminiz (1-4 veya S) [1]: ') || '1';
|
|
184
149
|
|
|
185
|
-
if (choice.toLowerCase() === 's')
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
150
|
+
if (choice.toLowerCase() === 's') return;
|
|
188
151
|
|
|
189
|
-
if (choice === '1') {
|
|
152
|
+
if (choice === '1') {
|
|
190
153
|
console.log(c('cyan', '\nTrendyol YapΔ±landΔ±rmasΔ±\n'));
|
|
191
|
-
console.log('LΓΌtfen Trendyol Partner panelinden aldΔ±ΔΔ±nΔ±z bilgileri girin.');
|
|
192
154
|
console.log(c('dim', '(BoΕ bΔ±rakΔ±p Enter\'a basarak geΓ§ebilirsiniz)\n'));
|
|
193
155
|
|
|
194
156
|
const supplierId = await this.prompt('Supplier ID: ');
|
|
@@ -209,9 +171,9 @@ class OnboardingWizard {
|
|
|
209
171
|
}
|
|
210
172
|
}
|
|
211
173
|
|
|
212
|
-
// ADIM
|
|
213
|
-
async
|
|
214
|
-
this.step =
|
|
174
|
+
// ADIM 3: KANALLAR
|
|
175
|
+
async step3_Channels() {
|
|
176
|
+
this.step = 3;
|
|
215
177
|
this.printHeader('Δ°LETΔ°ΕΔ°M KANALLARI');
|
|
216
178
|
|
|
217
179
|
console.log('WhatsApp ve Telegram entegrasyonu.\n');
|
|
@@ -226,12 +188,45 @@ class OnboardingWizard {
|
|
|
226
188
|
}
|
|
227
189
|
}
|
|
228
190
|
|
|
229
|
-
console.log(c('dim', '\nNot: WhatsApp baΔlantΔ±sΔ±
|
|
191
|
+
console.log(c('dim', '\nNot: WhatsApp baΔlantΔ±sΔ± "openclaw channels login" ile yapΔ±lΔ±r.\n'));
|
|
230
192
|
await sleep(1500);
|
|
231
193
|
}
|
|
232
194
|
|
|
195
|
+
// ADIM 4: VANTUZ GATEWAY
|
|
196
|
+
async step4_Gateway() {
|
|
197
|
+
this.step = 4;
|
|
198
|
+
this.printHeader('VANTUZ GATEWAY');
|
|
199
|
+
|
|
200
|
+
console.log('Vantuz Gateway, AI ve kanal yΓΆnetimini gΓΌΓ§lendirir.\n');
|
|
201
|
+
|
|
202
|
+
// .openclaw/ klasΓΆrΓΌ kontrolΓΌ
|
|
203
|
+
const openclawDir = path.join(process.cwd(), '.openclaw');
|
|
204
|
+
const openclawConfig = path.join(openclawDir, 'openclaw.json');
|
|
205
|
+
|
|
206
|
+
if (fs.existsSync(openclawConfig)) {
|
|
207
|
+
console.log(c('green', 'β Gateway yapΔ±landΔ±rmasΔ± bulundu.'));
|
|
208
|
+
try {
|
|
209
|
+
const config = JSON.parse(fs.readFileSync(openclawConfig, 'utf-8'));
|
|
210
|
+
if (config.gateway?.auth?.token) {
|
|
211
|
+
console.log(c('green', 'β Token ve gΓΌvenlik anahtarlarΔ± hazΔ±r.'));
|
|
212
|
+
}
|
|
213
|
+
} catch (e) {
|
|
214
|
+
console.log(c('yellow', 'β Config okunamadΔ±.'));
|
|
215
|
+
}
|
|
216
|
+
} else {
|
|
217
|
+
console.log(c('yellow', 'β Gateway yapΔ±landΔ±rmasΔ± eksik.'));
|
|
218
|
+
console.log(c('dim', '\nOtomatik olarak oluΕturulacak...\n'));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
console.log(c('dim', '\nBaΕlatmak iΓ§in sadece: start.bat'));
|
|
222
|
+
console.log(c('dim', 'Durum kontrolΓΌ: vantuz gateway status\n'));
|
|
223
|
+
|
|
224
|
+
await this.prompt(c('dim', 'Devam etmek iΓ§in Enter\'a basΔ±n...'));
|
|
225
|
+
}
|
|
226
|
+
|
|
233
227
|
// KAYDET
|
|
234
228
|
async step5_Save() {
|
|
229
|
+
this.step = 5;
|
|
235
230
|
this.printHeader('AYARLAR KAYDEDΔ°LΔ°YOR');
|
|
236
231
|
|
|
237
232
|
console.log('YapΔ±landΔ±rma dosyasΔ± oluΕturuluyor...');
|
|
@@ -271,15 +266,16 @@ class OnboardingWizard {
|
|
|
271
266
|
console.log('\n');
|
|
272
267
|
console.log('Vantuz AI kullanΔ±ma hazΔ±rdΔ±r.\n');
|
|
273
268
|
console.log('BaΕlamak iΓ§in Εu komutlarΔ± kullanabilirsiniz:');
|
|
274
|
-
console.log(c('cyan', ' vantuz tui') + '
|
|
275
|
-
console.log(c('cyan', ' vantuz status') + '
|
|
269
|
+
console.log(c('cyan', ' vantuz tui') + ' - Sohbet arayΓΌzΓΌnΓΌ baΕlatΔ±r');
|
|
270
|
+
console.log(c('cyan', ' vantuz status') + ' - Sistem durumunu gΓΆsterir');
|
|
271
|
+
console.log(c('cyan', ' vantuz gateway') + ' - Gateway durumunu gΓΆsterir');
|
|
272
|
+
console.log(c('cyan', ' vantuz doctor') + ' - Sistem saΔlΔ±k kontrolΓΌ');
|
|
276
273
|
console.log('\n');
|
|
277
274
|
|
|
278
|
-
// Final prompt to prevent immediate exit
|
|
279
275
|
await this.prompt(c('dim', 'ΓΔ±kmak iΓ§in Enter\'a basΔ±n...'));
|
|
280
276
|
}
|
|
281
277
|
|
|
282
|
-
// ARAΓLAR
|
|
278
|
+
// ARAΓLAR
|
|
283
279
|
prompt(question) {
|
|
284
280
|
return new Promise((resolve) => {
|
|
285
281
|
const rl = readline.createInterface({
|
|
@@ -293,11 +289,6 @@ class OnboardingWizard {
|
|
|
293
289
|
});
|
|
294
290
|
});
|
|
295
291
|
}
|
|
296
|
-
|
|
297
|
-
// Deprecated insecure secret prompt - using standard prompt for stability
|
|
298
|
-
promptSecret(question) {
|
|
299
|
-
return this.prompt(question);
|
|
300
|
-
}
|
|
301
292
|
}
|
|
302
293
|
|
|
303
294
|
// BAΕLAT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vantuz",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.7",
|
|
4
4
|
"description": "Yapay Zeka Destekli E-Ticaret YΓΆnetim Platformu - 7 Pazaryeri + WhatsApp/Telegram",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "cli.js",
|
|
@@ -36,7 +36,10 @@
|
|
|
36
36
|
"fiyatlama",
|
|
37
37
|
"whatsapp",
|
|
38
38
|
"telegram",
|
|
39
|
-
"enterprise"
|
|
39
|
+
"enterprise",
|
|
40
|
+
"gateway",
|
|
41
|
+
"management",
|
|
42
|
+
"cli"
|
|
40
43
|
],
|
|
41
44
|
"author": {
|
|
42
45
|
"name": "Nuri Can AvΕar",
|
|
@@ -45,7 +48,7 @@
|
|
|
45
48
|
"license": "SEE LICENSE IN LICENSE",
|
|
46
49
|
"repository": {
|
|
47
50
|
"type": "git",
|
|
48
|
-
"url": "https://github.com/nuricanavsar/vantuz.git"
|
|
51
|
+
"url": "git+https://github.com/nuricanavsar/vantuz.git"
|
|
49
52
|
},
|
|
50
53
|
"homepage": "https://vantuz.ai",
|
|
51
54
|
"bugs": {
|
|
@@ -57,6 +60,7 @@
|
|
|
57
60
|
"cors": "^2.8.6",
|
|
58
61
|
"dotenv": "^16.0.0",
|
|
59
62
|
"express": "^5.2.1",
|
|
63
|
+
"openclaw": "^2026.2.9",
|
|
60
64
|
"xml2js": "^0.6.2"
|
|
61
65
|
},
|
|
62
66
|
"devDependencies": {
|
|
@@ -73,9 +77,13 @@
|
|
|
73
77
|
"files": [
|
|
74
78
|
"cli.js",
|
|
75
79
|
"onboard.js",
|
|
76
|
-
"
|
|
77
|
-
"
|
|
80
|
+
"core",
|
|
81
|
+
"server",
|
|
82
|
+
"platforms",
|
|
83
|
+
"plugins",
|
|
84
|
+
".openclaw",
|
|
85
|
+
"LICENSE",
|
|
78
86
|
"README.md",
|
|
79
|
-
"
|
|
87
|
+
"DOCS_TR.md"
|
|
80
88
|
]
|
|
81
|
-
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
name: 'Hepsiburada',
|
|
3
|
+
requiredFields: [
|
|
4
|
+
{ key: 'merchantId', label: 'Merchant ID' },
|
|
5
|
+
{ key: 'username', label: 'Username' },
|
|
6
|
+
{ key: 'password', label: 'Password' }
|
|
7
|
+
],
|
|
8
|
+
async getOrders(creds) {
|
|
9
|
+
// Stub
|
|
10
|
+
if (!creds.merchantId) return [];
|
|
11
|
+
return [
|
|
12
|
+
{ number: 'HB-998877', customer: 'Ahmet YΔ±lmaz', amount: '1250.00 TRY', status: 'Ready' }
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
};
|
package/platforms/n11.js
ADDED