natureco-cli 2.15.0 → 2.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/dashboard.js +2 -2
- package/src/commands/setup.js +95 -10
package/package.json
CHANGED
|
@@ -211,7 +211,7 @@ body::before{
|
|
|
211
211
|
<div class="header-bot-name" id="header-bot-name">Nature Bot</div>
|
|
212
212
|
<div class="header-bot-model" id="header-bot-model">NatureCo</div>
|
|
213
213
|
</div>
|
|
214
|
-
<div class="version-badge" id="version-badge">v2.15.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.15.1</div>
|
|
215
215
|
</div>
|
|
216
216
|
<div class="messages" id="messages"></div>
|
|
217
217
|
<div class="input-area">
|
|
@@ -341,7 +341,7 @@ function dashboard(action) {
|
|
|
341
341
|
apiKey: cfg.apiKey,
|
|
342
342
|
defaultBot: cfg.defaultBot,
|
|
343
343
|
defaultBotId: cfg.defaultBotId,
|
|
344
|
-
version: 'v2.15.
|
|
344
|
+
version: 'v2.15.1',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/commands/setup.js
CHANGED
|
@@ -18,6 +18,7 @@ const LANG = {
|
|
|
18
18
|
providerQ: 'Hangi AI provider kullanmak istiyorsunuz?',
|
|
19
19
|
customUrl: 'Provider URL girin (örn: https://api.example.com/v1):',
|
|
20
20
|
apiKeyQ: 'API Key girin:',
|
|
21
|
+
apiKeyNatureCo: 'natureco.me → Geliştirici Paneli → API Keys bölümünden aldığın key\'i gir:',
|
|
21
22
|
modelQ: 'Model seç:',
|
|
22
23
|
customModel: 'Model adı girin (örn: llama-3.3-70b-versatile):',
|
|
23
24
|
customEntry: 'Özel URL gir',
|
|
@@ -75,6 +76,7 @@ const LANG = {
|
|
|
75
76
|
providerQ: 'Which AI provider do you want to use?',
|
|
76
77
|
customUrl: 'Enter provider URL (e.g. https://api.example.com/v1):',
|
|
77
78
|
apiKeyQ: 'Enter API Key:',
|
|
79
|
+
apiKeyNatureCo: 'natureco.me → Developer Panel → API Keys section — paste your key:',
|
|
78
80
|
modelQ: 'Select model:',
|
|
79
81
|
customModel: 'Enter model name (e.g. llama-3.3-70b-versatile):',
|
|
80
82
|
customEntry: 'Enter custom URL',
|
|
@@ -125,7 +127,14 @@ const LANG = {
|
|
|
125
127
|
};
|
|
126
128
|
|
|
127
129
|
// ─── Provider presets ─────────────────────────────────────────────────────────
|
|
130
|
+
const NATURECO_PROVIDER = {
|
|
131
|
+
name: 'NatureCo (natureco.me — kendi platformun)',
|
|
132
|
+
value: 'natureco',
|
|
133
|
+
url: 'https://api.natureco.me/v1',
|
|
134
|
+
};
|
|
135
|
+
|
|
128
136
|
const PROVIDER_PRESETS = (customLabel) => [
|
|
137
|
+
NATURECO_PROVIDER,
|
|
129
138
|
{ name: 'Groq (recommended — fast & free)', value: 'https://api.groq.com/openai/v1' },
|
|
130
139
|
{ name: 'OpenAI', value: 'https://api.openai.com/v1' },
|
|
131
140
|
{ name: 'Anthropic', value: 'https://api.anthropic.com' },
|
|
@@ -207,8 +216,12 @@ async function setup() {
|
|
|
207
216
|
default: 'https://api.groq.com/openai/v1',
|
|
208
217
|
}]);
|
|
209
218
|
|
|
210
|
-
|
|
211
|
-
|
|
219
|
+
// NatureCo provider seçildiyse URL'yi ayarla
|
|
220
|
+
let isNatureCo = false;
|
|
221
|
+
if (providerChoice === 'natureco') {
|
|
222
|
+
providerUrl = NATURECO_PROVIDER.url;
|
|
223
|
+
isNatureCo = true;
|
|
224
|
+
} else if (providerChoice === 'custom') {
|
|
212
225
|
const { customUrl } = await inquirer.prompt([{
|
|
213
226
|
type: 'input',
|
|
214
227
|
name: 'customUrl',
|
|
@@ -225,11 +238,10 @@ async function setup() {
|
|
|
225
238
|
const { providerApiKey } = await inquirer.prompt([{
|
|
226
239
|
type: 'password',
|
|
227
240
|
name: 'providerApiKey',
|
|
228
|
-
message: L.apiKeyQ,
|
|
241
|
+
message: isNatureCo ? L.apiKeyNatureCo : L.apiKeyQ,
|
|
229
242
|
mask: '*',
|
|
230
243
|
validate: (v) => v.trim() ? true : L.apiKeyRequired,
|
|
231
244
|
}]);
|
|
232
|
-
|
|
233
245
|
// Model listesi
|
|
234
246
|
let modelChoices = [L.customModelEntry];
|
|
235
247
|
for (const [domain, models] of Object.entries(COMMON_MODELS)) {
|
|
@@ -300,19 +312,82 @@ async function setup() {
|
|
|
300
312
|
],
|
|
301
313
|
}]);
|
|
302
314
|
|
|
315
|
+
// ── Entegrasyon sub-flow'ları ──────────────────────────────────────────────
|
|
316
|
+
const integConfig = {};
|
|
317
|
+
|
|
318
|
+
if (integrations.includes('Telegram')) {
|
|
319
|
+
console.log('');
|
|
320
|
+
console.log(chalk.cyan(' Telegram kurulumu:'));
|
|
321
|
+
const { tgToken } = await inquirer.prompt([{
|
|
322
|
+
type: 'input',
|
|
323
|
+
name: 'tgToken',
|
|
324
|
+
message: lang === 'tr' ? ' Bot Token girin (BotFather\'dan):' : ' Enter Bot Token (from BotFather):',
|
|
325
|
+
validate: (v) => v.trim() ? true : (lang === 'tr' ? 'Token gerekli' : 'Token required'),
|
|
326
|
+
}]);
|
|
327
|
+
const { tgChatId } = await inquirer.prompt([{
|
|
328
|
+
type: 'input',
|
|
329
|
+
name: 'tgChatId',
|
|
330
|
+
message: lang === 'tr' ? ' Chat ID girin (sadece bu ID\'den gelen mesajlara cevap verilir):' : ' Enter Chat ID (only messages from this ID will be answered):',
|
|
331
|
+
validate: (v) => v.trim() ? true : (lang === 'tr' ? 'Chat ID gerekli' : 'Chat ID required'),
|
|
332
|
+
}]);
|
|
333
|
+
console.log(chalk.gray(lang === 'tr'
|
|
334
|
+
? ' 💡 Chat ID\'nizi öğrenmek için @userinfobot\'a /start yazın'
|
|
335
|
+
: ' 💡 To find your Chat ID, send /start to @userinfobot'));
|
|
336
|
+
integConfig.telegramToken = tgToken.trim();
|
|
337
|
+
integConfig.telegramChatId = tgChatId.trim();
|
|
338
|
+
// Bağlantı testi
|
|
339
|
+
try {
|
|
340
|
+
const res = await fetch(`https://api.telegram.org/bot${tgToken.trim()}/getMe`);
|
|
341
|
+
const data = await res.json();
|
|
342
|
+
if (data.ok) {
|
|
343
|
+
printDone(L, `Telegram @${data.result.username}`);
|
|
344
|
+
} else {
|
|
345
|
+
console.log(chalk.yellow(' ⚠ Token geçersiz görünüyor, ilerleyebilirsin'));
|
|
346
|
+
}
|
|
347
|
+
} catch {
|
|
348
|
+
console.log(chalk.gray(' (bağlantı testi atlandı)'));
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (integrations.includes('WhatsApp')) {
|
|
353
|
+
console.log('');
|
|
354
|
+
console.log(chalk.cyan(lang === 'tr'
|
|
355
|
+
? ' WhatsApp için gateway başlatılması gerekiyor.'
|
|
356
|
+
: ' WhatsApp requires the gateway to be running.'));
|
|
357
|
+
console.log(chalk.gray(lang === 'tr'
|
|
358
|
+
? ' Kurulum sonunda gateway başlatılacak, ardından QR kodu taratman gerekecek.'
|
|
359
|
+
: ' The gateway will start after setup — you\'ll need to scan the QR code.'));
|
|
360
|
+
printDone(L, 'WhatsApp');
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (integrations.includes('Discord')) {
|
|
364
|
+
console.log('');
|
|
365
|
+
console.log(chalk.cyan(' Discord kurulumu:'));
|
|
366
|
+
const { discordToken } = await inquirer.prompt([{
|
|
367
|
+
type: 'password',
|
|
368
|
+
name: 'discordToken',
|
|
369
|
+
message: lang === 'tr' ? ' Discord Bot Token girin:' : ' Enter Discord Bot Token:',
|
|
370
|
+
mask: '*',
|
|
371
|
+
validate: (v) => v.trim() ? true : (lang === 'tr' ? 'Token gerekli' : 'Token required'),
|
|
372
|
+
}]);
|
|
373
|
+
integConfig.discordToken = discordToken.trim();
|
|
374
|
+
printDone(L, 'Discord');
|
|
375
|
+
}
|
|
376
|
+
|
|
303
377
|
if (integrations.length > 0) {
|
|
304
|
-
|
|
378
|
+
if (!integrations.includes('Telegram') && !integrations.includes('WhatsApp') && !integrations.includes('Discord')) {
|
|
379
|
+
printDone(L, integrations.join(', '));
|
|
380
|
+
}
|
|
305
381
|
console.log('');
|
|
306
|
-
integrations.
|
|
307
|
-
console.log(chalk.gray(` →
|
|
308
|
-
}
|
|
382
|
+
if (integrations.includes('Slack')) {
|
|
383
|
+
console.log(chalk.gray(` → natureco slack connect`));
|
|
384
|
+
}
|
|
309
385
|
} else {
|
|
310
386
|
printDone(L, L.integSkip);
|
|
311
387
|
}
|
|
312
388
|
|
|
313
389
|
// ── ADIM 5: Gateway ────────────────────────────────────────────────────────
|
|
314
390
|
printStep(L, 5, L.gatewayTitle);
|
|
315
|
-
|
|
316
391
|
const { startGateway } = await inquirer.prompt([{
|
|
317
392
|
type: 'confirm',
|
|
318
393
|
name: 'startGateway',
|
|
@@ -329,11 +404,16 @@ async function setup() {
|
|
|
329
404
|
providerUrl,
|
|
330
405
|
providerApiKey: providerApiKey.trim(),
|
|
331
406
|
providerModel,
|
|
407
|
+
apiKey: providerApiKey.trim(), // login bypass — chat doğrudan çalışsın
|
|
332
408
|
botName: botName.trim(),
|
|
333
409
|
userName: userName.trim(),
|
|
334
410
|
debug: existingConfig.debug || false,
|
|
335
411
|
skills: existingConfig.skills || { enabled: true, list: [] },
|
|
336
412
|
mcpServers: existingConfig.mcpServers || {},
|
|
413
|
+
// Entegrasyon config'leri
|
|
414
|
+
...(integConfig.telegramToken && { telegramToken: integConfig.telegramToken }),
|
|
415
|
+
...(integConfig.telegramChatId && { telegramChatId: integConfig.telegramChatId }),
|
|
416
|
+
...(integConfig.discordToken && { discordToken: integConfig.discordToken }),
|
|
337
417
|
};
|
|
338
418
|
|
|
339
419
|
saveConfig(config);
|
|
@@ -374,6 +454,12 @@ async function setup() {
|
|
|
374
454
|
stdio: 'ignore',
|
|
375
455
|
}).unref();
|
|
376
456
|
printDone(L, 'Gateway');
|
|
457
|
+
if (integrations.includes('WhatsApp')) {
|
|
458
|
+
console.log('');
|
|
459
|
+
console.log(chalk.yellow(lang === 'tr'
|
|
460
|
+
? ' 📱 WhatsApp QR kodunu taratmak için: natureco whatsapp connect'
|
|
461
|
+
: ' 📱 To scan WhatsApp QR code: natureco whatsapp connect'));
|
|
462
|
+
}
|
|
377
463
|
} catch (e) {
|
|
378
464
|
console.log(chalk.yellow(` ⚠ ${e.message}`));
|
|
379
465
|
}
|
|
@@ -396,7 +482,6 @@ async function setup() {
|
|
|
396
482
|
if (startChat) {
|
|
397
483
|
console.log(chalk.cyan(` ${L.chatStart}`));
|
|
398
484
|
console.log('');
|
|
399
|
-
// Chat komutunu çalıştır
|
|
400
485
|
const chat = require('./chat');
|
|
401
486
|
await chat([], {});
|
|
402
487
|
} else {
|