natureco-cli 2.13.26 → 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 +1 -1
- package/src/commands/dashboard.js +2 -2
- package/src/utils/memory.js +11 -10
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.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.
|
|
344
|
+
version: 'v2.13.28',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/utils/memory.js
CHANGED
|
@@ -214,11 +214,6 @@ function getMemoryPrompt(botId) {
|
|
|
214
214
|
|
|
215
215
|
const parts = [];
|
|
216
216
|
|
|
217
|
-
// Add bot name if set (MUST be before empty check) - stronger emphasis
|
|
218
|
-
if (botName) {
|
|
219
|
-
parts.push(`Your name is ${botName}. ALWAYS introduce yourself as ${botName} when asked.`);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
217
|
// Check if there's any content to add
|
|
223
218
|
if (!name && !nickname && !botName && preferences.length === 0 && facts.length === 0) {
|
|
224
219
|
return '';
|
|
@@ -242,11 +237,17 @@ function getMemoryPrompt(botId) {
|
|
|
242
237
|
}
|
|
243
238
|
|
|
244
239
|
if (facts.length > 0) {
|
|
245
|
-
//
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
240
|
+
// Normalize all facts to objects with score, then sort and limit
|
|
241
|
+
const topFacts = facts
|
|
242
|
+
.map(f => {
|
|
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;
|
|
246
|
+
})
|
|
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);
|
|
250
251
|
|
|
251
252
|
if (topFacts.length > 0) {
|
|
252
253
|
parts.push(`Bilgiler: ${topFacts.join(', ')}`);
|