natureco-cli 5.32.0 → 5.33.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 +8 -0
- package/package.json +1 -1
- package/src/commands/repl.js +11 -0
- package/src/tools/memory_tree.js +35 -3
- package/src/tools/workflow.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to NatureCo CLI will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [5.33.0] - 2026-07-04 — "OTURUM-BAŞI BEKLEYEN-İŞ HATIRLATMASI (Theseus deseni)"
|
|
6
|
+
|
|
7
|
+
### ✨ Yeni (Hafıza)
|
|
8
|
+
- **Bekleyen is hatirlatmasi**: her yeni oturum basinda (natureco chat) hafiza agacindaki `3-kararlar / Bekleyen İşler` dali okunur ve "📌 Geçen oturumdan kalanlar: ..." olarak proaktif gosterilir (Theseus'un "gecen sefer su kalmisti" davranisi). Ajan yarim kalan isi / "sonra yapalim" denileni memory_tree ile bu dala yazar; is bitince memory_tree(action:remove) ile kaldirir.
|
|
9
|
+
- memory_tree yeni action: `remove` (tamamlanan yapragi sil).
|
|
10
|
+
|
|
11
|
+
Doğrulama: gercek PTY oturumunda startup'ta "📌 Geçen oturumdan kalanlar" + bekleyen is gorundu; +2 test (getPending/remove); **500 test yeşil**, ESLint temiz.
|
|
12
|
+
|
|
5
13
|
## [5.32.0] - 2026-07-04 — "AĞAÇ-HAFIZA + OTURUMLAR ARASI KALICILIK (Theseus mimarisi)"
|
|
6
14
|
|
|
7
15
|
### ✨ Yeni (Hafıza)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.33.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
|
@@ -1161,6 +1161,17 @@ async function startRepl(args) {
|
|
|
1161
1161
|
console.log(tui.C.brand(' 👋 Ben ' + displayBotName + ', ' + displayUserName + '. Sen nasilsin?'));
|
|
1162
1162
|
console.log('');
|
|
1163
1163
|
|
|
1164
|
+
// Theseus deseni: oturum basinda "geçen sefer kalanlari" proaktif hatirlat
|
|
1165
|
+
// (3-kararlar / "Bekleyen İşler" dali). Ajan yarim isleri buraya memory_tree ile yazar.
|
|
1166
|
+
try {
|
|
1167
|
+
const pending = require('../tools/memory_tree')._internal.getPending(cfg.userName);
|
|
1168
|
+
if (pending && pending.length) {
|
|
1169
|
+
console.log(tui.C.muted(' 📌 Geçen oturumdan kalanlar:'));
|
|
1170
|
+
for (const item of pending.slice(0, 6)) console.log(tui.C.muted(' • ' + item));
|
|
1171
|
+
console.log('');
|
|
1172
|
+
}
|
|
1173
|
+
} catch { /* hafiza yoksa sessiz gec */ }
|
|
1174
|
+
|
|
1164
1175
|
// v5.4.14: SOUL'dan onemli bilgileri de goster
|
|
1165
1176
|
if (soulSummary) {
|
|
1166
1177
|
const soulPreview = soulSummary.split('\n').slice(0, 3).join(' ').substring(0, 200);
|
package/src/tools/memory_tree.js
CHANGED
|
@@ -21,7 +21,7 @@ const os = require('os');
|
|
|
21
21
|
const ROOTS = [
|
|
22
22
|
{ id: '1-kisisel', title: 'Kişisel & Tercihler', branches: ['Kimlik', 'Tercihler', 'İletişim Kalıpları'] },
|
|
23
23
|
{ id: '2-teknik', title: 'Teknik & Projeler', branches: ['Projeler', 'Kurulum & Sistem', 'Teknik Referans'] },
|
|
24
|
-
{ id: '3-kararlar', title: 'Kararlar, Kurallar & Dersler', branches: ['Kararlar', 'Kurallar & Kısıtlar', 'Öğrenilen Dersler', 'Tarihli Olaylar'] },
|
|
24
|
+
{ id: '3-kararlar', title: 'Kararlar, Kurallar & Dersler', branches: ['Bekleyen İşler', 'Kararlar', 'Kurallar & Kısıtlar', 'Öğrenilen Dersler', 'Tarihli Olaylar'] },
|
|
25
25
|
];
|
|
26
26
|
|
|
27
27
|
function treeDir(username) {
|
|
@@ -105,6 +105,35 @@ function search(username, query) {
|
|
|
105
105
|
return hits;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
// Oturum basinda proaktif hatirlatma icin: 3-kararlar / "Bekleyen İşler" dalindaki yapraklar.
|
|
109
|
+
function getPending(username) {
|
|
110
|
+
const txt = readSafe(username, '3-kararlar');
|
|
111
|
+
const out = [];
|
|
112
|
+
let inBranch = false;
|
|
113
|
+
for (const line of txt.split('\n')) {
|
|
114
|
+
if (line.startsWith('## ')) inBranch = /bekleyen/i.test(line);
|
|
115
|
+
else if (inBranch && /^\s*-\s+\S/.test(line)) out.push(line.trim().replace(/^-\s*/, ''));
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Bir yapragi (tamamlanan bekleyen is gibi) kaldir — query iceren "- ..." satirlarini siler.
|
|
121
|
+
function remove(username, root, query) {
|
|
122
|
+
ensureTree(username);
|
|
123
|
+
const r = resolveRoot(root || '3-kararlar');
|
|
124
|
+
const q = String(query || '').toLowerCase().trim();
|
|
125
|
+
if (!q) return { success: false, error: 'query gerekli' };
|
|
126
|
+
const txt = readSafe(username, r.id);
|
|
127
|
+
const kept = [];
|
|
128
|
+
let removed = 0;
|
|
129
|
+
for (const line of txt.split('\n')) {
|
|
130
|
+
if (/^\s*-\s+/.test(line) && line.toLowerCase().includes(q)) { removed++; continue; }
|
|
131
|
+
kept.push(line);
|
|
132
|
+
}
|
|
133
|
+
if (removed) fs.writeFileSync(rootPath(username, r.id), kept.join('\n'), 'utf8');
|
|
134
|
+
return { success: true, removed, root: r.id };
|
|
135
|
+
}
|
|
136
|
+
|
|
108
137
|
function append(username, root, branch, content) {
|
|
109
138
|
ensureTree(username);
|
|
110
139
|
const r = resolveRoot(root);
|
|
@@ -149,8 +178,11 @@ module.exports = {
|
|
|
149
178
|
if (!p.content) return { success: false, error: 'content (yaprak metni) gerekli' };
|
|
150
179
|
return append(u, p.root || '1-kisisel', p.branch || 'Genel', p.content);
|
|
151
180
|
}
|
|
152
|
-
|
|
181
|
+
if (p.action === 'remove' || p.action === 'done') {
|
|
182
|
+
return remove(u, p.root || '3-kararlar', p.query || p.content);
|
|
183
|
+
}
|
|
184
|
+
return { success: false, error: 'bilinmeyen action: ' + p.action + ' (index|read|search|append|remove)' };
|
|
153
185
|
} catch (e) { return { success: false, error: e.message }; }
|
|
154
186
|
},
|
|
155
|
-
_internal: { ensureTree, buildIndex, buildDigest, readRoot, search, append, treeDir, rootPath, ROOTS },
|
|
187
|
+
_internal: { ensureTree, buildIndex, buildDigest, readRoot, search, append, getPending, remove, treeDir, rootPath, ROOTS },
|
|
156
188
|
};
|
package/src/tools/workflow.js
CHANGED
|
@@ -262,6 +262,7 @@ async function workflow(params) {
|
|
|
262
262
|
'\nKurallar:',
|
|
263
263
|
'- 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.',
|
|
264
264
|
'- 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.',
|
|
265
|
+
'- 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.',
|
|
265
266
|
'- MEVCUT bir dosyayi degistirmeden ONCE read_file ile oku; sonra edit_file ile hedefli degisiklik yap (tum dosyayi write_file ile ezme).',
|
|
266
267
|
'- Bir seyi nerede oldugunu bilmiyorsan once file_search/list_dir/bash(grep) ile kesfet.',
|
|
267
268
|
'- Kod yazdiktan/degistirdikten sonra gerektiginde bash ile calistir/test et (orn. "node dosya.js", "npm test"); hata cikarsa duzelt.',
|