natureco-cli 5.4.19 → 5.4.21
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/setup.js +2 -2
- package/src/commands/telegram.js +21 -2
- package/src/utils/tools.js +27 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.21",
|
|
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"
|
package/src/commands/setup.js
CHANGED
|
@@ -131,9 +131,9 @@ async function cmdWizard() {
|
|
|
131
131
|
console.log('');
|
|
132
132
|
console.log(chalk.white(' Step 3: Bot & Kullanıcı'));
|
|
133
133
|
console.log(chalk.gray(' ─────────────────────────────────────────────'));
|
|
134
|
-
const userName = await rlQuestion(` Sizin adınız
|
|
134
|
+
const userName = await rlQuestion(` Sizin adınız: `);
|
|
135
135
|
if (userName) cfg.userName = userName;
|
|
136
|
-
const botName = await rlQuestion(` Bot
|
|
136
|
+
const botName = await rlQuestion(` Bot adı: `);
|
|
137
137
|
if (botName) cfg.botName = botName;
|
|
138
138
|
|
|
139
139
|
// Step 4: Kanal Entegrasyonları (isteğe bağlı, isteyen atlayabilir)
|
package/src/commands/telegram.js
CHANGED
|
@@ -31,12 +31,31 @@ async function telegram(action, chatId) {
|
|
|
31
31
|
|
|
32
32
|
async function connectTelegram() {
|
|
33
33
|
const config = getConfig();
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
if (!config.providerUrl) {
|
|
36
36
|
console.log(chalk.red('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n'));
|
|
37
37
|
process.exit(1);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
// v5.4.21: Eğer zaten token kaydedilmişse, kullanıcıya sor — değiştirmek ister mi?
|
|
41
|
+
if (config.telegramToken) {
|
|
42
|
+
const masked = config.telegramToken.slice(0, 15) + '...' + config.telegramToken.slice(-5);
|
|
43
|
+
console.log(chalk.green('\n✓ Telegram token zaten kayıtlı: ' + masked));
|
|
44
|
+
console.log(chalk.gray(' Bot ID: ' + (config.telegramBotId || 'yok')));
|
|
45
|
+
console.log(chalk.gray(' İzinli chat: ' + (config.telegramAllowedChats || []).join(', ') + '\n'));
|
|
46
|
+
const ans = await inquirer.prompt([{
|
|
47
|
+
type: 'confirm',
|
|
48
|
+
name: 'change',
|
|
49
|
+
message: 'Token değiştirmek istiyor musun?',
|
|
50
|
+
default: false,
|
|
51
|
+
}]);
|
|
52
|
+
if (!ans.change) {
|
|
53
|
+
console.log(chalk.green('\n✅ Mevcut token kullanılacak.\n'));
|
|
54
|
+
console.log(chalk.gray('Gateway başlat: natureco gateway start\n'));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
40
59
|
console.log(chalk.yellow('\n⏳ Telegram bot bağlantısı hazırlanıyor...\n'));
|
|
41
60
|
console.log(chalk.gray('Telegram bot token almak için:'));
|
|
42
61
|
console.log(chalk.gray('1. Telegram\'da @BotFather\'ı aç'));
|
package/src/utils/tools.js
CHANGED
|
@@ -56,14 +56,33 @@ function loadToolDefinitions() {
|
|
|
56
56
|
* [{ type: "function", function: { name, description, parameters } }]
|
|
57
57
|
*/
|
|
58
58
|
function toOpenAIFormat(toolDefs) {
|
|
59
|
-
return toolDefs.map(t =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
return toolDefs.map(t => {
|
|
60
|
+
// v5.4.21: Groq uyumluluk - additionalProperties: false kaldirildi
|
|
61
|
+
// ve gereksiz kisitlamalar temizlendi
|
|
62
|
+
const cleanParams = JSON.parse(JSON.stringify(t.parameters || {}));
|
|
63
|
+
if (cleanParams.properties) {
|
|
64
|
+
Object.keys(cleanParams.properties).forEach(key => {
|
|
65
|
+
const prop = cleanParams.properties[key];
|
|
66
|
+
// "type": ["number", "string"] union types Groq'da hata verir
|
|
67
|
+
// Sadece ilk tipi al
|
|
68
|
+
if (Array.isArray(prop.type)) {
|
|
69
|
+
prop.type = prop.type[0];
|
|
70
|
+
}
|
|
71
|
+
// additionalProperties kaldir
|
|
72
|
+
delete prop.additionalProperties;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
// Groq icin required kismi bazen sorun cikarir - olduugu gibi birak
|
|
76
|
+
// ama type validation'u gevset
|
|
77
|
+
return {
|
|
78
|
+
type: 'function',
|
|
79
|
+
function: {
|
|
80
|
+
name: t.name,
|
|
81
|
+
description: t.description,
|
|
82
|
+
parameters: cleanParams,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
});
|
|
67
86
|
}
|
|
68
87
|
|
|
69
88
|
/**
|