natureco-cli 5.32.0 → 5.34.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 CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to NatureCo CLI will be documented in this file.
4
4
 
5
+ ## [5.34.0] - 2026-07-05 — "CRON DÜZELTMESİ (sahte-başarı önlendi + daemon dürüstlüğü)"
6
+
7
+ ### 🐛 Düzeltme (kullanıcının "cron gorevleri olusturup uygulayabiliyor mu" sorusu üzerine bulundu)
8
+ - **`cron_create` agentic allowlist'te HİÇ YOKTU** — modele hic tanitilmamisti. Ajan "her gun X yap" gibi istekte zorunlu olarak `bash` ile native OS scheduling'e (Windows: schtasks/Register-ScheduledTask, macOS: crontab) yoneliyordu — tutarsiz (natureco cron list'te gorunmez) ve bazen basarisiz komuttan sonra SAHTE BASARI iddia ediyordu. Artik `cron_create` allowlist'te + sistem promptunda taniml.
9
+ - **Daemon gerekliligi dürüstçe soyleniyor**: cron_create sonrasi olusan gorevin FIILEN tetiklenmesi icin arka plan servisinin (`natureco daemon start/install`) calisiyor olmasi gerekir — bu adim atlanirsa gorev sadece database'e (crons.json) kaydedilir, calismaz. Ajan artik bunu acikca soyluyor, kesin basari iddia etmiyor.
10
+ - Regresyon kilidi: DEFAULT_ALLOWED icinde cron_create + temel arac testleri (2 yeni test).
11
+
12
+ ### 🔍 Sistematik denetim (kullanicinin "tüm özellikleri tek tek test et" talebiyle)
13
+ 90 arac dosyasi yuklendi (89/90 execute'a sahip, 1 yardimci modul); 11 yerel arac fiilen calistirildi (10/11 basarili, macos_screenshot dogru sekilde "sadece macOS" dedi); 23 CLI komutu calistirildi (22/23 basarili, 1 yanlis alt-komut adi = false positive).
14
+
15
+ Doğrulama: cron_create E2E (crons.json'a doğru yazıldı, schedule doğru, daemon uyarısı görüldü); **500+ test yeşil**, ESLint temiz.
16
+
17
+ ## [5.33.0] - 2026-07-04 — "OTURUM-BAŞI BEKLEYEN-İŞ HATIRLATMASI (Theseus deseni)"
18
+
19
+ ### ✨ Yeni (Hafıza)
20
+ - **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.
21
+ - memory_tree yeni action: `remove` (tamamlanan yapragi sil).
22
+
23
+ Doğrulama: gercek PTY oturumunda startup'ta "📌 Geçen oturumdan kalanlar" + bekleyen is gorundu; +2 test (getPending/remove); **500 test yeşil**, ESLint temiz.
24
+
5
25
  ## [5.32.0] - 2026-07-04 — "AĞAÇ-HAFIZA + OTURUMLAR ARASI KALICILIK (Theseus mimarisi)"
6
26
 
7
27
  ### ✨ Yeni (Hafıza)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "5.32.0",
3
+ "version": "5.34.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"
@@ -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);
@@ -21,7 +21,7 @@ const os = require('os');
21
21
  // icinde approvals politikasini uyguluyor (isSafeCommand → direkt; tehlikeli → red;
22
22
  // digerleri → allowlist/full moda gore). Yani keyfi/yikici komut calismaz.
23
23
  // Diger ~85 arac (discord, telegram, cron, browser...) bilerek DISARIDA.
24
- const DEFAULT_ALLOWED = ['write_file', 'read_file', 'edit_file', 'skill_view', 'bash', 'file_search', 'list_dir', 'memory_write', 'memory_tree'];
24
+ const DEFAULT_ALLOWED = ['write_file', 'read_file', 'edit_file', 'skill_view', 'bash', 'file_search', 'list_dir', 'memory_write', 'memory_tree', 'cron_create'];
25
25
 
26
26
  const TOOL_ALIASES = {
27
27
  write_file: 'write_file', create_file: 'write_file', writefile: 'write_file', write: 'write_file', create: 'write_file', save_file: 'write_file', new_file: 'write_file',
@@ -33,6 +33,7 @@ const TOOL_ALIASES = {
33
33
  list_dir: 'list_dir', ls: 'list_dir', dir: 'list_dir', list_directory: 'list_dir', filesystem: 'list_dir',
34
34
  memory_write: 'memory_write', remember: 'memory_write', save_memory: 'memory_write', memorize: 'memory_write', memory_save: 'memory_write', save_fact: 'memory_write',
35
35
  memory_tree: 'memory_tree', tree_memory: 'memory_tree', memory: 'memory_tree', hafiza: 'memory_tree',
36
+ cron_create: 'cron_create', cron: 'cron_create', schedule_task: 'cron_create', create_cron: 'cron_create',
36
37
  };
37
38
 
38
39
  function expandHome(p) {
@@ -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
- return { success: false, error: 'bilinmeyen action: ' + p.action + ' (index|read|search|append)' };
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
  };
@@ -257,11 +257,14 @@ async function workflow(params) {
257
257
  '- list_dir: dizin icerigini listele. parametre: path',
258
258
  '- bash: kabuk komutu calistir (npm, git, node, python, test, ls, grep/findstr, mkdir...). parametre: command. Guvenli komutlar dogrudan calisir; yikici/tehlikeli komutlar guvenlik politikasiyla engellenir. Icerik aramasi icin grep/findstr kullan.',
259
259
  '- skill_view: gorevle ilgili bir skill yukle. parametre: name',
260
+ '- cron_create: zamanlanmis/periyodik gorev (cron) olustur. parametreler: name, schedule (cron ifadesi orn. "0 9 * * *" ya da "every day 9am" gibi preset), command, description.',
260
261
  '- memory_write: HIZLI tek bilgi kaydet (isim, kisa tercih). parametreler: username ("' + memUser + '"), fact, category. YENI oturumda hatirlanir.',
261
262
  '- 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.',
262
263
  '\nKurallar:',
263
264
  '- 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
265
  '- 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.',
266
+ '- 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.',
267
+ '- Zamanlanmis/periyodik/tekrarlayan gorev (cron, "her gun/hafta X yap", hatirlatici) istenirse SADECE cron_create arac ini kullan; bash ile crontab/schtasks/Register-ScheduledTask DUZENLEME (tutarsiz olur, "natureco cron list" ile gorunmez). cron_create sonrasi kullaniciya ACIKCA soyle: gorevin fiilen tetiklenmesi icin arka plan servisinin calisiyor olmasi gerekir ("natureco daemon start" ya da "natureco daemon install"); bu adim atlanirsa gorev database\'e kaydedilir ama calismaz. Bunu SOYLEMEDEN "olusturuldu, calisacak" gibi kesin basari iddia etme.',
265
268
  '- MEVCUT bir dosyayi degistirmeden ONCE read_file ile oku; sonra edit_file ile hedefli degisiklik yap (tum dosyayi write_file ile ezme).',
266
269
  '- Bir seyi nerede oldugunu bilmiyorsan once file_search/list_dir/bash(grep) ile kesfet.',
267
270
  '- Kod yazdiktan/degistirdikten sonra gerektiginde bash ile calistir/test et (orn. "node dosya.js", "npm test"); hata cikarsa duzelt.',