natureco-cli 2.13.4 → 2.13.5

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.4",
3
+ "version": "2.13.5",
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.4</div>
214
+ <div class="version-badge" id="version-badge">v2.13.5</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.4',
344
+ version: 'v2.13.5',
345
345
  bots: cfg.bots || [],
346
346
  telegramToken: cfg.telegramToken || null,
347
347
  whatsappConnected: cfg.whatsappConnected || false,
@@ -16,6 +16,21 @@ function normalizeWhatsAppNumber(target) {
16
16
  return match ? '+' + match[1] : target;
17
17
  }
18
18
 
19
+ /**
20
+ * Add unique fact to facts array (prevent duplicates)
21
+ */
22
+ function addUniqueFact(facts, newFact) {
23
+ const exists = facts.some(f => {
24
+ const existingVal = typeof f === 'string' ? f : f.value;
25
+ const newVal = typeof newFact === 'string' ? newFact : newFact.value;
26
+ return existingVal === newVal;
27
+ });
28
+
29
+ if (!exists) {
30
+ facts.push(newFact);
31
+ }
32
+ }
33
+
19
34
  async function migrate(options) {
20
35
  const from = options.from || 'openclaw';
21
36
 
@@ -71,7 +86,7 @@ async function migrate(options) {
71
86
 
72
87
  if (timezoneMatch) {
73
88
  let timezone = timezoneMatch[1].trim().replace(/\*\*/g, '').trim();
74
- memory.facts.push({
89
+ addUniqueFact(memory.facts, {
75
90
  value: `Timezone: ${timezone}`,
76
91
  score: 6,
77
92
  updatedAt: new Date().toISOString().split('T')[0]
@@ -80,7 +95,7 @@ async function migrate(options) {
80
95
 
81
96
  if (notesMatch) {
82
97
  let notes = notesMatch[1].trim().replace(/\*\*/g, '').trim();
83
- memory.facts.push({
98
+ addUniqueFact(memory.facts, {
84
99
  value: notes,
85
100
  score: 6,
86
101
  updatedAt: new Date().toISOString().split('T')[0]
@@ -130,7 +145,7 @@ async function migrate(options) {
130
145
 
131
146
  // Add first 30 lines as facts (max 200 chars each)
132
147
  for (const line of lines.slice(0, 30)) {
133
- memory.facts.push({
148
+ addUniqueFact(memory.facts, {
134
149
  value: line.slice(0, 200),
135
150
  score: 6,
136
151
  updatedAt: new Date().toISOString().split('T')[0]