ei-tui 1.3.4 → 1.3.5
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
CHANGED
|
@@ -272,15 +272,24 @@ export async function buildResponsePromptData(
|
|
|
272
272
|
const filteredHuman = await filterHumanDataByVisibility(human, persona, queries);
|
|
273
273
|
const visiblePersonas = getVisiblePersonas(sm, persona);
|
|
274
274
|
|
|
275
|
+
const contextWindowMs = persona.context_window_ms ?? human.settings?.default_context_window_ms ?? 28800000;
|
|
276
|
+
const contextBoundaryMs = persona.context_boundary ? new Date(persona.context_boundary).getTime() : 0;
|
|
277
|
+
const windowStartMs = Date.now() - contextWindowMs;
|
|
278
|
+
|
|
275
279
|
const alwaysMessages = sm.messages_getAlways(persona.id);
|
|
276
|
-
const temporalAnchors = alwaysMessages
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
const temporalAnchors = alwaysMessages
|
|
281
|
+
.filter(m => {
|
|
282
|
+
const msgMs = new Date(m.timestamp).getTime();
|
|
283
|
+
return msgMs < windowStartMs || (contextBoundaryMs > 0 && msgMs < contextBoundaryMs);
|
|
284
|
+
})
|
|
285
|
+
.map(m => ({
|
|
286
|
+
id: m.id,
|
|
287
|
+
role: m.role === "human" ? "human" as const : "system" as const,
|
|
288
|
+
content: m.content,
|
|
289
|
+
silence_reason: m.silence_reason,
|
|
290
|
+
timestamp: m.timestamp,
|
|
291
|
+
_synthesis: m._synthesis,
|
|
292
|
+
}));
|
|
284
293
|
|
|
285
294
|
return {
|
|
286
295
|
persona: {
|