natureco-cli 5.53.0 → 5.54.0
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/account.js +34 -30
- package/src/commands/ask.js +5 -3
- package/src/commands/chat.js +5 -3
- package/src/commands/help.js +230 -226
- package/src/commands/login.js +58 -55
- package/src/commands/repl.js +11 -9
- package/src/commands/run.js +8 -6
- package/src/utils/dangerous.js +19 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.54.0",
|
|
4
4
|
"description": "OpenClaw'dan daha güvenli, daha hızlı, daha ucuz AI agent CLI. Multi-agent, self-evolving skills, audit log, maliyet optimizasyonu ve NatureCo platform-native.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"natureco": "bin/natureco.js"
|
package/src/commands/account.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
const inquirer = require('../utils/inquirer-wrapper');
|
|
2
2
|
const chalk = require('chalk');
|
|
3
3
|
const acc = require('../utils/natureco-account');
|
|
4
|
+
const { getLang } = require('../utils/i18n');
|
|
5
|
+
|
|
6
|
+
const L = (tr, en) => (getLang() === 'en' ? en : tr);
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
|
-
* `natureco account [login|logout|whoami]` —
|
|
7
|
-
* developers.natureco.me API-KEY
|
|
8
|
-
*
|
|
9
|
+
* `natureco account [login|logout|whoami]` — one NatureCo account (SSO).
|
|
10
|
+
* Separate from the developers.natureco.me API-KEY login (`natureco login`):
|
|
11
|
+
* this is your personal identity with your natureco.me account, shared
|
|
12
|
+
* across the whole ecosystem.
|
|
9
13
|
*/
|
|
10
14
|
async function account(action) {
|
|
11
15
|
const sub = (action || 'whoami').toLowerCase();
|
|
@@ -20,42 +24,42 @@ async function doLogin() {
|
|
|
20
24
|
console.log(chalk.green.bold(' (•ᴥ•)'));
|
|
21
25
|
console.log(chalk.green(' />🌿'));
|
|
22
26
|
console.log('');
|
|
23
|
-
console.log(chalk.green.bold(' NatureCo Hesabı — Giriş'));
|
|
24
|
-
console.log(chalk.gray(' natureco.me hesabınla ekosistemin her yerinde tek kimlik
|
|
27
|
+
console.log(chalk.green.bold(' ' + L('NatureCo Hesabı — Giriş', 'NatureCo Account — Sign in')));
|
|
28
|
+
console.log(chalk.gray(' ' + L('natureco.me hesabınla ekosistemin her yerinde tek kimlik.', 'One identity across the whole ecosystem with your natureco.me account.') + '\n'));
|
|
25
29
|
console.log(chalk.gray(' ' + '─'.repeat(48)) + '\n');
|
|
26
30
|
|
|
27
31
|
const { email } = await inquirer.prompt([{
|
|
28
32
|
type: 'input',
|
|
29
33
|
name: 'email',
|
|
30
|
-
message: ' E-posta:',
|
|
31
|
-
validate: (v) => (/.+@.+\..+/.test((v || '').trim()) ? true : 'Geçerli bir e-posta gir'),
|
|
34
|
+
message: L(' E-posta:', ' Email:'),
|
|
35
|
+
validate: (v) => (/.+@.+\..+/.test((v || '').trim()) ? true : L('Geçerli bir e-posta gir', 'Enter a valid email')),
|
|
32
36
|
}]);
|
|
33
37
|
|
|
34
38
|
const { method } = await inquirer.prompt([{
|
|
35
39
|
type: 'list',
|
|
36
40
|
name: 'method',
|
|
37
|
-
message: ' Giriş yöntemi:',
|
|
41
|
+
message: L(' Giriş yöntemi:', ' Sign-in method:'),
|
|
38
42
|
choices: [
|
|
39
|
-
{ name: 'Şifre', value: 'password' },
|
|
40
|
-
{ name: 'E-postama kod gönder (OTP)', value: 'otp' },
|
|
43
|
+
{ name: L('Şifre', 'Password'), value: 'password' },
|
|
44
|
+
{ name: L('E-postama kod gönder (OTP)', 'Email me a code (OTP)'), value: 'otp' },
|
|
41
45
|
],
|
|
42
46
|
}]);
|
|
43
47
|
|
|
44
48
|
try {
|
|
45
49
|
if (method === 'password') {
|
|
46
|
-
const { password } = await inquirer.prompt([{ type: 'password', name: 'password', message: ' Şifre:', mask: '*' }]);
|
|
47
|
-
console.log(chalk.gray('\n Doğrulanıyor...'));
|
|
50
|
+
const { password } = await inquirer.prompt([{ type: 'password', name: 'password', message: L(' Şifre:', ' Password:'), mask: '*' }]);
|
|
51
|
+
console.log(chalk.gray('\n ' + L('Doğrulanıyor...', 'Verifying...')));
|
|
48
52
|
await acc.loginWithPassword(email.trim(), password);
|
|
49
53
|
} else {
|
|
50
|
-
console.log(chalk.gray('\n Gönderiliyor...'));
|
|
54
|
+
console.log(chalk.gray('\n ' + L('Gönderiliyor...', 'Sending...')));
|
|
51
55
|
await acc.sendOtp(email.trim());
|
|
52
|
-
console.log(chalk.gray(' ') + chalk.cyan(email.trim()) + chalk.gray(' adresine e-posta gönderildi.'));
|
|
53
|
-
console.log(chalk.gray(' 6 haneli kod geldiyse kodu, giriş linki geldiyse linki yapıştır.'));
|
|
56
|
+
console.log(chalk.gray(' ') + chalk.cyan(email.trim()) + chalk.gray(L(' adresine e-posta gönderildi.', ' — email sent.')));
|
|
57
|
+
console.log(chalk.gray(' ' + L('6 haneli kod geldiyse kodu, giriş linki geldiyse linki yapıştır.', 'Paste the 6-digit code, or the login link if you got one.')));
|
|
54
58
|
const { token } = await inquirer.prompt([{
|
|
55
|
-
type: 'input', name: 'token', message: ' Kod veya giriş linki:',
|
|
56
|
-
validate: (v) => ((v || '').trim().length >= 6 ? true : 'Kodu ya da linki gir'),
|
|
59
|
+
type: 'input', name: 'token', message: L(' Kod veya giriş linki:', ' Code or login link:'),
|
|
60
|
+
validate: (v) => ((v || '').trim().length >= 6 ? true : L('Kodu ya da linki gir', 'Enter the code or link')),
|
|
57
61
|
}]);
|
|
58
|
-
console.log(chalk.gray('\n Doğrulanıyor...'));
|
|
62
|
+
console.log(chalk.gray('\n ' + L('Doğrulanıyor...', 'Verifying...')));
|
|
59
63
|
const val = token.trim();
|
|
60
64
|
if (/^https?:\/\//i.test(val) || val.includes('token')) {
|
|
61
65
|
await acc.verifyLink(val);
|
|
@@ -64,41 +68,41 @@ async function doLogin() {
|
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
} catch (err) {
|
|
67
|
-
console.log(chalk.red(`\n ❌ ${err.message || 'Giriş başarısız'}\n`));
|
|
71
|
+
console.log(chalk.red(`\n ❌ ${err.message || L('Giriş başarısız', 'Sign-in failed')}\n`));
|
|
68
72
|
process.exit(1);
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
const me = await acc.whoami();
|
|
72
|
-
console.log(chalk.green('\n ✓ Giriş başarılı!'));
|
|
73
|
-
if (me && me.email) console.log(chalk.gray(' Hoş geldin, ') + chalk.white(me.email));
|
|
74
|
-
console.log(chalk.gray(' Oturum: ~/.natureco/auth.json'));
|
|
76
|
+
console.log(chalk.green('\n ✓ ' + L('Giriş başarılı!', 'Signed in!')));
|
|
77
|
+
if (me && me.email) console.log(chalk.gray(' ' + L('Hoş geldin, ', 'Welcome, ')) + chalk.white(me.email));
|
|
78
|
+
console.log(chalk.gray(' ' + L('Oturum: ', 'Session: ') + '~/.natureco/auth.json'));
|
|
75
79
|
console.log('');
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
async function doLogout() {
|
|
79
83
|
if (!acc.isLoggedIn()) {
|
|
80
|
-
console.log(chalk.gray('\n Zaten giriş yapılmam
|
|
84
|
+
console.log(chalk.gray('\n ' + L('Zaten giriş yapılmamış.', 'Not signed in.') + '\n'));
|
|
81
85
|
return;
|
|
82
86
|
}
|
|
83
87
|
const who = acc.currentEmail();
|
|
84
88
|
acc.logout();
|
|
85
|
-
console.log(chalk.green(
|
|
89
|
+
console.log(chalk.green('\n ✓ ' + L('Çıkış yapıldı', 'Signed out') + `${who ? ' (' + who + ')' : ''}.\n`));
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
async function doWhoami() {
|
|
89
93
|
if (!acc.isLoggedIn()) {
|
|
90
|
-
console.log(chalk.gray('\n NatureCo hesabına giriş yapılmamış.'));
|
|
91
|
-
console.log(chalk.gray(' Giriş: ') + chalk.cyan('natureco account login') + '\n');
|
|
94
|
+
console.log(chalk.gray('\n ' + L('NatureCo hesabına giriş yapılmamış.', 'Not signed in to a NatureCo account.')));
|
|
95
|
+
console.log(chalk.gray(' ' + L('Giriş: ', 'Sign in: ')) + chalk.cyan('natureco account login') + '\n');
|
|
92
96
|
return;
|
|
93
97
|
}
|
|
94
|
-
console.log(chalk.gray('\n Doğrulanıyor...'));
|
|
98
|
+
console.log(chalk.gray('\n ' + L('Doğrulanıyor...', 'Verifying...')));
|
|
95
99
|
const me = await acc.whoami();
|
|
96
100
|
if (!me) {
|
|
97
|
-
console.log(chalk.yellow('\n ⚠ Oturum süresi dolmuş görünüyor. Tekrar giriş yap: ') + chalk.cyan('natureco account login') + '\n');
|
|
101
|
+
console.log(chalk.yellow('\n ⚠ ' + L('Oturum süresi dolmuş görünüyor. Tekrar giriş yap: ', 'Your session looks expired. Sign in again: ')) + chalk.cyan('natureco account login') + '\n');
|
|
98
102
|
return;
|
|
99
103
|
}
|
|
100
|
-
console.log(chalk.green.bold('\n ⬡ NatureCo Hesabı'));
|
|
101
|
-
console.log(chalk.gray(' E-posta: ') + chalk.white(me.email || '-'));
|
|
104
|
+
console.log(chalk.green.bold('\n ⬡ ' + L('NatureCo Hesabı', 'NatureCo Account')));
|
|
105
|
+
console.log(chalk.gray(' ' + L('E-posta: ', 'Email: ')) + chalk.white(me.email || '-'));
|
|
102
106
|
console.log(chalk.gray(' ID: ') + chalk.gray(me.id || '-'));
|
|
103
107
|
console.log('');
|
|
104
108
|
}
|
package/src/commands/ask.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const chalk = require('chalk');
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const { getLang: _getLang } = require('../utils/i18n');
|
|
3
|
+
const L = (tr, en) => (_getLang() === 'en' ? en : tr);
|
|
2
4
|
const { getApiKey, getConfig } = require('../utils/config');
|
|
3
5
|
const { getBots, sendMessage } = require('../utils/api');
|
|
4
6
|
const { getSkillPrompts } = require('../utils/skills');
|
|
@@ -9,7 +11,7 @@ async function ask(question, options = {}) {
|
|
|
9
11
|
const apiKey = getApiKey();
|
|
10
12
|
|
|
11
13
|
if (!apiKey) {
|
|
12
|
-
console.log(chalk.red('\n❌ Giriş yapılmamış. Önce "natureco login" çalıştırın.\n'));
|
|
14
|
+
console.log(chalk.red(L('\n❌ Giriş yapılmamış. Önce "natureco login" çalıştırın.\n', '\n❌ Not signed in. Run "natureco login" first.\n')));
|
|
13
15
|
process.exit(1);
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -26,7 +28,7 @@ async function ask(question, options = {}) {
|
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
if (!defaultBotId) {
|
|
29
|
-
console.log(chalk.red('\n❌ Hiç bot bulunamadı. "natureco chat" ile yerel sağlayıcıyı kullanabilir ya da bir bot oluşturabilirsiniz.\n'));
|
|
31
|
+
console.log(chalk.red(L('\n❌ Hiç bot bulunamadı. "natureco chat" ile yerel sağlayıcıyı kullanabilir ya da bir bot oluşturabilirsiniz.\n', '\n❌ No bots found. Use "natureco chat" for the local provider, or create a bot.\n')));
|
|
30
32
|
process.exit(1);
|
|
31
33
|
}
|
|
32
34
|
|
package/src/commands/chat.js
CHANGED
|
@@ -5,7 +5,9 @@ const readline = require('readline');
|
|
|
5
5
|
const inquirer = require('../utils/inquirer-wrapper');
|
|
6
6
|
const TB = require('../utils/token-budget');
|
|
7
7
|
const tui = require('../utils/tui');
|
|
8
|
-
const chalk = require('chalk');
|
|
8
|
+
const chalk = require('chalk');
|
|
9
|
+
const { getLang: _getLang } = require('../utils/i18n');
|
|
10
|
+
const L = (tr, en) => (_getLang() === 'en' ? en : tr);
|
|
9
11
|
const { getApiKey, getConfig } = require('../utils/config');
|
|
10
12
|
const repl = require('./repl');
|
|
11
13
|
const { getSkillPrompts, getSkills } = require('../utils/skills');
|
|
@@ -273,7 +275,7 @@ async function chat(botName, options = {}) {
|
|
|
273
275
|
session = createSession(bot.id, bot.name);
|
|
274
276
|
console.log(chalk.green(`Bot değişti: ${newBot.name}`));
|
|
275
277
|
} else {
|
|
276
|
-
console.log(chalk.red(
|
|
278
|
+
console.log(chalk.red(`${L('Bot bulunamadı', 'Bot not found')}: ${newName}`));
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
281
|
console.log();
|
|
@@ -300,7 +302,7 @@ async function chat(botName, options = {}) {
|
|
|
300
302
|
console.log();
|
|
301
303
|
return;
|
|
302
304
|
case 'help':
|
|
303
|
-
console.log(chalk.yellow('Chat Komutları:'));
|
|
305
|
+
console.log(chalk.yellow(L('Chat Komutları:', 'Chat commands:')));
|
|
304
306
|
[
|
|
305
307
|
['/clear', 'Ekranı temizle'],
|
|
306
308
|
['/bot [ad]', 'Bot değiştir'],
|
package/src/commands/help.js
CHANGED
|
@@ -1,226 +1,230 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* natureco help — Modern TUI help screen (v4.6+)
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const chalk = require('chalk');
|
|
9
|
-
const tui = require('../utils/tui');
|
|
10
|
-
const { getConfig } = require('../utils/config');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{ name: 'natureco
|
|
36
|
-
{ name: 'natureco
|
|
37
|
-
{ name: 'natureco
|
|
38
|
-
{ name: 'natureco
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{ name: 'natureco
|
|
50
|
-
{ name: 'natureco
|
|
51
|
-
{ name: 'natureco
|
|
52
|
-
{ name: 'natureco
|
|
53
|
-
{ name: 'natureco
|
|
54
|
-
{ name: 'natureco
|
|
55
|
-
{ name: 'natureco
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{ name: 'natureco
|
|
67
|
-
{ name: 'natureco
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{ name: 'natureco cost
|
|
79
|
-
{ name: 'natureco cost
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{ name: 'natureco
|
|
91
|
-
{ name: 'natureco
|
|
92
|
-
{ name: 'natureco
|
|
93
|
-
{ name: 'natureco
|
|
94
|
-
{ name: 'natureco
|
|
95
|
-
{ name: 'natureco
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{ name: 'natureco
|
|
107
|
-
{ name: 'natureco
|
|
108
|
-
{ name: 'natureco
|
|
109
|
-
{ name: 'natureco
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
{ name: 'natureco skills
|
|
121
|
-
{ name: 'natureco
|
|
122
|
-
{ name: 'natureco
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
{ name: 'natureco
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
{ name: 'natureco
|
|
145
|
-
{ name: 'natureco
|
|
146
|
-
{ name: 'natureco
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
{ name: 'natureco
|
|
158
|
-
{ name: 'natureco
|
|
159
|
-
{ name: 'natureco
|
|
160
|
-
{ name: 'natureco
|
|
161
|
-
{ name: 'natureco
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
{ name: '/
|
|
173
|
-
{ name: '/
|
|
174
|
-
{ name: '/
|
|
175
|
-
{ name: '/
|
|
176
|
-
{ name: '/
|
|
177
|
-
{ name: '/
|
|
178
|
-
{ name: '/
|
|
179
|
-
{ name: '/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (config.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
console.log('');
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
1
|
+
/**
|
|
2
|
+
* natureco help — Modern TUI help screen (v4.6+)
|
|
3
|
+
*
|
|
4
|
+
* Categorized command list; uses the TUI box + table engine.
|
|
5
|
+
* Bilingual (tr|en) via the i18n `L(tr, en)` helper.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const chalk = require('chalk');
|
|
9
|
+
const tui = require('../utils/tui');
|
|
10
|
+
const { getConfig } = require('../utils/config');
|
|
11
|
+
const { getLang } = require('../utils/i18n');
|
|
12
|
+
|
|
13
|
+
const L = (tr, en) => (getLang() === 'en' ? en : tr);
|
|
14
|
+
|
|
15
|
+
function help() {
|
|
16
|
+
const config = getConfig() || {};
|
|
17
|
+
const version = require('../../package.json').version;
|
|
18
|
+
const width = 64;
|
|
19
|
+
|
|
20
|
+
console.log('');
|
|
21
|
+
|
|
22
|
+
// Header — TUI box
|
|
23
|
+
const headerLines = [
|
|
24
|
+
tui.styled(' ╭' + '─'.repeat(width) + '╮', { color: tui.PALETTE.primary }),
|
|
25
|
+
tui.styled(' │', { color: tui.PALETTE.primary }) + ' 🌿 ' + tui.styled('NatureCo CLI', { color: tui.PALETTE.primary, bold: true }) + tui.C.muted(' v' + version) + ' ' + tui.C.muted('Terminal-native AI agent') + tui.styled(' │', { color: tui.PALETTE.primary }),
|
|
26
|
+
tui.styled(' ╰' + '─'.repeat(width) + '╯', { color: tui.PALETTE.primary }),
|
|
27
|
+
];
|
|
28
|
+
console.log(headerLines.join('\n'));
|
|
29
|
+
|
|
30
|
+
const sections = [
|
|
31
|
+
{
|
|
32
|
+
icon: '⚙️ ',
|
|
33
|
+
title: L('Kurulum & Giriş', 'Setup & Sign-in'),
|
|
34
|
+
rows: [
|
|
35
|
+
{ name: 'natureco setup', desc: L('İlk kurulum sihirbazı (provider, bot)', 'First-run wizard (provider, bot)') },
|
|
36
|
+
{ name: 'natureco login', desc: L('API key ile giriş yap', 'Sign in with an API key') },
|
|
37
|
+
{ name: 'natureco account', desc: L('NatureCo hesabı / SSO (login|logout|whoami)', 'NatureCo account / SSO (login|logout|whoami)') },
|
|
38
|
+
{ name: 'natureco lang', desc: L('Arayüz dili (tr | en)', 'Interface language (tr | en)') },
|
|
39
|
+
{ name: 'natureco logout', desc: L('Çıkış yap', 'Sign out') },
|
|
40
|
+
{ name: 'natureco update', desc: L('Yeni versiyon kontrolü', 'Check for a new version') },
|
|
41
|
+
{ name: 'natureco doctor', desc: L('Sistem sağlığı kontrolü (10 check)', 'System health check (10 checks)') },
|
|
42
|
+
{ name: 'natureco status', desc: L('Sistem durumu (TUI kart)', 'System status (TUI card)') },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
icon: '💬',
|
|
47
|
+
title: 'Chat & Agent',
|
|
48
|
+
rows: [
|
|
49
|
+
{ name: 'natureco chat', desc: L('Sohbet başlat (→ REPL engine)', 'Start a chat (→ REPL engine)') },
|
|
50
|
+
{ name: 'natureco chat <bot>', desc: L('Belirli bot ile sohbet', 'Chat with a specific bot') },
|
|
51
|
+
{ name: 'natureco chat --resume', desc: L('Son oturuma dön', 'Resume the last session') },
|
|
52
|
+
{ name: 'natureco repl', desc: L('İnteraktif REPL (persistent memory)', 'Interactive REPL (persistent memory)') },
|
|
53
|
+
{ name: 'natureco repl --resume <id>', desc: L('Önceki oturumu yükle', 'Load a previous session') },
|
|
54
|
+
{ name: 'natureco ask "<soru>"', desc: L('Tek seferlik soru', 'One-off question') },
|
|
55
|
+
{ name: 'natureco code <file>', desc: L('Code agent (Claude Code alternatifi)', 'Code agent (Claude Code alternative)') },
|
|
56
|
+
{ name: 'natureco run <script.md>', desc: L('Markdown script çalıştır', 'Run a Markdown script') },
|
|
57
|
+
{ name: 'natureco bots', desc: L('Bot listesi', 'List bots') },
|
|
58
|
+
{ name: 'natureco team list', desc: L('Multi-agent tipleri (8 uzman)', 'Multi-agent types (8 specialists)') },
|
|
59
|
+
{ name: 'natureco team spawn <type> <task>', desc: L('Sub-agent çalıştır', 'Run a sub-agent') },
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
icon: '🛡️ ',
|
|
64
|
+
title: L('Güvenlik & Gözlem', 'Security & Observability'),
|
|
65
|
+
rows: [
|
|
66
|
+
{ name: 'natureco audit today', desc: L('Bugünkü loglar', "Today's logs") },
|
|
67
|
+
{ name: 'natureco audit stats', desc: L('24 saat istatistik', '24-hour statistics') },
|
|
68
|
+
{ name: 'natureco audit files', desc: L('Log dosyaları', 'Log files') },
|
|
69
|
+
{ name: 'natureco audit search <q>', desc: L('Log ara', 'Search logs') },
|
|
70
|
+
{ name: 'natureco security audit', desc: L('Güvenlik denetimi', 'Security audit') },
|
|
71
|
+
{ name: 'natureco doctor check <name>', desc: L('Tek sağlık check', 'Single health check') },
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
icon: '💰',
|
|
76
|
+
title: L('Maliyet', 'Cost'),
|
|
77
|
+
rows: [
|
|
78
|
+
{ name: 'natureco cost today', desc: L('Bugünkü maliyet', "Today's cost") },
|
|
79
|
+
{ name: 'natureco cost week', desc: L('Bu hafta', 'This week') },
|
|
80
|
+
{ name: 'natureco cost month', desc: L('Bu ay', 'This month') },
|
|
81
|
+
{ name: 'natureco cost budget', desc: L('Bütçe durumu', 'Budget status') },
|
|
82
|
+
{ name: 'natureco cost prices', desc: L('Model fiyatları (21+ model)', 'Model prices (21+ models)') },
|
|
83
|
+
{ name: 'natureco cost model "<prompt>"', desc: L('Model önerisi (router)', 'Model recommendation (router)') },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
icon: '🌐',
|
|
88
|
+
title: L('Entegrasyonlar (10 kanal)', 'Integrations (10 channels)'),
|
|
89
|
+
rows: [
|
|
90
|
+
{ name: 'natureco telegram connect', desc: L('Telegram bot bağla', 'Connect a Telegram bot') },
|
|
91
|
+
{ name: 'natureco whatsapp connect', desc: L('WhatsApp QR ile bağla', 'Connect WhatsApp via QR') },
|
|
92
|
+
{ name: 'natureco discord connect', desc: L('Discord bot bağla', 'Connect a Discord bot') },
|
|
93
|
+
{ name: 'natureco slack connect', desc: L('Slack workspace bağla', 'Connect a Slack workspace') },
|
|
94
|
+
{ name: 'natureco signal connect', desc: L('Signal REST API', 'Signal REST API') },
|
|
95
|
+
{ name: 'natureco irc connect', desc: L('IRC sunucusu', 'IRC server') },
|
|
96
|
+
{ name: 'natureco mattermost connect', desc: L('Mattermost bot', 'Mattermost bot') },
|
|
97
|
+
{ name: 'natureco imessage connect', desc: L('iMessage bridge', 'iMessage bridge') },
|
|
98
|
+
{ name: 'natureco sms connect', desc: L('Twilio SMS', 'Twilio SMS') },
|
|
99
|
+
{ name: 'natureco webhooks connect', desc: L('Webhook ekle', 'Add a webhook') },
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
icon: '🌿',
|
|
104
|
+
title: 'NatureCo Native',
|
|
105
|
+
rows: [
|
|
106
|
+
{ name: 'natureco naturehub post "<text>"', desc: L('NatureCo API ile bota mesaj gönder', 'Send a message to a bot via the NatureCo API') },
|
|
107
|
+
{ name: 'natureco naturehub list', desc: L('Botlarını listele', 'List your bots') },
|
|
108
|
+
{ name: 'natureco naturehub info [bot_id]', desc: L('Bot detayı', 'Bot details') },
|
|
109
|
+
{ name: 'natureco medium draft <file.md>', desc: L('Medium makale taslağı', 'Medium article draft') },
|
|
110
|
+
{ name: 'natureco medium publish <file.md>', desc: L("Medium'da yayınla", 'Publish to Medium') },
|
|
111
|
+
{ name: 'natureco seo audit <url>', desc: L('SEO denetimi (skor 0-100)', 'SEO audit (score 0-100)') },
|
|
112
|
+
{ name: 'natureco xp', desc: L('XP/Level durumu', 'XP / level status') },
|
|
113
|
+
{ name: 'natureco xp rewards', desc: L('Ödül listesi', 'Rewards list') },
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
icon: '📊',
|
|
118
|
+
title: 'Skill & MCP',
|
|
119
|
+
rows: [
|
|
120
|
+
{ name: 'natureco skills list', desc: L("Yüklü skill'ler", 'Installed skills') },
|
|
121
|
+
{ name: 'natureco skills suggest', desc: L('Self-evolving öneriler', 'Self-evolving suggestions') },
|
|
122
|
+
{ name: 'natureco skills accept <id>', desc: L('Öneriyi kabul et', 'Accept a suggestion') },
|
|
123
|
+
{ name: 'natureco skills reject <id>', desc: L('Öneriyi reddet', 'Reject a suggestion') },
|
|
124
|
+
{ name: 'natureco skills install <slug>', desc: L("NatureHub'dan yükle", 'Install from NatureHub') },
|
|
125
|
+
{ name: 'natureco mcp list', desc: L('MCP sunucuları', 'MCP servers') },
|
|
126
|
+
{ name: 'natureco mcp add <name>', desc: L('MCP sunucusu ekle', 'Add an MCP server') },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
icon: '⏰',
|
|
131
|
+
title: L('Otomasyon & Dashboard', 'Automation & Dashboard'),
|
|
132
|
+
rows: [
|
|
133
|
+
{ name: 'natureco cron list', desc: L('Cron görevleri', 'Cron jobs') },
|
|
134
|
+
{ name: 'natureco cron add', desc: L('Cron ekle', 'Add a cron job') },
|
|
135
|
+
{ name: 'natureco hooks create <tip>', desc: L('Hook oluştur', 'Create a hook') },
|
|
136
|
+
{ name: 'natureco dashboard', desc: L('Web dashboard (port 7421)', 'Web dashboard (port 7421)') },
|
|
137
|
+
{ name: 'natureco gateway start', desc: L('Gateway arka plan', 'Gateway (background)') },
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
icon: '⚙️ ',
|
|
142
|
+
title: L('Yapılandırma', 'Configuration'),
|
|
143
|
+
rows: [
|
|
144
|
+
{ name: 'natureco config list', desc: L('Tüm ayarlar', 'All settings') },
|
|
145
|
+
{ name: 'natureco config set <key> <val>', desc: L('Ayar değiştir', 'Change a setting') },
|
|
146
|
+
{ name: 'natureco configure', desc: L('İnteraktif yapılandırma', 'Interactive configuration') },
|
|
147
|
+
{ name: 'natureco sessions list', desc: L('Geçmiş oturumlar', 'Past sessions') },
|
|
148
|
+
{ name: 'natureco sessions show <id>', desc: L('Oturum detayı', 'Session details') },
|
|
149
|
+
{ name: 'natureco memory', desc: L('Memory yönetimi', 'Memory management') },
|
|
150
|
+
{ name: 'natureco init', desc: L('Proje başlat (.natureco/)', 'Initialize a project (.natureco/)') },
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
icon: '🛠️ ',
|
|
155
|
+
title: L('Diğer', 'Other'),
|
|
156
|
+
rows: [
|
|
157
|
+
{ name: 'natureco agents list', desc: L('Agent listesi', 'List agents') },
|
|
158
|
+
{ name: 'natureco models list', desc: L('Model listesi', 'List models') },
|
|
159
|
+
{ name: 'natureco channels', desc: L('Bağlı kanallar', 'Connected channels') },
|
|
160
|
+
{ name: 'natureco logs', desc: L('Gateway logları', 'Gateway logs') },
|
|
161
|
+
{ name: 'natureco tasks list', desc: L('Arka plan görevleri', 'Background tasks') },
|
|
162
|
+
{ name: 'natureco nodes', desc: L('Network nodes', 'Network nodes') },
|
|
163
|
+
{ name: 'natureco security', desc: L('Güvenlik denetimi', 'Security audit') },
|
|
164
|
+
{ name: 'natureco reset', desc: L('Sıfırla', 'Reset') },
|
|
165
|
+
{ name: 'natureco uninstall', desc: L('Kaldır', 'Uninstall') },
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
icon: '💬',
|
|
170
|
+
title: L('REPL İçi Komutlar (chat/repl)', 'In-REPL commands (chat/repl)'),
|
|
171
|
+
rows: [
|
|
172
|
+
{ name: '/help', desc: L('Yardım', 'Help') },
|
|
173
|
+
{ name: '/clear', desc: L('Ekranı temizle', 'Clear the screen') },
|
|
174
|
+
{ name: '/memory', desc: L("Memory'i göster", 'Show memory') },
|
|
175
|
+
{ name: '/forget', desc: L("Memory'i sil", 'Clear memory') },
|
|
176
|
+
{ name: '/sessions', desc: L('Geçmiş oturumlar', 'Past sessions') },
|
|
177
|
+
{ name: '/resume [id|last]', desc: L('Önceki oturuma dön', 'Resume a previous session') },
|
|
178
|
+
{ name: '/system <text>', desc: L('System prompt', 'System prompt') },
|
|
179
|
+
{ name: '/model <name>', desc: L('Model değiştir', 'Switch model') },
|
|
180
|
+
{ name: '/identity [ad]', desc: L('Bot adı değiştir', 'Rename the bot') },
|
|
181
|
+
{ name: '/tokens', desc: L('Token kullanımı', 'Token usage') },
|
|
182
|
+
{ name: '/doctor, /cost, /audit, /team, /xp', desc: L('REPL içinden TUI komutlar', 'TUI commands from inside the REPL') },
|
|
183
|
+
{ name: '/save, /exit, /quit', desc: L('Kaydet / Çıkış', 'Save / Exit') },
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
for (const section of sections) {
|
|
189
|
+
console.log('\n' + tui.styled(` ${section.icon} ${section.title}`, { color: tui.PALETTE.secondary, bold: true }));
|
|
190
|
+
console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
|
|
191
|
+
console.log('\n' + tui.table(section.rows, [
|
|
192
|
+
{ key: 'name', label: L('Komut', 'Command'), minWidth: 36, render: r => tui.styled(r.name, { color: tui.PALETTE.primary, bold: true }) },
|
|
193
|
+
{ key: 'desc', label: L('Açıklama', 'Description'), minWidth: 35, render: r => tui.C.muted(r.desc) },
|
|
194
|
+
], { borderStyle: 'round', zebra: false }));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Current config (if any)
|
|
198
|
+
if (config.providerUrl || config.botName) {
|
|
199
|
+
console.log('\n' + tui.styled(' ⚙️ ' + L('Mevcut Yapılandırma', 'Current Configuration'), { color: tui.PALETTE.accent, bold: true }));
|
|
200
|
+
console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
|
|
201
|
+
const cardW = 54;
|
|
202
|
+
const cardLines = [
|
|
203
|
+
tui.styled(' ╭' + '─'.repeat(cardW) + '╮', { color: tui.PALETTE.border }),
|
|
204
|
+
];
|
|
205
|
+
if (config.providerUrl) {
|
|
206
|
+
const provider = config.providerUrl.replace('https?:\/\/', '').split('/')[0];
|
|
207
|
+
cardLines.push(tui.styled(' │ ', { color: tui.PALETTE.border }) + tui.C.muted('Provider ') + tui.styled(provider.padEnd(38), { color: tui.PALETTE.text, bold: true }) + tui.styled(' │', { color: tui.PALETTE.border }));
|
|
208
|
+
}
|
|
209
|
+
if (config.providerModel) {
|
|
210
|
+
cardLines.push(tui.styled(' │ ', { color: tui.PALETTE.border }) + tui.C.muted('Model ') + tui.styled((config.providerModel || '—').padEnd(38), { color: tui.PALETTE.primary, bold: true }) + tui.styled(' │', { color: tui.PALETTE.border }));
|
|
211
|
+
}
|
|
212
|
+
if (config.botName) {
|
|
213
|
+
cardLines.push(tui.styled(' │ ', { color: tui.PALETTE.border }) + tui.C.muted('Bot ') + tui.styled((config.botName || '—').padEnd(38), { color: tui.PALETTE.text }) + tui.styled(' │', { color: tui.PALETTE.border }));
|
|
214
|
+
}
|
|
215
|
+
if (config.userName) {
|
|
216
|
+
cardLines.push(tui.styled(' │ ', { color: tui.PALETTE.border }) + tui.C.muted(L('Kullanıcı ', 'User ')) + tui.styled((config.userName || '—').padEnd(38), { color: tui.PALETTE.text }) + tui.styled(' │', { color: tui.PALETTE.border }));
|
|
217
|
+
}
|
|
218
|
+
cardLines.push(tui.styled(' ╰' + '─'.repeat(cardW) + '╯', { color: tui.PALETTE.border }));
|
|
219
|
+
console.log(cardLines.join('\n'));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Links
|
|
223
|
+
console.log('\n' + tui.styled(' 🔗 ' + L('Kaynaklar', 'Resources'), { color: tui.PALETTE.secondary, bold: true }));
|
|
224
|
+
console.log(' ' + tui.C.muted(L('Döküman ', 'Docs ')) + tui.C.brand('https://natureco.me/cli'));
|
|
225
|
+
console.log(' ' + tui.C.muted('SDK ') + tui.C.brand('https://natureco.me/developer'));
|
|
226
|
+
console.log(' ' + tui.C.muted('npm ') + tui.C.brand('https://npmjs.com/package/natureco-cli'));
|
|
227
|
+
console.log('');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
module.exports = help;
|
package/src/commands/login.js
CHANGED
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
const inquirer = require('../utils/inquirer-wrapper');
|
|
2
|
-
const chalk = require('chalk');
|
|
3
|
-
const { saveApiKey } = require('../utils/config');
|
|
4
|
-
const { validateApiKey } = require('../utils/api');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
console.
|
|
11
|
-
|
|
12
|
-
console.log(
|
|
13
|
-
console.log('');
|
|
14
|
-
console.log(chalk.green.bold('
|
|
15
|
-
console.log(chalk.
|
|
16
|
-
console.log(
|
|
17
|
-
console.log('');
|
|
18
|
-
console.log(chalk.gray(' API key
|
|
19
|
-
console.log('');
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
console.log(chalk.
|
|
52
|
-
console.log('');
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
const inquirer = require('../utils/inquirer-wrapper');
|
|
2
|
+
const chalk = require('chalk');
|
|
3
|
+
const { saveApiKey } = require('../utils/config');
|
|
4
|
+
const { validateApiKey } = require('../utils/api');
|
|
5
|
+
const { getLang } = require('../utils/i18n');
|
|
6
|
+
|
|
7
|
+
const L = (tr, en) => (getLang() === 'en' ? en : tr);
|
|
8
|
+
|
|
9
|
+
async function login() {
|
|
10
|
+
console.clear();
|
|
11
|
+
|
|
12
|
+
console.log('');
|
|
13
|
+
console.log(chalk.green.bold(' (\\_/)'));
|
|
14
|
+
console.log(chalk.green.bold(' (•ᴥ•)'));
|
|
15
|
+
console.log(chalk.green(' />🌿'));
|
|
16
|
+
console.log('');
|
|
17
|
+
console.log(chalk.green.bold(' ' + L('NatureCo CLI — Giriş', 'NatureCo CLI — Sign in')));
|
|
18
|
+
console.log(chalk.gray(' ' + L("API key'ini gir ve başla.", 'Enter your API key to get started.') + '\n'));
|
|
19
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
20
|
+
console.log('');
|
|
21
|
+
console.log(chalk.gray(' ' + L('API key almak için: ', 'Get an API key at: ')) + chalk.cyan('developers.natureco.me'));
|
|
22
|
+
console.log('');
|
|
23
|
+
|
|
24
|
+
const { apiKey } = await inquirer.prompt([{
|
|
25
|
+
type: 'password',
|
|
26
|
+
name: 'apiKey',
|
|
27
|
+
message: ' API Key:',
|
|
28
|
+
mask: '*',
|
|
29
|
+
validate: (v) => {
|
|
30
|
+
if (!v.trim()) return L('API key boş olamaz', "API key can't be empty");
|
|
31
|
+
return true;
|
|
32
|
+
},
|
|
33
|
+
}]);
|
|
34
|
+
|
|
35
|
+
console.log('');
|
|
36
|
+
console.log(chalk.gray(' ' + L('Doğrulanıyor...', 'Verifying...')));
|
|
37
|
+
|
|
38
|
+
const result = await validateApiKey(apiKey.trim());
|
|
39
|
+
|
|
40
|
+
if (!result.valid) {
|
|
41
|
+
console.log(chalk.red(`\n ❌ ${result.error || L('Geçersiz API key', 'Invalid API key')}\n`));
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (result.user?.email) {
|
|
46
|
+
console.log(chalk.gray(` ${L('Hoş geldin,', 'Welcome,')} ${chalk.white(result.user.email)}`));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
saveApiKey(apiKey.trim());
|
|
50
|
+
|
|
51
|
+
console.log(chalk.green('\n ✓ ' + L('Giriş başarılı!', 'Signed in!')));
|
|
52
|
+
console.log(chalk.gray(' Config: ~/.natureco/config.json'));
|
|
53
|
+
console.log('');
|
|
54
|
+
console.log(chalk.gray(' ' + L('Başlamak için: ', 'To get started: ')) + chalk.cyan('natureco chat'));
|
|
55
|
+
console.log('');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = login;
|
package/src/commands/repl.js
CHANGED
|
@@ -46,7 +46,9 @@ function extractPreferenceFacts(content) {
|
|
|
46
46
|
}
|
|
47
47
|
return out;
|
|
48
48
|
}
|
|
49
|
-
const chalk = require('chalk');
|
|
49
|
+
const chalk = require('chalk');
|
|
50
|
+
const { getLang: _getLang } = require('../utils/i18n');
|
|
51
|
+
const L = (tr, en) => (_getLang() === 'en' ? en : tr);
|
|
50
52
|
const tui = require('../utils/tui');
|
|
51
53
|
const { loadToolDefinitions, toOpenAIFormat, executeTool } = require('../utils/tools');
|
|
52
54
|
const { accumulateToolCallDeltas, finalizeToolCalls } = require('../utils/streaming-tools');
|
|
@@ -1031,7 +1033,7 @@ function runCliCommand(args) {
|
|
|
1031
1033
|
stdio: 'inherit',
|
|
1032
1034
|
});
|
|
1033
1035
|
proc.on('close', (code) => resolve(code));
|
|
1034
|
-
proc.on('error', (e) => { console.log(chalk.red(' Hata: ' + e.message)); resolve(1); });
|
|
1036
|
+
proc.on('error', (e) => { console.log(chalk.red(L(' Hata: ', ' Error: ') + e.message)); resolve(1); });
|
|
1035
1037
|
});
|
|
1036
1038
|
}
|
|
1037
1039
|
|
|
@@ -1117,7 +1119,7 @@ async function startRepl(args) {
|
|
|
1117
1119
|
messages = session.messages || [];
|
|
1118
1120
|
console.log(chalk.green(`\n ✓ Oturum yüklendi: ${session.id} (${messages.length} mesaj)\n`));
|
|
1119
1121
|
} else {
|
|
1120
|
-
console.log(chalk.yellow(`\n ⚠️ Oturum
|
|
1122
|
+
console.log(chalk.yellow(`\n ⚠️ ${L('Oturum bulunamadı', 'Session not found')}: ${resumeId}\n`));
|
|
1121
1123
|
}
|
|
1122
1124
|
}
|
|
1123
1125
|
|
|
@@ -1440,7 +1442,7 @@ async function startRepl(args) {
|
|
|
1440
1442
|
console.log(chalk.gray('\n Devam etmek için: /resume <id> veya /resume last\n'));
|
|
1441
1443
|
break;
|
|
1442
1444
|
case 'resume':
|
|
1443
|
-
if (!arg) { console.log(chalk.yellow(' Kullanım: /resume <id> veya /resume last')); break; }
|
|
1445
|
+
if (!arg) { console.log(chalk.yellow(L(' Kullanım: /resume <id> veya /resume last', ' Usage: /resume <id> or /resume last'))); break; }
|
|
1444
1446
|
const session = loadSession(arg);
|
|
1445
1447
|
if (session) {
|
|
1446
1448
|
messages = session.messages || [];
|
|
@@ -1449,11 +1451,11 @@ async function startRepl(args) {
|
|
|
1449
1451
|
else messages.unshift({ role: 'system', content: systemPrompt, _internal: true });
|
|
1450
1452
|
console.log(chalk.green(` ✓ Oturum yüklendi: ${session.id} (${messages.length} mesaj)`));
|
|
1451
1453
|
} else {
|
|
1452
|
-
console.log(chalk.yellow(` ⚠️ Oturum
|
|
1454
|
+
console.log(chalk.yellow(` ⚠️ ${L('Oturum bulunamadı', 'Session not found')}: ${arg}`));
|
|
1453
1455
|
}
|
|
1454
1456
|
break;
|
|
1455
1457
|
case 'system':
|
|
1456
|
-
if (!arg) { console.log(chalk.yellow(' Kullanım: /system <text>')); break; }
|
|
1458
|
+
if (!arg) { console.log(chalk.yellow(L(' Kullanım: /system <text>', ' Usage: /system <text>'))); break; }
|
|
1457
1459
|
// Override stable tier directly (user's custom text)
|
|
1458
1460
|
_cachedStable = arg;
|
|
1459
1461
|
// Rebuild volatile only (context stays unchanged)
|
|
@@ -1467,7 +1469,7 @@ async function startRepl(args) {
|
|
|
1467
1469
|
console.log(chalk.green(' ✓ System prompt güncellendi'));
|
|
1468
1470
|
break;
|
|
1469
1471
|
case 'model':
|
|
1470
|
-
if (!arg) { console.log(chalk.yellow(' Kullanım: /model <name>')); break; }
|
|
1472
|
+
if (!arg) { console.log(chalk.yellow(L(' Kullanım: /model <name>', ' Usage: /model <name>'))); break; }
|
|
1471
1473
|
model = arg;
|
|
1472
1474
|
console.log(chalk.green(' ✓ Model: ') + chalk.cyan(model));
|
|
1473
1475
|
break;
|
|
@@ -1508,7 +1510,7 @@ async function startRepl(args) {
|
|
|
1508
1510
|
console.log(tui.C.yellow(' Henüz plan yok.'));
|
|
1509
1511
|
}
|
|
1510
1512
|
} else {
|
|
1511
|
-
console.log(tui.C.yellow(' Kullanım: /plan on|off|show'));
|
|
1513
|
+
console.log(tui.C.yellow(L(' Kullanım: /plan on|off|show', ' Usage: /plan on|off|show')));
|
|
1512
1514
|
}
|
|
1513
1515
|
break;
|
|
1514
1516
|
case 'save':
|
|
@@ -1530,7 +1532,7 @@ async function startRepl(args) {
|
|
|
1530
1532
|
await runCliCommand(args2);
|
|
1531
1533
|
}
|
|
1532
1534
|
} else {
|
|
1533
|
-
console.log(chalk.yellow(` Bilinmeyen komut: /${cmd}. /help yazın
|
|
1535
|
+
console.log(chalk.yellow(` ${L('Bilinmeyen komut', 'Unknown command')}: /${cmd}. ${L('/help yazın.', 'type /help.')}`));
|
|
1534
1536
|
}
|
|
1535
1537
|
}
|
|
1536
1538
|
safePrompt();
|
package/src/commands/run.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const chalk = require('chalk');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
const { getLang: _getLang } = require('../utils/i18n');
|
|
5
|
+
const L = (tr, en) => (_getLang() === 'en' ? en : tr);
|
|
4
6
|
const { getApiKey, getConfig } = require('../utils/config');
|
|
5
7
|
const { sendMessage } = require('../utils/api');
|
|
6
8
|
const { getSkillPrompts } = require('../utils/skills');
|
|
@@ -9,7 +11,7 @@ async function run(scriptPath) {
|
|
|
9
11
|
const apiKey = getApiKey();
|
|
10
12
|
|
|
11
13
|
if (!apiKey) {
|
|
12
|
-
console.log(chalk.red('\n❌ Giriş yapılmamış. Önce "natureco login" çalıştırın.\n'));
|
|
14
|
+
console.log(chalk.red(L('\n❌ Giriş yapılmamış. Önce "natureco login" çalıştırın.\n', '\n❌ Not signed in. Run "natureco login" first.\n')));
|
|
13
15
|
process.exit(1);
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -17,7 +19,7 @@ async function run(scriptPath) {
|
|
|
17
19
|
const defaultBotId = config.defaultBotId;
|
|
18
20
|
|
|
19
21
|
if (!defaultBotId) {
|
|
20
|
-
console.log(chalk.red('\n❌ Varsayılan bot ayarlanmamış. "natureco config set defaultBotId <bot-id>" ile ayarlayın.\n'));
|
|
22
|
+
console.log(chalk.red(L('\n❌ Varsayılan bot ayarlanmamış. "natureco config set defaultBotId <bot-id>" ile ayarlayın.\n', '\n❌ No default bot set. Set one with "natureco config set defaultBotId <bot-id>".\n')));
|
|
21
23
|
process.exit(1);
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -25,21 +27,21 @@ async function run(scriptPath) {
|
|
|
25
27
|
const fullPath = path.resolve(scriptPath);
|
|
26
28
|
|
|
27
29
|
if (!fs.existsSync(fullPath)) {
|
|
28
|
-
console.log(chalk.red(`\n❌ Dosya
|
|
30
|
+
console.log(chalk.red(`\n❌ ${L('Dosya bulunamadı', 'File not found')}: ${scriptPath}\n`));
|
|
29
31
|
process.exit(1);
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
const scriptContent = fs.readFileSync(fullPath, 'utf8');
|
|
33
35
|
|
|
34
36
|
if (!scriptContent || scriptContent.trim().length === 0) {
|
|
35
|
-
console.log(chalk.red('\n❌ Script dosyası boş.\n'));
|
|
37
|
+
console.log(chalk.red(L('\n❌ Script dosyası boş.\n', '\n❌ Script file is empty.\n')));
|
|
36
38
|
process.exit(1);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
// Skill prompts'ları yükle
|
|
40
42
|
const skillPrompts = getSkillPrompts();
|
|
41
43
|
|
|
42
|
-
console.log(chalk.yellow(`\n⏳ Script çalıştırılıyor: ${path.basename(scriptPath)}\n`));
|
|
44
|
+
console.log(chalk.yellow(`\n⏳ ${L('Script çalıştırılıyor', 'Running script')}: ${path.basename(scriptPath)}\n`));
|
|
43
45
|
|
|
44
46
|
// Loading animasyonu
|
|
45
47
|
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
package/src/utils/dangerous.js
CHANGED
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
const inquirer = require('../utils/inquirer-wrapper');
|
|
14
14
|
const chalk = require('chalk');
|
|
15
|
+
const { getLang } = require('./i18n');
|
|
16
|
+
|
|
17
|
+
const L = (tr, en) => (getLang() === 'en' ? en : tr);
|
|
15
18
|
|
|
16
19
|
const RISK = {
|
|
17
20
|
LOW: 'low', // Otomatik onay
|
|
@@ -21,10 +24,10 @@ const RISK = {
|
|
|
21
24
|
};
|
|
22
25
|
|
|
23
26
|
const RISK_LABELS = {
|
|
24
|
-
low: { color: 'gray', icon: '⚪', label: '
|
|
25
|
-
medium: { color: 'yellow', icon: '🟡', label: 'ORTA RISK' },
|
|
26
|
-
high: { color: 'red', icon: '🔴', label: '
|
|
27
|
-
critical: { color: 'magenta', icon: '⛔', label: '
|
|
27
|
+
low: { color: 'gray', icon: '⚪', label: { tr: 'DÜŞÜK RİSK', en: 'LOW RISK' } },
|
|
28
|
+
medium: { color: 'yellow', icon: '🟡', label: { tr: 'ORTA RİSK', en: 'MEDIUM RISK' } },
|
|
29
|
+
high: { color: 'red', icon: '🔴', label: { tr: 'YÜKSEK RİSK', en: 'HIGH RISK' } },
|
|
30
|
+
critical: { color: 'magenta', icon: '⛔', label: { tr: 'KRİTİK - GERİ ALINAMAZ', en: 'CRITICAL - IRREVERSIBLE' } },
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
const RISK_RANK = { low: 0, medium: 1, high: 2, critical: 3 };
|
|
@@ -44,37 +47,39 @@ async function requireApproval(command, args = {}, risk = RISK.HIGH, reason = ''
|
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
const label = RISK_LABELS[risk] || RISK_LABELS.high;
|
|
50
|
+
const labelText = (label.label && (label.label[getLang()] || label.label.tr)) || '';
|
|
47
51
|
|
|
48
52
|
console.log();
|
|
49
|
-
console.log(chalk[label.color](` ${label.icon} ${
|
|
53
|
+
console.log(chalk[label.color](` ${label.icon} ${labelText}: ${command}`));
|
|
50
54
|
console.log(chalk.gray(' ' + '─'.repeat(60)));
|
|
51
|
-
console.log(chalk.white(` Komut: ${command}`));
|
|
55
|
+
console.log(chalk.white(` ${L('Komut', 'Command')}: ${command}`));
|
|
52
56
|
if (Object.keys(args).length > 0) {
|
|
53
|
-
console.log(chalk.gray(`
|
|
57
|
+
console.log(chalk.gray(` ${L('Argümanlar', 'Arguments')}: ${JSON.stringify(args)}`));
|
|
54
58
|
}
|
|
55
59
|
if (reason) {
|
|
56
|
-
console.log(chalk[label.color](` Neden: ${reason}`));
|
|
60
|
+
console.log(chalk[label.color](` ${L('Neden', 'Reason')}: ${reason}`));
|
|
57
61
|
}
|
|
58
62
|
console.log(chalk.gray(' ' + '─'.repeat(60)));
|
|
59
63
|
|
|
60
64
|
// Dusuk risk - otomatik onay, sadece mesaj goster
|
|
61
65
|
if (risk === RISK.LOW) {
|
|
62
|
-
console.log(chalk.gray(' Otomatik
|
|
66
|
+
console.log(chalk.gray(' ' + L('Otomatik onaylandı (düşük risk)', 'Auto-approved (low risk)')));
|
|
63
67
|
console.log();
|
|
64
68
|
return true;
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
// Kritik risk - tam yazim gerekli
|
|
68
72
|
if (risk === RISK.CRITICAL) {
|
|
69
|
-
console.log(chalk.red(' Bu
|
|
73
|
+
console.log(chalk.red(' ' + L('Bu işlem geri alınamaz!', 'This action cannot be undone!')));
|
|
74
|
+
const yesWord = L('EVET SIL', 'YES DELETE');
|
|
70
75
|
const { confirm } = await inquirer.prompt([{
|
|
71
76
|
type: 'input',
|
|
72
77
|
name: 'confirm',
|
|
73
|
-
message: chalk.red(' Devam etmek
|
|
74
|
-
validate: (input) => input === 'EVET SIL' || input === ''
|
|
78
|
+
message: chalk.red(' ' + L(`Devam etmek için "${yesWord}" yazın (veya Enter ile iptal):`, `Type "${yesWord}" to continue (or Enter to cancel):`)),
|
|
79
|
+
validate: (input) => input === 'EVET SIL' || input === 'YES DELETE' || input === ''
|
|
75
80
|
}]);
|
|
76
81
|
console.log();
|
|
77
|
-
return confirm === 'EVET SIL';
|
|
82
|
+
return confirm === 'EVET SIL' || confirm === 'YES DELETE';
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
// Yuksek ve orta risk - basit onay
|
|
@@ -82,7 +87,7 @@ async function requireApproval(command, args = {}, risk = RISK.HIGH, reason = ''
|
|
|
82
87
|
const { ok } = await inquirer.prompt([{
|
|
83
88
|
type: promptType,
|
|
84
89
|
name: 'ok',
|
|
85
|
-
message: chalk[label.color](
|
|
90
|
+
message: chalk[label.color](' ' + L('Bu komutu çalıştırmak istediğinize emin misiniz?', 'Are you sure you want to run this command?')),
|
|
86
91
|
default: false,
|
|
87
92
|
}]);
|
|
88
93
|
console.log();
|