natureco-cli 5.4.10 → 5.4.11
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/repl.js +32 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.11",
|
|
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"
|
package/src/commands/repl.js
CHANGED
|
@@ -471,13 +471,38 @@ async function startRepl(args) {
|
|
|
471
471
|
const fs = require('fs');
|
|
472
472
|
const memFile = path.join(os.homedir(), '.natureco', 'memory', ((cfg.userName || 'default').toLowerCase()) + '.json');
|
|
473
473
|
if (fs.existsSync(memFile)) {
|
|
474
|
-
const memData = JSON.parse(
|
|
474
|
+
const memData = JSON.parse(memFile, 'utf8'));
|
|
475
475
|
if (!memData.botName || memData.botName !== memory.botName) {
|
|
476
476
|
memData.botName = memory.botName;
|
|
477
477
|
fs.writeFileSync(memFile, JSON.stringify(memData, null, 2), 'utf8');
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
} catch (e) {} // Sessizce devam et, kritik degil
|
|
481
|
+
|
|
482
|
+
// v5.4.11: Sasuke Brain - Cross-session context otomatik yukle
|
|
483
|
+
// REPL acildiginda son oturumdan 1-2 context mesaji al
|
|
484
|
+
let crossSessionContext = '';
|
|
485
|
+
try {
|
|
486
|
+
const { listSessions, loadSession } = require('../utils/sessions-helper');
|
|
487
|
+
if (listSessions && loadSession) {
|
|
488
|
+
const sessions = listSessions(1);
|
|
489
|
+
if (sessions && sessions.length > 0) {
|
|
490
|
+
const lastSession = loadSession(sessions[0].id);
|
|
491
|
+
if (lastSession && lastSession.messages && lastSession.messages.length > 0) {
|
|
492
|
+
// Son 2 user message
|
|
493
|
+
const lastUserMsgs = lastSession.messages
|
|
494
|
+
.filter(m => m.role === 'user')
|
|
495
|
+
.slice(-2);
|
|
496
|
+
if (lastUserMsgs.length > 0) {
|
|
497
|
+
crossSessionContext = '\n[KONUSMA GECMISI: ' + sessions[0].id + ']\n' +
|
|
498
|
+
lastUserMsgs.map(m => 'User: ' + (m.content || '').slice(0, 100)).join('\n') + '\n[/GECMISI]\n';
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
} catch (e) {
|
|
504
|
+
// Cross-session yukleme basarisiz, devam et
|
|
505
|
+
}
|
|
481
506
|
// v5.4.5: SOUL.md'yi yukle ve kisiligi system prompt'a enjekte et
|
|
482
507
|
const { loadSoul, summarizeSoul } = require("../tools/soul");
|
|
483
508
|
const soulContent = loadSoul();
|
|
@@ -538,6 +563,8 @@ async function startRepl(args) {
|
|
|
538
563
|
// === KULLANICI BAGLAMI ===
|
|
539
564
|
cfg.userHome ? `Kullanicinin home dizini: ${cfg.userHome}. Downloads: ${cfg.userHome}/Downloads, Desktop: ${cfg.userHome}/Desktop.` : '',
|
|
540
565
|
messages.length > 0 ? 'Bu oturum daha onceki konusmalarin devami.' : '',
|
|
566
|
+
// v5.4.11: Cross-session context (Sasuke Brain)
|
|
567
|
+
crossSessionContext ? `GECMISTE KONUSULAN KONULAR: Bu konulari biliyorsun, tekrar sorma:\n${crossSessionContext}` : '',
|
|
541
568
|
|
|
542
569
|
// === SOUL.md (kisilik manifestosu) ===
|
|
543
570
|
soulSummary ? `=== BENIM KISILIK DOSYAM (SOUL.md) ===\n${soulSummary}\n=== SOUL SONU ===\nBu kisilik dosyasi sana kim oldugunu hatirlatiyor. Burada yazilanlara gore davran. Kullanici "sen kimsin?" derse buradan bilgi kullan.` : '',
|
|
@@ -656,7 +683,7 @@ async function startRepl(args) {
|
|
|
656
683
|
memory.lastUpdated = new Date().toISOString();
|
|
657
684
|
fs.writeFileSync(memFile, JSON.stringify(memory, null, 2), 'utf8');
|
|
658
685
|
// Verification: geri oku
|
|
659
|
-
const verify = JSON.parse(fs.readFileSync(memFile, 'utf8')
|
|
686
|
+
const verify = JSON.parse(fs.readFileSync(memFile, 'utf8');
|
|
660
687
|
factsAdded = uniqueFacts.length;
|
|
661
688
|
}
|
|
662
689
|
|
|
@@ -849,7 +876,9 @@ async function startRepl(args) {
|
|
|
849
876
|
toProcess = toProcess.replace(/Ben\s+Claude[-]?[\d\w\.]*/gi, 'Ben İchigo');
|
|
850
877
|
toProcess = toProcess.replace(/Ben\s+GPT[-]?[\d\w\.]*/gi, 'Ben İchigo');
|
|
851
878
|
toProcess = toProcess.replace(/Ben\s+bir\s+yapay\s+zeka/gi, 'Ben İchigo');
|
|
852
|
-
|
|
879
|
+
// v5.4.11: İchigo5 ve İchigo.5 gibi varyasyonları yakala
|
|
880
|
+
toProcess = toProcess.replace(/İchigo[\.\s\-_]*\d+/g, 'İchigo'); // İchigo5, İchigo.5, İchigo-2, İchigo_3
|
|
881
|
+
toProcess = toProcess.replace(/Ben\s+İchigo[\.\s\-_]*\d*/gi, 'Ben İchigo');
|
|
853
882
|
process.stdout.write(toProcess);
|
|
854
883
|
}
|
|
855
884
|
} catch (e) {
|