natureco-cli 2.4.2 → 2.4.3
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/commands/gateway-server.js +1 -1
- package/src/utils/api.js +1 -1
- package/src/utils/memory.js +22 -12
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.4.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.4.3</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.4.
|
|
344
|
+
version: 'v2.4.3',
|
|
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.4.
|
|
131
|
+
log('gateway', 'Starting NatureCo Gateway v2.4.3...', 'green');
|
|
132
132
|
|
|
133
133
|
// Load config
|
|
134
134
|
const { getConfig } = require('../utils/config');
|
package/src/utils/api.js
CHANGED
package/src/utils/memory.js
CHANGED
|
@@ -119,18 +119,28 @@ function addMemoryEntry(botId, key, value) {
|
|
|
119
119
|
function extractMemoryFromMessage(message) {
|
|
120
120
|
const extracted = [];
|
|
121
121
|
|
|
122
|
-
//
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
122
|
+
// Question words that should NOT trigger name extraction
|
|
123
|
+
const questionWords = ['ne', 'kim', 'nasıl', 'neden', 'niçin', 'nerede', 'nereye', 'nereden', 'hangi', 'kaç', 'ne zaman'];
|
|
124
|
+
|
|
125
|
+
// Check if message is a question
|
|
126
|
+
const isQuestion = questionWords.some(q => message.toLowerCase().includes(q)) || message.includes('?');
|
|
127
|
+
|
|
128
|
+
// Name patterns: "adım X", "ben X'im", "ismim X", "benim adım X"
|
|
129
|
+
// Only extract if NOT a question
|
|
130
|
+
if (!isQuestion) {
|
|
131
|
+
const namePatterns = [
|
|
132
|
+
/benim\s+ad[ıi]m\s+([A-ZÇĞİÖŞÜ][a-zçğıöşü]+)/i,
|
|
133
|
+
/ad[ıi]m\s+([A-ZÇĞİÖŞÜ][a-zçğıöşü]+)/i,
|
|
134
|
+
/ben\s+([A-ZÇĞİÖŞÜ][a-zçğıöşü]+)['']?[ıi]?m/i,
|
|
135
|
+
/[iı]smim\s+([A-ZÇĞİÖŞÜ][a-zçğıöşü]+)/i,
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
for (const pattern of namePatterns) {
|
|
139
|
+
const match = message.match(pattern);
|
|
140
|
+
if (match) {
|
|
141
|
+
extracted.push({ key: 'name', value: match[1] });
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
134
144
|
}
|
|
135
145
|
}
|
|
136
146
|
|