mr-memory 2.11.3 → 2.11.4
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 +11 -1
package/package.json
CHANGED
package/upload.ts
CHANGED
|
@@ -123,7 +123,17 @@ async function sessionToJsonl(filePath: string): Promise<MemoryLine[]> {
|
|
|
123
123
|
timestamp = Date.now();
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
const trimmedText = text.trim();
|
|
127
|
+
|
|
128
|
+
// Chunk oversized messages to avoid blowing up the embedding service
|
|
129
|
+
if (trimmedText.length > MAX_ITEM_CHARS) {
|
|
130
|
+
const chunks = chunkText(trimmedText, TARGET_CHUNK_CHARS);
|
|
131
|
+
for (const chunk of chunks) {
|
|
132
|
+
lines.push({ content: chunk, role: msg.role, timestamp });
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
lines.push({ content: trimmedText, role: msg.role, timestamp });
|
|
136
|
+
}
|
|
127
137
|
} catch {
|
|
128
138
|
// Skip invalid lines
|
|
129
139
|
}
|