natureco-cli 2.23.1 → 2.23.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.23.1",
3
+ "version": "2.23.2",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "main": "bin/natureco.js",
6
6
  "bin": {
@@ -721,20 +721,21 @@ ${indexPrompt}`;
721
721
  console.log();
722
722
  }
723
723
 
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
- }
724
+ try {
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
+ }
730
730
 
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);
731
+ if (stats.filesChanged > prevFilesChanged && projectIndex.packageJson?.scripts?.test) {
732
+ const fixPrompt = await runTests(projectIndex, conversationMessages, tools, providerConfig, displayBotName);
733
+ if (fixPrompt) {
734
+ await handleMessage(fixPrompt);
735
+ }
737
736
  }
737
+ } catch (err) {
738
+ console.log(chalk.red(`\n ❌ Kayıt hatası: ${err.message}\n`));
738
739
  }
739
740
  }
740
741
 
@@ -763,7 +764,11 @@ ${indexPrompt}`;
763
764
  async function promptLoop() {
764
765
  rl.question('', async (msg) => {
765
766
  process.stdout.write('\x1b[1A\x1b[2K');
766
- await handleMessage(msg);
767
+ try {
768
+ await handleMessage(msg);
769
+ } catch (err) {
770
+ console.log(chalk.red(`\n ❌ Beklenmeyen hata: ${err.message}\n`));
771
+ }
767
772
  promptLoop();
768
773
  });
769
774
  }