natureco-cli 2.14.2 → 2.14.4

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.14.2",
3
+ "version": "2.14.4",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "main": "bin/natureco.js",
6
6
  "bin": {
@@ -1,3 +1,6 @@
1
+ const path = require('path');
2
+ const os = require('os');
3
+ const fs = require('fs');
1
4
  const inquirer = require('inquirer');
2
5
  const chalk = require('chalk');
3
6
  const readline = require('readline');
@@ -160,9 +163,9 @@ async function chat(botName, options = {}) {
160
163
  // Chat başlat
161
164
  console.clear();
162
165
 
163
- // Get botName from memory
164
- const memory = results.memory || loadMemory(bot.id);
165
- const displayBotName = memory.botName || bot.name;
166
+ // Get botName from memory and bot
167
+ const mem = loadMemory(bot.id);
168
+ const displayBotName = mem.botName || bot.name || 'NatureCo';
166
169
 
167
170
  // Get provider model (short name)
168
171
  const { getConfig } = require('../utils/config');
@@ -174,10 +177,10 @@ async function chat(botName, options = {}) {
174
177
  const terminalWidth = process.stdout.columns || 80;
175
178
  const separator = '─'.repeat(terminalWidth);
176
179
 
177
- // Rabbit ASCII art
178
- const rabbit = chalk.cyan(' (\\\_/)\n') +
179
- chalk.cyan(' (•ᴥ•)\n') +
180
- chalk.cyan(' />🌿');
180
+ // Rabbit ASCII art with fixed unicode
181
+ const rabbit = chalk.cyan(' (\\\_/)') + '\n' +
182
+ chalk.cyan(' (•ᴥ•)') + '\n' +
183
+ chalk.cyan(' />') + chalk.green('🌿');
181
184
 
182
185
  // Full UI header with rabbit
183
186
  console.log(rabbit);
@@ -185,7 +188,7 @@ async function chat(botName, options = {}) {
185
188
  console.log(chalk.gray(separator));
186
189
 
187
190
  // Line 1: NatureCo · botName · model · timezone
188
- const timezone = memory.facts?.find(f => {
191
+ const timezone = mem.facts?.find(f => {
189
192
  const val = typeof f === 'string' ? f : f.value;
190
193
  return val?.includes('Timezone:');
191
194
  });
@@ -211,20 +214,22 @@ async function chat(botName, options = {}) {
211
214
  console.log(chalk.gray(separator));
212
215
 
213
216
  // Line 3: Memory info · Skills · Crons
214
- const userName = memory.name || 'User';
215
- const factCount = (memory.facts || []).length;
217
+ const userName = mem.name || 'User';
218
+ const factCount = (mem.facts || []).length;
216
219
  const skillCount = getSkills().length;
217
220
 
218
- // Get active cron count
221
+ // Get active cron count with correct path
219
222
  let cronCount = 0;
220
223
  try {
221
224
  const fs2 = require('fs');
222
225
  const cronsFile = path.join(os.homedir(), '.natureco', 'crons.json');
223
226
  if (fs2.existsSync(cronsFile)) {
224
227
  const crons = JSON.parse(fs2.readFileSync(cronsFile, 'utf8'));
225
- cronCount = crons.filter(c => c.enabled).length;
228
+ cronCount = crons.filter(c => c.enabled !== false).length;
226
229
  }
227
- } catch {}
230
+ } catch (e) {
231
+ cronCount = 0;
232
+ }
228
233
 
229
234
  const memoryInfo = `Memory: ${userName}`;
230
235
  const line3 = chalk.gray(memoryInfo + (factCount > 0 ? ` · ${factCount} facts` : '')) +
@@ -376,10 +381,10 @@ async function chat(botName, options = {}) {
376
381
  case 'clear':
377
382
  console.clear();
378
383
 
379
- // Rabbit
380
- const rabbitClear = chalk.cyan(' (\\\_/)\n') +
381
- chalk.cyan(' (•ᴥ•)\n') +
382
- chalk.cyan(' />🌿');
384
+ // Rabbit with fixed unicode
385
+ const rabbitClear = chalk.cyan(' (\\\_/)') + '\n' +
386
+ chalk.cyan(' (•ᴥ•)') + '\n' +
387
+ chalk.cyan(' />') + chalk.green('🌿');
383
388
  console.log(rabbitClear);
384
389
  console.log('');
385
390
 
@@ -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.2</div>
214
+ <div class="version-badge" id="version-badge">v2.14.4</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.2',
344
+ version: 'v2.14.4',
345
345
  bots: cfg.bots || [],
346
346
  telegramToken: cfg.telegramToken || null,
347
347
  whatsappConnected: cfg.whatsappConnected || false,