natureco-cli 2.13.12 → 2.13.13

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": "2.13.12",
3
+ "version": "2.13.13",
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">v2.13.12</div>
214
+ <div class="version-badge" id="version-badge">v2.13.13</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.12',
344
+ version: 'v2.13.13',
345
345
  bots: cfg.bots || [],
346
346
  telegramToken: cfg.telegramToken || null,
347
347
  whatsappConnected: cfg.whatsappConnected || false,
package/src/utils/api.js CHANGED
@@ -720,8 +720,8 @@ async function sendMessage(apiKey, botId, message, conversationId = null, skillP
720
720
  // Get user's home directory
721
721
  const homeDir = os.homedir();
722
722
 
723
- // System prompt for terminal assistant with dynamic home directory
724
- let systemPrompt = `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.
723
+ // Base system prompt for terminal assistant with dynamic home directory
724
+ const 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.
725
725
 
726
726
  IMPORTANT: The user's home directory is: ${homeDir}
727
727
  When listing home directory, always use list_dir with path: "${homeDir}"
@@ -750,23 +750,29 @@ TOOL SELECTION GUIDE:
750
750
  - web_search: Use when users ask about current information, news, weather, or anything requiring internet search
751
751
  - http_request: Use for API calls, webhooks, fetching URLs, testing endpoints`;
752
752
 
753
+ let systemPrompt = baseSystemPrompt;
754
+
753
755
  // Add MCP tool guidance if MCP servers are loaded
756
+ let mcpPrompt = '';
754
757
  const mcpTools = getMcpTools();
755
758
  if (mcpTools.length > 0) {
756
759
  const mcpServerNames = Object.keys(mcpClients);
757
760
 
758
- systemPrompt += `\n\nMCP SERVERS (${mcpServerNames.length}):`;
761
+ mcpPrompt = `\n\nMCP SERVERS (${mcpServerNames.length}):`;
759
762
 
760
763
  for (const serverName of mcpServerNames) {
761
764
  const serverTools = mcpClients[serverName].tools;
762
- systemPrompt += `\n- ${serverName}: ${serverTools.length} tools`;
765
+ mcpPrompt += `\n- ${serverName}: ${serverTools.length} tools`;
763
766
  }
764
767
 
765
- systemPrompt += `\n\nWhen filesystem MCP is loaded, use list_directory (not list_dir), read_file from MCP (not local).`;
766
- systemPrompt += `\nFor GitHub MCP, prefer list_issues over search_issues.`;
768
+ mcpPrompt += `\n\nWhen filesystem MCP is loaded, use list_directory (not list_dir), read_file from MCP (not local).`;
769
+ mcpPrompt += `\nFor GitHub MCP, prefer list_issues over search_issues.`;
770
+
771
+ systemPrompt += mcpPrompt;
767
772
  }
768
773
 
769
774
  // Add available skills information
775
+ let skillsPrompt = '';
770
776
  const skillsDir = path.join(homeDir, '.natureco', 'skills');
771
777
  if (fs.existsSync(skillsDir)) {
772
778
  try {
@@ -776,20 +782,28 @@ TOOL SELECTION GUIDE:
776
782
  });
777
783
 
778
784
  if (skills.length > 0) {
779
- systemPrompt += `\n\nAVAILABLE SKILLS:`;
785
+ skillsPrompt = `\n\nAVAILABLE SKILLS:`;
780
786
 
781
787
  // Show only first 10 skills, summarize the rest
782
788
  if (skills.length > 10) {
783
- systemPrompt += `\nInstalled skills (${skills.length} total): ${skills.slice(0, 10).join(', ')} and ${skills.length - 10} more.`;
789
+ skillsPrompt += `\nInstalled skills (${skills.length} total): ${skills.slice(0, 10).join(', ')} and ${skills.length - 10} more.`;
784
790
  } else {
785
- systemPrompt += `\nInstalled skills: ${skills.join(', ')}`;
791
+ skillsPrompt += `\nInstalled skills: ${skills.join(', ')}`;
786
792
  }
793
+
794
+ systemPrompt += skillsPrompt;
787
795
  }
788
796
  } catch (err) {
789
797
  // Silently skip if skills directory can't be read
790
798
  }
791
799
  }
792
800
 
801
+ // Log system prompt components
802
+ console.log('[API] Base system prompt:', baseSystemPrompt.length, 'chars');
803
+ console.log('[API] MCP prompt:', mcpPrompt.length, 'chars');
804
+ console.log('[API] Skills prompt:', skillsPrompt.length, 'chars');
805
+ console.log('[API] Total system prompt:', systemPrompt.length, 'chars, ~', Math.round(systemPrompt.length / 4), 'tokens');
806
+
793
807
  return sendMessageToProvider(apiKey, message, conversationId, systemPrompt);
794
808
  }
795
809