natureco-cli 5.4.7 → 5.4.8

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": "5.4.7",
3
+ "version": "5.4.8",
4
4
  "description": "OpenClaw'dan daha güvenli, daha hızlı, daha ucuz AI agent CLI. Multi-agent, self-evolving skills, audit log, maliyet optimizasyonu ve NatureCo platform-native.",
5
5
  "bin": {
6
6
  "natureco": "bin/natureco.js"
@@ -24,7 +24,7 @@ const chalk = require('chalk');
24
24
  const tui = require('../utils/tui');
25
25
  const { loadToolDefinitions, toOpenAIFormat, executeTool } = require('../utils/tools');
26
26
 
27
- // v5.4.6: Model adi sizintisini engelle
27
+ // v5.4.6: Model adi sizintisini engelle — global'e ata, callback'lerden erisebilir olsun
28
28
  const MODEL_NAMES_TO_HIDE = ['MiniMax-M2.5', 'MiniMaxM2.5', 'minimaxm25', 'Claude-3', 'GPT-4', 'ChatGPT'];
29
29
  function fixModelNameLeak(text, botName) {
30
30
  if (!text) return text;
@@ -38,6 +38,7 @@ function fixModelNameLeak(text, botName) {
38
38
  fixed = fixed.replace(/I am\s+Claude[^.,!?\n]*/gi, 'I am İchigo');
39
39
  return fixed;
40
40
  }
41
+ global.fixModelNameLeak = fixModelNameLeak;
41
42
 
42
43
  // v4.8.0: Tool definitions — başlangıçta bir kez yükle (performans)
43
44
  let _toolDefs = null;
@@ -463,8 +464,20 @@ async function startRepl(args) {
463
464
  // Memory yükle
464
465
  let memory = loadMemory(cfg.userName);
465
466
 
466
- // v5.4.6: Memory'de botName yoksa otomatik İchigo set et
467
+ // v5.4.7: Memory'de botName yoksa otomatik İchigo set et VE kaydet
467
468
  if (!memory.botName) memory.botName = 'İchigo';
469
+ // BotName'i memory'ye persist et (her oturumda ayni kalsin)
470
+ try {
471
+ const fs = require('fs');
472
+ const memFile = path.join(os.homedir(), '.natureco', 'memory', ((cfg.userName || 'default').toLowerCase()) + '.json');
473
+ if (fs.existsSync(memFile)) {
474
+ const memData = JSON.parse(fs.readFileSync(memFile, 'utf8'));
475
+ if (!memData.botName || memData.botName !== memory.botName) {
476
+ memData.botName = memory.botName;
477
+ fs.writeFileSync(memFile, JSON.stringify(memData, null, 2), 'utf8');
478
+ }
479
+ }
480
+ } catch (e) {} // Sessizce devam et, kritik degil
468
481
  // v5.4.5: SOUL.md'yi yukle ve kisiligi system prompt'a enjekte et
469
482
  const { loadSoul, summarizeSoul } = require("../tools/soul");
470
483
  const soulContent = loadSoul();
@@ -552,6 +565,9 @@ async function startRepl(args) {
552
565
  }
553
566
  console.log(tui.C.muted(' Komutlar: ') + tui.C.yellow('/help') + tui.C.muted(' · ') + tui.C.yellow('/memory') + tui.C.muted(' · ') + tui.C.yellow('/sessions') + tui.C.muted(' · ') + tui.C.yellow('/exit'));
554
567
  console.log('');
568
+ // v5.4.7: Hard-coded kimlik — model once bunu okusun
569
+ console.log(tui.C.brand(' 👋 Ben ' + (memory.botName || 'İchigo') + ', ' + (userName || 'kanka') + '. Sen nasilsin?'));
570
+ console.log('');
555
571
 
556
572
  let totalInputTokens = 0;
557
573
  let totalOutputTokens = 0;
@@ -721,10 +737,18 @@ async function startRepl(args) {
721
737
  providerApiKey,
722
738
  apiMessages,
723
739
  model,
724
- // Text chunk callback — v5.4.6: post-process ile model adı sızıntısını engelle
740
+ // Text chunk callback — v5.4.7: inline fix fonksiyonu (modülden bağımsız)
725
741
  (chunk) => {
726
742
  try {
727
- const fixedChunk = fixModelNameLeak(chunk, botName);
743
+ // Inline replace: MiniMax-M2.5 → İchigo
744
+ let fixedChunk = String(chunk || '');
745
+ fixedChunk = fixedChunk.replace(/MiniMax[\s-]*M?[\d.]*[\d]*/gi, botName);
746
+ fixedChunk = fixedChunk.replace(/\bClaude[\s-]*[\d.]*[\d]*/gi, botName);
747
+ fixedChunk = fixedChunk.replace(/\bGPT[\s-]*[\d.]*[\d]*/gi, botName);
748
+ fixedChunk = fixedChunk.replace(/\bChatGPT\b/gi, botName);
749
+ fixedChunk = fixedChunk.replace(/Ben\s+MiniMax[^.,!?\n]*/gi, 'Ben ' + botName);
750
+ fixedChunk = fixedChunk.replace(/Ben\s+NatureCo\s+CLI[^.,!?\n]*/gi, 'Ben ' + botName);
751
+ fixedChunk = fixedChunk.replace(/Ben\s+bir\s+AI[^.,!?\n]*/gi, 'Ben ' + botName);
728
752
  process.stdout.write(fixedChunk);
729
753
  } catch (e) {
730
754
  process.stdout.write(chunk);