natureco-cli 1.1.4 → 1.1.5

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": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "main": "bin/natureco.js",
6
6
  "bin": {
@@ -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.4</div>
214
+ <div class="version-badge" id="version-badge">v1.1.5</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.4',
344
+ version: 'v1.1.5',
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,15 @@ async function _sendMessage(apiKey, botId, message, conversationId = null, skill
28
28
  const { getConfig } = require('./config');
29
29
  const config = getConfig();
30
30
 
31
- // agent_id boş veya undefined ise config'den oku
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.";
31
+ // bot_id boş veya undefined ise config'den oku
32
+ const finalBotId = botId || config.defaultBotId;
36
33
 
37
34
  const body = {
38
- agent_id: agentId,
39
35
  message,
40
- platform: 'cli',
41
36
  user_id: 'cli-user',
42
- system_prompt: systemPrompt
37
+ bot_id: finalBotId
43
38
  };
44
39
 
45
- // conversation_id varsa ekle (null gönderme)
46
- if (conversationId) {
47
- body.conversation_id = conversationId;
48
- }
49
-
50
40
  // Custom AI provider varsa ekle
51
41
  if (config.aiProvider && config.aiApiKey) {
52
42
  body.custom_provider = config.aiProvider;
@@ -58,15 +48,10 @@ async function _sendMessage(apiKey, botId, message, conversationId = null, skill
58
48
  }
59
49
  }
60
50
 
61
- // Tool definitions şimdilik devre dışı
62
- // if (toolDefinitions && toolDefinitions.length > 0) {
63
- // body.tools = toolDefinitions;
64
- // }
65
-
66
51
  // Debug: Request body'yi logla
67
52
  console.log('\n[DEBUG] API Request Body:', JSON.stringify(body, null, 2));
68
53
 
69
- const data = await request('/api/agent/chat', {
54
+ const data = await request('/api/agent/message', {
70
55
  method: 'POST',
71
56
  headers: {
72
57
  Authorization: `Bearer ${apiKey}`,
@@ -78,6 +63,16 @@ async function _sendMessage(apiKey, botId, message, conversationId = null, skill
78
63
  // Debug: API response'u logla
79
64
  console.log('[DEBUG] API Response:', JSON.stringify(data, null, 2), '\n');
80
65
 
66
+ // Backend response formatını CLI formatına çevir
67
+ // Backend: { response: "...", message_id: "...", bot_id: "..." }
68
+ // CLI beklediği: { reply: "...", conversation_id: "..." }
69
+ if (data.response && !data.reply) {
70
+ data.reply = data.response;
71
+ }
72
+ if (data.message_id && !data.conversation_id) {
73
+ data.conversation_id = data.message_id;
74
+ }
75
+
81
76
  return data;
82
77
  }
83
78