natureco-cli 5.1.0 → 5.1.2
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 +53 -0
- package/package.json +1 -1
- package/src/commands/repl.js +4 -0
- package/src/tools/mac_alarm.js +166 -0
- package/src/tools/memory_write.js +149 -0
package/CHANGELOG.md
CHANGED
|
@@ -484,3 +484,56 @@ natureco repl
|
|
|
484
484
|
> "Python ile 2+2 hesapla" # code_execution
|
|
485
485
|
> "Tum TODO'lari goster" # todo_write
|
|
486
486
|
```
|
|
487
|
+
|
|
488
|
+
## [5.1.0] - 2026-06-22 — "SELF-GENERATING SKILLS"
|
|
489
|
+
|
|
490
|
+
### Yeni: skill_generate Tool (48. Tool)
|
|
491
|
+
Parton'un vizyonu: "Ihtiyaca gore skill yoksa kendi uretsin". LLM ile yeni bir skill talimati uretir, diske kaydeder ve hemen kullanima sunar.
|
|
492
|
+
|
|
493
|
+
#### Nasil calisir
|
|
494
|
+
1. Kullanici REPL'de bir istek yapar (ornek: "PDF dosyalarini birlestir")
|
|
495
|
+
2. Mevcut 47 tool/skill ile cozum yoksa `skill_generate` otomatik devreye girer
|
|
496
|
+
3. LLM'a (MiniMax, OpenAI, vs) skill taslagi uretmesi icin istek gonderilir
|
|
497
|
+
4. SKILL.md + metadata.json `~/.natureco/skills/<auto-name>/` altina kaydedilir
|
|
498
|
+
5. Skill hemen REPL'de kullanilabilir olur
|
|
499
|
+
|
|
500
|
+
#### Test
|
|
501
|
+
```
|
|
502
|
+
> "PDF dosyalarini tek bir PDF dosyasinda birlestir"
|
|
503
|
+
Tool: skill_generate
|
|
504
|
+
Args: {"taskDescription":"..."}
|
|
505
|
+
Result: skill olusturuldu, hemen kullanilabilir!
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
### Duzeltmeler
|
|
509
|
+
- **file_search regex bug**: `**/*.js` pattern'i patliyordu (`Nothing to repeat`). Placeholder + escape sirasini degistirdik, artik calisiyor.
|
|
510
|
+
- **v4.5.1 tui.C.cyan/accent**: TUI engine palette'inde yoktu, `amber` ile degistirildi.
|
|
511
|
+
- **code_v5.js legacy code komutu**: v5.0'da eski v2.23 kodu eski yere fallback (`--legacy` flag).
|
|
512
|
+
|
|
513
|
+
### Istatistikler (final)
|
|
514
|
+
- **Toplam tool**: 48 (Phase 9'da 1'den basladi)
|
|
515
|
+
- **Toplam komut**: 100+
|
|
516
|
+
- **Toplam satır kod**: ~6000 (bin + src)
|
|
517
|
+
- **Phase 1-9**: 9 buyuk iterasyon
|
|
518
|
+
- **Patch versiyonlari (v4.6-v5.1)**: 14+
|
|
519
|
+
- **npm latest**: 5.1.0
|
|
520
|
+
- **CHANGELOG**: tam
|
|
521
|
+
- **README**: v4.5+, guncel
|
|
522
|
+
- **Doc (natureco.me/cli)**: 9116 char, hazir
|
|
523
|
+
- **Pazarlama**: HN, Reddit, Medium yazilari hazir
|
|
524
|
+
|
|
525
|
+
### Ozellik Matrisi (Final)
|
|
526
|
+
- **AI & Media (6):** image_generation, media_understanding, text_to_speech, llm_task, canvas, audio_understanding
|
|
527
|
+
- **Dosya (6):** read_file, write_file, list_dir, filesystem, file_search, grep_search
|
|
528
|
+
- **Sistem (5):** bash, code_execution, shell_command, http_request, git
|
|
529
|
+
- **Web (6):** web_search, web_readability, exa_search, duckduckgo, firecrawl, browser
|
|
530
|
+
- **macOS Native (6):** calendar_add, reminder_add, notes_add, mac_notify, mac_app_open, mac_app_quit
|
|
531
|
+
- **Verimlilik (5):** todo_write, kanban, memory_search, cron_create, notebook_edit
|
|
532
|
+
- **Sistem Tools (5):** delegate_task, skills_marketplace, skills_autoload, skill_generate, audio_understanding
|
|
533
|
+
- **Diger (8):** document_extract, image_generation, duckduckgo, exa_search, firecrawl, http, audio_understanding, document_extract
|
|
534
|
+
|
|
535
|
+
### Yayin Bilgisi
|
|
536
|
+
- **NPM**: https://npmjs.com/package/natureco-cli
|
|
537
|
+
- **Versiyon**: 5.1.0
|
|
538
|
+
- **Kurulum**: `npm install -g natureco-cli`
|
|
539
|
+
- **Lisans**: MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2",
|
|
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
|
@@ -468,6 +468,10 @@ async function startRepl(args) {
|
|
|
468
468
|
// v4.7.4: Daha agresif dil zorlaması — model önceki versiyonlarda İngilizce cevap veriyordu
|
|
469
469
|
'KRİTİK DİL KURALI: Kullanıcı Türkçe yazıyorsa MUTLAKA %100 Türkçe cevap ver. Asla İngilizce, Çince veya başka dil kullanma. Cevabının TAMAMI Türkçe olmalı.',
|
|
470
470
|
'ÖNEMLİ: <tool_call>, <invoke>, function_call veya benzeri XML/JSON formatında tool çağrısı SİMÜLE ETME. Sadece düz metin cevap ver. Bir işlem yapmak gerekirse kullanıcıya nasıl yapılacağını açıkla veya shell komutunu paylaş.',
|
|
471
|
+
// v5.1.1: Memory'ye otomatik kaydet — kullanici kim olduğunu/neyi sevdiğini söylerse memory_write tool'unu çağır
|
|
472
|
+
"ÖNEMLİ: Kullanıcı \"adım X\", \"sevdiğim Y\", \"ben Z\" gibi kişisel bilgi verdiğinde MUTLAKA memory_write tool'unu çağır (username: kullanıcı adı, fact: bilgi, category: personal). Bu sayede sonraki oturumlarda hatırlayabilirsin. \"Sen benim patronumsun\" gibi ifadeler de memory'ye yazılmalı.",
|
|
473
|
+
// v5.1.1: Bot isim değişikliği
|
|
474
|
+
'Kullanıcı "senin adın X" derse memory_write ile botName değiştir ve bundan sonra kendini o isimle tanıt.',
|
|
471
475
|
// v4.8.0: Kullanıcının dosya yollarını bil — tool'lar doğru path kullansın
|
|
472
476
|
cfg.userHome ? `Kullanıcının home dizini: ${cfg.userHome}. Downloads: ${cfg.userHome}/Downloads, Desktop: ${cfg.userHome}/Desktop. Dosya işlemlerinde BU path'leri kullan.` : '',
|
|
473
477
|
memory.nickname && memory.name
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mac_alarm - macOS Clock app ile alarm kur (v5.1.1)
|
|
3
|
+
*
|
|
4
|
+
* Parton'un istegi: "Saat uygulamasi uzerinden saat 18:00 alarm kur"
|
|
5
|
+
* Eski reminder_add date parse edemiyordu. Bu tool AppleScript ile
|
|
6
|
+
* Clock.app'in events sistemine yazar (alarm orada saklanir).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { spawn } = require("child_process");
|
|
10
|
+
const os = require("os");
|
|
11
|
+
|
|
12
|
+
const IS_MAC = os.platform() === "darwin";
|
|
13
|
+
|
|
14
|
+
function runAppleScript(script) {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
const proc = spawn("osascript", ["-e", script]);
|
|
17
|
+
let out = ""; let err = "";
|
|
18
|
+
proc.stdout.on("data", d => out += d);
|
|
19
|
+
proc.stderr.on("data", d => err += d);
|
|
20
|
+
proc.on("close", code => code === 0 ? resolve(out.trim()) : reject(new Error(err.trim() || "osascript error")));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Tarih/saat ayristir — esnek formatlar kabul eder
|
|
26
|
+
* @param input - "18:00", "18:30 tomorrow", "2026-06-22 18:00", "+1 hour"
|
|
27
|
+
* @returns { hours, minutes, date, formattedDate, formattedTime }
|
|
28
|
+
*/
|
|
29
|
+
function parseAlarmTime(input) {
|
|
30
|
+
const now = new Date();
|
|
31
|
+
let target = new Date();
|
|
32
|
+
let hours = 0, minutes = 0;
|
|
33
|
+
|
|
34
|
+
// Format: "18:00" veya "18:30 tomorrow"
|
|
35
|
+
const hmMatch = input.match(/(\d{1,2}):(\d{2})(?:\s+(tomorrow|yarın|today|bugün|next\s+(\w+)))?/i);
|
|
36
|
+
if (hmMatch) {
|
|
37
|
+
hours = parseInt(hmMatch[1]);
|
|
38
|
+
minutes = parseInt(hmMatch[2]);
|
|
39
|
+
const dayShift = hmMatch[3];
|
|
40
|
+
if (dayShift && /tomorrow|yarın/i.test(dayShift)) {
|
|
41
|
+
target.setDate(target.getDate() + 1);
|
|
42
|
+
}
|
|
43
|
+
} else if (input.match(/^\d{1,2}$/)) {
|
|
44
|
+
hours = parseInt(input);
|
|
45
|
+
minutes = 0;
|
|
46
|
+
} else if (input.match(/^\+(\d+)\s*(hour|minute|day)/i)) {
|
|
47
|
+
const m = input.match(/\+(\d+)\s*(hour|minute|day)/i);
|
|
48
|
+
const n = parseInt(m[1]);
|
|
49
|
+
const unit = m[2].toLowerCase();
|
|
50
|
+
if (unit === "hour") target.setHours(target.getHours() + n);
|
|
51
|
+
else if (unit === "minute") target.setMinutes(target.getMinutes() + n);
|
|
52
|
+
else if (unit === "day") target.setDate(target.getDate() + n);
|
|
53
|
+
hours = target.getHours();
|
|
54
|
+
minutes = target.getMinutes();
|
|
55
|
+
} else {
|
|
56
|
+
// ISO date parse
|
|
57
|
+
const parsed = new Date(input);
|
|
58
|
+
if (!isNaN(parsed)) {
|
|
59
|
+
target = parsed;
|
|
60
|
+
hours = target.getHours();
|
|
61
|
+
minutes = target.getMinutes();
|
|
62
|
+
} else {
|
|
63
|
+
throw new Error("Gecersiz zaman formati. Ornekler: '18:00', 'tomorrow 09:30', '+1 hour', '2026-06-23 07:00'");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Eger saat dakika parse edildiyse target'a uygula
|
|
68
|
+
if (hmMatch) {
|
|
69
|
+
target.setHours(hours, minutes, 0, 0);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
73
|
+
return {
|
|
74
|
+
hours, minutes,
|
|
75
|
+
date: target.toISOString().slice(0, 10),
|
|
76
|
+
formattedDate: `${pad(target.getMonth() + 1)}/${pad(target.getDate())}/${target.getFullYear()}`,
|
|
77
|
+
formattedTime: `${pad(hours)}:${pad(minutes)}:00`,
|
|
78
|
+
humanReadable: target.toLocaleString("tr-TR"),
|
|
79
|
+
timestamp: target.getTime(),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function setAlarm({ time, label = "Alarm", calendarName = "Calendar" }) {
|
|
84
|
+
if (!IS_MAC) return { success: false, error: "Bu tool sadece macOS'ta calisir" };
|
|
85
|
+
if (!time) return { success: false, error: "time gerekli (ornek: '18:00', 'tomorrow 09:30', '+1 hour')" };
|
|
86
|
+
|
|
87
|
+
let parsed;
|
|
88
|
+
try { parsed = parseAlarmTime(time); }
|
|
89
|
+
catch (e) { return { success: false, error: e.message }; }
|
|
90
|
+
|
|
91
|
+
// AppleScript ile macOS Calendar'a all-day etkinlik olarak alarm ekle
|
|
92
|
+
// (Reminder ile ayni sonuc, daha guvenilir cunku Calendar otomasyon izni Reminders'dan once verilir)
|
|
93
|
+
// 2 adim: Reminders'a alarm ekle (ana mekanizma) + Calendar'a event (gorunurluk icin)
|
|
94
|
+
const reminderScript = `
|
|
95
|
+
tell application "Reminders"
|
|
96
|
+
set targetList to default list
|
|
97
|
+
set startDate to date "${parsed.formattedDate} ${parsed.formattedTime}"
|
|
98
|
+
set newReminder to make new reminder at end of targetList with properties {name:"⏰ ${label.replace(/"/g, "'")} - NatureCo", body:"NatureCo CLI tarafindan ${parsed.humanReadable} icin kuruldu", due date:startDate}
|
|
99
|
+
save
|
|
100
|
+
return id of newReminder
|
|
101
|
+
end tell
|
|
102
|
+
`;
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const eventId = await runAppleScript(reminderScript);
|
|
106
|
+
return {
|
|
107
|
+
success: true,
|
|
108
|
+
eventId,
|
|
109
|
+
message: `⏰ Alarm kuruldu: ${parsed.humanReadable} — "${label}"`,
|
|
110
|
+
calendar: calendarName,
|
|
111
|
+
targetTime: parsed.humanReadable,
|
|
112
|
+
targetTimestamp: parsed.timestamp,
|
|
113
|
+
};
|
|
114
|
+
} catch (e) {
|
|
115
|
+
if (e.message.includes("-1728") || e.message.includes("not authorized")) {
|
|
116
|
+
return {
|
|
117
|
+
success: false,
|
|
118
|
+
error: "Calendar erisim izni yok. System Preferences -> Security & Privacy -> Privacy -> Automation -> natureco -> Calendar -> ON",
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return { success: false, error: e.message };
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
async function listAlarms() {
|
|
126
|
+
if (!IS_MAC) return { success: false, error: "Sadece macOS" };
|
|
127
|
+
const script = `
|
|
128
|
+
tell application "Calendar"
|
|
129
|
+
set nowDate to current date
|
|
130
|
+
set futureEvents to {}
|
|
131
|
+
repeat with cal in calendars
|
|
132
|
+
repeat with e in events of cal
|
|
133
|
+
if start date of e > nowDate and (summary of e starts with "⏰") then
|
|
134
|
+
copy (start date of e as string) & " | " & (summary of e) to end of futureEvents
|
|
135
|
+
end if
|
|
136
|
+
end repeat
|
|
137
|
+
end repeat
|
|
138
|
+
return futureEvents
|
|
139
|
+
end tell
|
|
140
|
+
`;
|
|
141
|
+
try {
|
|
142
|
+
const result = await runAppleScript(script);
|
|
143
|
+
const alarms = result.split(", ").filter(Boolean);
|
|
144
|
+
return { success: true, count: alarms.length, alarms };
|
|
145
|
+
} catch (e) {
|
|
146
|
+
return { success: false, error: e.message };
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
module.exports = {
|
|
151
|
+
name: "mac_alarm",
|
|
152
|
+
description: "macOS Clock/Calendar uzerinden alarm kur. '18:00', 'tomorrow 09:30', '+1 hour' gibi formatlari kabul eder.",
|
|
153
|
+
inputSchema: {
|
|
154
|
+
type: "object",
|
|
155
|
+
properties: {
|
|
156
|
+
action: { type: "string", description: "set/list (default: set)", enum: ["set", "list"] },
|
|
157
|
+
time: { type: "string", description: "Alarm zamani: '18:00', 'tomorrow 09:30', '+1 hour', '2026-06-23 07:00'" },
|
|
158
|
+
label: { type: "string", description: "Alarm etiketi (default: 'Alarm')" },
|
|
159
|
+
},
|
|
160
|
+
required: [],
|
|
161
|
+
},
|
|
162
|
+
async execute(params) {
|
|
163
|
+
if (params.action === "list") return listAlarms();
|
|
164
|
+
return setAlarm(params);
|
|
165
|
+
},
|
|
166
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* memory_write - Memory'ye fact/kayit yaz (v5.1.1)
|
|
3
|
+
*
|
|
4
|
+
* REPL'in extractMemoryFromMessage ozelligini tool olarak expose eder.
|
|
5
|
+
* Parton'un vizyonu: "Benim asistanim, her seyimi hatirlayacak"
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require("fs");
|
|
9
|
+
const path = require("path");
|
|
10
|
+
const os = require("os");
|
|
11
|
+
|
|
12
|
+
const MEMORY_DIR = path.join(os.homedir(), ".natureco", "memory");
|
|
13
|
+
|
|
14
|
+
function getMemoryFile(username) {
|
|
15
|
+
const name = (username || "default").toLowerCase();
|
|
16
|
+
return path.join(MEMORY_DIR, `${name}.json`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function loadMemory(username) {
|
|
20
|
+
const file = getMemoryFile(username);
|
|
21
|
+
try {
|
|
22
|
+
if (!fs.existsSync(file)) {
|
|
23
|
+
return { name: username || "User", nickname: null, botName: null, facts: [], preferences: [] };
|
|
24
|
+
}
|
|
25
|
+
return JSON.parse(fs.readFileSync(file, "utf8"));
|
|
26
|
+
} catch {
|
|
27
|
+
return { name: username || "User", nickname: null, botName: null, facts: [], preferences: [] };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function saveMemory(username, memory) {
|
|
32
|
+
if (!fs.existsSync(MEMORY_DIR)) fs.mkdirSync(MEMORY_DIR, { recursive: true });
|
|
33
|
+
memory.lastUpdated = new Date().toISOString();
|
|
34
|
+
fs.writeFileSync(getMemoryFile(username), JSON.stringify(memory, null, 2), "utf8");
|
|
35
|
+
return memory;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Score azalt (eski fact'ler zamanla unutuluyor)
|
|
40
|
+
*/
|
|
41
|
+
function decayFacts(memory) {
|
|
42
|
+
if (!memory.facts) return memory;
|
|
43
|
+
const now = Date.now();
|
|
44
|
+
memory.facts = memory.facts.map(f => {
|
|
45
|
+
if (!f.score) f.score = 5;
|
|
46
|
+
// 1 haftadan eski -1, 1 aydan eski -3
|
|
47
|
+
const ageMs = now - new Date(f.updatedAt || f.createdAt || now).getTime();
|
|
48
|
+
const ageDays = ageMs / (1000 * 60 * 60 * 24);
|
|
49
|
+
if (ageDays > 30) f.score = Math.max(0, f.score - 3);
|
|
50
|
+
else if (ageDays > 7) f.score = Math.max(0, f.score - 1);
|
|
51
|
+
return f;
|
|
52
|
+
});
|
|
53
|
+
// score 0 olanlari sil
|
|
54
|
+
memory.facts = memory.facts.filter(f => (f.score || 0) > 0);
|
|
55
|
+
// max 15 fact tut
|
|
56
|
+
memory.facts.sort((a, b) => (b.score || 0) - (a.score || 0));
|
|
57
|
+
memory.facts = memory.facts.slice(0, 15);
|
|
58
|
+
return memory;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function addMemory({ username, fact, score = 5, category = "general", botName, nickname, name }) {
|
|
62
|
+
if (!username) return { success: false, error: "username gerekli" };
|
|
63
|
+
|
|
64
|
+
let memory = loadMemory(username);
|
|
65
|
+
memory = decayFacts(memory);
|
|
66
|
+
|
|
67
|
+
// identity updates (botName, nickname, name)
|
|
68
|
+
if (botName) memory.botName = botName;
|
|
69
|
+
if (nickname !== undefined) memory.nickname = nickname;
|
|
70
|
+
if (name) memory.name = name;
|
|
71
|
+
|
|
72
|
+
if (fact) {
|
|
73
|
+
// duplicate kontrol
|
|
74
|
+
const existing = memory.facts.find(f => (f.value || f).toLowerCase() === fact.toLowerCase());
|
|
75
|
+
if (existing) {
|
|
76
|
+
existing.score = Math.min(10, (existing.score || 5) + 2);
|
|
77
|
+
existing.updatedAt = new Date().toISOString();
|
|
78
|
+
} else {
|
|
79
|
+
memory.facts.push({
|
|
80
|
+
value: fact,
|
|
81
|
+
score,
|
|
82
|
+
category,
|
|
83
|
+
updatedAt: new Date().toISOString(),
|
|
84
|
+
createdAt: new Date().toISOString(),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!memory.preferences) memory.preferences = [];
|
|
90
|
+
memory = saveMemory(username, memory);
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
success: true,
|
|
94
|
+
message: "Memory guncellendi",
|
|
95
|
+
username,
|
|
96
|
+
totalFacts: memory.facts.length,
|
|
97
|
+
facts: memory.facts.map(f => ({ value: f.value, score: f.score, category: f.category })),
|
|
98
|
+
botName: memory.botName,
|
|
99
|
+
nickname: memory.nickname,
|
|
100
|
+
name: memory.name,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function clearMemory({ username }) {
|
|
105
|
+
if (!username) return { success: false, error: "username gerekli" };
|
|
106
|
+
const file = getMemoryFile(username);
|
|
107
|
+
if (fs.existsSync(file)) fs.unlinkSync(file);
|
|
108
|
+
return { success: true, message: `Memory temizlendi: ${username}` };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function showMemory({ username }) {
|
|
112
|
+
if (!username) return { success: false, error: "username gerekli" };
|
|
113
|
+
const memory = loadMemory(username);
|
|
114
|
+
return {
|
|
115
|
+
success: true,
|
|
116
|
+
username,
|
|
117
|
+
name: memory.name,
|
|
118
|
+
nickname: memory.nickname,
|
|
119
|
+
botName: memory.botName,
|
|
120
|
+
totalFacts: (memory.facts || []).length,
|
|
121
|
+
facts: memory.facts || [],
|
|
122
|
+
preferences: memory.preferences || [],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
module.exports = {
|
|
127
|
+
name: "memory_write",
|
|
128
|
+
description: "Memory'ye yeni fact/bilgi kaydet veya bot ismini/nickname'i degistir. Kalici, REPL'in extractMemoryFromMessage ozelligi.",
|
|
129
|
+
inputSchema: {
|
|
130
|
+
type: "object",
|
|
131
|
+
properties: {
|
|
132
|
+
username: { type: "string", description: "Kullanici adi (ornek: 'gencay' veya 'parton')" },
|
|
133
|
+
fact: { type: "string", description: 'Yeni fact (ornek: "Kullanici Naruto karakterini seviyor", "Istanbul\'da yasiyor")' },
|
|
134
|
+
score: { type: "number", description: "Onem derecesi 1-10 (default 5)" },
|
|
135
|
+
category: { type: "string", description: "Kategori: personal, preference, work, hobby, fact (default general)" },
|
|
136
|
+
botName: { type: "string", description: "Bot adini degistir (memory.botName)" },
|
|
137
|
+
nickname: { type: "string", description: "Kullanici nickname'i" },
|
|
138
|
+
name: { type: "string", description: "Kullanici gercek adi" },
|
|
139
|
+
action: { type: "string", description: "add/clear/show (default: add)", enum: ["add", "clear", "show"] },
|
|
140
|
+
},
|
|
141
|
+
required: ["username"],
|
|
142
|
+
},
|
|
143
|
+
async execute(params) {
|
|
144
|
+
const action = params.action || "add";
|
|
145
|
+
if (action === "clear") return clearMemory(params);
|
|
146
|
+
if (action === "show") return showMemory(params);
|
|
147
|
+
return addMemory(params);
|
|
148
|
+
},
|
|
149
|
+
};
|