natureco-cli 5.56.0 → 5.58.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/cron.js +75 -73
- package/src/commands/discord.js +7 -5
- package/src/commands/gateway.js +25 -23
- package/src/commands/imessage.js +50 -48
- package/src/commands/irc.js +27 -25
- package/src/commands/mattermost.js +34 -32
- package/src/commands/plugins.js +69 -67
- package/src/commands/signal.js +61 -59
- package/src/commands/skills.js +76 -74
- package/src/commands/slack.js +7 -5
- package/src/commands/sms.js +35 -33
- package/src/commands/telegram.js +50 -48
- package/src/commands/whatsapp.js +43 -41
package/src/commands/skills.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
|
+
const { getLang: _gl } = require('../utils/i18n');
|
|
3
|
+
const L = (tr, en) => (_gl() === 'en' ? en : tr);
|
|
2
4
|
const tui = require('../utils/tui');
|
|
3
5
|
const path = require('path');
|
|
4
6
|
const fs = require('fs');
|
|
@@ -20,7 +22,7 @@ async function skills(args) {
|
|
|
20
22
|
if (action === 'install') {
|
|
21
23
|
const slug = params[0];
|
|
22
24
|
if (!slug) {
|
|
23
|
-
console.log(chalk.red('\n❌ Kullanım: natureco skills install <slug>\n'));
|
|
25
|
+
console.log(chalk.red(L('\n❌ Kullanım: natureco skills install <slug>\n', '\n❌ Usage: natureco skills install <slug>\n')));
|
|
24
26
|
process.exit(1);
|
|
25
27
|
}
|
|
26
28
|
await installSkillCommand(slug);
|
|
@@ -30,7 +32,7 @@ async function skills(args) {
|
|
|
30
32
|
if (action === 'remove') {
|
|
31
33
|
const slug = params[0];
|
|
32
34
|
if (!slug) {
|
|
33
|
-
console.log(chalk.red('\n❌ Kullanım: natureco skills remove <slug>\n'));
|
|
35
|
+
console.log(chalk.red(L('\n❌ Kullanım: natureco skills remove <slug>\n', '\n❌ Usage: natureco skills remove <slug>\n')));
|
|
34
36
|
process.exit(1);
|
|
35
37
|
}
|
|
36
38
|
await removeSkillCommand(slug);
|
|
@@ -42,7 +44,7 @@ async function skills(args) {
|
|
|
42
44
|
if (flag === '--all') {
|
|
43
45
|
await updateAllSkillsCommand();
|
|
44
46
|
} else {
|
|
45
|
-
console.log(chalk.red('\n❌ Kullanım: natureco skills update --all\n'));
|
|
47
|
+
console.log(chalk.red(L('\n❌ Kullanım: natureco skills update --all\n', '\n❌ Usage: natureco skills update --all\n')));
|
|
46
48
|
process.exit(1);
|
|
47
49
|
}
|
|
48
50
|
return;
|
|
@@ -51,7 +53,7 @@ async function skills(args) {
|
|
|
51
53
|
if (action === 'create') {
|
|
52
54
|
const name = params[0];
|
|
53
55
|
if (!name) {
|
|
54
|
-
console.log(chalk.red('\n❌ Kullanım: natureco skills create <ad>\n'));
|
|
56
|
+
console.log(chalk.red(L('\n❌ Kullanım: natureco skills create <ad>\n', '\n❌ Usage: natureco skills create <name>\n')));
|
|
55
57
|
process.exit(1);
|
|
56
58
|
}
|
|
57
59
|
await createSkillCommand(name);
|
|
@@ -88,7 +90,7 @@ async function skills(args) {
|
|
|
88
90
|
if (action === 'accept') {
|
|
89
91
|
const proposalId = params[0];
|
|
90
92
|
if (!proposalId) {
|
|
91
|
-
console.log(chalk.red('\n❌ Kullanım: natureco skills accept <proposal-id>\n'));
|
|
93
|
+
console.log(chalk.red(L('\n❌ Kullanım: natureco skills accept <proposal-id>\n', '\n❌ Usage: natureco skills accept <proposal-id>\n')));
|
|
92
94
|
process.exit(1);
|
|
93
95
|
}
|
|
94
96
|
await acceptProposalCommand(proposalId);
|
|
@@ -98,7 +100,7 @@ async function skills(args) {
|
|
|
98
100
|
if (action === 'reject') {
|
|
99
101
|
const proposalId = params[0];
|
|
100
102
|
if (!proposalId) {
|
|
101
|
-
console.log(chalk.red('\n❌ Kullanım: natureco skills reject <proposal-id>\n'));
|
|
103
|
+
console.log(chalk.red(L('\n❌ Kullanım: natureco skills reject <proposal-id>\n', '\n❌ Usage: natureco skills reject <proposal-id>\n')));
|
|
102
104
|
process.exit(1);
|
|
103
105
|
}
|
|
104
106
|
detector.rejectProposal(proposalId);
|
|
@@ -108,7 +110,7 @@ async function skills(args) {
|
|
|
108
110
|
|
|
109
111
|
if (action === 'forget') {
|
|
110
112
|
detector.reset();
|
|
111
|
-
console.log(chalk.yellow('\n🧹 Tüm pattern hafızası ve proposal\'lar silindi.\n'));
|
|
113
|
+
console.log(chalk.yellow(L('\n🧹 Tüm pattern hafızası ve proposal\'lar silindi.\n', '\n🧹 All pattern memory and proposals cleared.\n')));
|
|
112
114
|
return;
|
|
113
115
|
}
|
|
114
116
|
|
|
@@ -120,27 +122,27 @@ async function skills(args) {
|
|
|
120
122
|
|
|
121
123
|
if (action === 'install-mp') {
|
|
122
124
|
const skillName = params[0];
|
|
123
|
-
if (!skillName) { console.log(chalk.red('\n❌ Kullanım: natureco skills install-mp <name>\n')); process.exit(1); }
|
|
125
|
+
if (!skillName) { console.log(chalk.red(L('\n❌ Kullanım: natureco skills install-mp <name>\n', '\n❌ Usage: natureco skills install-mp <name>\n'))); process.exit(1); }
|
|
124
126
|
await installFromMarketplace(skillName);
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
if (action === 'search-mp') {
|
|
129
131
|
const query = params[0];
|
|
130
|
-
if (!query) { console.log(chalk.red('\n❌ Kullanım: natureco skills search-mp <query>\n')); process.exit(1); }
|
|
132
|
+
if (!query) { console.log(chalk.red(L('\n❌ Kullanım: natureco skills search-mp <query>\n', '\n❌ Usage: natureco skills search-mp <query>\n'))); process.exit(1); }
|
|
131
133
|
await searchMarketplace(query);
|
|
132
134
|
return;
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
if (action === 'remove-mp' || action === 'uninstall-mp') {
|
|
136
138
|
const skillName = params[0];
|
|
137
|
-
if (!skillName) { console.log(chalk.red('\n❌ Kullanım: natureco skills remove-mp <name>\n')); process.exit(1); }
|
|
139
|
+
if (!skillName) { console.log(chalk.red(L('\n❌ Kullanım: natureco skills remove-mp <name>\n', '\n❌ Usage: natureco skills remove-mp <name>\n'))); process.exit(1); }
|
|
138
140
|
uninstallMarketplace(skillName);
|
|
139
141
|
return;
|
|
140
142
|
}
|
|
141
143
|
|
|
142
|
-
console.log(chalk.red(`\n❌ Geçersiz action: ${action}\n`));
|
|
143
|
-
console.log(chalk.gray('Kullanım: natureco skills [list|install|remove|update|create|search|browse|info|check|suggest|accept|reject|forget|marketplace|install-mp|search-mp|remove-mp]\n'));
|
|
144
|
+
console.log(chalk.red(`\n❌ ${L('Geçersiz action', 'Invalid action')}: ${action}\n`));
|
|
145
|
+
console.log(chalk.gray(L('Kullanım: natureco skills [list|install|remove|update|create|search|browse|info|check|suggest|accept|reject|forget|marketplace|install-mp|search-mp|remove-mp]\n', 'Usage: natureco skills [list|install|remove|update|create|search|browse|info|check|suggest|accept|reject|forget|marketplace|install-mp|search-mp|remove-mp]\n')));
|
|
144
146
|
process.exit(1);
|
|
145
147
|
}
|
|
146
148
|
|
|
@@ -157,7 +159,7 @@ async function listMarketplace() {
|
|
|
157
159
|
for (const s of result.skills) {
|
|
158
160
|
console.log(' ' + chalk.cyan(s.name.padEnd(22)) + chalk.gray((s.description || '').slice(0, 50)));
|
|
159
161
|
}
|
|
160
|
-
console.log('\n ' + chalk.gray('Kur: ') + chalk.cyan('natureco skills install-mp <name>'));
|
|
162
|
+
console.log('\n ' + chalk.gray(L('Kur: ', 'Install: ')) + chalk.cyan('natureco skills install-mp <name>'));
|
|
161
163
|
console.log('');
|
|
162
164
|
}
|
|
163
165
|
}
|
|
@@ -169,7 +171,7 @@ async function installFromMarketplace(skillName) {
|
|
|
169
171
|
if (!mp) return;
|
|
170
172
|
const result = await mp.execute({ action: 'install', skillName });
|
|
171
173
|
if (result.success) {
|
|
172
|
-
console.log(chalk.green('\n ✓ ' + skillName + ' kuruldu: ' + result.path + '\n'));
|
|
174
|
+
console.log(chalk.green('\n ✓ ' + skillName + L(' kuruldu: ', ' installed: ') + result.path + '\n'));
|
|
173
175
|
} else {
|
|
174
176
|
console.log(chalk.red('\n ✗ ' + result.error + '\n'));
|
|
175
177
|
}
|
|
@@ -182,7 +184,7 @@ async function searchMarketplace(query) {
|
|
|
182
184
|
if (!mp) return;
|
|
183
185
|
const result = await mp.execute({ action: 'search', query });
|
|
184
186
|
if (result.success) {
|
|
185
|
-
console.log(chalk.cyan.bold('\n 🔍 "' + query + '" icin sonuclar\n'));
|
|
187
|
+
console.log(chalk.cyan.bold('\n 🔍 "' + query + L('" icin sonuclar\n', '" results\n')));
|
|
186
188
|
for (const s of result.results) {
|
|
187
189
|
console.log(' ' + chalk.cyan(s.name.padEnd(22)) + chalk.gray((s.description || '').slice(0, 50)));
|
|
188
190
|
}
|
|
@@ -194,9 +196,9 @@ function uninstallMarketplace(skillName) {
|
|
|
194
196
|
const skillDir = path.join(os.homedir(), '.natureco', 'skills', skillName);
|
|
195
197
|
if (fs.existsSync(skillDir)) {
|
|
196
198
|
fs.rmSync(skillDir, { recursive: true });
|
|
197
|
-
console.log(chalk.green('\n ✓ ' + skillName + ' kaldirildi\n'));
|
|
199
|
+
console.log(chalk.green('\n ✓ ' + skillName + L(' kaldirildi\n', ' removed\n')));
|
|
198
200
|
} else {
|
|
199
|
-
console.log(chalk.yellow('\n ' + skillName + ' zaten yok\n'));
|
|
201
|
+
console.log(chalk.yellow('\n ' + skillName + L(' zaten yok\n', ' already gone\n')));
|
|
200
202
|
}
|
|
201
203
|
}
|
|
202
204
|
|
|
@@ -206,41 +208,41 @@ async function listSkills() {
|
|
|
206
208
|
const userCount = allSkills.filter(s => s.source === 'user').length;
|
|
207
209
|
|
|
208
210
|
console.log(chalk.gray('\n ' + '─'.repeat(48)));
|
|
209
|
-
console.log(chalk.cyan.bold('\n Yüklü Skill\'ler') + chalk.gray(` — toplam ${allSkills.length} (${builtinCount} yerleşik${userCount ? `, ${userCount} kişisel` : ''})`));
|
|
210
|
-
console.log(chalk.gray(' Yerleşikler: ~/.natureco/skills-builtin · Kişiseller: ~/.natureco/skills · Araçlar: ~/.natureco/tools\n'));
|
|
211
|
+
console.log(chalk.cyan.bold(L('\n Yüklü Skill\'ler', '\n Installed Skills')) + chalk.gray(` — ${L('toplam', 'total')} ${allSkills.length} (${builtinCount} ${L('yerleşik', 'built-in')}${userCount ? `, ${userCount} ${L('kişisel', 'personal')}` : ''})`));
|
|
212
|
+
console.log(chalk.gray(L(' Yerleşikler: ~/.natureco/skills-builtin · Kişiseller: ~/.natureco/skills · Araçlar: ~/.natureco/tools\n', ' Built-in: ~/.natureco/skills-builtin · Personal: ~/.natureco/skills · Tools: ~/.natureco/tools\n')));
|
|
211
213
|
|
|
212
214
|
if (allSkills.length === 0) {
|
|
213
215
|
// Yerleşikler pakette gelir; bu duruma normalde ancak paket bozulursa düşülür
|
|
214
|
-
console.log(chalk.red(' ⚠ Hiç skill bulunamadı — kurulum bozuk olabilir.'));
|
|
215
|
-
console.log(chalk.gray(' Onarmak için: ') + chalk.cyan('npm install -g natureco-cli') + chalk.gray(' (yeniden kurar)\n'));
|
|
216
|
+
console.log(chalk.red(L(' ⚠ Hiç skill bulunamadı — kurulum bozuk olabilir.', ' ⚠ No skills found — installation may be broken.')));
|
|
217
|
+
console.log(chalk.gray(L(' Onarmak için: ', ' To repair: ')) + chalk.cyan('npm install -g natureco-cli') + chalk.gray(L(' (yeniden kurar)\n', ' (reinstalls)\n')));
|
|
216
218
|
return;
|
|
217
219
|
}
|
|
218
220
|
|
|
219
221
|
allSkills.forEach((skill, index) => {
|
|
220
|
-
const sourceLabel = skill.source === 'builtin' ? chalk.blue('[yerleşik]') :
|
|
221
|
-
skill.source === 'user' ? chalk.cyan('[kişisel]') :
|
|
222
|
-
chalk.magenta('[proje]');
|
|
222
|
+
const sourceLabel = skill.source === 'builtin' ? chalk.blue(L('[yerleşik]', '[built-in]')) :
|
|
223
|
+
skill.source === 'user' ? chalk.cyan(L('[kişisel]', '[personal]')) :
|
|
224
|
+
chalk.magenta(L('[proje]', '[project]'));
|
|
223
225
|
console.log(chalk.white(` ${index + 1}. ${skill.name} `) + sourceLabel);
|
|
224
226
|
console.log(chalk.gray(` ${skill.description}`));
|
|
225
227
|
if (skill.metadata?.requires?.bins) {
|
|
226
|
-
console.log(chalk.gray(` Gerekli: ${skill.metadata.requires.bins.join(', ')}`));
|
|
228
|
+
console.log(chalk.gray(` ${L('Gerekli', 'Required')}: ${skill.metadata.requires.bins.join(', ')}`));
|
|
227
229
|
}
|
|
228
230
|
console.log('');
|
|
229
231
|
});
|
|
230
232
|
|
|
231
233
|
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
232
|
-
console.log(chalk.gray(` Toplam: ${allSkills.length} skill`));
|
|
233
|
-
console.log(chalk.gray(' Kaldırmak için: ') + chalk.cyan('natureco skills remove <slug>\n'));
|
|
234
|
+
console.log(chalk.gray(` ${L('Toplam', 'Total')}: ${allSkills.length} skill`));
|
|
235
|
+
console.log(chalk.gray(L(' Kaldırmak için: ', ' To remove: ')) + chalk.cyan('natureco skills remove <slug>\n'));
|
|
234
236
|
}
|
|
235
237
|
|
|
236
238
|
async function installSkillCommand(slug) {
|
|
237
|
-
console.log(chalk.yellow(`\n⏳ "${slug}" skill'i yükleniyor
|
|
239
|
+
console.log(chalk.yellow(`\n⏳ "${slug}" ${L("skill'i yükleniyor...", 'installing...')}\n`));
|
|
238
240
|
|
|
239
241
|
try {
|
|
240
242
|
await installSkill(slug);
|
|
241
|
-
console.log(chalk.green(`✅ "${slug}" başarıyla yüklendi!\n`));
|
|
243
|
+
console.log(chalk.green(`✅ "${slug}" ${L('başarıyla yüklendi', 'installed successfully')}!\n`));
|
|
242
244
|
} catch (err) {
|
|
243
|
-
console.log(chalk.red(`\n❌ Hata: ${err.message}\n`));
|
|
245
|
+
console.log(chalk.red(`\n❌ ${L('Hata', 'Error')}: ${err.message}\n`));
|
|
244
246
|
process.exit(1);
|
|
245
247
|
}
|
|
246
248
|
}
|
|
@@ -250,53 +252,53 @@ async function removeSkillCommand(slug) {
|
|
|
250
252
|
{
|
|
251
253
|
type: 'confirm',
|
|
252
254
|
name: 'confirm',
|
|
253
|
-
message: `"${slug}" skill'ini silmek istediğinizden emin misiniz
|
|
255
|
+
message: `"${slug}" ${L("skill'ini silmek istediğinizden emin misiniz?", '— delete this skill?')}`,
|
|
254
256
|
default: false,
|
|
255
257
|
},
|
|
256
258
|
]);
|
|
257
259
|
|
|
258
260
|
if (!confirm) {
|
|
259
|
-
console.log(chalk.gray('\nİptal edildi.\n'));
|
|
261
|
+
console.log(chalk.gray(L('\nİptal edildi.\n', '\nCancelled.\n')));
|
|
260
262
|
return;
|
|
261
263
|
}
|
|
262
264
|
|
|
263
265
|
try {
|
|
264
266
|
removeSkill(slug);
|
|
265
|
-
console.log(chalk.green(`\n✅ "${slug}" silindi
|
|
267
|
+
console.log(chalk.green(`\n✅ "${slug}" ${L('silindi.', 'deleted.')}\n`));
|
|
266
268
|
} catch (err) {
|
|
267
|
-
console.log(chalk.red(`\n❌ Hata: ${err.message}\n`));
|
|
269
|
+
console.log(chalk.red(`\n❌ ${L('Hata', 'Error')}: ${err.message}\n`));
|
|
268
270
|
process.exit(1);
|
|
269
271
|
}
|
|
270
272
|
}
|
|
271
273
|
|
|
272
274
|
async function updateAllSkillsCommand() {
|
|
273
|
-
console.log(chalk.yellow('\n⏳ Tüm skill\'ler güncelleniyor...\n'));
|
|
275
|
+
console.log(chalk.yellow(L('\n⏳ Tüm skill\'ler güncelleniyor...\n', '\n⏳ Updating all skills...\n')));
|
|
274
276
|
|
|
275
277
|
try {
|
|
276
278
|
const updated = await updateAllSkills();
|
|
277
279
|
if (updated.length === 0) {
|
|
278
|
-
console.log(chalk.gray('Güncellenecek skill bulunamadı.\n'));
|
|
280
|
+
console.log(chalk.gray(L('Güncellenecek skill bulunamadı.\n', 'No skills to update.\n')));
|
|
279
281
|
} else {
|
|
280
|
-
console.log(chalk.green(`✅ ${updated.length} skill güncellendi:\n`));
|
|
282
|
+
console.log(chalk.green(`✅ ${updated.length} skill ${L('güncellendi', 'updated')}:\n`));
|
|
281
283
|
updated.forEach(s => console.log(chalk.cyan(` - ${s}`)));
|
|
282
284
|
console.log('');
|
|
283
285
|
}
|
|
284
286
|
} catch (err) {
|
|
285
|
-
console.log(chalk.red(`\n❌ Hata: ${err.message}\n`));
|
|
287
|
+
console.log(chalk.red(`\n❌ ${L('Hata', 'Error')}: ${err.message}\n`));
|
|
286
288
|
process.exit(1);
|
|
287
289
|
}
|
|
288
290
|
}
|
|
289
291
|
|
|
290
292
|
async function createSkillCommand(name) {
|
|
291
|
-
console.log(chalk.yellow(`\n⏳ "${name}" skill şablonu oluşturuluyor
|
|
293
|
+
console.log(chalk.yellow(`\n⏳ "${name}" skill ${L('şablonu oluşturuluyor...', 'template being created...')}\n`));
|
|
292
294
|
|
|
293
295
|
try {
|
|
294
296
|
const skillPath = createSkillTemplate(name);
|
|
295
|
-
console.log(chalk.green(`✅ Skill şablonu oluşturuldu:\n`));
|
|
297
|
+
console.log(chalk.green(`✅ ${L('Skill şablonu oluşturuldu', 'Skill template created')}:\n`));
|
|
296
298
|
console.log(chalk.cyan(` ${skillPath}\n`));
|
|
297
|
-
console.log(chalk.gray('SKILL.md dosyasını düzenleyerek skill\'i özelleştirin.\n'));
|
|
299
|
+
console.log(chalk.gray(L('SKILL.md dosyasını düzenleyerek skill\'i özelleştirin.\n', 'Customize the skill by editing SKILL.md.\n')));
|
|
298
300
|
} catch (err) {
|
|
299
|
-
console.log(chalk.red(`\n❌ Hata: ${err.message}\n`));
|
|
301
|
+
console.log(chalk.red(`\n❌ ${L('Hata', 'Error')}: ${err.message}\n`));
|
|
300
302
|
process.exit(1);
|
|
301
303
|
}
|
|
302
304
|
}
|
|
@@ -305,22 +307,22 @@ async function searchSkillsCommand(query) {
|
|
|
305
307
|
if (!query || query.trim().length === 0) {
|
|
306
308
|
try {
|
|
307
309
|
const popularSkills = await getPopularSkills();
|
|
308
|
-
console.log(chalk.yellow('\nPopüler Skill\'ler:\n'));
|
|
310
|
+
console.log(chalk.yellow(L('\nPopüler Skill\'ler:\n', '\nPopular Skills:\n')));
|
|
309
311
|
popularSkills.forEach(skill => {
|
|
310
312
|
console.log(chalk.cyan(` ${skill.name.padEnd(15)}`), chalk.gray(skill.description));
|
|
311
313
|
});
|
|
312
314
|
} catch (err) {
|
|
313
|
-
console.log(chalk.red(`\n ❌ Popüler skill'ler
|
|
315
|
+
console.log(chalk.red(`\n ❌ ${L("Popüler skill'ler alınamadı", 'Could not fetch popular skills')}: ${err.message}\n`));
|
|
314
316
|
}
|
|
315
317
|
console.log('');
|
|
316
|
-
console.log(chalk.gray('Kurmak için: '), chalk.cyan('natureco skills install <slug>'));
|
|
317
|
-
console.log(chalk.gray('Örnek: '), chalk.cyan('natureco skills install github'));
|
|
318
|
+
console.log(chalk.gray(L('Kurmak için: ', 'To install: ')), chalk.cyan('natureco skills install <slug>'));
|
|
319
|
+
console.log(chalk.gray(L('Örnek: ', 'Example: ')), chalk.cyan('natureco skills install github'));
|
|
318
320
|
console.log(chalk.gray('ClawHub: '), chalk.cyan('natureco skills install clawhub:github'));
|
|
319
321
|
console.log('');
|
|
320
322
|
return;
|
|
321
323
|
}
|
|
322
324
|
|
|
323
|
-
console.log(chalk.yellow(`\n⏳ "${query}" aranıyor
|
|
325
|
+
console.log(chalk.yellow(`\n⏳ "${query}" ${L('aranıyor...', 'searching...')}\n`));
|
|
324
326
|
|
|
325
327
|
try {
|
|
326
328
|
// ClawHub search API
|
|
@@ -328,30 +330,30 @@ async function searchSkillsCommand(query) {
|
|
|
328
330
|
const response = await fetch(searchUrl);
|
|
329
331
|
|
|
330
332
|
if (!response.ok) {
|
|
331
|
-
throw new SkillError('ClawHub API\'ye erişilemedi', 'fetch', `https://clawhub.ai/api/skills?q=${encodeURIComponent(query)}`);
|
|
333
|
+
throw new SkillError(L('ClawHub API\'ye erişilemedi', 'Could not reach the ClawHub API'), 'fetch', `https://clawhub.ai/api/skills?q=${encodeURIComponent(query)}`);
|
|
332
334
|
}
|
|
333
335
|
|
|
334
336
|
let data;
|
|
335
337
|
try {
|
|
336
338
|
data = await response.json();
|
|
337
339
|
} catch {
|
|
338
|
-
throw new SkillError('ClawHub geçersiz yanıt döndü (JSON bekleniyordu)', 'parse', searchUrl);
|
|
340
|
+
throw new SkillError(L('ClawHub geçersiz yanıt döndü (JSON bekleniyordu)', 'ClawHub returned an invalid response (JSON expected)'), 'parse', searchUrl);
|
|
339
341
|
}
|
|
340
342
|
const results = data.skills || [];
|
|
341
343
|
|
|
342
344
|
if (results.length === 0) {
|
|
343
|
-
console.log(chalk.yellow(`"${query}" için sonuç bulunamad
|
|
345
|
+
console.log(chalk.yellow(`"${query}" ${L('için sonuç bulunamadı.', '— no results found.')}\n`));
|
|
344
346
|
return;
|
|
345
347
|
}
|
|
346
348
|
|
|
347
|
-
console.log(chalk.yellow(`"${query}" için ${results.length}
|
|
349
|
+
console.log(chalk.yellow(`"${query}" ${L('için', 'for')} ${results.length} ${L('sonuç', 'results')}:\n`));
|
|
348
350
|
results.forEach(skill => {
|
|
349
|
-
console.log(chalk.cyan(` ${skill.name.padEnd(15)}`), chalk.gray(skill.description || 'Açıklama yok'));
|
|
350
|
-
console.log(chalk.gray(` Kurmak için: natureco skills install clawhub:${skill.slug}`));
|
|
351
|
+
console.log(chalk.cyan(` ${skill.name.padEnd(15)}`), chalk.gray(skill.description || L('Açıklama yok', 'No description')));
|
|
352
|
+
console.log(chalk.gray(` ${L('Kurmak için', 'To install')}: natureco skills install clawhub:${skill.slug}`));
|
|
351
353
|
});
|
|
352
354
|
console.log('');
|
|
353
355
|
} catch (err) {
|
|
354
|
-
console.log(chalk.red(`\n ❌ Arama başarısız: ${err.message}\n`));
|
|
356
|
+
console.log(chalk.red(`\n ❌ ${L('Arama başarısız', 'Search failed')}: ${err.message}\n`));
|
|
355
357
|
}
|
|
356
358
|
}
|
|
357
359
|
|
|
@@ -360,18 +362,18 @@ async function browseSkillsCommand() {
|
|
|
360
362
|
try {
|
|
361
363
|
popularSkills = await getPopularSkills();
|
|
362
364
|
} catch (err) {
|
|
363
|
-
console.log(chalk.red(`\n ❌ Popüler skill'ler
|
|
365
|
+
console.log(chalk.red(`\n ❌ ${L("Popüler skill'ler alınamadı", 'Could not fetch popular skills')}: ${err.message}\n`));
|
|
364
366
|
return;
|
|
365
367
|
}
|
|
366
368
|
|
|
367
|
-
console.log(chalk.green.bold('\n╭─ Popüler Skill\'ler ─╮\n'));
|
|
369
|
+
console.log(chalk.green.bold(L('\n╭─ Popüler Skill\'ler ─╮\n', '\n╭─ Popular Skills ─╮\n')));
|
|
368
370
|
|
|
369
371
|
process.stdin.resume();
|
|
370
372
|
const { selectedSkills } = await inquirer.prompt([
|
|
371
373
|
{
|
|
372
374
|
type: 'checkbox',
|
|
373
375
|
name: 'selectedSkills',
|
|
374
|
-
message: 'Kurmak istediğiniz skill\'leri seçin:',
|
|
376
|
+
message: L('Kurmak istediğiniz skill\'leri seçin:', 'Select the skills you want to install:'),
|
|
375
377
|
choices: popularSkills.map(skill => ({
|
|
376
378
|
name: `${skill.name} - ${skill.description}`,
|
|
377
379
|
value: skill.source === 'clawhub' ? `clawhub:${skill.slug}` : skill.slug,
|
|
@@ -381,22 +383,22 @@ async function browseSkillsCommand() {
|
|
|
381
383
|
process.stdin.pause();
|
|
382
384
|
|
|
383
385
|
if (selectedSkills.length === 0) {
|
|
384
|
-
console.log(chalk.gray('\nHiçbir skill seçilmedi.\n'));
|
|
386
|
+
console.log(chalk.gray(L('\nHiçbir skill seçilmedi.\n', '\nNo skills selected.\n')));
|
|
385
387
|
return;
|
|
386
388
|
}
|
|
387
389
|
|
|
388
|
-
console.log(chalk.yellow(`\n⏳ ${selectedSkills.length} skill kuruluyor
|
|
390
|
+
console.log(chalk.yellow(`\n⏳ ${selectedSkills.length} skill ${L('kuruluyor...', 'installing...')}\n`));
|
|
389
391
|
|
|
390
392
|
for (const slug of selectedSkills) {
|
|
391
393
|
try {
|
|
392
394
|
await installSkill(slug);
|
|
393
|
-
console.log(chalk.green(`✅ ${slug} kuruldu`));
|
|
395
|
+
console.log(chalk.green(`✅ ${slug} ${L('kuruldu', 'installed')}`));
|
|
394
396
|
} catch (err) {
|
|
395
|
-
console.log(chalk.red(`❌ ${slug}
|
|
397
|
+
console.log(chalk.red(`❌ ${slug} ${L('kurulamadı', 'could not be installed')}: ${err.message}`));
|
|
396
398
|
}
|
|
397
399
|
}
|
|
398
400
|
|
|
399
|
-
console.log(chalk.green('\n✅ Kurulum tamamlandı!\n'));
|
|
401
|
+
console.log(chalk.green(L('\n✅ Kurulum tamamlandı!\n', '\n✅ Installation complete!\n')));
|
|
400
402
|
}
|
|
401
403
|
|
|
402
404
|
async function infoSkill(slug) {
|
|
@@ -457,11 +459,11 @@ async function listProposals() {
|
|
|
457
459
|
|
|
458
460
|
console.log('\n' + tui.styled(' 🧠 Self-Evolving Skill Proposals', { color: tui.PALETTE.primary, bold: true }));
|
|
459
461
|
console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
|
|
460
|
-
console.log(' ' + tui.C.muted('Kullanımın tekrar eden pattern\'lerinden otomatik skill önerileri.\n'));
|
|
462
|
+
console.log(' ' + tui.C.muted(L('Kullanımın tekrar eden pattern\'lerinden otomatik skill önerileri.\n', 'Automatic skill suggestions from your recurring usage patterns.\n')));
|
|
461
463
|
|
|
462
464
|
if (pending.length === 0) {
|
|
463
|
-
console.log(' ' + tui.C.muted('Şu an öneri yok. Daha fazla tool çağrısı yap, sistem öğrensin.'));
|
|
464
|
-
console.log(' ' + tui.C.muted('Pattern\'leri sıfırla: ') + tui.C.brand('natureco skills forget\n'));
|
|
465
|
+
console.log(' ' + tui.C.muted(L('Şu an öneri yok. Daha fazla tool çağrısı yap, sistem öğrensin.', 'No suggestions right now. Make more tool calls so the system can learn.')));
|
|
466
|
+
console.log(' ' + tui.C.muted(L('Pattern\'leri sıfırla: ', 'Reset patterns: ')) + tui.C.brand('natureco skills forget\n'));
|
|
465
467
|
return;
|
|
466
468
|
}
|
|
467
469
|
|
|
@@ -474,26 +476,26 @@ async function listProposals() {
|
|
|
474
476
|
}));
|
|
475
477
|
|
|
476
478
|
console.log(tui.table(rows, [
|
|
477
|
-
{ key: 'name', label: 'Öneri', minWidth: 25, render: r => tui.styled(r.name, { color: tui.PALETTE.primary, bold: true }) },
|
|
478
|
-
{ key: 'count', label: 'Tekrar', minWidth: 7, render: r => tui.styled(r.count, { color: tui.PALETTE.accent, bold: true }) },
|
|
479
|
+
{ key: 'name', label: L('Öneri', 'Suggestion'), minWidth: 25, render: r => tui.styled(r.name, { color: tui.PALETTE.primary, bold: true }) },
|
|
480
|
+
{ key: 'count', label: L('Tekrar', 'Repeats'), minWidth: 7, render: r => tui.styled(r.count, { color: tui.PALETTE.accent, bold: true }) },
|
|
479
481
|
{ key: 'pattern', label: 'Pattern', minWidth: 30, render: r => tui.C.muted(r.pattern) },
|
|
480
|
-
{ key: 'first', label: 'İlk', minWidth: 18, render: r => tui.C.muted(r.first) },
|
|
482
|
+
{ key: 'first', label: L('İlk', 'First'), minWidth: 18, render: r => tui.C.muted(r.first) },
|
|
481
483
|
], { borderStyle: 'round', zebra: true }));
|
|
482
484
|
|
|
483
|
-
console.log('\n ' + tui.C.muted('Kabul et: ') + tui.C.brand('natureco skills accept <id>'));
|
|
484
|
-
console.log(' ' + tui.C.muted('Reddet: ') + tui.C.brand('natureco skills reject <id>\n'));
|
|
485
|
+
console.log('\n ' + tui.C.muted(L('Kabul et: ', 'Accept: ')) + tui.C.brand('natureco skills accept <id>'));
|
|
486
|
+
console.log(' ' + tui.C.muted(L('Reddet: ', 'Reject: ')) + tui.C.brand('natureco skills reject <id>\n'));
|
|
485
487
|
}
|
|
486
488
|
|
|
487
489
|
async function acceptProposalCommand(proposalId) {
|
|
488
|
-
console.log(chalk.yellow('\n⏳ Skill oluşturuluyor...\n'));
|
|
490
|
+
console.log(chalk.yellow(L('\n⏳ Skill oluşturuluyor...\n', '\n⏳ Creating skill...\n')));
|
|
489
491
|
const result = detector.acceptProposal(proposalId);
|
|
490
492
|
if (!result.success) {
|
|
491
493
|
console.log(chalk.red(`\n❌ ${result.reason}\n`));
|
|
492
494
|
process.exit(1);
|
|
493
495
|
}
|
|
494
|
-
console.log(chalk.green(`✅ Yeni skill oluşturuldu: ${result.skillName}\n`));
|
|
495
|
-
console.log(chalk.gray(` Yol: ${result.path}\n`));
|
|
496
|
-
console.log(chalk.gray(' SKILL.md dosyasını düzenleyerek özelleştirebilirsin.\n'));
|
|
496
|
+
console.log(chalk.green(`✅ ${L('Yeni skill oluşturuldu', 'New skill created')}: ${result.skillName}\n`));
|
|
497
|
+
console.log(chalk.gray(` ${L('Yol', 'Path')}: ${result.path}\n`));
|
|
498
|
+
console.log(chalk.gray(L(' SKILL.md dosyasını düzenleyerek özelleştirebilirsin.\n', ' You can customize it by editing SKILL.md.\n')));
|
|
497
499
|
audit.log(audit.ACTIONS.SKILL_AUTO, { proposalId, skillName: result.skillName });
|
|
498
500
|
}
|
|
499
501
|
|
package/src/commands/slack.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
|
+
const { getLang: _gl } = require('../utils/i18n');
|
|
3
|
+
const L = (tr, en) => (_gl() === 'en' ? en : tr);
|
|
2
4
|
const inquirer = require('../utils/inquirer-wrapper');
|
|
3
5
|
const { getApiKey, getConfig, saveConfig } = require('../utils/config');
|
|
4
6
|
const { getBots } = require('../utils/api');
|
|
@@ -27,7 +29,7 @@ async function connectSlack() {
|
|
|
27
29
|
const config = getConfig();
|
|
28
30
|
|
|
29
31
|
if (!config.providerUrl) {
|
|
30
|
-
console.log(chalk.red('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n'));
|
|
32
|
+
console.log(chalk.red(L('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n', '\n❌ Setup not done. Run "natureco setup" first.\n')));
|
|
31
33
|
process.exit(1);
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -51,18 +53,18 @@ async function connectSlack() {
|
|
|
51
53
|
const botId = `slack_${Date.now()}`;
|
|
52
54
|
const selectedBot = { name: 'Slack Bot', id: botId };
|
|
53
55
|
|
|
54
|
-
console.log(chalk.yellow('\n⏳ Slack bağlantısı kaydediliyor...\n'));
|
|
56
|
+
console.log(chalk.yellow(L('\n⏳ Slack bağlantısı kaydediliyor...\n', '\n⏳ Saving Slack connection...\n')));
|
|
55
57
|
|
|
56
58
|
// Save to config (v2.x - no backend call)
|
|
57
59
|
config.slackToken = answers.token.trim();
|
|
58
60
|
config.slackBotId = botId;
|
|
59
61
|
saveConfig(config);
|
|
60
62
|
|
|
61
|
-
console.log(chalk.green('✅ Slack token kaydedildi!\n'));
|
|
63
|
+
console.log(chalk.green(L('✅ Slack token kaydedildi!\n', '✅ Slack token saved!\n')));
|
|
62
64
|
console.log(chalk.cyan('Bot ID:'), chalk.white(botId));
|
|
63
65
|
console.log(chalk.cyan('Token:'), chalk.white(answers.token.slice(0, 20) + '...'));
|
|
64
|
-
console.log(chalk.gray('\nNot: Slack botunuzu Slack App settings\'ten yapılandırmanız gerekiyor.'));
|
|
65
|
-
console.log(chalk.gray('Token config\'e kaydedildi: ~/.natureco/config.json\n'));
|
|
66
|
+
console.log(chalk.gray(L('\nNot: Slack botunuzu Slack App settings\'ten yapılandırmanız gerekiyor.', '\nNote: You need to configure your Slack bot from the Slack App settings.')));
|
|
67
|
+
console.log(chalk.gray(L('Token config\'e kaydedildi: ~/.natureco/config.json\n', 'Token saved to config: ~/.natureco/config.json\n')));
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
async function disconnectSlack() {
|
package/src/commands/sms.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
|
+
const { getLang: _gl } = require('../utils/i18n');
|
|
3
|
+
const L = (tr, en) => (_gl() === 'en' ? en : tr);
|
|
2
4
|
const inquirer = require('../utils/inquirer-wrapper');
|
|
3
5
|
const { getConfig, saveConfig } = require('../utils/config');
|
|
4
6
|
|
|
@@ -15,11 +17,11 @@ async function sms(action) {
|
|
|
15
17
|
async function connectSms() {
|
|
16
18
|
const config = getConfig();
|
|
17
19
|
if (!config.providerUrl) {
|
|
18
|
-
console.log(chalk.red('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n'));
|
|
20
|
+
console.log(chalk.red(L('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n', '\n❌ Setup not done. Run "natureco setup" first.\n')));
|
|
19
21
|
process.exit(1);
|
|
20
22
|
}
|
|
21
|
-
console.log(chalk.yellow('\n⏳ SMS (Twilio) bağlantısı hazırlanıyor...\n'));
|
|
22
|
-
console.log(chalk.gray('Twilio hesabı gereklidir: https://twilio.com\n'));
|
|
23
|
+
console.log(chalk.yellow(L('\n⏳ SMS (Twilio) bağlantısı hazırlanıyor...\n', '\n⏳ Preparing SMS (Twilio) connection...\n')));
|
|
24
|
+
console.log(chalk.gray(L('Twilio hesabı gereklidir: https://twilio.com\n', 'A Twilio account is required: https://twilio.com\n')));
|
|
23
25
|
|
|
24
26
|
const defaults = {
|
|
25
27
|
accountSid: config.smsAccountSid || '',
|
|
@@ -31,18 +33,18 @@ async function connectSms() {
|
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
const answers = await inquirer.prompt([
|
|
34
|
-
{ type: 'input', name: 'accountSid', message: 'Twilio Account SID:', default: defaults.accountSid ? defaults.accountSid.slice(0, 10) + '...' : '', validate: v => v.trim() ? true : 'Gerekli' },
|
|
36
|
+
{ type: 'input', name: 'accountSid', message: 'Twilio Account SID:', default: defaults.accountSid ? defaults.accountSid.slice(0, 10) + '...' : '', validate: v => v.trim() ? true : L('Gerekli', 'Required') },
|
|
35
37
|
{ type: 'password', name: 'authToken', message: 'Twilio Auth Token:' },
|
|
36
|
-
{ type: 'input', name: 'fromNumber', message: 'Gönderen numara (E.164, +15551234567):', default: defaults.fromNumber, validate: v => v.trim() || defaults.messagingServiceSid ? true : 'Numara veya Messaging Service SID gerekli' },
|
|
37
|
-
{ type: 'input', name: 'messagingServiceSid', message: 'Messaging Service SID (opsiyonel):', default: defaults.messagingServiceSid },
|
|
38
|
-
{ type: 'input', name: 'webhookUrl', message: 'Genel webhook URL (ngrok vb., opsiyonel):', default: defaults.webhookUrl },
|
|
39
|
-
{ type: 'list', name: 'dmPolicy', message: 'DM politikası:', default: defaults.dmPolicy, choices: [
|
|
40
|
-
{ name: 'Allowlist (önerilen) — spam koruması', value: 'allowlist' },
|
|
41
|
-
{ name: 'Pairing — eşleşme kodu ile', value: 'pairing' },
|
|
42
|
-
{ name: 'Open — herkese açık', value: 'open' },
|
|
43
|
-
{ name: 'Disabled — devre dışı', value: 'disabled' },
|
|
38
|
+
{ type: 'input', name: 'fromNumber', message: L('Gönderen numara (E.164, +15551234567):', 'Sender number (E.164, +15551234567):'), default: defaults.fromNumber, validate: v => v.trim() || defaults.messagingServiceSid ? true : L('Numara veya Messaging Service SID gerekli', 'Number or Messaging Service SID required') },
|
|
39
|
+
{ type: 'input', name: 'messagingServiceSid', message: L('Messaging Service SID (opsiyonel):', 'Messaging Service SID (optional):'), default: defaults.messagingServiceSid },
|
|
40
|
+
{ type: 'input', name: 'webhookUrl', message: L('Genel webhook URL (ngrok vb., opsiyonel):', 'Public webhook URL (ngrok etc., optional):'), default: defaults.webhookUrl },
|
|
41
|
+
{ type: 'list', name: 'dmPolicy', message: L('DM politikası:', 'DM policy:'), default: defaults.dmPolicy, choices: [
|
|
42
|
+
{ name: L('Allowlist (önerilen) — spam koruması', 'Allowlist (recommended) — spam protection'), value: 'allowlist' },
|
|
43
|
+
{ name: L('Pairing — eşleşme kodu ile', 'Pairing — with a match code'), value: 'pairing' },
|
|
44
|
+
{ name: L('Open — herkese açık', 'Open — public'), value: 'open' },
|
|
45
|
+
{ name: L('Disabled — devre dışı', 'Disabled — off'), value: 'disabled' },
|
|
44
46
|
]},
|
|
45
|
-
{ type: 'confirm', name: 'enableWebhook', message: 'Gelen SMS webhook\'u etkinleştirilsin mi?', default: config.smsEnableWebhook !== false },
|
|
47
|
+
{ type: 'confirm', name: 'enableWebhook', message: L('Gelen SMS webhook\'u etkinleştirilsin mi?', 'Enable inbound SMS webhook?'), default: config.smsEnableWebhook !== false },
|
|
46
48
|
]);
|
|
47
49
|
|
|
48
50
|
const botId = `sms_${Date.now()}`;
|
|
@@ -56,21 +58,21 @@ async function connectSms() {
|
|
|
56
58
|
config.smsBotId = botId;
|
|
57
59
|
saveConfig(config);
|
|
58
60
|
|
|
59
|
-
console.log(chalk.green('\n✅ SMS (Twilio) bağlantısı kaydedildi!\n'));
|
|
61
|
+
console.log(chalk.green(L('\n✅ SMS (Twilio) bağlantısı kaydedildi!\n', '\n✅ SMS (Twilio) connection saved!\n')));
|
|
60
62
|
console.log(chalk.cyan('Bot ID:'), chalk.white(botId));
|
|
61
63
|
console.log(chalk.cyan('Account SID:'), chalk.white(answers.accountSid.slice(0, 20) + '...'));
|
|
62
|
-
console.log(chalk.cyan('Numara:'), chalk.white(answers.fromNumber || '(Messaging Service)'));
|
|
63
|
-
console.log(chalk.cyan('DM Politikası:'), chalk.white(answers.dmPolicy));
|
|
64
|
+
console.log(chalk.cyan(L('Numara:', 'Number:')), chalk.white(answers.fromNumber || '(Messaging Service)'));
|
|
65
|
+
console.log(chalk.cyan(L('DM Politikası:', 'DM Policy:')), chalk.white(answers.dmPolicy));
|
|
64
66
|
|
|
65
67
|
if (answers.enableWebhook) {
|
|
66
|
-
console.log(chalk.gray('\nTwilio Console\'da webhook URL\'si ayarlayın:'));
|
|
68
|
+
console.log(chalk.gray(L('\nTwilio Console\'da webhook URL\'si ayarlayın:', '\nSet the webhook URL in the Twilio Console:')));
|
|
67
69
|
if (answers.webhookUrl) {
|
|
68
70
|
console.log(chalk.cyan(` ${answers.webhookUrl}/webhooks/sms`));
|
|
69
71
|
} else {
|
|
70
|
-
console.log(chalk.gray(' (önce bir genel URL ayarlayın)'));
|
|
72
|
+
console.log(chalk.gray(L(' (önce bir genel URL ayarlayın)', ' (set a public URL first)')));
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
|
-
console.log(chalk.gray('\nGateway ile başlatmak için: natureco gateway start\n'));
|
|
75
|
+
console.log(chalk.gray(L('\nGateway ile başlatmak için: natureco gateway start\n', '\nTo start with the gateway: natureco gateway start\n')));
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
async function disconnectSms() {
|
|
@@ -80,7 +82,7 @@ async function disconnectSms() {
|
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
84
|
const { confirm } = await inquirer.prompt([
|
|
83
|
-
{ type: 'confirm', name: 'confirm', message: 'SMS bağlantısını kaldırmak istediğinize emin misiniz?', default: false }
|
|
85
|
+
{ type: 'confirm', name: 'confirm', message: L('SMS bağlantısını kaldırmak istediğinize emin misiniz?', 'Are you sure you want to remove the SMS connection?'), default: false }
|
|
84
86
|
]);
|
|
85
87
|
if (!confirm) {
|
|
86
88
|
console.log(chalk.gray('\nCancelled\n'));
|
|
@@ -103,22 +105,22 @@ function statusSms() {
|
|
|
103
105
|
console.log(chalk.green('\n✅ SMS (Twilio) connected\n'));
|
|
104
106
|
console.log(chalk.cyan('Bot ID:'), chalk.white(config.smsBotId));
|
|
105
107
|
console.log(chalk.cyan('Account SID:'), chalk.white((config.smsAccountSid || '').slice(0, 20) + '...'));
|
|
106
|
-
console.log(chalk.cyan('Numara:'), chalk.white(config.smsFromNumber || '(Messaging Service)'));
|
|
107
|
-
console.log(chalk.cyan('DM Politikası:'), chalk.white(config.smsDmPolicy || 'allowlist'));
|
|
108
|
-
console.log(chalk.cyan('Webhook:'), chalk.white(config.smsEnableWebhook !== false ? 'Aktif' : 'Devre Dışı'));
|
|
108
|
+
console.log(chalk.cyan(L('Numara:', 'Number:')), chalk.white(config.smsFromNumber || '(Messaging Service)'));
|
|
109
|
+
console.log(chalk.cyan(L('DM Politikası:', 'DM Policy:')), chalk.white(config.smsDmPolicy || 'allowlist'));
|
|
110
|
+
console.log(chalk.cyan('Webhook:'), chalk.white(config.smsEnableWebhook !== false ? L('Aktif', 'Active') : L('Devre Dışı', 'Disabled')));
|
|
109
111
|
console.log(chalk.gray('\nDisconnect with: natureco sms disconnect\n'));
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
async function probeSms() {
|
|
113
115
|
const config = getConfig();
|
|
114
116
|
if (!config.smsAccountSid || !config.smsAuthToken) {
|
|
115
|
-
console.log(chalk.red('\n❌ SMS bağlantısı yapılmamış\n'));
|
|
116
|
-
console.log(chalk.gray('Önce: natureco sms connect\n'));
|
|
117
|
+
console.log(chalk.red(L('\n❌ SMS bağlantısı yapılmamış\n', '\n❌ SMS connection not set up\n')));
|
|
118
|
+
console.log(chalk.gray(L('Önce: natureco sms connect\n', 'First: natureco sms connect\n')));
|
|
117
119
|
process.exit(1);
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
const base64Auth = Buffer.from(`${config.smsAccountSid}:${config.smsAuthToken}`).toString('base64');
|
|
121
|
-
console.log(chalk.yellow('\n⏳ Twilio problanıyor...\n'));
|
|
123
|
+
console.log(chalk.yellow(L('\n⏳ Twilio problanıyor...\n', '\n⏳ Probing Twilio...\n')));
|
|
122
124
|
|
|
123
125
|
try {
|
|
124
126
|
const res = await fetch('https://api.twilio.com/2010-04-01/Accounts/' + config.smsAccountSid + '.json', {
|
|
@@ -127,14 +129,14 @@ async function probeSms() {
|
|
|
127
129
|
});
|
|
128
130
|
|
|
129
131
|
if (!res.ok) {
|
|
130
|
-
console.log(chalk.red(`✗ Twilio API
|
|
131
|
-
if (res.status === 401) console.log(chalk.gray(' Account SID veya Auth Token hatalı.\n'));
|
|
132
|
+
console.log(chalk.red(`✗ ${L('Twilio API Hatası', 'Twilio API Error')}: HTTP ${res.status}\n`));
|
|
133
|
+
if (res.status === 401) console.log(chalk.gray(L(' Account SID veya Auth Token hatalı.\n', ' Account SID or Auth Token is incorrect.\n')));
|
|
132
134
|
process.exit(1);
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
const account = await res.json();
|
|
136
|
-
console.log(chalk.green('✓ Twilio API Bağlantısı Başarılı\n'));
|
|
137
|
-
console.log(chalk.cyan('Hesap Adı:'), chalk.white(account.friendly_name));
|
|
138
|
+
console.log(chalk.green(L('✓ Twilio API Bağlantısı Başarılı\n', '✓ Twilio API Connection Successful\n')));
|
|
139
|
+
console.log(chalk.cyan(L('Hesap Adı:', 'Account Name:')), chalk.white(account.friendly_name));
|
|
138
140
|
console.log(chalk.cyan('Status:'), chalk.white(account.status));
|
|
139
141
|
console.log(chalk.cyan('Type:'), chalk.white(account.type));
|
|
140
142
|
|
|
@@ -147,20 +149,20 @@ async function probeSms() {
|
|
|
147
149
|
});
|
|
148
150
|
if (balRes.ok) {
|
|
149
151
|
const balance = await balRes.json();
|
|
150
|
-
console.log(chalk.cyan('Bakiye:'), chalk.white(`${balance.balance} ${balance.currency}`));
|
|
152
|
+
console.log(chalk.cyan(L('Bakiye:', 'Balance:')), chalk.white(`${balance.balance} ${balance.currency}`));
|
|
151
153
|
}
|
|
152
154
|
} catch {}
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
// Check phone number
|
|
156
158
|
if (config.smsFromNumber) {
|
|
157
|
-
console.log(chalk.gray(`\
|
|
159
|
+
console.log(chalk.gray(`\n${L('Gönderen numara', 'Sender number')}: ${config.smsFromNumber}`));
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
console.log('');
|
|
161
163
|
|
|
162
164
|
} catch (err) {
|
|
163
|
-
console.log(chalk.red(`\n✗ Probe
|
|
165
|
+
console.log(chalk.red(`\n✗ ${L('Probe hatası', 'Probe error')}: ${err.message}\n`));
|
|
164
166
|
process.exit(1);
|
|
165
167
|
}
|
|
166
168
|
}
|