natureco-cli 5.60.0 → 5.62.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "5.60.0",
3
+ "version": "5.62.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"
@@ -1,5 +1,7 @@
1
1
  const chalk = require('chalk');
2
2
  const http = require('http');
3
+ const { getLang: _gl } = require('../utils/i18n');
4
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
3
5
  const { getConfig } = require('../utils/config');
4
6
 
5
7
  const ALLOWED_METHODS = [
@@ -74,7 +76,7 @@ function adminRpc(args) {
74
76
  if (action === 'methods') return listMethods();
75
77
 
76
78
  console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
77
- console.log(chalk.gray(' Kullanım: natureco admin-rpc [status|start|stop|call|methods]\n'));
79
+ console.log(chalk.gray(L(' Kullanım: natureco admin-rpc [status|start|stop|call|methods]\n', ' Usage: natureco admin-rpc [status|start|stop|call|methods]\n')));
78
80
  process.exit(1);
79
81
  }
80
82
 
@@ -103,7 +105,7 @@ function listMethods() {
103
105
 
104
106
  async function callMethod(method, jsonParams) {
105
107
  if (!method) {
106
- console.log(chalk.red('\n ❌ Method adı gerekli\n'));
108
+ console.log(chalk.red(L('\n ❌ Method adı gerekli\n', '\n ❌ Method name required\n')));
107
109
  console.log(chalk.cyan(' natureco admin-rpc call health\n'));
108
110
  process.exit(1);
109
111
  }
@@ -116,7 +118,7 @@ async function callMethod(method, jsonParams) {
116
118
  let params = {};
117
119
  if (jsonParams) {
118
120
  try { params = JSON.parse(jsonParams); }
119
- catch { console.log(chalk.red('\n ❌ Geçersiz JSON\n')); process.exit(1); }
121
+ catch { console.log(chalk.red(L('\n ❌ Geçersiz JSON\n', '\n ❌ Invalid JSON\n'))); process.exit(1); }
120
122
  }
121
123
 
122
124
  console.log(chalk.cyan(`\n 📡 Calling: ${method}\n`));
@@ -172,14 +174,14 @@ async function callMethod(method, jsonParams) {
172
174
  const output = execSync(`tail -${lines} "${logPath}"`, { encoding: 'utf8', maxBuffer: 1024 * 1024 });
173
175
  console.log(output);
174
176
  } catch {
175
- console.log(chalk.yellow(' ⚠️ Log bulunamadı\n'));
177
+ console.log(chalk.yellow(L(' ⚠️ Log bulunamadı\n', ' ⚠️ Log not found\n')));
176
178
  }
177
179
  return;
178
180
  }
179
181
 
180
182
  if (method === 'config.set') {
181
183
  const { setConfigValue } = require('../utils/config');
182
- if (!params.key) { console.log(chalk.red('\n ❌ params.key gerekli\n')); process.exit(1); }
184
+ if (!params.key) { console.log(chalk.red(L('\n ❌ params.key gerekli\n', '\n ❌ params.key required\n'))); process.exit(1); }
183
185
  setConfigValue(params.key, params.value);
184
186
  console.log(chalk.green(`\n ✅ config.${params.key} = ${JSON.stringify(params.value)}\n`));
185
187
  return;
@@ -1,5 +1,7 @@
1
1
  const chalk = require('chalk');
2
2
  const tui = require('../utils/tui');
3
+ const { getLang: _gl } = require('../utils/i18n');
4
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
3
5
  const F = require('../utils/format');
4
6
  const fs = require('fs');
5
7
  const path = require('path');
@@ -51,7 +53,7 @@ function approvals(args) {
51
53
  if (action === 'allowlist') return listAllowlist();
52
54
 
53
55
  console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
54
- console.log(chalk.gray(' Kullanım: natureco approvals [list|pending|approve|reject|set-policy|set|add|get|allowlist]\n'));
56
+ console.log(chalk.gray(L(' Kullanım: natureco approvals [list|pending|approve|reject|set-policy|set|add|get|allowlist]\n', ' Usage: natureco approvals [list|pending|approve|reject|set-policy|set|add|get|allowlist]\n')));
55
57
  process.exit(1);
56
58
  }
57
59
 
@@ -80,12 +82,12 @@ function listApprovals() {
80
82
  { key: 'source', label: 'Kaynak', minWidth: 12, render: r => tui.C.text(r.source) },
81
83
  { key: 'text', label: 'Komut', minWidth: 25, render: r => tui.C.muted(r.text) },
82
84
  {
83
- key: 'status', label: 'Durum', minWidth: 12,
85
+ key: 'status', label: L('Durum', 'Status'), minWidth: 12,
84
86
  render: r => r.status === 'pending'
85
87
  ? tui.styled(' ⏳ Bekliyor ', { bg: tui.PALETTE.warning, color: '#000', bold: true })
86
88
  : r.status === 'approved'
87
- ? tui.styled(' ✓ Onaylı ', { bg: tui.PALETTE.success, color: '#000', bold: true })
88
- : tui.styled(' ✗ Reddedildi ', { bg: tui.PALETTE.danger, color: '#000', bold: true })
89
+ ? tui.styled(L(' ✓ Onaylı ', ' ✓ Approved '), { bg: tui.PALETTE.success, color: '#000', bold: true })
90
+ : tui.styled(L(' ✗ Reddedildi ', ' ✗ Rejected '), { bg: tui.PALETTE.danger, color: '#000', bold: true })
89
91
  },
90
92
  ], { borderStyle: 'round', zebra: true }));
91
93
  console.log('');
@@ -101,7 +103,7 @@ function listPending() {
101
103
  const rows = queue.map(r => ({
102
104
  id: r.id, source: r.source || 'cli', text: r.text, status: r.status,
103
105
  }));
104
- console.log('\n' + tui.styled(' ⏳ Bekleyen Onaylar (' + rows.length + ')', { color: tui.PALETTE.warning, bold: true }));
106
+ console.log('\n' + tui.styled(L(' ⏳ Bekleyen Onaylar (', ' ⏳ Pending Approvals (') + rows.length + ')', { color: tui.PALETTE.warning, bold: true }));
105
107
  console.log('\n' + tui.table(rows, [
106
108
  { key: 'id', label: 'ID', minWidth: 14, render: r => tui.C.muted(r.id) },
107
109
  { key: 'source', label: 'Kaynak', minWidth: 12, render: r => tui.C.text(r.source) },
@@ -112,16 +114,16 @@ function listPending() {
112
114
 
113
115
  function addReq(text) {
114
116
  if (!text) {
115
- console.log(chalk.red('\n ❌ Request text gerekli\n'));
117
+ console.log(chalk.red(L('\n ❌ Request text gerekli\n', '\n ❌ Request text required\n')));
116
118
  process.exit(1);
117
119
  }
118
120
  const queue = loadQueue();
119
121
  const r = { id: genId(), text, status: 'pending', source: 'cli', createdAt: new Date().toISOString(), resolvedAt: null };
120
122
  queue.push(r);
121
123
  saveQueue(queue);
122
- console.log(chalk.yellow(`\n ⏳ Onay beklemede: ${r.id}\n`));
124
+ console.log(chalk.yellow(`\n ⏳ ${L('Onay beklemede', 'Awaiting approval')}: ${r.id}\n`));
123
125
  console.log(` ${chalk.white(text)}`);
124
- console.log(chalk.gray(` Onaylamak için: natureco approvals approve ${r.id}`));
126
+ console.log(chalk.gray(` ${L('Onaylamak için', 'To approve')}: natureco approvals approve ${r.id}`));
125
127
  console.log();
126
128
  }
127
129
 
@@ -129,8 +131,8 @@ function approveReq(id) {
129
131
  const queue = loadQueue();
130
132
  if (id) {
131
133
  const r = queue.find(x => x.id === id);
132
- if (!r) { console.log(chalk.red(`\n ❌ Request bulunamadı: ${id}\n`)); process.exit(1); }
133
- if (r.status !== 'pending') { console.log(chalk.yellow(`\n ⚠️ "${id}" zaten ${r.status}\n`)); return; }
134
+ if (!r) { console.log(chalk.red(`\n ❌ ${L('Request bulunamadı', 'Request not found')}: ${id}\n`)); process.exit(1); }
135
+ if (r.status !== 'pending') { console.log(chalk.yellow(`\n ⚠️ "${id}" ${L('zaten', 'already')} ${r.status}\n`)); return; }
134
136
  r.status = 'approved';
135
137
  r.resolvedAt = new Date().toISOString();
136
138
  saveQueue(queue);
@@ -138,7 +140,7 @@ function approveReq(id) {
138
140
  return;
139
141
  }
140
142
  const pending = queue.filter(r => r.status === 'pending');
141
- if (pending.length === 0) { console.log(chalk.gray('\n Bekleyen onay yok\n')); return; }
143
+ if (pending.length === 0) { console.log(chalk.gray(L('\n Bekleyen onay yok\n', '\n No pending approvals\n'))); return; }
142
144
  for (const r of pending) { r.status = 'approved'; r.resolvedAt = new Date().toISOString(); }
143
145
  saveQueue(queue);
144
146
  F.success(`${pending.length} requests approved`);
@@ -148,8 +150,8 @@ function rejectReq(id) {
148
150
  const queue = loadQueue();
149
151
  if (id) {
150
152
  const r = queue.find(x => x.id === id);
151
- if (!r) { console.log(chalk.red(`\n ❌ Request bulunamadı: ${id}\n`)); process.exit(1); }
152
- if (r.status !== 'pending') { console.log(chalk.yellow(`\n ⚠️ "${id}" zaten ${r.status}\n`)); return; }
153
+ if (!r) { console.log(chalk.red(`\n ❌ ${L('Request bulunamadı', 'Request not found')}: ${id}\n`)); process.exit(1); }
154
+ if (r.status !== 'pending') { console.log(chalk.yellow(`\n ⚠️ "${id}" ${L('zaten', 'already')} ${r.status}\n`)); return; }
153
155
  r.status = 'rejected';
154
156
  r.resolvedAt = new Date().toISOString();
155
157
  saveQueue(queue);
@@ -157,7 +159,7 @@ function rejectReq(id) {
157
159
  return;
158
160
  }
159
161
  const pending = queue.filter(r => r.status === 'pending');
160
- if (pending.length === 0) { console.log(chalk.gray('\n Bekleyen onay yok\n')); return; }
162
+ if (pending.length === 0) { console.log(chalk.gray(L('\n Bekleyen onay yok\n', '\n No pending approvals\n'))); return; }
161
163
  for (const r of pending) { r.status = 'rejected'; r.resolvedAt = new Date().toISOString(); }
162
164
  saveQueue(queue);
163
165
  F.error(`${pending.length} requests rejected`);
@@ -176,13 +178,13 @@ function setPolicy(policy) {
176
178
 
177
179
  function getReq(id) {
178
180
  if (!id) {
179
- console.log(chalk.red('\n ❌ Request ID gerekli\n'));
181
+ console.log(chalk.red(L('\n ❌ Request ID gerekli\n', '\n ❌ Request ID required\n')));
180
182
  process.exit(1);
181
183
  }
182
184
  const queue = loadQueue();
183
185
  const r = queue.find(x => x.id === id);
184
186
  if (!r) {
185
- console.log(chalk.red(`\n ❌ Request bulunamadı: ${id}\n`));
187
+ console.log(chalk.red(`\n ❌ ${L('Request bulunamadı', 'Request not found')}: ${id}\n`));
186
188
  process.exit(1);
187
189
  }
188
190
  F.kv('ID', r.id);
@@ -204,7 +206,7 @@ function listAllowlist() {
204
206
 
205
207
  function allowlistAdd(pattern) {
206
208
  if (!pattern) {
207
- console.log(chalk.red('\n ❌ Pattern gerekli\n'));
209
+ console.log(chalk.red(L('\n ❌ Pattern gerekli\n', '\n ❌ Pattern required\n')));
208
210
  process.exit(1);
209
211
  }
210
212
  const patterns = loadAllowlist();
@@ -219,7 +221,7 @@ function allowlistAdd(pattern) {
219
221
 
220
222
  function allowlistRemove(pattern) {
221
223
  if (!pattern) {
222
- console.log(chalk.red('\n ❌ Pattern gerekli\n'));
224
+ console.log(chalk.red(L('\n ❌ Pattern gerekli\n', '\n ❌ Pattern required\n')));
223
225
  process.exit(1);
224
226
  }
225
227
  let patterns = loadAllowlist();
@@ -12,6 +12,8 @@
12
12
  */
13
13
 
14
14
  const chalk = require('chalk');
15
+ const { getLang: _gl } = require('../utils/i18n');
16
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
15
17
  const tui = require('../utils/tui');
16
18
  const F = require('../utils/format');
17
19
  const fs = require('fs');
@@ -53,11 +55,11 @@ function formatEntry(entry) {
53
55
 
54
56
  function showEntries(entries, limit = 50) {
55
57
  if (entries.length === 0) {
56
- console.log(tui.C.muted('\n Kayıt yok.\n'));
58
+ console.log(tui.C.muted(L('\n Kayıt yok.\n', '\n No records.\n')));
57
59
  return;
58
60
  }
59
61
  const slice = entries.slice(-limit);
60
- console.log(tui.styled(`\n 📋 ${entries.length} kayıt${limit < entries.length ? ` (son ${limit})` : ''}`, { color: tui.PALETTE.primary, bold: true }));
62
+ console.log(tui.styled(`\n 📋 ${entries.length} ${L('kayıt', 'records')}${limit < entries.length ? ` (${L('son', 'last')} ${limit})` : ''}`, { color: tui.PALETTE.primary, bold: true }));
61
63
 
62
64
  // Yeni TUI tablo
63
65
  const rows = slice.map(e => ({
@@ -69,9 +71,9 @@ function showEntries(entries, limit = 50) {
69
71
  }));
70
72
 
71
73
  console.log('\n' + tui.table(rows, [
72
- { key: 'ts', label: 'Saat', minWidth: 10, render: r => tui.C.muted(r.ts) },
74
+ { key: 'ts', label: L('Saat', 'Time'), minWidth: 10, render: r => tui.C.muted(r.ts) },
73
75
  { key: 'action', label: 'Action', minWidth: 22, render: r => colorizeAction(r.action) },
74
- { key: 'data', label: 'Veri', minWidth: 30, render: r => tui.C.dim(r.data) },
76
+ { key: 'data', label: L('Veri', 'Data'), minWidth: 30, render: r => tui.C.dim(r.data) },
75
77
  ], { borderStyle: 'round', zebra: true }));
76
78
  console.log('');
77
79
  }
@@ -88,10 +90,10 @@ function audit_cmd(args) {
88
90
 
89
91
  if (action === 'stats') {
90
92
  const stats = audit.stats24h();
91
- console.log('\n' + tui.styled(' 📊 Son 24 Saat Audit İstatistiği', { color: tui.PALETTE.primary, bold: true }));
93
+ console.log('\n' + tui.styled(L(' 📊 Son 24 Saat Audit İstatistiği', ' 📊 Last 24h Audit Stats'), { color: tui.PALETTE.primary, bold: true }));
92
94
  console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
93
- console.log('\n ' + tui.C.muted('Dönem: ') + tui.C.text(stats.period));
94
- console.log(' ' + tui.C.muted('Toplam kayıt: ') + tui.styled(String(stats.total), { color: tui.PALETTE.primary, bold: true }));
95
+ console.log('\n ' + tui.C.muted(L('Dönem: ', 'Period: ')) + tui.C.text(stats.period));
96
+ console.log(' ' + tui.C.muted(L('Toplam kayıt: ', 'Total records: ')) + tui.styled(String(stats.total), { color: tui.PALETTE.primary, bold: true }));
95
97
  console.log('');
96
98
 
97
99
  // TUI tablo ile
@@ -106,8 +108,8 @@ function audit_cmd(args) {
106
108
  if (rows.length > 0) {
107
109
  console.log(tui.table(rows, [
108
110
  { key: 'action', label: 'Action', minWidth: 22, render: r => colorizeAction(r.action) },
109
- { key: 'count', label: 'Sayı', minWidth: 6, render: r => tui.styled(r.count, { color: tui.PALETTE.secondary, bold: true }) },
110
- { key: 'bar', label: 'Dağılım', minWidth: 22, render: r => tui.styled(r.bar, { color: tui.PALETTE.primary }) },
111
+ { key: 'count', label: L('Sayı', 'Count'), minWidth: 6, render: r => tui.styled(r.count, { color: tui.PALETTE.secondary, bold: true }) },
112
+ { key: 'bar', label: L('Dağılım', 'Distribution'), minWidth: 22, render: r => tui.styled(r.bar, { color: tui.PALETTE.primary }) },
111
113
  ], { borderStyle: 'round', zebra: true }));
112
114
  }
113
115
  console.log('');
@@ -118,7 +120,7 @@ function audit_cmd(args) {
118
120
  const date = params[0] || new Date().toISOString().slice(0, 10);
119
121
  const entries = audit.readLog(date);
120
122
  if (entries.length === 0) {
121
- console.log(chalk.yellow(`\n ⚠️ ${date} için kayıt yok.\n`));
123
+ console.log(chalk.yellow(`\n ⚠️ ${date} ${L('için kayıt yok.', '— no records.')}\n`));
122
124
  return;
123
125
  }
124
126
  showEntries(entries, 9999);
@@ -127,18 +129,18 @@ function audit_cmd(args) {
127
129
 
128
130
  if (action === 'cleanup') {
129
131
  const removed = audit.cleanup();
130
- console.log(chalk.green(`\n ✓ ${removed} eski log dosyası temizlendi (30 gün+).\n`));
132
+ console.log(chalk.green(`\n ✓ ${removed} ${L('eski log dosyası temizlendi (30 gün+).', 'old log files cleaned (30 days+).')}\n`));
131
133
  return;
132
134
  }
133
135
 
134
136
  if (action === 'tail') {
135
- console.log(chalk.cyan('\n 📡 Canlı audit log (Ctrl+C ile çık)...\n'));
137
+ console.log(chalk.cyan(L('\n 📡 Canlı audit log (Ctrl+C ile çık)...\n', '\n 📡 Live audit log (Ctrl+C to exit)...\n')));
136
138
  let lastSize = 0;
137
139
  const todayFile = audit.listLogFiles()[0];
138
140
  const interval = setInterval(() => {
139
141
  const current = audit.listLogFiles()[0];
140
142
  if (current !== todayFile) {
141
- console.log(chalk.gray(`\n ── yeni gün: ${current} ──`));
143
+ console.log(chalk.gray(`\n ── ${L('yeni gün', 'new day')}: ${current} ──`));
142
144
  }
143
145
  const file = path.join(audit.AUDIT_DIR, audit.listLogFiles()[0]);
144
146
  try {
@@ -167,7 +169,7 @@ function audit_cmd(args) {
167
169
  if (action === 'search') {
168
170
  const query = params.join(' ').toLowerCase();
169
171
  if (!query) {
170
- console.log(chalk.red('\n ❌ Arama terimi gerekli: natureco audit search <query>\n'));
172
+ console.log(chalk.red(L('\n ❌ Arama terimi gerekli: natureco audit search <query>\n', '\n ❌ Search term required: natureco audit search <query>\n')));
171
173
  return;
172
174
  }
173
175
  const today = new Date().toISOString().slice(0, 10);
@@ -183,7 +185,7 @@ function audit_cmd(args) {
183
185
 
184
186
  if (action === 'files') {
185
187
  const files = audit.listLogFiles();
186
- console.log(chalk.bold('\n 📁 Audit log dosyaları:\n'));
188
+ console.log(chalk.bold(L('\n 📁 Audit log dosyaları:\n', '\n 📁 Audit log files:\n')));
187
189
  for (const f of files) {
188
190
  const stat = fs.statSync(path.join(audit.AUDIT_DIR, f));
189
191
  const size = (stat.size / 1024).toFixed(1);
@@ -194,15 +196,15 @@ function audit_cmd(args) {
194
196
  }
195
197
 
196
198
  // Yardım
197
- console.log(chalk.yellow('\n Kullanım:'));
198
- console.log(chalk.gray(' natureco audit Bugünkü logları göster'));
199
- console.log(chalk.gray(' natureco audit today Bugünkü tüm loglar'));
200
- console.log(chalk.gray(' natureco audit stats 24 saat istatistik'));
201
- console.log(chalk.gray(' natureco audit show <date> Belirli gün (YYYY-MM-DD)'));
202
- console.log(chalk.gray(' natureco audit search <q> Log ara'));
203
- console.log(chalk.gray(' natureco audit files Dosya listesi'));
204
- console.log(chalk.gray(' natureco audit cleanup 30 günden eski logları sil'));
205
- console.log(chalk.gray(' natureco audit tail Canlı akış'));
199
+ console.log(chalk.yellow(L('\n Kullanım:', '\n Usage:')));
200
+ console.log(chalk.gray(L(' natureco audit Bugünkü logları göster', ' natureco audit Show today\'s logs')));
201
+ console.log(chalk.gray(L(' natureco audit today Bugünkü tüm loglar', ' natureco audit today All of today\'s logs')));
202
+ console.log(chalk.gray(L(' natureco audit stats 24 saat istatistik', ' natureco audit stats 24-hour stats')));
203
+ console.log(chalk.gray(L(' natureco audit show <date> Belirli gün (YYYY-MM-DD)', ' natureco audit show <date> Specific day (YYYY-MM-DD)')));
204
+ console.log(chalk.gray(L(' natureco audit search <q> Log ara', ' natureco audit search <q> Search logs')));
205
+ console.log(chalk.gray(L(' natureco audit files Dosya listesi', ' natureco audit files File list')));
206
+ console.log(chalk.gray(L(' natureco audit cleanup 30 günden eski logları sil', ' natureco audit cleanup Delete logs older than 30 days')));
207
+ console.log(chalk.gray(L(' natureco audit tail Canlı akış', ' natureco audit tail Live stream')));
206
208
  console.log('');
207
209
  }
208
210
 
@@ -1,5 +1,7 @@
1
1
  const chalk = require('chalk');
2
2
  const fs = require('fs');
3
+ const { getLang: _gl } = require('../utils/i18n');
4
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
3
5
  const path = require('path');
4
6
  const os = require('os');
5
7
  const { execSync } = require('child_process');
@@ -15,7 +17,7 @@ function backup(args) {
15
17
  if (action === 'verify') return verifyBackup(params.join(' '));
16
18
 
17
19
  console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
18
- console.log(chalk.gray(' Kullanım: natureco backup [create|list|restore|verify]\n'));
20
+ console.log(chalk.gray(L(' Kullanım: natureco backup [create|list|restore|verify]\n', ' Usage: natureco backup [create|list|restore|verify]\n')));
19
21
  process.exit(1);
20
22
  }
21
23
 
@@ -79,7 +81,7 @@ function listBackups() {
79
81
 
80
82
  function restoreBackup(file) {
81
83
  if (!file) {
82
- console.log(chalk.red('\n ❌ Backup file gerekli\n'));
84
+ console.log(chalk.red(L('\n ❌ Backup file gerekli\n', '\n ❌ Backup file required\n')));
83
85
  console.log(chalk.cyan(' natureco backup list'));
84
86
  console.log(chalk.cyan(' natureco backup restore <filename>\n'));
85
87
  process.exit(1);
@@ -89,7 +91,7 @@ function restoreBackup(file) {
89
91
  const backupFile = path.join(backupDir, file);
90
92
 
91
93
  if (!fs.existsSync(backupFile)) {
92
- console.log(chalk.red(`\n ❌ Backup bulunamadı: ${backupFile}\n`));
94
+ console.log(chalk.red(`\n ❌ ${L('Backup bulunamadı', 'Backup not found')}: ${backupFile}\n`));
93
95
  process.exit(1);
94
96
  }
95
97
 
@@ -105,7 +107,7 @@ function restoreBackup(file) {
105
107
 
106
108
  function verifyBackup(file) {
107
109
  if (!file) {
108
- console.log(chalk.red('\n ❌ Backup file gerekli\n'));
110
+ console.log(chalk.red(L('\n ❌ Backup file gerekli\n', '\n ❌ Backup file required\n')));
109
111
  process.exit(1);
110
112
  }
111
113
 
@@ -113,7 +115,7 @@ function verifyBackup(file) {
113
115
  const backupFile = path.join(backupDir, file);
114
116
 
115
117
  if (!fs.existsSync(backupFile)) {
116
- console.log(chalk.red(`\n ❌ Backup bulunamadı: ${backupFile}\n`));
118
+ console.log(chalk.red(`\n ❌ ${L('Backup bulunamadı', 'Backup not found')}: ${backupFile}\n`));
117
119
  process.exit(1);
118
120
  }
119
121
 
@@ -1,5 +1,7 @@
1
1
  const chalk = require('chalk');
2
2
  const { getConfig, saveConfig } = require('../utils/config');
3
+ const { getLang: _gl } = require('../utils/i18n');
4
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
3
5
  const dns = require('dns');
4
6
  const os = require('os');
5
7
 
@@ -41,12 +43,12 @@ async function bonjour(args) {
41
43
  if (action === 'status') return statusBonjour();
42
44
 
43
45
  console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
44
- console.log(chalk.gray(' Kullanım: natureco bonjour [scan|discover|status]\n'));
46
+ console.log(chalk.gray(L(' Kullanım: natureco bonjour [scan|discover|status]\n', ' Usage: natureco bonjour [scan|discover|status]\n')));
45
47
  process.exit(1);
46
48
  }
47
49
 
48
50
  async function scanNetwork() {
49
- console.log(chalk.cyan('\n Ağ taranıyor...\n'));
51
+ console.log(chalk.cyan(L('\n Ağ taranıyor...\n', '\n Scanning network...\n')));
50
52
 
51
53
  const interfaces = os.networkInterfaces();
52
54
  const found = [];
@@ -66,14 +68,14 @@ async function scanNetwork() {
66
68
  }
67
69
 
68
70
  if (found.length === 0) {
69
- console.log(chalk.gray(' Ağ arayüzü bulunamadı.\n'));
71
+ console.log(chalk.gray(L(' Ağ arayüzü bulunamadı.\n', ' No network interfaces found.\n')));
70
72
  return;
71
73
  }
72
74
 
73
75
  const gateway = await discoverGateway();
74
76
 
75
77
  console.log(chalk.gray(' ' + '─'.repeat(48)));
76
- console.log(chalk.cyan.bold('\n Ağ Arayüzleri\n'));
78
+ console.log(chalk.cyan.bold(L('\n Ağ Arayüzleri\n', '\n Network Interfaces\n')));
77
79
 
78
80
  found.forEach(f => {
79
81
  console.log(chalk.white(` ${f.interface}`));
@@ -82,14 +84,14 @@ async function scanNetwork() {
82
84
  });
83
85
 
84
86
  if (gateway) {
85
- console.log(chalk.gray('\n Varsayılan ağ geçidi: ') + chalk.cyan(gateway));
87
+ console.log(chalk.gray(L('\n Varsayılan ağ geçidi: ', '\n Default gateway: ')) + chalk.cyan(gateway));
86
88
  }
87
89
 
88
- console.log(chalk.gray('\n Service discovery için: ') + chalk.cyan('natureco bonjour discover\n'));
90
+ console.log(chalk.gray(L('\n Service discovery için: ', '\n For service discovery: ')) + chalk.cyan('natureco bonjour discover\n'));
89
91
  }
90
92
 
91
93
  async function discoverServices() {
92
- console.log(chalk.cyan('\n Servis keşfi başlatılıyor...\n'));
94
+ console.log(chalk.cyan(L('\n Servis keşfi başlatılıyor...\n', '\n Starting service discovery...\n')));
93
95
 
94
96
  // Try common ports
95
97
  const commonServices = [
@@ -138,30 +140,30 @@ async function discoverServices() {
138
140
  }
139
141
 
140
142
  if (results.length === 0) {
141
- console.log(chalk.gray(' Servis bulunamadı.\n'));
143
+ console.log(chalk.gray(L(' Servis bulunamadı.\n', ' No services found.\n')));
142
144
  return;
143
145
  }
144
146
 
145
147
  console.log(chalk.gray(' ' + '─'.repeat(48)));
146
- console.log(chalk.cyan.bold('\n Bulunan Servisler\n'));
148
+ console.log(chalk.cyan.bold(L('\n Bulunan Servisler\n', '\n Discovered Services\n')));
147
149
 
148
150
  results.forEach(r => {
149
151
  console.log(` ${chalk.green('●')} ${chalk.white(r.service)} ${chalk.gray(`→ ${r.host}:${r.port}`)}`);
150
152
  });
151
153
 
152
- console.log(chalk.gray('\n Özel port eklemek: ') + chalk.cyan('natureco config set discoveryPorts [3000,4000]\n'));
154
+ console.log(chalk.gray(L('\n Özel port eklemek: ', '\n Add custom port: ')) + chalk.cyan('natureco config set discoveryPorts [3000,4000]\n'));
153
155
  }
154
156
 
155
157
  function statusBonjour() {
156
- console.log(chalk.gray('\n Bonjour/mDNS Servis Keşfi\n'));
158
+ console.log(chalk.gray(L('\n Bonjour/mDNS Servis Keşfi\n', '\n Bonjour/mDNS Service Discovery\n')));
157
159
  console.log(chalk.gray(' ' + '─'.repeat(48)));
158
- console.log(chalk.gray(' Ağ keşif aracı — NatureCo servislerini ve gateway\'i bulur.'));
159
- console.log(chalk.gray(' Komutlar:'));
160
- console.log(chalk.cyan(' scan ') + chalk.gray('Ağ arayüzlerini ve IP\'leri listele'));
161
- console.log(chalk.cyan(' discover ') + chalk.gray('Yerel ağda NatureCo servislerini ara'));
162
- console.log(chalk.gray('\n Port yapılandırması:'));
163
- console.log(chalk.gray(' Varsayılan: 3848 (Gateway), 3849 (Dashboard)'));
164
- console.log(chalk.gray(' Özel: ') + chalk.cyan('natureco config set discoveryPorts [3000,4000]\n'));
160
+ console.log(chalk.gray(L(' Ağ keşif aracı — NatureCo servislerini ve gateway\'i bulur.', ' Network discovery tool — finds NatureCo services and the gateway.')));
161
+ console.log(chalk.gray(L(' Komutlar:', ' Commands:')));
162
+ console.log(chalk.cyan(' scan ') + chalk.gray(L('Ağ arayüzlerini ve IP\'leri listele', 'List network interfaces and IPs')));
163
+ console.log(chalk.cyan(' discover ') + chalk.gray(L('Yerel ağda NatureCo servislerini ara', 'Search for NatureCo services on the local network')));
164
+ console.log(chalk.gray(L('\n Port yapılandırması:', '\n Port configuration:')));
165
+ console.log(chalk.gray(L(' Varsayılan: 3848 (Gateway), 3849 (Dashboard)', ' Default: 3848 (Gateway), 3849 (Dashboard)')));
166
+ console.log(chalk.gray(L(' Özel: ', ' Custom: ')) + chalk.cyan('natureco config set discoveryPorts [3000,4000]\n'));
165
167
  }
166
168
 
167
169
  module.exports = bonjour;
@@ -1,5 +1,7 @@
1
1
  const chalk = require('chalk');
2
2
  const { getConfig } = require('../utils/config');
3
+ const { getLang: _gl } = require('../utils/i18n');
4
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
3
5
 
4
6
  const CAPABILITY_MODEL_PATTERNS = {
5
7
  chat: { patterns: ['llama', 'gpt', 'claude', 'mixtral', 'gemma', 'deepseek', 'mistral', 'grok', 'command'] },
@@ -23,7 +25,7 @@ async function capability(args) {
23
25
  if (action === 'infer' || action === 'check') return inferCapabilities(params[0]);
24
26
 
25
27
  console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
26
- console.log(chalk.gray(' Kullanım: natureco capability [list|infer]\n'));
28
+ console.log(chalk.gray(L(' Kullanım: natureco capability [list|infer]\n', ' Usage: natureco capability [list|infer]\n')));
27
29
  process.exit(1);
28
30
  }
29
31
 
@@ -104,7 +106,7 @@ async function listCapabilities() {
104
106
  }
105
107
 
106
108
  console.log(chalk.gray('\n Capabilities are inferred from available models.\n'));
107
- console.log(chalk.gray(' Detaylı sorgu: ') + chalk.cyan('natureco capability infer <provider>\n'));
109
+ console.log(chalk.gray(L(' Detaylı sorgu: ', ' Detailed query: ')) + chalk.cyan('natureco capability infer <provider>\n'));
108
110
  }
109
111
 
110
112
  function getKnownProviderModels(providerUrl) {
@@ -132,7 +134,7 @@ function getKnownProviderModels(providerUrl) {
132
134
 
133
135
  async function inferCapabilities(provider) {
134
136
  if (!provider) {
135
- console.log(chalk.red('\n ❌ Provider adı gerekli\n'));
137
+ console.log(chalk.red(L('\n ❌ Provider adı gerekli\n', '\n ❌ Provider name required\n')));
136
138
  process.exit(1);
137
139
  }
138
140
 
@@ -4,6 +4,8 @@
4
4
  */
5
5
 
6
6
  const inquirer = require('../utils/inquirer-wrapper');
7
+ const { getLang: _gl } = require('../utils/i18n');
8
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
7
9
  const chalk = require('chalk');
8
10
 
9
11
  /**
@@ -23,26 +25,26 @@ async function checkExistingToken(config, channelKey, channelName) {
23
25
  ? token.slice(0, 15) + '...' + token.slice(-5)
24
26
  : token.slice(0, 3) + '***';
25
27
 
26
- console.log(chalk.green('\n✓ ' + channelName + ' token zaten kayıtlı: ' + masked));
28
+ console.log(chalk.green('\n✓ ' + channelName + L(' token zaten kayıtlı: ', ' token already saved: ') + masked));
27
29
 
28
30
  if (config[channelKey + 'BotId']) {
29
31
  console.log(chalk.gray(' Bot ID: ' + config[channelKey + 'BotId']));
30
32
  }
31
33
  if (config[channelKey.replace('Token', 'AllowedChats')]) {
32
- console.log(chalk.gray(' İzinli sohbet: ' + config[channelKey.replace('Token', 'AllowedChats')].join(', ')));
34
+ console.log(chalk.gray(L(' İzinli sohbet: ', ' Allowed chat: ') + config[channelKey.replace('Token', 'AllowedChats')].join(', ')));
33
35
  }
34
36
  console.log('');
35
37
 
36
38
  const ans = await inquirer.prompt([{
37
39
  type: 'confirm',
38
40
  name: 'change',
39
- message: 'Token değiştirmek istiyor musun?',
41
+ message: L('Token değiştirmek istiyor musun?', 'Change token?'),
40
42
  default: false,
41
43
  }]);
42
44
 
43
45
  if (!ans.change) {
44
- console.log(chalk.green('\n✅ Mevcut token kullanılacak.\n'));
45
- console.log(chalk.gray('Gateway başlatmak için: natureco gateway start\n'));
46
+ console.log(chalk.green(L('\n✅ Mevcut token kullanılacak.\n', '\n✅ Existing token will be used.\n')));
47
+ console.log(chalk.gray(L('Gateway başlatmak için: natureco gateway start\n', 'To start the gateway: natureco gateway start\n')));
46
48
  return false; // Mevcut kullanilacak
47
49
  }
48
50
  return true; // Yeni alinacak