natureco-cli 2.6.1 → 2.6.2
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
|
@@ -211,7 +211,7 @@ body::before{
|
|
|
211
211
|
<div class="header-bot-name" id="header-bot-name">Nature Bot</div>
|
|
212
212
|
<div class="header-bot-model" id="header-bot-model">NatureCo</div>
|
|
213
213
|
</div>
|
|
214
|
-
<div class="version-badge" id="version-badge">v2.6.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.6.2</div>
|
|
215
215
|
</div>
|
|
216
216
|
<div class="messages" id="messages"></div>
|
|
217
217
|
<div class="input-area">
|
|
@@ -341,7 +341,7 @@ function dashboard(action) {
|
|
|
341
341
|
apiKey: cfg.apiKey,
|
|
342
342
|
defaultBot: cfg.defaultBot,
|
|
343
343
|
defaultBotId: cfg.defaultBotId,
|
|
344
|
-
version: 'v2.6.
|
|
344
|
+
version: 'v2.6.2',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/commands/doctor.js
CHANGED
|
@@ -70,49 +70,35 @@ async function doctor(options) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
// 3.
|
|
73
|
+
// 3. Provider URL kontrolü (v2.x)
|
|
74
74
|
total++;
|
|
75
75
|
criticalTotal++;
|
|
76
|
-
let
|
|
77
|
-
if (config && config.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (response.ok) {
|
|
84
|
-
console.log(chalk.green('✅ API key:'), chalk.white(config.apiKey.slice(0, 8) + '...'));
|
|
85
|
-
passed++;
|
|
86
|
-
criticalPassed++;
|
|
87
|
-
apiKeyValid = true;
|
|
88
|
-
results.push({ status: 'ok', message: 'API key geçerli' });
|
|
89
|
-
} else {
|
|
90
|
-
console.log(chalk.red('❌ API key:'), chalk.white('Geçersiz'));
|
|
91
|
-
results.push({ status: 'error', message: 'API key geçersiz', fix: 'Setup çalıştırılacak' });
|
|
92
|
-
}
|
|
93
|
-
} catch (err) {
|
|
94
|
-
console.log(chalk.red('❌ API key:'), chalk.white('Test edilemedi'));
|
|
95
|
-
results.push({ status: 'error', message: 'API key test edilemedi' });
|
|
96
|
-
}
|
|
76
|
+
let providerValid = false;
|
|
77
|
+
if (config && config.providerUrl) {
|
|
78
|
+
console.log(chalk.green('✅ Provider URL:'), chalk.white(config.providerUrl));
|
|
79
|
+
passed++;
|
|
80
|
+
criticalPassed++;
|
|
81
|
+
providerValid = true;
|
|
82
|
+
results.push({ status: 'ok', message: 'Provider URL ayarlanmış' });
|
|
97
83
|
} else {
|
|
98
|
-
console.log(chalk.
|
|
99
|
-
results.push({ status: '
|
|
84
|
+
console.log(chalk.red('❌ Provider URL:'), chalk.white('Ayarlanmamış'));
|
|
85
|
+
results.push({ status: 'error', message: 'Provider URL yok', fix: 'Setup çalıştırılacak' });
|
|
100
86
|
}
|
|
101
87
|
|
|
102
|
-
if (shouldFix && !
|
|
88
|
+
if (shouldFix && !providerValid) {
|
|
103
89
|
console.log(chalk.yellow(' 🔧 Setup başlatılıyor...'));
|
|
104
90
|
console.log(chalk.gray(' Lütfen setup\'ı manuel çalıştırın: natureco setup'));
|
|
105
91
|
}
|
|
106
92
|
|
|
107
|
-
// 4.
|
|
93
|
+
// 4. Provider Model kontrolü (v2.x)
|
|
108
94
|
total++;
|
|
109
|
-
if (config && config.
|
|
110
|
-
console.log(chalk.green('✅
|
|
95
|
+
if (config && config.providerModel) {
|
|
96
|
+
console.log(chalk.green('✅ Provider Model:'), chalk.white(config.providerModel));
|
|
111
97
|
passed++;
|
|
112
|
-
results.push({ status: 'ok', message: '
|
|
98
|
+
results.push({ status: 'ok', message: 'Provider model ayarlanmış' });
|
|
113
99
|
} else {
|
|
114
|
-
console.log(chalk.yellow('⚠️
|
|
115
|
-
results.push({ status: 'warning', message: '
|
|
100
|
+
console.log(chalk.yellow('⚠️ Provider Model:'), chalk.white('Ayarlanmamış'));
|
|
101
|
+
results.push({ status: 'warning', message: 'Provider model yok', fix: 'Setup ile ayarlanabilir' });
|
|
116
102
|
}
|
|
117
103
|
|
|
118
104
|
// 5. Skills kontrolü
|
|
@@ -225,39 +211,71 @@ async function doctor(options) {
|
|
|
225
211
|
}
|
|
226
212
|
|
|
227
213
|
// 13. Gateway kontrolü (opsiyonel)
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
214
|
+
const gatewayPidFile = path.join(CONFIG_DIR, 'gateway.pid');
|
|
215
|
+
let gatewayRunning = false;
|
|
216
|
+
|
|
217
|
+
if (fs.existsSync(gatewayPidFile)) {
|
|
218
|
+
try {
|
|
219
|
+
const pid = parseInt(fs.readFileSync(gatewayPidFile, 'utf-8').trim());
|
|
220
|
+
|
|
221
|
+
// Check if process is running
|
|
222
|
+
try {
|
|
223
|
+
process.kill(pid, 0); // Signal 0 checks if process exists
|
|
224
|
+
gatewayRunning = true;
|
|
225
|
+
console.log(chalk.green('✅ Gateway:'), chalk.white(`Çalışıyor (PID: ${pid})`));
|
|
226
|
+
results.push({ status: 'ok', message: 'Gateway çalışıyor', optional: true });
|
|
227
|
+
} catch {
|
|
228
|
+
console.log(chalk.yellow('⚠️ Gateway:'), chalk.white('PID dosyası var ama process çalışmıyor'));
|
|
229
|
+
results.push({ status: 'warning', message: 'Gateway PID stale', fix: 'natureco gateway start', optional: true });
|
|
230
|
+
}
|
|
231
|
+
} catch {
|
|
232
|
+
console.log(chalk.gray('⚪ Gateway:'), chalk.white('PID dosyası okunamadı'));
|
|
233
|
+
results.push({ status: 'info', message: 'Gateway PID okunamadı', optional: true });
|
|
234
|
+
}
|
|
232
235
|
} else {
|
|
233
236
|
console.log(chalk.gray('⚪ Gateway:'), chalk.white('Çalışmıyor'));
|
|
234
237
|
results.push({ status: 'info', message: 'Gateway çalışmıyor', fix: 'natureco gateway start', optional: true });
|
|
235
238
|
}
|
|
236
239
|
|
|
237
|
-
// 14.
|
|
240
|
+
// 14. Tavily API key kontrolü (web search için)
|
|
241
|
+
total++;
|
|
242
|
+
if (config && config.tavilyApiKey) {
|
|
243
|
+
console.log(chalk.green('✅ Tavily API:'), chalk.white(config.tavilyApiKey.slice(0, 10) + '...'));
|
|
244
|
+
passed++;
|
|
245
|
+
results.push({ status: 'ok', message: 'Tavily API key ayarlanmış' });
|
|
246
|
+
} else {
|
|
247
|
+
console.log(chalk.yellow('⚠️ Tavily API:'), chalk.white('Ayarlanmamış (web search çalışmayacak)'));
|
|
248
|
+
results.push({ status: 'warning', message: 'Tavily API key yok', fix: 'natureco config set tavilyApiKey tvly_xxx' });
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// 15. Provider erişim kontrolü
|
|
238
252
|
total++;
|
|
239
253
|
criticalTotal++;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
254
|
+
if (config && config.providerUrl) {
|
|
255
|
+
try {
|
|
256
|
+
// Extract base URL for health check
|
|
257
|
+
const baseUrl = config.providerUrl.replace(/\/v1.*$/, '');
|
|
258
|
+
|
|
259
|
+
const response = await fetch(baseUrl, {
|
|
260
|
+
method: 'GET',
|
|
261
|
+
signal: AbortSignal.timeout(5000),
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// Any response (even 404) means provider is reachable
|
|
265
|
+
console.log(chalk.green('✅ Provider Erişim:'), chalk.white('Provider erişilebilir'));
|
|
248
266
|
passed++;
|
|
249
267
|
criticalPassed++;
|
|
250
|
-
results.push({ status: 'ok', message: '
|
|
251
|
-
}
|
|
252
|
-
console.log(chalk.
|
|
253
|
-
results.push({ status: '
|
|
268
|
+
results.push({ status: 'ok', message: 'Provider erişilebilir' });
|
|
269
|
+
} catch (err) {
|
|
270
|
+
console.log(chalk.red('❌ Provider Erişim:'), chalk.white('Provider erişilemiyor'));
|
|
271
|
+
results.push({ status: 'error', message: 'Provider erişilemiyor' });
|
|
254
272
|
}
|
|
255
|
-
}
|
|
256
|
-
console.log(chalk.
|
|
257
|
-
results.push({ status: '
|
|
273
|
+
} else {
|
|
274
|
+
console.log(chalk.gray('⚪ Provider Erişim:'), chalk.white('Provider URL ayarlanmamış'));
|
|
275
|
+
results.push({ status: 'info', message: 'Provider URL yok' });
|
|
258
276
|
}
|
|
259
277
|
|
|
260
|
-
//
|
|
278
|
+
// 16. Güncelleme kontrolü
|
|
261
279
|
total++;
|
|
262
280
|
try {
|
|
263
281
|
const packageJson = require('../../package.json');
|
|
@@ -128,7 +128,7 @@ async function startGateway() {
|
|
|
128
128
|
|
|
129
129
|
async function runGatewayWorker() {
|
|
130
130
|
// This runs in the background
|
|
131
|
-
log('gateway', 'Starting NatureCo Gateway v2.6.
|
|
131
|
+
log('gateway', 'Starting NatureCo Gateway v2.6.2...', 'green');
|
|
132
132
|
|
|
133
133
|
// Load config
|
|
134
134
|
const { getConfig } = require('../utils/config');
|
package/src/utils/api.js
CHANGED