natureco-cli 2.23.26 → 2.23.28
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 +12 -11
package/package.json
CHANGED
package/src/commands/code.js
CHANGED
|
@@ -13,6 +13,18 @@ const { createSession, addMessageToSession } = require('../utils/sessions');
|
|
|
13
13
|
const { addToHistory } = require('../utils/history');
|
|
14
14
|
const { getToolDefinitions, executeTool } = require('../utils/tool-runner');
|
|
15
15
|
|
|
16
|
+
let rl = null;
|
|
17
|
+
|
|
18
|
+
async function confirmAction(message) {
|
|
19
|
+
return new Promise(resolve => {
|
|
20
|
+
rl.question(chalk.yellow(`⚠ ${message}\n[? Devam edilsin mi? (Y/n) `), answer => {
|
|
21
|
+
const confirmed = !answer || answer.toLowerCase() === 'y';
|
|
22
|
+
console.log(chalk.gray(` ✓ Devam edilsin mi? ${confirmed ? 'Yes' : 'No'}`));
|
|
23
|
+
resolve(confirmed);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
17
29
|
const sep = () => chalk.gray('─'.repeat(process.stdout.columns || 120));
|
|
18
30
|
|
|
@@ -206,16 +218,6 @@ async function streamMessage(providerConfig, messages, tools) {
|
|
|
206
218
|
return { text: result?.message?.content || '', toolCalls };
|
|
207
219
|
}
|
|
208
220
|
|
|
209
|
-
async function confirmAction(message) {
|
|
210
|
-
return new Promise(resolve => {
|
|
211
|
-
rl.question(chalk.yellow(`⚠ ${message}\n[? Devam edilsin mi? (Y/n) `), answer => {
|
|
212
|
-
const confirmed = !answer || answer.toLowerCase() === 'y';
|
|
213
|
-
console.log(chalk.gray(` ✓ Devam edilsin mi? ${confirmed ? 'Yes' : 'No'}`));
|
|
214
|
-
resolve(confirmed);
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
|
|
219
221
|
// ── Tool execution ────────────────────────────────────────────────────────────
|
|
220
222
|
const DANGEROUS = [/\brm\b/, /\brmdir\b/, /\bdelete\b/i, /\bdrop\b/i, /\btruncate\b/i];
|
|
221
223
|
|
|
@@ -680,7 +682,6 @@ ${indexPrompt}`;
|
|
|
680
682
|
}
|
|
681
683
|
|
|
682
684
|
// ── Input loop — readline herhangi bir sebepten kapanırsa yeniden oluştur ───
|
|
683
|
-
let rl;
|
|
684
685
|
|
|
685
686
|
function createRl() {
|
|
686
687
|
if (rl) {
|