@vedtechsolutions/engram-mcp 1.0.14 → 1.0.16
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/dist/hook.js +8 -4
- package/package.json +1 -1
package/dist/hook.js
CHANGED
|
@@ -3250,6 +3250,9 @@ function sanitizeCognitiveState(state) {
|
|
|
3250
3250
|
if (cog.recent_discovery && cog.recent_discovery.startsWith("Pre-compaction")) {
|
|
3251
3251
|
cog.recent_discovery = null;
|
|
3252
3252
|
}
|
|
3253
|
+
if (state.active_task && state.active_task.startsWith("<")) {
|
|
3254
|
+
state.active_task = null;
|
|
3255
|
+
}
|
|
3253
3256
|
if (!state.active_task || state.active_task === "unknown task") {
|
|
3254
3257
|
const editedFiles = state.recent_actions.filter((a) => a.tool === "Edit" || a.tool === "Write").map((a) => a.target.split(/[/\\]/).pop() ?? a.target);
|
|
3255
3258
|
const uniqueFiles = [...new Set(editedFiles)].slice(-5);
|
|
@@ -6298,14 +6301,14 @@ ${distillLines}`
|
|
|
6298
6301
|
}
|
|
6299
6302
|
}
|
|
6300
6303
|
}
|
|
6301
|
-
if (content.length >= 10) {
|
|
6304
|
+
if (content.length >= 10 && !content.startsWith("<")) {
|
|
6302
6305
|
state.recent_prompts.push(truncate(content, 300));
|
|
6303
6306
|
if (state.recent_prompts.length > 8) {
|
|
6304
6307
|
state.recent_prompts = state.recent_prompts.slice(-8);
|
|
6305
6308
|
}
|
|
6306
6309
|
}
|
|
6307
6310
|
try {
|
|
6308
|
-
if (content.length >= 20) {
|
|
6311
|
+
if (content.length >= 20 && !content.startsWith("<")) {
|
|
6309
6312
|
const approach = extractApproachFromPrompt(content);
|
|
6310
6313
|
if (approach) {
|
|
6311
6314
|
const currentLen = state.cognitive_state.current_approach?.length ?? 0;
|
|
@@ -6318,9 +6321,9 @@ ${distillLines}`
|
|
|
6318
6321
|
);
|
|
6319
6322
|
}
|
|
6320
6323
|
}
|
|
6321
|
-
if (content.length >= 30 && content.length <= 500) {
|
|
6324
|
+
if (content.length >= 30 && content.length <= 500 && !content.startsWith("<")) {
|
|
6322
6325
|
const firstSentence = content.split(/[.!?\n]/)[0]?.trim();
|
|
6323
|
-
if (firstSentence && firstSentence.length >= 15 && firstSentence.length <= 200) {
|
|
6326
|
+
if (firstSentence && firstSentence.length >= 15 && firstSentence.length <= 200 && !firstSentence.startsWith("<")) {
|
|
6324
6327
|
state.active_task = firstSentence;
|
|
6325
6328
|
}
|
|
6326
6329
|
}
|
|
@@ -6469,6 +6472,7 @@ ${distillLines}`
|
|
|
6469
6472
|
if (m.memory.tags.includes("pre-compact")) continue;
|
|
6470
6473
|
if (m.memory.tags.includes("session-narrative")) continue;
|
|
6471
6474
|
if (m.memory.tags.includes("milestone") || m.memory.content.startsWith("Session milestone")) continue;
|
|
6475
|
+
if (state.active_project && m.memory.encoding_context?.project && m.memory.encoding_context.project !== state.active_project && (m.memory.type === "episodic" || m.memory.type === "semantic" && m.memory.domains.length > 0)) continue;
|
|
6472
6476
|
const isFailure = m.memory.type === "episodic" && isEpisodicData(m.memory.type_data) && m.memory.type_data.outcome === "negative";
|
|
6473
6477
|
const prefix = m.somatic_marker ? "[ENGRAM GUT]" : isFailure ? "[ENGRAM CAUTION]" : "[ENGRAM CONTEXT]";
|
|
6474
6478
|
const outcomeHint = m.memory.type === "episodic" && (m.somatic_marker || isFailure) ? getEpisodicOutcomeHint(m.memory) : "";
|