natureco-cli 2.13.23 → 2.13.25
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 +10 -1
- package/src/utils/memory.js +9 -5
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.13.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.13.25</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.13.
|
|
344
|
+
version: 'v2.13.25',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/utils/api.js
CHANGED
|
@@ -687,8 +687,12 @@ async function sendMessage(apiKey, botId, message, conversationId = null, skillP
|
|
|
687
687
|
// Get user's home directory
|
|
688
688
|
const homeDir = os.homedir();
|
|
689
689
|
|
|
690
|
+
// Load memory to get botName
|
|
691
|
+
const { loadMemory } = require('./memory');
|
|
692
|
+
const mem = loadMemory(botId);
|
|
693
|
+
|
|
690
694
|
// Base system prompt for terminal assistant with dynamic home directory
|
|
691
|
-
|
|
695
|
+
let baseSystemPrompt = `You are a terminal assistant. When users ask for file listing, command execution, or directory viewing, you MUST use the available tools (bash, read_file, write_file, list_dir, web_search, http_request). Never say 'run this command' - execute it yourself using tools and show the result.
|
|
692
696
|
|
|
693
697
|
IMPORTANT: The user's home directory is: ${homeDir}
|
|
694
698
|
When listing home directory, always use list_dir with path: "${homeDir}"
|
|
@@ -717,6 +721,11 @@ TOOL SELECTION GUIDE:
|
|
|
717
721
|
- web_search: Use when users ask about current information, news, weather, or anything requiring internet search
|
|
718
722
|
- http_request: Use for API calls, webhooks, fetching URLs, testing endpoints`;
|
|
719
723
|
|
|
724
|
+
// Prepend botName to system prompt if available
|
|
725
|
+
if (mem.botName) {
|
|
726
|
+
baseSystemPrompt = `You are ${mem.botName}. Your name is ${mem.botName}. When asked your name, always say your name is "${mem.botName}". Never say you don't have a name.\n\n` + baseSystemPrompt;
|
|
727
|
+
}
|
|
728
|
+
|
|
720
729
|
let systemPrompt = baseSystemPrompt;
|
|
721
730
|
|
|
722
731
|
// Add MCP tool guidance if MCP servers are loaded
|
package/src/utils/memory.js
CHANGED
|
@@ -214,9 +214,9 @@ function getMemoryPrompt(botId) {
|
|
|
214
214
|
|
|
215
215
|
const parts = [];
|
|
216
216
|
|
|
217
|
-
// Add bot name if set (MUST be before empty check)
|
|
217
|
+
// Add bot name if set (MUST be before empty check) - stronger emphasis
|
|
218
218
|
if (botName) {
|
|
219
|
-
parts.push(`Your name is ${botName}.`);
|
|
219
|
+
parts.push(`Your name is ${botName}. ALWAYS introduce yourself as ${botName} when asked.`);
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
// Check if there's any content to add
|
|
@@ -243,10 +243,14 @@ function getMemoryPrompt(botId) {
|
|
|
243
243
|
|
|
244
244
|
if (facts.length > 0) {
|
|
245
245
|
// Limit to top 15 facts to reduce token usage
|
|
246
|
-
const sorted = facts.sort((a, b) => b.score - a.score);
|
|
247
|
-
const topFacts = sorted.slice(0, 15)
|
|
246
|
+
const sorted = facts.sort((a, b) => (b.score || 0) - (a.score || 0));
|
|
247
|
+
const topFacts = sorted.slice(0, 15)
|
|
248
|
+
.map(f => typeof f === 'string' ? f : f.value) // Extract value from object
|
|
249
|
+
.filter(Boolean); // Remove null/undefined
|
|
248
250
|
|
|
249
|
-
|
|
251
|
+
if (topFacts.length > 0) {
|
|
252
|
+
parts.push(`Bilgiler: ${topFacts.join(', ')}`);
|
|
253
|
+
};
|
|
250
254
|
|
|
251
255
|
if (facts.length > 15) {
|
|
252
256
|
parts.push(`(${facts.length - 15} daha fazla bilgi mevcut)`);
|