natureco-cli 1.1.4 → 1.1.6
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/dashboard.js +2 -2
- package/src/utils/api.js +13 -21
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">v1.1.
|
|
214
|
+
<div class="version-badge" id="version-badge">v1.1.6</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: 'v1.1.
|
|
344
|
+
version: 'v1.1.6',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/utils/api.js
CHANGED
|
@@ -28,25 +28,12 @@ async function _sendMessage(apiKey, botId, message, conversationId = null, skill
|
|
|
28
28
|
const { getConfig } = require('./config');
|
|
29
29
|
const config = getConfig();
|
|
30
30
|
|
|
31
|
-
//
|
|
32
|
-
const agentId = botId || config.defaultBotId;
|
|
33
|
-
|
|
34
|
-
// System prompt'u basit ve kısa tut (max 300 karakter)
|
|
35
|
-
const systemPrompt = "Sen bir terminal asistanısın. Kullanıcı dosya listeleme, komut çalıştırma gibi istekler yaptığında bash tool kullan.";
|
|
36
|
-
|
|
31
|
+
// Backend otomatik ilk botu seçsin, bot_id gönderme
|
|
37
32
|
const body = {
|
|
38
|
-
agent_id: agentId,
|
|
39
33
|
message,
|
|
40
|
-
|
|
41
|
-
user_id: 'cli-user',
|
|
42
|
-
system_prompt: systemPrompt
|
|
34
|
+
user_id: 'cli-user'
|
|
43
35
|
};
|
|
44
36
|
|
|
45
|
-
// conversation_id varsa ekle (null gönderme)
|
|
46
|
-
if (conversationId) {
|
|
47
|
-
body.conversation_id = conversationId;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
37
|
// Custom AI provider varsa ekle
|
|
51
38
|
if (config.aiProvider && config.aiApiKey) {
|
|
52
39
|
body.custom_provider = config.aiProvider;
|
|
@@ -58,15 +45,10 @@ async function _sendMessage(apiKey, botId, message, conversationId = null, skill
|
|
|
58
45
|
}
|
|
59
46
|
}
|
|
60
47
|
|
|
61
|
-
// Tool definitions şimdilik devre dışı
|
|
62
|
-
// if (toolDefinitions && toolDefinitions.length > 0) {
|
|
63
|
-
// body.tools = toolDefinitions;
|
|
64
|
-
// }
|
|
65
|
-
|
|
66
48
|
// Debug: Request body'yi logla
|
|
67
49
|
console.log('\n[DEBUG] API Request Body:', JSON.stringify(body, null, 2));
|
|
68
50
|
|
|
69
|
-
const data = await request('/api/agent/
|
|
51
|
+
const data = await request('/api/agent/message', {
|
|
70
52
|
method: 'POST',
|
|
71
53
|
headers: {
|
|
72
54
|
Authorization: `Bearer ${apiKey}`,
|
|
@@ -78,6 +60,16 @@ async function _sendMessage(apiKey, botId, message, conversationId = null, skill
|
|
|
78
60
|
// Debug: API response'u logla
|
|
79
61
|
console.log('[DEBUG] API Response:', JSON.stringify(data, null, 2), '\n');
|
|
80
62
|
|
|
63
|
+
// Backend response formatını CLI formatına çevir
|
|
64
|
+
// Backend: { response: "...", message_id: "...", bot_id: "..." }
|
|
65
|
+
// CLI beklediği: { reply: "...", conversation_id: "..." }
|
|
66
|
+
if (data.response && !data.reply) {
|
|
67
|
+
data.reply = data.response;
|
|
68
|
+
}
|
|
69
|
+
if (data.message_id && !data.conversation_id) {
|
|
70
|
+
data.conversation_id = data.message_id;
|
|
71
|
+
}
|
|
72
|
+
|
|
81
73
|
return data;
|
|
82
74
|
}
|
|
83
75
|
|