natureco-cli 2.15.0 → 2.15.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "2.15.0",
3
+ "version": "2.15.2",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "main": "bin/natureco.js",
6
6
  "bin": {
@@ -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.0</div>
214
+ <div class="version-badge" id="version-badge">v2.15.2</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.0',
344
+ version: 'v2.15.2',
345
345
  bots: cfg.bots || [],
346
346
  telegramToken: cfg.telegramToken || null,
347
347
  whatsappConnected: cfg.whatsappConnected || false,
@@ -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
- let providerUrl = providerChoice;
211
- if (providerChoice === 'custom') {
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,36 +238,41 @@ 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
245
 
233
- // Model listesi
234
- let modelChoices = [L.customModelEntry];
235
- for (const [domain, models] of Object.entries(COMMON_MODELS)) {
236
- if (providerUrl.includes(domain)) {
237
- modelChoices = [...models, L.customModelEntry];
238
- break;
246
+ // Model listesi — NatureCo seçildiyse atla
247
+ let providerModel;
248
+ if (isNatureCo) {
249
+ providerModel = 'natureco-default';
250
+ } else {
251
+ let modelChoices = [L.customModelEntry];
252
+ for (const [domain, models] of Object.entries(COMMON_MODELS)) {
253
+ if (providerUrl.includes(domain)) {
254
+ modelChoices = [...models, L.customModelEntry];
255
+ break;
256
+ }
239
257
  }
240
- }
241
258
 
242
- const { modelChoice } = await inquirer.prompt([{
243
- type: 'list',
244
- name: 'modelChoice',
245
- message: L.modelQ,
246
- choices: modelChoices,
247
- }]);
248
-
249
- let providerModel = modelChoice;
250
- if (modelChoice === L.customModelEntry) {
251
- const { customModel } = await inquirer.prompt([{
252
- type: 'input',
253
- name: 'customModel',
254
- message: L.customModel,
255
- validate: (v) => v.trim() ? true : L.modelRequired,
259
+ const { modelChoice } = await inquirer.prompt([{
260
+ type: 'list',
261
+ name: 'modelChoice',
262
+ message: L.modelQ,
263
+ choices: modelChoices,
256
264
  }]);
257
- providerModel = customModel.trim();
265
+
266
+ providerModel = modelChoice;
267
+ if (modelChoice === L.customModelEntry) {
268
+ const { customModel } = await inquirer.prompt([{
269
+ type: 'input',
270
+ name: 'customModel',
271
+ message: L.customModel,
272
+ validate: (v) => v.trim() ? true : L.modelRequired,
273
+ }]);
274
+ providerModel = customModel.trim();
275
+ }
258
276
  }
259
277
 
260
278
  printDone(L, `${providerUrl.replace('https://', '').split('/')[0]} · ${providerModel}`);
@@ -300,19 +318,82 @@ async function setup() {
300
318
  ],
301
319
  }]);
302
320
 
321
+ // ── Entegrasyon sub-flow'ları ──────────────────────────────────────────────
322
+ const integConfig = {};
323
+
324
+ if (integrations.includes('Telegram')) {
325
+ console.log('');
326
+ console.log(chalk.cyan(' Telegram kurulumu:'));
327
+ const { tgToken } = await inquirer.prompt([{
328
+ type: 'input',
329
+ name: 'tgToken',
330
+ message: lang === 'tr' ? ' Bot Token girin (BotFather\'dan):' : ' Enter Bot Token (from BotFather):',
331
+ validate: (v) => v.trim() ? true : (lang === 'tr' ? 'Token gerekli' : 'Token required'),
332
+ }]);
333
+ const { tgChatId } = await inquirer.prompt([{
334
+ type: 'input',
335
+ name: 'tgChatId',
336
+ 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):',
337
+ validate: (v) => v.trim() ? true : (lang === 'tr' ? 'Chat ID gerekli' : 'Chat ID required'),
338
+ }]);
339
+ console.log(chalk.gray(lang === 'tr'
340
+ ? ' 💡 Chat ID\'nizi öğrenmek için @userinfobot\'a /start yazın'
341
+ : ' 💡 To find your Chat ID, send /start to @userinfobot'));
342
+ integConfig.telegramToken = tgToken.trim();
343
+ integConfig.telegramChatId = tgChatId.trim();
344
+ // Bağlantı testi
345
+ try {
346
+ const res = await fetch(`https://api.telegram.org/bot${tgToken.trim()}/getMe`);
347
+ const data = await res.json();
348
+ if (data.ok) {
349
+ printDone(L, `Telegram @${data.result.username}`);
350
+ } else {
351
+ console.log(chalk.yellow(' ⚠ Token geçersiz görünüyor, ilerleyebilirsin'));
352
+ }
353
+ } catch {
354
+ console.log(chalk.gray(' (bağlantı testi atlandı)'));
355
+ }
356
+ }
357
+
358
+ if (integrations.includes('WhatsApp')) {
359
+ console.log('');
360
+ console.log(chalk.cyan(lang === 'tr'
361
+ ? ' WhatsApp için gateway başlatılması gerekiyor.'
362
+ : ' WhatsApp requires the gateway to be running.'));
363
+ console.log(chalk.gray(lang === 'tr'
364
+ ? ' Kurulum sonunda gateway başlatılacak, ardından QR kodu taratman gerekecek.'
365
+ : ' The gateway will start after setup — you\'ll need to scan the QR code.'));
366
+ printDone(L, 'WhatsApp');
367
+ }
368
+
369
+ if (integrations.includes('Discord')) {
370
+ console.log('');
371
+ console.log(chalk.cyan(' Discord kurulumu:'));
372
+ const { discordToken } = await inquirer.prompt([{
373
+ type: 'password',
374
+ name: 'discordToken',
375
+ message: lang === 'tr' ? ' Discord Bot Token girin:' : ' Enter Discord Bot Token:',
376
+ mask: '*',
377
+ validate: (v) => v.trim() ? true : (lang === 'tr' ? 'Token gerekli' : 'Token required'),
378
+ }]);
379
+ integConfig.discordToken = discordToken.trim();
380
+ printDone(L, 'Discord');
381
+ }
382
+
303
383
  if (integrations.length > 0) {
304
- printDone(L, integrations.join(', '));
384
+ if (!integrations.includes('Telegram') && !integrations.includes('WhatsApp') && !integrations.includes('Discord')) {
385
+ printDone(L, integrations.join(', '));
386
+ }
305
387
  console.log('');
306
- integrations.forEach(integ => {
307
- console.log(chalk.gray(` → ${L.integCmds[integ]}`));
308
- });
388
+ if (integrations.includes('Slack')) {
389
+ console.log(chalk.gray(` → natureco slack connect`));
390
+ }
309
391
  } else {
310
392
  printDone(L, L.integSkip);
311
393
  }
312
394
 
313
395
  // ── ADIM 5: Gateway ────────────────────────────────────────────────────────
314
396
  printStep(L, 5, L.gatewayTitle);
315
-
316
397
  const { startGateway } = await inquirer.prompt([{
317
398
  type: 'confirm',
318
399
  name: 'startGateway',
@@ -329,11 +410,16 @@ async function setup() {
329
410
  providerUrl,
330
411
  providerApiKey: providerApiKey.trim(),
331
412
  providerModel,
413
+ apiKey: providerApiKey.trim(), // login bypass — chat doğrudan çalışsın
332
414
  botName: botName.trim(),
333
415
  userName: userName.trim(),
334
416
  debug: existingConfig.debug || false,
335
417
  skills: existingConfig.skills || { enabled: true, list: [] },
336
418
  mcpServers: existingConfig.mcpServers || {},
419
+ // Entegrasyon config'leri
420
+ ...(integConfig.telegramToken && { telegramToken: integConfig.telegramToken }),
421
+ ...(integConfig.telegramChatId && { telegramChatId: integConfig.telegramChatId }),
422
+ ...(integConfig.discordToken && { discordToken: integConfig.discordToken }),
337
423
  };
338
424
 
339
425
  saveConfig(config);
@@ -374,6 +460,12 @@ async function setup() {
374
460
  stdio: 'ignore',
375
461
  }).unref();
376
462
  printDone(L, 'Gateway');
463
+ if (integrations.includes('WhatsApp')) {
464
+ console.log('');
465
+ console.log(chalk.yellow(lang === 'tr'
466
+ ? ' 📱 WhatsApp QR kodunu taratmak için: natureco whatsapp connect'
467
+ : ' 📱 To scan WhatsApp QR code: natureco whatsapp connect'));
468
+ }
377
469
  } catch (e) {
378
470
  console.log(chalk.yellow(` ⚠ ${e.message}`));
379
471
  }
@@ -396,7 +488,6 @@ async function setup() {
396
488
  if (startChat) {
397
489
  console.log(chalk.cyan(` ${L.chatStart}`));
398
490
  console.log('');
399
- // Chat komutunu çalıştır
400
491
  const chat = require('./chat');
401
492
  await chat([], {});
402
493
  } else {