natureco-cli 5.39.0 → 5.40.0
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/CHANGELOG.md +13 -0
- package/package.json +1 -1
- package/src/commands/repl.js +41 -19
- package/src/tools/workflow.js +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to NatureCo CLI will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [5.40.0] - 2026-07-08 — "CROSS-SESSION HAFIZA bozulması düzeltildi (gerçek macOS SSH testinde bulundu)"
|
|
6
|
+
|
|
7
|
+
Gerçek MacBook'a SSH ile bağlanıp canlı test yapılırken bulundu: kullanıcı "projemin gizli kod adı ONYX-7'yi hatırla" dediğinde, yeni oturumda HATIRLANMIYORDU. Kök neden zincirleme çözüldü.
|
|
8
|
+
|
|
9
|
+
### 🐛 Cross-session hafıza (KRİTİK — kullanıcının en önemli özelliği)
|
|
10
|
+
- **Otomatik fact-extraction masum ifadeleri bozuyordu (asıl kök neden)**: `repl.js` her oturum sonunda regex ile fact çıkarıyordu; pattern `ad[ıi]m?` — **`m` OPSİYONEL** — "kod **adı**", "proje **adı**", "dosya **adı**" gibi tamlamaları "kullanıcı adı" sanıyor, değeri de `toLowerCase()`+`\w+` ile bozuyordu: **"gizli kod adı ZEPHYR-9" → "Kullanici ad: zephyr"**. Agent `memory_write` ile DOĞRU kaydetse bile üzerine bu YANLIŞ fact yazılıyor, recall bozuluyordu. Artık: `m` zorunlu ("benim adım/adım/ismim X" yakalanır, "kod adı" YAKALANMAZ), değer orijinal case'de korunur (ZEPHYR-9 bozulmaz), aşırı geniş `bana .* de` kaldırıldı. Ayrıca konum eki `[dt]e`→`[dt][ae]` (da/de/ta/te), tercih/konum nesnesi fiilden ÖNCE (Türkçe dil bilgisi). Fonksiyon module-level `extractPreferenceFacts`'e taşındı + 5 regresyon testi.
|
|
11
|
+
- **loadUserMemory sıralama**: flat fact'ler dosya sırasıyla ilk 15'i alınıyordu → çok fact olunca EN YENİ kayıt (yeni öğrenilen kod adı) sysMsg'e girmeden kesiliyordu. Artık skor + tarihe göre sıralanıp ilk 25 alınır (en güncel/önemli garanti).
|
|
12
|
+
- **Limit tutarsızlığı**: `repl.js` fact'leri 15'e, `memory_write` 50'ye (MAX_FACTS) kesiyordu — repl'in 15 sert limiti yeni fact'leri sessizce siliyordu. İkisi 50'de (NATURECO_MAX_FACTS) birleştirildi.
|
|
13
|
+
- **memory kaydetme kuralı** (agentic sysMsg): "spesifik değerleri (kod/isim/sayı/tarih) AYNEN koru, doğru etiketle (proje kod adı ≠ kullanıcı adı)" kuralı eklendi.
|
|
14
|
+
|
|
15
|
+
### ✓ Gerçek macOS (Darwin 25.5.0, arm64) SSH doğrulaması
|
|
16
|
+
node v26.4.0 + natureco kurulu. Doğrulanan: grep_search (ripgrep yolu), code_execution (python3+node), git (log+enjeksiyon+remote-guard), cron_create (oluştur+`cron list`'te görünür+remove), http_request/duckduckgo/memory_tree, agentic chat + write_file, **ve düzeltme sonrası**: "kod adı FALCON-3" → doğru kaydedildi + yeni oturumda hatırlandı. 532 test yeşil (repl-memory regresyon +5), ESLint temiz.
|
|
17
|
+
|
|
5
18
|
## [5.39.0] - 2026-07-08 — "CROSS-PLATFORM: grep_search + social_open Windows'ta kırıktı, düzeltildi"
|
|
6
19
|
|
|
7
20
|
Platform-uyumluluk denetimi: 90 aracın 18'i platform-özel. Çekirdek chat/code araçlarının Windows VE macOS'ta çalışması hedeflendi. 2 çekirdek/computer-use aracı saf Windows'ta kırıktı.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.40.0",
|
|
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
|
@@ -20,6 +20,32 @@ const path = require('path');
|
|
|
20
20
|
const os = require('os');
|
|
21
21
|
const https = require('https');
|
|
22
22
|
const { spawn } = require('child_process');
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* v5.40: Oturum-sonu pattern-tabanli isim/tercih cikarimi — SAF fonksiyon (test
|
|
26
|
+
* edilebilir; regresyon kilidi). Eskiden persistSessionToMemory icinde gomuluydu
|
|
27
|
+
* ve "ad[ıi]m?" (m OPSIYONEL) pattern'i "kod adı", "proje adı", "dosya adı" gibi
|
|
28
|
+
* MASUM tamlamalari "kullanici adi" saniyor + degeri lowercase/\w ile bozuyordu
|
|
29
|
+
* ("gizli kod adı ZEPHYR-9" → "Kullanici ad: zephyr"). Bu, agent memory_write ile
|
|
30
|
+
* DOGRU kaydetse bile uzerine YANLIS fact yazip cross-session recall'i bozuyordu.
|
|
31
|
+
* @param {string} content Kullanici mesaji (orijinal case)
|
|
32
|
+
* @returns {Array<{key:string, category:string, value:string}>}
|
|
33
|
+
*/
|
|
34
|
+
function extractPreferenceFacts(content) {
|
|
35
|
+
const patterns = [
|
|
36
|
+
// ad: "benim adım X" / "adım X" / "ismim X" — m ZORUNLU; "kod adı" (adı) YAKALANMAZ.
|
|
37
|
+
{ match: /(?:benim\s+ad[ıi]m|(?:^|\s)ad[ıi]m|[iı]smim)\s+([A-Za-zÇĞİÖŞÜçğıöşü][\wÇĞİÖŞÜçğıöşü.-]*)/i, category: 'personal', key: 'ad' },
|
|
38
|
+
// tercih/konum: nesne fiilden ONCE gelir (TR) — deger orijinal case korunur.
|
|
39
|
+
{ match: /([A-Za-zÇĞİÖŞÜçğıöşü][\wÇĞİÖŞÜçğıöşü.-]*)['’]?[ıi]?\s*(?:seviyorum|hoşlan[ıi]yorum|beğeniyorum)/i, category: 'preference', key: 'sevilen' },
|
|
40
|
+
{ match: /([A-Za-zÇĞİÖŞÜçğıöşü][\wÇĞİÖŞÜçğıöşü.-]*)['’]?[dt][ae]\s+(?:yaşıyorum|oturuyorum|kalıyorum)/i, category: 'location', key: 'yer' },
|
|
41
|
+
];
|
|
42
|
+
const out = [];
|
|
43
|
+
for (const p of patterns) {
|
|
44
|
+
const m = (content || '').match(p.match);
|
|
45
|
+
if (m) out.push({ key: p.key, category: p.category, value: `Kullanici ${p.key}: ${m[1].trim()}` });
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
23
49
|
const chalk = require('chalk');
|
|
24
50
|
const tui = require('../utils/tui');
|
|
25
51
|
const { loadToolDefinitions, toOpenAIFormat, executeTool } = require('../utils/tools');
|
|
@@ -1252,20 +1278,12 @@ async function startRepl(args) {
|
|
|
1252
1278
|
// Bot adı sorgulanmış olabilir, mevcut adı koru
|
|
1253
1279
|
}
|
|
1254
1280
|
|
|
1255
|
-
// Kisilik
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
for (const p of prefPatterns) {
|
|
1262
|
-
const m2 = msg.content.match(p.match);
|
|
1263
|
-
if (m2) {
|
|
1264
|
-
const val = m2[1].toLowerCase();
|
|
1265
|
-
const fact = `Kullanici ${p.key}: ${val}`;
|
|
1266
|
-
if (!(memory.facts || []).some(f => f.value === fact)) {
|
|
1267
|
-
newFacts.push({ value: fact, score: 6, category: p.category, createdAt: new Date().toISOString() });
|
|
1268
|
-
}
|
|
1281
|
+
// v5.40: Kisilik/isim cikarimi module-level SAF extractPreferenceFacts'e
|
|
1282
|
+
// tasindi (test edilebilir + regresyon kilidi). "kod adı"/"proje adı" gibi
|
|
1283
|
+
// masum tamlamalari artik yanlis yakalamiyor; deger orijinal case'de kalir.
|
|
1284
|
+
for (const pf of extractPreferenceFacts(msg.content)) {
|
|
1285
|
+
if (!(memory.facts || []).some(f => (f.value || '').toLowerCase() === pf.value.toLowerCase())) {
|
|
1286
|
+
newFacts.push({ value: pf.value, score: 6, category: pf.category, createdAt: new Date().toISOString() });
|
|
1269
1287
|
}
|
|
1270
1288
|
}
|
|
1271
1289
|
}
|
|
@@ -1285,11 +1303,13 @@ async function startRepl(args) {
|
|
|
1285
1303
|
factsAdded = uniqueFacts.length;
|
|
1286
1304
|
}
|
|
1287
1305
|
|
|
1288
|
-
// Decay (eski
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1306
|
+
// Decay: soft-cap. v5.40: memory_write ile UYUMLU (eski 15 sert limiti yeni
|
|
1307
|
+
// fact'leri sessizce kesiyordu — recall kaybina yol aciyordu). 50 = MAX_FACTS.
|
|
1308
|
+
const CAP = (() => { const r = parseInt(process.env.NATURECO_MAX_FACTS || '', 10); return Number.isFinite(r) && r > 0 ? r : 50; })();
|
|
1309
|
+
if (memory.facts && memory.facts.length > CAP) {
|
|
1310
|
+
// En yuksek skor + en yeni once; dusukleri sil.
|
|
1311
|
+
memory.facts.sort((a, b) => ((b.score || 5) - (a.score || 5)) || String(b.updatedAt || b.createdAt || '').localeCompare(String(a.updatedAt || a.createdAt || '')));
|
|
1312
|
+
memory.facts = memory.facts.slice(0, CAP);
|
|
1293
1313
|
}
|
|
1294
1314
|
} catch (e) {
|
|
1295
1315
|
// Sessizce devam et, kritik degil
|
|
@@ -1643,3 +1663,5 @@ async function startRepl(args) {
|
|
|
1643
1663
|
}
|
|
1644
1664
|
|
|
1645
1665
|
module.exports = startRepl;
|
|
1666
|
+
// v5.40: test icin — cross-session hafiza bozulma regresyonu (kod adı ≠ kullanici adi)
|
|
1667
|
+
module.exports.extractPreferenceFacts = extractPreferenceFacts;
|
package/src/tools/workflow.js
CHANGED
|
@@ -61,12 +61,18 @@ function loadUserMemory(username) {
|
|
|
61
61
|
const key = v.trim().toLowerCase();
|
|
62
62
|
if (!key || seen.has(key)) continue;
|
|
63
63
|
seen.add(key);
|
|
64
|
-
|
|
64
|
+
// v5.40: skor + tarih koru — sysMsg'e EN GUNCEL/ONEMLI fact'ler girsin.
|
|
65
|
+
// Eski hali dosya sirasiyla ilk 15'i aliyordu → cok fact olunca en YENI
|
|
66
|
+
// kayit (or. yeni ogrenilen kod adi) kesiliyor, recall basarisiz oluyordu.
|
|
67
|
+
facts.push({ v: v.trim(), score: (f && typeof f.score === 'number') ? f.score : 0, t: (f && (f.updatedAt || f.createdAt)) || '' });
|
|
65
68
|
}
|
|
66
69
|
}
|
|
70
|
+
// v5.40: yuksek skor + en yeni once
|
|
71
|
+
facts.sort((a, b) => (b.score - a.score) || String(b.t).localeCompare(String(a.t)));
|
|
72
|
+
const factVals = facts.map(f => f.v);
|
|
67
73
|
// isim memory.name'de yoksa fact'lerden cikar
|
|
68
74
|
if (!name) {
|
|
69
|
-
for (const f of
|
|
75
|
+
for (const f of factVals) {
|
|
70
76
|
const match = f.toLowerCase().match(/(?:kullanici\s*adi?|kullanıcı\s*adı?|isim|name)\s*:?\s*(.+)/);
|
|
71
77
|
if (match && match[1].trim().length > 2) { name = match[1].trim(); break; }
|
|
72
78
|
}
|
|
@@ -74,7 +80,7 @@ function loadUserMemory(username) {
|
|
|
74
80
|
const parts = [];
|
|
75
81
|
if (name) parts.push(`Kullanici adi: ${name}`);
|
|
76
82
|
if (botName) parts.push(`Bot adi: ${botName}`);
|
|
77
|
-
if (
|
|
83
|
+
if (factVals.length > 0) parts.push(`Bilinenler: ${factVals.slice(0, 25).join('; ')}`);
|
|
78
84
|
return parts.join('\n');
|
|
79
85
|
} catch {}
|
|
80
86
|
return '';
|
|
@@ -273,6 +279,7 @@ async function workflow(params) {
|
|
|
273
279
|
'- memory_tree: AGAC-HAFIZA — zengin/kategorize kalici bilgi (proje, karar, teknik not, kisisel detay). action: index|read|search|append; username="' + memUser + '"; append icin: root (1-kisisel|2-teknik|3-kararlar) + branch (dal basligi) + content (yaprak). YENI oturumda hatirlanir.',
|
|
274
280
|
'\nKurallar:',
|
|
275
281
|
'- Kullanici kalici bilgi paylasirsa (isim, tercih, parola, proje, karar, onemli detay) ya da "hatirla / not al / kaydet" derse HEMEN KAYDET (username="' + memUser + '"): kisa tek bilgi → memory_write; zengin/kategorize bilgi → memory_tree(append, dogru root/branch). Trivial/gecici seyleri kaydetme.',
|
|
282
|
+
'- KAYIT KALITESI (onemli): fact\'i kullanicinin SOYLEDIGI ANLAMI ve SPESIFIK DEGERLERI koruyarak yaz. Kod/isim/sayi/tarih/parola gibi degerleri AYNEN gecir (or. "gizli kod adi ONYX-7" → fact: "Projenin gizli kod adi ONYX-7" — "ONYX-7"yi "onyx" yapma, kisaltma). Neyin ne oldugunu DOGRU etiketle: proje kod adi ≠ kullanici adi, sifre ≠ isim. Yanlis ozetleme yeni oturumda yanlis hatirlamaya yol acar.',
|
|
276
283
|
'- Kullaniciya ozel bir sey sorulunca (gecmis, proje, tercih, karar) once memory_tree(search/read) ile ilgili kok/dali OKU (hedefli, tum hafizayi degil). Tek primary: bilgi tek yerde yasar; digerine sadece "bkz:". Credential/secret ASLA duz metin.',
|
|
277
284
|
'- Bir is YARIM kalirsa ya da kullanici "sonra / yarin / daha sonra yapalim" derse memory_tree(action:append, root:"3-kararlar", branch:"Bekleyen İşler", content:"...") ile kaydet — yeni oturum basinda otomatik hatirlatilir. Bir bekleyen is TAMAMLANINCA memory_tree(action:remove, root:"3-kararlar", query:"<anahtar kelime>") ile kaldir.',
|
|
278
285
|
'- Guncel/internet bilgisi gerektiren bir soru gelirse ONCE duckduckgo_search ile ara ("internet erisimim yok" DEME — bu arac her zaman calisir, API key gerekmez).',
|