toon-memory 1.6.7 → 1.6.8
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/mcp/server.js +7 -13
- package/package.json +1 -1
- package/src/mcp/server.ts +7 -11
package/mcp/server.js
CHANGED
|
@@ -27718,11 +27718,11 @@ function readMemory() {
|
|
|
27718
27718
|
const data = readFileSync(MEMORY_FILE, "utf-8");
|
|
27719
27719
|
if (config2.encrypted) {
|
|
27720
27720
|
const key = readEnvKey();
|
|
27721
|
-
if (!key) return
|
|
27721
|
+
if (!key) return "";
|
|
27722
27722
|
try {
|
|
27723
27723
|
return decrypt(data, key);
|
|
27724
27724
|
} catch {
|
|
27725
|
-
return
|
|
27725
|
+
return "";
|
|
27726
27726
|
}
|
|
27727
27727
|
}
|
|
27728
27728
|
return data;
|
|
@@ -27732,11 +27732,10 @@ function writeMemory(content) {
|
|
|
27732
27732
|
const config2 = loadConfig();
|
|
27733
27733
|
if (config2.encrypted) {
|
|
27734
27734
|
const key = readEnvKey();
|
|
27735
|
-
if (key)
|
|
27736
|
-
|
|
27737
|
-
|
|
27738
|
-
|
|
27739
|
-
}
|
|
27735
|
+
if (!key) return;
|
|
27736
|
+
const encrypted = encrypt(content, key);
|
|
27737
|
+
writeFileSync(MEMORY_FILE, encrypted);
|
|
27738
|
+
return;
|
|
27740
27739
|
}
|
|
27741
27740
|
writeFileSync(MEMORY_FILE, content);
|
|
27742
27741
|
}
|
|
@@ -28046,12 +28045,7 @@ server.registerTool(
|
|
|
28046
28045
|
saveConfig({ encrypted: true });
|
|
28047
28046
|
writeEnvKey(key);
|
|
28048
28047
|
return {
|
|
28049
|
-
content: [{
|
|
28050
|
-
type: "text",
|
|
28051
|
-
text: `\u{1F510} Encriptaci\xF3n habilitada
|
|
28052
|
-
\u26A0\uFE0F Guarda esta clave (no se puede recuperar):
|
|
28053
|
-
${key}`
|
|
28054
|
-
}]
|
|
28048
|
+
content: [{ type: "text", text: "\u{1F510} Encriptaci\xF3n habilitada" }]
|
|
28055
28049
|
};
|
|
28056
28050
|
}
|
|
28057
28051
|
);
|
package/package.json
CHANGED
package/src/mcp/server.ts
CHANGED
|
@@ -186,11 +186,11 @@ function readMemory(): string {
|
|
|
186
186
|
|
|
187
187
|
if (config.encrypted) {
|
|
188
188
|
const key = readEnvKey()
|
|
189
|
-
if (!key) return
|
|
189
|
+
if (!key) return ""
|
|
190
190
|
try {
|
|
191
191
|
return decrypt(data, key)
|
|
192
192
|
} catch {
|
|
193
|
-
return
|
|
193
|
+
return ""
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -209,11 +209,10 @@ function writeMemory(content: string): void {
|
|
|
209
209
|
|
|
210
210
|
if (config.encrypted) {
|
|
211
211
|
const key = readEnvKey()
|
|
212
|
-
if (key)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
212
|
+
if (!key) return
|
|
213
|
+
const encrypted = encrypt(content, key)
|
|
214
|
+
writeFileSync(MEMORY_FILE, encrypted)
|
|
215
|
+
return
|
|
217
216
|
}
|
|
218
217
|
|
|
219
218
|
writeFileSync(MEMORY_FILE, content)
|
|
@@ -687,10 +686,7 @@ server.registerTool(
|
|
|
687
686
|
writeEnvKey(key)
|
|
688
687
|
|
|
689
688
|
return {
|
|
690
|
-
content: [{
|
|
691
|
-
type: "text" as const,
|
|
692
|
-
text: `🔐 Encriptación habilitada\n⚠️ Guarda esta clave (no se puede recuperar):\n${key}`
|
|
693
|
-
}],
|
|
689
|
+
content: [{ type: "text" as const, text: "🔐 Encriptación habilitada" }],
|
|
694
690
|
}
|
|
695
691
|
}
|
|
696
692
|
)
|