natureco-cli 5.6.8 → 5.6.10

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.6.8",
3
+ "version": "5.6.10",
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"
@@ -852,11 +852,11 @@ async function startRepl(args) {
852
852
  const trimmed = (line || '').toLowerCase();
853
853
  const isIdentityQuestion = /(sen\s+kim|adin\s+ne|kendini\s+tan|kendin\s+tanit|kimsin|ne\s+adindasin)/.test(trimmed);
854
854
  if (isIdentityQuestion) {
855
- // Hard-coded prefix artik botName'i kullaniyor
855
+ // v5.6.10: Hard-coded prefix minimal - model cevabini bozuyordu
856
+ // Once sadece isim yaz, modelin devamini getirsin
856
857
  const displayName = memory.botName || 'İchigo';
857
858
  process.stdout.write(tui.styled('\n AI ', { color: tui.PALETTE.secondary, bold: true }));
858
- process.stdout.write('Ben ' + displayName + ', NatureCo CLI\'nin Türkçe yapay zeka asistanıyım. ');
859
- console.log('\n');
859
+ process.stdout.write('Merhaba! Ben ' + displayName + '. ');
860
860
  }
861
861
 
862
862
  // AI cevabı
@@ -868,41 +868,8 @@ async function startRepl(args) {
868
868
  providerApiKey,
869
869
  apiMessages,
870
870
  model,
871
- // Text chunk callback — v5.4.15: DIREKT FIX, buffer'sız
872
- // v5.4.15: Her chunk'ta inline fix - buffer mantigi tamamen kaldirildi
873
- (chunk) => {
874
- try {
875
- let c = String(chunk || '');
876
- // 1. Model adlari
877
- c = c.replace(/MiniMax[\s\-\.\w\d]*/gi, 'İchigo'); // v5.4.16 FINAL: \b kaldirildi, parca parça gelen chunk'larda bile calisir
878
- c = c.replace(/MiniMax[^İchigoİCHIGO]*?(?=[İchigoİCHIGO.,!?\n]|$)/g, 'İchigo');
879
- c = c.replace(/NatureCo\s+CLI/g, 'İchigo');
880
- c = c.replace(/\bClaude[\s\-\.\w]*/gi, 'İchigo');
881
- c = c.replace(/\bGPT[\s\-\.\w]*/gi, 'İchigo');
882
- c = c.replace(/ChatGPT/g, 'İchigo');
883
- // 2. "Ben X" pattern
884
- c = c.replace(/Ben[^.!?,;:\n]*MiniMax[^.!?,;:\n]*/gi, 'Ben İchigo'); // v5.4.16: parca parça MiniMax'i de yakala
885
- c = c.replace(/Ben\s+Claude[^.!?,;:\n]*/gi, 'Ben İchigo');
886
- c = c.replace(/Ben\s+GPT[^.!?,;:\n]*/gi, 'Ben İchigo');
887
- c = c.replace(/Ben\s+bir\s+(?:yapay\s+zeka|AI)[^.!?,;:\n]*/gi, 'Ben İchigo');
888
- c = c.replace(/Ben\s+NatureCo\s+CLI[^.!?,;:\n]*/gi, 'Ben İchigo');
889
- // 3. "İchigo" varyasyonlari
890
- c = c.replace(/(İchigo)(\d)([a-zA-ZçğıöşüÇĞİÖŞÜ])/g, '$1 $3');
891
- c = c.replace(/(İchigo)([a-zA-ZçğıöşüÇĞİÖŞÜ])/g, '$1 $2');
892
- c = c.replace(/İchigo[\.\s\-_]*\d+/g, 'İchigo');
893
- c = c.replace(/İchigo\./g, 'İchigo');
894
- // 4. "Ben İchigo" + sonraki harf
895
- c = c.replace(/Ben\s+İchigo([a-zA-ZçğıöşüÇĞİÖŞÜ])/g, 'Ben İchigo $1');
896
- c = c.replace(/(İchigo)(\d)([a-zA-ZçğıöşüÇĞİÖŞÜ])/g, '$1 $3');
897
- c = c.replace(/İchigo[\.\s\-_\d]*([a-zA-ZçğıöşüÇĞİÖŞÜ])/g, 'İchigo $1');
898
- c = c.replace(/Ben\s+İchigo\b/gi, 'Ben İchigo');
899
- c = c.replace(/\*\*(?:MiniMax|Claude|GPT)[^\*]*\*\*/gi, '**İchigo**'); // v5.4.17: **Markdown** model adi
900
- c = c.replace(/Merhaba[!]?\s+Ben[^.!?,;:\n]*MiniMax[^.!?,;:\n]*/gi, 'Merhaba! Ben İchigo');
901
- // v5.4.19: silindi (cift cevap onleme)
902
- } catch (e) {
903
- process.stdout.write(chunk);
904
- }
905
- },
871
+ // v5.6.9: Streaming kapatildi - tum cevap bekleniyor, sonra fix
872
+ null, // callback yok
906
873
  // Tool call callback — kullanıcıya göster
907
874
  (toolEvent) => {
908
875
  if (toolEvent.status === 'running') {
@@ -923,12 +890,38 @@ async function startRepl(args) {
923
890
  }
924
891
  }
925
892
  );
926
- // v5.4.18: Tam cevaba inline fix uygula (stream false sayesinde tam metin gelir)
927
- const fixedReply = global._applyModelNameFix ? global._applyModelNameFix(reply) : reply;
893
+ // v5.6.9: Streaming kapatildi, tam cevap replyBuffer'da birikiyor
894
+ const fullReply = global._replyBuffer || reply || '';
895
+ global._replyBuffer = '';
896
+ // Bot adini al
897
+ const displayBotName = memory.botName || 'İchigo';
898
+ // v5.6.9: Tum model adlarini ve varyasyonlari temizle
899
+ let fixedReply = String(fullReply);
900
+ // Bilinen model adlari - tum varyasyonlar
901
+ fixedReply = fixedReply.replace(/\bMiniMax[-\s\w\.\d]*/gi, displayBotName);
902
+ fixedReply = fixedReply.replace(/\bM2\.5[-\s\w\.\d]*/gi, displayBotName);
903
+ fixedReply = fixedReply.replace(/\bM2[\s\-\.\w\d]*/gi, displayBotName);
904
+ fixedReply = fixedReply.replace(/\bClaude[-\s\w\.\d]*/gi, displayBotName);
905
+ fixedReply = fixedReply.replace(/\bGPT[-\s\w\.\d]*/gi, displayBotName);
906
+ fixedReply = fixedReply.replace(/\bChatGPT\b/g, displayBotName);
907
+ // NatureCo CLI referansini temizle
908
+ fixedReply = fixedReply.replace(/NatureCo\s+CLI(\s*'in|'nin)?/gi, displayBotName);
909
+ // "Ben X" pattern - tum model adlarini bot adi ile degistir
910
+ fixedReply = fixedReply.replace(/Ben\s+MiniMax[^.!?,;:\n]*/gi, 'Ben ' + displayBotName);
911
+ fixedReply = fixedReply.replace(/Ben\s+Claude[^.!?,;:\n]*/gi, 'Ben ' + displayBotName);
912
+ fixedReply = fixedReply.replace(/Ben\s+GPT[^.!?,;:\n]*/gi, 'Ben ' + displayBotName);
913
+ fixedReply = fixedReply.replace(/Ben\s+İchigo[\s\w\.]*/gi, 'Ben ' + displayBotName);
914
+ // Markdown ** ile cevrili model adi
915
+ fixedReply = fixedReply.replace(/\*\*(?:MiniMax|Claude|GPT|M2\.5|M2)[^\*]*\*\*/gi, '**' + displayBotName + '**');
916
+ // "İchigo" varyasyonlari
917
+ fixedReply = fixedReply.replace(/(İchigo)(\d)([a-zA-ZçğıöşüÇĞİÖŞÜ])/g, displayBotName + ' $3');
918
+ fixedReply = fixedReply.replace(/İchigo[\.\s\-_]*\d+/g, displayBotName);
919
+ fixedReply = fixedReply.replace(/İchigo\./g, displayBotName);
920
+ // Cevap yazdir
928
921
  process.stdout.write('\n' + fixedReply + '\n');
929
922
  messages.push({ role: 'assistant', content: fixedReply });
930
923
  totalInputTokens += apiMessages.reduce((s, m) => s + Math.ceil((m.content || '').length / 4), 0);
931
- totalOutputTokens += Math.ceil((reply || '').length / 4);
924
+ totalOutputTokens += Math.ceil((fullReply || '').length / 4);
932
925
  } catch (err) {
933
926
  process.stdout.write('\n');
934
927
  console.log(chalk.red(' ❌ ' + err.message));
@@ -97,6 +97,11 @@ function loadToolDefinitions() {
97
97
  */
98
98
  function toOpenAIFormat(toolDefs) {
99
99
  // v5.6.6: Yasakli tool'lari filtrele, alias'lari cozumle
100
+ // v5.6.6: Inline tool filtre - model halusinasyonla cagirabilecegi tool'lari engelle
101
+ toolDefs = toolDefs.filter(t =>
102
+ !['brave_search','brave-web-search','google_search','web_search','browse','open','search','shell','bash_command','execute_command','run_command','sql','query','lookup'].includes(t.name)
103
+ );
104
+
100
105
  return toolDefs
101
106
  .filter(t => !['brave_search','brave-web-search','google_search','web_search','browse','open','search','shell','bash_command','execute_command','run_command','sql','query','lookup'].includes(t.name))
102
107
  .map(t => {