natureco-cli 2.13.22 → 2.13.24

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.22",
3
+ "version": "2.13.24",
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.22</div>
214
+ <div class="version-badge" id="version-badge">v2.13.24</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.22',
344
+ version: 'v2.13.24',
345
345
  bots: cfg.bots || [],
346
346
  telegramToken: cfg.telegramToken || null,
347
347
  whatsappConnected: cfg.whatsappConnected || false,
@@ -247,9 +247,52 @@ async function migrate(options) {
247
247
  const memoryDir = path.join(os.homedir(), '.natureco', 'memory');
248
248
  fs.mkdirSync(memoryDir, { recursive: true });
249
249
 
250
+ // Save to universal-provider.json (primary)
250
251
  const memoryFile = path.join(memoryDir, 'universal-provider.json');
251
252
  fs.writeFileSync(memoryFile, JSON.stringify(memory, null, 2));
252
253
 
254
+ // Also copy to all existing bot memory files
255
+ try {
256
+ const memoryFiles = fs.readdirSync(memoryDir)
257
+ .filter(f => f.endsWith('.json') && f !== 'universal-provider.json');
258
+
259
+ for (const file of memoryFiles) {
260
+ const filePath = path.join(memoryDir, file);
261
+
262
+ try {
263
+ const existing = JSON.parse(fs.readFileSync(filePath, 'utf8'));
264
+
265
+ // Add botName and nickname (don't overwrite if already exists)
266
+ if (memory.botName && !existing.botName) {
267
+ existing.botName = memory.botName;
268
+ }
269
+ if (memory.nickname && !existing.nickname) {
270
+ existing.nickname = memory.nickname;
271
+ }
272
+
273
+ // Merge facts (avoid duplicates)
274
+ if (!existing.facts) {
275
+ existing.facts = [];
276
+ }
277
+ for (const fact of (memory.facts || [])) {
278
+ addUniqueFact(existing.facts, fact);
279
+ }
280
+
281
+ // Save updated memory
282
+ fs.writeFileSync(filePath, JSON.stringify(existing, null, 2));
283
+ } catch (err) {
284
+ // Skip file if error
285
+ console.log(chalk.gray(`⚠️ ${file} güncellenemedi`));
286
+ }
287
+ }
288
+
289
+ if (memoryFiles.length > 0) {
290
+ console.log(chalk.green(`✅ Memory ${memoryFiles.length} bot dosyasına da kopyalandı`));
291
+ }
292
+ } catch (err) {
293
+ // Silently fail if can't read memory directory
294
+ }
295
+
253
296
  report.memory = memory;
254
297
  }
255
298
  } catch (err) {
@@ -214,9 +214,9 @@ function getMemoryPrompt(botId) {
214
214
 
215
215
  const parts = [];
216
216
 
217
- // Add bot name if set (MUST be before empty check)
217
+ // Add bot name if set (MUST be before empty check) - stronger emphasis
218
218
  if (botName) {
219
- parts.push(`Your name is ${botName}.`);
219
+ parts.push(`Your name is ${botName}. ALWAYS introduce yourself as ${botName} when asked.`);
220
220
  }
221
221
 
222
222
  // Check if there's any content to add
@@ -243,10 +243,14 @@ function getMemoryPrompt(botId) {
243
243
 
244
244
  if (facts.length > 0) {
245
245
  // Limit to top 15 facts to reduce token usage
246
- const sorted = facts.sort((a, b) => b.score - a.score);
247
- const topFacts = sorted.slice(0, 15);
246
+ const sorted = facts.sort((a, b) => (b.score || 0) - (a.score || 0));
247
+ const topFacts = sorted.slice(0, 15)
248
+ .map(f => typeof f === 'string' ? f : f.value) // Extract value from object
249
+ .filter(Boolean); // Remove null/undefined
248
250
 
249
- parts.push(`Bilgiler: ${topFacts.map(f => f.value).join(', ')}`);
251
+ if (topFacts.length > 0) {
252
+ parts.push(`Bilgiler: ${topFacts.join(', ')}`);
253
+ };
250
254
 
251
255
  if (facts.length > 15) {
252
256
  parts.push(`(${facts.length - 15} daha fazla bilgi mevcut)`);