natureco-cli 5.61.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.61.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();
@@ -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
@@ -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
 
@@ -33,7 +35,7 @@ function commitments(args) {
33
35
  if (action === 'delete') return deleteC(params[0]);
34
36
 
35
37
  console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
36
- console.log(chalk.gray(' Kullanım: natureco commitments [list|add|check|resolve|pending|summary|delete]\n'));
38
+ console.log(chalk.gray(L(' Kullanım: natureco commitments [list|add|check|resolve|pending|summary|delete]\n', ' Usage: natureco commitments [list|add|check|resolve|pending|summary|delete]\n')));
37
39
  process.exit(1);
38
40
  }
39
41
 
@@ -42,7 +44,7 @@ function listC() {
42
44
  console.log(chalk.cyan('\n 📋 Commitments\n'));
43
45
  console.log(chalk.gray(' ' + '─'.repeat(48)));
44
46
  if (items.length === 0) {
45
- console.log(chalk.gray(' Henüz commitment yok.\n'));
47
+ console.log(chalk.gray(L(' Henüz commitment yok.\n', ' No commitments yet.\n')));
46
48
  return;
47
49
  }
48
50
  for (const c of items) {
@@ -55,52 +57,52 @@ function listC() {
55
57
 
56
58
  function addC(text) {
57
59
  if (!text) {
58
- console.log(chalk.red('\n ❌ Commitment text gerekli\n'));
60
+ console.log(chalk.red(L('\n ❌ Commitment text gerekli\n', '\n ❌ Commitment text required\n')));
59
61
  process.exit(1);
60
62
  }
61
63
  const items = load();
62
64
  const c = { id: genId(), text, status: 'pending', createdAt: new Date().toISOString(), resolvedAt: null };
63
65
  items.push(c);
64
66
  save(items);
65
- console.log(chalk.green(`\n ✅ Commitment eklendi: ${c.id}\n`));
67
+ console.log(chalk.green(`\n ✅ ${L('Commitment eklendi', 'Commitment added')}: ${c.id}\n`));
66
68
  console.log(` ${chalk.white(c.text)}`);
67
69
  console.log();
68
70
  }
69
71
 
70
72
  function checkC(id) {
71
73
  if (!id) {
72
- console.log(chalk.red('\n ❌ Commitment ID gerekli\n'));
74
+ console.log(chalk.red(L('\n ❌ Commitment ID gerekli\n', '\n ❌ Commitment ID required\n')));
73
75
  process.exit(1);
74
76
  }
75
77
  const items = load();
76
78
  const c = items.find(x => x.id === id);
77
- if (!c) { console.log(chalk.red(`\n ❌ Commitment bulunamadı: ${id}\n`)); process.exit(1); }
78
- if (c.status === 'resolved') { console.log(chalk.yellow(`\n ⚠️ "${c.text}" zaten çözülmüş\n`)); return; }
79
+ if (!c) { console.log(chalk.red(`\n ❌ ${L('Commitment bulunamadı', 'Commitment not found')}: ${id}\n`)); process.exit(1); }
80
+ if (c.status === 'resolved') { console.log(chalk.yellow(`\n ⚠️ "${c.text}" ${L('zaten çözülmüş', 'already resolved')}\n`)); return; }
79
81
  c.status = 'checked';
80
82
  save(items);
81
- console.log(chalk.green(`\n ☑️ "${c.text}" tamamlandı olarak işaretlendi\n`));
83
+ console.log(chalk.green(`\n ☑️ "${c.text}" ${L('tamamlandı olarak işaretlendi', 'marked as done')}\n`));
82
84
  }
83
85
 
84
86
  function resolveC(id) {
85
87
  if (!id) {
86
88
  const items = load();
87
89
  const pending = items.filter(x => x.status !== 'resolved');
88
- if (pending.length === 0) { console.log(chalk.gray('\n Çözülecek commitment yok\n')); return; }
90
+ if (pending.length === 0) { console.log(chalk.gray(L('\n Çözülecek commitment yok\n', '\n No commitments to resolve\n'))); return; }
89
91
  for (const c of pending) {
90
92
  c.status = 'resolved';
91
93
  c.resolvedAt = new Date().toISOString();
92
94
  }
93
95
  save(items);
94
- console.log(chalk.green(`\n ✅ ${pending.length} commitment çözüldü\n`));
96
+ console.log(chalk.green(`\n ✅ ${pending.length} ${L('commitment çözüldü', 'commitments resolved')}\n`));
95
97
  return;
96
98
  }
97
99
  const items = load();
98
100
  const c = items.find(x => x.id === id);
99
- if (!c) { console.log(chalk.red(`\n ❌ Commitment bulunamadı: ${id}\n`)); process.exit(1); }
101
+ if (!c) { console.log(chalk.red(`\n ❌ ${L('Commitment bulunamadı', 'Commitment not found')}: ${id}\n`)); process.exit(1); }
100
102
  c.status = 'resolved';
101
103
  c.resolvedAt = new Date().toISOString();
102
104
  save(items);
103
- console.log(chalk.green(`\n ✅ "${c.text}" çözüldü\n`));
105
+ console.log(chalk.green(`\n ✅ "${c.text}" ${L('çözüldü', 'resolved')}\n`));
104
106
  }
105
107
 
106
108
  function pendingC() {
@@ -125,8 +127,8 @@ function summaryC() {
125
127
  const pending = total - resolved - checked;
126
128
  console.log(chalk.cyan('\n 📊 Commitments Summary\n'));
127
129
  console.log(chalk.gray(' ' + '─'.repeat(48)));
128
- console.log(` ${chalk.white('Toplam:')} ${total}`);
129
- console.log(` ${chalk.green('Çözülen:')} ${resolved}`);
130
+ console.log(` ${chalk.white(L('Toplam:', 'Total:'))} ${total}`);
131
+ console.log(` ${chalk.green(L('Çözülen:', 'Resolved:'))} ${resolved}`);
130
132
  console.log(` ${chalk.yellow('Kontrol:')} ${checked}`);
131
133
  console.log(` ${chalk.cyan('Kalan:')} ${pending}`);
132
134
  console.log();
@@ -134,12 +136,12 @@ function summaryC() {
134
136
 
135
137
  function deleteC(id) {
136
138
  if (!id) {
137
- console.log(chalk.red('\n ❌ Commitment ID gerekli\n'));
139
+ console.log(chalk.red(L('\n ❌ Commitment ID gerekli\n', '\n ❌ Commitment ID required\n')));
138
140
  process.exit(1);
139
141
  }
140
142
  let items = load();
141
143
  const idx = items.findIndex(x => x.id === id);
142
- if (idx === -1) { console.log(chalk.red(`\n ❌ Commitment bulunamadı: ${id}\n`)); process.exit(1); }
144
+ if (idx === -1) { console.log(chalk.red(`\n ❌ ${L('Commitment bulunamadı', 'Commitment not found')}: ${id}\n`)); process.exit(1); }
143
145
  const removed = items.splice(idx, 1)[0];
144
146
  save(items);
145
147
  console.log(chalk.gray(`\n 🗑️ "${removed.text}" silindi\n`));
@@ -1,5 +1,7 @@
1
1
  const chalk = require('chalk');
2
2
  const { execSync, spawn } = require('child_process');
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 fs = require('fs');
5
7
  const os = require('os');
@@ -17,7 +19,7 @@ function daemon(args) {
17
19
  if (action === 'uninstall') return uninstallDaemon();
18
20
 
19
21
  console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
20
- console.log(chalk.gray(' Kullanım: natureco daemon [status|start|stop|restart|install|uninstall]\n'));
22
+ console.log(chalk.gray(L(' Kullanım: natureco daemon [status|start|stop|restart|install|uninstall]\n', ' Usage: natureco daemon [status|start|stop|restart|install|uninstall]\n')));
21
23
  process.exit(1);
22
24
  }
23
25