@vedtechsolutions/engram-mcp 1.0.21 → 1.0.22
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 +12 -1
- package/package.json +1 -1
package/dist/hook.js
CHANGED
|
@@ -3338,6 +3338,17 @@ function sanitizeCognitiveState(state) {
|
|
|
3338
3338
|
state.active_task = `Working on ${uniqueFiles.join(", ")}`;
|
|
3339
3339
|
}
|
|
3340
3340
|
}
|
|
3341
|
+
if (!state.active_task && state.recent_prompts && state.recent_prompts.length > 0) {
|
|
3342
|
+
const taskVerbs = /^(fix|add|create|update|implement|remove|refactor|build|change|move|write|make|set|run|deploy|test|commit|push|install|configure|debug|solve|enable|disable|start|stop|check|verify|analyze|review|audit|optimize|clean|delete|migrate|upgrade|publish|get|do|finish)/i;
|
|
3343
|
+
for (let i = state.recent_prompts.length - 1; i >= 0; i--) {
|
|
3344
|
+
const prompt = state.recent_prompts[i];
|
|
3345
|
+
const first = prompt.split(/[.!?\n]/)[0]?.trim();
|
|
3346
|
+
if (first && first.length >= 15 && first.length <= 200 && taskVerbs.test(first)) {
|
|
3347
|
+
state.active_task = first;
|
|
3348
|
+
break;
|
|
3349
|
+
}
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3341
3352
|
}
|
|
3342
3353
|
if (state.session_files.length > 0) {
|
|
3343
3354
|
state.session_files = state.session_files.filter((f) => {
|
|
@@ -6394,7 +6405,7 @@ ${distillLines}`
|
|
|
6394
6405
|
}
|
|
6395
6406
|
if (content.length >= 30 && content.length <= 500 && !content.startsWith("<")) {
|
|
6396
6407
|
const firstSentence = content.split(/[.!?\n]/)[0]?.trim();
|
|
6397
|
-
const isTaskLike = firstSentence && /^(fix|add|create|update|implement|remove|refactor|build|change|move|write|make|set|run|deploy|test|commit|push|install|configure|debug|solve|close|merge|release)/i.test(firstSentence);
|
|
6408
|
+
const isTaskLike = firstSentence && /^(fix|add|create|update|implement|remove|refactor|build|change|move|write|make|set|run|deploy|test|commit|push|install|configure|debug|solve|close|merge|release|enable|disable|start|stop|check|verify|analyze|review|audit|optimize|clean|delete|migrate|upgrade|publish|get|do|finish)/i.test(firstSentence);
|
|
6398
6409
|
if (isTaskLike && firstSentence.length >= 15 && firstSentence.length <= 200) {
|
|
6399
6410
|
state.active_task = firstSentence;
|
|
6400
6411
|
}
|