natureco-cli 2.10.3 → 2.10.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
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.10.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.10.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: 'v2.10.
|
|
344
|
+
version: 'v2.10.6',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
|
@@ -138,7 +138,7 @@ async function startGateway() {
|
|
|
138
138
|
|
|
139
139
|
async function runGatewayWorker() {
|
|
140
140
|
// This runs in the background
|
|
141
|
-
log('gateway', 'Starting NatureCo Gateway v2.10.
|
|
141
|
+
log('gateway', 'Starting NatureCo Gateway v2.10.6...', 'green');
|
|
142
142
|
|
|
143
143
|
// Load config
|
|
144
144
|
const { getConfig } = require('../utils/config');
|
package/src/utils/api.js
CHANGED
|
@@ -152,16 +152,20 @@ async function executeMcpTool(toolName, toolArgs) {
|
|
|
152
152
|
|
|
153
153
|
// MCP returns { content: [{ type: 'text', text: '...' }] }
|
|
154
154
|
if (result.content && result.content.length > 0) {
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
// Extract all text content and join with newlines
|
|
156
|
+
const textContents = result.content
|
|
157
|
+
.filter(c => c.type === 'text')
|
|
158
|
+
.map(c => c.text);
|
|
159
|
+
|
|
160
|
+
if (textContents.length > 0) {
|
|
157
161
|
return {
|
|
158
162
|
success: true,
|
|
159
|
-
output:
|
|
163
|
+
output: textContents.join('\n')
|
|
160
164
|
};
|
|
161
165
|
}
|
|
162
166
|
}
|
|
163
167
|
|
|
164
|
-
// Fallback: return entire result
|
|
168
|
+
// Fallback: return entire result as JSON
|
|
165
169
|
return {
|
|
166
170
|
success: true,
|
|
167
171
|
output: JSON.stringify(result, null, 2)
|
|
@@ -471,6 +475,9 @@ async function sendMessageToProvider(apiKey, message, conversationId = null, sys
|
|
|
471
475
|
name: result.name,
|
|
472
476
|
content: `[BASE64_ENCODED_RESULT]: ${encoded}`
|
|
473
477
|
});
|
|
478
|
+
|
|
479
|
+
// DEBUG: Check if MCP results are being encoded
|
|
480
|
+
console.log(`[DEBUG] Tool: ${result.name}, Content preview:`, messages[messages.length-1].content.slice(0, 50));
|
|
474
481
|
}
|
|
475
482
|
|
|
476
483
|
// Continue loop to get final response
|