natureco-cli 2.14.2 → 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 +19 -17
- 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,10 +174,10 @@ async function chat(botName, options = {}) {
|
|
|
174
174
|
const terminalWidth = process.stdout.columns || 80;
|
|
175
175
|
const separator = '─'.repeat(terminalWidth);
|
|
176
176
|
|
|
177
|
-
// Rabbit ASCII art
|
|
178
|
-
const rabbit = chalk.cyan(' (\\\_/)\n'
|
|
179
|
-
chalk.cyan(' (•ᴥ•)\n'
|
|
180
|
-
chalk.cyan('
|
|
177
|
+
// Rabbit ASCII art with fixed unicode
|
|
178
|
+
const rabbit = chalk.cyan(' (\\\_/)') + '\n' +
|
|
179
|
+
chalk.cyan(' (•ᴥ•)') + '\n' +
|
|
180
|
+
chalk.cyan(' />') + chalk.green('🌿');
|
|
181
181
|
|
|
182
182
|
// Full UI header with rabbit
|
|
183
183
|
console.log(rabbit);
|
|
@@ -185,7 +185,7 @@ async function chat(botName, options = {}) {
|
|
|
185
185
|
console.log(chalk.gray(separator));
|
|
186
186
|
|
|
187
187
|
// Line 1: NatureCo · botName · model · timezone
|
|
188
|
-
const timezone =
|
|
188
|
+
const timezone = mem.facts?.find(f => {
|
|
189
189
|
const val = typeof f === 'string' ? f : f.value;
|
|
190
190
|
return val?.includes('Timezone:');
|
|
191
191
|
});
|
|
@@ -211,20 +211,22 @@ async function chat(botName, options = {}) {
|
|
|
211
211
|
console.log(chalk.gray(separator));
|
|
212
212
|
|
|
213
213
|
// Line 3: Memory info · Skills · Crons
|
|
214
|
-
const userName =
|
|
215
|
-
const factCount = (
|
|
214
|
+
const userName = mem.name || 'User';
|
|
215
|
+
const factCount = (mem.facts || []).length;
|
|
216
216
|
const skillCount = getSkills().length;
|
|
217
217
|
|
|
218
|
-
// Get active cron count
|
|
218
|
+
// Get active cron count with correct path
|
|
219
219
|
let cronCount = 0;
|
|
220
220
|
try {
|
|
221
221
|
const fs2 = require('fs');
|
|
222
222
|
const cronsFile = path.join(os.homedir(), '.natureco', 'crons.json');
|
|
223
223
|
if (fs2.existsSync(cronsFile)) {
|
|
224
224
|
const crons = JSON.parse(fs2.readFileSync(cronsFile, 'utf8'));
|
|
225
|
-
cronCount = crons.filter(c => c.enabled).length;
|
|
225
|
+
cronCount = crons.filter(c => c.enabled !== false).length;
|
|
226
226
|
}
|
|
227
|
-
} catch {
|
|
227
|
+
} catch (e) {
|
|
228
|
+
cronCount = 0;
|
|
229
|
+
}
|
|
228
230
|
|
|
229
231
|
const memoryInfo = `Memory: ${userName}`;
|
|
230
232
|
const line3 = chalk.gray(memoryInfo + (factCount > 0 ? ` · ${factCount} facts` : '')) +
|
|
@@ -376,10 +378,10 @@ async function chat(botName, options = {}) {
|
|
|
376
378
|
case 'clear':
|
|
377
379
|
console.clear();
|
|
378
380
|
|
|
379
|
-
// Rabbit
|
|
380
|
-
const rabbitClear = chalk.cyan(' (\\\_/)\n'
|
|
381
|
-
chalk.cyan(' (•ᴥ•)\n'
|
|
382
|
-
chalk.cyan('
|
|
381
|
+
// Rabbit with fixed unicode
|
|
382
|
+
const rabbitClear = chalk.cyan(' (\\\_/)') + '\n' +
|
|
383
|
+
chalk.cyan(' (•ᴥ•)') + '\n' +
|
|
384
|
+
chalk.cyan(' />') + chalk.green('🌿');
|
|
383
385
|
console.log(rabbitClear);
|
|
384
386
|
console.log('');
|
|
385
387
|
|
|
@@ -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,
|