natureco-cli 2.23.22 → 2.23.24
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/code.js +16 -10
package/package.json
CHANGED
package/src/commands/code.js
CHANGED
|
@@ -603,11 +603,6 @@ ${indexPrompt}`;
|
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
|
|
606
|
-
if (userMessage === 'exit' || userMessage === 'quit') {
|
|
607
|
-
showSummary();
|
|
608
|
-
process.exit(0);
|
|
609
|
-
}
|
|
610
|
-
|
|
611
606
|
stats.messageCount++;
|
|
612
607
|
console.log(chalk.white('You ') + userMessage);
|
|
613
608
|
conversationMessages.push({ role: 'user', content: userMessage });
|
|
@@ -725,15 +720,26 @@ ${indexPrompt}`;
|
|
|
725
720
|
}
|
|
726
721
|
|
|
727
722
|
async function promptLoop() {
|
|
728
|
-
|
|
723
|
+
while (true) {
|
|
724
|
+
const msg = await new Promise(resolve => {
|
|
725
|
+
rl.question(chalk.gray('> '), resolve);
|
|
726
|
+
});
|
|
727
|
+
|
|
729
728
|
process.stdout.write('\x1b[1A\x1b[2K');
|
|
729
|
+
|
|
730
|
+
const trimmed = msg.trim();
|
|
731
|
+
if (!trimmed) continue;
|
|
732
|
+
if (['exit', 'quit', 'çıkış', 'q'].includes(trimmed.toLowerCase())) {
|
|
733
|
+
rl.close();
|
|
734
|
+
process.exit(0);
|
|
735
|
+
}
|
|
736
|
+
|
|
730
737
|
try {
|
|
731
|
-
await handleMessage(
|
|
738
|
+
await handleMessage(trimmed);
|
|
732
739
|
} catch (err) {
|
|
733
|
-
console.
|
|
740
|
+
console.error(chalk.red('Error: ' + err.message));
|
|
734
741
|
}
|
|
735
|
-
|
|
736
|
-
});
|
|
742
|
+
}
|
|
737
743
|
}
|
|
738
744
|
|
|
739
745
|
createRl();
|