natureco-cli 2.23.3 → 2.23.4
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 +30 -18
package/package.json
CHANGED
package/src/commands/code.js
CHANGED
|
@@ -744,27 +744,38 @@ ${indexPrompt}`;
|
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
-
// ── Input loop
|
|
748
|
-
|
|
747
|
+
// ── Input loop — readline herhangi bir sebepten kapanırsa yeniden oluştur ───
|
|
748
|
+
let rl;
|
|
749
749
|
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
if (conversationMessages.filter(m => m.role === 'user').length > 0) {
|
|
754
|
-
try {
|
|
755
|
-
const { save } = await inquirer.prompt([{
|
|
756
|
-
type: 'confirm', name: 'save',
|
|
757
|
-
message: chalk.yellow("Bu session'ı proje hafızasına kaydet?"),
|
|
758
|
-
default: true,
|
|
759
|
-
}]);
|
|
760
|
-
if (save) await saveProjectMemory(conversationMessages, providerConfig);
|
|
761
|
-
} catch {}
|
|
750
|
+
function createRl() {
|
|
751
|
+
if (rl) {
|
|
752
|
+
try { rl.removeAllListeners(); rl.close(); } catch {}
|
|
762
753
|
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
754
|
+
rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: true });
|
|
755
|
+
|
|
756
|
+
rl.on('SIGINT', async () => {
|
|
757
|
+
console.log('\n');
|
|
758
|
+
rl.pause();
|
|
759
|
+
if (conversationMessages.filter(m => m.role === 'user').length > 0) {
|
|
760
|
+
try {
|
|
761
|
+
const { save } = await inquirer.prompt([{
|
|
762
|
+
type: 'confirm', name: 'save',
|
|
763
|
+
message: chalk.yellow("Bu session'ı proje hafızasına kaydet?"),
|
|
764
|
+
default: true,
|
|
765
|
+
}]);
|
|
766
|
+
if (save) await saveProjectMemory(conversationMessages, providerConfig);
|
|
767
|
+
} catch {}
|
|
768
|
+
}
|
|
769
|
+
showSummary();
|
|
770
|
+
process.exit(0);
|
|
771
|
+
});
|
|
766
772
|
|
|
767
|
-
|
|
773
|
+
// close event → inquirer tool onayı sırasında tetiklenebilir, hemen yeniden oluştur
|
|
774
|
+
rl.on('close', () => {
|
|
775
|
+
if (process.exitCode !== undefined) return;
|
|
776
|
+
createRl();
|
|
777
|
+
});
|
|
778
|
+
}
|
|
768
779
|
|
|
769
780
|
async function promptLoop() {
|
|
770
781
|
rl.question('', async (msg) => {
|
|
@@ -778,6 +789,7 @@ ${indexPrompt}`;
|
|
|
778
789
|
});
|
|
779
790
|
}
|
|
780
791
|
|
|
792
|
+
createRl();
|
|
781
793
|
promptLoop();
|
|
782
794
|
}
|
|
783
795
|
|