natureco-cli 2.15.1 → 2.15.3

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.1",
3
+ "version": "2.15.3",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "main": "bin/natureco.js",
6
6
  "bin": {
@@ -75,7 +75,7 @@ async function chat(botName, options = {}) {
75
75
  }
76
76
  } else {
77
77
  // Bot adı ile eşleşen botu bul
78
- bot = botList.bots.find(b => b.name.toLowerCase() === botName.toLowerCase());
78
+ bot = botList.bots.find(b => b.name && botName && b.name.toLowerCase() === botName.toLowerCase());
79
79
 
80
80
  if (!bot) {
81
81
  console.log(chalk.red(`\n❌ Bot "${botName}" not found.\n`));
@@ -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.1</div>
214
+ <div class="version-badge" id="version-badge">v2.15.3</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.1',
344
+ version: 'v2.15.3',
345
345
  bots: cfg.bots || [],
346
346
  telegramToken: cfg.telegramToken || null,
347
347
  whatsappConnected: cfg.whatsappConnected || false,
@@ -242,31 +242,37 @@ async function setup() {
242
242
  mask: '*',
243
243
  validate: (v) => v.trim() ? true : L.apiKeyRequired,
244
244
  }]);
245
- // Model listesi
246
- let modelChoices = [L.customModelEntry];
247
- for (const [domain, models] of Object.entries(COMMON_MODELS)) {
248
- if (providerUrl.includes(domain)) {
249
- modelChoices = [...models, L.customModelEntry];
250
- break;
251
- }
252
- }
253
245
 
254
- const { modelChoice } = await inquirer.prompt([{
255
- type: 'list',
256
- name: 'modelChoice',
257
- message: L.modelQ,
258
- choices: modelChoices,
259
- }]);
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
+ }
257
+ }
260
258
 
261
- let providerModel = modelChoice;
262
- if (modelChoice === L.customModelEntry) {
263
- const { customModel } = await inquirer.prompt([{
264
- type: 'input',
265
- name: 'customModel',
266
- message: L.customModel,
267
- 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,
268
264
  }]);
269
- 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
+ }
270
276
  }
271
277
 
272
278
  printDone(L, `${providerUrl.replace('https://', '').split('/')[0]} · ${providerModel}`);
@@ -284,6 +290,9 @@ async function setup() {
284
290
 
285
291
  printDone(L, botName.trim());
286
292
 
293
+ // botName'in string olduğunu garantile
294
+ const safeBotName = String(botName || 'NatureBot').trim();
295
+
287
296
  // ── ADIM 3: Kullanıcı adı ──────────────────────────────────────────────────
288
297
  printStep(L, 3, L.userNameTitle);
289
298
 
@@ -405,7 +414,7 @@ async function setup() {
405
414
  providerApiKey: providerApiKey.trim(),
406
415
  providerModel,
407
416
  apiKey: providerApiKey.trim(), // login bypass — chat doğrudan çalışsın
408
- botName: botName.trim(),
417
+ botName: safeBotName,
409
418
  userName: userName.trim(),
410
419
  debug: existingConfig.debug || false,
411
420
  skills: existingConfig.skills || { enabled: true, list: [] },
@@ -423,7 +432,7 @@ async function setup() {
423
432
  try {
424
433
  saveMemory(botId, {
425
434
  name: userName.trim(),
426
- botName: botName.trim(),
435
+ botName: safeBotName,
427
436
  nickname: '',
428
437
  preferences: [],
429
438
  facts: [],
@@ -438,7 +447,7 @@ async function setup() {
438
447
  console.log('');
439
448
  console.log(chalk.gray(` ${L.summaryProvider}:`), chalk.white(providerUrl.replace('https://', '').split('/')[0]));
440
449
  console.log(chalk.gray(` ${L.summaryModel}:`), chalk.white(providerModel));
441
- console.log(chalk.gray(` ${L.summaryBot}:`), chalk.cyan(botName.trim()));
450
+ console.log(chalk.gray(` ${L.summaryBot}:`), chalk.cyan(safeBotName));
442
451
  console.log(chalk.gray(` ${L.summaryUser}:`), chalk.white(userName.trim()));
443
452
  console.log(chalk.gray(` ${L.summaryConfig}:`), chalk.gray(CONFIG_FILE));
444
453
  console.log('');
@@ -483,7 +492,7 @@ async function setup() {
483
492
  console.log(chalk.cyan(` ${L.chatStart}`));
484
493
  console.log('');
485
494
  const chat = require('./chat');
486
- await chat([], {});
495
+ await chat([safeBotName], {});
487
496
  } else {
488
497
  console.log(chalk.gray(` ${L.chatSkip}`));
489
498
  console.log('');