natureco-cli 2.13.27 → 2.13.28

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.27",
3
+ "version": "2.13.28",
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.27</div>
214
+ <div class="version-badge" id="version-badge">v2.13.28</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.27',
344
+ version: 'v2.13.28',
345
345
  bots: cfg.bots || [],
346
346
  telegramToken: cfg.telegramToken || null,
347
347
  whatsappConnected: cfg.whatsappConnected || false,
@@ -237,15 +237,17 @@ function getMemoryPrompt(botId) {
237
237
  }
238
238
 
239
239
  if (facts.length > 0) {
240
- // Limit to top 15 facts to reduce token usage
241
- const sorted = facts.sort((a, b) => (b.score || 0) - (a.score || 0));
242
- const topFacts = sorted.slice(0, 15)
240
+ // Normalize all facts to objects with score, then sort and limit
241
+ const topFacts = facts
243
242
  .map(f => {
244
- if (typeof f === 'string') return f;
245
- if (f && typeof f === 'object') return f.value || '';
246
- return '';
243
+ if (typeof f === 'string') return { value: f, score: 5 };
244
+ if (f && typeof f === 'object') return { value: f.value || '', score: f.score || 5 };
245
+ return null;
247
246
  })
248
- .filter(f => f && f.length > 0);
247
+ .filter(f => f && f.value && f.value.length > 0)
248
+ .sort((a, b) => (b.score || 0) - (a.score || 0))
249
+ .slice(0, 15)
250
+ .map(f => f.value);
249
251
 
250
252
  if (topFacts.length > 0) {
251
253
  parts.push(`Bilgiler: ${topFacts.join(', ')}`);