natureco-cli 5.6.42 → 5.6.43
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.6.
|
|
3
|
+
"version": "5.6.43",
|
|
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"
|
|
@@ -384,9 +384,21 @@ async function startWhatsAppProvider(sessionDir, config) {
|
|
|
384
384
|
log('whatsapp', `Message without text content. Keys: ${Object.keys(msg.message || {}).join(', ')}`, 'gray');
|
|
385
385
|
continue;
|
|
386
386
|
}
|
|
387
|
-
|
|
387
|
+
|
|
388
|
+
// v5.6.43: Slash-prefix komut sistemi - sadece / ile başlayan mesajlara cevap ver
|
|
389
|
+
if (!messageText.startsWith('/')) {
|
|
390
|
+
log('whatsapp', `Skipping non-command from +${sender}: "${messageText.slice(0, 40)}..."`, 'gray');
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
const cleanCommand = messageText.replace(/^\/+/, '').trim();
|
|
394
|
+
if (!cleanCommand) {
|
|
395
|
+
log('whatsapp', `Empty command from +${sender}`, 'gray');
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
log('whatsapp', `Slash command: /${cleanCommand.slice(0, 60)}`, 'yellow');
|
|
399
|
+
|
|
388
400
|
const ownNumber = sock.user?.id?.split(':')[0].replace('@s.whatsapp.net', '') || 'unknown';
|
|
389
|
-
log('whatsapp', `Inbound message +${sender} -> +${ownNumber} (${
|
|
401
|
+
log('whatsapp', `Inbound message +${sender} -> +${ownNumber} (${cleanCommand.length} chars)`, 'cyan');
|
|
390
402
|
|
|
391
403
|
try {
|
|
392
404
|
const { sendMessage } = require('../utils/api');
|
|
@@ -410,7 +422,7 @@ async function startWhatsAppProvider(sessionDir, config) {
|
|
|
410
422
|
systemPrompt += '\n\n' + memoryPrompt;
|
|
411
423
|
}
|
|
412
424
|
|
|
413
|
-
const response = await sendMessage(cfg.providerApiKey || cfg.apiKey || '', botId,
|
|
425
|
+
const response = await sendMessage(cfg.providerApiKey || cfg.apiKey || '', botId, cleanCommand, conversationId, systemPrompt);
|
|
414
426
|
const reply = response?.reply || response?.message || '';
|
|
415
427
|
|
|
416
428
|
if (reply) {
|
|
@@ -530,16 +542,25 @@ async function startSlackProvider(config) {
|
|
|
530
542
|
|
|
531
543
|
async function callProviderForGateway(config, message, context) {
|
|
532
544
|
// Gateway icin LLM API cagir
|
|
533
|
-
|
|
545
|
+
// v5.6.43: System prompt ekle - MiniMax bazen sadece user mesajiyla hata veriyor
|
|
546
|
+
const apiMessages = [
|
|
547
|
+
{ role: 'system', content: 'You are a helpful AI assistant. Respond concisely.' },
|
|
548
|
+
{ role: 'user', content: message }
|
|
549
|
+
];
|
|
534
550
|
return new Promise((resolve, reject) => {
|
|
535
551
|
const providerUrl = config.providerUrl;
|
|
536
552
|
const providerApiKey = config.providerApiKey;
|
|
537
553
|
const model = config.providerModel;
|
|
538
554
|
|
|
539
555
|
const isMM = providerUrl && (providerUrl.includes('minimax') || providerUrl.includes('minimaxi'));
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
556
|
+
// v5.6.43: Endpoint duzeltme - MiniMax icin farkli yol dene
|
|
557
|
+
let endpoint;
|
|
558
|
+
if (isMM) {
|
|
559
|
+
const base = providerUrl.replace(/\/+$/, '').replace(/\/v1$/, '');
|
|
560
|
+
endpoint = `${base}/v1/text/chatcompletion_v2`;
|
|
561
|
+
} else {
|
|
562
|
+
endpoint = `${providerUrl.replace(/\/+$/, '')}/chat/completions`;
|
|
563
|
+
}
|
|
543
564
|
|
|
544
565
|
const data = JSON.stringify({
|
|
545
566
|
model, messages: apiMessages, temperature: 0.7, max_tokens: 2048
|
|
@@ -634,7 +655,7 @@ async function startTelegramProvider(config) {
|
|
|
634
655
|
systemPrompt += '\n\n' + memoryPrompt;
|
|
635
656
|
}
|
|
636
657
|
|
|
637
|
-
const response = await sendMessage(cfg.providerApiKey || cfg.apiKey || '', botId,
|
|
658
|
+
const response = await sendMessage(cfg.providerApiKey || cfg.apiKey || '', botId, cleanCommand, conversationId, systemPrompt);
|
|
638
659
|
const reply = response?.reply || response?.message || '';
|
|
639
660
|
|
|
640
661
|
if (reply) {
|