natureco-cli 2.14.1 → 2.14.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/chat.js +38 -15
- package/src/commands/dashboard.js +2 -2
package/package.json
CHANGED
package/src/commands/chat.js
CHANGED
|
@@ -160,9 +160,9 @@ async function chat(botName, options = {}) {
|
|
|
160
160
|
// Chat başlat
|
|
161
161
|
console.clear();
|
|
162
162
|
|
|
163
|
-
// Get botName from memory
|
|
164
|
-
const
|
|
165
|
-
const displayBotName =
|
|
163
|
+
// Get botName from memory and bot
|
|
164
|
+
const mem = loadMemory(bot.id);
|
|
165
|
+
const displayBotName = mem.botName || bot.name || 'NatureCo';
|
|
166
166
|
|
|
167
167
|
// Get provider model (short name)
|
|
168
168
|
const { getConfig } = require('../utils/config');
|
|
@@ -174,11 +174,18 @@ async function chat(botName, options = {}) {
|
|
|
174
174
|
const terminalWidth = process.stdout.columns || 80;
|
|
175
175
|
const separator = '─'.repeat(terminalWidth);
|
|
176
176
|
|
|
177
|
-
//
|
|
177
|
+
// Rabbit ASCII art with fixed unicode
|
|
178
|
+
const rabbit = chalk.cyan(' (\\\_/)') + '\n' +
|
|
179
|
+
chalk.cyan(' (•ᴥ•)') + '\n' +
|
|
180
|
+
chalk.cyan(' />') + chalk.green('🌿');
|
|
181
|
+
|
|
182
|
+
// Full UI header with rabbit
|
|
183
|
+
console.log(rabbit);
|
|
184
|
+
console.log('');
|
|
178
185
|
console.log(chalk.gray(separator));
|
|
179
186
|
|
|
180
187
|
// Line 1: NatureCo · botName · model · timezone
|
|
181
|
-
const timezone =
|
|
188
|
+
const timezone = mem.facts?.find(f => {
|
|
182
189
|
const val = typeof f === 'string' ? f : f.value;
|
|
183
190
|
return val?.includes('Timezone:');
|
|
184
191
|
});
|
|
@@ -196,7 +203,7 @@ async function chat(botName, options = {}) {
|
|
|
196
203
|
// Line 2: Session · Commands · Ctrl+C
|
|
197
204
|
const line2 = chalk.gray('Session') +
|
|
198
205
|
chalk.gray(' · ') +
|
|
199
|
-
chalk.gray('
|
|
206
|
+
chalk.gray('/clear /bot /skills /memory /help') +
|
|
200
207
|
chalk.gray(' · ') +
|
|
201
208
|
chalk.gray('Ctrl+C to exit');
|
|
202
209
|
console.log(line2);
|
|
@@ -204,22 +211,24 @@ async function chat(botName, options = {}) {
|
|
|
204
211
|
console.log(chalk.gray(separator));
|
|
205
212
|
|
|
206
213
|
// Line 3: Memory info · Skills · Crons
|
|
207
|
-
const userName =
|
|
208
|
-
const factCount = (
|
|
214
|
+
const userName = mem.name || 'User';
|
|
215
|
+
const factCount = (mem.facts || []).length;
|
|
209
216
|
const skillCount = getSkills().length;
|
|
210
217
|
|
|
211
|
-
// Get cron count
|
|
218
|
+
// Get active cron count with correct path
|
|
212
219
|
let cronCount = 0;
|
|
213
220
|
try {
|
|
214
221
|
const fs2 = require('fs');
|
|
215
222
|
const cronsFile = path.join(os.homedir(), '.natureco', 'crons.json');
|
|
216
223
|
if (fs2.existsSync(cronsFile)) {
|
|
217
224
|
const crons = JSON.parse(fs2.readFileSync(cronsFile, 'utf8'));
|
|
218
|
-
cronCount = crons.filter(c => c.enabled).length;
|
|
225
|
+
cronCount = crons.filter(c => c.enabled !== false).length;
|
|
219
226
|
}
|
|
220
|
-
} catch {
|
|
227
|
+
} catch (e) {
|
|
228
|
+
cronCount = 0;
|
|
229
|
+
}
|
|
221
230
|
|
|
222
|
-
const memoryInfo =
|
|
231
|
+
const memoryInfo = `Memory: ${userName}`;
|
|
223
232
|
const line3 = chalk.gray(memoryInfo + (factCount > 0 ? ` · ${factCount} facts` : '')) +
|
|
224
233
|
chalk.gray(' ') +
|
|
225
234
|
chalk.gray(`Skills: ${skillCount}`) +
|
|
@@ -368,6 +377,14 @@ async function chat(botName, options = {}) {
|
|
|
368
377
|
switch (command.toLowerCase()) {
|
|
369
378
|
case 'clear':
|
|
370
379
|
console.clear();
|
|
380
|
+
|
|
381
|
+
// Rabbit with fixed unicode
|
|
382
|
+
const rabbitClear = chalk.cyan(' (\\\_/)') + '\n' +
|
|
383
|
+
chalk.cyan(' (•ᴥ•)') + '\n' +
|
|
384
|
+
chalk.cyan(' />') + chalk.green('🌿');
|
|
385
|
+
console.log(rabbitClear);
|
|
386
|
+
console.log('');
|
|
387
|
+
|
|
371
388
|
const terminalWidth2 = process.stdout.columns || 80;
|
|
372
389
|
const separator2 = '─'.repeat(terminalWidth2);
|
|
373
390
|
|
|
@@ -554,7 +571,9 @@ ${lastCodeBlock}
|
|
|
554
571
|
addMessageToSession(bot.id, session.id, '/ultrareview', botReply);
|
|
555
572
|
} catch (err) {
|
|
556
573
|
stopLoadingAnimation(loadingInterval);
|
|
557
|
-
|
|
574
|
+
// Extract clean error message
|
|
575
|
+
const errorMsg = err.message.split('"message":"')[1]?.split('"')[0] || err.message;
|
|
576
|
+
console.log(chalk.red(`Error: ${errorMsg}\n`));
|
|
558
577
|
}
|
|
559
578
|
|
|
560
579
|
rl.prompt();
|
|
@@ -589,7 +608,9 @@ ${lastCodeBlock}
|
|
|
589
608
|
addMessageToSession(bot.id, session.id, userMessage, botReply);
|
|
590
609
|
} catch (err) {
|
|
591
610
|
stopLoadingAnimation(loadingInterval);
|
|
592
|
-
|
|
611
|
+
// Extract clean error message
|
|
612
|
+
const errorMsg = err.message.split('"message":"')[1]?.split('"')[0] || err.message;
|
|
613
|
+
console.log(chalk.red(`Error: ${errorMsg}\n`));
|
|
593
614
|
}
|
|
594
615
|
|
|
595
616
|
rl.prompt();
|
|
@@ -693,7 +714,9 @@ ${lastCodeBlock}
|
|
|
693
714
|
}
|
|
694
715
|
} catch (err) {
|
|
695
716
|
stopLoadingAnimation(loadingInterval);
|
|
696
|
-
|
|
717
|
+
// Extract clean error message
|
|
718
|
+
const errorMsg = err.message.split('"message":"')[1]?.split('"')[0] || err.message;
|
|
719
|
+
console.log(chalk.red(`Error: ${errorMsg}\n`));
|
|
697
720
|
}
|
|
698
721
|
|
|
699
722
|
currentMessage = '';
|
|
@@ -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.14.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.14.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.14.
|
|
344
|
+
version: 'v2.14.3',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|