natureco-cli 2.5.0 → 2.5.1

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.5.0",
3
+ "version": "2.5.1",
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.5.0</div>
214
+ <div class="version-badge" id="version-badge">v2.5.1</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.5.0',
344
+ version: 'v2.5.1',
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.5.0...', 'green');
131
+ log('gateway', 'Starting NatureCo Gateway v2.5.1...', 'green');
132
132
 
133
133
  // Load config
134
134
  const { getConfig } = require('../utils/config');
@@ -1,6 +1,8 @@
1
+ const { getConfig } = require('../utils/config');
2
+
1
3
  module.exports = {
2
4
  name: 'web_search',
3
- description: 'Search the web for current information using DuckDuckGo',
5
+ description: 'Search the web for current information using Tavily',
4
6
  inputSchema: {
5
7
  type: 'object',
6
8
  properties: {
@@ -14,44 +16,44 @@ module.exports = {
14
16
 
15
17
  async execute(params) {
16
18
  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
+ const config = getConfig();
20
+ const apiKey = config.tavilyApiKey || process.env.TAVILY_API_KEY;
19
21
 
20
- const response = await fetch(url);
22
+ if (!apiKey) {
23
+ return {
24
+ success: false,
25
+ error: 'Tavily API key gerekli. Kur: natureco config set tavilyApiKey tvly_xxx\nÜcretsiz key: https://tavily.com'
26
+ };
27
+ }
28
+
29
+ const response = await fetch('https://api.tavily.com/search', {
30
+ method: 'POST',
31
+ headers: { 'Content-Type': 'application/json' },
32
+ body: JSON.stringify({
33
+ api_key: apiKey,
34
+ query: params.query,
35
+ search_depth: 'basic',
36
+ max_results: 5
37
+ })
38
+ });
21
39
 
22
40
  if (!response.ok) {
23
41
  return {
24
42
  success: false,
25
- error: `DuckDuckGo API error: ${response.status}`
43
+ error: `Tavily API error: ${response.status} ${response.statusText}`
26
44
  };
27
45
  }
28
46
 
29
47
  const data = await response.json();
30
- const results = [];
31
48
 
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
- });
49
+ if (data.error) {
50
+ return {
51
+ success: false,
52
+ error: data.error
53
+ };
52
54
  }
53
55
 
54
- if (results.length === 0) {
56
+ if (!data.results || data.results.length === 0) {
55
57
  return {
56
58
  success: true,
57
59
  message: 'Sonuç bulunamadı',
@@ -63,8 +65,12 @@ module.exports = {
63
65
  return {
64
66
  success: true,
65
67
  query: params.query,
66
- results: results,
67
- count: results.length
68
+ results: data.results.map(r => ({
69
+ title: r.title,
70
+ snippet: r.content,
71
+ url: r.url
72
+ })),
73
+ count: data.results.length
68
74
  };
69
75
  } catch (error) {
70
76
  return {
package/src/utils/api.js CHANGED
@@ -1,4 +1,4 @@
1
- // NatureCo CLI v2.5.0 - Universal LLM Provider Support
1
+ // NatureCo CLI v2.5.1 - 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');