natureco-cli 2.4.5 → 2.5.0
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.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.5.0</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.
|
|
344
|
+
version: 'v2.5.0',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
|
@@ -128,7 +128,7 @@ async function startGateway() {
|
|
|
128
128
|
|
|
129
129
|
async function runGatewayWorker() {
|
|
130
130
|
// This runs in the background
|
|
131
|
-
log('gateway', 'Starting NatureCo Gateway v2.
|
|
131
|
+
log('gateway', 'Starting NatureCo Gateway v2.5.0...', 'green');
|
|
132
132
|
|
|
133
133
|
// Load config
|
|
134
134
|
const { getConfig } = require('../utils/config');
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
name: 'web_search',
|
|
3
|
+
description: 'Search the web for current information using DuckDuckGo',
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object',
|
|
6
|
+
properties: {
|
|
7
|
+
query: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
description: 'Search query'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
required: ['query']
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
async execute(params) {
|
|
16
|
+
try {
|
|
17
|
+
const query = encodeURIComponent(params.query);
|
|
18
|
+
const url = `https://api.duckduckgo.com/?q=${query}&format=json&no_html=1&skip_disambig=1`;
|
|
19
|
+
|
|
20
|
+
const response = await fetch(url);
|
|
21
|
+
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
return {
|
|
24
|
+
success: false,
|
|
25
|
+
error: `DuckDuckGo API error: ${response.status}`
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const data = await response.json();
|
|
30
|
+
const results = [];
|
|
31
|
+
|
|
32
|
+
// Add abstract if available
|
|
33
|
+
if (data.AbstractText) {
|
|
34
|
+
results.push({
|
|
35
|
+
title: data.Heading || 'Abstract',
|
|
36
|
+
snippet: data.AbstractText,
|
|
37
|
+
url: data.AbstractURL || ''
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Add related topics (up to 5)
|
|
42
|
+
if (data.RelatedTopics && Array.isArray(data.RelatedTopics)) {
|
|
43
|
+
data.RelatedTopics.slice(0, 5).forEach(topic => {
|
|
44
|
+
if (topic.Text && topic.FirstURL) {
|
|
45
|
+
results.push({
|
|
46
|
+
title: topic.Text.split(' - ')[0] || 'Related',
|
|
47
|
+
snippet: topic.Text,
|
|
48
|
+
url: topic.FirstURL
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (results.length === 0) {
|
|
55
|
+
return {
|
|
56
|
+
success: true,
|
|
57
|
+
message: 'Sonuç bulunamadı',
|
|
58
|
+
query: params.query,
|
|
59
|
+
results: []
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
success: true,
|
|
65
|
+
query: params.query,
|
|
66
|
+
results: results,
|
|
67
|
+
count: results.length
|
|
68
|
+
};
|
|
69
|
+
} catch (error) {
|
|
70
|
+
return {
|
|
71
|
+
success: false,
|
|
72
|
+
error: error.message
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
package/src/utils/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// NatureCo CLI v2.
|
|
1
|
+
// NatureCo CLI v2.5.0 - Universal LLM Provider Support
|
|
2
2
|
// Supports: OpenAI, Groq, Together, Fireworks, Perplexity, Mistral, DeepSeek, OpenRouter, Ollama, LM Studio, Anthropic
|
|
3
3
|
|
|
4
4
|
const fs = require('fs');
|
|
@@ -384,7 +384,7 @@ async function sendMessage(apiKey, botId, message, conversationId = null, skillP
|
|
|
384
384
|
const homeDir = os.homedir();
|
|
385
385
|
|
|
386
386
|
// System prompt for terminal assistant with dynamic home directory
|
|
387
|
-
const 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). Never say 'run this command' - execute it yourself using tools and show the result.
|
|
387
|
+
const 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). Never say 'run this command' - execute it yourself using tools and show the result.
|
|
388
388
|
|
|
389
389
|
IMPORTANT: The user's home directory is: ${homeDir}
|
|
390
390
|
When listing home directory, always use list_dir with path: "${homeDir}"
|
|
@@ -403,7 +403,8 @@ TOOL SELECTION GUIDE:
|
|
|
403
403
|
- read_file: Use for .txt, .md, .json, .log, .csv files
|
|
404
404
|
- bash with "cat file | head -100": Use for .sh, .py, .js, .ts, .env, config files, or any file with special characters
|
|
405
405
|
- list_dir: Use for directory listings
|
|
406
|
-
- bash: Use for all system commands, process info, disk usage, etc
|
|
406
|
+
- bash: Use for all system commands, process info, disk usage, etc.
|
|
407
|
+
- web_search: Use when users ask about current information, news, weather, or anything requiring internet search`;
|
|
407
408
|
|
|
408
409
|
return sendMessageToProvider(apiKey, message, conversationId, systemPrompt);
|
|
409
410
|
}
|