mr-memory 2.11.2 → 2.11.3
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/package.json +1 -1
- package/upload.ts +7 -2
package/package.json
CHANGED
package/upload.ts
CHANGED
|
@@ -170,7 +170,11 @@ async function discoverBrainFiles(stateDir: string): Promise<string[]> {
|
|
|
170
170
|
const sessionsDir = path.join(stateDir, "agents", "main", "sessions");
|
|
171
171
|
if (await exists(sessionsDir)) {
|
|
172
172
|
const allSessionFiles = await fs.readdir(sessionsDir);
|
|
173
|
-
|
|
173
|
+
// Match both active sessions (.jsonl) and soft-deleted ones (.jsonl.deleted.*)
|
|
174
|
+
// OpenClaw renames old sessions instead of deleting them — the data is still valid
|
|
175
|
+
const sessionFiles = (allSessionFiles as string[]).filter((f) =>
|
|
176
|
+
f.endsWith(".jsonl") || f.includes(".jsonl.deleted.")
|
|
177
|
+
);
|
|
174
178
|
files.push(...sessionFiles.map((f) => path.join(sessionsDir, f)));
|
|
175
179
|
}
|
|
176
180
|
|
|
@@ -260,7 +264,8 @@ export async function runUpload(params: {
|
|
|
260
264
|
for (const file of files) {
|
|
261
265
|
const displayName = path.basename(file);
|
|
262
266
|
try {
|
|
263
|
-
const
|
|
267
|
+
const isSession = file.endsWith(".jsonl") || file.includes(".jsonl.deleted.");
|
|
268
|
+
const lines = isSession ? await sessionToJsonl(file) : await fileToJsonl(file);
|
|
264
269
|
if (lines.length === 0) {
|
|
265
270
|
skippedEmpty++;
|
|
266
271
|
continue;
|