natureco-cli 2.23.1 → 2.23.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.23.1",
3
+ "version": "2.23.3",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "main": "bin/natureco.js",
6
6
  "bin": {
@@ -698,7 +698,12 @@ ${indexPrompt}`;
698
698
  }
699
699
  conversationMessages.push(assistantMsg);
700
700
 
701
- if (!streamResult.toolCalls?.length) break;
701
+ if (!streamResult.toolCalls?.length) {
702
+ if (!streamResult.text) {
703
+ console.log(chalk.yellow('\n ⚠️ Model cevap vermedi, tekrar deneyin.\n'));
704
+ }
705
+ break;
706
+ }
702
707
 
703
708
  console.log(chalk.yellow(`\n🔧 ${streamResult.toolCalls.length} tool çalıştırılıyor...\n`));
704
709
 
@@ -721,20 +726,21 @@ ${indexPrompt}`;
721
726
  console.log();
722
727
  }
723
728
 
724
- // Session'a kaydet
725
- const lastAssistant = [...conversationMessages].reverse().find(m => m.role === 'assistant');
726
- if (lastAssistant?.content) {
727
- addToHistory(bot.id, userMessage, lastAssistant.content, null);
728
- addMessageToSession(bot.id, session.id, userMessage, lastAssistant.content);
729
- }
729
+ try {
730
+ const lastAssistant = [...conversationMessages].reverse().find(m => m.role === 'assistant');
731
+ if (lastAssistant?.content) {
732
+ addToHistory(bot.id, userMessage, lastAssistant.content, null);
733
+ addMessageToSession(bot.id, session.id, userMessage, lastAssistant.content);
734
+ }
730
735
 
731
- // ── Test runner dosya değiştiyse sor ───────────────────────────────────
732
- if (stats.filesChanged > prevFilesChanged && projectIndex.packageJson?.scripts?.test) {
733
- const fixPrompt = await runTests(projectIndex, conversationMessages, tools, providerConfig, displayBotName);
734
- if (fixPrompt) {
735
- // Test hatasını agent'a gönder
736
- await handleMessage(fixPrompt);
736
+ if (stats.filesChanged > prevFilesChanged && projectIndex.packageJson?.scripts?.test) {
737
+ const fixPrompt = await runTests(projectIndex, conversationMessages, tools, providerConfig, displayBotName);
738
+ if (fixPrompt) {
739
+ await handleMessage(fixPrompt);
740
+ }
737
741
  }
742
+ } catch (err) {
743
+ console.log(chalk.red(`\n ❌ Kayıt hatası: ${err.message}\n`));
738
744
  }
739
745
  }
740
746
 
@@ -763,7 +769,11 @@ ${indexPrompt}`;
763
769
  async function promptLoop() {
764
770
  rl.question('', async (msg) => {
765
771
  process.stdout.write('\x1b[1A\x1b[2K');
766
- await handleMessage(msg);
772
+ try {
773
+ await handleMessage(msg);
774
+ } catch (err) {
775
+ console.log(chalk.red(`\n ❌ Beklenmeyen hata: ${err.message}\n`));
776
+ }
767
777
  promptLoop();
768
778
  });
769
779
  }
@@ -665,7 +665,7 @@ function startCronJobs(config) {
665
665
  'Content-Type': 'application/json',
666
666
  },
667
667
  body: JSON.stringify({
668
- model: cfg.providerModel || 'llama-3.1-8b-instant',
668
+ model: cfg.providerModel || 'llama-3.3-70b-versatile',
669
669
  messages: [{ role: 'user', content: cronJob.prompt }],
670
670
  temperature: 0.7,
671
671
  max_tokens: 1000,
@@ -636,7 +636,7 @@ async function migrate(options) {
636
636
  console.log(chalk.gray(' - Provider URL ve API key ayarlayın:'));
637
637
  console.log(chalk.cyan(' natureco config set providerUrl https://api.groq.com/openai/v1'));
638
638
  console.log(chalk.cyan(' natureco config set providerApiKey gsk_xxx'));
639
- console.log(chalk.cyan(' natureco config set providerModel llama-3.1-8b-instant'));
639
+ console.log(chalk.cyan(' natureco config set providerModel llama-3.3-70b-versatile'));
640
640
  console.log('');
641
641
  }
642
642
 
package/src/utils/api.js CHANGED
@@ -359,7 +359,7 @@ function getProviderConfig() {
359
359
  return {
360
360
  url: config.providerUrl,
361
361
  apiKey: config.providerApiKey,
362
- model: config.providerModel || 'llama-3.1-8b-instant',
362
+ model: config.providerModel || 'llama-3.3-70b-versatile',
363
363
  isAnthropic: config.providerUrl.includes('anthropic.com')
364
364
  };
365
365
  }
@@ -369,7 +369,7 @@ function getProviderConfig() {
369
369
  return {
370
370
  url: 'https://api.groq.com/openai/v1',
371
371
  apiKey: config.groqApiKey,
372
- model: config.groqModel || 'llama-3.1-8b-instant',
372
+ model: config.groqModel || 'llama-3.3-70b-versatile',
373
373
  isAnthropic: false
374
374
  };
375
375
  }
@@ -527,7 +527,7 @@ async function sendMessageToProvider(apiKey, message, conversationId = null, sys
527
527
  'Provider not configured. Set with:\n' +
528
528
  ' natureco config set providerUrl https://api.groq.com/openai/v1\n' +
529
529
  ' natureco config set providerApiKey gsk_xxx\n' +
530
- ' natureco config set providerModel llama-3.1-8b-instant'
530
+ ' natureco config set providerModel llama-3.3-70b-versatile'
531
531
  );
532
532
  }
533
533